Diocotron instability
A hollow electron column in a strong magnetic field rolls up into vortices; the tree follows them.
In a strong axial field B the electrons of a nonneutral plasma move with the E x B drift v = E x B / B^2 of their guiding centres: a 2D incompressible flow whose vorticity is the charge density, the same dynamics as an ideal fluid’s (2D Euler). A thin annulus of charge between the radii a- and a+ is unstable, like a shear layer (Kelvin-Helmholtz): its edges ripple, the ripples grow and the ring breaks up into vortices that orbit and merge. For a uniform annulus with no wall, the azimuthal mode l grows at gamma / omega_D = sqrt(c_l - b_l^2 / 4), with b_l = l (1 - x^2), c_l = l (1 - x^2) - (1 - x^(2 l)), x = a- / a+ and omega_D the E x B rotation frequency of a uniform column of the annulus density (Davidson, Physics of Nonneutral Plasmas, ch. 6). The guiding centres are line charges (kernel="log"); their field comes from the FMM of FlatQuadtree.fmm and they are pushed with the classic fourth-order Runge-Kutta method. Units k_e = B = omega_D = 1, a+ = 1, a- = 0.8, particles started on rings (a quiet start, so that only the seeded mode grows).
Source: examples/diocotron_instability.py. Run it yourself with python examples/diocotron_instability.py [--output examples/output] [--quick] (needs pip install "tree-d-3d[examples]").
Animations
Section titled “Animations”
Loading figure…the annulus seeded with a small random ripple, rolling up into vortices, with the cells of the quadtree the FMM builds every step; the particles are colored by their starting radius (blue at the inner edge, red at the outer), so the vortices show their layers wound up into spirals. The tree refines into the vortices and coarsens in the empty space between them.
Figures
Section titled “Figures”
Loading figure…the amplitude of the seeded mode against time, one run per mode l = 2 ... 6 and l = 8, measured by the multipole moment |<(z / a+)^l>| of the charge, with the slope of the theory’s growth rate (dashed). l = 2 and l = 8 are stable (l = 7 is only marginally so, and left out): they only oscillate, until the unstable modes seeded by the discreteness of the particles grow large enough to drive them nonlinearly.

Loading figure…the growth rates fitted to the runs (from three times the seed to 0.1; a mode that has not tripled by t omega_D = 15 counts as stable) against the theory’s.

Loading figure…the electrostatic energy and the angular momentum (the sum of q r^2), which the exact guiding-centre dynamics conserves, during the roll-up: their drift measures the FMM’s and the time step’s errors.
--quick uses fewer particles and a shorter roll-up (about a minute); --smoke is the tiny configuration the test suite runs. Needs Plotly (pip install 'tree-d-3d[examples]').