6.4 Calculating poloidal angle

Once |𝒥∇ψ| is known, the value of 𝜃 of a point can be obtained by integrating expression (168), i.e.,

           ∫ xi,j
𝜃i,j = 𝜃ref,j +     --R--dlp,
            xref,j |𝒥 ∇ψ |
(169)

where the curve integration is along the contour Ψ = Ψj, xref,j is a reference point on the contour, where value of the poloidal angle is chosen as 𝜃ref,j. The choice of the positive direction of 𝜃 is up to users. Depending on the positive direction chosen, the sign of the Jacobian of the constructed coordinates can have a sign difference from the 𝒥 appearing in Eq. (169). Denote the Jacobian of the constructed coordinates by 𝒥′, then

𝒥′ = ± 𝒥
(170)

This sign can be determined after the radial coordinate and the positive direction of the poloidal angle are chosen. In GTAW code, I choose the positive direction of 𝜃 to be in anticlockwise direction when observers look along the direction of ˆϕ. To achieve this, the line integration in Eq. (169) should be along the anticlockwise direction. (I use the determination of the direction matrix, a well known method in graphic theory, to determine the direction from a given set of discrete points on a magnetic surface.)

Normalized poloidal angle

The span of 𝜃 defined by Eq. (169) is usually not 2π in one poloidal loop. This poloidal angle can be scaled by s(ψ) to define a new poloidal coordinate 𝜃, whose span is 2π in one poloidal loop, where s(ψ) is a magnetic surface function given by

s(ψ) = ∮--2π----.
        |𝒥R∇ψ|dlp
(171)

Then 𝜃 is written as

𝜃i,j = s(ψj)𝜃i,j
          (       ∫ xi,j        )
   = s(ψj) 𝜃ref,j +     --R---dlp
                   xref,j|𝒥∇ ψ|
     -          ∫ xi,j   R
   = 𝜃ref,j + s(ψj)      |𝒥-∇ψ-|dlp,                     (172)
                 xref,j
where 𝜃ref,j = s(ψj)𝜃ref,j. Sine we have modified the definition of the poloidal angle, the Jacobian of the new coordinates (ψ,𝜃) is different from that of (ψ,𝜃,ϕ). The Jacobian 𝒥new of the new coordinates (ψ,𝜃) is written as
             1
𝒥new ≡ --------------
       (∇ ψ × ∇𝜃)⋅∇ ϕ
    =  --------1----------
       {∇ψ × ∇[s(ψ)𝜃]}⋅∇ ϕ
       -1--------1-------
    =  s(ψ )(∇ψ × ∇𝜃)⋅∇ ϕ
        1   ′
    =  s(ψ-)𝒥
         1
    = ± ----𝒥                                   (173)
        s(ψ)
The Jacobian 𝒥 can be set to various forms to achieve various poloidal coordinates, which will be discussed in the next section. After the Jacobian and the radial coordinate ψ is chosen, all the quantities on the right-hand side of Eq. (172) are known and the integration can be performed to obtain the value of 𝜃i,j of each point on each flux surface.

[The reference points xref,j and the values of poloidal angle at these points can be chosen by users. One choice of the reference points xref,j are those points on the horizontal ray in the midplane that starts from the magnetic axis and points to the low filed side of the device and 𝜃ref,j at these points is chosen as zero (this is my choice in the GTAW code). In the TEK code, the reference points are chosen at the high-field side of the midplane and 𝜃ref,j = π at the reference points.]

Jacobian for equal-arc-length poloidal angle

If the Jacobian 𝒥 is chosen to be of the following form

      R
𝒥 = ---- .
    |∇ ψ|
(174)

Then 𝜃i,j in Eq. (172) is written

-     -      2π  ∫ xi,j
𝜃i,j = 𝜃ref,j + ∮-dl     dlp.
               p  xref,j
(175)

and the Jacobian of new coordinates (ψ,𝜃), 𝒥new, which is given by Eq. (173), now takes the form

        ∮            ∮
𝒥new = ±--dlp--R--= ± --dlp--R--dΨ-.
         2π  |∇ ψ|     2π  |∇ Ψ|dψ
(176)

Equation (175) indicates a set of poloidal points with equal arc intervals corresponds to a set of uniform 𝜃i points. Therefore this choice of the Jacobian is called the equal-arc-length Jacobian. Note that Eq. (175) does not involve the radial coordinate ψ. Therefore the values of 𝜃 of points on any magnetic surface can be determined before the radial coordinate is chosen.

Jacobian for equal-volume poloidal angle (Hamada coordinate)

The volume element in (ψ,𝜃,ϕ) coordinates is given by dV = |𝒥|d𝜃dϕdψ. If we choose a Jacobian that is independent of 𝜃, then uniform 𝜃 grids will correspond to grids with uniform volume interval. In this case, 𝒥 is written as

𝒥 = h (ψ ),
(177)

where h(ψ) is a function independent of 𝜃. Then 𝜃i,j in Eq. (172) is written

-    -        2π    ∫ xi,j  R
𝜃i,j = 𝜃ref,j + ∮-R----      ----dlp
             |∇ψ|dlp  xref,j|∇ψ|
(178)

and the Jacobian of the new coordinates (ψ,𝜃), 𝒥new,  is given by Eq. (173), which now takes the following form:

         1 ∮   R
𝒥new = ± ---  ----dlp.
         2π   |∇ ψ|
(179)

Note that both 𝜃i,j and 𝒥new are independent of the function h(ψ) introduced in Eq. (177). (h(ψ) is eliminated by the normalization procedure specified in Sec. 6.4 due to the fact that h(ψ) is constant on a magnetic surface.) The equal-volume poloidal angle is also called Hamada poloidal angle.

The equal-volume poloidal angle is useful in achieving loading balance for parallel particle simulations. Assume that markers are loaded uniform in space and the poloidal angle is domain decomposed and assigned to different MPI process. Then the equal-volume poloidal angle can make marker number in each MPI process be equal to each other and thus work loading to each process be equal. (**check**If the domain decomposition is also applied to the radial direction, to achieve loading balance, then the radial coordinate ψ should be chosen in a way that makes (R∕ψ)dlp be independent of ψ, so that 𝒥new in Eq. (179) is constant in space.**)

Jacobian of Boozer’s poloidal angle

If the Jacobian 𝒥 is chosen to be of the Boozer form:

         h(ψ)
𝒥(ψ,𝜃) = --2-.
          B
(180)

then the poloidal angle in Eq. (172) is written as

               2π   ∫ xi,j B2R
𝜃i,j = 𝜃ref,j + ∮-B2Rdl      |∇-ψ|dlp.
              |∇ ψ| p xref,j
(181)

The final Jacobian is given by

        ∮  2
        --B|∇-Rψ|dlp-1-
𝒥new = ±   2π   B2 .
(182)

The usefullness of Boozer poloidal angle will be further discussed in Sec. 10.8 after we introduce a gneralized toroidal angle.

 

Jacobian for PEST poloidal angle (straight-field-line poloidal angle)

If the Jacobian 𝒥 is chosen to be of the following form

𝒥 (ψ,𝜃) = R2,

then Eq. (156) implies that the local safety factor, ˆq (ψ,𝜃) = g∕Ψ, is a magnetic surface function, i.e., the magnetic field lines are straight in (ψ,𝜃) plane. Then the poloidal angle in Eq. (172) is written

                     ∫
-    -      ∮--2π----  xi,j --1---
𝜃i,j = 𝜃ref,j + R1|∇-ψ|dlp xref,j R|∇ψ |dlp,
(183)

The Jacobian 𝒥new given by Eq. (173) now takes the form

          ∮ --1--dl
𝒥new = ±R2 --R|∇ψ|-p.
             2π
(184)

Let us denote an arbitrary poloidal angle by 𝜃 and the above straight-field-line poloidal angle by 𝜗, then it is ready to find the following relation between 𝜃 and 𝜗:

           1∫ 𝜃
𝜗 = 𝜗ref,j + q 𝜃  qˆd𝜃,
              ref,j
(185)

where ˆq is the local safety factor corresponding to the arbitrary poloidal angle 𝜃, i.e., ˆq = B⋅∇ϕ∕(B⋅∇𝜃). [Proof: Using d𝜃 = --R--
|𝒥∇ψ |dlp, the poloidal angle 𝜗 given in Eq. (183) is written as

                    ∫ x
𝜗 = 𝜗ref,j + ∮--2π---    i,j--1---dlp
            R|1∇ψ|dlp  xref,jR |∇ ψ|
                2π      ∫ xi,j   1   |𝒥 ∇ψ |
  = 𝜗ref,j + ∮--1--|𝒥∇ψ|--      -----------d𝜃
            R|∇ψ|  R  d𝜃 xref,j R|∇ψ |  R
          --2π---∫ xi,j|𝒥-|
  = 𝜗ref,j + ∮ |𝒥|d𝜃 xref,j R2 d𝜃.                           (186)
            R2
Using ˆq = g-
R2𝒥-
Ψ′, where 𝒥 is the Jacobian of (ψ,𝜃,ϕ) coordinates, then the above 𝜗 is reduced to expression (185).]

Note that Boozer poloidal angle is very close to the poloidal angel disccused here because the two Jacobians are very similar:

     -1-   2
𝒥  = B2 ∼ R .
(187)

Comparison between different types of poloidal angle

 

All Jacobians introduced above can be written in a general form:

     --Ri----
𝒥  = |∇ ψ|jBk,
(188)

The choice of (i = 2,j = k = 0) gives the PEST coordinate, (i = j = 0,k = 2) give the Boozer coordinate, (i = j = 1,k = 0) gives the equal-arc coordinate, (i = j = k = 0) gives the Hammada coordinate.

 

Figure 6 compares the equal-arc-poloidal angle and the straight-line poloidal angle, which shows that the resolution of the straight-line poloidal angle is not good near the low-field-side midplane. Since ballooning modes take larger amplitude near the low-field-side midplane, better resolution is desired there. This is one reason that I often avoid using the straight-line poloidal angle in my numerical codes.


pict pict

Fig. 6: The equal-arc poloidal angle (left) and the straight-line poloidal angle (right) for EAST equilibrium #38300@3.9s. The blue lines correspond to the equal-𝜃 lines, with uniform 𝜃 interval between neighbour lines. The red lines correspond to the magnetic surfaces, which start from ∘ Ψ--
    t = 0.01714 (the innermost magnetic surface) and end at ∘ Ψ--
    t = 0.9851 (the boundary magnetic surface), and are equally spaced in ∘ ---
  Ψt.

Verification of Jacobian

After the magnetic coordinates are constructed, we can evaluate the Jacobian 𝒥new by using directly the definition of the Jacobian, i.e.,

       ------1-------
𝒥new = (∇ψ × ∇ 𝜃) ⋅∇ϕ ,
(189)

which can be further written as

𝒥new = R (R 𝜃Zψ − RψZ𝜃),
(190)

where the partial differential can be evaluated by using numerical differential schemes. The results obtained by this way should agree with results obtained from the analytical form of the Jacobian. This consistency check provide a verification for the correctness of the theory derivation and numerical implementation. In evaluating the Jacobian by using the analytical form, we may need to evaluate ψ, which finally reduces to evaluating Ψ. The value of |∇Ψ| is obtained numerically based on the numerical data of Ψ given in cylindrical coordinate grids. Then the cubic spline interpolating formula is used to obtain the value of |∇Ψ| at desired points. (𝒥new calculated by the second method (i.e. using analytic form) is used in the GTAW code; the first methods are also implemented in the code for the benchmark purpose.) In the following sections, for notation ease, the Jacobiban of the constructed coordinate system will be denoted by 𝒥 , rather than 𝒥new.

Radial coordinate

The radial coordinate ψ can be chosen to be various surface function, e.g., volume, poloidal or toroidal magnetic flux within a magnetic surface. The frequently used radial coordinates include Ψ, and √ Ψ-, where Ψ is defined by

--  Ψ-−-Ψ0-
Ψ = Ψa − Ψ0,
(191)

where Ψ0 and Ψa are the values of Ψ at the magnetic axis and LCFS, respectively. Other choices of the radial coordinates: the toroidal magnetic flux and its square root, Ψt, and ∘ ---
  Ψt, where Ψt and Ψt are defined by

dΨt
dΨ- = 2πq,Ψt(0) = 0
(192)

and

Ψ-=  -Ψt-,
 t   Ψt(1)
(193)

respectively, where Ψt(0) and Ψt(1) are the values of Ψt at the magnetic axis and LCFS, respectively.

If ψ =   ---
∘ Ψt, then

dΨ   dΨ dΨ     1 dΨ     1  dΨ dΨ-    1
---= -----t = ------t= ------t--t-= ---Ψt(1)2ψ
dψ   dΨtdψ    2πq dψ   2πq dΨtdψ    2πq
(194)

The cylindrical coordinates (R,ϕ,Z) is a right-hand system, with the positive direction of Z pointing vertically up. In GTAW code, the positive direction of 𝜃 is chosen in the anticlockwise direction when observers look along the direction of ˆ
ϕ. Then the definition 𝒥1 = ψ ×∇𝜃 ⋅∇ϕ indicates that (1) 𝒥 is negative if ψ points from the magnetic axis to LCFS; (2) 𝒥 is positive if ψ points from the LCFS to the magnetic axis. This can be used to determine the sign of Jacobian after using the analytical formula to obtain the absolute value of Jacobian.

If ψ = Ψ or ψ = √ --
  Ψ, ψ points from the magnetic axis to LCFS.

The volume between magnetic surfaces can also be used as a radial coordinate. The differential volume element is written as

d3V = 𝒥 dψd𝜃dϕ.
(195)

Integrating over the toroidal angle, we obtain

 2
d V = 2π𝒥dψd 𝜃
(196)

Further integrating over the poloidal angle, we obtain

 1         ∮
d V = 2πdψ   𝒥 d𝜃,
(197)

i.e.,

d1V      ∮
----= 2π   𝒥 d𝜃.
 dψ
(198)

In codes I wrote, I stick to using Ψ as the radial coordinate when doing computation, and transform to other radial coordinates when presenting the results if needed.