From ff46dc93b514d646cccf359e807cfb57ad68a460 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 18 Feb 2017 13:26:40 -0500 Subject: [PATCH] [Thermo] Fix inconsistencies in PDSS_IonsFromNeutral The definitions of p0, Tmin, and Tmax were circular -- they queried the STITbyPDSS object which just referenced the same PDSS_IonsFromNeutral object. Instead, pull these properties from the associated "neutral molecule" phase. The overrides of setTemperature and temperature were unnecessary and likely to cause problems. --- include/cantera/thermo/PDSS_IonsFromNeutral.h | 2 -- src/thermo/PDSS_IonsFromNeutral.cpp | 19 +++---------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index b127af575..52dd6ec51 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -102,8 +102,6 @@ public: //! @name Mechanical Equation of State Properties //! @{ - virtual void setTemperature(doublereal temp); - virtual doublereal temperature() const; virtual void setState_TP(doublereal temp, doublereal pres); virtual void setState_TR(doublereal temp, doublereal rho); diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index dfe2af464..71e369c87 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -94,9 +94,9 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde void PDSS_IonsFromNeutral::initThermo() { PDSS::initThermo(); - m_p0 = m_tp->speciesThermo().refPressure(m_spindex); - m_minTemp = m_spthermo->minTemp(m_spindex); - m_maxTemp = m_spthermo->maxTemp(m_spindex); + m_p0 = neutralMoleculePhase_->refPressure(); + m_minTemp = neutralMoleculePhase_->minTemp(); + m_maxTemp = neutralMoleculePhase_->maxTemp(); } doublereal PDSS_IonsFromNeutral::enthalpy_RT() const @@ -231,19 +231,6 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const return val; } -doublereal PDSS_IonsFromNeutral::temperature() const -{ - // Obtain the temperature from the owning VPStandardStateTP object if you - // can. - m_temp = m_tp->temperature(); - return m_temp; -} - -void PDSS_IonsFromNeutral::setTemperature(doublereal temp) -{ - m_temp = temp; -} - void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres) { m_pres = pres;