Cantera
Loading...
Searching...
No Matches
MultiStateResolvedVibrationalRelaxationRate.cpp
Go to the documentation of this file.
1//! @file MultiStateResolvedVibrationalRelaxationRate.cpp
2//! @since New in %Cantera 4.0
3
4// This file is part of Cantera. See License.txt in the top-level directory or
5// at https://cantera.org/license.txt for license and copyright information.
6
8
9namespace Cantera
10{
11
12namespace
13{
14
15const string WhereSetParameters =
16 "MultiStateResolvedVibrationalRelaxationRate::setParameters";
17
18} // namespace
19
20MultiStateResolvedVibrationalRelaxationRate::
21 MultiStateResolvedVibrationalRelaxationRate(
22 double A, double b, double C0, double C13, double C23)
24 A, b, C0, C13, C23, 2.0 / 3.0, 0.0, 1.0)
25{
26}
27
28MultiStateResolvedVibrationalRelaxationRate::
29 MultiStateResolvedVibrationalRelaxationRate(
30 const AnyMap& node,
31 const UnitStack& rate_units)
32{
33 setParameters(node, rate_units);
34}
35
37 const AnyMap& node,
38 const UnitStack& rate_units)
39{
41
42 const auto& rateMap =
43 node["rate-constant"].as<AnyMap>();
44
45 requireKeys(
46 rateMap, type(), WhereSetParameters, {"A", "b"});
47
48 forbidKeys(
49 rateMap, type(), WhereSetParameters,
50 {"n", "m", "Cn", "Cm", "Ea",
51 "a", "reference-pressure"});
52
53 m_A = node.units().convertRateCoeff(
54 rateMap["A"], conversionUnits());
55
56 m_b = rateMap["b"].asDouble();
57
58 m_C0 = rateMap.getDouble("C0", 0.0);
59 m_C13 = rateMap.getDouble("C13", 0.0);
60 m_Cm = rateMap.getDouble("C23", 0.0);
61
62 m_m = 2.0 / 3.0;
63
64 m_Cn = 0.0;
65 m_n = 1.0;
66
67 m_valid = true;
68}
69
71 AnyMap& rateNode) const
72{
73 getPreExponentialFactor(rateNode);
74
75 rateNode["b"] = m_b;
76 rateNode["C0"] = m_C0;
77 rateNode["C13"] = m_C13;
78 rateNode["C23"] = m_Cm;
79}
80
81} // namespace Cantera
Multi-state-resolved vibrational relaxation reaction rate.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
Definition AnyMap.h:640
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
void getRateParameters(AnyMap &rateNode) const override
Store the model-specific coefficients in the rate-constant node.
const string type() const override
String identifying reaction rate specialization.
const Units & conversionUnits() const
Get the units for converting the leading term in the reaction rate expression.
bool m_valid
Flag indicating whether reaction rate is set up correctly.
double convertRateCoeff(const AnyValue &val, const Units &dest) const
Convert a generic AnyValue node representing a reaction rate coefficient to the units specified in de...
Definition Units.cpp:634
Common implementation for vibrational relaxation reaction rates.
double m_n
Temperature exponent used by the Cn term.
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
double m_A
Pre-exponential constant for the reaction rate.
double m_C13
Coefficient multiplying .
double m_b
Temperature exponent for the reaction rate.
double m_m
Temperature exponent used by the Cm term.
double m_C0
Dimensionless constant in the exponential.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
Unit aggregation utility.
Definition Units.h:105