The fugacity calculator uses JavaScript to determine the molar volume and fugacity of pure water from the Pitzer and Sterner (1994) equation of state. The Dekker method is employed to solve numerically for volume as a function of pressure and temperature. Fugacity is calculated using the analytical solution presented in Sterner and Pitzer (1994):
ln f = [lnρ + Ares/RT + P/ρRT]P,T + ln(RT) - 1,
where f is fugacity, Ares is residual Helmholtz energy, ρ is 'molar' density (n/V) and P, T, R are pressure, temperature and the universal gas constant, respectively.
Python functions to caculate volume and fugacity can be found here, also on GitHub.
Dekker, T.J. Finding a Zero by Means of Successive Linear Interpolation. In: Constructive Aspects of the Fundamental Theorem of Algebra. Ed. B. Dejon and P. Henrici. Wiley-Interscience, 1969. Pitzer, K.S. and Sterner, S.M. (1994). Equations of state valid continuously from zero to extreme pressures for H2O and CO2. Journal of Chemical Physics. 101: 3111-3116. Shampine, L.F. and Watts, H.A.(1970). FZERO, A Root-solving Code. Report SC-TM-70-631, Sandia Laboratories.
Sterner, S.M. and Pitzer, K.S. (1994). An equation of state for carbon dioxide valid from zero to extreme pressures. Contributions to Mineralogy and Petrology. 117: 362-374.