Skip to content
VLASIFY™
TutorialResearch & computing support

Numerical convergence study tutorial: observed order, Richardson extrapolation and GCI

Updated · Scientifically reviewed by Dinkar Mishra, PhD on

Short answer

Run the same simulation on at least three systematically refined grids with a constant refinement ratio r. For each reported quantity, check that differences shrink with refinement, compute the observed order p = ln[(f3 − f2)/(f2 − f1)] / ln r, estimate the exact value by Richardson extrapolation, and report the Grid Convergence Index as the numerical uncertainty. The worked example below verifies the procedure on a problem with a known solution.

Who this is for

Researchers and engineers in any simulation field (CFD, plasma, solid mechanics, electromagnetics) who must quantify discretisation error for publications or design reviews.

Software

Python ≥ 3.9NumPy ≥ 1.22

Prerequisites

  • A simulation you can run at several resolutions with all other settings fixed.
  • Python with NumPy for the worked example and the analysis helper.

Step 1: plan the grids

Choose a constant refinement ratio r=hcoarse/hfiner = h_{coarse}/h_{fine} (usually 2). Run at least three levels, h1<h2<h3h_1 < h_2 < h_3 with h2=rh1h_2 = r h_1 and h3=rh2h_3 = r h_2. Iterative solvers must be converged much more tightly than the expected discretisation error; otherwise iteration error contaminates the study.

Step 2: compute the observed order and extrapolate

For a quantity ff with values f1f_1 (fine), f2f_2, f3f_3 (coarse):

p=ln⁡[(f3−f2)/(f2−f1)]ln⁡r,fext=f1+f1−f2rp−1,GCIfine=1.25 ∣(f1−f2)/f1∣rp−1.p = \frac{\ln\left[(f_3 - f_2)/(f_2 - f_1)\right]}{\ln r}, \qquad f_{ext} = f_1 + \frac{f_1 - f_2}{r^p - 1}, \qquad \mathrm{GCI}_{fine} = \frac{1.25\,\left|(f_1 - f_2)/f_1\right|}{r^p - 1}.

Step 3: a worked example with a known answer

We solve −u′′=π2sin⁡(πx)-u'' = \pi^2\sin(\pi x) on [0,1][0, 1] with u(0)=u(1)=0u(0) = u(1) = 0 by second-order finite differences. The exact solution u=sin⁡(πx)u = \sin(\pi x) lets us confirm that the procedure recovers the formal order of 2:

import numpy as np


def solve(n):
    """Second-order finite-difference solution on n intervals; returns x and u."""
    x = np.linspace(0.0, 1.0, n + 1)
    h = 1.0 / n
    main = 2.0 * np.ones(n - 1) / h**2
    off = -1.0 * np.ones(n - 2) / h**2
    A = np.diag(main) + np.diag(off, 1) + np.diag(off, -1)
    f = np.pi**2 * np.sin(np.pi * x[1:-1])
    u = np.zeros(n + 1)
    u[1:-1] = np.linalg.solve(A, f)
    return x, u


grids = [160, 80, 40]                        # fine, medium, coarse (r = 2)
mid = [solve(n)[1][n // 2] for n in grids]   # u(0.5) on each grid (exact value: 1)
f1, f2, f3 = mid
r = 2.0
p = np.log((f3 - f2) / (f2 - f1)) / np.log(r)
f_ext = f1 + (f1 - f2) / (r**p - 1)
gci = 1.25 * abs((f1 - f2) / f1) / (r**p - 1)

errors = [abs(v - 1.0) for v in mid]
p_exact = np.log(errors[1] / errors[0]) / np.log(r)
print(f"observed order (three grids) p = {p:.3f}")
print(f"observed order (exact errors) p = {p_exact:.3f}")
print(f"extrapolated u(0.5) = {f_ext:.8f}   (exact 1)")
print(f"GCI on the fine grid = {100 * gci:.4f}%")

The script recovers an observed order very close to 2, both from the three-grid formula (no exact solution needed) and from the true errors. The Richardson-extrapolated value is much closer to 1 than any of the three grid solutions.

Step 4: apply it to your simulation

Replace solve with your simulation runs and mid with your reported quantities: peak values, integrals, growth rates, frequencies. For particle methods, also separate statistical noise from discretisation error; see the PIC convergence test.

Verify

  • Differences decrease monotonically: ∣f2−f1∣<∣f3−f2∣|f_2 - f_1| < |f_3 - f_2|.
  • pp is positive and near the scheme’s formal order.
  • The GCI is small compared with the precision your conclusions require, or it is reported as the numerical uncertainty.

Troubleshooting

  • (f3−f2)/(f2−f1)(f_3 - f_2)/(f_2 - f_1) is negative (oscillatory convergence): the order formula does not apply. Add finer grids, or report a bound from the range of values.
  • The observed order is far below formal: check smoothness of the solution and boundary treatment, and confirm that iterative convergence is tight.
  • Results barely change between grids: the differences may be dominated by round-off or iteration error, so check solver tolerances and precision.

Assumptions and limitations

  • Richardson extrapolation and the GCI assume smooth solutions in the asymptotic range. Shocks, singularities and stochastic noise violate this.
  • The worked example verifies the procedure on a 1D model problem. Real simulations rarely behave this cleanly, which is why at least three grids are required.
  • Convergence establishes numerical accuracy, not physical correctness; see verification vs validation.

Frequently asked questions

What refinement ratio should I use?+

Ratios of 2 are the most common and give clear differences between grids. Smaller ratios (around 1.3–1.5) reduce cost for expensive 3D runs, but the differences between levels must still be larger than other error sources such as iteration or statistical noise.

What if the observed order differs from the formal order?+

An observed order much lower than the formal order suggests the grids are not in the asymptotic range, the solution is not smooth (shocks, singularities), or other errors interfere. Much higher than formal usually indicates error cancellation. Refine further before trusting the extrapolation.

Do I need to refine the time step too?+

For time-dependent simulations, yes: refine time and space together (keeping the CFL number fixed), or show separately that temporal error is negligible.

What is the safety factor in the GCI?+

Roache recommends Fs = 1.25 when three or more grids are used and the observed order is computed, and Fs = 3 when only two grids are available and an assumed order is used.

References

  1. Roache, Perspective: A method for uniform reporting of grid refinement studies, J. Fluids Eng. 116, 405 (1994) · Peer-reviewed article
  2. Celik et al., Procedure for estimation and reporting of uncertainty due to discretization in CFD applications, J. Fluids Eng. 130, 078001 (2008) · Peer-reviewed article
  3. Oberkampf & Roy, Verification and Validation in Scientific Computing (Cambridge University Press, 2010) · Standard textbook

Want this set up and verified for you?

We install, configure and validate scientific software on your workstation, cluster or cloud, and train your team to run it.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote