Cantera  4.0.0a1
Loading...
Searching...
No Matches
BlowersMaselRate.h
Go to the documentation of this file.
1//! @file BlowersMaselRate.h Header for Blowers-Masel reaction rates
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_BLOWERSMASELRATE_H
7#define CT_BLOWERSMASELRATE_H
8
9#include "Arrhenius.h"
10
11namespace Cantera
12{
13
14//! Data container holding shared data specific to BlowersMaselRate
15/**
16 * The data container `BlowersMaselData` holds precalculated data common to
17 * all `BlowersMaselRate` objects.
18 */
20{
21 BlowersMaselData() = default;
22
23 void update(double T) override;
24 bool update(const ThermoPhase& phase, const Kinetics& kin) override;
26 void resize(Kinetics& kin) override;
27
28 bool ready = false; //!< boolean indicating whether vectors are accessible
29 double density = NAN; //!< used to determine if updates are needed
30 vector<double> partialMolarEnthalpies; //!< partial molar enthalpies
31
32protected:
33 int m_state_mf_number = -1; //!< integer that is incremented when composition changes
34};
35
36
37//! Blowers Masel reaction rate type depends on the enthalpy of reaction
38/**
39 * The Blowers Masel approximation @cite blowers2000 adjusts the activation energy
40 * based on enthalpy change of a reaction:
41 *
42 * @f{eqnarray*}{
43 * E_a &=& 0\; &\text{if }\Delta H < -4E_0 \\
44 * E_a &=& \Delta H\; &\text{if }\Delta H > 4E_0 \\
45 * E_a &=& \frac{(w + \Delta H / 2)(V_P - 2w +
46 * \Delta H)^2}{(V_P^2 - 4w^2 + (\Delta H)^2)}\; &\text{otherwise}
47 * @f}
48 * where
49 * @f[
50 * V_P = \frac{2w (w + E_0)}{w - E_0},
51 * @f]
52 * @f$ w @f$ is the average bond dissociation energy of the bond breaking
53 * and that being formed in the reaction. Since the expression is
54 * very insensitive to @f$ w @f$ for @f$ w >= 2 E_0 @f$, @f$ w @f$
55 * can be approximated to an arbitrary high value like 1000 kJ/mol.
56 *
57 * After the activation energy is determined by Blowers-Masel approximation,
58 * it can be plugged into Arrhenius function to calculate the rate constant.
59 * @f[
60 * k_f = A T^b \exp (-E_a/RT)
61 * @f]
62 *
63 * @ingroup arrheniusGroup
64 */
66{
67public:
68 //! Default constructor.
70
71 //! Constructor.
72 /*!
73 * @param A Pre-exponential factor. The unit system is (kmol, m, s); actual units
74 * depend on the reaction order and the dimensionality (surface or bulk).
75 * @param b Temperature exponent (non-dimensional)
76 * @param Ea0 Intrinsic activation energy in energy units [J/kmol]
77 * @param w Average bond dissociation energy of the bond being formed and
78 * broken in the reaction, in energy units [J/kmol]
79 */
80 BlowersMaselRate(double A, double b, double Ea0, double w);
81
82 explicit BlowersMaselRate(const AnyMap& node,
83 const UnitStack& rate_units={});
84
85 unique_ptr<MultiRateBase> newMultiRate() const override {
86 return make_unique<MultiRate<BlowersMaselRate, BlowersMaselData>>();
87 }
88
89 const string type() const override {
90 return "Blowers-Masel";
91 }
92
93 void setContext(const Reaction& rxn, const Kinetics& kin) override;
94
95 //! Evaluate reaction rate
96 double evalRate(double logT, double recipT) const {
98 return m_A * std::exp(m_b * logT - Ea_R * recipT);
99 }
100
101 //! Update information specific to reaction
102 void updateFromStruct(const BlowersMaselData& shared_data) {
103 if (shared_data.ready) {
104 m_deltaH_R = 0.;
105 for (const auto& [k, multiplier] : m_stoich_coeffs) {
106 m_deltaH_R += shared_data.partialMolarEnthalpies[k] * multiplier;
107 }
109 }
110 }
111
112 //! Evaluate reaction rate
113 /*!
114 * @param shared_data data shared by all reactions of a given type
115 */
116 double evalFromStruct(const BlowersMaselData& shared_data) const {
118 return m_A * std::exp(m_b * shared_data.logT - Ea_R * shared_data.recipT);
119 }
120
121 //! Evaluate derivative of reaction rate with respect to temperature
122 //! divided by reaction rate
123 /*!
124 * This method does not consider potential changes due to a changed reaction
125 * enthalpy. A corresponding warning is raised.
126 * @param shared_data data shared by all reactions of a given type
127 */
128 double ddTScaledFromStruct(const BlowersMaselData& shared_data) const;
129
130protected:
131 //! Return the effective activation energy (a function of the delta H of reaction)
132 //! divided by the gas constant (that is, the activation temperature) [K]
133 double effectiveActivationEnergy_R(double deltaH_R) const {
134 if (deltaH_R <= -4 * m_Ea_R) {
135 return 0.;
136 }
137 if (deltaH_R > 4 * m_Ea_R) {
138 return deltaH_R;
139 }
140 // m_E4_R is the bond dissociation energy "w" (in temperature units)
141 double vp = 2 * m_E4_R * ((m_E4_R + m_Ea_R) / (m_E4_R - m_Ea_R)); // in Kelvin
142 double vp_2w_dH = (vp - 2 * m_E4_R + deltaH_R); // (Vp - 2 w + dH)
143 return (m_E4_R + deltaH_R / 2) * (vp_2w_dH * vp_2w_dH) /
144 (vp * vp - 4 * m_E4_R * m_E4_R + deltaH_R * deltaH_R); // in Kelvin
145 }
146
147public:
148 double activationEnergy() const override {
150 }
151
152 //! Return the bond dissociation energy *w* [J/kmol]
153 double bondEnergy() const {
154 return m_E4_R * GasConstant;
155 }
156
157 //! Return current enthalpy change of reaction [J/kmol]
158 double deltaH() const {
159 return m_deltaH_R * GasConstant;
160 }
161
162 //! Set current enthalpy change of reaction [J/kmol]
163 /*!
164 * @note used for testing purposes only; this quantity is not an
165 * independent variable and will be overwritten during an update of the state.
166 *
167 * @warning This method is an experimental part of the %Cantera API and
168 * may be changed or removed without notice.
169 */
170 void setDeltaH(double deltaH) {
172 }
173
174protected:
175 //! Pairs of species indices and multipliers to calculate enthalpy change
176 vector<pair<size_t, double>> m_stoich_coeffs;
177
178 double m_deltaH_R = 0.0; //!< enthalpy change of reaction (in temperature units)
179};
180
181}
182
183#endif
Header for reaction rates that involve Arrhenius-type kinetics.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
Base class for Arrhenius-type Parameterizations.
Definition Arrhenius.h:44
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition Arrhenius.h:150
double m_A
Pre-exponential factor.
Definition Arrhenius.h:147
double m_b
Temperature exponent.
Definition Arrhenius.h:148
double m_Ea_R
Activation energy (in temperature units)
Definition Arrhenius.h:149
Blowers Masel reaction rate type depends on the enthalpy of reaction.
double evalFromStruct(const BlowersMaselData &shared_data) const
Evaluate reaction rate.
void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
double evalRate(double logT, double recipT) const
Evaluate reaction rate.
double deltaH() const
Return current enthalpy change of reaction [J/kmol].
vector< pair< size_t, double > > m_stoich_coeffs
Pairs of species indices and multipliers to calculate enthalpy change.
double bondEnergy() const
Return the bond dissociation energy w [J/kmol].
BlowersMaselRate()
Default constructor.
double effectiveActivationEnergy_R(double deltaH_R) const
Return the effective activation energy (a function of the delta H of reaction) divided by the gas con...
double m_deltaH_R
enthalpy change of reaction (in temperature units)
double ddTScaledFromStruct(const BlowersMaselData &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
void updateFromStruct(const BlowersMaselData &shared_data)
Update information specific to reaction.
void setDeltaH(double deltaH)
Set current enthalpy change of reaction [J/kmol].
const string type() const override
String identifying reaction rate specialization.
double activationEnergy() const override
Return the activation energy Ea [J/kmol] The value corresponds to the constant specified by input par...
Public interface for kinetics managers.
Definition Kinetics.h:126
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition Reaction.h:25
Base class for a phase with thermodynamic properties.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:123
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
Data container holding shared data specific to BlowersMaselRate.
int m_state_mf_number
integer that is incremented when composition changes
vector< double > partialMolarEnthalpies
partial molar enthalpies
void update(double T) override
Update data container based on temperature T
bool ready
boolean indicating whether vectors are accessible
double density
used to determine if updates are needed
void resize(Kinetics &kin) override
Update array sizes that depend on number of species, reactions and phases.
Data container holding shared data used for ReactionRate calculation.
double recipT
inverse of temperature
virtual void update(double T)
Update data container based on temperature T
double logT
logarithm of temperature
Unit aggregation utility.
Definition Units.h:105