Low level class for the real description of water. More...
#include <WaterPropsIAPWSphi.h>
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 [51].
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. | |
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.
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.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 440 of file WaterPropsIAPWSphi.cpp.
double phi_d | ( | double | tau, |
double | delta | ||
) |
Calculate derivative of phi wrt delta.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 512 of file WaterPropsIAPWSphi.cpp.
double phi_dd | ( | double | tau, |
double | delta | ||
) |
2nd derivative of phi wrt delta
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 616 of file WaterPropsIAPWSphi.cpp.
double phi_t | ( | double | tau, |
double | delta | ||
) |
First derivative of phi wrt tau.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 702 of file WaterPropsIAPWSphi.cpp.
double phi_tt | ( | double | tau, |
double | delta | ||
) |
Second derivative of phi wrt tau.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 783 of file WaterPropsIAPWSphi.cpp.
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()
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 520 of file WaterPropsIAPWSphi.cpp.
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())
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 624 of file WaterPropsIAPWSphi.cpp.
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()
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 632 of file WaterPropsIAPWSphi.cpp.
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.
p_red | Value of the dimensionless pressure |
tau | Dimensionless temperature = T_c/T |
deltaGuess | Initial guess for the dimensionless density |
Definition at line 864 of file WaterPropsIAPWSphi.cpp.
double gibbs_RT | ( | ) | const |
Calculate the dimensionless Gibbs free energy.
Definition at line 939 of file WaterPropsIAPWSphi.cpp.
double enthalpy_RT | ( | ) | const |
Calculate the dimensionless enthalpy, h/RT.
Definition at line 946 of file WaterPropsIAPWSphi.cpp.
double entropy_R | ( | ) | const |
Calculate the dimensionless entropy, s/R.
Definition at line 956 of file WaterPropsIAPWSphi.cpp.
double intEnergy_RT | ( | ) | const |
Calculate the dimensionless internal energy, u/RT.
Definition at line 966 of file WaterPropsIAPWSphi.cpp.
double cv_R | ( | ) | const |
Calculate the dimensionless constant volume heat capacity, Cv/R.
Definition at line 974 of file WaterPropsIAPWSphi.cpp.
double cp_R | ( | ) | const |
Calculate the dimensionless constant pressure heat capacity, Cv/R.
Definition at line 982 of file WaterPropsIAPWSphi.cpp.
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.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 361 of file WaterPropsIAPWSphi.cpp.
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.
|
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.
|
protected |
Calculate d_phiR_d(delta), the first derivative of phiR wrt delta.
Definition at line 448 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta.
Definition at line 506 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta.
Definition at line 527 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta.
Definition at line 610 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate d_phi0/d(tau)
Definition at line 640 of file WaterPropsIAPWSphi.cpp.
|
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.
|
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.
|
protected |
Calculate d2_phi0/dtau2.
Definition at line 710 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate the mixed derivative d2_phiR/(dtau ddelta)
Definition at line 796 of file WaterPropsIAPWSphi.cpp.
|
protected |
Calculate the mixed derivative d2_phi0/(dtau ddelta)
Definition at line 791 of file WaterPropsIAPWSphi.cpp.
|
protected |
Value of internally calculated polynomials of powers of TAU.
Definition at line 183 of file WaterPropsIAPWSphi.h.
|
protected |
Value of internally calculated polynomials of powers of delta.
Definition at line 186 of file WaterPropsIAPWSphi.h.
|
protected |
Last tau that was used to calculate polynomials.
Definition at line 189 of file WaterPropsIAPWSphi.h.
|
protected |
sqrt of TAU
Definition at line 192 of file WaterPropsIAPWSphi.h.
|
protected |
Last delta that was used to calculate polynomials.
Definition at line 195 of file WaterPropsIAPWSphi.h.