Skip to content

Commit

Permalink
[Kinetics] Simplify falloff serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Apr 18, 2023
1 parent 131ac1c commit d29cd1b
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/kinetics/Falloff.cpp
Expand Up @@ -342,22 +342,13 @@ void TroeRate::getParameters(AnyMap& node) const
FalloffRate::getParameters(node);

AnyMap params;
if (!valid()) {
// pass
} else if (m_lowRate.conversionUnits().factor() != 0.0) {
if (valid()) {
params["A"] = m_a;
params["T3"].setQuantity(1.0 / m_rt3, "K");
params["T1"].setQuantity(1.0 / m_rt1, "K");
if (std::abs(m_t2) > SmallNumber) {
params["T2"].setQuantity(m_t2, "K");
}
} else {
params["A"] = m_a;
params["T3"] = 1.0 / m_rt3;
params["T1"] = 1.0 / m_rt1;
if (std::abs(m_t2) > SmallNumber) {
params["T2"] = m_t2;
}
}
params.setFlowStyle();
node["Troe"] = std::move(params);
Expand Down Expand Up @@ -470,24 +461,14 @@ void SriRate::getParameters(AnyMap& node) const
FalloffRate::getParameters(node);

AnyMap params;
if (!valid()) {
// pass
} else if (m_lowRate.conversionUnits().factor() != 0.0) {
if (valid()) {
params["A"] = m_a;
params["B"].setQuantity(m_b, "K");
params["C"].setQuantity(m_c, "K");
if (m_d != 1.0 || m_e != 0.0) {
params["D"] = m_d;
params["E"] = m_e;
}
} else {
params["A"] = m_a;
params["B"] = m_b;
params["C"] = m_c;
if (m_d != 1.0 || m_e != 0.0) {
params["D"] = m_d;
params["E"] = m_e;
}
}
params.setFlowStyle();
node["SRI"] = std::move(params);
Expand Down

0 comments on commit d29cd1b

Please sign in to comment.