-
Notifications
You must be signed in to change notification settings - Fork 268
Description
It is not enough to limit the advection scheme in one direction since the same scheme (only for momentum advection) is used to reconstruct the advecting velocity in the tangential direction, leading to an out-of-bounds access: for example, if the grid is 4, 2, 4 and we limit advection in y to Upwind(3), still we will have [Upwind(7) -> Center(6) for advective velocities] in x that needs to compute the advecting velocity
(for example u for v advection) using an 6-point stencil, thus leading to an out-of-bounds error.
For this reason we should limit to the minimum order in all three direction, or at least add a kwarg to be able to change the advecting velocity scheme (also for Centered).
To check that this is the case, take
Oceananigans.jl/test/test_nonhydrostatic_models.jl
Lines 88 to 92 in 3ae9e7a
| model = NonhydrostaticModel(grid=small_grid, advection=UpwindBiased(; order = 9)) | |
| @test model.advection isa FluxFormAdvection | |
| @test required_halo_size_x(model.advection) == 4 | |
| @test required_halo_size_y(model.advection) == 2 | |
| @test required_halo_size_z(model.advection) == 4 |
and add a
time_step!(model, 1)