A routine in tokamak operation is to reconstruct magnetic field under the constraints of MHD force balance and various measurements. This kind of task can be done by various codes, e.g., EFIT. I developed a similar code, heq (github.com/youjunhu/heq). I will discuss details related to this code.
I also discuss the fixed-boundary equilibrium problem, where the boundary magnetic surface is given and one is asked to solve the force-balance equation within that boundray.
Another topic is how to construct spatial coordinates that conform to the shape of the magnetic surfaces and makes field line equation simple by defining suitable poloidal/toroidal angles, based on discrete numerical equilibrium data output by the equilibrium reconstructing codes.
Let us begin with the basics.
Due to the divergence-free condition, i.e., ∇⋅ B = 0, magnetic field can be expressed as the curl of a vector field,
| (1) |
where A is called the vector potential of B. (The usefullness of this representation is that, once B is in this form, we do not need to worry about the divergence-free condition.) In cylindrical coordinates (R,ϕ,Z), the above expression is written
| (2) |
We consider axisymmetric magnetic field. The axial symmetry means that, when expressed in the cylindrical coordinate system (R,ϕ,Z), the components of B, namely BR, BZ, and Bϕ, are all independent of ϕ. For this case, it can be proved that an axisymmetric vector potential A suffices for expressing the magnetic field, i.e., all the components of the vector potential A can also be taken independent of ϕ. Using this, Eq. (2) is written
| (3) |
In tokamak literature, direction is called the toroidal direction, and (R,Z) planes (i.e., ϕ = const planes) are called poloidal planes.
Equation (3) indicates that the two poloidal components of B, namely BR and BZ, are determined by a single component of A, namely Aϕ. This motivates us to define a function Ψ(R,Z):
| (4) |
Then Eq. (3) implies the poloidal components, BR and BZ, can be written as
| (5) |
| (6) |
(Note that it is the property of being axisymmetric and divergence-free that enables us to express the two components of B, namely BR and BZ, in terms of a single function Ψ(R,Z).) Furthermore, it is ready to prove that Ψ is constant along a magnetic field line, i.e. B ⋅∇Ψ = 0. [Proof:
We note that Ψ is related to the poloidal magnetic flux, as we will discuss in Sec. 2.7.
Using Eqs. (5) and (6), the poloidal magnetic field Bp is written as
Next, let’s examine the toroidal component Bϕ. Equation (3) indicates that Bϕ involves both AR and AZ. This indicates that using the potential form does not enable useful simplification for Bϕ. Therfore we will directly use Bϕ. Define g ≡ RBϕ(R,Z) (the reason that we define this quantity will become clear when we discuss the forece balance), then the toroidal magnetic field is written as
| (9) |
Combining Eqs. (8) and (9), we obtain
which is a general expression of axisymmetric magnetic field. Expression (10) is a famous formula in tokamak physics.
Let us discuss the gauge transformation of A in the axisymmetric case. As is well known, magnetic field remains the same under the following gauge transformation:
| (11) |
where f is an arbitrary scalar field. Here we require that ∇f be axisymmetric because, as mentioned above, an axisymmetric vector potential suffices for describing an axisymmetric magnetic field. In cylindrical coordinates, ∇f is given by
| (12) |
Since ∇f is axisymmetric, it follows that all the three components of ∇f are independent of ϕ, i.e., ∂2f∕∂R∂ϕ = 0, ∂2f∕∂Z∂ϕ = 0, and ∂2f∕∂ϕ2 = 0, which implies that ∂f∕∂ϕ is independent of R, Z, and ϕ, i.e., ∂f∕∂ϕ is actually a spatial constant. Using this, the ϕ component of the gauge transformation (11) is written
where C is a constant. The requirement of being axial symmetry greatly reduces the degree of freedom of the gauge transformation for Aϕ. Multiplying Eq. (13) with R, we obtain the corresponding gauge transformation for Ψ,
| (14) |
which indicates Ψ is similar to that of electric potential, i.e., adding a constant to it does not make difference. Note that the definition Ψ(R,Z) ≡ RAϕ does not imply Ψ(R = 0,Z) = 0 because Aϕ can adopt 1∕R dependence under the gauge transformation (13). If Aϕ is finite at R = 0, then Ψ is zero there. This is the case we encounter in equilibrium reconstruction.
Because Ψ is constant along a magnetic field line and Ψ is independent of ϕ, the projection of a magnetic field line onto (R,Z) plane is a contour of Ψ. Inversely, a contour of Ψ is also projections of a magnetic field line onto the plane. [Proof. A contour of Ψ on (R,Z) plane satisfies
| (15) |
i.e.,
| (16) |
| (17) |
Using Eqs. (5) and (6), the above equation is written
| (18) |
i.e.,
| (19) |
which is the equation of the projection of a magnetic field line in (R,Z) plane. This proves that contours of Ψ are projections of magnetic field lines in (R,Z) plane.]
Figure 1 shows typical contours of Ψ in a tokamak (CFETR tokamak as an example).
Points where the poloidal field is zero (i.e., ∇Ψ=0) are called magnetic null points. There are two types of magnetgic null points : O-points and X-points, which can be visually identified by viewing contours of Ψ. Mathematically, O-points and X-points are distinguished by the sign of S defined by
| (20) |
where S ≥ 0 corresponds to O-points and S < 0 corresponds to X-points.
Surfaces of revolution generated by rotating Ψ contours around the axis of symmetry (Z axis) are called magnetic surfaces or flux surfaces. No field line intersects these surfaces. We are only interested in flux surfaces within the machine wall. We note that some Ψ contours may intersect the wall before they can form closed curves. Field lines on the corresponding flux surfaces are called open field lines.
The value of Ψ is constant on a magnetic surface. Meanwhile, the values of Ψ on different magnetic surfaces are usually different. These two properties enable Ψ to be used as labels of magnetic surfaces. In cases that there are multiple magnetic surfaces of the same value of Ψ, the ambiguity can be resolved by specifying which region the flux surfaces lie in, e.g., within or outside the last-closed-flux surface region, near the high-field side or low-field side, in the Scrape-Off Layer or the private flux region (PFR).
PFR: the area between the X-point and the material divertor., i.e, the region between divertor legs that is unconnected to the plasma.
Note that Ψ is defined by Ψ = RAϕ, which is just a component of the vector potential A, thereby having no obvious physical meaning. Next, we show that Ψ has a simple relation with the poloidal magnetic flux that can be be measured in experiments.
In Fig. 2, there are two magnetic surfaces labeled, respectively, by Ψ = Ψ1 and Ψ = Ψ2. The poloidal magnetic flux through any toroidal ribbons between the two magnetic surfaces is equal to each other (due to the magnetic Gauss theorem). Next, we calculate this poloidal magnetic flux, denoted by Ψp(12). To make the calculation easy, we select a plane perpendicular to the Z axis, as is shown by the dash line in Fig. (2). In this case, only BZ contribute to the poloidal magnetic flux: (the positive direction of the plane is chosen in the direction of )
Equation (21) indicates that the difference of Ψ between two magnetic surfaces is equal to the poloidal flux divided by 2π.In experiments, we measure the poloidal magnetic flux through toroidal loops around the central symmetric axis (discussed in Sec. 2.8). Consider one of the loops that located at point (R,Z), then, using (21), the flux through the loop can be written as
| (22) |
The central symmetric axis (R = 0) is a field line. If Aϕ is finite at R = 0, then Ψ = AϕR is zero there. This is the case we encounter in equilibrium reconstruction. Then this flux is written as
| (23) |
Due to this relation, Ψ is often called the poloidal magnetic flux per radian (SI unit: web/rad). This relation allows the poloidal flux measurements to be used to constrain the GS equation in the equilibrium reconstrunction (discussed in Sec. 6). Note that the positive normal direction of the surface (where the magnetic flux Ψp is defined) is chosen in the +Z direction.
Tokamaks usually have some toroidal wire loops around the central symmetirc axis, called flux loops, which are used to measure the poloidal magnetic flux through the loops. (By measuring the voltage around the loops, we can obtain the time derivative of the flux and, after integrating over time, the flux itself.)
Suppose that the loop is located at (R,Z) and denote the magnetic flux through the loop by Ψp(R,Z,t) (only the poloidal magnetic field contribute to this flux since the loop is in the toroidal direction). Then Faraday’s law gives
| (24) |
where 𝜀 is the emf. If the loop is a coil with N turns, the induced voltage V in the coil is N times the emf 𝜀, i.e., V = N𝜀. Using this, Eq. (24) is written as
| (25) |
Integrating the above equation over time, we obtain
| (26) |
The starting time t = 0 can be chosen as when Ψp(R,Z,0) is easy to know (e.g., when there is no plasma). Equation (26) tells us how to calcualte Ψp from the measured loop voltage V .
There are usually many flux loops (e.g. 35 on EAST[32]) at different locations in the poloidal plane (see Fig. 3). They are outside of the plasma region and thus are called “external magnetic measurements”. The measured poloidal flux, along with the poloidal field measurement by magnetic probes, can be used as constraints in reconstructing the magnetic field within the plasma region. This is discussed in Sec. 6.
In most part of a tokamak plasma, contours of Ψ in (R,Z) plane are closed before they touch the machine wall. Figure 4 shows some examples of closed flux surfaces.
The innermost magnetic surface reduces to a curve, which is called magnetic axis (in Fig. 4, Ψ0 labels the magnetic axis). ∇Ψ is zero at the magnetic axis since Ψ(R,Z) reach maximum/minimum there. As a result, the poloidal magnetic field is zero there (refer to Eq. (8)).
As is discussed in Sec. 2.7, the poloidal magnetic flux enclosed by a magnetic surface Ψ (the poloidal magnetic flux through the toroidal surfaces S2) is given by
| (27) |
Here the positive direction of the surface S2 is defined to be in the clockwise direction when an observer looks along the direction of . In practice, we need to pay attention to the positive direction chosen (there can be a sign difference when choosing different positive directions).
Also note, the poloidal magnetic flux enclosed by a closed magnetic surface can have another definitions: the poloidal magnetic flux through the central hole of the magnetic surface, i.e., the poloidal flux through S1 in Fig. 4. In this case, as is discussed in Sec. 2.7, the poloidal magnetic flux is related to Ψ by
| (28) |
where the positive direction of the surface S1 is in the clockwise direction.
Also note that, since Bp = ∇Ψ ×∇ϕ, the condition ΨLCFS − Ψaxis > 0 means Bp points in the anticlockwise direction (viewed along ϕ direction), and ΨLCFS − Ψaxis < 0 means Bp points in the clockwise direction.
In the above, the magnetic field is assumed to be axisymmetric. With this assumption, the poloidal magnetic field (having two components) can be expressed in terms of a single component of the vector potential A, Aϕ (specifically via Ψ ≡ AϕR). This kind of simplification is not achievable if the axisymmetricity assumption is dropped, because other components of the vector potential (namely AR and AZ) will appear in the expression of the poloidal magnetic field. Let us re-examine Eq. (2) for a general magnetic perturbation:
When studying tearing modes and turbulence, most authors narrow the possible perturbations by setting δAR = δAZ = 0, i.e.,
| (30) |
| (31) |
| (32) |
where δΨ = RδAϕ. Therefore this kind of magnetic perturbation can still be written in the same form of the equilibrium poloidal magnetic field:
| (33) |
The above approximation is widely used in practice, e.g., in turbulence simulation, where δAϕ is replaced by δA∥. (Do we miss some magnetic perturbations that is important for plasma transport when using the above specific form?)
The total magnetic field is then written as
| (34) |
**check**Can the projection of the total magnetic field line in the poloidal plane can be traced by tracing the contour of Ψ + δΨ? No. The contours of Ψ + δΨ will not show island structures in the poloidal plane. To show the expected island structures, we need to subtract non-reconnecting poloidal magnetic field from the total poloidal field? **check** The contours of the so-called helical flux will give the expected island structures near the resonant surfaces?**check**
Next, we go back to discuss the 2D case (i.e., assuming axisymmetry).
When the displacement current term is neglectable (the case we consider here), the conductive current is just another representation of the magnetic field. Specifically, the current density is proportional to the curl of the magnetic field (Ampère’s law):
where μ0 is vacuum magnetic permeability.
Use Eq. (35) and the definition g ≡ RBϕ, the poloidal components of the current density, JZ and JR, can be written as
| (36) |
and
| (37) |
respectively.
Ampere’s law (35) indicates the toroidal current density Jϕ is given by
Define △⋆ by
| (39) |
which is the Laplace operator in cylindrical coordinates for the axisymmertic case, then Eq. (38) is written as
| (40) |
(Many authors refer to Eq. (40) as the Grad-Shafranov (GS) equation. No, it is not. It is just Ampere’s law, which has nothing to do with the force-balance. Only after you express Jϕ in terms of the plasma pressure, can Eq. (40) be called the GS equation, as is discussed Sec. 5.3.)
Let us consider what constraint the force balance imposes on the axisymmetric magnetic field discussed above. The MHD momentum equation is given by
| (41) |
where ρ, ρq, ℙ, J, E, and B are mass density, charge density, thermal pressure tensor, current density, electric field, and magnetic field, respectively. The electric field force ρqE is usually ignored due to either ρq = 0 or E = 0. Further assume that there is no plasma flow (u = 0, the flow effect is discussed in A.4) and the plasma pressure is isotropic, then the steady state momentum equation (force balance equation) is written as
| (42) |
where P is the scalar plasma pressure.
Is the force balance (42) always satisfied in a real toakamak discharge? To answer this question, we need to go back to the original momentum equation (41). The imbalance between J × B and ∇P will give rise to the compressional Alfven waves, the time-scale of which, τA, is much shorter than the time-scale τ we are interested in. Therefore, on the time scale τ (and for slow flow with u < Cs, where Cs is the the sound speed), the leading order of the momentum equation is the force balance (42).[26].
Consider the force balance in the direction of B. Dotting the equilibrium equation (42) by B, we obtain
| (43) |
which implies that P is constant along a magnetic field line. Since Ψ is also constant along a magnetic field line, P can be expressed in terms of only Ψ on a single magnetic line. Note that this does not necessarily mean P is a single-valued function of Ψ, (i.e. P = P(Ψ)). This is because P still has the freedom of taking different values on different magnetic field lines with the same value of Ψ while still satisfying B ⋅∇P = 0. This situation can appear when there are saddle points (X points) in Ψ contours (refer to Sec. A.13) and P takes different functions of Ψ in islands of Ψ sepearated by a X point. For pressure within a single island of Ψ, P = P(Ψ) can be safely assumed.
On the other hand, if P = P(Ψ), then we obtain
B ⋅∇P = B ⋅∇Ψ = 0, |
i.e., Eq. (43) is satisfied, indicating P = P(Ψ) is a sufficient condition for the force balance in the parallel (to the magnetic field) direction.
Consider the force balance in the toroidal direction. The ϕ component of Eq. (42) is written
| (44) |
Since P = P(Ψ), which implies ∂P∕∂ϕ = 0, equation (44) reduces to
| (45) |
Using the expressions of the poloidal current density (36) and (37) in the force balance equation (45) yields
| (46) |
which can be further written
| (47) |
According to the same reasoning for the pressure, we conclude that g = g(Ψ) is a sufficient condition for the toroidal force balance. (The function g defined here is usually called the “poloidal current function” in tokamak literature. The reason for this name is discussed in Sec. A.5.)
Consider the force balance in direction. The component of Eq. (42) is written
| (48) |
Using the expressions of the current density and magnetic field [Eqs. (6) and (37)], equation (48) is written
| (49) |
Assuming the sufficient condition discussed above, i.e., P and g are a function of only Ψ, i.e., P = P(Ψ) and g = g(Ψ), Eq. (49) is written
| (50) |
which can be simplified to
| (51) |
which is the requirement of force-balance along the major radius. On the other hand, we know Jϕ can be expressed in Ψ via Eq. (40). Combining this with Eq. (51) yields
| (52) |
i.e.,
| (53) |
Equation (53) is known as Grad-Shafranov (GS) equation.
[Note that the Z component of the force balance equation is written
|
which turns out to be identical with the Grad-Shafranov equation. This is not a coincidence. The reason is that the force balance equation has been satisfied in three different directions (namely, , , and B direction) and thus it must be satisfied in all the directions.]
A general axisymmetric magnetic field (which does not necessarily satisfy the force balance), is given by Eq. (10), i.e.,
| (54) |
For the above axisymmetric magnetic field to be consistent with the force balance equation (42), there are additional requirements for Ψ and g. Specifically, Ψ is restricted by the GS equation and g should be a function of only Ψ. Therefore an axisymmetric equilibrium magnetic field is fully determined by two functions, Ψ = Ψ(R,Z) and g = g(Ψ). The Ψ is determined by solving the GS equation with specified RHS source terms and boundary conditions.
The RHS source terms in the GS equation (53) are P(Ψ) and g(Ψ), both of which must be specified before the GS equation can be solved. For most cases, the source terms are nonlinear about Ψ and thus the GS equation is a two-dimensional (in R and Z) nonlinear partial differential equation for Ψ.
For most choices of P(Ψ) and g(Ψ), the GS equation (53) has to be solved numerically. For some particular choices of P and g profiles, analytical solutions are available, one of which is the Solovév equilibrium and is discussed in Appendix A.3.
Note that we solve the GS equation in order to obtain the poloidal magnetic flux Ψ and thus the poloidal magnetic field. The toroidal magnetic field must be specified in some way before we can solve the GS equation. There are several ways of specifying the toroidal magnetic field: (1) given g(Ψ), (2) given ⟨j∥⟩, (3) given the safety factor q(Ψ). There are simple relations between g, ⟨j∥⟩, and q, which allows translation form one to another (discussed later). In transport simulations, ⟨j∥⟩ is obtained from current drive models and neoclassical bootstrap current models. Note that the specification of the source terms (P, g, q, and ⟨j∥⟩) usually involve the unknown Ψ (via not only the explicit presence of Ψ, but also the flux-surface averaging which implicit involves Ψ). This indicates that iterations are needed when numerically solving the GS equation.
Since J = μ0−1∇× B, the current density J can be inferred from a given magnetic field. The components of J (expressed in terms of g and Ψ) are given by Eqs. (36), (37) and (40) and these expressions can be further simplified by using the equilibrium constraints, such as g = g(Ψ) and △∗Ψ = −μ0R2 −g. The simplified J expressions are given in A.11.
On the other hand, in the kinetic equilibrium reconstruction[20], it is the current that is first (partially) specified (e.g., by summing sources of current drive and bootstrap current) and then the current is used as constraints for the GS equation, i.e, constraints for the magnetic field.
The GS equation is given by Eq. (53), i.e.,
| (55) |
If a solution to the GS equation is obtained, the solution can be scaled to obtain a family of solutions. Given an equilibrium with Ψ(R,Z), P(Ψ), g(Ψ), then it is ready to prove that Ψ2 = sΨ, P2 = s2P(Ψ), and g2 = ±sg(Ψ) is also a solution to the GS equation, where s is a constant. In this case, both the poloidal and toroidal magnetic fields are increased by a factor of s, and thus the safety factor remains unchanged. Also note that the pressure is increased by s2 factor and thus the value of β (the ratio of the therm pressure to magnetic pressure) remains unchanged. Note that g2 = ±sg(Ψ), which indicates that the direction of the toroidal magnetic field can be reversed without breaking the force balance. Also note that Ψ2 = sΨ and s can be negative, which indicates that the direction of the toroidal current can also be reversed without breaking the force balance.
The second kind of scaling is to set Ψ2 = Ψ, P2 = P(Ψ), and g22 = g2(Ψ) + c. It is ready to prove that the scaled expression is still a solution to the GS equation because g2g2′ = gg′. This scaling keep the pressure and the poloidal field unchanged and thus the poloidal beta βp remains unchanged. This scaling scales the toroidal field and thus can be used to generate a family of equilibria with different profiles of safety factor.
Another scaling, which is trivial, is to set Ψ2 = Ψ, P2 = P(Ψ) + c, and g2 = g(Ψ). This scaling can be used to test the effects of the pressure (not the pressure gradient) on various physical processes.
When a numerical equilibrium is obtained, one can use these scaling methods together to generate new equilibria that satisfy particular global conditions. Note that the shape of magnetic surfaces of the scaled equilibrium remains the same as the original one.
The above scaling is made under the constraint that the the GS equation (55), is satisfied. In practice, we may scale Ψ by a factor while fixing g and P. This does not satisfy the GS equation, but allows more flexibility in changing the the safety factor profile. Scaling Ψ by a factor corresponds to scaling the plasma current and the poloidal magnetic field.
Ampere’s law in Eq. (40) can be generalized to include discrete toroidal currents:
| (57) |
where G is the fundamental solution given by
which is often called Green’s function in this context. (The Green function is obtained by using a formula similar to the Biot-Savart Law, see 676.)If all the toroidal currents (plasma current + PF coil curents) are known, then Ψ can be calculated by using Eq. (57). Unfortunately Jϕ is usually unknown. On the other hand, the force-balance indicates that Jϕ can be expressed in terms of Ψ via Eq. (51), i.e.,
| (59) |
Substituting this into Eq. (57) gives an implicit formula for Ψ, which can be iterated (with an initial guess of Ψ(R,Z), and assuming the function forms, P(Ψ) and g(Ψ), as well as the coil currents Ii, are known ). Will the iteration converge? We do not know for sure. Numerical experiments indicate it does in some cases[18]. Let us discuss these cases. We assume that the 1D functions, P(Ψ) and g(Ψ) can be modeled as (following EFIT’s model):
| (60) |
| (61) |
where
| (62) |
ΨM and ΨB are values of Ψ at the magnetic axis and LCFS, the coefficients αj and βj are to be determined, Np and NF are integers chosen by users. One feature of expressions (60) and (61) is that they guarantee that dP∕dΨ and gdg∕dΨ are zero at and outside the LCFS, and thus no plasma current there. Also note that expressions (60) and (61) are nonlinear functions of Ψ even for Np = NF = 1. This is because the unknowns, ΨM and ΨB, appear in the denominator of expression (62). Another nonlinearity is related to the fact that the unkonw Ψ determines where is the LCFS and thus determine region where the current desnsity is set to zero. This also gives rise to the name “free-boundary” when referring to this kind of problem.
Choosing an initial guess of Ψ(R,Z) on gridpoints, we can get the values of αj, βj, and Ii by solving a least square problem that minimises the difference between quantities computed and the corresponding quantities measured in actual experiments. (Details are given in Sec. 6.1.)
After the coefficients αj and βj are obtained, Jϕ can be updated by using Eqs. (59)-(62). Then, we use the latest Jϕ and Ii in Eq. (57) to update the values of Ψ on gridpoints. We repeat the above procedure until convergecne in Ψ(R,Z). This is called Picard iteration. (Alternatively, the values of Ψ on the inner gridpoints can be updated by inverting the Laplace operator △⋆, see Sec. 6.4. The values of Ψ on the bounary still have to be obtained by using Eq. (57).)
I implemented the above method in a Python code HEQ (https://github.com/youjunhu/heq). The following subsections discuss details in the code: Sec. 6.1 discusses the least square problem. Sec. 6.3 discusses the vertical displacement instability stabilizer. Without the stabilizer, the Picard iteration diverges for many elongated configurations, due to the vertical displacement instability.
Plugging expressions (60) and (61) into (59), we obtain
For notation ease, define the following basis functions:
| (64) |
and the corresponding expansion coefficients
| (65) |
then Eq. (63) is written as
| (66) |
where Nb = NP + NF. Plugging expression (66) into Eq. (57), we obtain
Collect all the free parameters as a column vector: u = (c0,…cNb−1,I0,…,INc−1)T. Denote the size of vector u by N, which is the number of free parameters, i.e., N = Nb + Nc, then the rhs of Eq. (67) can be written as matrix-vector product, Γu. Denote the total number of measurements of the poloidal flux by MFL. Then matrix elements of Γ for i = 0,…,MFL − 1 are given by:
| (68) |
for j = 0,…,Nb − 1, and
| (69) |
for j = Nb,…,N − 1. Here (Ri(FL),Zi(FL)) is the location where the ith flux measurement is made.
The matrix Γ , which is of shape (M,N), is called “response matrix”. (In least square problems, this matrix is called “design matrix’.) The value of M is equal to number of measurements included (measurements are merged to Γ by row stacking). We will include MFL measurements of the poloidal flux, MB measurements of the poloidal magnetic field, 1 measurement of plasma current, a constraint for the on-axis safety factor. Then M = MFL + MB + 1 + 1. (For EAST, MFL = 35,MB = 38.)
Next, we consider the poloidal field measurement:
| (70) |
where (Ri,Zi) is the location of the No. i probe, i is a unit vector denoting the positive normal direction of the No. i magnetic probe, cos𝜃pi = i ⋅ eR, sin𝜃pi = i ⋅ eZ.
Bp(Ri,Zi) can be inferred from u via
where
| (72) |
and GBR and GBZ is given by Eq. (681) and (682). The rhs of Eq. (71) indicates that the matrix elements of Γ are given by:
| (73) |
for (j = 0,…,Nb − 1), and
| (74) |
for (j = Nb,…,N − 1) . I place the magnetic field equations after the flux equations, i.,e the row number i is in the range [MFL,MFL + MB − 1].
Next, we consider the constraint of plasma current. The plasma current Ip can be inferred from u via
| (75) |
The rhs of Eq. (75) indicates that the matrix elements of Γ are given by:
| (76) |
for (j = 0,…,Nb − 1), and zero for (j = Nb,…,N − 1) . This equation is placed after the equations of flux and magnetic field measurement, i.e., its row number is i = MFL + MB.
Let us consider the constraint of on-axis safety factor value. A formula for computing q value at the magnetic axis is given by [ref. P. M. Bellan’s paper]:
| (77) |
where
| (78) |
is the elongation at the magnetic axis. Using
Jϕ axis = ∑ j=0Nb−1c jbj(0) |
expression (77) is written as
| (79) |
In HEQ, this constraint is not included in some cases.
Step 0. Initial guess of Ψ: Ψ(k) with k = 0.
Step 1. Compute elements of response matrix Γ using Ψ(k).
Step 2. Solve linear least-square problem to get (c1,c2,c2,c4,I1,…,INc).
Step 3. Update Ψ using the Picard iteration:
| (80) |
or in its discrete form:
| (81) |
Step 4: k = k + 1 and goto Step 1.
In Step 1, we first search for the magnetic axis and boundary surface of Ψ(k) so that we can get the values of Ψ(k) at those locations. These values are needed in computing x = (Ψ(k) − ΨM)∕(ΨB − ΨM).
To stabilize the vertical displacement instability in the Picard iteration, we add two virtual coils that carry oppositive currents (denoted by Ivc and −Ivc), and are up-down symmetric, located at (Rvc,Zvc) and (Rvc,−Zvc), respectively. And set the current Ivc by
Ivc = −gz, |
where (Rcur,Zcur) is the location of plasma current center defined by
Rcur = ∫ ΩplRJϕ(R,Z)dRdZ, |
Zcur = ∫ ΩplZJϕ(R,Z)dRdZ, |
BR,vacuum is the BR generated by all the real PF coils, gz is a positive constant chosen by users. Note that g = 1 corresponds to that the BR generated by the virtual coils exactly cancles the BR generted by all the real coils. Usually we need value larger than 2, i.e., over compensation. The virtual coils locatons, (Rvc,Zvc) and (Rvc,−Zvc), are usually chosen near the center of the top/bottom boundary of the computational box.
If we want to invert the finite-difference version of the Laplace operator △∗ to solve the GS equation for Ψ, we encounter two issues: (1) the RHS of the GS equation involves 2 unknown functions P′(Ψ) and gg′(Ψ), in addition to the main unknown function Ψ(R,Z); (2) the boundary condition needs to be given: i.e., the values of Ψ on a rectangular computational boundry need to be provided.
To address issue (1): function forms of P′(Ψ) and g′g(Ψ) are chosen by users, often as polymials in ΨN with coefficients that are assumed known (which are later obtained in the least-square method to make the resulting solution approximately match some measurements, as is discussed in the previous section).
To address issue (2): The value of Ψ on the rectangular boundary is updated using the Green’s function method (assume that external coil currents are given), as is discussed in the previous section.
Guess values of Ψ on both the inner gridpoints and boundary points. After this, we can invert △∗ to update Ψ within the computational box, and use the Green’s function method to update values of Ψ on the boundary. Then iterate to converge.
Two iterations: one for Ψ values on the inner gridpoints, one over Ψ values on the computational boundary.
External PF coil currents enter the problem via the boundary condition: specifically via its contribution to Ψ on the boundary.
The above procedure is just a minor modification from the pure Green’s function algorithm discussed in Sec. 6.2, i.e., replacing the Green’s function method for the inner gridpoints with the finte-difference Laplace operator inverting.
For reference easy, the finite-difference schemes for the Laplace operator is listed below.
| (82) |
Method 1: discretize Eq. (83) as
aφi−1,j + bφi,j + cφi+1,j + dφi,j−1 + eφi,j+1 = −μ0RiJϕi,j, |
where b = −−, a = , c = , d = e = . Method 2: discetize Eq. (84)
− + = −μ0RiJϕi,j, |
which can be organized as
aφi−1,j + bφi,j + cφi+1,j + dφi,j−1 + eφi,j+1 = −μ0RiJϕi,j, |
where b = − − a = + , c = −, d = e =
My numerical experiments indicate this scheme is more stable than than the first one (for the same grid size, and without the VDE stabilizer, the first scheme blow up while the latter scheme works well).
Semi-free boundary equilibrium problems refer to the cases where the LCFS shape and the value of Ψ on it are given and one is asked to solve the currents in the PF coils. This is similar to the fitting problem discussed above: we consider the control points on the LCFS as virtual flux loops that measure the poloidal flux.
An equilibrium reconstruction code (e.g., rtefit) can be used to “observe” the inner structure of Ψ. PF coil currents can provide actions on Ψ. With the sensors and actuators, we can feedback controll the magnetic configuration (flux map).
For example, consider controlling the shape of LCFS (often called iso-flux control). We choose a target surface. To make sure that the target surface is a magnetic surface, the value of Ψ on it should be made a spatial constant. Dentoe this constant by Ψt. To make sure that there is no closed flux surface outside the target surface, we select the target surface as a surface that is tangential to the first wall (for limiter configuration) or there is a X-point on it (for divertor configuration). Then discretize the target surface by a series of discrete coordinates (Ri,Zi) with i = 1,2,…M. The actions (coil current changes) are chosen to minimise the following residual:
| (87) |
where
| (88) |
| (89) |
the superscritp (old) indicates values before the control actions, Ψi(old) is obtained by a real-time equilibrium reconstruction code.
This assumes that the plasma current density remains the same when the actions are imposed (i.e., no plasma response is included), so that only the coil current changes contribute to the Ψ change.
If we need to feedback control X points to derised positions, then the above sum can be extended to include the following:
Plasma physists love to consider a kind of simplified problem: the fixed boundary equilibrium problem, where the shape of the boundary flux surface is given (the value of Ψ is a constant on this boundary). In dealing with the fixed boundary problem, the curvilinear coordinate system is useful. Specifically, the convenience is that the coordinates can be adjusted to make one of the coordinate surfaces coincide with the given boundary flux surface, so that the boundary condition becomes trivial.
More generally, curvilinear coordinates can be ajusted to make coordinate surfaces coincide with magnetic surfaces (dicussed later). This often simplifies analysis of wave and transport problems, especially when we properly choose the poloidal/toroidal coordinate to make magnetic field lines look like straight lines in terms of these coordinates.
Next section discusses the basic theory of curvilinear coordinates system[4].
In many studies of tokamak plasmas, one need construct a curvilinear coordinate system based on a given magnetic cofiguration in order to make the problem amenable to analytical methods or numerical methods. Specifically, many theories and numerical codes use the curvilinear coordinate systems that are constructed with one coordinate surface coinciding with magnetic surfaces. In these coordinate systems, we need to choose a poloidal coordinate 𝜃 and a toroidal coordinate ζ. As metioned above, a particular choice for 𝜃 and ζ is one that makes the magnetic field lines be straight lines in (𝜃,ζ) plane. These kinds of coordinates are often called magnetic coordinates. That is, “magnetic coordinates are defined so they conform to the shape of the magnetic surfaces and trivialize the equations for the field lines.”
A further tuned magnetic coordinate system is the so-called field aligned (or filed-line following) coordinate system, in which changing one of the three coordinates with the other two fixed would correspond to following a magnetic field line. The field aligned coordinates are discussed in Sec. 17.
Next, let us discuss some general properties about coordinates transformation.
A magnetic field line on a closed magnetic surface travel a closed curve in a poloidal plane. For these kinds of field lines, we can define the safety factor q: the number of toroidal loops a magnetic field line travels when it makes one poloidal loop, i.e.
| (91) |
where △ϕ as the change of the toroidal angle when a magnetic field line travels a full poloidal loop. The safety factor can also be understood as the average pitch angle of a magnetic field line in (𝜃,ϕ) plane of a closed magnetic surface.
For open field line region (where a field line touches the wall before its poloidal projection can close itself), the “connection length” is often used to characterize the magnetic field.
The equation of magnetic field lines is given by
| (92) |
where dℓp is the line element along the direction of Bp on the poloidal plane. Equation (92) can be arranged in the form
| (93) |
which can be integrated over dℓp to give
| (94) |
where the line integration is along the poloidal magnetic field (the contour of Ψ on the poloidal plane). Using this, Eq. (91) is written
| (95) |
The safety factor given by Eq. (95) is expressed in terms of the components of the magnetic field. The safety factor can also be expressed in terms of the magnetic flux. Define ΔΨp as the poloidal magnetic flux enclosed by two neighboring magnetic surface, then ΔΨp is given by
| (96) |
where Δx is the length of a line segment in the poloidal plane between the two magnetic surfaces, which is perpendicular to the first magnetic surface (so perpendicular to the Bp). Note that Δx, as well as R and Bp, generally depends on the poloidal location whereas ΔΨp is independent of the poloidal location.
Using Eq. (96), the poloidal magnetic field is written as
| (97) |
Substituting Eq. (97) into Eq. (95), we obtain
| (98) |
We know ΔΨp is a constant independent of the poloidal location, so ΔΨp can be taken outside the integration to give
| (99) |
It is ready to realise that the integral appearing in Eq. (99) is the toroidal magnetic flux enclosed by the two magnetic surfaces, ΔΨt. Using this, Eq. (99) is written as
| (100) |
Equation (100) indicates that the safety factor of a magnetic surface is equal to the differential of the toroidal magnetic flux with respect to the poloidal magnetic flux enclosed by the magnetic surface.
If the safety factor of a magnetic surface is a rational number, i.e., q = m∕n, where m and n are integers, then this magnetic surface is called a rational surface, otherwise an irrational surface. A field line on a rational surface with q = m∕n closes itself after it travels n poloidal loops. An example of a field line on a rational surface is shown in Fig. 5.
In the Cartesian coordinates, a point is described by its coordinates (x,y,z), which, in the vector form, is written as
| (101) |
where r is the location vector of the point; , , and are the basis vectors of the Cartesian coordinates, which are constant, independent of spactial location. The transformation between the Cartesian coordinates system, (x,y,z), and a general coordinates system, (x1,x2,x3), can be expressed as
| (102) |
For example, cylindrical coordinates (R,ϕ,Z) can be considered as a general coordinate systems, which are defined by r = R cosϕ + R sinϕ + Z.
The transformation function in Eq. (102) can be written as
| (103) |
A useful quality characterizing coordinate transformation is the Jacobian determinant (or simply called Jacobian), which, for the transformation in Eq. (103), is defined by
| (104) |
which can also be written as
| (105) |
It is easy to prove that the Jacobian 𝒥 in Eq. (105) can also be written (the derivation is given in my notes on Jacobian)
| (106) |
Conventionally, the Jacobian of the transformation from the Cartesian coordinates to a particular coordinate system σ is called the Jacobian of σ, without explitly mentioning that this transformation is with respect to the Cartesian coordinates.
Using the defintion in Eq. (104), the Jacobian 𝒥 of the Cartesian coordinates can be calculated, yielding 1. Likewise, the Jacobian of the cylindrical coordinates (R,ϕ,Z) can be calculated as follows:
In a curvilinear coordinate system (x1,x2,x3), there are two kinds of basis vectors: ∇xi and ∂r∕∂xi, with i = 1,2,3. These two kinds of basis vectors satisfy the following orthogonality relation:
| (107) |
where δij is the Kronical delta function. [Proof: Working in a Cartesian coordinate system (x,y,z) with the corresponding basis vectors denoted by (,,), then the left-hand side of Eq. (107) can be written as
where the second equality is due to ∂∕∂xj = 0,∂∕∂xj = 0,∂∕∂xj = 0 since ,, are constant vectors independent of spatial location; the chain rule has been used in obtaining Eq. (109)][The cylindrical coordinate system (R,ϕ,Z) is an example of general coordinates. As an exercise, we can verify that the cylindrical coordinates have the property given in Eq. (107). In this case, x = x1 cosx2, y = x1 sinx2, z = x3, where x1 ≡ R, x2 ≡ ϕ, x3 ≡ Z.]
It can be proved that ∇xi is a contravariant vector while ∂r∕∂xi is a covariant vector (I do not prove this and do not bother with the meaning of these names, just using this as a naming scheme for easy reference).
The orthogonality relation in Eq. (107) is fundamental to the theory of general coordinates. The orthogonality relation allows one to write the covariant basis vectors in terms of contravariant basis vectors and vice versa. For example, the orthogonality relation tells that ∂r∕∂x1 is orthogonal to ∇x2 and ∇x3, thus, ∂r∕∂x1 can be written as
| (110) |
where A is a unknown variable to be determined. To determine A, dotting Eq. (110) by ∇x1, and using the orthogonality relation again, we obtain
| (111) |
which gives
| (113) |
Similarly, we obtain
| (114) |
and
| (115) |
Equations (113)-(115) can be generally written
| (116) |
where (i,j,k) represents the cyclic order in the variables (x1,x2,x3). Equation (116) expresses the covariant basis vectors in terms of the contravariant basis vectors. On the other hand, from Eq. (113)-(115), we obtain
| (117) |
which expresses the contravariant basis vectors in terms of the covariant basis vectors.
Suppose (ψ,𝜃,ζ) is an arbitrary general coordinate system. Following Einstein’s notation, contravariant basis vectors are denoted with upper indices as
| (120) |
In term of the contravairant basis vectors, A is written
| (121) |
where the components are easily obtained by taking scalar product with eψ,e𝜃,andeζ, yielding Aψ = A ⋅ eψ, A𝜃 = A ⋅ e𝜃, and Aζ = A ⋅ eζ. Similarly, in term of the covariant basis vectors, A is written
| (122) |
where Aψ = A ⋅ eψ, A𝜃 = A ⋅ e𝜃, and Aζ = A ⋅ eζ.
Using the above notation, the relation in Eq. (116) is written as
| (123) |
| (124) |
| (125) |
where 𝒥 = [(∇ψ ×∇𝜃) ⋅∇ζ]−1. Similarly, the relation in Eq. (117) is written as
| (126) |
| (127) |
| (128) |
The gradient of a scalar function f(ψ,𝜃,ζ) is readily calculated from the chain rule,
| (129) |
Note that the gradient of a scalar function is in the covariant representation. The inverse form of this expression is obtained by dotting the above equation respectively by the three contravariant basis vectors, yielding
| (130) |
| (131) |
| (132) |
Using Eq. (129), the directional derivative in the direction of ∇ψ is written as
| (133) |
To calculate the divergence of a vector, it is desired that the vector should be in the contravariant form because we can make use of the fact:
| (134) |
for any scalar quantities α and β. Therefore we write vector A as
| (135) |
where A(ψ) = A ⋅∇ψ, A(𝜃) = A ⋅∇𝜃, A(ζ) = A ⋅∇ζ. Then the divergence of A is readily calculated as
where the second equality is obtained by using Eqs. (130), (131), and (132).
The Laplacian operator is defined by ∇2 ≡∇⋅∇. Then ∇2f is written as (f is an arbitrary function)
To proceed, we can use the divergence formula (137) to express the divergence in the above expression. However, the vector in the above (blue term) is not in the covariant form desired by the divergence formula (137). If we want to directly use the formula (137), we need to transform the vector (blue term in expression (138)) to the covariant form. This process seems to be a little complicated. Therefore, I choose not to use this method. Instead, I try to simplify expression (138) by using basic vector identities:
To take the curl of a vector, it should be in the covariant representation since we can make use of the fact that ∇×∇α = 0. Thus the curl of A is written as
Note that taking the curl of a vector in the covariant form leaves the vector in the contravariant form.
Consider a general coordinate system (ψ,𝜃,ζ). I define the metric tensor as the transformation matrix between the covariant basis vectors and the contravariant ones. Equations (116) and (117) express the relation between the two sets of basis vectors using cross product. Next, let us express the relation in matrix from. To obtain the metric matrix, we write the contrariant basis vectors in terms of the covariant ones, such as
| (144) |
Taking the scalar product respectively with ∇ψ, ∇𝜃, and ∇ζ, Eq. (144) is written as
| (145) |
| (146) |
| (147) |
Similarly, we write
| (148) |
Taking the scalar product with ∇ψ, ∇𝜃, and ∇ζ, respectively, the above becomes
| (149) |
| (150) |
| (151) |
The same situation applies for the ∇ζ basis vector,
| (152) |
Taking the scalar product with ∇ψ, ∇𝜃, and ∇ζ, respectively, the above equation becomes
| (153) |
| (154) |
| (155) |
Summarizing the above results in matrix form, we obtain
| (156) |
Similarly, to convert contravariant basis vector to covariant one, we write
| (157) |
Taking the scalar product respectively with ∇𝜃 ×∇ζ𝒥 , ∇ζ ×∇ψ𝒥 , and ∇ψ ×∇𝜃𝒥 , the above equation becomes
| (158) |
| (159) |
| (160) |
For the second contravariant basis vector
| (161) |
| (162) |
| (163) |
| (164) |
For the third contravariant basis vector
| (165) |
| (166) |
| (167) |
| (168) |
Summarizing these results, we obtain
| (169) |
where
M = , |
This matrix and the matrix in Eqs. (156) should be the inverse of each other. It is ready to prove this by directly calculating the product of the two matrix.
Suppose that (ψ,𝜃,ϕ) are arbitrary general coordinates except that ϕ is the usual toroidal angle in cylindrical coordinates. Then ∇ϕ = 1∕R is perpendicular to both ∇ψ and ∇𝜃. Using this, Eq. (156) is simplified to
| (170) |
Similarly, Eq. (169) is simplified to
| (171) |
[Note that the matrix in Eqs. (170) and (171) should be the inverse of each other. The product of the two matrix,
| (172) |
can be calculated to give
, |
where
A = |∇𝜃|2|∇ψ|2𝒥2∕R2 − (∇𝜃 ⋅∇ψ)2𝒥2. |
By using the definition of the Jacobian in Eq. (106), it is easy to verify that A = 1, i.e.,
| (173) |
]
The axisymmetric equilibrium magnetic field is given by Eq. (54), i.e.,
| (174) |
In a general coordinate system (ψ,𝜃,ϕ) (not necessarily magnetic surface coordinates), the above expression can be written as
| (175) |
where the subscripts denote the partial derivatives with the corresponding subscripts. Note that Eq. (175) is a mixed representation, which involves both covariant and contravariant basis vectors. Equation (175) can be converted to the contravariant form by using the metric tensor, giving
| (176) |
Similarly, Eq. (175) can also be transformed to the covariant form, giving
| (177) |
For the convenience of notation, define
| (178) |
then Eq. (177) is written as
| (179) |
A coordinate system (ψ,𝜃,ϕ), where ϕ is the usual cylindrical toroidal angle, is called a magnetic surface coordinate system if Ψ is a function of only ψ, i.e., ∂Ψ∕∂𝜃 = 0 (we also have ∂Ψ∕∂ϕ = 0 since we are considering axially symmetrical case). In terms of (ψ,𝜃,ϕ) coordinates, the contravariant form of the magnetic field, Eq. (176), is written as
| (180) |
where Ψ′≡ dΨ∕dψ. The covariant form of the magnetic field, Eq. (177), is written as
| (181) |
The local safety factor is defined by
| (182) |
which characterizes the local pitch angle of a magnetic field line in (𝜃,ϕ) plane of a magnetic surface. Substituting the contravariant representation of the magnetic field, Eq. (180), into the above equation, the local safety factor is written
| (183) |
Note that the expression in Eq. (183) depends on the Jacobian 𝒥 . This is because the definition of depends on the definition of 𝜃, which in turn depends on the the Jacobian 𝒥 .
In terms of , the contravariant form of the magnetic field, Eq. (180), is written
| (184) |
and the parallel differential operator B0 ⋅∇ is written as
| (185) |
If happens to be independent of 𝜃 (i.e., field lines are straight in (𝜃,ϕ) plane), then the above operator becomes a constant coefficient differential oprator (after divided by 𝒥−1). This simplification is useful because different poloidal harmonics are decoupled in this case. We will discuss this issue futher in Sec. 16.
The global safety factor defined in Eq. (95) is actually the poloidal average of the local safety factor, i.e.,
Note that q and defined this way can be negative, which depends on the choice of the positive direction of ϕ and 𝜃 coordinates (note that the safety factor given in G-eqdsk file is always positive, i.e. it is the absolute value of the safety factor defined here).Next, let us transform the 𝜃 integration in expression (187) to a curve integral in the poloidal plane. Using the relation dℓp and d𝜃 [Eq. (195)], expression (187) is further written
Expression (188) is used in the GTAW code to numerically calculate the value of q on magnetic surfaces (as a benchmarking of the q profile specified in the G-eqdsk file). Expression (188) can also be considered as a relation between q and g. In the equilibrium problem where q is given (fixed-q equilibrium), we can use expression (188) to obtain the corresponding g (which explicitly appears in the GS equation):
| (189) |
We note that expression (189) involves magnetic surface averaging, which is unknown before we know Ψ. Therefore iteration is usually needed in solving the fixed-q equilibrium (i.e., we guess the unknown Ψ, so that the magnetic surface averaging in expression (189) can be performed, yielding the values of g.)
Using Bp = |∇Ψ|∕R and Bϕ = g∕R, the absolute value of q in expression (188) is written
Given the definition of a magnetic surface coordinate system (ψ,𝜃,ϕ), the Jacobian of this system is fully determined. On the other hand, given the definition of ψ, ϕ, and the Jacobian, the definition of 𝜃 is fully determined (can have some trivial shifting freedoms). Next, let us discuss how to calculate 𝜃 in this case. In (ψ,𝜃,ϕ) coordinates, a line element is written
| (192) |
The line element that lies on a magnetic surface (i.e., dψ = 0) and in a poloidal plane (i.e., dϕ = 0) is then written
| (194) |
Using the fact that ∇ψ and ∇ϕ are orthogonal and ∇ϕ = ∕R, the above equation is written as
| (195) |
Given |𝒥∇ψ|, Eq. (195) can be integrated to determine the 𝜃 coordinate of points on a magnetic surface.
—–
| (196) |
Once |𝒥∇ψ| is known, the value of 𝜃 of a point can be obtained by integrating expression (195), i.e.,
| (197) |
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. (197). Denote the Jacobian of the constructed coordinates by 𝒥′, then
| (198) |
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. (197) 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.)
The span of 𝜃 defined by Eq. (197) 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
| (199) |
Then 𝜃 is written as
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 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. (200) 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.]
If the Jacobian 𝒥 is chosen to be of the following form
| (202) |
Then 𝜃i,j in Eq. (200) is written
| (203) |
and the Jacobian of new coordinates (ψ,𝜃,ϕ), 𝒥new, which is given by Eq. (201), now takes the form
| (204) |
Equation (203) 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. (203) 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.
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
| (205) |
where h(ψ) is a function independent of 𝜃. Then 𝜃i,j in Eq. (200) is written
| (206) |
and the Jacobian of the new coordinates (ψ,𝜃,ϕ), 𝒥new, is given by Eq. (201), which now takes the following form:
| (207) |
Note that both 𝜃i,j and 𝒥new are independent of the function h(ψ) introduced in Eq. (205). (h(ψ) is eliminated by the normalization procedure specified in Sec. 12.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. (207) is constant in space.**)
If the Jacobian 𝒥 is chosen to be of the Boozer form:
| (208) |
then the poloidal angle in Eq. (200) is written as
| (209) |
The final Jacobian is given by
| (210) |
The usefullness of Boozer poloidal angle will be further discussed in Sec. 16.8 after we introduce a gneralized toroidal angle.
If the Jacobian 𝒥 is chosen to be of the following form
𝒥 (ψ,𝜃) = R2, |
then Eq. (183) implies that the local safety factor, (ψ,𝜃) = −g∕Ψ′, is a magnetic surface function, i.e., the magnetic field lines are straight in (ψ,𝜃) plane. Then the poloidal angle in Eq. (200) is written
| (211) |
The Jacobian 𝒥new given by Eq. (201) now takes the form
| (212) |
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 𝜗:
| (213) |
where is the local safety factor corresponding to the arbitrary poloidal angle 𝜃, i.e., = B⋅∇ϕ∕(B⋅∇𝜃). [Proof: Using d𝜃 = dlp, the poloidal angle 𝜗 given in Eq. (211) is written as
Note that Boozer poloidal angle is very close to the poloidal angel disccused here because the two Jacobians are very similar:
| (215) |
All Jacobians introduced above can be written in a general form:
| (216) |
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.
After the magnetic coordinates are constructed, we can evaluate the Jacobian 𝒥new by using directly the definition of the Jacobian, i.e.,
| (217) |
which can be further written as
| (218) |
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.
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
| (219) |
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 , where Ψt and Ψt are defined by
| (220) |
and
| (221) |
respectively, where Ψt(0) and Ψt(1) are the values of Ψt at the magnetic axis and LCFS, respectively.
If ψ = , then
| (222) |
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
| (223) |
Integrating over the toroidal angle, we obtain
| (224) |
Further integrating over the poloidal angle, we obtain
| (225) |
i.e.,
| (226) |
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.
Given an axisymmetric tokamak equilibrium in (R,ϕ,Z) coordinates (e.g., 2D data Ψ(R,Z) on a rectangular grids (R,Z) in G-file), we can construct a magnetic surface coordinates (ψ,𝜃,ϕ) by the following two steps. (1) Find out a series of magnetic surfaces on (R,Z) plane and select radial coordinates for each magnetic surface (e.g. the poloidal flux within each magnetic surface). (2) Specify the Jacobian or some property that we want the poloidal angle to have. Then calculate the poloidal angle of each point on each flux surface (on the ϕ = const plane) by using Eq. (195) (if the Jacobian is specified) or some method specified by us to achieve some property we prefer for the poloidal angle (if a Jacobian is not directly specified). Then we obtain the magnetic surface coordinates system (ψ,𝜃,ϕ).
Two-dimensional data Ψ(R,Z) on a rectangular grids (R,Z) is read from the G_EQDSK file (G-file) of EFIT code. Based on the 2D array data, I use 2D cubic spline interpolation to construct a interpolating function Ψ = Ψ(R,Z). To construct a magnetic surface coordinate system, I need to find the contours of Ψ, i.e., magnetic surfaces. The values of Ψ on the magnetic axis, Ψ0, and the value of Ψ on the last closed flux surface (LCFS), Ψb, are given in G-file. Using these two values, I construct a 1D array “psival” with value of elements changing uniform from Ψ0 to Ψb. Then I try to find the contours of Ψ with contour level value ranging from Ψ0 to Ψb. This is done in the following way: construct a series of straight line (in the poloidal plane) that starts from the location of the magnetic axis and ends at one of the points on the LCFS. Combine the straight line equation, Z = Z(R), with the interpolating function Ψ(R,Z), we obtain a one variable function h = Ψ(R,Z(R)). Then finding the location where Ψ is equal to a specified value Ψi, is reduced to finding the root of the equation Ψ(R,Z(R)) − Ψi = 0. Since this is a one variable equation, the root can be easily found by using simple root finding scheme, such as bisection method (bisection method is used in GTAW code). After finding the roots for each value in the array “psival” on each straight lines, the process of finding the contours of Ψ is finished. The contours of Ψ found this way are plotted in Fig. 7.
In the above, we mentioned that the point of magnetic axis and points on the LCFS are needed to construct the straight lines. In G-file, points on LCFS are given explicitly in an array. The location of magnetic axis is also explicitly given in G-file. It is obvious that some of the straight lines Z = Z(R) that pass through the location of magnetic axis and points on the LCFS will have very large or even infinite slope. On these lines, finding the accurate root of the equation Ψ(R,Z(R)) −Ψi = 0 is difficult or even impossible. The way to avoid this situation is obvious: switch to use function R = R(Z) instead of Z = Z(R) when the slope of Z = Z(R) is large (the switch condition I used is |dZ∕dR| > 1).
In constructing the flux surface coordinate with desired Jacobian, we will need the absolute value of the gradient of Ψ, |∇Ψ|, on some specified spatial points. To achieve this, we need to construct a interpolating function for |∇Ψ|. The |∇Ψ| can be written as
| (227) |
By using the center difference scheme to evaluate the partial derivatives with respect to R and Z in the above equation (using one side difference scheme for the points on the rectangular boundary), we can obtain an 2D array for the value of |∇Ψ| on the rectangular (R,Z) grids. Using this 2D array, we can construct an interpolating function for ∇Ψ by using the cubic spline interpolation scheme.
Metric elements of the (ψ,𝜃,ϕ) coordinates, e.g., ∇ψ ⋅∇𝜃, are often needed in practical calculations. Next, we express these metric elements in terms of the cylindrical coordinates (R,Z) and their partial derivatives with respect to ψ and 𝜃. Note that, in this case, the coordinate system is (ψ,𝜃,ϕ) while R and Z are functions of ψ and 𝜃, i.e.,
| (228) |
| (229) |
Then ∇R and ∇Z are written as
| (230) |
| (231) |
wehre Rψ ≡ ∂R∕∂ψ, etc. Equations (230) and (231) can be solved to give
| (232) |
| (233) |
Using the above expressions, the Jacobian of (ψ,𝜃,ϕ) coordinates, 𝒥 , is written as
| (235) |
Using this, Expressions (232) and (233) are written as
| (236) |
and
| (237) |
Then the elements of the metric matrix are written as
| (238) |
| (239) |
and
| (240) |
Equations (238), (239), and (240) are the expressions of the metric elements in terms of R, Rψ, R𝜃, Zψ, and Z𝜃. [Combining the above results, we obtain
| (241) |
Equation (240) is used in GTAW code. Using the above results, hαβ = ∇α ⋅∇β are written as
| (242) |
| (243) |
| (244) |
As a side product of the above results, we can calculate the arc length in the poloidal plane along a constant ψ surface, dℓp, which is expressed as
In some cases (e.g., turbulence simulation), model tokamak magnetic field, which is not an exact solution to the GS equation, is often used. In the model, the safety factor profile q(ψ), toroidal field function g(ψ), and the magnetic surface shape (R(ψ,𝜃),Z(ψ,𝜃)) are given. To use this model in a simulation, we need to calculate its poloidal magnetic field, which is determined by the poloidal magnetic flux function Ψ. To determine Ψ, we need to use Eq. (187), i.e.,
| (246) |
and re-organize the formula as
| (247) |
which can be integrated to obtain Ψ and thus the poloidal magnetic field Bp = ∇Ψ ×∇ϕ, where 𝒥 = [(∇ψ ×∇𝜃) ⋅∇ϕ]−1. The toroidal magnetic field can be obtained from g(ψ) by Bϕ = g∕R. In most papers, g(ψ) is chosen to be a constant.
A typical magnetic surface shape used in simulations is the Miller shape, which is given by
| (248) |
where r = ψ is the radial coordinate, R0(r), δ(r), and κr(r) are the Shafronov shift, triangularity, and elongation profiles, which can be arbitrarily specified. For the special case of R0 being a constant, δ(r) = 0, and κ(r) = 1, this shape reduces to a concentric-circular magnetic field. An example of calculating the poloidal field of the model field is given in Sec. 18. This kind of model field can be called theoretical physicists’ tokamak. Computational physicists often use this model for code benchmarking purpose. The famous DIII-D cyclone base case is an example, which was extensively used for benchmarking gyrokinetic simulation of ion temperature driven turbulence.
The magnetic surface average of a physical quantity G(ψ,𝜃,ϕ) is defined by
| (249) |
where the volume integration is over a small volume between two adjacent flux surfaces with Ψ differing by △Ψ. [This formula (with finite ΔΨ) is used in TEK code to calculate the radial heat flux.]
The above 3D volume integration can also be written as a 2D surface integration. The differential volume element is given by d3V = |𝒥|dψd𝜃dϕ, where 𝒥 is the Jacobian of (ψ,𝜃,ϕ) coordinates. Using this, equation (249) is written as
which is a 2D averaging over a magnetic surface and thus is called magnetic surface average. Note that the surface averaging of any n≠0 harmonic is zero (n is the toroidal mode number). Therefore the magnetic surface average contains only the contribution from the n = 0 component, i.e., axisymmetric component. (On the other hand, m≠0 poloidal harmonics of G can contribute to the surface average since the Jacobian has a poloidal angle dependence.) Using this and noting that 𝒥 is axisymmetric, then expression (250) is written as
| (251) |
where G0(𝜃) is defined by the following Fourier expansion:
| (252) |
_________________________________________________________________________________________________________________________
“Zonal” and “mean” components
⟨G⟩ is sometimes called the “zonal” component of G if the radial wavelength of ⟨G⟩ is much smaller than the equilibrium scale length. If the radial wavelength of ⟨G⟩ is comparable to the equilibrium scale length, ⟨G⟩ is usually called “mean” component in tokamak literature. For example, mean flows are of system space scale and thus are easy to be observed in experiments. On the other hand, the “zonal” flow, which usually refers to the turbulence generated secondary flow, is of much smaller radial scale (the radial wavelength of zonal flow is of several Larmor radius) and thus is difficult to observe in experiments.
_________________________________________________________________________________________________________________________
Sometimes, we do not want the Jacobian to explicitly appear in the formula. This can be achieved by writing the differential volume element as
| (253) |
Using Bp = |∇Ψ|∕R, the volume element is further written as
| (254) |
Using this, the averaging defined in Eq. (249) is written as
| (256) |
(Equation (256) is used in the GTAW code to calculate the magnetic surface averaging.) Using Eq. (195) and Bp = |∇Ψ|∕R, equation (256) can also be written as
| (257) |
Using the expression of the volume element dτ = |𝒥|d𝜃dϕdψ, the volume within a magnetic surface is written
| (258) |
Using this, the differential of V with respect to ψ is written as
| (259) |
Using this, Eq. (257) is written as
⟨G⟩ = ∫ 02πG|𝒥|d𝜃 |
Next, examine the meaning of the following volume integral
| (260) |
where the volume V = V (ψ) is the volume within the magnetic surface labeled by ψ. Using ∇⋅ B = 0, the quantity D can be further written as
| (261) |
Note that 𝜃 is not a single-value function of the spacial points. In order to evaluate the integration in Eq. (261), we need to select one branch of 𝜃, which can be chosen to be 0 ≤ 𝜃 < 2π. Note that function 𝜃 = 𝜃(R,Z) is not continuous in the vicinity of the contour of 𝜃 = 0. Next, we want to use the Gauss’s theorem to convert the above volume integration to surface integration. Noting the discontinuity of the integrand 𝜃B in the vicinity of the contour of 𝜃 = 0, the volume should be cut along the contour, thus, generating two surfaces. Denote these two surfaces by S1 and S2, then equation (261) is written as
| (263) |
Using the expression of the volume element dτ = |𝒥|d𝜃dϕdψ, Ψp can be further written in terms of flux surface averaged quantities.
Note that the sign of the Jacobian appears in Eq. (264), which is due to the positive direction of surface S2 is determined by the positive direction of 𝜃, which in turn is determined by the sign of the Jacobian (In my code, however, the positive direction of 𝜃 is chosen by me and the sign of the Jacobian is determined by the positive direction of 𝜃). We can verify the sign of Eq. (264) is exactly consistent with that in Eq. (27).Similarly, the toroidal flux within a flux surface is written as
| (265) |
the poloidal current within a flux surface is written as
| (266) |
and toroidal current within a flux surface is written as
| (267) |
(**check**)The toroidal magnetic flux is written as
⇒ Ψt′ = g |
⇒ = g |
| (269) |
Next, calculate the derivative of the toroidal flux with respect to the poloidal flux.
Comparing this result with Eq. (470) indicates that it is equal to the safety factor, i.e.,
| (271) |
By using the contravariant representation of current density (502), the poloidal current within a magnetic surface is written as
−∇ψ ×∇𝜃 − g′∇ϕ ×∇ψ, |
The toroidal current is written as
The last equality is due to ∇ψ = 0 at ψ = 0. By using the flux surface average operator, Eq. (273) is written
| (274) |
Next, calculate another useful surface-averaged quantity,
In Sec. 12.1, we introduced the local safety factor (ψ,𝜃). Equation (183) indicates that if the Jacobian is chosen to be of the particular form 𝒥 = h(ψ)R2, then the local safety factor is independent of 𝜃, i.e., magnetic line is straight in (𝜃,ϕ) plane. On the other hand, if we want to make field line straight in (𝜃,ϕ) plane, the Jacobian must be chosen to be of the specific form 𝒥 = h(ψ)R2. We note that, as mentioned in Sec. 12.3, the poloidal angle is fully determined by the choice of the Jacobian. The specific choice of 𝒥 = α(ψ)R2 is usually too restrictive for achieve a desired poloidal resolution (for example, the equal-arc poloidal angle can not be achieved by this choice of Jacobian). Is there any way that we can make the field line straight in a coordinate system at the same time ensure that the Jacobian can be freely adjusted to obtain desired poloidal angle? The answer is yes. The obvious way to achieve this is to define a new toroidal angle ζ that generalizes the usual toroidal angle ϕ. Define a new toroidal angle ζ by[10]
| (277) |
where δ = δ(ψ,𝜃) is a unknown function to be determined by the constraint of field line being straight in (𝜃,ζ) plane. Using Eq. (184), the new local safety factor in (ψ,𝜃,ζ) coordinates is written as
To make the new local safety factor be independent of 𝜃, the right-hand side of Eq. (278) should be independent of 𝜃, i.e.,
| (279) |
where c(ψ) can be an arbitrary function of ψ. A convenient choice for c(ψ) is c(ψ) = q, i.e., making the new local safety factor be equal to the original global safety factor, i.e., new = q. In this case, equation (279) is written as
| (280) |
which, on a magnetic surface labed by ψ, can be integrated over 𝜃 to give
| (281) |
where 𝜃ref is an starting poloidal angle arbitrarily chosen for the integration, and δ(ψ,𝜃ref) is the constant of integration. In the following, both 𝜃ref and δ(ψ,𝜃ref) will be chosen to be zero. Then the above equations is written
| (282) |
Substituting the above expression into the definition of ζ (Eq. 277), we obtain
| (283) |
which is the formula for calculating the general toroidal angle. If 𝜃 is a straight-field line poloidal angle, then ζ in Eq. (283) reduces to the usual toroidal angle ϕ.
In summary, magnetic field line is straight in (𝜃,ζ) plane with slope being q if ζ is defined by Eq. (283). In this method, we make the field line straight by defining a new toroidal angle, instead of requiring the Jacobian to take particular forms. Thus, the freedom of choosing the form of the Jacobian is still available to be used later to choose a good poloidal angle coordinate. Note that the Jacobian of the new coordinates (ψ,𝜃,ζ) is equal to that of (ψ,𝜃,ϕ). [Proof:
[In numerical implementation, the term ∫ 0𝜃d𝜃 appearing in δ is computed by using
For later use, from Eq. (282), we obtain
This formula is used in GTAW code, where the derivative ∂(g∕Ψ′)∕∂ψ is calculated numerically by using the central difference scheme.]
Recall that the contravariant form of the magnetic field in (ψ,𝜃,ϕ) coordinates is given by Eq. (184), i.e.,
| (287) |
Next, let us derive the corresponding form in (ψ,𝜃,ζ) coordinates. Using the definition of ζ, equation (287) is written as
The expression of the magnetic field in Eq. (289) can be rewritten in terms of the flux function Ψp and Ψt discussed in Sec. 15.2. Equation (289) is
| (290) |
which, by using Eq. (264), i.e., ∇Ψ = ∇Ψp∕(2π), is rewritten as
| (291) |
which, by using Eq. (271), i.e., q = dΨt∕dΨp, is further written as
| (292) |
Noting the simple fact that
| (293) |
where c is a constant, we conclude that
| (294) |
(since ϕ = ζ + q(ψ)δ(ψ,𝜃), where the part q(ψ)δ(ψ,𝜃) acts as a constant when we hold ψ and 𝜃 constant), i.e., the symmetry property with respect to the new toroidal angle ζ is identical with the one with respect to the old toroidal angle ϕ. On the other hand, generally,
| (295) |
and
| (296) |
In the special case that f is axisymmetric (i.e., f is independent of ϕ in (ψ,𝜃,ϕ) coordinates), then two sides of Eqs. (295) and (296) are equal to each other. Note that the partial derivatives ∂∕∂ψ and ∂∕∂𝜃 in Sec. 16.1 and 16.2 are taken in (ψ,𝜃,ϕ) coordinates. Because the quantities involved in Sec. 16.1 and 16.2 are axisymmetric, these partial derivatives are equal to their counterparts in (ψ,𝜃,ζ) coordinates.
In Sec. 13, we have provided the steps to construct the magnetic surface coordinate system (ψ,𝜃,ϕ). Only one additional step is needed to construct the straight-line flux coordinate system (ψ,𝜃,ζ). The additional step is to calculate the generalized toroidal angle ζ according to Eq. (277), where δ is obtained from Eq. (282). Also note that the Jacobian of (ψ,𝜃,ζ) coordinates happens to be equal to that of (ψ,𝜃,ϕ) coordinates.
The usefulness of the contravariant form [Eq. (289] of the magnetic field lies in that it allows a simple form of B ⋅∇ operator in a coordinate system. (The operator B0 ⋅∇ is usually called magnetic differential operator.) In (ψ,𝜃,ζ) coordinate system, by using the contravariant form Eq. (289), the operator is written as
Next, consider the solution of the following magnetic differential equation:
| (298) |
where h = h(ψ,𝜃,ζ) is some known function. Using Eq. (297), the magnetic differential equation is written as
| (299) |
Note that the coefficients before the two partial derivatives of the above equation are all independent of 𝜃 and ζ. This indicates that different Fourier harmonics in 𝜃 and ζ are decoupled. As a result of this fact, if f is Fourier expanded as
| (300) |
(note that, following the convention adopted in tokamak literature[10], the Fourier harmonics are chosen to be ei(m𝜃−nζ), instead of ei(m𝜃+nζ)), and the right-hand side is expanded as
| (301) |
then Eq. (299) can be readily solved to give
| (302) |
The usefulness of the straight line magnetic coordinates (ψ,𝜃,ζ) lies in that, as mentioned previously, it makes the coefficients before the two partial derivatives both independent of 𝜃 and ζ, thus, allowing a simple solution to the magnetic differential equation.
Equation (302) indicates that, for the differential equation (298), there is a resonant response to a perturbation ei(m𝜃−nζ) on a magnetic surface with m − nq = 0. Therefore, the magnetic surface with q = m∕n is called the “resonant surface” for the perturbation ei(m𝜃−nζ).
The phase change of the perturbation ei(m𝜃−nζ) along a magnetic field is given by mΔ𝜃 − nΔζ, which can be written as Δ𝜃(m−nq). Since m−nq = 0 on a resonant surface, this indicates that there is no phase change along a magnetic field line on a resonant surface, i.e., the parallel wavenumber k∥ is zero on a resonant surface.
Next, we discuss a special poloidal angle, which is useful in describling a perturnbation of single harmonic (m,n). This poloidal angle is defined by
| (303) |
where (m,n) are the mode numbers of the perturbation. The poloidal angle χ is often called helical angle and is special in that its definition is associated with a perturbation (the mode numbers of the perturbation appear in the definition) while the definition of the poloidal angles discussed previously only involve the equilibrium quantities.
The poloidal angle χ is designed to make 3D perturbations of the form ∼ f(ψ,m𝜃 −nζ) reduce to 2D perturbations, i.e.,
| (304) |
It is ready to verify that the Jacobian of coordinates (ψ,χ,ζ) is equal to that of coordinates (ψ,𝜃,ζ) [proof: (𝒥′)−1 = ∇ψ ×∇χ ⋅∇ζ = ∇ψ ×∇(𝜃 − nζ∕m) ⋅∇ζ = ∇ψ ×∇𝜃 ⋅∇ζ = 𝒥−1].
The component of B along ∇χ direction (i.e., the covariant component) is written
At the resonant surface q = m∕n, equation (305) implies B(χ) = 0. The direction ∇χ defines the reconnecting component of the magnetic field?On the other hand, the component of B along ∇𝜃 direction is written
Using (306) and (305), the relation between B(𝜃) and B(χ) is written as
| (307) |
In the above, we have obtained the covariant form of the magnetic field in (ψ,𝜃,ϕ) coordinates (i.e., Eq. (181)). Next, we derive the corresponding form in (ψ,𝜃,ζ) coordinate. In order to do this, we need to express the ∇ϕ basis vector in terms of ∇ψ, ∇𝜃, and ∇ζ basis vectors. Using the definition of the generalized toroidal angle, we obtain
Using Eq. (308), the covariant form of the magnetic field, Eq. (181), is written as
| (309) |
This expression can be further simplified by using equation (280) to eliminate ∂δ∕∂𝜃, which gives
| (312) |
with I(ψ) = h(ψ) − gq. The magnetic field expression in Eq. (312) frequently appears in tokamak literature[30]. In this form, the coefficients before both ∇𝜃 and ∇ζ depends on only the radial coordinate. In terms of I(ψ), the Jabobian can also be written as
| (313) |
In solving the MHD eigenmode equations in toroidal geometries, besides the B ⋅∇ operator, we will also encounter another surface operator (B×∇ψ∕B2) ⋅∇. Next, we derive the form of the this operator in (ψ,𝜃,ζ) coordinate system. Using the covariant form of the equilibrium magnetic field [Eq. (311)], we obtain
| (314) |
Using this, the (B ×∇ψ∕B2) ⋅∇ operator is written as
which is the form of the operator in (ψ,𝜃,ζ) coordinate system.Examining Eq. (316), we find that the coefficients before the two partial derivatives will be independent of 𝜃 and ζ if the Jacobian 𝒥 is chosen to be of the form 𝒥 = h(ψ)∕B2, where h is some magnetic surface function. It is obvious that the independence of the coefficients on 𝜃 and ζ will be advantageous to some applications. The coordinate system (ψ,𝜃,ζ) with the particular choice of 𝒥 = h(ψ)∕B2 is called the Boozer coordinates. The usefulness of the new toroidal angle ζ is highlighted in Boozer’s choice of the Jacobian, which makes both B ⋅∇ and (B ×∇ψ∕B2) ⋅∇ be a constant-coefficient differential operator. For other choices of the Jacobian, only the B⋅∇ operator is a constant-coefficient differential operator.
In solving the MHD eigenmode equations in toroidal geometry, we also need the radial differential operator ∇ψ ⋅∇. Next, we derive the form of the operator in (ψ,𝜃,ζ) coordinates. Using
∇f = ∇ψ + ∇𝜃 + ∇ζ, |
the radial differential operator is written as
where ∂(qδ)∕∂ψ and q∂δ∕∂𝜃 are given respectively by Eqs. (286) and (280). Using the above formula, ∇ψ ⋅∇ζ is written as
| (318) |
This formula is used in GTAW code.
In (ψ,𝜃,ζ) coordinates, a magnetic field line is straight in (𝜃,ζ) plane with slope being q. Then the equation for a magnetic field line is written as
| (319) |
where α is a constant in (𝜃,ζ) plane and can be used to label magnetic field lines on a magnetic surface. This motivates us to use α, i.e.,
| (320) |
to replace ζ. Then the magnetic field in Eq. (289) is written as
| (321) |
which is called the Clebsch form. The direction
| (322) |
is parallel (or anti-parallel) to the magnetic field direction. Due to this fact, (ψ,𝜃,α) coordinates are usually called “field-line-following coordinates” or “field-aligned coordinates” [2, 6].
Equation (321) implies that
| (323) |
and
| (324) |
i.e., both α and ψ are constant along a magnetic field line. Taking scalar product of Eq. (321) with ∇𝜃, we obtain
| (325) |
which is nonzero, i.e., only 𝜃 among (ψ,𝜃,α) is changing along a magnetic field line. (Here 𝒥 = (∇ψ ×∇𝜃 ⋅∇α)−1 is the Jacobian of the coordinate system (ψ,𝜃,α), which happens to be equal to the Jacobian of (ψ,𝜃,ζ) coordinates.)
Using Eq. (321), the magnetic differential operator B ⋅∇ in the new coordinate system (ψ,𝜃,α) is written
| (326) |
which is just a partial derivative over 𝜃, as is expected, since only 𝜃 is changing along a magnetic field line.
By the way, note that (B ⋅∇α)∕(B ⋅∇𝜃) = 0, i.e., the magnetic field lines are straight with zero slope on (𝜃,α) plane.
Using Eqs. (320) and (283), α can be written as
where = B ⋅∇ϕ∕B ⋅∇𝜃 is the local safety factor. (If we choose the straight-field-line 𝜃, then α is written as α = ϕ−q𝜃.) Define δ = ∫ 0𝜃 d𝜃, which is called tor_shift in TEK code, then α = ϕ−δ. In TEK, I choose 𝜃 ∈ [−π,π) with 𝜃 = −π corresponding to the high-field-side midplane, and 𝜃 is increasing along the counter-clockwise direction viewed along ∇ϕ. The 𝜃 cut, i.e., 𝜃 = ±π is far away from the low-field-side where ballooning modes often have larger amplitude. The (x,y) grid near the 𝜃 cut is highly twisted in real space and interplation is needed in mapping physical quantity from the grid at 𝜃 = −π plane to that at 𝜃 = +π. Numerical errors more likely appear there. So we prefer that the 𝜃 cut is located in less important area (area where mode amplitude is small).It is widely believed that turbulence responsible for energy transport in tokamak plasmas usually has k∥≪ k⊥, where k∥ and k⊥ are the parallel and perpendicular wavenumbers, respectively. Due to this elongated structure along the parallel direction, less grids can be used in the parallel direction than that in the perpendicular direction in turbulence simulation. In this case, the field-aligned coordinates (ψ,𝜃,α) provide suitable coordinates to be used, where less gridpoints can be used for 𝜃 coordinate in simulations and even some ∂∕∂𝜃 derivatives can be neglected (high-n approximation), which simplifies the equations that need to be solved. There is another reason why almost all gyrokinetic codes use field-aligned coordinates: the stability of numerical algorthims is improved when we use coarse grids in the parallel direction because the parallel Courant condition (for explicit schemes) Δt ≤ ΔL∥∕v∥ can be more easily satisfied (especially for the cases with kinetic electrons), where ΔL∥ is the parallel grid spacing, which is larger when coarse grids are used in the parallel direction. This is also mentioned in Ref. [23] and it seems to be right from my experiences of testing several algorithm but a strict test is needed to verify this. This can also be understood in the following way: the coarse parallel grid automatically filters out physically irrelevant but numerically problematic high-k∥ modes, permitting much longer time steps for explicit time stepping, in both particle and fluid codes[12].
The fact B ⋅∇α = 0 implies that α is constant along a magnetic field line. At first glance, a magnetic line on an irrational surface seems to sample all the points on the surface. This seems to indicate that α is a flux surface label for irrational surface. However, α must be a non-flux-surface-function so that it can provide a suitable toroidal coordinate. I had once been confused by this conflict for a long time. The key point to resolve this confusion is to realize that it is wrong to say there is only one magnetic line on an irrational surface, i.e. it is wrong to say a magnetic line on an irrational surface samples all the points on the surface. There are still infinite number of magnetic field lines that can not be connected with each other on an irrational surface. Then the fact B ⋅∇α = 0 does not imply that α must be the same on these different magnetic field lines. In fact, although B ⋅∇α = 0, the gradient of α on a flux-surface along the perpendicular (to B) direction is nonzero, i.e., B ×∇Ψ ⋅∇α≠0. [Proof:
In (ψ,𝜃,ϕ) coordinates, ∇ϕ is perpendicular to ∇ψ. However, in field-line-following coordinates (ψ,𝜃,α), ∇α is not perpendicular to ∇ψ. Therefore ∇α is not along the binormal direction B ×∇ψ.
The generalized toroidal angle α is defined by Eq. (327), i.e., α = ϕ −δ, where δ = ∫ 0𝜃 d𝜃. The gradient of α is then written as
Then
| (330) |
| (331) |
Another method of computing the above quantities: Using Eqs. (236) and (237), expression (329) is written as
In GEM[7] and GENE[13] codes, the field-aligned coordinates (x,y,z) are defined by
| (335) |
| (336) |
| (337) |
where r is an arbitrary flux surface label with length dimension, which is often chosen in GEM to be the minor radius of a magnetic surface in the midplane. Here r0 and R0 are constant quantities of length dimension, r0 is the minor radius of a reference magnetic surface (usually corresponding to the center of the radial simulation box), R0 is the major radius of the magnetic axis, q0 is the safety factor value on the r = r0 surface. The constant length q0R0 introduced in the definition of z is to make z approximately correspond to the length along the field line in the large-aspect ratio limit. The constant length r0∕q0 introduced in the definition of y is to make y corresponds to the arc-length in the poloidal plane traced by a field line when its usual toroidal angle increment Δϕ is α. This explanation makes y look like a poloidal coordinate whereas y is actually a toroidal coordinate.
Next, let us calculate the wave number along the y direction, ky, for a mode with toroidal wave number n. The wavelength along the y direction, λy, is given by
| (338) |
Then the wavenumber ky is written as
| (339) |
On the other hand, the poloidal wavenumber k𝜃 is given by
| (340) |
where m is the poloidal mode number of the mode in (ψ,𝜃,ϕ) coordinates. If the mode has the property k∥≈ 0, i.e., m ≈ nq0, then k𝜃 is equal to the ky. The motivation of introducing the constant length r0∕q0 in the definition of y is to make ky ≈ k𝜃 for a mode with k∥≈ 0.
Some authors call ky or k𝜃 by the name “binormal wavenumber”, which is not an appropriate name in my opinion. Some authors call y the binormal direction, which is also an inappropriate name since neither ∇y nor ∂r∕∂y is along the binormal direction B0 ×∇ψ.
In this section, I try to visualize gridpoints in the field aligned coordinates. The directions of the covariant basis vectors of (ψ,𝜃,α) coordinates are as follows:
| (341) |
| (342) |
| (343) |
Here ∂r∕∂ψ|𝜃,α is a combination of the usual radial and toroidal direction, which needs some clarification. Note that, ϕ is related to α by Eq. (327), i.e.,
| (344) |
(where the second equality becomes exact if 𝜃 is the straight-field-line poloidal angle defined in Sec. 12.4.), which indicates that, for q′(ψ)≠0 and 𝜃≠0, the usual toroidal angle ϕ is changing when changing ψ and holding 𝜃 and α fixed. Figure 16b shows how the usual toroidal angle ϕ changes when we change ψ and hold 𝜃 and α fixed.
The relation ϕ ≈ α + q(ψ)𝜃 given by Eq. (344) indicates that the toroidal shift along ∂r∕∂ψ|α,𝜃 for a radial change form ψ1 to ψ2 is given by (q(ψ2) − q(ψ2))𝜃, which is larger on 𝜃 isosurface with larger value of 𝜃. An example for this is shown in Fig. 17 for 𝜃 = 19 × 2π∕63, where ∂r∕∂ψ|α,𝜃 has larger toroidal shift than that in Fig. 16 for 𝜃 = 9 × 2π∕63.
The ∂r∕∂ψ|𝜃,α curves can be understood from another perspective. Examine a family of magnetic field lines that start from 𝜃 = 0 and ϕ = ϕ1 but different radial coordinates. These starting points all have the same value of α, which is equal to ϕ1. When following these field lines to another isosurfce of 𝜃, the intersecting points of these field lines with the 𝜃 isosurface will trace out a ∂r∕∂ψ|𝜃,α line with α = ϕ1. Examine another family of magnetic field lines similar to the above but with the starting toroidal angle ϕ = ϕ2. They will trace out another ∂r∕∂ψ|𝜃,α line (with α = ϕ2) on the 𝜃 isosurface. Continue the process, we finally get those curves in Fig. 16b and Fig. 17b.
For a harmonic in (ψ,𝜃,ϕ) coordinates given by A(ψ,𝜃,ϕ) = exp(ikψψ + im𝜃 + inϕ), the radial wave number is kψ. Let us calculate the corresponding radial wavenumber kψ⋆ in the new coordinates (ψ,𝜃,α), which is defined by
| (345) |
where the phase is given by phase = kψψ + m𝜃 + nϕ. Then the above expression is written as
Let us examine how many ψ grid points are needed to resolve the ψ dependence in (ψ,𝜃,α) coordinates on the high-field side (𝜃 = π). Assume kψ ≈ 0, then kψ⋆ at 𝜃 = π is given by kψ⋆ = nπq′. The corresponding wave-length is given by λψ⋆ = 2π∕kψ⋆. The grid spacing Δψ should be less than half of this wave-length (sampling theorem). Then the grid number should satisfy that
| (348) |
where Lψ is the radial width of the computational domain.
The number of Fourier harmonics that need to be included is given by
| (349) |
For DIII-D cyclone base case, choose the radial coordinate ψ as r. At the radial location ψ = r0 = 0.24m, q0 = 1.4, ŝ0 = 0.78, then q′0 = s0q0∕r0 = 4.5m−1. Then Nr⋆ = n× 0.45 for the radial width Lr = 0.10m.
Figure 18 plots ∂r∕∂ψ|𝜃,α lines on the 𝜃 = 0,2π isosurfaces, which are chosen to be on the low-field-side midplane. On 𝜃 = 0 surface, ∂r∕∂ψ|𝜃,α lines are identical to ∂r∕∂ψ|𝜃,ϕ lines. On 𝜃 = 2π surface, each ∂r∕∂ψ|𝜃,α line has large ϕ shift. In old version of my code, 𝜃 = 0,2π surfaces are chosen as the 𝜃 cuts (in the new version 𝜃 = [−π,π]). A connection condition for the perturbations is needed between these two surfaces. This connection condition is discussed in Sec. 17.5.
Since (ψ,𝜃,ϕ) and (ψ,𝜃 + 2π,ϕ) correspond to the same spatial point, a real space continuous quantity f expressed in terms of coordinates (ψ,𝜃,ϕ), i.e., f = f(ψ,𝜃,ϕ), must satisfy the following periodic conditions along 𝜃:
| (350) |
Since (ψ,𝜃,ϕ) and (ψ,𝜃,ϕ + 2π) correspond to the same spatial point, f must satisfy the following periodic conditions along ϕ:
| (351) |
Since (ψ,𝜃,α) and (ψ,𝜃,α + 2π) correspond to the same spatial point, a real space continuous quantity g expressed in terms of field-line-following coordinates (ψ,𝜃,α), i.e., g = g(ψ,𝜃,α), must satisfy the following periodic condition along α:
| (352) |
However, generally there is no periodic condition along 𝜃,
| (353) |
because P1 = (ψ,𝜃,α) and P2 = (ψ,𝜃 + 2π,α) are generally not the same spatial point. In fact, equation (327) implies, for point P1, its toroidal angle ϕ1 is given by
| (354) |
while for point P2, its toroidal angle ϕ2 is given by
| (355) |
i.e., ϕ1 and ϕ2 are different by 2πq. From this, we know that (ψ,𝜃,α) and (ψ,𝜃 + 2π,α − 2πq) correspond to the same spatial point. Therefore we have the following periodic condition:
| (356) |
or equivalently
| (357) |
For the fully kinetic ion module of GEM code that I am developing, 𝜃 is chosen in the range [0 : 2π]. The condition (357) imposes the following boundary condition:
| (358) |
If α is on a grid, α + 2πq is usually not on a grid. Therefore, to get the value of g(ψ,0,α + 2πq), an interpolation of the discrete date over the generalized toroidal angle α (or equivalently ϕ) is needed, as is shown in Fig. 19.
Figure 20 compares a small number of ϕ contours and α contours on a magnetic surface.
As is shown in the left panel of Fig. 20, with ϕ fixed, an 𝜃 curve reaches its starting point when 𝜃 changes from zero to 2π. However, as shown in the right panel of Fig. 20, with α fixed, an 𝜃 curve (i.e. a magnetic field line) does not necessarily reach its starting point when 𝜃 changes from zero to 2π. There is a toroidal shift, 2πq, between the starting point and ending point. Therefore there is generally no periodic condition along 𝜃 since q is not always an integer. A mixed periodic condition involves both 𝜃 and α is given in (356).
In field-line-following coordinates (ψ,𝜃,α), a toroidal harmonic of a physical perturbation can be written as
| (359) |
where n is the toroidal mode number, m′, which is not necessary an integer, is introduced to describe the variation along a field line. The periodic condition given by Eq. (356) requires that
| (360) |
To satisfy the above condition, we can choose
| (361) |
where N is an arbitrary integer, i.e.,
| (362) |
We are interested in perturbation with a slow variation along the field line direction (i.e., along ∂r∕∂𝜃|ψ,α) and thus we want the value of m′ to be small. One of the possible small values given by expression (362) is to choose N = −n × NINT((qmax + qmin)∕2), so that m′ is given by
| (363) |
where NINT is a function that return the nearest integer of its argument, qmax and qmin is the maximal and minimal value of the safety factor in the radial region in which we are interested. [In the past, I choose m′(ψ) = nq − NINT(nq). However, m′(ψ) in this case is not a continuous function of ψ and thus is not physical.] This form is used to set the initial density perturbation in the fully kinetic code I am developing. Note that m′ in Eq. (363) depends on the radial coordinate ψ through q(ψ). Also note that m′ here is different from the poloidal mode number m in (ψ,𝜃,ϕ) coordinate system. It is ready to show that the perturbation given by Eq. (359) with m′∼ 1 and n ≫ 1 has large poloidal mode number m when expressed in (ψ,𝜃,ϕ) coordinates. [Proof: Expression (359) can be written as
| (364) |
Assume that 𝜃 is the straight-field-line poloidal angle in (ψ,𝜃,ϕ) coordinate system, then δ(ψ,𝜃) = q𝜃 and the above equation is written as
| (365) |
which indicates the poloidal mode number m in (ψ,𝜃,ϕ) coordinates is given by m = m′−nq. For the case with m′∼ 1 and n ≫ 1, m is much larger than one.]
Since α contours on a magnetic surface are magnetic field lines, they span out the 3D shape of magnetic surface when there are many α contours on a magnetic surface, as is shown by the right-panel of Fig. 21.
Figure 22 compares the ϕ coordinate surface of (ψ,𝜃,ϕ) coordinates with the α coordinate surface of (ψ,𝜃,α) coordinates.
The above grid is often called “flux-tube”, since it is created by following field lines, and it looks like a tube if the field lines are very near to each other (e.g., when we choose a very narrow radial and toroidal region to start from). Since no magnetic field line passes through the sides of the tube, the flux through any cross section of the tube is equal. The term “flux tube” is often used in astrophysics.
Most gyrokinetic simulation codes use field-line-following coordinates in constructing spatial mesh. The mesh is conceptually generated by the following three steps: (1) selecting some initial points; (2) tracing out magnetic-field-lines passing through these points; (3) choose the intersecting points of these field-lines with a series of chosen surfaces as the final grid-points. The initial points and the chosen surfaces differ among various codes and thus the resulting grid differs. Next, let us discuss some examples.
Given the definition of (ψ,𝜃) coordinates, choose toroidally symmetrical points (can be a toroidal wedge) in 𝜃 = 0 plane (𝜃 = 0 plane is usually chosen to be the low-field-side midplane). Then trace out the magnetic-field-lines passing through these points for one poloidal circuit (usually chosen in the range 𝜃 ∈ [−π,π]) and record the intersection points of these field-lines with various 𝜃 = const planes. Note that the gridpoints in 𝜃 = −π plane usually do not coincide those in 𝜃 = +π plane due to the toroidal shift arising when the safety factor is irrational. Interpolation can be used to map physical variables defined on gridpoints in 𝜃 = −π plane to those in 𝜃 = +π plane.
Given the definition of (ψ,𝜃) coordinates, 2D grid-points can be chosen on ϕ = 0 plane based on (ψ,𝜃) coordinates. Then trace out the magnetic-field-lines starting from these points for one toroidal circuit and record the intersection points of these field-lines with ϕj = jΔϕ planes, where j = 1,2,…,Nt − 1, Δϕ = 2π∕(Nt − 1). It is obvious that the resulting mesh are not toroidally symmetrical. And also the grids on ϕ = 0 plane differ from those on ϕ = 2π plane. Interpolation can be used to mapping physical variables defined on grid-points of ϕ = 0 to those of ϕ = 2π plane. In this case, the number of “toroidal grid-points” Nt (i.e., the number of poloidal planes) is actually the number of grid-points in the parallel direction within one toroidal circuit.
XGC1 can handle the region outside of the LCFS. Here we only discuss the region inside the LCFS. At each radial gridpoint on ϕ = 0 plane, follow the magnetic field line starting form this point for one poloidal loop and record the intersection points of this field-line with ϕj = jΔϕ planes, where j = 1,2,…,Nt, Δϕ = 2π∕Nt. For the case q > 1, one magnetic-field-line will have more than one intersection points on some poloidal planes. Repeat tracing the field line for each radial location. Then project (toroidally) all the intersection points on different poloidal planes to a single poloidal plane and rotate (toroidally) these 2D grids to define a 3D grid that are toroidally symmetrical.
The generalized toroidal angle α is numerically calculated in my code. To verify B ⋅∇α = 0 along a magnetic field-line, figure 26 plots the values of α along a magnetic field line, which indicates that α is constant. This indicates the numerical implementation of the field-aligned coordinates is correct.
Let us introduce the binormal wavenumber, which is frequently used in presenting turbulence simulation results. Define the binormal direction s by
s = , |
which is a unit vector lying on a magnetic surface and perpendicular to B. The binormal wavenumber of a mode is defined by
| (366) |
where p is the phase of the mode. Consider a mode given by exp(ikψψ + im𝜃 − inζ), then the phase p = kψψ + m𝜃 − nζ. Then kbn is written as
| (369) |
Using Eq. (289), i.e., B = −(∇ζ ×∇Ψ + q∇Ψ ×∇𝜃), the above expression is written as
| (370) |
which indicates the binormal wavenumber generally depends on the poloidal angle. For large aspect-ratio tokamak, we have Bϕ ≈ B, q ≈ Bϕr∕(BpR). Then Eq. (370) is written
| (371) |
which indicates the binormal wavenumber are approximately independent of the poloidal angle. Since m = nq on a resonant surface, the above equation is written |kbn|≈ m∕r, which is the usual poloidal wave number. Due to this relation, the binormal wavenumber kbn is often called the poloidal wavenumber and denoted by k𝜃 in papers on tokamak turbulence. In the GENE code, y coordinate is defined by y = αr0∕q0. Then the ky of a mode of toroidal mode number n is given by ky = 2π∕λy where λy = λαr0∕q0 and λα = 2π∕n. Then ky is written as ky = nq0∕r0, which is similar to the binormal defined above. For this reason, ky of GENE code is also called binormal wave-vector, which is in fact not reasonable because neither ∂r∕∂y or ∇y is along the binormal direction.
Assume magnetic surfaces of a magnetic configuration are known and given by
| (372) |
| (373) |
where (r,𝜃) are two parameters and r is magnetic surface label (i.e., ∂Ψ∕∂𝜃|r = 0). The above parametric equations specify a series of concentric-circular magnetic surfaces.
Assume the toroidal field function g(r) = RBϕ is given. Then the toroidal magnetic field is determined by Bϕ = g∕R. Further assume the safety factor profile q(r) is given, then the magnetic field is fully determined. Next, let us derive the explicit form of the poloidal magnetic field Bp, which is given by
| (374) |
which involves the poloidal magnetic flux Ψp. Therefore our task is to express Ψp in terms of q and g. Using q(r) = dΨt∕dΨp, we obtain
dΨp = dΨt, |
Integrate the above equation over r, we obtain
| (375) |
which an be written as
| (376) |
where use has been made of Ψt = ∫ 0r ∫ −ππBϕrdrd𝜃. Using Bϕ = g∕R and R = R0 + r cos𝜃, the above equation is written
| (377) |
Using maxima (an open-source computer algebra system), the above integration over 𝜃 can be performed analytically, giving
| (378) |
Using this, equation (377) is written as
| (379) |
which can be simplified as
| (380) |
This is what we want—the expression of the poloidal magnetic flux in terms of q and g. [Another way of obtaining Eq. (380) is to use Eq. (187), i.e.,
| (381) |
where 𝒥 is the Jacobian of the (r,𝜃,ϕ) coordinates and is given by 𝒥 = R(R𝜃Zr −RrZ𝜃) = −Rr. Then Eq. (381) is simplified as
| (382) |
which, after being integrated over r, gives Eq. (380).]
Using Eq. (380), the poloidal magnetic field in Eq. (374) is written as
[Using the formulas ∇r = −(Z𝜃−R𝜃) and 𝒥 = R(R𝜃Zr −RrZ𝜃), where 𝒥 is the Jacobian of the (r,𝜃,ϕ) coordinates, we obtain 𝒥 = −Rr and ∇r = cos𝜃 + sin𝜃, ∇ϕ = ∕R. Then Eq. (383) is written as
| (384) |
This is the explicit form of the poloidal magnetic field in terms of g and q. The magnitude of Bp is written as
| (385) |
Note that both Bp and Bϕ depend on the poloidal angle 𝜃.]
I use Eq. (380) to compute the 2D data of Ψ (Ψ = Ψp∕2π) on the poloidal plane when creating a numerical G-eqdsk file for the above magnetic configuration (Fortran code is at /home/yj/project_new/circular_configuration_with_q_given).
Assume that the poloidal plasma current is zero, then g(r) = RBϕ is a constant independent of r. This is always assumed by the authors who use concentric-circular configuration but is seldom explicitly mentioned.
In analytical work, 1∕R dependence on (r,𝜃) is often approximated as
= = ≈(1 − 𝜀cos𝜃), |
where 𝜀 = r∕R0 is the local inverse aspect ratio.
Since the above field is derived from the general form given by Eq. (10), it is guaranteed that the field is divergence-free. In case of any doubt, let us directly verify this. Write B as
| (386) |
where 𝒥 is the Jacobian of (r,𝜃,ϕ) coordinates; B(1), B(2), and B(3) are given by
| (387) |
| (388) |
| (389) |
Use Bp given by (383), then B(1), B(2), and B(3) are written as
| (390) |
| (391) |
and
| (392) |
respectively. Then, by using the divergence formula in (r,𝜃,ϕ) coordinates, ∇⋅ B is written as
The answer is no. It is ready to verify that the poloidal magnetic flux function Ψ = Ψp∕2π given by Eq. (380) is not a solution to the GS equation (621) even if the plasma pressure in the GS equation is set to zero. The above expression is a solution to the GS equation in the limit of infinite aspect ratio and zero plasma pressure. The finite aspect ratio and plasma pressure requires the magnetic surfaces to have the Shafranov shift in order to satisfy the GS equation (see Sec. A.17).
For the above magnetic field, the toroidal shift involved in the definition of the generalized toroidal angle can be expressed in simple analytical form. The toroidal shift is given by
| (394) |
where the local safety factor can be written as
| (395) |
Using 𝒥 = −Rr and
| (396) |
The local safety factor in Eq. (395) is written as
| (397) |
Using this, expression (394) is written
| (398) |
Assume 𝜃 ∈ (−π,π), then the integration ∫ 0𝜃1∕Rd𝜃 can be analytically performed (using maxima), yielding
| (399) |
Then expression (398) is written
| (400) |
where use has been made of sin𝜃∕(cos𝜃 + 1) = tan(𝜃∕2). Using this, the generalized toroidal angle can be written as
The results given by the formula (400) are compared with the results from my code that assumes a general numerical configuration. The results from the two methods agree with each other, as is shown in Fig. 27, which provides confidence in both the analytical formula and the numerical code.In passing, we note that the straight-field-line poloidal angle 𝜃f can also be considered to be defined by
| (402) |
i.,e,
| (403) |
Then using Eq. (401), 𝜃f is written as
| (404) |
which agrees with Eq. (A2) in Gorler’s paper[13].
Let ψ = r and define hψR = ∇ψ ⋅, hαR = ∇α⋅, etc. Explicit expressions for these elements can be written as
| (406) |
Using expression (400), dδ∕dr can be evaluated analytically, yielding
arctan(x) = |
(I did not remember this formula and I use SymPy to obtain this.) These expressions are used to benchmark the numerical code that assume general flux surface shapes. The results show that the code gives correct result when concentric circular flux surfaces are used.
Taking the 𝜃 derivative of δ, equation (400) is written as (using Sympy)
| (407) |
where
| (408) |
Equation (397) should be equal to given by Eq. (397). This was verified numerically.
Taking the r derivative of Eq. (380), we obtain
| (409) |
i.e.,
| (410) |
| (411) |
The magnetic shear for a concentric-circular configuration is defined by
| (412) |
where r is the minor radius of a magnetic surface. The above expression can be re-arranged as
| (413) |
Integrating the above equation over r and assuming ŝ is a constant, we obtain
| (414) |
Performing the integration, the above equation is written as
| (415) |
where q0 = q(r0). Equation (415) can be finally written as
| (416) |
This is a profile with a constant magnetic shear s. In Ben’s toroidal ITG simulation, the following q profile is used:
| (417) |
with q′(r0) = ŝq0∕r0. This is a linear profile over r, with the values of q and the shear at r = r0 being q0 and ŝ, respectively.
The fixed boundary equilibrium problem (also called the “inverse equilibrium problem” by some authors) refers to the case where the shape of a boundary magnetic surface is given and one is asked to solve the equilibrium within this magnetic surface. To make it convenient to deal with the shape of the boundary, one usually uses a general coordinates system which has one coordinate surface coinciding with the given magnetic surface. This makes it trivial to deal with the irregular boundary. To obtain the equilibrium, one needs to solve the GS equation in the general coordinate system.
Next we derive the form of the GS equation in a general coordinate system. The main task is to derive the form of the toroidal elliptic operator in the general coordinate system. The toroidal elliptic operator takes the form
| (418) |
For an arbitrary general coordinate system (ψ,𝜃,ϕ) (the (ψ,𝜃,ϕ) coordinate system here is an arbitrary general coordinate system except that ∇ϕ is perpendicular to both ∇ψ and ∇𝜃), the toroidal elliptic operator is written
| (419) |
where the subscripts denotes partial derivatives, 𝒥 is the Jacobian of the coordinate system (ψ,𝜃,ϕ). [Next, we provide the proof of Eq. (419). The gradient of Ψ is written as (note that Ψ is independent of ϕ)
| (420) |
Using this expression and the divergence formula (137), the elliptic operator in Eq. (418) is written
Using Eq. (419), the GS equation (53) is written
| (422) |
which is the form of the GS equation in (ψ,𝜃,ϕ) coordinate system.
The toroidal elliptic operator in Eq. (419) can be written
| (423) |
where haβ is defined by Eq. (178), i.e.,
| (424) |
Next, we derive the finite difference form of the toroidal elliptic operator. The finite difference form of the term (hψψΨψ)ψ is written
| (426) |
The finite difference form of (h𝜃𝜃Ψ𝜃)𝜃 is written
| (428) |
The finite difference form of (hψ𝜃Ψ𝜃)ψ is written as
| (429) |
Approximating the value of Ψ at the grid centers by the average of the value of Ψ at the neighbor grid points, Eq. (429) is written as
| (430) |
where
| (431) |
Similarly, the finite difference form of (hψ𝜃Ψψ)𝜃 is written as
| (433) |
| (434) |
and
| (435) |
where the Jacobian
| (436) |
The partial derivatives, R𝜃, Rψ, Z𝜃, and Zψ, appearing in Eqs. (433)-(436) are calculated by using the central difference scheme. The values of hψψ, h𝜃𝜃, hψ𝜃 and 𝒥 at the middle points are approximated by the linear average of their values at the neighbor grid points.
| (437) |
| (438) |
| (439) |
Ψ = d0 + d1cos𝜃 + d2sin𝜃 |
| (440) |
| (441) |
The function p(Ψ) and g(Ψ) in the GS equation are free functions which must be specified by users before solving the GS equation. Next, we discuss one way to specify the free functions. Following Ref. [16], we take P(Ψ) and g(Ψ) to be of the forms
| (442) |
| (443) |
with and ĝ chosen to be of polynomial form:
| (444) |
| (445) |
where
| (446) |
with Ψb the value of Ψ on the boundary, Ψa the value of Ψ on the magnetic axis, α, β, γ, P0, Pb, and g0 are free parameters. Using the profiles of P and g given by Eqs. (442) and (443), we obtain
| (447) |
where Δ = Ψb − Ψa, and
| (448) |
Then the term on the r.h.s (nonlinear source term) of the GS equation is written
| (449) |
The value of parameters P0, Pb, and g0 in Eqs. (442) and (443), and the value of α and β in Eqs. (444) and (445) can be chosen arbitrarily. The parameter γ is used to set the value of the total toroidal current. The toroidal current density is given by Eq. (579), i.e.,
| (450) |
which can be integrated over the poloidal cross section within the boundary magnetic surface to give the total toroidal current,
Using
| (452) |
Eq. (451) is written as
| (453) |
from which we solve for γ, giving
| (454) |
If the total toroidal current Iϕ is given, Eq. (454) can be used to determine the value of γ.
In the fixed boundary equilibrium problem, the shape of the boundary magnetic surface (it is also the boundary of the computational region) is given while the shape of the inner flux surface is to be solved. A simple analytical expression for a D-shaped magnetic surface takes the form
| (455) |
| (456) |
with 𝜃 changing from 0 to 2π. According to the definition in Eqs. (521), (522), and (524) we can readily verify that the parameters a, R0, κ appearing in Eqs. (455) and (456) are indeed the minor radius, major radius, and ellipticity, respectively. According to the definition of triangularity Eq. (523), the triangularity δ for the magnetic surface defined by Eqs. (455) and (456) is written as
| (457) |
Another common expression for the shape of a magnetic surface was given by Miller[8, 22], which is written as
| (458) |
| (459) |
Note that Miller’s formula is only slightly different from the formula (455). For Miller’s formula, it is easy to prove that the triangularity δ is equal to Δ (instead of δ = sinΔ as given in Eq. (457)).
In the iterative metric method[11] for solving the fixed boundary equilibrium problem, we need to provide an initial guess of the shape of the inner flux surface (this initial guess is used to construct a initial generalized coordinates system). A common guess of the inner flux surfaces is given by
| (460) |
| (461) |
where α is a parameter, ψ is a label parameter of flux surface. If the shape of the LCFS is given by Eqs. (455) and (456), then Eqs. (460) and (461) are written as
| (462) |
| (463) |
Fig. 29 plots the shape given by Eqs. (462) and (463) for a =0.4, R0 = 1.7, κ = 1.7, Δ = arcsin(0.6), and α = 1 with ψ varying from zero to one.
The tokamak equilibrium problem where the shape of the LCFS is given is called fixed boundary equilibrium problem. I wrote a numerical code that uses the iterative metric method[11] to solve this kind of equilibrium problem. Figure 30 describes the steps involved in the iterative metric method.
To benchmark the numerical code, I set the profile of P and g according to Eqs. (531) and (532) with the parameters c2 = 0, c1 = B0(κ02 + 1)∕(R02κ0q0), κ0 = 1.5, and q0 = 1.5. The comparison of the analytic and numerical results are shown in Fig. 31.
Note that the parameter c0 in the Solovev equilibrium seems to be not needed in the numerical calculation. In fact this impression is wrong: the c0 parameter is actually needed in determining the boundary magnetic surface of the numerical equilibrium (in the case considered here c0 is chosen as c0 = B0∕(R02κ0q0)).
With the pressure increasing, the magnetic axis usually shifts to the low-field-side of the device, as is shown in Fig. 32.
Consider the Jacobian of the form
| (464) |
where m and n are arbitrary integers which can be appropriately chosen by users, μ0 and R0 are constants included for normalization. In the iterative metric method of solving fixed boundary equilibrium problem, we first construct a coordinates transformation (𝜃,ψ) → (R(𝜃,ψ),Z(𝜃,ψ)) (this transformation is arbitrary except for that surface ψ = 1 coincides with the last closed flux surface), then solve the GS equation in (𝜃,ψ) coordinate system to get the value of Ψ at grid points, and finally adjust the value of (R(𝜃,ψ),Z(𝜃,ψ)) to make surface ψ = const lies on a magnetic surface. It is obvious the Jacobian of the final transformation we obtained usually does not satisfy the constraint given by Eq. (464) since we do not use any information of Eq. (464) in the above steps. Now comes the question: how to make the transformation obtained above satisfy the constraint Eq. (464) through adjusting the values of 𝜃? To make the constraint Eq. (464) satisfied, 𝜃 and ψ should satisfy the relation
| (465) |
which
Using Eq. (), we obtain
∫ 0𝜃d𝜃 = ∫ 0𝜃d𝜃m |
| (466) |
normalized to 2π, the normalized 𝜃 is written as
| (467) |
In the GS equation, g(Ψ) is one of the two free functions which can be prescribed by users. In some cases, we want to specify the safety factor profile q(Ψ), instead of g(Ψ), in solving the GS equation. Next, we derive the form of the GS equation that contains q(Ψ), rather than g(Ψ), as a free function. The safety factor defined in Eq. (187) can be written
Equation (470) gives the relation between the safety factor q and the toroidal field function g. This relation can be used in the GS equation to eliminate g in favor of q, which gives
| (471) |
| (472) |
Note that this expression involves the flux surface average, which depends on the flux surface shape and the shape is unknown before Ψ is determined.
Multiplying Eq. (604) by R−2 gives
| (473) |
Surface-averaging the above equation, we obtain
| (474) |
| (475) |
| (476) |
| (477) |
| (478) |
Substitute Eq. (472) into the above equation to eliminate gdg∕dΨ, we obtain
| (479) |
Eq. (479) agrees with Eq. (5.55) in Ref. [16].
| (480) |
| (481) |
where
| (482) |
The GS equation is
| (483) |
| (484) |
| (485) |
Using Eq. (481) to eliminate Ψ′′ in the above equation, the coefficients before (−μ0dp∕dΨ) is written as
A = − |
Define
α = , |
β = . |
A = −(2π)4β |
| (488) |
| (489) |
Using
| (490) |
Eq. () is written as
| (491) |
| (492) |
| (493) |
| (494) |
| (495) |
| (496) |
| (497) |
| (498) |
| (499) |
| (500) |
But the expression of A is slightly different from that given in Ref. [16] [Eq. (5.57)]. Using the above coefficients, the GS equation with the q-profile held fixed is written as
| (501) |
Let us derive the contravariant expression for the current density. Using
μ0J = ∇× B, |
along with magnetic field expression (181) and the curl formula (143), we obtain
which is the contravariant form of the current density vector. Next, for later use, calculate the parallel current. By using Eqs. (181) and (502), the parallel current density is written as
For a large aspect-ratio, circular cross section tokamak, the R on a magnetic surface is nearly constant, R ≈ R0. The poloidal angle dependence of the magnetic field can be neglected, i.e., Bϕ(r,𝜃) ≈ Bϕ(r), and Bp(r,𝜃) ≈ Bp(r), where r is the minor radius of the relavent magnetic surface. Using these, the safety factor in Eq. (95) is approximated to
| (504) |
EAST has 14 superconducting poloidal field (PF) coils (only 12 of them are independently powered). The layout is shown in Fig. 33.
All the PF coils can be considered as shaping coils since they all have effects in shaping the plasmas. In practice, they are further classified according to their main roles. PF1 to PF6 form a solenoid in the center of the torus and thus called Central Solenoide (CS) coils. Their main role is to induce electric field to drive current in the plasma and heat the plasma. As a result, they are often called “Ohm heating coils”. PF13 and PF14 are mainly used to control (slow) vertical plasma displacement and thus are often called “vertical field coils” or “position control coils”. PF11 and PF12 are used to triangularize the plasma and thus is called “shaping coils”. In order to squeeze the plasma to form desied triangularity, their currents need to be in the opposite direction of plamsa current (since two opposite currents repel each other). PF7+PF9 and PF8+PF10 are often called (by EAST operators) as “big coils” or “divertor coils” since they have the largest number of turns and current and are used to elongate the plasma to diverter configurations.
Besides the 16 superconducting PF coils outside vaccum vessel, EAST has two small copper coils within the vaccum vessel (2turn/coil), which are connected in anti-series and thus have opposite currents. They are closer to the plasma (than other PF coils) and are used to control fast plasma displacements, specifically VDEs (vertical displacement events). They are often called “fast control coils”.
Using Ampere’s circuital law
| (505) |
along the toroidal direction and assuming perfect toroidal symmetry, we obtain
| (506) |
i.e.,
| (507) |
Neglecting the poloidal current contributed by the plasma, the poloidal current is determined solely by the current in the TF coils. The EAST tokamak has 16 groups of TF coils with 132turns/coil (I got to know the number of turns from ZhaoLiang Wang: φ × R = 12 × 11 = 132). Denote the current in a single turn by Is, then Eq. (507) is written
| (508) |
Using this formula, the strength of the toroidal magnetic field at R = 1.8m for Is = 104A is calculated to be Bϕ = 2.34T. This was one of the two scenarios often used in EAST experiments (another scenario is Is = 8 × 103A). (The limit of the current in a single turn of the TF coils is 14.5kA (from B. J. Xiao’s paper [31]).
Note that the exact equilibrium toroidal magnetic field Bϕ is given by Bϕ = g(Ψ)∕R. Compare this with Eq. (507), we know that the approximation made to obtain Eq. (508) is equivalent to g(Ψ) ≈ μ0ITF∕2π, i.e. assuming g is a constant. The poloidal plasma current density jpol is related to g by jpol = g′(Ψ)Bp∕μ0. The constant g corresponds to zero plasma poloidal current, which is consistent to the assumption used to obtain Eq. (508).
Let us estimate the safety factor value near the plasma edge using the total plasma current and the current in a single turn of TF coils Is. For divertor magnetic configuration, the plasma edge is at the saperatrix, where q →∞. To get a characteristic safety factor value that is finite, one often chooses the edge to be the magnetic surface that encloses 95% of the poloidal magnetic flux. Denote this surface by S95 and the value of q at this surface by q95, which is given by
| (509) |
where a is the minor radius of the surface S95, and Raxis the major radius of the magnetic axis, Bϕ,axis is the the magnitude of toroidal magnetic field at the magnetic axis, and Bp is the average poloidal magnetic field on the surface, Bp ≈ μ0Ip∕(2πa). Using Eq. (508), Eq. (509) is written as
| (510) |
For EAST, tipically Raxis = 1.85m and a = 0.45m. Using this, we obtain
| (511) |
The so-called resonant magnetic perturbation (RMP) coils are 3D coils that are used to suppress or mitigate edge localized modes. The shape and location of RMP coils of EAST tokamak are plotted in Fig. 34.
The size of EAST is similar to that of DIII-D tokamak. The main parameters are summarized in Table. 1. A significant difference between EAST and DIII-D is that DIII-D has a larger minor radius, which makes DIII-D able to operate with a larger toroidal current than that EAST can do for the same current density. Another significant difference between EAST and DIII-D is that the coils of EAST are supper-conducting while the coils of DIII-D are not. The supper-conducting coils enable EAST to operate at longer pulse.
EAST | DIII-D[21] | KSTAR[19] | SPARC | WEST | JET | |
Major radius R0 | 1.85m | 1.67m | 1.8m | 1.85m | 2.5m | 2.96m |
minor radius a | 0.45m | 0.67m | 0.5m | 0.57m | 0.5m | 0.9m |
elongation | ||||||
Plasma volume | 20m3 | |||||
No. of TF coils, turns, current | 16, 130, 14.5kA | 24, 6, 126kA | 16, 56, 35.2kA | |||
Bt at R0 | 3.26T | 2.17T | 3.5T | 12.2T | 3.7T | 3.45T |
CS coil module×turn×current | 6×120×14.5kA | |||||
No. of independent PF coils | 6+6 | ?+18 | ||||
Available solenoid magnetic flux | 12Vs | 10.5Vs | 17Vs | |||
Maximum plasma current | 1.0MA | 3.0MA | 2MA | 8.7MA | 1MA | 5MA |
Pulse length | 400s | 10s | 300s | |||
superconducting? | Yes | No | Yes | Yes | No | |
ITER[1] | CFETR(old version) | CFETR (new) | BEST | |
Major radius R0 | 6.2m | 5.7m | 7.2m | 3.6m |
minor radius a | 2.0m | 1.6m | 2.2m | |
elongation | ||||
No. of TF coils, turns, current | 18, 134, 68kA | 16, 132, 67.5kA | 16, ?, ? | 16, 152, 45.6kA |
Bt at R0 | 5.29T | 5.00T | 6.5T | |
CS coil module×turn×current | ||||
No. of independent PF coils | ||||
Available solenoid magnetic flux | ||||
Maximum plasma current | 15MA | 10MA | 14MA | |
Pulse length | 400s | |||
superconducting? | Yes | Yes | Yes | Yes |
ASDEX-U | HL-2M | NSTX | MAST | |
Major radius R 0 | 1.65m | 1.78m | 0.85m | 0.9m |
minor radius a | 0.7m | 0.65m | 0.68m | 0.6m |
elongation | ||||
No. of TF coils, turns, current | 16,?,? | 20,7,190kA | ||
Bt at R0 | 2.99T | 0.3T | 0.55T | |
CS coil module×turn×current | 1,?,? | |||
No. of independent PF coils | 1+16 | |||
Available solenoid magnetic flux | 14Vs | |||
typical plasma current | 1.6MA | 2.5MA | ||
Pulse length | 5s | |||
superconducting? | No | No | No | |
DIII-D has 24 groups of TF coils with 6turns/coil, i.e., total turns are 24 × 6 = 144, with a maximum current of Is = 126kA in a single turn[21]. Using formula (507), the toroidal filed at R = 1.67m can be calculated, giving 2.17T.
DIII-D is special in that its poloidal field (PF) coils are located inside of the TF-coils, which makes the PF-coils more close to the plasma and thus more efficient in shaping the plasma. However, this nested structure is difficult to assemble. In superconducting tokamaks (e.g., EAST, KSTAR, ITER), PF coils are all placed outside of the TF-coils.
I noticed that HL-2M also has the PF coils located within the TF-coils, similar to DIII-D. This remind me that this layout may apply to all non-superconducting tokamaks (to be confirmed, No, non-superconducting tokamak ASDEX-U has PF coils outside of TF coils).
KSTAR has 16 TF coils and 14 PF coils. Both of the TF and PF coil system use internally cooled superconductors. The nominal current in TF coils is 35.2kA∕turn with 56turns∕coil and all coils connected in series[25]. Using these information and formula (507), the toroidal filed at R = 1.8m can be calculated, giving 3.5T. The PF coil system consists of 8 Central Solenoide (CS) coils and 6 outer PF coils and can provide 17 V-sec.
ITER has 18 TF coils with number of turns in one coil being 134 and current per turn 68kA[5]. Using these information and formula (507), the toroidal filed at R = 6.2m can be calculated, giving 5.29T
According to Refs. [8, 22], Miller’s formula for a series of shaped flux surfaces is given by
| (512) |
| (513) |
where κ(r) and δ(r) are elongation and triangularity profile, R0(r) is the Shafranov shift profile, which is given by
| (514) |
where R0′ is a constant, R0(a) is the major radius of the center of the boundary flux surface. The triangularity profile is
| (515) |
and the elongation profile is
| (516) |
The nominal ITER parameters are κ0 = 1.8, δ0 = 0.5 and R0′ = −0.16. I wrote a code to plot the shapes of the flux surface (/home/yj/project/miller_flux_surface). An example of the results is given in Fig. 35.
An analytic expression for the pressure profile of double (inner and external) transport barriers is given by
| (517) |
where ψ is the normalized poloidal flux, wi and we are the width of the inner and external barriers, ψi and ψe are the locations of the barriers, ai and ae is the height of the barriers, c is a constant to ensure P(ψ) = 0 at ψ = 1.
To construct a periodic function about 𝜃, we introduces a function z(𝜃) which is defined over −∞ < 𝜃 < ∞ and vanishes sufficiently fast as |𝜃|→∞ so that the following infinite summation converge:
| (518) |
If we use the above sum to define a function
| (519) |
then it is obvious that
| (520) |
i.e., z(𝜃) is a periodic function about 𝜃 with period of 2π.
If we use the right-hand-side of Eq. (519) to represent z(𝜃), then we do not need to worry about the periodic property of z(𝜃) (the periodic property is guaranteed by the representation)
Let us introduce parameters characterizing the shape of a magnetic surface in the poloidal plane. The “midplane” is defined as the plane that passes through the magnetic axis and is perpendicular to the symmetric axis (Z axis). For a up-down symmetric (about the midplane) magnetic surface, its shape can be roughly characterized by four parameters, namely, the R coordinate of the innermost and outermost points in the midplane, Rin and Rout; the (R,Z) coordinators of the highest point of the magnetic surface, (Rtop,Ztop). These four parameters are indicated in Fig. 38.
In terms of these four parameters, we can define the major radius of a magnetic surface
| (521) |
(which is the R coordinate of the geometric center of the magnetic surface), the minor radius of a magnetic surface
| (522) |
the triangularity of a magnetic surface
| (523) |
and, the ellipticity (elongation) of a magnetic surface
| (524) |
Usually, we specify the value of R0, a, δt, and κ, instead of (Rin,Rout,Rtop,Ztop), to characterize the shape of a magnetic surface. The value of the triangularity δt is usually positive in traditional tokamak operations, but negative triangularity is achievable and potentially useful, which is under active investigation.
Besides, using a and R0, we can define another useful parameter 𝜀 ≡ a∕R0, which is called the inverse aspect ratio. Note that the major radius R0 of the LCFS is usually different from Raxis (the R coordinate of the magnetic axis). Usually we have Raxis > R0 due to the so-called Shafranov shift.
We note that Ψ ≡ AϕR is the covariant toroidal component of A in cylindrical coordinates (R,ϕ,Z). The proof is as follows. Note that the covariant form of A should be expressed in terms of the contravariant basis vector (∇R, ∇ϕ, and ∇Z), i.e.,
| (525) |
where A2 is the covariant toroidal component of A. To obtain A2, we take scalar product of Eq. (525) with ∂r∕∂ϕ and use the orthogonality relation (107), which gives
| (526) |
In cylindrical coordinates (R,ϕ,Z), the position vector is written as
| (527) |
where , , and are unit vectors along ∂r∕∂R, ∂r∕∂Z, and ∂r∕∂ϕ, respectively, i.e.
| (528) |
Using this, we obtain
| (529) |
Use Eq. (529) in Eq. (526) giving
| (530) |
with Aϕ defined by Aϕ = A ⋅. Equation (530) indicates that Ψ = AϕR is the covariant toroidal component of the vector potential.
For most choices of P(Ψ) and g(Ψ), the GS equation (53) has to be solved numerically. For the specific choice of P and g profiles given by
| (531) |
| (532) |
where c1, c2, and R0 are constants, there is an analytical solution, which is given by[16]
| (533) |
where c0 is an constant. [Proof: By direct substitution, we can verify Ψ of this form is indeed a solution to the GS equation (53).] A useful choice for tokamak application is to set c0 = B0∕(R02κ0q0), c1 = B0(κ02 + 1)∕(R02κ0q0), and c2 = 0. Then Eq. (533) is written
| (534) |
For this case, the toroidal field function g is a constant. (For the Solovev equilibrium (534), I found numerically that the value of the safety factor at the magnetic axis (R = R0,Z = 0) is equal to q0g∕(R0B0). This result should be able to be proved analytically. I will do this later. In calculating the safety factor, we also need the expression of |∇Ψ|, which is given analytically by
Define Ψ0 = B0R02, and Ψ = Ψ∕Ψ0, then Eq. (534) is written as
where R = R∕R0, Z = Z∕R0. From Eq. (536), we obtain
| (537) |
Given the value of κ0, q0, for each value of Ψ, we can plot a magnetic surface on (R,Z) plane. An example of the nested magnetic surfaces is shown in Fig. 39.
Equation (534) can be solved to give explicit form of the contour of Ψ in (R,Z) plane:
| (538) |
The minor radius of a magnetic surface of the Solovev equilibrium can be calculated by using Eq. (538), which gives
| (539) |
| (540) |
and thus
| (541) |
where A = 8R02q0∕(B0κ0). In my code of constructing Solovev magnetic surface, the value of a is specified by users, and then Eq. (541) is solved numerically to obtain the value of Ψ of the flux surface. Note that the case Ψ = 0 corresponds to Rin = Rout = R0, i.e., the magnetic axis, while the case Ψ = R02B0κ0∕(8q0) corresponds to Rin = 0. Therefore, the reasonable value of Ψ of a magnetic surface should be in the range 0 ≤ Ψ < R02B0κ0∕(8q0). This range is used as the interval bracketing a root in the bisection root finder.
Using Eq. (541), the inverse aspect ratio of a magnetic surface labeled by Ψ can be approximated as[16]
| (542) |
Therefore, the value of Ψ of a magnetic surface with the inverse aspect ratio 𝜀 is approximately given by
| (543) |
In deriving the Grad-Shafranov equation, we have assumed that there is no plasma flow. Next, let us examine whether this assumption is justified for plasmas in EAST tokamak.
The complete momentum equation is given by
| (544) |
where ρqE term can be usually neglected due to either ρq ≈ 0 or E ≈ 0, ℙ is a pressure tensor, which is different from the scalar pressure considered in this note. The equilibrium with pressure tensor can be important for neutral beam heating plasma, where pressure contributed by NBI fast ions can be a tensor. With plasma flow and scalar pressure and neglecting electric force term, the steady state momentum equation is written
| (545) |
where the term on the left-hand side is the contribution of plasma flow to the force balance. Let us estimate the magnitude of this term. Macroscopic flows in tokamak are usually along the toroidal direction (the poloidal flow is usually heavily damped). The toroidal flow usually has the same toroidal angular frequency on a magnetic surface, i.e., the flow can be written as
| (546) |
where ωT = ωT(ψ) is the toroidal angular frequency of the flow, which can have radial variation. Using this expression, the left-hand side of Eq. (545) is written as
As is discussed in Sec. (), to satisfy the force balance, g ≡ RBϕ must be a magnetic surface function, i.e., g = g(Ψ). Using this, expression (36) and (37) are written
| (548) |
and
| (549) |
respectively. The above two equations imply that
| (550) |
which implies that the projections of B lines and J lines in the poloidal plane are identical to each other. This indicates that the J surfaces coincide with the magnetic surfaces.
The poloidal plasma current density is usually small (compared with the toroidal plasma current density) but is important for some cases of interest and thus could not be safely neglected. Many model equilibria (e.g., Solovev equilibria, DIII-D cyclone base cases) frequently used in simulations assume that g is a spatial constant, i.e., neglecting the poloidal plasmas current. The conclusions drawn from these simulations could be misleading.
Using this and ∇⋅ J = 0, and following the same steps in Sec. 2.7, we obtain
| (551) |
where Ipol is the poloidal current enclosed by the two magnetic surfaces, the positive direction of Ipol is chosen to be in the clockwise direction when observers look along . Equation (551) indicates that the difference of g between two magnetic surface is proportional to the poloidal current. For this reason, g is usually call the “poloidal current function”.
In the above, we see that the relation of g with the poloidal electric current is similar to that of Ψ with the poloidal magnetic flux. This similarity is due to the following differential relations:
The poloidal plasma current density Jp can be further written as
Using g = g(Ψ), Eq. (552) can also be written asPlasma β is is the ratio of thermal pressure to magnetic pressure, i.e.,
| (554) |
Since pressure in tokamak plasmas is not uniform, volume averaged pressure is used to define the beta. The toroidal beta βt and the poloidal beta βp are defined, respectively, by
| (555) |
| (556) |
where ⟨…⟩ is the volume average, Bt0 is the vacuum toroidal magnetic field at the magnetic axis (or geometrical center of the plasma), Ba = μ0Ip∕l is the flux surface averaged poloidal magnetic fied, l = ∮ dl is the length of the poloidal perimeter of the boundary flux surface. Then βp can be written as
| (557) |
An alternative defintion of βp use the LCFS cross-sectional average of p rather than the volume average p (Wesson tokamaks). This definition is adopted in many codes, including HEQ code I developed
Beta can be considered as a quantity characterizing the efficiency of the magnetic field of tokamaks in confining plasmas.
In tokamaks, the toroidal magnetic field is dominant and thus the the toroidal beta βt (not βp) is the usual way to characterize the the efficiency of the magnetic field in confining plasmas. (Why do we need βp? The short answer is that βp is proportional to an important current, the bootstrap current, which is important for tokamak steady state operation.)
Tokamak experiments have found that it is easier to achieve higher βt in low Bt plasmas than in higher Bt plasmas, which indicates that the efficiency of the magnetic field in confining plasma is a decreasing function of the magnitude of the magnetic field.
Beta limit means there is a limit for the value of beta beyond which the plasma will encounter a serious disruption. Early calculation of the beta limit on JET shows that the maximal βt obtained is proportional to Ip∕(106aBt0), where all quantities are in SI units. This scaling relation βt max = CTIp∕(106aBt0) is often called Troyon scaling, where the coefficient CT was determined numerically by Troyon to 0.028. Often CT is expressed in percent, in which case CT = 2.8. This motivates us to define
| (558) |
which is called “normalized beta”. The normalized beta βN is an operational parameter indicating how close the plasma is to reach destabilizing major MHD activities. Its typical value is of order unit. As mentioned above, βN calculated by Troyon is 2.8. Empirical evaluation from the data of different tokamaks raises this value slightly to 3.5, although significantly higher values, e.g., βN = 7.2, have been achieved in the low aspect ratio tokamak NSTX[24].
The value of βN indicates how close one is to the onset of deleterious instability . The ability to increase the value of βN can be considered as the ability of controlling the major MHD instabilities, and thus can be used to characterize how well a tokamak device is operated. One goal of EAST tokamak during 2015-2016 is to sustain a plasma with βN ≥ 2 for at least 10 seconds.
(check** The tearing mode, specifically the neoclassical tearing mode (NTM) is expected to set the beta limit in a reactor.)
(**check: Tokamak experiments have found that it is easier to achieve high βN in large Ip plasmas than in small Ip plasmas. However, experiments found it is easier to achieve high βp in small Ip plasmas than in large Ip plasmas. Examining the expression of βN and βp given by Eqs. (557) and Eq. (), respectively, we recognize that pressure limit should have a scaling of ⟨p⟩∝ Ipα with 1 < α < 2. )
βp is the ratio of the pressure to the squre of plasma current, and thus characterizes the efficiency of the plasma current in confining the plasma. Is there a limit for βp?
As is mentioned in Sec. A.6, the beta limit study on JET tokamak shows that the maximal βt obtained is proportional to Ip∕aBt0. This means the maximal plasmas pressure obtained is proportional to Ip∕a, i.e.,
| (559) |
The total plasma energy is given by E ≈⟨p⟩2πRπa2, where R is the major radius of the device. Using Eq. (559), we obtain
| (560) |
Since fusion power is proportional to the plasma energy, the above relation indicates, to obtain larger fusion power, we need bigger tokamaks with larger plasma current.
The reason why larger plasma current is desired can also be appreciated by examining an empirical scaling of the the energy confinement time τE given by
| (561) |
which is proportional to I2.
Another fundamental reason for building larger tokamaks is that the energy confinement time τE ∼ a2∕χ increases with the machine size, where χ is the heat diffusitivity. In addition, the heat diffusitivity χ decreases with increasing machine size if the diffusitivity satisfies the gyro-Bohm scaling, which is given by
| (562) |
which is inverse proportional to the machine size a. However, if the diffusitivity satisfies the Bohm scaling, which is given by
| (563) |
then, the diffusitivity is independent of the machine size. The Bohm diffusitivity χB is a∕ρs times larger than the gyro-Bohm diffusitivity χGB, where ρs is the gyro-radius. Heat diffusitivity scaling in the low confinement operation (L mode) in present-day tokamaks is observed to be Bohm or worse than Bohm.
The maximum density that can be obtained in stable plasma operations (without disruption) is empirically given by
| (564) |
where nG is the Greenwalt density, which is given by
| (565) |
where Ip is the plasma current, a is the minor radius, all physical quantities are in SI units. The 1.5nG gives the density limit that can be achieved for a tokamak operation scenario with plasma current Ip and plasma minor radius a. The Greenwalt density limit is an empirical one, which, like other empirical limits, can be exceeded in practice. Equation (565) indicates that the Greenwalt density is proportional to the current density. Therefore the ability to operate in large plasma current density means the ability to operate with high plasma density.
Note that neither the pressure limit nor the density limit is determined by the force-balance constraints. They are determined by the stability of the equilibrium. On the other hand, since the stability of the equilibrium is determined by the equilibrium itself, the pressure and density limit is determined by the equilibrium.
The self-inductance of a current loop is defined as the ratio of the magnetic flux Φ traversing the loop and its current I:
| (566) |
where
| (567) |
It can be proved that L is independent of the current I in the loop, i.e., L is fully determined by the shape of the loop.
On the other hand, the energy contained in the magnetic field produced by the loop current is given by
| (568) |
where the volume includes all space where B is not negligible. It can be proved that (to be proved) W, L, and I are related to each other by:
| (569) |
i.e.,
| (570) |
which can be considered an equivalent definition of the self-inductance.
The internal inductance Li of tokamak plasma is defined in such a way that W only includes the magnetic energy within the plasma. Specifically, Li is defined by
| (571) |
where the integration over the plasma volume P and only the poloidal field B𝜃 appears in the integration since plasma current produces only the poloidal magnetic field.
The normalized internal inductance li is defined as
| (572) |
where R is the surface averaged major radius. Using Eq. (571), expression (572) is written as
| (573) |
which is the definition of li used in the ITER design. Using the defintion of R, i.e.,
| (574) |
where A is the cross section of boundary flux surface, expression (573) is written as
| (575) |
Another way of defining the normalized internal inductance is
| (576) |
where ⟨…⟩s is the surface average over the plasma boundary. Using Ampere’s law, we obtain
| (577) |
Using this Eq. (576) is written as
| (578) |
For circular cross section, l2 = 4πA. Then the above expression is written as
li = ⟨B𝜃2⟩, |
which agrees with Eq. (575).
The normalized internal inductance reflects the peakness of the current density profile in the toroidal plasma: smaller value of li corresponds to broader current profile.
Due to the force balance condition, the plasma current is related to the plasma pressure gradient:
The parallel (to the magnetic field) current density is written asAnother useful quantity is μ0⟨J ⋅ B⟩, which is written as
In the vacuum region that is between the plasma and the first wall, there is no current, i.e.,
| (585) |
Next, let us examine what constraint this condition imposes on the magnetic field. Using expression (10), the above equation is written as
| (586) |
It is not obvious how to draw useful information from the above equation.
In the above, we use the vector potential approach. Next, let us try the scalar potential approach:
| (587) |
then the constraint ∇⋅ B = 0 is written as
| (588) |
[check***As discussed in Sec. (), the force balance equation of axisymmetric plasma requires that B ⋅∇g = 0. From this and the fact B ⋅∇Ψ = 0, we conclude that g is a function of Ψ, i.e., g = g(Ψ). However, this reasoning is not rigorous. Note the concept of a function requires that a function can not be a one-to-more map. This means that g = g(Ψ) indicates that the values of g must be equal on two different magnetic field lines that have the same value of Ψ. However, the two equations B⋅∇g = 0 and B⋅∇Ψ = 0 do not require this constraint. To examine whether this constraint removes some equilibria from all the possible ones, we consider a system with an X point. Inside one of the magnetic islands, we use
| (589) |
and inside the another, we use
| (590) |
Then solve the two GS equations respectively within the boundary of the two islands. It is easy to obtain two magnetic surfaces that have the same value of Ψ respectively inside the two islands. Equations (589) and (590) indicate that the values of g on the two magnetic surfaces are different from each other. It is obvious the resulting equilibrium that contain the two islands can not be recovered by directly solving a single GS equation with a given function g(Ψ).**check]
Note that, on both an irrational surface and a rational surface, there are infinite number of magnetic field lines that are not connected with each other (it is wrong to say there is only one magnetic field line on a irrational surface). Consider a field f that satisfies B⋅∇f = 0, the value f is a constant along any one of the magnetic field lines. Now comes the question: whether the values of f on different field lines are equal to each other? To answer this question, we can choose a direction different from B on the magnetic surface and examine whether Ψ is constant or not along this direction, i.e, whether k ⋅∇f equals zero or not, where k is the chosen direction. For axsiymmetric magnetic surfaces, it is ready to see that k = is a direction in the magnetic surface and it is usually not identical with B∕B. Then we obtain
| (591) |
If f is independent of ϕ, then k ⋅∇Ψ = 0. Then the fact that B ⋅∇f = 0 and the fact that B and k are two different directions on the magnetic surface, indicates that f is constant on the surface, i.e., the values of f on different field lines are equal to each other. If f is non-axisymmetric, then we know the values of f on different magnetic field lines on the same magnetic surface are not equal to each other. This is the case for the α coordinates discussed in Sec. ().
This reasoning is for the case of axsiymmetric magnetic surfaces. It is ready to do the same reasoning for non-axisymmetrica magnetic surface after we find a convenient direction k on the magnetic surface.
(In practice, I choose the positive direction of 𝜃 and ϕ along the direction of toroidal and poloidal magnetic field (i.e., B ⋅∇ϕ and B ⋅∇𝜃 are always positive in (ψ,𝜃,ϕ) coordinates system). Then, the qlocal defined by Eq. (182) is always positive. It follows that qglobal should be also positive. Next, let us examine whether this property is correctly preserved by Eq. (188). Case 1: The radial coordinate ψ is chosen as Ψ′≡ dΨ∕dψ > 0. Then the factor before the integration in Eq. (188) is negative. We can further verify that 𝒥 is always negative for either the case that ∇Ψ is pointing inward or outward. Therefore the .r.h.s. of Eq. (188) is always positive for this case. Case 2: The radial coordinate ψ is chosen as Ψ′≡ dΨ∕dψ < 0. Then the factor before the integration in Eq. (188) is positive. We can further verify that 𝒥 is always positive for either the case that ∇Ψ is pointing inward or outward. The above two cases include all possibilities. Therefore, the positivity of qglobal is always guaranteed)
a magnetic surface forms a central hole around Z axis. Using Gauss’s theorem in the volume within the central hole, and noting that no magnetic field line point-intersects a magnetic surface, we know that the magnetic flux through any cross section of the hole is equal to each other. Next we calculate this magnetic flux. To make the calculation easy, we select a plane cross section perpendicular to the Z axis, as is shown by the dash line in Fig. (). In this case, only BZ contribute to the magnetic flux, which is written (the positive direction of the cross section is chosen in the direction of Z)
| (592) |
be generalized to any revolution surface that is generated by rotating a curve segment on the poloidal plane around Z axis. For instance, a curve on the poloidal plane that connects the magnetic axis and a point on a flux surface can form a toroidal surface (e.g., surface S2 in Fig. 53). The magnetic flux through the toroidal surface S2 is given by
i.e.
| (593) |
which indicates that the difference of Ψ between the Z axis and a magnetic surface is the poloidal magnetic flux per radian through the central hole, Ψp1∕2π.
The magnetic surface forms a central hole around Z axis. The magnetic flux through any cross section of the central hole is equal to each other and is given by Ψp = 2π(Ψb − Ψa), where Ψa and Ψb are the value of Ψ at the Z axis and the magnetic surface, respectively.
The conclusion in Eq. (592) can be generalized to any revolution surface that is generated by rotating a curve on the poloidal plane about Z axis. For instance, a curve on the poloidal plane that connects the magnetic axis and a point on a flux surface can form a toroidal surface (e.g., surface S2 in Fig. 53).
Also note the difference between Ψp and Ψp1 defined in Sec. 2.7: Ψp1 is the magnetic flux through the central hole of a torus and thus includes the flux in the center transformer, and Ψp is the magnetic flux through the ribbon between the magnetic axis and the magnetic surface.
We know that the toroidal flux ψt, safety factor q, and the Ψ in the GS equation are related by the following equations:
| (594) |
| (595) |
Define:
| (596) |
(In the Toray_ga code, the radial coordinate ρ is defined as
| (597) |
where Bt0 is a constant factor.ρ defined this way is of length dimension, which is an effective geometry radius obtained by approximating the flux surface as circular.)
I use Eq. (596) to define ρ. Then we have
| (598) |
| (599) |
| (600) |
| (601) |
| (602) |
Eq. (602) is used to transform between ψ and ρ.
dρ = dΦ = 2πqdψ = qdψ |
⇒ dψ = dρ(πa2) |
If (ψ,𝜃,ϕ) are magnetic surface coordinates, i.e., ∂Ψ∕∂𝜃 = 0, then the toroidal elliptic operator in Eq. (419) is reduced to
| (603) |
and the GS equation, Eq. (422), is reduced to
| (604) |
Define (r,𝜃,ϕ) coordinates by
| (605) |
| (606) |
where (R,ϕ,Z) are the cylindrical coordinates and R0 is a constant. The above transformation is shown graphically in Fig. 41.
The Jacobian of (r,𝜃,ϕ) coordinates can be calculated using the definition. Using x = R cosϕ, y = R sinϕ, and z = Z, the Jacobian (with respect to the Cartesian coordinates (x,y,z)) is written as
Next, we transform the GS equation from (R,Z) coordinates to (r,𝜃) coordinates. Using the relations R = R0 + r cos𝜃 and Z = r sin𝜃, we have
| (608) |
| (609) |
| (610) |
| (611) |
The GS equation in (R,Z) coordinates is given by
| (612) |
The term ∂Ψ∕∂Z is written as
Using Eq. (613), ∂2Ψ∕∂Z2 is written as
| (615) |
sin𝜃 = . |
cos𝜃 = −Z |
| (616) |
cos𝜃 = |
| (617) |
Summing the the right-hand-side of Eq. (614) and the expression on line (618) yields
| (620) |
Using these, the GS equation is written as
++− = −μ0(R0+r cos𝜃)2−g(Ψ), |
which can be arranged in the form
| (621) |
which agrees with Eq. (3.6.2) in Wessson’s book[29], where f is defined by f = RBϕ∕μ0, which is different from g ≡ RBϕ by a 1∕μ0 factor.
Consider the case that the boundary flux surface is circular with radius r = a and the center of the cirle at (R = R0,Z = 0). Consider the case 𝜀 = r∕R0 → 0. Expanding Ψ in the small parameter 𝜀,
| (622) |
where Ψ0 ∼ O(𝜀0), Ψ1 ∼ O(𝜀1). Substituting Eq. (622) into Eq. (621), we obtain
r+r++−− = −μ0(R0+r cos𝜃)2P′(Ψ 0+Ψ1)−g′(Ψ0+Ψ1)g(Ψ0+Ψ1) |
Multiplying the above equation by R02, we obtain
| (623) |
Further assume the following orderings (why?)
| (624) |
and
| (625) |
Using these orderings, the order of the terms in Eq. (623) can be estimated as
| (626) |
| (627) |
| (628) |
| (629) |
| (630) |
| (631) |
| (632) |
| (633) |
| (634) |
The leading order (𝜀−2 order) balance is given by the following equation:
| (635) |
It is reasonable to assume that Ψ0 is independent of 𝜃 since Ψ0 corresponds to the limit a∕R → 0. (The limit a∕R → 0 can have two cases, one is r → 0, another is R →∞. In the former case, Ψ must be independent of 𝜃 since Ψ should be single-valued. The latter case corresponds to a cylinder, for which it is reasonable (really?) to assume that Ψ0 is independent of 𝜃.) Then Eq. (635) is written
| (636) |
(My remarks: The leading order equation (636) does not corresponds strictly to a cylinder equilibrium because the magnetic field B = ∇Ψ0 ×∇ϕ + g∇ϕ depends on 𝜃.) The next order (𝜀−1 order) equation is
R02r+R02−R0cos𝜃 = −μ0R022R 0r cos𝜃P′(Ψ0)−μ0R04P′′(Ψ 0)Ψ1−R02[g′(Ψ 0)g(Ψ0)]′Ψ1 |
| (637) |
| (638) |
It is obvious that the simple poloidal dependence of cos𝜃 will satisfy the above equation. Therefore, we consider Ψ1 of the form
| (639) |
where Δ(r) is a new function to be determined. Substitute this into the Eq. (), we obtain an equation for Δ(r),
| (640) |
| (641) |
| (642) |
| (643) |
Using the identity
= −, |
equation () is written as
| (644) |
Using the leading order equation (), we know that the second and fourth term on the l.h.s of the above equation cancel each other, giving
| (645) |
| (646) |
Using the identity
| (647) |
equation (646) is written
| (648) |
| (649) |
Using
| (650) |
equation (649) is written
| (651) |
| (652) |
which agrees with equation (3.6.7) in Wessson’s book[29].
The normalized pressure gradient, α, which appears frequently in tokamak literature, is defined by[3]
| (653) |
which can be further written
| (654) |
where p = p∕(B02∕2μ0). Equation (654) can be further written as
| (655) |
where 𝜀a = a∕R0, r = r∕a, and a is the minor radius of the boundary flux surface. (Why is there a q2 factor in the definition of α?)
The global magnetic shear s is defined by
| (656) |
which can be written
| (657) |
In the case of large aspect ratio and circular flux surface, the leading order equation of the Grad-Shafranov equation in (r,𝜃) coordinates is written
| (658) |
which gives concentric circular flux surfaces centered at (R = R0,Z = 0). Assume that Jϕ is uniform distributed, i.e., |Jϕ| = I∕(πa2), where I is the total current within the flux surface r = a. Further assume the current is in the opposite direction of ∇ϕ, then Jϕ = −I∕(πa2). Using this, Eq. (658) can be solved to give
| (659) |
Then it follows that the normalized radial coordinate ρ ≡ (Ψ − Ψ0)∕(Ψb − Ψ0) relates to r by r = (I check this numerically for the case of EAST discharge #38300). Sine in my code, the radial coordinate is Ψ, I need to transform the derivative with respect to r to one with respect to Ψ, which gives
| (660) |
| (661) |
The necessary condition for the existence of TAEs with frequency near the upper tip of the gap is given by[3]
| (662) |
which is used in my paper on Alfvén eigenmodes on EAST tokamak[15]. Equations (660) and (661) are used in the GTAW code to calculate s and α.
Magnetic field (e.g., equilibrium poloidal field, RMP field, ripple field) and vector potential generated by coils can be calculated in the following way.
The Biot-Savart law for a zero-thinkness wire is given by
Given a current source J(r,t), the vector potential can be calculated using
| (664) |
where
| (665) |
is called the retarded time. For a steady-state source, J(r′,t′) = J(r). Then Eq. (664) is simplified as
| (666) |
For a current flowing in a thin wire, the above equation is written as
| (667) |
where dS is a surface element perpendicular to the wire and dl is a line element along the wire. Using J(r′)dS(r′) = I(r′), the above eqaution is written as
| (669) |
(Aϕ is needed in several applications. In solving the free-boundy equilibrium problem, we need to calculate Aϕ generated by the PF coils. In studying the effects of RMP on particles, we need to calculate Pϕ, the canonical toroidal angular momentum, whose defintion involves Aϕ. Then we need to calculate Aϕ generated by the RMP coils.)
For a curve along the toroidal direction, the line element dl in terms of the cylindrical basis is written as dl′ = R′dϕ′ϕ′. Using Cartesian coordinate basis vectors, dl′ is written as
| (670) |
and
| (671) |
where a global Cartesian coordinates with x axis in ϕ = 0 plane is assumed.
Let us consider a full toroidal coil at (R′,Z′)with current I (a filamentary current loop). Since the problem is symmetric, the magnetic field/potential is independent of ϕ. For calculation ease, we select ϕ = 0 plane and calculate A and B values in this plane. Then
| (672) |
| (673) |
Using these, we obtain
| (674) |
and Eq. (669) is written as
| (675) |
Sine Aϕ is axsymmetric, the above formula applies to all values of ϕ. Multiply Aϕ by R and set I = 1, we get Green’s function of Ψ:
This expression can be directly used in numerical codes to compute the Green function table. One can also write the above integration to the elipitic integrals and use library to compute these inegreals. Let us write the above expresion in this form. Define 𝜃 = (π − ϕ)∕2, then cosϕ′ = cos(π − 2𝜃) = −cos(2𝜃) = 2sin2𝜃 − 1. Using this Eq. (676) is written as
| (678) |
Then
E(k) = ∫ 0π∕2d𝜃, |
K(k) = ∫ 0π∕2d𝜃 |
are the eliptic integrals of the first and second kind.
Similarly, we can calculate the magnetic field:
where the cross product is written asR ⋅ dl′× (r − r′) = R′(Z − Z′)cosϕ′dϕ′ |
Z ⋅ dl′× (r − r′) = dϕ′ |
Using these in Eq. (680), BR(r) and BZ(r) are written as
One can also try to write the above formula to eliplicity integral form. The ressult is not compact as the above formula. So I directly use Eqs. (681) and (682) in HEQ code. Alternatively, one can directly take the finite difference of G to get GBR and GBZ in a numerical code.
For a curve in the poloidal plane, the line element dl in terms of the cylindrical basis is written as dl = dRR(ϕ) + dZz. Using Cartesian coordinate basis vectors, dl is written as
| (683) |
Using Eq. (683) and (), we obtain
| (684) |
This document initially contains notes I took when learning tokamak equilibrium theory. As a result of the on-going learning, the document is evolving. I enjoy seeing the continuous improvement of this document over a long time scale (10 years). Most of the content is elementary but I still found I got something totally wrong in the first version. Let me know if you spot something specious.
This document was written by using TeXmacs[27], a structured wysiwyw (what you see is what you want) editor for scientists. The HTML version is generated by first converting the TeXmacs file to TeX format and then using htlatex to convert the TeX to HTML.
[1] R Aymar, P Barabaschi, and Y Shimomura. The ITER design. Plasma Physics and Controlled Fusion, 44(5):519–565, apr 2002.
[2] M. A. Beer, S. C. Cowley, and G. W. Hammett. Field-aligned coordinates for nonlinear simulations of tokamak turbulence. Phys. Plasmas (1994-present), 2(7):2687–2700, 1995.
[3] H. L. Berk, J. W. Van Dam, D. Borba, J. Candy, G. T. A. Huysmans, and S. Sharapov. More on core localized toroidal alfvén eigenmodes. Phys. Plasmas, 2(9):3401–3406, 1995.
[4] Allen H. Boozer. Physics of magnetically confined plasmas. Rev. Mod. Phys., 76:1071–1141, Jan 2005.
[5] R. Gallix, C. Jong, J. Knaster, N. Mitchell C. Sborchia, Y. Fu. Design and specifications of the iter tf coils. IEEE TRANSACTIONS ON APPLIED SUPERCONDUCTIVITY,, 18(2):463, 2008.
[6] Yang Chen and Scott E. Parker. A delta-f particle method for gyrokinetic simulations with kinetic electrons and electromagnetic perturbations. Journal of Computational Physics, 189(2):463–475, 2003.
[7] Yang Chen and Scott E. Parker. Electromagnetic gyrokinetic δf particle-in-cell turbulence simulation with realistic equilibrium profiles and geometry. Journal of Computational Physics, 220(2):839–855, 2007.
[8] Yang Chen, Scott E. Parker, J. Lang, and G.-Y. Fu. Linear gyrokinetic simulation of high-n toroidal alfvén eigenmodes in a burning plasma. Phys. Plasmas, 17(10):102504, 2010.
[9] Fu Peng, Gao Ge Chen Yuan-Yang, Bao Xiao-Hua. Plasma shape optimization for east tokamak using orthogonal method. Chinese Physics B, 28(1):15201, 2019.
[10] C.Z Cheng and M.S Chance. Nova: a nonvariational code for solving the mhd stability of axisymmetric toroidal plasmas. J. of Comput. Phys., 71(1):124–146, 1987.
[11] J DeLucia, S.C Jardin, and A.M.M Todd. An iterative metric method for solving the inverse tokamak equilibrium problem. Journal of Computational Physics, 37(2):183–204, 1980.
[12] A. M. Dimits. Fluid simulations of tokamak turbulence in quasiballooning coordinates. Phys. Rev. E, 48:4070–4079, Nov 1993.
[13] T. Görler, N. Tronko, W. A. Hornsby, A. Bottino, R. Kleiber, C. Norscini, V. Grandgirard, F. Jenko, and E. Sonnendrücker. Intercode comparison of gyrokinetic global electromagnetic modes. Physics of Plasmas, 23(7):72503, 2016.
[14] J. van der Hoeven et al. GNU TeXmacs. https://www.texmacs.org, 1998.
[15] Youjun Hu, Guoqiang Li, N. N. Gorelenkov, Huishan Cai, Wenjun Yang, Deng Zhou, and Qilong Ren. Numerical study of alfvén eigenmodes in the experimental advanced superconducting tokamak. Phys. Plasmas, 21(5):0, 2014.
[16] Stephen C. Jardin. Computational methods in plasma physics. CRC Press, 2010.
[17] Young Mu Jeon. Development of a Free-boundary Tokamak Equilibrium Solver for Advanced Study of Tokamak Equilibria. Journal of the Korean Physical Society, 67(5):843–853, 09 2015.
[18] L.L. Lao, H. St. John, R.D. Stambaugh, A.G. Kellman, and W. Pfeiffer. Reconstruction of current profile parameters and plasma shapes in tokamaks. Nucl. Fusion, 25(11):1611, 1985.
[19] G.S. Lee, M. Kwon, C.J. Doh, B.G. Hong, K. Kim, M.H. Cho, W. Namkung, C.S. Chang, Y.C. Kim, J.Y. Kim, H.G. Jhang, D.K. Lee, K.I. You, J.H. Han, M.C. Kyum, J.W. Choi, J. Hong, W.C. Kim, B.C. Kim, J.H. Choi, S.H. Seo, H.K. Na, H.G. Lee, S.G. Lee, S.J. Yoo, B.J. Lee, Y.S. Jung, J.G. Bak, H.L. Yang, S.Y. Cho, K.H. Im, N.I. Hur, I.K. Yoo, J.W. Sa, K.H. Hong, G.H. Kim, B.J. Yoo, H.C. Ri, Y.K. Oh, Y.S. Kim, C.H. Choi, D.L. Kim, Y.M. Park, K.W. Cho, T.H. Ha, S.M. Hwang, Y.J. Kim, S. Baang, S.I. Lee, H.Y. Chang, W. Choe, S.G. Jeong, S.S. Oh, H.J. Lee, B.H. Oh, B.H. Choi, C.K. Hwang, S.R. In, S.H. Jeong, I.S. Ko, Y.S. Bae, H.S. Kang, J.B. Kim, H.J. Ahn, D.S. Kim, C.H. Choi, J.H. Lee, Y.W. Lee, Y.S. Hwang, S.H. Hong, K.-H. Chung, D.-I. Choi, and KSTAR Team. Design and construction of the KSTAR tokamak. Nuclear Fusion, 41(10):1515–1523, oct 2001.
[20] G Q Li, Q L Ren, J P Qian, L L Lao, S Y Ding, Y J Chen, Z X Liu, B Lu, and Q Zang. Kinetic equilibrium reconstruction on east tokamak. Plasma Phys. Controlled Fusion, 55(12):125008, 2013.
[21] J.L. Luxon. A design retrospective of the DIII-D tokamak. Nuclear Fusion, 42(5):614–633, may 2002.
[22] R. L. Miller, M. S. Chu, J. M. Greene, Y. R. Lin-Liu, and R. E. Waltz. Noncircular, finite aspect ratio, local equilibrium model. Phys. Plasmas, 5(4):973–978, 1998.
[23] M. Ottaviani. An alternative approach to field-aligned coordinates for plasma turbulence simulations. Physics Letters A, 375(15):1677–1685, 2011.
[24] S.A. Sabbagh, A.C. Sontag, J.M. Bialek, D.A. Gates, A.H. Glasser, J.E. Menard, W. Zhu, M.G. Bell, R.E. Bell, A. Bondeson, C.E. Bush, J.D. Callen, M.S. Chu, C.C. Hegna, S.M. Kaye, L.L. Lao, B.P. LeBlanc, Y.Q. Liu, R. Maingi, D. Mueller, K.C. Shaing, D. Stutman, K. Tritz, and C. Zhang. Resistive wall stabilized operation in rotating high beta nstx plasmas. Nucl. Fusion, 46(5):635, 2006.
[25] I. Song, C. Choi, and M. Cho. Quench protection system for the superconducting coil of the kstar tokamak. IEEE Transactions on Applied Superconductivity, 17(1):1–6, March 2007.
[26] Youwen Sun. Tokamak geometry and equilibrium. http://theory.ipp.ac.cn/~yj/other/TOKAMAK_geometry_and_equilibrium_Youwen_Sun_201208.pdf, 2012. [Online; Institute of Plasma Physics, Chinese Academy of Sciences].
[27] Joris van der Hoeven. Gnu texmacs, a structured wysiwyw (what you see is what you want) editor for scientists. http://www.texmacs.org/, 2007. [Online].
[28] W. X. Wang, Z. Lin, W. M. Tang, W. W. Lee, S. Ethier, J. L. V. Lewandowski, G. Rewoldt, T. S. Hahm, and J. Manickam. Gyro-kinetic simulation of global turbulent transport properties in tokamak experiments. Physics of Plasmas, 13(9):92505, 2006.
[29] John Wesson. Tokamaks. Oxford University Press, 2004.
[30] R. B. White and M. S. Chance. Hamiltonian guiding center drift orbit calculation for plasmas of arbitrary cross section. The Physics of Fluids, 27(10):2455–2467, 1984.
[31] B J Xiao, D A Humphreys, and M L Walker. East plasma control system. Fusion Engineering and Design, 83:181, 2008.
[32] B. J. Xiao. The first diverted plasma on east tokamak. 34th EPS Conference on Plasma Phys, 2007.