22 m_iState(WATER_LIQUID),
26 m_allowGasPhase(false)
39 m_iState(WATER_LIQUID),
43 m_allowGasPhase(false)
53 const std::string& inputFile,
const std::string&
id) :
57 m_iState(WATER_LIQUID),
61 m_allowGasPhase(false)
72 const XML_Node& phaseRoot,
bool spInstalled) :
76 m_iState(WATER_LIQUID),
80 m_allowGasPhase(false)
95 m_iState(WATER_LIQUID),
96 EW_Offset(b.EW_Offset),
97 SW_Offset(b.SW_Offset),
98 m_verbose(b.m_verbose),
99 m_allowGasPhase(b.m_allowGasPhase)
136 const XML_Node& phaseNode,
const std::string&
id)
142 const std::string& inputFile,
const std::string&
id)
144 if (inputFile.size() == 0) {
146 "input file is null");
149 std::ifstream fin(path.c_str());
151 throw CanteraError(
"PDSS_Water::initThermo",
"could not open "
152 +path+
" for reading.");
164 "ERROR: Can not find phase named " +
165 id +
" in file named " + inputFile);
176 m_mw = 2 * 1.00794 + 15.9994;
181 doublereal T = 298.15;
185 doublereal presLow = 1.0E-2;
186 doublereal oneBar = 1.0E5;
187 doublereal dens = 1.0E-9;
193 if (s != 188.835E3) {
200 if (h != -241.826E6) {
306 int waterState = WATER_LIQUID;
308 waterState = WATER_SUPERCRIT;
313 std::string stateString =
"T = " +
316 "Failed to set water SS state: " + stateString);
326 "Water State isn't liquid or crit");
339 doublereal dens_save =
m_dens;
340 doublereal tt =
m_temp - 0.04;
343 throw CanteraError(
"PDSS_Water::dthermalExpansionCoeffdT",
344 "unable to solve for the density at T = " +
fp2str(tt) +
", P = " +
fp2str(pres));
349 return (val2 - vald) / 0.04;
417 doublereal pp =
m_sub.
psat(t, WATER_LIQUID);
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
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.
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.
doublereal psat_est(doublereal temperature) const
This function returns an estimated value for the saturation pressure.
SpeciesThermo * m_spthermo
Pointer to the species thermodynamic property manager.
PDSS_Water & operator=(const PDSS_Water &b)
Assignment operator.
const doublereal OneAtm
One atmosphere [Pa].
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
void setDensity(doublereal dens)
Set the density of the water phase.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
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...
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...
virtual doublereal critTemperature() const
critical temperature
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 dthermalExpansionCoeffdT() const
Return the derivative of the volumetric thermal expansion coefficient. Units: 1/K2.
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
void constructSet()
Internal routine that initializes the underlying water model.
virtual doublereal density() const
Return the standard state density at standard state.
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 critPressure() const
critical pressure
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
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 pref_safe(doublereal temp) const
Returns a reference pressure value that can be safely calculated by the underlying real equation of s...
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
WaterProps m_waterProps
Pointer to the WaterProps object.
doublereal molarVolume() const
Calculate the molar volume (kmol m-3) at the last temperature and density.
bool m_verbose
Verbose flag - used?
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Class for the liquid water pressure dependent standard state.
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
virtual doublereal satPressure(doublereal t)
saturation pressure
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual doublereal pressure() const
Returns the pressure (Pa)
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
Base class for exceptions thrown by Cantera classes.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density...
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.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal critDensity() const
critical density
doublereal SW_Offset
Offset constant used to obtain consistency with NIST convention.
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
Virtual base class for a species with a pressure dependent standard state.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal m_temp
Current temperature used by the PDSS object.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
PDSS & operator=(const PDSS &b)
Assignment operator.
Contains declarations for string manipulation functions within Cantera.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
bool m_allowGasPhase
Since this phase represents a liquid phase, it's an error to return a gas-phase answer.
doublereal EW_Offset
Offset constants used to obtain consistency with the NIST database.
void build(std::istream &f)
Main routine to create an tree-like representation of an XML file.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
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.
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...