From 48f450a0321e69618e4c38d8c374b9e7449b25ea Mon Sep 17 00:00:00 2001 From: ratinguely <46829818+ratinguely@users.noreply.github.com> Date: Thu, 22 Aug 2024 20:09:30 -0400 Subject: [PATCH] Update get_data_from_EFIT_for_SOFT.py Corrected error for calculating toroidal B-field, using FPOL[0] instead of FPOL --- efit/get_data_from_EFIT_for_SOFT.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/efit/get_data_from_EFIT_for_SOFT.py b/efit/get_data_from_EFIT_for_SOFT.py index 3a783ce..b0976dd 100644 --- a/efit/get_data_from_EFIT_for_SOFT.py +++ b/efit/get_data_from_EFIT_for_SOFT.py @@ -161,7 +161,8 @@ def get_Br_Bz(psi,R,Z,dR=5e-3,dZ=5e-3,Rpsi=[],Zpsi=[]): #mf Bphi Yes nz-by-nr matrix Toroidal field component FPOL = gfile.Ginfo['FPOL']; # Poloidal current function in m-T, F = RBT on flux grid -Btor = FPOL/r; # T, toroidal magnetic field Btor(r) +# Note that B0 = FPOL[0]/R0, and Btor(r) = B0*R0/r, so Btor(r) = FPOL[0]/R0*R0/r = FPOL[0]/r +Btor = FPOL[0]/r; # T, toroidal magnetic field Btor(r) Bphi = np.zeros(shape=np.shape(RGRID)); # to store data for iZ in range(len(z)): Bphi[iZ,:] = Btor; # T, toroidal magnetic field, Bphi(z,r) BPHI = Bphi.T; # Bphi(r,z)