Skip to content

Commit

Permalink
[physics] Fix make_incompressible() for FVM
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Aug 3, 2024
1 parent df9bea1 commit b3ce07e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phi/physics/fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def make_incompressible(velocity: Field,
wide_stencil = not velocity.is_staggered
pressure = math.solve_linear(masked_laplace, div, solve, velocity.boundary, hard_bcs, active, wide_stencil=wide_stencil, order=order, implicit=None, upwind=None, correct_skew=correct_skew)
# --- Subtract grad p ---
grad_pressure = field.spatial_gradient(pressure, input_velocity.extrapolation, at=velocity.sampled_at, order=order)
grad_pressure = field.spatial_gradient(pressure, input_velocity.extrapolation, at=velocity.sampled_at, order=order, scheme='green-gauss')
if hard_bcs is not None:
grad_pressure *= hard_bcs
velocity = (velocity - grad_pressure).with_extrapolation(input_velocity.extrapolation)
Expand Down

0 comments on commit b3ce07e

Please sign in to comment.