The ``mixture.py`` module ========================= .. py:module:: ansys.chemkin.core.mixture Summary ------- .. py:currentmodule:: mixture .. tab-set:: .. tab-item:: Classes .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~ansys.chemkin.core.mixture.Mixture` - define a mixture based on the gas species in the given chemistry set. .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~verify_mixture` - Verify the Mixture is valid and active. * - :py:obj:`~isothermal_mixing` - Mixing multiple gas mixtures at gioven temperature. * - :py:obj:`~adiabatic_mixing` - Mixing multiple gas mixtures adiabatically. * - :py:obj:`~cal_mixture_temperature_from_enthalpy` - Compute the mixture temperature from the given mixture enthalpy. * - :py:obj:`~create_mixture_recipe_from_fractions` - Build a PyChemkin mixture recipe/formula from a species fraction array. * - :py:obj:`~calculate_stoichiometrics` - Calculate the stoichiometric coefficients. * - :py:obj:`~species_diffusion_velocity` - Compute species diffusive velocities between two gas mixtures. * - :py:obj:`~mixing_by_exchange_with_the_mean` - Mix two mixtures of the same mass using the IEM model. * - :py:obj:`~calculate_mass_weighted_mean_mixture` - Calculate the mass-weighted mean mixture from a list of mixtures. * - :py:obj:`~interpolate_mixtures` - Get Mixture by interpolation. * - :py:obj:`~compare_mixtures` - Compare properties of mixture B against those of mixture A. * - :py:obj:`~calculate_equilibrium` - Get the equilibrium mixture composition. * - :py:obj:`~equilibrium` - Find the equilibrium state mixture corresponding to the given mixture. * - :py:obj:`~detonation` - Find the Chapman-Jouguet state mixture and detonation wave speed. .. toctree:: :titlesonly: :maxdepth: 1 :hidden: Mixture Description ----------- Chemkin Mixture utilities. Module detail ------------- .. py:function:: verify_mixture(this_mixture: Mixture) -> bool Verify the Mixture is valid and active. .. py:function:: isothermal_mixing(recipe: list[tuple[Mixture, float]], mode: str, finaltemperature: float) -> Mixture Mixing multiple gas mixtures at gioven temperature. .. py:function:: adiabatic_mixing(recipe: list[tuple[Mixture, float]], mode: str) -> Mixture Mixing multiple gas mixtures adiabatically. .. py:function:: cal_mixture_temperature_from_enthalpy(mixture: Mixture, h_mixture: float, guesstemperature: float = 0.0) -> int Compute the mixture temperature from the given mixture enthalpy. .. py:function:: create_mixture_recipe_from_fractions(chemistry_set: ansys.chemkin.core.chemistry.Chemistry, frac: numpy.typing.NDArray[numpy.double]) -> tuple[int, list[tuple[str, float]]] Build a PyChemkin mixture recipe/formula from a species fraction array. .. py:function:: calculate_stoichiometrics(chemistryset: ansys.chemkin.core.chemistry.Chemistry, fuel_molefrac: numpy.typing.NDArray[numpy.double], oxid_molefrac: numpy.typing.NDArray[numpy.double], prod_index: numpy.typing.NDArray[numpy.int32]) -> tuple[float, numpy.typing.NDArray[numpy.double]] Calculate the stoichiometric coefficients. .. py:function:: species_diffusion_velocity(mixture_a: Mixture, mixture_b: Mixture, mode: str = 'mix', tdiff: bool = True) -> numpy.typing.NDArray[numpy.double] Compute species diffusive velocities between two gas mixtures. .. py:function:: mixing_by_exchange_with_the_mean(mixture_a: Mixture, mixture_b: Mixture, mix_time: float, mix_param: float, tau: float) -> tuple[Mixture, Mixture] Mix two mixtures of the same mass using the IEM model. .. py:function:: calculate_mass_weighted_mean_mixture(mixtures: list[Mixture], masses: Union[list[float], None] = None) -> Mixture Calculate the mass-weighted mean mixture from a list of mixtures. .. py:function:: interpolate_mixtures(mixtureleft: Mixture, mixtureright: Mixture, ratio: float) -> Mixture Get Mixture by interpolation. .. py:function:: compare_mixtures(mixture_a: Mixture, mixture_b: Mixture, atol: float = 1e-10, rtol: float = 0.001, mode: str = 'mass') -> tuple[bool, float, float] Compare properties of mixture B against those of mixture A. .. py:function:: calculate_equilibrium(chemid: int, p: float, t: float, frac: numpy.typing.NDArray[numpy.double], wt: numpy.typing.NDArray[numpy.double], mode_in: str, mode_out: str, eq_option: int = 1, use_realgas: int = 0) -> tuple[list[float], numpy.typing.NDArray[numpy.double]] Get the equilibrium mixture composition. .. py:function:: equilibrium(mixture: Mixture, opt: int = 1) -> Mixture Find the equilibrium state mixture corresponding to the given mixture. .. py:function:: detonation(mixture: Mixture) -> tuple[list[float], Mixture] Find the Chapman-Jouguet state mixture and detonation wave speed.