From 2468b47ae7040add21647e097aaf535d6673f46d Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 27 Mar 2014 01:29:27 +0000 Subject: [PATCH] [Thermo] Remove unimplemented overrides of ThermoPhase methods ThermoPhase already provides an implementation of these methods that raises an exception to indicate that the method is unimplemented. Therefore, derived classes which do not implement a method do not need to do this. --- include/cantera/thermo/DebyeHuckel.h | 67 --------------------- include/cantera/thermo/HMWSoln.h | 72 ----------------------- include/cantera/thermo/IdealMolalSoln.h | 35 ----------- include/cantera/thermo/RedlichKwongMFTP.h | 8 --- include/cantera/thermo/SingleSpeciesTP.h | 28 --------- src/thermo/DebyeHuckel.cpp | 14 ----- src/thermo/HMWSoln.cpp | 14 ----- src/thermo/RedlichKwongMFTP.cpp | 7 --- 8 files changed, 245 deletions(-) diff --git a/include/cantera/thermo/DebyeHuckel.h b/include/cantera/thermo/DebyeHuckel.h index 5b899069e..58b455e6c 100644 --- a/include/cantera/thermo/DebyeHuckel.h +++ b/include/cantera/thermo/DebyeHuckel.h @@ -792,31 +792,6 @@ public: */ virtual void setState_TP(doublereal t, doublereal p); - /** - * The isothermal compressibility. Units: 1/Pa. - * The isothermal compressibility is defined as - * \f[ - * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T - * \f] - * - * It's equal to zero for this model, since the molar volume - * doesn't change with pressure or temperature. - */ - virtual doublereal isothermalCompressibility() const; - - /** - * The thermal expansion coefficient. Units: 1/K. - * The thermal expansion coefficient is defined as - * - * \f[ - * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P - * \f] - * - * It's equal to zero for this model, since the molar volume - * doesn't change with pressure or temperature. - */ - virtual doublereal thermalExpansionCoeff() const; - /** * @} * @name Activities, Standard States, and Activity Concentrations @@ -1095,48 +1070,6 @@ public: */ virtual void setParametersFromXML(const XML_Node& eosdata); - /// @name Saturation properties. - /// These methods are only implemented by subclasses that - /// implement full liquid-vapor equations of state. - /// - virtual doublereal satTemperature(doublereal p) const { - err("satTemperature"); - return -1.0; - } - - //! Get the saturation pressure for a given temperature. - /*! - * Note the limitations of this function. Stability considerations - * concerning multiphase equilibrium are ignored in this - * calculation. Therefore, the call is made directly to the SS of - * water underneath. The object is put back into its original - * state at the end of the call. - * - * @todo This is probably not implemented correctly. The stability - * of the salt should be added into this calculation. The - * underlying water model may be called to get the stability - * of the pure water solution, if needed. - * - * @param T Temperature (kelvin) - */ - virtual doublereal satPressure(doublereal T) { - err("satPressure"); - return -1.0; - } - - virtual doublereal vaporFraction() const { - err("vaprFraction"); - return -1.0; - } - - virtual void setState_Tsat(doublereal t, doublereal x) { - err("setState_sat"); - } - - virtual void setState_Psat(doublereal p, doublereal x) { - err("setState_sat"); - } - //@} /* diff --git a/include/cantera/thermo/HMWSoln.h b/include/cantera/thermo/HMWSoln.h index 659c7f262..ca2162722 100644 --- a/include/cantera/thermo/HMWSoln.h +++ b/include/cantera/thermo/HMWSoln.h @@ -1544,29 +1544,6 @@ public: */ virtual void setState_TP(doublereal t, doublereal p); - /** - * The isothermal compressibility. Units: 1/Pa. - * The isothermal compressibility is defined as - * \f[ - * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T - * \f] - * It's equal to zero for this model, since the molar volume - * doesn't change with pressure or temperature. - */ - virtual doublereal isothermalCompressibility() const; - - /** - * The thermal expansion coefficient. Units: 1/K. - * The thermal expansion coefficient is defined as - * - * \f[ - * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P - * \f] - * It's equal to zero for this model, since the molar volume - * doesn't change with pressure or temperature. - */ - virtual doublereal thermalExpansionCoeff() const; - /** * @} * @name Potential Energy @@ -1918,40 +1895,6 @@ public: */ virtual void setParametersFromXML(const XML_Node& eosdata); - //--------------------------------------------------------- - /// @name Critical state properties. - /// These methods are only implemented by some subclasses. - //@{ - - /// Critical temperature (K). - virtual doublereal critTemperature() const { - err("critTemperature"); - return -1.0; - } - - /// Critical pressure (Pa). - virtual doublereal critPressure() const { - err("critPressure"); - return -1.0; - } - - /// Critical density (kg/m3). - virtual doublereal critDensity() const { - err("critDensity"); - return -1.0; - } - - //@} - - /// @name Saturation properties. - /// These methods are only implemented by subclasses that - /// implement full liquid-vapor equations of state. - /// - virtual doublereal satTemperature(doublereal p) const { - err("satTemperature"); - return -1.0; - } - //! Get the saturation pressure for a given temperature. /*! * Note the limitations of this function. Stability considerations @@ -1969,21 +1912,6 @@ public: */ virtual doublereal satPressure(doublereal T); - virtual doublereal vaporFraction() const { - err("vaprFraction"); - return -1.0; - } - - virtual void setState_Tsat(doublereal t, doublereal x) { - err("setState_sat"); - } - - virtual void setState_Psat(doublereal p, doublereal x) { - err("setState_sat"); - } - - //@} - /* * -------------- Utilities ------------------------------- */ diff --git a/include/cantera/thermo/IdealMolalSoln.h b/include/cantera/thermo/IdealMolalSoln.h index 8644b96a6..cbaf24a96 100644 --- a/include/cantera/thermo/IdealMolalSoln.h +++ b/include/cantera/thermo/IdealMolalSoln.h @@ -629,41 +629,6 @@ public: */ virtual void setParametersFromXML(const XML_Node& eosdata); - /// @name Critical state properties. - /// These methods are only implemented by some subclasses. - - //@{ - - /** - * Critical temperature (K). - * Not implemented for this phase type. - */ - virtual doublereal critTemperature() const { - err("critTemperature"); - return -1.0; - } - - /** - * Critical pressure (Pa). - * - * Not implemented for this phase type. - */ - virtual doublereal critPressure() const { - err("critPressure"); - return -1.0; - } - - /** - * Critical density (kg/m3). - * Not implemented for this phase type. - */ - virtual doublereal critDensity() const { - err("critDensity"); - return -1.0; - } - - //@} - /* * -------------- Utilities ------------------------------- */ diff --git a/include/cantera/thermo/RedlichKwongMFTP.h b/include/cantera/thermo/RedlichKwongMFTP.h index 64f982232..e8030e938 100644 --- a/include/cantera/thermo/RedlichKwongMFTP.h +++ b/include/cantera/thermo/RedlichKwongMFTP.h @@ -135,14 +135,6 @@ public: */ virtual doublereal pressure() const; - //! Returns the isothermal compressibility. Units: 1/Pa. - /*! - * The isothermal compressibility is defined as - * \f[ - * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T - * \f] - */ - virtual doublereal isothermalCompressibility() const; // @} protected: diff --git a/include/cantera/thermo/SingleSpeciesTP.h b/include/cantera/thermo/SingleSpeciesTP.h index c28655dea..d497ca4c6 100644 --- a/include/cantera/thermo/SingleSpeciesTP.h +++ b/include/cantera/thermo/SingleSpeciesTP.h @@ -571,34 +571,6 @@ public: */ virtual void setParametersFromXML(const XML_Node& eosdata) {} - //@} - /// @name Saturation properties. - /// These methods are only implemented by subclasses that - /// implement full liquid-vapor equations of state. - /// - virtual doublereal satTemperature(doublereal p) const { - err("satTemperature"); - return -1.0; - } - - virtual doublereal satPressure(doublereal t) { - err("satPressure"); - return -1.0; - } - - virtual doublereal vaporFraction() const { - err("vaprFraction"); - return -1.0; - } - - virtual void setState_Tsat(doublereal t, doublereal x) { - err("setState_sat"); - } - - virtual void setState_Psat(doublereal p, doublereal x) { - err("setState_sat"); - } - //@} /** diff --git a/src/thermo/DebyeHuckel.cpp b/src/thermo/DebyeHuckel.cpp index b52344cc4..08fe1f922 100644 --- a/src/thermo/DebyeHuckel.cpp +++ b/src/thermo/DebyeHuckel.cpp @@ -284,20 +284,6 @@ void DebyeHuckel::calcDensity() Phase::setDensity(dd); } -doublereal DebyeHuckel::isothermalCompressibility() const -{ - throw CanteraError("DebyeHuckel::isothermalCompressibility", - "unimplemented"); - return 0.0; -} - -doublereal DebyeHuckel::thermalExpansionCoeff() const -{ - throw CanteraError("DebyeHuckel::thermalExpansionCoeff", - "unimplemented"); - return 0.0; -} - void DebyeHuckel::setDensity(doublereal rho) { double dens = density(); diff --git a/src/thermo/HMWSoln.cpp b/src/thermo/HMWSoln.cpp index 1d72be743..4421631ca 100644 --- a/src/thermo/HMWSoln.cpp +++ b/src/thermo/HMWSoln.cpp @@ -690,20 +690,6 @@ void HMWSoln::calcDensity() Phase::setDensity(dd); } -doublereal HMWSoln::isothermalCompressibility() const -{ - throw CanteraError("HMWSoln::isothermalCompressibility", - "unimplemented"); - return 0.0; -} - -doublereal HMWSoln::thermalExpansionCoeff() const -{ - throw CanteraError("HMWSoln::thermalExpansionCoeff", - "unimplemented"); - return 0.0; -} - double HMWSoln::density() const { // calcDensity(); diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index 69b335258..590bb0ea0 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -344,13 +344,6 @@ void RedlichKwongMFTP::setConcentrations(const doublereal* const c) updateAB(); } -doublereal RedlichKwongMFTP::isothermalCompressibility() const -{ - throw CanteraError("RedlichKwongMFTP::isothermalCompressibility() ", - "not implemented"); - return 0.0; -} - void RedlichKwongMFTP::getActivityConcentrations(doublereal* c) const { getPartialMolarVolumes(DATA_PTR(m_partialMolarVolumes));