Repository navigation
IBM: restore the IB force and torque with the dual-pass hypoelastic HLLD - #2206
Merged
Merged
Conversation
MFlowCode#2162 took the IB force from the momentum fluxes across the body's faces and made the validator reject it with hypoelastic HLLD, whose RHS uses two flux sets. That RHS updates a fluid cell with the hat-L flux at its right face and the hat-R flux at its left, so each body face now reads the set that updates its fluid cell (f_ib_face_flux), and the accumulation runs once per direction after both sets exist. s_accumulate_ib_face_fluxes now returns early when no force or exchange is wanted, so the RHS calls it unconditionally. Adds 2D fixed, 2D two-way and 3D sphere tests with ib_force_wrt. The igr clause of the MFlowCode#2162 rule was unreachable (check_igr_simulation rejects ib with igr) and goes with it; the validator tests expect that message.
|
Claude Code Review Head SHA: 49a75b0 Files changed:
Findings: |
sbryngelson
marked this pull request as ready for review
November 12, 2026 14:12
sbryngelson
requested review from
danieljvickers
and removed request for
a team
November 12, 2026 14:12
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2206 +/- ##
==========================================
+ Coverage 63.71% 64.91% +1.20%
==========================================
Files 90 110 +20
Lines 24569 29488 +4919
Branches 3584 4469 +885
==========================================
+ Hits 15653 19143 +3490
- Misses 6135 6803 +668
- Partials 2781 3542 +761 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… the AMR fine advance
Lines of Code
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#2162 took the IB force from the momentum fluxes across the body's faces and added a validator rule rejecting force output and moving bodies with
igror with the hypoelastic dual-pass HLLD (hypoelasticity = T,riemann_solver = 4), whose RHS it said is "not one set of face fluxes". That removed a working feature for the dual-pass solver. This PR restores it.f_ib_face_flux), and the accumulation runs once per direction after both sets exist.s_accumulate_ib_face_fluxesreturns early when no force or exchange is wanted, so the RHS calls it unconditionally. A one-element placeholder for the unused hat-R array keeps amdflang from aborting on unallocated arrays named in untaken branches.igrclause of the IBM: take the IB force from the momentum fluxes across the body's faces #2162 rule was unreachable:check_igr_simulationalready rejectsib = Twithigr = T("IGR does not support the immersed boundary method"). With that rule lifted as a diagnostic, even a static circle fails on every platform (q_prim_vfis never allocated under IGR: a bounds error on CPU debug, an illegal address on an A100, a memory fault on an MI300A), so IGR with immersed boundaries never worked and nothing was removed there. Supporting it is a separate feature and is not attempted here.case.mdloses the two "not supported with igr or hypoelastic HLLD" clauses and gains a note on which flux sets form the force.ib_force_wrt: 2D fixed circle (AA36F5D2), 2D two-way circle (BA59123E), 3D sphere (8DDB767E).Verification
Exactness (temporary instrumentation, not committed; NVIDIA A100, 2D and 3D, fixed and moving bodies): at body faces the accumulated force equals the force reconstructed from the RHS arrays the solver actually used (
rhs_hatLandrhs_hatRof the fluid cells next to the body) to a relative difference of at most 2.5e-15 over more than 1000 comparisons, for all directions, G = 0, 0.5 and 5, and a two-way body.G = 0 limit: with G = 0 for both fluids the dual-pass HLLD force history matches the WENO5 + HLLC force (no hypoelasticity) to the printed 9 digits, in 2D and 3D, and the momentum balance of the non-body fluid cells against the body force closes to about 1e-15. With G /= 0 the same balance leaves 2e-5 to 3e-5 (1.7e-4 with a moving body): the dual-pass hat-L and hat-R fluxes differ at interior faces, so fluid momentum is not exactly conserved by the scheme itself; it is not an error in the accumulation. The AMD force history matches NVIDIA's to the printed precision.
Test sets, labels run with
--no-chemistry --no-examples:Limitations
override_tol = 1e-5: on the first A100 run 11 of 225,280 stress values near the body differed from the CPU-generated golden by up to 1.5e-6. With that tolerance these two tests alone would not catch a wrong-flux-set error of order 1e-5; the exactness check above is the real evidence.ib_heat_wrtandthermal_bc = 3need chemistry, which hypoelastic HLLD forbids, so the flux selection wired through the energy and mass fluxes is not exercised.This PR was made with Claude Code (AI).