freegs.filament_coil.FilamentCoil#
- class freegs.filament_coil.FilamentCoil(Rfil=None, Zfil=None, shape=None, current=0.0, Nfils=50, turns=1, control=True)[source]#
Bases:
CoilThis class represents a coil broken down into multiple filaments, with each filament acting as a point source of current.
Note: Filaments are wired in parallel, so a the current through a single turn is shared between the filaments.
public members#
R, Z - Location of the coil current - current in each turn of the coil in Amps turns - Number of turns control - enable or disable control system area - Cross-section area in m^2
The total toroidal current carried by the coil is current * turns
- __init__(Rfil=None, Zfil=None, shape=None, current=0.0, Nfils=50, turns=1, control=True)[source]#
Inputs#
- shape:
Outline of the coil shape as a list of points
[(r1,z1), (r2,z2), ...]Must have more than two points. If not provided, plotting the coil may not be entirely accurate.- Rfil, Zfil:
Locations of coil filaments (lists/arrays). This is optional. If these are not provided then the filaments themselves are populated automatically across the cross-section of the coil.
- current :
Current in each turn of the coil in Amps
- Nfils :
Number of filaments. Only used when Rfil is None.
- turns :
Number of turns in point coil(s) block. Total block current is current * turns
- control :
Enable or disable control system.
Note
The number of filaments does not equal the number of turns; each turn of the coil might consist of multiple filaments.
Methods
Br(R, Z)Calculate radial magnetic field Br at (R,Z)
Bz(R, Z)Calculate vertical magnetic field Bz at (R,Z)
__init__([Rfil, Zfil, shape, current, ...])Inputs shape: Outline of the coil shape as a list of points [(r1,z1), (r2,z2), ...] Must have more than two points. If not provided, plotting the coil may not be entirely accurate. Rfil, Zfil: Locations of coil filaments (lists/arrays). This is optional. If these are not provided then the filaments themselves are populated automatically across the cross-section of the coil. current : Current in each turn of the coil in Amps Nfils : Number of filaments. Only used when Rfil is None. turns : Number of turns in point coil(s) block. Total block current is current * turns control : Enable or disable control system.
calcPsiFromGreens(pgreen)Calculate plasma psi from Greens functions and current
controlBr(R, Z)Calculate radial magnetic field Br at (R,Z) due to a unit current
controlBz(R, Z)Calculate axial magnetic field Br at (R,Z) due to a unit current
controlPsi(R, Z)Calculate poloidal flux at (R,Z) due to a unit current
createPsiGreens(R, Z)Calculate the Greens function at every point, and return array.
from_numpy_array(value)getForces(equilibrium)Calculate forces on the coils in Newtons
inShape(polygon)plot([axis, show])Plot the coil points, using axis if given
psi(R, Z)Calculate poloidal flux at (R,Z)
to_numpy_array()Helper method for writing output
Attributes
Major radius of the coil in m
Height of the coil in m
The cross-section area of the coil in m^2
- property R#
Major radius of the coil in m
- property Z#
Height of the coil in m
- property area#
The cross-section area of the coil in m^2
- controlPsi(R, Z)[source]#
Calculate poloidal flux at (R,Z) due to a unit current
Note: This is multiplied by current to get coil Psi
- dtype = dtype([('RZlen', '<i8'), ('R', '<f8', (500,)), ('Z', '<f8', (500,)), ('current', '<f8'), ('turns', '<i8'), ('control', '?'), ('npoints', '<i8')])#