From 2dfc551925c368ab6dbe35fe3127ce5d37481d2f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 12 Mar 2013 21:45:26 +0000 Subject: [PATCH] Allow GasKinetics to more easily support derived classes Partial cherry-pick of r2181 that doesn't change the interface for existing derived classes. --- include/cantera/kinetics/GasKinetics.h | 10 ++++++++-- src/kinetics/GasKinetics.cpp | 14 +++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/cantera/kinetics/GasKinetics.h b/include/cantera/kinetics/GasKinetics.h index 437caf111..908aed185 100644 --- a/include/cantera/kinetics/GasKinetics.h +++ b/include/cantera/kinetics/GasKinetics.h @@ -347,14 +347,20 @@ public: 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. //! Currently the enhanced collision partner concentrations are updated //! here, as well as the pressure-dependent portion of P-log and Chebyshev //! reactions. - void _update_rates_C(); + void _update_rates_C() { + update_rates_C(); + } //@} diff --git a/src/kinetics/GasKinetics.cpp b/src/kinetics/GasKinetics.cpp index 32c633a2a..fcf6239ec 100644 --- a/src/kinetics/GasKinetics.cpp +++ b/src/kinetics/GasKinetics.cpp @@ -156,7 +156,7 @@ void GasKinetics:: update_C() {} //==================================================================================================================== void GasKinetics:: -_update_rates_T() +update_rates_T() { doublereal T = thermo().temperature(); m_logStandConc = log(thermo().standardConcentration()); @@ -188,7 +188,7 @@ _update_rates_T() //==================================================================================================================== void GasKinetics:: -_update_rates_C() +update_rates_C() { thermo().getActivityConcentrations(&m_conc[0]); doublereal ctot = thermo().molarDensity(); @@ -247,7 +247,7 @@ void GasKinetics::updateKc() */ void GasKinetics::getEquilibriumConstants(doublereal* kc) { - _update_rates_T(); + update_rates_T(); thermo().getStandardChemPotentials(&m_grt[0]); fill(m_rkcn.begin(), m_rkcn.end(), 0.0); @@ -501,8 +501,8 @@ void GasKinetics::processFalloffReactions() //==================================================================================================================== void GasKinetics::updateROP() { - _update_rates_C(); - _update_rates_T(); + update_rates_C(); + update_rates_T(); if (m_ROP_ok) { return; @@ -558,8 +558,8 @@ void GasKinetics::updateROP() void GasKinetics:: getFwdRateConstants(doublereal* kfwd) { - _update_rates_C(); - _update_rates_T(); + update_rates_C(); + update_rates_T(); // copy rate coefficients into ropf copy(m_rfn.begin(), m_rfn.end(), m_ropf.begin());