From ff61654c6c79e416a868619519e1b8a1a653205f Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 31 Oct 2008 15:45:34 +0000 Subject: [PATCH] getFloat() interface changes. --- Cantera/src/thermo/ConstDensityThermo.cpp | 2 +- Cantera/src/thermo/DebyeHuckel.cpp | 4 ++-- Cantera/src/thermo/HMWSoln_input.cpp | 2 +- Cantera/src/thermo/IdealMolalSoln.cpp | 2 +- Cantera/src/thermo/IdealSolidSolnPhase.cpp | 2 +- Cantera/src/thermo/LatticePhase.cpp | 2 +- Cantera/src/thermo/PDSS_ConstVol.cpp | 2 +- Cantera/src/thermo/SpeciesThermoFactory.cpp | 10 +++++----- Cantera/src/thermo/StoichSubstance.cpp | 2 +- Cantera/src/thermo/StoichSubstanceSSTP.cpp | 2 +- Cantera/src/thermo/SurfPhase.cpp | 4 ++-- Cantera/src/thermo/VPSSMgr_ConstVol.cpp | 4 ++-- Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp | 4 ++-- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cantera/src/thermo/ConstDensityThermo.cpp b/Cantera/src/thermo/ConstDensityThermo.cpp index c4e7c4673..2de457734 100755 --- a/Cantera/src/thermo/ConstDensityThermo.cpp +++ b/Cantera/src/thermo/ConstDensityThermo.cpp @@ -173,7 +173,7 @@ namespace Cantera { void ConstDensityThermo::setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Incompressible"); - doublereal rho = getFloat(eosdata, "density", "-"); + doublereal rho = getFloat(eosdata, "density", "toSI"); setDensity(rho); } diff --git a/Cantera/src/thermo/DebyeHuckel.cpp b/Cantera/src/thermo/DebyeHuckel.cpp index b71db7408..6742ecc16 100644 --- a/Cantera/src/thermo/DebyeHuckel.cpp +++ b/Cantera/src/thermo/DebyeHuckel.cpp @@ -1261,7 +1261,7 @@ namespace Cantera { m_speciesSize[k] << endl; #endif } else if (modelString == "constant_incompressible") { - m_speciesSize[k] = getFloat(*ss, "molarVolume", "-"); + m_speciesSize[k] = getFloat(*ss, "molarVolume", "toSi"); #ifdef DEBUG_HKM_NOT cout << "species " << sss[k] << " has volume " << m_speciesSize[k] << endl; @@ -1277,7 +1277,7 @@ namespace Cantera { "Solute SS Model \"" + modelStringa + "\" is not known"); } - m_speciesSize[k] = getFloat(*ss, "molarVolume", "-"); + m_speciesSize[k] = getFloat(*ss, "molarVolume", "toSI"); #ifdef DEBUG_HKM_NOT cout << "species " << sss[k] << " has volume " << m_speciesSize[k] << endl; diff --git a/Cantera/src/thermo/HMWSoln_input.cpp b/Cantera/src/thermo/HMWSoln_input.cpp index e3ef710a2..9d4f32dc3 100644 --- a/Cantera/src/thermo/HMWSoln_input.cpp +++ b/Cantera/src/thermo/HMWSoln_input.cpp @@ -1044,7 +1044,7 @@ namespace Cantera { "\" is not known"); } if (modelString == "constant_incompressible" ) { - m_speciesSize[k] = getFloat(*ss, "molarVolume", "-"); + m_speciesSize[k] = getFloat(*ss, "molarVolume", "toSI"); #ifdef DEBUG_HKM_NOT cout << "species " << sss[k] << " has volume " << m_speciesSize[k] << endl; diff --git a/Cantera/src/thermo/IdealMolalSoln.cpp b/Cantera/src/thermo/IdealMolalSoln.cpp index 5c1f37da0..4049b0ee5 100644 --- a/Cantera/src/thermo/IdealMolalSoln.cpp +++ b/Cantera/src/thermo/IdealMolalSoln.cpp @@ -897,7 +897,7 @@ namespace Cantera { for (int k = 0; k < m_kk; k++) { XML_Node* s = speciesDB->findByAttr("name", sss[k]); XML_Node *ss = s->findByName("standardState"); - m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "-"); + m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "toSI"); } MolalityVPSSTP::initThermoXML(phaseNode, id); diff --git a/Cantera/src/thermo/IdealSolidSolnPhase.cpp b/Cantera/src/thermo/IdealSolidSolnPhase.cpp index 70d0e25a5..66dd4f510 100644 --- a/Cantera/src/thermo/IdealSolidSolnPhase.cpp +++ b/Cantera/src/thermo/IdealSolidSolnPhase.cpp @@ -1253,7 +1253,7 @@ namespace Cantera { for (int k = 0; k < m_kk; k++) { XML_Node* s = speciesDB->findByAttr("name", sss[k]); XML_Node *ss = s->findByName("standardState"); - m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "-"); + m_speciesMolarVolume[k] = getFloat(*ss, "molarVolume", "toSI"); } /* diff --git a/Cantera/src/thermo/LatticePhase.cpp b/Cantera/src/thermo/LatticePhase.cpp index df7501d97..fc5158138 100644 --- a/Cantera/src/thermo/LatticePhase.cpp +++ b/Cantera/src/thermo/LatticePhase.cpp @@ -248,7 +248,7 @@ namespace Cantera { void LatticePhase::setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Lattice"); - m_molar_density = getFloat(eosdata, "site_density", "-"); + m_molar_density = getFloat(eosdata, "site_density", "toSI"); m_vacancy = getString(eosdata, "vacancy_species"); } } diff --git a/Cantera/src/thermo/PDSS_ConstVol.cpp b/Cantera/src/thermo/PDSS_ConstVol.cpp index b0fb1db2f..0acb66e34 100644 --- a/Cantera/src/thermo/PDSS_ConstVol.cpp +++ b/Cantera/src/thermo/PDSS_ConstVol.cpp @@ -119,7 +119,7 @@ namespace Cantera { "standardState model for species isn't constant_incompressible: " + speciesNode.name()); } - m_constMolarVolume = getFloat(*ss, "molarVolume", "-"); + m_constMolarVolume = getFloat(*ss, "molarVolume", "toSI"); std::string id = ""; initThermoXML(phaseNode, id); diff --git a/Cantera/src/thermo/SpeciesThermoFactory.cpp b/Cantera/src/thermo/SpeciesThermoFactory.cpp index d6bf0c6ef..02933b6e3 100755 --- a/Cantera/src/thermo/SpeciesThermoFactory.cpp +++ b/Cantera/src/thermo/SpeciesThermoFactory.cpp @@ -452,10 +452,10 @@ namespace Cantera { if (tmax == 0.0) tmax = 1.0e30; vector_fp c(4); - c[0] = getFloat(f, "t0", "-"); - c[1] = getFloat(f, "h0", "-"); - c[2] = getFloat(f, "s0", "-"); - c[3] = getFloat(f, "cp0", "-"); + c[0] = getFloat(f, "t0", "toSI"); + c[1] = getFloat(f, "h0", "toSI"); + c[2] = getFloat(f, "s0", "toSI"); + c[3] = getFloat(f, "cp0", "toSI"); doublereal p0 = OneAtm; sp.install(speciesName, k, SIMPLE, &c[0], tmin, tmax, p0); } @@ -540,7 +540,7 @@ namespace Cantera { } vector_fp coeffs(nfreq + 2); coeffs[0] = nfreq; - coeffs[1] = getFloat(f, "binding_energy", "-"); + coeffs[1] = getFloat(f, "binding_energy", "toSI"); copy(freqs.begin(), freqs.end(), coeffs.begin() + 2); //posc = new Adsorbate(k, tmin, tmax, pref, // DATA_PTR(coeffs)); diff --git a/Cantera/src/thermo/StoichSubstance.cpp b/Cantera/src/thermo/StoichSubstance.cpp index e4c1f9fe5..d745cf28d 100644 --- a/Cantera/src/thermo/StoichSubstance.cpp +++ b/Cantera/src/thermo/StoichSubstance.cpp @@ -135,7 +135,7 @@ namespace Cantera { void StoichSubstance::setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","StoichSubstance"); - doublereal rho = getFloat(eosdata, "density", "-"); + doublereal rho = getFloat(eosdata, "density", "toSI"); setDensity(rho); } diff --git a/Cantera/src/thermo/StoichSubstanceSSTP.cpp b/Cantera/src/thermo/StoichSubstanceSSTP.cpp index 41452a740..89d30123c 100644 --- a/Cantera/src/thermo/StoichSubstanceSSTP.cpp +++ b/Cantera/src/thermo/StoichSubstanceSSTP.cpp @@ -467,7 +467,7 @@ namespace Cantera { throw CanteraError("StoichSubstanceSSTP::StoichSubstanceSSTP", "thermo model attribute must be StoichSubstance"); } - doublereal rho = getFloat(eosdata, "density", "-"); + doublereal rho = getFloat(eosdata, "density", "toSI"); setDensity(rho); } diff --git a/Cantera/src/thermo/SurfPhase.cpp b/Cantera/src/thermo/SurfPhase.cpp index 82b32b417..bb6aea6e6 100644 --- a/Cantera/src/thermo/SurfPhase.cpp +++ b/Cantera/src/thermo/SurfPhase.cpp @@ -457,7 +457,7 @@ namespace Cantera { void SurfPhase:: setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Surface"); - doublereal n = getFloat(eosdata, "site_density", "-"); + doublereal n = getFloat(eosdata, "site_density", "toSI"); if (n <= 0.0) throw CanteraError("SurfPhase::setParametersFromXML", "missing or negative site density"); @@ -523,7 +523,7 @@ namespace Cantera { void EdgePhase:: setParametersFromXML(const XML_Node& eosdata) { eosdata._require("model","Edge"); - doublereal n = getFloat(eosdata, "site_density", "-"); + doublereal n = getFloat(eosdata, "site_density", "toSI"); if (n <= 0.0) throw CanteraError("EdgePhase::setParametersFromXML", "missing or negative site density"); diff --git a/Cantera/src/thermo/VPSSMgr_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_ConstVol.cpp index 8f419c7d9..4f725e081 100644 --- a/Cantera/src/thermo/VPSSMgr_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_ConstVol.cpp @@ -116,7 +116,7 @@ namespace Cantera { throw CanteraError("VPSSMgr_ConstVol::initThermoXML", "standardState model for species isn't constant_incompressible: " + s->name()); } - m_Vss[k] = getFloat(*ss, "molarVolume", "-"); + m_Vss[k] = getFloat(*ss, "molarVolume", "toSI"); } } @@ -143,7 +143,7 @@ namespace Cantera { if ((int) m_Vss.size() < k+1) { m_Vss.resize(k+1, 0.0); } - m_Vss[k] = getFloat(*ss, "molarVolume", "-"); + m_Vss[k] = getFloat(*ss, "molarVolume", "toSI"); installSTSpecies(k, speciesNode, phaseNode_ptr); diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp index 9b5de66b5..cb42dca4b 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -232,7 +232,7 @@ namespace Cantera { throw CanteraError("VPSSMgr_Water_ConstVol::initThermoXML", "standardState model for species isn't constant_incompressible: " + s->name()); } - m_Vss[k] = getFloat(*ss, "molarVolume", "-"); + m_Vss[k] = getFloat(*ss, "molarVolume", "toSI"); } } @@ -283,7 +283,7 @@ namespace Cantera { if ((int) m_Vss.size() < k+1) { m_Vss.resize(k+1, 0.0); } - m_Vss[k] = getFloat(*ss, "molarVolume", "-"); + m_Vss[k] = getFloat(*ss, "molarVolume", "toSI"); // instantiate a new kPDSS object kPDSS = new PDSS_ConstVol(m_vptp_ptr, k, speciesNode, *phaseNode_ptr, true);