:py:mod:`FELiCS.Equation.Reactions.c2sm2` ========================================= .. py:module:: FELiCS.Equation.Reactions.c2sm2 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: FELiCS.Equation.Reactions.c2sm2.C2SM2 .. py:class:: C2SM2(YCH4_lim, P) C2SM2 class representing 2S-CM2 chemical reaction mechanism for a two-step combustion model. This class encapsulates the thermochemical and kinetic properties of a simplified methane combustion mechanism involving key species and two global reactions. **Initialize the C2SM2 object** :param YCH4_lim: The threshold value for the methane mass fraction. :type YCH4_lim: :py:class:`float` :param P: Polynomial degree for finite element approximation. :type P: :py:class:`int` :ivar YCH4_lim: The threshold value for YCH4. :vartype YCH4_lim: :py:class:`float` :ivar P: The order of basis functions used in FEniCS. :vartype P: :py:class:`int` :ivar janaf: Object for evaluating thermochemical properties using JANAF polynomials. :vartype janaf: :py:class:`Janafopenfoam` :ivar N2: Instance representing nitrogen. :vartype N2: :py:class:`Janafspecie` :ivar CO2: Instance representing carbon dioxide. :vartype CO2: :py:class:`Janafspecie` :ivar O2: Instance representing oxygen. :vartype O2: :py:class:`Janafspecie` :ivar CH4: Instance representing methane. :vartype CH4: :py:class:`Janafspecie` :ivar CO: Instance representing carbon monoxide. :vartype CO: :py:class:`Janafspecie` :ivar H2O: Instance representing water vapor. :vartype H2O: :py:class:`Janafspecie` :ivar AR: Instance representing argon. :vartype AR: :py:class:`Janafspecie` :ivar h0r_1: Standard-state enthalpy of reaction 1. :vartype h0r_1: :py:class:`float` :ivar h0r_2: Standard-state enthalpy of reaction 2. :vartype h0r_2: :py:class:`float` :ivar s0r_1: Standard-state entropy of reaction 1. :vartype s0r_1: :py:class:`float` :ivar s0r_2: Standard-state entropy of reaction 2. :vartype s0r_2: :py:class:`float` :ivar A1: Pre-exponential factor for reaction 1. :vartype A1: :py:class:`float` :ivar A2: Pre-exponential factor for reaction 2. :vartype A2: :py:class:`float` :ivar Ta1: Activation temperature for reaction 1. :vartype Ta1: :py:class:`float` :ivar Ta2: Activation temperature for reaction 2. :vartype Ta2: :py:class:`float` :ivar pa: Reference pressure in N/m². :vartype pa: :py:class:`float` :ivar R: Universal gas constant (consistent with JANAF data). :vartype R: :py:class:`float` :ivar R_mol: Molar gas constant (J/mol·K). :vartype R_mol: :py:class:`float` :ivar n_CH4_1: Stoichiometric coefficient of CH4 in reaction 1. :vartype n_CH4_1: :py:class:`float` :ivar n_O2_1: Stoichiometric coefficient of O2 in reaction 1. :vartype n_O2_1: :py:class:`float` :ivar n_CO_1: Stoichiometric coefficient of CO in reaction 1. :vartype n_CO_1: :py:class:`float` :ivar n_H2O_1: Stoichiometric coefficient of H2O in reaction 1. :vartype n_H2O_1: :py:class:`float` :ivar n_CO_2: Stoichiometric coefficient of CO in reaction 2. :vartype n_CO_2: :py:class:`float` :ivar n_O2_2: Stoichiometric coefficient of O2 in reaction 2. :vartype n_O2_2: :py:class:`float` :ivar n_CO2_2: Stoichiometric coefficient of CO2 in reaction 2. :vartype n_CO2_2: :py:class:`float` :ivar nu_CH4_1: Kinetic exponent of CH4 in reaction 1. :vartype nu_CH4_1: :py:class:`float` :ivar nu_O2_1: Kinetic exponent of O2 in reaction 1. :vartype nu_O2_1: :py:class:`float` :ivar nu_CO_1: Kinetic exponent of CO in reaction 1. :vartype nu_CO_1: :py:class:`float` :ivar nu_H2O_1: Kinetic exponent of H2O in reaction 1. :vartype nu_H2O_1: :py:class:`float` :ivar nu_CO_2: Kinetic exponent of CO in reaction 2. :vartype nu_CO_2: :py:class:`float` :ivar nu_O2_2: Kinetic exponent of O2 in reaction 2. :vartype nu_O2_2: :py:class:`float` :ivar nu_CO2_2: Kinetic exponent of CO2 in reaction 2. :vartype nu_CO2_2: :py:class:`float` :ivar Q1dT: Sensitivity of reaction 1 rate with respect to temperature. :vartype Q1dT: :py:class:`float` or :py:class:`Expression` :ivar Q1drho: Sensitivity of reaction 1 rate with respect to density. :vartype Q1drho: :py:class:`float` or :py:class:`Expression` :ivar Q1dYCH4: Sensitivity of reaction 1 rate with respect to CH4 mass fraction. :vartype Q1dYCH4: :py:class:`float` or :py:class:`Expression` :ivar Q1dYO2: Sensitivity of reaction 1 rate with respect to O2 mass fraction. :vartype Q1dYO2: :py:class:`float` or :py:class:`Expression` :ivar Q2dT: Sensitivity of reaction 2 rate with respect to temperature. :vartype Q2dT: :py:class:`float` or :py:class:`Expression` :ivar Q2drho: Sensitivity of reaction 2 rate with respect to density. :vartype Q2drho: :py:class:`float` or :py:class:`Expression` :ivar Q2dYCO: Sensitivity of reaction 2 rate with respect to CO mass fraction. :vartype Q2dYCO: :py:class:`float` or :py:class:`Expression` :ivar Q2dYO2: Sensitivity of reaction 2 rate with respect to O2 mass fraction. :vartype Q2dYO2: :py:class:`float` or :py:class:`Expression` :ivar Q2dYCO2: Sensitivity of reaction 2 rate with respect to CO2 mass fraction. :vartype Q2dYCO2: :py:class:`float` or :py:class:`Expression` .. py:method:: computeSensitivities(T, rho, Y_CH4, Y_CO, Y_O2, Y_CO2) Compute all the sensitivities of the progress rates and store them. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Returns True when sensitivities are computed. :rtype: :py:class:`bool` .. py:method:: deltaGT02_(T) Compute the standard-state Gibbs function change for reversible reaction 2. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the Gibbs function change. :rtype: :py:class:`Expression` .. py:method:: Kf1_(T) Compute the forward rate of reaction 1. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the forward rate of reaction 1. :rtype: :py:class:`Expression` .. py:method:: Kf2_(T) Compute the forward rate of reaction 2. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the forward rate of reaction 2. :rtype: :py:class:`Expression` .. py:method:: Kp2_(T) Compute the equilibrium constant for reaction 2. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the equilibrium constant for reaction 2. :rtype: :py:class:`Expression` .. py:method:: Kc2_(T) Compute the concentration equilibrium constant for reaction 2. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the concentration equilibrium constant for reaction 2. :rtype: :py:class:`Expression` .. py:method:: Kr2_(T) Compute the reverse rate of reaction 2. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the reverse rate of reaction 2. :rtype: :py:class:`Expression` .. py:method:: Q1_(T, rho, Y_CH4, Y_O2) Compute the rate of progress of reaction 1. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the rate of progress of reaction 1. :rtype: :py:class:`Expression` .. py:method:: Q2f_(T, rho, Y_CO, Y_O2) Compute the forward rate of progress of reaction 2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the forward rate of progress of reaction 2. :rtype: :py:class:`Expression` .. py:method:: Q2r_(T, rho, Y_CO2) Compute the reverse rate of progress of reaction 2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the reverse rate of progress of reaction 2. :rtype: :py:class:`Expression` .. py:method:: Q2_(T, rho, Y_CO, Y_O2, Y_CO2) Compute the rate of progress of reaction 2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the rate of progress of reaction 2. :rtype: :py:class:`Expression` .. py:method:: Q_(T, rho, Y_CH4, Y_CO, Y_O2, Y_CO2) Compute the heat-release rate of both reactions combined. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the combined heat-release rate. :rtype: :py:class:`Expression` .. py:method:: Q(T, rho, Y_CH4, Y_CO, Y_O2, Y_CO2) Return the heat release rate as a Function. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Projected heat release rate function. :rtype: :py:class:`Function` .. py:method:: dQ(fluc) Return the fluctuations in heat release. :param fluc: Object containing fluctuation data for temperature, density, and species mass fractions. :type fluc: :py:class:`object` :returns: A tuple containing the total fluctuation in heat release and a list of individual fluctuations. :rtype: :py:class:`tuple` .. py:method:: rrCH4_(T, rho, Y_CH4, Y_O2) Compute the reaction rate of CH4. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the reaction rate of CH4. :rtype: :py:class:`Expression` .. py:method:: rrH2O_(T, rho, Y_CH4, Y_O2) Compute the reaction rate of H2O. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the reaction rate of H2O. :rtype: :py:class:`Expression` .. py:method:: rrO2_(T, rho, Y_CH4, Y_CO, Y_O2, Y_CO2) Compute the reaction rate of O2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the reaction rate of O2. :rtype: :py:class:`Expression` .. py:method:: rrCO_(T, rho, Y_CH4, Y_CO, Y_O2, Y_CO2) Compute the reaction rate of CO. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the reaction rate of CO. :rtype: :py:class:`Expression` .. py:method:: rrCO2_(T, rho, Y_CO, Y_O2, Y_CO2) Compute the reaction rate of CO2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the reaction rate of CO2. :rtype: :py:class:`Expression` .. py:method:: sO2dT_(T) Compute the sensitivity of entropy of O2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of entropy of O2. :rtype: :py:class:`Expression` .. py:method:: sCOdT_(T) Compute the sensitivity of entropy of CO with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of entropy of CO. :rtype: :py:class:`Expression` .. py:method:: sCO2dT_(T) Compute the sensitivity of entropy of CO2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of entropy of CO2. :rtype: :py:class:`Expression` .. py:method:: Kf1dT_(T) Compute the sensitivity of Kf1 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of Kf1. :rtype: :py:class:`Expression` .. py:method:: Kp2dT_(T) Compute the sensitivity of Kp2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of Kp2. :rtype: :py:class:`Expression` .. py:method:: Kc2dT_(T) Compute the sensitivity of Kc2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of Kc2. :rtype: :py:class:`Expression` .. py:method:: Kf2dT_(T) Compute the sensitivity of Kf2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of Kf2. :rtype: :py:class:`Expression` .. py:method:: Kr2dT_(T) Compute the sensitivity of Kr2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :returns: Expression for the sensitivity of Kr2. :rtype: :py:class:`Expression` .. py:method:: Q1dT_(T, rho, Y_CH4, Y_O2) Compute the sensitivity of Q1 with respect to T. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q1. :rtype: :py:class:`Expression` .. py:method:: Q1drho_(T, rho, Y_CH4, Y_O2) Compute the sensitivity of Q1 with respect to rho. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q1. :rtype: :py:class:`Expression` .. py:method:: Q1dYCH4_(T, rho, Y_CH4, Y_O2) Compute the sensitivity of Q1 with respect to Y_CH4. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q1. :rtype: :py:class:`Expression` .. py:method:: Q1dYO2_(T, rho, Y_CH4, Y_O2) Compute the sensitivity of Q1 with respect to Y_O2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q1. :rtype: :py:class:`Expression` .. py:method:: Q2dT_(T, rho, Y_CO, Y_O2, Y_CO2) Compute the sensitivity of Q2 with respect to T. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the sensitivity of Q2. :rtype: :py:class:`Expression` .. py:method:: Q2drho_(T, rho, Y_CO, Y_O2, Y_CO2) Compute the sensitivity of Q2 with respect to rho. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the sensitivity of Q2. :rtype: :py:class:`Expression` .. py:method:: Q2dYCO_(T, rho, Y_O2) Compute the sensitivity of Q2 with respect to Y_CO. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q2. :rtype: :py:class:`Expression` .. py:method:: Q2dYO2_(T, rho, Y_CO, Y_O2) Compute the sensitivity of Q2 with respect to Y_O2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :returns: Expression for the sensitivity of Q2. :rtype: :py:class:`Expression` .. py:method:: Q2dYCO2_(T, rho) Compute the sensitivity of Q2 with respect to Y_CO2. :param T: Temperature. :type T: :py:class:`float` :param rho: Density. :type rho: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :returns: Expression for the sensitivity of Q2. :rtype: :py:class:`Expression` .. py:method:: Wmix(Y_CH4, Y_CO, Y_O2, Y_CO2, Y_H2O) Compute the molecular weight of the mixture. :param Y_CH4: Mass fraction of CH4. :type Y_CH4: :py:class:`float` :param Y_CO: Mass fraction of CO. :type Y_CO: :py:class:`float` :param Y_O2: Mass fraction of O2. :type Y_O2: :py:class:`float` :param Y_CO2: Mass fraction of CO2. :type Y_CO2: :py:class:`float` :param Y_H2O: Mass fraction of H2O. :type Y_H2O: :py:class:`float` :returns: Molecular weight of the mixture. :rtype: :py:class:`float` .. py:method:: add_source_to_weak_form(weakform, dQ_threshold=None) Add reaction source terms to the weak form equations. This method adds contributions from reaction source terms to the energy and species equations within a variational formulation. If a heat release threshold is specified, the source terms are only added where the mean heat release exceeds that threshold. :param weakform: The weak form object containing relevant fields and test functions for the formulation. :type weakform: :py:class:`object` :param dQ_threshold: Minimum mean heat release rate required for the reaction source term to be applied. :type dQ_threshold: :py:class:`float`, *optional* :returns: **eq_stiffness** -- The updated weak form including the added reaction source terms. :rtype: :py:class:`object`