CliMA / Oceananigans.jl

🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs
https://clima.github.io/OceananigansDocumentation/stable
MIT License
1k stars 196 forks source link

Revise physical constants #190

Closed ali-ramadhan closed 5 years ago

ali-ramadhan commented 5 years ago

@jm-c has pointed out that certain constants may not have the correct value for saltwater. Would be good to get this stuff right.

Two points I recall:

ali-ramadhan commented 5 years ago

As part of this we should probably cite where we're getting the physical constants from, and keep in mind measurement uncertainties.

glwagner commented 5 years ago

@jm-c can you help with this?

glwagner commented 5 years ago

It might be a good idea to calculate our reference values for thermal expansion coefficient and haline contraction coefficient based on our reference values for temperature and salinity using TEOS-10 (or some other appropriate reference).

One way to do this is via

https://github.com/TEOS-10/GSW-Python

I also think that we should nuke any of the constants that are not actively used in the code (our code is probably not an appropriate resource for determining the right heat capacity to use in a given situation).

ali-ramadhan commented 5 years ago

Hmmm, cₚ and α are very commonly used in scripts.

Should we leave them in the EOS struct even though they are technically unused by the model, or should they go as well?

If there is one correct value for them, then might make sense to include them. But I don't think that's the case.

glwagner commented 5 years ago

Numbers in the literature seem to vary between cP=3990 to cP=3994... ?

What's the justification for keeping constants that are technically unrelated to the Oceananigans solver in the code? If the justification is so that people don't have to concern themselves with what the correct value is for their particular situation, I'm not sure it makes sense to keep it...

We could have a nice example which does some calculation with a seawater specific heat, along with a comment that explains where the value comes from.

Currently I find myself choosing these values independently of the Oceananigans.jl codebase anyways since I know that the default values are not appropriate for "ordinary" seawater.

glwagner commented 5 years ago

Utlimately, Clima will need julia tools for determining seawater properties. At that time, we can direct users to those tools for determining seawater properties like cP that might be needed for setup calculations. Until then perhaps we do not want to encouage a dependence on Oceananigans for values of cP?

ali-ramadhan commented 5 years ago

If the correct value has to be computed and isn't a static constant, then that's already out of scope for equations_of_state.jl I think. But yeah, would be good to calculate appropriate βT and βS.

glwagner commented 5 years ago

Not sure this is the same "cP" we are talking about, but this is the TEOS-10 function that calculates the "isobaric heat capacity of seawater" as a function of salinity, temperature, and pressure:

http://www.teos-10.org/pubs/gsw/v3_04/html/gsw_cp_t_exact.html

jm-c commented 5 years ago

C_p = 3991.86795711963 J/kg/K is the reference value of specific heat capacity (Graham and McDougall, 2013)

On Tue, Aug 27, 2019 at 06:25:19PM -0700, Gregory L. Wagner wrote:

Numbers in the literature seem to vary between cP=3990 to cP=3994... ?

What's the justification for keeping constants that are technically unrelated to the Oceananigans solver in the code? If the justification is so that people don't have to concern themselves with what the correct value is for their particular situation, I'm not sure it makes sense to keep it...

We could have a nice example which does some calculation with a seawater specific heat, along with a comment that explains where the value comes from.

Currently I find myself choosing these values independently of the Oceananigans.jl codebase anyways since I know that the default values are not correct.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/climate-machine/Oceananigans.jl/issues/190#issuecomment-525544991

glwagner commented 5 years ago

The origin of this reference heat capacity is explained around equation 3.3.3 in this document:

https://unesdoc.unesco.org/in/documentViewer.xhtml?v=2.1.196&id=p::usmarcdef_0000188170&file=/in/rest/annotationSVC/DownloadWatermarkedAttachment/attach_import_3378fdfe-50b7-4e53-8795-fafc7913dcc0%3F_%3D188170eng.pdf&locale=en&multi=true&ark=/ark:/48223/pf0000188170/PDF/188170eng.pdf#%5B%7B%22num%22%3A298%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C-93%2C846%2C0%5D

Section 2.20 in that document discusses the isobaric heat capacity.

Does the "correct" heat capacity then depend on our interpretation of the variable T in Oceananigans.jl (and therefore on the values we choose for the thermal expansion coefficient and saline contraction coefficient)? It's all a little unclear to me.

Note also that the TEOS-10 document uses α for the thermal expansion coefficient. The variable βΤ is sometimes used to denote the 'isothermal compressibility'.