[kinetics] Track undeclared third body usage

This commit is contained in:
Ingmar Schoegl 2023-08-12 07:34:04 -05:00
parent e00c23ffc3
commit 693beb6de8
3 changed files with 8 additions and 0 deletions

View File

@ -1625,6 +1625,9 @@ protected:
//! See skipUndeclaredThirdBodies()
bool m_skipUndeclaredThirdBodies = false;
//! Flag indicating whether reactions include undeclared third bodies
bool m_hasUndeclaredThirdBodies = false;
//! reference to Solution
std::weak_ptr<Solution> m_root;
};

View File

@ -88,6 +88,8 @@ void BulkKinetics::addThirdBody(shared_ptr<Reaction> r)
throw CanteraError("BulkKinetics::addThirdBody", "Found third-body"
" efficiency for undefined species '{}' while adding reaction '{}'",
name, r->equation());
} else {
m_hasUndeclaredThirdBodies = true;
}
}
m_multi_concm.install(nReactions() - 1, efficiencies,

View File

@ -643,6 +643,9 @@ AnyMap Kinetics::parameters()
if (nReactions() == 0) {
out["reactions"] = "none";
}
if (m_hasUndeclaredThirdBodies) {
out["skip-undeclared-third-bodies"] = true;
}
}
return out;
}