Skip to content

Commit

Permalink
Merge pull request #573 from Eomys/summary-masses
Browse files Browse the repository at this point in the history
[NF] add some masses to machine summary
  • Loading branch information
BonneelP authored Jan 3, 2023
2 parents 614ade4 + ec4e33c commit 5b60ffb
Showing 1 changed file with 60 additions and 4 deletions.
64 changes: 60 additions & 4 deletions pyleecan/Methods/Machine/Machine/comp_desc_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,80 @@ def comp_desc_dict(self):
)
)

# Stator lamination mass
if M_dict is not None and "Stator-0" in M_dict and "Mlam" in M_dict["Stator-0"]:
Mslam = M_dict["Stator-0"]["Mlam"]
else:
Mslam = None
desc_dict.append(
dict(
{
"name": "Mslam",
"path": "machine.comp_masses()['Stator-0']['Mlam']",
"verbose": "Stator lamination mass",
"type": float,
"unit": "kg",
"is_input": False,
"value": Mslam,
}
)
)

# Stator winding mass
if M_dict is not None and "Stator-0" in M_dict and "Mwind" in M_dict["Stator-0"]:
Mwind = M_dict["Stator-0"]["Mwind"]
Mswind = M_dict["Stator-0"]["Mwind"]
else:
Mwind = None
Mswind = None
desc_dict.append(
dict(
{
"name": "Mwind",
"name": "Mswind",
"path": "machine.comp_masses()['Stator-0']['Mwind']",
"verbose": "Stator winding mass",
"type": float,
"unit": "kg",
"is_input": False,
"value": Mwind,
"value": Mswind,
}
)
)

# Rotor lamination mass
if M_dict is not None and "Rotor-0" in M_dict and "Mlam" in M_dict["Rotor-0"]:
Mrlam = M_dict["Rotor-0"]["Mlam"]
else:
Mrlam = None
desc_dict.append(
dict(
{
"name": "Mrlam",
"path": "machine.comp_masses()['Rotor-0']['Mlam']",
"verbose": "Rotor lamination mass",
"type": float,
"unit": "kg",
"is_input": False,
"value": Mrlam,
}
)
)

# Rotor winding mass only if necessary
if M_dict is not None and "Rotor-0" in M_dict and "Mwind" in M_dict["Rotor-0"]:
Mrwind = M_dict["Rotor-0"]["Mwind"]
desc_dict.append(
dict(
{
"name": "Mrwind",
"path": "machine.comp_masses()['Rotor-0']['Mwind']",
"verbose": "Rotor winding mass",
"type": float,
"unit": "kg",
"is_input": False,
"value": Mrwind,
}
)
)

# Magnet mass only if necessary
if M_dict is not None and "Rotor-0" in M_dict and "Mmag" in M_dict["Rotor-0"]:
Mmag = M_dict["Rotor-0"]["Mmag"]
Expand All @@ -165,4 +220,5 @@ def comp_desc_dict(self):
)
)


return desc_dict

0 comments on commit 5b60ffb

Please sign in to comment.