Fortran#

API#

module iapws__api

API.

\(\)
pure subroutine psat(Ts, ps)

Compute the saturation pressure at temperature Ts. Validity range 273.13 K <= Ts <= 647.096 K.

Ts: real(kind=dp), contiguous, (:), intent(in)

Saturation temperature in K.

ps: real(kind=dp), contiguous, (:), intent(out)

Saturation pressure in MPa. Filled with nan if out of validity range.

\(\)
pure subroutine Tsat(ps, Ts)

Compute the saturation temperature at pressure ps. Validity range 611.213 Pa <= ps <= 22.064 MPa.

ps: real(kind=dp), contiguous, (:), intent(in)

Saturation pressure in MPa.

Ts: real(kind=dp), contiguous, (:), intent(out)

Saturation temperature in K. Filled with nan if out of validity range.

\(\)
pure subroutine wp(p, T, prop, res)

Compute water properties at pressure p in MPa and temperature T in Kelvin. The adequate region is selected according to p and T.

Available properties: * v: specific volume in m3/kg * u: specific internal energy in kJ/kg * s: specific entropy in kJ/kg * h: specific enthalpy in kJ/kg/K * cp: specific isobaric heat capacity in kJ/kg/K * cv: specific isochoric heat capacity in kJ/kg/K * w: speed of sound in m/s

p: real(kind=dp), (:), intent(in)

Pressure in MPa.

T: real(kind=dp), (:), intent(in)

Pressure in K.

prop: character(len=*), intent(in)

Property

res: real(kind=dp), (:), intent(out)

Filled with NaN if no adequate region is found.

\(\)
pure subroutine wr(p, T, res)

Get the water region corresponding to p and T. Regions 1 to 5 or -1 when not found.

p: real(kind=dp), (:), intent(in)

Pressure in MPa.

T: real(kind=dp), (:), intent(in)

Temperature in K.

res: integer(kind=int32), (:), intent(out)

Region (1-5)

\(\)
pure subroutine wph(p, T, res)

Get the water phase corresponding to p and T. Phases: l(liquid), v(VAPOR), c(SUPER CRITICAL), s(SATURATION), n(UNKNOWN).

p: real(kind=dp), (:), intent(in)

pressure in MPa.

T: real(kind=dp), (:), intent(in)

Temperature in K.

res: character(len=1), (:), intent(out)

Phase (l, v, c, s, n)

\(\)
pure subroutine Kw(T, rhow, k)

Compute the ionization constant of water Kw. Validity range 273.13 K <= T <= 1273.15 K and 0 <= p <= 1000 MPa.

T: real(kind=dp), (:), intent(in)

Temperature in K.

rhow: real(kind=dp), (:), intent(in)

Mass density in g.cm^{-3}.

k: real(kind=dp), (:), intent(out)

Ionization constant. Filled with NaN if out of validity range.

\(\)
function get_version() fptr

Return the version

fptr: character(len=:), pointer

\(\)