Skip to content

Forward-facing step: a three-realm forest on quadtrees ​

IDGroupMilestoneTypeBackendsFigureRegression
EV-stepEuler#46, #66 (follow-up)P+CCPU, FNL (trees leg); CPU only (full leg)yes—

Case and scope ​

The Mach 3 wind tunnel with a step of Woodward & Colella (1984, J. Comput. Phys. 54, 115–173, §IV b): the gas enters from the left at Mach 3, hits a step of height 0.2, and forms a bow shock, a Mach reflection off the top wall and a re-reflection down the tunnel. The tunnel is L-shaped, so FLUME builds it as three rectangular realms glued by two 1:1 mirror seams, and the step is body-fitted: its two faces are physical walls of the realms, with no immersed boundary.

 y = 1   +--------+-----------------------------+   wall
         |   B    |              C              |
  inflow |        | seam                        | outflow
 y = 0.2 +--------+   +------ wall (step top) --+
         |   A    | wall (step front)
 y = 0   +--------+
       x = 0    x = 0.6                       x = 3

The case puts together inter-realm mirror seams (two, on different axes, misaligned), intra-realm quadtree 2:1 seams (refined boxes off the inter-realm seams) and the walls, inflow and outflow of a supersonic tunnel. What it catches:

  • a quadtree that differs from the octree (#46): the same forest on quadtrees (nk = 1) and on octrees with a null z axis must agree column by column to round-off;
  • a z dependence in a 2-D flow: every run must be z-invariant;
  • loss of positivity at the seams, the corner and the reflected shocks;
  • seam defects that show as structure in the quadtree–octree difference map at the inter-realm or 2:1 seams.

The refinement is static

The boxes are placed by hand on the features of the reference solution at t=4, and the grid is frozen after initialisation: FLUME had no runtime AMR when this case was written (milestone M5). A solution-driven marker could not place them either, since the tunnel starts uniform. The boxes therefore follow the flow only once it has settled, and the case verifies the seam machinery, not adaptivity.

The realms of a forest regrid at runtime (#110), but this forest's seams are mirror seams between blocks that do not line up, and a mirror seam keeps one level per seam side. A coupling = auto seam varies its levels face by face but needs the same block cell counts along the seam, which these blocks (A 24 cells along x, B 6) do not have. The refinement of this layout therefore stays static; the aligned layout below lines the blocks up and refines at runtime.

Models and numerics ​

ItemChoiceCode
Equationscompressible Euler, ideal gas, γ=cp/cv=3.5/2.5=1.4models
SpaceWENO5 (weno-u-5) flux splitting on characteristic variables; no positivity limiter (refused on multi-realm runs)compute_residuals_weno, adam_flume_cpu_object.F90
TimeSSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.5adam_stepper_object.F90 (SELAH)
Forestthree realms, two 1:1 mirror seams (A–B at y=0.2, B–C at x=0.6), β cadence, misaligned seam blocks (#51)populate_inter_realm_topology, build_seam_rows, adam_forest_object.F90; numerics
AMRone more level on a static box per realm (geometric box marker, block centroids), quadtree ratio = 4, reflux onmark_by_geometry, adam_flume_common_object.F90; numerics
Thin-block guardblocks thinner than 2ngc along a refined, non-null axis refused (#66)check_amr_block_cells, adam_realm_object.F90
Boundariesinflow, extrapolation (outflow), inviscid walls; realm edges compose the conditions of their facesset_boundary_conditions, adam_flume_cpu_object.F90; realm_edge_face, realm_edge_donor, adam_flume_bc_object.F90; boundary conditions
Corneruntreated (Woodward and Colella reset the entropy near it)—

Initial and boundary conditions ​

RealmExtentFaces
A[0,0.6]×[0,0.2]inflow, wall (bottom), wall (step front), seam with B (top)
B[0,0.6]×[0.2,1]inflow, seam with A (bottom), seam with C (right), wall (top)
C[0.6,3]×[0.2,1]seam with B (left), wall (step top), wall (top), outflow (extrapolation)

The realms share the base cell 1/N. B and C have N/10 blocks per axis, narrow enough to refine close to the seams; A has N/40, so that its blocks keep 8 cells along y: a refined block needs at least 2ngc=6 cells along every active axis.

Itemtrees legfull leg
Base cell1/401/80 (the coarse grid of Woodward and Colella)
Blocks, quadtreeA: 1 block of 24×8; B: 4×4 of 6×8; C: 4×4 of 24×8A: 2×2 of 24×8; B: 8×8 of 6×8; C: 8×8 of 24×8
Treesquadtree (nk = 1) and octree with a null z axis (nk = 4, 16 in A)quadtree
Refined boxes (one level, block centroids)A: none (its single block touches its seam); B: x∈[0.3,0.45], y∈[0.4,0.8]; C: x≥1.2A: y≤0.1; B: x∈[0.3,0.525], y∈[0.3,0.7]; C: x≥0.9 (cells 1/160)
Initial statethe inflow state everywhere: (ρ,u,v,p)=(1.4,3,0,1) (sound speed 1, Mach 3)the same
Final timet=0.5 (440 steps)t=4 (7545 steps); plus the uniform 1/80 control (no box)
Ranks22

The boxes of the full leg, at N=80:

  • A, y≤0.1: the bow shock standing on the lower wall.
  • B, x∈[0.3,0.525], y∈[0.3,0.7]: the bow shock bending up towards the Mach stem. The column x>0.525 touches the B–C seam.
  • C, x≥0.9: all of the realm except the block column on the seam. That covers the reflected shock reaching the step top, the slip line and the re-reflection off the top wall.

A refined block may not touch an inter-realm seam (C's seam is only its face x=0.6; its face y=0.2 is the step top, a wall). The strongest features, the Mach stem and the triple point at x≈0.6, therefore sit on the B–C seam and stay on the base grid. Refining across that seam would take the 2:1 inter-realm coupling (coupling = refined, #52), available on quadtrees too since #71 but not used by this case.

Input files ​

FileRole
src/tests/flume/verification/step/make_step.py <dir> --tree quad|oct --cells N --refine --time-max Twrites the manifest step.ini and the realms step-A.ini, step-B.ini, step-C.ini
src/tests/flume/verification/step/make_step.py <dir> --layout aligned [--dims 2|3] [--m M] [--nk NK] [--weno 5|7|9] [--base-level LB] [--max-level LF] [--runtime]the aligned forest (blocks lined up, coupling = auto), optionally runtime AMR and 3-D
src/tests/flume/verification/step/check.sh--legs trees (default), aligned and full; --keep keeps the checkpoints for the figures; checks positivity of every run
src/tests/flume/verification/mhd/quadtree/quadtree_oracle.pythe z invariance and the quadtree against the octree per (x,y) column, momentum scaled as one vector
src/tests/flume/verification/make_doc_figures.py (fig_step, fig_step_trees)the figures, from the kept work directories of step/
bash
cd src/tests/flume/verification/step && ./check.sh                    # trees leg, CPU (about 10 min)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh           # trees leg, FNL
./check.sh --legs trees,full --keep                                   # both legs, checkpoints kept
python3 ../make_doc_figures.py --out ../../../../../docs/public/flume --only step step-trees

Results ​

Step forest at t = 0.5 on quadtrees and octrees

trees leg, t=0.5, base 1/40: density on the quadtree and on the octree with the blocks outlined, and the quadtree–octree difference per (x,y) column.

trees legBoundOctree, null z (CPU / FNL)Quadtree, nk = 1 (CPU / FNL)
z spread of a column10−106.1⋅10−13 / 3.1⋅10−130 / 0
against the octree, per (x,y) column10−10—6.5⋅10−13 / 2.7⋅10−13
min ρ, min ppositive, finite0.469, 0.715 (both)0.469, 0.715 (both)

Woodward-Colella step at t = 4

full leg, t=4: density with the blocks outlined (static boxes, inter-realm seams dashed), Mach number, and the zoom on the Mach stem and C's 2:1 seam at x=0.9, refined run against the uniform 1/80 control.

full leg (CPU)BoundResult
min ρ, min p, refined runpositive, finite0.344, 0.370
uniform controlpositive, finitepass

The picture has the features of the reference of Woodward and Colella:

  • the bow shock standing at x≈0.3 on the lower wall;
  • its Mach reflection off the top wall at x≈0.6, with the triple point near (0.6,0.78) and the slip line leaving it along y≈0.8;
  • the reflected shock striking the step top at x≈1.2 in a Mach reflection;
  • its re-reflection reaching the top wall at x≈2.4.

Related cases: Multi-realm runs (the seam legs on Sod), Quadtree AMR (the quadtree on MHD), Ghost probe (the step forest's edge ghosts).

The aligned forest: runtime AMR and 3-D ​

Issue #133 (leg 1 of the speedup matrix) and the paper figure of #142 need the step refined at runtime, and in 3-D. make_step.py --layout aligned writes the same three realms with their blocks lined up across both seams, so that the seams can be coupling = auto seams, along which the runtime grid refines and coarsens face by face (one level per seam side, equal across). auto needs the same block cell counts along a seam; with one root block per realm and square cells the block shapes follow from the realms' aspect ratios:

RealmExtentBlock cellsAt level L
A[0,0.6]×[0,0.2]3m×mh=0.2/(m2L) in every realm
B[0,0.6]×[0.2,1]3m×4mA–B seam: 3m cells along x on both sides
C[0.6,3]×[0.2,1]12m×4mB–C seam: 4m cells along y on both sides

--m 16 by default: level 1 is h=1/160, level 4 h=1/1280, the spacings of the speedup matrix. A refined axis needs an even count of at least 2ngc cells (#66), so m≥10 at WENO-9 (ngc=5). --dims 3 extrudes the tunnel in z on octrees: --nk cells per block (10 by default), extent Lz=0.2nk/m (0.125 at the defaults, cubic cells), reflecting walls on the z faces. The extruded step is z-invariant: the 3-D case adds cost and the 3-D machinery (octree seams, 3-D regrids), not physics. Runtime AMR (--runtime): a Löhner marker on the density (refine 0.3, derefine 0.1, buffer ngc−1), every 10 steps, from --base-level to --max-level. The legacy layout above is unchanged (same inputs, byte for byte).

The aligned leg of check.sh runs both trees briefly (2-D quadtree, m=16, levels 1–2, to t=0.2; 3-D octree with the smallest blocks WENO-7 allows, m=nk=8, levels 0–1, to t=0.1), both at WENO-7 with runtime AMR: the grid must change across the auto seams, and density and pressure must stay positive and finite.

WENO-9 does not reach t=4; WENO-7 does (the feasibility gate 4.1 of #133). On the aligned forest at the uniform spacing h=1/160 (2-D, CPU, 4 ranks), WENO-9 produced a non-finite density at t=3.62 (step 7119) at (0.616,0.203), in the expansion just behind the step corner, where the density drops towards vacuum; the positivity limiter that would bound it is refused on multi-realm runs. WENO-7 at the same spacing runs to t=4 (7826 steps) with every value finite. The speedup matrix's leg 1 therefore runs WENO-7 (medooza, develop 0bcdf870, gfortran 16.2, 2026-11-22, Slurm jobs 1369311 and 1369318).

The 3-D step at t = 4 on runtime AMR

The 3-D step at t=4, WENO-7, the three-realm aligned forest on octrees with runtime AMR from level 0 to level 2 (h=1/80 to 1/320), 20304 steps: the density with the blocks outlined and the numerical schlieren log10⁡|∇ρ| on the cell layer just above the mid plane z=Lz/2.

Measured: ADAM 0bcdf870 + the night-2026-11-22 tree (the paper commit, tag pending), FNL nvfortran 26.9, CUDA 12.9 (iac_nvf) on 4 NVIDIA A30, 2026-11-22 to 2026-11-23 (make_step.py <dir> --layout aligned --dims 3 --weno 7 --base-level 0 --max-level 2 --runtime --time-max 4.0, job 1369369).

Findings ​

  • The trees order the restriction sums differently (8 fine cells over two identical z layers, against 4), so they agree to round-off, not bit for bit; the octree is z-invariant to round-off only, its tricubic seam weights depending on the z sub-position. The difference map carries no structure at the seams, inter-realm or 2:1.
  • The trees leg takes about 10 min on the CPU, 9 of them for the octree (its blocks split along z too). The full leg is not default: about 41 min on the CPU, plus 13 min for the uniform control.
  • The low-Mach layer along the step top is the numerical boundary layer of the untreated corner, the artifact Woodward and Colella remove with their entropy fix.
  • The zoom compares the refined run with the uniform 1/80 run. The Mach stem and the triple point sit on the B–C seam, on the base grid in both runs, and agree. C's 2:1 seam at x=0.9 is crossed by the reflected shock and the slip line without a kink. Downstream of it, the box resolves the shock pattern near the step top (x≈1.2) more sharply than the uniform grid, which smears it into a single blob.
  • Blocks thinner than 2ngc along a refined axis are refused (#66, check_amr_block_cells). The coarse ghost layers beside a finer block are restricted from 2ngc fine cells; a thinner block would restrict its outer layer from its own ghost cells, which the same exchange is still filling, and the result would depend on the exchange order (rank count). A's blocks keep 8 cells along y for this reason.