From 89eab1bb487764a39ac8ed75a5756cea2b58659b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 13 Mar 2014 21:35:49 +0000 Subject: [PATCH] [Thermo] Remove redundant implementations of logStandardConc For the cases where logStandardConc just calls standardConcentration, rely on the default implementation in class ThermoPhase. --- include/cantera/thermo/ConstDensityThermo.h | 6 ------ include/cantera/thermo/DebyeHuckel.h | 6 ------ include/cantera/thermo/HMWSoln.h | 7 ------- include/cantera/thermo/IdealGasPhase.h | 7 ------- include/cantera/thermo/IdealMolalSoln.h | 8 -------- include/cantera/thermo/IdealSolnGasVPSS.h | 7 ------- include/cantera/thermo/MolalityVPSSTP.h | 8 -------- include/cantera/thermo/PseudoBinaryVPSSTP.h | 7 ------- include/cantera/thermo/RedlichKwongMFTP.h | 7 ------- src/thermo/ConstDensityThermo.cpp | 5 ----- src/thermo/DebyeHuckel.cpp | 6 ------ src/thermo/HMWSoln.cpp | 6 ------ src/thermo/IdealGasPhase.cpp | 7 ------- src/thermo/IdealMolalSoln.cpp | 6 ------ src/thermo/IdealSolnGasVPSS.cpp | 6 ------ src/thermo/MolalityVPSSTP.cpp | 6 ------ src/thermo/PseudoBinaryVPSSTP.cpp | 6 ------ src/thermo/RedlichKwongMFTP.cpp | 6 ------ 18 files changed, 117 deletions(-) diff --git a/include/cantera/thermo/ConstDensityThermo.h b/include/cantera/thermo/ConstDensityThermo.h index b1f81b246..ebe294eb0 100644 --- a/include/cantera/thermo/ConstDensityThermo.h +++ b/include/cantera/thermo/ConstDensityThermo.h @@ -153,12 +153,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - //! Natural logarithm of the standard concentration of the kth species. - /*! - * @param k index of the species (defaults to zero) - */ - virtual doublereal logStandardConc(size_t k=0) const; - //! Get the Gibbs functions for the standard //! state of the species at the current T and P of the solution /*! diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 8686730c2..e07b1aa04 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -868,12 +868,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - //! Natural logarithm of the standard concentration of the kth species. - /*! - * @param k index of the species (defaults to zero) - */ - virtual doublereal logStandardConc(size_t k=0) const; - //! Returns the units of the standard and generalized concentrations. /*! * Note they have the same units, as their diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 3eb4ee1eb..c6303b07f 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -1706,13 +1706,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - //! Returns the natural logarithm of the standard - //! concentration of the kth species - /*! - * @param k Species index - */ - virtual doublereal logStandardConc(size_t k=0) const; - //! Returns the units of the standard and generalized concentrations. /*! * Note they have the same units, as their diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index 204e568e4..b216357da 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -554,13 +554,6 @@ public: */ virtual doublereal standardConcentration(size_t k = 0) const; - //! Returns the natural logarithm of the standard - //! concentration of the kth species - /*! - * @param k index of the species. (defaults to zero) - */ - virtual doublereal logStandardConc(size_t k = 0) const; - //! Get the array of non-dimensional activity coefficients at //! the current solution temperature, pressure, and solution concentration. /*! diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 1e1810aef..8644b96a6 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -407,14 +407,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - /*! - * Returns the natural logarithm of the standard - * concentration of the kth species - * - * @param k Species index - */ - virtual doublereal logStandardConc(size_t k=0) const; - /*! * Returns the units of the standard and generalized * concentrations Note they have the same units, as their diff --git a/include/cantera/thermo/IdealSolnGasVPSS.h b/include/cantera/thermo/IdealSolnGasVPSS.h index deb8f3ee7..1d9c81c2a 100644 --- a/include/cantera/thermo/IdealSolnGasVPSS.h +++ b/include/cantera/thermo/IdealSolnGasVPSS.h @@ -175,13 +175,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - //! Returns the natural logarithm of the standard - //! concentration of the kth species - /*! - * @param k index of the species. (defaults to zero) - */ - virtual doublereal logStandardConc(size_t k=0) const; - //! Returns the units of the standard and generalized concentrations. /*! * Note they have the same units, as their diff --git a/include/cantera/thermo/MolalityVPSSTP.h b/include/cantera/thermo/MolalityVPSSTP.h index 501b198c5..f2227ac57 100644 --- a/include/cantera/thermo/MolalityVPSSTP.h +++ b/include/cantera/thermo/MolalityVPSSTP.h @@ -431,14 +431,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - /** - * Returns the natural logarithm of the standard - * concentration of the kth species - * - * @param k species index - */ - virtual doublereal logStandardConc(size_t k=0) const; - /** * Returns the units of the standard and generalized * concentrations Note they have the same units, as their diff --git a/include/cantera/thermo/PseudoBinaryVPSSTP.h b/include/cantera/thermo/PseudoBinaryVPSSTP.h index 13a38dc80..3d0a89a38 100644 --- a/include/cantera/thermo/PseudoBinaryVPSSTP.h +++ b/include/cantera/thermo/PseudoBinaryVPSSTP.h @@ -135,13 +135,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - /** - * Returns the natural logarithm of the standard - * concentration of the kth species - * - * @param k species index - */ - virtual doublereal logStandardConc(size_t k=0) const; //@} /// @name Partial Molar Properties of the Solution //@{ diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 062ba5621..0618573e0 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -269,13 +269,6 @@ public: */ virtual doublereal standardConcentration(size_t k=0) const; - //! Returns the natural logarithm of the standard - //! concentration of the kth species - /*! - * @param k index of the species. (defaults to zero) - */ - virtual doublereal logStandardConc(size_t k=0) const; - //! Returns the units of the standard and generalized concentrations. /*! * Note they have the same units, as their diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index 26469e6e3..bc93997a6 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -117,11 +117,6 @@ doublereal ConstDensityThermo::standardConcentration(size_t k) const return molarDensity(); } -doublereal ConstDensityThermo::logStandardConc(size_t k) const -{ - return log(molarDensity()); -} - void ConstDensityThermo::getChemPotentials(doublereal* mu) const { doublereal vdp = (pressure() - m_spthermo->refPressure())/ diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index 8f862b455..742ba0726 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -350,12 +350,6 @@ doublereal DebyeHuckel::standardConcentration(size_t k) const return 1.0 / mvSolvent; } -doublereal DebyeHuckel::logStandardConc(size_t k) const -{ - double c_solvent = standardConcentration(k); - return log(c_solvent); -} - void DebyeHuckel::getUnitsStandardConc(double* uA, int k, int sizeUA) const { for (int i = 0; i < sizeUA; i++) { diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index 68f7d06c9..ae28ac989 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -812,12 +812,6 @@ doublereal HMWSoln::standardConcentration(size_t k) const return 1.0 / mvSolvent; } -doublereal HMWSoln::logStandardConc(size_t k) const -{ - double c_solvent = standardConcentration(k); - return log(c_solvent); -} - void HMWSoln::getUnitsStandardConc(double* uA, int k, int sizeUA) const { for (int i = 0; i < sizeUA; i++) { diff --git a/src/thermo/IdealGasPhase.cpp b/src/thermo/IdealGasPhase.cpp index af6191a0a..6e5d193f1 100644 --- a/src/thermo/IdealGasPhase.cpp +++ b/src/thermo/IdealGasPhase.cpp @@ -100,13 +100,6 @@ doublereal IdealGasPhase::standardConcentration(size_t k) const return p / (GasConstant * temperature()); } -doublereal IdealGasPhase::logStandardConc(size_t k) const -{ - _updateThermo(); - double p = pressure(); - return std::log(p / (GasConstant * temperature())); -} - void IdealGasPhase::getActivityCoefficients(doublereal* ac) const { for (size_t k = 0; k < m_kk; k++) { diff --git a/src/thermo/IdealMolalSoln.cpp b/src/thermo/IdealMolalSoln.cpp index 715fb25a8..5ecf13844 100644 --- a/src/thermo/IdealMolalSoln.cpp +++ b/src/thermo/IdealMolalSoln.cpp @@ -269,12 +269,6 @@ doublereal IdealMolalSoln::standardConcentration(size_t k) const return c0; } -doublereal IdealMolalSoln::logStandardConc(size_t k) const -{ - double c0 = standardConcentration(k); - return log(c0); -} - void IdealMolalSoln::getUnitsStandardConc(double* uA, int k, int sizeUA) const { int eos = eosType(); diff --git a/src/thermo/IdealSolnGasVPSS.cpp b/src/thermo/IdealSolnGasVPSS.cpp index 957b9f084..a8f85c853 100644 --- a/src/thermo/IdealSolnGasVPSS.cpp +++ b/src/thermo/IdealSolnGasVPSS.cpp @@ -217,12 +217,6 @@ doublereal IdealSolnGasVPSS::standardConcentration(size_t k) const } } -doublereal IdealSolnGasVPSS::logStandardConc(size_t k) const -{ - double c = standardConcentration(k); - return std::log(c); -} - void IdealSolnGasVPSS::getUnitsStandardConc(double* uA, int, int sizeUA) const { int eos = eosType(); diff --git a/src/thermo/MolalityVPSSTP.cpp b/src/thermo/MolalityVPSSTP.cpp index be3419554..9c92d5008 100644 --- a/src/thermo/MolalityVPSSTP.cpp +++ b/src/thermo/MolalityVPSSTP.cpp @@ -299,12 +299,6 @@ doublereal MolalityVPSSTP::standardConcentration(size_t k) const return -1.0; } -doublereal MolalityVPSSTP::logStandardConc(size_t k) const -{ - err("logStandardConc"); - return -1.0; -} - void MolalityVPSSTP::getActivities(doublereal* ac) const { err("getActivities"); diff --git a/src/thermo/PseudoBinaryVPSSTP.cpp b/src/thermo/PseudoBinaryVPSSTP.cpp index 988bbfd88..cfc001bf5 100644 --- a/src/thermo/PseudoBinaryVPSSTP.cpp +++ b/src/thermo/PseudoBinaryVPSSTP.cpp @@ -96,12 +96,6 @@ doublereal PseudoBinaryVPSSTP::standardConcentration(size_t k) const return -1.0; } -doublereal PseudoBinaryVPSSTP::logStandardConc(size_t k) const -{ - err("logStandardConc"); - return -1.0; -} - void PseudoBinaryVPSSTP::getElectrochemPotentials(doublereal* mu) const { getChemPotentials(mu); diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 901bc5446..32bf84db0 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -378,12 +378,6 @@ doublereal RedlichKwongMFTP::standardConcentration(size_t k) const return 1.0 / m_tmpV[k]; } -doublereal RedlichKwongMFTP::logStandardConc(size_t k) const -{ - double c = standardConcentration(k); - return std::log(c); -} - void RedlichKwongMFTP::getUnitsStandardConc(double* uA, int, int sizeUA) const { //int eos = eosType();