CGYRO

Brief description

CGYRO is a global-spectral gyrokinetic code.

Core developers

Notable publications

Table 3 List of CGYRO algorithm publications

Title

Link

A high-accuracy Eulerian gyrokinetic solver for collisional plasmas

[CBB16]

Implications of advanced collision operators for gyrokinetic simulation

[BC17]

Spectral treatment of gyrokinetic shear flow

[CB18]

Spectral treatment of gyrokinetic profile curvature

[CBS20]

Paradigm for global gyrokinetic turbulence

[CDB25]

Table 4 List of CGYRO performance optimization publications

Title

Link

Multiscale-optimized plasma turbulence simulation on petascale architechtures

[CSB+19]

Comparing single-node and multi-node performance of an important fusion HPC code benchmark

[BCSWurthwein22]

Optimization and portability of a fusion OpenACC-based HPC code from NVIDIA to AMD GPUs

[SBCB23]

GitHub source repository

Released under Apache2 license:

$ git clone git@github.com:gafusion/gacode.git

Input parameters

Normalization

Table 5 CGYRO Normalization

Quantity

Unit

Description

length

a

minor radius

mass

mD

deuterium mass = 3.345×1024g

density

ne

electron density

temperature

Te

electron temperature

velocity

cs=Te/mD

deuterium sound speed

time

a/cs

minor radius over sound speed

Tabular list

Table 6 Plasma shape/geometry

input.cgyro parameter

Short description

Default

EQUILIBRIUM_MODEL

Geometry model selector

2

RMIN

Normalized minor radius

0.5

RMAJ

Normalized major radius

3.0

SHIFT

Shafranov shift

0.0

KAPPA

Elongation

1.0

S_KAPPA

Elongation shear

0.0

DELTA

Triangularity

0.0

S_DELTA

Triangularity shear

0.0

ZETA

Squareness

0.0

S_ZETA

Squareness shear

0.0

ZMAG

Elevation

0.0

DZMAG

Gradient of elevation

0.0

Q

Safety factor

2.0

S

Magnetic shear

1.0

BTCCW

Field orientation

-1.0

IPCCW

Current orientation

-1.0

UDSYMMETRY_FLAG

Enforce up-down symmetry

1

Table 7 Advanced shape parameters

input.cgyro parameter

Short description

Default

SHAPE_COS0

Tilt

0.0

SHAPE_S_COS0

Tilt shear

0.0

SHAPE_COS1

Ovality

0.0

SHAPE_S_COS1

Ovality shear

0.0

SHAPE_COS2

2nd antisymmetric moment

0.0

SHAPE_S_COS2

2nd antisymmetric moment shear

0.0

SHAPE_COS3

3rd antisymmetric moment

0.0

SHAPE_S_COS3

3rd antisymmetric moment shear

0.0

SHAPE_SIN3

3rd symmetric moment

0.0

SHAPE_S_SIN3

3rd symmetric moment shear

0.0

Table 8 Control parameters

input.cgyro parameter

Short description

Default

PROFILE_MODEL

Profile input selector

1

QUASINEUTRAL_FLAG

Toggle quasineutrality

1

NONLINEAR_FLAG

Toggle nonlinear simulation

0

ZF_TEST_MODE

Control zonal flow testing

0

SILENT_FLAG

Toggle silent output

0

AMP

Initial n>0 amplitude

0.1

AMP0

Initial n=0 amplitude

0.0

Table 9 Fields

input.cgyro parameter

Short description

Default

N_FIELD

Number of fields to evolve

1

BETAE_UNIT

Electron beta

0.0

BETAE_UNIT_SCALE

Electron beta scaling parameter

0.0

BETA_STAR_SCALE

Pressure gradient scaling factor

1.0

LAMBDA_DEBYE

Debye length

0.0

LAMBDA_DEBYE_SCALE

Debye length scaling factor

0.0

Table 10 Numerical Resolution

input.cgyro parameter

Short description

Default

N_RADIAL

Number of radial kx0 wavenumbers

4

BOX_SIZE

Radial domain size

1

N_TOROIDAL

Number of binormal ky wavenumbers

1

KY

Binormal wavenumber or domain size

0.3

N_THETA

Number of poloidal θ gridpoints

24

N_XI

Number of pitch angle ξ gridpoints

16

N_ENERGY

Number of energy u gridpoints

8

E_MAX

Maximum energy

8.0

NL_SINGLE_FLAG

Use FP64 or FP32 math for nonlinear term

0

Table 11 Numerical Dissipation

input.cgyro parameter

Short description

Default

UP_RADIAL

Radial spectral upwind scaling

1.0

UP_THETA

Poloidal upwind scaling

1.0

UP_ALPHA

Binormal spectral upwind scaling

0.0

NUP_RADIAL

Radial spectral upwind order

3

NUP_THETA

Poloidal upwind order

3

NUP_ALPHA

Binormal spectral upwind order

3

UPWIND_SINGLE_FLAG

Use reduced precision communication

0

Table 12 Time Stepping

input.cgyro parameter

Short description

Default

DELTA_T_METHOD

Time integrator selection

0

DELTA_T

Time step

0.01

ERROR_TOL

Error tolerance

1e-4

MAX_TIME

Simulation time

1.0

FREQ_TOL

Error tolerance for frequency

0.001

PRINT_STEP

Data output interval

100

RESTART_STEP

Restart data output interval

10

Table 13 Species-related parameters

input.cgyro parameter

Short description

Default

N_SPECIES

Number of GK species (ions plus electrons)

1

Z_*

Species charge

1

MASS_*

Species mass

1.0

DENS_*

Species density

1.0

TEMP_*

Species temperature

1.0

DLNNDR_*

Species density gradient

1.0

DLNTDR_*

Species temperature gradient

1.0

Table 14 Collisions

input.cgyro parameter

Short description

Default

NU_EE

Electron-electron collision frequency

0.1

COLLISION_MODEL

Collision model selector

4

COLLISION_FIELD_MODEL

Toggle self-consistent field update

1

COLLISION_MOM_RESTORE

Toggle momentum conservation

1

COLLISION_ENE_RESTORE

Toggle energy conservation

1

COLLISION_ENE_DIFFUSION

Toggle energy diffusion

1

COLLISION_KPERP

Toggle so-called FLR term

0

COLLISION_PRECISION_MODE

Reduce Sugama memory use

0

Table 15 Rotation physics

input.cgyro parameter

Short description

Default

ROTATION_MODEL

Rotation model selector

1

GAMMA_E

Dopper shearing rate (E×B shear)

0.0

GAMMA_P

Rotation shearing rate

0.0

MACH

Rotation speed (Mach number)

0.0

GAMMA_E_SCALE

Doppler shearing rate scaling factor

1.0

GAMMA_P_SCALE

Rotation shearing rate scaling factor

1.0

MACH_SCALE

Rotation speed scaling factor

1.0

Table 16 Global-spectral parameters

input.cgyro parameter

Short description

Default

N_GLOBAL

Global output resolution

4

NU_GLOBAL

Source rate

15.0

Table 17 Output file control

input.cgyro parameter

Short description

Default

FIELD_PRINT_FLAG

Output of electromagnetic field components

0

MOMENT_PRINT_FLAG

Output of density and energy moments

0

GFLUX_PRINT_FLAG

Output of global flux profiles

0

H_PRINT_FLAG

Output of distribution (single-mode only)

0

Table 18 Optimization related parameters

input.cgyro parameter

Short description

Default

TOROIDALS_PER_PROC

How many toroidal harmonics per MPI process

1

COLLISION_PRECISION_MODE

Use FP64 or FP32 constants for the cmat constants

0

NL_SINGLE_FLAG

Use FP64 or FP32 math for nonlinear term

0

MPI_RANK_ORDER

Relative ordering of MPI ranks

2

VELOCITY_ORDER

What internal velocity order to use

1

GPU_BIGMEM_FLAG

Enable GPU offload when possible

1

Output data

Files

It is not recommended to read these files directly. Rather, we encourage the use of the CGYRO python data interface.

Table 19 Time-independent output

Filename

Short description

out.cgyro.egrid

Energy mesh and various weights

out.cgyro.equilibrium

Physics input data

out.cgyro.grids

Mesh dimensions and coordinates

out.cgyro.hosts

MPI ranks and hostnames

out.cgyro.info

Human-readable description of simulation

out.cgyro.memory

Memory usage statistics

out.cgyro.mpi

Recommendations for choosing MPI tasks and OMP threads

out.cgyro.version

Version information and timestamp for simulation

bin.cgyro.geo

GK equation coefficients versus θ

Table 20 Common time-dependent output

Filename

Short description

Switch

out.cgyro.time

Time and error vector

out.cgyro.timing

Kernel timer data

bin.cgyro.freq

Mode frequency vector

bin.cgyro.kxky_phi

δϕ(kx0,ky,t)

bin.cgyro.kxky_apar

δA(kx0,ky,t)

FIELD_PRINT_FLAG = 1

bin.cgyro.kxky_bpar

δB(kx0,ky,t)

FIELD_PRINT_FLAG = 1

bin.cgyro.kxky_n

δna(kx0,ky,t)

MOMENT_PRINT_FLAG = 1

bin.cgyro.kxky_e

δEa(kx0,ky,t)

MOMENT_PRINT_FLAG = 1

bin.cgyro.kxky_v

δva(kx0,ky,t)

MOMENT_PRINT_FLAG = 1

bin.cgyro.ky_flux

Γa,Πa,Qa versus (ky,t)

bin.cgyro.ky_cflux

Γa,Πa,Qa (half domain) versus (ky,t)

Table 21 Restart data

Filename

Short description

out.cgyro.tag

Restart tag file (contains time index and value)

bin.cgyro.restart

Binary restart file

Normalization

Ion sound gyroradius

ρs,unit=cseBunit/(mDc)

Ion sound speed

cs=Te/mD

gyroBohm particle flux

ΓGB=necs(ρs,unit/a)2

gyroBohm momentum flux

ΠGB=neaTe(ρs,unit/a)2

gyroBohm energy flux

QGB=necsTe(ρs,unit/a)2

Python interface

It is suggested that users use the python interface to read CGYRO output data.

Simulation images

Simulation data courtesy Nathan Howard (MIT)

b250 b990 b1020 b1480

FAQ

What is kyρs and why does CGYRO modify ρs ?

How does adaptive time-stepping work?

Why did you start over with CGYRO?

How do you run a simple linear case?

How do I run a pre-existing template case?

How do I submit a batch job?