Skip to content

Commit

Permalink
Comment clarification on IAPWS Units on IAPWS constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
henningjp committed Apr 23, 2022
1 parent 73f86a3 commit 3c9f7b3
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions IF97.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ namespace IF97
// for the Thermodynamic Properties of Water and Steam, August 2007
// IAPWS G5-01(2016), Guideline on the Use of Fundamental Physical Constants
// and Basic Constants of Water
// * IAPWS constants use units of MPa and kJ and are entered as such, but converted as needed to SI
// depending on the definition of IAPWS_UNITS below. Main program can define IAPWS_UNITS
// to leave all input/output values in IAPWS units, which is handy for results verification
// against values printed in the IAPWS documents. CoolProp will never use this definition.
// Converted constants below are commented with an *.
#ifdef IAPWS_UNITS
const double p_fact = 1.0; // Leaves Thermodynamic Properties in IAPWS units of MPa
const double R_fact = 1.0; // Leaves Thermodynamic Properties in IAPWS units of kJ
Expand All @@ -46,41 +51,41 @@ namespace IF97
#endif
// IF97 Constants
const double Tcrit = 647.096; // K
const double Pcrit = 22.064*p_fact; // Pa
const double Pcrit = 22.064*p_fact; // MPa*
const double Rhocrit = 322.0; // kg/m³
const double Scrit = 4.41202148223476*R_fact; // J/kg-K (needed for backward eqn. in Region 3(a)(b)
const double Scrit = 4.41202148223476*R_fact; // kJ*/kg-K (needed for backward eqn. in Region 3(a)(b)
const double Ttrip = 273.16; // K
const double Ptrip = 0.000611656*p_fact; // Pa
const double Ptrip = 0.000611656*p_fact; // MPa*
const double Tmin = 273.15; // K
const double Tmax = 1073.15; // K
const double Pmin = 0.000611213*p_fact; // Pa
const double Pmax = 100.0*p_fact; // Pa
const double Rgas = 0.461526*R_fact; // J/kg-K : mass based!
const double Pmin = 0.000611213*p_fact; // MPa*
const double Pmax = 100.0*p_fact; // MPa*
const double Rgas = 0.461526*R_fact; // kJ*/kg-K : mass based!
const double MW = 0.018015268; // kg/mol
// Bounds for Region Determination
const double Text = 2273.15; // Extended (Region 5) Temperature Limit (Region 5) [K]
const double Pext = 50.0*p_fact; // Extended (Region 5) Pressure Limit (Region 5) [Pa]
const double P23min = 16.529164252605*p_fact; // Min Pressure on Region23 boundary curve; Max is Pmax
const double Pext = 50.0*p_fact; // Extended (Region 5) Pressure Limit (Region 5) [MPa*]
const double P23min = 16.529164252605*p_fact; // Min Pressure [MPa*] on Region23 boundary curve; Max is Pmax
const double T23min = 623.15; // Min Temperature on Region23 boundary curve
const double T23max = 863.15; // Max Temperature on Region23 boundary curve
const double P2amax = 4.0*p_fact; // Max Pressure on upper H2a2b boundary (straight line)
const double P2bcmin = 6.54670*p_fact; // Min Pressure [MPa] on H2b2c boundary curve; Max is Pmax
const double S2bc = 5.85*R_fact; // Min Pressure [MPa] on H2b2c boundary curve; Max is Pmax
const double P2amax = 4.0*p_fact; // Max Pressure [MPa*] on upper H2a2b boundary (straight line)
const double P2bcmin = 6.54670*p_fact; // Min Pressure [MPa*] on H2b2c boundary curve; Max is Pmax
const double S2bc = 5.85*R_fact; // Min Pressure [MPa*] on H2b2c boundary curve; Max is Pmax
// Bounds for Backward p(h,s), t(h,s) Determination
const double Smin = 0.0; // Min Entropy [kJ/kg-K] for Backward p(h,s)
const double Smax = 11.921054825051103*R_fact; // Max Entropy [kJ/kg-K] for Backward p(h,s)
const double STPmax = 6.04048367171238*R_fact; // S(Tmax,Pmax)
const double Sgtrip = 9.155492076509681*R_fact; // Sat. Vapor Entropy [kJ/kg-K] at Triple Point
const double Sftrip = -4.09187776773977E-7*R_fact; // Sat. Liquid Entropy [kJ/kg-K] at Triple Point
const double Hgtrip = 2500.9109532932*R_fact; // Sat. Vapor Enthalpy [kJ/kg] at Triple Point
const double Hftrip = 5.16837786577998E-4*R_fact; // Sat. Liquid Enthalpy [kJ/kg] at Triple Point
const double SfT23 = 3.778281340*R_fact; // Sat. Liquid Entropy [KJ/kg-K] at T23min
const double SgT23 = 5.210887825*R_fact; // Sat. Vapor Entropy [KJ/kg-K] at T23min
const double S13min = 3.397782955*R_fact; // Entropy at (T13,Pmax)
const double S23min = 5.048096828*R_fact; // B23 Bounding Box
const double S23max = 5.260578707*R_fact; // B23 Bounding Box
const double H23min = 2.563592004E3*R_fact; // B23 Bounding Box
const double H23max = 2.812942061E3*R_fact; // B23 Bounding Box
const double Smin = 0.0; // Min Entropy [kJ*/kg-K] for Backward p(h,s)
const double Smax = 11.921054825051103*R_fact; // Max Entropy [kJ*/kg-K] for Backward p(h,s)
const double STPmax = 6.04048367171238*R_fact; // S(Tmax,Pmax) [kJ*/kg-K]
const double Sgtrip = 9.155492076509681*R_fact; // Sat. Vapor Entropy [kJ*/kg-K] at Triple Point
const double Sftrip = -4.09187776773977E-7*R_fact; // Sat. Liquid Entropy [kJ*/kg-K] at Triple Point
const double Hgtrip = 2500.9109532932*R_fact; // Sat. Vapor Enthalpy [kJ*/kg] at Triple Point
const double Hftrip = 5.16837786577998E-4*R_fact; // Sat. Liquid Enthalpy [kJ*/kg] at Triple Point
const double SfT23 = 3.778281340*R_fact; // Sat. Liquid Entropy [KJ*/kg-K] at T23min
const double SgT23 = 5.210887825*R_fact; // Sat. Vapor Entropy [KJ*/kg-K] at T23min
const double S13min = 3.397782955*R_fact; // Entropy at (T13,Pmax) [kJ*/kg-K]
const double S23min = 5.048096828*R_fact; // B23 Bounding Box [kJ*/kg-K]
const double S23max = 5.260578707*R_fact; // B23 Bounding Box [kJ*/kg-K]
const double H23min = 2.563592004E3*R_fact; // B23 Bounding Box [kJ*/kg-K]
const double H23max = 2.812942061E3*R_fact; // B23 Bounding Box [kJ*/kg-K]
//
double Tsat97(double p); // Forward declaration of Tsat97 required for calls below.
double psat97(double T); // Forward declaration of psat97 required for calls below.
Expand Down

0 comments on commit 3c9f7b3

Please sign in to comment.