Repository navigation
AMR: tag on vorticity, temperature or a species mass fraction - #2366
sbryngelson wants to merge 4 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.
|
Claude Code Review Head SHA: 2d8e3da Files changed:
Findings: Low-confidence nit, not a finding: |
# Conflicts: # src/simulation/m_amr_nest.fpp # src/simulation/m_amr_regrid.fpp
# Conflicts: # toolchain/mfc/test/cases.py
Lines of Code
|
|
Re-check after resolving the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2366 +/- ##
==========================================
+ Coverage 65.72% 65.80% +0.08%
==========================================
Files 111 111
Lines 30549 30712 +163
Branches 4673 4699 +26
==========================================
+ Hits 20079 20211 +132
+ Misses 6699 6696 -3
- Partials 3771 3805 +34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AI-assisted (Claude Code). Completes #2310. Part of #2247.
What
Three more values of
amr_tag_var:chemistry = T. Computed withget_temperature, the calls_compute_q_T_sfmakes; the common indicator is appliedamr_tag_species(new parameter, default 1)chemistry = Tandamr_tag_abs = T; the common indicator is appliedThe vorticity uses the velocity differences between a cell's two neighbours, weighted by
dx/dyanddx/dz, so it is the curl on cells that are not square. On a fine block the stencil is clamped to the block and the difference is divided by the index gap, so a block edge gets a one-sided derivative. Everything stays on the host, as the other tag variables are.Validator:
amr_tag_varin 1 to 7; 5 rejected in 1D; 6 and 7 need chemistry; 7 needsamr_tag_abs = Tandamr_tag_species >= 1.amr_tag_species <= num_speciesis a run-time check inm_checker.fpp, since the species count comes from the mechanism (as forinj_species).amr.md,case.mdand the parameter descriptions are updated.The default (
amr_tag_var = 1) is unchanged: no existing golden changes.Design choices to review
dx(the x cell size), not by a mean or minimum cell size, so the threshold has velocity units and halves per level for a resolved vortex.get_temperaturewith the energy assembled in place and the default Newton guess, rather than by refactorings_compute_q_T_sfinto a per-cell routine, which would have risked roundoff changes in existing goldens.How it was checked
Frontier, CPU:
AMR -> 2D -> tag vorticity(06E1CE23): a Gresho vortex of uniform density on a 64x32 base withdx != dy, two refined levels,amr_tag_eps = 0.05. The golden'sD/amr_levelsline has 5184 fine cells on level 1 (the initial block has 2048) and 2816 on level 2. A density tag cannot see this flow.|curl u| * dxis 0.158; level 0 tags the core at a threshold of 0.15 and nothing at 0.165. Without the aspect weighting the value would be 0.118. On level-1 data the core is tagged at 0.07 and not at 0.1 (expected 0.079).1D -> Chemistry -> Reactive Shocktube AMR -> Tag Temperature(08A73A90): the block starts at cells 4 to 11 and regrids onto the diaphragm at cell 24. Same example and mechanism as the existing reactive shocktube AMR tests, so no extra chemistry build.AMRgroup passes (117 tests) on a build made after the last edit;test_case_validator.pypasses (198), with the new assertions written first and seen to fail.Not checked
amr_tag_var = 7) has validator coverage only: no run, and the run-timeamr_tag_species > num_speciesabort was not exercised.