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
11 namespace 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 */
19 struct BlowersMaselData : public ReactionData
20{
21 BlowersMaselData();
22
23 virtual void update(double T) override;
24 virtual bool update(const ThermoPhase& phase, const Kinetics& kin) override;
25 using ReactionData::update;
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
36 protected:
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 */
70 class BlowersMaselRate : public ArrheniusBase
71{
72 public:
73 //! Default constructor.
74 BlowersMaselRate();
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={})
88 : BlowersMaselRate()
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 {
105 double Ea_R = effectiveActivationEnergy_R(m_deltaH_R);
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 }
116 m_deltaH_R /= GasConstant;
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 {
125 double Ea_R = effectiveActivationEnergy_R(m_deltaH_R);
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
138 protected:
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
156 public:
157 virtual double activationEnergy() const override {
158 return effectiveActivationEnergy_R(m_deltaH_R) * GasConstant;
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) {
180 m_deltaH_R = deltaH / GasConstant;
181 }
182
183 protected:
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
Arrhenius.h
Header for reaction rates that involve Arrhenius-type kinetics.
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::ArrheniusBase
Base class for Arrhenius-type Parameterizations.
Definition: Arrhenius.h:52
Cantera::ArrheniusBase::setParameters
virtual void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition: Arrhenius.cpp:113
Cantera::ArrheniusBase::m_E4_R
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition: Arrhenius.h:167
Cantera::ArrheniusBase::m_A
double m_A
Pre-exponential factor.
Definition: Arrhenius.h:164
Cantera::ArrheniusBase::m_b
double m_b
Temperature exponent.
Definition: Arrhenius.h:165
Cantera::ArrheniusBase::m_Ea_R
double m_Ea_R
Activation energy (in temperature units)
Definition: Arrhenius.h:166
Cantera::BlowersMaselRate
Blowers Masel reaction rate type depends on the enthalpy of reaction.
Definition: BlowersMaselRate.h:71
Cantera::BlowersMaselRate::evalFromStruct
double evalFromStruct(const BlowersMaselData &shared_data) const
Evaluate reaction rate.
Definition: BlowersMaselRate.h:124
Cantera::BlowersMaselRate::setContext
virtual void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
Definition: BlowersMaselRate.cpp:70
Cantera::BlowersMaselRate::newMultiRate
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
Definition: BlowersMaselRate.h:93
Cantera::BlowersMaselRate::evalRate
double evalRate(double logT, double recipT) const
Evaluate reaction rate.
Definition: BlowersMaselRate.h:104
Cantera::BlowersMaselRate::deltaH
double deltaH() const
Return current enthalpy change of reaction [J/kmol].
Definition: BlowersMaselRate.h:167
Cantera::BlowersMaselRate::bondEnergy
double bondEnergy() const
Return the bond dissociation energy w [J/kmol].
Definition: BlowersMaselRate.h:162
Cantera::BlowersMaselRate::BlowersMaselRate
BlowersMaselRate()
Default constructor.
Definition: BlowersMaselRate.cpp:46
Cantera::BlowersMaselRate::activationEnergy
virtual double activationEnergy() const override
Return the activation energy Ea [J/kmol] The value corresponds to the constant specified by input par...
Definition: BlowersMaselRate.h:157
Cantera::BlowersMaselRate::effectiveActivationEnergy_R
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...
Definition: BlowersMaselRate.h:142
Cantera::BlowersMaselRate::m_deltaH_R
double m_deltaH_R
enthalpy change of reaction (in temperature units)
Definition: BlowersMaselRate.h:187
Cantera::BlowersMaselRate::ddTScaledFromStruct
double ddTScaledFromStruct(const BlowersMaselData &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
Definition: BlowersMaselRate.cpp:62
Cantera::BlowersMaselRate::updateFromStruct
void updateFromStruct(const BlowersMaselData &shared_data)
Update information specific to reaction.
Definition: BlowersMaselRate.h:110
Cantera::BlowersMaselRate::setDeltaH
void setDeltaH(double deltaH)
Set current enthalpy change of reaction [J/kmol].
Definition: BlowersMaselRate.h:179
Cantera::BlowersMaselRate::m_stoich_coeffs
std::vector< std::pair< size_t, double > > m_stoich_coeffs
Pairs of species indices and multiplers to calculate enthalpy change.
Definition: BlowersMaselRate.h:185
Cantera::BlowersMaselRate::type
virtual const std::string type() const override
String identifying reaction rate specialization.
Definition: BlowersMaselRate.h:97
Cantera::Kinetics
Public interface for kinetics managers.
Definition: Kinetics.h:114
Cantera::MultiRate
A class template handling ReactionRate specializations.
Definition: MultiRate.h:21
Cantera::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::vector_fp
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
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
Cantera::BlowersMaselData
Data container holding shared data specific to BlowersMaselRate.
Definition: BlowersMaselRate.h:20
Cantera::BlowersMaselData::m_state_mf_number
int m_state_mf_number
integer that is incremented when composition changes
Definition: BlowersMaselRate.h:37
Cantera::BlowersMaselData::resize
virtual void resize(size_t nSpecies, size_t nReactions, size_t nPhases) override
Update number of species, reactions and phases.
Definition: BlowersMaselRate.h:27
Cantera::BlowersMaselData::update
virtual void update(double T) override
Update data container based on temperature T
Definition: BlowersMaselRate.cpp:21
Cantera::BlowersMaselData::ready
bool ready
boolean indicating whether vectors are accessible
Definition: BlowersMaselRate.h:32
Cantera::BlowersMaselData::density
double density
used to determine if updates are needed
Definition: BlowersMaselRate.h:33
Cantera::BlowersMaselData::partialMolarEnthalpies
vector_fp partialMolarEnthalpies
partial molar enthalpies
Definition: BlowersMaselRate.h:34
Cantera::ReactionData
Data container holding shared data used for ReactionRate calculation.
Definition: ReactionData.h:26
Cantera::ReactionData::recipT
double recipT
inverse of temperature
Definition: ReactionData.h:111
Cantera::ReactionData::update
virtual void update(double T)
Update data container based on temperature T
Definition: ReactionData.h:35
Cantera::ReactionData::logT
double logT
logarithm of temperature
Definition: ReactionData.h:110
Cantera::UnitStack
Unit aggregation utility.
Definition: Units.h:99