Numerical Implementation and Oceanographic Application of the Gibbs Thermodynamic Potential of Seawater R
Total Page:16
File Type:pdf, Size:1020Kb
Numerical implementation and oceanographic application of the Gibbs thermodynamic potential of seawater R. Feistel To cite this version: R. Feistel. Numerical implementation and oceanographic application of the Gibbs thermodynamic po- tential of seawater. Ocean Science, European Geosciences Union, 2005, 1 (1), pp.9-16. hal-00298266 HAL Id: hal-00298266 https://hal.archives-ouvertes.fr/hal-00298266 Submitted on 12 Apr 2005 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Ocean Science, 1, 9–16, 2005 www.ocean-science.net/os/1/9/ Ocean Science SRef-ID: 1812-0792/os/2005-1-9 European Geosciences Union Numerical implementation and oceanographic application of the Gibbs thermodynamic potential of seawater R. Feistel Baltic Sea Research Institute, Seestrasse 15, 18119 Warnemunde,¨ Germany Received: 11 November 2004 – Published in Ocean Science Discussions: 17 November 2004 Revised: 27 January 2005 – Accepted: 18 March 2005 – Published: 12 April 2005 Abstract. The 2003 Gibbs thermodynamic potential func- structure was chosen for its simplicity in analytical partial tion represents a very accurate, compact, consistent and com- derivatives and its numerical implementation, as discussed prehensive formulation of equilibrium properties of seawater. in Feistel (1993). It is expressed in the International Temperature Scale ITS-90 This paper provides code examples for the numerical com- and is fully consistent with the current scientific pure water putation in FORTRAN, C++ and Visual Basic 6, and de- standard, IAPWS-95. Source code examples in FORTRAN, scribes their algorithms for the latter case. This code is nei- C++ and Visual Basic are presented for the numerical imple- ther very compact, nor very fast, nor definitely error-free; it is mentation of the potential function and its partial derivatives, just intended as functioning example and guide for the devel- as well as for potential temperature. A collection of thermo- opment of individual implementations into custom program dynamic formulas and relations is given for possible applica- environments. Users are free to use, modify and distribute tions in oceanography, from density and chemical potential the code at their own responsibility. over entropy and potential density to mixing heat and en- The recent Gibbs potential formulation of seawater ther- tropy production. For colligative properties like vapour pres- modynamics has a number of advantages compared to the sure, freezing points, and for a Gibbs potential of sea ice, the classical “EOS80”, the 1980 Equation of State (Fofonoff and equations relating the Gibbs function of seawater to those of Millard, 1983), as explained in detail by Feistel (2003). One vapour and ice are presented. important reason is that it is fully consistent with the current international scientific standard formulation of liquid and gaseous pure water, IAPWS-95 (Wagner and Pruß, 2002), and with a new comprehensive description of ice (Feistel and 1 Introduction Wagner, 2005). It is valid for pressures from the triple point − ◦ ◦ Thermodynamic potential functions (also called fundamental to 100 MPa (10 000 dbar), temperatures from 2 C to 40 C, equations of state) offer a very compact and consistent way for practical salinities up to 42 psu and up to 50 psu at normal of representing equilibrium properties of a given substance, pressure. both theoretically and numerically (Alberty, 2001). This was For faster computation, as e.g. required in circulation very successfully demonstrated by subsequent standard for- models, modified equations of state derived from the 1995 mulations for water and steam (Wagner and Pruß, 2002). For and 2003 Gibbs potential functions have recently been con- seawater, this method was first studied by Fofonoff (1962) structed by McDougall et al. (2003) and Jackett et al. (2005), and later applied numerically in three subsequently improved available from the numerical supplement of this paper. versions by Feistel (1993), Feistel and Hagen (1995), and A significant advantage compared to the usual EOS80 for- Feistel (2003), expressing free enthalpy (also called Gibbs mulation of seawater properties is the new availability of energy) as a function of pressure, temperature and practical quantities like energy, enthalpy, entropy, or chemical poten- salinity. Their mathematical structures are polynomial-like tial. We present in Sect. 3 a collection of important ther- and have remained identical throughout these versions with modynamic and oceanographic relations with brief explana- only slight modifications of their sets of coefficients. The tions, for which the new potential function can be applied. Such formulas are often only found scattered over various ar- Correspondence to: R. Feistel ticles and textbooks. In Sect. 4, the Gibbs function of seawa- ([email protected]) ter is used in conjunction with numerically available thermo- © 2005 Author(s). This work is licensed under a Creative Commons License. 10 R. Feistel: Numerical implementation and oceanographic application dynamic formulations for water vapour and water ice, con- There are three first derivatives of g with respect to its in- sistent with the current one (Tillner-Roth, 1998; Wagner and dependent variables p, t, and S. Pruß, 2002; Feistel, 2003; Feistel and Wagner, 2005; Feis- Density, ρ, and specific volume, v: tel et al., 2005). This way colligative properties like vapour 1 ∂g pressure or freezing points can be computed, as well as vari- = v = (2) ous properties of sea ice. ρ ∂p S,t ∂g gU P P i j k−1 with = g0jk + gijkx · k · y z . ∂p S,t pU 2 Gibbs potential and its derivatives j,k>0 i>1 Specific entropy, σ: Specific free enthalpy (also called Gibbs function, Gibbs en- ∂g = − ergy, Gibbs free energy, or free energy in the literature) of σ (3) ∂t S,p seawater, g(S, t, p), is assumed to be a polynomial-like func- 2 tion of the independent variables practical salinity, S=x ·SU , ∂g = with ∂t temperature, t=y · tU , and applied pressure, p=z·pU , as, S,p " # gU g x2 ln x+ P g + P g xi · j · yj−1zk . g(S, t, p) tU 110 0jk ijk = j>0,k i>1 gU Relative chemical potential, µ: ! X X (g + g y) x2 ln x + g + g xi yj zk (1) ∂g 100 110 0jk ijk µ = (4) j,k i>1 ∂S t,p −1 ∂g The unit specific free enthalpy is gU =1 J kg . The refer- with = ∂S t,p ence values are defined arbitrarily as SU =40 psu for salinity " # = ◦ (PSS-78) (Lewis and Perkin, 1981; Unesco, 1981), tU 40 C gU (g +g y)(2 ln x+1) + P g · i · xi−2yj zk . 2sU 100 110 ijk for temperature (ITS-90) (Blanke, 1989; Preston-Thomas, i>1,j,k 1990), and pU =100 MPa=10 000 dbar for pressure. The di- Several thermodynamic coefficients require second deriva- mensionless variables x, y, z for salinity, temperature and tives of g. pressure are not to be confused with spatial coordinates. We Isothermal compressibility, K: follow Fofonoff’s (1992) proposal here and write for clarity 2 2 “psu” as the unit expressing practical salinity, even though 1 ∂v ∂ g/∂p S,t K = − = − (5) this notion is formally not recommended (Siedler, 1998). v ∂p S,t (∂g/∂p)S,t We shall use capital symbols T =T0+t for absolute tempera- 2 = + ∂ g tures, with Celsius zero point T0=273.15 K, and P P0 p with 2 = ∂p S,t for absolute pressures, with normal atmospheric pressure gU P P i j k−2 P0=0.101325 MPa, in the following. The polynomial coef- 2 g0jk+ gijkx · k (k−1) · y z . pU ficients gijk are listed in Table 1. The specific dependence on j,k>1 i>1 salinity results from Planck’s theory of ideal solutions and Isobaric thermal expansion coefficient, α: ¨ 2 the Debye-Huckel theory of electrolytes (Landau and Lif- 1 ∂v ∂ g/∂t∂p schitz, 1966; Falkenhagen et al., 1971), providing a thermo- α = = S (6) v ∂t ∂g/∂p dynamically correct low-salinity limit of the formula. S,p ( )S,t Any Gibbs function of seawater contains four freely ad- 2 with ∂ g = justable constants (Fofonoff, 1962), not available from mea- ∂p∂t S surements, which can be specified by suitable definitions g U P g + P g xi · j · k · yj−1zk−1. pU tU 0jk ijk of reference states. For the actual potential function, in- j>0,k>0 i>1 ternal energy and entropy are set to zero at the pure water Isobaric specific heat capacity, cP : triple point (S=0 psu, T =273.16 K, P =611.657 Pa), and en- ! thalpy and entropy are set to zero at the standard ocean state ∂σ ∂h ∂2g c = T = = −T (7) (S=35 psu, T =273.15 K, P =101325 Pa). This definition is P ∂t ∂t ∂t2 S,p S,p S,p consistent with the IAPWS-95 formulation for liquid water and vapour (Wagner and Pruß, 2002), and with the latest ∂2g with 2 = Gibbs potential of ice (Feistel and Wagner, 2005; Feistel et ∂t S,p al., 2005). It differs, however, from the reference states used gU P g + P g xi · j (j−1) · yj−2zk. t2 0jk ijk in earlier versions of the Gibbs function of seawater (Feistel, U j>1,k i>1 1993; Feistel and Hagen, 1995). h is specific enthalpy, as defined below in Eq.