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:
parent
fea1a36294
commit
c344b4c0f8
2 changed files with 20 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ void Reactor::setKineticsMgr(Kinetics& kin)
|
|||
{
|
||||
m_kin = &kin;
|
||||
if (m_kin->nReactions() == 0) {
|
||||
disableChemistry();
|
||||
setChemistry(false);
|
||||
} else {
|
||||
enableChemistry();
|
||||
setChemistry(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue