From 078254348744c06bb498102172660bd10f44d4ec Mon Sep 17 00:00:00 2001 From: abujazar Date: Thu, 29 Jun 2023 21:41:25 +0300 Subject: [PATCH 1/9] changes for no insulation --- femmt/examples/basic_inductor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/femmt/examples/basic_inductor.py b/femmt/examples/basic_inductor.py index bca1a47d..ad1c4d7f 100644 --- a/femmt/examples/basic_inductor.py +++ b/femmt/examples/basic_inductor.py @@ -2,7 +2,7 @@ import os def basic_example_inductor(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(flag_insulation: bool = True, show_visual_outputs: bool = True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -22,7 +22,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None# polyethylen } # Here the case size can be determined @@ -63,7 +63,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # When the losses file is already created and contains the losses for the current model, it is enough to run geo.create_model in # order for the thermal simulation to work (geo.single_simulation is not needed). # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. - geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, + geo.thermal_simulation(flag_insulation,thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, colors_geometry=fmt.colors_geometry_ba_jonas) @@ -113,7 +113,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.set_air_gaps(air_gaps) # 4. set insulations - insulation = fmt.Insulation() + insulation = fmt.Insulation(flag_insulation=True) insulation.add_core_insulations(0.001, 0.001, 0.004, 0.001) insulation.add_winding_insulations([[0.0005]]) geo.set_insulation(insulation) @@ -151,7 +151,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # 9. start simulation # 7. prepare and start thermal simulation - example_thermal_simulation(show_visual_outputs) + example_thermal_simulation(flag_insulation=True,show_visual_outputs=show_visual_outputs) if __name__ == "__main__": basic_example_inductor(show_visual_outputs=True) \ No newline at end of file From 1ae1022352a36cafa46c8dceb5407a868c9f8fd2 Mon Sep 17 00:00:00 2001 From: abujazar Date: Thu, 3 Aug 2023 20:09:04 +0200 Subject: [PATCH 2/9] This is the thermal simulation working for center_tapped transformer --- femmt/component.py | 50 ++++++++++++++++--- femmt/examples/basic_inductor.py | 12 ++--- femmt/examples/basic_transformer.py | 12 ++--- .../basic_transformer_center_tapped.py | 7 +-- .../basic_transformer_three_winding.py | 13 +++-- femmt/functions_topologies.py | 2 +- femmt/mesh.py | 5 +- femmt/thermal/thermal_simulation.py | 27 +++++++++- 8 files changed, 97 insertions(+), 31 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index 6f9cbc74..0de26519 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -590,17 +590,52 @@ def get_wire_distances(self) -> List[List[float]]: :return: Wire distances :rtype: List[List[float]] """ - wire_distance = [] - for winding in self.two_d_axi.p_conductor: + #wire_distance = [] + #for winding in self.two_d_axi.p_conductor: # 5 points are for 1 wire - num_points = len(winding) - num_windings = num_points//5 + #num_points = len(winding) + #num_windings = num_points//5 + #winding_list = [] + #for i in range(num_windings): + #winding_list.append(winding[i*5][0]) + #wire_distance.append(winding_list) + + #return wire_distance + + wire_distance = [] + for num, conductor in enumerate(self.two_d_axi.p_conductor): + # Check if the winding is parallel and calculate points accordingly + if self.windings[num].parallel: # as in center_tapped transformer, RectangularSolid is used in parallel winding + num_points = len(conductor) + num_turns = num_points // 4 + point_increment = 4 + else: + num_points = len(conductor) + num_turns = num_points // 5 + point_increment = 5 + winding_list = [] - for i in range(num_windings): - winding_list.append(winding[i*5][0]) + for i in range(num_turns): + winding_list.append(conductor[i * point_increment][0]) wire_distance.append(winding_list) return wire_distance + #wire_distance = [] + #for winding_index in range(len(self.two_d_axi.p_conductor)): + #winding = self.two_d_axi.p_conductor[winding_index] + # 5 points are for 1 wire + #num_points = len(winding) + #num_windings = num_points // 5 + #winding_list = [] + #for i in range(num_windings): + #winding_list.append(winding[i * 5][0]) + # If this winding is parallel and it is the second or third winding, duplicate the last value in winding_list + #if self.windings[winding_index].parallel and (winding_index == 1 or winding_index == 2): + #winding_list.append(winding_list[-1]) + #wire_distance.append(winding_list) + + # return wire_distance + def calculate_wire_lengths(self) -> List[float]: distances = self.get_wire_distances() @@ -1424,6 +1459,7 @@ def write_electro_magnetic_parameter_pro(self): if self.windings[num].parallel: text_file.write(f"NbrCond_{num + 1} = 1;\n") text_file.write(f"AreaCell_{num + 1} = {self.windings[num].a_cell*turns};\n") + else: text_file.write(f"NbrCond_{num + 1} = {turns};\n") text_file.write(f"AreaCell_{num + 1} = {self.windings[num].a_cell};\n") @@ -1616,7 +1652,7 @@ def calculate_and_write_log(self, sweep_number: int = 1, currents: List = None, else: winding_dict["winding_losses"] = self.load_result(res_name=f"j2F_{winding + 1}", last_n=sweep_number)[sweep_run] if self.windings[winding].parallel: - winding_dict["turn_losses"].append(self.load_result(res_name=winding_name[winding] + f"/Losses_turn_{1}", last_n=sweep_number)[sweep_run]) + winding_dict["turn_losses"].append(self.load_result(res_name=winding_name[winding] + f"/Losses_turn_{1}", last_n=sweep_number)[sweep_run]) else: for turn in range(0, winding_dict["number_turns"]): winding_dict["turn_losses"].append(self.load_result(res_name=winding_name[winding] + f"/Losses_turn_{turn + 1}", last_n=sweep_number)[sweep_run]) diff --git a/femmt/examples/basic_inductor.py b/femmt/examples/basic_inductor.py index bca1a47d..d71a4e0d 100644 --- a/femmt/examples/basic_inductor.py +++ b/femmt/examples/basic_inductor.py @@ -2,7 +2,7 @@ import os def basic_example_inductor(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool =True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -22,7 +22,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -65,7 +65,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation= flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") @@ -113,7 +113,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.set_air_gaps(air_gaps) # 4. set insulations - insulation = fmt.Insulation() + insulation = fmt.Insulation(flag_insulation=False) insulation.add_core_insulations(0.001, 0.001, 0.004, 0.001) insulation.add_winding_insulations([[0.0005]]) geo.set_insulation(insulation) @@ -151,7 +151,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # 9. start simulation # 7. prepare and start thermal simulation - example_thermal_simulation(show_visual_outputs) + example_thermal_simulation(show_visual_outputs, flag_insulation= False) if __name__ == "__main__": basic_example_inductor(show_visual_outputs=True) \ No newline at end of file diff --git a/femmt/examples/basic_transformer.py b/femmt/examples/basic_transformer.py index 757193e9..09a523cf 100644 --- a/femmt/examples/basic_transformer.py +++ b/femmt/examples/basic_transformer.py @@ -4,7 +4,7 @@ def basic_example_transformer(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool =True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -13,7 +13,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -24,7 +24,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -67,7 +67,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation= flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") if not os.path.exists(example_results_folder): @@ -100,7 +100,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.set_air_gaps(air_gaps) # 4. set insulation - insulation = fmt.Insulation() + insulation = fmt.Insulation(flag_insulation=False) insulation.add_core_insulations(0.001, 0.001, 0.002, 0.001) insulation.add_winding_insulations([[0.0002, 0.001], [0.001, 0.0002]]) @@ -134,7 +134,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.create_model(freq=200000, pre_visualize_geometry=show_visual_outputs) geo.single_simulation(freq=200000, current=[2, 2], phi_deg=[0, 180], show_fem_simulation_results=show_visual_outputs) - example_thermal_simulation(show_visual_outputs) + example_thermal_simulation(show_visual_outputs, flag_insulation= False) if __name__ == "__main__": diff --git a/femmt/examples/basic_transformer_center_tapped.py b/femmt/examples/basic_transformer_center_tapped.py index fc897eec..32ffd460 100644 --- a/femmt/examples/basic_transformer_center_tapped.py +++ b/femmt/examples/basic_transformer_center_tapped.py @@ -2,7 +2,7 @@ import os def basic_example_transformer_center_tapped(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation:bool = True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -22,7 +22,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -106,6 +106,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.create_model(freq=200000, pre_visualize_geometry=show_visual_outputs) geo.single_simulation(freq=200000, current=[20, 120, 120], phi_deg=[0, 180, 180], show_fem_simulation_results=show_visual_outputs) + example_thermal_simulation(show_visual_outputs, flag_insulation=True) if __name__ == "__main__": basic_example_transformer_center_tapped(show_visual_outputs=True) \ No newline at end of file diff --git a/femmt/examples/basic_transformer_three_winding.py b/femmt/examples/basic_transformer_three_winding.py index 39bc31dc..4255147a 100644 --- a/femmt/examples/basic_transformer_three_winding.py +++ b/femmt/examples/basic_transformer_three_winding.py @@ -2,7 +2,7 @@ import os def basic_example_transformer_three_winding(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool =True): # Thermal simulation: @@ -13,7 +13,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -24,7 +24,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -67,7 +67,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation=flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") @@ -99,7 +99,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.set_air_gaps(air_gaps) # 4. set insulation - insulation = fmt.Insulation() + insulation = fmt.Insulation(flag_insulation=True) insulation.add_core_insulations(0.001, 0.001, 0.002, 0.001) insulation.add_winding_insulations([[0.0002, 0.0004, 0.0004], [0.0004, 0.0002, 0.0004], @@ -131,6 +131,9 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.create_model(freq=250000, pre_visualize_geometry=show_visual_outputs) geo.single_simulation(freq=250000, current=[4, 4, 4], phi_deg=[0, 180, 0], show_fem_simulation_results=show_visual_outputs) + # 7. prepare and start thermal simulation + example_thermal_simulation(show_visual_outputs, flag_insulation=True) + if __name__ == "__main__": basic_example_transformer_three_winding(show_visual_outputs=True) \ No newline at end of file diff --git a/femmt/functions_topologies.py b/femmt/functions_topologies.py index 04457a64..ffc04326 100644 --- a/femmt/functions_topologies.py +++ b/femmt/functions_topologies.py @@ -150,7 +150,7 @@ def set_center_tapped_windings(core, primary_additional_bobbin, :return: """ def define_insulations(): - insulation = Insulation() + insulation = Insulation(flag_insulation=True) insulation.add_core_insulations(iso_top_core, iso_bot_core, iso_left_core, iso_right_core) insulation.add_winding_insulations([[iso_primary_to_primary, iso_primary_to_secondary, iso_primary_to_secondary], [iso_primary_to_secondary, iso_secondary_to_secondary, iso_primary_to_secondary], diff --git a/femmt/mesh.py b/femmt/mesh.py index 7d58771c..03d4fbe4 100644 --- a/femmt/mesh.py +++ b/femmt/mesh.py @@ -1180,7 +1180,10 @@ def generate_thermal_mesh(self, case_gap_top, case_gap_right, case_gap_bot, colo for ww in self.model.winding_windows: for vww in ww.virtual_winding_windows: for index, winding in enumerate(self.windings): - flattened_turns[winding.winding_number] += vww.turns[index] + try: + flattened_turns[winding.winding_number] += vww.turns[index] + except: + pass for winding in self.windings: winding_number = winding.winding_number diff --git a/femmt/thermal/thermal_simulation.py b/femmt/thermal/thermal_simulation.py index 50964de8..d9082b55 100644 --- a/femmt/thermal/thermal_simulation.py +++ b/femmt/thermal/thermal_simulation.py @@ -3,7 +3,7 @@ import json import numpy as np import os -from typing import Dict +from typing import Dict, List # Third parry libraries import gmsh @@ -15,6 +15,8 @@ from femmt.data import FileData + + def create_case(boundary_regions, boundary_physical_groups, boundary_temperatures, boundary_flags, k_case, function_pro: FunctionPro, parameters_pro: ParametersPro, group_pro: GroupPro, constraint_pro: ConstraintPro): @@ -93,18 +95,38 @@ def create_windings(winding_tags, k_windings, winding_losses, conductor_radii, w k = {} regions = {} windings_total_str = "{" + tag_counters = {} + + + for winding_index, winding in enumerate(winding_tags): if winding is not None and len(winding) > 0: + if winding is not None and len(winding) > 0: + original_winding = winding[:] + #winding = list(set(winding)) # Remove duplicates from winding + if len(original_winding) > len(winding_losses[winding_index]): + # Distribute the loss of the single physical turn equally over each geometric turn for parallel windings (need to be reviewd)) + winding_losses[winding_index] = [winding_losses[winding_index][0] / len(original_winding) for _ in range(len(original_winding))] + + + for index, tag in enumerate(winding): name = f"winding_{winding_index}_{index}" windings_total_str += f"{name}, " q_vol[name] = thermal_f.calculate_heat_flux_round_wire(winding_losses[winding_index][index], conductor_radii[winding_index], wire_distances[winding_index][index]) + print(q_vol[name]) k[name] = k_windings - regions[name] = tag + if tag not in tag_counters: # The counter is needed here to create a single region for for every turn in case of parallel windings + tag_counters[tag] = 0 + else: + tag_counters[tag] += 1 + regions[name] = tag + tag_counters[tag] + #regions[name] = tag + # Needs to be added. [:-2] removes the last ', ' regions["windings_total"] = windings_total_str[:-2] + "}" @@ -150,6 +172,7 @@ def create_post_operation(thermal_file_path, thermal_influx_file_path, thermal_m append = False for winding_index, winding in enumerate(windings): if winding is not None and len(winding) > 0: + #winding = list(set(winding)) # Remove duplicates from region of parallel windings for index, tag in enumerate(winding): name = f"winding_{winding_index}_{index}" post_operation_pro.add_on_elements_of_statement("T", name, winding_file, "GmshParsed", 0, name, append) From 04ba4737e1cd4873d9260555f81084924d4c90ef Mon Sep 17 00:00:00 2001 From: abujazar Date: Thu, 3 Aug 2023 20:11:28 +0200 Subject: [PATCH 3/9] changes for wire distances of rectangular conductors --- femmt/component.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index 0de26519..2bdad677 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -590,17 +590,6 @@ def get_wire_distances(self) -> List[List[float]]: :return: Wire distances :rtype: List[List[float]] """ - #wire_distance = [] - #for winding in self.two_d_axi.p_conductor: - # 5 points are for 1 wire - #num_points = len(winding) - #num_windings = num_points//5 - #winding_list = [] - #for i in range(num_windings): - #winding_list.append(winding[i*5][0]) - #wire_distance.append(winding_list) - - #return wire_distance wire_distance = [] for num, conductor in enumerate(self.two_d_axi.p_conductor): @@ -620,22 +609,6 @@ def get_wire_distances(self) -> List[List[float]]: wire_distance.append(winding_list) return wire_distance - #wire_distance = [] - #for winding_index in range(len(self.two_d_axi.p_conductor)): - #winding = self.two_d_axi.p_conductor[winding_index] - # 5 points are for 1 wire - #num_points = len(winding) - #num_windings = num_points // 5 - #winding_list = [] - #for i in range(num_windings): - #winding_list.append(winding[i * 5][0]) - # If this winding is parallel and it is the second or third winding, duplicate the last value in winding_list - #if self.windings[winding_index].parallel and (winding_index == 1 or winding_index == 2): - #winding_list.append(winding_list[-1]) - #wire_distance.append(winding_list) - - # return wire_distance - def calculate_wire_lengths(self) -> List[float]: distances = self.get_wire_distances() From 0804185d7f0be17c2fec886514f1044512dd8252 Mon Sep 17 00:00:00 2001 From: abujazar Date: Fri, 22 Sep 2023 07:28:12 +0200 Subject: [PATCH 4/9] Thermal Simulation is working now for stacked and stacked_center_tapped transformers --- femmt/component.py | 103 ++++++++++++++++-- femmt/examples/basic_transformer_stacked.py | 4 +- ...basic_transformer_stacked_center_tapped.py | 8 +- 3 files changed, 100 insertions(+), 15 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index 64bb6d52..bd887b7b 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -258,7 +258,8 @@ def thermal_simulation(self, thermal_conductivity_dict: Dict, boundary_temperatu # Core area -> Is needed to estimate the heat flux # Power density for volumes W/m^3 - core_area = [self.calculate_core_volume()] # TODO Core area should be calculated for every core_part as needed in Thermal + #core_area = self.calculate_core_volume() + core_area = self.calculate_core_parts_volume() # Set wire radii wire_radii = [winding.conductor_radius for winding in self.windings] @@ -602,8 +603,8 @@ def calculate_core_volume(self) -> float: core_height = self.core.window_h + self.core.core_inner_diameter / 2 winding_height = self.core.window_h elif self.core.core_type == CoreType.Stacked: - core_height = self.core.window_h_bot + self.core.window_h_top + self.core.core_inner_diameter * 3 / 4 # TODO: could also be done arbitrarily - winding_height = self.core.window_h_bot + self.core.window_h_top # TODO: could also be done arbitrarily + core_height = self.core.window_h_bot + self.core.window_h_top + self.core.core_inner_diameter * 3 / 4 # TODO: could also be done arbitrarily + winding_height = self.core.window_h_bot + self.core.window_h_top # TODO: could also be done arbitrarily core_width = self.core.r_outer @@ -611,13 +612,14 @@ def calculate_core_volume(self) -> float: air_gap_volume = 0 inner_leg_width = self.core.r_inner - winding_width - for leg_position, position_value, height in self.air_gaps.midpoints: - width = 0 + if self.core.core_type == CoreType.Single: + for leg_position, position_value, height in self.air_gaps.midpoints: + width = 0 if leg_position == AirGapLegPosition.LeftLeg.value: - # left leg - # TODO this is wrong since the air gap is not centered on the y axis - width = core_width - self.core.r_inner + # left leg + # TODO this is wrong since the air gap is not centered on the y axis + width = core_width - self.core.r_inner elif leg_position == AirGapLegPosition.CenterLeg.value: # center leg width = inner_leg_width @@ -631,7 +633,85 @@ def calculate_core_volume(self) -> float: air_gap_volume += np.pi * width ** 2 * height return np.pi * (core_width ** 2 * core_height - ( - inner_leg_width + winding_width) ** 2 * winding_height + inner_leg_width ** 2 * winding_height) - air_gap_volume + inner_leg_width + winding_width) ** 2 * winding_height + inner_leg_width ** 2 * winding_height) - air_gap_volume + + def calculate_core_parts_volume(self) -> list: + + """Calculates the volume of the core excluding air. + + :return: Volume of the core. + :rtype: list + """ + + heights = [point[2] for point in self.air_gaps.midpoints] + + if self.core.core_type == CoreType.Single: + return [self.calculate_core_volume()] + + elif self.core.core_type == CoreType.Stacked: + + core_part_volume = [] + # core_part_1 + # core_part_1 is divided into 3 subparts + # subpart_1 + subpart1_1_height = self.core.window_h_bot / 2 + self.core.core_inner_diameter / 4 - heights[0] / 2 + subpart1_1_width = self.core.core_inner_diameter / 2 + subpart1_1_volume = np.pi * subpart1_1_width ** 2 * subpart1_1_height + + # subpart_2 + subpart1_2_height = self.core.core_inner_diameter / 4 + subpart1_2_width = self.core.window_w + subpart1_2_volume = np.pi * subpart1_2_width ** 2 * subpart1_2_height + + # subpart 3 + subpart1_3_height = self.core.window_h_bot + self.core.core_inner_diameter / 4 + subpart1_3_width = self.core.r_outer - self.core.r_inner + subpart1_3_volume = np.pi * subpart1_3_width ** 2 * subpart1_3_height + + core_part_1_volume = subpart1_1_volume + subpart1_2_volume + subpart1_3_volume + core_part_volume.append(core_part_1_volume) + + # core_part_2 + core_part_2_height = self.core.window_h_bot / 2 - heights[0] / 2 + core_part_2_width = self.core.core_inner_diameter / 2 + core_part_2_volume = np.pi * core_part_2_width ** 2 * core_part_2_height + core_part_volume.append(core_part_2_volume) + + # core_part_3 + core_part_3_height = self.core.core_inner_diameter / 4 + core_part_3_width = self.core.r_inner + core_part_3_volume = np.pi * core_part_3_width ** 2 * core_part_3_height + core_part_volume.append(core_part_3_volume) + + # core_part_4 + core_part_4_height = self.core.core_inner_diameter / 4 + core_part_4_width = self.core.r_outer - self.core.r_inner + core_part_4_volume = np.pi * core_part_4_width ** 2 * core_part_4_height + core_part_volume.append(core_part_4_volume) + + # core_part_5 + # core_part_5 is divided into 3 parts + # subpart_1 + subpart5_1_height = self.core.window_h_top + self.core.core_inner_diameter / 4 - heights[1] / 2 + subpart5_1_width = self.core.r_inner - self.core.window_w + subpart5_1_volume = np.pi * subpart5_1_width ** 2 * subpart5_1_height + + # subpart_2 + subpart5_2_height = self.core.core_inner_diameter / 4 + subpart5_2_width = self.core.window_w + subpart5_2_volume = np.pi * subpart5_2_width ** 2 * subpart5_2_height + + # subpart 3 + subpart5_3_height = self.core.window_h_top + self.core.core_inner_diameter / 4 + subpart5_3_width = self.core.r_outer - self.core.r_inner + subpart5_3_volume = np.pi * subpart5_3_width ** 2 * subpart5_3_height + + core_part_5_volume = subpart5_1_volume + subpart5_2_volume + subpart5_3_volume + core_part_volume.append(core_part_5_volume) + + return core_part_volume + + def calculate_core_weight(self) -> float: """ @@ -645,7 +725,10 @@ def calculate_core_weight(self) -> float: else: volumetric_mass_density = self.core.material_database.get_material_attribute( material_name=self.core.material, attribute="volumetric_mass_density") + #core_parts_volumes = self.calculate_core_parts_volume() + #core_parts_weights = [v * volumetric_mass_density for v in core_parts_volumes] return self.calculate_core_volume() * volumetric_mass_density + #return core_parts_weights def get_wire_distances(self) -> List[List[float]]: """Helper function which returns the distance (radius) of each conductor to the y-axis @@ -2174,7 +2257,7 @@ def calculate_and_write_log(self, sweep_number: int = 1, currents: List = None, # ---- Miscellaneous ---- log_dict["misc"] = { - "core_2daxi_volume": self.calculate_core_volume(), + "core_2daxi_volume": self.calculate_core_volume(), #self.calculate_core_volume(), "core_2daxi_total_volume": self.calculate_core_volume_with_air(), "core_2daxi_weight": core_weight, "wire_lengths": self.calculate_wire_lengths(), diff --git a/femmt/examples/basic_transformer_stacked.py b/femmt/examples/basic_transformer_stacked.py index 1cbbb10c..7704a1bd 100644 --- a/femmt/examples/basic_transformer_stacked.py +++ b/femmt/examples/basic_transformer_stacked.py @@ -102,7 +102,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation geo.set_air_gaps(air_gaps) # 4. set insulations - insulation = fmt.Insulation(flag_insulation=True) + insulation = fmt.Insulation(flag_insulation=False) # insulation.add_core_insulations(0.001, 0.001, 0.002, 0.001) # TODO: needed for upper and lower winding window? insulation.add_core_insulations(0.001, 0.001, 0.001, 0.001) # [bot, top, left, right] insulation.add_winding_insulations([[0.0002, 0.001], @@ -136,7 +136,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # ------------------------- # geo.get_inductances(I0=10, op_frequency=100000, skin_mesh_factor=0.5) # 7. prepare and start thermal simulation - example_thermal_simulation(show_visual_outputs, flag_insulation=True) + example_thermal_simulation(show_visual_outputs, flag_insulation=False) if __name__ == "__main__": basic_example_transformer_stacked(show_visual_outputs=True) \ No newline at end of file diff --git a/femmt/examples/basic_transformer_stacked_center_tapped.py b/femmt/examples/basic_transformer_stacked_center_tapped.py index 7c216824..0d8dead6 100644 --- a/femmt/examples/basic_transformer_stacked_center_tapped.py +++ b/femmt/examples/basic_transformer_stacked_center_tapped.py @@ -5,7 +5,7 @@ def basic_example_transformer_stacked_center_tapped(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool = True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -25,7 +25,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None# polyethylen } # Here the case size can be determined @@ -68,7 +68,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation=flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") @@ -130,6 +130,8 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.single_simulation(freq=200000, current=[20, 120, 120], phi_deg=[0, 180, 180], show_fem_simulation_results=show_visual_outputs) geo.get_inductances(I0=1, op_frequency=200000) + # 7. prepare and start thermal simulation + example_thermal_simulation(show_visual_outputs, flag_insulation=False) if __name__ == "__main__": basic_example_transformer_stacked_center_tapped(show_visual_outputs=True) \ No newline at end of file From 2fc7e1541baf8dc1d04233a6aa4be896a9e5fa36 Mon Sep 17 00:00:00 2001 From: abujazar Date: Thu, 12 Oct 2023 15:33:56 +0200 Subject: [PATCH 5/9] adapt basic examples for flag_insulation, volume calculation for core_parts --- femmt/component.py | 137 +++++++++++++++--- .../examples/basic_transformer_interleaved.py | 10 +- femmt/examples/basic_transformer_n_winding.py | 12 +- 3 files changed, 127 insertions(+), 32 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index bd887b7b..dcd2a728 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -260,6 +260,8 @@ def thermal_simulation(self, thermal_conductivity_dict: Dict, boundary_temperatu # Power density for volumes W/m^3 #core_area = self.calculate_core_volume() core_area = self.calculate_core_parts_volume() + #core_area = ff.calculate_cylinder_volume() + # Set wire radii wire_radii = [winding.conductor_radius for winding in self.windings] @@ -612,29 +614,30 @@ def calculate_core_volume(self) -> float: air_gap_volume = 0 inner_leg_width = self.core.r_inner - winding_width - if self.core.core_type == CoreType.Single: - for leg_position, position_value, height in self.air_gaps.midpoints: - width = 0 - - if leg_position == AirGapLegPosition.LeftLeg.value: - # left leg - # TODO this is wrong since the air gap is not centered on the y axis - width = core_width - self.core.r_inner - elif leg_position == AirGapLegPosition.CenterLeg.value: - # center leg - width = inner_leg_width - elif leg_position == AirGapLegPosition.RightLeg.value: - # right leg + + for leg_position, position_value, height in self.air_gaps.midpoints: + width = 0 + + if leg_position == AirGapLegPosition.LeftLeg.value: + # left leg # TODO this is wrong since the air gap is not centered on the y axis width = core_width - self.core.r_inner - else: - raise Exception(f"Invalid leg position tag {leg_position} used for an air gap.") + elif leg_position == AirGapLegPosition.CenterLeg.value: + # center leg + width = inner_leg_width + elif leg_position == AirGapLegPosition.RightLeg.value: + # right leg + # TODO this is wrong since the air gap is not centered on the y axis + width = core_width - self.core.r_inner + else: + raise Exception(f"Invalid leg position tag {leg_position} used for an air gap.") - air_gap_volume += np.pi * width ** 2 * height + air_gap_volume += np.pi * width ** 2 * height return np.pi * (core_width ** 2 * core_height - ( inner_leg_width + winding_width) ** 2 * winding_height + inner_leg_width ** 2 * winding_height) - air_gap_volume + def calculate_core_parts_volume(self) -> list: """Calculates the volume of the core excluding air. @@ -642,15 +645,96 @@ def calculate_core_parts_volume(self) -> list: :return: Volume of the core. :rtype: list """ - heights = [point[2] for point in self.air_gaps.midpoints] + core_part_volume = [] + + def get_width(part_number): + if self.stray_path: + if self.stray_path.start_index == 0: + if part_number == 2: + return self.core.core_inner_diameter / 2 + elif part_number == 3: + return self.stray_path.length + elif self.stray_path.start_index == 1: + if part_number == 2: + return self.stray_path.length + elif part_number == 3: + return self.core.core_inner_diameter / 2 + return self.core.core_inner_diameter / 2 if self.core.core_type == CoreType.Single: - return [self.calculate_core_volume()] + if self.component_type == ComponentType.IntegratedTransformer: + + # Calculate heights dynamically + sorted_midpoints = sorted(self.air_gaps.midpoints, key=lambda x: x[1]) + #finding position of first airgap + bottommost_airgap_position = sorted_midpoints[0][1] + bottommost_airgap_height = sorted_midpoints[0][2] + #finding position of last airgap + topmost_airgap_position = sorted_midpoints[-1][1] + topmost_airgap_height = sorted_midpoints[-1][2] + # finding position to get the distance between two airgaps + second_topmost_airgap_position = sorted_midpoints[-2][1] + second_topmost_airgap_height = sorted_midpoints[-2][2] + # finding position to get the distance between two airgaps + third_topmost_airgap_position = sorted_midpoints[-3][1] + third_topmost_airgap_height = sorted_midpoints[-3][2] + + + + subpart1_1_height = bottommost_airgap_position + self.core.window_h / 2 - bottommost_airgap_height / 2 + self.core.core_inner_diameter / 4 + subpart1_1_width = self.core.core_inner_diameter / 2 + subpart1_1_volume = np.pi * subpart1_1_width ** 2 * subpart1_1_height + + #subpart2 + subpart1_2_height = self.core.core_inner_diameter / 4 + subpart1_2_width = self.core.window_w + subpart1_2_volume = np.pi * subpart1_2_width ** 2 * subpart1_2_height + + #subpart2 + subpart1_3_height = self.core.window_h + self.core.core_inner_diameter / 2 + subpart1_3_width = self.core.r_outer - self.core.r_inner + subpart1_3_volume = np.pi * subpart1_3_width ** 2 * subpart1_3_height + + #subpart4 + subpart1_4_height = self.core.core_inner_diameter / 4 + subpart1_4_width = self.core.window_w + subpart1_4_volume = np.pi * subpart1_4_width ** 2 * subpart1_4_height + + #subpart1_5_height = self.air_gaps.midpoints[self.stray_path.start_index+1][1] - self.air_gaps.midpoints[self.stray_path.start_index+1][2] / 2 + subpart1_5_height = self.core.window_h / 2 - topmost_airgap_position - topmost_airgap_height / 2 + self.core.core_inner_diameter / 4 + subpart1_5_width = self.core.core_inner_diameter / 2 + subpart1_5_volume = np.pi * subpart1_5_width ** 2 * subpart1_5_height + + core_part_1_volume = subpart1_1_volume + subpart1_2_volume + subpart1_3_volume + subpart1_4_volume + subpart1_5_volume + core_part_volume.append(core_part_1_volume) + + # #core_part_2 + if len(sorted_midpoints) > 1: + core_part_2_height = topmost_airgap_position - topmost_airgap_height / 2 - (second_topmost_airgap_position + second_topmost_airgap_height / 2) + core_part_2_width = get_width(2) + + core_part_2_volume = np.pi * core_part_2_width ** 2 * core_part_2_height + core_part_volume.append(core_part_2_volume) + + #core_part_3 + if len(sorted_midpoints) > 2: + core_part_3_height = second_topmost_airgap_position - second_topmost_airgap_height / 2 - (third_topmost_airgap_position + third_topmost_airgap_height / 2) + core_part_3_width = get_width(3) + + core_part_3_volume = np.pi * core_part_3_width ** 2 * core_part_3_height + core_part_volume.append(core_part_3_volume) + + + return core_part_volume + + + else: + return [self.calculate_core_volume()] elif self.core.core_type == CoreType.Stacked: - core_part_volume = [] + # core_part_1 # core_part_1 is divided into 3 subparts # subpart_1 @@ -710,8 +794,19 @@ def calculate_core_parts_volume(self) -> list: core_part_volume.append(core_part_5_volume) return core_part_volume - - + # if self.core.core_type == CoreType.Single: + # cylinder_height = self.core.window_h + self.core.core_inner_diameter / 2 + # elif self.core.core_type == CoreType.Stacked: + # cylinder_height = self.core.window_h_bot + self.core.window_h_top + self.core.core_inner_diameter * 3 / 4 + # cylinder_diameter = self.core.r_outer + # + # core_volumes = [] # Initialize list to store each volume + # + # for _ in self.mesh.plane_surface_core: + # volume = ff.calculate_cylinder_volume(cylinder_diameter, cylinder_height) + # core_volumes.append(volume) + # + # return core_volumes # Return the list of volumes def calculate_core_weight(self) -> float: """ diff --git a/femmt/examples/basic_transformer_interleaved.py b/femmt/examples/basic_transformer_interleaved.py index 9d912416..a16d6080 100644 --- a/femmt/examples/basic_transformer_interleaved.py +++ b/femmt/examples/basic_transformer_interleaved.py @@ -2,7 +2,7 @@ import os def basic_example_transformer_interleaved(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool = True): # Thermal simulation: # The losses calculated by the magnetics simulation can be used to calculate the heat distribution of the given magnetic component # In order to use the thermal simulation, thermal conductivities for each material can be entered as well as a boundary temperature @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -22,7 +22,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -65,7 +65,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation=flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") @@ -131,7 +131,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): visualize_last_fem_simulation=show_visual_outputs) # 9. start thermal simulation - example_thermal_simulation(show_visual_outputs) + example_thermal_simulation(show_visual_outputs, flag_insulation=True) if __name__ == "__main__": diff --git a/femmt/examples/basic_transformer_n_winding.py b/femmt/examples/basic_transformer_n_winding.py index ce92ad09..5d19607b 100644 --- a/femmt/examples/basic_transformer_n_winding.py +++ b/femmt/examples/basic_transformer_n_winding.py @@ -4,7 +4,7 @@ def basic_example_transformer_n_winding(onelab_folder: str = None, show_visual_outputs: bool = True, is_test: bool = False): - def example_thermal_simulation(show_visual_outputs: bool = True): + def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation: bool = True): # Thermal simulation: @@ -15,7 +15,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 0.0263, + "air": 1.54, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -26,7 +26,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): "core": 5, # ferrite "winding": 400, # copper "air_gaps": 180, # aluminiumnitride - "insulation": 0.42 # polyethylen + "insulation": 0.42 if flag_insulation else None # polyethylen } # Here the case size can be determined @@ -69,7 +69,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): # Obviously when the model is modified and the losses can be out of date and therefore the geo.single_simulation needs to run again. geo.thermal_simulation(thermal_conductivity_dict, boundary_temperatures, boundary_flags, case_gap_top, case_gap_right, case_gap_bot, show_visual_outputs, color_scheme=fmt.colors_ba_jonas, - colors_geometry=fmt.colors_geometry_ba_jonas) + colors_geometry=fmt.colors_geometry_ba_jonas, flag_insulation=flag_insulation) example_results_folder = os.path.join(os.path.dirname(__file__), "example_results") @@ -101,7 +101,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.set_air_gaps(air_gaps) # 4. set insulation - insulation = fmt.Insulation() + insulation = fmt.Insulation(flag_insulation=True) insulation.add_core_insulations(0.001, 0.001, 0.002, 0.001) # insulation.add_winding_insulations([0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002], 0.0005) insulation.add_winding_insulations( @@ -199,7 +199,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True): geo.single_simulation(freq=250000, current=[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], phi_deg=[0, 180, 0, 180, 0, 180, 0, 180, 0, 180, 0, 180], show_fem_simulation_results=show_visual_outputs) # 7. prepare and start thermal simulation - example_thermal_simulation(show_visual_outputs=show_visual_outputs) + example_thermal_simulation(show_visual_outputs=show_visual_outputs, flag_insulation=True) # read inductances # geo.get_inductances(I0=4, op_frequency=250000, skin_mesh_factor=0.5, visualize=False) From 38be6674e91653a5f485003e1706264a2d35af6f Mon Sep 17 00:00:00 2001 From: abujazar Date: Fri, 13 Oct 2023 04:17:25 +0200 Subject: [PATCH 6/9] trying to fix core_part errors --- femmt/examples/basic_inductor.py | 4 ++-- femmt/examples/basic_transformer.py | 4 ++-- femmt/thermal/thermal_simulation.py | 30 +++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/femmt/examples/basic_inductor.py b/femmt/examples/basic_inductor.py index 8e2c7b67..6a3d1196 100644 --- a/femmt/examples/basic_inductor.py +++ b/femmt/examples/basic_inductor.py @@ -116,7 +116,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation geo.set_air_gaps(air_gaps) # 4. set insulations - insulation = fmt.Insulation(flag_insulation=False) + insulation = fmt.Insulation(flag_insulation=True) insulation.add_core_insulations(0.001, 0.001, 0.004, 0.001) insulation.add_winding_insulations([[0.0005]]) geo.set_insulation(insulation) @@ -154,7 +154,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # 9. start simulation # 7. prepare and start thermal simulation - example_thermal_simulation(show_visual_outputs, flag_insulation=False) + example_thermal_simulation(show_visual_outputs, flag_insulation=True) if __name__ == "__main__": basic_example_inductor(show_visual_outputs=True) \ No newline at end of file diff --git a/femmt/examples/basic_transformer.py b/femmt/examples/basic_transformer.py index 4cf2d794..3e9e8e30 100644 --- a/femmt/examples/basic_transformer.py +++ b/femmt/examples/basic_transformer.py @@ -101,7 +101,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation geo.set_air_gaps(air_gaps) # 4. set insulation - insulation = fmt.Insulation(flag_insulation=False) + insulation = fmt.Insulation(flag_insulation=True) insulation.add_core_insulations(0.001, 0.001, 0.002, 0.001) insulation.add_winding_insulations([[0.0002, 0.001], [0.001, 0.0002]]) @@ -135,7 +135,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation geo.create_model(freq=200000, pre_visualize_geometry=show_visual_outputs) geo.single_simulation(freq=200000, current=[2, 2], phi_deg=[0, 180], show_fem_simulation_results=show_visual_outputs) - example_thermal_simulation(show_visual_outputs, flag_insulation= False) + example_thermal_simulation(show_visual_outputs, flag_insulation= True) if __name__ == "__main__": diff --git a/femmt/thermal/thermal_simulation.py b/femmt/thermal/thermal_simulation.py index a51b1667..b5df29ae 100644 --- a/femmt/thermal/thermal_simulation.py +++ b/femmt/thermal/thermal_simulation.py @@ -74,8 +74,9 @@ def create_core_and_air_gaps(core_tags, k_core, core_area, core_parts_losses, ai regions = {} # Dictionary to hold regions for each core part core_total_str = "{" - + core_tags = [[tag] for tag in core_tags] for index, tag in enumerate(core_tags): + #tag = tag_list[0] name = f"core_part_{index + 1}" # Create a name for the core part based on its position core_total_str += f"{name}, " @@ -86,7 +87,7 @@ def create_core_and_air_gaps(core_tags, k_core, core_area, core_parts_losses, ai k[name] = k_core # Associate the core part name with its tag - regions[name] = tag # This makes it a list + regions[name] = tag[0] # as Tag is list of list if air_gaps_tag is not None: k["air_gaps"] = k_air_gaps @@ -175,9 +176,19 @@ def create_post_operation(thermal_file_path, thermal_influx_file_path, thermal_m # Add regions #core file will be GmshParsed file as we have many core parts - for core_index, core_part in enumerate(core_parts): # Assuming core_tags is a list of core tags - name = f"core_part_{core_index + 1}" - post_operation_pro.add_on_elements_of_statement("T", name, core_file, "GmshParsed", 0, name, True) + # for core_index, core_part in enumerate(core_parts): # Assuming core_tags is a list of core tags + # name = f"core_part_{core_index + 1}" + # post_operation_pro.add_on_elements_of_statement("T", name, core_file, "GmshParsed", 0, name, True) + core_parts = [[part] for part in core_parts] + core_append = False # Initialize the append flag for core parts + for core_index, core_part in enumerate(core_parts): + if core_part is not None and len(core_part) > 0: + #core_part_value = core_part[0] + + name = f"core_part_{core_index + 1}" + post_operation_pro.add_on_elements_of_statement("T", name, core_file, "GmshParsed", 0, name, core_append) + if not core_append: + core_append = True @@ -300,7 +311,10 @@ def post_operation(case_volume: float, output_file: str, sensor_points_file: str # Extract min/max/averages from core, insulations and windings (and air?) # core - core_values = parse_gmsh_parsed(core_file) # TODO : need to be reviewd as with the first run (file results are deleted), ["mean": mean_sum / len(core_values.keys())] will have (division by zero) + print("Before parsing:", core_file) + core_values = parse_gmsh_parsed(core_file) + print("After parsing:", core_values) + #core_values = parse_gmsh_parsed(core_file) # TODO : need to be reviewd as with the first run (file results are deleted), ["mean": mean_sum / len(core_values.keys())] will have (division by zero) core_parts = {} core_part_min = float('inf') @@ -329,7 +343,7 @@ def post_operation(case_volume: float, output_file: str, sensor_points_file: str "max": core_part_max, "mean": mean_sum / len(core_values.keys()) } - + print(len(core_values.keys())) # windings winding_values = parse_gmsh_parsed(winding_file) windings = {} @@ -362,7 +376,7 @@ def post_operation(case_volume: float, output_file: str, sensor_points_file: str "max": winding_max, "mean": mean_sum / len(winding_values.keys()) } - + print(len(winding_values.keys())) misc = { "case_volume": case_volume, "case_weight": -1, From 2470b965995d181aa3ca17939626e31880eae61d Mon Sep 17 00:00:00 2001 From: abujazar Date: Tue, 17 Oct 2023 03:24:34 +0200 Subject: [PATCH 7/9] editing parse_gmsh_parsed function --- femmt/component.py | 3 +-- femmt/examples/basic_inductor.py | 4 ++-- femmt/examples/basic_transformer.py | 2 +- femmt/examples/basic_transformer_center_tapped.py | 2 +- femmt/examples/basic_transformer_interleaved.py | 2 +- femmt/examples/basic_transformer_n_winding.py | 2 +- femmt/examples/basic_transformer_three_winding.py | 2 +- femmt/thermal/thermal_simulation.py | 11 +++++++---- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index dcd2a728..99d33c4d 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -2251,8 +2251,7 @@ def calculate_and_write_log(self, sweep_number: int = 1, currents: List = None, for i in range(0, len(self.mesh.plane_surface_core)): sweep_dict["core_parts"][f"core_part_{i + 1}"] = {} sweep_dict["core_parts"][f"core_part_{i + 1}"]["eddy_losses"] = \ - self.load_result(res_name=f"core_parts/CoreEddyCurrentLosses_{i + 1}", last_n=sweep_number)[ - sweep_run] + self.load_result(res_name=f"core_parts/CoreEddyCurrentLosses_{i + 1}", last_n=sweep_number)[sweep_run] sweep_dict["core_parts"][f"core_part_{i + 1}"]["hyst_losses"] = \ self.load_result(res_name=f"core_parts/p_hyst_{i + 1}", last_n=sweep_number)[sweep_run] # finding the total losses for every core_part diff --git a/femmt/examples/basic_inductor.py b/femmt/examples/basic_inductor.py index 6a3d1196..734c950d 100644 --- a/femmt/examples/basic_inductor.py +++ b/femmt/examples/basic_inductor.py @@ -12,7 +12,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, @@ -133,7 +133,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # fill_factor=None, conductor_arrangement=fmt.ConductorArrangement.Square) # 7. add conductor to vww and add winding window to MagneticComponent - vww.set_winding(winding, 9, None) + vww.set_winding(winding, 7, None) geo.set_winding_windows([winding_window]) # 8. create the model diff --git a/femmt/examples/basic_transformer.py b/femmt/examples/basic_transformer.py index 3e9e8e30..00d7e222 100644 --- a/femmt/examples/basic_transformer.py +++ b/femmt/examples/basic_transformer.py @@ -13,7 +13,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, diff --git a/femmt/examples/basic_transformer_center_tapped.py b/femmt/examples/basic_transformer_center_tapped.py index d85e18ab..457e299f 100644 --- a/femmt/examples/basic_transformer_center_tapped.py +++ b/femmt/examples/basic_transformer_center_tapped.py @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, diff --git a/femmt/examples/basic_transformer_interleaved.py b/femmt/examples/basic_transformer_interleaved.py index a16d6080..06cac511 100644 --- a/femmt/examples/basic_transformer_interleaved.py +++ b/femmt/examples/basic_transformer_interleaved.py @@ -11,7 +11,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, diff --git a/femmt/examples/basic_transformer_n_winding.py b/femmt/examples/basic_transformer_n_winding.py index 5d19607b..ffd80b7f 100644 --- a/femmt/examples/basic_transformer_n_winding.py +++ b/femmt/examples/basic_transformer_n_winding.py @@ -15,7 +15,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, diff --git a/femmt/examples/basic_transformer_three_winding.py b/femmt/examples/basic_transformer_three_winding.py index ad769e6e..e60a389e 100644 --- a/femmt/examples/basic_transformer_three_winding.py +++ b/femmt/examples/basic_transformer_three_winding.py @@ -13,7 +13,7 @@ def example_thermal_simulation(show_visual_outputs: bool = True, flag_insulation # The case parameter sets the thermal conductivity for a case which will be set around the core. # This could model some case in which the transformer is placed in together with a set potting material. thermal_conductivity_dict = { - "air": 1.54, + "air": 0.0263, "case": { # epoxy resign "top": 1.54, "top_right": 1.54, diff --git a/femmt/thermal/thermal_simulation.py b/femmt/thermal/thermal_simulation.py index b5df29ae..0e9c3c8d 100644 --- a/femmt/thermal/thermal_simulation.py +++ b/femmt/thermal/thermal_simulation.py @@ -280,6 +280,12 @@ def parse_gmsh_parsed(file_path: str): else: raise Exception(f"Unknown line: {line}") + # Append the last set of current_values to value_dict after the loop ends + if current_values: + if len(current_values) == 1: + value_dict[current_key] = current_values[0] + else: + value_dict[current_key] = np.array(current_values) return value_dict @@ -311,10 +317,7 @@ def post_operation(case_volume: float, output_file: str, sensor_points_file: str # Extract min/max/averages from core, insulations and windings (and air?) # core - print("Before parsing:", core_file) core_values = parse_gmsh_parsed(core_file) - print("After parsing:", core_values) - #core_values = parse_gmsh_parsed(core_file) # TODO : need to be reviewd as with the first run (file results are deleted), ["mean": mean_sum / len(core_values.keys())] will have (division by zero) core_parts = {} core_part_min = float('inf') @@ -507,7 +510,7 @@ def run_thermal(file_data: FileData, tags_dict: Dict, thermal_conductivity_dict: create_case(tags_dict["boundary_regions"], boundary_physical_groups, boundary_temperatures, boundary_flags, thermal_conductivity_dict["case"], function_pro, parameters_pro, group_pro, constraint_pro) create_background(tags_dict["background_tag"], thermal_conductivity_dict["air"], function_pro, group_pro) - print(tags_dict) + create_core_and_air_gaps(tags_dict["core_tags"], thermal_conductivity_dict["core"], core_area, core_parts_losses, tags_dict["air_gaps_tag"], thermal_conductivity_dict["air_gaps"], function_pro, group_pro) From c582b6334c6a23a08af5969143dde3e542b3c322 Mon Sep 17 00:00:00 2001 From: abujazar Date: Tue, 17 Oct 2023 03:56:18 +0200 Subject: [PATCH 8/9] changing in calculate_core_Volume() --- femmt/component.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/femmt/component.py b/femmt/component.py index 99d33c4d..3fb0b4e9 100644 --- a/femmt/component.py +++ b/femmt/component.py @@ -601,6 +601,8 @@ def calculate_core_volume(self) -> float: :return: Volume of the core. :rtype: float """ + core_height = None + winding_height = None if self.core.core_type == CoreType.Single: core_height = self.core.window_h + self.core.core_inner_diameter / 2 winding_height = self.core.window_h @@ -615,24 +617,25 @@ def calculate_core_volume(self) -> float: air_gap_volume = 0 inner_leg_width = self.core.r_inner - winding_width + for leg_position, position_value, height in self.air_gaps.midpoints: width = 0 - if leg_position == AirGapLegPosition.LeftLeg.value: - # left leg + if leg_position == AirGapLegPosition.LeftLeg.value: + # left leg + # TODO this is wrong since the air gap is not centered on the y axis + width = core_width - self.core.r_inner + elif leg_position == AirGapLegPosition.CenterLeg.value: + # center leg + width = inner_leg_width + elif leg_position == AirGapLegPosition.RightLeg.value: + # right leg # TODO this is wrong since the air gap is not centered on the y axis width = core_width - self.core.r_inner - elif leg_position == AirGapLegPosition.CenterLeg.value: - # center leg - width = inner_leg_width - elif leg_position == AirGapLegPosition.RightLeg.value: - # right leg - # TODO this is wrong since the air gap is not centered on the y axis - width = core_width - self.core.r_inner - else: - raise Exception(f"Invalid leg position tag {leg_position} used for an air gap.") + else: + raise Exception(f"Invalid leg position tag {leg_position} used for an air gap.") - air_gap_volume += np.pi * width ** 2 * height + air_gap_volume += np.pi * width ** 2 * height return np.pi * (core_width ** 2 * core_height - ( inner_leg_width + winding_width) ** 2 * winding_height + inner_leg_width ** 2 * winding_height) - air_gap_volume @@ -820,10 +823,8 @@ def calculate_core_weight(self) -> float: else: volumetric_mass_density = self.core.material_database.get_material_attribute( material_name=self.core.material, attribute="volumetric_mass_density") - #core_parts_volumes = self.calculate_core_parts_volume() - #core_parts_weights = [v * volumetric_mass_density for v in core_parts_volumes] return self.calculate_core_volume() * volumetric_mass_density - #return core_parts_weights + def get_wire_distances(self) -> List[List[float]]: """Helper function which returns the distance (radius) of each conductor to the y-axis From e1c5082491734927eb6aec42a45a7775df1507de Mon Sep 17 00:00:00 2001 From: abujazar Date: Fri, 20 Oct 2023 15:36:47 +0200 Subject: [PATCH 9/9] adapt test files according to new introduced core_parts for thermal simulation --- ...gnetic_inductor_core_fixed_loss_angle.json | 90 ++++----- ...core_fixed_loss_angle_foil_horizontal.json | 96 ++++----- ...r_core_fixed_loss_angle_foil_vertical.json | 68 ++++--- ...uctor_core_fixed_loss_angle_litz_wire.json | 90 ++++----- ...ectro_magnetic_inductor_core_material.json | 90 ++++----- ...ic_inductor_core_material_measurement.json | 90 ++++----- .../results/log_electro_magnetic_thermal.json | 76 ++++---- ...tic_transformer_core_fixed_loss_angle.json | 150 ++++++++------- ...rmer_integrated_core_fixed_loss_angle.json | 124 ++++++------ ...mer_interleaved_core_fixed_loss_angle.json | 182 +++++++++--------- .../fixtures/results/results_thermal.json | 74 ++++--- 11 files changed, 596 insertions(+), 534 deletions(-) diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle.json index b3c5f608..5fd58be1 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle.json @@ -4,79 +4,83 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.08057736083103678, - 0.07733072579894379, - 0.04964844751630253, - 0.02073763111638337, - 0.009391229664298572, - 0.02095646453242342, - 0.05024729254017496, - 0.07868650499175549, - 0.08333939165381178 + 0.08057736083105702, + 0.07733072579898291, + 0.04964844751628478, + 0.02073763111638346, + 0.009391229664306087, + 0.02095646453242996, + 0.05024729254020058, + 0.07868650499176949, + 0.08333939165383826 ], "flux": [ - 9.353580088139323e-05, - -8.007450177064308e-07 + 9.353580088140036e-05, + -8.007450177058432e-07 ], "flux_over_current": [ - 2.0785702006433566e-05, - -1.8140655278295135e-07 + 2.0785702006435094e-05, + -1.8140655278282152e-07 ], "V": [ - 0.512914944182372, - 58.77018785080648 + 0.512914944182005, + 58.7701878508108 ], "number_turns": 9, "I": [ 4.5, 0.0 ], - "winding_losses": 0.4709150486451306, - "P": 1.154058624410337, - "Q": 132.23292266431457, - "S": 132.23795857338078 + "winding_losses": 0.4709150486452519, + "P": 1.1540586244095112, + "Q": 132.2329226643243, + "S": 132.2379585733905 }, - "core_eddy_losses": 0.01571862829606287, - "core_hyst_losses": 0.6686138218303596, + "core_eddy_losses": 0.01571862829606507, + "core_hyst_losses": 0.6686138218304594, "core_parts": { "core_part_1": { - "eddy_losses": 0.00657139049155327, - "hyst_losses": 0.4701989479225411 + "eddy_losses": 0.00657139049155419, + "hyst_losses": 0.4701989479226126, + "total_core_part_1": 0.47677033841416677 }, "core_part_2": { - "eddy_losses": 0.00914723780450959, - "hyst_losses": 0.1984148739078189 + "eddy_losses": 0.009147237804510891, + "hyst_losses": 0.1984148739078468, + "total_core_part_2": 0.20756211171235767 } }, - "all_winding_losses": 0.4709150486451306 + "all_winding_losses": 0.4709150486452519 } ], "total_losses": { "winding1": { - "total": 0.4709150486451307, + "total": 0.47091504864525247, "turns": [ - 0.08057736083103678, - 0.07733072579894379, - 0.04964844751630253, - 0.02073763111638337, - 0.009391229664298572, - 0.02095646453242342, - 0.05024729254017496, - 0.07868650499175549, - 0.08333939165381178 + 0.08057736083105702, + 0.07733072579898291, + 0.04964844751628478, + 0.02073763111638346, + 0.009391229664306087, + 0.02095646453242996, + 0.05024729254020058, + 0.07868650499176949, + 0.08333939165383826 ] }, - "all_windings": 0.4709150486451306, - "eddy_core": 0.01571862829606287, - "hyst_core_fundamental_freq": 0.6686138218303596, - "core": 0.6843324501264224, - "total_losses": 1.155247498771553 + "all_windings": 0.4709150486452519, + "eddy_core": 0.01571862829606507, + "total_core_part_1": 0.47677033841416677, + "total_core_part_2": 0.20756211171235767, + "hyst_core_fundamental_freq": 0.6686138218304594, + "core": 0.6843324501265244, + "total_losses": 1.1552474987717765 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 10:54:09", + "date": "2023-10-20 15:17:45", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_horizontal.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_horizontal.json index f055989e..62f096e1 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_horizontal.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_horizontal.json @@ -4,75 +4,81 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.002926614321648473, - 0.01202647879613398, - 0.0313486608531296, - 0.06067189436246943, - 0.09946534075498803, - 0.1458352784303493, - 0.1940968150775521, - 0.2335115162500874, - 0.2702535701556243, - 0.2346330428645974, - 0.07097138625542547, - 0.01538738828999806 + 0.002926614321643067, + 0.01202647879611364, + 0.03134866085309905, + 0.06067189436241932, + 0.09946534075490532, + 0.1458352784303187, + 0.1940968150774607, + 0.2335115162499131, + 0.2702535701554756, + 0.234633042864431, + 0.07097138625537025, + 0.01538738828998796 ], "flux": [ - 0.0002072748943729928, - -3.869262321510046e-06 + 0.0002072748943729242, + -3.869262321408718e-06 ], "flux_over_current": [ - 6.909160848621864e-05, - -1.2922809836602567e-06 + 6.909160848619572e-05, + -1.2922809836264764e-06 ], "V": [ - 2.435892266784512, - 130.234613787004 + 2.435892266720838, + 130.2346137869608 ], "number_turns": 12, "I": [ 3.0, 0.0 ], - "winding_losses": 1.371127986412009, - "P": 3.6538384001767685, - "Q": 195.351920680506, - "S": 195.38608816550197 + "winding_losses": 1.371127986411141, + "P": 3.6538384000812565, + "Q": 195.3519206804412, + "S": 195.38608816543538 }, - "core_eddy_losses": 0.05498444728977709, - "core_hyst_losses": 2.227725967733116, - "all_winding_losses": 1.371127986412009 + "core_eddy_losses": 0.05498444728973803, + "core_hyst_losses": 2.227725967731544, + "core_parts": { + "core_part_1": { + "total_core_part_1": 2.282710415021282 + } + }, + "all_winding_losses": 1.371127986411141 } ], "total_losses": { "winding1": { - "total": 1.3711279864120036, + "total": 1.3711279864111376, "turns": [ - 0.002926614321648473, - 0.01202647879613398, - 0.0313486608531296, - 0.06067189436246943, - 0.09946534075498803, - 0.1458352784303493, - 0.1940968150775521, - 0.2335115162500874, - 0.2702535701556243, - 0.2346330428645974, - 0.07097138625542547, - 0.01538738828999806 + 0.002926614321643067, + 0.01202647879611364, + 0.03134866085309905, + 0.06067189436241932, + 0.09946534075490532, + 0.1458352784303187, + 0.1940968150774607, + 0.2335115162499131, + 0.2702535701554756, + 0.234633042864431, + 0.07097138625537025, + 0.01538738828998796 ] }, - "all_windings": 1.371127986412009, - "eddy_core": 0.05498444728977709, - "hyst_core_fundamental_freq": 2.227725967733116, - "core": 2.2827104150228927, - "total_losses": 3.6538384014349017 + "all_windings": 1.371127986411141, + "eddy_core": 0.05498444728973803, + "total_core_part_1": 2.282710415021282, + "hyst_core_fundamental_freq": 2.227725967731544, + "core": 2.282710415021282, + "total_losses": 3.6538384014324228 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 11:08:42", + "date": "2023-10-20 15:21:58", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_vertical.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_vertical.json index f8bc0148..dde71c9b 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_vertical.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_foil_vertical.json @@ -4,61 +4,67 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.08703860017239212, - 0.0217148082740151, - 0.01241587820169207, - 0.00505306816273928, - 0.001046305639598656 + 0.08703860017241397, + 0.02171480827402828, + 0.01241587820170079, + 0.005053068162739305, + 0.001046305639598696 ], "flux": [ - 3.54614125671046e-05, - -5.476756265899682e-07 + 3.546141256710918e-05, + -5.476756265531694e-07 ], "flux_over_current": [ - 1.1820455387871603e-05, - -1.8290641798530918e-07 + 1.1820455387873158e-05, + -1.829064179730445e-07 ], "V": [ - 0.3447704754222428, - 22.28103348517399 + 0.3447704753991244, + 22.28103348517692 ], "number_turns": 5, "I": [ 3.0, 0.0 ], - "winding_losses": 0.1272686604504369, - "P": 0.5171557131333642, - "Q": 33.42155022776098, - "S": 33.4255511496576 + "winding_losses": 0.1272686604504801, + "P": 0.5171557130986866, + "Q": 33.42155022776538, + "S": 33.425551149661466 }, - "core_eddy_losses": 0.00934704409965321, - "core_hyst_losses": 0.3805400084075918, - "all_winding_losses": 0.1272686604504369 + "core_eddy_losses": 0.009347044099655357, + "core_hyst_losses": 0.3805400084076812, + "core_parts": { + "core_part_1": { + "total_core_part_1": 0.3898870525073366 + } + }, + "all_winding_losses": 0.1272686604504801 } ], "total_losses": { "winding1": { - "total": 0.12726866045043722, + "total": 0.12726866045048105, "turns": [ - 0.08703860017239212, - 0.0217148082740151, - 0.01241587820169207, - 0.00505306816273928, - 0.001046305639598656 + 0.08703860017241397, + 0.02171480827402828, + 0.01241587820170079, + 0.005053068162739305, + 0.001046305639598696 ] }, - "all_windings": 0.1272686604504369, - "eddy_core": 0.00934704409965321, - "hyst_core_fundamental_freq": 0.3805400084075918, - "core": 0.389887052507245, - "total_losses": 0.5171557129576818 + "all_windings": 0.1272686604504801, + "eddy_core": 0.009347044099655357, + "total_core_part_1": 0.3898870525073366, + "hyst_core_fundamental_freq": 0.3805400084076812, + "core": 0.3898870525073366, + "total_losses": 0.5171557129578167 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 10:55:48", + "date": "2023-10-20 15:21:05", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_litz_wire.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_litz_wire.json index 28644d47..a725e327 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_litz_wire.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_fixed_loss_angle_litz_wire.json @@ -4,79 +4,83 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.01452916689303946, - 0.01400946595135911, - 0.01206386061129302, - 0.01046714667582749, - 0.009788275142277657, - 0.01001979414846602, - 0.01113607639552506, - 0.01321002303158861, - 0.01680378631299536 + 0.01452966795307973, + 0.01400992128334477, + 0.01206414470852072, + 0.01046729020359622, + 0.009788358897470166, + 0.0100198983091005, + 0.01113627889447178, + 0.0132104082127972, + 0.01680448789173269 ], "flux": [ - 9.701679224805312e-05, - -5.195299909702967e-07 + 9.701679210244213e-05, + -5.195320078332932e-07 ], "flux_over_current": [ - 2.1559287166234027e-05, - -1.279664413504589e-07 + 2.155928713387618e-05, + -1.2796689093883517e-07 ], "V": [ - 0.3618165888473677, - 60.95744836026617 + 0.3618178600285537, + 60.95744826877651 ], "number_turns": 9, "I": [ 4.5, 0.0 ], - "winding_losses": 0.1120275951623715, - "P": 0.8140873249065774, - "Q": 137.1542588105989, - "S": 137.15667482137832 + "winding_losses": 0.1120304563541137, + "P": 0.8140901850642458, + "Q": 137.15425860474716, + "S": 137.1566746325066 }, - "core_eddy_losses": 0.01606920614566715, - "core_hyst_losses": 0.6859905236008876, + "core_eddy_losses": 0.01606920612999203, + "core_hyst_losses": 0.6859905225794412, "core_parts": { "core_part_1": { - "eddy_losses": 0.006588393844613568, - "hyst_losses": 0.4799876774696081 + "eddy_losses": 0.006588393838709922, + "hyst_losses": 0.4799876766669126, + "total_core_part_1": 0.4865760705056225 }, "core_part_2": { - "eddy_losses": 0.009480812301053597, - "hyst_losses": 0.2060028461312795 + "eddy_losses": 0.009480812291282073, + "hyst_losses": 0.2060028459125291, + "total_core_part_2": 0.21548365820381116 } }, - "all_winding_losses": 0.1120275951623715 + "all_winding_losses": 0.1120304563541137 } ], "total_losses": { "winding1": { - "total": 0.11202759516237179, + "total": 0.1120304563541138, "turns": [ - 0.01452916689303946, - 0.01400946595135911, - 0.01206386061129302, - 0.01046714667582749, - 0.009788275142277657, - 0.01001979414846602, - 0.01113607639552506, - 0.01321002303158861, - 0.01680378631299536 + 0.01452966795307973, + 0.01400992128334477, + 0.01206414470852072, + 0.01046729020359622, + 0.009788358897470166, + 0.0100198983091005, + 0.01113627889447178, + 0.0132104082127972, + 0.01680448789173269 ] }, - "all_windings": 0.1120275951623715, - "eddy_core": 0.01606920614566715, - "hyst_core_fundamental_freq": 0.6859905236008876, - "core": 0.7020597297465548, - "total_losses": 0.8140873249089263 + "all_windings": 0.1120304563541137, + "eddy_core": 0.01606920612999203, + "total_core_part_1": 0.4865760705056225, + "total_core_part_2": 0.21548365820381116, + "hyst_core_fundamental_freq": 0.6859905225794412, + "core": 0.7020597287094332, + "total_losses": 0.8140901850635469 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 10:54:49", + "date": "2023-10-20 15:20:13", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material.json index b88c24d1..778ace9d 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material.json @@ -4,79 +4,83 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.08053028450355233, - 0.07728908353536308, - 0.04962615944716157, - 0.02073314081596513, - 0.00939374531902322, - 0.02095207127544631, - 0.05022506217548885, - 0.07864470180821359, - 0.08329089156126432 + 0.08053028450358944, + 0.07728908353543255, + 0.04962615944716423, + 0.02073314081596786, + 0.009393745319029501, + 0.02095207127545542, + 0.05022506217551787, + 0.07864470180825203, + 0.08329089156130774 ], "flux": [ - 9.349913016479193e-05, - -3.216209501642105e-07 + 9.349913016482143e-05, + -3.216209501874287e-07 ], "flux_over_current": [ - 2.077755165158173e-05, - -7.493481011443616e-08 + 2.0777551651588228e-05, + -7.493481011959625e-08 ], "V": [ - 0.2118731840582929, - 58.74714326537247 + 0.2118731840728827, + 58.74714326539084 ], "number_turns": 9, "I": [ 4.5, 0.0 ], - "winding_losses": 0.4706851404414779, - "P": 0.476714664131159, - "Q": 132.18107234708805, - "S": 132.18193198655072 + "winding_losses": 0.4706851404417164, + "P": 0.47671466416398606, + "Q": 132.1810723471294, + "S": 132.1819319865922 }, - "core_eddy_losses": 0.005238272112541359, - "core_hyst_losses": 0.1991574304417403, + "core_eddy_losses": 0.005238272112544699, + "core_hyst_losses": 0.1991574304419288, "core_parts": { "core_part_1": { - "eddy_losses": 0.002189318573992297, - "hyst_losses": 0.1365566551601681 + "eddy_losses": 0.002189318573993692, + "hyst_losses": 0.1365566551602975, + "total_core_part_1": 0.13874597373429118 }, "core_part_2": { - "eddy_losses": 0.003048953538549063, - "hyst_losses": 0.06260077528157174 + "eddy_losses": 0.003048953538551015, + "hyst_losses": 0.06260077528163152, + "total_core_part_2": 0.06564972882018254 } }, - "all_winding_losses": 0.4706851404414779 + "all_winding_losses": 0.4706851404417164 } ], "total_losses": { "winding1": { - "total": 0.47068514044147836, + "total": 0.4706851404417166, "turns": [ - 0.08053028450355233, - 0.07728908353536308, - 0.04962615944716157, - 0.02073314081596513, - 0.00939374531902322, - 0.02095207127544631, - 0.05022506217548885, - 0.07864470180821359, - 0.08329089156126432 + 0.08053028450358944, + 0.07728908353543255, + 0.04962615944716423, + 0.02073314081596786, + 0.009393745319029501, + 0.02095207127545542, + 0.05022506217551787, + 0.07864470180825203, + 0.08329089156130774 ] }, - "all_windings": 0.4706851404414779, - "eddy_core": 0.005238272112541359, - "hyst_core_fundamental_freq": 0.1991574304417403, - "core": 0.20439570255428166, - "total_losses": 0.6750808429957595 + "all_windings": 0.4706851404417164, + "eddy_core": 0.005238272112544699, + "total_core_part_1": 0.13874597373429118, + "total_core_part_2": 0.06564972882018254, + "hyst_core_fundamental_freq": 0.1991574304419288, + "core": 0.2043957025544735, + "total_losses": 0.6750808429961899 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 10:50:33", + "date": "2023-10-20 15:18:32", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material_measurement.json b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material_measurement.json index 0ae20d8e..5b95ef8d 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material_measurement.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_inductor_core_material_measurement.json @@ -4,79 +4,83 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.07811789012598208, - 0.07513795022513887, - 0.04831962480419095, - 0.02034351490365898, - 0.009378084304544164, - 0.02056313101450804, - 0.04891283403273235, - 0.07647069720144349, - 0.0808052733042793 + 0.07811789012601648, + 0.07513795022519928, + 0.04831962480418833, + 0.02034351490366124, + 0.009378084304557058, + 0.02056313101452742, + 0.04891283403277089, + 0.07647069720147442, + 0.08080527330429722 ], "flux": [ - 9.139573252324786e-05, - -4.27384642285096e-07 + 9.139573252326144e-05, + -4.273846423023933e-07 ], "flux_over_current": [ - 2.0310131003396858e-05, - -9.844369058721532e-08 + 2.0310131003399992e-05, + -9.844369059106052e-08 ], "V": [ - 0.2783429776269561, - 57.42554251834607 + 0.2783429776378281, + 57.42554251835494 ], "number_turns": 9, "I": [ 4.5, 0.0 ], - "winding_losses": 0.4580489999164769, - "P": 0.6262716996606512, - "Q": 129.20747066627865, - "S": 129.20898843431542 + "winding_losses": 0.4580489999166914, + "P": 0.6262716996851132, + "Q": 129.2074706662986, + "S": 129.20898843433548 }, - "core_eddy_losses": 0.005970074514340104, - "core_hyst_losses": 0.4238045669312349, + "core_eddy_losses": 0.005970074514341914, + "core_hyst_losses": 0.4238045669313867, "core_parts": { "core_part_1": { - "eddy_losses": 0.002491994027811744, - "hyst_losses": 0.2942956358669379 + "eddy_losses": 0.002491994027812486, + "hyst_losses": 0.2942956358670434, + "total_core_part_1": 0.29678762989485585 }, "core_part_2": { - "eddy_losses": 0.003478080486528357, - "hyst_losses": 0.1295089310642973 + "eddy_losses": 0.00347808048652944, + "hyst_losses": 0.1295089310643434, + "total_core_part_2": 0.13298701155087286 } }, - "all_winding_losses": 0.4580489999164769 + "all_winding_losses": 0.4580489999166914 } ], "total_losses": { "winding1": { - "total": 0.4580489999164782, + "total": 0.45804899991669235, "turns": [ - 0.07811789012598208, - 0.07513795022513887, - 0.04831962480419095, - 0.02034351490365898, - 0.009378084304544164, - 0.02056313101450804, - 0.04891283403273235, - 0.07647069720144349, - 0.0808052733042793 + 0.07811789012601648, + 0.07513795022519928, + 0.04831962480418833, + 0.02034351490366124, + 0.009378084304557058, + 0.02056313101452742, + 0.04891283403277089, + 0.07647069720147442, + 0.08080527330429722 ] }, - "all_windings": 0.4580489999164769, - "eddy_core": 0.005970074514340104, - "hyst_core_fundamental_freq": 0.4238045669312349, - "core": 0.42977464144557503, - "total_losses": 0.8878236413620519 + "all_windings": 0.4580489999166914, + "eddy_core": 0.005970074514341914, + "total_core_part_1": 0.29678762989485585, + "total_core_part_2": 0.13298701155087286, + "hyst_core_fundamental_freq": 0.4238045669313867, + "core": 0.4297746414457286, + "total_losses": 0.88782364136242 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 10:52:44", + "date": "2023-10-20 15:19:38", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_thermal.json b/tests/integration/fixtures/results/log_electro_magnetic_thermal.json index 404dc069..7f1de2b9 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_thermal.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_thermal.json @@ -4,67 +4,73 @@ "f": 100000, "winding1": { "turn_losses": [ - 0.005191803070663505, - 0.02381013923074908, - 0.06068039921025378, - 0.09263788641827077, - 0.152293203412263, - 0.04825064671041769, - 0.02263980055268162, - 0.004988884101271357 + 0.005191803070657385, + 0.02381013923073857, + 0.06068039921019962, + 0.09263788641818624, + 0.1522932034121882, + 0.04825064671041221, + 0.02263980055268533, + 0.004988884101278411 ], "flux": [ - 9.13499633161381e-05, - -1.481437190961602e-06 + 9.134996331611467e-05, + -1.481437190952988e-06 ], "flux_over_current": [ - 3.044996922625107e-05, - -4.957253860059524e-07 + 3.0449969226243222e-05, + -4.957253860030809e-07 ], "V": [ - 0.9344203385245585, - 57.39683977393538 + 0.9344203385191461, + 57.39683977392059 ], "number_turns": 8, "I": [ 3.0, 0.0 ], - "winding_losses": 0.4104927627065708, - "P": 1.4016305077868378, - "Q": 86.09525966090308, - "S": 86.10666817476266 + "winding_losses": 0.4104927627063445, + "P": 1.401630507778719, + "Q": 86.09525966088088, + "S": 86.10666817474034 }, "core_eddy_losses": 0.0, - "core_hyst_losses": 0.9922305174941147, - "all_winding_losses": 0.4104927627065708 + "core_hyst_losses": 0.9922305174935993, + "core_parts": { + "core_part_1": { + "total_core_part_1": 0.9922305174935993 + } + }, + "all_winding_losses": 0.4104927627063445 } ], "total_losses": { "winding1": { - "total": 0.41049276270657076, + "total": 0.41049276270634594, "turns": [ - 0.005191803070663505, - 0.02381013923074908, - 0.06068039921025378, - 0.09263788641827077, - 0.152293203412263, - 0.04825064671041769, - 0.02263980055268162, - 0.004988884101271357 + 0.005191803070657385, + 0.02381013923073857, + 0.06068039921019962, + 0.09263788641818624, + 0.1522932034121882, + 0.04825064671041221, + 0.02263980055268533, + 0.004988884101278411 ] }, - "all_windings": 0.4104927627065708, + "all_windings": 0.4104927627063445, "eddy_core": 0.0, - "hyst_core_fundamental_freq": 0.9922305174941147, - "core": 0.9922305174941147, - "total_losses": 1.4027232802006855 + "total_core_part_1": 0.9922305174935993, + "hyst_core_fundamental_freq": 0.9922305174935993, + "core": 0.9922305174935993, + "total_losses": 1.4027232801999436 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 11:28:05", + "date": "2023-10-20 15:24:30", "component_type": "Inductor", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.0149, "window_w": 0.01105, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_transformer_core_fixed_loss_angle.json b/tests/integration/fixtures/results/log_electro_magnetic_transformer_core_fixed_loss_angle.json index 8bc1df2d..814e6d05 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_transformer_core_fixed_loss_angle.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_transformer_core_fixed_loss_angle.json @@ -4,121 +4,127 @@ "f": 250000, "winding1": { "turn_losses": [ - 0.8151200364865538, - 0.5967245714024573, - 0.3187610560944258, - 0.1233077276732152, - 0.02569372569938749, - 0.6532107937573608, - 0.4792623946019697, - 0.2612114242099259, - 0.1035863236354099, - 0.0239885741373234 + 0.8151200364865472, + 0.5967245714024684, + 0.3187610560944314, + 0.1233077276732099, + 0.02569372569938718, + 0.6532107937573823, + 0.4792623946019806, + 0.261211424209924, + 0.103586323635406, + 0.0239885741373241 ], "flux": [ - 8.308164983303328e-06, - 5.606859512698774e-06 + 8.308164983294942e-06, + 5.606859512692874e-06 ], "flux_over_current": [ - 2.0770328527066046e-06, - 1.3995822736807956e-06 + 2.0770328527045103e-06, + 1.399582273679345e-06 ], "V": [ - -8.793834778180173, - 13.05038230265544 + -8.793834778171059, + 13.05038230264228 ], "number_turns": 10, "I": [ 4.0, 0.0 ], - "winding_losses": 3.40086662769806, - "P": -17.587669556360346, - "Q": 26.10076460531088, - "S": 31.473417885663032 + "winding_losses": 3.400866627698086, + "P": -17.587669556342117, + "Q": 26.10076460528456, + "S": 31.473417885631022 }, "winding2": { "turn_losses": [ - 0.02631449060295769, - 0.1242488756277047, - 0.3189701676840874, - 0.5966077072749462, - 0.8143954297453232, - 0.02497245867708634, - 0.1044648258155699, - 0.2617020770308137, - 0.4794685434231457, - 0.6528565650336904 + 0.02631449060296689, + 0.1242488756277235, + 0.3189701676841237, + 0.5966077072750384, + 0.8143954297454146, + 0.02497245867708991, + 0.1044648258155817, + 0.2617020770308619, + 0.4794685434232213, + 0.652856565033737 ], "flux": [ - -1.19039927924422e-05, - 8.185886959235638e-06 + -1.190399279245146e-05, + 8.185886959228308e-06 ], "flux_over_current": [ - 3.0456066847554003e-06, - -1.9434973983623715e-06 + 3.0456066847576098e-06, + -1.9434973983604534e-06 ], "V": [ - -12.87175611961806, - -18.69828385216307 + -12.8717561196065, + -18.69828385217736 ], "number_turns": 10, "I": [ -3.997563308076383, 0.13959798681000457 ], - "winding_losses": 3.40400114091533, - "P": 24.42270859586441, - "Q": 38.27222234620612, - "S": 45.40078962392558 + "winding_losses": 3.404001140915766, + "P": 24.422708595840305, + "Q": 38.27222234623389, + "S": 45.40078962393602 }, - "core_eddy_losses": 0.003742574947502717, - "core_hyst_losses": 0.0302902495099854, - "all_winding_losses": 6.80486776861339 + "core_eddy_losses": 0.003742574947501271, + "core_hyst_losses": 0.03029024950997371, + "core_parts": { + "core_part_1": { + "total_core_part_1": 0.034032824457474985 + } + }, + "all_winding_losses": 6.804867768613852 } ], "total_losses": { "winding1": { - "total": 3.4008666276980293, + "total": 3.400866627698061, "turns": [ - 0.8151200364865538, - 0.5967245714024573, - 0.3187610560944258, - 0.1233077276732152, - 0.02569372569938749, - 0.6532107937573608, - 0.4792623946019697, - 0.2612114242099259, - 0.1035863236354099, - 0.0239885741373234 + 0.8151200364865472, + 0.5967245714024684, + 0.3187610560944314, + 0.1233077276732099, + 0.02569372569938718, + 0.6532107937573823, + 0.4792623946019806, + 0.261211424209924, + 0.103586323635406, + 0.0239885741373241 ] }, "winding2": { - "total": 3.4040011409153257, + "total": 3.4040011409157587, "turns": [ - 0.02631449060295769, - 0.1242488756277047, - 0.3189701676840874, - 0.5966077072749462, - 0.8143954297453232, - 0.02497245867708634, - 0.1044648258155699, - 0.2617020770308137, - 0.4794685434231457, - 0.6528565650336904 + 0.02631449060296689, + 0.1242488756277235, + 0.3189701676841237, + 0.5966077072750384, + 0.8143954297454146, + 0.02497245867708991, + 0.1044648258155817, + 0.2617020770308619, + 0.4794685434232213, + 0.652856565033737 ] }, - "all_windings": 6.80486776861339, - "eddy_core": 0.003742574947502717, - "hyst_core_fundamental_freq": 0.0302902495099854, - "core": 0.03403282445748812, - "total_losses": 6.8389005930708775 + "all_windings": 6.804867768613852, + "eddy_core": 0.003742574947501271, + "total_core_part_1": 0.034032824457474985, + "hyst_core_fundamental_freq": 0.03029024950997371, + "core": 0.034032824457474985, + "total_losses": 6.838900593071327 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 11:11:42", + "date": "2023-10-20 15:11:46", "component_type": "Transformer", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.015, "window_w": 0.012, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_transformer_integrated_core_fixed_loss_angle.json b/tests/integration/fixtures/results/log_electro_magnetic_transformer_integrated_core_fixed_loss_angle.json index 95b4437d..91febf9a 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_transformer_integrated_core_fixed_loss_angle.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_transformer_integrated_core_fixed_loss_angle.json @@ -4,115 +4,119 @@ "f": 250000, "winding1": { "turn_losses": [ - 0.1132297903436348, - 0.1440636610902788, - 0.1994321110468745, - 0.1065176928422285 + 0.113229790343635, + 0.1440636610902724, + 0.1994321110468765, + 0.1065176928422164 ], "flux": [ - 2.281527116017833e-06, - 3.050038970955152e-06 + 2.281527116016398e-06, + 3.05003897095485e-06 ], "flux_over_current": [ - 2.8518506464476425e-07, - 3.801519201737564e-07 + 2.85185064644586e-07, + 3.801519201737189e-07 ], "V": [ - -4.777129918663706, - 3.583741216006086 + -4.777129918663235, + 3.583741216003846 ], "number_turns": 4, "I": [ 8.0, 0.0 ], - "winding_losses": 0.5632432553230153, - "P": -19.108519674654826, - "Q": 14.334964864024345, - "S": 23.88779482935759 + "winding_losses": 0.5632432553230006, + "P": -19.10851967465294, + "Q": 14.334964864015385, + "S": 23.8877948293507 }, "winding2": { "turn_losses": [ - 0.09709392967840036, - 0.1385065835859177, - 0.2115343736334769, - 0.1626514945711467, - 0.07534987825001753, - 0.02476459236767516, - 0.07187698743848421, - 0.01979825453235075 + 0.09709392967840208, + 0.1385065835859171, + 0.2115343736334724, + 0.1626514945711244, + 0.07534987824999828, + 0.0247645923676682, + 0.07187698743847404, + 0.01979825453234507 ], "flux": [ - 1.59989332178133e-06, - 6.396188367850073e-06 + 1.599893321778541e-06, + 6.396188367849494e-06 ], "flux_over_current": [ - -2.5905702221446836e-07, - -1.6298406559243326e-06 + -2.59057022213792e-07, + -1.6298406559241295e-06 ], "V": [ - -10.05975863443116, - 2.514035676101347 + -10.05975863443026, + 2.514035676097002 ], "number_turns": 8, "I": [ -3.984778792366982, 0.3486229709906328 ], - "winding_losses": 0.8015760940574701, - "P": 20.48118172469541, - "Q": -3.255406551399287, - "S": 20.738285287238448 + "winding_losses": 0.8015760940574049, + "P": 20.48118172469286, + "Q": -3.255406551390787, + "S": 20.738285287234596 }, - "core_eddy_losses": 0.0008530748745437754, - "core_hyst_losses": 0.007767932471564947, + "core_eddy_losses": 0.0008530748745433899, + "core_hyst_losses": 0.007767932471561175, "core_parts": { "core_part_1": { - "eddy_losses": 0.0007634983801010015, - "hyst_losses": 0.007451774557019985 + "eddy_losses": 0.000763498380100638, + "hyst_losses": 0.007451774557016286, + "total_core_part_1": 0.008215272937116923 }, "core_part_2": { - "eddy_losses": 8.957649444277318e-05, - "hyst_losses": 0.0003161579145449672 + "eddy_losses": 8.95764944427523e-05, + "hyst_losses": 0.0003161579145449025, + "total_core_part_2": 0.00040573440898765477 } }, - "all_winding_losses": 1.3648193493804854 + "all_winding_losses": 1.3648193493804055 } ], "total_losses": { "winding1": { - "total": 0.5632432553230167, + "total": 0.5632432553230002, "turns": [ - 0.1132297903436348, - 0.1440636610902788, - 0.1994321110468745, - 0.1065176928422285 + 0.113229790343635, + 0.1440636610902724, + 0.1994321110468765, + 0.1065176928422164 ] }, "winding2": { - "total": 0.8015760940574693, + "total": 0.8015760940574015, "turns": [ - 0.09709392967840036, - 0.1385065835859177, - 0.2115343736334769, - 0.1626514945711467, - 0.07534987825001753, - 0.02476459236767516, - 0.07187698743848421, - 0.01979825453235075 + 0.09709392967840208, + 0.1385065835859171, + 0.2115343736334724, + 0.1626514945711244, + 0.07534987824999828, + 0.0247645923676682, + 0.07187698743847404, + 0.01979825453234507 ] }, - "all_windings": 1.3648193493804854, - "eddy_core": 0.0008530748745437754, - "hyst_core_fundamental_freq": 0.007767932471564947, - "core": 0.008621007346108722, - "total_losses": 1.3734403567265943 + "all_windings": 1.3648193493804055, + "eddy_core": 0.0008530748745433899, + "total_core_part_1": 0.008215272937116923, + "total_core_part_2": 0.00040573440898765477, + "hyst_core_fundamental_freq": 0.007767932471561175, + "core": 0.008621007346104565, + "total_losses": 1.37344035672651 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 11:13:05", + "date": "2023-10-20 15:23:11", "component_type": "IntegratedTransformer", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.02, "window_w": 0.011, diff --git a/tests/integration/fixtures/results/log_electro_magnetic_transformer_interleaved_core_fixed_loss_angle.json b/tests/integration/fixtures/results/log_electro_magnetic_transformer_interleaved_core_fixed_loss_angle.json index 525d6527..2c58ea30 100644 --- a/tests/integration/fixtures/results/log_electro_magnetic_transformer_interleaved_core_fixed_loss_angle.json +++ b/tests/integration/fixtures/results/log_electro_magnetic_transformer_interleaved_core_fixed_loss_angle.json @@ -4,137 +4,143 @@ "f": 250000, "winding1": { "turn_losses": [ - 0.06805391405234136, - 0.09145754330817611, - 0.1276053062650547, - 0.1796140314946553, - 0.2491837520793671, - 0.3388847163253579, - 0.4630515792767697, - 0.4285741209767489, - 0.2429938804775827, - 0.09153351101812283, - 0.0195162539605728, - 0.07005732004485911, - 0.08761600112636682, - 0.1123735851567892, - 0.1480627230834712, - 0.1963378846298191, - 0.2628814853184701, - 0.3648108786972347, - 0.3171244784437643, - 0.147958846576184, - 0.03503097664115825 + 0.06805391405234339, + 0.09145754330817266, + 0.1276053062650451, + 0.1796140314946336, + 0.249183752079333, + 0.3388847163253159, + 0.4630515792767378, + 0.4285741209767311, + 0.2429938804775767, + 0.09153351101812121, + 0.01951625396057305, + 0.07005732004485923, + 0.08761600112636324, + 0.1123735851567811, + 0.1480627230835676, + 0.1963378846298306, + 0.2628814853184819, + 0.3648108786973263, + 0.3171244784443976, + 0.1479588465761665, + 0.03503097664115627 ], "flux": [ - 1.183750710053008e-07, - 8.294334651791238e-08 + 1.183750710232084e-07, + 8.294334659458684e-08 ], "flux_over_current": [ - 2.959555975373038e-08, - 1.5703365777783056e-08 + 2.9595559758208808e-08, + 1.5703365796953794e-08 ], "V": [ - -0.09866715712823322, - 0.1859543862023942 + -0.09866715724868652, + 0.185954386230533 ], "number_turns": 21, "I": [ 4.0, 0.0 ], - "winding_losses": 4.042722788952844, - "P": -0.19733431425646644, - "Q": 0.3719087724047884, - "S": 0.42101896225075963 + "winding_losses": 4.042722788953492, + "P": -0.19733431449737304, + "Q": 0.371908772461066, + "S": 0.42101896241338715 }, "winding2": { "turn_losses": [ - 0.1522647042064853, - 0.174717725867139, - 0.2074324641639617, - 0.2506301956960212, - 0.3047812940412247, - 0.367882926579459, - 0.4212561506607667 + 0.1522647042064873, + 0.1747177258671355, + 0.2074324641639577, + 0.2506301956960215, + 0.3047812940412071, + 0.3678829265794413, + 0.4212561506607503 ], "flux": [ - -3.266199806235779e-06, - 6.291592099275683e-07 + -3.266199806229673e-06, + 6.291592099532839e-07 ], "flux_over_current": [ - 2.7218290198879236e-07, - -5.411330067759532e-08 + 2.7218290198828277e-07, + -5.4113300679738725e-08 ], "V": [ - -1.020011687221375, - -5.130526831924445 + -1.020011687261777, + -5.130526831914839 ], "number_turns": 7, "I": [ -12.0, 1.4695761589768238e-15 ], - "winding_losses": 1.878965461215061, - "P": 6.1200701233282455, - "Q": 30.783160991546666, - "S": 31.385637781411027 + "winding_losses": 1.878965461215006, + "P": 6.120070123570659, + "Q": 30.783160991489034, + "S": 31.385637781401773 }, - "core_eddy_losses": 0.000450816615417936, - "core_hyst_losses": 0.003942034545531867, - "all_winding_losses": 5.921688250167905 + "core_eddy_losses": 0.0004508166154179859, + "core_hyst_losses": 0.003942034545532349, + "core_parts": { + "core_part_1": { + "total_core_part_1": 0.004392851160950335 + } + }, + "all_winding_losses": 5.921688250168498 } ], "total_losses": { "winding1": { - "total": 4.042722788952866, + "total": 4.042722788953514, "turns": [ - 0.06805391405234136, - 0.09145754330817611, - 0.1276053062650547, - 0.1796140314946553, - 0.2491837520793671, - 0.3388847163253579, - 0.4630515792767697, - 0.4285741209767489, - 0.2429938804775827, - 0.09153351101812283, - 0.0195162539605728, - 0.07005732004485911, - 0.08761600112636682, - 0.1123735851567892, - 0.1480627230834712, - 0.1963378846298191, - 0.2628814853184701, - 0.3648108786972347, - 0.3171244784437643, - 0.147958846576184, - 0.03503097664115825 + 0.06805391405234339, + 0.09145754330817266, + 0.1276053062650451, + 0.1796140314946336, + 0.249183752079333, + 0.3388847163253159, + 0.4630515792767378, + 0.4285741209767311, + 0.2429938804775767, + 0.09153351101812121, + 0.01951625396057305, + 0.07005732004485923, + 0.08761600112636324, + 0.1123735851567811, + 0.1480627230835676, + 0.1963378846298306, + 0.2628814853184819, + 0.3648108786973263, + 0.3171244784443976, + 0.1479588465761665, + 0.03503097664115627 ] }, "winding2": { - "total": 1.8789654612150577, + "total": 1.8789654612150004, "turns": [ - 0.1522647042064853, - 0.174717725867139, - 0.2074324641639617, - 0.2506301956960212, - 0.3047812940412247, - 0.367882926579459, - 0.4212561506607667 + 0.1522647042064873, + 0.1747177258671355, + 0.2074324641639577, + 0.2506301956960215, + 0.3047812940412071, + 0.3678829265794413, + 0.4212561506607503 ] }, - "all_windings": 5.921688250167905, - "eddy_core": 0.000450816615417936, - "hyst_core_fundamental_freq": 0.003942034545531867, - "core": 0.004392851160949803, - "total_losses": 5.926081101328855 + "all_windings": 5.921688250168498, + "eddy_core": 0.0004508166154179859, + "total_core_part_1": 0.004392851160950335, + "hyst_core_fundamental_freq": 0.003942034545532349, + "core": 0.004392851160950335, + "total_losses": 5.926081101329448 }, "simulation_settings": { "simulation_name": null, - "date": "2023-08-25 11:12:29", + "date": "2023-10-20 15:22:34", "component_type": "Transformer", - "working_directory": "/home/nikolasf/Dokumente/01_git/30_Python/FEMMT/tests/integration/temp", + "working_directory": "C:\\Users\\samba\\PycharmProjects\\FEM_Magnetics_Toolbox\\tests\\integration\\temp", "core": { "core_inner_diameter": 0.015, "window_w": 0.012, diff --git a/tests/integration/fixtures/results/results_thermal.json b/tests/integration/fixtures/results/results_thermal.json index 231c8421..3452f862 100644 --- a/tests/integration/fixtures/results/results_thermal.json +++ b/tests/integration/fixtures/results/results_thermal.json @@ -1,49 +1,61 @@ { - "core": { - "min": 20.15928442290696, - "max": 21.23228498341296, - "mean": 20.74054867007537 + "core_parts": { + "core_part_1": { + "min": 20.15928442290691, + "max": 21.23228498341263, + "mean": 20.74054867007518 + }, + "total": { + "min": 20.15928442290691, + "max": 21.23228498341263, + "mean": 20.74054867007518 + } }, "windings": { "winding_0_0": { - "min": 20.77722154058439, - "max": 20.78129896378552, - "mean": 20.778828605030903 + "min": 20.77722154058429, + "max": 20.78129896378544, + "mean": 20.77882860503081 }, "winding_0_1": { - "min": 20.86520324787987, - "max": 20.87066742939323, - "mean": 20.86781694397631 + "min": 20.86520324787963, + "max": 20.87066742939298, + "mean": 20.867816943976056 }, "winding_0_2": { - "min": 20.95962314654165, - "max": 20.96455114361748, - "mean": 20.962187895808697 + "min": 20.95962314654136, + "max": 20.96455114361719, + "mean": 20.96218789580841 }, "winding_0_3": { - "min": 21.03203456392492, - "max": 21.03496398969991, - "mean": 21.033754905179116 + "min": 21.03203456392462, + "max": 21.03496398969962, + "mean": 21.033754905178824 }, "winding_0_4": { - "min": 21.05902021215385, - "max": 21.06103547095926, - "mean": 21.0602539145121 + "min": 21.05902021215361, + "max": 21.06103547095902, + "mean": 21.060253914511854 }, "winding_0_5": { - "min": 20.99107579068692, - "max": 20.99535703035798, - "mean": 20.993258912906487 + "min": 20.99107579068684, + "max": 20.99535703035788, + "mean": 20.9932589129064 }, "winding_0_6": { - "min": 20.91348883851924, - "max": 20.91790978303432, - "mean": 20.91556421433843 + "min": 20.91348883851931, + "max": 20.91790978303437, + "mean": 20.915564214338495 + }, + "winding_0_7": { + "min": 20.84399557863777, + "max": 20.84724514360274, + "mean": 20.845297194030216 }, "total": { - "min": 20.77722154058439, - "max": 21.06103547095926, - "mean": 20.944523627393153 + "min": 20.77722154058429, + "max": 21.06103547095902, + "mean": 20.932120323222634 } }, "misc": { @@ -51,8 +63,8 @@ "case_weight": -1 }, "insulations": { - "min": 20.24849972466509, - "max": 21.15300382780542, - "mean": 20.698717796095803 + "min": 20.24849972466502, + "max": 21.15300382780513, + "mean": 20.69871779609566 } }