Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui improvement #135

Merged
merged 8 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/source/user_guide_model_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ Alignment pertains to how the set of conductors is positioned within the winding
Placement Strategies
^^^^^^^^^^^^^^^^^^^^

The strategy for placing conductors is named based on the initial direction and subsequent movement. Examples include:
The strategy for placing conductors is named based on the initial direction and subsequent movement. It is only applied if the winding type is ``Single``.

For ``RoundSolid`` and ``RoundLitz`` conductors, the placement strategies are as follows:

- **VerticalUpward_HorizontalRightward**: Placement starts at the bottom, moving upward vertically, then shifts rightward horizontally for the next column.

Expand All @@ -407,6 +409,20 @@ The strategy for placing conductors is named based on the initial direction and

- **HorizontalLeftward_VerticalDownward**: Starts on the right side, moving leftward, then downward for each new row.

For ``RectangularSolid`` conductors, where the winding scheme is ``FoilVertical`` or ``FoilHorizontal``, the placement strategies are as follows:

- **FoilVerticalDistribution**: These strategies are used when distributing rectangular foil conductors vertically.

- **HorizontalRightward**: Begins placement from the left of the winding window, moving horizontally rightward for each conductor.

- **HorizontalLeftward**: Begins placement from the right of the winding window, moving horizontally leftward for each conductor.

- **FoilHorizontalDistribution**: These strategies are used when distributing rectangular foil conductors horizontally.

- **VerticalUpward**: Begins placement from the bottom of the winding window, moving upward for each conductor.

- **VerticalDownward**: Begins placement from the top of the winding window, moving downward for each conductor.


Zigzag Condition
^^^^^^^^^^^^^^^^
Expand All @@ -415,6 +431,7 @@ Zigzag placement introduces an alternating pattern in the layout:

- After completing a row or column, the direction alternates (e.g., if moving upward initially, the next is downward).
- The ``zigzag`` parameter is optional and defaults to ``False``. It can be omitted if a zigzag movement is not needed.
It is only can be used for ``RoundSolid`` and ``RoundLitz`` conductors when the winding type is ``Single``.

Now before simulating the winding window needs to be added to the model
as well:
Expand Down
42 changes: 22 additions & 20 deletions femmt/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,31 +254,31 @@ def litz_database() -> Dict:
litz_dict["1.5x105x0.1"] = {"strands_numbers": 105,
"strand_radii": 0.1e-3 / 2,
"conductor_radii": 1.5e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "",
"litz": "RUPALIT V155",
"insulation": "textile"}
litz_dict["1.4x200x0.071"] = {"strands_numbers": 200,
"strand_radii": 0.071e-3 / 2,
"conductor_radii": 1.4e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "",
"litz": "RUPALIT V155",
"insulation": "textile"}
litz_dict["2.0x405x0.071"] = {"strands_numbers": 405,
"strand_radii": 0.071e-3 / 2,
"conductor_radii": 2.0e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "",
"material_number": "",
"litz": "",
"insulation": "unknown blue plastic"}
litz_dict["2.0x800x0.05"] = {"strands_numbers": 800,
"strand_radii": 0.05e-3 / 2,
"conductor_radii": 2e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "Elektrisola",
"material_number": "12104184",
"litz": "",
Expand All @@ -287,7 +287,7 @@ def litz_database() -> Dict:
litz_dict["1.1x60x0.1"] = {"strands_numbers": 60,
"strand_radii": 0.1e-3 / 2,
"conductor_radii": 1.1e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "",
"litz": "RUPALIT V155",
Expand All @@ -296,7 +296,7 @@ def litz_database() -> Dict:
litz_dict["1.35x200x0.071"] = {"strands_numbers": 200,
"strand_radii": 0.071e-3 / 2,
"conductor_radii": 1.35e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "",
"litz": "RUPALIT V155",
Expand All @@ -305,7 +305,7 @@ def litz_database() -> Dict:
litz_dict["3.2x2100x0.05"] = {"strands_numbers": 2100,
"strand_radii": 0.05e-3 / 2,
"conductor_radii": 3.2e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "AB21220373",
"litz": "RUPALIT V155",
Expand All @@ -315,7 +315,7 @@ def litz_database() -> Dict:
litz_dict["4.6x2160x0.071"] = {"strands_numbers": 2160,
"strand_radii": 0.071e-3 / 2,
"conductor_radii": 4.6e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "AB21225497",
"litz": "RUPALIT V155",
Expand All @@ -325,7 +325,7 @@ def litz_database() -> Dict:
litz_dict["2.9x1200x0.06"] = {"strands_numbers": 1200,
"strand_radii": 0.06e-3 / 2,
"conductor_radii": 2.9e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "Elektrisola",
"material_number": "",
"litz": "",
Expand All @@ -334,7 +334,7 @@ def litz_database() -> Dict:
litz_dict["2.6x1000x0.06"] = {"strands_numbers": 1000,
"strand_radii": 0.06e-3 / 2,
"conductor_radii": 2.6e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "Elektrisola",
"material_number": "",
"litz": "",
Expand All @@ -343,7 +343,7 @@ def litz_database() -> Dict:
litz_dict["1.8x512x0.05"] = {"strands_numbers": 512,
"strand_radii": 0.05e-3 / 2,
"conductor_radii": 1.8e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "AB21217207",
"litz": "RUPALIT Safety VB155",
Expand All @@ -352,7 +352,7 @@ def litz_database() -> Dict:
litz_dict["2.3x600x0.071"] = {"strands_numbers": 600,
"strand_radii": 0.071e-3 / 2,
"conductor_radii": 2.3e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "AB21220522",
"litz": "RUPALIT Safety Profil V155",
Expand All @@ -361,7 +361,7 @@ def litz_database() -> Dict:
litz_dict["2.8x400x0.1"] = {"strands_numbers": 400,
"strand_radii": 0.1e-3 / 2,
"conductor_radii": 2.8e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "PACK",
"material_number": "AB21222210",
"litz": "RUPALIT Safety V155",
Expand All @@ -370,7 +370,7 @@ def litz_database() -> Dict:
litz_dict["1.71x140x0.1"] = {"strands_numbers": 140,
"strand_radii": 0.1e-3 / 2,
"conductor_radii": 1.71e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "",
"material_number": "",
"litz": "",
Expand All @@ -379,7 +379,7 @@ def litz_database() -> Dict:
litz_dict["1.7x500x0.06"] = {"strands_numbers": 500,
"strand_radii": 0.06e-3 / 2,
"conductor_radii": 1.7e-3 / 2,
"ff": "",
"ff": None,
"manufacturer": "",
"material_number": "",
"litz": "",
Expand Down Expand Up @@ -1018,8 +1018,9 @@ def visualize_simulation_results(simulation_result_file_path: str, store_figure_
cumulative_core_hysteresis = 0
cumulative_core_eddy = 0
cumulative_losses = []
cumulative_inductances = []
windings_labels = []
# Determine if this is a single simulation or a sweep
is_single_simulation = len(loaded_results_dict["single_sweeps"]) == 1

for index, sweep in enumerate(loaded_results_dict["single_sweeps"]):
freq = sweep['f']
Expand All @@ -1043,11 +1044,9 @@ def visualize_simulation_results(simulation_result_file_path: str, store_figure_

if len(cumulative_losses) < i:
cumulative_losses.append(loss)
cumulative_inductances.append(inductance)
windings_labels.append(f"Winding {i}")
else:
cumulative_losses[i - 1] += loss
cumulative_inductances[i - 1] += inductance

# Plot for current frequency
ax.bar(i, loss, width=0.35, label=f'{windings_labels[i - 1]} Loss at {freq} Hz')
Expand All @@ -1065,8 +1064,11 @@ def visualize_simulation_results(simulation_result_file_path: str, store_figure_

# Plot cumulative results for core and windings
fig, ax = plt.subplots()
ax.bar(0, cumulative_core_hysteresis, width=0.35, label='Cumulative Core Hysteresis Loss')
ax.bar(0, cumulative_core_eddy, bottom=cumulative_core_hysteresis, width=0.35, label='Cumulative Core Eddy Current Loss')
if is_single_simulation:
ax.bar(0, cumulative_core_hysteresis, width=0.35, label='Cumulative Core Hysteresis Loss')
ax.bar(0, cumulative_core_eddy, bottom=cumulative_core_hysteresis, width=0.35, label='Cumulative Core Eddy Current Loss')
else:
ax.bar(0, cumulative_core_eddy, width=0.35, label='Cumulative Core Eddy Current Loss')

for index, loss in enumerate(cumulative_losses):
ax.bar(index + 1, loss, width=0.35, label=f'{windings_labels[index]} Cumulative Loss')
Expand Down
Loading
Loading