Cantera 2.6.0
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{
22
23 virtual void update(double T) override;
24 virtual bool update(const ThermoPhase& phase, const Kinetics& kin) override;
26
27 virtual void resize(size_t nSpecies, size_t nReactions, size_t nPhases) override {
28 partialMolarEnthalpies.resize(nSpecies, 0.);
29 ready = true;
30 }
31
32 bool ready; //!< boolean indicating whether vectors are accessible
33 double density; //!< used to determine if updates are needed
34 vector_fp partialMolarEnthalpies; //!< partial molar enthalpies
35
36protected:
37 int m_state_mf_number; //!< integer that is incremented when composition changes
38};
39
40
41//! Blowers Masel reaction rate type depends on the enthalpy of reaction
42/**
43 * The Blowers Masel approximation is written by Paul Blowers,
44 * Rich Masel (DOI: https://doi.org/10.1002/aic.690461015) to
45 * adjust the activation energy based on enthalpy change of a reaction:
46 *
47 * \f{eqnarray*}{
48 * E_a &=& 0\; \text{if }\Delta H < -4E_0 \\
49 * E_a &=& \Delta H\; \text{if }\Delta H > 4E_0 \\
50 * E_a &=& \frac{(w + \Delta H / 2)(V_P - 2w +
51 * \Delta H)^2}{(V_P^2 - 4w^2 + (\Delta H)^2)}\; \text{Otherwise}
52 * \f}
53 * where
54 * \f[
55 * V_P = \frac{2w (w + E_0)}{w - E_0},
56 * \f]
57 * \f$ w \f$ is the average bond dissociation energy of the bond breaking
58 * and that being formed in the reaction. Since the expression is
59 * very insensitive to \f$ w \f$ for \f$ w >= 2 E_0 \f$, \f$ w \f$
60 * can be approximated to an arbitrary high value like 1000 kJ/mol.
61 *
62 * After the activation energy is determined by Blowers-Masel approximation,
63 * it can be plugged into Arrhenius function to calculate the rate constant.
64 * \f[
65 * k_f = A T^b \exp (-E_a/RT)
66 * \f]
67 *
68 * @ingroup arrheniusGroup
69 */
71{
72public:
73 //! Default constructor.
75
76 //! Constructor.
77 /*!
78 * @param A Pre-exponential factor. The unit system is (kmol, m, s); actual units
79 * depend on the reaction order and the dimensionality (surface or bulk).
80 * @param b Temperature exponent (non-dimensional)
81 * @param Ea0 Intrinsic activation energy in energy units [J/kmol]
82 * @param w Average bond dissociation energy of the bond being formed and
83 * broken in the reaction, in energy units [J/kmol]
84 */
85 BlowersMaselRate(double A, double b, double Ea0, double w);
86
87 explicit BlowersMaselRate(const AnyMap& node, const UnitStack& rate_units={})
89 {
90 setParameters(node, rate_units);
91 }
92
93 unique_ptr<MultiRateBase> newMultiRate() const override {
94 return unique_ptr<MultiRateBase>(new MultiRate<BlowersMaselRate, BlowersMaselData>);
95 }
96
97 virtual const std::string type() const override {
98 return "Blowers-Masel";
99 }
100
101 virtual void setContext(const Reaction& rxn, const Kinetics& kin) override;
102
103 //! Evaluate reaction rate
104 double evalRate(double logT, double recipT) const {
106 return m_A * std::exp(m_b * logT - Ea_R * recipT);
107 }
108
109 //! Update information specific to reaction
110 void updateFromStruct(const BlowersMaselData& shared_data) {
111 if (shared_data.ready) {
112 m_deltaH_R = 0.;
113 for (const auto& item : m_stoich_coeffs) {
114 m_deltaH_R += shared_data.partialMolarEnthalpies[item.first] * item.second;
115 }
117 }
118 }
119
120 //! Evaluate reaction rate
121 /*!
122 * @param shared_data data shared by all reactions of a given type
123 */
124 double evalFromStruct(const BlowersMaselData& shared_data) const {
126 return m_A * std::exp(m_b * shared_data.logT - Ea_R * shared_data.recipT);
127 }
128
129 //! Evaluate derivative of reaction rate with respect to temperature
130 //! divided by reaction rate
131 /*!
132 * This method does not consider potential changes due to a changed reaction
133 * enthalpy. A corresponding warning is raised.
134 * @param shared_data data shared by all reactions of a given type
135 */
136 double ddTScaledFromStruct(const BlowersMaselData& shared_data) const;
137
138protected:
139 //! Return the effective activation energy (a function of the delta H of reaction)
140 //! divided by the gas constant (that is, the activation temperature) [K]
141 //! @internal The enthalpy change of reaction is not an independent parameter
142 double effectiveActivationEnergy_R(double deltaH_R) const {
143 if (deltaH_R < -4 * m_Ea_R) {
144 return 0.;
145 }
146 if (deltaH_R > 4 * m_Ea_R) {
147 return deltaH_R;
148 }
149 // m_E4_R is the bond dissociation energy "w" (in temperature units)
150 double vp = 2 * m_E4_R * ((m_E4_R + m_Ea_R) / (m_E4_R - m_Ea_R)); // in Kelvin
151 double vp_2w_dH = (vp - 2 * m_E4_R + deltaH_R); // (Vp - 2 w + dH)
152 return (m_E4_R + deltaH_R / 2) * (vp_2w_dH * vp_2w_dH) /
153 (vp * vp - 4 * m_E4_R * m_E4_R + deltaH_R * deltaH_R); // in Kelvin
154 }
155
156public:
157 virtual double activationEnergy() const override {
159 }
160
161 //! Return the bond dissociation energy *w* [J/kmol]
162 double bondEnergy() const {
163 return m_E4_R * GasConstant;
164 }
165
166 //! Return current enthalpy change of reaction [J/kmol]
167 double deltaH() const {
168 return m_deltaH_R * GasConstant;
169 }
170
171 //! Set current enthalpy change of reaction [J/kmol]
172 /*!
173 * @internal used for testing purposes only; note that this quantity is not an
174 * independent variable and will be overwritten during an update of the state.
175 *
176 * @warning This method is an experimental part of the %Cantera API and
177 * may be changed or removed without notice.
178 */
179 void setDeltaH(double deltaH) {
181 }
182
183protected:
184 //! Pairs of species indices and multiplers to calculate enthalpy change
185 std::vector<std::pair<size_t, double>> m_stoich_coeffs;
186
187 double m_deltaH_R; //!< enthalpy change of reaction (in temperature units)
188};
189
190}
191
192#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:399
Base class for Arrhenius-type Parameterizations.
Definition: Arrhenius.h:52
virtual void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition: Arrhenius.cpp:113
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition: Arrhenius.h:167
double m_A
Pre-exponential factor.
Definition: Arrhenius.h:164
double m_b
Temperature exponent.
Definition: Arrhenius.h:165
double m_Ea_R
Activation energy (in temperature units)
Definition: Arrhenius.h:166
Blowers Masel reaction rate type depends on the enthalpy of reaction.
double evalFromStruct(const BlowersMaselData &shared_data) const
Evaluate reaction rate.
virtual 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].
double bondEnergy() const
Return the bond dissociation energy w [J/kmol].
BlowersMaselRate()
Default constructor.
virtual double activationEnergy() const override
Return the activation energy Ea [J/kmol] The value corresponds to the constant specified by input par...
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].
std::vector< std::pair< size_t, double > > m_stoich_coeffs
Pairs of species indices and multiplers to calculate enthalpy change.
virtual const std::string type() const override
String identifying reaction rate specialization.
Public interface for kinetics managers.
Definition: Kinetics.h:114
A class template handling ReactionRate specializations.
Definition: MultiRate.h:21
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:184
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
Data container holding shared data specific to BlowersMaselRate.
int m_state_mf_number
integer that is incremented when composition changes
virtual void resize(size_t nSpecies, size_t nReactions, size_t nPhases) override
Update number of species, reactions and phases.
virtual 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
vector_fp partialMolarEnthalpies
partial molar enthalpies
Data container holding shared data used for ReactionRate calculation.
Definition: ReactionData.h:26
double recipT
inverse of temperature
Definition: ReactionData.h:111
virtual void update(double T)
Update data container based on temperature T
Definition: ReactionData.h:35
double logT
logarithm of temperature
Definition: ReactionData.h:110
Unit aggregation utility.
Definition: Units.h:99