19 PDSS_ConstVol::PDSS_ConstVol()
23 void PDSS_ConstVol::setParametersFromXML(
const XML_Node& speciesNode)
25 PDSS::setParametersFromXML(speciesNode);
30 "no standardState Node for species " + speciesNode.
name());
32 if (ss->
attrib(
"model") !=
"constant_incompressible") {
34 "standardState model for species isn't constant_incompressible: " + speciesNode.
name());
37 setMolarVolume(
getFloat(*ss,
"molarVolume",
"toSI"));
40 void PDSS_ConstVol::initThermo()
43 m_minTemp = m_spthermo->minTemp();
44 m_maxTemp = m_spthermo->maxTemp();
45 m_p0 = m_spthermo->refPressure();
46 m_V0 = m_constMolarVolume;
47 m_Vss = m_constMolarVolume;
50 doublereal PDSS_ConstVol::intEnergy_mole()
const 52 doublereal pV = (m_pres * m_Vss);
56 doublereal PDSS_ConstVol::cv_mole()
const 58 return (cp_mole() - m_V0);
61 void PDSS_ConstVol::setPressure(doublereal p)
64 doublereal del_pRT = (m_pres - m_p0) / (
GasConstant * m_temp);
65 m_hss_RT = m_h0_RT + del_pRT * m_Vss;
66 m_gss_RT = m_hss_RT - m_sss_R;
69 void PDSS_ConstVol::setTemperature(doublereal temp)
72 m_spthermo->updatePropertiesTemp(temp, &m_cp0_R, &m_h0_RT, &m_s0_R);
73 m_g0_RT = m_h0_RT - m_s0_R;
75 doublereal del_pRT = (m_pres - m_p0) / (
GasConstant * m_temp);
77 m_hss_RT = m_h0_RT + del_pRT * m_Vss;
80 m_gss_RT = m_hss_RT - m_sss_R;
83 void PDSS_ConstVol::setState_TP(doublereal temp, doublereal pres)
89 void PDSS_ConstVol::setState_TR(doublereal temp, doublereal rho)
91 doublereal rhoStored = m_mw / m_constMolarVolume;
92 if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) {
94 "Inconsistent supplied rho");
99 doublereal PDSS_ConstVol::satPressure(doublereal t)
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
std::string name() const
Returns the name of the XML node.
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node...
Class XML_Node is a tree-based representation of the contents of an XML file.
Base class for exceptions thrown by Cantera classes.
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
Namespace for the Cantera kernel.