@MagneticField¶
The magnetic field module defines a magnetic field and domain (walls) to use in the simulation. For setting up a quick simulation, the analytical magnetic field can be used to generate a magnetic field with circular flux surfaces. For more advanced applications, SOFT2 is able to take numeric 2D magnetic fields as input.
The type of the magnetic field to load is specified as a secondary type of the
block (i.e. in parenthesis after the block name). At the moment, two different
types of magnetic fields are available: analytical
and numeric
.
More details about the magnetic field in SOFT2 can be found on the page Magnetic fields.
Relating safety factor and current profile¶
The safety factor type current
has been derived from the current density
where \(j_0\) is the central current density and \(r_0\) is the plasma radius (see Magnetic fields for details about the notation). The corresponding safety factor is
From this, the plasma current \(I\) can be related to the central safety factor \(q_0\equiv q(0)\):
or conversely
where \(\mu_0\approx 4\pi\times 10^{-7}\,\text{H/m}\) is the vacuum permeability. With \(B_0\), \(\mu_0\), \(R_{\rm m}\) and \(r_0\) in SI units, and the total plasma current in mega-ampere, the central safety factor can be computed from
Summary of options¶
Option | Type | Description |
analytical B0 |
analytical | Magnetic field strength (on-axis) of analytical magnetic field |
analytical Rm |
analytical | Major radius of analytical magnetic field |
analytical zm |
analytical | Vertical position of magnetic axis |
analytical rminor |
analytical | Minor radius of analytical magnetic field |
analytical sigmaB |
analytical | Toroidal field direction of analytical magnetic field |
analytical sigmaI |
analytical | Current direction of analytical magnetic field |
analytical qtype |
analytical | Safety factor type: current , constant , linear , qudratic or exponential |
analytical qa1 |
analytical | First safety factor parameter of analytical magnetic field |
analytical qa2 |
analytical | Second safety factor parameter of analytical magnetic field |
numeric filename |
numeric | Name of file containing numeric magnetic field |
numeric filetype |
numeric | Override filetype of file containing numeric magnetic field |
Example configuration¶
The following defines an analytical magnetic field, similar to Alcator C-Mod:
magnetic_field = analytical-field;
@MagneticField analytical-field (analytical) {
B0 = 5.0;
Rm = 0.68;
rminor = 0.22;
qtype = quadratic;
qa1 = 3.0;
qa2 = 1.0;
}
An example of a numeric magnetic field:
magnetic_field = numeric-field;
@MagneticField numeric-field (numeric) {
filename = "/path/to/magnetic-field.mat";
# SOFT will automatically identify the
# above file as a 'MAT' file, due to its
# '.mat' filename extension.
}
Common settings¶
analytical¶
-
B0
¶
Default value: None Allowed values: Any positive real number The magnetic field strength on-axis (in Tesla).
-
Rm
¶
Default value: None Allowed values: Any positive real number (greater than analytical rminor
)The tokamak major radius (in meters).
-
zm
¶
Default value: 0
Allowed values: Any real number The vertical position of the magnetic axis.
-
rminor
¶
Default value: None Allowed values: Any positive real number (less than analytical Rm
)The tokamak minor radius (in meters).
-
sigmaB
¶
-
sigmaI
¶
Default value: cw
Allowed values: cw
/-
, orccw
/+
Sign of the toroidal field component (
sigmaB
) and plasma current (sigmaI
). The valuecw
corresponds to the toroidal component being oriented in the clock-wise direction, when seen from above the tokamak, whileccw
corresponds to the toroidal component being oriented in the counter clock-wise direction, when seen from above.Instead of specifying the direction, the sign may be given directly as either
-
(clock-wise) or+
(counter clock-wise).
-
qa1
¶
-
qa2
¶
Default value: 1.0 Allowed values: Any real number Constants used to define the safety factor. See
analytical qtype
for details about how exactly they affect the different safety factor.
-
qtype
¶
Default value: None Allowed values: constant
,exponential
,linear
,quadratic
Specifies the radial dependence of the safety factor. The functional forms for the various options are given in terms of the normalized minor radius \(a\) (normalized to the value of
rminor
) in the table below. The constants \(q_{a1}\) and \(q_{a2}\) are specified using theanalytical qa1
andanalytical qa2
options.qtype Functional form current \(q(a) = q_{a1}/\left( 1-\frac{2}{n+2}a^{q_{a2}} \right)\) constant \(q(a) = q_{a1}\) linear \(q(a) = q_{a1} a + q_{a2}\) quadratic \(q(a) = q_{a1} a^2 + q_{a2}\) exponential \(q(a) = e^{q_{a1}} + q_{a2}\)
numeric¶
-
filename
¶
Default value: None Allowed values: String Specifies the name of the file that contains the magnetic field to load.
-
filetype
¶
Default value: Auto-determine filetype based on filename Allowed values: h5
,hdf5
,mat
,out
,sdt
Overrides the filetype of the given file. Usually SOFT tries to determine which filetype a given file is of based on its filename extension. By explicitly setting this option, this check is overriden allows you to use non-standard filename extensions for the input file.