diff --git a/Cantera/src/thermo/Elements.cpp b/Cantera/src/thermo/Elements.cpp index 945654dfd..0e862bed6 100644 --- a/Cantera/src/thermo/Elements.cpp +++ b/Cantera/src/thermo/Elements.cpp @@ -34,6 +34,7 @@ using namespace std; #ifdef USE_DGG_CODE #include #endif +#include namespace Cantera { diff --git a/Cantera/src/thermo/PDSS_HKFT.cpp b/Cantera/src/thermo/PDSS_HKFT.cpp index ad9a42218..313e140d3 100644 --- a/Cantera/src/thermo/PDSS_HKFT.cpp +++ b/Cantera/src/thermo/PDSS_HKFT.cpp @@ -21,6 +21,8 @@ #include "WaterProps.h" #include "PDSS_Water.h" +#include + using namespace std; namespace Cantera { diff --git a/Cantera/src/thermo/PureFluidPhase.cpp b/Cantera/src/thermo/PureFluidPhase.cpp index 80034d987..a0748e18c 100644 --- a/Cantera/src/thermo/PureFluidPhase.cpp +++ b/Cantera/src/thermo/PureFluidPhase.cpp @@ -16,6 +16,8 @@ #include "../../../ext/tpx/Sub.h" #include "../../../ext/tpx/utils.h" +#include + namespace Cantera { // Base Constructor diff --git a/Cantera/src/thermo/ThermoFactory.cpp b/Cantera/src/thermo/ThermoFactory.cpp index 48d6e1191..5940a580a 100644 --- a/Cantera/src/thermo/ThermoFactory.cpp +++ b/Cantera/src/thermo/ThermoFactory.cpp @@ -74,6 +74,8 @@ #include "IdealSolnGasVPSS.h" +#include + using namespace std; namespace Cantera { diff --git a/Cantera/src/thermo/VPSSMgr_General.cpp b/Cantera/src/thermo/VPSSMgr_General.cpp index 6db09888f..29dba2226 100644 --- a/Cantera/src/thermo/VPSSMgr_General.cpp +++ b/Cantera/src/thermo/VPSSMgr_General.cpp @@ -109,6 +109,32 @@ namespace Cantera { initLengths(); } + /*! + * Returns the vector of the + * gibbs function of the reference state at the current temperature + * of the solution and the reference pressure for the species. + * units = J/kmol + * + * @param g Output vector contain the Gibbs free energies + * of the reference state of the species + * length = m_kk, units = J/kmol. + */ + void VPSSMgr_General::getGibbs_ref(doublereal *g) const { + doublereal _rt = GasConstant * m_tlast; + if (m_useTmpRefStateStorage) { + std::copy(m_g0_RT.begin(), m_g0_RT.end(), g); + scale(g, g+m_kk, g, _rt); + } else { + for (int k = 0; k < m_kk; k++) { + PDSS *kPDSS = m_PDSS_ptrs[k]; + kPDSS->setState_TP(m_tlast, m_plast); + double h0_RT = kPDSS->enthalpy_RT_ref(); + double s0_R = kPDSS->entropy_R_ref(); + g[k] = _rt * (h0_RT - s0_R); + } + } + } + void VPSSMgr_General::initThermoXML(XML_Node& phaseNode, std::string id) { diff --git a/Cantera/src/thermo/VPSSMgr_General.h b/Cantera/src/thermo/VPSSMgr_General.h index 107c0a4ab..98bfb270c 100644 --- a/Cantera/src/thermo/VPSSMgr_General.h +++ b/Cantera/src/thermo/VPSSMgr_General.h @@ -147,6 +147,17 @@ namespace Cantera { */ //@{ + /*! + * Returns the vector of the + * gibbs function of the reference state at the current temperature + * of the solution and the reference pressure for the species. + * units = J/kmol + * + * @param g Output vector contain the Gibbs free energies + * of the reference state of the species + * length = m_kk, units = J/kmol. + */ + virtual void getGibbs_ref(doublereal *g) const ; //! @name Initialization Methods - For Internal use (VPStandardState) /*!