diff --git a/freegs/shaped_coil.py b/freegs/shaped_coil.py index d5777c0..33470ce 100644 --- a/freegs/shaped_coil.py +++ b/freegs/shaped_coil.py @@ -93,12 +93,13 @@ def __init__(self, shape, current=0.0, turns=1, control=True, npoints=6): def controlPsi(self, R, Z): """ - Calculate poloidal flux at (R,Z) due to a unit current + Calculate poloidal flux at (R,Z) due to a unit current in the circuit """ result = 0.0 for R_fil, Z_fil, weight in self._points: result += Greens(R_fil, Z_fil, R, Z) * weight - return result + # Multiply by turns so that toroidal current is current * turns + return result * self.turns def controlBr(self, R, Z): """ @@ -107,7 +108,7 @@ def controlBr(self, R, Z): result = 0.0 for R_fil, Z_fil, weight in self._points: result += GreensBr(R_fil, Z_fil, R, Z) * weight - return result + return result * self.turns def controlBz(self, R, Z): """ @@ -116,7 +117,7 @@ def controlBz(self, R, Z): result = 0.0 for R_fil, Z_fil, weight in self._points: result += GreensBz(R_fil, Z_fil, R, Z) * weight - return result + return result * self.turns def inShape(self,polygon): Shaped_Coil = Polygon([shape for shape in self.shape])