Skip to content

Commit

Permalink
Formatting tweaks to LinearBurkeRate
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Oct 23, 2024
1 parent 35fb3fb commit d367a49
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 100 deletions.
2 changes: 1 addition & 1 deletion doc/sphinx/reference/kinetics/rate-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ different third-body efficiencies often are much more similar at the same reduce
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 :ct:`LinearBurkeRate` reaction class, as it
implementation of LMR-R in Cantera via the {ct}`LinearBurkeRate` 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
Expand Down
10 changes: 5 additions & 5 deletions doc/sphinx/yaml/reactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ Additional fields are:
collider ``M``, defined as :math:`\epsilon_{0,i}(T)=\Lambda_{0,i}(T)/\Lambda_{0,\text{M}}(T)`.
The user does not need to assign an ``efficiency`` for ``M``, as it is always
equal to 1 by definition. However, they are free to do so, as long as it takes
the form 'efficiency: {A: 1, b: 0, Ea: 0}' (no other variations are permitted).
the form ``efficiency: {A: 1, b: 0, Ea: 0}`` (no variations are permitted).
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 (such as 'H2O: {A: 10, b: 0, Ea: 0}').
``Ea`` can be set to 0 (such as ``H2O: {A: 10, b: 0, Ea: 0}``).

A :ref:`Troe <sec-yaml-falloff>` implementation also requires: ``high-P-rate-constant``,
``low-P-rate-constant``, ``Troe`` (do not use the Troe ``efficiencies`` key).
Expand All @@ -467,7 +467,7 @@ Additional fields are:

Examples:

*`linear-Burke` rate with Troe format for the reference collider (N2)*:
`linear-Burke` *rate with Troe format for the reference collider (N2)*::

equation: H + OH <=> H2O
type: linear-Burke
Expand All @@ -482,7 +482,7 @@ Examples:
- name: H2O
efficiency: {A: 1.04529e-01, b: 5.50787e-01, Ea: -2.32675e+02}

*`linear-Burke` rate with PLOG format for the reference collider (Ar)*:
`linear-Burke` *rate with PLOG format for the reference collider (Ar)*::

equation: H + O2 (+M) <=> HO2 (+M) # Adding '(+M)' is optional
type: linear-Burke
Expand Down Expand Up @@ -511,7 +511,7 @@ Examples:
- name: H2O
efficiency: {A: 3.69146e+01, b: -7.12902e-02, Ea: 3.19087e+01}

*`linear-Burke` rate with Chebyshev format for the reference collider (Ar)*:
`linear-Burke` *rate with Chebyshev format for the reference collider (Ar)*::

equation: H2O2 <=> 2 OH
type: linear-Burke
Expand Down
42 changes: 18 additions & 24 deletions include/cantera/kinetics/LinearBurkeRate.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct LinearBurkeData : public ReactionData
//! This parameterization is described by Singal et al. @cite singal2024 and in the
//! [science reference](../reference/kinetics/rate-constants.html#linear-burke-rate-expressions)
//! documentation.
//! @ingroup otherRateGroup
class LinearBurkeRate final : public ReactionRate
{
public:
Expand All @@ -94,9 +95,9 @@ class LinearBurkeRate final : public ReactionRate

void getParameters(AnyMap& rateNode) const override;

//! Create type alias that refers to PlogRate, TroeRate, and ChebyshevRate
//! Type alias that refers to PlogRate, TroeRate, and ChebyshevRate
using RateTypes = boost::variant<PlogRate, TroeRate, ChebyshevRate>;
//! Create type alias that refers to PlogData, FalloffData, and ChebyshevData
//! Type alias that refers to PlogData, FalloffData, and ChebyshevData
using DataTypes = boost::variant<PlogData, FalloffData, ChebyshevData>;

double evalFromStruct(const LinearBurkeData& shared_data);
Expand All @@ -106,27 +107,20 @@ class LinearBurkeRate final : public ReactionRate
void validate(const string& equation, const Kinetics& kin) override;

protected:
//! Evaluate overall reaction rate using PLOG to evaluate
//! pressure-dependent aspect of the reaction
double evalPlogRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj,
double logPeff);
//! Evaluate overall reaction rate using Troe to evaluate
//! pressure-dependent aspect of the reaction
double evalTroeRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj,
double logPeff);
//! Evaluate overall reaction rate using Chebyshev to evaluate
//! pressure-dependent aspect of the reaction
double evalChebyshevRate(
const LinearBurkeData& shared_data,
DataTypes& dataObj,
RateTypes& rateObj,
double logPeff);
//! Evaluate overall reaction rate using PLOG to evaluate pressure-dependent aspect
//! of the reaction
double evalPlogRate(const LinearBurkeData& shared_data, DataTypes& dataObj,
RateTypes& rateObj, double logPeff);

//! Evaluate overall reaction rate using Troe to evaluate pressure-dependent aspect
//! of the reaction
double evalTroeRate(const LinearBurkeData& shared_data, DataTypes& dataObj,
RateTypes& rateObj, double logPeff);

//! Evaluate overall reaction rate using Chebyshev to evaluate pressure-dependent
//! aspect of the reaction
double evalChebyshevRate(const LinearBurkeData& shared_data, DataTypes& dataObj,
RateTypes& rateObj, double logPeff);

//! String name of each collider, appearing in the same order as that of the
//! original reaction input.
Expand All @@ -141,7 +135,7 @@ class LinearBurkeRate final : public ReactionRate

//! Third-body collision efficiency object for k(T,P,X) and eig0_mix calculation
vector<ArrheniusRate> m_epsObjs1;
//! Third-body collision efficiency object for m_logPeff_ calculation
//! Third-body collision efficiency object for logPeff calculation
vector<ArrheniusRate> m_epsObjs2;
//! Third-body collision efficiency object for the reference collider M
//! (eig0_M/eig0_M = 1 always)
Expand Down
4 changes: 2 additions & 2 deletions samples/python/kinetics/jet_stirred_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
Mixture Rules Has a Substantial Impact on Combustion Predictions for H2 and NH3,
Proc. Combust. Inst. 40 (2024).
Requires: cantera >= 3.1
Requires: cantera >= 3.1, pandas, matplotlib
.. tags:: jet-stirred reactor, kinetics
.. tags:: jet-stirred reactor, kinetics, combustion
"""

import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions samples/python/kinetics/shock_tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
Mixture Rules Has a Substantial Impact on Combustion Predictions for H2 and NH3,
Proc. Combust. Inst. 40 (2024).
Requires: cantera >= 3.1
Requires: cantera >= 3.1, matplotlib
.. tags:: shock tube, kinetics
.. tags:: shock tube, kinetics, combustion
"""

import cantera as ct
Expand Down
2 changes: 1 addition & 1 deletion samples/python/onedim/flame_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Requires: cantera >= 3.1
.. tags:: flame speed, kinetics
.. tags:: flame speed, kinetics, combustion, premixed flame
"""

import cantera as ct
Expand Down
Loading

0 comments on commit d367a49

Please sign in to comment.