freegs.pre_calc_coil.PreCalcCoil#
- class freegs.pre_calc_coil.PreCalcCoil(shape, Rgrid, Zgrid, mapBr, mapBz, mapPsi, current=0.0, turns=1, control=True)[source]#
Bases:
CoilThis class represents a coil whose Green’s functions have already been calculated by some external code. This is useful in modelling coils whose internal structure may be complex and whose current distribution may be highly non-uniform.
The user needs to supply information on the R,Z grids that the Green’s functions have been pre-calculated on, as well as the Br, Bz and psi data on said R,Z grid.
public members#
R, Z - Location of the coil current - current in 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__(shape, Rgrid, Zgrid, mapBr, mapBz, mapPsi, current=0.0, 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
Rgrid - 1D array of R coords that maps are calculated on. Zgrid - 1D array of Z coords that maps are calculated on. mapBr - 1D array of Br calculated on Rgrid,Zgrid for the coil @ 1A-turn. mapBz - 1D array of Bz calculated on Rgrid,Zgrid for the coil @ 1A-turn. mapPsi - 1D array of Psi calculated on Rgrid,Zgrid for the coil @ 1A-turn. current - The current in the circuit. The total current is current * turns. turns - Number of turns in point coil(s) block. Total block current is current * turns. control - Enable or disable control system.
Methods
Br(R, Z)Calculate radial magnetic field Br at (R,Z)
Bz(R, Z)Calculate vertical magnetic field Bz at (R,Z)
__init__(shape, Rgrid, Zgrid, mapBr, mapBz, ...)Inputs shape - outline of the coil shape as a list of points [(r1,z1), (r2,z2), ...] Must have more than two points
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 vertical 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 shape, using axis if given
psi(R, Z)Calculate poloidal flux at (R,Z)
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
- dtype = dtype([('RZlen', '<i8'), ('R', '<f8', (10,)), ('Z', '<f8', (10,)), ('current', '<f8'), ('turns', '<i8'), ('control', '?')])#