This notebook contains course material from CBE20255 by Jeffrey Kantor (jeff at nd.edu); the content is available on Github. The text is released under the CC-BY-NC-ND-4.0 license, and code is released under the MIT license.

# Water and Steam Calculator¶

This notebook provides a convenient calculator front-end to the IAPWS IF97 standard for the thermodynamic properties of water and steam. The following cell installs the iapws package for water.

In [ ]:
!pip install iapws -q


## Properties of Steam¶

Execute the following the cell to estimate the properties of water at specified temperature and pressure.

In [ ]:
#@title Properties of Water { run: "auto", vertical-output: true }
#@markdown Enter pressure [bar]
P = 5.0 #@param {type:"number"}
#@markdown Enter temperature [deg C]
T = 200 #@param {type:"number"}

from iapws import IAPWS97

water = IAPWS97(P = P/10, T = T + 273.15)
sat_liq = IAPWS97(P = P/10, x = 0)

if sat_liq.T < T + 273.15:
print('Superheated Vapor:')
elif sat_liq.T > T + 273.15:
print('Supercooled Liquid:')

print("    h [kJ/kg]   =", round(water.h,1))
print("    u [kJ/kg]   =", round(water.u,1))
print("    v [m3/kg]   =", round(water.v,5))
print("    s [kJ/kg/K] =", round(water.s,3))
print()
print("At this pressure Tsat [deg C] =", round(sat_liq.T - 273.15, 2))

Superheated Vapor:
h [kJ/kg]   = 2855.9
u [kJ/kg]   = 2643.4
v [m3/kg]   = 0.42503
s [kJ/kg/K] = 7.061

At this pressure Tsat [deg C] = 151.84


## Saturation Conditions at a Specified Pressure¶

Execute the following cell to estimate the properties of saturated liquid water and water vapor at a specified pressure.

In [ ]:
#@title Water Liquid/Vapor Saturation (Pressure) { run: "auto", vertical-output: true }
#@markdown Enter pressure [bar]
P = 2.44 #@param {type:"number"}

from iapws import IAPWS97

sat_liq = IAPWS97(P = P/10, x = 0)
sat_vap = IAPWS97(P = P/10, x = 1)

print("T [deg C]   =", round(sat_liq.T - 273.15, 2))
print("\nSaturated Liquid:")
print("    h [kJ/kg]   =", round(sat_liq.h,1))
print("    u [kJ/kg]   =", round(sat_liq.u,1))
print("    v [m3/kg]   =", round(sat_liq.v,5))
print("    s [kJ/kg/K] =", round(sat_liq.s,3))

print("\nSaturated Vapor:")
print("    h [kJ/kg]   =", round(sat_vap.h,1))
print("    u [kJ/kg]   =", round(sat_vap.u,1))
print("    v [m3/kg]   =", round(sat_vap.v,5))
print("    s [kJ/kg/K] =", round(sat_vap.s,3))

T [deg C]   = 126.62

Saturated Liquid:
h [kJ/kg]   = 531.9
u [kJ/kg]   = 531.7
v [m3/kg]   = 0.00107
s [kJ/kg/K] = 1.599

Saturated Vapor:
h [kJ/kg]   = 2715.4
u [kJ/kg]   = 2536.0
v [m3/kg]   = 0.73524
s [kJ/kg/K] = 7.061


## Saturation Conditions at a Specified Temperature¶

Execute the following cell to estimate the properties of saturated liquid water and water vapor at a specified temperature.

In [ ]:
#@title Water Liquid/Vapor Saturation (Temperature) { run: "auto", vertical-output: true }
#@markdown Enter temperature [deg C]
T = 81.3 #@param {type:"number"}

from iapws import IAPWS97

sat_liq = IAPWS97(T = T+273.15, x = 0)
sat_vap = IAPWS97(T = T+273.15, x = 1)

print("P [bar]   =", round(10*sat_liq.P, 5))
print("\nSaturated Liquid:")
print("    h [kJ/kg]   =", round(sat_liq.h,1))
print("    u [kJ/kg]   =", round(sat_liq.u,1))
print("    v [m3/kg]   =", round(sat_liq.v,5))
print("    s [kJ/kg/K] =", round(sat_liq.s,3))

print("\nSaturated Vapor:")
print("    h [kJ/kg]   =", round(sat_vap.h,1))
print("    u [kJ/kg]   =", round(sat_vap.u,1))
print("    v [m3/kg]   =", round(sat_vap.v,5))
print("    s [kJ/kg/K] =", round(sat_vap.s,3))

P [bar]   = 0.49966

Saturated Liquid:
h [kJ/kg]   = 340.4
u [kJ/kg]   = 340.4
v [m3/kg]   = 0.00103
s [kJ/kg/K] = 1.091

Saturated Vapor:
h [kJ/kg]   = 2645.2
u [kJ/kg]   = 2483.2
v [m3/kg]   = 3.24219
s [kJ/kg/K] = 7.593

In [ ]: