3. Inputs

3.1. Magnetic equilibrium

The magnetic equilibrium should be provided in the form of a geqdsk file (note the link requires a GA account to access). The data in the file should use COCOS-1 conventions.

The geqdsk file provides the poloidal magnetic flux function \(\psi\) (which is the poloidal magnetic flux divided by \(2\pi\)), and \(f_\mathrm{pol}\) that determines the toroidal magnetic field as \(B_\mathrm{toroidal} = f_\mathrm{pol}(\psi)\nabla\zeta\) where \(\zeta\) is the toroidal angle (\(f_\mathrm{pol}(psi)\) is sometimes written as \(I(\psi)\)).

The geqdsk file may also contain a set of points that describe the wall of the tokamak. Only a contour in the poloidal plane can be represented, so 3d features of the wall cannot be included, consistent with hypnotoad generating a toroidally-symmetric grid. The wall contour is only used by hypnotoad at the divertor targets, so the detail of the wall shape elsewhere is not important.

The geqdsk file is passed as the first argument to the command line program hypnotoad-geqdsk, or when using hypnotoad-gui is entered in the ‘geqdsk file’ box near the bottom of the window.

The geqdsk file used to create a grid file is saved in the grid file for provenance tracking. It can be conveniently extracted from the grid file with the hypnotoad-recreate-inputs program.

3.2. Settings

Grid generation is controlled by settings, saved in a YAML file. The settings can be conveniently edited by using hypnotoad-gui which can load (using the ‘Options file’ box near the bottom of the window) and save (using the ‘File’ dialog menu or the buttons near the top of the screen) the settings to/from YAML files. hypnotoad-gui provides an interactive interface where default values are displayed (and defaults that depend on other settings are updated), with tool-tips showing help text appearing if you hover the cursor over each setting.

When generating a grid on the command line, the settings file is passed as the second argument to hypnotoad-geqdsk.

Relevant options will be described in the following sections. A complete list of the options for both orthogonal and nonorthogonal grids is here: Tokamak options. Options that only apply to nonorthogonal grids are listed here: Nonorthogonal options. Some other options used to set tolerances, etc. for the grid generation process are here: Mesh options.

All the settings used for grid generation are saved (with all defaults evaluated) in YAML format in the grid file for provenance tracking. They can be conveniently extracted as a YAML file from the grid file with the hypnotoad-recreate-inputs program.