Allow GasKinetics to more easily support derived classes

Partial cherry-pick of r2181 that doesn't change the interface for existing
derived classes.
This commit is contained in:
Ray Speth 2013-03-12 21:45:26 +00:00
parent 83cca43a3b
commit 2dfc551925
2 changed files with 15 additions and 9 deletions

View file

@ -347,14 +347,20 @@ public:
return m_pgroups[i]; return m_pgroups[i];
} }
virtual void update_rates_T();
virtual void update_rates_C();
void _update_rates_T(); void _update_rates_T() {
update_rates_T();
}
//! Update properties that depend on concentrations. //! Update properties that depend on concentrations.
//! Currently the enhanced collision partner concentrations are updated //! Currently the enhanced collision partner concentrations are updated
//! here, as well as the pressure-dependent portion of P-log and Chebyshev //! here, as well as the pressure-dependent portion of P-log and Chebyshev
//! reactions. //! reactions.
void _update_rates_C(); void _update_rates_C() {
update_rates_C();
}
//@} //@}

View file

@ -156,7 +156,7 @@ void GasKinetics::
update_C() {} update_C() {}
//==================================================================================================================== //====================================================================================================================
void GasKinetics:: void GasKinetics::
_update_rates_T() update_rates_T()
{ {
doublereal T = thermo().temperature(); doublereal T = thermo().temperature();
m_logStandConc = log(thermo().standardConcentration()); m_logStandConc = log(thermo().standardConcentration());
@ -188,7 +188,7 @@ _update_rates_T()
//==================================================================================================================== //====================================================================================================================
void GasKinetics:: void GasKinetics::
_update_rates_C() update_rates_C()
{ {
thermo().getActivityConcentrations(&m_conc[0]); thermo().getActivityConcentrations(&m_conc[0]);
doublereal ctot = thermo().molarDensity(); doublereal ctot = thermo().molarDensity();
@ -247,7 +247,7 @@ void GasKinetics::updateKc()
*/ */
void GasKinetics::getEquilibriumConstants(doublereal* kc) void GasKinetics::getEquilibriumConstants(doublereal* kc)
{ {
_update_rates_T(); update_rates_T();
thermo().getStandardChemPotentials(&m_grt[0]); thermo().getStandardChemPotentials(&m_grt[0]);
fill(m_rkcn.begin(), m_rkcn.end(), 0.0); fill(m_rkcn.begin(), m_rkcn.end(), 0.0);
@ -501,8 +501,8 @@ void GasKinetics::processFalloffReactions()
//==================================================================================================================== //====================================================================================================================
void GasKinetics::updateROP() void GasKinetics::updateROP()
{ {
_update_rates_C(); update_rates_C();
_update_rates_T(); update_rates_T();
if (m_ROP_ok) { if (m_ROP_ok) {
return; return;
@ -558,8 +558,8 @@ void GasKinetics::updateROP()
void GasKinetics:: void GasKinetics::
getFwdRateConstants(doublereal* kfwd) getFwdRateConstants(doublereal* kfwd)
{ {
_update_rates_C(); update_rates_C();
_update_rates_T(); update_rates_T();
// copy rate coefficients into ropf // copy rate coefficients into ropf
copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin()); copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin());