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𝐑dtMv||22μB0qδΦ,

where t is time, v||=𝐯·𝐁0/B0 is the component of particle's velocity 𝐯 along the equilibrium magnetic field, μ=M(v2v||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·(α𝐁0t+δΦ)=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=ψ0s×θιψ0s×ζ=Ks+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ζ+MvqB0(Kψ+I(ψ)θ+G(ψ)ζ))(Rψ·ψ˙+Rθ·θ˙+Rζ·ζ˙)Mv||22μB0

Simplifying,

L(s,θ,ζ,v)=q(θ(ψ+I(ψ)MvqB0)+ζ(G(ψ)MvqB0ψP)+ψ(KMvqB0))(Rψ·ψ˙+Rθ·θ˙+Rζ·ζ˙)Mv||22μB0

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

L(s,θ,ζ,v)=q(θ˙(ψ+I(ψ)MvqB0)+ζ˙(G(ψ)MvqB0ψP)+ψ˙(KMvqB0))Mv22μ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(ψ)MvqB0ψP)pθ=Lθ˙=q(ψ+I(ψ)MvqB0)pψ=0

We know that the energy is

E=pq˙L,

but the first part of the expression cancels out so we get E=Mv22+μ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(ψ)MvqB0ψP))Mv||22μB0.

and our new momenta for θ is qψ.

We have the following EOM: From ψ:

Lψ=ddtLψ˙qθ˙+(G(ψ)MvB0G(ψ)MvB02B0ψqι)ζ˙μB0ψ=0.

From θ:

Lθ=ddtLθ˙qψ˙+ζ˙MG(ψ)vB02B0θ+μB0θ=0

From ζ:

Lζ=ddtLζ˙ζ˙G(ψ)MvB02B0ζμB0ζ=MB0(G(ψ)ψ˙v+G(ψ)v˙)G(ψ)MvB02(B0ψψ˙+B0θθ˙+B0ζζ˙)qιψ˙

From v:

Lv=ddtLv˙=0Lv=G(ψ)ζ˙MB0Mv=0.ζ˙=B0vG

Substituting this into our equation from θ, we find that

qψ˙+Mv2B0B0θ+μB0θ=0,ψ˙=1qB0θ(Mv2B0+μ).

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

qθ˙+MGv2GMv2B0B0ψqιB0vGμB0ψ=0,θ˙=1q(B0ψ(μ+Mv2B0)+qιB0vGMGv2G)

Finally, we solve for v.

Solving, for v˙, we have

v˙=GGvψ˙+vB0(B0ψψ˙+B0θθ˙)+B0MG(qιψ˙μB0ζ).

We know that

ψ˙=1qB0θ(Mv2B0+μ)θ˙=1q(B0ψ(μ+Mv2B0)+qιB0vGMGv2G).

These two have a common term of

B0θ(Mv2B0+μ)

that gets cancelled when we sum them in our expression:

B0ψψ˙+B0θθ˙=B0θ1G(ιB0vMGv2q).

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

v˙=GGvψ˙+vB0(B0ψψ˙+B0θθ˙)+B0MG(qιψ˙μB0ζ)=GGv(1qB0θ(Mv2B0+μ))T1+vB01GB0θ(vB0ιMv2qG)T2+B0MG(ιB0θ(Mv2B0+μ)μB0ζ)T3=vqGB0θ(Mv2B0+μ)GT1+1GB0θ(v2ιMv3qB0G)T2+v2GιB0θμB0MG(ιB0θ+B0ζ)T3notice T1:Mv3qGB0B0θGcancels withMv3qGB0B0θG from T2,1GB0θv2ιcancels withv2GιB0θ from T3.v˙=μvGqGB0θμB0MG(ιB0θ+B0ζ).

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

Lζ=ζ˙G(ψ)MvB02B0ζμ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(ψ)MvqB0ψP))Mv||22μB0

yields

pζ=qNψqψP+GMvB0.

as a conserved quantity.