Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepting buoyancy instead of density in MultiLayerQG module #343

Merged
merged 8 commits into from
Dec 20, 2023

Conversation

mpudig
Copy link
Collaborator

@mpudig mpudig commented Nov 20, 2023

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
Copy link
Member

navidcy commented Dec 11, 2023

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

β = 0.0, # y-gradient of Coriolis parameter
U = zeros(nlayers), # imposed zonal flow U(y) in each layer
H = 1/nlayers * ones(nlayers), # rest fluid height of each layer
b = -(1 .+ 1/nlayers * Array{Float64}(0:nlayers-1)), # Boussinesq buoyancy of each layer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reasoning behind this default b?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this what corresponds to the previous default ρ?

Copy link
Member

@navidcy navidcy Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the two coincide if ρ0 = ρ[n], right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the two-layer model this choice of default $b$ will give the same reduced gravity as the previous default $\rho$ did. I chose this as the default $b$ as I believe it's consistent with QG scalings.

@navidcy navidcy linked an issue Dec 19, 2023 that may be closed by this pull request
Copy link
Member

@navidcy navidcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! nice job!

@navidcy navidcy changed the title Accepting buoyancy instead of density in multilayerqg Accepting buoyancy instead of density in MultiLayerQG module Dec 19, 2023
@navidcy
Copy link
Member

navidcy commented Dec 19, 2023

@mpudig you should have merge rights now, right?

if you are happy merge whenever.

@navidcy
Copy link
Member

navidcy commented Dec 20, 2023

@mpudig I'll merge

@navidcy navidcy merged commit 449f8be into FourierFlows:main Dec 20, 2023
3 checks passed
@navidcy
Copy link
Member

navidcy commented Dec 20, 2023

@mpudig welcome to GeophysicalFlows.jl contributors!

@mpudig
Copy link
Collaborator Author

mpudig commented Dec 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤥 enhancement New feature or request science 🔬
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mistake in stretching matrix in multilayerqg.jl
2 participants