From 0375fcb70ef0ff2a3d40d4b90f77292c8e04aa5b Mon Sep 17 00:00:00 2001
From: MatthieuJacobs <matthieu.jacobs@student.kuleuven.be>
Date: Sun, 27 Feb 2022 22:10:03 +0100
Subject: [PATCH] extra efielddescr

---
 Scripts_Matthieu/AnalyticalPrescriptions.py   | 22 ++++++++++++++++++-
 .../PrepareGeometryDescription1.py            |  2 +-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/Scripts_Matthieu/AnalyticalPrescriptions.py b/Scripts_Matthieu/AnalyticalPrescriptions.py
index d9d4fb7..36233ec 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 6834292..f2af80e 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:
-- 
GitLab