bill's blog

Tracing Particles under Vacuum Assumptions

I've been working on creating a GPU-parallelized particle tracer for energetic particles in stellarators. I thought it'd be informative (both for myself and for others) to publish a writeup of the equations I'm using in my solver.

Writeup

Consider a particle of mass M and charge q, moving in equilibrium field 𝐁0=∇×𝐀0 in presence of shear-Alfven wave perturbation with magnetic field δ𝐁=∇×α𝐁0. The drift kinetics of a particle with charge q is described with the expanded Lagrangian (Littlejohn)

L(𝐑,d𝐑dt,v||)=q(𝐀0+α𝐁0+Mv||qB0𝐁0)·d𝐑dt−Mv||22−μB0−qδΦ,

where t is time, v||=𝐯·𝐁0/B0 is the component of particle's velocity 𝐯 along the equilibrium magnetic field, μ=M(v2−v||2)/(2B0) is the magnetic moment, and δΦ is the scalar potential of the shear Alfven wave. Observe that scalar δΦ and vector α𝐁0 potentials are related for transverse wave, since

𝐁0·(∂α𝐁0∂t+∇δΦ)=0⇒∇||δΦ=−B0∂α∂t,

where B0∇||=𝐁0·∇ is derivative along the magnetic field, and t is time.

ψ=12π∫𝐁0·d𝐒

normalized by the total toroidal flux ψ0, θ and ζ are poloidal and toroidal Boozer angles. Co- and contravariant forms of the equilibrium 𝐁0 field are, respectively,

𝐁0=ψ0∇s×∇θ−ιψ0∇s×∇ζ=K∇s+I(s)∇θ+G(s)∇ζ.

where ι is the rotational transform. In what follows, equilibrium current 𝐣0 is assumed to be straight in Boozer coordinates, K=0.

We know that we may choose a gauge where the vector potential satisfies:

A0=ψ∇θ−ψP∇ζ

We also know that

d𝐑dt=(∂R∂ψ·ψ˙+∂R∂θ·θ˙+∂R∂ζ·ζ˙)

We assume (for unperturbed) that α=0. So the Lagrangian in Boozer coordinates (ψ,θ,ζ,v‖) is:

L(ψ,θ,ζ,v‖)=q(ψ∇θ−ψP∇ζ+Mv‖qB0(K∇ψ+I(ψ)∇θ+G(ψ)∇ζ))(∂R∂ψ·ψ˙+∂R∂θ·θ˙+∂R∂ζ·ζ˙)−Mv||22−μB0

Simplifying,

L(s,θ,ζ,v‖)=q(∇θ(ψ+I(ψ)Mv‖qB0)+∇ζ(G(ψ)Mv‖qB0−ψP)+∇ψ(KMv‖qB0))(∂R∂ψ·ψ˙+∂R∂θ·θ˙+∂R∂ζ·ζ˙)−Mv||22−μB0

Using the dual property of the contravariant and covariant bases, we get

L(s,θ,ζ,v‖)=q(θ˙(ψ+I(ψ)Mv‖qB0)+ζ˙(G(ψ)Mv‖qB0−ψP)+ψ˙(KMv‖qB0))−Mv‖22−μB0.

Now, we find the canonical momenta of s,θ,ζ,v‖ (assuming K=0). Immediately, we know

pv‖=0

since L has no v‖˙. We know that

pζ=∂L∂ζ˙=q(G(ψ)Mv‖qB0−ψP)pθ=∂L∂θ˙=q(ψ+I(ψ)Mv‖qB0)pψ=0

We know that the energy is

E=∑pq˙−L,

but the first part of the expression cancels out so we get E=Mv‖22+μB0.

The implicit EOMs are derived from the Euler-Lagrange equations. We derive the EOMs under a vacuum assumption (i.e. I,K=0).

Our simplified Lagrangian is:

L=q(θ˙ψ+ζ˙(G(ψ)Mv‖qB0−ψP))−Mv||22−μB0.

and our new momenta for θ is qψ.

We have the following EOM: From ψ:

∂L∂ψ=ddt∂L∂ψ˙qθ˙+(G′(ψ)Mv‖B0−G(ψ)Mv‖B02∂B0∂ψ−qι)ζ˙−μ∂B0∂ψ=0.

From θ:

∂L∂θ=ddt∂L∂θ˙qψ˙+ζ˙MG(ψ)v‖B02∂B0∂θ+μ∂B0∂θ=0

From ζ:

∂L∂ζ=ddt∂L∂ζ˙−ζ˙G(ψ)Mv‖B02∂B0∂ζ−μ∂B0∂ζ=MB0(G′(ψ)ψ˙v‖+G(ψ)v˙‖)−G(ψ)Mv‖B02(∂B0∂ψψ˙+∂B0∂θθ˙+∂B0∂ζζ˙)−qιψ˙

From v‖:

∂L∂v‖=ddt∂L∂v˙‖=0∂L∂v‖=G(ψ)ζ˙MB0−Mv‖=0.ζ˙=B0v‖G

Substituting this into our equation from θ, we find that

qψ˙+Mv‖2B0∂B0∂θ+μ∂B0∂θ=0,ψ˙=−1q∂B0∂θ(Mv‖2B0+μ).

Substituting ζ˙ into our equation from ψ, we find that

qθ˙+MG′v‖2G−Mv‖2B0∂B0∂ψ−qιB0v‖G−μ∂B0∂ψ=0,θ˙=1q(∂B0∂ψ(μ+Mv‖2B0)+qιB0v‖G−MG′v‖2G)

Finally, we solve for v‖.

Solving, for v˙‖, we have

v˙∥=−G′Gv∥ψ˙+v∥B0(∂B0∂ψψ˙+∂B0∂θθ˙)+B0MG(qιψ˙−μ∂B0∂ζ).

We know that

ψ˙=−1q∂B0∂θ(Mv‖2B0+μ)θ˙=1q(∂B0∂ψ(μ+Mv‖2B0)+qιB0v‖G−MG′v‖2G).

These two have a common term of

∂B0∂θ(Mv‖2B0+μ)

that gets cancelled when we sum them in our expression:

∂B0∂ψψ˙+∂B0∂θθ˙=∂B0∂θ1G(ιB0v‖−MG′v‖2q).

From here, it is relatively easy to substitute ψ˙ into the rest of our equation:

v˙∥=−G′Gv∥ψ˙+v∥B0(∂B0∂ψψ˙+∂B0∂θθ˙)+B0MG(qιψ˙−μ∂B0∂ζ)=−G′Gv∥(−1q∂B0∂θ(Mv∥2B0+μ))⏟T1+v∥B01G∂B0∂θ(v∥B0ι−Mv∥2qG′)⏟T2+B0MG(−ι∂B0∂θ(Mv∥2B0+μ)−μ∂B0∂ζ)⏟T3=v∥qG∂B0∂θ(Mv∥2B0+μ)G′⏟T1′+1G∂B0∂θ(v∥2ι−Mv∥3qB0G′)⏟T2′+−v∥2Gι∂B0∂θ−μB0MG(ι∂B0∂θ+∂B0∂ζ)⏟T3′notice T1′:Mv∥3qGB0∂B0∂θG′cancels with−Mv∥3qGB0∂B0∂θG′ from T2′,1G∂B0∂θv∥2ιcancels with−v∥2Gι∂B0∂θ from T3′.⟹v˙∥=μv∥G′qG∂B0∂θ−μB0MG(ι∂B0∂θ+∂B0∂ζ).

Note that, if B0 is invariant with respect to ζ, then we have

∂L∂ζ=−ζ˙G(ψ)Mv‖B02∂B0∂ζ−μ∂B0∂ζ=0=ddtpζ.

Note also that if B0 depends only on ψ and χ=θ−Nζ then we have a new Lagrangian:

L′(ψ,χ,ζ,v‖)=L(ψ,χ−Nζ,ζ,v‖).

(of course, the time derivatives of each variable are also in the Lagrangian).

We can now treat θ as a function of χ,ζ. In this new field, we have L′ independent of ζ and will have

pζ=∂L′∂ζ˙.

We know that

θ˙=χ˙+Nζ˙.

Substituting into our old Lagrangian:

L=q(θ˙ψ+ζ˙(G(ψ)Mv‖qB0−ψP))−Mv||22−μB0

yields

pζ=qNψ−qψP+GMv‖B0.

as a conserved quantity.