Gyredocs
Depth Practice
API

Gyre/Verification

Discrete invariants

In one minuteSummation by parts, free-stream preservation, conservation and entropy conservation are algebraic identities of the scheme. They hold to round-off, in two and three dimensions, on curved meshes.

Written at L2 Practice goes to L3 Mechanics 1872 words Markdown

These studies do not measure convergence; they check identities that are either satisfied to machine precision or broken.

Summation-by-parts operators#

PassedSummation-by-parts operators1 of 1 checks passed · 0.29 s · quick suite

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

Maximum defects per polynomial degreeSummation-by-parts operators
pSBPquadrature (deg <= 2p-1)differentiationskew(M S)Pi I - 1
100002.2204e-16
202.2204e-16004.9960e-16
33.3307e-165.5511e-178.8818e-164.4409e-160
41.1102e-153.3307e-161.7764e-158.8818e-164.4409e-16
51.3866e-152.2204e-162.6645e-151.9984e-154.4409e-16
62.2128e-151.9429e-164.4409e-151.5543e-154.4409e-15
71.8936e-151.1102e-163.1086e-152.2204e-151.8874e-15
82.5535e-154.4409e-166.2172e-153.7748e-151.1423e-15

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

For every polynomial degree: the SBP identity MD+(MD)T=B\mathbf M\mathbf D + (\mathbf M\mathbf D)^{\mathsf T} = \mathbf B; exactness of LGL quadrature up to degree 2p−12p-1 (and, in the unit tests, inexactness at 2p2p); exact differentiation of polynomials up to degree pp; skew-symmetry of the flux-differencing matrix MS\mathbf M\mathbf S; and that projection after prolongation is the identity on the coarse space of the p-multigrid transfers.

Free-stream preservation#

PassedFree-stream preservation on curved meshes1 of 1 checks passed · 18.67 s · quick suite

A uniform flow must remain an exact steady state on arbitrarily curved elements. This requires discrete metric identities: cross-product metrics in 2-D and the conservative-curl form in 3-D. Meshes are smoothly warped periodic boxes (6 % amplitude); the table reports the largest weak residual of the uniform state and the closure of each element's discrete surface (geometric conservation law).

  • max |Rw| of uniform flow and GCL defect2.91e-15expected < 1e-11pass

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

Uniform-flow residual on warped meshesFree-stream preservation on curved meshes
dimelementspgeometry degreeviscousmin J / max Jmax |Rw|surface closure
2-D6x534no0.4510471.3492e-153.0531e-16
2-D6x534yes0.4510471.3368e-153.0531e-16
2-D4x454no0.4535562.8560e-154.9960e-16
2-D4x454yes0.4535562.9091e-154.9960e-16
3-D3x3x322no0.2761592.6316e-163.4694e-17
3-D3x3x322yes0.2761592.6316e-163.4694e-17
3-D3x3x333no0.4170893.2526e-166.9823e-17
3-D3x3x333yes0.4170893.2823e-166.9823e-17

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

In three dimensions the naive cross-product metrics break the discrete metric identities on curved elements; the conservative curl form restores them. The 3-D rows of the table are therefore a direct test of that construction. The last column is the closure of each element’s discrete surface, ∑faces∫n dS=0\sum_\text{faces}\int \mathbf n\,\mathrm dS = 0, the geometric conservation law.

Conservation and entropy#

PassedEntropy conservation and stability41 of 41 checks passed · 15.77 s · quick suite

The rate of change of the discrete mathematical entropy, -w^T Rw, is evaluated on warped periodic meshes for combinations of two-point volume fluxes and interface fluxes. The state is a periodic field carrying a 3 % node-wise perturbation, so it jumps across every element face, the curved interior faces included. Split-form DGSEM with an entropy-conservative two-point flux satisfies a discrete entropy balance exactly for any nodal state: the checks require the rate to vanish to round-off for the entropy-conservative pairings, to be clearly non-zero for the volume fluxes that are not entropy conservative, and to be negative, well above round-off, when an upwind interface flux adds dissipation. A second table tests the interface fluxes alone on random pairs of states far apart: the entropy-stable ones (llf, es_roe) must produce no entropy for any pair, which is the property the proof rests on; the classical solvers are shown for comparison.

  • 2-D ranocha / ec: |d/dt entropy|5.98e-15expected < 1e-11pass
  • 2-D ranocha / ec: conservation defect4.46e-14expected < 1e-11pass
  • 2-D chandrashekar / ec: |d/dt entropy|8.10e-15expected < 1e-11pass
  • 2-D chandrashekar / ec: conservation defect4.88e-14expected < 1e-11pass
  • 2-D kennedy_gruber / ec: not entropy conservative5.98e-04expected > 1e-8pass
  • 2-D kennedy_gruber / ec: conservation defect4.24e-14expected < 1e-11pass
  • 2-D central / ec: not entropy conservative4.57e-04expected > 1e-8pass
  • 2-D central / ec: conservation defect4.31e-14expected < 1e-11pass
  • 2-D ranocha / llf: entropy dissipated-0.0551expected < -1e-8pass
  • 2-D ranocha / llf: conservation defect4.66e-14expected < 1e-11pass
  • 2-D ranocha / es_roe: entropy dissipated-0.01835expected < -1e-8pass
  • 2-D ranocha / es_roe: conservation defect4.46e-14expected < 1e-11pass
  • 2-D chandrashekar / es_roe: entropy dissipated-0.01835expected < -1e-8pass
  • 2-D chandrashekar / es_roe: conservation defect4.73e-14expected < 1e-11pass
  • 2-D ranocha / roe: entropy dissipated-0.01835expected < -1e-8pass
  • 2-D ranocha / roe: conservation defect4.13e-14expected < 1e-11pass
  • 2-D ranocha / hllc: entropy dissipated-0.01834expected < -1e-8pass
  • 2-D ranocha / hllc: conservation defect4.09e-14expected < 1e-11pass
  • 3-D ranocha / ec: |d/dt entropy|3.69e-15expected < 1e-11pass
  • 3-D ranocha / ec: conservation defect1.20e-14expected < 1e-11pass
  • 3-D chandrashekar / ec: |d/dt entropy|3.52e-15expected < 1e-11pass
  • 3-D chandrashekar / ec: conservation defect1.17e-14expected < 1e-11pass
  • 3-D kennedy_gruber / ec: not entropy conservative0.001198expected > 1e-8pass
  • 3-D kennedy_gruber / ec: conservation defect2.69e-15expected < 1e-11pass
  • 3-D central / ec: not entropy conservative0.007444expected > 1e-8pass
  • 3-D central / ec: conservation defect1.82e-15expected < 1e-11pass
  • 3-D ranocha / llf: entropy dissipated-0.05432expected < -1e-8pass
  • 3-D ranocha / llf: conservation defect1.18e-14expected < 1e-11pass
  • 3-D ranocha / es_roe: entropy dissipated-0.01778expected < -1e-8pass
  • 3-D ranocha / es_roe: conservation defect1.16e-14expected < 1e-11pass
  • 3-D chandrashekar / es_roe: entropy dissipated-0.01778expected < -1e-8pass
  • 3-D chandrashekar / es_roe: conservation defect1.23e-14expected < 1e-11pass
  • 3-D ranocha / roe: entropy dissipated-0.01783expected < -1e-8pass
  • 3-D ranocha / roe: conservation defect1.36e-15expected < 1e-11pass
  • 3-D ranocha / hllc: entropy dissipated-0.01782expected < -1e-8pass
  • 3-D ranocha / hllc: conservation defect8.19e-16expected < 1e-11pass
  • 2-D llf: largest two-state entropy production over 5000 random pairs-0.05717expected < 0pass
  • 2-D es_roe: largest two-state entropy production over 5000 random pairs-0.03018expected < 0pass
  • 3-D llf: largest two-state entropy production over 5000 random pairs-0.2282expected < 0pass
  • 3-D es_roe: largest two-state entropy production over 5000 random pairs-0.04117expected < 0pass
  • classical solvers (roe, hllc) violate the two-state inequality for some pairs (cases of 4)2expected >= 1 (why they carry no proof)pass

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

Entropy production rate by flux pairingEntropy conservation and stability

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 flux2-D3-D
ranocha / ec5.9781e-153.6880e-15
chandrashekar / ec8.0969e-153.5232e-15
kennedy_gruber / ec5.9810e-040.00119758
central / ec4.5667e-040.00744448
ranocha / llf0.05509530.0543174
ranocha / es_roe0.01834930.0177799
chandrashekar / es_roe0.01834930.0177799
ranocha / roe0.01834870.0178301
ranocha / hllc0.01834480.0178184

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

Entropy rate and conservation defectEntropy conservation and stability
dimvolume fluxinterface fluxd/dt ∫ η|Σ Rw|
2-Dranochaec-5.9781e-154.4631e-14
2-Dchandrashekarec-8.0969e-154.8850e-14
2-Dkennedy_gruberec-5.9810e-044.2411e-14
2-Dcentralec-4.5667e-044.3077e-14
2-Dranochallf-0.05509534.6629e-14
2-Dranochaes_roe-0.01834934.4631e-14
2-Dchandrashekares_roe-0.01834934.7296e-14
2-Dranocharoe-0.01834874.1300e-14
2-Dranochahllc-0.01834484.0856e-14
3-Dranochaec-3.6880e-151.1970e-14
3-Dchandrashekarec-3.5232e-151.1685e-14
3-Dkennedy_gruberec-0.001197582.6854e-15
3-Dcentralec-0.007444481.8180e-15
3-Dranochallf-0.05431741.1796e-14
3-Dranochaes_roe-0.01777991.1602e-14
3-Dchandrashekares_roe-0.01777991.2261e-14
3-Dranocharoe-0.01783011.3600e-15
3-Dranochahllc-0.01781848.1879e-16

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

The state of the study is a smooth periodic field with a node-wise random perturbation of 3 %, so every interface carries a jump and the interface flux is exercised on every face, curved interior faces included.

With an entropy-conservative volume flux and a dissipation-free interface flux (ec), the discrete entropy changes only at round-off level on a warped mesh — it is conserved. The Kennedy–Gruber and central fluxes, which are not entropy conservative, produce or destroy entropy at a rate many orders of magnitude larger (see the table). With upwind interface fluxes (llf, es_roe, roe, hllc) the rate must be negative with a margin: the check requires a rate below −10−8-10^{-8}, three orders above the tolerance of the conservative pairings, so that a round-off value of either sign cannot pass. Entropy is dissipated, as the second law requires. For small jumps the matrix dissipation of es_roe removes entropy at the rate of the classical Roe flux, about a third of the scalar dissipation of llf in this study.

Entropy production of the interface flux alone, random state pairs (Ranocha two-point flux)Entropy conservation and stability
diminterface fluxpairslargest productionpairs with production > 0 [%]
2-Dllf5000-0.05717050
2-Des_roe5000-0.03017790
2-Droe50001365.0618.5
2-Dhllc5000-0.01565710
3-Dllf5000-0.2281960
3-Des_roe5000-0.04117140
3-Droe5000812.67619.18
3-Dhllc5000-0.04019140

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

The second table tests the interface fluxes alone, on random pairs of states far apart: the entropy-stable fluxes produce no entropy for any pair, the classical Roe flux does for a share of them (why). In every case mass, momentum and energy are conserved to round-off.

Structure of the viscous operator#

PassedStructure of the BR2 viscous operator17 of 17 checks passed · 116.9 s · quick suite

At a quiescent state the energy–energy and momentum–momentum blocks of the weak-form Jacobian are exactly the discrete heat-conduction and viscous-stress operators. Their symmetry (the hallmark of an adjoint-consistent diffusion discretization) and positive semi-definiteness are checked on Cartesian and warped meshes with periodic and Dirichlet boundaries, and the Jacobian sparsity pattern is checked to be compact (face neighbours only), which element-block preconditioning relies on.

  • warp=0.0, periodic, p=2: asymmetry2.70e-16expected < 1e-12pass
  • warp=0.0, periodic, p=2: smallest eigenvalue-5.45e-16expected >= -1e-12pass
  • warp=0.0, periodic, p=3: asymmetry2.54e-16expected < 1e-12pass
  • warp=0.0, periodic, p=3: smallest eigenvalue-1.89e-15expected >= -1e-12pass
  • warp=0.0, Dirichlet, p=2: asymmetry1.17e-16expected < 1e-12pass
  • warp=0.0, Dirichlet, p=2: smallest eigenvalue0.02524expected >= -1e-12pass
  • warp=0.0, Dirichlet, p=3: asymmetry1.44e-16expected < 1e-12pass
  • warp=0.0, Dirichlet, p=3: smallest eigenvalue0.0147expected >= -1e-12pass
  • warp=0.05, periodic, p=2: asymmetry2.82e-16expected < 1e-12pass
  • warp=0.05, periodic, p=2: smallest eigenvalue5.54e-17expected >= -1e-12pass
  • warp=0.05, periodic, p=3: asymmetry2.93e-16expected < 1e-12pass
  • warp=0.05, periodic, p=3: smallest eigenvalue-5.08e-16expected >= -1e-12pass
  • warp=0.05, Dirichlet, p=2: asymmetry1.60e-16expected < 1e-12pass
  • warp=0.05, Dirichlet, p=2: smallest eigenvalue0.02478expected >= -1e-12pass
  • warp=0.05, Dirichlet, p=3: asymmetry1.64e-16expected < 1e-12pass
  • warp=0.05, Dirichlet, p=3: smallest eigenvalue0.0144expected >= -1e-12pass
  • element couplings outside the face-neighbour stencil0expected == 0pass

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

Relative asymmetry and smallest eigenvalueStructure of the BR2 viscous operator
warpboundariespasym. (heat)asym. (stress)min eig (heat)min eig (stress)
0periodic22.7046e-162.0254e-16-5.4470e-166.5560e-16
0periodic32.2839e-162.5421e-161.1123e-16-1.8926e-15
0Dirichlet27.9058e-171.1709e-160.04231560.0252442
0Dirichlet36.5254e-171.4417e-160.02463660.0147011
0.05periodic21.9043e-162.8210e-161.5375e-155.5369e-17
0.05periodic32.3864e-162.9273e-161.1192e-15-5.0847e-16
0.05Dirichlet25.4250e-171.5964e-160.04177770.0247796
0.05Dirichlet31.3399e-161.6369e-160.02425480.0143994

gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build

At a quiescent state the energy–energy block of the Jacobian is the discrete heat-conduction operator and the momentum–momentum block is the discrete viscous-stress operator (including the cross-derivative coupling). Both are symmetric to round-off and positive semi-definite, on warped meshes and with Dirichlet walls. A separate check confirms that the full Jacobian only couples face neighbours.

    ↑ ↓ moveEnter open[ ] change depthResults show section and depth level