Eqdsk File

0 views
Skip to first unread message

Lauren Redder

unread,
Aug 5, 2024, 4:01:08 AM8/5/24
to pramibbrocpet
Astandard format for storing tokamak equilibrium data is G-EQDSKwhich contains the poloidal flux in (R,Z) and 1D profiles of pressure, , safety factor q,and other quantities related to the Grad-Shafranov solution. The G-EQDSK format does not however have a standardfor specifying the location of, and currents in, the poloidal field coils. This makes writing G-EQDSK files quitestraightforward, but reading them more challenging, as these coil currents must be inferred.

The implementation of the file input and output is divided into a high level interface in freegs.geqdsk and a low level interface in freegs._geqdsk. The high level interface handles Equilibrium objects, whilst the low level interface handlessimple dictionaries.


This is complicated by the need to infer the currents in the coils. To do this the locations of the coils need to be specified. An example is 02-read-geqdsk.py which reads a file produced by 01-freeboundary.py. First create a machine object which specifies the location of the coils


A feedback control system is used to keep the plasma boundary and X-point locations fixed whilst adjusting the coil currents.If additional information about coil currents is available, then this can be used to fix some or all of the coil currents.


eqtools is a Python package for working with magnetic equilibrium reconstructions from magnetic plasma confinement devices. At present, interfaces exist for data from the Alcator C-Mod and NSTX MDSplus trees as well as eqdsk a- and g-files. eqtools is designed to be flexible and extensible such that it can become a uniform interface to perform mapping operations and accessing equilibrium data for any magnetic confinement device, regardless of how the data are accessed.


The main class of eqtools is the Equilibrium, which contains all of the coordinate mapping functions as well as templates for methods to fetch data (primarily dictated to the quantities computed by EFIT). Subclasses such as EFITTree, CModEFITTree, NSTXEFITTree and EqdskReader implement specific methods to access the data and convert it to the form needed for the routines in Equilibrium. These classes are smart about caching intermediate results, so you will get a performance boost by using the same instance throughout your analysis of a given shot.


The basic class for manipulating EFIT results stored in the Alcator C-Mod MDSplus tree is CModEFITTree. To load the data from a specific shot, simply create the CModEFITTree object with the shot number as the argument:


Once this is loaded, you can access the data you would normally have to pull from specific nodes in the tree using convenient getter methods. For instance, to get the elongation as a function of time, you can run:


For length/area/volume quantities, eqtools understands units. The default is to return in whatever units you specified when creating the CModEFITTree, but you can override this with the length_unit keyword. For instance, to get the vertical position of the magnetic axis in mm, you can run:


eqtools can map from almost any coordinate to any common flux surface label. For instance, say you want to know what the square root of normalized toroidal flux corresponding to a normalized flux surface volume of 0.5 is at t=1.0s. You can simply call:


If a list of times is provided, the default behavior is to evaluate all of the points to be converted at each of the times. So, to follow the mapping of normalized poloidal flux values [0.1, 0.5, 1.0] to outboard midplane major radius at time points [1.0, 1.25, 1.5, 1.75], you could call:


This will return a 4-by-3 array: one row for each time, one column for each location. If you want to override this behavior and instead consider a sequence of (psi, t) points, set the each_t keyword to False:

3a8082e126
Reply all
Reply to author
Forward
0 new messages