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

Potential missing factor in MultiLayerQG.energies #292

Closed
apaloczy opened this issue Jul 5, 2022 · 1 comment · Fixed by #294
Closed

Potential missing factor in MultiLayerQG.energies #292

apaloczy opened this issue Jul 5, 2022 · 1 comment · Fixed by #294
Labels
🐞 bug Something isn't working

Comments

@apaloczy
Copy link
Collaborator

apaloczy commented Jul 5, 2022

I think there may be a missing 1 / sum(params.H) factor in the potential energies part of MultiLayerQG.energies.

This is because in the n-layer case, multiplying the PV equations by $\psi_n H_n/H$ (with $H = \Sigma H_n$) and adding them together to form the energy equation gives potential energy terms that look like

$$\mathrm{PE_{j+1/2}} = \frac{1}{2} \frac{f_0^2}{g_{j+1/2}'H} \iint (\psi_j - \psi_{j+1})^2 \frac{dx dy}{Lx Ly}.$$

The total energy is nearly conserved as expected in two-layer decaying turbulence simulations if the 1 / sum(params.H) is added.

Does this check? If so, I can open a pull request.

@apaloczy apaloczy changed the title Potential mising factor in MultiLayerQG.energies Potential missing factor in MultiLayerQG.energies Jul 5, 2022
@navidcy
Copy link
Member

navidcy commented Jul 5, 2022

This checks! Even dimensionally the KE and PE expressions in the docs don't match.

(https://fourierflows.github.io/GeophysicalFlowsDocumentation/v0.14.0/modules/multilayerqg/#Diagnostics)

Open a PR please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants