This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Shock with Confidence: Formal Proofs of Correctness for Hyperbolic Partial Differential Equation Solvers

Jonathan Gorard Princeton UniversityPrinceton, NJUSA [email protected]  and  Ammar Hakim Princeton Plasma Physics LaboratoryPrinceton, NJUSA [email protected]
(2025)
Abstract.

First-order systems of hyperbolic partial differential equations (PDEs) occur ubiquitously throughout computational physics, commonly used in simulations of fluid turbulence, shock waves, electromagnetic interactions, and even general relativistic phenomena. Such equations are often challenging to solve numerically in the non-linear case, due to their tendency to form discontinuities even for smooth initial data, which can cause numerical algorithms to become unstable, violate conservation laws, or converge to physically incorrect solutions. In this paper, we introduce a new formal verification pipeline for such algorithms in Racket, which allows a user to construct a bespoke hyperbolic PDE solver for a specified equation system, generate low-level C code which verifiably implements that solver, and then produce formal proofs of various mathematical and physical correctness properties of the resulting implementation, including L2{L^{2}} stability, flux conservation, and physical validity. We outline how these correctness proofs are generated, using a custom-built theorem-proving and automatic differentiation framework that fully respects the algebraic structure of floating-point arithmetic, and show how the resulting C code may either be used to run standalone simulations, or integrated into a larger computational multiphysics framework such as Gkeyll.

copyright: acmlicensedjournalyear: 2025doi: XXXXXXX.XXXXXXX

1. Introduction

Systems of hyperbolic partial differential equations (PDEs) constitute a highly general class of mathematical models for phenomena involving waves, or the wave-like propagation of information, including water waves in hydrodynamic modeling(Vreugdenhil, 1994), blast waves in explosives modeling(Fickett, 1985), gravitational waves in general relativity(Auger and Plagnol, 2017)111Indeed, the Einstein field equations themselves can be cast in a purely hyperbolic form(Gorard, 2024)., and even traffic waves in vehicular traffic flows(Musha and Higuchi, 1978). When systems of hyperbolic PDEs are non-linear, they have a tendency to form discontinuities after finite time (even for arbitrarily smooth initial data)(Toro and Billett, 2000), such as shock waves and contact discontinuities. Such discontinuities are notoriously challenging to capture using standard numerical techniques such as finite difference methods, since the discontinuous solution to the PDE system does not exist in the strong sense (only in the weak/distributional sense), and such methods will therefore typically violate certain crucial conservation laws (such as conservation of energy, or conservation of momentum) in the presence of such discontinuities(Harten et al., 1976). This has led to the development of a variety of finite volume algorithms, and specifically high-resolution shock-capturing (HRSC) schemes(Toro, 2009), which capture these non-linear discontinuities by solving the weak/integral form of the PDE system directly, in a manner which fully guarantees conservation. However, Godunov’s theorem222Linear, monotonicity-preserving schemes cannot be more than first-order accurate(Laney, 1998)., a central result in the theory of numerical methods for hyperbolic PDEs, implies that naive algorithms have a tendency to produce spurious oscillations (i.e. violations of the total variation diminishing, or TVD, property(Harten, 1983)), or otherwise to introduce new extrema into the solution (i.e. violations of the monotonicity-preservation property). One way around this highly distressing theorem is to sacrifice either linearity or higher-order accuracy of the method in the vicinity of shock waves. To make matters worse, since thermodynamic quantities such as entropy tend to be discontinuous across shocks, some methods may converge to mathematically correct but physically invalid solutions (e.g. solutions which decrease total entropy), unless certain additional entropy conditions are satisfied(Osher, 1984).

In this paper, we introduce a new technique for producing formally verified implementations of high-resolution shock-capturing schemes, with provable mathematical and physical correctness properties. We develop a domain-specific language in Racket(Felleisen et al., 2015) for representing arbitrary first-order systems of hyperbolic PDEs, from which verifiable C code can then be automatically synthesized, implementing a variety of bespoke first- and second-order accurate finite volume algorithms to solve them. We also introduce a suite of novel automated theorem-proving and automatic differentiation tools which fully respect the algebraic properties of floating-point arithmetic (e.g. allowing commutativity but not associativity of floating-point addition and multiplication), and which thus implement only strictly correctness-preserving algebraic transformations of the corresponding C code. We show how it is possible to use these tools to prove fundamental correctness properties of the underlying first-order numerical schemes, such as (strict) hyperbolicity-preservation, L1{L^{1}}, L2{L^{2}} and L{L^{\infty}} stability, local Lipschitz continuity (a sufficient condition for physical correctness), and flux conservation. We also demonstrate how it is possible to prove correctness properties of the flux extrapolation algorithms necessary to extend these schemes to second-order spatial accuracy, such as symmetry and TVD. Each generated proof is, itself, a symbolic piece of Racket code that can be independently run and verified, and is therefore able to act as a standalone certificate of correctness for some aspect of the algorithm. This pipeline is also able to produce both entirely standalone verified solvers, as well as verified solvers that can be integrated into a larger computational multiphysics framework such as Gkeyll333https://gkeyll.readthedocs.io/en/latest/ (with the larger framework handling all non-verified simulation tasks, such as parallelism, grid generation, and data input/output). The underlying theory behind the finite volume solvers used within Gkeyll can be found in (Hakim et al., 2006).

Section 2 begins with preliminary background material on the mathematical properties of high-resolution shock-capturing schemes. In 2.1, we briefly introduce explicitly conservative finite volume numerical methods, as well as the four model equation systems (linear advection, inviscid Burgers’, perfectly hyperbolic Maxwell’s, and isothermal Euler) that will be used throughout the paper. In 2.2, we introduce the Lax-Friedrichs inter-cell flux function, and outline sufficient conditions to guarantee its hyperbolicity-preservation, CFL stability, and local Lipschitz continuity (with the latter condition itself being a sufficient condition for physical/thermodynamic correctness). In 2.3, we introduce the Roe approximate Riemann solver, and again outline sufficient conditions to guarantee its hyperbolicity-preservation and flux conservation (i.e. jump continuity). In 2.4, we describe how to extend the first-order Lax-Friedrichs and Roe solvers to be second-order accurate in space via flux extrapolation, outline sufficient conditions on the flux limiters to guarantee that the resulting second-order schemes be symmetric and total variation diminishing (TVD), and also introduce the four flux limiters (minmod, monotonized-centered, superbee and van Leer) that are used throughout the paper.

Section 3 presents the main methodology and results of the paper. In 3.1, we outline how we encode hyperbolic PDE systems in Racket, and how the automatic C code generator works. In 3.2, we introduce the core of the symbolic theorem-prover, outlining the algorithm for reducing an arbitrary symbolic Racket expression to a normal form, whilst respecting the algebraic structure of floating-point arithmetic. In 3.3, we describe the algorithm for performing automatic differentiation on arbitrary Racket expressions, enabling one to compute symbolic gradients, Jacobians, Hessians, etc. In 3.4, we outline how these methods may be combined to produce automatic proofs of (strict) hyperbolicity, CFL stability, convexity/local Lipschitz continuity, and flux continuity properties of Lax-Friedrichs and Roe solvers. In 3.5, we describe the algorithm for performing variable transformations and evaluating symbolic limits of Racket expressions for the purpose of proving symmetry and second-order TVD properties of flux limiters.

In 3.6, we present our main results: full proofs of correctness for Lax-Friedrichs and Roe solvers for the linear advection, inviscid Burgers’, and perfectly hyperbolic Maxwell’s equations, with partial/conditional proofs of correctness in the case of the isothermal Euler equations, along with full proofs of correctness for the minmod and monotonized-centered flux limiters, with partial proofs of correctness for the superbee and van Leer limiters. We end in Section 4 with some concluding remarks and directions for future research.

Our Racket implementation of the formal verification pipeline can be found at444https://github.com/ammarhakim/gkylcas/. The corresponding provably-correct C implementations, which have been integrated into the Gkeyll code, can be found at555https://github.com/ammarhakim/gkylzero/.

2. Preliminaries

2.1. Hyperbolic PDE Solvers

For the purposes of this paper, we consider homogeneous systems of (potentially non-linear) first-order hyperbolic PDEs, expressed in the generic conservation law form:

(1) 𝐔t+𝐅(𝐔)=𝟎,\frac{\partial\mathbf{U}}{\partial t}+\nabla\cdot\mathbf{F}\left(\mathbf{U}\right)=\mathbf{0},

where 𝐔{\mathbf{U}} represents the vector of conserved variables and 𝐅(𝐔){\mathbf{F}\left(\mathbf{U}\right)} represents the matrix of fluxes of those variables. We can discretize such a system of PDEs in both space and time, using a uniform grid spacing of Δx{\Delta x} and a time-step of Δt{\Delta t}, indexed by subscripts (ii) and superscripts (nn):

(2) xi+1=xi+Δx, and tn+1=tn+Δt,x_{i+1}=x_{i}+\Delta x,\qquad\text{ and }\qquad t^{n+1}=t^{n}+\Delta t,

respectively. Specifically, we employ a finite volume discretization, in which the conserved variable vector 𝐔{\mathbf{U}} at time tn{t^{n}} is taken to be constant within each cell xi{x_{i}} (and therefore piecewise constant across the entire domain), and we adopt the shorthand 𝐔in=𝐔(xi,tn){\mathbf{U}_{i}^{n}=\mathbf{U}\left(x_{i},t^{n}\right)} to denote this value. The value of the conserved variable vector 𝐔in{\mathbf{U}_{i}^{n}} within each cell can then be evolved in time by means of the explicitly conservative update formula(Toro, 2009):

(3) 𝐔in+1=𝐔inΔtΔx[𝐅i+12𝐅i12],\mathbf{U}_{i}^{n+1}=\mathbf{U}_{i}^{n}-\frac{\Delta t}{\Delta x}\left[\mathbf{F}_{i+\frac{1}{2}}-\mathbf{F}_{i-\frac{1}{2}}\right],

where 𝐅i+12{\mathbf{F}_{i+\frac{1}{2}}} and 𝐅i12{\mathbf{F}_{i-\frac{1}{2}}} represent inter-cell fluxes, i.e. the interpolated fluxes of the conserved variables between cells xi{x_{i}} and xi+1{x_{i+1}}, and between cells xi1{x_{i-1}} and xi{x_{i}}, respectively. Different choices of inter-cell flux function give rise to different finite volume schemes, exhibiting different numerical properties(LeVeque, 2011).

In what follows, we shall focus on four one-dimensional model equation systems in particular, covering all possible combinations of linear vs. non-linear and scalar vs. vector. The first two are purely 1D scalar equations of the form:

(4) ut+f(u)x=0,\frac{\partial u}{\partial t}+\frac{\partial f\left(u\right)}{\partial x}=0,

namely the linear advection equation with flux f(u)=au{f\left(u\right)=au} (for an arbitrary constant advection velocity a{a\in\mathbb{R}}), and the non-linear inviscid Burgers’ equation with flux f(u)=12u2{f\left(u\right)=\frac{1}{2}u^{2}}. In each case, the conserved variable uu simply represents an arbitrary advected quantity. The second two are 1D vector equation systems of the form:

(5) 𝐔t+𝐅(𝐔)x=𝟎\frac{\partial\mathbf{U}}{\partial t}+\frac{\partial\mathbf{F}\left(\mathbf{U}\right)}{\partial x}=\mathbf{0}

namely the linear perfectly hyperbolic Maxwell’s equations(Munz et al., 2000), with conserved variable vector:

(6) 𝐔=[ExEyEzBxByBzϕψ],\mathbf{U}=\begin{bmatrix}E^{x}&E^{y}&E^{z}&B^{x}&B^{y}&B^{z}&\phi&\psi\end{bmatrix}^{\intercal},

and flux vector:

(7) 𝐅(𝐔)=[χc2ϕc2Bzc2ByγψEzEzχExγc2Bx],\mathbf{F}\left(\mathbf{U}\right)=\begin{bmatrix}\chi c^{2}\phi&c^{2}B^{z}&-c^{2}B^{y}&\gamma\psi&-E^{z}&E^{z}&\chi E^{x}&\gamma c^{2}B^{x}\end{bmatrix}^{\intercal},

and the non-linear isothermal Euler equations, with conserved variable vector:

(8) 𝐔=[ρρuρvρw],\mathbf{U}=\begin{bmatrix}\rho&\rho u&\rho v&\rho w\end{bmatrix}^{\intercal},

and flux vector:

(9) 𝐅(𝐔)=[ρuρu2+ρvth2ρuvρuw].\mathbf{F}\left(\mathbf{U}\right)=\begin{bmatrix}\rho u&\rho u^{2}+\rho v_{th}^{2}&\rho uv&\rho uw\end{bmatrix}^{\intercal}.

For the perfectly hyperbolic Maxwell’s equations, the conserved variables correspond to the xx, yy and zz components of the electric and magnetic field vectors 𝐄{\mathbf{E}} and 𝐁{\mathbf{B}}, as well as the correction potentials ϕ{\phi} and ψ{\psi} for cleaning divergence errors in 𝐄{\mathbf{E}} and 𝐁{\mathbf{B}}, respectively. c,χ,γ{c,\chi,\gamma\in\mathbb{R}} are arbitrary constants representing the speed of light, and the propagation speeds of electric and magnetic divergence errors, respectively. For the isothermal Euler equations, the conserved variables correspond to the fluid density ρ{\rho}, and the xx, yy and zz components of the fluid momentum ρu{\rho u}, ρv{\rho v} and ρw{\rho w} (with uu, vv and ww representing the xx, yy and zz components of the fluid velocity, which are not conserved). vth{v_{th}\in\mathbb{R}} is an arbitrary constant representing the thermal velocity of the fluid.

2.2. The Lax-Friedrichs Flux

One of the simplest choices of inter-cell flux function is the Lax-Friedrichs (finite difference) flux(Lax, 1954)(LeVeque, 1992):

(10) 𝐅i+12=12[𝐅(𝐔in)+𝐅(𝐔i+1n)]Δx2Δt[𝐔i+1n𝐔in].\mathbf{F}_{i+\frac{1}{2}}=\frac{1}{2}\left[\mathbf{F}\left(\mathbf{U}_{i}^{n}\right)+\mathbf{F}\left(\mathbf{U}_{i+1}^{n}\right)\right]-\frac{\Delta x}{2\Delta t}\left[\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}\right].

A finite volume solver based on a Lax-Friedrichs inter-cell flux will satisfy the following properties(Breuß, 2004):

Theorem 2.1.

A Lax-Friedrichs solver preserves hyperbolicity(Hartman, 1960) (i.e. preserves well-posedness of the Cauchy problem along all non-characteristic hypersurfaces) for an arbitrary hyperbolic PDE system if the flux Jacobian with respect to the conserved variable vector 𝐔{\mathbf{U}}:

(11) 𝐉𝐅=𝐔𝐅(𝐔),\mathbf{J}_{\mathbf{F}}=\nabla_{\mathbf{U}}\mathbf{F}\left(\mathbf{U}\right),

is diagonalizable, with purely real eigenvalues.

Theorem 2.2.

A Lax-Friedrichs solver maintains L1{L^{1}}, L2{L^{2}} and L{L^{\infty}} stability for an arbitrary hyperbolic PDE system if the CFL stability condition(Courant et al., 1967):

(12) 0|a|ΔtΔx1,0\leq\frac{\left\lvert a\right\rvert\Delta t}{\Delta x}\leq 1,

is satisfied, where |a|{\left\lvert a\right\rvert} denotes the largest absolute eigenvalue of the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}}.

Theorem 2.3.

A Lax-Friedrichs solver preserves local Lipschitz continuity of the discrete flux function 𝐅(𝐔in){\mathbf{F}\left(\mathbf{U}_{i}^{n}\right)} with respect to the discrete conserved variables 𝐔in{\mathbf{U}_{i}^{n}} (i.e. preserves the property that, in every neighborhood 𝒩{\mathcal{N}} of possible values of 𝐔in{\mathbf{U}_{i}^{n}}, there exists a restriction of the discrete flux function to 𝒩{\mathcal{N}} which has strictly bounded first derivatives in 𝐔in{\mathbf{U}_{i}^{n}}) for an arbitrary hyperbolic PDE system if the continuous flux function 𝐅(𝐔){\mathbf{F}\left(\mathbf{U}\right)} is itself locally Lipschitz continuous with respect to the continuous conserved variables 𝐔{\mathbf{U}}.

Theorem 2.4.

A sufficient condition for the continuous flux function 𝐅(𝐔){\mathbf{F}\left(\mathbf{U}\right)} for an arbitrary hyperbolic PDE system to be locally Lipschitz continuous with respect to the continuous conserved variables 𝐔{\mathbf{U}} is for the componentwise Hessian with respect to 𝐔{\mathbf{U}}:

(13) 𝐇f=(𝐔𝐔f(𝐔))\mathbf{H}_{f}=\left(\nabla_{\mathbf{U}}\nabla_{\mathbf{U}}f\left(\mathbf{U}\right)\right)^{\intercal}

to be positive semidefinite (i.e. symmetric/Hermitian with non-negative eigenvalues), for each scalar flux component f(𝐔){f\left(\mathbf{U}\right)} of 𝐅(𝐔){\mathbf{F}\left(\mathbf{U}\right)}.

The significance of hyperbolicity-preservation is that it is a necessary condition for the solver to remain deterministic, i.e. to prevent discrete solutions from becoming multi-valued(Hartman, 1960). Note that the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} being symmetric/Hermitian is a sufficient but not necessary condition for the solver to preserve hyperbolicity. The significance of the CFL stability condition is that, at least for a Lax-Friedrichs solver, CFL stability subsumes all other standard notions of numerical stability (e.g. L1{L^{1}}, L2{L^{2}} and L{L^{\infty}} stability) within a single condition(Courant et al., 1967). Finally, the significance of the local Lipschitz continuity condition, as well as the slightly stronger convexity condition, is that these constraints are sufficient to guarantee that the solver will converge to the physically correct (i.e. thermodynamically consistent) solution in the presence of weak, nonlinear waves, such as shock waves in hydrodynamics(Breuß, 2004).

2.3. The Roe Flux

A more sophisticated choice of inter-cell flux function is the Roe (linearized Riemann problem) flux(Roe, 1981):

(14) 𝐅i+12=12[𝐅(𝐔in)+𝐅(𝐔i+1n)]12p|λp|αp𝐫p.\mathbf{F}_{i+\frac{1}{2}}=\frac{1}{2}\left[\mathbf{F}\left(\mathbf{U}_{i}^{n}\right)+\mathbf{F}\left(\mathbf{U}_{i+1}^{n}\right)\right]-\frac{1}{2}\sum_{p}\left\lvert\lambda_{p}\right\rvert\alpha_{p}\mathbf{r}_{p}.

In the above, we assume an inter-cell Roe matrix 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)}, which is a linearized approximation to the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} that is taken to be constant between cells xi{x_{i}} and xi+1{x_{i+1}}, satisfying consistency with the exact Jacobian in the appropriate limit:

(15) lim𝐔in,𝐔i+1n𝐔[𝐀(𝐔in,𝐔i+1n)]=𝐔𝐅(𝐔),\lim_{\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\to\mathbf{U}}\left[\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)\right]=\nabla_{\mathbf{U}}\mathbf{F}\left(\mathbf{U}\right),

such that λp{\lambda_{p}} are the eigenvalues of 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)}, 𝐫p{\mathbf{r}_{p}} are the (right) eigenvectors of 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)}, and αp{\alpha_{p}} are the components of the inter-cell jump in the conserved variables 𝐔i+1n𝐔in{\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}}, as represented in the 𝐫p{\mathbf{r}_{p}} eigenbasis:

(16) 𝐔i+1n𝐔in=pαp𝐫p.\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}=\sum_{p}\alpha_{p}\mathbf{r}_{p}.

A finite volume solver based on a Roe inter-cell flux will satisfy the following properties(Wesseling, 2001):

Theorem 2.5.

A Roe solver preserves hyperbolicity for an arbitrary hyperbolic PDE system if the Roe matrix 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)} is diagonalizable, with purely real eigenvalues.

Theorem 2.6.

A Roe solver is flux-conservative (i.e. exactly conserves the components of the conserved variable vector 𝐔{\mathbf{U}}) if it satisfies the flux jump condition:

(17) 𝐅(𝐔i+1n𝐔in)=𝐀(𝐔in,𝐔i+1n)[𝐔i+1n𝐔in].\mathbf{F}\left(\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}\right)=\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)\left[\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}\right].

Note that Theorem 2.5 regarding Roe solvers is essentially identical in content to Theorem 2.1 regarding Lax-Friedrichs solvers, but with the exact flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} replaced by the linearized inter-cell approximation 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)}. Note, moreover, that a Lax-Friedrichs solver is guaranteed to conserve the components of 𝐔{\mathbf{U}} automatically, and does not require any additional conditions (such as those in Theorem 2.6) to hold. Finally, note that the CFL stability and local Lipschitz continuity criteria for Lax-Friedrichs solvers apply to Roe solvers too, i.e. a Roe solver for a given PDE system will not be CFL stable unless the corresponding Lax-Friedrichs solver is also CFL stable, etc.

2.4. Flux Extrapolation and Limiters

The Lax-Friedrichs and Roe solvers described above are, naively, only first-order accurate in space. In order to achieve second-order spatial accuracy, it is necessary to replace the piecewise constant approximations of the conserved variable vector 𝐔{\mathbf{U}} with piecewise linear approximations instead(Van Leer, 1979). At the boundary between cells xi{x_{i}} and xi+1{x_{i+1}}, the left- and right-sided extrapolated values of 𝐔{\mathbf{U}} are given by:

(18) 𝐔i+12L=𝐔i+12ϕ(𝐫i)(𝐔i+1𝐔i),\mathbf{U}_{i+\frac{1}{2}}^{L}=\mathbf{U}_{i}+\frac{1}{2}\boldsymbol{\phi}\left(\mathbf{r}_{i}\right)\left(\mathbf{U}_{i+1}-\mathbf{U}_{i}\right),

and:

(19) 𝐔i+12R=𝐔i+112ϕ(𝐫i+1)(𝐔i+2𝐔i+1),\mathbf{U}_{i+\frac{1}{2}}^{R}=\mathbf{U}_{i+1}-\frac{1}{2}\boldsymbol{\phi}\left(\mathbf{r}_{i+1}\right)\left(\mathbf{U}_{i+2}-\mathbf{U}_{i+1}\right),

respectively, while at the boundary between cells xi1{x_{i-1}} and xi{x_{i}}, the left- and right-sided extrapolated values of 𝐔{\mathbf{U}} are given by:

(20) 𝐔i12L=𝐔i1+12ϕ(𝐫i1)(𝐔i𝐔i1),\mathbf{U}_{i-\frac{1}{2}}^{L}=\mathbf{U}_{i-1}+\frac{1}{2}\boldsymbol{\phi}\left(\mathbf{r}_{i-1}\right)\left(\mathbf{U}_{i}-\mathbf{U}_{i-1}\right),

and:

(21) 𝐔i12R=𝐔i12ϕ(𝐫i)(𝐔i+1𝐔i),\mathbf{U}_{i-\frac{1}{2}}^{R}=\mathbf{U}_{i}-\frac{1}{2}\boldsymbol{\phi}\left(\mathbf{r}_{i}\right)\left(\mathbf{U}_{i+1}-\mathbf{U}_{i}\right),

respectively, where 𝐫i{\mathbf{r}_{i}} is a ratio of successive gradients of 𝐔{\mathbf{U}} (computed componentwise):

(22) 𝐫i=𝐔i𝐔i1𝐔i+1𝐔i.\mathbf{r}_{i}=\frac{\mathbf{U}_{i}-\mathbf{U}_{i-1}}{\mathbf{U}_{i+1}-\mathbf{U}_{i}}.

The function ϕ(𝐫i){\boldsymbol{\phi}\left(\mathbf{r}_{i}\right)} in the above is a flux limiter(LeVeque, 2011), intended to limit the spatial derivatives arising within the reconstruction so as to damp any spurious oscillations that might otherwise appear in the vicinity of steep gradients or true discontinuities. Since all quantities are computed componentwise, it is sufficient to think of the flux limiter as being a scalar function of a scalar ratio of gradients ϕ(r){\phi\left(r\right)}.

A second-order spatially accurate scheme can now be constructed by taking the left- and right-extrapolated values 𝐔i+12L{\mathbf{U}_{i+\frac{1}{2}}^{L}} and 𝐔i+12R{\mathbf{U}_{i+\frac{1}{2}}^{R}} and evolving them forward by a half time-step Δt2{\frac{\Delta t}{2}}, to obtain the evolved states 𝐔i+12L¯{\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}} and 𝐔i+12R¯{\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}}:

(23) 𝐔i+12L¯=𝐔i+12L+Δt2Δx[𝐅(𝐔i12R)𝐅(𝐔i+12L)],\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}=\mathbf{U}_{i+\frac{1}{2}}^{L}+\frac{\Delta t}{2\Delta x}\left[\mathbf{F}\left(\mathbf{U}_{i-\frac{1}{2}}^{R}\right)-\mathbf{F}\left(\mathbf{U}_{i+\frac{1}{2}}^{L}\right)\right],

and:

(24) 𝐔i+12R¯=𝐔i+12R+Δt2Δx[𝐅(𝐔i+12R)𝐅(𝐔i+32L)],\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}=\mathbf{U}_{i+\frac{1}{2}}^{R}+\frac{\Delta t}{2\Delta x}\left[\mathbf{F}\left(\mathbf{U}_{i+\frac{1}{2}}^{R}\right)-\mathbf{F}\left(\mathbf{U}_{i+\frac{3}{2}}^{L}\right)\right],

respectively. The inter-cell flux 𝐅i+12{\mathbf{F}_{i+\frac{1}{2}}} for the second-order scheme is now evaluated in the usual way, but with the left and right cell states 𝐔in{\mathbf{U}_{i}^{n}} and 𝐔i+1n{\mathbf{U}_{i+1}^{n}} replaced by the evolved boundary-extrapolated states 𝐔i+12L¯{\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}} and 𝐔i+12R¯{\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}}, respectively, i.e. for the case of Lax-Friedrichs fluxes, one has:

(25) 𝐅i+12=12[𝐅(𝐔i+12L¯)+𝐅(𝐔i+12R¯)]Δx2Δt[𝐔i+12R¯𝐔i+12L¯],\mathbf{F}_{i+\frac{1}{2}}=\frac{1}{2}\left[\mathbf{F}\left(\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}\right)+\mathbf{F}\left(\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}\right)\right]-\frac{\Delta x}{2\Delta t}\left[\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}-\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}\right],

and for the case of Roe fluxes, one has:

(26) 𝐅i+12=12[𝐅(𝐔i+12L¯)+𝐅(𝐔i+12R¯)]12p|λp|αp𝐫p,\mathbf{F}_{i+\frac{1}{2}}=\frac{1}{2}\left[\mathbf{F}\left(\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}}\right)+\mathbf{F}\left(\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}\right)\right]-\frac{1}{2}\sum_{p}\left\lvert\lambda_{p}\right\rvert\alpha_{p}\mathbf{r}_{p},

for Roe matrix 𝐀(𝐔i+12L¯,𝐔i+12R¯){\mathbf{A}\left(\overline{\mathbf{U}_{i+\frac{1}{2}}^{L}},\overline{\mathbf{U}_{i+\frac{1}{2}}^{R}}\right)}.

Flux limiters, and the resulting second-order extrapolations that they enable, satisfy the following properties:

Theorem 2.7.

A flux limiter ϕ(r){\phi\left(r\right)} will act symmetrically (i.e. will act equivalently on forward and backward gradients) if it satisfies the symmetry condition:

(27) ϕ(r)r=ϕ(1r).\frac{\phi\left(r\right)}{r}=\phi\left(\frac{1}{r}\right).
Theorem 2.8.

A second-order scheme extrapolated from an underlying first-order Lax-Friedrichs or Roe solver will be second-order TVD (total variation diminishing), i.e. one will have:

(28) TV(𝐔n+1)TV(𝐔n),TV\left(\mathbf{U}^{n+1}\right)\leq TV\left(\mathbf{U}^{n}\right),

where TV(𝐔n){TV\left(\mathbf{U}^{n}\right)} denotes the total variation of the solution at time tn{t^{n}}:

(29) TV(𝐔n)=i𝐔i+1n𝐔in,TV\left(\mathbf{U}^{n}\right)=\sum_{i}\left\lVert\mathbf{U}_{i+1}^{n}-\mathbf{U}_{i}^{n}\right\rVert,

if the flux limiter ϕ(r){\phi\left(r\right)} satisfies the Sweby criteria(Sweby, 1984):

(30) r<0,\displaystyle\forall r<0,\qquad ϕ(r)=0\displaystyle\phi\left(r\right)=0
(31) 0r12,\displaystyle\forall 0\leq r\leq\frac{1}{2},\qquad rϕ(r)2r,\displaystyle r\leq\phi\left(r\right)\leq 2r,
(32) 12r1,\displaystyle\forall\frac{1}{2}\leq r\leq 1,\qquad rϕ(r)1,\displaystyle r\leq\phi\left(r\right)\leq 1,
(33) 1r2,\displaystyle\forall 1\leq r\leq 2,\qquad 1ϕ(r)r,\displaystyle 1\leq\phi\left(r\right)\leq r,
(34) r>2,\displaystyle\forall r>2,\qquad 1ϕ(r)2,\displaystyle 1\leq\phi\left(r\right)\leq 2,

with ϕ(1)=1{\phi\left(1\right)=1}.

In what follows, we shall focus upon four standard flux limiters in particular, all of which had previously been implemented as part of the Gkeyll code, namely the minmod limiter(Roe, 1986):

(35) ϕmm(r)=max(0,min(1,r)),\phi_{mm}\left(r\right)=\max\left(0,\min\left(1,r\right)\right),

the monotonized-centered limiter(Van Leer, 1977):

(36) ϕmc(r)=max(0,min(2r,12(1+r),2)),\phi_{mc}\left(r\right)=\max\left(0,\min\left(2r,\frac{1}{2}\left(1+r\right),2\right)\right),

the superbee limiter(Roe, 1986):

(37) ϕsb(r)=max(0,min(2r,1),min(r,2)),\phi_{sb}\left(r\right)=\max\left(0,\min\left(2r,1\right),\min\left(r,2\right)\right),

and the van Leer limiter(Van Leer, 1974):

(38) ϕvl(r)=r+|r|1+|r|.\phi_{vl}\left(r\right)=\frac{r+\left\lvert r\right\rvert}{1+\left\lvert r\right\rvert}.

3. Methodology and Results

3.1. Automatic Code Generation

Before we proceed with formally verifying various properties of finite volume schemes in Racket, it is first necessary for us to be able to generate reliable C implementations which certifiably match the symbolic Racket expressions being reasoned about. To this end, we introduce a general data structure for representing hyperbolic PDE systems in Racket, consisting of four lists of symbolic Racket expressions: cons-exprs representing the conserved variable vector, flux-exprs representing the flux vector, max-speed-exprs representing the maximum wave-speed estimates (used for enforcing the CFL stability condition), and parameters representing any additional simulation parameters (such as equation of state variables). For example, the equations representing the density ρ{\rho} and xx-momentum ρu{\rho u} components of the isothermal Euler equation system are represented in our Racket implementation as follows, assuming a thermal velocity vth=1.0{v_{th}=1.0}:

(define pde-system-isothermal-euler
(hash
name "isothermal-euler"
cons-exprs (list rho, mom_x)
flux-exprs (list
mom_x
(+ (/ (* mom_x mom_x) rho)
(* rho vt vt)))
max-speed-exprs (list
(abs (- (/ mom_x rho) vt))
(abs (+ (/ mom_x rho) vt)))
parameters (list (define vt 1.0))))

Each of the Racket expressions in these lists may then be converted recursively into a string representing a functionally equivalent C expression, using the function convert-expr:

(define (convert-expr expr)
(match expr
[(? symbol? symb) (symbol->string symb)]
[(? number? num) (number->string num)]
...
[‘(abs ,arg)
(format "fabs(~a)" (convert-expr arg))]
...
[‘(+ . ,terms)
(let ([c-terms
(map convert-expr terms)])
(string-append "("
(string-join c-terms "+") ")"))]
...))

The base case of convert-expr converts any symbol or number directly into its corresponding string. Any single- or multi-argument function, e.g. (abs arg) or (max arg1 arg2), is converted into its C equivalent, e.g. fabs(arg) or fmax(arg1, arg2), with convert-expr being called on all interior expressions. Finally, any elementary arithmetic operation, e.g. (+ arg1 arg2 ...), has convert-expr mapped over each argument, and the results are interspersed with the corresponding arithmetic symbol, e.g. +, in C. We have generally erred on the side of over-generating parentheses in the resulting C code, in order to guarantee that the order of operations remains identical between the C and Racket versions of mathematical expressions. Conditional expressions in Racket are either converted into the corresponding ternary operators in C:

(match expr
[‘(cond
[,cond1 ,expr1]
[else ,expr2])
(format "(~a)?~a:~a"
(convert-expr cond1)
(convert-expr expr1)
(convert-expr expr2))])

or are converted directly into if statements. Finally, the strings generated by convert-expr are spliced into a template for a generic finite volume solver using format. Appropriate templates exist for both entirely standalone solvers, and for bespoke solver modules that can be integrated into the larger Gkeyll code.

3.2. Symbolic Theorem-Proving

At its core, our automated theorem-proving framework is based upon a symbolic simplification algorithm, which aims to reduce every symbolic Racket expression to some canonical algebraic form. Although such simplification algorithms are standard in computer algebra, our particular application makes this task non-trivial in two respects. First, we wish for our simplification algorithm to be based on a globally confluent(Robinson and Voronkov, 2001) and strongly normalizing(Baader and Nipkow, 1999) underlying rewriting system, since such rewriting systems exhibit highly desirable correctness and termination properties for the type of algebraic/equational theorem-proving with which we are concerned. This places certain restrictions on the kinds of rewriting rules that we are able to include, since many algebraically correct transformations, such as those corresponding to commutativity of addition or multiplication:

(match expr
[‘(+ ,x ,y) (+ ,y ,x)]
[‘(* ,x ,y) (* ,y ,x)])

cannot be safely included without risking breaking the strong normalization property of the rewriting system (and hence termination of the theorem-prover). Second, since the variables over which we are reasoning typically represent floating-point numbers, and specifically doubles in C, many standard algebraic rules, such as associativity of addition or multiplication:

(match expr
[‘(+ ,x (+ ,y, z)) (+ (+ ,x ,y) ,z)]
[‘(* ,x (* ,y ,z)) (* (* ,x ,y) ,z)])

cannot safely be assumed to hold (except in certain restricted cases) due to the accumulation of truncation errors. For instance, in floating-point arithmetic(Goldberg, 1991):

(39) (1030+1030)+1=1, yet 1030+(1030+1)=0.\left(10^{30}+-10^{30}\right)+1=1,\qquad\text{ yet }\qquad 10^{30}+\left(-10^{30}+1\right)=0.

To this end, we have tried wherever possible to admit only to those algebraic transformations that are permitted under the IEEE 754 standard for floating-point arithmetic(IEEE Computer Society et al., 2008).

The particular collection of algebraic rewriting rules used within our theorem-prover is somewhat complex and ad hoc, so we shall only summarize the salient elements here. The basic structure consists of a recursively-defined symbolic-simp-rule function of the form:

(define (symbolic-simp-rule expr)
(match expr
[‘(+ 0 ,x) ‘,x]
[‘(* 1 ,x) ‘,x]
[‘(* 0 ,x) 0]
...
[‘(+ . ,terms)
(+ ,@(map (lambda (term)
(symbolic-simp-rule term)) terms))]
...
[else expr]))

The first few rules shown above are examples of elementary algebraic properties(Bläsius and Bürckert, 1992), such as the existence of 0 as a (left) additive identity, the existence of 1 as a (left) multiplicative identity, the existence of 0 as a (left) annihilator for multiplication, etc. The next rule is an example of how symbolic-simp-rule is mapped over each term within an elementary arithmetic operation such as (+ arg1 arg2 ...) (similar mappings are performed for operations such as (abs arg) or (max arg1 arg2), with each subexpression being recursively simplified). Finally, if none of the rewriting rules match the expression, then the expression has reached a normal form and is returned verbatim. The symbolic simplifier itself then consists of a single function symbolic-simp which recursively calls symbolic-simp-rule until a fixed point is achieved (i.e. until the expression stops changing):

(define (symbolic-simp expr)
(define simp-expr (symbolic-simp-rule expr))
(cond
[(equal? simp-expr expr) expr]
[else (symbolic-simp simp-expr)]))

In order to facilitate the reduction of all symbolic expressions to a canonical form, rewriting rules exist to move all numerical constants or coefficients to the left of non-numerical expressions within sums or products:

(match expr
[‘(+ ,(and x (not (? number?)))
,(and y (? number?)))
(+ ,y ,x)]
[‘(* ,(and x (not (? number?)))
,(and y (? number?)))
(* ,y ,x)])

to collect “like” terms together within sums and differences (via the distributive property):

(match expr
[‘(+ (* ,a ,x) (* ,b ,x)) (* (+ ,a ,b) ,x)]
[‘(- (* ,a ,x) (* ,b ,x)) (* (- ,a ,b) ,x)])

and to evaluate any arithmetic expressions or operations involving purely numerical values directly:

(match expr
[‘(+ ,(and x (? number?))
,(and y (? number?))) (+ x y)]
...
[‘(sqrt ,(and x (? number?))) (sqrt x)]
...)

etc. A more complicated set of rules and heuristics exist regarding whether and when to expand brackets, factorize subexpressions, and so on. Algebraic rules are also defined for standard mathematical functions such as (sqrt ...) or (abs ...), stating for instance that the square root of the square of a quantity, or the square of the square root of a quantity, is equal to the quantity itself:

(match expr
[‘(sqrt (* ,x ,x)) ‘,x]
[‘(* (sqrt ,x) (sqrt ,x)) ‘,x])

or that the absolute value of the negation of a quantity is equal to the quantity itself:

(match expr
[‘(abs (* -1 ,x)) (abs ,x)])

or that the (max ...) and (min ...) functions satisfy (at least in the binary case):

(40) max(x,y)=12(x+y)+12|xy|,\max\left(x,y\right)=\frac{1}{2}\left(x+y\right)+\frac{1}{2}\left\lvert x-y\right\rvert,

and:

(41) min(x,y)=12(x+y)12|xy|,\min\left(x,y\right)=\frac{1}{2}\left(x+y\right)-\frac{1}{2}\left\lvert x-y\right\rvert,

respectively, i.e:

(match expr
[‘(max ,x ,y)
(+ (* 0.5 (+ ,x ,y))
(* 0.5 (abs (- ,x ,y))))]
[‘(min ,x ,y)
(- (* 0.5 (+ ,x ,y))
(* 0.5 (abs (- ,x ,y))))])

etc.

3.3. Automatic Differentiation

In order to compute symbolic derivatives of arbitrary Racket expressions, we implement a minimalistic automatic differentiation algorithm, again restricting ourselves to assume only those algebraic properties which hold for arbitrary floating-point numbers. Any Racket expression expr may then be differentiated symbolically with respect to the variable var, by means of the function symbolic-diff:

(define (symbolic-diff expr var)
(match expr
[(? symbol? symb) (cond
[(eq? symb var) 1.0]
[else 0.0])]
[(? number?) 0.0]
...
[‘(+ . ,terms)
(+ ,@(map (lambda (term)
(symbolic-diff term var)) terms))]
...))

The base case of symbolic-diff evaluates the derivative of any symbol or numerical constant to 0, unless that symbol matches the variable with respect to which one is differentiating, in which case it evaluates to 1. For any sum of the form (+ arg1 arg2 ...), symbolic-diff is mapped over each term, reflecting the linearity of differentiation (and likewise for differences). For any product of the form (* arg1 arg2 ...), symbolic-diff is applied to each term in the product separately (with all other terms being kept fixed), with the results then being summed together:

(match expr
[‘(* . ,terms)
((lambda (sums) (cond
[(null? (cdr sums)) (car sums)]
[else (cons ’+ sums)]))
(let loop ([i ])
(cond
[(= i (length terms)) ()]
[else (let ([di (symbolic-diff
(list-ref terms i) var)])
(cons (cons ’* (for/list
[(j (in-range (length terms))])
(cond
[(= j i) di]
[else (list-ref terms j)])))
(loop (add1 i))))])))])

reflecting the product rule of differentiation, etc. Certain standard mathematical functions, such as (sqrt ...), also have their derivatives specifically encoded wherever they are well-defined:

(match expr
[‘(sqrt ,x) (* 0.5 (/ 1.0 (sqrt ,x)))])

With the ability to differentiate arbitrary scalar functions thus in place, the symbolic Jacobian of a list of symbolic Racket expressions exprs, evaluated with respect to a list of symbolic Racket variables vars, may now be computed via a straightforward symbolic-jacobian function:

(define (symbolic-jacobian exprs vars)
(map (lambda (expr)
(map (lambda (var)
(symbolic-simp (symbolic-diff expr var)))
vars
exprs))

Likewise for the symbolic gradient of a single symbolic Racket expression expr, with respect to a list of symbolic Racket variables vars, via the symbolic-gradient function:

(define (symbolic-gradient expr vars)
(map (lambda (var)
(symbolic-simp (symbolic-diff expr var)))
vars))

The symbolic Hessian (symbolic-hessian) of a symbolic Racket expression may therefore be computed as a composition of the two:

(define (symbolic-hessian expr vars)
(symbolic-jacobian (symbolic-gradient expr
vars) vars))

3.4. Stability, Hyperbolicity and Convexity

In order to prove that a given Lax-Friedrichs solver meets the CFL stability criterion listed in Theorem 2.2, it is sufficient to compute the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} by evaluating:

(symbolic-jacobian flux-exprs cons-vars)

and then to compute its symbolic eigenvalues, which for instance can be done in the case of a 2x2 matrix using:

(define (symbolic-eigvals2 matrix)
(let ([a (list-ref (list-ref matrix 0) 0)]
[b (list-ref (list-ref matrix 0) 1)]
[c (list-ref (list-ref matrix 1) 0)]
[d (list-ref (list-ref matrix 1) 1)])
(list
(* 0.5 (+ (- ,a (sqrt (+ (* 4.0 ,b ,c)
(* (- ,a ,d) (- ,a ,d))))) ,d))
(* 0.5 (+ (+ ,a (sqrt (+ (* 4.0 ,b ,c)
(* (- ,a ,d) (- ,a ,d))))) ,d)))])))

where we have simply encoded the explicit solutions λ±{\lambda_{\pm}} of the characteristic polynomial for the 2x2 matrix:

(42) M=[abcd],M=\begin{bmatrix}a&b\\ c&d\end{bmatrix},

i.e:

(43) λ±=12(a+d±a2+4bc2ad+d2).\lambda_{\pm}=\frac{1}{2}\left(a+d\pm\sqrt{a^{2}+4bc-2ad+d^{2}}\right).

We can now proceed to apply (abs ...) to each symbolic eigenvalue, and then compare the absolute eigenvalues against the expressions in max-speed-exprs (after mapping symbolic-simp over the two lists of expressions, reducing them to their respective normal forms) in order to confirm that they are indeed identical. Since the time-steps Δt{\Delta t} within the generated C code are computed directly from the elements of max-speed-exprs as:

(44) Δt=CCFLΔx|a|,\Delta t=\frac{C_{CFL}\Delta x}{\left\lvert a\right\rvert},

where |a|{\left\lvert a\right\rvert} is the largest value in max-speed-exprs, this condition is sufficient to guarantee CFL stability under Theorem 2.2 provided that 0<CCFL1{0<C_{CFL}\leq 1}, which is also verified by the theorem-prover during the initialization step:

(cond
[(or (<= cfl 0) (> cfl 1)) #f]
...
[else #t])

In order to prove that a given Lax-Friedrichs solver meets the hyperbolicity-preservation criterion listed in Theorem 2.1, one must, furthermore, determine whether each of the symbolic eigenvalues of the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} corresponds to a real number. For this purpose, we introduce an is-real function:

(define (is-real expr cons-var parameters)
(match expr
[(? real?) #t]
...
[(? (lambda (arg)
(not (equal? (member arg cons-vars)
#f)))) #t]
...
[(? (lambda (arg)
(and (not (empty? parameters)) (ormap
(lambda (parameter) (equal? arg
(list-ref parameter 1)))
parameters)))) #t]
...
[(else #f)]))

The base case of is-real treats any real numerical constant as a real number, and any simulation parameter or conserved variable is also assumed to be real by default. This latter condition is then enforced during the simulation initialization step itself:

(cond
[(not (or (empty? parameters) (andmap
(lambda (parameter) (is-real
(list-ref parameter 2) (list cons-expr)
parameters)) parameters))) #f]
[(not (is-real init-func (list cons-expr)
parameters)) #f]
...
[else #t])

We enforce that the set of real numbers is closed under operations like addition, subtraction, and multiplication, e.g:

(match expr
[‘(+ . ,terms)
(andmap (lambda (term)
(is-real term cons-vars parameters))
terms)]
...)

etc., and also that the set of reals remains closed under division so long as the denominator is non-zero, and under square roots so long as the argument is non-negative; these latter two conditions are enforced via the additional functions is-non-zero and is-non-negative, which will be described momentarily.

Moreover, strict hyperbolicity-preservation of a given Lax-Friedrichs solver can be proven (in the 2x2 case) by proving that the symbolic eigenvalues of the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}} are not only real but also distinct, using the are-distinct function:

(define (are-distinct expr parameters)
(match expr
[(? (lambda (arg) (and (number?
(list-ref arg 0)) (number?
(list-ref arg 1))
(not (equal? (list-ref arg 0)
(list-ref arg 1)))))) #t]
...
[else #f]))

The base case of are-distinct treats any pair of non-equal numerical constants as distinct. Pairs of expressions of the form {x,x}{\left\{x,-x\right\}} or {x+y,xy}{\left\{x+y,x-y\right\}} are then also treated as distinct, provided that the expressions xx or yy are themselves non-zero, respectively:

(match expr
[‘(,x (* -1 ,x)) (is-non-zero x parameters)]
[‘((* -1 ,x) ,x) (is-non-zero x parameters)]
[‘((+ ,x ,y) (- ,x ,y))
(is-non-zero y parameters)]
[‘((- ,x ,y) (+ ,x ,y))
(is-non-zero y parameters)]
...)

where the function is-non-zero treats all non-zero numerical constants as non-zero, as its base case:

(define (is-non-zero expr parameters)
(match expr
[(? lambda (arg)
(and (number? arg) (not (equal? arg 0)))))
#t]
...
[else #f]))

It also treats all simulation parameters as non-zero, and enforces this condition, using similar logic to what was previously described for is-real. Finally, it treats the product of any two non-zero expressions as non-zero:

(match expr
[‘(* ,x ,y) (and (is-non-zero x parameters)
(is-non-zero y parameters))])

Finally, in order to prove that a given Lax-Friedrichs solver meets the local Lipschitz continuity criterion listed in Theorems 2.3 and 2.4, it is sufficient to compute the symbolic Hessian 𝐇f{\mathbf{H}_{f}} by evaluating:

(symbolic-hessian flux-expr cons-exprs)

for each flux-expr ff in the list flux-exprs, and then to compute its symbolic eigenvalues using symbolic-eigvals2 (at least in the 2x2 case), in order to confirm that each symbolic eigenvalue is non-negative. Non-negativity can be checked using the is-non-negative function:

(define (is-non-negative expr parameters)
(match expr
[(? lambda (arg)
(and (number? arg) (>= arg 0)))) #t]
...
[else #f]))

whose base case treats all non-negative numerical constants as non-negative. Moreover, we enforce that the sum, product or quotient of two non-negative numbers is always non-negative, e.g:

(match expr
[‘(* ,x ,y) (and
(is-non-negative x parameters)
(is-non-negative y parameters))]
...)

etc. Although we have described these techniques in the context of proving the hyperbolicity-preserving and strict hyperbolicity-preserving properties of Lax-Friedrichs solvers via Theorem 2.1, we note that the same techniques can be used to prove the hyperbolicity-preserving and strict hyperbolicity-preserving properties of Roe solvers also, via Theorem 2.5, by exploiting the fact that a valid symbolic Roe matrix 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)} can be calculated as an average of the two symbolic flux Jacobians:

(45) 𝐀(𝐔in,𝐔i+1n)=12[𝐔𝐅(𝐔in)+𝐔𝐅(𝐔i+1n)],\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)=\frac{1}{2}\left[\nabla_{\mathbf{U}}\mathbf{F}\left(\mathbf{U}_{i}^{n}\right)+\nabla_{\mathbf{U}}\mathbf{F}\left(\mathbf{U}_{i+1}^{n}\right)\right],

and the reality and distinctness of its eigenvalues can therefore be verified in exactly the same way as for 𝐉𝐅{\mathbf{J}_{\mathbf{F}}}. The flux conservation/jump continuity condition can be verified purely algebraically, by simply confirming that the two sides of the equation in Theorem 2.6 both reduce to the same canonical form using symbolic-simp.

3.5. Symbolic Limits and Symmetry

In order to determine whether a given flux limiter ϕ(r){\phi\left(r\right)} satisfies the symmetry condition presented in Theorem 2.7, it is necessary to perform a r1r{r\to\frac{1}{r}} variable transformation throughout the expression for ϕ(r){\phi\left(r\right)}, in order to determine whether this transformed expression is algebraically equivalent to ϕ(r)r{\frac{\phi\left(r\right)}{r}}. For this purpose, we use the recursively-defined variable-transform function:

(define (variable-transform expr var new-var)
(cond
[(symbol? expr) (cond
[(equal? expr var) new-var]
[else expr])]
[(pair? expr] (map (lambda (subexpr)
(variable-transform subexpr var new-var))
expr)]
[else expr]))

which applies itself recursively to all subexpressions, and replaces any subexpression it finds which matches var with a new subexpression matching new-var. For the second-order total variation diminishing (TVD) condition presented in Theorem 2.8, we use a strictly stronger set of conditions which imply (but are not equivalent to) the Sweby criteria, namely the limiting conditions that:

(46) 0limr0[ϕ(r)]1,1limr2[ϕ(r)]2,0\leq\lim_{r\to 0}\left[\phi\left(r\right)\right]\leq 1,\qquad 1\leq\lim_{r\to 2}\left[\phi\left(r\right)\right]\leq 2,
(47) limr1[ϕ(r)]=1,limr[ϕ(r)]2,\lim_{r\to 1}\left[\phi\left(r\right)\right]=1,\qquad\lim_{r\to\infty}\left[\phi\left(r\right)\right]\leq 2,

assuming that ϕ(r)=0{\phi\left(r\right)=0} for all r<0{r<0}, combined with the condition that ϕ(r){\phi\left(r\right)} be a (non-strictly) concave function:

(48) d2ϕ(r)dr20.\frac{d^{2}\phi\left(r\right)}{dr^{2}}\leq 0.

These symbolic limits of the form limxx0[f(x)]{\lim\limits_{x\to x_{0}}\left[f\left(x\right)\right]} are evaluated via the evaluate-limit function, which first performs a variable transformation xx0{x\to x_{0}} (using the extended reals x{,+}{x\in\mathbb{R}\cup\left\{-\infty,+\infty\right\}}), and then recursively simplifies until the limiting expression achieves a fixed point:

(define (evaluate-limit expr var limit)
(define limit-val
(variable-transform expr var limit))
(define limit-expr
(evaluate-limit-rule limit-val var limit))
(cond
[(equal? limit-expr expr) expr]
[else (evaluate-limit limit-expr var limit)]))

where evaluate-limit-rule encodes valid algebraic simplification rules over the extended reals (a specialized subset of the algebraic rules encoded by symbolic-simp-rule).

3.6. Results

For the two scalar PDEs (i.e. the linear advection and inviscid Burgers’ equations), the hyperbolicity-preservation, CFL stability and local Lipschitz continuity properties of the Lax-Friedrichs solver, and the hyperbolicity-preservation and flux conservation (jump continuity) properties of the Roe solver, can all be proved directly and without further complication, as outlined in Tables 1 and 2. For the two vector PDE systems (i.e. the perfectly hyperbolic Maxwell’s equations and isothermal Euler equations), slightly more work is required. In order to ensure that the theorem-prover never needs to manipulate any higher-dimensional (i.e. beyond 2x2) matrices, we first “factorize” these equation systems into coupled pairs of PDEs, with each pair being dealt with independently. Maxwell’s equations effectively “factorize” into four coupled pairs of linear advection equations, for the Ey{E^{y}} and Bz{B^{z}} components, the Ez{E^{z}} and By{B^{y}} components, the Ex{E^{x}} and ϕ{\phi} components, and the Bx{B^{x}} and ψ{\psi} components, respectively. The isothermal Euler equations effectively “factorize” into a non-linear pair of equations for the ρ{\rho} and ρu{\rho u} components, and a linear pair of equations for the ρv{\rho v} and ρw{\rho w} components (since the ρv{\rho v} and ρw{\rho w} momentum components can each be regarded as being advected linearly with a speed of uu at each time-step). As shown in Tables 3 and 4, for all four coupled systems constituting the perfectly hyperbolic Maxwell’s equations, the hyperbolicity-preservation, strict hyperbolicity-preservation, CFL stability and local Lipschitz continuity properties of the Lax-Friedrichs solver, and the hyperbolicity-preservation, strict hyperbolicity-preservation and flux conservation (jump continuity) properties of the Roe solver, can all be proved unproblematically. However, for the two coupled systems constituting the isothermal Euler equations, several properties cannot immediately be proven: for the Lax-Friedrichs solver, proofs cannot be found for the local Lipschitz continuity property for the ρ{\rho} and ρu{\rho u} components, or for the strict hyperbolicity-preservation property for the ρv{\rho v} and ρw{\rho w} components, while for the Roe solver, proofs cannot be found for any of the properties for the ρ{\rho} and ρu{\rho u} components, or for the strict hyperbolicity-preservation property for the ρv{\rho v} and ρw{\rho w} components. It is worth expanding upon each of these “failure” cases in greater detail.

Equation Hyperbolicity (Lax) Stability (Lax) Local Lipschitz (Lax)
Linear Advection 33 45 39
Inviscid Burgers’ 90 116 96
Table 1. Numbers of proof steps required to prove hyperbolicity-preservation, CFL stability and local Lipschitz continuity for the Lax-Friedrichs solver, across both the linear advection and inviscid Burgers’ scalar conservation equations.
Equation Hyperbolicity (Roe) Conservation (Roe)
Linear Advection 55 92
Inviscid Burgers’ 120 188
Table 2. Numbers of proof steps required to prove hyperbolicity-preservation and flux conservation (jump continuity) for the Roe solver, across both the linear advection and inviscid Burgers’ scalar conservation equations.
Equations Hyperbolicity (Lax) Strict Hyperbolicity (Lax) Stability (Lax) Local Lipschitz (Lax)
Maxwell’s (Ey{E^{y}} and Bz{B^{z}}) 499 502 575 272
Maxwell’s (Ez{E^{z}} and By{B^{y}}) 627 630 711 452
Maxwell’s (Ex{E^{x}} and ϕ{\phi}) 729 735 803 450
Maxwell’s (Bx{B^{x}} and ψ{\psi}) 731 737 805 450
Isothermal Euler (ρ{\rho} and ρu{\rho u}) 1462 1465 1558 -
Isothermal Euler (ρv{\rho v} and ρw{\rho w}) 1189 - 1329 251
Table 3. Numbers of proof steps (where applicable) required to prove hyperbolicity-preservation, strict hyperbolicity-preservation, CFL stability and local Lipschitz continuity for the Lax-Friedrichs solver, across all coupled pairs of components for the perfectly hyperbolic Maxwell’s and isothermal Euler equation systems.
Equations Hyperbolicity (Roe) Strict Hyperbolicity (Roe) Conservation (Roe)
Maxwell’s (Ey{E^{y}} and Bz{B^{z}}) 616 619 412
Maxwell’s (Ez{E^{z}} and By{B^{y}}) 826 829 643
Maxwell’s (Ex{E^{x}} and ϕ{\phi}) 871 877 642
Maxwell’s (Bx{B^{x}} and ψ{\psi}) 873 879 642
Isothermal Euler (ρ{\rho} and ρu{\rho u}) - - -
Isothermal Euler (ρv{\rho v} and ρw{\rho w}) 1315 - 498
Table 4. Numbers of proof steps (where applicable) required to prove hyperbolicity-preservation, strict hyperbolicity-preservation and flux conservation (jump continuity) for the Roe solver, across all coupled pairs of components for the perfectly hyperbolic Maxwell’s and isothermal Euler equation systems.
Flux Limiter Symmetry Second-Order TVD
minmod 863 513
monotonized-centered 4171 2251
superbee - 2125
van Leer 244 -
Table 5. Numbers of proof steps (where applicable) required to prove the symmetry and second-order total variation diminishing properties of the minmod, monotonized-centered, superbee and van Leer flux limiters.

By interrogating the attempted proof of local Lipschitz continuity for the Lax-Friedrichs solver for the ρ{\rho} and ρu{\rho u} components, we see that the theorem-prover succeeds in reducing the problem of proving flux convexity to the problem of proving that the inequality:

(49) 2((ρu)2+ρ2)ρ30,\frac{2\left(\left(\rho u\right)^{2}+\rho^{2}\right)}{\rho^{3}}\geq 0,

always holds. However, in the absence of any guarantee that ρ>0{\rho>0}, it is unable to proceed further. Thus, we see that the theorem-prover has correctly concluded that it is unable to guarantee local Lipschitz continuity of the flux function in the absence of the additional constraint that the fluid density ρ{\rho} always be strictly positive (which the solver in isolation does not guarantee). The theorem-prover is also correct to conclude that strict hyperbolicity-preservation for the Lax-Friedrichs solver for the ρv{\rho v} and ρw{\rho w} components does not hold, due to the presence of a repeated “uu” eigenvalue within the flux Jacobian 𝐉𝐅{\mathbf{J}_{\mathbf{F}}}. Likewise, by interrogating the attempted proofs of hyperbolicity- and strict hyperbolicity-preservation for the Roe solver for the ρ{\rho} and ρu{\rho u} components, we see that the theorem-prover reduces these problems to the problem of proving that the quantities:

(50) λ±=12ρL2ρR2[ρLρR((ρRuR)ρL+(ρLuL)ρR)]±12ρL2ρR2[ρL2ρR2((ρRuR)ρL(ρLuL)ρR)2+ρ"L4ρR4vth2],\lambda_{\pm}=\frac{1}{2\rho_{L}^{2}\rho_{R}^{2}}\left[\rho_{L}\rho_{R}\left(\left(\rho_{R}u_{R}\right)\rho_{L}+\left(\rho_{L}u_{L}\right)\rho_{R}\right)\right]\\ \pm\frac{1}{2\rho_{L}^{2}\rho_{R}^{2}}\left[\sqrt{-\rho_{L}^{2}\rho_{R}^{2}\left(\left(\rho_{R}u_{R}\right)\rho_{L}-\left(\rho_{L}u_{L}\right)\rho_{R}\right)^{2}+\rho_{"L}^{4}\rho_{R}^{4}v_{th}^{2}}\right],

are always real and distinct, which itself can only be true if the inequality:

(51) 4ρL4ρR4vth2ρL2ρR2((ρRuR)ρL(ρLuL)ρR)2,4\rho_{L}^{4}\rho_{R}^{4}v_{th}^{2}\geq\rho_{L}^{2}\rho_{R}^{2}\left(\left(\rho_{R}u_{R}\right)\rho_{L}-\left(\rho_{L}u_{L}\right)\rho_{R}\right)^{2},

is satisfied, where ρL{\rho_{L}}, ρLuL{\rho_{L}u_{L}} and ρR{\rho_{R}}, ρRuR{\rho_{R}u_{R}} denote the fluid density ρ{\rho} and fluid momentum ρu{\rho u} within the left and right cells xi{x_{i}} and xi+1{x_{i+1}}, respectively. Therefore, once again, we find that the theorem-prover correctly determines that these properties cannot be guaranteed in the absence of some form of positivity restriction on the fluid density ρ{\rho}. Similarly, the presence of the repeated “uu” eigenvalue within the Roe matrix 𝐀(𝐔in,𝐔i+1n){\mathbf{A}\left(\mathbf{U}_{i}^{n},\mathbf{U}_{i+1}^{n}\right)} for the ρv{\rho v} and ρw{\rho w} components implies that strict hyperbolicity-preservation does not hold here either. Hence, we see that the only property for which the theorem-prover truly fails (i.e. where it does not succeed in finding a proof for a statement which is unconditionally true) is the flux conservation/jump continuity condition for the Roe solver for the ρ{\rho} and ρu{\rho u} components.

For the minmod and monotonized-centered flux limiters, the symmetry and second-order TVD properties can both be proved directly and unproblematically, as shown in Table 5. However, we see that the theorem-prover fails to find valid proofs for the symmetry property of the superbee limiter, and the second-order TVD property of the van Leer limiter. As in the case of the flux conservation condition for the isothermal Euler Roe solver, this is due entirely to present algebraic limitations of the simplification algorithm (since these properties certainly do hold, unconditionally, in the case of these limiters); these limitations can presumably be circumvented via the judicious introduction of stronger symbolic simplification rules into symbolic-simp-rule and related functions.

4. Conclusions and Future Work

In this paper, we have introduced a new formal verification pipeline in Racket for first-order hyperbolic PDE solvers, with a particular emphasis upon finite volume, high-resolution shock-capturing methods. Although the resulting automated theorem-proving framework still exhibits some notable limitations, we see that it is nevertheless able to produce full proofs of correctness for several linear and non-linear hyperbolic PDE solvers (with both first- and second-order spatial accuracy), and to produce conditional/partial proofs of correctness for others. These general correctness results encompass both mathematical (e.g. hyperbolicity-preservation) and physical (e.g. thermodynamic validity) notions of correctness. At present, this pipeline constitutes around 15,000 lines of Racket in total, although the vast majority of this is boilerplate for the purposes of synthesizing functionally complete C code (both in the standalone case, and for integration into the Gkeyll codebase, which includes automatic synthesis of header files, regression tests, etc.): the core theorem-proving, automatic differentiation, and symbolic limit evaluation routines fit within just a few hundred lines of Racket each, and it is likely that these can all be optimized further. We consider this work to be a successful proof-of-concept, representing a solid foundation upon which further such verification pipelines may be built, expanding into a wider variety of numerical solvers, equation systems, reconstruction algorithms, and discretization schemes.

In addition to reinforcing the weak points in the existing theorem-prover, such as adding new and more powerful rewriting rules (for instance, those needed to complete the proofs of correctness for the superbee and van Leer flux limiters) and introducing more systematic techniques for proving conditional results (such as those needed to complete the formalization of the conditional correctness proofs for the isothermal Euler solvers), we intend to expand this overall framework in several key directions. One such direction involves introducing formal verification tools for ordinary differential equation (ODE) integrators too, including the kinds of both explicit (e.g. strong stability-preserving Runge-Kutta(Gottlieb et al., 2001)) and implicit (e.g. time-centered Crank-Nicolson) ODE integrators used within the Gkeyll code, for instance when coupling hydrodynamic and electromagnetic PDE systems together(Wang et al., 2020) or handling geometric source terms in general relativity(Gorard et al., 2024). Being able to automate the deduction of properties such as absolute stability regions for explicit Runge-Kutta integrators would, in itself, be an important and highly useful advance. Another major frontier of expansion would be the formalization of the kinds of modal discontinuous Galerkin (DG) algorithms used for solving kinetic equations within codes such as Gkeyll(Juno et al., 2018), for which properties like L2{L^{2}} stability and entropy convexity are significantly more subtle and fragile than they are in the case of finite volume solvers, depending sensitively upon particular choices of basis functions(Juno, 2020), etc. Overall, it is hoped that the construction of formally verified simulations, of the kind described here, will become an increasingly pervasive methodology throughout scientific computing in general, and within computational physics in particular.

Acknowledgements.
J.G. was partially funded by the Princeton University Research Computing group. J.G. and A.H. were partially funded by the U.S. Department of Energy under Contract No. DE-AC02-09CH1146 via an LDRD grant. The development of Gkeyll was partially funded by the NSF-CSSI program, Award Number 2209471. J.G. thanks Nikola Bukowiecka for her proofreading and suggestions.

References

  • (1)
  • Auger and Plagnol (2017) Gerard Auger and Eric Plagnol. 2017. An overview of gravitational waves: theory, sources and detection. World scientific, New Jersey.
  • Baader and Nipkow (1999) Franz Baader and Tobias Nipkow. 1999. Term rewriting and all that (1st paperback edition ed.). Cambridge University Press, Cambridge New York Melbourne Madrid Cape Town.
  • Bläsius and Bürckert (1992) Karl Hans Bläsius and Hans-Jürgen Bürckert (Eds.). 1992. Deduktionssysteme: Automatisierung des logischen Denkens (2., völlig überarbeitete und erweiterte auflage ed.). Oldenbourg, München Wien.
  • Breuß (2004) Michael Breuß. 2004. The correct use of the Lax–Friedrichs method. ESAIM: Mathematical Modelling and Numerical Analysis 38, 3 (May 2004), 519–540. doi:10.1051/m2an:2004027
  • Courant et al. (1967) R. Courant, K. Friedrichs, and H. Lewy. 1967. On the Partial Difference Equations of Mathematical Physics. IBM Journal of Research and Development 11, 2 (March 1967), 215–234. doi:10.1147/rd.112.0215
  • Felleisen et al. (2015) Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay McCarthy, and Sam Tobin-Hochstadt. 2015. The Racket Manifesto. In 1st Summit on Advances in Programming Languages (SNAPL 2015) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 32), Thomas Ball, Rastislav Bodik, Shriram Krishnamurthi, Benjamin S. Lerner, and Greg Morriset (Eds.). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 113–128. doi:10.4230/LIPIcs.SNAPL.2015.113
  • Fickett (1985) Wildon Fickett. 1985. Introduction to detonation theory. Univ. of California Pr, Berkeley.
  • Goldberg (1991) David Goldberg. 1991. What every computer scientist should know about floating-point arithmetic. Comput. Surveys 23, 1 (March 1991), 5–48. doi:10.1145/103162.103163
  • Gorard (2024) Jonathan Gorard. 2024. Computational General Relativity in the Wolfram Language using Gravitas II: ADM Formalism and Numerical Relativity. arXiv:2401.14209 [gr-qc] https://arxiv.org/abs/2401.14209
  • Gorard et al. (2024) Jonathan Gorard, Ammar Hakim, James Juno, and Jason M. TenBarge. 2024. A Tetrad-First Approach to Robust Numerical Algorithms in General Relativity. arXiv:2410.02549 [gr-qc] https://arxiv.org/abs/2410.02549
  • Gottlieb et al. (2001) Sigal Gottlieb, Chi-Wang Shu, and Eitan Tadmor. 2001. Strong Stability-Preserving High-Order Time Discretization Methods. SIAM Rev. 43, 1 (Jan. 2001), 89–112. doi:10.1137/S003614450036757X
  • Hakim et al. (2006) A. Hakim, J. Loverich, and U. Shumlak. 2006. A high resolution wave propagation scheme for ideal Two-Fluid plasma equations. J. Comput. Phys. 219, 1 (Nov. 2006), 418–442. doi:10.1016/j.jcp.2006.03.036
  • Harten (1983) Ami Harten. 1983. High resolution schemes for hyperbolic conservation laws. J. Comput. Phys. 49, 3 (March 1983), 357–393. doi:10.1016/0021-9991(83)90136-5
  • Harten et al. (1976) A. Harten, J. M. Hyman, P. D. Lax, and B. Keyfitz. 1976. On finite‐difference approximations and entropy conditions for shocks. Communications on Pure and Applied Mathematics 29, 3 (May 1976), 297–322. doi:10.1002/cpa.3160290305
  • Hartman (1960) Philip Hartman. 1960. A lemma in the theory of structural stability of differential equations. Proc. Amer. Math. Soc. 11, 4 (Aug. 1960), 610–620. doi:10.1090/S0002-9939-1960-0121542-7
  • IEEE Computer Society et al. (2008) IEEE Computer Society, Institute of Electrical and Electronics Engineers, and IEEE-SA Standards Board (Eds.). 2008. IEEE standard for floating-point arithmetic. Institute of Electrical and Electronics Engineers, New York, NY.
  • Juno (2020) James Juno. 2020. A Deep Dive into the Distribution Function: Understanding Phase Space Dynamics with Continuum Vlasov-Maxwell Simulations. arXiv:2005.13539 [physics.plasm-ph] https://arxiv.org/abs/2005.13539
  • Juno et al. (2018) J. Juno, A. Hakim, J. TenBarge, E. Shi, and W. Dorland. 2018. Discontinuous Galerkin algorithms for fully kinetic plasmas. J. Comput. Phys. 353 (Jan. 2018), 110–147. doi:10.1016/j.jcp.2017.10.009
  • Laney (1998) Culbert B. Laney. 1998. Computational Gasdynamics (1 ed.). Cambridge University Press. doi:10.1017/CBO9780511605604
  • Lax (1954) Peter D. Lax. 1954. Weak solutions of nonlinear hyperbolic equations and their numerical computation. Communications on Pure and Applied Mathematics 7, 1 (Feb. 1954), 159–193. doi:10.1002/cpa.3160070112
  • LeVeque (1992) Randall J. LeVeque. 1992. Numerical Methods for Conservation Laws. Birkhäuser Basel, Basel. doi:10.1007/978-3-0348-8629-1
  • LeVeque (2011) Randall J. LeVeque. 2011. Finite volume methods for hyperbolic problems (10. printing ed.). Cambridge Univ. Press, Cambridge.
  • Munz et al. (2000) C.-D. Munz, P. Omnes, R. Schneider, E. Sonnendrücker, and U. Voß. 2000. Divergence Correction Techniques for Maxwell Solvers Based on a Hyperbolic Model. J. Comput. Phys. 161, 2 (July 2000), 484–511. doi:10.1006/jcph.2000.6507
  • Musha and Higuchi (1978) Toshimitsu Musha and Hideyo Higuchi. 1978. Traffic Current Fluctuation and the Burgers Equation. Japanese Journal of Applied Physics 17, 5 (May 1978), 811–816. doi:10.1143/JJAP.17.811
  • Osher (1984) Stanley Osher. 1984. Riemann Solvers, the Entropy Condition, and Difference Approximations. SIAM J. Numer. Anal. 21, 2 (April 1984), 217–235. doi:10.1137/0721016
  • Robinson and Voronkov (2001) John Alan Robinson and Andrei Voronkov. 2001. Handbook of automated reasoning. Elsevier MIT Press, Amsterdam New York Cambridge, Mass.
  • Roe (1981) P.L Roe. 1981. Approximate Riemann solvers, parameter vectors, and difference schemes. J. Comput. Phys. 43, 2 (Oct. 1981), 357–372. doi:10.1016/0021-9991(81)90128-5
  • Roe (1986) P L Roe. 1986. Characteristic-Based Schemes for the Euler Equations. Annual Review of Fluid Mechanics 18, 1 (Jan. 1986), 337–365. doi:10.1146/annurev.fl.18.010186.002005
  • Sweby (1984) P. K. Sweby. 1984. High Resolution Schemes Using Flux Limiters for Hyperbolic Conservation Laws. SIAM J. Numer. Anal. 21, 5 (Oct. 1984), 995–1011. doi:10.1137/0721062
  • Toro (2009) E. F. Toro. 2009. Riemann solvers and numerical methods for fluid dynamics: a practical introduction (3rd ed ed.). Springer, Dordrecht New York.
  • Toro and Billett (2000) E. F. Toro and S. J. Billett. 2000. Centred TVD schemes for hyperbolic conservation laws. IMA J. Numer. Anal. 20, 1 (Jan. 2000), 47–79. doi:10.1093/imanum/20.1.47
  • Van Leer (1974) Bram Van Leer. 1974. Towards the ultimate conservative difference scheme. II. Monotonicity and conservation combined in a second-order scheme. J. Comput. Phys. 14, 4 (March 1974), 361–370. doi:10.1016/0021-9991(74)90019-9
  • Van Leer (1977) Bram Van Leer. 1977. Towards the ultimate conservative difference scheme III. Upstream-centered finite-difference schemes for ideal compressible flow. J. Comput. Phys. 23, 3 (March 1977), 263–275. doi:10.1016/0021-9991(77)90094-8
  • Van Leer (1979) Bram Van Leer. 1979. Towards the ultimate conservative difference scheme. V. A second-order sequel to Godunov’s method. J. Comput. Phys. 32, 1 (July 1979), 101–136. doi:10.1016/0021-9991(79)90145-1
  • Vreugdenhil (1994) C. B. Vreugdenhil. 1994. Numerical Methods for Shallow-Water Flow. Water Science and Technology Library, Vol. 13. Springer Netherlands, Dordrecht. doi:10.1007/978-94-015-8354-1
  • Wang et al. (2020) Liang Wang, Ammar H. Hakim, Jonathan Ng, Chuanfei Dong, and Kai Germaschewski. 2020. Exact and locally implicit source term solvers for multifluid-Maxwell systems. J. Comput. Phys. 415 (Aug. 2020), 109510. doi:10.1016/j.jcp.2020.109510
  • Wesseling (2001) Pieter Wesseling. 2001. Principles of Computational Fluid Dynamics. Springer Series in Computational Mathematics, Vol. 29. Springer Berlin Heidelberg, Berlin, Heidelberg. doi:10.1007/978-3-642-05146-3