18 m_iState(WATER_LIQUID),
22 m_allowGasPhase(false)
35 m_iState(WATER_LIQUID),
39 m_allowGasPhase(false)
49 const std::string& inputFile,
const std::string&
id) :
53 m_iState(WATER_LIQUID),
57 m_allowGasPhase(false)
60 "To be removed after Cantera 2.3.");
70 const XML_Node& phaseRoot,
bool spInstalled) :
74 m_iState(WATER_LIQUID),
78 m_allowGasPhase(false)
93 m_iState(WATER_LIQUID),
94 EW_Offset(b.EW_Offset),
95 SW_Offset(b.SW_Offset),
96 m_verbose(b.m_verbose),
97 m_allowGasPhase(b.m_allowGasPhase)
104 PDSS_Water& PDSS_Water::operator=(
const PDSS_Water& b)
130 const XML_Node& phaseNode,
const std::string&
id)
136 const std::string& inputFile,
const std::string&
id)
139 "To be removed after Cantera 2.3.");
140 if (inputFile.size() == 0) {
142 "input file is null");
152 "ERROR: Can not find phase named " +
153 id +
" in file named " + inputFile);
162 m_mw = 2 * 1.00794 + 15.9994;
165 doublereal T = 298.15;
167 doublereal presLow = 1.0E-2;
168 doublereal oneBar = 1.0E5;
169 doublereal dens = 1.0E-9;
175 if (s != 188.835E3) {
182 if (h != -241.826E6) {
285 int waterState = WATER_LIQUID;
287 waterState = WATER_SUPERCRIT;
293 "Failed to set water SS state: T = {} K and p = {} Pa", T, p);
302 "Water State isn't liquid or crit");
314 doublereal dens_save =
m_dens;
315 doublereal tt =
m_temp - 0.04;
318 throw CanteraError(
"PDSS_Water::dthermalExpansionCoeffdT",
319 "unable to solve for the density at T = {}, P = {}", tt, pres);
324 return (val2 - vald) / 0.04;
392 doublereal pp =
m_sub.
psat(t, WATER_LIQUID);
doublereal psat_est(doublereal temperature) const
This function returns an estimated value for the saturation pressure.
doublereal m_dens
State of the system - density.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
XML_Node * findXMLPhase(XML_Node *root, const std::string &idtarget)
Search an XML_Node tree for a named phase XML_Node.
virtual doublereal critPressure() const
critical pressure
const doublereal OneAtm
One atmosphere [Pa].
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
virtual doublereal pressure() const
Returns the pressure (Pa)
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
void setDensity(doublereal dens)
Set the density of the water phase.
doublereal density(doublereal temperature, doublereal pressure, int phase=-1, doublereal rhoguess=-1.0)
Calculates the density given the temperature and the pressure, and a guess at the density...
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
virtual doublereal critDensity() const
critical density
doublereal m_pres
State of the system - pressure.
WaterPropsIAPWS m_sub
Pointer to the WaterPropsIAPWS object, which does the actual calculations for the real equation of st...
Class XML_Node is a tree-based representation of the contents of an XML file.
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
doublereal molarVolume() const
Calculate the molar volume (kmol m-3) at the last temperature and density.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
void constructSet()
Internal routine that initializes the underlying water model.
PDSS_enumType m_pdssType
Enumerated type describing the type of the PDSS object.
void constructPDSSXML(VPStandardStateTP *vptp_ptr, int spindex, const XML_Node &phaseNode, const std::string &id)
Initialization of a PDSS object using an XML tree.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density...
void constructPDSSFile(VPStandardStateTP *vptp_ptr, int spindex, const std::string &inputFile, const std::string &id)
Initialization of a PDSS object using an input XML file.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
virtual void initThermo()
Initialization routine for all of the shallow pointers.
WaterProps m_waterProps
Pointer to the WaterProps object.
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
bool m_verbose
Verbose flag - used?
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
Class for the liquid water pressure dependent standard state.
virtual doublereal satPressure(doublereal t)
saturation pressure
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Base class for exceptions thrown by Cantera classes.
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
void build(const std::string &filename)
Populate the XML tree from an input file.
doublereal pref_safe(doublereal temp) const
Returns a reference pressure value that can be safely calculated by the underlying real equation of s...
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
virtual doublereal dthermalExpansionCoeffdT() const
Return the derivative of the volumetric thermal expansion coefficient.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
doublereal m_maxTemp
Maximum temperature.
int m_iState
state of the fluid
virtual void setTemperature(doublereal temp)
Set the internal temperature.
doublereal m_minTemp
Minimum temperature.
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
doublereal SW_Offset
Offset constant used to obtain consistency with NIST convention.
Virtual base class for a species with a pressure dependent standard state.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal m_temp
Current temperature used by the PDSS object.
PDSS & operator=(const PDSS &b)
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
Contains declarations for string manipulation functions within Cantera.
virtual doublereal critTemperature() const
critical temperature
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
MultiSpeciesThermo * m_spthermo
Pointer to the species thermodynamic property manager.
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
virtual doublereal density() const
Return the standard state density at standard state.
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
bool m_allowGasPhase
Since this phase represents a liquid phase, it's an error to return a gas-phase answer.
Namespace for the Cantera kernel.
doublereal EW_Offset
Offset constants used to obtain consistency with the NIST database.
PDSS_Water()
Bare constructor.
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter, and sets the internal state to the saturated conditions.
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...