From ec4e33cedcc185063d94c453b772d81618ae1a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C3=BCnther?= Date: Thu, 24 Nov 2022 12:19:58 +0100 Subject: [PATCH] [NF] add some masses to machine summary --- .../Methods/Machine/Machine/comp_desc_dict.py | 64 +++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/pyleecan/Methods/Machine/Machine/comp_desc_dict.py b/pyleecan/Methods/Machine/Machine/comp_desc_dict.py index e6591d50c..2c364e738 100644 --- a/pyleecan/Methods/Machine/Machine/comp_desc_dict.py +++ b/pyleecan/Methods/Machine/Machine/comp_desc_dict.py @@ -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"] @@ -165,4 +220,5 @@ def comp_desc_dict(self): ) ) + return desc_dict