IAPWS95

Benedito Dias Baptista Filho

18/04/2018

This Vignette exemplifies the use of some functions of the Package IAPWS95, which calculates water thermodynamic and transport properties as function of different combinations of Temperature, Density, Pressure, Enthalphy and Entropy. The functions presented are used to return single values or generate tables of thermodynamic properties, being useful for scientists and engineers who analyze thermal and hydraulic experimental data or are involved with projects and equipment development, like turbines or nuclear reactors. This Vignette shows too few examples, but each function is documented with examples.

The name IAPWS95 comes from the “IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use”, a formulation developed by “The International Association for the Properties of Water and Steam”, revised in 2014. http://www.iapws.org/

IAPWS-95 formulation is based on the fundamental equation of Helmholtz free energy as a function of temperature and density, f = f(T, ρ). Other thermodynamic properties are obtained by differentiation and algebraic manipulation without the use of any other information. IAPWS-95 defines accurately the thermodynamic properties of the fluid phases of ordinary water substance, with complete thermodynamic consistency among these properties, over a wide range of states (pressures up to 1000 MPa and temperatures from the melting and sublimation temperatures to 1273 K). In this package the lower temperature limit is the triple point temperature, 273.16 K. The definition of properties includes those on the liquid–vapor equilibrium line.

The transport properties programmed were based on different IAPWS Releases: “Release on the IAPWS Formulation 2011 for the Thermal Conductivity of Ordinary Water Substance”; “Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance”; “Revised Release on Surface Tension of Ordinary Water Substance” (2014). The melting pressure was based on the “Revised Release on the Pressure along the Melting and Sublimation Curves of Ordinary Water Substance” (2011). The vapor pressure function introduced in this version was based on the Wagner and Pruß equation (1993).

Organizations involved

This package was developed under a research project on water properties conducted at the “Energetic and Nuclear Research Institute (IPEN-CNEN-SP: https://www.ipen.br/portal_por/portal/default.php)”, a Research Institute of the “Brazilian Nuclear Energy Commission” (CNEN), by the author, who is the Representative of Brazil, an Associate Member of IAPWS.

This project was possible with the assistance of Dr. Allan Harvey, of the National Institute of Standards and Technology (NIST) and Chair of the Working Group of “Thermophysical Properties of Water and Steam” of the IAPWS.

Example of a Table generating Function: spTcteTab(p1, p2, dp, T)

# Entropy Function of Pressure, with Temperature Constant
library(IAPWS95)
library(pander)
# Initial Pressure
p1 <- 10.
# Final Pressure
p2 <- 100.
# Pressure increment
dp <- 10.
# Temperature
T <- 450.
capture.output( Tabs <- spTcteTab(p1, p2, dp, T), file='NUL')
pander::pandoc.table(Tabs)
T [K] p [K] s [kJ kg-1 K-1]
450 10 2.097
450 20 2.084
450 30 2.072
450 40 2.061
450 50 2.049
450 60 2.039
450 70 2.028
450 80 2.018
450 90 2.009
450 100 1.999

Table of Saturation Properties: satTabvT(T1, T2, dT)

# Saturation Properties Function of Temperature
library(IAPWS95)
library(pander)
# Initial Temperature
T1 <- 300.
# Final Temperature
T2 <- 400.
# Temperature increment
dT <- 10.
capture.output( TabT <- satTabvT(T1, T2, dT), file='NUL')
pander::pandoc.table(TabT)
T vf vg hf hg sf sg
300 0.001003 39.08 112.6 2550 0.3931 8.517
310 0.001007 22.9 154.4 2568 0.5301 8.316
320 0.001011 13.95 196.2 2586 0.6629 8.13
330 0.001015 8.805 238 2603 0.7915 7.959
340 0.001021 5.734 279.9 2621 0.9165 7.801
350 0.001027 3.842 321.8 2638 1.038 7.655
360 0.001034 2.641 363.8 2654 1.156 7.519
370 0.001041 1.859 405.9 2671 1.271 7.392
380 0.001049 1.336 448.1 2686 1.384 7.274
390 0.001058 0.9793 490.4 2701 1.494 7.163
400 0.001067 0.7302 533 2716 1.601 7.058

Functions of Temperature and Density

# Dynamic Viscosity [ Pa s ]
library(IAPWS95)
# Temperature
T <- 500.
# Density
D <- 838.025
ViscTD(T,D)

[1] 0.000119828393

# Specific Enthalpy [ kJ kg-1 ]
hTD(T,D)

[1] 977.181624

# Pressure [ MPa ]
pTD(T,D)

[1] 10.0003858

Functions of Temperature and Pressure

# Specific Internal Energy [ kJ kg-1 ]
library(IAPWS95)
# Temperature
T <- 500.
# Pressure
p <- 10.0003858
uTp(T,p)

[1] 965.248346

# Specific Enthalpy [ kJ kg-1 ]
hTp(T,p)

[1] 977.181624

Error Codes

If the values given to any function is out of validity range, represent incorrect inputs, or generate convergence problems, an error message is printed. The errors are defined in the table listed as: errorCodes.

# Error Codes
library(IAPWS95)
library(pander)
capture.output( errorT <- errorCodes, file='NUL')
pander::pandoc.table(errorT)
Error.code Error.Description
-1001 Outside limits of Temperature
-1101 Outside limits of Temperature in two phase routine: TTC
-1028 Outside limits of Temperature in an inner routine
-1002 Outside limits of pressure
-1112 Pressure difference pDIFF = 10-7 in calculation of pSAT for given s
-1212 Outside Pressure-Temperature Range
-1003 Outside limits of Density
-1103 Density did not converge in two phase routine
-1113 Density D < DgTR
-1004 Steam Quality did not converge in two phase routines
-1005 Outside limits of Entropy
-1015 TDIFF = 10-7 in calculation of TSAT for given s
-1105 Entropy s = sC or s = sgTR in two phase routine
-1555 Entropy s > sgTR in a two phase routine
-1006 Enthalpy below minimum value
-9999 Enthalpy over upper limit by Entropy
-1111 Enthalpy under lower limit by Entropy
-1011 Temperature did not converge
-1013 Density did not converge
-3001 Temperature T < 50K (for sublimation pressure)
-3002 Temperature T >715K (over temp. limits for melting pressure)

Graphics: An example of h-s Diagram for saturation line

This package does not have any graphics function yet, but you can make use of any R graphic function or package.

library(IAPWS95)
library(ggplot2)
# Initial Temperature
T1 <- 275.
# Final Temperature
T2 <- 647.
# Temperature increment
dT <- 3.
capture.output( Tab <- satTabT(T1, T2, dT), file='NUL')
x1 <- Tab[,6]
x2 <- rev(Tab[,7])
s <- append(x1, x2)
y1 <- Tab[,4]
y2 <- rev(Tab[,5])
h <- append(y1, y2)
# h- Graph
plot(s,h, type = "o", pch=20)
grid()

dados <- as.data.frame(s)
dados$h <- h
ggplot2::ggplot(dados, ggplot2::aes(x=s, y=h)) + ggplot2::geom_line()