Repository navigation
Examples: gas-phase chemistry validation (ignition, flame speed, reactive shock tube) - #2374
Conversation
…hock tube reference check (WIP)
|
Hand test of
Checkers (GNU 13, CPU): see the numbers in the PR body and the validation page. |
|
Correction to the hand-test comment above: the "1e-7 already at 20 us, before ignition" figure came from the text output, which prints 14 decimals (an absolute resolution of 1e-14, i.e. 1e-7 relative for a species of 1e-7). It is not a real difference. Isolation on the A100 (same case, 100 saves; max over species of the difference from the GNU 13 CPU run, relative to each species' maximum):
The 25.5 GPU difference first appears in the radical species at about 14 to 30 us (the induction period) and grows to 1e-3 around ignition; it is independent of -Mfprelaxed, FMA contraction, -O level and the CUDA toolkit (12.9 vs 13.0 with 25.11), and absent on the 25.5 CPU build. So it comes from the 25.5 GPU code generation or runtime, not from those flags. The first species source vector was not compared (the output resolution hides a ulp-level difference). The test is expected to differ on NVHPC 25.5 (#2181); I am not loosening the tolerance to hide it. |
|
Claude Code Review Head SHA: cba6bb9 Files changed:
Findings:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2374 +/- ##
==========================================
+ Coverage 65.72% 66.14% +0.41%
==========================================
Files 111 112 +1
Lines 30549 31093 +544
Branches 4673 4749 +76
==========================================
+ Hits 20079 20567 +488
+ Misses 6699 6675 -24
- Partials 3771 3851 +80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contribution Policy
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Summary
Adds checks of the gas-phase chemistry against Cantera:
examples/1D_h2_air_ignition(constant-volume H2/air ignition, ignition delay, T(t) and UV equilibrium, split and in-stage reaction integrators),examples/1D_h2_air_flame_speed(1D premixed flame speed against a Cantera FreeFlame, GRCBC outflow) and a temperature comparison script plus reference table forexamples/1D_reactive_shocktube(thesis Fig. 4.9 of Martinez Ferrer 2013). Each has a checker script and README; the results are on a new pagedocs/documentation/validation_gas_chemistry.md. One test is registered (1D -> Chemistry -> H2-Air Ignition -> Split Reactions, UUID 009447E8).1D_h2_air_flame_speedis skipped from auto-registration (docs-only).1D_reactive_shocktube/case.pygains--t_save_usand--substeps; defaults are unchanged. Nosrc/change.Evidence
Measured on master (GNU 13, CPU, one rank, double): ignition tau error against Cantera +2.8e-6 / +1.1e-5 / +2.0e-5 at T0 = 1000 / 1100 / 1200 K (dt = 1e-8 s), max |dT| 0.29 K, T_end - T_eq +0.06 K; second order in dt (1.13 K at 2e-8, 6.46 K at 5e-8); in-stage integrator at 5e-10 s agrees to 2e-11. Flame speed S_c error -0.76 % (40 um) and -0.21 % (20 um). Shock tube at 401 / 801 cells: leading shock 43.16 / 43.25 mm at 170 us (reference 43.25), L1 temperature difference 1.0 / 2.5 / 4.2 % at 170 / 190 / 230 us, burnt gas about 100 K hotter (different mechanism from the reference, verified in 0D on a pre-merge build only). These match the earlier pre-merge measurements. Golden: GNU 13 CPU; NVIDIA A100 with NVHPC 25.11 agrees to 2e-12 relative; NVHPC 25.5 differs by up to 1e-3 in minor species (see issue #2181); the new test is skipped on NVHPC < 25.11 GPU builds (UUID 009447E8 added to
NVHPC_GPU_KNOWN_DIFFERENCE_UUIDS); CPU builds run it. The 25.5 difference needs -O1 or higher on the GPU path, is not understood, and is isolated in the #2181 comment; the tolerance is not loosened to hide it. The hand-test comment follows.Scope
Not included: the second (11-species CO) mechanism, the thesis velocity, gamma and Y_H comparisons, a registered flame or shock-tube test (too long), figures. The 10 and 5 um flame rows are quoted from an earlier build and labeled so. Open: single-precision and CI-lane behavior of the new test (golden tolerance set from the CI spread after the first run).
Test plan
./mfc.sh test --only 009447E8; checkers as in the page's Reproduce section.Related issues: #2399, #2403
This PR was made with Claude Code (AI).