Appearance
3. A blast on a static AMR grid
A 2-D blast on a grid with a refined patch: the AMR keys, what the refined grid looks like in the output, and the check that matters across 2:1 faces, conservation.
The case
src/tests/flume/regression/blast-amr-limiter/input.ini is the Balsara–Spicer magnetised blast:
The AMR keys
(Excerpt: the committed input also sets the marker's delta_type, delta_fine, delta_coarse, box_zmin and box_zmax, which the parser requires.)
ini
[grid]
ni = 16
nj = 16
nk = 4 ; z is a null axis (null_z = .true.)
[amr]
max_level = 3
ratio = 8 ; octree
iu_ref_levels = 2 ; two uniform levels: 64 blocks, 64 x 64 cells
markers_number = 1 ; one marker refines further
frequency = 0 ; no runtime regridding
[amr_marker_1]
mode = 1 ; geometric marker
geo_type = primitive-box
box_xmin = 0.55
box_ymin = 0.55
box_xmax = 0.7
box_ymax = 0.7
target_level = 3 ; refine the blocks in the box up to level 3
[initial_conditions]
amr_iterations = 1 ; set the IC, refine, set the IC again on the new gridA block is refined when its centroid lies in the box; the box selects the base block 2 ngc (AMR cookbook).
Run it
bash
mpirun -np 2 ../../exe/adam_flume_cpu input.ini > log.txtThe case stops after it_max = 100 steps, at
In ParaView, colour by r and switch the representation to Surface With Edges: the refined patch shows as blocks of half the cell size.
The check: conservation across the 2:1 faces
blast-amr-limiter-conservation_history.dat, first and last rows, the mass column:
txt
VARIABLES="it" "time" "int_r" ...
0 0.0000000000000000E+000 1.0000000000000000E+000
100 2.4718421224877865E-003 1.0000000000000000E+000On a periodic box the mass is conserved exactly by the scheme, and it is here to the last printed digit although the blast crosses the 2:1 faces: at the end of each step the reflux replaces the coarse face flux with the sum of the fine ones, so both sides exchange the same flux. The AMR conservation page checks the same property on a dedicated case, and the positivity limiter page (PV-5) runs the same blast to
What you learned
- Static refinement is
max_level, a marker section andamr_iterations;frequency = 0keeps the grid fixed. - The output holds every block at its own spacing; counting blocks and spacings is the quickest check of the grid.
- Across 2:1 faces the reflux keeps the scheme conservative; the conservation history shows it.
Previous: 2. Lax. Next: 4. The positivity limiter.