FELiCS.Equation.Reactions.TwoStepReaction#
Module Contents#
Classes#
Represents a two-step methane-air combustion reaction mechanism. |
- class FELiCS.Equation.Reactions.TwoStepReaction.TwoStepReaction(ModelName)#
Represents a two-step methane-air combustion reaction mechanism.
This class models two-step chemical reactions, adapted for BFER or 2S_CH4_CM2 models, and provides methods for reading reaction data, computing mean fields, and evaluating reaction rates. See CERFACS for model reference https://www.cerfacs.fr/cantera/mechanisms/meth.php
Initialize the TwoStepReaction object
- Parameters:
ModelName (
str) – Name of the reaction model to use.- Variables:
mixtureDirectory (
str) – Directory name for mixture data.speciesDirectory (
str) – Directory name for species data.p0 (
float) – Reference pressure.R (
float) – Universal gas constant.n_CH4_1 (
floatorNone) – Stoichiometric prefactor for CH4 in reaction 1.n_O2_1 (
floatorNone) – Stoichiometric prefactor for O2 in reaction 1.n_CO_1 (
floatorNone) – Stoichiometric prefactor for CO in reaction 1.n_CO_2 (
floatorNone) – Stoichiometric prefactor for CO in reaction 2.n_O2_2 (
floatorNone) – Stoichiometric prefactor for O2 in reaction 2.n_CO2_2 (
floatorNone) – Stoichiometric prefactor for CO2 in reaction 2.nu_CH4_1 (
floatorNone) – Kinematic exponent for CH4 in reaction 1.nu_O2_1 (
floatorNone) – Kinematic exponent for O2 in reaction 1.nu_CO_2 (
floatorNone) – Kinematic exponent for CO in reaction 2.nu_O2_2 (
floatorNone) – Kinematic exponent for O2 in reaction 2.nu_CO2_2 (
floatorNone) – Kinematic exponent for CO2 in reaction 2.A1 (
floatorNone) – Pre-exponential factor for reaction 1.Ta1 (
floatorNone) – Activation temperature for reaction 1.beta1 (
floatorNone) – Temperature exponent for reaction 1.h1 (
floatorNone) – Heat of reaction for reaction 1.A2 (
floatorNone) – Pre-exponential factor for reaction 2.Ta2 (
floatorNone) – Activation temperature for reaction 2.beta2 (
floatorNone) – Temperature exponent for reaction 2.h2 (
floatorNone) – Heat of reaction for reaction 2.WO2 (
floatorNone) – Molar mass of O2.WH2O (
floatorNone) – Molar mass of H2O.WCH4 (
floatorNone) – Molar mass of CH4.WCO (
floatorNone) – Molar mass of CO.WCO2 (
floatorNone) – Molar mass of CO2.WN2 (
floatorNone) – Molar mass of N2.Q1 (
objectorNone) – Reaction progress rate for reaction 1.Q2f (
objectorNone) – Forward reaction progress rate for reaction 2.Q2r (
objectorNone) – Reverse reaction progress rate for reaction 2.Q2 (
objectorNone) – Total reaction progress rate for reaction 2.K2f (
objectorNone) – Forward reaction rate constant for reaction 2.K2r (
objectorNone) – Reverse reaction rate constant for reaction 2.lnexpInEqui_h (
objectorNone) – Linearized enthalpy term for equilibrium constant in reaction 2.expInEqui (
objectorNone) – Exponential term for equilibrium constant in reaction 2.Equi (
objectorNone) – Equilibrium constant for reaction 2.i_rho (
intorNone) – Index for density in solution variables.i_CH4 (
intorNone) – Index for CH4 in solution variables.i_O2 (
intorNone) – Index for O2 in solution variables.i_CO2 (
intorNone) – Index for CO2 in solution variables.i_CO (
intorNone) – Index for CO in solution variables.T (
objectorNone) – Temperature field.Y_CH4_limited (
objectorNone) – Limited CH4 mass fraction.epsilon (
float) – Correction for base flow CH4.reactionName (
str) – Name of the reaction.
- ReadReactionDict(ModelName)#
Reads reaction parameters and species data from files and updates class attributes.
- Parameters:
ModelName (
str) – Name of the reaction model to use.
Notes
This method sets stoichiometric prefactors, kinematic exponents, reaction constants, and molar masses based on the provided model name.
- computeMeanField(MF, ele)#
Computes the mean field reaction rates and equilibrium constants.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
- Returns:
Q1 (
object) – Mean field for reaction 1.Q2f (
object) – Forward mean field for reaction 2.Q2r (
object) – Reverse mean field for reaction 2.
Notes
This method also computes equilibrium constants and related fields for reaction 2.
- addReaction(MF, testf, trialf, solutionList, ele)#
Adds the reaction terms to the weak form for both reaction steps.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.testf (
list) – List of test functions.trialf (
dict) – Dictionary of trial functions.solutionList (
listofstr) – List of solution variable names.ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
- Returns:
reaction_term – Weak form expression representing the reaction contributions.
- Return type:
ufl.Form
Notes
The method computes the indices for relevant variables and constructs the weak form using the reaction rates and heat release for both steps.
- dQ1_(MF, trialf)#
Computes the fluctuation of the reaction rate for the first reaction step.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.trialf (
dict) – Dictionary of trial functions.
- Returns:
dQ1 – Fluctuation of the reaction rate for reaction 1.
- Return type:
float
- dQ2f_(MF, trialf)#
Computes the fluctuation of the forward reaction rate for the second reaction step.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.trialf (
dict) – Dictionary of trial functions.
- Returns:
dQ2f – Fluctuation of the forward reaction rate for reaction 2.
- Return type:
float
- dQ2r_(MF, trialf)#
Computes the fluctuation of the reverse reaction rate for the second reaction step.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.trialf (
dict) – Dictionary of trial functions.
- Returns:
dQ2r – Fluctuation of the reverse reaction rate for reaction 2.
- Return type:
float
- dK2fdT_(T)#
Computes the temperature derivative of the forward reaction rate constant for reaction 2.
- Parameters:
T (
object) – Temperature field.- Returns:
dK2fdT – Expression for the temperature derivative of the forward rate constant.
- Return type:
object
- dK2rdT_(T)#
Computes the temperature derivative of the reverse reaction rate constant for reaction 2.
- Parameters:
T (
object) – Temperature field.- Returns:
dK2rdT – Expression for the temperature derivative of the reverse rate constant.
- Return type:
object
- dEquidT_(T)#
Computes the temperature derivative of the equilibrium constant for reaction 2.
- Parameters:
T (
object) – Temperature field.- Returns:
dEquidT – Expression for the temperature derivative of the equilibrium constant.
- Return type:
object
- dexpInEquidT_(T)#
Computes the temperature derivative of the exponential part of the equilibrium constant for reaction 2.
- Parameters:
T (
object) – Temperature field.- Returns:
dexpInEquidT – Expression for the temperature derivative of the exponential part of the equilibrium constant.
- Return type:
object
- postHeatRelaese(MF, prho, pCH4, pO2, pCO, pCO2, ele)#
Evaluates the fluctuation of heat release in post-processing.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.prho (
float) – Perturbation in density.pCH4 (
float) – Perturbation in CH4 mass fraction.pO2 (
float) – Perturbation in O2 mass fraction.pCO (
float) – Perturbation in CO mass fraction.pCO2 (
float) – Perturbation in CO2 mass fraction.ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
- Returns:
heat_release_field – Projected fluctuation heat release field.
- Return type:
object
- postdQ1_(MF, prho, pO2, pCH4, ele)#
Computes the fluctuation of the reaction rate for the first reaction step in post-processing.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.prho (
float) – Perturbation in density.pO2 (
float) – Perturbation in O2 mass fraction.pCH4 (
float) – Perturbation in CH4 mass fraction.ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
- Returns:
dQ1 – Fluctuation of the reaction rate for reaction 1.
- Return type:
float
- postdQ2f_(MF, prho, pCO, pO2)#
Computes the fluctuation of the forward reaction rate for the second reaction step in post-processing.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.prho (
float) – Perturbation in density.pCO (
float) – Perturbation in CO mass fraction.pO2 (
float) – Perturbation in O2 mass fraction.
- Returns:
dQ2f – Fluctuation of the forward reaction rate for reaction 2.
- Return type:
float
- postdQ2r_(MF, prho, pCO2)#
Computes the fluctuation of the reverse reaction rate for the second reaction step in post-processing.
- Parameters:
MF (
dict) – Dictionary containing mean flow properties.prho (
float) – Perturbation in density.pCO2 (
float) – Perturbation in CO2 mass fraction.
- Returns:
dQ2r – Fluctuation of the reverse reaction rate for reaction 2.
- Return type:
float
- testM()#
Prints the maximum reaction rates of the base flow for diagnostic purposes.
Notes
This method outputs the maximum values of reaction rates for reaction 1, reaction 2 forward, and reaction 2 inverse.