Add methods Reactor::setChemistry and chemistryEnabled

These functions mirror the setEnergy and energyEnabled methods.
The enableChemistry and disableChemistry methods are deprecated.
This commit is contained in:
Bryan W. Weber 2016-08-09 13:23:18 -04:00 committed by Bryan W. Weber
parent fea1a36294
commit c344b4c0f8
No known key found for this signature in database
GPG key ID: DEE60DAAA4195429
2 changed files with 20 additions and 4 deletions

View file

@ -55,13 +55,29 @@ public:
void setKineticsMgr(Kinetics& kin); void setKineticsMgr(Kinetics& kin);
//! Disable changes in reactor composition due to chemical reactions. //! Disable changes in reactor composition due to chemical reactions.
//! @deprecated Use setChemistry instead. To be removed after Cantera 2.3
void disableChemistry() { void disableChemistry() {
m_chem = false; warn_deprecated("Reactor::disableChemistry",
"Use setChemistry instead. To be removed after Cantera 2.3");
setChemistry(false);
} }
//! Enable changes in reactor composition due to chemical reactions. //! Enable changes in reactor composition due to chemical reactions.
//! @deprecated Use setChemistry instead. To be removed after Cantera 2.3
void enableChemistry() { void enableChemistry() {
m_chem = true; warn_deprecated("Reactor::enableChemistry",
"Use setChemistry instead. To be removed after Cantera 2.3");
setChemistry(true);
}
//! Enable or disable changes in reactor composition due to chemical reactions.
void setChemistry(bool cflag = true) {
m_chem = cflag;
}
//! Returns `true` if changes in the reactor composition due to chemical reactions are enabled.
bool chemistryEnabled() const {
return m_chem;
} }
//! Set the energy equation on or off. //! Set the energy equation on or off.

View file

@ -29,9 +29,9 @@ void Reactor::setKineticsMgr(Kinetics& kin)
{ {
m_kin = &kin; m_kin = &kin;
if (m_kin->nReactions() == 0) { if (m_kin->nReactions() == 0) {
disableChemistry(); setChemistry(false);
} else { } else {
enableChemistry(); setChemistry(true);
} }
} }