Skip to content

Commit 9279c66

Browse files
committed
fix indcutor core losses in fem simulation in inductor optimization
1 parent 372c482 commit 9279c66

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

femmt/optimization/io.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,13 @@ def single_fem_simulation(fem_input: IoFemInput, show_visual_outputs: bool = Fal
947947
plot_interpolation=False, show_fem_simulation_results=show_visual_outputs)
948948

949949
# read the flux per mesh cell and transfer it into losses with the help of the magnet model
950-
hyst_losses_custom = geo.calc_hystersis_losses_with_MagNet_model_PB_based_on_mesh_results(b_wave=fmt.WaveformType.Custom,
950+
hyst_losses_magnet = geo.calc_hystersis_losses_with_MagNet_model_PB_based_on_mesh_results(b_wave=fmt.WaveformType.Custom,
951951
custom_b_wave=normalized_current_interp)
952-
953952
result_dict_hyst = geo.read_log()
954953

954+
core_eddy_current_losses = result_dict_hyst['total_losses']['eddy_core']
955+
core_loss_magnet_eddy = hyst_losses_magnet + core_eddy_current_losses
956+
955957
# get the winding losses
956958
geo.excitation_sweep(frequency_list=fem_input.fft_frequency_list, current_list_list=current_amplitudes,
957959
phi_deg_list_list=phases, show_last_fem_simulation=show_visual_outputs)
@@ -961,7 +963,7 @@ def single_fem_simulation(fem_input: IoFemInput, show_visual_outputs: bool = Fal
961963
inductance=result_dict['single_sweeps'][0]['winding1']['flux_over_current'][0],
962964
p_loss_winding=result_dict['total_losses']['winding1']['total'],
963965
p_core_sine=result_dict_hyst['total_losses']['core'],
964-
p_core_magnet=hyst_losses_custom,
966+
p_core_magnet=core_loss_magnet_eddy,
965967
volume=result_dict["misc"]["core_2daxi_total_volume"]
966968
)
967969
return fem_output

0 commit comments

Comments
 (0)