diff --git a/Cantera/src/thermo/VPSSMgr.cpp b/Cantera/src/thermo/VPSSMgr.cpp index 92b9917ba..1f8e451d8 100644 --- a/Cantera/src/thermo/VPSSMgr.cpp +++ b/Cantera/src/thermo/VPSSMgr.cpp @@ -388,7 +388,6 @@ namespace Cantera { } } - for (int k = 0; k < m_kk; k++) { const PDSS *kPDSS = m_vptp_ptr->providePDSS(k); m_p0_k = kPDSS->refPressure(); @@ -402,8 +401,6 @@ namespace Cantera { } } #endif - - } void VPSSMgr::installSTSpecies(int k, const XML_Node& s, diff --git a/Cantera/src/thermo/VPSSMgr.h b/Cantera/src/thermo/VPSSMgr.h index ad5fa49b3..5be3b3217 100644 --- a/Cantera/src/thermo/VPSSMgr.h +++ b/Cantera/src/thermo/VPSSMgr.h @@ -734,7 +734,10 @@ namespace Cantera { * called for each species in the phase, and after initThermo() * has been called. * It's called via an inner-to-outer onion shell like manner. - * + * + * In this routine, we currently calculate the reference pressure, + * the minimum and maximum temperature for the applicability + * of the thermo formulation. * * @param phaseNode Reference to the phaseNode XML node. * @param id ID of the phase. @@ -766,9 +769,8 @@ namespace Cantera { * to the phase which owns the species */ virtual PDSS * createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + const XML_Node * const phaseNode_ptr); - //! Initialize the internal pointers in this object /*! diff --git a/Cantera/src/thermo/VPSSMgr_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_ConstVol.cpp index bba01572a..2121a4724 100644 --- a/Cantera/src/thermo/VPSSMgr_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_ConstVol.cpp @@ -127,7 +127,7 @@ namespace Cantera { PDSS * VPSSMgr_ConstVol::createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr) { + const XML_Node * const phaseNode_ptr) { //VPSSMgr::installSpecies(k, speciesNode, phaseNode_ptr); const XML_Node *ss = speciesNode.findByName("standardState"); if (!ss) { diff --git a/Cantera/src/thermo/VPSSMgr_ConstVol.h b/Cantera/src/thermo/VPSSMgr_ConstVol.h index 6c8c787c6..dcb6e5b28 100644 --- a/Cantera/src/thermo/VPSSMgr_ConstVol.h +++ b/Cantera/src/thermo/VPSSMgr_ConstVol.h @@ -183,7 +183,7 @@ namespace Cantera { * containing the parameterization */ virtual PDSS* createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + const XML_Node * const phaseNode_ptr); //@} //! This utility function reports the type of parameterization diff --git a/Cantera/src/thermo/VPSSMgr_General.cpp b/Cantera/src/thermo/VPSSMgr_General.cpp index 29dba2226..954ec220b 100644 --- a/Cantera/src/thermo/VPSSMgr_General.cpp +++ b/Cantera/src/thermo/VPSSMgr_General.cpp @@ -135,16 +135,14 @@ namespace Cantera { } } - void VPSSMgr_General::initThermoXML(XML_Node& phaseNode, std::string id) { VPSSMgr::initThermoXML(phaseNode, id); - } PDSS* VPSSMgr_General::returnPDSS_ptr(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr, bool &doST) { + const XML_Node * const phaseNode_ptr, bool &doST) { PDSS *kPDSS = 0; doST = true; GeneralSpeciesThermo *genSpthermo = dynamic_cast(m_spthermo); @@ -186,7 +184,7 @@ namespace Cantera { PDSS * VPSSMgr_General::createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr) { + const XML_Node * const phaseNode_ptr) { bool doST; PDSS *kPDSS = returnPDSS_ptr(k, speciesNode, phaseNode_ptr, doST); // VPSSMgr::installSTSpecies(k, speciesNode, phaseNode_ptr); @@ -212,7 +210,6 @@ namespace Cantera { if (k == 0) { m_p0 = p0; } - return kPDSS; } diff --git a/Cantera/src/thermo/VPSSMgr_General.h b/Cantera/src/thermo/VPSSMgr_General.h index 98bfb270c..458c5e5c4 100644 --- a/Cantera/src/thermo/VPSSMgr_General.h +++ b/Cantera/src/thermo/VPSSMgr_General.h @@ -7,7 +7,6 @@ * class \link Cantera::VPSSMgr_General VPSSMgr_General\endlink). */ /* - * $Author$ * $Revision$ * $Date$ */ @@ -33,9 +32,9 @@ namespace Cantera { //! Class that handles the calculation of standard state thermo properties for //! a set of species belonging to a single phase in a completely general - //! but slow way + //! but slow way. /*! - * This class manages the calculation standard state thermo properties for + * This class manages the calculation of standard state thermo properties for * a set of species belonging to a single phase in a completely general * but slow way. * The way this does this is to call the underlying PDSS routines one at a @@ -186,13 +185,70 @@ namespace Cantera { */ virtual void initThermo(); + //! Finalize the thermo objects after all species have been entered + /*! + * This function is the LAST initialization routine to be + * called. It's called after createInstallPDSS() has been + * called for each species in the phase, and after initThermo() + * has been called. + * It's called via an inner-to-outer onion-shell like manner. + * + * Currently, this routine passed control to the parent class + * without doing anything. + * + * @param phaseNode Reference to the phaseNode XML node. + * @param id ID of the phase. + */ virtual void initThermoXML(XML_Node& phaseNode, std::string id); - PDSS* returnPDSS_ptr(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr, bool &doST); + private: + //! Local factory routine for the creation of PDSS objects + /*! + * This routine is specific to the VPSSMgr_General object. + * It will create a PDSS object for species k, by searching + * and querying for the "standardState" XML node in the standard + * state description of the species. If this XML node doesn't + * exist, it will assume that the standard state is an ideal + * gas. + * It decides on the attribute, "model", what PDSS object + * to create. + * + * @param k Species number + * @param speciesNode XML node for the standard state of the species + * @param phaseNode_ptr pointer to the phase XML node + * @param doST output variable indicating whether the + * instantiation has resulted in a SpeciesThermo object + * being created and registered with the SpeciesThermo + * manager class. + * + * @return Returns the pointer to a malloced PDSS object + */ + PDSS * returnPDSS_ptr(int k, const XML_Node& speciesNode, + const XML_Node * const phaseNode_ptr, bool &doST); - virtual PDSS *createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + public: + + //! Factory routine for the creation of PDSS objects that are + //! then internally registered with this VPSSMgr object + /*! + * This function sets up the internal data within this object for + * handling the calculation of the standard state for the species. + * + * This routine + * will create a PDSS object for species k, by searching + * and querying for the "standardState" XML node in the standard + * state description of the species. + * It will then store the object's pointer in a vector of pointers, + * and it will own the object. + * + * @param k Species number + * @param speciesNode XML node for the standard state of the species + * @param phaseNode_ptr pointer to the phase XML node + * + * @return Returns the pointer to the malloced PDSS object + */ + virtual PDSS* createInstallPDSS(int k, const XML_Node& speciesNode, + const XML_Node * const phaseNode_ptr); //! This utility function reports the type of parameterization //! used for the species with index number index. diff --git a/Cantera/src/thermo/VPSSMgr_IdealGas.cpp b/Cantera/src/thermo/VPSSMgr_IdealGas.cpp index d4c749610..34ef28457 100644 --- a/Cantera/src/thermo/VPSSMgr_IdealGas.cpp +++ b/Cantera/src/thermo/VPSSMgr_IdealGas.cpp @@ -102,7 +102,7 @@ namespace Cantera { PDSS * VPSSMgr_IdealGas::createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr) { + const XML_Node * const phaseNode_ptr) { //VPSSMgr::installSpecies(k, speciesNode, phaseNode_ptr); const XML_Node *ss = speciesNode.findByName("standardState"); if (ss) { diff --git a/Cantera/src/thermo/VPSSMgr_IdealGas.h b/Cantera/src/thermo/VPSSMgr_IdealGas.h index 955c24516..146fa3e0a 100644 --- a/Cantera/src/thermo/VPSSMgr_IdealGas.h +++ b/Cantera/src/thermo/VPSSMgr_IdealGas.h @@ -204,7 +204,7 @@ namespace Cantera { * containing the parameterization */ virtual PDSS* createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + const XML_Node * const phaseNode_ptr); //! This utility function reports the type of parameterization diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp index b70d18f88..40a65a8eb 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -255,7 +255,7 @@ namespace Cantera { PDSS* VPSSMgr_Water_ConstVol::createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr) { + const XML_Node * const phaseNode_ptr) { PDSS *kPDSS = 0; // Will have to do something for water diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h index dd1dce163..057a1d6f9 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h @@ -281,7 +281,7 @@ namespace Cantera { * to the phase which owns the species */ virtual PDSS *createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + const XML_Node * const phaseNode_ptr); //! This utility function reports the type of parameterization //! used for the species with index number index. diff --git a/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp b/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp index 87ec184ea..0b33cdd63 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -241,7 +241,7 @@ namespace Cantera { PDSS * VPSSMgr_Water_HKFT::createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr) { + const XML_Node * const phaseNode_ptr) { PDSS *kPDSS = 0; const XML_Node *ss = speciesNode.findByName("standardState"); diff --git a/Cantera/src/thermo/VPSSMgr_Water_HKFT.h b/Cantera/src/thermo/VPSSMgr_Water_HKFT.h index 365f23553..462eae89c 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_HKFT.h +++ b/Cantera/src/thermo/VPSSMgr_Water_HKFT.h @@ -365,7 +365,7 @@ namespace Cantera { * to the phase which owns the species */ virtual PDSS *createInstallPDSS(int k, const XML_Node& speciesNode, - const XML_Node *phaseNode_ptr); + const XML_Node * const phaseNode_ptr); //@}