Repository navigation
IBM: opt-in sub-grid wall conduction column for isothermal walls (patch_ib%wall_column) - #2329
Conversation
|
Claude Code Review Head SHA: 01a90a6 Files changed:
Findings:
|
38a9e6e to
01a90a6
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2329 +/- ##
==========================================
+ Coverage 65.72% 65.99% +0.27%
==========================================
Files 111 112 +1
Lines 30549 31064 +515
Branches 4673 4748 +75
==========================================
+ Hits 20079 20502 +423
- Misses 6699 6716 +17
- Partials 3771 3846 +75 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ch_ib%wall_column) Each first-layer ghost of a fixed, inert, thermal_bc = 1 circle or sphere carries a 1D low-Mach conduction column along the wall normal (m_ib_wall_column), advanced once per step; its step-mean wall flux enters the gas as the ghost's conduction temperature, with a one-sided drain guard and a Lagrange column-top probe. wall_column_dt_frac adds a time-step limit (WCOL). With ib_heat_wrt the body books the column's flux. Off by default: no existing golden moves. Two new chemistry tests with goldens generated on an A100 (nvhpc) and checked on an MI300A (amdflang).
895ac8e to
7a6db65
Compare
…release CPU spread 1.5e-4)
|
CI follow-up for the one failing lane (Intel ifx, release, CPU): test DF9526DB (Wall Column -> Time-Step Limit).
Sensitivity (CCE CPU, same case): a 1e-12 relative change of the freestream velocity changes the output by under the 7-digit output resolution (<1e-7), so roundoff is not amplified much. A 0.1 % change of Change: Not verified: the cause of the Intel difference. A 1.5e-4 gap implies a step-sequence difference of about 1e-4 relative on Intel release, which pure roundoff does not explain given the measurement above; I had no ifx to reproduce it, and did not get a debug/fastmath CCE comparison (the build did not configure). Pure roundoff amplified by the chemistry is not supported by the data; a compiler-specific code path in the limiter remains possible. Frontier and remaining NVHPC 26.9 cpu lanes were still pending when this was written. This PR was made with Claude Code (AI). |
|
Merged current master into this branch (head 900327e, normal merge commit).
MI300A and A100 runs of the wall-column and IBM tests are pending; results will follow here. This PR was made with Claude Code (AI). |
|
NVIDIA hand test of this head (
The set is the wall-column tests (including Not run: AMD (the Frontier CI lanes are the AMD check), the OpenMP offload path on NVIDIA, and H100/H200. AI-assisted (Claude Code). |
Lines of Code
|
Follow-up to #2248 (merged): one commit on current master. No existing golden moves with the option off.
Summary
At an isothermal immersed wall the ghost carries a linear-mirror conduction temperature, so the wall heat flux the gas sees is at most about 2 lambda dT / h. When the thermal layer is thinner than a cell (a cold body in hot gas at low resolution) the body takes up far too little heat. This adds an opt-in sub-grid model:
patch_ib(i)%wall_column(newm_ib_wall_column). Each first-layer ghost of a fixed, inert,thermal_bc = 1circle or sphere carries a 1D low-Mach conduction column along the wall normal: 96 stretched cells from the wall (Twall) tomax(3h, wall_column_len)(default 0.15 R), curvature, frozen composition, per-step lambda(T) and c_p(T) tables, 16 L-stable SDIRK2 substeps per flow step. The column's top state comes from the gas through a Lagrange probe (s_lag3_weights). It advances once per step, from the state of the first stage.ib_heat_wrtthe body books the column's flux, that is the gas faces' flux plus the guard's cut.wall_column_dt_frac(default 0.1) adds a time-step candidateWCOL: a step's column drain may take at most this fraction of a near-wall cell's heat span. At a step start the column's flux is the singular one, and without the limit an impulsively started flow emptied a near-wall cell in one stage.chemistry,chem_params%diffusion,chem_params%transport_model = 1,thermal_bc = 1,surface_reaction = 0, a circle or sphere, every body fixed, no AMR, andcfl_adap_dtorcfl_const_dt. Documentation incase.md; parameters registered indefinitions.pyanddescriptions.py. Default off.Evidence
Case: the cold cylinder of #2248 (
thermal_bc = 1,Twall= 300 K, R = 1 mm, quiescent 1500 K air, 11-species mechanism, diffusion on, reactions off, inviscid, closed box of half-width 3R), heat taken by the body per unit depth, the time integral ofib_heat_wrtcolumn 5, at t = 0.02 and 0.1 R^2/alpha (alpha of the 1500 K gas).Reference (independent of MFC). A separate 1D radial solver: variable-property low-Mach conduction about the cylinder,
rho c_p (T_t + u T_r) = (1/r)(r lambda T_r)_r + p_t,div u = (1/r)(r lambda T_r)_r/(rho c_p T) - p_t/(gamma p),u = 0at the wall and at the outer wall of an annulus of the box's gas area (this fixesp(t); p falls to 0.965 p0 at 0.02 and 0.920 p0 at 0.1), lambda(T) and c_p(T) from Cantera for the same composition, BDF in time on 312 stretched cells (unchanged to 3e-5 under doubling). Reference heat: 0.36600 J/m at 0.02, 0.82807 J/m at 0.1. Without the pressure fall the 1D value is 0.3725 (+1.8 %), so the box matters at that level. The 2D runs of #2248 at 128 cells/R (0.3611 master, 0.3641 branch) are within 1.3 % and 0.5 % of it. The 1D script, the cylinder case file and the table scripts are not part of the diff; I can add them if wanted.All 2D runs: A100, nvfortran 25.11, OpenACC, 1 rank, wall column off (this is #2248; the off column reproduces the values in its table) and on.
Heat the body books, t = 0.02 R^2/alpha (error against 0.3660 J/m):
t = 0.1 R^2/alpha (reference 0.8281 J/m):
With the column the booked heat is within 3.6 % of the reference from 6 cells/R up, and the error falls slowly from there; without it #2248 needs 64 cells/R to be within 3.6 %. The column overshoots by a nearly resolution-independent 1.4-3 % that I did not trace to a cause (the reference is not the limit: the off runs approach it from below).
What the gas gives up is a different number. The booked heat includes the guard's cut, heat the column takes from the wall side but the gas cells are not drained of. Without that term the body books what the gas faces carry, which is the gas's energy loss in this closed box. I measured that on the same case before adding the cut to the booking (same dynamics, only the booking differs; t = 0.02):
The gas-side error is smaller than #2248's at every resolution (it is about what #2248 reaches at twice the resolution: -8.5 % at 16 against -7.5 % at 32) but it is not monotone in resolution (n = 8 is worse than n = 6 and 12), so the part of the gain that reaches the gas field is modest and grid dependent. The gain is mainly in the wall heat that is reported (
ib_heat), which is what a Nusselt number or a heat-load diagnostic uses; the gas near the wall is still left somewhat too warm at coarse resolution. The column length does not matter: at 16 cells/R a 0.3 R column gives 0.3341 against 0.3348 for the default (gas side).Two ranks (the body straddles the rank boundary), 16 cells/R: the booked heat is the same as on one rank to all printed digits (0.37534 J/m, 1493 steps on both); at 32 cells/R two ranks give 0.37291 J/m in 2992 steps, the one-rank value. The two new tests at 60 x 60 cells on one and two ranks: the same step count (62 and 342) and the same booked heat to ten digits, with the columns of
ib_heat.datdiffering by at most 3e-10 relative.Cost (A100, 64 cells/R, 384 x 384, 1194-1218 steps, 3 repeats each):
ns/gp/eq/rhs1.772 / 1.772 / 1.775 off, 1.802 / 1.802 / 1.798 on (+1.6 %). That metric is the minimum stage time, which excludes the stage that advances the columns; the wall time per step is 12.8-13.0 ms off and 21.3 ms on (three repeats), +65 % at this grid size. The columns are advanced one ghost per thread, so the added time (about 8 ms per step) depends on the ghost count, not on the grid; it is a smaller fraction on a larger grid or one with fewer ghosts.Tests
After the rebase onto current master (b08da8d) and the column-ghost compaction (see Scaling): Cray CCE (ftn) CPU build with MPI, 1 rank, no GPU:
48CC6F65andDF9526DBpass against their committed goldens (generated on the A100, unchanged), so the compaction does not change the results../mfc.sh formatand./mfc.sh precheckpass. The A100 and MI300A results below were obtained before the rebase and before the compaction and were not rerun; the CI of this PR (GitHub GNU/Intel/macOS, NVHPC, Frontier CCE and AMD) and the Phoenix NVIDIA-GPU run (ci:phoenix) cover the rebased code../mfc.sh formatand./mfc.sh precheckpass. Before the rebase, labels run separately,--no-buildafter a dry-run build, A100 (nvhpc 25.11, OpenACC) and MI300A (amdflang, OpenMP offload):The IBM label does not contain the new tests (their names say "IBM Reacting Surface", not "IBM"); they carry the Chemistry label. The failure:
2FB9269F(IBM Inert Surface, Slip Wall), whose golden came in with IBM: opt-in isentropic ghost density and total-enthalpy tangential speed at slip walls (ib_slip_ccst) #2274 after IBM: wall conduction through the unbounded mirror temperature for chemistry walls #2248's goldens were regenerated. It fails identically (same values) on IBM: wall conduction through the unbounded mirror temperature for chemistry walls #2248's head without this commit, in IBM: wall conduction through the unbounded mirror temperature for chemistry walls #2248's own CI, so it is not an effect of this change (not rechecked on current master). (The five stale goldens of the earlier stack,8B2A7F3E,FAF04D7A,3F5FE078,F8D466BD,C02C399E, are regenerated in IBM: wall conduction through the unbounded mirror temperature for chemistry walls #2248 and pass here.)48CC6F65(Wall Column) andDF9526DB(Wall Column, Time-Step Limit withwall_column_dt_frac = 1e-3, which gives 150 steps against 21 for the default), both on the 2D reacting-surface example withsurface_reaction = 0andib_heat_wrt. Goldens generated on the A100 and checked on the MI300A: with the default tolerance the MI300A run failed by up to 4e-8 relative in the energy and 1e-7 absolute in a mole fraction, so both carryoverride_tol = 1e-6, with that justification incases.py. After that both pass on both vendors.Scaling
The column state is stored only for the first-layer ghosts of
wall_columnbodies (wc_gp(c)lists their indices intoghost_points; setup counts them once). A ghost of a body without the option holds nothing, and a run without the option allocates one-element arrays.ib_partsums that master'sib_heatuses (no single-address atomic).thermal_bc = 1, so moving or mixed-body clouds cannot use the column. A cloud of 1e5 fixed isothermal spheres can, and then pays the memory above.GPU notes
All new kernels follow the patterns in
gpuParallelization.md: element and component stores only (wc_T(k, i),wc_q(i),ghost_points(i)%T_cond), no whole-array stores intoghost_points; the 1D solve is aseqroutine on tabulated lambda(T) and c_p(T), and the thermochemistry calls (get_mixture_*) are made from the kernel bodies, not from aGPU_ROUTINE; private arrays are sized by constants andnum_speciesthrough the usual fypp bound; the time-step limit is aminreduction. Each thread holds a few kilobytes of private arrays.Limitations and not run
ib_flux_wall.thermal_bcother than 1, surface reactions, transport models other than mixture-averaged.ib_heatunder the option is the column's flux, which is not the energy the gas lost (table above, 4-20 % at the resolutions shown). Lumped walls (thermal_bc = 3) are excluded for that reason.This PR was made with Claude Code (AI).