---
title: "Mathematics & Numerical Methods"
summary: "The equations Gyre solves and the numerical methods it uses — split-form DG spectral elements, entropy-conservative fluxes, curvilinear metrics, BR2 viscous terms, the Spalart–Allmaras turbulence closure, shock capturing, the implicit solver, adjoints and output error estimation — with derivations."
section: theory
order: 0
level: 1
keywords: [theory]
---
<!-- gyre docs: expanded Markdown of theory/index.md (generated tables, verification numbers and chart data are written out). Base level of this page: L1 Essentials; passages at another level are bracketed by 'begin level N' / 'end level N' comments and start with [LN Name]. Built from revision ceb1f4b0be. -->

Each page states the method at a practical level and keeps derivations and proofs at depth 4. Claims are tied to the verification studies that test them, and a statement that is a theorem is given with its conditions: where the default configuration is outside those conditions, the page says so.

- [Governing equations](governing-equations.md) (L2 Practice): Gyre solves the compressible Euler and Navier–Stokes equations in conservation form, non-dimensionalised by the free stream, and uses their entropy structure as the organising principle of the discretization.
- [Split-form DG spectral elements](dgsem.md) (L2 Practice): Space 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.
- [Two-point and interface fluxes](two-point-fluxes.md) (L2 Practice): The volume terms use symmetric two-point fluxes that conserve entropy exactly; dissipation is added only at element interfaces through an upwind flux. A discrete entropy inequality is proven for the two interface fluxes built on the entropy-conservative flux (es_roe with matrix dissipation, llf with scalar dissipation); for the classical Roe flux, which is the default, and for HLLC entropy decay is measured, not proven.
- [Curvilinear elements and metric terms](curvilinear-metrics.md) (L2 Practice): Elements are curved with the same polynomial technology as the solution. Metric terms are computed so that a uniform flow stays exactly uniform on any mesh, and they are evaluated inside the differentiated code so that shape derivatives come for free.
- [Viscous terms — the BR2 scheme](viscous-br2.md) (L3 Mechanics): Viscous 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.
- [Boundary conditions](boundary-conditions.md) (L2 Practice): Boundary conditions are imposed weakly through the same numerical fluxes as interior faces. Walls use a boundary state rather than a ghost-cell Riemann problem, which keeps force functionals adjoint consistent.
- [Implicit solver](implicit-solver.md) (L2 Practice): Steady states are found by pseudo-transient Newton–Krylov iteration. The Jacobian is never formed — its action comes from automatic differentiation — and it is preconditioned by p-multigrid with element-block-Jacobi smoothing whose blocks are also obtained by AD.
- [Adjoints and sensitivities](adjoint-and-sensitivities.md) (L2 Practice): Gyre computes exact derivatives of outputs with respect to flow parameters and surface shape with one transposed linear solve per output. All partial derivatives come from automatic differentiation of the discrete operators, so gradients are consistent with the solver to solver tolerance.
- [Output error estimation](error-estimation.md) (L3 Mechanics): The adjoint that provides gradients also measures how much each element's unresolved residual contaminates an output. One extra linear solve yields an error estimate, a corrected output and per-element indicators.
- [Shock capturing](shock-capturing.md) (L2 Practice): Flows with shocks are stabilised by an artificial viscosity that a smoothness sensor switches on only in the elements containing a shock. The term lives inside the differentiated residual, so Newton convergence and adjoint derivatives stay exact.
- [Turbulence closure (RANS, Spalart–Allmaras)](turbulence-model.md) (L2 Practice): Turbulent flows are computed with the Reynolds-averaged equations closed by the negative Spalart–Allmaras model. The model equation is one more row of the same discrete operator, so the Newton linearisation, the adjoint and the shape derivatives (including the wall distance) remain exact.
- [Outputs and functionals](outputs-and-functionals.md) (L2 Practice): The definition, sign convention, normalisation and units of every output name a result can contain — force and moment coefficients, heat, the volume diagnostics, the surface load field and the surface distributions.
