Repository navigation
Add patch_ib%thermal_layer: start a hot IB in its conduction solution #2056
Description
Summary
Adds patch_ib(i)%thermal_layer = δ [m] (default 0, off) for thermal_bc = 1 circles (geometry 2) and spheres (geometry 8).
A hot isothermal IB otherwise meets the ambient gas as a temperature step at t = 0, and the mirrored ghost state doubles that step (T_ghost = 2 T_wall − T_gas ≈ 3300 K for an 1800 K wall in 300 K air). On fine cells the gas next to the wall heats faster than it can expand: in a 3D bed of 191 carbon spheres (d = 100 µm, 12 cells/d), near-wall cells reached 1.87 bar within 4 steps and the run went NaN on step 5. That failure did not depend on dt (CFL 0.5, 0.15 and 0.05 all failed at t ≈ 3–6e-8 s) or on surface chemistry (identical with surface_reaction = 0).
With thermal_layer = δ, pre_process starts the gas in the conduction solution for a wall impulsively brought to Twall a time t₀ = δ²/(4α) earlier:
T = T∞ + (T_wall − T∞) (R/r)^((d−1)/2) erfc((r − R)/δ)
at fixed pressure and composition, so ρ scales as T∞/T. This is exact for a sphere and the leading-order (short-time) term for a cylinder (Carslaw & Jaeger). Overlapping layers take the IB with the largest temperature change; periodic directions use the nearest image. It acts only on the initial condition.
Testing
- New case
2D -> Chemistry -> IBM Reacting Surface -> Thermal Layer(A74B7381): the reacting-surface example at the Example grid cap with δ = D/2. The initial density goes from 0.29 kg/m³ (1200 K) at the wall to the 1.18 kg/m³ freestream. - The reacting-surface example golden (F52F0D4C) passes unchanged.
- Validator:
thermal_layermust be ≥ 0 and, when > 0, needsthermal_bc = 1on geometry 2 or 8. - GPU (OpenMP offload, MI300A), the 3D bed above,
Twall= 1800 K: without the layer it aborts at step 4; with δ = 0.2 d (2.4 cells) it runs 835 steps to t·U/d = 5 cleanly. At 24 cells/d the bed also runs without the layer.
./mfc.sh lint passes except the two [dp-acc] thermochem codegen tests, which also fail without this change here (LLNL gfortran 13.3.1's nvptx offload lacks log10).
Tested on LLNL Tuolumne (CCE 19 CPU; OpenMP offload on MI300A).
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.
- Closed PR: Add patch_ib%thermal_layer: start a hot IB in its conduction solution #1955
- Branch:
ib-thermal-layeron thesbryngelsonfork, at38cfa029b5 - Reopening needs no force-push and no rebase:
gh pr reopen 1955 -R MFlowCode/MFC
Tracked with the pr-to-do label so the whole set is discoverable together.
Filed with Claude Code.
Activity