Standard norms of the difference between computed and reference fields are used.
E_L1 = (1/N) * sum|u_computed(i) - u_reference(i)|
Characterizes the average deviation.
E_L2 = sqrt((1/N) * sum(u_computed(i) - u_reference(i))^2)
More sensitive to outliers. Recommended as the default.
E_Linf = max|u_computed(i) - u_reference(i)|
Shows the worst-case local deviation.
E_rel = E_L2(u_computed - u_reference) / E_L2(u_reference)
Normalized by the reference magnitude — useful when comparing quantities of different scales (e.g., Cl, Cd).
Computed and reference points are matched by nearest-neighbor coordinates. If grids are identical — direct comparison. If grids differ — interpolation is NOT performed (the user should output results at reference points or use --auto-generate for analytical cases).
If your grid differs from the reference and --auto-generate is not used:
--auto-generate to produce reference data on your grid.Based on Roache’s (1994, 1998) methodology and ASME V&V 20:
| Compute GCI: GCI21 = Fs * | (f2-f1)/f1 | / (r21^p - 1) |
Safety factor Fs = 1.25 (for 3 meshes), 3.0 (for 2 meshes).
Tolerance should be set larger than the expected discretization error on the target mesh. A tolerance that is too tight will cause false failures; one that is too loose will mask real regressions.
For a second-order accurate scheme on a uniform mesh of size N (N×N in 2D), the discretization error in the L2 norm scales roughly as:
E_L2 ≈ C · (L/N)²
where L is the domain length scale and C is a problem-dependent constant (typically 1–50 for smooth flows). Halving the mesh spacing (doubling N) reduces the error by approximately 4×.
| Mesh N² | Estimated L2 range (smooth flow, 2nd order) | Typical usage |
|---|---|---|
| 32² | 0.1 – 0.5 | Coarse scoping |
| 64² | 0.02 – 0.1 | Quick CI checks |
| 128² | 0.005 – 0.03 | Standard verification |
| 256² | 0.001 – 0.008 | High-precision |
| Case type | Typical L2 tolerance | Notes |
|---|---|---|
| Analytical solution, fine mesh (256²+) | 1e-6 – 1e-4 | Machine precision possible on matching grid |
| MMS with source terms | 1e-5 – 1e-3 | Depends on quadrature accuracy |
| Analytical, moderate mesh (128²) | 1e-4 – 1e-2 | 2nd-order schemes on uniform grid |
| Analytical, coarse mesh (64²) | 0.01 – 0.1 | Allow for discretization error |
| Experimental data | 1e-3 – 1e-1 | Limited by measurement uncertainty |
| DNS reference data | 0.01 – 0.1 | Limited by statistical convergence |
| Mesh | Observed L2 (vs Ghia 129²) | Recommended tolerance |
|---|---|---|
| 32² | ≈ 0.08 | 0.1 – 0.2 |
| 64² | ≈ 0.03 | 0.05 – 0.1 |
| 128² | ≈ 0.005 | 0.005 – 0.01 |
The current lid-driven-cavity/case.yaml sets L2 = 1e-3, which is appropriate for 129² but too tight for the default 64² mesh used in the OpenFOAM template. Bin the tolerance to your actual mesh resolution.