gcmotion.bfield#
Here is a list of the availiable q-factor configurations:
Large Aspect Ratio |
|
(Numerical) SmartPositve |
|
(Numerical) SmartNegative |
|
(Numerical) SmartNegative2 |
|
(Numerical) DTTPositive |
|
(Numerical) DTTNegative |
Their parameters are documented below.
Examples
Creating an analytic Magnetic Field
>>> import gcmotion as gcm
>>>
>>> # Quantity Constructor
>>> Rnum = 1.6
>>> anum = 0.5
>>> B0num = 1
>>> species = "p"
>>> Q = gcm.QuantityConstructor(R=Rnum, a=anum, B0=B0num, species=species)
>>>
>>> # Intermediate values
>>> B0 = Q(B0num, "Tesla")
>>> i = Q(0, "NUPlasma_current")
>>> g = Q(1, "NUPlasma_current")
>>>
>>> # A magnetic field
>>> bfield = gcm.bfield.LAR(B0=B0, i=i, g=g)
Creating a numerical Magneticfield. Use the respective Initializer to grab the normalization constants from the dataset automatically. See Initializers
>>> import gcmotion as gcm
>>>
>>> # Quantity Constructor
>>> species = "p"
>>> smart_init = gcm.SmartNegativeInit(species)
>>> Q = smart_init.QuantityConstructor()
>>>
>>> # Intermediate Quantities
>>> R = smart_init.R
>>> a = smart_init.a
>>> B0 = smart_init.B0
>>>
>>> bfield=gcm.bfield.SmartNegative(),
Methods#
The functions bigNU and solverbNU work identically in every class, so I list their methods here.
Available magnetic fields#
LAR
- class gcmotion.bfield.LAR(B0: Quantity, i: Quantity, g: Quantity)#
Initializes the standard Large Aspect Ratio magnetic field.
- Parameters:
- B0Quantity
The strength of the magnetic field on the magnetic axis in [T].
- iQuantity
The toroidal current in units of [Plasma Current].
- gQuantity
The poloidal current in units of [Plasma Current].
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).
SmartPositive
- class gcmotion.bfield.SmartPositive#
Initializes a bfield object with numerical data from the Smart Tokamak with Positive Triangularity.
The dataset must be stored in ./gcmotion/tokamak/reconstructed/smart_positive.nc.
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).
SmartNegative
- class gcmotion.bfield.SmartNegative#
Initializes a bfield object with numerical data from the Smart Tokamak with Negative Triangularity.
The dataset must be stored in ./gcmotion/tokamak/reconstructed/smart_negative.nc.
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).
SmartNegative2
- class gcmotion.bfield.SmartNegative2#
Initializes a bfield object with numerical data from the Smart Tokamak with Negative Triangularity.
The dataset must be stored in ./gcmotion/tokamak/reconstructed/smart_negative.nc.
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).
DTTPositive
- class gcmotion.bfield.DTTPositive#
Initializes a bfield object with numerical data from the Divertor Test Tokamak with Positive Triangularity..
The dataset must be stored in ./gcmotion/tokamak/reconstructed/dtt_positive.nc.
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).
DTTNegative
- class gcmotion.bfield.DTTNegative#
Initializes a bfield object with numerical data from the Divertor Test Tokamak with Negative Triangularity.
The dataset must be stored in ./gcmotion/tokamak/reconstructed/dtt_negative.nc.
Methods
bigNU
(psi, theta)Calculates \(B(\psi, \theta), I(\psi, \theta), g(\psi,\ \theta)\).
solverbNU
(psi, theta)Calculates all the values needed by the solver: \(B,I,g\) (by calling
self.bigNU()
) and the derivatives \(\dfrac{\partial B}{\partial \psi}, \dfrac{\partial B}{\partial\ \theta}\ \dfrac{\partial I}{\partial \psi}\) and \(\dfrac{\partial\ g}{\partial \psi}\).