Skip to content

Commit

Permalink
[kinetics] Track undeclared third body usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Aug 15, 2023
1 parent e00c23f commit 693beb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/cantera/kinetics/Kinetics.h
Expand Up @@ -1625,6 +1625,9 @@ class Kinetics
//! 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;
};
Expand Down
2 changes: 2 additions & 0 deletions src/kinetics/BulkKinetics.cpp
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/kinetics/Kinetics.cpp
Expand Up @@ -643,6 +643,9 @@ AnyMap Kinetics::parameters()
if (nReactions() == 0) {
out["reactions"] = "none";
}
if (m_hasUndeclaredThirdBodies) {
out["skip-undeclared-third-bodies"] = true;
}
}
return out;
}
Expand Down

0 comments on commit 693beb6

Please sign in to comment.