Conservation and Symmetry Checks
Physical invariants like conserved mass, energy, and symmetry must hold in the discrete solution; a violation is a bug.
Invariants That Must Hold
Many physical systems conserve quantities exactly: mass, momentum, energy, charge. Many also possess symmetries: a symmetric problem should have a symmetric solution. These invariants provide verification checks that need no exact solution. If the discrete solution violates a conservation law the equations enforce, or breaks a symmetry the problem possesses, there is a bug, regardless of how plausible the answer looks.
Conservation Checks
- Integrate the conserved quantity over the domain and confirm it changes only through fluxes at the boundary.
- Track the imbalance over time; for a conservative scheme it should stay at the round-off level.
- A growing imbalance signals a non-conservative discretization or a coding error in a flux term.
Symmetry Checks
If a problem is symmetric under a reflection or rotation, the solution must share that symmetry. Running a symmetric problem and measuring the asymmetry of the output is a sensitive test: any asymmetry beyond round-off reveals a bug, often in boundary handling or in a directionally biased algorithm. The check is cheap and requires only that the problem be set up symmetrically.
Strengths and Limits
These checks are valuable because they are independent of any reference solution and often catch bugs that convergence studies miss, particularly in flux and boundary implementations. But they are necessary, not sufficient: a scheme can conserve energy exactly and still be inaccurate, and a symmetric solution can still be wrong. A conservative, symmetric, but under-resolved solution passes both checks while being far from correct.
The right role is as fast, always-on sanity checks in a verification suite, complementing order-of-accuracy tests. A conservation check that runs on every regression case catches a whole class of errors immediately, before the more expensive accuracy tests are even consulted, and its violation points directly at the offending term.