Skip to content
Snippets Groups Projects
Commit 0375fcb7 authored by Jacobs Matthieu's avatar Jacobs Matthieu
Browse files

extra efielddescr

parent e1527836
No related branches found
No related tags found
No related merge requests found
# This file contains the analytical functions describing potential, efield and magnetic field for different cases # This file contains the analytical functions describing potential, efield and magnetic field for different cases
import math import math
import PlottingFunctions
# Magnetic Fields # Magnetic Fields
def b_field_description1(r,z,theta, Rmajor, Rminor): def b_field_description1(r,z,theta, Rmajor, Rminor):
# Radial B-field (linear and max at central surfaces of the torus # Radial B-field (linear and max at central surfaces of the torus
...@@ -32,6 +33,11 @@ def potential_description2(r,z,theta,Rmajor,Rminor): ...@@ -32,6 +33,11 @@ def potential_description2(r,z,theta,Rmajor,Rminor):
potval = math.exp(-R)*100 potval = math.exp(-R)*100
return potval 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 # Electric Fields
def e_descr1(r,z,theta, Rmajor): def e_descr1(r,z,theta, Rmajor):
r = r/100 r = r/100
...@@ -48,4 +54,18 @@ def e_descr2(r,z,theta, Rmajor): ...@@ -48,4 +54,18 @@ def e_descr2(r,z,theta, Rmajor):
Er = -100*math.exp(-D) Er = -100*math.exp(-D)
Ephi = 0 Ephi = 0
Ez = 0 Ez = 0
return [Er,Ephi, Ez] return [Er,Ephi, Ez]
\ No newline at end of file
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
...@@ -4,7 +4,7 @@ import shutil ...@@ -4,7 +4,7 @@ import shutil
import AnalyticalPrescriptions import AnalyticalPrescriptions
# The folder where the different cases should be stored is # The folder where the different cases should be stored is
basepath = "D:\Matthieu\Documents\\1.Master\Thesis\Data\\" 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): if os.path.isdir(folder):
Flag = int(input("Do you want to remove" + folder + " Answer should be 1/0")) Flag = int(input("Do you want to remove" + folder + " Answer should be 1/0"))
if Flag: if Flag:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment