Skip to content

Integral drift and the WENO sensor near seams ​

IDGroupMilestoneBackendsFigureRegression
AL (A4)Seam accuracy and divergenceM6 (#68)CPU, FNL (the two backends log the same values)yes—

Case and scope ​

The reflux policy of Phase E (reflux_policy = troubled) turns the reflux off at the seam faces that a WENO sensor judges smooth. Two quantities decide whether that is safe and where its threshold sits, and no check logged either:

  • how the conserved integrals drift when the reflux is off (bounded, or accumulating?);
  • what the sensor reads on the seam faces of a smooth flow (false positives) and of a shock crossing (detections).

AL logs both on two legs, each run with the reflux on and off. It asserts only the conservation of the reflux; the rest is a log.

What the case catches:

  • a reflux that stops conserving: with the reflux on, every logged integral must drift at most 10−13.

Models and numerics ​

ItemChoiceCode
Equationscompressible Euler, ideal gas, γ=1.4models
SpaceWENO5 (weno-u-5) flux splitting on characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90
Timevortex: SSP Runge–Kutta 5 stages (runge-kutta-ssp-54), CFL 0.4; sod: SSP Runge–Kutta 3 stages (runge-kutta-ssp-33), CFL 0.5adam_rk_object.F90
Seam operatorsmean restriction, tricubic fillnumerics
RefluxBerger–Colella on, or off (--no-reflux, a measurement, not a supported configuration)apply_reflux_to_stage_forest, adam_flume_cpu_object.F90
Conservation history[diagnostics] conservation_history_savecompute_conservation, adam_flume_cpu_object.F90
Sensor (post-processing)r=minkwk/dk of the WENO-5 weights of adam_weno_object (Jiang–Shu, ϵ=10−6, exponent 3), the weno-riemann sensor of #47, threshold τ=0.2amr_log.py; adam_weno_object.F90; FLUX_CORRECTION_SENSOR_TAU, adam_flume_parameters.F90
Boundariesvortex: periodic in x, y; sod: extrapolationboundary conditions

Initial and boundary conditions ​

LegSetupConserved integrals logged
vortexthe AO Euler vortex: quadtree, quadrant [0.5,1]2 refined, N=64, periodic, run to t=1, one period of the free stream (1,1), so the vortex crosses every seamρ, ρu, ρv, E (every integral is conserved)
sodthe AS Sod c2f: octree, x>0.75 refined, N=200, t=0.2; the shock crosses the 2:1 face at t=0.143ρ, E (no flux through the ends before t=0.2)

Both legs run with the reflux on and off, a checkpoint every 10 steps, 2 ranks.

Input files ​

FileRole
src/tests/flume/verification/amr-order/make_amr_order.pythe vortex inputs (--cells 64 --time-max 1.0 --it-save 10 [--no-reflux])
src/tests/flume/verification/amr-shock/make_amr_shock.pythe sod inputs (--cells 200 --side c2f --it-save 10 [--no-reflux])
src/tests/flume/verification/amr-log/amr_log.pydrift and sensor logs
src/tests/flume/verification/make_doc_figures.py --only integral-driftthe figure, from the kept work directories of amr-log/check.sh (CPU)
src/tests/flume/verification/amr-log/check.shruns the legs (--legs vortex,sod, --np N, --reflux-policy always|troubled, --keep)
bash
cd src/tests/flume/verification/amr-log && ./check.sh             # CPU: about 11 min
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh       # FNL: about 5 min

Logs (amr_log.py):

  • drift: the relative drift (I(t)−I(0))/|I(0)| of the integrals of the conservation history, its maximum, and its growth (the mean |drift| over the last quarter of the run over that of the second quarter: about 1 when bounded, 7/3 for a linear drift; "a jump" when the second quarter holds less than 1 % of the maximum, as before a shock first crosses a face);
  • sensor: on every checkpoint, r=minkwk/dk of every face along every non-null axis, the minimum over ρ, un, p (primitive variables) and over the two reconstructions beside the face, recomputed from the checkpoints, whose ghosts are filled right before the save as the stencils read them. Per region (the seam band, the faces within ngc of their own spacing from the 2:1 faces; the interior): the minimum r and the fraction of faces below τ=0.2.

The default scheme weights its characteristic split fluxes, so the map is the sensor a seam policy would read, not a dump of the scheme's own weights.

Results ​

AL: the integrals across static seams

CPU, from the work directories amr-log/check.sh --keep and --reflux-policy troubled --keep leave: the relative drift of mass and energy per step. The reflux keeps both at round-off; without it the vortex drifts to 2⋅10−5 and the Sod crossing to 2⋅10−4; under troubled the smooth vortex drifts as without reflux, so the sensor leaves its seam faces unrefluxed, the Sod crossing only to 2⋅10−7 (the shock faces are flagged).

Drift (2 ranks):

LegBound, reflux onReflux on: max driftReflux off: max drift (mass, energy)Reflux off: growth
vortex10−13≤4.5⋅10−162.2⋅10−5, 2.5⋅10−5 (momentum 3.9, 2.7⋅10−5)1.4 to 7.7
sod10−13≤3.3⋅10−161.2⋅10−4, 2.4⋅10−4a jump at the crossing

Sensor, faces with r<τ:

LegSeam band: largest (mean) fractionInterior: largest (mean) fraction
vortex0.110 (0.053)0.051 (0.020)
sod1.000 (0.172)0.128 (0.078)

Related cases: E2 builds the troubled policy on these logs; B2 is its scalar prototype; the reflux conservation on uniform-level seams is conservation across AMR seams.

Findings ​

  • Without the reflux, a smooth flow's drift accumulates. Every seam crossing adds to it: by one period the vortex has lost about 2⋅10−5 of its mass and energy, and the growth (1.4 to 7.7) says the drift is not bounded. A shock adds 10−4 in one crossing. The reflux keeps both at round-off.
  • The sensor detects the crossing shock. In the Sod run the seam band reads r=1 until the shock reaches it, 67 to 100 % of its faces are below τ while the shock crosses (t=0.126 to 0.152), and 0 to 13 % after, where the A3 defect sits.
  • It also flags smooth seam faces. On the vortex, up to 11 % of the band faces (mean 5 %) read r<τ, 2.6 times the interior's mean fraction: the JS weights drop at the extrema of a smooth profile, and more so where the seam's second-order error adds kinks. For reflux_policy = troubled a false positive keeps the reflux, the conservative choice: the cost is the order on those faces, which Phase B2 measures. The threshold is not tuned here.