From b033d44d3e00a1c4a36cd1a501ff77d34da18bbe Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 19 Feb 2017 17:48:55 -0500 Subject: [PATCH] [Thermo] Make PDSS_ConstVol configurable without XML --- include/cantera/thermo/PDSS_ConstVol.h | 6 ++++++ src/thermo/PDSS_ConstVol.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/cantera/thermo/PDSS_ConstVol.h b/include/cantera/thermo/PDSS_ConstVol.h index 745e853db..a61379070 100644 --- a/include/cantera/thermo/PDSS_ConstVol.h +++ b/include/cantera/thermo/PDSS_ConstVol.h @@ -55,6 +55,12 @@ public: virtual void initThermo(); virtual void setParametersFromXML(const XML_Node& speciesNode); + //! Set the (constant) molar volume [m3/kmol] of the species. Must be called before + //! initThermo(). + void setMolarVolume(double v) { + m_constMolarVolume = v; + } + //@} private: diff --git a/src/thermo/PDSS_ConstVol.cpp b/src/thermo/PDSS_ConstVol.cpp index dbfdc7d32..22d45a946 100644 --- a/src/thermo/PDSS_ConstVol.cpp +++ b/src/thermo/PDSS_ConstVol.cpp @@ -34,7 +34,7 @@ void PDSS_ConstVol::setParametersFromXML(const XML_Node& speciesNode) "standardState model for species isn't constant_incompressible: " + speciesNode.name()); } - m_constMolarVolume = getFloat(*ss, "molarVolume", "toSI"); + setMolarVolume(getFloat(*ss, "molarVolume", "toSI")); } void PDSS_ConstVol::initThermo()