Skip to content

Commit

Permalink
Δzᶜᶜᶜ(... , ibg::PCBIBG) works for grids with flat dims (#3530)
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Apr 2, 2024
1 parent fc871ef commit ff3ab99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ImmersedBoundaries/partial_cell_bottom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ on_architecture(to, ib::PartialCellBottom) = PartialCellBottom(on_architecture(t
∘ k | Δz
k --x-- ↓
Criterion is h >= z - ϵ Δz
Criterion is h z - ϵ Δz
"""
@inline function _immersed_cell(i, j, k, underlying_grid, ib::PartialCellBottom)
# Face node above current cell
z = znode(i, j, k+1, underlying_grid, c, c, f)
h = @inbounds ib.bottom_height[i, j, 1]
return z <= h
return z h
end

@inline bottom_cell(i, j, k, ibg::PCBIBG) = !immersed_cell(i, j, k, ibg.underlying_grid, ibg.immersed_boundary) &
Expand All @@ -107,8 +107,9 @@ end
@inline function Δzᶜᶜᶜ(i, j, k, ibg::PCBIBG)
underlying_grid = ibg.underlying_grid
ib = ibg.immersed_boundary

# Get node at face above and defining nodes on c,c,f
x, y, z = node(i, j, k+1, underlying_grid, c, c, f)
z = znode(i, j, k+1, underlying_grid, c, c, f)

# Get bottom height and fractional Δz parameter
h = @inbounds ib.bottom_height[i, j, 1]
Expand Down

0 comments on commit ff3ab99

Please sign in to comment.