From b69540b13661844106101f94a66b5004464aedf8 Mon Sep 17 00:00:00 2001 From: schoener Date: Fri, 7 Jan 2022 15:03:10 +0100 Subject: [PATCH] slightly changed geometry --- Coil_geometry/00_FINAL_coil_geometry.py | 4 ++ Coil_geometry/AHH/08_FINAL_AHH.py | 8 ++-- .../Export_field/02_plotting_data.py | 4 +- Coil_geometry/Export_field/05_Write_to_txt.py | 32 ++++++++----- Coil_geometry/HH/11_Final_HH.py | 38 +++++++++------ ...imation cooling of measurement resistor.py | 48 +++++++++++++++++++ untitled0.py | 8 +++- 7 files changed, 108 insertions(+), 34 deletions(-) create mode 100644 Cooling/06_Estimation cooling of measurement resistor.py diff --git a/Coil_geometry/00_FINAL_coil_geometry.py b/Coil_geometry/00_FINAL_coil_geometry.py index 836eb6a..5c74b06 100644 --- a/Coil_geometry/00_FINAL_coil_geometry.py +++ b/Coil_geometry/00_FINAL_coil_geometry.py @@ -28,6 +28,10 @@ HH_Coil = BC.BCoil(HH = 1, distance = 54, radius = 48, layers = 8, windings = 8, print(f"HH N = {HH_Coil.get_N()}") I = 1.33 # 64 / HH_Coil.get_N() * 1.25 +print(HH_Coil.resistance(20)) +print(HH_Coil.induct_perry()) +print(HH_Coil.resistance(190)) + # 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) diff --git a/Coil_geometry/AHH/08_FINAL_AHH.py b/Coil_geometry/AHH/08_FINAL_AHH.py index a637cd3..043f83b 100644 --- a/Coil_geometry/AHH/08_FINAL_AHH.py +++ b/Coil_geometry/AHH/08_FINAL_AHH.py @@ -29,15 +29,17 @@ 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.set_R_outer(50.5 - HH_Coil.get_tot_wire_width()*1e3) +HH_Coil.set_R_inner(45.6) + +HH_Coil.set_d_min(47.15+2*0.5) # 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)) +D_max = 2 * (HH_Coil.get_R_inner()*1e3 - 0.5) * 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, diff --git a/Coil_geometry/Export_field/02_plotting_data.py b/Coil_geometry/Export_field/02_plotting_data.py index ee3d7ba..5e0b29b 100644 --- a/Coil_geometry/Export_field/02_plotting_data.py +++ b/Coil_geometry/Export_field/02_plotting_data.py @@ -11,7 +11,7 @@ def main(): wire_height=0.5, wire_width=0.5, insulation_thickness=0.068 / 2, is_round=True, winding_scheme=2) - step = 0.03 + step = 0.05 xlim_mm = 30 xlim = int(xlim_mm/step) + 1 ylim_mm = 30 @@ -30,7 +30,7 @@ def main(): - b_plot = np.load('output/B_quarter.npy') + b_raw = np.load('output/final/b_cart_1Gcm.npy') #b_raw = np.load('output/b_cart_1_step_5.npy') #b_raw = np.load('output/b_full_test.npy') diff --git a/Coil_geometry/Export_field/05_Write_to_txt.py b/Coil_geometry/Export_field/05_Write_to_txt.py index 811e9d1..b2d52bb 100644 --- a/Coil_geometry/Export_field/05_Write_to_txt.py +++ b/Coil_geometry/Export_field/05_Write_to_txt.py @@ -7,21 +7,27 @@ import numpy as np from scipy.io import savemat def main(): - # b_full = np.load('output/b_full_test.npy') + step = 0.05 + xlim_mm = 30 + xlim = int(xlim_mm / step) + 1 + print(xlim) + ylim_mm = 30 + ylim = int(ylim_mm / step) + 1 + zlim_mm = 20 + zlim = int(zlim_mm / step) + 1 + + b_1qu = np.load('output/final/b_cart_1Gcm.npy') # - # bx_txt = open("output/Bx.txt", "w+") - # xx = 0 - # yy = 0 - # str = np.array2string(b_full[xx, yy, :, 0]) - # bx_txt.write(str) - b_full = np.load('output/final/b_full.npy') - # mdic = {"B": b_full} - # del b_full - - # savemat("b_full_matlab.mat",b_full) - - np.savetxt("b_x.csv", b_full[:,:,0,0]) + bx_txt = open("output/Bz.txt", "w+") + xx = 50 + yy = 50 + # str = np.array2string(b_1qu[xx, yy, :, 0]) + for xx in range(0,xlim): + for yy in range(0,ylim): + str_1 = ' '.join(map(str,b_1qu[xx, yy, :, 2])) + bx_txt.writelines(str_1) + bx_txt.close() diff --git a/Coil_geometry/HH/11_Final_HH.py b/Coil_geometry/HH/11_Final_HH.py index 7e0e73e..d12707e 100644 --- a/Coil_geometry/HH/11_Final_HH.py +++ b/Coil_geometry/HH/11_Final_HH.py @@ -26,40 +26,50 @@ Wire_1 = [0.5, 0.568] #Wire_1 = [0.45, 0.514] #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(22.5) + +print(f"U = {1 * R}") I_current = 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 - 0.5) -HH_Coil.set_d_min(47.15+1) +#HH_Coil.set_R_outer(50.5 - HH_Coil.get_tot_wire_width()*1e3 - 0.5) +HH_Coil.set_R_outer(49.93) + +additional_space = 0.3 +HH_Coil.set_R_outer(49.93-additional_space) +HH_Coil.set_R_inner(45.6) +#HH_Coil.set_R_inner(45.9-0.1) +# 0.4 to get from +-30300 +HH_Coil.set_d_min(47.15+0.4+ 2*additional_space) print(f"height = {HH_Coil.get_coil_height()}") HH_Coil.print_info() -Bz, Bx = HH_Coil.B_field(I_current, x, z, raster = 7) +#Bz, Bx = HH_Coil.B_field(I_current, x, z, raster = 7) -B_tot_z, B_tot_x = HH_Coil.B_field(I_current, x, z, raster = 7) + +Bz, B_tot_x = HH_Coil.B_tot_along_axis(I_current, x, z, raster = 7) Bz_curv = BC.BCoil.curv(Bz, z) -HH_Coil.cooling(I_current,28) +#HH_Coil.cooling(I_current,28) print(f"Bz(0) = {Bz[15000]} G") print(f"B_z_curvature(0) = {Bz_curv[15000]:.10f} G/cm^2") -print(f"Bz(1 μm) = {Bz[15001]}") -print(f"Bz(1 mm) = {Bz[16000]}") +#print(f"Bz(1 μm) = {Bz[15001]}") +#print(f"Bz(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 +/- 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[16000] - Bz[15000]}, relative: {(Bz[16000] - 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 15 mm: {Bz[30000] - Bz[15000]}, relative: {(Bz[30000] - Bz[15000])/Bz[15000]}") +print(f"Diff B +/- 1 mm: {Bz[16000] - Bz[15000]}, relative: {(Bz[16000] - Bz[15000])/Bz[15000]}") +#print(f"Diff B +/- 15 mm: {Bz[30000] - Bz[15000]}, relative: {(Bz[30000] - Bz[15000])/Bz[15000]}") +""" plt.figure(300) @@ -95,7 +105,7 @@ plt.legend()#bbox_to_anchor=(1.05, 1), loc='upper left') #plt.savefig("output/first_compensation_idea.png") plt.show() - +""" diff --git a/Cooling/06_Estimation cooling of measurement resistor.py b/Cooling/06_Estimation cooling of measurement resistor.py new file mode 100644 index 0000000..a97145d --- /dev/null +++ b/Cooling/06_Estimation cooling of measurement resistor.py @@ -0,0 +1,48 @@ +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 src import physical_constants as cs + + +Wire_1 = [0.5, 0.568] +#Wire_1 = [0.45, 0.514] +#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) + +e_cu = 3e-2 # emissivity copper, polished + +rho_cu = 1.7 * 1e-8 + +I = 3 # A + +surface = 10e-4 +# S_coil = S_coil/2 +print(f"Surface area = {surface}") + + +def power_bal(T, h_air): + T_0 = 22.5 + P = 100e-3 + + f = h_air * surface * (T - T_0) - 0.5 * P + return f + + +print(e_cu * surface * cs.sigma_B ** 4 * (50 ** 4 - 22.5 ** 4)) +T = np.linspace(20, 120, 500) +T_calc = np.linspace(20, 2200, 1000) + +for h_air in [2.5, 10, 25]: + pos_min = np.argmin(np.abs(power_bal(T_calc, h_air))) + T_SS = T_calc[pos_min] + print(f"T_ss = {T_SS} °C") + plt.plot(T, power_bal(T, h_air), label=f"$h_{{air}} = {h_air} \; W/m^2 K$ , $T_{{SS}}$ = {T_SS:.2f}°C") +plt.ylabel("Power balance [W]") +plt.xlabel("temparature [°C]") +plt.title(f"Power balance, free convection, AHH coil, I = {I} A, windings: 4 x 4") +plt.legend() +plt.show() + +print(AHH_opt.power(I, 25) / 2) \ No newline at end of file diff --git a/untitled0.py b/untitled0.py index 2841415..13b1e3b 100644 --- a/untitled0.py +++ b/untitled0.py @@ -9,8 +9,12 @@ import matplotlib.pyplot as plt def main(): - print(2e8/4.9e-3) - #print(zlim*35921/(1024)**2) + r = 45.92e-3 + d = 2*r + d_w = 0.569e-3 + a = 51.52 * d**(-0.41) + 11.31 * d**(-0.33) * np.log(d_w) + print(a) + print(8.96 * 5)