Skip to content

Commit

Permalink
hard-coded 88char lim to all changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsingal committed Oct 14, 2024
1 parent 743139f commit e6e1f98
Show file tree
Hide file tree
Showing 10 changed files with 331 additions and 161 deletions.
8 changes: 4 additions & 4 deletions doc/doxygen/cantera.bib
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,13 @@ @article{singal2024
author = {P.~J.~Singal and J.~Lee and L.~Lei and R.~L.~Speth and M.~P.~Burke},
journal = {Proceedings of the Combustion Institute},
pages = {TBD},
title = {Implementation of New Mixture Rules Has a Substantial Impact on
Combustion Predictions for {H2} and {NH3}},
title = {Implementation of New Mixture Rules Has a Substantial Impact on Combustion
Predictions for {H2} and {NH3}},
doi = {TBD},
url = {TBD},
volume = {41},
volume = {40},
number = {TBD},
year = {2025}}
year = {2024}}
@article{stewart1989,
author = {P.~H.~Stewart and C.~W.~Larson and D.~Golden},
journal = {Combustion and Flame},
Expand Down
103 changes: 72 additions & 31 deletions doc/sphinx/reference/kinetics/rate-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,49 +238,90 @@ Chebyshev reactions can be defined in the YAML format using the
(sec-linear-Burke)=
## Linear Burke Rate Expressions

Linear Burke rate expressions employ the reduced-pressure linear mixture rule (LMR-R). This mixture rule is used to evaluate the rate constants of complex-forming reactions, and is a mole-fraction-weighted sum of the bath gas rate constants (when pure) evaluated at the reduced pressure ($R$) and temperature ($T$) of the mixture.
Linear Burke rate expressions employ the reduced-pressure linear mixture rule (LMR-R).
This mixture rule is used to evaluate the rate constants of complex-forming reactions,
and is a mole-fraction-weighted sum of the bath gas rate constants (when pure) evaluated
at the reduced pressure ($R$) and temperature ($T$) of the mixture.

$$
k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{i} k_{i}(T,R_{\text{LMR}})\tilde{X}_{i,\text{LMR}}
$$
$$ k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{i}
k_{i}(T,R_{\text{LMR}})\tilde{X}_{i,\text{LMR}} $$

where the reduced pressure, $R$, in its most general form

$$
R_{\text{LMR}}(T,P,\boldsymbol{X}) = \frac{\sum_{i} \Lambda_{0,i}(T)X_i[M]}{\Lambda_{\infty}(T)}
$$
$$ R_{\text{LMR}}(T,P,\boldsymbol{X}) = \frac{\sum_{i}
\Lambda_{0,i}(T)X_i[M]}{\Lambda_{\infty}(T)} $$

and the fractional contribution of each component to the reduced pressure, $\tilde{X}_{i}$
and the fractional contribution of each component to the reduced pressure,
$\tilde{X}_{i}$

$$
\tilde{X}_{i,\text{LMR}}(T,P,\boldsymbol{X})=\frac{\Lambda_{0,i}(T)X_i}{\sum_{j} \Lambda_{0,j}(T)X_j}
$$
$$ \tilde{X}_{i,\text{LMR}}(T,P,\boldsymbol{X})=\frac{\Lambda_{0,i}(T)X_i}{\sum_{j}
\Lambda_{0,j}(T)X_j} $$

can be cast in terms of the absolute value of the least negative chemically significant eigenvalue of the master equation for the $i^{th}$ collider (when pure) in the low-pressure limit, $\Lambda_{0,i}(T)[M]$, and high-pressure limit, $\Lambda_{\infty}(T)$, and $[M]$ is the total concentration.
can be cast in terms of the absolute value of the least negative chemically significant
eigenvalue of the master equation for the $i^{th}$ collider (when pure) in the
low-pressure limit, $\Lambda_{0,i}(T)[M]$, and high-pressure limit,
$\Lambda_{\infty}(T)$, and $[M]$ is the total concentration.

Evaluating all rate constants at the reduced pressure ($R$)---instead of the pressure ($P$)---of the mixture takes advantage of the fact that rate constants (and their chemically significant eigenvectors) for different colliders are usually far more similar at the same $R$ than the same $P$. In practice, since rate constants are usually expressed with respect to pressure $P$ (which has units of Pa, Torr, bar, atm, etc.) rather than reduced pressure $R$ (which is dimensionless), one needs to find the effective pressure for the $i^{th}$ collider, $P_{i}^{\text{ eff}}$ (with units of $P$), such that the reduced pressure of pure collider $i$ is equal to the reduced pressure of the mixture, which can be shown to be
Evaluating all rate constants at the reduced pressure ($R$)---instead of the pressure
($P$)---of the mixture takes advantage of the fact that rate constants (and their
chemically significant eigenvectors) for different colliders are usually far more
similar at the same $R$ than the same $P$. In practice, since rate constants are usually
expressed with respect to pressure $P$ (which has units of Pa, Torr, bar, atm, etc.)
rather than reduced pressure $R$ (which is dimensionless), one needs to find the
effective pressure for the $i^{th}$ collider, $P_{i}^{\text{ eff}}$ (with units of $P$),
such that the reduced pressure of pure collider $i$ is equal to the reduced pressure of
the mixture, which can be shown to be

$$
P_{i,\text{LMR}}^{\text{ eff}}(T,P,\boldsymbol{X}) = \frac{\sum_{j} \Lambda_{0,j}(T)X_j}{\Lambda_{0,i}(T)}P
$$
$$ P_{i,\text{LMR}}^{\text{ eff}}(T,P,\boldsymbol{X}) = \frac{\sum_{j}
\Lambda_{0,j}(T)X_j}{\Lambda_{0,i}(T)}P $$

such that an alternate version of the generalized LMR-R equation can be written as

$$
k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{i} k_{i}(T,P_{i,\text{LMR}}^{\text{ eff}})\tilde{X}_{i,\text{LMR}}
$$

It is worth noting two convenient implications of this change in basis. First, when LMR-R is implemented with the above equation, it is not necessary to specify $\Lambda_{\infty}(T)$, which cancels out in evaluating $P_{i}^{\text{ eff}}$. Second, only ratios of $\Lambda_{0,i}(T)$ appear in the calculations of $\tilde{X}_{i,\text{LMR}}(T,P,\boldsymbol{X})$ and $P_{i,\text{LMR}}^{\text{ eff}}(T,P,\boldsymbol{X})$, such that third-body efficiencies $\epsilon_{0,i}(T)=\Lambda_{0,i}(T)/\Lambda_{0,\text{M}}(T)$ (where the user must assign $\epsilon_{0,\text{M}}(T)=1$, as this is true by definition), can be implemented by the user in lieu of $\Lambda_{0,i}(T)$.

While direct implementation of LMR-R via the above equation would require $k_i(T,P)$ be specified in addition to $\Lambda_{0,i}(T)$ or $\epsilon_{0,i}(T)$ for each important collider, often data for $k_i(T,P)$ (i.e. the complete $T,P$-dependence) for each collider is not available even when $\Lambda_{0,i}(T)$ or $\epsilon_{0,i}(T)$ have available data or can be estimated using typical values (as is typically done in kinetic models for reactions in modified Lindemann expressions). It would therefore be useful to allow some colliders to be specified with unique $\Lambda_{0,i}(T)$ (or $\epsilon_{0,i}(T)$) without $k_i(T,P)$, by assuming the same reduced-pressure dependence as M (i.e. $k_{i}(T,R)=k_{M}(T,R)$) for those colliders:

$$
k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{n} k_{n}(T,P_{n,\text{LMR}}^{\text{ eff}})\tilde{X}_{n,\text{LMR}} + k_{M}(T,P_{M,\text{LMR}}^{\text{ eff}}) \left(1-\sum_{n}\tilde{X}_{n,\text{LMR}}\right)
$$

where the sum over $n$ is only for the colliders for which unique $k_n(T,P)$ are available. Each $k_n(T,P)$ can be specified in the user's choice of Troe, Plog, or Chebyshev formats. For the Troe format, the effective third-body concentration is calculated by dividing $P_{i}^{\text{ eff}}$ by the temperature and ideal gas constant. For the other formats, $P_{i}^{\text{ eff}}$ is implemented directly as the 'pressure' of interest.

While not required if unique $k_i(T,P)$ data are available, this approximation, like LMR-R, takes advantage of the fact that rate constants for colliders with even very different third-body efficiencies often are much more similar at the same reduced pressure ($R$) than at the same pressure ($P$) and, in fact, are exactly the same if they differ in only their collision frequency (but have the same energy- and angular-momentum-transfer kernel). This equation forms the basis of the computational implementation of LMR-R in Cantera via the Linear Burke Rate reaction class, as it enables the most accurate representation of $k_{\text{LMR-R}}(T,P,\boldsymbol{X})$ possible given limitations in the completeness of the dataset at any given moment. Further description of the LMR-R theory and computational method is available in {cite:t}`singal2024`.
$$ k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{i} k_{i}(T,P_{i,\text{LMR}}^{\text{
eff}})\tilde{X}_{i,\text{LMR}} $$

It is worth noting two convenient implications of this change in basis. First, when
LMR-R is implemented with the above equation, it is not necessary to specify
$\Lambda_{\infty}(T)$, which cancels out in evaluating $P_{i}^{\text{ eff}}$. Second,
only ratios of $\Lambda_{0,i}(T)$ appear in the calculations of
$\tilde{X}_{i,\text{LMR}}(T,P,\boldsymbol{X})$ and $P_{i,\text{LMR}}^{\text{
eff}}(T,P,\boldsymbol{X})$, such that third-body efficiencies
$\epsilon_{0,i}(T)=\Lambda_{0,i}(T)/\Lambda_{0,\text{M}}(T)$ (where the user must assign
$\epsilon_{0,\text{M}}(T)=1$, as this is true by definition), can be implemented by the
user in lieu of $\Lambda_{0,i}(T)$.

While direct implementation of LMR-R via the above equation would require $k_i(T,P)$ be
specified in addition to $\Lambda_{0,i}(T)$ or $\epsilon_{0,i}(T)$ for each important
collider, often data for $k_i(T,P)$ (i.e. the complete $T,P$-dependence) for each
collider is not available even when $\Lambda_{0,i}(T)$ or $\epsilon_{0,i}(T)$ have
available data or can be estimated using typical values (as is typically done in kinetic
models for reactions in modified Lindemann expressions). It would therefore be useful
to allow some colliders to be specified with unique $\Lambda_{0,i}(T)$ (or
$\epsilon_{0,i}(T)$) without $k_i(T,P)$, by assuming the same reduced-pressure
dependence as M (i.e. $k_{i}(T,R)=k_{M}(T,R)$) for those colliders:

$$ k_{\text{LMR-R}}(T,P,\boldsymbol{X}) = \sum_{n} k_{n}(T,P_{n,\text{LMR}}^{\text{
eff}})\tilde{X}_{n,\text{LMR}} + k_{M}(T,P_{M,\text{LMR}}^{\text{ eff}})
\left(1-\sum_{n}\tilde{X}_{n,\text{LMR}}\right) $$

where the sum over $n$ is only for the colliders for which unique $k_n(T,P)$ are
available. Each $k_n(T,P)$ can be specified in the user's choice of Troe, Plog, or
Chebyshev formats. For the Troe format, the effective third-body concentration is
calculated by dividing $P_{i}^{\text{ eff}}$ by the temperature and ideal gas constant.
For the other formats, $P_{i}^{\text{ eff}}$ is implemented directly as the 'pressure'
of interest.

While not required if unique $k_i(T,P)$ data are available, this approximation, like
LMR-R, takes advantage of the fact that rate constants for colliders with even very
different third-body efficiencies often are much more similar at the same reduced
pressure ($R$) than at the same pressure ($P$) and, in fact, are exactly the same if
they differ in only their collision frequency (but have the same energy- and
angular-momentum-transfer kernel). This equation forms the basis of the computational
implementation of LMR-R in Cantera via the Linear Burke Rate reaction class, as it
enables the most accurate representation of $k_{\text{LMR-R}}(T,P,\boldsymbol{X})$
possible given limitations in the completeness of the dataset at any given moment.
Further description of the LMR-R theory and computational method is available in
{cite:t}`singal2024`.

```{admonition} YAML Usage
:class: tip
Expand Down
62 changes: 43 additions & 19 deletions doc/sphinx/yaml/reactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -402,30 +402,53 @@ Example::
``linear-Burke``
----------------

A complex-forming reaction (one that depends on both P and X) parameterized
according to the reduced-pressure linear mixture rule as
:ref:`described here <sec-linear-Burke>`.
A complex-forming reaction (one that depends on both P and X) parameterized according to
the reduced-pressure linear mixture rule as :ref:`described here <sec-linear-Burke>`.



Additional fields are:

``colliders``
A list of dictionaries, where each entry contains parameters corresponding
to individual colliders (species in the bath gas).
A list of dictionaries, where each entry contains parameters corresponding to
individual colliders (species in the bath gas).

``name``
The name of the collider species (e.g., ``H2O``). The first collider defined must be ``M``, which represents the generic reference collider (often ``Ar`` or ``N2``) that represents all species lacking their own explicit parameterization.
The name of the collider species (e.g., ``H2O``). The first collider defined must be
``M``, which represents the generic reference collider (often ``Ar`` or ``N2``) that
represents all species lacking their own explicit parameterization.

``eig0``
The absolute value of the least negative chemically significant eigenvalue of the master equation for the :math:`i^{th}` collider (when pure), evaluated at the low-pressure limit, :math:`\Lambda_{0,i}(T)[M]`. This parameter is entered in modified Arrhenius format to enable consideration of temperature dependence.
The absolute value of the least negative chemically significant eigenvalue of the
master equation for the :math:`i^{th}` collider (when pure), evaluated at the
low-pressure limit, :math:`\Lambda_{0,i}(T)[M]`. This parameter is entered in
modified Arrhenius format to enable consideration of temperature dependence.

``eps``
The third-body efficiency of the collider relative to that of the reference collider ``M``, defined as :math:`\epsilon_{0,i}(T)=\Lambda_{0,i}(T)/\Lambda_{0,\text{M}}(T)`. The user must assign ``eps: {A:1, b:0, Ea: 0}`` for ``M``, as this is true by definition. This parameter is entered in modified Arrhenius format to enable consideration of temperature dependence. If the user wishes to specify a temperature-independent value, then ``A`` can be set to this value and ``b`` and ``Ea`` can be set to 0.

``eps`` and ``eig0`` comprise the two acceptable ways to represent the contribution of each bath gas component (collider) to the reduced pressure. All explicitly defined colliders must include either ``eps`` or ``eig0``, but the choice must remain consistent throughout a single reaction (either all colliders are defined with ``eps``, or all are defined with ``eig0``).

The pressure-dependent aspect of the rate constant can be parameterized in the user's choice of :ref:`Troe <sec-yaml-falloff>`, :ref:`pressure-dependent-arrhenius <sec-yaml-pressure-dependent-Arrhenius>`, or :ref:`Chebyshev <sec-yaml-Chebyshev>` representations. The same parameters used for a standalone Troe, PLOG, or Chebyshev reaction are then inserted directly below ``eps`` or ``eig0`` for a given collider (note: Troe cannot be given its own ``efficiencies`` key). At minimum, this treatment must be applied to ``M``. However, additional colliders may also be given their own Troe, PLOG, or Chebyshev parameterization if so desired. Mixing and matching of types within the same reaction is allowed (e.g., a PLOG table for ``M``, Troe parameters for ``H2``, and Chebyshev data for ``NH3``).
The third-body efficiency of the collider relative to that of the reference collider
``M``, defined as
:math:`\epsilon_{0,i}(T)=\Lambda_{0,i}(T)/\Lambda_{0,\text{M}}(T)`. The user must
assign ``eps: {A:1, b:0, Ea: 0}`` for ``M``, as this is true by definition. This
parameter is entered in modified Arrhenius format to enable consideration of
temperature dependence. If the user wishes to specify a temperature-independent
value, then ``A`` can be set to this value and ``b`` and ``Ea`` can be set to 0.

``eps`` and ``eig0`` comprise the two acceptable ways to represent the contribution of
each bath gas component (collider) to the reduced pressure. All explicitly defined
colliders must include either ``eps`` or ``eig0``, but the choice must remain consistent
throughout a single reaction (either all colliders are defined with ``eps``, or all are
defined with ``eig0``).

The pressure-dependent aspect of the rate constant can be parameterized in the user's
choice of :ref:`Troe <sec-yaml-falloff>`, :ref:`pressure-dependent-arrhenius
<sec-yaml-pressure-dependent-Arrhenius>`, or :ref:`Chebyshev <sec-yaml-Chebyshev>`
representations. The same parameters used for a standalone Troe, PLOG, or Chebyshev
reaction are then inserted directly below ``eps`` or ``eig0`` for a given collider
(note: Troe cannot be given its own ``efficiencies`` key). At minimum, this treatment
must be applied to ``M``. However, additional colliders may also be given their own
Troe, PLOG, or Chebyshev parameterization if so desired. Mixing and matching of types
within the same reaction is allowed (e.g., a PLOG table for ``M``, Troe parameters for
``H2``, and Chebyshev data for ``NH3``).

A mathematical description of this YAML implementation can be found in Eq. 8 of
:cite:t:`singal2024`.
Expand Down Expand Up @@ -480,13 +503,14 @@ Examples::
temperature-range: [200.0, 2000.0]
pressure-range: [1.000e-01 atm, 1.000e+02 atm]
data:
- [-1.5843e+01, 8.7088e-01, -9.4364e-02, -2.8099e-03, -4.4803e-04, 1.5809e-03, -2.5088e-04]
- [2.3154e+01, 5.2739e-01, 2.8862e-02, -5.4601e-03, 7.0783e-04, -3.0282e-03, 7.8121e-04]
- [-3.8008e-01, 8.6349e-02, 4.0292e-02, -7.2269e-03, 5.7570e-04, 2.7944e-03, -1.4912e-03]
- [-1.4800e-01, -7.1798e-03, 2.2052e-02, 6.2269e-03, -5.9801e-03, -8.2205e-06, 1.9243e-03]
- [-6.0604e-02, -1.4203e-02, 1.3414e-03, 9.6228e-03, 1.7002e-03, -3.6506e-03, -4.3168e-04]
- [-2.4557e-02, -9.7102e-03, -5.8753e-03, 3.0456e-03, 5.8666e-03, 1.5037e-03, -2.0073e-03]
- [-1.5400e-02, -5.2427e-03, -6.9148e-03, -5.9440e-03, -1.2183e-03, 2.1694e-03, 1.5925e-03]
- [-1.58e+01, 8.71e-01, -9.44e-02, -2.81e-03, -4.48e-04, 1.58e-03, -2.51e-04]
- [2.32e+01, 5.27e-01, 2.89e-02, -5.46e-03, 7.08e-04, -3.03e-03, 7.81e-04]
- [-3.80e-01, 8.63e-02, 4.03e-02, -7.23e-03, 5.76e-04, 2.79e-03, -1.49e-03]
- [-1.48e-01, -7.18e-03, 2.21e-02, 6.23e-03, -5.98e-03, -8.22e-06, 1.92e-03]
- [-6.06e-02, -1.42e-02, 1.34e-03, 9.62e-03, 1.70e-03, -3.65e-03, -4.32e-04]
- [-2.46e-02, -9.71e-03, -5.88e-03, 3.05e-03, 5.87e-03, 1.50e-03, -2.01e-03]
- [-1.54e-02, -5.24e-03, -6.91e-03, -5.94e-03, -1.22e-03, 2.17e-03, 1.59e-03]

- name: N2
eps: {A: 1.14813e+00, b: 4.60090e-02, Ea: -2.92413e+00}
- name: CO2
Expand Down
21 changes: 15 additions & 6 deletions include/cantera/kinetics/LinearBurkeRate.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ struct LinearBurkeData : public ReactionData
};


//! Pressure-dependent and composition-dependent reaction rate calculated
//! according to the reduced-pressure linear mixture rule (LMR-R) developed
//! at Columbia University. @cite singal2024
//! Pressure-dependent and composition-dependent reaction rate calculated according to
//! the reduced-pressure linear mixture rule (LMR-R) developed at Columbia University.
//! @cite singal2024
class LinearBurkeRate final : public ReactionRate
{
public:
Expand Down Expand Up @@ -101,9 +101,18 @@ class LinearBurkeRate final : public ReactionRate
/*!
* @param shared_data data shared by all reactions of a given type
*/
double evalPlogRate(const LinearBurkeData& shared_data, DataTypes& dataObj, RateTypes& rateObj);
double evalTroeRate(const LinearBurkeData& shared_data, DataTypes& dataObj, RateTypes& rateObj);
double evalChebyshevRate(const LinearBurkeData& shared_data, DataTypes& dataObj, RateTypes& rateObj);
double evalPlogRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj);
double evalTroeRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj);
double evalChebyshevRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj);
double evalFromStruct(const LinearBurkeData& shared_data);

void setContext(const Reaction& rxn, const Kinetics& kin) override;
Expand Down
Loading

0 comments on commit e6e1f98

Please sign in to comment.