Because Tristan-MP v2
uses adjustable number of ghost zones per each MPI subdomain it is fairly easy to implement any high order Maxwell solver schemes or different particle shape functions. However, in its most basic version we use the simplest schemes. Recommended minimum number of ghost cells is --NGHOSTS=3
, but keep in mind that the performance may vary with different number of ghost cells depending on the particular setup. We focus on the main loop with the correct ordering of operations in the other section. In this section we describe the numerical aspects of each of the substeps.
Field solver
Electric and magnetic fields are staggered spatially in the so-called Yee mesh pattern. Magnetic field is also staggered temporally, to ensure all the derivatives are time-centered. This means at any given timestep $n$ in a given cell $i$, $j$, $k$ we have the following components of the electromagnetic field and the current density:
where $(i,j,k)$ corresponds to the center of the cell, and $(n)$ is the beginning of the timestep.
Maxwell solver itself consists of three separate substeps. Faraday’s law over half timestep $\Delta t/2$ (called twice):
The Ampere’s law over the full timestep $\Delta t$:
And the correction to the Ampere’s law from the deposited currents:
This is sometimes called a leap-frog approach; intermediate value of $\boldsymbol{B}^{(n)}$ is used for particle push. All the procedure is shown in the animation below.
Particle pusher
Guiding center approximation
The GCA algorithm is an alternative particle pusher which may be used when the Larmor radius is critically underresolved (for more details on the algorithm see Bacchini+). It relies on the conservation of adiabatic invariant, while evolving the parallel (w.r.t. the local magnetic field) component of the velocity according to the $E_\parallel$. To enable GCA
one has to compile the code with the -gca
flag. Keep in mind that the curvature term is still not implemented, so the current version of the GCA
algorithm might be unusable for cases where the curvature drift is important.
This algorithm is only used in hybrid with the default Boris pusher, with the GCA only pushing the particles for which the electric field and the gyroradius are small: $E < f B$ and $\rho_L < \rho_{\rm crit}$ (in cells). Parameters $f$ and $\rho_{\rm crit}$ are configured in the input:
<algorithm>
...
gca_rhoL = 1 # critical larmor radius at which GCA kicks in
gca_EoverB = 1 # critical E/B at which GCA kicks in
One can also enable/disable GCA
for certain particle species (defaults to .true.
if particles are charged and the -gca
flag is enabled):
<particles>
...
gca1 = 1 # use GCA for species #1
gca2 = 0 # never use GCA for species #2