From c431590dad215f4a1f7fc77210f4533c2bd38f61 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 21 Oct 2005 22:25:53 +0000 Subject: [PATCH] Filled out 2 missing functions to this ThermoPhase object: getIntEnergy_RT() and getIntEnergy_RT_ref(). --- Cantera/src/IdealGasPhase.cpp | 24 ++++++++++++++++++++++++ Cantera/src/IdealGasPhase.h | 13 +++++++++++++ 2 files changed, 37 insertions(+) diff --git a/Cantera/src/IdealGasPhase.cpp b/Cantera/src/IdealGasPhase.cpp index 8a99c8be2..4ec4c3678 100644 --- a/Cantera/src/IdealGasPhase.cpp +++ b/Cantera/src/IdealGasPhase.cpp @@ -148,6 +148,18 @@ namespace Cantera { } } + /** + * Returns the vector of nondimensional + * internal Energies of the standard state at the current temperature + * and pressure of the solution for each species. + */ + void IdealGasPhase::getIntEnergy_RT(doublereal *urt) const { + const array_fp& _h = enthalpy_RT_ref(); + for (int k = 0; k < m_kk; k++) { + urt[k] = _h[k] - 1.0; + } + } + /** * Get the nondimensional heat capacity at constant pressure * function for the species @@ -202,6 +214,18 @@ namespace Cantera { copy(_s.begin(), _s.end(), er); } + /** + * Returns the vector of nondimensional + * internal Energies of the reference state at the current temperature + * of the solution and the reference pressure for each species. + */ + void IdealGasPhase::getIntEnergy_RT_ref(doublereal *urt) const { + const array_fp& _h = enthalpy_RT_ref(); + for (int k = 0; k < m_kk; k++) { + urt[k] = _h[k] - 1.0; + } + } + /** * Returns the vector of nondimensional * constant pressure heat capacities of the reference state diff --git a/Cantera/src/IdealGasPhase.h b/Cantera/src/IdealGasPhase.h index 081eda449..285a7f208 100644 --- a/Cantera/src/IdealGasPhase.h +++ b/Cantera/src/IdealGasPhase.h @@ -318,6 +318,13 @@ namespace Cantera { */ virtual void getPureGibbs(doublereal* gpure) const; + /** + * Returns the vector of nondimensional + * internal Energies of the standard state at the current temperature + * and pressure of the solution for each species. + */ + virtual void getIntEnergy_RT(doublereal *urt) const; + /** * Get the nondimensional heat capacity at constant pressure * function for the species @@ -357,6 +364,12 @@ namespace Cantera { */ virtual void getEntropy_R_ref(doublereal *er) const; + /** + * Returns the vector of nondimensional + * internal Energies of the reference state at the current temperature + * of the solution and the reference pressure for each species. + */ + virtual void getIntEnergy_RT_ref(doublereal *urt) const; /** * Returns the vector of nondimensional * constant pressure heat capacities of the reference state