libICEpost.src.thermophysicalModels.specie.reactions.Reaction ============================================================= .. py:module:: libICEpost.src.thermophysicalModels.specie.reactions.Reaction .. autoapi-nested-parse:: @author: F. Ramognino Last update: 01/02/2024 Classes and packages for handling reactions in gaseous mixtures Content of the package: Reaction (class) Defines classes to model reactions StoichiometricReaction (class) Class handling chemical reactions (transformation of reactants into products) through balancing of stoichiometry. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/Reaction/Reaction/index /autoapi/libICEpost/src/thermophysicalModels/specie/reactions/Reaction/StoichiometricReaction/index Classes ------- .. autoapisummary:: libICEpost.src.thermophysicalModels.specie.reactions.Reaction.Reaction libICEpost.src.thermophysicalModels.specie.reactions.Reaction.StoichiometricReaction Package Contents ---------------- .. py:class:: Reaction(reactants: Iterable[libICEpost.src.thermophysicalModels.specie.specie.Molecule.Molecule], products: Iterable[libICEpost.src.thermophysicalModels.specie.specie.Molecule.Molecule], name: str = '') Bases: :py:obj:`libICEpost.src.base.BaseClass.BaseClass` Base class for handling chemical reactions (transformation of reactants into products). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. attribute:: reactants Mixture The reactants .. attribute:: products Mixture The products .. py:attribute:: name :type: str Name of the reaction .. py:property:: reactants .. py:property:: products .. py:property:: moleRatio The ratio of number of moles between products and reactants .. py:attribute:: _reactants .. py:attribute:: _products .. py:method:: __repr__() .. py:method:: checkAtomicSpecie() Checks that the atomic composition of the specie are consistent .. py:method:: update(mix: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None) Method to update the composition of reactants and products (interface). .. py:method:: _update(mix: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None) :abstractmethod: Method to update the composition of reactants and products (implementation). .. py:method:: releasedEnergy() -> float Compute the released energy from the reaction per unit mass. :returns: [J/kg] :rtype: float .. py:class:: StoichiometricReaction(reactants: Iterable[libICEpost.src.thermophysicalModels.specie.specie.Mixture.Molecule], products: Iterable[libICEpost.src.thermophysicalModels.specie.specie.Mixture.Molecule], name: str = '') Bases: :py:obj:`libICEpost.src.thermophysicalModels.specie.reactions.Reaction.Reaction.Reaction` Class handling chemical reactions (transformation of reactants into products) through balancing of stoichiometry. Reaction happens infinitely fast with instantaneous conversion of reactants into products. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. attribute:: reactants Mixture The reactants .. attribute:: products Mixture The products .. py:method:: fromDictionary(dictionary) :classmethod: Create from dictionary. { "reactants": list The molecules in the reactants "products": list The molecules in the products } .. py:method:: fromFuelOxidation(fuel: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Molecule, oxidizer: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Molecule = database.chemistry.specie.Molecules.O2) :classmethod: Create oxidation reactions for a fuel. Can handle oxidizers with H, N, O :param fuel: The fuel molecule. :type fuel: Molecule .. py:method:: fromOxidizerReduction(oxidizer: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Molecule) :classmethod: Create a reduction reaction of an oxidizer that is not in pure form (example NO2) :param oxidizer: The oxidizer molecule. :type oxidizer: Molecule .. py:method:: __str__() Print the formula of the reaction (coefficient in mole fractions): reactants => products .. py:method:: _update(mix: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None) mix: Mixture (None) The new mixture of reactants (if needs to be changed) Computes the composition of reactants and products through mass balance of each atomic specie. If system is not solvable, raises ValueError. If there are molecules that remain inhert across the reaction raises a ValueError.