Gyre/Mathematics & Numerical Methods
Split-form DG spectral elements
In one minuteSpace is discretized by a nodal discontinuous Galerkin spectral element method on Gauss–Lobatto points. Its derivative operator satisfies summation by parts, which lets the volume terms be written as differences of symmetric two-point fluxes and gives discrete conservation and entropy statements on curved meshes.
The domain is partitioned into curved quadrilateral or hexahedral elements. Each element is the image of the reference cube under a polynomial mapping , and the solution is a tensor-product polynomial of degree in , stored by its values at the Legendre–Gauss–Lobatto (LGL) nodes. Neighbouring elements are coupled only through numerical fluxes on shared faces — the solution may jump across them.
Using the same LGL points for interpolation and quadrature makes three things true at once:
- the mass matrix is diagonal, , so no linear system is needed to evaluate a time derivative;
- face values are simply nodal values (the end points are nodes), so no interpolation to faces;
- the derivative matrix with satisfies summation by parts (SBP), the discrete integration-by-parts identity below.
The price is that LGL quadrature with points is exact only to degree , one short of what the mass matrix of degree- polynomials needs. The split form turns this weakness into a controlled one.
For nodal vectors this is : integration by parts, exactly, for the discrete inner product. Every stability and conservation property of the scheme is a consequence of this identity; none relies on exact integration. The verification study “Summation-by-parts operators” checks it to round-off for all degrees in use.
Gauss–Lobatto collocation operators: the SBP identity M D + (M D)^T = B, quadrature exactness to degree 2p-1, exact differentiation of degree-p polynomials, skew-symmetry of the flux-differencing matrix M S and consistency of the p-multigrid transfers.
- largest defect over all identities and degrees6.22e-15expected < 1e-11pass
gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build
From the strong form to flux differencing#
In reference coordinates a conservation law reads with contravariant fluxes (see curvilinear metrics). The standard strong-form DGSEM applies to the nodal fluxes and penalises the difference between the numerical flux and the interior flux at the two end nodes of each line of nodes.
Gyre replaces the derivative of the nodal flux by a flux-differencing operator. Along one line of nodes in direction , at node :
where is a symmetric, consistent two-point flux and the contravariant two-point flux uses the average of the metric terms at the two nodes, . The last term lifts the interface flux onto the two face nodes with the factor ( is the surface Jacobian, the outward normal).
Two remarks make this concrete:
- is skew-symmetric and has a zero diagonal. The interior-flux boundary correction of the strong form has been absorbed into using consistency, .
- With the arithmetic-mean flux (option
central) the scheme is algebraically identical to the standard strong-form DGSEM on elements whose metric terms are constant along each node line (affine elements). On a curved element it is not: because the metric terms are averaged as well, the volume term is , which differs from the standard by . Therecentralis the metric-split form of Gassner, Winters and Kopriva (2016), which is still conservative and free-stream preserving. Other choices of correspond to split (skew-symmetric) forms of the nonlinear terms, which is where the name comes from.
Conservation. Multiply the volume term by and sum over : because is skew-symmetric and is symmetric, . Only the interface fluxes remain, and they cancel between neighbours for any conservative .
Entropy. Contract with the entropy variables instead. Skew-symmetry gives If the two-point flux satisfies Tadmor’s condition , the right-hand side telescopes, by SBP, to boundary values of the entropy potential — exactly the discrete counterpart of . No quadrature exactness was used, so the statement survives the aliasing of LGL collocation and, with metric averaging and discretely divergence-free metrics, holds on curved elements. With an entropy-conservative interface flux the semi-discrete scheme conserves to round-off.
Entropy decay needs a condition on the interface flux. What remains after the telescoping is,
per interior face, . The total entropy decays if this is non-positive for every pair of states, i.e. if
is itself entropy stable. The llf flux is: it is the entropy-conservative
flux minus , and because the entropy is convex. So is
es_roe, which subtracts a symmetric positive semi-definite matrix applied to
and keeps the wave-by-wave dissipation of Roe’s solver. The default
roe flux and hllc are not built on the entropy-conservative flux and no such inequality is
proven for them; that their entropy rate is negative in the chart below is a measurement on
the states of the study. The argument also covers only the inviscid terms on interior or
periodic faces, with positive density and pressure; see
which combinations are provably entropy stable.
Measured here: with an entropy-conservative volume flux and the dissipation-free interface flux the entropy rate is at most 8.1e-15 in magnitude; with the upwind interface fluxes it lies between -5.5e-02 and -1.8e-02.
Data table
| volume flux / interface flux | 2-D | 3-D |
|---|---|---|
| ranocha / ec | 5.9781e-15 | 3.6880e-15 |
| chandrashekar / ec | 8.0969e-15 | 3.5232e-15 |
| kennedy_gruber / ec | 5.9810e-04 | 0.00119758 |
| central / ec | 4.5667e-04 | 0.00744448 |
| ranocha / llf | 0.0550953 | 0.0543174 |
| ranocha / es_roe | 0.0183493 | 0.0177799 |
| chandrashekar / es_roe | 0.0183493 | 0.0177799 |
| ranocha / roe | 0.0183487 | 0.0178301 |
| ranocha / hllc | 0.0183448 | 0.0178184 |
gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build
A naive implementation evaluates for all ordered node pairs per line.
Since is symmetric and , only the unordered pairs are
needed. Basis1D.pair_tables() returns index vectors iL, iR and a matrix C so that the
flux-differencing sum is one gather, one batched flux evaluation and one small matrix product
per direction:
f = phys.flux_volume(jnp.take(U, iL, axis=ax), jnp.take(U, iR, axis=ax),
0.5 * (jnp.take(Ja[a], iL, axis=ax) + jnp.take(Ja[a], iR, axis=ax)), th)
JR = JR + apply_1d(f, C, ax) # C[i, q] = S[i, m] for pair q = {i, m}
The same code runs for and : the array has nodal axes and the loop runs over them. For this more than halves the cost of the dominant kernel (6 pairs instead of 16).
For smooth solutions the design order of accuracy is . Gyre’s verification studies show:
- for linear-in-effect problems and for steady inviscid manufactured solutions on Cartesian meshes;
- between and for the strongly nonlinear unsteady isentropic vortex, and somewhat below on strongly warped coarse meshes — reduced rates of this kind are a known characteristic of Gauss–Lobatto collocation;
- in viscous, diffusion-dominated flow, reduced rates between and with pressure the slowest variable (see order of accuracy).
Data table
| h | p = 1 | p = 2 | p = 3 | p = 4 |
|---|---|---|---|---|
| 0.125 | 0.0244511 | 0.00125525 | 5.2276e-05 | 2.0736e-06 |
| 0.0625 | 0.00716847 | 1.6201e-04 | 3.4487e-06 | 6.8806e-08 |
| 0.03125 | 0.00188612 | 2.0333e-05 | 2.1592e-07 | 2.1334e-09 |
gyre 0.4.0 · 39979fcf90 · · gpu · NVIDIA GeForce RTX 3060 Ti · quick suite · record (JSON)Same code as this build