Cantera  2.0
WaterPropsIAPWSphi Class Reference

Low level class for the real description of water. More...

#include <WaterPropsIAPWSphi.h>

## Public Member Functions

WaterPropsIAPWSphi ()
Base constructor.

doublereal phi (doublereal tau, doublereal delta)
Calculate the Phi function, which is the base function.

doublereal phi_d (doublereal tau, doublereal delta)
Calculate derivative of phi wrt delta.

doublereal phi_dd (doublereal tau, doublereal delta)
2nd derivative of phi wrt delta

doublereal phi_t (doublereal tau, doublereal delta)
First derivative of phi wrt tau.

doublereal phi_tt (doublereal tau, doublereal delta)
Second derivative of phi wrt tau.

void check1 ()
Internal check # 1.

void check2 ()
Internal check # 2.

doublereal pressureM_rhoRT (doublereal tau, doublereal delta)
Calculate the dimensionless pressure at tau and delta;.

doublereal dimdpdrho (doublereal tau, doublereal delta)
Dimensionless derivative of p wrt rho at constant T.

doublereal dimdpdT (doublereal tau, doublereal delta)
Dimensionless derivative of p wrt T at constant rho.

doublereal dfind (doublereal p_red, doublereal tau, doublereal deltaGuess)
This function computes the reduced density, given the reduced pressure and the reduced temperature, tau.

doublereal gibbs_RT () const
Calculate the dimensionless gibbs free energy.

doublereal enthalpy_RT () const
Calculate the dimensionless enthalpy, h/RT.

doublereal entropy_R () const
Calculate the dimensionless entropy, s/R.

doublereal intEnergy_RT () const
Calculate the dimensionless internal energy, u/RT.

doublereal cv_R () const
Calculate the dimensionless constant volume heat capacity, Cv/R.

doublereal cp_R () const
Calculate the dimensionless constant pressure heat capacity, Cv/R.

void tdpolycalc (doublereal tau, doublereal delta)
Calculates internal polynomials in tau and delta.

doublereal phiR () const

## Private Member Functions

doublereal phi0 () const
Calculate Equation 6.5 for phi0, the ideal gas part of the dimensionless Helmholtz free energy.

doublereal phiR_d () const
Calculate d_phiR_d(delta), the first derivative of phiR wrt delta.

doublereal phi0_d () const
Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta.

doublereal phiR_dd () const
Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta.

doublereal phi0_dd () const
Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta.

doublereal phi0_t () const
Calculate d_phi0/d(tau)

doublereal phiR_t () const
Calculate Equation 6.6 for dphiRdtau, the derivative residual part of the dimensionless Helmholtz free energy wrt temperature.

doublereal phiR_tt () const
Calculate Equation 6.6 for dphiRdtau, the second derivative residual part of the dimensionless Helmholtz free energy wrt temperature.

doublereal phi0_tt () const
Calculate d2_phi0/dtau2.

doublereal phiR_dt () const
Calculate the mixed derivative d2_phiR/(dtau ddelta)

doublereal phi0_dt () const
Calculate the mixed derivative d2_phi0/(dtau ddelta)

void intCheck (doublereal tau, doublereal delta)
Calculates all of the functions at a one point and prints out the result.

## Private Attributes

doublereal TAUp [52]
Value of internally calculated polynomials of powers of TAU.

doublereal DELTAp [16]
Value of internally calculated polynomials of powers of delta.

doublereal TAUsave
Last tau that was used to calculate polynomials.

doublereal TAUsqrt
sqrt of TAU

doublereal DELTAsave
Last delta that was used to calculate polynomials.

## Detailed Description

Low level class for the real description of water.

The reference is W. Wagner, A. Prub, "The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use," J. Phys. Chem. Ref. Dat, 31, 387, 2002.

Units Note: This class works with reduced units exclusively.

Definition at line 30 of file WaterPropsIAPWSphi.h.

## Constructor & Destructor Documentation

 WaterPropsIAPWSphi ( )

Base constructor.

Definition at line 367 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::DELTAp, and WaterPropsIAPWSphi::TAUp.

## Member Function Documentation

 doublereal phi ( doublereal tau, doublereal delta )

Calculate the Phi function, which is the base function.

The phi function is basically the helmholtz free energy Eqn. (6.4) All internal polynomials are recalculated.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 513 of file WaterPropsIAPWSphi.cpp.

 doublereal phi_d ( doublereal tau, doublereal delta )

Calculate derivative of phi wrt delta.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 597 of file WaterPropsIAPWSphi.cpp.

 doublereal phi_dd ( doublereal tau, doublereal delta )

2nd derivative of phi wrt delta

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 718 of file WaterPropsIAPWSphi.cpp.

 doublereal phi_t ( doublereal tau, doublereal delta )

First derivative of phi wrt tau.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 819 of file WaterPropsIAPWSphi.cpp.

 doublereal phi_tt ( doublereal tau, doublereal delta )

Second derivative of phi wrt tau.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 916 of file WaterPropsIAPWSphi.cpp.

 void check1 ( )

Internal check # 1.

Definition at line 404 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::intCheck(), Cantera::Rho_c, and Cantera::T_c.

 void check2 ( )

Internal check # 2.

Definition at line 414 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::intCheck(), Cantera::Rho_c, and Cantera::T_c.

 doublereal pressureM_rhoRT ( doublereal tau, doublereal delta )

Calculate the dimensionless pressure at tau and delta;.

  pM/(rhoRT) = delta * phi_d() = 1.0 + delta phiR_d()

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

note: this is done so much, we have a separate routine.

Definition at line 605 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::phiR_d(), and WaterPropsIAPWSphi::tdpolycalc().

Referenced by WaterPropsIAPWS::pressure().

 doublereal dimdpdrho ( doublereal tau, doublereal delta )

Dimensionless derivative of p wrt rho at constant T.

dp/drho * 1/RT = (2. delta phi_d() + delta**2 phi_dd()) (1.0 + 2. delta phiR_d() + delta**2 phiR_dd())

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 726 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::dpdrho().

 doublereal dimdpdT ( doublereal tau, doublereal delta )

Dimensionless derivative of p wrt T at constant rho.

dp/dT * M/(Rho R) = (1.0 + delta phiR_d()

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 734 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::coeffPresExp().

 doublereal dfind ( doublereal p_red, doublereal tau, doublereal deltaGuess )

This function computes the reduced density, given the reduced pressure and the reduced temperature, tau.

It takes an initial guess, deltaGuess. DeltaGuess is important as this is a multivalued function below the critical point.

Parameters
 p_red Value of the dimensionless pressure tau Dimensionless temperature = T_c/T deltaGuess Initial guess for the dimensionless density
Returns
Returns the dimensionless density.

Definition at line 1015 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::density(), and WaterPropsIAPWS::density_const().

 doublereal gibbs_RT ( ) const

Calculate the dimensionless gibbs free energy.

Definition at line 1106 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::corr(), and WaterPropsIAPWS::Gibbs().

 doublereal enthalpy_RT ( ) const

Calculate the dimensionless enthalpy, h/RT.

Definition at line 1113 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::enthalpy().

 doublereal entropy_R ( ) const

Calculate the dimensionless entropy, s/R.

Definition at line 1123 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::entropy().

 doublereal intEnergy_RT ( ) const

Calculate the dimensionless internal energy, u/RT.

Definition at line 1133 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::intEnergy().

 doublereal cv_R ( ) const

Calculate the dimensionless constant volume heat capacity, Cv/R.

Definition at line 1141 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWSphi::cp_R(), and WaterPropsIAPWS::cv().

 doublereal cp_R ( ) const

Calculate the dimensionless constant pressure heat capacity, Cv/R.

Definition at line 1149 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWS::cp().

 void tdpolycalc ( doublereal tau, doublereal delta )

Calculates internal polynomials in tau and delta.

This routine is used to store the internal state of tau and delta for later use by the other routines in the class.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 424 of file WaterPropsIAPWSphi.cpp.

 doublereal phiR ( ) const

Calculate Equation 6.6 for phiR, the residual part of the dimensionless Helmholtz free energy.

Definition at line 457 of file WaterPropsIAPWSphi.cpp.

 doublereal phi0 ( ) const
private

Calculate Equation 6.5 for phi0, the ideal gas part of the dimensionless Helmholtz free energy.

Definition at line 443 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::DELTAsave, and WaterPropsIAPWSphi::TAUsave.

 doublereal phiR_d ( ) const
private

Calculate d_phiR_d(delta), the first derivative of phiR wrt delta.

Definition at line 521 of file WaterPropsIAPWSphi.cpp.

 doublereal phi0_d ( ) const
private

Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta.

Definition at line 591 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::DELTAsave.

Referenced by WaterPropsIAPWSphi::intCheck(), and WaterPropsIAPWSphi::phi_d().

 doublereal phiR_dd ( ) const
private

Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta.

Definition at line 612 of file WaterPropsIAPWSphi.cpp.

 doublereal phi0_dd ( ) const
private

Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta.

Definition at line 712 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::DELTAsave.

Referenced by WaterPropsIAPWSphi::intCheck(), and WaterPropsIAPWSphi::phi_dd().

 doublereal phi0_t ( ) const
private

Calculate d_phi0/d(tau)

Definition at line 742 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::TAUsave.

 doublereal phiR_t ( ) const
private

Calculate Equation 6.6 for dphiRdtau, the derivative residual part of the dimensionless Helmholtz free energy wrt temperature.

Definition at line 754 of file WaterPropsIAPWSphi.cpp.

 doublereal phiR_tt ( ) const
private

Calculate Equation 6.6 for dphiRdtau, the second derivative residual part of the dimensionless Helmholtz free energy wrt temperature.

Definition at line 840 of file WaterPropsIAPWSphi.cpp.

 doublereal phi0_tt ( ) const
private

Calculate d2_phi0/dtau2.

Definition at line 827 of file WaterPropsIAPWSphi.cpp.

References WaterPropsIAPWSphi::TAUsave.

 doublereal phiR_dt ( ) const
private

Calculate the mixed derivative d2_phiR/(dtau ddelta)

Definition at line 929 of file WaterPropsIAPWSphi.cpp.

 doublereal phi0_dt ( ) const
private

Calculate the mixed derivative d2_phi0/(dtau ddelta)

Definition at line 924 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWSphi::intCheck().

 void intCheck ( doublereal tau, doublereal delta )
private

Calculates all of the functions at a one point and prints out the result.

It's used for conducting the internal check.

Parameters
 tau Dimensionless temperature = T_c/T delta Dimensionless density = delta = rho / Rho_c

Definition at line 380 of file WaterPropsIAPWSphi.cpp.

Referenced by WaterPropsIAPWSphi::check1(), and WaterPropsIAPWSphi::check2().

## Member Data Documentation

 doublereal TAUp[52]
private

Value of internally calculated polynomials of powers of TAU.

Definition at line 197 of file WaterPropsIAPWSphi.h.

 doublereal DELTAp[16]
private

Value of internally calculated polynomials of powers of delta.

Definition at line 200 of file WaterPropsIAPWSphi.h.

 doublereal TAUsave
private

Last tau that was used to calculate polynomials.

Definition at line 203 of file WaterPropsIAPWSphi.h.

 doublereal TAUsqrt
private

sqrt of TAU

Definition at line 206 of file WaterPropsIAPWSphi.h.

 doublereal DELTAsave
private

Last delta that was used to calculate polynomials.

Definition at line 209 of file WaterPropsIAPWSphi.h.

The documentation for this class was generated from the following files: