util.water

## Don't show: data(thermo)
thermo$obigt: 1911 aqueous, 3588 total species
## End(Don't show) # calculate density of stable phase at 500 K, 500 bar rho <- rho.IAPWS95(T=500, P=500) # calculate pressure (= 50 MPa) at this density IAPWS95("P", T=500, rho=rho)
p 1 50
# calculate dielectric constant water.AW90(T=500, rho=rho, P=50)
[1] 32.54731
# density along saturation curve T <- seq(273.15, 623.15, 25) WP02.auxiliary(T=T) # liquid from WP02
[1] 999.7885 996.9994 987.9908 974.8091 958.3468 939.0253 917.0095 892.2849 864.6701 833.7879 798.9850 [12] 759.1563 712.3294 654.4707 574.4712
WP02.auxiliary("rho.vapor", T) # vapor from WP02
[1] 4.850914e-03 2.307363e-02 8.315054e-02 2.421845e-01 5.980992e-01 1.298500e+00 2.547898e+00 4.617113e+00 [9] 7.860972e+00 1.275428e+01 1.996592e+01 3.051875e+01 4.617059e+01 7.050918e+01 1.135604e+02
# WP02.auxiliary gives a close estimate of saturation pressure... T <- 445:455 P.sigma <- WP02.auxiliary("P.sigma", T) # ... but alternates between being just on the liquid or vapor side # (low rho: steam; high rho: water) rho.IAPWS95(T, convert(P.sigma, "bar"))
[1] 4.300105 4.398815 4.499334 4.601687 4.705901 4.812002 4.920014 888.224574 887.159202 [10] 886.089124 885.014320
# thermo$opt$IAPWS.sat allows for choosing liquid or vapor or "" thermo$opt$IAPWS.sat <<- "" # shows artifactual vapor-liquid transition water.IAPWS95("V", T, "Psat")
water.IAPWS95: calculating 11 values for rho V V 1 4189.49490 2 4095.48239 3 4003.98575 4 3914.92651 5 3828.22896 6 3743.82008 7 3661.62938 8 20.28233 9 20.30669 10 20.33121 11 20.35591
# the calculated Psat, while not exact, should be close enough for most # geochemical calculations to select liquid or vapor oldwat <- water("IAPWS95")
water: setting thermo$opt$water to IAPWS95
thermo$opt$IAPWS.sat <<- "vapor" V.vapor <- subcrt("water", T=convert(445:455, "C"))$out[[1]]$V
water.IAPWS95: calculating 11 values for Psat subcrt: 1 species at 11 values of T and P (wet) water.IAPWS95: calculating 11 values for rho rho G H S V Cp
thermo$opt$IAPWS.sat <<- "liquid" # the default V.liquid <- subcrt("water", T=convert(445:455, "C"))$out[[1]]$V
water.IAPWS95: calculating 11 values for Psat subcrt: 1 species at 11 values of T and P (wet) water.IAPWS95: calculating 11 values for rho rho G H S V Cp
stopifnot(all(V.vapor > V.liquid)) water(oldwat)
water: setting thermo$opt$water to SUPCRT92