Skip to content

Commit

Permalink
[physics] Detect rank_deficiency for meshes in make_incompressible()
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 4, 2025
1 parent e181b87 commit 2d66768
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phi/physics/fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def make_incompressible(velocity: Field,
div = field.where(field.is_finite(div), div, 0)
if not input_velocity.extrapolation.is_flexible and all_active:
solve = solve.with_preprocessing(_balance_divergence, active)
if solve.rank_deficiency is None and not div.is_grid:
solve = copy_with(solve, rank_deficiency=1)
if solve.x0 is None:
pressure_extrapolation = _pressure_extrapolation(input_velocity.extrapolation)
solve = copy_with(solve, x0=Field(div.geometry, 0, pressure_extrapolation)) # convert=False
Expand Down

0 comments on commit 2d66768

Please sign in to comment.