How do I calculate the total pressure contribution in a turbulent kinetic energy budget using the Oceananigans kernels? #3431
-
I'm trying to calculate a kinetic energy budget for my nonhydrostatic simulation (that's part of what #3423 was about), and I figured the easiest way to do this is to use Oceananigans' own kernels. For most terms that's relatively simple. To calculate the contribution from the shear stress term, for example, I can do something like u * ∂ⱼ_τ₁ⱼ(args...) + v * ∂ⱼ_τ₂ⱼ(args...) + w * ∂ⱼ_τ₃ⱼ(args...) ...(along with the proper interpolations, of course, as it is done in Oceanostics.) However, I'm having a bit of trouble with the pressure term. I understand pressure is used to correct the velocity in order to enforce incompressibility, but that makes the calculation of its role (as it appears in the Navier-Stokes equations: If I understand correctly, when Oceananigans.jl/src/TimeSteppers/runge_kutta_3.jl Lines 116 to 124 in 1c2a6f8 So after the substep (where we get the predictor velocities) the velocities are corrected using the nonhydrostatic pressure as such Meaning the (nonhydrostatic) pressure gradient contribution is kinda hidden in the new velocities, and only then we get a call to Then there will be a call to So my question is, if I wanted to calculate (and "close") a kinetic energy budget accurately (really I want to calculate a turbulent kinetic energy budget, but let's start with the simple stuff) how would I calculate the contribution from the pressure gradient term? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I believe that computing the exact, pointwise kinetic energy budget is challenging. This is equivalent to being able to compute the numerical dissipation (the residual of such an exact budget), which I am not sure is possible in general or has been done. But here are some references:
Note that I think your shear production term is not exact, but approximate. To be exact, I think it would have to combine information at two different time-steps (because that is necessary to derive an equation for the discrete variance). If you're seeking an approximate budget that respects the C-grid but possibly contains temporal approximations, then I would use the continuous analogue of the pressure contribution to kinetic energy, u . grad(p). @simone-silvestri might have more to say because he has been working on quantifying numerical dissipation. |
Beta Was this translation helpful? Give feedback.
-
You can treat pressure like any other term, there should be no ambiguity contingent on the fact you use the pressure at uⁿ⁺¹ = uⁿ + Δt Gⁿ
pⁿ⁺¹ = poisson_solution(∇⋅uⁿ⁺¹...)
uⁿ⁺¹ = uⁿ⁺¹ + Δt ∂ₓpⁿ⁺¹ so the non-hydrostatic pressure at (uⁿ⁺¹ + uⁿ) Gⁿ / 2 For the pressure this means that the discrete contribution of the pressure term to the discrete kinetic energy is (uⁿ⁺¹ + uⁿ) ∂ₓpⁿ⁺¹ / 2 If you want to be extremely precise you have to account for the time-stepping scheme used. |
Beta Was this translation helpful? Give feedback.
You can treat pressure like any other term, there should be no ambiguity contingent on the fact you use the pressure at
n+1
. In fact, the logical steps that we are taking are:so the non-hydrostatic pressure at
n+1
is a part of the tendency as much as all the other terms. Also, as Greg said, you need the information atn+1
to calculate the budgets because the correct way to assess the discrete kinetic energy is to doFor the pressure this means that the discrete contribution of the pressure term to the discrete kinetic energy is
If you want to be extremely precise you…