lib.iapws97 module¶
Library with a wrapper class of iapws97 for IAPWS formulation
All the functionality is included in the main class:
IAPWS97: Stream definition using IAPWS-IF97 formulation valid for liquid water or steam
Direct access to normally used input parameters
IAPWS97_PT: Derivated class for direct P and T input
IAPWS97_Ph: Derivated class for direct P and h input
IAPWS97_Ps: Derivated class for direct P and s input
IAPWS97_Px: Derivated class for direct P and x input
IAPWS97_Tx: Derivated class for direct T and x input
API reference¶
- class lib.iapws97.IAPWS97(**kwargs)[source]¶
Bases:
ThermoWaterClass to model a state for liquid water or steam with the IAPWS-IF97
- Parameters:
- Tfloat
Temperature [K]
- Pfloat
Pressure [MPa]
- hfloat
Specific enthalpy [kJ/kg]
- sfloat
Specific entropy [kJ/kgK]
- xfloat
Vapor quality [-]
- lfloat, optional
Wavelength of light, for refractive index [nm]
Methods
calculo(st)Calculate procedure
fill(fase, st)Fill phase properties
- Returns:
- The calculated instance has the following properties:
P: Pressure [MPa]
T: Temperature [K]
g: Specific Gibbs free energy [kJ/kg]
a: Specific Helmholtz free energy [kJ/kg]
v: Specific volume [m³/kg]
rho: Density [kg/m³]
h: Specific enthalpy [kJ/kg]
u: Specific internal energy [kJ/kg]
s: Specific entropy [kJ/kg·K]
cp: Specific isobaric heat capacity [kJ/kg·K]
cv: Specific isochoric heat capacity [kJ/kg·K]
Z: Compression factor [-]
fi: Fugacity coefficient [-]
f: Fugacity [MPa]
gamma: Isoentropic exponent [-]
alfav: Isobaric cubic expansion coefficient [1/K]
xkappa: Isothermal compressibility [1/MPa]
kappas: Adiabatic compresibility [1/MPa]
alfap: Relative pressure coefficient [1/K]
betap: Isothermal stress coefficient [kg/m³]
joule: Joule-Thomson coefficient [K/MPa]
deltat: Isothermal throttling coefficient [kJ/kg·MPa]
region: Region
v0: Ideal specific volume [m³/kg]
u0: Ideal specific internal energy [kJ/kg]
h0: Ideal specific enthalpy [kJ/kg]
s0: Ideal specific entropy [kJ/kg·K]
a0: Ideal specific Helmholtz free energy [kJ/kg]
g0: Ideal specific Gibbs free energy [kJ/kg]
cp0: Ideal specific isobaric heat capacity [kJ/kg·K]
cv0: Ideal specific isochoric heat capacity [kJ/kg·K]
w0: Ideal speed of sound [m/s]
gamma0: Ideal isoentropic exponent [-]
w: Speed of sound [m/s]
mu: Dynamic viscosity [Pa·s]
nu: Kinematic viscosity [m²/s]
k: Thermal conductivity [W/m·K]
alfa: Thermal diffusivity [m²/s]
sigma: Surface tension [N/m]
epsilon: Dielectric constant [-]
n: Refractive index [-]
Prandt: Prandtl number [-]
Pr: Reduced Pressure [-]
Tr: Reduced Temperature [-]
Notes
- Definitions options:
T, P: Not valid for two-phases region
P, h
P, s
h, s
T, x: Only for two-phases region
P, x: Only for two-phases region
References
- [1] Wagner, W., Cooper, J.R., Dittmann, A., Kijima, J., Kretzschmar,
H.-J., Kruse, A., Mareš, R., Oguchi, K., Sato, H., Stöcker, I., Šifner, O., Takaishi, Y., Tanishita, I., Trübenbach, J., Willkommen, T. The IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. J. Eng. Gas Turbines & Power 122 (2000) 150-182.
Examples
Region 1, Table A3
>>> st = IAPWS97(T=300, P=3e6) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '0.00100215168 115.331273 112.324818' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '0.392294792 4.17301218 1507.73921' >>> st = IAPWS97(T=300, P=8e7) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '0.000971180894 184.142828 106.448356' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '0.368563852 4.01008987 1634.69054' >>> st = IAPWS97(T=500, P=3e6) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '0.001202418 975.542239 971.934985' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '2.58041912 4.65580682 1240.71337'
Region 2, Table A6
>>> st = IAPWS97(T=300, P=3.5e3) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '39.4913866 2549.91145 2411.6916' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '8.52238967 1.91300162 427.920172' >>> st = IAPWS97(T=700, P=3.5e3) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '92.3015898 3335.68375 3012.62819' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '10.1749996 2.08141274 644.289068' >>> st = IAPWS97(T=700, P=3e7) >>> "%0.9g %0.9g %0.9g" % (st.v, st.h.kJkg, st.u.kJkg) '0.00542946619 2631.49474 2468.61076' >>> "%0.9g %0.9g %0.9g" % (st.s.kJkgK, st.cp.kJkgK, st.w) '5.17540298 10.3505092 480.386523'
Region 3, Table A10
>>> from iapws.iapws97 import _Region3 >>> st = _Region3(500, 650) >>> "%0.9g %0.9g %0.9g" % (st["P"], st["h"], st["h"]-st["P"]*1000*st["v"]) '25.5837018 1863.43019 1812.26279' >>> "%0.9g %0.9g %0.9g" % (st["s"], st["cp"], st["w"]) '4.05427273 13.8935717 502.005554' >>> st = _Region3(200, 650) >>> "%0.9g %0.9g %0.9g" % (st["P"], st["h"], st["h"]-st["P"]*1000*st["v"]) '22.2930643 2375.12401 2263.65868' >>> "%0.9g %0.9g %0.9g" % (st["s"], st["cp"], st["w"]) '4.85438792 44.6579342 383.444594' >>> st = _Region3(500, 750) >>> "%0.9g %0.9g %0.9g" % (st["P"], st["h"], st["h"]-st["P"]*1000*st["v"]) '78.3095639 2258.68845 2102.06932' >>> "%0.9g %0.9g %0.9g" % (st["s"], st["cp"], st["w"]) '4.46971906 6.34165359 760.696041'
Region 4, Table A12
>>> st1 = IAPWS97(T=300, x=0.5) >>> st2 = IAPWS97(T=500, x=0.5) >>> st3 = IAPWS97(T=600, x=0.5) >>> "%0.9g %0.9g %0.9g" % (st1.P.MPa, st2.P.MPa, st3.P.MPa) '0.00353658941 2.63889776 12.3443146'
Region 4, Table A29
>>> st1 = IAPWS97(P=1e5, x=0.5) >>> st2 = IAPWS97(P=1e6, x=0.5) >>> st3 = IAPWS97(P=1e7, x=0.5) >>> "%0.9g %0.9g %0.9g" % (st1.T, st2.T, st3.T) '372.755919 453.035632 584.149488'
Other test in paper have been upgraded by new equation, i.e. for region 5 or for ancillary equation, the testing is done in iapws testing layer
- M = 18.015268¶
- Pc = 22064000.0¶
- Tc = 647.096¶
- rhoc = 322.0¶
- Tt = 273.16¶
- Tb = 373.1243¶
- f_accent = 0.3443¶
- momentoDipolar = 6.18754725310668e-30¶
References¶
[R1-76] IAPWS; Revised Release on the Surface Tension of Ordynary Water Substance. 2014
[R2-83] IAPWS; Release on the Values of Temperature, Pressure and Density of Ordynary and Heavy Water Substances at their Respectives Critical Points. 1992
[R4-84] IAPWS; Revised Release on Viscosity and Thermal Conductivity of Heavy Water Substance. 2007
[R5-85] IAPWS; Release on Surface Tension of Heavy Water Substance. 1994
[R6-95] IAPWS; Revised Release on the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use. 2006
[R7-97] IAPWS; Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. 2012
[R8-97] IAPWS; Release on the Static Dielectric Constant of Ordinary WaterSubstance for Temperatures from 238 K to 873 K and Pressures up to 1000 MPa. 1997
[R9-97] IAPWS; Release on the Refractive Index of Ordinary Water Substance as a Function of Wavelength, Temperature and Pressure. 1997
[R10-06] IAPWS; Revised Release on the Equation of State 2006 for H2O Ice Ih. 2009
[R11-19] IAPWS; Release on the Ionization Constant of H2O. 2019
[R12-08] IAPWS; Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance. 2008
[R13-08] IAPWS; Release on the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater. 2008
[R14-08] IAPWS; Revised Release on the Pressure along the Melting and Sublimation Curves of Ordinary Water Substance. 2011
[R15-11] IAPWS; Release on the IAPWS Formulation 2011 for the Thermal Conductivity of Ordinary Water Substance. 2011
[R16-17] IAPWS; Release on the IAPWS Formulation 2017 for the Thermodynamic Properties of Heavy Water. 2017
[SR1-86] IAPWS; Revised Supplementary Release on Saturation Properties of Ordinary Water Substance. 1992
[SR2-01] IAPWS; Revised Supplementary Release on Backward Equations for Pressure as a Function of Enthalpy and Entropy p(h,s) for Regions 1 and 2 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. 2014
[SR3-03] IAPWS; Revised Supplementary Release on Backward Equations for the Functions T(p,h), v(p,h), and T(p,s), v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. 2014
[SR4-04] IAPWS; Revised Supplementary Release on Backward Equations p(h,s) for Region 3, Equations as a Function of h and s for the Region Boundaries, and an Equation Tsat(h,s) for Region 4 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. 2014
[SR5-05] IAPWS; Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. 2016
[SR6-08] IAPWS; Revised Supplementary Release on Properties of Liquid Water at 0.1 MPa. 2011
[SR7-09] IAPWS; Supplementary Release on a Computationally Efficient Thermodynamic Formulation for Liquid Water for Oceanographic Use. 2009
[G1-90] IAPWS; Electrolytic Conductivity (Specific Conductance) of Liquid and Dense Supercritical Water from 0°C to 800°C and Pressures up to 1000 MPa. 1990
[G2-90] IAPWS; Solubility of Sodium Sulfate in Aqueous Mixtures of Sodium Chloride and Sulfuric Acid from Water to Concentrated Solutions, from 250 °C to 350 °C. 1994
[G3-00] IAPWS; Revised Guideline on the Critical Locus of Aqueous Solutions of Sodium Chloride. 2012
[G4-01] IAPWS; Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures. 2001
[G5-01] IAPWS; Guideline on the Use of Fundamental Physical Constants and Basic Constants of Water. 2016
[G7-04] IAPWS; Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures. 2004
[G8-10] IAPWS; Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater. 2010
[G9-12] IAPWS; Guideline on a Low-Temperature Extension of the IAPWS-95 Formulation for Water Vapor. 2012
[G10-15] IAPWS; Guideline on the Thermal Conductivity of Seawater. 2015
[G11-15] IAPWS; Guideline on a Virial Equation for the Fugacity of H2O in Humid Air. 2015
[G12-15] IAPWS; Guideline on Thermodynamic Properties of Supercooled Water. 2015
[AN3-07] IAPWS; Thermodynamic Derivatives from IAPWS Formulations. 2014
[AN5-13] IAPWS; Industrial Calculation of the Thermodynamic Properties of Seawater. 2016