Skip to content

Cylinder IBs: honor the axis set by length_y/length_z (fixes 3D start-up hang) #2060

Open

Description

@sbryngelson

Summary

Cylinder immersed boundaries (patch_ib%geometry = 10) are assumed to lie along x in three places, so a cylinder set along y or z (with length_y or length_z) either hangs the simulation at start-up or silently loses its body.

  1. Start-up hang. s_get_ib_bound uses sqrt(radius**2 + length_x**2). For a y/z cylinder, length_x is the unset default −1e6, so the bound is 10⁶ m. The automatic ib_neighborhood_radius (1536 ib neighborhood radius automatic size checking #1736) turns that into ~10⁹ exchange rounds, and s_get_neighbor_bounds loops in MPI_Sendrecv indefinitely: all ranks were found there in stack traces of a hung GPU job, and the CPU MPI build hangs the same way. Nothing is printed, since Cray Fortran buffers stdout to files. Even for x-aligned cylinders the bound used the full length where half is meant.
  2. No IB cells. Both marker loops call f_is_inside_cylinder(xyz_local(2), xyz_local(3), xyz_local(1), radius, length_x), so a y/z cylinder marks no cells (since 1454-projection-optimization  #1549).
  3. Wrong levelset axis. The cylinder levelset picks its axis by testing length /= 0, which always selects x because the unset default is −1e6, not 0.

Change

  • f_cylinder_axis (1/2/3, whichever length is set, default z) and f_is_inside_ib_cylinder in m_ib_patches; both marker loops and the levelset use them.
  • s_get_ib_bound: sqrt(radius**2 + (0.5*max(length_x, length_y, length_z))**2).
  • New regression test: the existing 3D cylinder IBM case with the axis along z (8 variants, following the existing cylinder tests).

x-aligned cylinders are unchanged: no existing golden moved.

Verification

  • On master, the new z-aligned case aborts at start-up with "an immersed boundary marked no cell anywhere" (on multi-rank GPU runs of larger cases it hung instead, as described above). With this PR its golden generates, and it differs from the same case without the IB in ~1,700–2,300 of 15,625 cells per field, so the body is really there.
  • ./mfc.sh test --only Cylinder: 8 passed; --only IBM: 69 passed (CPU).
  • Found while setting up 3D runs of three spanwise-periodic burning rods; with this fix they start and run on 16 MI300A nodes.

Not addressed here: a finite (non-periodic) rod develops a NaN near its end edges after ~20 steps on a coarse grid. That is present with x-aligned rods on master too, so it is a separate issue.

The bug was reproduced, located in a debugger and verified as described above.


A fix for this is already written. The pull request was closed only to reduce the number of simultaneously open PRs from this author, not because the work was rejected or found incorrect.

Tracked with the pr-to-do label so the whole set is discoverable together.

Filed with Claude Code.

Activity

  1. added
    pr-to-doFix already written in a closed PR; reopen when review capacity allows
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr-to-doFix already written in a closed PR; reopen when review capacity allows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions