Inputs
The T3D input file
The T3D input file is parsed with toml. Input file names should be suffixed with .in, such as example.in. Such an input file can be run via
t3d example.in
Example input files can be found in the Getting started with T3D pages, and in the tests/regression directory in the T3D repository.
A typical input file will be of the form
[grid]
N_radial = 9
...
[time]
...
...
All parameters belong to particular groups, e.g. [grid] or [time], etc.
In the following we describe each possible input parameter in each group. In practice, many of these parameters can be left unspecified so that default values are used.
grid
The [grid] group controls the radial grid used for the calculation, as well as the choice of radial coordinate.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
The number of radial grid points where profiles (e.g. density, temperature) will be evolved. |
10 |
|
|
Choice of radial coordinate (rho). Can be either ‘torflux’ (rho = sqrt(toroidal_flux/toroidal_flux_LCFS)) or ‘rminor’ (rho = r/a, the normalized minor radius). |
‘torflux’ |
|
|
Largest value of rho on the grid. |
0.8 |
|
|
Smallest value of rho on the grid (currently not available as an input). |
\(\texttt{rho_edge}/(2\,\texttt{N_radial}-1)\) |
time
The [time] group contains parameters pertaining to the timestepping and Newton iteration.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
The initial timestep size. |
0.5 |
|
|
End time. Use this or |
1000 |
|
|
Number of timesteps. Use this or |
1000 |
|
|
Implicitness parameter (1.0 -> fully implicit, 0.0 -> fully explicit) |
1.0 |
|
|
Maximum number of Newton iterations |
4 |
|
|
Stop Newton iteration when rms_err < |
0.02 |
|
|
Allow advance to next timestep if rms_err < |
0.1 |
|
|
Adjustment factor when decreasing timestep, so that dtau_new = dtau_old/ |
2.0 |
|
|
Increase timestep by factor of 2 if rms_err < |
|
|
|
The maximum allowable timestep size. |
10.0 |
model
The [[model]] group controls the models used to compute fluxes (e.g. turbulence models, neoclassical models, etc). Note that the double square bracket denotes an array in toml, so that multiple [[model]] blocks can be used. Fluxes from different models will be summed (e.g. Q_tot = Q_turb + Q_neo).
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Name of the flux model. See Flux Models for options. |
“GX” |
Each model has additional parameters that can/should be specified. See the section corresponding to each model in Flux Models.
species
The [[species]] group controls the plasma species in the calculation. Note that the double square bracket denotes an array in toml, so that multiple [[species]] blocks can be used, one for each species.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Name of the plasma species. Can be arbitrary, but “electron”, “hydrogen”, “deuterium”, “tritium”, “boron”, “carbon” have default values for charge, mass, etc. |
“deuterium” |
|
|
Mass of species in units of proton mass. If |
Smart default or None |
|
|
Charge of species in units of electron charge. If |
Smart default or None |
|
|
Treat species as adiabatic in turbulence and/or neoclassical calculations. |
False |
|
|
Treat species as adiabatic in turbulence and/or neoclassical calculations. |
False |
|
|
Use species as reference species for normalizations in some flux models. Should be specified |
First ion species listed |
|
|
Use species as bulk species. Should be specified |
First ion species listed |
|
|
Short name for species, to be used in diagnostic output, e.g. “e” for |
Smart default or |
|
|
Table controlling density initialization and evolution. See |
{} |
|
|
Evolve the density in time. |
True |
|
|
Initialize the density equal to some fraction of the density of another species, but allow profiles evolve independently after initialization. This can be either a string corresponding to a species, e.g. |
|
|
|
Initialize and maintain (as profiles evolve) the density equal to some fraction of the density of another species. This can be either a string corresponding to a species, e.g. |
|
|
|
Shape of initial density profile. Options are |
‘parabolic’ |
|
|
For |
4 |
|
|
For |
|
|
|
For |
|
|
|
For |
0.5 |
|
|
For |
|
|
|
For |
1 |
|
|
For |
2 |
|
|
For |
[0, 0, 0, 0] |
|
|
Import initial density profile from external file. |
False |
|
|
Key (string) corresponding to density for import. |
|
|
|
For |
|
|
|
Table controlling temperature initialization and evolution. See |
{} |
|
|
Evolve the temperature in time. |
True |
|
|
Initialize the temperature equal to some fraction of the temperature of another species, but allow profiles evolve independently after initialization. This can be either a string corresponding to a species, e.g. |
|
|
|
Initialize and maintain (as profiles evolve) the temperature equal to some fraction of the temperature of another species. This can be either a string corresponding to a species, e.g. |
|
|
|
Shape of initial temperature profile. Options are |
‘parabolic’ |
|
|
For |
4 |
|
|
For |
|
|
|
For |
|
|
|
For |
0.5 |
|
|
For |
|
|
|
For |
1 |
|
|
For |
2 |
|
|
For |
[0, 0, 0, 0] |
|
|
Import initial temperature profile from external file. |
False |
|
|
Key (string) corresponding to temperature for import. |
|
|
|
For |
|
|
|
Table controlling the auxiliary particle source. See |
{} |
|
|
Shape of aux particle source. Options are |
‘gaussian’ |
|
|
For |
0 |
|
|
For |
|
|
|
For |
0.1 |
|
|
For |
0 |
|
|
Table controlling the auxiliary power source. See |
{} |
|
|
Shape of aux power source. Options are |
‘gaussian’ |
|
|
For |
0 |
|
|
For |
|
|
|
For |
0.1 |
|
|
For |
0 |
Note that since quasineutrality must be satisfied, the density of the last ion species listed in the input file will be set by quasineutrality (throughout the T3D simulation). This will effectively override parameters in the density table of that species if they were specified.
geometry
The [geometry] group controls the (tokamak or stellarator) geometry used in the calculation.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Type of geometry to use. Options are |
|
|
|
Geometry file to generate geometry from. For |
|
|
|
Import geometry from file specified in [import]. Typically this only used for |
Note that there are some requirements for the various options:
geo_option = 'vmec'requiresflux_label = 'torflux'(in[grid]).geo_option = 'geqdsk'currently requires that GX be used for the flux model.geo_option = 'miller'requiresflux_label = 'rminor'andimport = true.
rescale
The [rescale] group allows one to change the magnetic field or size of a device that is represented by a VMEC output file.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Choose a radius to be specified. Options are |
|
|
|
If L_def = |
L_mult |
|
|
If L_def = |
L_mult |
|
|
Multiply all linear lengths by L_mult (float). |
1.0 |
|
|
Choose a definition of the magnetic field to be targeted. Options are |
|
|
|
If B_def = |
0 |
|
|
If B_def = |
B_mult |
|
|
If B_def = |
B_mult |
|
|
Multiply the magnetic field by B_mult (float). |
1.0 |
physics
The [physics] group controls various physics knobs for the calculation.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Include collisional equilibration between species. |
True |
|
|
Include alpha heating. |
True |
|
|
For alpha heating: if only deuterium ion species is present, assumes a fraction |
0.5 |
|
|
Include radiation of impurity species if they are present. Includes line, bremsstrahlung, recombination. |
False |
|
|
Include only bremsstrahlung radiation, based on :math: |
False |
|
|
Specify Zeff as a constant or as a table (table specification follows e.g. density table specification in |
False |
|
|
Include turbulent exchange terms in pressure equation. |
False |
import
The [import] group controls data that is imported from external files of various formats:
type = 'trinity'allows importing from an existing T3D .npy, .bp, or .nc output file
type = 'columns'allows importing from a text file with data in columns
type = 'transp'allows importing from a TRANSP-style u-file
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Type of import. Options are: |
|
|
|
File to import |
‘’ |
|
|
For |
-1 |
|
|
For |
[] |
|
|
For |
[] |
|
|
For |
0.0 |
log
The [log] group controls the output format. T3D will output a python pickle file which can be used for plotting but is also used as a restart file. T3D output data can also be written in NetCDF4 or ADIOS2 format.
Group |
Variable |
Description |
Default |
|---|---|---|---|
|
|
Write T3D output in NetCDF4 format |
False |
|
|
Write T3D output in ADIOS2 format |
True |
|
|
Execute write every N steps |
1 |