From edaef6a0b77479028918fff380589ca0e0526b7f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 8 May 2014 23:01:43 +0000 Subject: [PATCH] [Thermo] Remove redundant methods of PDSS descendants The removed methods repeated the implementation of the base class. --- include/cantera/thermo/PDSS_ConstVol.h | 3 - include/cantera/thermo/PDSS_HKFT.h | 15 ----- include/cantera/thermo/PDSS_IdealGas.h | 10 ---- include/cantera/thermo/PDSS_IonsFromNeutral.h | 14 ----- include/cantera/thermo/PDSS_SSVol.h | 3 - include/cantera/thermo/PDSS_Water.h | 3 - src/thermo/PDSS_ConstVol.cpp | 18 ------ src/thermo/PDSS_HKFT.cpp | 60 ------------------- src/thermo/PDSS_IdealGas.cpp | 30 ---------- src/thermo/PDSS_IonsFromNeutral.cpp | 47 --------------- src/thermo/PDSS_SSVol.cpp | 18 ------ src/thermo/PDSS_Water.cpp | 10 ---- 12 files changed, 231 deletions(-) diff --git a/include/cantera/thermo/PDSS_ConstVol.h b/include/cantera/thermo/PDSS_ConstVol.h index 7974c966b..f8bc83d6d 100644 --- a/include/cantera/thermo/PDSS_ConstVol.h +++ b/include/cantera/thermo/PDSS_ConstVol.h @@ -121,9 +121,6 @@ public: //! @name Miscellaneous properties of the standard state //! @{ - virtual doublereal critTemperature() const; - virtual doublereal critPressure() const; - virtual doublereal critDensity() const; virtual doublereal satPressure(doublereal t); //! @} diff --git a/include/cantera/thermo/PDSS_HKFT.h b/include/cantera/thermo/PDSS_HKFT.h index 18a4b9191..b14f9441e 100644 --- a/include/cantera/thermo/PDSS_HKFT.h +++ b/include/cantera/thermo/PDSS_HKFT.h @@ -116,12 +116,10 @@ public: doublereal enthalpy_mole2() const; #endif - virtual doublereal enthalpy_RT() const; virtual doublereal intEnergy_mole() const; virtual doublereal entropy_mole() const; virtual doublereal gibbs_mole() const; virtual doublereal cp_mole() const; - virtual doublereal cv_mole() const; virtual doublereal molarVolume() const; virtual doublereal density() const; @@ -143,20 +141,8 @@ public: //! @name Mechanical Equation of State Properties //! @{ - virtual doublereal pressure() const; - virtual void setPressure(doublereal pres); - virtual void setTemperature(doublereal temp); - doublereal temperature() const; virtual void setState_TP(doublereal temp, doublereal pres); - //! @} - //! @name Miscellaneous properties of the standard state - //! @{ - - virtual doublereal critTemperature() const; - virtual doublereal critPressure() const; - virtual doublereal critDensity() const; - //! @} //! @name Initialization of the Object //! @{ @@ -202,7 +188,6 @@ public: const XML_Node& speciesNode, const XML_Node& phaseNode, bool spInstalled); - virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id); virtual void initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, SpeciesThermo* spthermo_ptr); diff --git a/include/cantera/thermo/PDSS_IdealGas.h b/include/cantera/thermo/PDSS_IdealGas.h index 5d967763b..5dd21c765 100644 --- a/include/cantera/thermo/PDSS_IdealGas.h +++ b/include/cantera/thermo/PDSS_IdealGas.h @@ -122,15 +122,6 @@ public: virtual void setState_TP(doublereal temp, doublereal pres); virtual void setState_TR(doublereal temp, doublereal rho); - //! @} - //! @name Miscellaneous properties of the standard state - //! @{ - - virtual doublereal critTemperature() const; - virtual doublereal critPressure() const; - virtual doublereal critDensity() const; - virtual doublereal satPressure(doublereal t); - //! @} //! @name Initialization of the Object //! @{ @@ -178,7 +169,6 @@ public: void constructPDSSXML(VPStandardStateTP* vptp_ptr, size_t spindex, const XML_Node& phaseNode, const std::string& id); - virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id); virtual void initThermo(); //@} }; diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index 4a0ba88e1..651fc2983 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -112,10 +112,8 @@ public: * case is the single anion species, with species index sp. */ virtual doublereal gibbs_RT() const; - virtual doublereal cp_mole() const; virtual doublereal cp_R() const; - virtual doublereal cv_mole() const; virtual doublereal molarVolume() const; virtual doublereal density() const; @@ -133,22 +131,11 @@ public: //! @name Mechanical Equation of State Properties //! @{ - virtual doublereal pressure() const; - virtual void setPressure(doublereal pres); virtual void setTemperature(doublereal temp); doublereal temperature() const; virtual void setState_TP(doublereal temp, doublereal pres); virtual void setState_TR(doublereal temp, doublereal rho); - //! @} - //! @name Miscellaneous properties of the standard state - //! @{ - - virtual doublereal critTemperature() const; - virtual doublereal critPressure() const; - virtual doublereal critDensity() const; - virtual doublereal satPressure(doublereal t); - //! @} //! @name Initialization of the Object //! @{ @@ -200,7 +187,6 @@ public: const XML_Node& speciesNode, const XML_Node& phaseNode, const std::string& id); - virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id); virtual void initThermo(); //@} diff --git a/include/cantera/thermo/PDSS_SSVol.h b/include/cantera/thermo/PDSS_SSVol.h index ad5d64d9d..0be2490a5 100644 --- a/include/cantera/thermo/PDSS_SSVol.h +++ b/include/cantera/thermo/PDSS_SSVol.h @@ -259,9 +259,6 @@ private: //! @name Miscellaneous properties of the standard state //! @{ - virtual doublereal critTemperature() const; - virtual doublereal critPressure() const; - virtual doublereal critDensity() const; virtual doublereal satPressure(doublereal t); //! @} diff --git a/include/cantera/thermo/PDSS_Water.h b/include/cantera/thermo/PDSS_Water.h index 87ec86fac..9be178d02 100644 --- a/include/cantera/thermo/PDSS_Water.h +++ b/include/cantera/thermo/PDSS_Water.h @@ -275,9 +275,6 @@ public: */ void constructPDSSXML(VPStandardStateTP* vptp_ptr, int spindex, const XML_Node& phaseNode, const std::string& id); - - virtual void initThermo(); - virtual void initThermoXML(const XML_Node& phaseNode, const std::string& id); //@} private: diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index 72bcd8ec0..5550cd5a3 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -265,24 +265,6 @@ doublereal PDSS_ConstVol::molarVolume_ref() const return m_V0_ptr[m_spindex]; } -doublereal PDSS_ConstVol::critTemperature() const -{ - throw CanteraError("PDSS_ConstVol::critTemperature()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_ConstVol::critPressure() const -{ - throw CanteraError("PDSS_ConstVol::critPressure()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_ConstVol::critDensity() const -{ - throw CanteraError("PDSS_ConstVol::critDensity()", "unimplemented"); - return 0.0; -} - void PDSS_ConstVol::setPressure(doublereal p) { m_pres = p; diff --git a/src/thermo/PDSS_HKFT.cpp b/src/thermo/PDSS_HKFT.cpp index 4ce2711fb..78bcf7ee3 100644 --- a/src/thermo/PDSS_HKFT.cpp +++ b/src/thermo/PDSS_HKFT.cpp @@ -232,13 +232,6 @@ doublereal PDSS_HKFT::enthalpy_mole() const return h; } -doublereal PDSS_HKFT::enthalpy_RT() const -{ - doublereal hh = enthalpy_mole(); - doublereal RT = GasConstant * m_temp; - return hh / RT; -} - #ifdef DEBUG_MODE doublereal PDSS_HKFT::enthalpy_mole2() const { @@ -362,13 +355,6 @@ doublereal PDSS_HKFT::cp_mole() const return Cp; } -doublereal -PDSS_HKFT::cv_mole() const -{ - throw CanteraError("PDSS_HKFT::cv_mole()", "unimplemented"); - return 0.0; -} - doublereal PDSS_HKFT::molarVolume() const { // Initially do all calculations in (cal/gmol/Pa) @@ -480,53 +466,12 @@ PDSS_HKFT::molarVolume_ref() const return ee; } -doublereal -PDSS_HKFT::pressure() const -{ - return m_pres; -} - -void -PDSS_HKFT::setPressure(doublereal p) -{ - m_pres = p; -} - -void PDSS_HKFT::setTemperature(doublereal temp) -{ - m_temp = temp; -} - -doublereal PDSS_HKFT::temperature() const -{ - return m_temp; -} - void PDSS_HKFT::setState_TP(doublereal temp, doublereal pres) { setTemperature(temp); setPressure(pres); } -doublereal -PDSS_HKFT::critTemperature() const -{ - throw CanteraError("PDSS_HKFT::critTemperature()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_HKFT::critPressure() const -{ - throw CanteraError("PDSS_HKFT::critPressure()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_HKFT::critDensity() const -{ - throw CanteraError("PDSS_HKFT::critDensity()", "unimplemented"); - return 0.0; -} -//===================================================================================================================== void PDSS_HKFT::initThermo() { PDSS::initThermo(); @@ -603,11 +548,6 @@ void PDSS_HKFT::initThermo() + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT; } } -//================================================================================================================= -void PDSS_HKFT::initThermoXML(const XML_Node& phaseNode, const std::string& id) -{ - PDSS::initThermoXML(phaseNode, id); -} void PDSS_HKFT::initAllPtrs(VPStandardStateTP* vptp_ptr, VPSSMgr* vpssmgr_ptr, SpeciesThermo* spthermo_ptr) diff --git a/src/thermo/PDSS_IdealGas.cpp b/src/thermo/PDSS_IdealGas.cpp index 519fd6df0..0737f54f2 100644 --- a/src/thermo/PDSS_IdealGas.cpp +++ b/src/thermo/PDSS_IdealGas.cpp @@ -109,11 +109,6 @@ void PDSS_IdealGas::constructPDSSFile(VPStandardStateTP* tp, size_t spindex, delete fxml; } -void PDSS_IdealGas::initThermoXML(const XML_Node& phaseNode, const std::string& id) -{ - PDSS::initThermoXML(phaseNode, id); -} - void PDSS_IdealGas::initThermo() { PDSS::initThermo(); @@ -243,24 +238,6 @@ void PDSS_IdealGas::setPressure(doublereal p) m_Vss_ptr[m_spindex] = GasConstant * m_temp / m_pres; } -doublereal PDSS_IdealGas::critTemperature() const -{ - throw CanteraError("PDSS_IdealGas::critTemperature()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_IdealGas::critPressure() const -{ - throw CanteraError("PDSS_IdealGas::critPressure()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_IdealGas::critDensity() const -{ - throw CanteraError("PDSS_IdealGas::critDensity()", "unimplemented"); - return 0.0; -} - doublereal PDSS_IdealGas::temperature() const { m_temp = m_vpssmgr_ptr->temperature(); @@ -294,11 +271,4 @@ void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho) setTemperature(temp); } -doublereal PDSS_IdealGas::satPressure(doublereal t) -{ - throw CanteraError("PDSS_IdealGas::satPressure()", "unimplemented"); - /*NOTREACHED*/ - return 0.0; -} - } diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index 56725edd5..3d6d690c3 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -206,11 +206,6 @@ void PDSS_IonsFromNeutral::constructPDSSFile(VPStandardStateTP* tp, size_t spind delete fxml; } -void PDSS_IonsFromNeutral::initThermoXML(const XML_Node& phaseNode, const std::string& id) -{ - PDSS::initThermoXML(phaseNode, id); -} - void PDSS_IonsFromNeutral::initThermo() { PDSS::initThermo(); @@ -330,13 +325,6 @@ PDSS_IonsFromNeutral::density() const return (m_pres * m_mw / (GasConstant * m_temp)); } -doublereal -PDSS_IonsFromNeutral::cv_mole() const -{ - throw CanteraError("PDSS_IonsFromNeutral::cv_mole()", "unimplemented"); - return 0.0; -} - doublereal PDSS_IonsFromNeutral::gibbs_RT_ref() const { @@ -399,34 +387,6 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const return val; } -doublereal PDSS_IonsFromNeutral::pressure() const -{ - return m_pres; -} - -void PDSS_IonsFromNeutral::setPressure(doublereal p) -{ - m_pres = p; -} - -doublereal PDSS_IonsFromNeutral::critTemperature() const -{ - throw CanteraError("PDSS_IonsFromNeutral::critTemperature()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_IonsFromNeutral::critPressure() const -{ - throw CanteraError("PDSS_IonsFromNeutral::critPressure()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_IonsFromNeutral::critDensity() const -{ - throw CanteraError("PDSS_IonsFromNeutral::critDensity()", "unimplemented"); - return 0.0; -} - doublereal PDSS_IonsFromNeutral::temperature() const { /* @@ -451,11 +411,4 @@ void PDSS_IonsFromNeutral::setState_TR(doublereal temp, doublereal rho) { } -doublereal PDSS_IonsFromNeutral::satPressure(doublereal t) -{ - throw CanteraError("PDSS_IonsFromNeutral::satPressure()", "unimplemented"); - /*NOTREACHED*/ - return 0.0; -} - } diff --git a/src/thermo/PDSS_SSVol.cpp b/src/thermo/PDSS_SSVol.cpp index 9cf11fa7d..9d8359a4e 100644 --- a/src/thermo/PDSS_SSVol.cpp +++ b/src/thermo/PDSS_SSVol.cpp @@ -311,24 +311,6 @@ void PDSS_SSVol::calcMolarVolume() const } } -doublereal PDSS_SSVol::critTemperature() const -{ - throw CanteraError("PDSS_SSVol::critTemperature()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_SSVol::critPressure() const -{ - throw CanteraError("PDSS_SSVol::critPressure()", "unimplemented"); - return 0.0; -} - -doublereal PDSS_SSVol::critDensity() const -{ - throw CanteraError("PDSS_SSVol::critDensity()", "unimplemented"); - return 0.0; -} - void PDSS_SSVol::setPressure(doublereal p) { m_pres = p; diff --git a/src/thermo/PDSS_Water.cpp b/src/thermo/PDSS_Water.cpp index cf3ea2b80..22034c7b8 100644 --- a/src/thermo/PDSS_Water.cpp +++ b/src/thermo/PDSS_Water.cpp @@ -256,16 +256,6 @@ void PDSS_Water::constructSet() m_pres = OneAtm; } -void PDSS_Water::initThermo() -{ - PDSS::initThermo(); -} - -void PDSS_Water::initThermoXML(const XML_Node& phaseNode, const std::string& id) -{ - PDSS::initThermoXML(phaseNode, id); -} - doublereal PDSS_Water::enthalpy_mole() const { doublereal h = m_sub->enthalpy();