Skip to content

Water properties ​

ChemistryLab.HKFGState Type
julia
HKFGState{T<:Real}

The g-function of Shock et al. (1992) and its first- and second-order partial derivatives w.r.t. T and P.

ChemistryLab.SpeciesElectroPropsHKF Type
julia
SpeciesElectroPropsHKF{T<:Real}

Born coefficient ω for an aqueous species and its partial derivatives, from the HKF model of Helgeson et al. (1981) extended by Shock et al. (1992).

ChemistryLab.WaterElectroProps Type
julia
WaterElectroProps{T<:Real}

Dielectric constant ε of water and Born functions Z, Y, Q, X, U, N, from Johnson and Norton (1991).

ChemistryLab.WaterThermoProps Type
julia
WaterThermoProps{T<:Real}

Density D (kg/m³) of liquid water and its partial derivatives w.r.t. T (K) and P (Pa), computed from the equation of state of Haar et al. (1984).

ChemistryLab.hkf_g_function Method
julia
hkf_g_function(T_K, P_Pa, wtp::WaterThermoProps) -> HKFGState

Compute the g-function of Shock et al. (1992) and its derivatives for the HKF model. Returns zero state if water density is outside [350, 1000] kg/m³.

AD-compatible (ForwardDiff-safe).

ChemistryLab.species_electro_props_hkf Method
julia
species_electro_props_hkf(gstate::HKFGState, z, wref) -> SpeciesElectroPropsHKF

Compute the Born coefficient ω and its derivatives for an aqueous species with charge z and reference Born coefficient wref (J/mol).

Uses the model of Helgeson et al. (1981), extended by Shock et al. (1992). AD-compatible (ForwardDiff-safe).

ChemistryLab.water_density_hgk Method
julia
water_density_hgk(T_K, P_Pa; D0 = 1000.0) -> density (kg/m³)

The density of water at the temperature T_K (K) and the pressure P_Pa (Pa) by the HGK equation of state: the liquid where a liquid root exists, otherwise the only root, that of the vapor or of the supercritical fluid.

The root of   is found on plain numbers, to in the density: by Newton's method from D0, and, when that does not land on the liquid, from a density no liquid reaches, where the pressure of the equation is increasing and convex in the density so that the iteration descends onto the largest root without overshooting it; failing a liquid root, from the side of the dilute gas. It is then lifted into the dual numbers of T_K and P_Pa by two Newton steps: the value does not move, and the derivatives are exact to second order, as the implicit-function theorem gives them.

ChemistryLab.water_electro_props_jn Method
julia
water_electro_props_jn(T_K, P_Pa, wtp::WaterThermoProps) -> WaterElectroProps

Compute dielectric constant and Born functions Z, Y, Q, X, U, N for water using the model of Johnson and Norton (1991).

AD-compatible (ForwardDiff-safe).

ChemistryLab.water_helmholtz_hgk Method
julia
water_helmholtz_hgk(T_K, D_kgm3) -> _HGKHelm

Compute the specific Helmholtz free energy of water and its derivatives at temperature T_K (K) and density D_kgm3 (kg/m³) using the equation of state of Haar et al. (1984).

All outputs are in SI units (J/kg per derivative w.r.t. appropriate variables). AD-compatible (ForwardDiff-safe).

ChemistryLab.water_surface_tension Method
julia
water_surface_tension(T_K) -> surface tension (N/m)

Surface tension of liquid water against its vapor at the absolute temperature T_K (K), from the interpolating equation of the International Association for the Properties of Water and Steam (IAPWS, 2014):

with   K,   mN/m,    and  . The equation holds from the triple point to , where the surface tension vanishes, and the release extrapolates it into the supercooled liquid down to −25 °C. IAPWS (2014), Table 1 lists the recommended values beside the equation's, and from the triple point to 200 °C the two differ by 0.01 mN/m at most. Above there is no liquid, and asking is an error.

AD-compatible in T_K.

Examples

julia
julia> round(1000 * water_surface_tension(298.15); digits = 2)   # mN/m at 25 °C
71.97
ChemistryLab.water_thermo_props Method
julia
water_thermo_props(T_K, P_Pa) -> WaterThermoProps

Compute density and its partial derivatives for liquid water at T_K (K), P_Pa (Pa), using the equation of state of Haar et al. (1984).

AD-compatible (ForwardDiff-safe).