13 : m_negativeA_ok(false)
20 , m_rate_units(
Units(0.))
25 : m_negativeA_ok(false)
31 , m_rate_units(
Units(0.))
59 if (rate_map[
m_A_str].is<std::string>()) {
61 "Specification of units is not supported for pre-exponential "
62 "factor when\ncreating a standalone 'ReactionRate' object.");
76 auto& rate_vec = rate.
asVector<AnyValue>(2, 4);
78 m_b = rate_vec[1].asDouble();
79 if (rate_vec.size() > 2) {
82 if (rate_vec.size() > 3) {
93 if (std::isnan(
m_A)) {
103 node[
"__unconvertible__"] =
true;
117 if (!node.
hasKey(
"rate-constant")) {
126 node[
"negative-A"] =
true;
130 if (!rateNode.
empty()) {
132 node[
"rate-constant"] = std::move(rateNode);
134 if (
type() !=
"Arrhenius") {
135 node[
"type"] =
type();
142 if (equation ==
"") {
144 "Detected negative pre-exponential factor (A={}).\n"
145 "Enable 'allowNegativePreExponentialFactor' to suppress "
146 "this message.",
m_A);
149 "Undeclared negative pre-exponential factor found in reaction '{}'",
156 if (isnan(
m_A) || isnan(
m_b)) {
158 "Rate object for reaction '{}' is not configured.", equation);
Header for reaction rates that involve Arrhenius-type kinetics.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
A map of string keys to values whose type can vary at runtime.
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
bool empty() const
Return boolean indicating whether AnyMap is empty.
bool getBool(const std::string &key, bool default_) const
If key exists, return it as a bool, otherwise return default_.
void setFlowStyle(bool flow=true)
Use "flow" style when outputting this AnyMap to YAML.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
A wrapper for a variable whose type is determined at runtime.
bool empty() const
Return boolean indicating whether AnyValue is empty.
const std::vector< T > & asVector(size_t nMin=npos, size_t nMax=npos) const
Return the held value, if it is a vector of type T.
bool is() const
Returns true if the held value is of the specified type.
const T & as() const
Get the value of this key as the specified type.
std::string m_Ea_str
The string for activation energy.
virtual void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
virtual void check(const std::string &equation, const AnyMap &node) override
Check rate expression.
std::string m_E4_str
The string for an optional 4th parameter.
Units m_rate_units
Reaction rate units.
std::string m_A_str
The string for temperature exponent.
double m_E4_R
Optional 4th energy parameter (in temperature units)
void getRateParameters(AnyMap &node) const
Return parameters.
virtual void getParameters(AnyMap &node) const override
Get parameters.
double m_A
Pre-exponential factor.
virtual void validate(const std::string &equation, const Kinetics &kin) override
Validate the reaction rate expression.
void setRateParameters(const AnyValue &rate, const UnitSystem &units, const UnitStack &rate_units)
Perform object setup based on AnyValue node information.
double m_order
Reaction order.
bool m_negativeA_ok
Flag indicating whether negative A values are permitted.
double m_b
Temperature exponent.
ArrheniusBase()
Default constructor.
void setRateUnits(const UnitStack &rate_units)
Set units of the reaction rate expression.
double m_logA
Logarithm of pre-exponential factor.
double m_Ea_R
Activation energy (in temperature units)
std::string m_b_str
The string for temperature exponent.
Base class for exceptions thrown by Cantera classes.
Public interface for kinetics managers.
doublereal temperature() const
Temperature (K).
virtual void setParameters(const AnyMap &node, const UnitStack &units)
Set parameters.
virtual const std::string type() const =0
String identifying reaction rate specialization.
Base class for a phase with thermodynamic properties.
double convert(double value, const std::string &src, const std::string &dest) const
Convert value from the units of src to the units of dest.
double convertActivationEnergy(double value, const std::string &src, const std::string &dest) const
Convert value from the units of src to the units of dest, allowing for the different dimensions that ...
A representation of the units associated with a dimensional quantity.
double factor() const
Return the factor for converting from this unit to Cantera's base units.
Namespace for the Cantera kernel.
const double GasConstant
Universal Gas Constant [J/kmol/K].
virtual bool update(const ThermoPhase &phase, const Kinetics &kin)
Update data container based on thermodynamic phase state.
double temperature
temperature
Unit aggregation utility.