Repository navigation
Moving immersed boundary: add geometric-conservation-law (GCL) treatment to eliminate spurious pressure / CFL blow-up #1636
Description
Summary
MFC's moving immersed-boundary method lacks a geometric-conservation-law (GCL) / fresh-dead-cell treatment. On a fixed Cartesian grid, a moving body produces a spurious mass source/sink at the interface that seeds pressure oscillations and, in marginal cases, a CFL / sound-speed blow-up. This is latent in the shared ghost-cell IBM code and affects both AMR and non-AMR moving-IB simulations. We should add a proper GCL treatment.
Where it currently bites
The AMR moving-IB regression test 13945217 ("AMR → 2D → moving IBM circle") diverges on OpenMP-offload backends (Cray CCE gpu-mp and AMD flang) while passing on OpenACC and CPU. It fails with icfl NaN / ICFL is greater than 1.0. Exiting.
Diagnosis (rocgdb + device-side finiteness instrumentation on Frontier):
- The IB geometry pipeline is completely finite — every ghost point's
levelset_norm,ip_loc, andinterp_coeffsstays finite for the whole run (0 non-finite across all steps). So this is not a degenerate-stencil or bad-normal bug, and not the moving-body position sync. - The failure is a flow-stability / CFL blow-up: a NaN sound speed forms in the flow state (device-generated), first appearing as a ~65-cell cluster hugging the moving circle's leading (advancing) edge, then growing until
maxval(icfl_sf)trips on the host. - It is OpenMP-only because the flow sits on a stability knife's edge; OpenMP's floating-point ordering tips the marginal case past the edge where OpenACC/CPU stay just stable.
Root cause
In src/simulation/m_rhs.fpp (~L851–865), every IB cell's RHS is zeroed (rhs_vf = 0) — a standard non-conservative ghost-cell IBM (Tseng & Ferziger 2003; Mittal & Iaccarino 2005). Interior cells are frozen and set by s_ibm_correct_state (p=1, momentum = body_vel·ρ). There is no GCL term accounting for a cell's fluid volume changing as the interface sweeps, and the flux across the moving fluid-solid interface is not made conservative. As the body moves, this un-GCL'd volume/flux change is a spurious mass source/sink at the front — the well-documented moving-IBM pressure-oscillation mechanism (Seo & Mittal, JCP 2011).
Notably, 13945217's body barely moves in cell units (vel=0.2, dt=1e-3 → ~0.13 cells over 10 steps), so the dominant driver here is the moving-wall velocity BC compression at the leading edge plus the per-substage recompute, more than literal cell-flipping — but both are the same missing-GCL family.
Why cheap fixes don't apply
- Fresh-cell reinitialization (reset vacated cells from fluid neighbors): implemented and tested — it fires but does not stabilize (
ICFL>1at the same step). The driver is a flux/volume conservation error, not stale cell state. - Velocity/forcing temporal smoothing: moot — the body velocity is prescribed-constant.
- Interior field extension: moot —
gp_layers=3≥ the WENO stencil, so the interiorp=1is masked from the reconstruction.
Proposed fix
Add a compressible GCL / cut-cell treatment to the moving-IB update: fractional cell volumes V(t) ∈ [0,1] and a U·dV/dt source term (or a conservative moving-boundary flux) replacing the binary frozen-cell mask. This is the literature remedy (Seo & Mittal report ~7–10× oscillation reduction) and benefits all moving-IB runs, AMR and non-AMR. It is a substantial change to the core IB update and will re-golden the moving-IB tests.
Test-coverage gap
The only moving-IB regression tests are AMR (13945217, 43AF9F25); there is no non-AMR moving-IB test, so a non-AMR moving-IB production run could hit this silently. A non-AMR moving-IB test should be added alongside the fix.
Interim
Deferring the numerics (no user is currently blocked). The associated CI test 13945217 is being adjusted to stop before the marginal instability manifests (matching 43AF9F25's short-run pattern) so CI is unblocked; this issue tracks the real fix.
References
- J.H. Seo & R. Mittal, A sharp-interface immersed boundary method with improved mass conservation and reduced spurious pressure oscillations, JCP 230 (2011) 7347–7363.
- Mittal & Iaccarino, Immersed Boundary Methods, Annu. Rev. Fluid Mech. 37 (2005).
- Implicit ghost-cell IBM for moving bodies with control of spurious force oscillations, JCP 2012 (S0021999112005128).
Activity
test: soften moving-IB circle case to avoid the un-GCL'd CFL blow-up (M…
test: keep two-body moving-IB (43AF9F25) at its original wall speed
sbryngelson commentedon Oct 10, 2026
@danieljvickers — posting the full moving-body investigation here, with links to #2017 (force), #1958 (second-order wall treatment), #2025 (body RK defect), and #2026 (bilinear/trilinear interpolation).
These are separate corrections. The tested version of #1958 and our body RK correction do not fix the moving-body force/transport inconsistency below: the counterexample still fails with both applied. This issue tracks the geometric-conservation work; it is not itself an implemented fix. Swept-volume/state transport addresses changing masks, while a consistent relative-interface flux is also needed to recover the physical moving-wall load. Bilinear/trilinear interpolation was not included in these tests, and improving interpolation alone cannot remove the continuum advective term derived below.
The existing RK draft, supporting notes, and native attachments are available in the #2025 comment: RK ZIP and RK patch.
The report below contains the actual solver tests, exact solution, stage-budget derivation, literature, and qualifications. The new 55-case bundle and diagnostic build patches are prepared locally; their native attachment upload is still pending. The diagnostic patches are reproducibility/instrumentation patches, not a general production fix.
Moving IBM: exact-solution tests and stage budgets
42 additional full serial CPU solver cases completed, following the 13 uniform-state cases. The principal finding is a moving-body force inconsistency in PR #2017: its raw fixed-grid momentum flux includes advective transport that is not the hydrodynamic load on a moving impermeable body. An exact zero-force solution reproduces the error, a uniform boost changes the reported force, and two-way coupling turns it into spurious body motion.
Source and test scope
a6add01e35239cf9e87de38972e968ad1799c04c.e85a5b0ff56fce105fdc5a9317f36ba4353e2179.82bd69ffabe040a8efde9e9985c527b0605a445c; its diff applies cleanly on PR2017 plus our RK correction and diagnostic hooks.moving-budget-worktree.Exact zero-force counterexample
The periodic unit square contains a slip circle of radius R=0.12 centered at
(0.35+Ut, 0.5), with U=0.25. The ideal gas has gamma=1.4, pressure p=2, and uniform velocity(U,0). Define X and Y as minimum-image distances from the moving center and r²=X²+Y². The density isIts periodic-seam tails are below double precision. Density stays between 0.9 and 1.1. On the body, rho=1+A cos(theta), and its radial derivative vanishes. The zero-gradient density condition is therefore compatible at the wall. This smooth density translates with the body while p and velocity remain constant. Continuity is rho_t+U rho_x=0; momentum and energy reduce to the same advection identity. The fluid and body have equal normal velocities, so impermeability holds. Uniform pressure gives exactly zero net force and torque, for any body mass.
Initial conservative states use five-point Gaussian cell averages: rho, rho U, zero y-momentum, p/(gamma-1)+rho U²/2, and alpha=1. Comparing five- and nine-point quadrature gives a maximum angular-profile discrepancy of 1.4e-12 at 32² and below 2e-15 at 64²/128². The full solver then runs to t=0.5, translating by 4, 8, or 16 cells.
With PR2017 + RK + PR1958 (IP minimum 1.5h):
Pressure and velocity remain at roundoff in these prescribed-motion cases. The false force is already present at the first RHS evaluation of the supplied exact initial state; it cannot be attributed to accumulated body RK error.
For a normal pointing from body to fluid, the raw Euler momentum flux contains rho u(u dot n)+p n. Here the advective contribution predicts
The measured mean approaches this nonzero value. Moreover, at every measured stage in the prescribed-motion cases, removing the advective contribution diagnostically (
Fx + U * integrated_fluid_mass_RHS) reduces the force to roundoff. This subtraction is a mechanism check for this exact constant-velocity solution, not a validated general correction.In the resting frame, both body and fluid velocity are zero and the same angular-density profile is stationary. The PR2017 force is then zero to roundoff, including a control that keeps moving_ibm=1 and exercises the same moving-IBM code path at zero speed. Its force therefore changes under a uniform Galilean boost even though the physical load is unchanged.
Two-way coupling exposes the consequence. At 64², the exact body velocity remains 0.25 and its final x is 0.475. With PR2017 + RK + PR1958, mass 1 gives final velocity 0.248985434 and x=0.47474277; mass 0.01 gives velocity 0.231208154 and x=0.47013750. The light-body pressure error reaches 0.00485469. Old pressure-gradient-force controls, using the corrected RK build and the original wall treatment, retain body velocity and position to roundoff; their force is below 3e-16. The exact uniform pressure/velocity makes the force mechanism comparison meaningful despite the wall-treatment difference. The diagnostic subtraction in the combined-PR build independently isolates the advective contribution.
What the revised force does verify
On the fixed mask used for each RHS, PR2017 balances integrated fluid momentum RHS and body force to approximately 1e-15. This is a useful discrete compatibility property. It does not include the transport associated with subsequently moving the domain represented by that mask.
Let Q0 be a component of the fluid total on the stage-input mask, Qstar_old the pre-reconstruction state integrated on that old mask, Qstar_new the same state on the rebuilt mask, and Qfinal_new the corrected state on the new mask. The stage difference decomposes into:
Here C=0: the correction writes solid/ghost cells, not cells classified as fluid. It can still alter the states later exposed by motion.
RK also blends the step-start conservative state using the stage's old mask. Define T_s as the step-start state integrated on that stage mask minus the step-start state integrated on the original step mask. For RK3 the exact full-step identity is
This identity was checked on measured stage totals for continuity, both momentum components, energy, and alpha, with closures below 6e-14. Thus the extra terms are measured consequences of reclassification and RK state reuse, not an unexplained residual.
Nonzero-exchange case
A prescribed U=0.25 body translates through initially still, uniform fluid with p=2, rho=1, in the periodic box. This produces a physical response; pressure changes in this case are not automatically spurious.
At 64² with both PRs, over t=0.5:
These are exact diagnostics of MFC's whole-cell masked totals. Such totals approximate the physical moving-domain integral; the test is not an independent exact cut-volume quadrature. Nevertheless, the results establish that the implemented fixed-mask flux balance is not the full moving-mask momentum balance. A changed subcell offset changes the residual and creates a y component; time refinement alone does not remove it.
Energy is also recorded. In this case the fluid energy change plus integrated force work is 0.0309720836. The diagnostic splits this into the energy-RHS/force-work difference (0.0361837793) and the geometry/RK contribution (-0.00521169578). The raw numerical momentum-flux force is not yet a physical traction/work pair for a moving wall; these numbers should not be promoted to a standalone exact physical-energy error without that qualification.
Density accuracy and image-point controls
A separate radially symmetric profile, rho=1+0.1 exp(-((r²-R²)/0.025)²), also translates exactly with uniform pressure and velocity. At 32²/64²/128² the existing mirror-IP wall gives maximum density errors 0.0159444/0.00506278/0.00170822, corresponding to observed rates 1.66 and 1.57. The matching no-body errors are 0.00223610/0.000326823/0.0000223032.
PR1958 with mirror IP gives essentially the same density errors, as expected for an already exact constant velocity. Its minimum IP distance of 1.5h changes density sampling and gives errors 0.0298666/0.00879898/0.00279631 (rates 1.76 and 1.65). This test does not evaluate the intended improvement of velocity extrapolation in a sheared flow. Larger image-point distance improves stencil availability but changes the density reconstruction error here. Halving dt at 64² barely changes the density error. Three grids do not establish asymptotic order, and Dan's bilinear/trilinear work is not applied.
Changing prescribed-body mass from 1 to 1000 produces 216 byte-identical snapshot files in both radial-density and nonzero-exchange controls. The pressure acceleration correction is guarded by moving_ibm>1; prescribed motion does not incorrectly use hydrodynamic force/mass.
Fix direction supported by the tests
For a moving interface, the relative flux is F_n-(v_wall dot n)Q. Impermeability then gives zero mass flux, pressure traction in the inviscid momentum exchange, and pressure work p(v_wall dot n) in energy. This removes the advective force in the exact counterexample. A general implementation must combine that exchange with swept-volume/state transport and RK geometry/state bookkeeping; rotation makes wall velocity vary over the surface. Simply giving all overwritten ghost momentum to the body is not a justified correction.
Monasse et al. explicitly separate pressure-force exchange from swept conserved quantities and construct a conservative compressible rigid-body coupling: paper, sections 4.2–4.4 and 5. This is the relevant direction for #1636 and moving-body support in #2017. Corrected RK and higher-order interpolation remain useful, but neither removes the raw advective transport term by itself.
Artifacts and reproduction
run_nonuniform.pyruns each 15-case suite.run_extra_tests.pyreproduces the mirror, angular-density, old-force, and resting-frame controls.analyze_nonuniform.pycloses stage/full-step budgets.verify_asymmetric.pychecks the force signature, body motion, controls, and quadrature.plot_nonuniform.pyandplot_asymmetric.pyproduce PNG/PDF figures.The preprocessor is the base+RK build. Base+RK simulation supplies old-force controls. For PR2017, apply
budget-build.diffon the pinned PR head, build serial simulation through./mfc.sh, and preserve that executable asbinaries/pr2017-rk-budget-simulation. Then applypr-1958.diffand rebuild for combined-PR tests. Alternatively,combined-budget-build.diffapplies the entire combined source change directly to the pinned PR2017 head. These diagnostic patches are serial CPU test instruments, not proposed production changes.The original
rk-production-draftand the isolatedmoving-budget-worktreeare siblings of this artifact directory. From their parent:Per-case inputs, logs, force histories, full stage CSVs, and analysis are retained. Provenance JSON records source diffs and binary hashes. The compact ZIP includes initial/final snapshots; intermediate snapshots remain in the local case directories. Findings are from actual solver runs, not the earlier interpolation arithmetic example. No new findings have been posted publicly in this continuation.