# FLUX-SURFACE GEOMETRY¶

## Coordinates¶

GYRO/CGYRO/NEO use a right-handed (positively-oriented), field-aligned coordinate system \((r,\theta,\alpha)\) and the Clebsch field representation

where \(\psi\) is the poloidal flux divided by \(2\pi\) and

is the Clebsch angle. Here, \(\varphi\) is the **toroidal angle**, oriented as shown
in the figure below, and \(\theta\) is the **poloidal angle** which increases as one
moves counterclockwise along the flux-surface (shown in blue). The **minor radius**
\(r\) is in all cases taken to be one-half the width of the flux-surface at
the elevation, \(Z_{c}\), of the flux-surface centroid.

The coordinate systems \((R,Z,\varphi)\) and \((r,\theta,\varphi)\) are positively oriented.

## Generalized minor radius¶

The minor radius variable, \(r\), used in GYRO/CGYRO/NEO is the half-width of the flux surface at the height, \(Z_{c}\), of the centroid:

This definition is valid in all cases; that is, for circular equilibria, as well as for shaped Grad-Shafranov (Miller) and general equilibrium.

## Generalized major radius¶

The major radius variable, \(R_{0}\), used in GYRO/CGYRO/NEO is the average of the maximum and minimum major radius of the flux-surface at the height, \(Z_{c}\), of the centroid:

This definition is valid in all cases; that is, for circular equilibria, as well as for shaped Grad-Shafranov (Miller) and general equilibrium.

## Effective field¶

The effective field strength, \(B_{\rm {unit}}\), is defined as

where \(\chi _{t}\) is the toroidal flux divided by \(2\pi\). This gives the roughly equivalent field that would be obtained if the flux surface was deformed to a circle.

## Equilibria¶

GYRO/CGYRO/NEO can be run using **circular equilibrium** or **shaped Grad-Shafranov equilibrium**.

**(1) Circular equilibrium**

The flux surfaces, which are

**not**local G-S equilibria, have the form:

\[\begin{split}R(r,\theta) &= R_0 + r \cos \theta \\ Z(r,\theta) &= r \sin \theta \\ \nu(r,\theta) &= -q(r) \theta\end{split}\]

GYRO: select gyro_radial_profile_method = 1

CGYRO: select EQUILIBRIUM_MODEL = 1

NEO: select EQUILIBRIUM_MODEL = 0

**(2) Shaped Grad-Shafranov equilibrium**

The flux surfaces, which are local G-S equilibria, have the parameterization:

Here \(c_n\) are anti-symmetric moments and \(s_m\) are symmetric moments. Physically, \(c_0\) is the tilt, \(c_1\) is the ovality, \(s_1=\arcsin[\delta(r)]\) where \(\delta\) is the triangularity, and \(s_2=-\zeta\) where \(\zeta\) is the squareness.

GYRO: select gyro_radial_profile_method = 5 or gyro_radial_profile_method = 3 with gyro_num_equil_flag = 0

CGYRO: select EQUILIBRIUM_MODEL = 2

NEO: select EQUILIBRIUM_MODEL = 2 or PROFILE_EQUILIBRIUM_MODEL = 1

For local simulations, also specify shape parameters. For experimental profiles, shape parameters are auto-generated from profile data.

## Table of geometry parameters¶

Symbol |
input.gyro parameter |
input.cgyro parameter |
input.neo parameter |
Circular (1) |
Shaped (2a) |
Exp. Shaped (2b) |
---|---|---|---|---|---|---|

\(r/a\) |
gyro_radius |
x |
x |
x |
||

\(R_0(r)/a\) |
gyro_aspect_ratio |
x |
x |
C |
||

\(\partial R_0/\partial r\) |
gyro_shift |
x |
C |
|||

\(Z_0(r)/a\) |
gyro_zmag |
x |
C |
|||

\(\partial Z_0/\partial r\) |
gyro_dzmag |
x |
C |
|||

\(q\) |
gyro_safety_factor |
x |
x |
C |
||

\(s\) |
gyro_shear |
x |
x |
C |
||

\(\kappa\) |
gyro_kappa |
x |
C |
|||

\(s_\kappa\) |
gyro_s_kappa |
x |
C |
|||

\(\delta\) |
gyro_delta |
x |
C |
|||

\(s_\delta\) |
gyro_s_delta |
x |
C |
|||

\(\zeta\) |
gyro_zeta |
x |
C |
|||

\(s_\zeta\) |
gyro_s_zeta |
x |
C |
|||

\(c_0\) |
gyro_shape_cos0 |
neo_shape_cos0 |
x |
C |
||

\(s_{c_0}\) |
gyro_shape_s_cos0 |
neo_shape_s_cos0 |
x |
C |
||

\(c_1\) |
gyro_shape_cos1 |
neo_shape_cos1 |
x |
C |
||

\(s_{c_1}\) |
gyro_shape_s_cos1 |
neo_shape_s_cos1 |
x |
C |
||

\(c_2\) |
gyro_shape_cos2 |
neo_shape_cos2 |
x |
C |
||

\(s_{c_2}\) |
gyro_shape_s_cos2 |
neo_shape_s_cos2 |
x |
C |
||

\(c_3\) |
gyro_shape_cos3 |
neo_shape_cos3 |
x |
C |
||

\(s_{c_3}\) |
gyro_shape_s_cos3 |
neo_shape_s_cos3 |
x |
C |
||

\(s_3\) |
gyro_shape_sin3 |
neo_shape_sin3 |
x |
C |
||

\(s_{s_3}\) |
gyro_shape_s_sin3 |
neo_shape_s_sin3 |
x |
C |
||

\(\beta_e\) |
gyro_betae_unit |
NA |
x |
C |
||

\(\beta_*\) scaling |
gyro_betaprime_scale |
x |
x |
x |
||

BTCCW |
gyro_btccw |
x |
x |
C |
||

IPCCW |
gyro_ipccw |
x |
x |
C |

In the table:

x denotes the direct use of the parameter as specified in input.gyro, input.cgyro, input.neo,

C means the parameter is computed from data in input.profiles

D means the parameter is not part of the model and is not used (although the effective value is printed for diagnostic purposes)

For further information about geometry and normalization conventions, consult the GYRO Technical Guide [CB10].

## Magnetic field orientation¶

GACODE uses a right-handed (positively-oriented), field-aligned coordinate system \((r,\theta,\varphi)\), whereas DIII-D uses a (positively-oriented) cylindrical system \((R,\phi,Z)\). Looking down on the tokamak from above, the orientation of the GACODE toroidal angle is clockwise, whereas the DIII-D toroidal angle is counter-clockwise:

In reality, quantities like the safety factor and poloidal flux have definite signs. Historically, these signs have been suppressed or neglected in both theory and modeling. For proper treatment of momentum transport, however, these signs must be retained. We can infer typically neglected signs by knowing IPCCW and BTCCW. For example:

sign(\(B_{\rm tor}\)) = -BTCCW

sign(\(B_{\rm pol}\)) = -IPCCW

sign(\(\psi_{\rm pol}\)) = -IPCCW

sign(\(q\)) = IPCCW \(\times\) BTCCW

The standard configuration in DIII-D is shown below.

This corresponds to IPCCW = 1 and BTCCW =-1. Thus, in GACODE coordinates, we expect:

sign(\(B_{\rm tor}\)) = 1

sign(\(B_{\rm pol}\)) = -1

sign(\(\psi_{\rm pol}\)) = -1

sign(\(q\)) = -1

In other words, the safety factor and poloidal flux are negative in the typical case. This will be reflected in a properly-constructed input.profiles file.