Skip to content

Commit 5b60ffb

Browse files
authored
Merge pull request #573 from Eomys/summary-masses
[NF] add some masses to machine summary
2 parents 614ade4 + ec4e33c commit 5b60ffb

File tree

1 file changed

+60
-4
lines changed

1 file changed

+60
-4
lines changed

pyleecan/Methods/Machine/Machine/comp_desc_dict.py

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,80 @@ def comp_desc_dict(self):
129129
)
130130
)
131131

132+
# Stator lamination mass
133+
if M_dict is not None and "Stator-0" in M_dict and "Mlam" in M_dict["Stator-0"]:
134+
Mslam = M_dict["Stator-0"]["Mlam"]
135+
else:
136+
Mslam = None
137+
desc_dict.append(
138+
dict(
139+
{
140+
"name": "Mslam",
141+
"path": "machine.comp_masses()['Stator-0']['Mlam']",
142+
"verbose": "Stator lamination mass",
143+
"type": float,
144+
"unit": "kg",
145+
"is_input": False,
146+
"value": Mslam,
147+
}
148+
)
149+
)
150+
132151
# Stator winding mass
133152
if M_dict is not None and "Stator-0" in M_dict and "Mwind" in M_dict["Stator-0"]:
134-
Mwind = M_dict["Stator-0"]["Mwind"]
153+
Mswind = M_dict["Stator-0"]["Mwind"]
135154
else:
136-
Mwind = None
155+
Mswind = None
137156
desc_dict.append(
138157
dict(
139158
{
140-
"name": "Mwind",
159+
"name": "Mswind",
141160
"path": "machine.comp_masses()['Stator-0']['Mwind']",
142161
"verbose": "Stator winding mass",
143162
"type": float,
144163
"unit": "kg",
145164
"is_input": False,
146-
"value": Mwind,
165+
"value": Mswind,
147166
}
148167
)
149168
)
150169

170+
# Rotor lamination mass
171+
if M_dict is not None and "Rotor-0" in M_dict and "Mlam" in M_dict["Rotor-0"]:
172+
Mrlam = M_dict["Rotor-0"]["Mlam"]
173+
else:
174+
Mrlam = None
175+
desc_dict.append(
176+
dict(
177+
{
178+
"name": "Mrlam",
179+
"path": "machine.comp_masses()['Rotor-0']['Mlam']",
180+
"verbose": "Rotor lamination mass",
181+
"type": float,
182+
"unit": "kg",
183+
"is_input": False,
184+
"value": Mrlam,
185+
}
186+
)
187+
)
188+
189+
# Rotor winding mass only if necessary
190+
if M_dict is not None and "Rotor-0" in M_dict and "Mwind" in M_dict["Rotor-0"]:
191+
Mrwind = M_dict["Rotor-0"]["Mwind"]
192+
desc_dict.append(
193+
dict(
194+
{
195+
"name": "Mrwind",
196+
"path": "machine.comp_masses()['Rotor-0']['Mwind']",
197+
"verbose": "Rotor winding mass",
198+
"type": float,
199+
"unit": "kg",
200+
"is_input": False,
201+
"value": Mrwind,
202+
}
203+
)
204+
)
205+
151206
# Magnet mass only if necessary
152207
if M_dict is not None and "Rotor-0" in M_dict and "Mmag" in M_dict["Rotor-0"]:
153208
Mmag = M_dict["Rotor-0"]["Mmag"]
@@ -165,4 +220,5 @@ def comp_desc_dict(self):
165220
)
166221
)
167222

223+
168224
return desc_dict

0 commit comments

Comments
 (0)