Cantera
Loading...
Searching...
No Matches
ConstantVibrationalRelaxationRate.cpp
Go to the documentation of this file.
1//! @file ConstantVibrationalRelaxationRate.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 "ConstantVibrationalRelaxationRate::setParameters";
17
18} // namespace
19
20ConstantVibrationalRelaxationRate::
21 ConstantVibrationalRelaxationRate(
22 const AnyMap& node, const UnitStack& rate_units)
23{
24 setParameters(node, rate_units);
25}
26
27ConstantVibrationalRelaxationRate::
28 ConstantVibrationalRelaxationRate(double A)
29 : VibrationalRelaxationRate(A, 0.0, 0.0, 0.0, 0.0,
30 2.0 / 3.0, 0.0, 1.0)
31{
32}
33
35 const AnyMap& node, const UnitStack& rate_units)
36{
38
39 const auto& rateMap =
40 node["rate-constant"].as<AnyMap>();
41
42 requireKeys(
43 rateMap, type(), WhereSetParameters,
44 {"A"});
45
46 forbidKeys(
47 rateMap, type(), WhereSetParameters,
48 {"b", "C23", "C0", "C13", "Cm", "m",
49 "Cn", "n", "Ea", "K", "a",
50 "reference-pressure"});
51
52 m_A = node.units().convertRateCoeff(
53 rateMap["A"], conversionUnits());
54
55 m_b = 0.0;
56 m_C0 = 0.0;
57 m_C13 = 0.0;
58 m_Cm = 0.0;
59 m_m = 2.0 / 3.0;
60 m_Cn = 0.0;
61 m_n = 1.0;
62
63 m_valid = true;
64}
65
67{
68 getPreExponentialFactor(rateNode);
69}
70
71} // namespace Cantera
Constant 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