CliMA / SeawaterPolynomials.jl

Polynomials for efficiently computing the density of seawater
https://clima.github.io/SeawaterPolynomials.jl/dev
MIT License
14 stars 3 forks source link

`thermal_expansion` and `haline_contraction` are multiplied by reference density #21

Closed glwagner closed 2 years ago

glwagner commented 2 years ago

The definition of thermal_expansion and haline_contraction are "non-standard", because they are multiplied by reference density. On main:

julia> using SeawaterPolynomials
[ Info: Precompiling SeawaterPolynomials [d496a93d-167e-4197-9f49-d3af4ff8fe40]

julia> eos = SeawaterPolynomials.SecondOrderSeawaterPolynomials.RoquetEquationOfState(:CabbelingThermobaricity)
SeawaterPolynomials.BoussinesqEquationOfState{SeawaterPolynomials.SecondOrderSeawaterPolynomials.SecondOrderSeawaterPolynomial{Float64}, Float64}(SeawaterPolynomials.SecondOrderSeawaterPolynomials.SecondOrderSeawaterPolynomial{Float64}(0.7718, -0.0651, 0.0, -2.5681e-5, 0.0, -0.005027, 0.0), 1024.6)

julia> using SeawaterPolynomials: thermal_expansion, haline_contraction

julia> thermal_expansion(0, 0, 0, eos)
-0.0651

julia> haline_contraction(0, 0, 0, eos)
0.7718

This is approximately 1e3 larger than their usual values:

julia> thermal_expansion(0, 0, 0, eos) / eos.reference_density
-6.353699004489558e-5

julia> haline_contraction(0, 0, 0, eos) / eos.reference_density
0.0007532695686121414

The same is true for the TEOS10 equation of state.

cc @simone-silvestri

simone-silvestri commented 2 years ago

is thermal expansion negative here? We need it to be positive, or at least we use a positive value in the linear equation of state...

glwagner commented 2 years ago

I'm pretty sure this is correct --- it becomes negative at T=S=Z=0. Or rather at S=Z=0 and T=4 ?

simone-silvestri commented 2 years ago

ok right!

glwagner commented 2 years ago

The "linear assumption" is especially bad in polar regions, where there is fresh, cold water.

glwagner commented 2 years ago

I should have chosen a more normal value like

julia> thermal_expansion(20, 35, 0, eos) / eos.reference_density
0.0002581441656573064