Repository navigation
Examples: 1D reacting shock tube with AMR following the front on temperature - #2385
Draft
sbryngelson wants to merge 6 commits into
Draft
sbryngelson wants to merge 6 commits into
sbryngelson wants to merge 6 commits into
Conversation
The tag sweep called the indicator per cell, which evaluated the tagged variable at the cell and its neighbours through function calls: seven evaluations per cell in 3D. Evaluate it once per cell into a local array and difference that. Same tags.
amr_tag_var = 5 tags where the vorticity magnitude times the cell size exceeds amr_tag_eps (central velocity differences, one-sided at a clamped block edge); 6 tags on the temperature and 7 on the mass fraction of species amr_tag_species (chemistry). Tests: a Gresho vortex of uniform density tracked on two levels, and the reactive shocktube regridded onto its temperature jump.
# Conflicts: # src/simulation/m_amr_nest.fpp # src/simulation/m_amr_regrid.fpp
# Conflicts: # toolchain/mfc/test/cases.py
…ng front tagged on temperature The reactive shock tube with one 2:1 level regridded every 20 steps on amr_tag_var = 6. Against a uniform grid at the fine resolution at 155 us: reflected shock 0.06 mm and reacting front 0.10 mm apart (fine cell 0.15 mm), peak temperature 2291 K against 2278 K (wall strip, coarse under AMR). Skipped by the Example suite like the other AMR examples; listed in amr.md.
Lines of Code
|
|
Claude Code Review Head SHA: a38ea46 Files changed:
Findings: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI-assisted (Claude Code). For #2313. Part of #2247.
Stacked on #2366 (temperature tagging): until that merges, this PR's diff contains it too. Review the commit "Add examples/1D_amr_reactive_shocktube".
What
A new example,
examples/1D_amr_reactive_shocktube: the existing1D_reactive_shocktube(H2/O2/Ar,h2o2.yaml) with one 2:1 AMR level that regrids on temperature (amr_tag_var = 6). An incident shock reflects off the wall at x = 0, the gas behind the reflected shock ignites at about 125 µs, and a reacting front follows the shock into the tube. The refined blocks track the incident shock, then the reflected shock, then the ignition region and the front.--no-amrruns the same case on a uniform grid at the fine resolution.amr.mdlists it with the other complete AMR cases.It is a reacting shock tube rather than a flame: it uses a mechanism and case MFC already has. At the final time the front moves at about 800 to 900 m/s, short of a detonation.
How it was checked
Frontier CPU, one rank. Level-1 blocks (coarse cells) from the restart files:
Against the uniform 800-cell run at 155 µs:
The example is skipped in the test suite with the other AMR examples (the test grid cap cannot hold a block, and it runs 25k steps);
1D -> Chemistry -> Reactive Shocktube AMR -> Tag Temperaturefrom #2366 tests the same case../mfc.sh precheckpasses; theAMRgroup passes (119 tests).Limitation found
The example stops at 155 µs, not the original example's 230 µs. AMR does not allow reaction sub-stepping (
chem_params%reaction_substepsmust be 0), and without sub-stepping this flow goes to NaN at about 170 µs, with or without AMR (uniform fine grid alike) and almost regardless ofdt(0.02, 0.01, 0.005 of the fine-cell crossing time: 170, 172, 184 µs). Withreaction_substeps = 4the uniform case runs to 230 µs. So the limit is the explicit reaction source, which AMR inherits because it cannot sub-step. The case file says so.Not checked
Multi-rank, GPU and case-optimized runs of the example; what triggers the failure near 170 µs; comparison with published profiles.