Let prescribed kinematics drive airfoil and STL immersed boundaries - #1929
sbryngelson wants to merge 5 commits into
Conversation
These geometries move their working centroid to the centre of mass and keep the difference in centroid_offset. Account for it everywhere it matters: - s_compute_centroid_offset is collective; call it for every global patch on every rank (MFlowCode#1895) - s_model_levelset subtracts centroid_offset, matching the marker test (MFlowCode#1896) - prescribed kinematics rotate kin_offset - centroid_offset about the hinge - checkpoints record the offsets and restarts restore them (MFlowCode#1902) The validator no longer forbids kin_model on geometries 4, 5, 11 and 12. Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1929 +/- ##
==========================================
- Coverage 62.82% 62.69% -0.14%
==========================================
Files 86 86
Lines 22394 22447 +53
Branches 3305 3324 +19
==========================================
+ Hits 14070 14074 +4
- Misses 6071 6118 +47
- Partials 2253 2255 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Only moving airfoils and STLs carry a centroid_offset, but setup ran one collective per global patch and each checkpoint three, so particle clouds (thousands of patches) paid for work they never use. One reduction now decides whether any patch needs it; otherwise nothing runs and no ib_offset file is written. The checkpoint writer also reduces in a single call, with only each patch's owner contributing. Co-Authored-By: Claude <noreply@anthropic.com>
|
Pushed The five tests pass on Frontier under GNU with |
Conflict in s_ibm_setup: master's s_check_every_patch_marked (MFlowCode#1914) runs first, then this branch's gated centroid-offset work.
Lines of Code
|
Summary
Lets prescribed kinematics (
kin_model) drive airfoils and STL models (geometry4, 5, 11, 12), and fixes the three bugs that stood in the way. Closes #1895, closes #1896, closes #1902.For these geometries a moving body's working centroid is moved to the centre of mass of its marked cells, and the difference is kept in
centroid_offset(body frame). Four things did not account for that:s_compute_centroid_offsetdoesMPI_Allreduces but was called from a loop over the rank-localnum_ibs, so ranks entered it different numbers of times. It is now called for every global patch id on every rank. A rank that does not hold the patch contributes zeros, and whether a reduction is needed at all is itself reduced, because only holding ranks can seegeometryandmoving_ibm.s_apply_ib_patchessubtractscentroid_offsetafter rotating into the body frame, buts_model_levelsetdid not. Image points were therefore placed relative to a body shifted by the offset from the one that was marked. One line.s_prescribed_kinematicsplaces the centroid athinge + R·kin_offset, wherekin_offsetpoints at the centroid named in the case file. Once that centroid has been moved to the centre of mass, the vector has to bekin_offset - centroid_offset. Otherwise the whole body is displaced byR·centroid_offset.restart_data/ib_offset_<step>.dat) and read back on restart. If no file is present, the measured offsets stand as before.The validator's prohibition of
kin_modelon geometries 4, 5, 11 and 12 is removed, andcase.mddocuments the convention. Static bodies andkin_modelon other geometries are unaffected: their offset is zero.Verification
pre_process,simulationandpost_processbuild on master0f7f62fawith this branch in all three Frontier configurations: CPU (--no-gpu), OpenMP offload (--gpu mp) and OpenACC (--gpu acc)../mfc.sh precheckpasses (all 7 gates).2D -> IBM -> Vieille Burn Rate, needs a chemistry build that was not present locally; CI builds it.A flapping STL plate under
kin_model = 1, with its case-file centroid 0.02 off the plate's centre of mass so thatcentroid_offsetis nonzero. Master's validator rejects this case, and before this PR it deadlocked at setup on more than one rank.ib_offset_200.datidenticalib_offset_200.datremovedAfter a restart the body itself is placed identically either way, because the marker test and the kinematics now both use
kin_offset - centroid_offset, so the offset cancels in the geometry. What the saved offsets preserve is the reference point for the centroid and the torque, which is what #1902 reports.Forces after a restart match the uninterrupted run to all printed digits for about 20 steps, then differ at the 1e-3 level as cells cross the moving surface. They do that equally with and without the offset file: it is the round-off sensitivity of a restart, which this PR does not change.
The same fixes carried an STL seagull with prescribed flapping on up to 64 Frontier nodes, over six wingbeats across chained restarts.
AI disclosure
Written with Claude Code (Anthropic). These fixes come from running an STL seagull with prescribed flapping on Frontier (up to 64 nodes, six wingbeats across chained restarts), and were reduced from the fixes used there.
Acknowledgement