11.6 Field-line-following mesh in gyrokinetic turbulence simulation codes

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.

Mesh in GENE, GYRO, and GEM codes

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.

Mesh in GTC and GTS codes[26]

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.

Mesh in XGC1 code ***check**

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.