Skip to content

Particles ​

Charged particles in a field solver (particle-in-cell) are advanced in one of two ways, and SELAH provides both:

  • with the field's Runge–Kutta scheme, in the same stage loop: the particles are a companion of the field stepper, their residual the Lorentz force at each stage;
  • with a two-level pusher (Boris and its relativistic successors), staggered in time with the fields: a kernel, selah_push.

The theory, with its sources: notes/companions-pushers-pml.md in the repository.

With the field's scheme ​

The particles' residual is (v,(q/m)(E+v×B)) with E and B gathered at the stage positions, and the field's residual gets the current deposited from the stage particles. Each stage of the coupled step is then the scheme's. What this gives:

PropertyValue
stability of the gyration ωc (and of every oscillatory mode ω)ωΔt≤ st%imag_axis_bound(): 0 for euler and ssp-22 (unstable at any step), 3 for ssp-33, 22 for rk4, 3.2784 for ssp-54, 4.9215 for ssp-104
gyration energydecays by |R(iωcΔt)|2 per step, every stable scheme (rk4: about (π/36)(ωcΔt)5 per gyration)
phase-space volumenot preserved
E×B driftexact: vE is an equilibrium of every explicit scheme

Two-level pushers ​

fortran
! p(8, np): x at 1:3, v (or u = gamma v) at 4:6, q at 7, m at 8; e, b: the fields at x^n, (3, np)
call selah_push(PUSHER_HIGUERA_CARY, LAYOUT_V_FIRST, n, dt, 1, 4, 7, 8, p, e, b, c=c_light)

The positions are at tn, the velocities (momenta) at tn−1/2; one call takes the first n particles to vn+1/2, xn+1. LAYOUT_V_LAST takes p(np, 8), e(np, 3), b(np, 3). The relativistic pushers hold u=γv and need c; a Gaussian-units caller passes B/c.

PusherUseVolumeE+v×B=0E×B drift
PUSHER_BORISnon-relativisticpreserved—exact
PUSHER_BORIS_RELATIVISTICrelativistic, the classicpreservednot kept (1.2e-7 per step at γ=10, qBΔt/m=0.1)wrong velocity (2 % at E/cB=0.5, qBΔt/m=1)
PUSHER_VAYrelativistic beamsnot preserved (det−1=−1.2⋅10−4 at qΔt/m=1)keptexact
PUSHER_HIGUERA_CARYrelativistic, the structure-preserving choicepreservedkeptexact

Boris turns the velocity by 2arctan⁡(ωcΔt/2) per step (the exact angle is ωcΔt), keeps |v| exactly in a pure magnetic field, and is stable at any step (aliased above ωcΔt≈2).

Charge-conserving stage currents ​

A particle-in-cell code keeps Gauss's law exactly when its current is the one that moves the deposited charge (a charge-conserving deposit, Esirkepov 2001). With the particles in the field's Runge–Kutta step, the field at stage k+1 sees ∑r≤kak+1,rJr: Gauss's law holds at every stage when that weighted sum is the charge-conserving current of the displacement from qn to the particles' state at stage k+1. Within the window of stage k, after the particles' residual:

fortran
call sp%lookahead(k, bp, dt, p, pt)            ! the particles' state at stage k+1 (the step's result at the last stage)
! ... deposit H, the charge-conserving current of the displacement p -> pt over dt (the caller's: Esirkepov)
call st%stage_current(k, bx, h, jall, jk)      ! J_k = (H - sum_{r<k} a_{k+1,r} J_r) / a_{k+1,k}
! ... jk into jall(..., k); the field's residual at stage k with the current jk

Then ∑r≤kak+1,rJr=H at every stage and ∑kbkJk=H(qn→qn+1) at the step. It needs ak+1,k≠0 and bs≠0, true for the whole catalogue (stage_current_admissible()). The individual Jk are not physical currents: the inversion amplifies them (up to 25 times for ssp-104); only their weighted sums are. This is PRISM's construction; no paper on it was found (the theory note gives its proof). In two and three dimensions Esirkepov's current follows the straight chord between the end points, so the coupling is second order in time whatever the scheme's order.

Verification ​

WhatCase
companions, the gyration on a companion, the axis bounds, the driftC8, A5
the four pushers: defining equations, angle, speed, drift, force-free, volume, the non-relativistic limitA8
Gauss's law at every stage and step with the stage currents; the look-ahead stateC9

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice