From c22e00c0df0ef4fbcc77a3f55cd43e213985413f Mon Sep 17 00:00:00 2001 From: schoener Date: Thu, 4 Nov 2021 19:23:34 +0100 Subject: [PATCH] save --- .../00_FINAL_coil_geometry.py | 0 Coil_geometry/01_FINAL_coil_max_current.py | 29 +++++ .../AHH}/00_Simple_testing.py | 0 .../AHH}/01_geometry_fixed_AHH.py | 0 ...02_geometry_fixed_search_distance_plots.py | 0 ...iteratively_find_exact_d_3rd_derivative.py | 0 .../AHH}/04_final_AHH_coil.py | 0 ...rison_opt_AHH_vs_not_cutting_optical_ax.py | 0 .../AHH}/06_surface_calculation_AHH.py | 0 .../AHH}/07_final_AHH_lowered height.py | 0 Coil_geometry/AHH/08_FINAL_AHH.py | 82 ++++++++++++++ Coil_geometry/{ => AHH}/Untitled.ipynb | 0 .../AHH}/output/AHH_field.pdf | Bin .../output/first_compensation_idea.png | Bin .../gradient_field_of_compensation_coil.pdf | Bin Coil_geometry/{ => HH}/00_Simple_testing.py | 0 Coil_geometry/{ => HH}/01_geometry_HH.py | 0 ...y_AHH_Try_inside_of_HH_for_compensation.py | 0 .../{ => HH}/04_Iterative_Testing.py | 0 .../{ => HH}/05_try_diff_geometry_HH1.py | 0 .../{ => HH}/06_only_geometry_AHH.py | 0 Coil_geometry/{ => HH}/07_02_testing B_tot.py | 0 .../08_plotting_07_HH_without_comp1.py | 0 .../09_geometry_HH_check_other_axis.py | 0 .../{ => HH}/10_comparison_Ilzh_small-bias.py | 0 Coil_geometry/{ => HH}/11_Final_HH.py | 2 + Coil_geometry/{ => HH}/12_Final_Plotting.py | 0 .../13_new_HH_coil_comp_different_wires.py | 0 .../{ => HH}/14_new_HH_coil_wire_decision.py | 1 + ..._new_HH_coil_iterative_winding_decision.py | 0 .../HH}/Untitled.ipynb | 0 Coil_geometry/{ => HH}/output/AHH_field.pdf | Bin .../HH}/output/first_compensation_idea.png | Bin .../gradient_field_of_compensation_coil.pdf | Bin Coil_geometry_AHH/11_Final_HH.py | 103 ------------------ Cooling/05_POWER_estimation_water_cooling.py | 44 ++++++++ src/coil_class.py | 35 +++++- untitled0.py | 33 ++---- 38 files changed, 198 insertions(+), 131 deletions(-) rename Coil_geometry_AHH/08_FINAL_AHH.py => Coil_geometry/00_FINAL_coil_geometry.py (100%) create mode 100644 Coil_geometry/01_FINAL_coil_max_current.py rename {Coil_geometry_AHH => Coil_geometry/AHH}/00_Simple_testing.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/01_geometry_fixed_AHH.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/02_geometry_fixed_search_distance_plots.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/03_iteratively_find_exact_d_3rd_derivative.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/04_final_AHH_coil.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/05_comparison_opt_AHH_vs_not_cutting_optical_ax.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/06_surface_calculation_AHH.py (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/07_final_AHH_lowered height.py (100%) create mode 100644 Coil_geometry/AHH/08_FINAL_AHH.py rename Coil_geometry/{ => AHH}/Untitled.ipynb (100%) rename {Coil_geometry_AHH => Coil_geometry/AHH}/output/AHH_field.pdf (100%) rename Coil_geometry/{ => AHH}/output/first_compensation_idea.png (100%) rename Coil_geometry/{ => AHH}/output/gradient_field_of_compensation_coil.pdf (100%) rename Coil_geometry/{ => HH}/00_Simple_testing.py (100%) rename Coil_geometry/{ => HH}/01_geometry_HH.py (100%) rename Coil_geometry/{ => HH}/02_geometry_AHH_Try_inside_of_HH_for_compensation.py (100%) rename Coil_geometry/{ => HH}/04_Iterative_Testing.py (100%) rename Coil_geometry/{ => HH}/05_try_diff_geometry_HH1.py (100%) rename Coil_geometry/{ => HH}/06_only_geometry_AHH.py (100%) rename Coil_geometry/{ => HH}/07_02_testing B_tot.py (100%) rename Coil_geometry/{ => HH}/08_plotting_07_HH_without_comp1.py (100%) rename Coil_geometry/{ => HH}/09_geometry_HH_check_other_axis.py (100%) rename Coil_geometry/{ => HH}/10_comparison_Ilzh_small-bias.py (100%) rename Coil_geometry/{ => HH}/11_Final_HH.py (96%) rename Coil_geometry/{ => HH}/12_Final_Plotting.py (100%) rename Coil_geometry/{ => HH}/13_new_HH_coil_comp_different_wires.py (100%) rename Coil_geometry/{ => HH}/14_new_HH_coil_wire_decision.py (99%) rename Coil_geometry/{ => HH}/15_new_HH_coil_iterative_winding_decision.py (100%) rename {Coil_geometry_AHH => Coil_geometry/HH}/Untitled.ipynb (100%) rename Coil_geometry/{ => HH}/output/AHH_field.pdf (100%) rename {Coil_geometry_AHH => Coil_geometry/HH}/output/first_compensation_idea.png (100%) rename {Coil_geometry_AHH => Coil_geometry/HH}/output/gradient_field_of_compensation_coil.pdf (100%) delete mode 100644 Coil_geometry_AHH/11_Final_HH.py create mode 100644 Cooling/05_POWER_estimation_water_cooling.py diff --git a/Coil_geometry_AHH/08_FINAL_AHH.py b/Coil_geometry/00_FINAL_coil_geometry.py similarity index 100% rename from Coil_geometry_AHH/08_FINAL_AHH.py rename to Coil_geometry/00_FINAL_coil_geometry.py diff --git a/Coil_geometry/01_FINAL_coil_max_current.py b/Coil_geometry/01_FINAL_coil_max_current.py new file mode 100644 index 0000000..bd7b5d3 --- /dev/null +++ b/Coil_geometry/01_FINAL_coil_max_current.py @@ -0,0 +1,29 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib +#matplotlib.use('Qt5Agg') +from src import coil_class as BC + +scale = 1000 +lim = 1 +nr_points = (2 * lim) * scale + 1 +x = np.linspace(-lim,lim,nr_points) +z = np.linspace(-lim,lim,nr_points) + +def mu_it(x_pos): + it = nr_points//2 + x_pos + return it + + +Wires = [[0.45, 0.514],[0.475, 0.543],[0.5, 0.568]] + +Wire_1 = Wires[2] + +#I_current = 0.94 +HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = Wire_1[0], + wire_width = Wire_1[0], insulation_thickness=(Wire_1[1] - Wire_1[0]) / 2, is_round = True, + winding_scheme= 2) + +R = HH_Coil.resistance(150) + +print(2400/R) \ No newline at end of file diff --git a/Coil_geometry_AHH/00_Simple_testing.py b/Coil_geometry/AHH/00_Simple_testing.py similarity index 100% rename from Coil_geometry_AHH/00_Simple_testing.py rename to Coil_geometry/AHH/00_Simple_testing.py diff --git a/Coil_geometry_AHH/01_geometry_fixed_AHH.py b/Coil_geometry/AHH/01_geometry_fixed_AHH.py similarity index 100% rename from Coil_geometry_AHH/01_geometry_fixed_AHH.py rename to Coil_geometry/AHH/01_geometry_fixed_AHH.py diff --git a/Coil_geometry_AHH/02_geometry_fixed_search_distance_plots.py b/Coil_geometry/AHH/02_geometry_fixed_search_distance_plots.py similarity index 100% rename from Coil_geometry_AHH/02_geometry_fixed_search_distance_plots.py rename to Coil_geometry/AHH/02_geometry_fixed_search_distance_plots.py diff --git a/Coil_geometry_AHH/03_iteratively_find_exact_d_3rd_derivative.py b/Coil_geometry/AHH/03_iteratively_find_exact_d_3rd_derivative.py similarity index 100% rename from Coil_geometry_AHH/03_iteratively_find_exact_d_3rd_derivative.py rename to Coil_geometry/AHH/03_iteratively_find_exact_d_3rd_derivative.py diff --git a/Coil_geometry_AHH/04_final_AHH_coil.py b/Coil_geometry/AHH/04_final_AHH_coil.py similarity index 100% rename from Coil_geometry_AHH/04_final_AHH_coil.py rename to Coil_geometry/AHH/04_final_AHH_coil.py diff --git a/Coil_geometry_AHH/05_comparison_opt_AHH_vs_not_cutting_optical_ax.py b/Coil_geometry/AHH/05_comparison_opt_AHH_vs_not_cutting_optical_ax.py similarity index 100% rename from Coil_geometry_AHH/05_comparison_opt_AHH_vs_not_cutting_optical_ax.py rename to Coil_geometry/AHH/05_comparison_opt_AHH_vs_not_cutting_optical_ax.py diff --git a/Coil_geometry_AHH/06_surface_calculation_AHH.py b/Coil_geometry/AHH/06_surface_calculation_AHH.py similarity index 100% rename from Coil_geometry_AHH/06_surface_calculation_AHH.py rename to Coil_geometry/AHH/06_surface_calculation_AHH.py diff --git a/Coil_geometry_AHH/07_final_AHH_lowered height.py b/Coil_geometry/AHH/07_final_AHH_lowered height.py similarity index 100% rename from Coil_geometry_AHH/07_final_AHH_lowered height.py rename to Coil_geometry/AHH/07_final_AHH_lowered height.py diff --git a/Coil_geometry/AHH/08_FINAL_AHH.py b/Coil_geometry/AHH/08_FINAL_AHH.py new file mode 100644 index 0000000..637f38b --- /dev/null +++ b/Coil_geometry/AHH/08_FINAL_AHH.py @@ -0,0 +1,82 @@ +import matplotlib.pyplot as plt +import numpy as np +import matplotlib +#matplotlib.use('Qt5Agg') +from src import coil_class as BC + +scale = 1000 +lim = 1 +nr_points = (2 * lim) * scale + 1 +x = np.linspace(-lim,lim,nr_points) +z = np.linspace(-lim,lim,nr_points) + +def mu_it(x_pos): + it = nr_points//2 + x_pos + return it + + +Wires = [[0.45, 0.514],[0.475, 0.543],[0.5, 0.568]] + +Wire_1 = Wires[2] + +#I_current = 0.94 +HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, wire_height = Wire_1[0], + wire_width = Wire_1[0], insulation_thickness=(Wire_1[1] - Wire_1[0]) / 2, is_round = True, + winding_scheme= 2) + + +print(f"HH N = {HH_Coil.get_N()}") +I = 64 / HH_Coil.get_N() * 1.25 + +# set radius plus distance +HH_Coil.set_R_outer(50.5 - HH_Coil.get_tot_wire_width()*1e3) +HH_Coil.set_d_min(47.15) + +# HH_Coil.B_quick_plot(I) +# HH_Coil.B_curv_quick_plot(I) +# HH_Coil.plot_raster() +HH_Coil.print_info() + +D_max = 2 * (HH_Coil.get_R_inner()*1e3 - 1) * np.tan(np.radians(41.11)) +print(D_max) + +AHH_Coil = BC.BCoil(HH = -1, distance = 54, radius = 48, layers = HH_Coil.get_layers, windings=2 * HH_Coil.get_windings, + wire_height = Wire_1[0], wire_width=Wire_1[0], insulation_thickness=(Wire_1[1] - Wire_1[0]) / 2, + is_round = True, winding_scheme= 2) + +AHH_Coil.set_R_inner(HH_Coil.get_R_inner() * 1e3) +AHH_Coil.set_d_max(D_max) + +AHH_Coil.print_info() +print(f"AHH N = {AHH_Coil.get_N()}") +I_grad = I - 0.128 # 8 x 9#128 / AHH_Coil.get_N() * I + +I_grad = I - 0.15 # 8 x 8 + +print(f"current @ 6G/cm: {I_grad} A") +AHH_Coil.B_grad_quick_plot(I_grad) +#Bz, Bx = AHH_Coil.B_field(I) +AHH_Coil.cooling(I_grad, 22.5) + +#Bz, Bx = AHH_Coil.B_field(I_grad, x, z, raster = 7) +# Bz_grad = BC.BCoil.grad(Bz,z) +# Bx_grad = BC.BCoil.grad(Bx,x) + +#AHH_Coil.B_quick_plot(I_grad) +#AHH_Coil.B_grad_quick_plot(I_grad) +AHH_Coil.plot_raster(raster_value= 11) + +# zero = mu_it(0) +# print(f"Bz_grad({z[zero]}) = {Bz_grad[zero]} G/cm") +# mu = mu_it(1) +# mm = mu_it(1000) +# mid = mu_it(5000) +# outer = mu_it(15000) +# # Bz0 = Bz_grad[zero] +# +# +# +# print(f"Bz_grad({z[mu]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mu]}, relative = {(Bz0 - Bz_grad[mu])/Bz0}") +# print(f"Bz_grad({z[mm]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mm]}, relative = {(Bz0 - Bz_grad[mm])/Bz0}") +# print(f"Bz_grad({z[mid]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[mid]}, relative = {(Bz0 - Bz_grad[mid])/Bz0}") +# print(f"Bz_grad({z[outer]} mm) - Bz_grad (0) = {Bz0 - Bz_grad[outer]}, relative = {(Bz0 - Bz_grad[outer])/Bz0}") diff --git a/Coil_geometry/Untitled.ipynb b/Coil_geometry/AHH/Untitled.ipynb similarity index 100% rename from Coil_geometry/Untitled.ipynb rename to Coil_geometry/AHH/Untitled.ipynb diff --git a/Coil_geometry_AHH/output/AHH_field.pdf b/Coil_geometry/AHH/output/AHH_field.pdf similarity index 100% rename from Coil_geometry_AHH/output/AHH_field.pdf rename to Coil_geometry/AHH/output/AHH_field.pdf diff --git a/Coil_geometry/output/first_compensation_idea.png b/Coil_geometry/AHH/output/first_compensation_idea.png similarity index 100% rename from Coil_geometry/output/first_compensation_idea.png rename to Coil_geometry/AHH/output/first_compensation_idea.png diff --git a/Coil_geometry/output/gradient_field_of_compensation_coil.pdf b/Coil_geometry/AHH/output/gradient_field_of_compensation_coil.pdf similarity index 100% rename from Coil_geometry/output/gradient_field_of_compensation_coil.pdf rename to Coil_geometry/AHH/output/gradient_field_of_compensation_coil.pdf diff --git a/Coil_geometry/00_Simple_testing.py b/Coil_geometry/HH/00_Simple_testing.py similarity index 100% rename from Coil_geometry/00_Simple_testing.py rename to Coil_geometry/HH/00_Simple_testing.py diff --git a/Coil_geometry/01_geometry_HH.py b/Coil_geometry/HH/01_geometry_HH.py similarity index 100% rename from Coil_geometry/01_geometry_HH.py rename to Coil_geometry/HH/01_geometry_HH.py diff --git a/Coil_geometry/02_geometry_AHH_Try_inside_of_HH_for_compensation.py b/Coil_geometry/HH/02_geometry_AHH_Try_inside_of_HH_for_compensation.py similarity index 100% rename from Coil_geometry/02_geometry_AHH_Try_inside_of_HH_for_compensation.py rename to Coil_geometry/HH/02_geometry_AHH_Try_inside_of_HH_for_compensation.py diff --git a/Coil_geometry/04_Iterative_Testing.py b/Coil_geometry/HH/04_Iterative_Testing.py similarity index 100% rename from Coil_geometry/04_Iterative_Testing.py rename to Coil_geometry/HH/04_Iterative_Testing.py diff --git a/Coil_geometry/05_try_diff_geometry_HH1.py b/Coil_geometry/HH/05_try_diff_geometry_HH1.py similarity index 100% rename from Coil_geometry/05_try_diff_geometry_HH1.py rename to Coil_geometry/HH/05_try_diff_geometry_HH1.py diff --git a/Coil_geometry/06_only_geometry_AHH.py b/Coil_geometry/HH/06_only_geometry_AHH.py similarity index 100% rename from Coil_geometry/06_only_geometry_AHH.py rename to Coil_geometry/HH/06_only_geometry_AHH.py diff --git a/Coil_geometry/07_02_testing B_tot.py b/Coil_geometry/HH/07_02_testing B_tot.py similarity index 100% rename from Coil_geometry/07_02_testing B_tot.py rename to Coil_geometry/HH/07_02_testing B_tot.py diff --git a/Coil_geometry/08_plotting_07_HH_without_comp1.py b/Coil_geometry/HH/08_plotting_07_HH_without_comp1.py similarity index 100% rename from Coil_geometry/08_plotting_07_HH_without_comp1.py rename to Coil_geometry/HH/08_plotting_07_HH_without_comp1.py diff --git a/Coil_geometry/09_geometry_HH_check_other_axis.py b/Coil_geometry/HH/09_geometry_HH_check_other_axis.py similarity index 100% rename from Coil_geometry/09_geometry_HH_check_other_axis.py rename to Coil_geometry/HH/09_geometry_HH_check_other_axis.py diff --git a/Coil_geometry/10_comparison_Ilzh_small-bias.py b/Coil_geometry/HH/10_comparison_Ilzh_small-bias.py similarity index 100% rename from Coil_geometry/10_comparison_Ilzh_small-bias.py rename to Coil_geometry/HH/10_comparison_Ilzh_small-bias.py diff --git a/Coil_geometry/11_Final_HH.py b/Coil_geometry/HH/11_Final_HH.py similarity index 96% rename from Coil_geometry/11_Final_HH.py rename to Coil_geometry/HH/11_Final_HH.py index 21abf2d..4917a8f 100644 --- a/Coil_geometry/11_Final_HH.py +++ b/Coil_geometry/HH/11_Final_HH.py @@ -55,6 +55,8 @@ print(f"Diff B 1 mm: {Bz[16000] - Bz[15000]}, relative: {(Bz[16000] - Bz[15000]) print(f"Diff B 0.5 mm: {Bz[15500] - Bz[15000]}, relative: {(Bz[15500] - Bz[15000])/Bz[15000]}") +print(f"Diff B 15 mm: {Bz[30000] - Bz[15000]}, relative: {(Bz[30000] - Bz[15000])/Bz[15000]}") + diff --git a/Coil_geometry/12_Final_Plotting.py b/Coil_geometry/HH/12_Final_Plotting.py similarity index 100% rename from Coil_geometry/12_Final_Plotting.py rename to Coil_geometry/HH/12_Final_Plotting.py diff --git a/Coil_geometry/13_new_HH_coil_comp_different_wires.py b/Coil_geometry/HH/13_new_HH_coil_comp_different_wires.py similarity index 100% rename from Coil_geometry/13_new_HH_coil_comp_different_wires.py rename to Coil_geometry/HH/13_new_HH_coil_comp_different_wires.py diff --git a/Coil_geometry/14_new_HH_coil_wire_decision.py b/Coil_geometry/HH/14_new_HH_coil_wire_decision.py similarity index 99% rename from Coil_geometry/14_new_HH_coil_wire_decision.py rename to Coil_geometry/HH/14_new_HH_coil_wire_decision.py index 534f208..f46b09e 100644 --- a/Coil_geometry/14_new_HH_coil_wire_decision.py +++ b/Coil_geometry/HH/14_new_HH_coil_wire_decision.py @@ -46,6 +46,7 @@ Bz_curv = BC.BCoil.curv(Bz,z) zero = mu_it(0) print(z[zero]) print(f"Curvature = {Bz_curv[zero]}") + #Wire_1.B_quick_plot(I) #Wire_1.B_curv_quick_plot(I,nr_points= 1000) diff --git a/Coil_geometry/15_new_HH_coil_iterative_winding_decision.py b/Coil_geometry/HH/15_new_HH_coil_iterative_winding_decision.py similarity index 100% rename from Coil_geometry/15_new_HH_coil_iterative_winding_decision.py rename to Coil_geometry/HH/15_new_HH_coil_iterative_winding_decision.py diff --git a/Coil_geometry_AHH/Untitled.ipynb b/Coil_geometry/HH/Untitled.ipynb similarity index 100% rename from Coil_geometry_AHH/Untitled.ipynb rename to Coil_geometry/HH/Untitled.ipynb diff --git a/Coil_geometry/output/AHH_field.pdf b/Coil_geometry/HH/output/AHH_field.pdf similarity index 100% rename from Coil_geometry/output/AHH_field.pdf rename to Coil_geometry/HH/output/AHH_field.pdf diff --git a/Coil_geometry_AHH/output/first_compensation_idea.png b/Coil_geometry/HH/output/first_compensation_idea.png similarity index 100% rename from Coil_geometry_AHH/output/first_compensation_idea.png rename to Coil_geometry/HH/output/first_compensation_idea.png diff --git a/Coil_geometry_AHH/output/gradient_field_of_compensation_coil.pdf b/Coil_geometry/HH/output/gradient_field_of_compensation_coil.pdf similarity index 100% rename from Coil_geometry_AHH/output/gradient_field_of_compensation_coil.pdf rename to Coil_geometry/HH/output/gradient_field_of_compensation_coil.pdf diff --git a/Coil_geometry_AHH/11_Final_HH.py b/Coil_geometry_AHH/11_Final_HH.py deleted file mode 100644 index 57e3611..0000000 --- a/Coil_geometry_AHH/11_Final_HH.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Mon Aug 23 17:40:37 2021 - -@author: Joschka -""" - - -import matplotlib.pyplot as plt -import numpy as np -#from src import B_field_calculation as bf - -from src import coil_class as BC - -from IPython import get_ipython -get_ipython().run_line_magic('matplotlib', 'qt') -#get_ipython().run_line_magic('matplotlib', 'inline') - -#set up axis -x = np.linspace(-20, 20, 40001) -z = np.linspace(-20, 20, 40001) - - -#New coil -I_current = 10 -d=69.4 - -HH_Coil = BC.BCoil(HH = -1, distance = d ,radius = 46.875 ,layers = 4, windings = 4 , wire_width= 1, wire_height= 2 ,layers_spacing = 0.25, windings_spacing= 0.25) - -HH_Coil.print_info() - -Bz, Bx = HH_Coil.B_field(I_current, x, z, raster = 10) - -B_tot_z, B_tot_x = HH_Coil.B_field(I_current, x, z, raster = 10) - -Bz = BC.BCoil.grad(Bz, z) -HH_Coil.cooling(I_current,28) - -print(f"B_z(0) = {Bz[15000]} G") -#print(f"B_z_curvature(0) = {Bz_curv[15000]:.10f} G/cm^2") - - -print(f"B_z(1 μm) = {Bz[15001]}") -print(f"B_z(1 mm) = {Bz[16000]}") - -print(f"Diff B 1 μm: {Bz[15001] - Bz[15000]}, relative: {(Bz[15001] - Bz[15000])/Bz[15000]}") - -print(f"Diff B 0.5 mm: {Bz[15500] - Bz[15000]}, relative: {(Bz[15500] - Bz[15000])/Bz[15000]}") - -print(f"Diff B 1 mm: {Bz[25000] - Bz[15000]}, relative: {(Bz[25000] - Bz[15000])/Bz[15000]}") - -print(f"Diff B 1 mm: {Bz[32000] - Bz[15000]}, relative: {(Bz[32000] - Bz[15000])/Bz[15000]}") - - -print(z[32000]) -print(z[15000]) - - - -plt.figure(300) - - - -""" -#Field plot -########################## -plt.subplot(2,1,1) -plt.plot(z,Bz,linestyle = "solid", label = r"$B_z along z-axis") -plt.plot(z,B_tot_z, linestyle = "dashed", label = "New B_tot along z-axis") -#plt.plot(x,B_tot_x, label = "B_tot along x-axis") -#plt.plot(z,B_z_comp,linestyle = "solid", label = r"$B_{z,1}$, d = 54 mm, R = 48.8 mm, I = 5 A, 4 x 4") - -#plt.plot(z,B_tot,linestyle = "solid", label = r"$B_{z,1} + B_{z,2}$") -#plt.xlim(-0.01,0.01) -plt.title("B-field" ) - -plt.ylabel(r"$B_z$ [G]") -plt.xlabel("z-axis [mm]") -plt.legend()#bbox_to_anchor=(1.05, 1), loc='upper left') - -plt.subplot(2,1,2) -plt.plot(z,Bz_curv,linestyle = "solid", label = r"$\nabla_z^2 B_{ref}$, d = 44 mm, R = 44 mm") -#plt.plot(z,B_z_comp_curv,linestyle = "solid", label = r"$\nabla_z^2 B_{z,1}$, d = 54 mm, R = 48.8 mm, I = 5 A") - -#plt.plot(z,B_tot_curv,linestyle = "solid", label = r"$\nabla_z^2 B_{z,1} + B_{z,2}$") - -plt.ylabel(r"$\nabla_z^2 B_z [G/cm^2]$") -plt.xlabel("z-axis [mm]")#plt.xlim(-10,10) -plt.title("Curvature of B-field") -plt.legend()#bbox_to_anchor=(1.05, 1), loc='upper left') - -#plt.savefig("output/first_compensation_idea.png") - -plt.show() -""" - - - -""" -AHH ############################################################################ -############################################################################### -############################################################################### -""" diff --git a/Cooling/05_POWER_estimation_water_cooling.py b/Cooling/05_POWER_estimation_water_cooling.py new file mode 100644 index 0000000..4d6521e --- /dev/null +++ b/Cooling/05_POWER_estimation_water_cooling.py @@ -0,0 +1,44 @@ +""" +Created on 3.11.21 + +@author: Joschka +""" +import numpy as np +from src import coil_class as BC + + +def main(): + dens = 999.78 # kg/m^3 + c_p = 4190 # J/kg*K + + d_T = 3 + + flow = 0.3#/5 #m/s + #flow *=2 + print(f"flow = {flow}m/s") + V_t = 4.8 * 3.2 * 1e-6 * flow + print(f"Volume rate = {V_t * 1e6} mL/s") + m = dens * V_t + + Q = m * c_p * d_T + print(f"Q = {Q} J/s") + + HH_Coil = BC.BCoil(HH=1, distance=51.694, radius=47.9263, layers=8, windings=8, wire_height=0.5, + wire_width=0.5, insulation_thickness=0.034, is_round=True, + winding_scheme=2) + for I in np.arange(1,7,0.001): + P = HH_Coil.power(I, 23) + if P > Q: + break + + print(f"Power = {P} W @ {I} A") + + B_max = HH_Coil.max_field(I) + + print(f"max field = {B_max} G") + + + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/src/coil_class.py b/src/coil_class.py index 137a3bc..96e0928 100644 --- a/src/coil_class.py +++ b/src/coil_class.py @@ -61,7 +61,8 @@ class BCoil: self.insulation_thickness = insulation_thickness * 1e-3 self.is_round = is_round self.winding_scheme = winding_scheme -# Standard get/set functions + + # Standard get/set functions @property def get_HH(self): return self.HH @@ -178,8 +179,6 @@ class BCoil: 2 - np.sqrt(3)) * self.get_tot_wire_width() / 2 # width is reduced due to winding offset return self.get_tot_wire_width() * self.layers - - def winding_raster(self): """ generates raster of flowing currents @@ -394,6 +393,27 @@ class BCoil: # print(f"time = {end - start} s") return B_z, B_x + def max_field(self, I_current,raster = 7): + B_z_0 = 0 + calc_raster = self.full_raster(raster) + + if self.get_N() != len(calc_raster): + log.error("N is not equal length of raster") + + rastering_value = len(calc_raster[0]) + + I_current /= rastering_value # divide current into smaller currents for mapping the whole wire + + for wire in range(0, self.get_N()): + for ii in range(0, rastering_value): + # extract position information out of raster + z_pos = calc_raster[wire, ii, 0] + r_pos = calc_raster[wire, ii, 1] + + B_z_0 += BCoil.B_z_loop(I_current, r_pos, z_pos, 0, 0) + BCoil.B_z_loop(self.HH * I_current, + r_pos, -z_pos, 0, 0) + return B_z_0 + def B_tot_along_axis(self, I_current, x, z, raster=10): """ return B_tot_z, B_tot_x @@ -620,7 +640,6 @@ class BCoil: plt.show() - def cooling(self, I_current, T): """ Print current density and power @@ -686,8 +705,12 @@ class BCoil: def main(): - Coil_1 = BCoil(HH = 1, distance = 54, radius = 48, layers = 7, windings = 8, wire_height = 0.6, wire_width = 0.5, insulation_thickness= 0.05, is_round = True, winding_scheme= 2) - Coil_1.plot_raster() + Coil_1 = BCoil(HH=1, distance=54, radius=48, layers=8, windings=8, wire_height=0.5, wire_width=0.5, + insulation_thickness=0.05, is_round=True, winding_scheme=2) + # Coil_1.plot_raster() + res_m = BCoil.resistivity_copper(20) * 1 / Coil_1.get_wire_area() + print(res_m) + # main() if __name__ == "__main__": diff --git a/untitled0.py b/untitled0.py index ab818c5..1a12761 100644 --- a/untitled0.py +++ b/untitled0.py @@ -6,31 +6,20 @@ Created on Fri Oct 1 10:42:13 2021 """ import numpy as np -a = np.ones(50) -for i in range(0,len(a)): - a[i] *= i +def main(): + wire_width = 0.568 + r_in = 45.92 + wire_width/2 + d_in = r_in * 2 + r_2 = r_in + wire_width + r_3 = r_2 + wire_width + r = r_in + 4*wire_width + res = 2*r -print(a) + print(res) -print(a[:5]) -print(a[5:]) -print(a[:-5]) -print(10e-3/13.7) -a = 7 -if (a == (7 or 3)): - print("true") - -print(40*1e-3*np.pi) -print(4/0.127) - -print(30/0.3) - -print(30/400) - -print(4.3*4.8/(60*(0.475/2)**2 *np.pi)) - -print(np.sin(np.radians(90))) \ No newline at end of file +if __name__ == '__main__': + main() \ No newline at end of file