FourierFlows / GeophysicalFlows.jl

Geophysical fluid dynamics pseudospectral solvers with Julia and FourierFlows.jl.
https://fourierflows.github.io/GeophysicalFlowsDocumentation/stable/
MIT License
153 stars 31 forks source link

Accepting buoyancy instead of density in `MultiLayerQG` module #343

Closed mpudig closed 8 months ago

mpudig commented 9 months ago

This pull request addresses issue #339 and discussion #325.

The conclusion from the discussion was that we should accept buoyancy as an input instead of density in multilayerqg. The density array was used only to calculate the reduced gravity array. Previously, the derived reduced gravity array resulted in spurious internal PV gradients as discussed extensively in discussion #325. It also implied that the Boussinesq approximation did not hold, which is implicitly assumed in the form of the layered QG equations solved here.

This pull request has changed the input field of multilayerqg from $\rho$, the density, to $b = -g \frac{\delta \rho}{\rho_0}$, the Boussinesq buoyancy, where $|\delta \rho| \ll \rho_0$. The reduced gravity is now derived directly from $b$, https://github.com/mpudig/GeophysicalFlows.jl/blob/density_to_buoyancy/src/multilayerqg.jl#L348. I have set the change in buoyancy to scale like 1/nlayers with the other default parameters as they are in multilayerqg – I believe this is consistent with the other nondimensional parameter values and an order 1 Burger number.

navidcy commented 9 months ago

Thanks for this! I'll try to get to this sometime this week!

navidcy commented 8 months ago

@mpudig you should have merge rights now, right?

if you are happy merge whenever.

navidcy commented 8 months ago

@mpudig I'll merge

navidcy commented 8 months ago

@mpudig welcome to GeophysicalFlows.jl contributors!

mpudig commented 8 months ago

@navidcy Apologies for the delay, I was making the long trip back to Australia. Thanks for merging!!