diff --git a/include/cantera/zeroD/Reactor.h b/include/cantera/zeroD/Reactor.h index 1c8e4f7d5..1cc0c20ca 100644 --- a/include/cantera/zeroD/Reactor.h +++ b/include/cantera/zeroD/Reactor.h @@ -55,13 +55,29 @@ public: void setKineticsMgr(Kinetics& kin); //! Disable changes in reactor composition due to chemical reactions. + //! @deprecated Use setChemistry instead. To be removed after Cantera 2.3 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. + //! @deprecated Use setChemistry instead. To be removed after Cantera 2.3 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. diff --git a/src/zeroD/Reactor.cpp b/src/zeroD/Reactor.cpp index d5622b4e9..d16fb0121 100644 --- a/src/zeroD/Reactor.cpp +++ b/src/zeroD/Reactor.cpp @@ -29,9 +29,9 @@ void Reactor::setKineticsMgr(Kinetics& kin) { m_kin = &kin; if (m_kin->nReactions() == 0) { - disableChemistry(); + setChemistry(false); } else { - enableChemistry(); + setChemistry(true); } }