Skip to content

Commit d8fcc45

Browse files
committed
Update code according review remarks.
Update comments and remove obsolete comments.
1 parent ae93ab9 commit d8fcc45

3 files changed

Lines changed: 9 additions & 34 deletions

File tree

femmt/examples/basic_inductor_with_dc_offset.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
Basic example to show how to simulate an inductor.
2+
Basic example to show how to simulate an inductor with current offset.
33
4-
After starting the program, the geometry dimensions are displayed. Verify this geometry, close the window, to continue the simulation.
5-
After a short time, B-Field and winding losses simulation results are shown. Winding losses are shown as a colormap.
6-
In the core, the magnitude B-Field in Tesla is shown. With the gmsh window, one can move the picture in the 3D way (not recommended).
7-
If you close this window, the thermal simulation will be continued, if programmed. If true, the thermal heat distribution will be displayed.
8-
To continue with the next simulation (or end the program), you need to close this window. All results are written to the result
4+
This example shows the calculation of the air gap by a given (dynamic) inductance.
5+
The dynamic inductance is calculated with a start air gap. The result of the inductance is taken to change the air gap
6+
accordingly. This changes the magnetic flux density, which influences the dynamic induction, so that the air gap will
7+
be approximated, until the requested accuracy is reached. All results are written to the result
98
folder .../femmt/examples/example_results/simulation_file_name/results/log_electro_magnetic.json. and .../results_thermal.json.
9+
and the air gap length, calculated dynamic inductance and target inductance is displayed.
1010
"""
1111
import femmt as fmt
1212
import os
@@ -87,12 +87,6 @@ def basic_example_inductor_with_dc_offset(onelab_folder: str = None, show_visual
8787

8888
# 4. set insulation
8989
# it is preferred to assign the exact dimensions of the bobbin for running electrostatic simulations or obtaining the capacitance of the inductor component
90-
# using the function below
91-
# bobbin_db = fmt.bobbin_database()["PQ 40/40"]
92-
# bobbin_dimensions = fmt.dtos.BobbinDimensions(bobbin_inner_diameter=bobbin_db["bobbin_inner_diameter"],
93-
# bobbin_window_w=bobbin_db["bobbin_window_w"],
94-
# bobbin_window_h=bobbin_db["bobbin_window_h"],
95-
# bobbin_h=bobbin_db["bobbin_h"])
9690
insulation = fmt.Insulation(flag_insulation=True)
9791
insulation.add_core_insulations(0.001, 0.001, 0.003, 0.001)
9892
insulation.add_winding_insulations([[0.0005, 0.0005]], per_layer_of_turns=False)

femmt/examples/core_materials_temp.pro

Lines changed: 0 additions & 12 deletions
This file was deleted.

femmt/optimization/io.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
class InductorOptimization:
3434
"""Reluctance model and FEM simulation for the inductor optimization."""
3535

36-
# Saturation threshold for calculation with Inductor optimization
36+
# Relative saturation threshold for material based on 'b_sat' from material data base
3737
_IO_SATURATION_THRESHOLD = 0.8
3838

3939
@staticmethod
@@ -390,14 +390,11 @@ def single_reluctance_model_simulation_dc_offset(reluctance_input: IoReluctanceM
390390
:rtype: IoReluctanceModelOutput
391391
"""
392392
if act_dynamic_mu_r_abs is None:
393-
# Variable declarationreluctance_input = {IoReluctanceModelInput} IoReluctanceModelInput(target_inductance=1e-05,
394-
# core_inner_diameter=0.02, window_w=0.012, window_h=0.013463557904098145,
395-
# turns...imported_complex_material=<femmt.model.ImportedComplexCoreMaterial object at 0x7c3ca5521e20>,
396-
# current_offset=5.998990605058874)... View
397393
dynamic_mu_r_abs = reluctance_input.material_mu_r_abs
398394
else:
399395
dynamic_mu_r_abs = act_dynamic_mu_r_abs
400396

397+
# Variable declaration
401398
previous_dynamic_mu_r_abs = dynamic_mu_r_abs
402399

403400
# prepare equidistant flux vector for the magnet loss simulation
@@ -501,13 +498,9 @@ def single_reluctance_model_simulation_dc_offset(reluctance_input: IoReluctanceM
501498

502499
winding_area = reluctance_input.turns * reluctance_input.litz_wire_diameter ** 2
503500

501+
# Winding loss calculation
504502
p_winding = 0
505503
for count, fft_frequency in enumerate(reluctance_input.fft_frequency_list):
506-
# proximity_factor_assumption = fmt.calc_proximity_factor_air_gap(
507-
# litz_wire_name=litz_wire_name, number_turns=turns, r_1=config.insulations.core_left,
508-
# frequency=fft_frequency, winding_area=winding_area,
509-
# litz_wire_material_name='Copper', temperature=config.temperature)
510-
511504
proximity_factor_assumption = fmt.calc_proximity_factor(
512505
litz_wire_name=reluctance_input.litz_wire_name, number_turns=reluctance_input.turns, window_h=reluctance_input.window_h,
513506
iso_core_top=reluctance_input.insulations.core_top, iso_core_bot=reluctance_input.insulations.core_bot,

0 commit comments

Comments
 (0)