Skip to content

Validator: a two-way immersed body needs a positive mass - #2193

Draft
sbryngelson wants to merge 2 commits into
MFlowCode:masterfrom
sbryngelson:wave5/two-way-needs-mass
Draft

sbryngelson wants to merge 2 commits into
MFlowCode:masterfrom
sbryngelson:wave5/two-way-needs-mass

Conversation

@sbryngelson

@sbryngelson sbryngelson commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What

moving_ibm = 2 advances a body with force/mass, and an unset mass is the -1e6 sentinel, so a two-way body without a mass accelerated the wrong way, silently. The validator now requires patch_ib(i)%mass > 0 for every moving_ibm = 2 body (particle clouds already required a positive mass). A fixed or prescribed body needs none. The patch_ib docs table gets a mass row.

Follow-up to #2188, which stopped the body-force term from entering the recorded force of bodies that are not two-way.

Effect on tests and examples

I ran the validator over all 789 buildable cases in list_cases() and over every example: only IBM -> Adaptive dt (09FDDC81) has a two-way body without a mass. It now gets mass = 1e6, so the body keeps its speed. Its golden changes: the old mass of -1e6 accelerated the body by about 1e-9 in the wrong direction, and that test places the body edges exactly on cell faces, so the difference changes which cells count as solid (about 430 of 2500 cells, 1e-3 relative in density). The other cases and goldens are unchanged.

Verification

  • 4 new validator unit tests; precheck passes.
  • AMD MI300A (Tuolumne, amdflang, OpenMP offload): regenerated 09FDDC81, then the full IBM subset passes (71 of 71), with the other wave-4 validator and levelset changes merged into the same tree.
  • NVIDIA + NVHPC (A100, OpenACC): the full IBM subset passes on this branch (71 of 71), so the regenerated golden also holds on a second vendor.

This PR was made with Claude Code (AI).

moving_ibm = 2 advances the body with force/mass, and an unset mass is the -1e6 sentinel, so the
body accelerated the wrong way, silently. The Adaptive dt test, the only suite case with a
two-way body and no mass, gets a heavy mass so its body keeps its speed.
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Claude Code Review

Head SHA: 8bbb431

Files changed:

  • 3
  • toolchain/mfc/case_validator.py
  • toolchain/mfc/test/cases.py
  • toolchain/mfc/test_case_validator.py

Findings:
No issues found. Checked in step 4: case_validator.py, test/cases.py, test_case_validator.py. The other moving_ibm = 2 test case and the examples I grepped already set a mass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant