Closed ali-ramadhan closed 4 years ago
why wouldn't they be just defined at cell centers? Suggest make that assumption. John
On Mon, Oct 21, 2019 at 2:29 PM Ali Ramadhan notifications@github.com wrote:
Title sounds ridiculous but @jm-c https://github.com/jm-c mentioned that for stretched grids, models (e.g. WRF) usually place the cell center halfway between the two cell faces, but some models relax this choice so that you can specify cell centers to be slightly offset from the true center.
I guess they won't be "cell centers" anymore, but just opening an issue in case there's anything to discuss.
Without assuming cell centers are halfway between the two faces then interpolation operators are a bit more complicated
@inline ℑz_aac(i, j, k, grid::VerticallyStretchedCartesianGrid, f) =
@inbounds ((grid.zC[k] - grid.zF[k]) * f[k, j, i] + (grid.zF[k+1] - grid.zC[k]) * f[k+1, j, i]) / grid.ΔzF[k]
and if we assume e.g. grid.zC[k] - grid.zF[k] = grid.ΔzF[k]/2 then the interpolation operators simplify.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/climate-machine/Oceananigans.jl/issues/491?email_source=notifications&email_token=AKXUEQROF3YBCYTVKZUUNMLQPXYINA5CNFSM4JDC6IX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HTI3OWQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXUEQQAZQL25R7ZQ4S7J63QPXYINANCNFSM4JDC6IXQ .
@johncmarshall54 I agree that makes the most sense. Was just curious about something @jm-c said.
Apparently he was mostly referring to the binary choice between having cell centers be exactly halfway between the cell faces, or having the faces be exactly halfway between the cell "centers".
In general, he says that having custom/offset locations is generally a bad idea, although it has been implemented in MITgcm.
He linked to a couple of older papers where they discuss this:
I'll have a quick look but I agree just having cell centers be halfway between cell faces seems very sensible.
Is the idea that there is some kind of compromise with putting the u
-points at the "center" of the u
control volumes, versus putting the tracer points at the center of the tracer control volumes? I see that it is impossible to achieve both.
In other words, certain assumptions about "interpolation" are baked into the interpolation operators (we do not do a true interpolation between the different grids for u
, v
, w
, etc).
The basic munerics of oceananigans is the same as MITgcm: we use a scheme which conserves tracer variance: e.g. D/Dt (T**2) = exactly 0 in the absence of sources and sinks. This is ensured by just taking the average of the T between adjacent boxes when one is computing the flux of T across the cell face. This is true even in the vertical when del_z is not constant. John
On Tue, Oct 22, 2019 at 1:41 PM Gregory L. Wagner notifications@github.com wrote:
Is the idea that there is some kind of compromise with putting the u-points at the "center" of the u control volumes, versus putting the tracer points at the center of the tracer control volumes? I see that it is impossible to achieve both.
In other words, certain assumptions about "interpolation" are baked into the interpolation operators (we do not do a true interpolation between the different grids for u, v, w, etc).
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/climate-machine/Oceananigans.jl/issues/491?email_source=notifications&email_token=AKXUEQRCTHJHAZRI5GKCT6TQP43NXA5CNFSM4JDC6IX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB6S3NQ#issuecomment-545074614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXUEQSMDJBGJELHENZ6XVLQP43NXANCNFSM4JDC6IXQ .
Is the idea that there is some kind of compromise with putting the
u
-points at the "center" of theu
control volumes, versus putting the tracer points at the center of the tracer control volumes? I see that it is impossible to achieve both.
Yeah it's impossible to have both. Apparently MITgcm offers the two different options, but I'm not sure of their respective merits.
The basic munerics of oceananigans is the same as MITgcm: we use a scheme which conserves tracer variance: e.g. D/Dt (T**2) = exactly 0 in the absence of sources and sinks. This is ensured by just taking the average of the T between adjacent boxes when one is computing the flux of T across the cell face. This is true even in the vertical when del_z is not constant.
I see, @jm-c pointed this out but I didn't realize it was to conserve tracer variance. I'll add this to the documentation once we have a vertically stretched grid.
The interpolation is done in the same way for velocity. Presumably this is to conserve kinetic energy then?
I guess this means you don't want crazy amounts of stretching between adjacent grid cells and might be the reason for @jm-c's rule of thumb for stretching: that adjacent cells shouldn't be stretched by more than √2.
I think this in some way implies that the location of the tracer point is "arbitrary". As long as it is located somewhere inside the cell, its fine.
Cell centers are assumed to lie halfway between the faces.
Title sounds ridiculous but @jm-c mentioned that for stretched grids, models (e.g. WRF) usually place the cell center halfway between the two cell faces, but apparently this choice can be relaxed so that you can specify cell centers to be slightly offset from the true center.
I guess they won't be "cell centers" anymore, but just opening an issue in case there's anything to discuss.
Without assuming cell centers are halfway between the two faces then interpolation operators are a bit more complicated
and if we assume e.g.
grid.zC[k] - grid.zF[k] = grid.ΔzF[k]/2
then the interpolation operators simplify.So it seems maybe we should just assume that the cell centers are exactly halfway between the faces, unless there's a good reason or important use case for having custom/offset cell center locations.