Gyre/Mathematics & Numerical Methods
Viscous terms — the BR2 scheme
In one minuteViscous fluxes use the second scheme of Bassi and Rebay with lifting operators evaluated on Gauss–Lobatto nodes. The discretization is compact (face neighbours only) and symmetric, which the implicit solver and the adjoint both rely on.
A discontinuous solution has no gradient at element faces, and using only element-interior gradients gives an inconsistent — and unstable — diffusion operator. Gyre uses the BR2 scheme: the gradient is corrected by lifting the solution jumps at faces into the elements.
Let be the gradient variables and the element-local (strong, non-conservative) gradient. For each face of an element define the face lifting, non-zero only at that face’s nodes:
The scheme then uses two different gradients:
and the divergence of the volume flux is taken in weak form with , the adjoint of in the quadrature inner product. Using only the face’s own lifting in the face flux (rather than the full , as BR1 does) is what keeps the stencil compact.
Because the LGL mass matrix is diagonal, the lifting relation is satisfied pointwise by the formula above — no linear solve. Summing the volume term over the two elements adjacent to a face gives, for a linear flux ,
which is the mirror image of the consistency term produced by the face flux, and the penalty term is symmetric positive semi-definite. The discrete operator is therefore the symmetric BR2 bilinear form evaluated with LGL quadrature. Symmetry is not cosmetic: it is the discrete statement of adjoint consistency, the property that lets functionals converge faster than the solution and makes the output error estimate sharp.
The requirement that the gradient (, strong, non-conservative) and divergence (, weak) be exact adjoints is why Gyre mixes the two forms rather than using one throughout.
| warp | boundaries | p | asym. (heat) | asym. (stress) | min eig (heat) | min eig (stress) |
|---|---|---|---|---|---|---|
| 0 | periodic | 2 | 2.7046e-16 | 2.0254e-16 | -5.4470e-16 | 6.5560e-16 |
| 0 | periodic | 3 | 2.2839e-16 | 2.5421e-16 | 1.1123e-16 | -1.8926e-15 |
| 0 | Dirichlet | 2 | 7.9058e-17 | 1.1709e-16 | 0.0423156 | 0.0252442 |
| 0 | Dirichlet | 3 | 6.5254e-17 | 1.4417e-16 | 0.0246366 | 0.0147011 |
| 0.05 | periodic | 2 | 1.9043e-16 | 2.8210e-16 | 1.5375e-15 | 5.5369e-17 |
| 0.05 | periodic | 3 | 2.3864e-16 | 2.9273e-16 | 1.1192e-15 | -5.0847e-16 |
| 0.05 | Dirichlet | 2 | 5.4250e-17 | 1.5964e-16 | 0.0417777 | 0.0247796 |
| 0.05 | Dirichlet | 3 | 1.3399e-16 | 1.6369e-16 | 0.0242548 | 0.0143994 |
gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build
The coercivity proofs for BR2 (Brezzi, Manzini, Marini, Pietra and Russo 2000; Arnold, Brezzi,
Cockburn and Marini 2002) need strictly greater than the number of faces of an
element; at equality the argument gives only a non-negative, not a coercive, form. Gyre’s
default is the customary borderline value (4 for quadrilaterals, 6 for hexahedra),
which lies on the edge of the proven range, not inside it. The proofs are also for exact
integration, whereas Gyre uses Gauss–Lobatto quadrature. No instability has been observed with
the default in the tests and studies; the value is an input of the discretization
(Discretization(..., eta_br2=...) in Python) for anyone who wants to be inside the proven
range. At the finite-volume level there is no interior
gradient and the lifting alone carries the viscous flux. With it is the two-point
difference along the face normal: exact on uniform spacing, too large by
between cells of widths and . The gradient components
tangential to a face, and with them the cross-derivative terms of the stress, are absent. The
viscous operator is therefore a p-multigrid preconditioner level, not a consistent
Navier–Stokes discretization, and cannot be selected as the solution degree of a viscous case.
The residual of an element depends only on itself and its face neighbours. This is verified by inspecting the sparsity of a dense AD Jacobian, and it is what allows the element-diagonal blocks used by the preconditioner to be extracted exactly with the split-argument trick.
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
The diffusion operator on its own reaches the design rate: heat conduction in a quiescent gas converges at , and an independent one-dimensional implementation of exactly this formulation converges at for every degree (study). For the coupled compressible Navier–Stokes system in a diffusion-dominated regime the state converges at a reduced rate between and , with pressure the slowest variable. Convection-dominated flows recover approximately . The reduced rate is a measurement; its cause has not been established.
Hypothesis. When diffusion dominates, the momentum and energy equations behave like an equal-order discretization of a Stokes-like system, in which the pressure-like variables are controlled only through the velocity divergence and lose one order.
Evidence for.
- The diffusion operator alone reaches : heat conduction in a quiescent gas, and an independent one-dimensional BR2 model that includes the nonlinear work term.
- The viscous operator is symmetric to round-off, so the loss is not an adjoint-inconsistency of the implementation.
- Pressure is the slowest variable and the loss shrinks as convection takes over, which is the pattern the hypothesis predicts.
Evidence against, and what is missing.
- In the compressible equations solved here pressure is a thermodynamic variable, not a Lagrange multiplier of a divergence constraint. The manufactured solution runs at Mach 0.5, far from the incompressible limit in which the Stokes argument is exact.
- Nothing in the repository isolates the mechanism. Three other candidates are present in this very discretization and have not been excluded: under-integration of the BR2 form by Gauss–Lobatto quadrature, the penalty sitting exactly on the coercivity bound (see above), and the non-conservative gradient in .
- The studies that would discriminate — the rate against Mach number, Gauss against Gauss–Lobatto quadrature, a sweep of — have not been run.
Until they are, treat the rates in the table as the fact and the explanation as a conjecture.