31 m_iState(WATER_LIQUID),
35 m_allowGasPhase(false)
51 m_iState(WATER_LIQUID),
55 m_allowGasPhase(false)
67 const std::string& inputFile,
const std::string&
id) :
72 m_iState(WATER_LIQUID),
76 m_allowGasPhase(false)
89 const XML_Node& phaseRoot,
bool spInstalled) :
94 m_iState(WATER_LIQUID),
98 m_allowGasPhase(false)
116 m_iState(WATER_LIQUID),
117 EW_Offset(b.EW_Offset),
118 SW_Offset(b.SW_Offset),
119 m_verbose(b.m_verbose),
120 m_allowGasPhase(b.m_allowGasPhase)
172 const XML_Node& phaseNode,
const std::string&
id)
178 const std::string& inputFile,
const std::string&
id)
180 if (inputFile.size() == 0) {
182 "input file is null");
185 std::ifstream fin(path.c_str());
187 throw CanteraError(
"PDSS_Water::initThermo",
"could not open "
188 +path+
" for reading.");
200 "ERROR: Can not find phase named " +
201 id +
" in file named " + inputFile);
213 "could not create new substance object.");
219 m_mw = 2 * 1.00794 + 15.9994;
224 doublereal T = 298.15;
228 doublereal presLow = 1.0E-2;
229 doublereal oneBar = 1.0E5;
230 doublereal dens = 1.0E-9;
236 if (s != 188.835E3) {
244 if (h != -241.826E6) {
366 int waterState = WATER_LIQUID;
368 waterState = WATER_SUPERCRIT;
377 std::string stateString =
"T = " +
380 "Failed to set water SS state: " + stateString);
390 "Water State isn't liquid or crit");
403 doublereal dens_save =
m_dens;
404 doublereal tt =
m_temp - 0.04;
407 throw CanteraError(
"PDSS_Water::dthermalExpansionCoeffdT",
408 "unable to solve for the density at T = " +
fp2str(tt) +
", P = " +
fp2str(pres));
413 return (val2 - vald) / 0.04;
469 if (temp < m_sub->Tcrit()) {
482 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.
WaterPropsIAPWS * m_sub
Pointer to the WaterPropsIAPWS object, which does the actual calculations for the real equation of st...
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.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
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.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
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...
Class for calculating the equation of state of water.
doublereal m_pres
State of the system - pressure.
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...
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
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.
Header for a class used to house several approximation routines for properties of water...
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.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
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.
doublereal molarVolume() const
Calculate the molar volume (kmol m-3) at the last temperature and density.
bool m_verbose
Verbose flag - used?
The WaterProps class is used to house several approximation routines for properties of water...
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
Classes providing support for XML data files.
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.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
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.
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
Virtual base class for a species with a pressure dependent standard state.
virtual ~PDSS_Water()
Destructor.
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...
WaterProps * m_waterProps
Pointer to the WaterProps object.
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...