From 33c8065a7c0d53f86516153c8a98c023919a30a4 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 16 Sep 2008 16:33:16 +0000 Subject: [PATCH] Misc changes due to porting to solaris 10. Caught a few inconsistencies in inherited functions --- Cantera/src/equil/MultiPhase.cpp | 4 +++- Cantera/src/oneD/Domain1D.h | 2 +- Cantera/src/thermo/Elements.cpp | 2 +- Cantera/src/thermo/PDSS_ConstVol.cpp | 2 +- Cantera/src/thermo/PDSS_ConstVol.h | 2 +- Cantera/src/thermo/PDSS_HKFT.cpp | 10 +++++----- Cantera/src/thermo/PDSS_HKFT.h | 2 +- Cantera/src/thermo/PDSS_IdealGas.cpp | 1 + Cantera/src/thermo/PDSS_Water.cpp | 2 +- Cantera/src/thermo/PDSS_Water.h | 3 +-- Cantera/src/thermo/ThermoPhase.cpp | 4 ++-- Cantera/src/thermo/VPSSMgrFactory.cpp | 5 ++--- Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp | 2 +- Cantera/src/thermo/VPSSMgr_Water_ConstVol.h | 2 +- 14 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Cantera/src/equil/MultiPhase.cpp b/Cantera/src/equil/MultiPhase.cpp index f50b88f2f..431c7ad3f 100644 --- a/Cantera/src/equil/MultiPhase.cpp +++ b/Cantera/src/equil/MultiPhase.cpp @@ -861,7 +861,9 @@ done: m_phase[p]->setState_TPX(m_temp, m_press, x); m_temp_OK[p] = true; if (m_temp < m_phase[p]->minTemp() - || m_temp > m_phase[p]->maxTemp()) m_temp_OK[p] = false; + || m_temp > m_phase[p]->maxTemp()) { + m_temp_OK[p] = false; + } } } diff --git a/Cantera/src/oneD/Domain1D.h b/Cantera/src/oneD/Domain1D.h index 1e3de0c5a..cd06abeda 100644 --- a/Cantera/src/oneD/Domain1D.h +++ b/Cantera/src/oneD/Domain1D.h @@ -180,7 +180,7 @@ namespace Cantera { } /// index of component with name \a name. - int componentIndex(std::string name) { + int componentIndex(std::string name) const { int nc = nComponents(); for (int n = 0; n < nc; n++) { if (name == componentName(n)) return n; diff --git a/Cantera/src/thermo/Elements.cpp b/Cantera/src/thermo/Elements.cpp index 2a1e65e54..e50b8930d 100644 --- a/Cantera/src/thermo/Elements.cpp +++ b/Cantera/src/thermo/Elements.cpp @@ -186,7 +186,7 @@ namespace Cantera { * @exception CanteraError * If a match is not found, a CanteraError is thrown as well */ - double Elements::LookupWtElements(const std::string& s) { + doublereal Elements::LookupWtElements(const std::string& s) { int num = sizeof(aWTable) / sizeof(struct awData); string s3 = s.substr(0,3); for (int i = 0; i < num; i++) { diff --git a/Cantera/src/thermo/PDSS_ConstVol.cpp b/Cantera/src/thermo/PDSS_ConstVol.cpp index fc96f7227..dc9f334f7 100644 --- a/Cantera/src/thermo/PDSS_ConstVol.cpp +++ b/Cantera/src/thermo/PDSS_ConstVol.cpp @@ -179,7 +179,7 @@ namespace Cantera { delete fxml; } - void PDSS_ConstVol::initThermoXML(const XML_Node& phaseNode, std::string id) { + void PDSS_ConstVol::initThermoXML(const XML_Node& phaseNode, std::string& id) { PDSS::initThermoXML(phaseNode, id); } diff --git a/Cantera/src/thermo/PDSS_ConstVol.h b/Cantera/src/thermo/PDSS_ConstVol.h index faa5996ae..d9860e528 100644 --- a/Cantera/src/thermo/PDSS_ConstVol.h +++ b/Cantera/src/thermo/PDSS_ConstVol.h @@ -407,7 +407,7 @@ namespace Cantera { * phase. If none is given, the first XML * phase element will be used. */ - virtual void initThermoXML(const XML_Node& phaseNode, std::string id); + virtual void initThermoXML(const XML_Node& phaseNode, std::string& id); //@} diff --git a/Cantera/src/thermo/PDSS_HKFT.cpp b/Cantera/src/thermo/PDSS_HKFT.cpp index 496f3d841..aeb82a9d2 100644 --- a/Cantera/src/thermo/PDSS_HKFT.cpp +++ b/Cantera/src/thermo/PDSS_HKFT.cpp @@ -45,6 +45,7 @@ namespace Cantera { m_charge_j(0.0) { m_pdssType = cPDSS_MOLAL_HKFT; + m_presR_bar = OneAtm * 1.0E-5; } @@ -74,6 +75,7 @@ namespace Cantera { m_charge_j(0.0) { m_pdssType = cPDSS_MOLAL_HKFT; + m_presR_bar = OneAtm * 1.0E-5; constructPDSSFile(tp, spindex, inputFile, id); } @@ -104,6 +106,7 @@ namespace Cantera { m_charge_j(0.0) { m_pdssType = cPDSS_MOLAL_HKFT; + m_presR_bar = OneAtm * 1.0E-5; // We have to read the info from here constructPDSSXML(tp, spindex, speciesNode, phaseRoot, spInstalled); } @@ -201,7 +204,6 @@ namespace Cantera { PDSS_HKFT::cp_mole() const { double pbar = m_pres * 1.0E-5; - double m_presR_bar = OneAtm * 1.0E-5; double c1term = m_c1; @@ -274,7 +276,6 @@ namespace Cantera { PDSS_HKFT::molarVolume() const { // double pbar = m_pres * 1.0E-5; - //double m_presR_bar = OneAtm * 1.0E-5; double a1term = m_a1 * 1.0E-5; @@ -478,7 +479,7 @@ namespace Cantera { } - void PDSS_HKFT::initThermoXML(const XML_Node& phaseNode, std::string id) { + void PDSS_HKFT::initThermoXML(const XML_Node& phaseNode, std::string& id) { PDSS::initThermoXML(phaseNode, id); } @@ -633,7 +634,7 @@ namespace Cantera { double PDSS_HKFT::deltaG() const { double pbar = m_pres * 1.0E-5; - double m_presR_bar = OneAtm * 1.0E-5; + //double m_presR_bar = OneAtm * 1.0E-5; double sterm = - m_Entrop_tr_pr * (m_temp - 298.15); @@ -679,7 +680,6 @@ namespace Cantera { double PDSS_HKFT::deltaS() const { double pbar = m_pres * 1.0E-5; - double m_presR_bar = OneAtm * 1.0E-5; double c1term = m_c1 * log(m_temp/298.15); diff --git a/Cantera/src/thermo/PDSS_HKFT.h b/Cantera/src/thermo/PDSS_HKFT.h index 50e6d82be..b57d12ad5 100644 --- a/Cantera/src/thermo/PDSS_HKFT.h +++ b/Cantera/src/thermo/PDSS_HKFT.h @@ -411,7 +411,7 @@ namespace Cantera { * phase. If none is given, the first XML * phase element will be used. */ - virtual void initThermoXML(const XML_Node& phaseNode, std::string id); + virtual void initThermoXML(const XML_Node& phaseNode, std::string& id); //@} diff --git a/Cantera/src/thermo/PDSS_IdealGas.cpp b/Cantera/src/thermo/PDSS_IdealGas.cpp index 0e191a731..baab1e084 100644 --- a/Cantera/src/thermo/PDSS_IdealGas.cpp +++ b/Cantera/src/thermo/PDSS_IdealGas.cpp @@ -348,6 +348,7 @@ namespace Cantera { /// saturation pressure doublereal PDSS_IdealGas::satPressure(doublereal t){ throw CanteraError("PDSS_IdealGas::satPressure()", "unimplemented"); + /*NOTREACHED*/ return (0.0); } diff --git a/Cantera/src/thermo/PDSS_Water.cpp b/Cantera/src/thermo/PDSS_Water.cpp index 36c198697..b01954d17 100644 --- a/Cantera/src/thermo/PDSS_Water.cpp +++ b/Cantera/src/thermo/PDSS_Water.cpp @@ -274,7 +274,7 @@ namespace Cantera { PDSS::initThermo(); } - void PDSS_Water::initThermoXML(const XML_Node& phaseNode, std::string id) { + void PDSS_Water::initThermoXML(const XML_Node& phaseNode, std::string& id) { PDSS::initThermoXML(phaseNode, id); } diff --git a/Cantera/src/thermo/PDSS_Water.h b/Cantera/src/thermo/PDSS_Water.h index 84527bc8b..afd601ad0 100644 --- a/Cantera/src/thermo/PDSS_Water.h +++ b/Cantera/src/thermo/PDSS_Water.h @@ -470,8 +470,7 @@ namespace Cantera { * phase. If none is given, the first XML * phase element will be used. */ - virtual void initThermoXML(const XML_Node& phaseNode, std::string id); - + virtual void initThermoXML(const XML_Node& phaseNode, std::string& id); //@} diff --git a/Cantera/src/thermo/ThermoPhase.cpp b/Cantera/src/thermo/ThermoPhase.cpp index 6301caa0d..a3998db62 100644 --- a/Cantera/src/thermo/ThermoPhase.cpp +++ b/Cantera/src/thermo/ThermoPhase.cpp @@ -413,8 +413,8 @@ namespace Cantera { unstablePhaseNew = true; Tunstable = Tnew; } else { - break; unstablePhaseNew = false; + break; } if (unstablePhase == false) { if (unstablePhaseNew == true) { @@ -673,8 +673,8 @@ namespace Cantera { unstablePhaseNew = true; Tunstable = Tnew; } else { - break; unstablePhaseNew = false; + break; } if (unstablePhase == false) { if (unstablePhaseNew == true) { diff --git a/Cantera/src/thermo/VPSSMgrFactory.cpp b/Cantera/src/thermo/VPSSMgrFactory.cpp index d08c15970..1daa2904c 100644 --- a/Cantera/src/thermo/VPSSMgrFactory.cpp +++ b/Cantera/src/thermo/VPSSMgrFactory.cpp @@ -230,9 +230,9 @@ namespace Cantera { if (iwater == 1) { if (ihptx == 0) { - vpss == new VPSSMgr_Water_ConstVol(vp_ptr, spth); + vpss = new VPSSMgr_Water_ConstVol(vp_ptr, spth); } else { - vpss == new VPSSMgr_Water_HKFT(vp_ptr, spth); + vpss = new VPSSMgr_Water_HKFT(vp_ptr, spth); } } // The default here is to fall back to use the completely @@ -329,7 +329,6 @@ namespace Cantera { case cVPSSMGR_PUREFLUID: throw CanteraError("VPSSMgrFactory::newVPSSMgr", "unimplemented"); - break; case cVPSSMGR_WATER_CONSTVOL: return new VPSSMgr_Water_ConstVol(vp_ptr, &spthermoRef); break; diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp index 0a98dc460..9b5de66b5 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -161,7 +161,7 @@ namespace Cantera { } - void VPSSMgr_Water_ConstVol::updateRefStateThermo() { + void VPSSMgr_Water_ConstVol::updateRefStateThermo() const { // Fix up the water doublereal RT = GasConstant * m_tlast; m_waterSS->setState_TP(m_tlast, m_p0); diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h index 5ac4c7543..10916cbc1 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h @@ -206,7 +206,7 @@ namespace Cantera { virtual void getStandardVolumes_ref(doublereal *vol) const ; - void updateRefStateThermo(); + void updateRefStateThermo() const; //! @name Initialization Methods - For Internal use (VPStandardState) /*!