libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel ================================================================== .. py:module:: libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel .. autoapi-nested-parse:: @author: F. Ramognino Last update: 01/02/2024 Defines classes to handel reaction of mixtures involving multiple simple reactions Content of the package: ReactionModel (module) Base class Stoichiometry (module) Combustion with infinitely fast combustion through balancing of stoichiometry Equilibrium (module) Computation of combustion products based on equilibrium Inhert (module) Non-reacting mixture DissociationModel (module) Defines classes to handel dissociation of specie in a mixture. Used in the Stoichiometry reaction model to impose dissociation of molecules. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/ReactionModel/DissociationModel/index /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/ReactionModel/Equilibrium/index /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/ReactionModel/Inhert/index /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/ReactionModel/ReactionModel/index /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/ReactionModel/Stoichiometry/index Classes ------- .. autoapisummary:: libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Stoichiometry libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Equilibrium libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Inhert Package Contents ---------------- .. py:class:: ReactionModel(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) Bases: :py:obj:`libICEpost.src.base.BaseClass.BaseClass` Defines classes to handel reaction of mixtures involving multiple simple reactions .. attribute:: reactants The mixture of the reactants :type: Mixture .. attribute:: products The mixture of products of the reaction :type: Mixture .. attribute:: reactions Database of oxidation reactions. Reference to database.chemistry.reactions[ReactionType] :type: _Database .. py:attribute:: _ReactionType :type: str The type for reactions to lookup for in the database .. py:attribute:: _reactants :type: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture The mixture of reactants .. py:attribute:: _products :type: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture The mixture of products .. py:attribute:: _state :type: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState | None The last thermodynamic state used to update the reaction model .. py:property:: reactants :type: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture The mixture of reactants .. py:property:: products The mixture of products .. py:property:: reactions The database with the avaliabe reactions .. py:property:: ReactionType Name of the reactions used .. py:property:: state The last thermodynamic state used to update the reaction model .. py:attribute:: _reactions .. py:method:: update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) -> bool Method to update the reactants data based on the mixture composition (interface). :param reactants: Mixture of reactants if to be changed. Defaults to None. :type reactants: Mixture, optional :param state: Thermodynamic state to update the reaction model. :type state: ThermoState, optional :returns: if something changed :rtype: bool .. py:method:: _update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) -> bool :abstractmethod: Method to update the reactants based on the mixture composition (implementation). :param reactants: Mixture of reactants if to be changed. Defaults to None. :type reactants: Mixture, optional :param state: Thermodynamic state to update the reaction model. :type state: ThermoState :returns: if something changed :rtype: bool .. py:class:: Stoichiometry(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, *, oxidizer: libICEpost.src.thermophysicalModels.specie.specie.Molecule.Molecule = database.chemistry.specie.Molecules.O2, dissociationModels: Iterable[libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.DissociationModel.DissociationModel.DissociationModel] = None) Bases: :py:obj:`libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel` Reaction model of fuel combustion with infinitely fast chemistry TODO: Extend to handle a generic reaction set, where there might be more then one oxidizer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. attribute:: oxidiser Molecule The oxidiser .. attribute:: reactants (Mixture) The mixture of the reactants .. attribute:: products (Mixture) The mixture of products of the reaction .. attribute:: reactions (_Database) Database of oxidation reactions. Reference to database.chemistry.reactions .. py:attribute:: _ReactionType :type: str :value: 'StoichiometricReaction' The type for reactions to lookup for in the database .. py:attribute:: _productsPreDissociation :type: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture The combustion products before applying the dissociation models .. py:attribute:: dissociationModels :type: list[libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.DissociationModel.DissociationModel.DissociationModel] A list of the dissociation models to apply .. py:property:: fuel The sub-mixture of reactants with the fuels .. py:property:: oxidizer The oxidizer .. py:method:: fromDictionary(dictionary) :classmethod: Construct from dictionary. :param dictionary: The dictionary from which constructing, containing: reactants (Mixture): the mixture of reactants oxidiser (Molecule): the oxidizer dissociationModels (dict[str:dict]): Construction dictionaries for dissociation models in the form: { : construction dictionary for the specific model ... } :type dictionary: dict .. py:attribute:: _oxidizer .. py:method:: _updateFuels() Update list of fuels .. py:method:: _update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) -> bool Method to update the products. :param reactants: Update mixture of reactants. Defaults to None. :type reactants: Mixture, optional :param state: Thermodynamic state to update the reaction model. (NOT USED) :type state: ThermoState, optional :returns: if something changed :rtype: bool .. py:class:: Equilibrium(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, mechanism: str, *, method: Literal['average', 'adiabatiFlame', 'burntGas'], state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState) Bases: :py:obj:`libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel` Reaction model based on computation of chemical equilibrium which CANTERA. .. attribute:: oxidiser The oxidiser :type: Molecule .. attribute:: reactants The mixture of the reactants :type: Mixture .. attribute:: products The mixture of products of the reaction :type: Mixture .. attribute:: specie The molecules to consider in the equilibrium :type: list[Molecule] .. attribute:: mechanism The path where the mechanism in yaml is stored :type: str .. py:attribute:: _ReactionType :type: str :value: None The type for reactions to lookup for in the database .. py:attribute:: _reactor :type: cantera.Solution The ractor used to compute equilibrium in CANTERA .. py:attribute:: _mechamism :type: str The path of the mechanism .. py:method:: fromDictionary(dictionary: dict) :classmethod: Constructs from dictionary :param dictionary: The dictionary from which constructing: reactants (Mixture): the mixture of reactants mechanism (str): The path where is stored the chemical mechanism to use (yaml) :type dictionary: dict .. py:property:: mechanism :type: str The path where the mechanism is stored. .. py:property:: method The method used to compute the equilibrium. .. py:attribute:: _mechanism .. py:attribute:: _method .. py:method:: _update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState) -> bool Method to update the products. :param reactants: Update mixture of reactants. Defaults to None. :type reactants: Mixture, optional :param state: Thermodynamic state to update the reaction model. :type state: ThermoState :returns: wether the system was updated :rtype: bool .. py:class:: Inhert(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture) Bases: :py:obj:`libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel` Inhert mixture (no reactions) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. attribute:: reactants (Mixture) The mixture of the reactants .. attribute:: products (Mixture) The mixture of products of the reaction .. py:attribute:: _ReactionType :type: str :value: None The type for reactions to lookup for in the database .. py:method:: fromDictionary(dictionary) :classmethod: Constuct from dictionary. :param dictionary: The dictionary from which constructing, containing: reactants (Mixture): the mixture of reactants :type dictionary: dict .. py:attribute:: _products The mixture of products .. py:method:: _update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) -> bool Method to update the products. :param reactants: Update mixture of reactants. Defaults to None. :type reactants: Mixture, optional :param state: Thermodynamic state to update the reaction model. (NOT USED) :type state: ThermoState, optional :returns: if something changed :rtype: bool