2 Equation of guiding-center motion in field-line-following coordinates

Consider the field-line-following coordinates (ψ,𝜃,α), where α is the generalized toroidal angle defined by α = ϕ δ with δ = 0𝜃ˆq d𝜃 and ˆq = B ⋅∇ϕ∕(B ⋅∇𝜃), which is the local safety factor. The time evolution of (ψ,𝜃,α) of a guiding-center is then written as

           --        --
dψ-= ∂ψ-+ dX-⋅∇-ψ = dX-⋅∇-ψ,
dt   ∂t    dt        dt
(14)

and similarly

      --
d𝜃=  dX-⋅∇𝜃,
dt   dt
(15)

       -- --
dα-=  dX-⋅∇α,
 dt   dt
(16)

Using the expression of dX∕dt given by Eq. (10), Eqs. (14)-(16) can be written as (presently dropping the E × B drift, which will be discussed later):

                Z- v∥-                             --
dψ- =   v --(---|Z|2π∇-×-b-----)-⋅∇ψ + -Z---(-------μ---------)--1-B-×∇B--⋅∇(ψ1,7)
dt       ∥B- 1+ -Z--v∥-b ⋅∇-× b        |Z|2π  1+ Z--v∥-b⋅∇-× b  B2
                |Z|2πB                          |Z |2πB
             --  Z- v∥-                           --
d𝜃  =  v∥--(-B-+-|Z|2π∇-×-b---)-⋅∇𝜃 + Z----(-------μ---------)--1B-× ∇B--⋅∇𝜃(,18)
dt       B  1+  Z|Z|-v∥b ⋅∇ × b        |Z |2π 1 + Z|Z|-v∥b ⋅∇ × b  B2
                  2πB                            2πB
                Z- v∥-                             --
dα-  =  v∥--(---|Z|2π∇-×-b-----)-⋅∇α + Z----(-------μ---------)--1-B-×∇B--⋅∇(α1.9)
dt        B  1+ |ZZ|-v∥-b ⋅∇ × b        |Z |2π 1 + Z|Z-|v∥-b⋅∇ × b  B2
                   2πB                            2πB
where use has been made of B⋅∇ψ = 0 and B⋅∇α = 0. The parallel acceleration equation is written as (presently dropping the electric field acceleration term)
 -          --  Z- v∥-
dv∥= − μ--(-B-+-|Z|2π∇-×-b---)-⋅∇B-
dt      B- 1+  Z|Z|-v∥b ⋅∇-× b
                 2πB
(20)

For a general tokamak magnetic configuration specified numerically, all the above 2D equilibrium quantities are computed by interpolating pre-computed numerical tables. We define the following numerical tables:

          1-  --
W1(ψ,𝜃) = Bb ⋅∇ × b,
(21)

           -- --
W2 (ψ,𝜃) = B-⋅∇𝜃,
           B
(22)

          --
W3(ψ,𝜃) = ∇-×b-⋅∇-ψ,
           B
(23)

          --
W4(ψ,𝜃) = ∇-×-b-⋅∇-𝜃,
            B
(24)

            --     --   --     --   --     ---
W5(ψ,𝜃,α) = ∇-×-b-⋅∇α = ∇-×-b-⋅∇ ϕ− ∇-×-b-⋅∇ δ
              B           B           B
(25)

           1 --  --- --
W6 (ψ,𝜃) =--2B × ∇B ⋅∇ ψ,
          B
(26)

          1 --  ---- --
W7(ψ,𝜃) = -2B × ∇ B ⋅∇𝜃,
          B
(27)

             1 --  ------     1 --  --- --    1 --  --- ---
W8 (ψ,𝜃,α) =--2B × ∇ B ⋅∇ α = --2B × ∇B ⋅∇ ϕ− --2B × ∇B ⋅∇ δ
            B                B               B
(28)

          B- ----
W9 (ψ,𝜃) =--⋅∇ B,
          B
(29)

           --     ---
W10(ψ,𝜃) = ∇-×-b-⋅∇B.
             B
(30)

Next, let us discuss the E × B drift:

--           1  --  -- --
vE×B ⋅∇ ψ = ---⋆E × B ⋅∇ψ
            BB ∥
(31)

--           1  --  -- --
vE ×B ⋅∇ 𝜃 =---⋆E × B ⋅∇𝜃
            BB ∥
(32)

             1  --  -- --
vE×B ⋅∇ α = ---⋆E × B ⋅∇α
            BB ∥
(33)

Using δE = δEb + δExx + δEyy, where x = ψ and y = α, the above drifts are written as

--              1   ----    -- --   -- --
vE×B ⋅∇x   =  BB-⋆(δEx∇x  +δEy ∇y) ×B ⋅∇x
                 ∥
           =  − -1-⋆(δEx ∇x + δEy∇y )× ∇x ⋅B-
                BB ∥
                 1   -- --    --  --
           =  − BB-⋆(δEy ∇y) × ∇x ⋅B
                   ∥
           =  --1⋆(δEy)∇x × ∇y ⋅B-
              B B∥
                1   --  B- --
           =  ---⋆(δEy)--′ ⋅B                             (34)
              B B∥     Ψ
--              1   ----    -- --   -- --
vE×B ⋅∇y   =  ---⋆(δEx∇x  +δEy ∇y) ×B ⋅∇y
              B B∥
           =  − -1--(δE- ∇x + δE-∇y )× ∇y ⋅B-
                BB ⋆∥   x       y
                 1   -- --    --  --
           =  − ---⋆(δEx ∇x )× ∇y ⋅B
                BB ∥     --
                -1-- --  B-- --
           =  − BB-⋆(δEx )Ψ′ ⋅B                            (35)
                   ∥
--              1    ----    -- --    ----
vE ×B ⋅∇𝜃  =   BB-⋆(δEx∇ ψ+ δEy ∇α) × B⋅∇ 𝜃
                  ∥
           =   −--1⋆(δExB--⋅∇-ψ × ∇𝜃 + δEyB--⋅∇α × ∇-𝜃).          (36)
                B B∥
The two terms in expression (36) can be written as
                    |            |
-- --    --      -- || eR  eϕ  eZ ||
B ⋅(∇ ψ × ∇𝜃)  =  B ⋅|| ∂∂ψR-  0  ∂∂ψZ-||
                    | ∂∂𝜃R-  0  ∂∂𝜃Z-|
                 -- ( ∂ψ ∂𝜃   ∂ψ ∂𝜃 )
              =  B ϕ  ∂Z-∂R-− ∂R-∂Z-

              ≡  W14
                    |               |
--  --   --      -- || eR   eϕ   eZ  ||
B ⋅(∇α × ∇𝜃)  =  B ⋅|| ∂∂αR-  1R∂∂αϕ  ∂∂αZ- ||
                    | ∂∂𝜃R-   0   ∂∂𝜃Z- |
                 -- ( 1 ∂α ∂𝜃 )  -- ( ∂α ∂𝜃   ∂α  ∂𝜃)   -- (  1 ∂α ∂𝜃)
              =  BR   R-∂ϕ-∂Z- + B ϕ  ∂Z-∂R-− ∂R-∂Z-  + BZ  − R-∂ϕ-∂R-

              ≡  W15

2.0.1 Periodic conditions of particle trajectory in field-line-following coordinates

Note that 𝜃(r) and ϕ(r) are multi-valued functions whereas 𝜃(r) and ϕ(r) happen to be single-valued functions. However α(r) and δ(r) are still multi-valued functions. [It is ready to see this by examining the special case that 𝜃 is a straight-field line poloidal angle, in which δ = 𝜃ref𝜃ˆq d𝜃 is simplified to q𝜃. Then δ is written as

  -
∇ δ = 𝜃∇q + q∇ 𝜃,
(37)

where the first term 𝜃q is a multi-valued function since 𝜃 is multi-valued.]

For multi-valued functions, if a single branch is chosen, then there will be discontinuity at the the branch cut. In numerically constructing the coordinates (ψ,𝜃,α), the principal value of 𝜃 is chosen in the range [π : π) and the branch cut for 𝜃 is chosen on the high-field-side midplane. The toroidal shift δ = 𝜃ref𝜃ˆq d𝜃 can be considered as a derived angle based on 𝜃 and thus its principal value and branch cut are determined by those of 𝜃.

The (ψ,𝜃,α) coordinates of a particle change continuously when we evolve them by integrating Eqs. (14)-(16), during which 𝜃 can move beyond [π,π). When a particle’s 𝜃 moves beyond the range [π : π), one or multiple ±2π shifts are imposed on 𝜃 until 𝜃 are within [π : π). Note that a corresponding shift in α is needed to keep the particle at the same spatial location when doing the 𝜃 shift. This is because, although (ψ,𝜃,ϕ) and (ψ,𝜃 2mπ,ϕ) correspond to the same spatial location, points (ψ,𝜃,α) and (ψ,𝜃 2mπ,α) do not, where m is an integer. Specifically, the usual toroidal angle ϕ of point (ψ,𝜃,α) is ϕ1 = α + 𝜃ref𝜃ˆq d𝜃 while ϕ of point (ψ,𝜃 2mπ,α) is ϕ2 = α + 𝜃ref𝜃2qˆ d𝜃. The difference between ϕ1 and ϕ2 is ϕ2 ϕ1 = 2mπq. This indicates that, to keep the point at the same spatial location when shifting 𝜃 by 2, α should be shifted by +2mπq, i.e., the new coordinates of the point should be (ψ,𝜃 2mπ,α + 2mπq). This process is illustrated in Fig. 1. A typical evolution of (𝜃,α) involving shifting is shown in Fig. 2.

 


pict

Figure 1: To keep the point at the same spatial location when shifting 𝜃 by 2π, α should be shifted by +2πq. Here A and C correspond to the same spatial location, but B is at a different location.

 

 


pict

Figure 2: Temporal evolution of (ψ,𝜃,α) of a passing electron. The range of 𝜃 is chosen to be [π : π] and the range of α and ϕ is [0 : 2π]. When 𝜃 exceed the range, a 2π shift is imposed, which generate the jump of 𝜃 in (b) and also the corresponding jump of α in (c). Note that when a jump in (𝜃,α) occurs, no jump in ϕ, which is what we expect, otherwise there must be something wrong. Also note that there are also jumps of ϕ shown in (c), which is due to ϕ exceeding the range [0 : 2π] and a 2π shift being imposed. This jump has nothing to do with the jump in 𝜃 or α and usually occur at different time (one jump of ϕ is near the jump of α, which is only a coincidence). Here ϕ is computed using ϕ = α + δ, where δ is obtained by interpolating the 2D numerical table of δ(ψ,𝜃). DIID-D cyclone base case

 

When α exceeds the range [0 : 2π], one or multiple ±2π shifts are imposed on α until α are within [0 : 2π]. Since, for fixed ψ and 𝜃, the generalized toroidal angle α is equivalent to the usual toroidal angle ϕ. No complication like the case of 𝜃 arises when doing the α shift.

One way of avoiding the subtle (𝜃,α) shift problem is to evolve particles’ ϕ, instead of α. In this case, we have

                      --  ----
dϕ-  -- --      - ----B-+-v2∥π∇-×-b---- --    ---------μ----------1---  --- --
dt = vd ⋅∇ ϕ =  v∥--(    -v∥--  --   ) ⋅∇ ϕ +   (    v∥--  --   )B2 B × ∇B ⋅∇(ϕ3,8)
                  B  1 + 2πBb ⋅∇ × b        2π 1 + 2πBb ⋅∇ ×b
After getting ϕ, we use α = ϕ δ(ψ,𝜃) to get particles’ α, where δ is obtained by interpolating the numerical table in (ψ,𝜃) plane. I have tested the two ways of computing evolution of α, which indicates their results agree with each other. In the final codes, I use the (𝜃,α) shift method, because this methods involve less interpolation and thus more efficient.
2.0.2 Benchmarking cases

To verify code implementation, two methods are used to compute the guiding-center orbits. The first method uses the cylindrical coordinates and then interpolate the orbits into magnetic coordinates using pre-computed mapping table between the cylindrical and magnetic coordinates. The second method directly uses the magnetic coordinates in pushing the orbits. The following figures compare the results obtained by these two methods, which indicates they agree with each other. This provides confidence on the correctness of the numerical implementation.


pict

Figure 3: Comparison between the temporal evolution of (ψ,𝜃,α) of a passing electron computed by two methods: the blue lines are the results computed directly in (ψ,𝜃,α) field-line-following coordinates, the red lines are results computed in cylindrical coordinates and then interpolated to the field-line-following coordinates. There is systematical discrepancy between ψ computed by the two methods. The results are actually very close to each other and the difference becomes obvious because the variation of ψ is very small for a passing electron. The results of α from the two methods also agree with each other. The discrepancy near tΩi = 400 is due to that α is close to 2π, and one result becomes zero, which is equivalent to 2π. equilibrium is the DIID-D cyclone base case

 

 

 


pict pict

Figure 4: Left: orbit on poloidal plane. Right: α is defined by α = ϕ 0𝜃ˆq d𝜃, where ϕ is the usual cylindrical toroidal angle.

 

 

 


 

pict pict

pict pict

Figure 5: The evolutions of the poloidal angles 𝜃 and generalized toroidal angle α calculated by the two methods agree with each other. r = ∘ ------
  ΨΨ−bΨ−0Ψ0