Skip to content

Commit

Permalink
Allow GasKinetics to more easily support derived classes
Browse files Browse the repository at this point in the history
Partial cherry-pick of r2181 that doesn't change the interface for existing
derived classes.
  • Loading branch information
speth committed Mar 12, 2013
1 parent 83cca43 commit 2dfc551
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
10 changes: 8 additions & 2 deletions include/cantera/kinetics/GasKinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,20 @@ class GasKinetics : public Kinetics
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();
}

//@}

Expand Down
14 changes: 7 additions & 7 deletions src/kinetics/GasKinetics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -188,7 +188,7 @@ _update_rates_T()
//====================================================================================================================

void GasKinetics::
_update_rates_C()
update_rates_C()
{
thermo().getActivityConcentrations(&m_conc[0]);
doublereal ctot = thermo().molarDensity();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 2dfc551

Please sign in to comment.