From ec0276ab64651d53023e1e87e575a4e49f132ae8 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Wed, 18 Feb 2009 22:31:32 +0000 Subject: [PATCH] Added another interface function --- Cantera/src/thermo/ThermoPhase.cpp | 7 +++++++ Cantera/src/thermo/ThermoPhase.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Cantera/src/thermo/ThermoPhase.cpp b/Cantera/src/thermo/ThermoPhase.cpp index ef8bc00ca..891afb291 100644 --- a/Cantera/src/thermo/ThermoPhase.cpp +++ b/Cantera/src/thermo/ThermoPhase.cpp @@ -145,6 +145,13 @@ namespace Cantera { for (k = 0; k < nsp; k++) a[k] /= standardConcentration(k); } + void ThermoPhase::getLNActivityCoefficients(doublereal *const lnac) const { + getActivityCoefficients(lnac); + for (int k = 0; k < m_kk; k++) { + lnac[k] = std::log(lnac[k]); + } + } + void ThermoPhase::setState_TPX(doublereal t, doublereal p, const doublereal* x) { setMoleFractions(x); setTemperature(t); setPressure(p); diff --git a/Cantera/src/thermo/ThermoPhase.h b/Cantera/src/thermo/ThermoPhase.h index f580dcc19..f6c06b918 100755 --- a/Cantera/src/thermo/ThermoPhase.h +++ b/Cantera/src/thermo/ThermoPhase.h @@ -1076,6 +1076,8 @@ namespace Cantera { //! Get the array of non-dimensional activities at //! the current solution temperature, pressure, and solution concentration. /*! + * Note, for molality based formulations, this returns the + * molality based activities. * * We resolve this function at this level by calling * on the activityConcentration function. However, @@ -1098,6 +1100,8 @@ namespace Cantera { err("getActivityCoefficients"); } } + + virtual void getLNActivityCoefficients(doublereal * const lnac) const; //@} /// @name Partial Molar Properties of the Solution