MMS: Compressible Euler Equations

Category: Analysis | Integrated 2026-04-06
CAE visualization for mms euler theory - technical simulation diagram
MMS: Compressible Euler Equations

Theoretical Foundations of MMS for the Compressible Euler Equations

Conservative Form and What Gets Verified

The compressible Euler equations are a conservation-law system for density, momentum, and total energy (two-dimensional, with source terms):

$$ \frac{\partial \mathbf{Q}}{\partial t} + \nabla\cdot\mathbf{F}(\mathbf{Q}) = \mathbf{S}, \qquad \mathbf{Q} = \begin{pmatrix} \rho \\ \rho\mathbf{u} \\ E \end{pmatrix}, \quad E = \frac{p}{\gamma - 1} + \frac{1}{2}\rho|\mathbf{u}|^2 $$

In MMS you pick a manufactured solution in the primitive variables \( (\rho_m, \mathbf{u}_m, p_m) \), substitute it into the left-hand side of the conservative form, and read off the source terms \( \mathbf{S} = (s_\rho, \mathbf{s}_{\rho u}, s_E) \) for each equation. With no viscous terms the derivation is shorter than for Navier-Stokes, but the difficulties peculiar to a hyperbolic system — characteristic-based boundary conditions, positivity, and interaction with shock-capturing schemes — are where the real verification battle is fought.

Designing the Manufactured Solution — Positivity and Smoothness

🙋

I plugged in a sine-based manufactured solution the same way I would for heat conduction, and the run died instantly on negative pressure.


🎓

That is the compressible MMS initiation rite. In the Euler system density and pressure must be physically positive, and solvers are built assuming exactly that. So the standard move is to design the manufactured solution as "a constant plus a small-amplitude perturbation" — something like \( \rho_m = \rho_0\,[1 + 0.1\sin(\pi x)\cos(\pi y)] \), keeping the fluctuation amplitude at 10-20% of the reference value so that \( \rho_m > 0,\ p_m > 0 \) is guaranteed everywhere. The Mach number distribution is part of the design too: decide up front whether the field is uniformly subsonic or uniformly supersonic, because the boundary treatment is completely different.

Characteristic Theory and How Many Conditions to Impose

In a hyperbolic system the number of conditions you may impose at a boundary is set by the number of incoming characteristics. For two-dimensional Euler the characteristic speeds are \( u_n - c,\ u_n,\ u_n,\ u_n + c \) — four of them, with \( c \) the speed of sound — and the count changes with the flow state at the boundary.

Boundary stateIncoming characteristics (2-D)Example of what to impose
Supersonic inflow4 (all)All variables set from the manufactured solution
Subsonic inflow3e.g. total temperature, total pressure, flow angle (one variable extrapolated from the interior)
Subsonic outflow1e.g. static pressure only; everything else extrapolated
Supersonic outflow0Everything extrapolated (impose nothing)

MMS obeys the same rule: correct verification means supplying manufactured values for only as many conditions as you are allowed to impose. Fixing every variable with Dirichlet data on every boundary over-specifies the subsonic case, producing a non-physical error layer near the boundary that contaminates the observed order. This is the single most common failure in compressible MMS.

Deriving Source Terms and Verifying Order

Derive in the Conservative Form

Derive the source terms in the form the solver actually discretizes. A finite volume solver is solving the conservative form, so deriving and injecting source terms for a non-conservative form written in primitive variables is poor verification practice even though the two are equivalent at the continuous level. With SymPy or similar the workflow is: (1) define the manufactured solution in primitive variables, (2) build the conservative variables and fluxes symbolically, (3) differentiate \( \partial_t \mathbf{Q} + \nabla\cdot\mathbf{F} \) to obtain each equation's source term, (4) apply common subexpression elimination and generate code. The energy source term is the longest, because pressure work and the derivative of kinetic energy both enter it, so always run a random-point cross-check against numerical differentiation.

Measure with Limiters and Artificial Viscosity Disabled

Compressible solvers ship with limiters and artificial viscosity for shock capturing. These can activate even on a smooth solution and locally drop the order to first, obstructing verification of the scheme's intrinsic order. The discipline is two-stage:

  1. Stage 1: confirm the nominal order with limiters off (or with a limiter that is inactive in smooth regions) — this verifies the discretization itself
  2. Stage 2: record how much order survives under production settings (limiters on) — this characterizes the error behavior you actually ship with. Losing order here is by design; the point is to know how much you lose

Evaluate Error Variable by Variable

Compute error norms separately for \( \rho, \rho u, \rho v, E \) (or the primitive variables \( \rho, u, v, p \)) and make every variable converging at the nominal order the pass criterion. If only one variable is low-order, the defect narrows down to the boundary treatment or flux evaluation involving that variable — energy alone being low, for instance, typically points to insufficient order in the temperature or pressure extrapolation at boundaries. When time integration is involved, separate the spatial and temporal verification just as with NS-MMS.

Applying It in Practice

Structure of a Standard Verification Campaign

  1. 2-D subsonic MMS — a smooth field around Mach 0.3-0.5; confirm the order with characteristic boundaries (3 conditions on inflow, 1 on outflow) implemented
  2. 2-D supersonic MMS — around Mach 1.5-3; fully specified inflow and fully extrapolated outflow exercise the other boundary path
  3. Extension to 3-D — a manufactured solution with different wavenumbers per direction catches dimension-specific bugs such as swapped indices
  4. Re-measurement under production settings — record the effective order with limiters and artificial viscosity enabled

These four cover the main paths: flux evaluation, boundary treatment, and the move to multiple dimensions. If you want to verify walls (slip boundaries), decide at the outset whether to design the manufactured velocity field to be wall-parallel at the boundary, or to treat the wall as a source-term boundary that permits transpiration.

Using MASA and Known Exact Solutions

The MASA library contains verified manufactured solutions for the Euler equations (2-D and 3-D, subsonic designs), which are useful as a cross-check against your own derivation. The compressible world also has an exact solution in the advecting isentropic vortex, a standard benchmark that measures the order of the time-evolution scheme without any source-term injection. "Isentropic vortex to confirm the basics, then MMS to cover boundaries and every term" is the practical two-step structure of a code verification campaign.

Reporting Format

The report should state: (1) the manufactured solution formulas with the amplitude and Mach number design, (2) the quantities imposed for each boundary type, (3) the mesh sequence and refinement ratio, (4) per-variable error norm tables with observed orders, and (5) results with limiters both enabled and disabled. Item (2) is the key to reproducibility: a verification report that does not say what was imposed at a subsonic inflow cannot be reproduced by anyone else.

How to Do It in Each Solver

Solver Comparison

SolverSource term injectionPractical notes
SU2Source code modification (open source), or custom sources via the Python wrapperMMS cases exist in the verification suite; extensive track record in research use
OpenFOAM (rhoCentralFoam and similar)fvOptions or solver modificationWatch the limiter settings of the central-upwind family of schemes
Ansys Fluent (density-based)UDF (DEFINE_SOURCE, per equation)Check the units of the energy source (W/m³) and the definition of E
In-house codeGenerated code compiled in directlyMaximum freedom for verification; easy to wire order tests into CI

Checklist of "Differences in Definition" to Settle Before Implementing

  • Definition of total energy — is it \( E \) (total energy per unit volume), \( e \) (internal energy), or \( h_0 \) (total enthalpy)? The form of the energy source term changes accordingly
  • Specific heat ratio and gas constant — the \( \gamma, R \) used in the derivation must match the solver settings. Beware implicit assumption of the air defaults (1.4 / 287)
  • Nondimensionalization — if the solver works internally in nondimensional variables, nondimensionalize the source terms with the same reference quantities before passing them in
  • Sign convention for source terms — added on the right-hand side or moved to the left? Follow how the equations are written in the manual

Research Frontiers

Verification Competition Among High-Order Schemes (DG, FR)

Because discontinuous Galerkin (DG) and Flux Reconstruction schemes carry nominal orders of four or six, demonstrating order via MMS has become entrenched in their development culture. At the international workshops that compare high-order CFD methods, the standard protocol is a side-by-side comparison of "error vs. degrees of freedom" and "error vs. compute time" on common MMS and isentropic vortex problems. MMS has thus moved beyond in-house verification to become a shared language for comparing schemes.

Entropy-Stable Schemes and Structure Preservation

As entropy-stable schemes — those satisfying the entropy inequality at the discrete level — have matured, the verification checklist has expanded from "order" alone to preservation of structure: the entropy budget, kinetic energy conservation, and free-stream preservation. Confirming the order with MMS and then layering on a free-stream preservation test (does a uniform flow stay undisturbed?) and entropy budget measurements is the modern standard for compressible solver development.

Verification in the Presence of Shocks

A smooth MMS cannot verify shock-capturing capability. Verification with discontinuities is an active research area: piecewise manufactured solutions that satisfy the shock relations exactly, exact solutions for moving shocks, and comparison against shock-fitted meshes. The practical division of labor is "order in smooth regions from MMS, shock position and strength from Riemann-problem benchmarks." Since the order of a global norm across a shock drops to first theoretically, demanding high order there is an error in the verification design.

Troubleshooting

Symptoms, Causes, and Fixes

SymptomLikely causeFix
Immediate divergence on negative density or pressureFluctuation amplitude of the manufactured solution is too largeDrop the amplitude to 10-20% of the reference value; check the global minima of \( \rho_m, p_m \) at derivation time
Error concentrated near boundaries with order lossOver-specified subsonic boundary; insufficient order in ghost-cell extrapolationImpose exactly the number of conditions characteristic theory allows; match the boundary extrapolation order to the interior scheme
Order pinned at first everywhereLimiter or artificial viscosity firing on a smooth solutionDisable them for stage-1 verification; check thresholds such as the TVB constant
Only the energy equation is low-orderMismatched definition of E; defective temperature or pressure extrapolation at boundariesWork through the definition checklist; isolate the boundary using per-variable errors
Steady runs stop converging once source terms are addedForgot the time-dependent part of the source term, or leaked a time term into a steady MMSFor steady verification, remove \( t \) from the manufactured solution; check the level at which the residual stalls
2-D passes but 3-D shows no orderSwapped direction indices; a bug in the z-direction fluxUse a manufactured solution with different wavenumbers per direction and check the directional dependence of the error

The Shortest Path to Isolating the Fault

🙋

Is it the boundaries, the fluxes, or the source terms? Is there an order for narrowing it down?


🎓

Three moves will pin it. Move 1: random-point check of the source terms — this exonerates the derivation and the code generation. Move 2: a manufactured solution with periodic boundaries (a field periodic in all directions) — this takes the boundary treatment out of the picture and measures the interior scheme alone. If the order fails to appear here, the flux or reconstruction is the culprit. Move 3: restore one boundary type at a time — periodic, then supersonic inflow/outflow, then subsonic inflow/outflow, raising the difficulty step by step to identify which boundary breaks it. Look at the spatial distribution of the error alongside this and it is immediately obvious whether the culprit sits near the boundary or across the whole domain. The procedure is not specific to compressible flow; it works for MMS on hyperbolic systems generally.

Related: automatic derivation of MMS source terms, troubleshooting NS-equation MMS, troubleshooting MMS convergence order.

Related Simulators

Feel the theory hands-on with the interactive simulators in this field

Simulator Library

Related Fields

Structural AnalysisFluid AnalysisThermal Analysis
Rate this article
Thanks for your feedback!
Helpful
More
detail
Report
error
Helpful
0
More detail
0
Report error
0
Written by NovaSolver Contributors
Anonymous Engineers & AI — Sitemap
View profile