Open tomchor opened 1 year ago
The movies don't play for me. But it seems like a vertically-integrated component (a constant) is missing from the hydrostatic pressure anomaly in the case of a vertically-periodic domain?
Actually, maybe it's the other way around -- the vertically-integrated component needs to be subtracted when the domain is vertically periodic? This is effectively what occurs here for example:
However this is not enforced for the hydrostatic pressure.
The tridiagonal solvers are also incorrect for vertically-periodic domains, I think (well, now that we have x- and y- tridiagonal solvers I believe they are also incorrect for x- and y- periodic if using an x-tridiagonal or y-tridiagonal solver).
Either way it does seem like the simplest solution is to eliminate the pressure decomposition.
Interested what @simone-silvestri and @xkykai think.
The movies don't play for me.
Weird, they're playing for me on two different browsers... not sure what to do about that.
The tridiagonal solvers are also incorrect for vertically-periodic domains, I think (well, now that we have x- and y- tridiagonal solvers I believe they are also incorrect for x- and y- periodic if using an x-tridiagonal or y-tridiagonal solver).
True, but just to be clear, these simulations don't use any stretched grid direction, so I believe they don't use the tridiagonal solver, correct?
The movies don't play for me.
Weird, they're playing for me on two different browsers... not sure what to do about that.
There's nothing for you to do, I was on plane internet! I can see it now. I was just letting you know...
The tridiagonal solvers are also incorrect for vertically-periodic domains, I think (well, now that we have x- and y- tridiagonal solvers I believe they are also incorrect for x- and y- periodic if using an x-tridiagonal or y-tridiagonal solver).
True, but just to be clear, these simulations don't use any stretched grid direction, so I believe they don't use the tridiagonal solver, correct?
Correct --- I just wanted to issue that warning in case there was more interest in vertically-periodic simulations (we basically don't test that situation, but it wouldn't be unreasonable to work on that).
@zhazorken and I were trying to set up a toy model where the direction where gravity is acting is periodic and there's some sort of buoyancy source in the domain, leading eventually to a plume that's infinite in the direction of gravity.
The code below presents such a model. Here I'm leaving the gravity as is default (i.e. pointing to
gravity_unit_vector = NegativeZDirection()
), I'm setting up a small buoyancy source at the west wall, and I'm including a bit of noise in the same west wall to kick off a plume.This simulation runs for 10 minutes and then plots this (on a 32x32 grid):
https://github.com/CliMA/Oceananigans.jl/assets/13205162/e4fc9a13-f14f-4c6d-bda6-0d4aae79ac4c
So basically there's a discontinuity in the vertical direction's pressure, which causes an artificial vertical pressure gradient, causing a spurious flow at the top and bottom, even those aren't supposed to be boundaries since the grid is periodic in
z
. It seems like this comes from the fact that the hydrostatic pressure isn't periodic (since it always comes from a vertical b integral I think), but the nonhydrostatic pressure is periodic. This in turn leads the total pressure to have a discontinuity. In fact if we run the exact same configuration but make both the gravitational direction and the periodic direction thex
direction (code here) we have a plume looks and behaves as expected and has no discontinuities:https://github.com/CliMA/Oceananigans.jl/assets/13205162/97ab7df9-4b64-4f65-9433-4eb9a5e7fe22
I'm not sure if this is something that needs fixing or if it's just a consequence of the hydrostatic decomposition, which always assumes gravity is in the
NegativeZDirection()
and thatz
isBounded
. Hence I'm not sure this is better left as an issue or a discussion, so please lmk if I should move this to a discussion.Also, if I run the example above (where gravity is in the
z
direction) using https://github.com/CliMA/Oceananigans.jl/pull/3080, which gets rid of the hydrostatic pressure separation, then I get what I believe to be the correct behavior (all pressures in the animation below are actually total pressure):https://github.com/CliMA/Oceananigans.jl/assets/13205162/60ef470d-22d7-429a-9029-adb7db5687ba
Which also points to the hydrostatic decomposition being the issue here.