-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Running this script produces an error in the numerical values between Oceananigans models with and without reactant. This seems to be due to an error in how negations of > and >= operators are handled. If you look at lines 290 - 307:
active_nodes = (!(grid.underlying_grid.z.cᵃᵃᶜ[k] ≤ grid.immersed_boundary.bottom_height[i, j-1, 1]) # NEGATING THIS ELIMINATES ERROR, NEED TO INVESTIGATE
& !(grid.underlying_grid.z.cᵃᵃᶜ[k] ≤ grid.immersed_boundary.bottom_height[i-1, j-1, 1])
& !(grid.underlying_grid.z.cᵃᵃᶜ[k] ≤ grid.immersed_boundary.bottom_height[i+1, j-1, 1])
& (j > 1)
& (j < (grid.Ny+2))
& (k > 0)
& (k < grid.Nz+1))
#=
# Works:
active_nodes = ((grid.underlying_grid.z.cᵃᵃᶜ[k] > grid.immersed_boundary.bottom_height[i, j-1, 1])
& (grid.underlying_grid.z.cᵃᵃᶜ[k] > grid.immersed_boundary.bottom_height[i-1, j-1, 1])
& (grid.underlying_grid.z.cᵃᵃᶜ[k] > grid.immersed_boundary.bottom_height[i+1, j-1, 1])
& (j > 1)
& (j < (grid.Ny+2))
& (k > 0)
& (k < grid.Nz+1))
=#
Logically these blocks should be equivalent (!(a ≤ b) == a > b
, but they produce different values for the Reactant model.
Metadata
Metadata
Assignees
Labels
No labels