19 m_iState(WATER_LIQUID),
22 m_allowGasPhase(false)
29 doublereal T = 298.15;
31 doublereal presLow = 1.0E-2;
32 doublereal oneBar = 1.0E5;
33 doublereal dens = 1.0E-9;
46 if (h != -241.826E6) {
149 int waterState = WATER_LIQUID;
151 waterState = WATER_SUPERCRIT;
157 "Failed to set water SS state: T = {} K and p = {} Pa", T, p);
166 "Water State isn't liquid or crit");
178 doublereal dens_save =
m_dens;
179 doublereal tt =
m_temp - 0.04;
182 throw CanteraError(
"PDSS_Water::dthermalExpansionCoeffdT",
183 "unable to solve for the density at T = {}, P = {}", tt, pres);
188 return (val2 - vald) / 0.04;
256 doublereal pp =
m_sub.
psat(t, WATER_LIQUID);
Contains the getElementWeight function and the definitions of element constraint types.
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...
Base class for exceptions thrown by Cantera classes.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
WaterPropsIAPWS m_sub
Pointer to the WaterPropsIAPWS object, which does the actual calculations for the real equation of st...
virtual doublereal pressure() const
Returns the pressure (Pa)
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
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 critPressure() const
critical pressure
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
doublereal EW_Offset
Offset constants used to obtain consistency with the NIST database.
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual doublereal dthermalExpansionCoeffdT() const
Return the derivative of the volumetric thermal expansion coefficient.
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
void setDensity(doublereal dens)
Set the density of the water phase.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual doublereal critTemperature() const
critical temperature
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
int m_iState
state of the fluid
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
virtual doublereal density() const
Return the standard state density at standard state.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
virtual doublereal satPressure(doublereal t)
saturation pressure
doublereal m_dens
State of the system - density.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
doublereal SW_Offset
Offset constant used to obtain consistency with NIST convention.
bool m_allowGasPhase
Since this phase represents a liquid phase, it's an error to return a gas-phase answer.
virtual doublereal critDensity() const
critical density
PDSS_Water()
Default constructor.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
doublereal m_pres
State of the system - pressure.
doublereal m_temp
Current temperature used by the PDSS object.
doublereal m_maxTemp
Maximum temperature.
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.
doublereal m_minTemp
Minimum temperature.
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 coeffThermExp() const
Returns the coefficient of thermal expansion.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density.
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
doublereal Tcrit() const
Returns the critical temperature of water (Kelvin)
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
doublereal molarVolume() const
Calculate the molar volume (kmol m-3) at the last temperature and density.
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
doublereal Rhocrit() const
Return the critical density of water (kg m-3)
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
doublereal psat_est(doublereal temperature) const
This function returns an estimated value for the saturation pressure.
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter,...
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
doublereal Pcrit() const
Returns the critical pressure of water (22.064E6 Pa)
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
const double OneAtm
One atmosphere [Pa].
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
double getElementWeight(const std::string &ename)
Get the atomic weight of an element.
Contains declarations for string manipulation functions within Cantera.