Skip to content

Fix issue #236: remove dead outflow-BC plumbing in Projection - #263

Merged
asalmgren merged 1 commit into
AMReX-Fluids:developmentfrom
asalmgren:fix-236
Oct 12, 2026
Merged

asalmgren merged 1 commit into
AMReX-Fluids:developmentfrom
asalmgren:fix-236

Conversation

@asalmgren

Copy link
Copy Markdown
Contributor

Fixes #236.

  • filterP declaration removed (never defined; any caller would get a link error).

  • nodal_proj.add_vort_proj retired — it only fed initialVorticityProject, which post_init_state aborts before reaching.

  • set_outflow_bcs/set_outflow_bcs_at_level only consume Sig_in and gravity, so the unused Vel_in/Divu_in/have_divu/which_call parameters are gone and gravity is computed inside. The one remaining job is the hydrostatic rho*g from computeRhoG, so every call site now gates on gravity != 0:

    • level_project: drop the have_divu || term and the unused Vel_ML/Divu_ML vectors.
    • initialPressureProject: test gravity explicitly (its only caller already did).
    • initialVelocityProject, initialSyncProject: drop the calls — with gravity == 0 they could only re-zero a phi that is already zero.

    That also removes the ghost cells that existed solely to feed those calls (nghost is now 0 for sig in initialVelocityProject, so the rho_wgt_vel_proj density-boundary block goes away, and for rhcc in initialSyncProject), so a divu run no longer does a pointless global gather per level. MLNodeLaplacian copies only valid cells from sig/rhcc and fills ghosts itself.

  • Unused which_call tags (INITIAL_VEL, INITIAL_SYNC, SYNC_PROJ, FILTER_P) removed, and the stale comments about U_new/divusource being used to construct the outflow BCs fixed.

OutFlowBC::SemiGrow/SemiCoarsen are dead too but belong to #239, so they are left alone; nodal_proj.do_outflow_bcs stays — it still switches the hydrostatic BC off.

Verification

  • Exec/run2d and Exec/run3d both build clean; Projection.cpp also compiles clean under -Wall -Wextra with asserts enabled, with no unused-parameter warnings.
  • regtest.2d.hotspot exercises everything touched here: ns.gravity = -9.8, ns.hi_bc = 5 2 (outflow at y-hi), do_temp = 1 so have_divu, and amr.max_level = 2 so the fine level covers the outflow face and putDown runs. Before/after plotfiles at step 5 agree bit-for-bit on all fields at all three levels (fcompare: PLOTFILE AGREE).

🤖 Generated with Claude Code

…tion

- Remove the filterP declaration (never defined anywhere in the tree).

- Retire nodal_proj.add_vort_proj: it only fed initialVorticityProject,
  which post_init_state aborts before calling.

- set_outflow_bcs / set_outflow_bcs_at_level only ever use Sig_in and
  gravity, so drop the unused Vel_in, Divu_in, have_divu and which_call
  parameters and compute gravity inside set_outflow_bcs. The remaining
  job is the hydrostatic rho*g from computeRhoG, so every call site now
  gates on gravity != 0:

    - level_project: drop the "have_divu ||" term and the unused Vel_ML
      and Divu_ML vectors.
    - initialPressureProject: test gravity explicitly (its only caller
      already did).
    - initialVelocityProject, initialSyncProject: drop the calls. With
      gravity == 0 they could only re-zero a phi that is already zero.

  That also removes the ghost cells that existed solely to feed those
  calls -- nghost is now 0 for sig in initialVelocityProject (so the
  rho_wgt_vel_proj density-boundary block goes away) and for rhcc in
  initialSyncProject -- so a divu run no longer does a pointless global
  gather per level. MLNodeLaplacian copies only valid cells from sig and
  rhcc and fills ghosts itself.

- Remove the now-unused which_call tags INITIAL_VEL, INITIAL_SYNC,
  SYNC_PROJ and FILTER_P, and fix the stale comments about U_new/divusource
  being used to construct the outflow BCs.

No change in results: regtest.2d.hotspot (gravity, outflow at y-hi,
have_divu, 2 levels of refinement) agrees bit-for-bit with the previous
code on all fields at all levels.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@asalmgren
asalmgren requested a review from jbbel October 12, 2026 21:03
@asalmgren
asalmgren merged commit cc43260 into AMReX-Fluids:development Oct 12, 2026
12 checks passed
@asalmgren
asalmgren deleted the fix-236 branch October 12, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant