Skip to content

Commit 4cfef20

Browse files
authored
Merge pull request #159 from upb-lea/new_mdb
tests split up, update missing thermal test
2 parents 31b9de1 + f370de2 commit 4cfef20

33 files changed

Lines changed: 1470 additions & 1303 deletions

docs/source/user_guide_model_creation.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ This results to the following code:
2626
import femmt as fmt
2727
2828
geo = fmt.MagneticComponent(simulation_type=fmt.SimulationType.FreqDomain,
29-
component_type=fmt.ComponentType.Transformer, working_directory=working_directory,
30-
verbosity=fmt.Verbosity.ToConsole, is_gui=is_test)
29+
component_type=fmt.ComponentType.Transformer, working_directory=working_directory,
30+
onelab_verbosity=fmt.Verbosity.ToConsole)
3131
3232
The ``simulation_type`` specifies the type of simulation to be performed.
3333

3434
- If set to ``FreqDomain``, indicating a frequency domain simulation.
3535
- If set to ``TimeDomain``, indicating a time domain simulations.
3636

37-
The ``Verbosity`` controls the level of detail in the output.
37+
The ``onelab_verbosity`` controls the level of the FEM simulation software ``Onelab`` details in the output.
3838

3939
- If set to ``ToConsole``, all output messages are shown in the commend line .
4040
- If set to ``ToFile``, all output messages are written to files.
@@ -81,16 +81,15 @@ Now the core object can be created and added to the model (geo object)
8181
window_h=core_db["window_h"],
8282
core_h=core_db["core_h"])
8383
84-
core = fmt.Core(core_type=fmt.CoreType.Single,
84+
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
85+
temperature=45,
86+
permeability_datasource=fmt.DataSource.TDK_MDT,
87+
permittivity_datasource=fmt.DataSource.LEA_MTB)
88+
89+
core = fmt.Core(material=core_material,
90+
core_type=fmt.CoreType.Single,
8591
core_dimensions=core_dimensions,
86-
detailed_core_model=False,
87-
material=mdb.Material.N49, temperature=45, frequency=inductor_frequency,
88-
permeability_datasource=fmt.MaterialDataSource.Measurement,
89-
permeability_datatype=fmt.MeasurementDataType.ComplexPermeability,
90-
permeability_measurement_setup=mdb.MeasurementSetup.LEA_LK,
91-
permittivity_datasource=fmt.MaterialDataSource.Measurement,
92-
permittivity_datatype=fmt.MeasurementDataType.ComplexPermittivity,
93-
permittivity_measurement_setup=mdb.MeasurementSetup.LEA_LK, mdb_verbosity=fmt.Verbosity.Silent)
92+
detailed_core_model=False)
9493
geo.set_core(core)
9594
9695
Material database
@@ -351,7 +350,7 @@ To create a conductor have a look at the following code example:
351350

352351
.. code:: python
353352
354-
winding1 = fmt.Conductor(winding_number=0, conductivity=fmt.Conductivity.Copper)
353+
winding1 = fmt.Conductor(winding_number=0, conductivity=fmt.ConductorMaterial.Copper)
355354
winding1.set_solid_round_conductor(conductor_radius=0.0011, conductor_arrangement=fmt.ConductorArrangement.Square)
356355
357356
Add conductors to virtual winding windows

femmt/component.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def __init__(self, simulation_type: SimulationType = SimulationType.FreqDomain,
5353
component_type: ComponentType = ComponentType.Inductor, working_directory: str = None,
5454
clean_previous_results: bool = True, onelab_verbosity: Verbosity = 1, is_gui: bool = False,
5555
simulation_name: str | None = None, wwr_enabled=True):
56-
# TODO Add a enum? for the verbosity to combine silent and print_output_to_file variables
5756
"""
5857
Initialize the magnetic component.
5958
@@ -84,7 +83,7 @@ def __init__(self, simulation_type: SimulationType = SimulationType.FreqDomain,
8483
if clean_previous_results:
8584
self.file_data.clear_previous_simulation_results()
8685

87-
# Variable to set silent mode
86+
# Variable to set silent mode for onelab
8887
self.verbosity = onelab_verbosity
8988
if not gmsh.isInitialized():
9089
gmsh.initialize()

femmt/examples/advanced_inductor_air_gap_sweep.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def basic_example_sweep(onelab_folder: str | None = None, show_visual_outputs: b
5151
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
5252
temperature=25,
5353
permeability_datasource=fmt.DataSource.TDK_MDT,
54-
permittivity_datasource=fmt.DataSource.LEA_MTB,
55-
mdb_verbosity=fmt.Verbosity.Silent)
54+
permittivity_datasource=fmt.DataSource.LEA_MTB)
5655

5756
core = fmt.Core(material=core_material,
5857
core_type=fmt.CoreType.Single,

femmt/examples/advanced_inductor_sweep.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def advanced_example_inductor_sweep(onelab_folder: str = None, show_visual_outpu
4444
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
4545
temperature=30,
4646
permeability_datasource=fmt.DataSource.TDK_MDT,
47-
permittivity_datasource=fmt.DataSource.LEA_MTB,
48-
mdb_verbosity=fmt.Verbosity.Silent)
47+
permittivity_datasource=fmt.DataSource.LEA_MTB)
4948

5049
core = fmt.Core(material=core_material,
5150
core_type=fmt.CoreType.Single,

femmt/examples/basic_inductor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def example_thermal_simulation(show_thermal_visual_outputs: bool = True, flag_in
121121
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
122122
temperature=45,
123123
permeability_datasource=fmt.DataSource.TDK_MDT,
124-
permittivity_datasource=fmt.DataSource.LEA_MTB,
125-
mdb_verbosity=fmt.Verbosity.Silent)
124+
permittivity_datasource=fmt.DataSource.LEA_MTB)
126125

127126
core = fmt.Core(material=core_material,
128127
core_type=fmt.CoreType.Single,

femmt/examples/basic_inductor_excitation_sweep.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ def basic_example_inductor_excitation_sweep(onelab_folder: str = None, show_visu
6161
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
6262
temperature=25,
6363
permeability_datasource=fmt.DataSource.TDK_MDT,
64-
permittivity_datasource=fmt.DataSource.LEA_MTB,
65-
mdb_verbosity=fmt.Verbosity.Silent)
64+
permittivity_datasource=fmt.DataSource.LEA_MTB)
6665

6766
core = fmt.Core(material=core_material,
6867
core_type=fmt.CoreType.Single,

femmt/examples/basic_inductor_foil.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ def example_thermal_simulation(show_thermal_visual_outputs: bool = True, flag_in
241241
phi_mu_deg=12,
242242
dc_conductivity=0.6,
243243
eps_r_abs=0,
244-
phi_eps_deg=0,
245-
mdb_verbosity=fmt.Verbosity.Silent)
244+
phi_eps_deg=0)
246245

247246
core = fmt.Core(material=core_material,
248247
core_type=fmt.CoreType.Single,

femmt/examples/basic_inductor_foil_vertical.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ def example_thermal_simulation(show_thermal_visual_outputs: bool = True, flag_in
124124
phi_mu_deg=12,
125125
dc_conductivity=0.6,
126126
eps_r_abs=0,
127-
phi_eps_deg=0,
128-
mdb_verbosity=fmt.Verbosity.Silent)
127+
phi_eps_deg=0)
129128

130129
core = fmt.Core(material=core_material,
131130
core_type=fmt.CoreType.Single,

femmt/examples/basic_split_windings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def setup_simulation(working_directory, horizontal_split_factors, vertical_split
5353
core_material = fmt.ImportedComplexCoreMaterial(material=fmt.Material.N49,
5454
temperature=60,
5555
permeability_datasource=fmt.DataSource.TDK_MDT,
56-
permittivity_datasource=fmt.DataSource.LEA_MTB,
57-
mdb_verbosity=fmt.Verbosity.Silent)
56+
permittivity_datasource=fmt.DataSource.LEA_MTB)
5857

5958
core = fmt.Core(material=core_material,
6059
core_type=fmt.CoreType.Single,

femmt/examples/basic_transformer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ def example_thermal_simulation(show_thermal_visual_outputs: bool = True, flag_in
117117
phi_mu_deg=12,
118118
dc_conductivity=1.2,
119119
eps_r_abs=0,
120-
phi_eps_deg=0,
121-
mdb_verbosity=fmt.Verbosity.Silent)
120+
phi_eps_deg=0)
122121

123122
core = fmt.Core(material=core_material,
124123
core_type=fmt.CoreType.Single,

0 commit comments

Comments
 (0)