Guiding Center Approximation

The equation of motion used in the particle tracker is based on the Guiding Center Approximation.

In a strong magnetic field, a charged particle spirals (gyrates) rapidly around a magnetic field line. Computing the full spiral is computationally expensive and often unnecessary. Instead, we track the Guiding Center—the center point of that spiral.

Here is the physics breakdown of the equations used in the JavaScript code.


1. The Position Equation ($\dot{\mathbf{X}}$)

The velocity of the guiding center $\mathbf{v}_{gc}$ is the sum of motion along the field line and drifts across the field line:

$$ \frac{d\mathbf{X}}{dt} = \underbrace{v_\parallel \mathbf{b}}_{\text{Parallel Motion}} + \underbrace{\mathbf{v}_D}_{\text{Perpendicular Drifts}} $$

A. Parallel Motion ($v_\parallel \mathbf{b}$)

This is the particle sliding along the magnetic field line vector $\mathbf{b} = \mathbf{B}/B$.

  • Passing particles: Travel indefinitely around the torus.
  • Trapped particles: Bounce back and forth due to the mirror force (explained below).

B. Perpendicular Drifts ($\mathbf{v}_D$)

In a curved magnetic field like a Tokamak, the particle experiences two main drifts:

  1. $\nabla B$ Drift: The magnetic field is stronger on the inside ($R_{in}$) than the outside ($R_{out}$). The gyro-radius is smaller where $B$ is high and larger where $B$ is low, causing a net drift.
    $$ \mathbf{v}{\nabla B} = \frac{m v\perp^2}{2 q B} \frac{\mathbf{B} \times \nabla B}{B^2} $$
  2. Curvature Drift: Centrifugal force felt by the particle as it follows a curved field line.
    $$ \mathbf{v}{\kappa} = \frac{m v\parallel^2}{q B} \frac{\mathbf{B} \times (\mathbf{b} \cdot \nabla)\mathbf{b}}{B^2} $$

The Tokamak Approximation:
In a tokamak, the magnetic field is dominated by the Toroidal field $B_\phi \propto 1/R$.
Therefore, both $\nabla B$ and the curvature vector point toward the major axis ($-\hat{R}$).
The cross product $\mathbf{B} \times (-\hat{R})$ points in the Vertical ($\hat{Z}$) direction.

We combine these into the total vertical drift used in the code:

$$ v_{drift, Z} = \frac{m}{q B R} \left( v_\parallel^2 + \frac{1}{2}v_\perp^2 \right) $$

  • Direction: Depends on the charge $q$. Ions drift down (usually), electrons drift up (depending on $B_\phi$ direction).
  • Effect: This drift pushes the particle off the flux surface. When combined with poloidal rotation, it creates the “Banana Orbit” width.

2. The Velocity Equation ($\dot{v}_\parallel$)

Why do particles bounce? Because of the Mirror Force.

Two quantities are conserved (constants of motion):

  1. Total Energy: $\mathcal{E} = \frac{1}{2}m v_\parallel^2 + \frac{1}{2}m v_\perp^2$
  2. Magnetic Moment: $\mu = \frac{m v_\perp^2}{2B}$

From (2), we know that $v_\perp^2 = \frac{2\mu B}{m}$.
Substituting this into (1):

$$ \mathcal{E} = \frac{1}{2}m v_\parallel^2 + \mu B $$

If we differentiate with respect to time (and assume static B-field $\partial B/\partial t = 0$):

$$ 0 = m v_\parallel \dot{v}\parallel + \mu \frac{dB}{dt} $$ $$ m v\parallel \dot{v}\parallel = – \mu (v\parallel \nabla_\parallel B) $$

Canceling $v_\parallel$, we get the acceleration equation used in the code:

$$ \frac{d v_\parallel}{dt} = – \frac{\mu}{m} \nabla_\parallel B $$

  • Explanation: As a particle moves into a region of higher B (closer to the central column of the tokamak), $v_\perp$ must increase to conserve $\mu$. To conserve Total Energy, $v_\parallel$ must decrease.
  • Turning Point: If $B$ gets high enough, $v_\parallel$ reaches zero. The particle stops and is pushed back by the $-\nabla B$ force. This creates the “Banana” trapped orbit.

3. Mapping to the JavaScript Code

In static/js/gfile_viewer.js, inside updateParticle():

// 1. Drift Calculation
// omega_c = qB/m
// v_perp_sq = 2*mu*B / m
// v_d_mag matches the Tokamak Approximation formula above
const v_d_mag = (vp*vp + 0.5*v_perp_sq_loc) / (omega_c * r);

// 2. Position Updates
// dr is mostly parallel flow projected onto R
const dr = vp * bR;
// dz includes the Vertical Drift derived above
const dz = vp * bZ + v_d_vert; 

// 3. Velocity Update (Mirror Force)
// gradB_par is roughly B * (-1/R) projected onto field line
const gradB_par = bR * (-f.Bmag/r); 
// dv matches the equation: -(mu/m) * grad_par B
const dv = -(mu/m) * gradB_par;

This simple set of equations captures the complex topology of Banana orbits, Passing orbits, and Potato orbits without needing to simulate the billions of gyro-cycles that happen in between.

Leave a Comment