Skip to content

feat: add 3D reacting mixing-layer example (H2/N2-air, Mach 1.5) + hcid=371 - #1758

Open
ecisneros8 wants to merge 13 commits into
MFlowCode:masterfrom
ecisneros8:flame-mixlyr-3D
Open

feat: add 3D reacting mixing-layer example (H2/N2-air, Mach 1.5) + hcid=371#1758
ecisneros8 wants to merge 13 commits into
MFlowCode:masterfrom
ecisneros8:flame-mixlyr-3D

Conversation

@ecisneros8

Copy link
Copy Markdown
Contributor

Description

Adds a new 3D temporally-evolving reacting mixing-layer example (H2/N2-air, convective
Mach 1.5) initialized from a 1D flamelet solve, plus a new hardcoded IC (hcid=371) that
extends hcid=370's 3D extrusion of a 2D profile with a closed-form spanwise (z)
modulation of the in-plane velocity perturbation, giving the IC genuine 3D content from
step 0 instead of staying z-invariant. Also registers hcid=371 in
case_validator.py's extrusion-hcid check and documents it in case.md.

Two unrelated NCSA DeltaAI cluster fixes are included: the batch template was using
mpirun, which is not the correct launcher on DeltaAI (srun is, matching
delta.mako's working pattern), and the dai-gpu module set never set
LD_LIBRARY_PATH for libnvToolsExt.so.1, which nvfortran's OpenACC/CUDA runtime
requires but the loaded cudatoolkit module doesn't provide.

Type of change (delete unused ones)

  • New feature
  • Bug fix

Testing

  • ./mfc.sh precheck -j 8 passes (formatting, spelling, toolchain/source lint, doc
    references, parameter docs, example case validation).
  • ./mfc.sh build -j 8 builds all three targets (pre_process, simulation,
    post_process) cleanly — hcid=371 lives in the shared
    src/common/include/3dHardcodedIC.fpp, included by both pre_process and
    simulation.
  • ./mfc.sh test -j 8: full suite passes (681 tests, plus the new
    3D -> Example -> reacting_mixing_layer golden generated and added in
    tests/2E1858B2/).
  • The new example itself was run on GPU for 165k+ steps with no numerical instability
    (not part of the regression suite at that step count — the golden covers the
    standard 50-step example smoke test). No CPU-vs-GPU comparison run was done.
    hcid=371 is only used via pre_process's icpp patches in this example (no
    immersed boundaries), so it hasn't been exercised through the IB patch path in
    src/simulation/m_ib_patches.fpp, which also includes this shared file.
  • The two DeltaAI fixes were validated on-cluster (correct srun batch submission and
    successful GPU binary launch after the LD_LIBRARY_PATH fix).

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

mpirun is not the correct MPI launcher on NCSA DeltaAI; srun (matching
delta.mako's working pattern) is required for batch submissions to succeed.
The dai-gpu module set never set LD_LIBRARY_PATH for libnvToolsExt.so.1,
which nvfortran's OpenACC/CUDA runtime links against but the loaded
cudatoolkit/25.5_12.9 module doesn't provide (only the SDK's bundled
CUDA 11.8 tree ships it), causing GPU binaries to fail to launch with a
missing shared library error.
…1.5)

New hcid=371 (3dHardcodedIC.fpp): extends hcid=370's 3D extrusion of a 2D
flamelet profile with a closed-form spanwise (z) modulation of the
in-plane velocity perturbation, so the IC has genuine 3D content from
step 0 without relying on mixlayer_perturb (whose fixed wavenumber range
is meaningless at this case's millimeter length scale).

New example examples/3D_reacting_mixing_layer/: a supersonic (Mach_c=1.5)
temporally-evolving H2/N2-air mixing layer initialized from a 1-D
flamelet solve (flamelet_ic.py), diluted to X_H2=0.5 (pure H2's high
sound speed otherwise forces an unphysically extreme velocity split to
reach Mach_c=1.5), with Unity-Lewis transport to match the flamelet
solve's own diffusivity assumption. Validated over 165k+ steps with no
numerical instability.
z_cc(p) - z_cc(0) is a per-rank quantity: s_mpi_decompose_computational_domain
overwrites p and z_domain with this rank's slab before the grid is built, so the
imposed wavenumber scaled with num_procs_z and the IC depended on the
decomposition. It also fell one cell short of L_z, leaving the modulation
discontinuous across the periodic z wrap even on one rank.

Use p_glb cells of the uniform cell width instead, and correct the comment and
case.md: only the cross-stream component is modulated, and the spanwise
component is set from it, not the full in-plane perturbation.
The 3D extrusion read only bounds-checked its row indices, so a file that is
merely too fine stays in range and silently supplies a corner of itself. Check
spacing and alignment up front, as hcid=274 already does for its full-field read.
perturb_xy defaulted seed=None, so np.random.default_rng drew from OS entropy.
IC/ is gitignored and regenerated on every checkout, which made the example
irreproducible run to run. Make the seed a required argument, set it in case.py,
and key the IC cache on it.

Also bin the phase blocks relative to x_coord[0] (binning the raw coordinate
clipped every x < 0 into block 0, leaving two of five blocks unused), write the
IC with savetxt rather than ~1.6M per-element writes, and record the mechanism's
provenance in sandiego.yaml.
The Example sweep caps 3D cases to 25^3 while case.py writes its IC at the
declared 210x560. Offsets rounded to zero, so the run read file rows 1-26 in x
and y: a pure-oxidizer sliver where the perturbation mollifier is identically
zero. Both hcid=371 statements then operated on zeros, and the golden covered
nothing.

Skip it in the Example sweep like the 2D siblings and register it under
Chemistry with --scale 0.05, which drives case.py's own grid so the IC matches.
The new golden carries nonzero spanwise momentum at step 0.
The literal 25.5 path breaks silently when dai-all's nvidia module bumps. Prefer
$NVHPC_ROOT, keep the validated path as the fallback, and drop the trailing
colon when LD_LIBRARY_PATH is empty.
Covers the stream conditions, grid, hcid=371's spanwise modulation, the seeded IC
and its cache, and the --scale/--hot flags.
web.eng.ucsd.edu serves an untrusted certificate, so lychee fails on the link the
3D_reacting_mixing_layer README cites. Same treatment as the HPE Cray docs entry.
@github-actions

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/common/include/ExtrusionHardcodedIC.fpp 170 +12
src/common/include/3dHardcodedIC.fpp 247 +7
Directory Lines Diff
common 9797 +19
total 45648 +19

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.25%. Comparing base (e2f0e26) to head (c9aef17).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1758      +/-   ##
==========================================
- Coverage   61.67%   60.25%   -1.43%     
==========================================
  Files          84       84              
  Lines       21619    21846     +227     
  Branches     3196     3218      +22     
==========================================
- Hits        13334    13163     -171     
- Misses       6093     6280     +187     
- Partials     2192     2403     +211     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants