Skip to content
VLASIFY™
TutorialPlasma & PIC simulation

PIC simulation convergence test: a step-by-step procedure

Updated · Scientifically reviewed by Dinkar Mishra, PhD on

Short answer

Pick the quantities you will report (for example peak electron energy or a growth rate). Run at least three resolutions, refining cell size and time step together by a constant ratio such as 2, and separately increase particles per cell. Check that the quantity changes less at each refinement, compute the observed order of convergence, and report the remaining numerical uncertainty, for example with Richardson extrapolation or the Grid Convergence Index.

Who this is for

Researchers preparing PIC results for publication, theses or design decisions, and reviewers who need to judge whether results are converged.

Software

Any PIC code —Python ≥ 3.9 (analysis script)

Prerequisites

  • A PIC simulation that already runs and produces the quantity you care about.
  • Enough allocation for several runs. The finest run in 3D can cost 8–16× the base run per halving of the cell size. Estimate it first with the PIC Simulation Planner.
  • A clear list of reported quantities: convergence is judged per quantity, not for a simulation as a whole.

Step 1: choose what to converge

Pick quantities that matter for your conclusions, for example:

  • laser wakefield: peak energy and charge of the accelerated beam, injection position;
  • instabilities: linear growth rate and saturation amplitude;
  • sheaths and thrusters: sheath potential, ion flux, electron temperature.

Avoid pointwise quantities such as the field at one cell at one time. They are noisy and converge slowly.

Step 2: design the refinement sequence

Use a constant refinement ratio rr (usually 2, or 2\sqrt{2} when runs are expensive):

RunCell sizeTime stepParticles per cell
Coarse (3)Δx\Delta xΔt\Delta tNN
Medium (2)Δx/r\Delta x / rΔt/r\Delta t / rNN
Fine (1)Δx/r2\Delta x / r^2Δt/r2\Delta t / r^2NN

Keep the Courant number and all physics parameters fixed. Separately, at the medium resolution, run NN, 2N2N and 4N4N particles per cell to see the statistical noise level. Grid convergence and particle-noise convergence are different questions; see particles per cell.

Step 3: compute the observed order

With f1f_1 the finest and f3f_3 the coarsest result, the observed order of convergence is

p=ln⁡[(f3−f2)/(f2−f1)]ln⁡r.p = \frac{\ln\left[(f_3 - f_2)/(f_2 - f_1)\right]}{\ln r}.

If pp is close to the formal order of your scheme (typically 2 for standard second-order PIC), the runs are in the asymptotic range. A Richardson-extrapolated estimate of the exact value is fexact≈f1+(f1−f2)/(rp−1)f_{exact} \approx f_1 + (f_1 - f_2)/(r^p - 1). The Grid Convergence Index for the fine run, with safety factor Fs=1.25F_s = 1.25, is

GCIfine=Fs ∣(f1−f2)/f1∣rp−1.\mathrm{GCI}_{fine} = \frac{F_s\,\left|(f_1 - f_2)/f_1\right|}{r^p - 1}.
import math

def convergence(f1, f2, f3, r=2.0, fs=1.25):
    """f1 = finest, f3 = coarsest. Returns observed order, extrapolated value, GCI."""
    e21, e32 = f2 - f1, f3 - f2
    if e21 == 0 or e32 / e21 <= 0:
        raise ValueError("Non-monotonic or oscillatory convergence: refine further or average over seeds.")
    p = math.log(e32 / e21) / math.log(r)
    f_exact = f1 + (f1 - f2) / (r**p - 1)
    gci = fs * abs((f1 - f2) / f1) / (r**p - 1)
    return p, f_exact, gci

# Example: peak beam energy in MeV from coarse, medium and fine runs
p, f_ex, gci = convergence(f1=412.0, f2=405.0, f3=378.0)
print(f"observed order p = {p:.2f}, extrapolated = {f_ex:.1f} MeV, GCI = {100 * gci:.1f}%")

For these illustrative numbers the script prints an observed order of about 1.95, an extrapolated value of about 414 MeV and a GCI of about 0.7%.

Step 4: report it

State in your paper or report:

  • the resolutions, particles per cell and time steps used;
  • the observed order and the numerical uncertainty (GCI or extrapolation error) for each reported quantity;
  • the statistical spread from different random seeds, if particle noise matters.

Verify

Your study is sound when:

  • differences shrink monotonically with refinement (∣f2−f1∣<∣f3−f2∣|f_2 - f_1| < |f_3 - f_2|);
  • the observed order is positive and roughly matches the formal order;
  • particle-noise variation is smaller than the grid uncertainty, or is reported separately.

Troubleshooting

  • Oscillating or negative (f3−f2)/(f2−f1)(f_3-f_2)/(f_2-f_1): the coarse run is not in the asymptotic range, or noise dominates. Add a finer level, or average several seeds.
  • Results keep drifting at every level: a physical scale is unresolved, for example a thin shock, a sharp density gradient or high-order laser harmonics. Check grid requirements in PIC grid size.
  • Numerical Cherenkov radiation in relativistic beams: it changes with resolution and pollutes the convergence. Use your code’s mitigation options (filters, specific solvers) consistently in all runs.

Assumptions and limitations

  • Richardson extrapolation and the GCI assume smooth, monotonic convergence in the asymptotic range. PIC noise and threshold phenomena such as injection can violate this.
  • The example numbers are illustrative inputs to show the calculation, not results from a real simulation.
  • For a general, code-independent treatment, see numerical convergence study tutorial.

Frequently asked questions

How many resolutions do I need?+

At least three, so that you can check the trend and estimate the observed order of convergence. Two resolutions only show that something changed, not whether it is converging.

Do I refine the time step together with the cell size?+

For explicit electromagnetic codes the time step is usually tied to the cell size by the CFL condition, so it refines automatically. Keep the Courant number fixed between runs so you change one discretisation ratio at a time.

What if my result does not converge?+

Either the coarsest runs are outside the asymptotic range (refine further), the quantity is sensitive to noise (increase particles per cell or average over seeds), or a physical process is under-resolved (for example a wave-breaking spike). Report this honestly. A non-converged quantity should not be presented as a precise number.

Is a convergence test the same as validation?+

No. Convergence shows that the numerical solution approaches the exact solution of the model equations (solution verification). Validation compares the model with experiment. Both are needed for credible predictions.

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
  4. Birdsall & Langdon, Plasma Physics via Computer Simulation (CRC Press) · 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