Repository navigation
3D finite cylinder IBs go NaN at the cap/side rim after ~20 steps #1964
Description
Activity
Status: opt-in edge rounding tried, on hold
What was tried. Opt-in rounded edges for rectangle (3), cuboid (9) and cylinder (10) IB patches, set by
patch_ib(i)%edge_radius_cells. The default of 0 leaves every existing path and golden file unchanged.- The markers and the level set use a rounded-box or rounded-cylinder signed-distance function.
- With r ≥ 3 cells, ghost-point normals are continuous around edges, so neighbouring ghost layers no longer mirror through different faces.
- The branch is
ib-edge-rounding, stacked on Cylinder IBs: honor the axis set by length_y/length_z (fixes 3D start-up hang) #1962. It is not pushed and has no PR.
Results. Hot isothermal wall (Twall = 1800 K), Mach 1.5, viscous reacting flow, r = 3, with the #1969 wall-ghost fix included:
case sharp (r = 0) rounded (r = 3) peak near-wall T (bound 1.02 Twall = 1836 K) 2D rectangle, 300 steps NaN by step ~24–72 no NaN 1927 K, on a flat face 5–9 cells from the corner 3D rod 12/D, 300 steps NaN at step ~22 no NaN 2015 K, on the side surface 3D rod 24/D, 600 steps NaN no NaN 1976 K at the rim (flat side 1817 K) 3D rod 24/D, r = 6 — no NaN 2055 K (worse) - Robustness: rounding removes the rim NaN.
- Temperature bound: rounding does not keep near-wall T within bounds. The overshoot also appears on flat faces away from edges (2D, and 12/D), so it is not only a corner effect.
- Radius: a larger radius does not help.
- CPU/GPU parity: at 12/D, rounded GPU and CPU runs agree on markers and on min/max T to 1e-6.
Plan. Rounding is on hold until the flat-wall overshoot of the isothermal ghost state is understood. It is likely related to #2014: the first-order no-slip ghost velocity leaves a hot, slipping first cell. After that, the acceptance runs above will be repeated.
The scaling limiter in #1975 remains the stopgap for the NaN.
Prepared with Claude Code.
Correction to the comment above: the edge-rounding branch has been dropped, not held. Its results stand as a negative result and are still worth recording, but we are not pursuing rounding.
Why. Rounding fixed the robustness symptom (rounded rods ran 300–600 steps where sharp ones went NaN by step 22) but not the cause. Near-wall temperature still exceeded 1.02·Twall, and a larger fillet was worse. Flat faces overshot too, so the defect was never edge-specific.
Where the cause now looks to be. An order-of-accuracy study of the isothermal IB wall found that near-wall temperature converges at only ~1st order on curved walls (~2nd order on grid-aligned flat walls), while pure conduction never overshoots the wall temperature at all. That points at the ghost extrapolation distance rather than at edge geometry: the image-point value is an inverse-distance-weighted average effectively sampled at the stencil centroid, and taking
max(centroid distance, |levelset|)as the gradient length extrapolates from the wrong distance for the 14–24 % of ghost points whose centroid sits closer to the wall than the mirror point. That is being tested directly, together with bilinear/trilinear image-point interpolation (#2026), which removes the same error at its source.#1975's scaling limiter remains the stopgap for the NaN itself.Prepared with Claude Code.
Summary
A finite 3D cylinder immersed boundary (
patch_ib%geometry = 10with a setlength_*, so the rod has end caps) goes NaN at the rim where an end cap meets the side surface. On a coarse grid in supersonic crossflow this happens after about 20 steps. It reproduces on master with an x-aligned rod, so it is not caused by #1962 (which fixes y/z-aligned cylinders).Reproduction
Hypothesis (not verified)
At the sharp cap/side rim, the levelset normal switches between the cap and side directions. That can send image points into the corner region, so the ghost state there is ill-posed. It needs its own investigation, e.g. checking image-point locations and ghost values for ghost points within ~2 cells of the rim.
Found with Claude Code while debugging 3D rod startup hangs (#1962).