Cantera  3.0.0
Loading...
Searching...
No Matches
WaterPropsIAPWSphi Class Reference

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

#include <WaterPropsIAPWSphi.h>

Detailed Description

Low level class for the real description of water.

This is a helper class for WaterSSTP and PDSS_Water and does not constitute a complete implementation of a thermo phase by itself (see Thermodynamic Properties and classes WaterSSTP and PDSS_Water).

The reference is Wagner and Pruss [47].

Units Note: This class works with reduced units exclusively.

Definition at line 32 of file WaterPropsIAPWSphi.h.

Public Member Functions

 WaterPropsIAPWSphi ()
 Base constructor.
 
double phi (double tau, double delta)
 Calculate the Phi function, which is the base function.
 
double phi_d (double tau, double delta)
 Calculate derivative of phi wrt delta.
 
double phi_dd (double tau, double delta)
 2nd derivative of phi wrt delta
 
double phi_t (double tau, double delta)
 First derivative of phi wrt tau.
 
double phi_tt (double tau, double delta)
 Second derivative of phi wrt tau.
 
double pressureM_rhoRT (double tau, double delta)
 Calculate the dimensionless pressure at tau and delta;.
 
double dimdpdrho (double tau, double delta)
 Dimensionless derivative of p wrt rho at constant T.
 
double dimdpdT (double tau, double delta)
 Dimensionless derivative of p wrt T at constant rho.
 
double dfind (double p_red, double tau, double deltaGuess)
 This function computes the reduced density, given the reduced pressure and the reduced temperature, tau.
 
double gibbs_RT () const
 Calculate the dimensionless Gibbs free energy.
 
double enthalpy_RT () const
 Calculate the dimensionless enthalpy, h/RT.
 
double entropy_R () const
 Calculate the dimensionless entropy, s/R.
 
double intEnergy_RT () const
 Calculate the dimensionless internal energy, u/RT.
 
double cv_R () const
 Calculate the dimensionless constant volume heat capacity, Cv/R.
 
double cp_R () const
 Calculate the dimensionless constant pressure heat capacity, Cv/R.
 
void tdpolycalc (double tau, double delta)
 Calculates internal polynomials in tau and delta.
 
double phiR () const
 Calculate Equation 6.6 for phiR, the residual part of the dimensionless Helmholtz free energy.
 

Protected Member Functions

double phi0 () const
 Calculate Equation 6.5 for phi0, the ideal gas part of the dimensionless Helmholtz free energy.
 
double phiR_d () const
 Calculate d_phiR_d(delta), the first derivative of phiR wrt delta.
 
double phi0_d () const
 Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta.
 
double phiR_dd () const
 Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta.
 
double phi0_dd () const
 Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta.
 
double phi0_t () const
 Calculate d_phi0/d(tau)
 
double phiR_t () const
 Calculate Equation 6.6 for dphiRdtau, the derivative residual part of the dimensionless Helmholtz free energy wrt temperature.
 
double phiR_tt () const
 Calculate Equation 6.6 for dphiRdtau, the second derivative residual part of the dimensionless Helmholtz free energy wrt temperature.
 
double phi0_tt () const
 Calculate d2_phi0/dtau2.
 
double phiR_dt () const
 Calculate the mixed derivative d2_phiR/(dtau ddelta)
 
double phi0_dt () const
 Calculate the mixed derivative d2_phi0/(dtau ddelta)
 

Protected Attributes

double TAUp [52]
 Value of internally calculated polynomials of powers of TAU.
 
double DELTAp [16]
 Value of internally calculated polynomials of powers of delta.
 
double TAUsave = -1.0
 Last tau that was used to calculate polynomials.
 
double TAUsqrt = -1.0
 sqrt of TAU
 
double DELTAsave = -1.0
 Last delta that was used to calculate polynomials.
 

Constructor & Destructor Documentation

◆ WaterPropsIAPWSphi()

Base constructor.

The added constants were calculated so that u = s = 0 for liquid at the triple point.

These where determined by the program testPress. I'm not quite satisfied with the result, but will let it stand for the moment. H didn't turn out to be .611872 J/kg, but .611782 J/kg. There may be a slight error here somehow.

Definition at line 351 of file WaterPropsIAPWSphi.cpp.

Member Function Documentation

◆ phi()

double phi ( double  tau,
double  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
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 440 of file WaterPropsIAPWSphi.cpp.

◆ phi_d()

double phi_d ( double  tau,
double  delta 
)

Calculate derivative of phi wrt delta.

Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 512 of file WaterPropsIAPWSphi.cpp.

◆ phi_dd()

double phi_dd ( double  tau,
double  delta 
)

2nd derivative of phi wrt delta

Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 616 of file WaterPropsIAPWSphi.cpp.

◆ phi_t()

double phi_t ( double  tau,
double  delta 
)

First derivative of phi wrt tau.

Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 702 of file WaterPropsIAPWSphi.cpp.

◆ phi_tt()

double phi_tt ( double  tau,
double  delta 
)

Second derivative of phi wrt tau.

Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 783 of file WaterPropsIAPWSphi.cpp.

◆ pressureM_rhoRT()

double pressureM_rhoRT ( double  tau,
double  delta 
)

Calculate the dimensionless pressure at tau and delta;.

  pM/(rhoRT) = delta * phi_d() = 1.0 + delta phiR_d()
Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

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

Definition at line 520 of file WaterPropsIAPWSphi.cpp.

◆ dimdpdrho()

double dimdpdrho ( double  tau,
double  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
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 624 of file WaterPropsIAPWSphi.cpp.

◆ dimdpdT()

double dimdpdT ( double  tau,
double  delta 
)

Dimensionless derivative of p wrt T at constant rho.

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

Parameters
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 632 of file WaterPropsIAPWSphi.cpp.

◆ dfind()

double dfind ( double  p_red,
double  tau,
double  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_redValue of the dimensionless pressure
tauDimensionless temperature = T_c/T
deltaGuessInitial guess for the dimensionless density
Returns
the dimensionless density.

Definition at line 864 of file WaterPropsIAPWSphi.cpp.

◆ gibbs_RT()

double gibbs_RT ( ) const

Calculate the dimensionless Gibbs free energy.

Definition at line 939 of file WaterPropsIAPWSphi.cpp.

◆ enthalpy_RT()

double enthalpy_RT ( ) const

Calculate the dimensionless enthalpy, h/RT.

Definition at line 946 of file WaterPropsIAPWSphi.cpp.

◆ entropy_R()

double entropy_R ( ) const

Calculate the dimensionless entropy, s/R.

Definition at line 956 of file WaterPropsIAPWSphi.cpp.

◆ intEnergy_RT()

double intEnergy_RT ( ) const

Calculate the dimensionless internal energy, u/RT.

Definition at line 966 of file WaterPropsIAPWSphi.cpp.

◆ cv_R()

double cv_R ( ) const

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

Definition at line 974 of file WaterPropsIAPWSphi.cpp.

◆ cp_R()

double cp_R ( ) const

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

Definition at line 982 of file WaterPropsIAPWSphi.cpp.

◆ tdpolycalc()

void tdpolycalc ( double  tau,
double  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
tauDimensionless temperature = T_c/T
deltaDimensionless density = delta = rho / Rho_c

Definition at line 361 of file WaterPropsIAPWSphi.cpp.

◆ phiR()

double phiR ( ) const

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

Definition at line 394 of file WaterPropsIAPWSphi.cpp.

◆ phi0()

double phi0 ( ) const
protected

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

Definition at line 380 of file WaterPropsIAPWSphi.cpp.

◆ phiR_d()

double phiR_d ( ) const
protected

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

Definition at line 448 of file WaterPropsIAPWSphi.cpp.

◆ phi0_d()

double phi0_d ( ) const
protected

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

Definition at line 506 of file WaterPropsIAPWSphi.cpp.

◆ phiR_dd()

double phiR_dd ( ) const
protected

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

Definition at line 527 of file WaterPropsIAPWSphi.cpp.

◆ phi0_dd()

double phi0_dd ( ) const
protected

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

Definition at line 610 of file WaterPropsIAPWSphi.cpp.

◆ phi0_t()

double phi0_t ( ) const
protected

Calculate d_phi0/d(tau)

Definition at line 640 of file WaterPropsIAPWSphi.cpp.

◆ phiR_t()

double phiR_t ( ) const
protected

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

Definition at line 652 of file WaterPropsIAPWSphi.cpp.

◆ phiR_tt()

double phiR_tt ( ) const
protected

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

Definition at line 723 of file WaterPropsIAPWSphi.cpp.

◆ phi0_tt()

double phi0_tt ( ) const
protected

Calculate d2_phi0/dtau2.

Definition at line 710 of file WaterPropsIAPWSphi.cpp.

◆ phiR_dt()

double phiR_dt ( ) const
protected

Calculate the mixed derivative d2_phiR/(dtau ddelta)

Definition at line 796 of file WaterPropsIAPWSphi.cpp.

◆ phi0_dt()

double phi0_dt ( ) const
protected

Calculate the mixed derivative d2_phi0/(dtau ddelta)

Definition at line 791 of file WaterPropsIAPWSphi.cpp.

Member Data Documentation

◆ TAUp

double TAUp[52]
protected

Value of internally calculated polynomials of powers of TAU.

Definition at line 183 of file WaterPropsIAPWSphi.h.

◆ DELTAp

double DELTAp[16]
protected

Value of internally calculated polynomials of powers of delta.

Definition at line 186 of file WaterPropsIAPWSphi.h.

◆ TAUsave

double TAUsave = -1.0
protected

Last tau that was used to calculate polynomials.

Definition at line 189 of file WaterPropsIAPWSphi.h.

◆ TAUsqrt

double TAUsqrt = -1.0
protected

sqrt of TAU

Definition at line 192 of file WaterPropsIAPWSphi.h.

◆ DELTAsave

double DELTAsave = -1.0
protected

Last delta that was used to calculate polynomials.

Definition at line 195 of file WaterPropsIAPWSphi.h.


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