Gyre/Mathematics & Numerical Methods
Boundary conditions
In one minuteBoundary 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.
Every boundary face is treated like an interior face whose exterior data are supplied by a boundary function of the interior trace , the outward normal and the flow parameters. Each boundary function returns three states:
- — handed to the interface Riemann flux;
- — the boundary state for viscous fluxes and gradient lifting (or none).
| condition | inviscid flux | viscous treatment |
|---|---|---|
farfield |
Riemann flux between and the free stream | interior gradient, no lifting |
slip_wall, symmetry |
, normal momentum removed | no viscous flux |
slip_wall_mirror |
Riemann flux against the mirrored state | no viscous flux |
noslip_adiabatic |
, zero velocity | lifted, zero heat flux |
noslip_isothermal |
as above with wall temperature t_wall |
, lifted |
pressure_outlet |
with (interior if supersonic) | interior gradient |
total_inlet |
from total pressure/temperature and flow angle, interior static pressure | interior gradient |
Three conditions read data from the flow parameters: noslip_isothermal the wall temperature
t_wall, pressure_outlet the back pressure p_back and total_inlet the total pressure and
temperature pt_in, tt_in, all as ratios to the free-stream static values. A condition whose
data are missing is rejected with an error that names the boundary group, the condition and the
key.
For walls and for the internal-flow inlet/outlet conditions Gyre sets . Any consistent numerical flux then returns exactly the physical flux of the boundary state, , with no dissipation. For a slip wall
so the wall flux is a pure pressure force with . Following Hartmann and Leicht, a boundary flux of the form , combined with functionals evaluated from the same boundary flux, yields an adjoint-consistent discretization: the discrete adjoint is a consistent discretization of the continuous adjoint problem including its boundary conditions. The mirrored-ghost-state alternative is available for comparison but is not adjoint consistent in this sense.
Forces are not recomputed from interpolated pressure. SurfaceOps.face_forces calls the
residual kernel with faces=True and integrates the momentum components of the numerical
boundary flux — inviscid minus viscous — that the residual itself used. Two consequences:
- the force is discretely conservative: summing the surface loads and the far-field momentum flux reproduces the residual sum exactly;
- the functional is adjoint consistent, a prerequisite for the superconvergence measured in the output-error study.
The boundary state keeps density and total energy and sets the velocity to zero, (adiabatic), or replaces the energy by (isothermal). Velocity (and wall temperature) enter the BR2 lifting as Dirichlet data, ; the viscous boundary flux is , with the energy component removed for adiabatic walls (zero heat flux and zero velocity leave no energy transfer). The numerical energy flux through an adiabatic wall is therefore zero by construction, for any state. The cylinder validation checks instead that the wall heat conduction of the converged solution, the flux that is removed, decreases between the two highest polynomial degrees; it vanishes for the exact solution.
Boundary functions are ordinary JAX code of . Their
dependence on flow parameters (the free-stream state in farfield, the back pressure in
pressure_outlet) and on geometry (through ) is therefore differentiated together with
everything else. The linearization study verifies JVPs, VJPs and the block preconditioner for
every wall type, the mirrored slip wall (slip_wall_mirror) with each interface flux
included, for a channel mixing four different conditions and for an inlet/outlet channel
(total_inlet, pressure_outlet, symmetry, slip_wall_mirror).
| configuration | p | DOF | JVP vs FD (rel.) | dot-product (rel.) | |B⁻¹ J_ee - I| | split residual defect |
|---|---|---|---|---|---|---|
| Euler, slip wall | 2 | 432 | 5.3652e-10 | 7.4656e-16 | 6.7502e-14 | 0 |
| NS, adiabatic wall | 2 | 432 | 3.7139e-10 | 7.5418e-15 | 1.2397e-14 | 0 |
| NS, isothermal wall | 2 | 432 | 3.1571e-10 | 1.0274e-13 | 1.6348e-14 | 0 |
| NS, mixed channel | 3 | 576 | 5.2611e-10 | 4.3341e-16 | 1.4949e-14 | 0 |
| Euler, mirrored slip wall | 2 | 432 | 1.9949e-10 | 1.0578e-13 | 5.6843e-14 | 0 |
| Euler, mirrored slip wall, HLLC flux | 2 | 432 | 5.6037e-10 | 7.5694e-14 | 2.4869e-14 | 0 |
| Euler, mirrored slip wall, LLF flux | 2 | 432 | 1.3770e-10 | 1.4703e-15 | 1.1713e-14 | 0 |
| Euler, inlet/outlet channel | 2 | 324 | 2.1088e-10 | 1.2508e-13 | 5.3846e-15 | 0 |
| Euler, mirrored slip wall, ES-Roe flux | 2 | 432 | 1.8848e-10 | 1.3925e-14 | 3.8192e-14 | 0 |
| NS, adiabatic wall, ES-Roe flux | 2 | 432 | 3.0017e-10 | 2.9248e-15 | 1.6784e-14 | 0 |
gyre 0.4.0 · 39979fcf90 · · cpu · quick suite · record (JSON)Same code as this build