diff --git a/Scripts_Matthieu/AnalyticalPrescriptions.py b/Scripts_Matthieu/AnalyticalPrescriptions.py index d9d4fb7729b9e96f8008cc727d5c8a7e7659813e..36233eca8f8eaf27f699ec659b226519e0920c18 100644 --- a/Scripts_Matthieu/AnalyticalPrescriptions.py +++ b/Scripts_Matthieu/AnalyticalPrescriptions.py @@ -1,5 +1,6 @@ # This file contains the analytical functions describing potential, efield and magnetic field for different cases import math +import PlottingFunctions # Magnetic Fields def b_field_description1(r,z,theta, Rmajor, Rminor): # Radial B-field (linear and max at central surfaces of the torus @@ -32,6 +33,11 @@ def potential_description2(r,z,theta,Rmajor,Rminor): potval = math.exp(-R)*100 return potval +def potential_description3(r,z,theta,Rmajor,Rminor): + r = (r-Rmajor)/100 + z = z/100 + potval = 500*math.cos(4*math.atan2(z,r)) + return potval # Electric Fields def e_descr1(r,z,theta, Rmajor): r = r/100 @@ -48,4 +54,18 @@ def e_descr2(r,z,theta, Rmajor): Er = -100*math.exp(-D) Ephi = 0 Ez = 0 - return [Er,Ephi, Ez] \ No newline at end of file + return [Er,Ephi, Ez] + +def e_descr3(r,z,theta, Rmajor,rminor): + r = (r-Rmajor)/100 + z = z/100 + Er = 2000*math.sin(4*math.atan2(z,r))*z/(z**2+r**2) + Ephi = 0 + Ez = 2000*math.sin(4*math.atan2(z,r))*-r/(z**2+r**2) +# return [Er,Ephi,Ez] + return Ez + +Rmajor = 500 +rminor = 100 +ns = 100 +PlottingFunctions.plot2DContour(ns,ns,Rmajor-rminor,Rmajor+rminor,-rminor,rminor,Rmajor,rminor,e_descr3,'X [cm]', 'Y [cm]','Potential [V]',True) \ No newline at end of file diff --git a/Scripts_Matthieu/PrepareGeometryDescription1.py b/Scripts_Matthieu/PrepareGeometryDescription1.py index 683429256040d3c3bc013c37aa2adb6d02f2c5c4..f2af80e2bded541d817b26c0d4b5660a3613c58a 100644 --- a/Scripts_Matthieu/PrepareGeometryDescription1.py +++ b/Scripts_Matthieu/PrepareGeometryDescription1.py @@ -4,7 +4,7 @@ import shutil import AnalyticalPrescriptions # The folder where the different cases should be stored is basepath = "D:\Matthieu\Documents\\1.Master\Thesis\Data\\" -folder = "D:\Matthieu\Documents\\1.Master\Thesis\Data\Description1" +folder = "D:\Matthieu\Documents\\1.Master\Thesis\Data\Description2" if os.path.isdir(folder): Flag = int(input("Do you want to remove" + folder + " Answer should be 1/0")) if Flag: