:py:mod:`FELiCS.Equation.Reactions.GlobalReaction` ================================================== .. py:module:: FELiCS.Equation.Reactions.GlobalReaction Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: FELiCS.Equation.Reactions.GlobalReaction.GlobalReaction .. py:class:: GlobalReaction(reaction_mechanism) Represents a global one-step chemical reaction mechanism. This class encapsulates the parameters and methods required to model a global reaction, including reading reaction data, computing mean fields, and handling heat release. **Initialize the GlobalReaction object** :param reaction_mechanism: Dictionary containing reaction mechanism parameters. :type reaction_mechanism: :py:class:`dict` :ivar mixtureDirectory: Directory name for mixture data. :vartype mixtureDirectory: :py:class:`str` :ivar speciesDirectory: Directory name for species data. :vartype speciesDirectory: :py:class:`str` :ivar A: Pre-exponential factor for the reaction. :vartype A: :py:class:`float` or :py:obj:`None` :ivar Ta: Activation temperature. :vartype Ta: :py:class:`float` or :py:obj:`None` :ivar a: Stoichiometric coefficient for oxygen. :vartype a: :py:class:`float` or :py:obj:`None` :ivar b: Stoichiometric coefficient for carbon. :vartype b: :py:class:`float` or :py:obj:`None` :ivar beta: Temperature exponent. :vartype beta: :py:class:`float` or :py:obj:`None` :ivar h0: Heat of reaction. :vartype h0: :py:class:`float` or :py:obj:`None` :ivar st_C: Stoichiometric coefficient for carbon species. :vartype st_C: :py:class:`float` or :py:obj:`None` :ivar st_O: Stoichiometric coefficient for oxygen species. :vartype st_O: :py:class:`float` or :py:obj:`None` :ivar WO: Molecular weight of oxygen. :vartype WO: :py:class:`float` or :py:obj:`None` :ivar WC: Molecular weight of carbon. :vartype WC: :py:class:`float` or :py:obj:`None` :ivar reactionName: Name of the reaction. :vartype reactionName: :py:class:`str` :ivar Q: Mean field reaction rate. :vartype Q: :py:class:`dolfinx.fem.Function` or :py:obj:`None` :ivar i_rho: Index of density in solution list. :vartype i_rho: :py:class:`int` or :py:obj:`None` :ivar i_C: Index of CH4 in solution list. :vartype i_C: :py:class:`int` or :py:obj:`None` .. py:method:: ReadReactionDict(reaction) Reads reaction parameters from a dictionary and updates class attributes. :param reaction: Dictionary containing reaction parameters. :type reaction: :py:class:`dict` .. admonition:: Notes This method sets the reaction coefficients and molecular weights based on the provided reaction dictionary. .. py:method:: computeMeanField(mean, ele) Computes the mean field reaction rate and interpolates it as a function. :param mean: Object containing mean flow properties (e.g., temperature, density, species mass fractions). :type mean: :py:class:`object` :param ele: Function space for interpolation. :type ele: :py:class:`dolfinx.fem.FunctionSpace` :returns: **Q** -- Interpolated mean field reaction rate. :rtype: :py:class:`dolfinx.fem.Function` .. admonition:: Notes Uses the reaction parameters and mean flow properties to construct the reaction rate expression. .. py:method:: addReaction(mean, testf, fluc, solutionList) Adds the reaction term to the weak form. :param mean: Object containing mean flow properties. :type mean: :py:class:`object` :param testf: List of test functions. :type testf: :py:class:`list` :param fluc: Object containing fluctuation properties. :type fluc: :py:class:`object` :param solutionList: List of solution variable names. :type solutionList: :py:class:`list` of :py:class:`str` :returns: **reaction_term** -- Weak form expression for the reaction term. :rtype: :py:class:`ufl.Form` .. admonition:: Notes The method computes the indices for relevant variables and constructs the weak form using the reaction rate and heat release. .. py:method:: dQ_(mean, fluc) Computes the fluctuation of the reaction rate. :param mean: Object containing mean flow properties. :type mean: :py:class:`object` :param fluc: Object containing fluctuation properties. :type fluc: :py:class:`object` :returns: **dQ** -- Fluctuation of the reaction rate. :rtype: :py:class:`float` .. admonition:: Notes The calculation uses stoichiometric coefficients and mean/fluctuation values for temperature and species. .. py:method:: postHeatRelease(mean, prho, pCH4, ele) Computes the post-processed heat release form. :param mean: Object containing mean flow properties. :type mean: :py:class:`object` :param prho: Perturbation in density. :type prho: :py:class:`float` :param pCH4: Perturbation in CH4 mass fraction. :type pCH4: :py:class:`float` :param ele: Function space for interpolation. :type ele: :py:class:`dolfinx.fem.FunctionSpace` .. admonition:: Notes The `ele` parameter is included for compatibility with the original method signature; however, it is not used in this mehtod. :returns: **heat_release_field** -- Interpolated post-processed heat release form. :rtype: :py:class:`dolfinx.fem.Function` .. py:method:: postdQ(mean, prho, pCH4) Computes the post-processed fluctuation of the reaction rate. :param mean: Object containing mean flow properties. :type mean: :py:class:`object` :param prho: Perturbation in density. :type prho: :py:class:`float` :param pCH4: Perturbation in CH4 mass fraction. :type pCH4: :py:class:`float` :returns: **dQ** -- Post-processed fluctuation of the reaction rate. :rtype: :py:class:`float`