Manufactured Solution: Viscous (Navier–Stokes)

verification

Manufactured velocity field
Velocity-magnitude of the manufactured solution on a plane of the finest grid, a smooth sinusoidal field with non-zero gradients in every direction.

Overview

The Method of Manufactured Solutions checks that a discretization is implemented as intended and attains its theoretical order of accuracy. Rather than seeking a physically meaningful flow, one prescribes a smooth analytic field, inserts it into the governing equations, and analytically derives the source term required to make that field an exact solution. Running the solver with those sources yields a problem whose answer is known at every point, so the error can be measured directly and its convergence under grid refinement compared against the scheme's design order. This case exercises the compressible Navier–Stokes path, convection, viscous diffusion, and the energy equation together.

Problem Setup

The manufactured field is a smooth, fully three-dimensional sinusoid chosen so that every primitive variable has non-zero gradients in all directions and the flow stays subsonic and realizable. Writing ϕ=π(x+y+z), the primitive variables are

p=cosϕ+3,u=v=w=sinϕ+3,T=(cosϕ+3)2,

with density from the ideal-gas law ρ=p/(RT). The amplitude is 3 and the wavenumber is π; the gas constant follows from the molecular weight. The source terms that make this field satisfy the equations are formed analytically and added to the residual; viscosity and thermal conductivity are constant. The domain is the unit cube, discretized by a family of uniform hexahedral grids at 83, 163, 323, 643 cells, each a 2× refinement of the last, so the global grid size h=(1/N)1/3 halves at every level. Each grid is converged until the iterative residual is several orders below the discretization error, so the measured error is spatial.

Quantities of Interest

For each grid the solver reports the error of every conservative equation, mass, the three momentum components, and energy, as an L2 norm over the domain. The verification examines two quantities: the decay of the error on a log–log plot of error against h relative to the design slope of 2, and the observed order of accuracy, computed from the error ratio between successive grids. Across the four grids the momentum equations give observed orders of 2.310, 2.138, and 2.043, approaching 2 from above; the mass equation gives 1.870, 1.942, and 1.935; and the energy equation gives 1.743, 1.791, and 1.804. On the finest pair of grids the observed order is 2.0 for momentum, 1.9 for mass, and 1.8 for energy.

Results

Discretization error vs grid size

Discretization error vs grid size
L2 norm of the error in each conservative equation vs grid size h=(1/N)1/3; the black dotted line is the design slope of 2.

Observed order of accuracy

Observed order of accuracy
Order of accuracy between successive grids for each equation; the momentum equations reach the design order of 2 (dotted line) and mass and energy approach it from below under refinement.

Observed order of accuracy per equation

Equation512→40964096→3276832768→262144
Mass (ρ) 1.8701.9421.935
x-momentum (ρu) 2.3102.1382.043
y-momentum (ρv) 2.3102.1382.043
z-momentum (ρw) 2.3102.1382.043
Energy (ρE) 1.7431.7911.804

Solver configuration

features exercised
Verification3DLaminarIdeal gasSteadyEnergy equation