Skip to main content

Module convergence

Module convergence 

Source
Expand description

§Convergence and analytics

This page collects the quantitative evidence in one place: every measured order of convergence next to the order the scheme is designed for, the conservation and equality checks, and the exact solutions that supply the reference values. The method is on the verification page, and each case is on its geometry page.

§Observed orders of convergence

“Expected” is the design order of the scheme in that norm on that problem. Pairwise orders are between successive resolutions, as defined in Verification method; “fit” is the least-squares slope.

§Smooth solutions

ProblemSchemeNormExpectedMeasuredPage
Advection, $\sin2\pi x$, 128 to 2048 cellsupwind, forward Euler$L_1$10.988 (fit)1D
Lax-Wendroff$L_1$, $L_2$, $L_\infty$22.000 (fit), all three
MUSCL van Leer, SSP-RK3$L_1$22.032 (fit)
MUSCL van Leer, SSP-RK3$L_2$, $L_\infty$below 2 (limiter clips extrema)1.756, 1.392 (fit)
Burgers, $\sin2\pi x$, $t=0.1$, 100 to 800 cellsMUSCL, SSP-RK3, Godunov$L_1$21.99, 2.02, 2.071D
MUSCL, SSP-RK3, Godunov$L_2$below 21.75, 1.76, 1.76
first order, forward Euler$L_1$10.94, 0.96, 0.98
Euler density wave, 100 to 800 cellsMUSCL, SSP-RK3, HLLC$L_1$22.02, 2.03, 2.041D
first order, forward Euler$L_1$10.94, 0.97, 0.99
Water shock tube (stiffened gas) against its exact solution, 100 to 800 cellsMUSCL, SSP-RK2, HLLC$L_1$ density; pressureabout 1 (discontinuities)0.84; 0.99 (fit)1D
Copper impact (Mie-Gruneisen) against the shock-speed relation, 100 to 800 cellsMUSCL, SSP-RK2, HLLC$L_1$ density; pressureabout 1 (discontinuities)1.01; 1.03 (fit)1D
Isentropic vortex, 32 to 64 cellsMUSCL, SSP-RK3, HLLCmean abs. error22.112D
Diagonal advection, 2Dupwind; MUSCL; Lax-Wendroff with Strang splitting1; 2; 2asserted by the tests within the tolerance in each2D
Cylindrical sound wave, 100 to 800 cellsMUSCL, SSP-RK3, HLLC$L_1$21.97, 1.97, 2.06 (fit 2.00)cylindrical
Spherical sound wave, 50 to 400 cellsMUSCL, SSP-RK3, HLLC$L_1$21.72, 1.67, 1.88spherical
Spherical sound wave through PythonMUSCL$L_1$21.67, 1.88, 2.03 (fit 1.86)
Solid-body rotation (exact steady state), 32 to 256 cellsMUSCL, SSP-RK3, HLLCradial momentum, $L_1$23.33, 3.09, 2.86 (faster than design: the profiles are quadratic)cylindrical
first orderradial momentum, $L_1$11.48, 1.03, 0.97
Spherical sound wave, 200 to 1600 cellsfirst order$L_1$10.70, 0.82, 0.90 (tending to 1)
Level-set derivative of a smooth function, semi-discreteWENO5; Upwind5; Upwind11; first-order upwind5; 5; 11; 15.00 (1D and 2D); 5.00; 10.9; 1.00high order
Reversing vortex, 64 to 128 cellsWENO5; Upwind5; Upwind11shape5 (design)4.5; 4.6; 5.2high order
Gradient of a reinitialised circle, 32 to 128 cellsfast sweeping$\lvert\nabla\phi\rvert-1$11.25high order
A bubble carried by a uniform flow (two gases), 24 to 96 cellscoupled solver, MUSCL, WENO5, SSP-RK3$L_\infty$ of $\phi$at least 2.5 (required)4.99, 5.00coupled materials
Coupling of the flow and the interface in time (a pressure wave moving the interface), Courant 0.4 to 0.05coupled solver, SSP-RK3$L_\infty$ of $\phi$ against a step 64 times smaller32.91 (fit)coupled materials
Extension of the state along the normal round a circle, 48 to 192 cellsfirst-order upwind, layer by layerlargest error in the band10.62, 0.90 (tending to 1)coupled materials

Observed order of the three advection schemes

1 2 4 8 1 1e−1 1e−2 1e−3 1e−4 1e−5 slope 1 slope 2 slope 5 Euler vortex, 2D (MUSCL) cylindrical sound wave (MUSCL) spherical sound wave (MUSCL) level set: Weno5, vortex level set: Upwind11, vortex refinement factor (cells ÷ coarsest grid) error ÷ coarsest error

Representative smooth cases, each series divided by its own coarsest error, on logarithmic axes. The slopes are the observed orders.

The sound-wave orders rise towards 2 as the grid is refined: the coarsest grids are not yet in the asymptotic range. That is why the harness requires the finest pair, not only the fit, to be within tolerance.

§Problems with shocks

With a shock in the domain no scheme is better than first order in $L_1$, so the quantity checked is a position or a plateau, and the order is reported for information.

ProblemReferenceResultPage
Burgers shockRankine-Hugoniot position 0.50.500011D
Burgers sine, shock at $t=0.4$characteristic equation, 0.8475760.8475701D
Sod plateau $p_*$, $u_*$0.30313, 0.9274530.30313, 0.927461D
Toro test 3 plateau $p_*$, $u_*$460.894, 19.5975460.93, 19.59551D
Toro test 4 plateau $p_*$, $u_*$1691.647, 8.689771691.06 (mean), 8.687
Noh, cylinder, shock position0.20.19875cylindrical
Noh, sphere, shock position0.20.19875spherical
Noh, post-shock density (cylinder, sphere)16, 6415.93, 63.12
Noh $L_1$ order (cylinder 100 to 200 then 200 to 400; sphere)about 11.85, 0.62; 0.94, 0.93
Sedov blast, cylinder, shock radius0.713100.71375cylindrical
Sedov blast, sphere, shock radius0.690960.69375spherical
Sedov $L_1$ density error at 800 cells (cylinder; sphere), a bound, not an orderbelow 5e-32.54e-3; 2.59e-3
Sedov $L_1$ order, fit over 100 to 800 cells (cylinder; sphere)at most about 1 (finite-size ball)0.79; 0.78
Blast against a fine run, finest pair (cylinder; sphere)about 11.08; 1.09cylindrical, spherical
Planar shock in 2DRankine-Hugoniot positionwithin 0.05 cell2D

§Conservation

Relative drift of the integrated quantity from the first to the last snapshot; closed or periodic domains.

ProblemMassEnergyPage
Advection upwind / Lax-Wendroff / MUSCL, 1000 cells2.7e-15 / 1.1e-15 / 7.7e-141D
Sod, open ends (mass, energy)2.0e-161.6e-16
Stationary contact00
Isentropic vortex, one full period9e-14 (also both momenta)9e-142D
3D blast, 8 blocks1.1e-151.5e-153D
3D blast, 64 blocks, 8 threads4.4e-160
Spherical blast1.1e-132.4e-13spherical
Cylindrical blast9.5e-141.5e-13cylindrical
Axisymmetric can00
Swirling ring in a closed can, unsplit (angular momentum 0)01.8e-16cylindrical
Swirling ring in a closed can, Strang (angular momentum 0)00

With open ends the quantity changes by exactly the time integral of the boundary flux, and that is what is tested (the Sod momentum gain of 0.225, the Burgers integral gain of 0.2).

§Exact and independent solutions

SolutionWhat it isWhereVerified by
Linear advectiontranslation of the initial data$u_0(x-at)$closed form
Burgers, shock and fanRankine-Hugoniot speed; the fan $(x-x_0)/t$src/pymerlin/exact_solutions/burgers.py (riemann); tests/common/burgers_exact.rsequations/burgers_reference.rs (8 tests: speed, linear fan, integrates to the boundary flux, odd transonic fan, zero-time limit)
Burgers, smoothmethod of characteristics, $x=\xi+tu_0(\xi)$burgers.py (sine)equations/burgers_reference.rs: the characteristic relation, periodicity, the mean
Euler, Riemann problemexact star pressure, velocity and the sampled solutionsrc/pymerlin/exact_solutions/euler.py; Rust ExactRiemannToro’s Tables 4.1 and 4.2; conservation of the sampled solution; mirror symmetry; continuity across the contact
Isentropic vortexexact advected vortextests/equations/euler2d.rsthe second-order convergence itself; carried without changing the totals
Sound wave, sphere$f(r-ct)/r$ potentialsrc/pymerlin/exact_solutions/acoustic.py; tests/geometry/acoustic.rsthe wave-equation residual; initial data of the shipped files
Sound wave, cylinderHankel transform of the initial pulse, with Bessel functions from their integral formacoustic.pythe same checks, pymerlin check --self-test acoustic (7 checks)
Noh’s implosionexact density, velocity and pressuretests/geometry/noh.rsthe plateau and the shock position
Sedov-Taylor blast, cylinder and spherethe similarity solution, integrated numerically from the shock to the centre; $\alpha$ from the energysrc/pymerlin/exact_solutions/sedov.pypymerlin check --self-test sedov (17 checks): $\alpha=0.851$ for the sphere with $\gamma=1.4$, the swept-up mass for three geometries and three $\gamma$, the three equations by finite differences, the shock jump
Solid-body rotation$w=\Omega r$ with the balancing pressure, constant densitytests/geometry/swirl.rsthe error falling faster than second order; without the centrifugal term it would not fall

The Python solutions are separate from the Rust code on purpose, so that a mistake in one is not repeated in the other. The checks outside cargo test (pymerlin check --self-test euler, --self-test schlieren, --self-test acoustic, --self-test sedov, pymerlin convergence for the two sound waves and the two Sedov blasts, pymerlin check for HDF5 against CSV, and the thread-scaling check) run in continuous integration.

§Equality checks

ComparedResultPage
1, 2, 3, 4, 6, 8 threads, 200 by 200 gas problem0 differing values3D
Convergence studies on any thread countidentical errors and fitted order (2.1104)
File run against library runbit for bit1D
HDF5 against CSVbit-identical1D
2D without $z$ dependence against the 1D cylinderbit for bitcylindrical
Gas with swirl and $w=0$ against the gas without swirlbit for bitcylindrical
1D embedded in 2D against the 1D tubebit for bit2D