Beispiel #1
0
    def setUp(self):
        """Run at the begining of every test to setup the gui"""

        self.test_obj = Lamination(Rint=0.1,
                                   Rext=1,
                                   is_stator=True,
                                   is_internal=True)
        self.test_obj.axial_vent.append(
            VentilationCirc(Zh=8, H0=10e-3, D0=40e-3, Alpha0=0))
        self.test_obj.axial_vent.append(
            VentilationCirc(Zh=9, H0=20e-3, D0=50e-3, Alpha0=0))

        self.widget = DAVDuct(self.test_obj)
Beispiel #2
0
    def test_Lam_Mag_10_inset(self):
        """Test machine plot with Magnet 10 inset"""

        plt.close("all")
        rotor = LamSlotMag(
            Rint=40e-3,
            Rext=100e-3,
            is_internal=True,
            is_stator=False,
            L1=0.45,
            Nrvd=1,
            Wrvd=0.05,
        )
        magnet = [MagnetType10(Lmag=0.5, Hmag=0.02, Wmag=0.04)]
        rotor.slot = SlotMFlat(Zs=4, W0=0.04, H0=0.02, magnet=magnet)
        rotor.mat_type.mag = MatMagnetics(Wlam=0.5e-3)

        rotor.axial_vent.append(VentilationCirc(Zh=4, Alpha0=0, D0=2.5e-3, H0=50e-3))
        rotor.axial_vent.append(VentilationCirc(Zh=8, Alpha0=0, D0=5e-3, H0=60e-3))
        rotor.axial_vent.append(VentilationCirc(Zh=12, Alpha0=0, D0=10e-3, H0=70e-3))

        stator = LamSlotMag(
            Rint=110e-3,
            Rext=200e-3,
            is_internal=False,
            is_stator=True,
            L1=0.45,
            Nrvd=1,
            Wrvd=0.05,
        )

        magnet2 = [MagnetType10(Lmag=0.5, Hmag=0.02, Wmag=0.04)]
        stator.slot = SlotMFlat(Zs=8, W0=0.04, W3=2 * pi / 64, H0=0.02, magnet=magnet2)
        stator.mat_type.mag = MatMagnetics(Wlam=0.5e-3)

        stator.axial_vent.append(
            VentilationTrap(Zh=6, Alpha0=pi / 6, W1=10e-3, W2=20e-3, D0=0.02, H0=0.140)
        )
        stator.axial_vent.append(
            VentilationTrap(Zh=6, Alpha0=pi / 6, W1=20e-3, W2=40e-3, D0=0.02, H0=0.170)
        )

        rotor.plot()
        fig = plt.gcf()
        self.assertEqual(len(fig.axes[0].patches), 30)
        fig.savefig(join(save_path, "test_Lam_Mag_10i_2-Rotor.png"))

        stator.plot()
        fig = plt.gcf()
        self.assertEqual(len(fig.axes[0].patches), 22)
        fig.savefig(join(save_path, "test_Lam_Mag_10i_3-Stator.png"))
Beispiel #3
0
    def test_clean_vent(self):
        """Test that you can clean the ventilation"""

        self.assertFalse(self.widget_1.g_ax_vent.isChecked())

        self.test_obj.stator.axial_vent = list()
        self.test_obj.stator.axial_vent.append(VentilationCirc(Zh=8))
        self.test_obj.stator.axial_vent.append(VentilationCirc(Zh=10))
        self.widget_1 = SLamParam(machine=self.test_obj,
                                  matlib=self.matlib,
                                  is_stator=True)
        self.assertTrue(self.widget_1.g_ax_vent.isChecked())

        self.widget_1.g_ax_vent.setChecked(False)
        self.assertEqual(self.test_obj.stator.axial_vent, list())
Beispiel #4
0
    def test_Lam_Wind_28_wind_rad_tan(self):
        """Test machine plot with Slot 28 and winding rad=1, tan=2 and rad=2 and tan=1
        """
        print("\nTest plot Slot 28")
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotWind(
            Rint=35e-3,
            Rext=84e-3,
            is_internal=True,
            is_stator=False,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.rotor.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=15e-3, H0=0.045)
        ]
        test_obj.rotor.slot = SlotW28(
            Zs=42, W0=3.5e-3, H0=0.45e-3, R1=3.5e-3, H3=14e-3, W3=5e-3
        )
        test_obj.rotor.winding = WindingCW2LT(qs=3, p=3)
        test_obj.rotor.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=85e-3,
            Rext=0.2,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.slot = SlotW28(
            Zs=18, W0=7e-3, R1=10e-3, H0=5e-3, H3=30e-3, W3=5e-3
        )
        test_obj.stator.winding = WindingDW2L(qs=3, p=3, Lewout=60e-3)
        test_obj.stator.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=0.2, Rext=0.25, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_1-Machine.png"))
        # Rotor + stator + 2 for frame + 1 for Shaft
        self.assertEqual(len(fig.axes[0].patches), 133)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_2-Rotor.png"))
        # 2 for lam + Zs*2 for wind + 6 vent
        self.assertEqual(len(fig.axes[0].patches), 92)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_3-Stator.png"))
        # 2 for lam, 2*Zs for wind
        self.assertEqual(len(fig.axes[0].patches), 38)
Beispiel #5
0
    def test_Lam_Wind_28_wind_22(self):
        """Test machine plot with Slot 28 and winding rad=2, tan=2
        """
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotWind(
            Rint=0.01,
            Rext=0.129,
            is_internal=True,
            is_stator=False,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.rotor.slot = SlotW28(
            Zs=6, W0=20e-3, R1=25e-3, H0=10e-3, H3=50e-3, W3=15e-3
        )
        test_obj.rotor.winding = WindingUD(
            user_wind_mat=wind_mat, qs=4, p=4, Lewout=60e-3
        )
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.13,
            Rext=0.4,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=60e-3, H0=0.25)
        ]
        test_obj.stator.slot = SlotW28(
            Zs=6, W0=40e-3, R1=50e-3, H0=10e-3, H3=70e-3, W3=85e-3
        )
        test_obj.stator.winding = WindingUD(
            user_wind_mat=wind_mat, qs=4, p=4, Lewout=60e-3
        )

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_4-Machine.png"))
        # Rotor + stator + 0 for frame + 1 for shaft
        self.assertEqual(len(fig.axes[0].patches), 59)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_5-Rotor.png"))
        # 2 for lam + Zs*4 for wind
        self.assertEqual(len(fig.axes[0].patches), 26)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s28_6-Stator.png"))
        # 2 for lam, 4*Zs for wind + 6 vents
        self.assertEqual(len(fig.axes[0].patches), 32)
    def setUp(self):
        """Run at the begining of every test to setup the machine"""
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamHole(is_internal=True,
                                 Rint=0.021,
                                 Rext=0.075,
                                 is_stator=False,
                                 L1=0.7)
        test_obj.rotor.hole = list()
        test_obj.rotor.hole.append(
            HoleM50(
                Zh=8,
                W0=50e-3,
                W1=2e-3,
                W2=1e-3,
                W3=1e-3,
                W4=20.6e-3,
                H0=17.3e-3,
                H1=1.25e-3,
                H2=0.5e-3,
                H3=6.8e-3,
                H4=0,
            ))
        test_obj.rotor.axial_vent = list()
        test_obj.rotor.axial_vent.append(
            VentilationCirc(Zh=8, Alpha0=0, D0=5e-3, H0=40e-3))
        test_obj.rotor.axial_vent.append(
            VentilationCirc(Zh=8, Alpha0=pi / 8, D0=7e-3, H0=40e-3))
        test_obj.rotor.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1.2)

        test_obj.stator = Lamination(Rint=0.078,
                                     Rext=0.104,
                                     is_internal=False,
                                     is_stator=True,
                                     L1=0.8)
        test_obj.stator.axial_vent.append(
            VentilationPolar(Zh=8, H0=0.08, D0=0.01, W1=pi / 8, Alpha0=pi / 8))
        test_obj.stator.axial_vent.append(
            VentilationPolar(Zh=8, H0=0.092, D0=0.01, W1=pi / 8, Alpha0=0))
        test_obj.stator.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=0.104, Rext=0.114, Lfra=1)

        self.test_obj = test_obj
Beispiel #7
0
    def test_text_vent(self):
        """Test the text avd"""
        self.assertEqual(self.widget_1.out_axial_duct.text(),
                         "Axial: 0 set (0 ducts)")

        self.test_obj.stator.axial_vent = list()
        self.test_obj.stator.axial_vent.append(VentilationCirc(Zh=8))
        self.test_obj.stator.axial_vent.append(VentilationCirc(Zh=10))
        self.widget_1 = SLamParam(machine=self.test_obj,
                                  matlib=self.matlib,
                                  is_stator=True)
        self.assertEqual(self.widget_1.out_axial_duct.text(),
                         "Axial: 2 set (18 ducts)")

        self.test_obj.stator.axial_vent = list()
        self.test_obj.stator.axial_vent.append(VentilationTrap(Zh=20))
        self.widget_1 = SLamParam(machine=self.test_obj,
                                  matlib=self.matlib,
                                  is_stator=True)
        self.assertEqual(self.widget_1.out_axial_duct.text(),
                         "Axial: 1 set (20 ducts)")
Beispiel #8
0
    def test_init_all_type(self):
        """Check that you can combine several kind of ventilations
        """
        self.test_obj = Lamination(Rint=0.1,
                                   Rext=1,
                                   is_stator=True,
                                   is_internal=True)
        self.test_obj.axial_vent.append(
            VentilationCirc(Zh=8, H0=10e-3, D0=40e-3, Alpha0=0))
        self.test_obj.axial_vent.append(
            VentilationTrap(Zh=4,
                            H0=24e-3,
                            D0=34e-3,
                            W1=44e-3,
                            W2=54e-3,
                            Alpha0=0))
        self.test_obj.axial_vent.append(
            VentilationPolar(Zh=3, H0=23e-3, D0=33e-3, W1=43e-3, Alpha0=0))
        self.widget = DAVDuct(self.test_obj)

        self.assertEqual(self.widget.tab_vent.count(), 3)
        self.assertEqual(self.widget.tab_vent.currentIndex(), 0)

        # First set
        self.assertEqual(type(self.widget.tab_vent.widget(0).w_vent),
                         PVentCirc)
        self.assertEqual(
            self.widget.tab_vent.widget(0).c_vent_type.currentIndex(), 0)
        self.assertEqual(
            self.widget.tab_vent.widget(0).w_vent.si_Zh.value(), 8)

        # 2nd set
        self.assertEqual(type(self.widget.tab_vent.widget(1).w_vent),
                         PVentTrap)
        self.assertEqual(
            self.widget.tab_vent.widget(1).c_vent_type.currentIndex(), 1)
        self.assertEqual(
            self.widget.tab_vent.widget(1).w_vent.si_Zh.value(), 4)

        # 3rd set
        self.assertEqual(type(self.widget.tab_vent.widget(2).w_vent),
                         PVentPolar)
        self.assertEqual(
            self.widget.tab_vent.widget(2).c_vent_type.currentIndex(), 2)
        self.assertEqual(
            self.widget.tab_vent.widget(2).w_vent.si_Zh.value(), 3)
Beispiel #9
0
    def s_add(self, vent=False):
        """Signal to add a new hole

        Parameters
        ----------
        self : DAVDuct
            A DAVDuct widget
        vent : Ventilation
            The ventilation to init the GUI with
        """
        # Create a new hole if needed
        if type(vent) is bool:
            # Default Hole is Circular
            vent_obj = VentilationCirc()
            vent_obj._set_None()
            self.lam.axial_vent.append(vent_obj)
            index = len(self.lam.axial_vent) - 1
        else:
            index = self.lam.axial_vent.index(vent)
        tab = WVent(self.lam, index=index)
        self.tab_vent.addTab(tab, "Vent " + str(index + 1))
Beispiel #10
0
    def __init__(self, lamination):
        """Initialize the widget according the current lamination

        Parameters
        ----------
        self : DAVDuct
            A DAVDuct widget
        lam : Lamination
            current lamination to edit
        """
        # Build the interface according to the .ui file
        QDialog.__init__(self)
        self.setupUi(self)

        self.obj = lamination  # Current object
        self.lam = Lamination(
            init_dict=Lamination.as_dict(lamination))  # Copy to modify

        # Init the GUI
        if len(self.lam.axial_vent) == 0:  # No vent => init circle
            self.lam.axial_vent.append(VentilationCirc())
            self.lam.axial_vent[0]._set_None()

        self.tab_vent.clear()
        for vent in self.lam.axial_vent:
            self.s_add(vent)
        self.tab_vent.setCurrentIndex(0)

        # Set Help URL
        self.b_help.url = "https://eomys.com/produits/manatee/howtos/article/"
        self.b_help.url += "how-to-add-ventilation-ducts"

        self.b_new.clicked.connect(self.s_add)
        self.b_remove.clicked.connect(self.s_remove)
        self.b_plot.clicked.connect(self.plot)
        self.b_cancel.clicked.connect(self.reject)
        self.b_ok.clicked.connect(self.valid_vent)
Beispiel #11
0
    def test_Lam_Wind_27_wind_22(self):
        """Test machine plot with Slot 27 and winding rad=2, tan=2
        """
        print("\nTest plot Slot 27")
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotWind(
            Rint=0.2,
            Rext=0.5,
            is_internal=True,
            is_stator=False,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.rotor.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=60e-3, H0=0.35)
        ]
        test_obj.rotor.slot = SlotW27(Zs=6,
                                      H0=0.05,
                                      W0=30e-3,
                                      H1=0.125,
                                      W1=0.06,
                                      H2=0.05,
                                      W2=0.09,
                                      W3=0.04)
        test_obj.rotor.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.rotor.winding = WindingUD(user_wind_mat=wind_mat,
                                           qs=4,
                                           p=4,
                                           Lewout=60e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.51,
            Rext=0.8,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.slot = SlotW27(Zs=18,
                                       H0=0.05,
                                       W0=30e-3,
                                       H1=0.07,
                                       W1=0.05,
                                       H2=0.15,
                                       W2=0.1,
                                       W3=0.05)
        test_obj.stator.winding = WindingDW2L(qs=3, p=3)
        test_obj.stator.winding.Lewout = 60e-3
        test_obj.stator.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=0.8, Rext=0.9, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s27_1-Machine.png"))
        # Rotor + Stator + 2 for frame + 1 for shaft
        self.assertEqual(len(fig.axes[0].patches), 73)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s27_2-Rotor.png"))
        # 2 for lam + 4*Zs for wind + 6 vent
        self.assertEqual(len(fig.axes[0].patches), 32)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s27_3-Stator.png"))
        # 2 for lam + 2*Zs for wind
        self.assertEqual(len(fig.axes[0].patches), 38)
Beispiel #12
0
    def test_Lam_Wind_26_wind_22(self):
        """Test machine plot with Slot 26 and winding rad=2, tan=2
        """
        print("\nTest plot Slot 26")
        plt.close("all")
        test_obj = MachineDFIM()
        test_obj.rotor = LamSlotWind(
            Rint=0.2,
            Rext=0.5,
            is_internal=True,
            is_stator=False,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.rotor.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=60e-3, H0=0.35)
        ]
        test_obj.rotor.slot = SlotW26(Zs=6,
                                      W0=20e-3,
                                      R1=30e-3,
                                      R2=20e-3,
                                      H0=20e-3,
                                      H1=20e-3)
        test_obj.rotor.winding = WindingUD(user_wind_mat=wind_mat,
                                           qs=4,
                                           p=4,
                                           Lewout=60e-3)
        test_obj.rotor.mat_type.mag = MatMagnetics(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.51,
            Rext=0.8,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.winding = WindingDW2L(qs=3, p=3)
        test_obj.stator.slot = SlotW26(Zs=18,
                                       W0=40e-3,
                                       R1=60e-3,
                                       R2=70e-3,
                                       H0=20e-3,
                                       H1=40e-3)
        test_obj.stator.mat_type.mag = MatMagnetics(Wlam=0.5e-3)
        test_obj.stator.winding.Lewout = 60e-3
        test_obj.frame = Frame(Rint=0.8, Rext=0.9, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s26_1-Machine.png"))
        # Rotor + Stator + 2 for frame + 1 for shaft
        self.assertEqual(len(fig.axes[0].patches), 73)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s26_2-Rotor.png"))
        # 2 for lam + 6 vent + 4*Zs for wind
        self.assertEqual(len(fig.axes[0].patches), 32)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s26_3-Stator.png"))
        # 2 for lam + Zs*2 for wind
        self.assertEqual(len(fig.axes[0].patches), 38)

        tooth = test_obj.rotor.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s26_Tooth_in.png"))

        tooth = test_obj.stator.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s26_Tooth_out.png"))
Beispiel #13
0
    def test_Lam_Wind_29_wind_22(self):
        """Test machine plot with Slot 29 and winding rad=2, tan=2
        """
        print("\nTest plot Slot 29")
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotWind(
            Rint=0.1, Rext=0.5, is_internal=True, is_stator=False, L1=0.9, Nrvd=2
        )
        test_obj.rotor.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=60e-3, H0=0.35)
        ]
        test_obj.rotor.slot = SlotW29(
            Zs=6, W0=0.05, H0=0.05, H1=0.1, W1=0.1, H2=0.2, W2=0.15
        )
        test_obj.rotor.winding = WindingUD(
            user_wind_mat=wind_mat, qs=4, p=4, Lewout=60e-3
        )
        test_obj.rotor.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.51,
            Rext=0.8,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.slot = SlotW29(
            Zs=6, W0=0.05, H0=0.025, H1=0.04, W1=0.1, H2=0.15, W2=0.2
        )
        test_obj.stator.winding = WindingUD(
            user_wind_mat=wind_mat, qs=4, p=4, Lewout=60e-3
        )
        test_obj.stator.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=0.8, Rext=0.9, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s29_1-Machine.png"))
        # rotor+stator+ 2 for frame + 1 for Shaft
        self.assertEqual(len(fig.axes[0].patches), 61)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s29_2-Rotor.png"))
        # 2 for lam, 4*Zs for wind + 6 vent
        self.assertEqual(len(fig.axes[0].patches), 32)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s29_3-Stator.png"))
        # 2 for lam, 4*Zs for wind
        self.assertEqual(len(fig.axes[0].patches), 26)

        tooth = test_obj.rotor.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s29_Tooth_in.png"))

        tooth = test_obj.stator.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s29_Tooth_out.png"))
Beispiel #14
0
    def test_Lam_Wind_21_wind_22(self):
        """Test machine plot with Slot 21 and winding rad=2, tan=2
        """
        print("\nTest plot Slot 21")
        plt.close("all")
        test_obj = Machine()

        test_obj.rotor = LamSlotWind(
            Rint=0.2,
            Rext=0.5,
            is_internal=True,
            is_stator=False,
            L1=0.85,
            Nrvd=3,
            Wrvd=0.05,
        )
        test_obj.rotor.slot = SlotW21(
            Zs=6,
            W0=40e-3,
            W1=60e-3,
            W2=40e-3,
            H0=20e-3,
            H1=0,
            H2=130e-3,
            H1_is_rad=False,
        )
        test_obj.rotor.axial_vent.append(
            VentilationTrap(Zh=6,
                            Alpha0=pi / 6,
                            W1=30e-3,
                            W2=60e-3,
                            D0=0.05,
                            H0=0.3))
        test_obj.rotor.axial_vent.append(
            VentilationTrap(Zh=6,
                            Alpha0=pi / 6,
                            W1=60e-3,
                            W2=90e-3,
                            D0=0.05,
                            H0=0.4))
        test_obj.rotor.winding = WindingUD(user_wind_mat=wind_mat,
                                           qs=4,
                                           p=4,
                                           Lewout=60e-3)
        test_obj.rotor.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.51,
            Rext=0.8,
            is_internal=False,
            is_stator=True,
            L1=0.85,
            Nrvd=3,
            Wrvd=0.05,
        )
        test_obj.stator.slot = SlotW21(
            Zs=18,
            W0=40e-3,
            W1=60e-3,
            W2=90e-3,
            H0=15e-3,
            H1=35e-3,
            H2=140e-3,
            H1_is_rad=False,
        )
        test_obj.stator.winding = WindingDW2L(qs=3, p=3)
        test_obj.stator.axial_vent.append(
            VentilationCirc(Zh=12, Alpha0=pi / 6, D0=50e-3, H0=0.75))
        test_obj.stator.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.stator.winding.Lewout = 60e-3
        test_obj.frame = Frame(Rint=0.8, Rext=1, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s21_1-Machine.png"))
        # Rotor + Stator + 2 for frame + 1 for shaft
        self.assertEqual(len(fig.axes[0].patches), 91)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s21_2-Rotor.png"))
        # 2 for lam + 4*Zs for wind + 6 vents + 6 vents
        self.assertEqual(len(fig.axes[0].patches), 38)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s21_3-Stator.png"))
        # 2 for lam + Zs*2 for wind + 12 vents
        self.assertEqual(len(fig.axes[0].patches), 50)

        tooth = test_obj.rotor.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s21_Tooth_in.png"))

        tooth = test_obj.stator.slot.get_surface_tooth()
        tooth.plot(color="r")
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s21_Tooth_out.png"))
    def test_Lam_Mag_10_inset_2_mag(self):
        """Test machine plot with Magnet 10 inset with two magnet in the slot"""
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotMag(
            Rint=40e-3,
            Rext=100e-3,
            is_internal=True,
            is_stator=False,
            L1=0.45,
            Nrvd=1,
            Wrvd=0.05,
        )
        test_obj.rotor.slot = SlotMFlat(
            Zs=4,
            W0=0.03,
            H0=0.02,
            W3=2 * pi / 60,
            magnet=[
                MagnetType10(Lmag=0.5, Hmag=0.015, Wmag=0.03),
                MagnetType10(Lmag=0.5, Hmag=0.015, Wmag=0.03),
            ],
        )
        test_obj.rotor.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=0.55)
        test_obj.rotor.axial_vent.append(
            VentilationCirc(Zh=4, Alpha0=0, D0=2.5e-3, H0=50e-3))
        test_obj.rotor.axial_vent.append(
            VentilationCirc(Zh=8, Alpha0=0, D0=5e-3, H0=60e-3))
        test_obj.rotor.axial_vent.append(
            VentilationCirc(Zh=12, Alpha0=0, D0=10e-3, H0=70e-3))
        test_obj.stator = LamSlotMag(
            Rint=110e-3,
            Rext=200e-3,
            is_internal=False,
            is_stator=True,
            L1=0.45,
            Nrvd=1,
            Wrvd=0.05,
        )

        test_obj.stator.slot = SlotMFlat(
            Zs=8,
            W0=0.03,
            W3=2 * pi / 64,
            H0=0.02,
            magnet=[
                MagnetType10(Lmag=0.5, Hmag=0.025, Wmag=0.03),
                MagnetType10(Lmag=0.5, Hmag=0.025, Wmag=0.03),
            ],
        )
        test_obj.stator.mat_type.mag = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=200e-3, Rext=250e-3, Lfra=0.5)
        test_obj.stator.axial_vent.append(
            VentilationTrap(Zh=6,
                            Alpha0=pi / 6,
                            W1=10e-3,
                            W2=20e-3,
                            D0=0.02,
                            H0=0.140))
        test_obj.stator.axial_vent.append(
            VentilationTrap(Zh=6,
                            Alpha0=pi / 6,
                            W1=20e-3,
                            W2=40e-3,
                            D0=0.02,
                            H0=0.170))
        test_obj.plot()
        fig = plt.gcf()
        self.assertEqual(len(fig.axes[0].patches), 67)
        fig.savefig(join(save_path, "test_Lam_Mag_10i_1_Mag_2-Machine.png"))

        test_obj.rotor.plot()
        fig = plt.gcf()
        self.assertEqual(len(fig.axes[0].patches), 34)
        fig.savefig(join(save_path, "test_Lam_Mag_10i_2_Mag_2-Rotor.png"))

        test_obj.stator.plot()
        fig = plt.gcf()
        self.assertEqual(len(fig.axes[0].patches), 30)
        fig.savefig(join(save_path, "test_Lam_Mag_10i_3_Mag_2-Stator.png"))
Beispiel #16
0
                                      Hwire=2e-3,
                                      Wins_wire=0,
                                      type_winding_shape=0)
# Rotor setup
rotor = LamSquirrelCage(
    Rext=0.131,
    Rint=45e-3,
    L1=0.35,
    Kf1=0.95,
    is_internal=True,
    is_stator=False,
    Hscr=20e-3,
    Lscr=15e-3,
    Nrvd=0,
)
rotor.axial_vent = [VentilationCirc(Zh=8, D0=20e-3, H0=70e-3, Alpha0=0)]

rotor.slot = SlotW21(Zs=28,
                     H0=3e-3,
                     W0=3e-3,
                     H1=0,
                     H2=20e-3,
                     W1=13e-3,
                     W2=10e-3)
rotor.winding = WindingSC(Ntcoil=1, qs=28, Lewout=17e-3, Npcpp=1)
rotor.winding.conductor = CondType21(Hbar=0.02, Wbar=0.01, Wins=0)

shaft = Shaft(Drsh=90e-3)

frame = None
Beispiel #17
0
        W2=1e-3,
        W3=1e-3,
        W4=20.6e-3,
        H0=17.3e-3,
        H1=1.25e-3,
        H2=0.5e-3,
        H3=6.8e-3,
        H4=0,
    ))
test_obj.rotor.hole[0].magnet_0.Lmag = 0.3
test_obj.rotor.hole[0].magnet_1.Lmag = 0.5
test_obj.rotor.hole[0].magnet_0.mat_type.struct.rho = 1000
test_obj.rotor.hole[0].magnet_1.mat_type.struct.rho = 1000
test_obj.rotor.axial_vent = list()
test_obj.rotor.axial_vent.append(
    VentilationCirc(Zh=8, Alpha0=0, D0=5e-3, H0=40e-3))
test_obj.rotor.axial_vent.append(
    VentilationCirc(Zh=8, Alpha0=pi / 8, D0=7e-3, H0=40e-3))
test_obj.rotor.mat_type.struct.rho = 7600
test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1.2)
test_obj.shaft.mat_type.struct.rho = 5000
test_obj.stator = Lamination(Rint=0.078,
                             Rext=0.104,
                             is_internal=False,
                             is_stator=True,
                             L1=0.8,
                             Nrvd=0,
                             Kf1=0.95)
test_obj.stator.axial_vent.append(
    VentilationPolar(Zh=8, H0=0.08, D0=0.01, W1=pi / 8, Alpha0=pi / 8))
test_obj.stator.axial_vent.append(
Beispiel #18
0
    def test_Lam_Wind_11_wind_22(self):
        """Test machine plot with Slot 11 and winding rad=2, tan=2
		"""
        print("\nTest plot Slot 11")
        plt.close("all")
        test_obj = Machine()
        test_obj.rotor = LamSlotWind(
            Rint=0.2,
            Rext=0.5,
            is_internal=True,
            is_stator=False,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.rotor.axial_vent = [
            VentilationCirc(Zh=6, Alpha0=pi / 6, D0=60e-3, H0=0.35)
        ]
        test_obj.rotor.slot = SlotW11(
            Zs=6,
            W0=50e-3,
            W1=60e-3,
            W2=70e-3,
            H0=20e-3,
            H1=35e-3,
            H2=130e-3,
            H1_is_rad=False,
            R1=10e-3,
        )
        test_obj.rotor.winding = WindingUD(user_wind_mat=wind_mat,
                                           qs=4,
                                           p=4,
                                           Lewout=60e-3)
        test_obj.rotor.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1)

        test_obj.stator = LamSlotWind(
            Rint=0.51,
            Rext=0.8,
            is_internal=False,
            is_stator=True,
            L1=0.9,
            Nrvd=2,
            Wrvd=0.05,
        )
        test_obj.stator.slot = SlotW11(
            Zs=18,
            W0=40e-3,
            W1=60e-3,
            W2=90e-3,
            H0=15e-3,
            H1=35e-3,
            H2=140e-3,
            H1_is_rad=False,
            R1=40e-3,
        )
        test_obj.stator.winding.Lewout = 60e-3
        test_obj.stator.winding = WindingDW2L(qs=3, p=3)
        test_obj.stator.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        test_obj.frame = Frame(Rint=0.8, Rext=0.9, Lfra=1)

        test_obj.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s11_1-Machine.png"))
        # Rotor + Stator + 2 for frame + 1 for Shaft
        self.assertEqual(len(fig.axes[0].patches), 73)

        test_obj.rotor.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s11_2-Rotor.png"))
        # 2 for lam + Zs*4 for wind + 6 vents
        self.assertEqual(len(fig.axes[0].patches), 32)

        test_obj.stator.plot()
        fig = plt.gcf()
        fig.savefig(join(save_path, "test_Lam_Wind_s11_3-Stator.png"))
        # 2 for lam + Zs*2 for wind
        self.assertEqual(len(fig.axes[0].patches), 38)