Skip to content

Accuracy across 2:1 seams ​

IDGroupMilestoneBackendsFigureRegression
VV-8Dissipative terms (M4)M4 (#65)CPU, FNLyes—

Case and scope ​

The diagonal shear wave of VV-1 and the diagonal Ohmic wave of VV-5 on a quadtree with its centre refined 2:1, against the exact linear solution.

What the case catches: conservation says nothing about accuracy, and a seam can conserve (VV-7) and still degrade the order. The case measures the order of the composite grid, and, with the reflux off, whether the dissipative flux crossing the seam is the one the register replaces.

Models and numerics ​

ItemChoiceCode
EquationsEuler with μ=0.01 (shear); MHD without divergence control (mhd-none) with η=0.01, μ=0 (Ohmic); γ=1.4models, ideal MHD
Dissipative fluxesdissipative_order = 4add_dissipative_fluxes_o4, add_resistive_fluxes_o4, adam_flume_cpu_dissipation_kernels.F90; numerics
Inviscid fluxesWENO5 flux splitting, characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90
Timerunge-kutta-ssp-54, CFL 0.2adam_rk_object.F90
Coarse ghostsmean restriction (a coarse ghost is the mean of the fine point values under it)boundary conditions
Fine ghoststhe tricubic coarse-to-fine fillboundary conditions
RefluxBerger–Colella reflux of point-value fluxes; off on the negative controlaccumulate_seam_fluxes, reflux_stage, adam_flume_cpu_object.F90; adam_flux_register_object.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Gridquadtree, 4×4 blocks of (N0/4)2 cells, N0 = 24 / 48 / 96 at the base level; the blocks whose centroid lies in [0.25,0.75]2 refined 2:1 (48 / 96 / 192 in the refined box)
Ranks2
Initial conditionsine-wave at 45°: shear mode, A=10−4; magnetic mode, A=10−5; ρ0=p0=1, wavelength 1/2
Boundariesperiodic on the x and y faces, extrapolation on the z faces
Final timet=0.1
Error measureRMS against the exact linear solution, weighted by the cell area

Input files ​

FileRole
src/tests/flume/verification/viscous/waves.pymake --refine 0.25 0.25 0.75 0.75 --ratio 4 [--reflux false] writes each input; oracle judges the ladder
src/tests/flume/verification/viscous/check.sh --legs vv8runs the three ladders (--np N; FLUME_EXE selects the backend)
make_doc_figures.py (fig_viscous_fields)the figure, from the CPU work directories of viscous/check.sh
bash
cd src/tests/flume/verification/viscous && ./check.sh --legs vv8             # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --legs vv8       # FNL

Results ​

VV-1 and VV-8 in 2-D: the shear wave and its error on a uniform grid; the shear and Ohmic errors with the centre refined 2:1

Top: the diagonal shear wave and its pointwise error on the uniform 962 grid; bottom: the shear and Ohmic errors on the 482 grid with its centre refined 2:1 (962 cells in the box).

Oracle: order ≥1.8 on the finest pair; the Ohmic ladder without reflux, the negative control, ≤1.3.

LegN (finest)RMS errorOrder
shear, μ48 / 96 / 1924.26⋅10−8 / 1.09⋅10−8 / 2.78⋅10−9+1.96, +1.98
shear, μ=0 (probe)48 / 96 / 1925.39⋅10−8 / 1.36⋅10−8 / 3.42⋅10−9+1.99, +1.99
Ohmic, η48 / 96 / 1921.15⋅10−9 / 2.94⋅10−10 / 8.12⋅10−11+1.97, +1.86
Ohmic, η=0 (probe)48 / 967.9⋅10−15 / 2.6⋅10−15round-off
Ohmic, no reflux48 / 96 / 1922.37⋅10−9 / 1.18⋅10−9 / 5.82⋅10−10+1.00, +1.02

CPU and FNL identical (2 ranks). The rows without coefficients are probes, not legs of check.sh.

Related cases: conservation across the same seams is VV-7; the inviscid order across static 2:1 seams, measured and then lifted in M6, is order across seams.

Findings ​

  • The composite grid is second order, against fourth on a uniform grid. The rows without coefficients say where that comes from. The shear wave is second order without viscosity too: its seam error is the inviscid one. With the mean restriction and the Berger–Colella reflux of point-value fluxes (a conservative but O(H2)-inconsistent coarse flux), the composite error is second order (issue #68 F1: each of the two caps the order at 2 on its own; the #21 bound on restriction-compatible prolongations does not apply to the tricubic fill).
  • A static field has no inviscid flux at first order, so the Ohmic composite at η=0 stays at round-off, and the Ohmic composite error is the dissipative flux crossing the seam: second order with reflux, first without (the gradient of mean-restricted ghosts is an O(1) error, which the reflux replaces by the fine flux).
  • The plan in #65 asked for the seam error "within a stated factor of the uniform fine run"; between a second-order seam and a fourth-order interior that factor grows with N, so the leg asserts the order instead.
  • The error maps show where the seam error lives. On the uniform grid the error of the shear wave is smooth and spread over the domain, near 10−13. On the refined grid the Ohmic error is a ring on the 2:1 faces, two orders above the rest of the domain: the dissipative flux at the face. The shear error fills the refined box and its surroundings instead, being the inviscid seam error that the flow carries and the viscosity spreads.