Cantera 2.6.0
BlowersMaselRate.cpp
Go to the documentation of this file.
1//! @file BlowersMaselRate.cpp
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
10
11namespace Cantera
12{
13
14BlowersMaselData::BlowersMaselData()
15 : ready(false)
16 , density(NAN)
17 , m_state_mf_number(-1)
18{
19}
20
21void BlowersMaselData::update(double T) {
22 warn_user("BlowersMaselData::update",
23 "This method does not update the change of reaction enthalpy.");
24 ReactionData::update(T);
25}
26
27bool BlowersMaselData::update(const ThermoPhase& phase, const Kinetics& kin)
28{
29 double rho = phase.density();
30 int mf = phase.stateMFNumber();
31 double T = phase.temperature();
32 bool changed = false;
33 if (T != temperature) {
34 ReactionData::update(T);
35 changed = true;
36 }
37 if (changed || rho != density || mf != m_state_mf_number) {
38 density = rho;
39 m_state_mf_number = mf;
40 phase.getPartialMolarEnthalpies(partialMolarEnthalpies.data());
41 changed = true;
42 }
43 return changed;
44}
45
46BlowersMaselRate::BlowersMaselRate()
47 : m_deltaH_R(0.)
48{
49 m_Ea_str = "Ea0";
50 m_E4_str = "w";
51}
52
53BlowersMaselRate::BlowersMaselRate(double A, double b, double Ea0, double w)
54 : ArrheniusBase(A, b, Ea0)
55 , m_deltaH_R(0.)
56{
57 m_Ea_str = "Ea0";
58 m_E4_str = "w";
59 m_E4_R = w / GasConstant;
60}
61
63{
64 warn_user("BlowersMaselRate::ddTScaledFromStruct",
65 "Temperature derivative does not consider changes of reaction enthalpy.");
67 return (Ea_R * shared_data.recipT + m_b) * shared_data.recipT;
68}
69
71{
72 m_stoich_coeffs.clear();
73 for (const auto& sp : rxn.reactants) {
74 m_stoich_coeffs.emplace_back(kin.kineticsSpeciesIndex(sp.first), -sp.second);
75 }
76 for (const auto& sp : rxn.products) {
77 m_stoich_coeffs.emplace_back(kin.kineticsSpeciesIndex(sp.first), sp.second);
78 }
79}
80
81}
Header for Blowers-Masel reaction rates.
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Base class for Arrhenius-type Parameterizations.
Definition: Arrhenius.h:52
std::string m_Ea_str
The string for activation energy.
Definition: Arrhenius.h:172
std::string m_E4_str
The string for an optional 4th parameter.
Definition: Arrhenius.h:173
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition: Arrhenius.h:167
double m_b
Temperature exponent.
Definition: Arrhenius.h:165
virtual void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
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.
std::vector< std::pair< size_t, double > > m_stoich_coeffs
Pairs of species indices and multiplers to calculate enthalpy change.
Public interface for kinetics managers.
Definition: Kinetics.h:114
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
Definition: Kinetics.h:265
virtual double density() const
Density (kg/m^3).
Definition: Phase.h:679
int stateMFNumber() const
Return the State Mole Fraction Number.
Definition: Phase.h:858
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Composition products
Product species and stoichiometric coefficients.
Definition: Reaction.h:138
Composition reactants
Reactant species and stoichiometric coefficients.
Definition: Reaction.h:135
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: ThermoPhase.h:521
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition: global.h:245
Data container holding shared data specific to BlowersMaselRate.
double recipT
inverse of temperature
Definition: ReactionData.h:111