The method of manufactured solutions
How a solver is held to an answer that is exact by construction. You choose the solution first, then derive the forcing that makes it true.
The problem it solves
Verification asks a narrow question: does the code solve the equations it claims to solve? Answering it needs a problem whose answer is already known exactly, so that the difference between the computed field and the true one is the solver’s own discretization error and nothing else.
The difficulty is that almost nothing has a closed-form answer. The Navier–Stokes equations admit exact solutions only in a handful of idealised settings, and the cases in group 1 of our programme are close to the whole published list. None of them exercises a solver the way a real problem does: no complicated geometry, no coupling between many terms at once, no awkward boundaries.
The method of manufactured solutions removes the constraint by turning the question around. Instead of hunting for a problem whose answer is known, you pick the answer and then construct the problem it solves.
Incompressible Navier–Stokes, steady, written as an operator
How it works
Write the governing equations as an operator acting on the solution, so that the true solution is the field making the operator vanish. Now choose any smooth field you like. It will not satisfy the equations, and the amount by which it fails is something you can compute exactly, by hand or symbolically. Call that residual the source term.
Add the source term to the right-hand side and you have a new problem, one you invented, whose exact solution is the field you chose. Solve it numerically, compare against the field you started from, and the difference is pure discretization error.
The construction, for a chosen field u*
The chosen field also supplies the boundary conditions: evaluate it on the boundary and impose that. Nothing in the procedure is approximate, which is the whole point. There is no reference solution on a very fine mesh standing in for the truth, and no experimental uncertainty to argue about.
A worked example
Take the steady incompressible equations above on the unit square and choose a divergence-free velocity with a matching pressure. The velocity has to be divergence-free or the chosen field would contradict continuity, which no source term in the momentum equation can repair.
The chosen solution
Substituting gives a tidy result. Each velocity component is an eigenfunction of the Laplacian, so diffusion reduces to a multiple of the velocity itself. The convective term collapses to a single sine, and with this pressure it is cancelled exactly by the pressure gradient. What remains is the viscous term alone.
The source term that follows
That cancellation is elegant, and it is also a warning. A test in which convection and pressure annihilate each other is not exercising either of them: a solver could discretize both badly, in exactly offsetting ways, and still pass. So a real suite perturbs the choice, with incommensurate wavenumbers and a pressure unrelated to the velocity, until every term in the equation makes a non-zero contribution to the source. The neat example is for reading; the useful one is deliberately untidy.
Why it is a strict test
Because the chosen field can be made to vary in every direction and in time, one manufactured case can put every term of the discretization under load at once: convection, diffusion, the pressure and velocity coupling, the time integration and the boundary treatment. A bug that quietly drops a term, or applies a boundary condition one cell out of place, does not merely shift the answer. It lowers the order of accuracy, and the refinement study reads that off as a slope.
This is why the order is the number worth reporting rather than the error on any single mesh. An error can be made to look small by running a fine mesh on a forgiving problem. An order is a rate, and a scheme either achieves its design rate or it does not.
| What a manufactured case exercises | How a defect shows up |
|---|---|
| Convection | Order falls below the design rate as the mesh refines |
| Diffusion | Error stops falling once the viscous term dominates |
| Pressure coupling | Velocity converges but pressure does not |
| Boundary treatment | Interior order is clean, global order is not |
| Time integration | Order holds under mesh refinement, fails under timestep refinement |
Each row is a failure mode the method separates, which is why the cases report more than one norm.
What it does not prove
The method is verification, not validation. It establishes that the code solves its equations correctly. It says nothing about whether those equations describe the flow you care about: a perfectly verified laminar solver is still the wrong tool for a turbulent wake. That is why the programme pairs this work with canonical benchmarks and real applications.
It has practical limits too. The chosen field must be smooth enough for the derivatives the equations ask for, so it cannot represent a shock or a sharp corner. The source term has to be evaluated independently of the discretization being tested, or the test flatters itself. And the manufactured problem is not physical: the source term is a mathematical device, not a force anything applies, so the field may well look nothing like a flow.
How we use it
Manufactured solutions underpin the order-of-accuracy group of our validation programme, and they run as part of the solver’s own test suite rather than as an occasional exercise, so a change that costs accuracy is caught when it is made rather than discovered later.
The published cases pair them with the genuine closed-form solutions, which are the stronger evidence where they exist, because nobody has to accept that the source term was derived correctly.