Cantera 2.6.0
|
Base class for falloff rate calculators. More...
#include <Falloff.h>
Public Member Functions | |
FalloffRate (const AnyMap &node, const UnitStack &rate_units={}) | |
void | init (const vector_fp &c) |
Initialize. More... | |
virtual void | setFalloffCoeffs (const vector_fp &c) |
Set coefficients of the falloff parameterization. More... | |
virtual void | getFalloffCoeffs (vector_fp &c) const |
Retrieve coefficients of the falloff parameterization. More... | |
virtual void | updateTemp (double T, double *work) const |
Update the temperature-dependent portions of the falloff function, if any, and store them in the 'work' array. More... | |
virtual double | F (double pr, const double *work) const |
The falloff function. More... | |
double | evalF (double T, double conc3b) |
Evaluate falloff function at current conditions. More... | |
virtual size_t | workSize () const |
The size of the work array required. More... | |
virtual const std::string | type () const |
String identifying reaction rate specialization. More... | |
virtual size_t | nParameters () const |
Returns the number of parameters used by this parameterization. More... | |
virtual void | setParameters (const AnyMap &node, const UnitStack &rate_units) |
Set parameters. More... | |
virtual void | getParameters (double *params) const |
Get the values of the parameters for this object. More... | |
virtual void | getParameters (AnyMap &node) const |
Get parameters. More... | |
virtual double | evalFromStruct (const FalloffData &shared_data) |
Evaluate reaction rate. More... | |
void | check (const std::string &equation, const AnyMap &node) |
Check basic syntax and settings of reaction rate expression. More... | |
virtual void | validate (const std::string &equation, const Kinetics &kin) |
Validate the reaction rate expression. More... | |
bool | allowNegativePreExponentialFactor () const |
Get flag indicating whether negative A values are permitted. More... | |
void | setAllowNegativePreExponentialFactor (bool value) |
Set flag indicating whether negative A values are permitted. More... | |
bool | chemicallyActivated () const |
Get flag indicating whether reaction is chemically activated. More... | |
void | setChemicallyActivated (bool activated) |
Set flag indicating whether reaction is chemically activated. More... | |
ArrheniusRate & | lowRate () |
Get reaction rate in the low-pressure limit. More... | |
void | setLowRate (const ArrheniusRate &low) |
Set reaction rate in the low-pressure limit. More... | |
ArrheniusRate & | highRate () |
Get reaction rate in the high-pressure limit. More... | |
void | setHighRate (const ArrheniusRate &high) |
Set reaction rate in the high-pressure limit. More... | |
Public Member Functions inherited from ReactionRate | |
ReactionRate (const ReactionRate &other) | |
ReactionRate & | operator= (const ReactionRate &other) |
virtual unique_ptr< MultiRateBase > | newMultiRate () const |
Create a rate evaluator for reactions of a particular derived type. More... | |
AnyMap | parameters () const |
Return the parameters such that an identical Reaction could be reconstructed using the newReaction() function. More... | |
virtual void | validate (const std::string &equation) |
Validate the reaction rate expression (legacy call) More... | |
size_t | rateIndex () const |
Reaction rate index within kinetics evaluator. More... | |
void | setRateIndex (size_t idx) |
Set reaction rate index within kinetics evaluator. More... | |
virtual void | setContext (const Reaction &rxn, const Kinetics &kin) |
Set context of reaction rate evaluation. More... | |
double | eval (double T) |
Evaluate reaction rate based on temperature. More... | |
double | eval (double T, double extra) |
Evaluate reaction rate based on temperature and an extra parameter. More... | |
double | eval (double T, const std::vector< double > &extra) |
Evaluate reaction rate based on temperature and an extra vector parameter. More... | |
Protected Attributes | |
ArrheniusRate | m_lowRate |
The reaction rate in the low-pressure limit. More... | |
ArrheniusRate | m_highRate |
The reaction rate in the high-pressure limit. More... | |
bool | m_chemicallyActivated |
Flag labeling reaction as chemically activated. More... | |
bool | m_negativeA_ok |
Flag indicating whether negative A values are permitted. More... | |
double | m_rc_low |
Evaluated reaction rate in the low-pressure limit. More... | |
double | m_rc_high |
Evaluated reaction rate in the high-pressure limit. More... | |
vector_fp | m_work |
Work vector. More... | |
Protected Attributes inherited from ReactionRate | |
AnyMap | m_input |
Input data used for specific models. More... | |
size_t | m_rate_index |
Index of reaction rate within kinetics evaluator. More... | |
Additional Inherited Members |
Base class for falloff rate calculators.
Each instance of a subclass of FalloffRate calculates the falloff reaction rate based on specific implementations of the falloff function.
|
inline |
|
inline |
void init | ( | const vector_fp & | c | ) |
Initialize.
Must be called before any other method is invoked.
c | Vector of coefficients of the parameterization. The number and meaning of these coefficients is subclass-dependent. |
Definition at line 85 of file Falloff.cpp.
|
virtual |
Set coefficients of the falloff parameterization.
c | Vector of coefficients of the parameterization. The number and meaning of these coefficients is subclass-dependent. |
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 116 of file Falloff.cpp.
|
virtual |
Retrieve coefficients of the falloff parameterization.
c | Vector of coefficients of the parameterization. The number and meaning of these coefficients is subclass-dependent. |
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 125 of file Falloff.cpp.
|
inlinevirtual |
Update the temperature-dependent portions of the falloff function, if any, and store them in the 'work' array.
If not overloaded, the default behavior is to do nothing.
T | Temperature [K]. |
work | storage space for intermediate results. |
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 128 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct().
|
inlinevirtual |
The falloff function.
This is defined so that the rate coefficient is
\[ k = F(Pr)\frac{Pr}{1 + Pr}. \]
Here \( Pr \) is the reduced pressure, defined by
\[ Pr = \frac{k_0 [M]}{k_\infty}. \]
pr | reduced pressure (dimensionless). |
work | array of size workSize() containing cached temperature-dependent intermediate results from a prior call to updateTemp. |
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 147 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct().
|
inline |
|
inlinevirtual |
|
inlinevirtual |
String identifying reaction rate specialization.
Implements ReactionRate.
Reimplemented in LindemannRate, TroeRate, SriRate, and TsangRate.
|
inlinevirtual |
Set parameters.
node | AnyMap object containing reaction rate specification |
units | unit definitions specific to rate information |
Reimplemented from ReactionRate.
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 130 of file Falloff.cpp.
References AnyMap::empty(), AnyMap::getBool(), AnyMap::hasKey(), UnitStack::join(), UnitStack::size(), and AnyMap::units().
|
inlinevirtual |
|
virtual |
Get parameters.
node | AnyMap containing rate information Store the parameters of a ReactionRate needed to reconstruct an identical object. Does not include user-defined fields available in the m_input map. |
Reimplemented from ReactionRate.
Reimplemented in TroeRate, SriRate, and TsangRate.
Definition at line 163 of file Falloff.cpp.
References AnyMap::clear(), and AnyMap::empty().
|
inlinevirtual |
Evaluate reaction rate.
shared_data | data shared by all reactions of a given type |
Definition at line 193 of file Falloff.h.
References FalloffData::conc_3b, ArrheniusRate::evalRate(), FalloffRate::F(), ReactionData::logT, FalloffRate::m_chemicallyActivated, FalloffRate::m_highRate, FalloffRate::m_lowRate, ReactionRate::m_rate_index, FalloffRate::m_rc_high, FalloffRate::m_rc_low, FalloffRate::m_work, FalloffData::ready, ReactionData::recipT, Cantera::SmallNumber, ReactionData::temperature, and FalloffRate::updateTemp().
|
virtual |
Check basic syntax and settings of reaction rate expression.
Reimplemented from ReactionRate.
Definition at line 185 of file Falloff.cpp.
|
virtual |
Validate the reaction rate expression.
Reimplemented from ReactionRate.
Definition at line 203 of file Falloff.cpp.
|
inline |
Get flag indicating whether negative A values are permitted.
Definition at line 221 of file Falloff.h.
References FalloffRate::m_negativeA_ok.
|
inline |
Set flag indicating whether negative A values are permitted.
Definition at line 226 of file Falloff.h.
References FalloffRate::m_negativeA_ok.
|
inline |
Get flag indicating whether reaction is chemically activated.
Definition at line 231 of file Falloff.h.
References FalloffRate::m_chemicallyActivated.
|
inline |
Set flag indicating whether reaction is chemically activated.
Definition at line 236 of file Falloff.h.
References FalloffRate::m_chemicallyActivated.
|
inline |
Get reaction rate in the low-pressure limit.
Definition at line 241 of file Falloff.h.
References FalloffRate::m_lowRate.
void setLowRate | ( | const ArrheniusRate & | low | ) |
Set reaction rate in the low-pressure limit.
Definition at line 90 of file Falloff.cpp.
References ArrheniusBase::check(), ArrheniusBase::preExponentialFactor(), and ArrheniusBase::setAllowNegativePreExponentialFactor().
|
inline |
Get reaction rate in the high-pressure limit.
Definition at line 249 of file Falloff.h.
References FalloffRate::m_highRate.
void setHighRate | ( | const ArrheniusRate & | high | ) |
Set reaction rate in the high-pressure limit.
Definition at line 103 of file Falloff.cpp.
References ArrheniusBase::check(), ArrheniusBase::preExponentialFactor(), and ArrheniusBase::setAllowNegativePreExponentialFactor().
|
protected |
The reaction rate in the low-pressure limit.
Definition at line 257 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct(), and FalloffRate::lowRate().
|
protected |
The reaction rate in the high-pressure limit.
Definition at line 258 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct(), and FalloffRate::highRate().
|
protected |
Flag labeling reaction as chemically activated.
Definition at line 260 of file Falloff.h.
Referenced by FalloffRate::chemicallyActivated(), FalloffRate::evalFromStruct(), and FalloffRate::setChemicallyActivated().
|
protected |
Flag indicating whether negative A values are permitted.
Definition at line 261 of file Falloff.h.
Referenced by FalloffRate::allowNegativePreExponentialFactor(), and FalloffRate::setAllowNegativePreExponentialFactor().
|
protected |
Evaluated reaction rate in the low-pressure limit.
Definition at line 263 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct().
|
protected |
Evaluated reaction rate in the high-pressure limit.
Definition at line 264 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct().
|
protected |
Work vector.
Definition at line 265 of file Falloff.h.
Referenced by FalloffRate::evalFromStruct(), SriRate::SriRate(), TroeRate::TroeRate(), and TsangRate::TsangRate().