Skip to content

Commit

Permalink
[Kinetics] Catch undetected third bodies in calculateRateCoeffUnits
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Apr 20, 2021
1 parent 34c8829 commit 3a459cb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/kinetics/Reaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,17 @@ std::string ThreeBodyReaction::productString() const {
void ThreeBodyReaction::calculateRateCoeffUnits(const Kinetics& kin)
{
ElementaryReaction::calculateRateCoeffUnits(kin);
const ThermoPhase& rxn_phase = kin.thermo(kin.reactionPhaseIndex());
rate_units *= rxn_phase.standardConcentrationUnits().pow(-1);
bool specified = false;
for (const auto& reac : reactants) {
if (reac.first != "M" && products.count(reac.first)) {
// detected specified third-body collision partner
specified = true;
}
}
if (!specified) {
const ThermoPhase& rxn_phase = kin.thermo(kin.reactionPhaseIndex());
rate_units *= rxn_phase.standardConcentrationUnits().pow(-1);
}
}

void ThreeBodyReaction::getParameters(AnyMap& reactionNode) const
Expand Down

0 comments on commit 3a459cb

Please sign in to comment.