# 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

$\mathbf{B} =\nabla \alpha \times \nabla \psi (r) \; ,$

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

$\alpha =\varphi +\nu (r,\theta )$

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.

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:

$r \doteq \frac{R_{+}-R_{-}}{2} \; .$

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

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:

$R_{0}=\frac{R_{+}+R_{-}}{2} \; .$

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

$B_\mathrm{unit} = \frac{1}{r} \frac{d\chi _{t}}{dr} \; ,$

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}$

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

$\begin{split}R(r,\theta) &= R_0(r) + r \cos \left[\theta + \sum_n c_n(r) \cos(n \theta) + \sum_m s_m(r) \sin(m \theta) \right] \\ Z(r,\theta) &= Z_0(r) + \kappa(r) r \sin \theta \\ \nu(r,\theta) & \rm{\;is\; computed \;numerically}\end{split}$
• 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$$

RMIN

RMIN_OVER_A

x

x

x

$$R_0(r)/a$$

gyro_aspect_ratio

RMAJ

RMAJ_OVER_A

x

x

C

$$\partial R_0/\partial r$$

gyro_shift

SHIFT

SHIFT

x

C

$$Z_0(r)/a$$

gyro_zmag

ZMAG

ZMAG_OVER_A

x

C

$$\partial Z_0/\partial r$$

gyro_dzmag

DZMAG

S_ZMAG

x

C

$$q$$

gyro_safety_factor

Q

Q

x

x

C

$$s$$

gyro_shear

S

SHEAR

x

x

C

$$\kappa$$

gyro_kappa

KAPPA

KAPPA

x

C

$$s_\kappa$$

gyro_s_kappa

S_KAPPA

S_KAPPA

x

C

$$\delta$$

gyro_delta

DELTA

DELTA

x

C

$$s_\delta$$

gyro_s_delta

S_DELTA

S_DELTA

x

C

$$\zeta$$

gyro_zeta

ZETA

ZETA

x

C

$$s_\zeta$$

gyro_s_zeta

S_ZETA

S_ZETA

x

C

$$c_0$$

gyro_shape_cos0

SHAPE_COS0

neo_shape_cos0

x

C

$$s_{c_0}$$

gyro_shape_s_cos0

SHAPE_S_COS0

neo_shape_s_cos0

x

C

$$c_1$$

gyro_shape_cos1

SHAPE_COS1

neo_shape_cos1

x

C

$$s_{c_1}$$

gyro_shape_s_cos1

SHAPE_S_COS1

neo_shape_s_cos1

x

C

$$c_2$$

gyro_shape_cos2

SHAPE_COS2

neo_shape_cos2

x

C

$$s_{c_2}$$

gyro_shape_s_cos2

SHAPE_S_COS2

neo_shape_s_cos2

x

C

$$c_3$$

gyro_shape_cos3

SHAPE_COS3

neo_shape_cos3

x

C

$$s_{c_3}$$

gyro_shape_s_cos3

SHAPE_S_COS3

neo_shape_s_cos3

x

C

$$s_3$$

gyro_shape_sin3

SHAPE_SIN3

neo_shape_sin3

x

C

$$s_{s_3}$$

gyro_shape_s_sin3

SHAPE_S_SIN3

neo_shape_s_sin3

x

C

$$\beta_e$$

gyro_betae_unit

BETAE_UNIT

NA

x

C

$$\beta_*$$ scaling

gyro_betaprime_scale

BETA_STAR_SCALE

BETA_STAR

x

x

x

BTCCW

gyro_btccw

BTCCW

BTCCW

x

x

C

IPCCW

gyro_ipccw

IPCCW

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.