FELiCS.Equation.Reactions.GlobalReaction#
Module Contents#
Classes#
Represents a global one-step chemical reaction mechanism. |
- class FELiCS.Equation.Reactions.GlobalReaction.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
- Parameters:
reaction_mechanism (
dict) – Dictionary containing reaction mechanism parameters.- Variables:
mixtureDirectory (
str) – Directory name for mixture data.speciesDirectory (
str) – Directory name for species data.A (
floatorNone) – Pre-exponential factor for the reaction.Ta (
floatorNone) – Activation temperature.a (
floatorNone) – Stoichiometric coefficient for oxygen.b (
floatorNone) – Stoichiometric coefficient for carbon.beta (
floatorNone) – Temperature exponent.h0 (
floatorNone) – Heat of reaction.st_C (
floatorNone) – Stoichiometric coefficient for carbon species.st_O (
floatorNone) – Stoichiometric coefficient for oxygen species.WO (
floatorNone) – Molecular weight of oxygen.WC (
floatorNone) – Molecular weight of carbon.reactionName (
str) – Name of the reaction.Q (
dolfinx.fem.FunctionorNone) – Mean field reaction rate.i_rho (
intorNone) – Index of density in solution list.i_C (
intorNone) – Index of CH4 in solution list.
- ReadReactionDict(reaction)#
Reads reaction parameters from a dictionary and updates class attributes.
- Parameters:
reaction (
dict) – Dictionary containing reaction parameters.
Notes
This method sets the reaction coefficients and molecular weights based on the provided reaction dictionary.
- computeMeanField(mean, ele)#
Computes the mean field reaction rate and interpolates it as a function.
- Parameters:
mean (
object) – Object containing mean flow properties (e.g., temperature, density, species mass fractions).ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
- Returns:
Q – Interpolated mean field reaction rate.
- Return type:
dolfinx.fem.Function
Notes
Uses the reaction parameters and mean flow properties to construct the reaction rate expression.
- addReaction(mean, testf, fluc, solutionList)#
Adds the reaction term to the weak form.
- Parameters:
mean (
object) – Object containing mean flow properties.testf (
list) – List of test functions.fluc (
object) – Object containing fluctuation properties.solutionList (
listofstr) – List of solution variable names.
- Returns:
reaction_term – Weak form expression for the reaction term.
- Return type:
ufl.Form
Notes
The method computes the indices for relevant variables and constructs the weak form using the reaction rate and heat release.
- dQ_(mean, fluc)#
Computes the fluctuation of the reaction rate.
- Parameters:
mean (
object) – Object containing mean flow properties.fluc (
object) – Object containing fluctuation properties.
- Returns:
dQ – Fluctuation of the reaction rate.
- Return type:
float
Notes
The calculation uses stoichiometric coefficients and mean/fluctuation values for temperature and species.
- postHeatRelease(mean, prho, pCH4, ele)#
Computes the post-processed heat release form.
- Parameters:
mean (
object) – Object containing mean flow properties.prho (
float) – Perturbation in density.pCH4 (
float) – Perturbation in CH4 mass fraction.ele (
dolfinx.fem.FunctionSpace) – Function space for interpolation.
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.
- Return type:
dolfinx.fem.Function
- postdQ(mean, prho, pCH4)#
Computes the post-processed fluctuation of the reaction rate.
- Parameters:
mean (
object) – Object containing mean flow properties.prho (
float) – Perturbation in density.pCH4 (
float) – Perturbation in CH4 mass fraction.
- Returns:
dQ – Post-processed fluctuation of the reaction rate.
- Return type:
float