From d6d91f4d98c5c7dbfe36e3318d307c768ad6415a Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 6 Mar 2019 18:17:48 -0500 Subject: [PATCH] [Thermo] Fix updating state of PDSS_IonsFromNeutral objects Setting T and P now updates the state of the underlying "neutral molecule phase". Also removed the unimplemented setState_TR method. --- include/cantera/thermo/PDSS_IonsFromNeutral.h | 1 - src/thermo/PDSS_IonsFromNeutral.cpp | 5 +---- test/thermo/phaseConstructors.cpp | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/cantera/thermo/PDSS_IonsFromNeutral.h b/include/cantera/thermo/PDSS_IonsFromNeutral.h index 9fd2188fcc..edf30e5872 100644 --- a/include/cantera/thermo/PDSS_IonsFromNeutral.h +++ b/include/cantera/thermo/PDSS_IonsFromNeutral.h @@ -80,7 +80,6 @@ class PDSS_IonsFromNeutral : public PDSS_Nondimensional //! @{ virtual void setState_TP(doublereal temp, doublereal pres); - virtual void setState_TR(doublereal temp, doublereal rho); //! @} //! @name Initialization of the Object diff --git a/src/thermo/PDSS_IonsFromNeutral.cpp b/src/thermo/PDSS_IonsFromNeutral.cpp index 3d22ac42b3..cf49d73d05 100644 --- a/src/thermo/PDSS_IonsFromNeutral.cpp +++ b/src/thermo/PDSS_IonsFromNeutral.cpp @@ -214,12 +214,9 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres) { + neutralMoleculePhase_->setState_TP(temp, pres); m_pres = pres; m_temp = temp; } -void PDSS_IonsFromNeutral::setState_TR(doublereal temp, doublereal rho) -{ -} - } diff --git a/test/thermo/phaseConstructors.cpp b/test/thermo/phaseConstructors.cpp index c4b2c758a5..1c7e84412a 100644 --- a/test/thermo/phaseConstructors.cpp +++ b/test/thermo/phaseConstructors.cpp @@ -111,7 +111,7 @@ TEST(IonsFromNeutralConstructor, fromXML) // Values for regression testing only -- no reference values known for comparison EXPECT_NEAR(p->density(), 1984.3225978174073, 1e-6); - EXPECT_NEAR(p->enthalpy_mass(), -8035317241137.971, 1e-1); + EXPECT_NEAR(p->enthalpy_mass(), -14737778.668383721, 1e-6); EXPECT_NEAR(mu[0], -4.66404010e+08, 1e1); EXPECT_NEAR(mu[1], -2.88157298e+06, 1e-1); } @@ -150,7 +150,7 @@ TEST(IonsFromNeutralConstructor, fromScratch) // Values for regression testing only -- same as XML test EXPECT_NEAR(p.density(), 1984.3225978174073, 1e-6); - EXPECT_NEAR(p.enthalpy_mass(), -8035317241137.971, 1e-1); + EXPECT_NEAR(p.enthalpy_mass(), -14737778.668383721, 1e-6); EXPECT_NEAR(mu[0], -4.66404010e+08, 1e1); EXPECT_NEAR(mu[1], -2.88157298e+06, 1e-1); }