Skip to content

FV reflux on a capped last step ​

CasesIssuesTypeBackendsFigureRegression
rmf-amr-fv-pulse-timed#38PCPU, FNLno—

Case and scope ​

On a time-driven run (it_max <= 0) PRISM caps its last step so that it lands on time_max. The Berger–Colella reflux correction must be scaled by that capped step, the one the update used. Before 4c1dd1a0 it was scaled by the forest's uncapped Δt, and the coarse–fine faces were not conservative on the last step.

With J=0 the finite-volume update with reflux keeps the domain integrals of D and B constant, up to the fluxes through the domain boundary. The case measures that conservation step by step.

What the case catches: a reflux correction scaled by any step other than the one the update used, as a jump of ∫Dz on the capped step. ∫Bx cannot see the defect: Bx has no x-flux, so the reflux at the x-normal seams never touches it. ∫Dz (its x-flux is Hy) can.

Models and numerics ​

ItemChoiceCode
EquationsMaxwell, SI, no sourcemodels
Spacecentred finite volumes of order 6 (fv_centered)numerics
TimeSSP Runge–Kutta (5,4), CFL 0.5, time-driven (it_max = -1): Δt=CFLΔxmin/(2c)=1.5635⋅10−12 s, time_max =4.5Δtnumerics
Refluxcorrection scaled by the step of the updateapply_reflux_corrections, adam_forest_object.F90; apply_reflux_to_stage_forest, adam_prism_cpu_object.F90

Initial and boundary conditions ​

ItemValue
Domainx,z∈[−0.06,0.06], y∈[−0.12,0.12] m
Grid64 blocks of 8×16×8 at level 2 (4 per axis, cubic cells, Δx=3.75⋅10−3); the band x∈[−0.03,0.03] refined to level 3: two 2:1 planes, both x boundaries coarse; ngc = 3
Initial conditionGaussian pulse along +y, transverse to the seams, sigma = 0.01, B0 = 10
BoundariesNeumann on all six faces
Steps4 full steps and one of half a step (time_max = 7.0361171362237545e-12 s); a checkpoint every step
Ranks2 (--np N)

The y extent is twice that of rmf-amr-fd-pulse, 12σ on each side: with the narrower box the Gaussian tails leak through the y faces and even the grid without seams drifts by 10−8 per step.

Input files ​

FileRole
src/tests/prism/regression/rmf-amr-fv-pulse-timed/input.inithe case
src/tests/prism/regression/rmf-amr-fv-pulse-timed/check.shruns it and integrates D and B over every checkpoint (--np N; PRISM_EXE)
bash
cd src/tests/prism/regression/rmf-amr-fv-pulse-timed && ./check.sh
PRISM_EXE=$PWD/../../../../../exe/adam_prism_fnl ./check.sh        # FNL

Results ​

LegAssertsBoundCPUFNL
capped stepthe last time step shorter than 0.99 of the first—passpass
seams activethe forest: reflux max|F_coarse-F_fine_sum| line is printed—passpass
conservationat every checkpoint, the drift of each D integral relative to the largest D integral, and of each B integral relative to the largest B integral≤10−92.2⋅10−112.2⋅10−11

∫Dz drift per step (CPU, 2 ranks):

Step12345 (capped)
fixed run1.8⋅10−151.4⋅10−131.8⋅10−121.0⋅10−112.2⋅10−11
fix reverted (negative control)the samethe samethe samethe same1.4⋅10−7

∫Bx stays at 10−16.

Related pages: static AMR and the FV reflux register for the register itself; FLUME's conservation across AMR seams measures the same property on the Euler equations.

Findings ​

  • With the correction scaled by the capped step, the drift grows smoothly to 2.2⋅10−11: the seams' disturbance reaching the x boundaries, not a reflux defect.
  • With the fix reverted the drift jumps to 1.4⋅10−7 on the capped step, 6500 times larger. The bound, 10−9, sits 45 times above the fixed run and 140 times below the reverted one.