[Kinetics] Fix handling of undeclared third bodies in Falloff reactions
This commit is contained in:
parent
08f0fb5bf6
commit
092937fd06
2 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#define CT_THIRDBODYCALC_H
|
||||
|
||||
#include "cantera/base/utilities.h"
|
||||
#include <cassert>
|
||||
|
||||
namespace Cantera
|
||||
{
|
||||
|
|
@ -26,6 +27,7 @@ public:
|
|||
iter != enhanced.end();
|
||||
++iter)
|
||||
{
|
||||
assert(iter->first != npos);
|
||||
m_species.back().push_back(iter->first);
|
||||
m_eff.back().push_back(iter->second - dflt);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -359,7 +359,14 @@ void GasKinetics::addFalloffReaction(FalloffReaction& r)
|
|||
for (Composition::const_iterator iter = r.third_body.efficiencies.begin();
|
||||
iter != r.third_body.efficiencies.end();
|
||||
++iter) {
|
||||
efficiencies[kineticsSpeciesIndex(iter->first)] = iter->second;
|
||||
size_t k = kineticsSpeciesIndex(iter->first);
|
||||
if (k != npos) {
|
||||
efficiencies[k] = iter->second;
|
||||
} else if (!m_skipUndeclaredThirdBodies) {
|
||||
throw CanteraError("GasKinetics::addTFalloffReaction", "Found "
|
||||
"third-body efficiency for undefined species '" + iter->first +
|
||||
"' while adding reaction '" + r.equation() + "'");
|
||||
}
|
||||
}
|
||||
m_falloff_concm.install(m_nfall, efficiencies,
|
||||
r.third_body.default_efficiency);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue