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()