Part 8, Chapter 3

PIC Simulations

Particle-in-cell computational methods for plasma kinetics

3.1 The PIC Algorithm

The particle-in-cell (PIC) method is the workhorse of computational plasma physics. Rather than discretizing the full distribution function on a velocity-space grid (which is prohibitively expensive in 3D-3V), PIC represents the plasma by a collection of computational "superparticles," each representing many physical particles. The algorithm cycles through four steps each timestep:

  1. Push particles: Advance particle positions and velocities using the equations of motion in the local fields.
  2. Deposit charge/current: Interpolate particle charges and currents onto the spatial grid.
  3. Solve fields: Solve Maxwell's equations (or Poisson's equation in the electrostatic limit) on the grid.
  4. Interpolate fields: Interpolate the grid fields back to particle positions for the next push.

The equations of motion for each particle are:

$$\frac{d\mathbf{x}_p}{dt} = \mathbf{v}_p, \qquad m_p\frac{d\mathbf{v}_p}{dt} = q_p\left(\mathbf{E}(\mathbf{x}_p) + \mathbf{v}_p \times \mathbf{B}(\mathbf{x}_p)\right)$$

3.2 The Boris Pusher

The Boris algorithm is the standard method for advancing particle velocities in electromagnetic fields. It is second-order accurate, time-reversible, and exactly preserves the particle speed during the magnetic rotation step (volume-preserving in phase space).

The algorithm splits the velocity update into three substeps. First, a half electric-field kick:

$$\mathbf{v}^- = \mathbf{v}^{n-1/2} + \frac{q\Delta t}{2m}\mathbf{E}^n$$

Then a magnetic rotation. Define the rotation vectors:

$$\mathbf{t} = \frac{q\mathbf{B}^n \Delta t}{2m}, \qquad \mathbf{s} = \frac{2\mathbf{t}}{1 + |\mathbf{t}|^2}$$

$$\mathbf{v}' = \mathbf{v}^- + \mathbf{v}^- \times \mathbf{t}, \qquad \mathbf{v}^+ = \mathbf{v}^- + \mathbf{v}' \times \mathbf{s}$$

Finally, a second half electric-field kick:

$$\mathbf{v}^{n+1/2} = \mathbf{v}^+ + \frac{q\Delta t}{2m}\mathbf{E}^n$$

The key property is that \(|\mathbf{v}^+| = |\mathbf{v}^-|\) exactly, so the magnetic field does no work, as it should physically. This prevents secular energy drift due to the magnetic push.

3.3 Stability and Resolution Requirements

Electrostatic PIC simulations have stringent resolution requirements. The grid spacing must resolve the Debye length:

$$\Delta x < \lambda_D = \sqrt{\frac{\epsilon_0 T_e}{n_e e^2}}$$

Failure to resolve the Debye length leads to numerical (grid) heating: the alias of short-wavelength modes folds energy to long wavelengths, artificially heating the plasma. The timestep must satisfy the CFL-like condition:

$$\omega_{pe}\,\Delta t < 2$$

For electromagnetic PIC, additional constraints arise from the Courant condition for light-wave propagation: \(c\,\Delta t < \Delta x\).

Finite-size particles: To reduce discrete particle noise, each superparticle is given a spatial extent (cloud or spline shape) rather than being a point charge. This smooths the short-range Coulomb interaction, suppressing unphysical close encounters while faithfully representing the collective long-range behavior. Common choices include first-order (linear, or CIC) and higher-order B-spline shapes.

3.4 Numerical Heating and Noise

PIC simulations suffer from discrete particle noise that scales as \(1/\sqrt{N_{ppc}}\) where\(N_{ppc}\) is the number of particles per cell. The electric field fluctuation level is:

$$\frac{\epsilon_0 \langle E^2 \rangle}{n_e T_e} \sim \frac{1}{N_{ppc} \cdot (n_e \lambda_D^d)}$$

where \(d\) is the spatial dimension. This noise acts as a collisional drag and diffusion, giving an effective collision frequency:

$$\nu_\text{num} \sim \frac{\omega_{pe}}{N_{ppc} \cdot (n_e \lambda_D^d)}$$

For the simulation to faithfully reproduce collisionless physics, we need the numerical collision rate to be much smaller than any physical rate of interest over the simulation duration.

Interactive Simulation

Minimal 1D Electrostatic PIC: Two-Stream Instability

Python
script.py123 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

Rate this chapter: