diff --git a/include/cantera/thermo/FixedChemPotSSTP.h b/include/cantera/thermo/FixedChemPotSSTP.h index ebbd5e44e..9ae5cff64 100644 --- a/include/cantera/thermo/FixedChemPotSSTP.h +++ b/include/cantera/thermo/FixedChemPotSSTP.h @@ -517,19 +517,6 @@ public: */ virtual void getCp_R_ref(doublereal* cprt) const; - /* - * @internal Initialize. This method is provided to allow - * subclasses to perform any initialization required after all - * species have been added. For example, it might be used to - * resize internal work arrays that must have an entry for - * each species. The base class implementation does nothing, - * and subclasses that do not require initialization do not - * need to overload this method. When importing a CTML phase - * description, this method is called just prior to returning - * from function importPhase(). - */ - virtual void initThermo(); - virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); //! Set the equation of state parameters diff --git a/include/cantera/thermo/IdealSolidSolnPhase.h b/include/cantera/thermo/IdealSolidSolnPhase.h index 84477fb8f..41cd7415a 100644 --- a/include/cantera/thermo/IdealSolidSolnPhase.h +++ b/include/cantera/thermo/IdealSolidSolnPhase.h @@ -791,13 +791,6 @@ public: /// @name Utility Functions //@{ - /** - * Initialization of an IdealSolidSolnPhase phase: - * Note this function is pretty much useless because it doesn't - * get the xml tree passed to it. Suggest a change. - */ - virtual void initThermo(); - /** * @internal Import and initialize a ThermoPhase object using an XML * tree. Here we read extra information about the XML description of a diff --git a/include/cantera/thermo/MetalSHEelectrons.h b/include/cantera/thermo/MetalSHEelectrons.h index d1bd9009e..ca237498b 100644 --- a/include/cantera/thermo/MetalSHEelectrons.h +++ b/include/cantera/thermo/MetalSHEelectrons.h @@ -432,19 +432,6 @@ public: virtual void getIntEnergy_RT_ref(doublereal* urt) const; // @} - /* - * @internal Initialize. This method is provided to allow - * subclasses to perform any initialization required after all - * species have been added. For example, it might be used to - * resize internal work arrays that must have an entry for - * each species. The base class implementation does nothing, - * and subclasses that do not require initialization do not - * need to overload this method. When importing a CTML phase - * description, this method is called just prior to returning - * from function importPhase(). - */ - virtual void initThermo(); - virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); //! Make the default XML tree diff --git a/include/cantera/thermo/MineralEQ3.h b/include/cantera/thermo/MineralEQ3.h index 5d099ac03..26678c8b2 100644 --- a/include/cantera/thermo/MineralEQ3.h +++ b/include/cantera/thermo/MineralEQ3.h @@ -348,21 +348,6 @@ public: virtual void getIntEnergy_RT_ref(doublereal* urt) const; //! @} - //! Internal initialization required after all species have - //! been added - /*! - * @internal Initialize. This method is provided to allow - * subclasses to perform any initialization required after all - * species have been added. For example, it might be used to - * resize internal work arrays that must have an entry for - * each species. The base class implementation does nothing, - * and subclasses that do not require initialization do not - * need to overload this method. When importing a CTML phase - * description, this method is called just prior to returning - * from function importPhase(). - */ - virtual void initThermo(); - //! Initialize the phase parameters from an XML file. /*! * initThermoXML() (virtual from ThermoPhase) diff --git a/include/cantera/thermo/WaterSSTP.h b/include/cantera/thermo/WaterSSTP.h index db1a0ef76..25e9b24b1 100644 --- a/include/cantera/thermo/WaterSSTP.h +++ b/include/cantera/thermo/WaterSSTP.h @@ -403,23 +403,6 @@ public: */ virtual void initThermoXML(XML_Node& phaseNode, const std::string& id); - //! Initialize the ThermoPhase object after all species have been set up - /*! - * @internal Initialize. - * - * This method is provided to allow - * subclasses to perform any initialization required after all - * species have been added. For example, it might be used to - * resize internal work arrays that must have an entry for - * each species. The base class implementation does nothing, - * and subclasses that do not require initialization do not - * need to overload this method. When importing a CTML phase - * description, this method is called from ThermoPhase::initThermoXML(), - * which is called from importPhase(), - * just prior to returning from function importPhase(). - */ - virtual void initThermo(); - //! Set equation of state parameter values from XML entries. /*! * This method is called by function importPhase() when processing a phase diff --git a/src/thermo/ConstDensityThermo.cpp b/src/thermo/ConstDensityThermo.cpp index 19a387fcc..dba0dadde 100644 --- a/src/thermo/ConstDensityThermo.cpp +++ b/src/thermo/ConstDensityThermo.cpp @@ -123,7 +123,7 @@ void ConstDensityThermo::getStandardChemPotentials(doublereal* mu0) const void ConstDensityThermo::initThermo() { - m_kk = nSpecies(); + ThermoPhase::initThermo(); m_h0_RT.resize(m_kk); m_g0_RT.resize(m_kk); m_cp0_R.resize(m_kk); diff --git a/src/thermo/FixedChemPotSSTP.cpp b/src/thermo/FixedChemPotSSTP.cpp index 0f1e961f5..8597dac7e 100644 --- a/src/thermo/FixedChemPotSSTP.cpp +++ b/src/thermo/FixedChemPotSSTP.cpp @@ -296,14 +296,6 @@ void FixedChemPotSSTP::getCp_R_ref(doublereal* cpr) const * ---- Initialization and Internal functions */ -void FixedChemPotSSTP::initThermo() -{ - /* - * Call the base class thermo initializer - */ - SingleSpeciesTP::initThermo(); -} - void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_) { /* diff --git a/src/thermo/IdealGasPhase.cpp b/src/thermo/IdealGasPhase.cpp index 77959b96b..6ae651042 100644 --- a/src/thermo/IdealGasPhase.cpp +++ b/src/thermo/IdealGasPhase.cpp @@ -327,6 +327,7 @@ void IdealGasPhase::getStandardVolumes_ref(doublereal* vol) const void IdealGasPhase::initThermo() { + ThermoPhase::initThermo(); m_p0 = refPressure(); m_h0_RT.resize(m_kk); m_g0_RT.resize(m_kk); diff --git a/src/thermo/IdealSolidSolnPhase.cpp b/src/thermo/IdealSolidSolnPhase.cpp index d86200e6e..e8be0d4f9 100644 --- a/src/thermo/IdealSolidSolnPhase.cpp +++ b/src/thermo/IdealSolidSolnPhase.cpp @@ -523,10 +523,6 @@ const vector_fp& IdealSolidSolnPhase::entropy_R_ref() const * Utility Functions *********************************************************************/ -void IdealSolidSolnPhase::initThermo() -{ -} - void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string& id_) { string subname = "IdealSolidSolnPhase::initThermoXML"; diff --git a/src/thermo/MetalSHEelectrons.cpp b/src/thermo/MetalSHEelectrons.cpp index 864440ba1..7fc66e52d 100644 --- a/src/thermo/MetalSHEelectrons.cpp +++ b/src/thermo/MetalSHEelectrons.cpp @@ -224,14 +224,6 @@ void MetalSHEelectrons::getIntEnergy_RT_ref(doublereal* urt) const * ---- Initialization and Internal functions */ -void MetalSHEelectrons::initThermo() -{ - /* - * Call the base class thermo initializer - */ - SingleSpeciesTP::initThermo(); -} - void MetalSHEelectrons::initThermoXML(XML_Node& phaseNode, const std::string& id_) { /* diff --git a/src/thermo/MineralEQ3.cpp b/src/thermo/MineralEQ3.cpp index bc7575994..863652a09 100644 --- a/src/thermo/MineralEQ3.cpp +++ b/src/thermo/MineralEQ3.cpp @@ -218,14 +218,6 @@ void MineralEQ3::getIntEnergy_RT_ref(doublereal* urt) const * ---- Initialization and Internal functions */ -void MineralEQ3::initThermo() -{ - /* - * Call the base class thermo initializer - */ - StoichSubstanceSSTP::initThermo(); -} - void MineralEQ3::setParameters(int n, doublereal* const c) { doublereal rho = c[0]; diff --git a/src/thermo/StoichSubstance.cpp b/src/thermo/StoichSubstance.cpp index aa31864ed..3bf970d1c 100644 --- a/src/thermo/StoichSubstance.cpp +++ b/src/thermo/StoichSubstance.cpp @@ -73,6 +73,7 @@ doublereal StoichSubstance::cv_mole() const void StoichSubstance::initThermo() { + ThermoPhase::initThermo(); if (m_kk > 1) { throw CanteraError("initThermo", "stoichiometric substances may only contain one species."); diff --git a/src/thermo/SurfPhase.cpp b/src/thermo/SurfPhase.cpp index 3fff37002..2b0109fc8 100644 --- a/src/thermo/SurfPhase.cpp +++ b/src/thermo/SurfPhase.cpp @@ -274,10 +274,7 @@ void SurfPhase::getCp_R_ref(doublereal* cprt) const void SurfPhase::initThermo() { - if (m_kk == 0) { - throw CanteraError("SurfPhase::initThermo", - "Number of species is equal to zero"); - } + ThermoPhase::initThermo(); m_h0.resize(m_kk); m_s0.resize(m_kk); m_cp0.resize(m_kk); diff --git a/src/thermo/WaterSSTP.cpp b/src/thermo/WaterSSTP.cpp index 4ac25bbee..7030b520a 100644 --- a/src/thermo/WaterSSTP.cpp +++ b/src/thermo/WaterSSTP.cpp @@ -107,11 +107,6 @@ WaterSSTP::~WaterSSTP() delete m_waterProps; } -void WaterSSTP::initThermo() -{ - SingleSpeciesTP::initThermo(); -} - void WaterSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id) { /*