示例#1
0
    def setUp(self):
        """Run at the begining of every test to setup the machine"""
        plt.close("all")
        test_obj = LamSlotWind(
            Rint=92.5e-3,
            Rext=0.2,
            is_internal=True,
            is_stator=True,
            L1=0.95,
            Nrvd=1,
            Wrvd=0.05,
        )
        test_obj.slot = SlotW16(Zs=6,
                                W0=2 * pi / 60,
                                W3=30e-3,
                                H0=10e-3,
                                H2=70e-3,
                                R1=15e-3)

        test_obj.mat_type.name = "Param"
        test_obj.mat_type.magnetics = MatLamination(Wlam=0.5e-3)
        BH = BHCurveParam(Bmax=1.5, mur_0=8585, mur_1=21.79, a=0.25575)
        test_obj.mat_type.magnetics.BH_curve = BH

        self.test_obj = test_obj
示例#2
0
    def test_set_slot_16(self):
        """Check that you can edit a Slot 16"""
        Zs = int(uniform(1, 100))
        self.test_obj.stator.slot = SlotW16(Zs=Zs)
        self.widget = SWSlot(self.test_obj, matlib=[], is_stator=True)

        self.assertEqual(self.widget.si_Zs.value(), Zs)
        self.assertEqual(self.widget.c_slot_type.currentText(), "Slot Type 16")
        self.assertEqual(self.widget.c_slot_type.currentIndex(), 6)
        self.assertEqual(type(self.widget.w_slot), PWSlot16)
示例#3
0
    def setUp(self):
        """Run at the begining of every test to setup the gui"""

        self.test_obj = LamSlotWind(Rint=0.1, Rext=0.2)
        self.test_obj.slot = SlotW16(H0=0.10,
                                     H2=0.12,
                                     W0=0.13,
                                     W3=0.14,
                                     R1=0.15)
        self.widget = PWSlot16(self.test_obj)
示例#4
0
    def setUp(self):
        """Run at the begining of every test to setup the machine"""
        plt.close("all")
        test_obj = LamSlotWind(
            Rint=92.5e-3,
            Rext=0.2,
            is_internal=True,
            is_stator=True,
            L1=0.95,
            Nrvd=1,
            Wrvd=0.05,
        )
        test_obj.slot = SlotW16(Zs=6,
                                W0=2 * pi / 60,
                                W3=30e-3,
                                H0=10e-3,
                                H2=70e-3,
                                R1=15e-3)

        self.test_obj = test_obj
示例#5
0
 def test_output_txt(self):
     """Check that the Output text is computed and correct
     """
     self.test_obj = LamSlotWind(
         Rint=92.5e-3,
         Rext=0.2,
         is_internal=True,
         is_stator=True,
         L1=0.95,
         Nrvd=1,
         Wrvd=0.05,
     )
     self.test_obj.slot = SlotW16(Zs=6,
                                  W0=2 * pi / 60,
                                  W3=30e-3,
                                  H0=10e-3,
                                  H2=70e-3,
                                  R1=15e-3)
     self.widget = PWSlot16(self.test_obj)
     self.assertEqual(self.widget.w_out.out_slot_height.text(),
                      "Slot height: 0.08 m")
示例#6
0
from pyleecan.Classes.SlotW16 import SlotW16
from numpy import ndarray, arcsin, pi
from pyleecan.Classes.LamSlot import LamSlot
from pyleecan.Methods.Slot.Slot.comp_height import comp_height
from pyleecan.Methods.Slot.Slot.comp_surface import comp_surface
from pyleecan.Methods.Slot.Slot.comp_angle_opening import comp_angle_opening
from pyleecan.Methods.Slot.SlotWind.comp_surface_wind import comp_surface_wind

# For AlmostEqual
DELTA = 1e-4

SlotW16_test = list()

# Internal Slot
lam = LamSlot(is_internal=True, Rext=0.1325)
lam.slot = SlotW16(Zs=8, H0=5e-3, H2=30e-3, R1=5e-3, W0=pi / 12, W3=10e-3)
SlotW16_test.append({
    "test_obj": lam,
    "S_exp": 2.508259e-3,
    "Aw": 0.6927673,
    "SW_exp": 2.33808e-3,
    "H_exp": 3.5e-2,
})


@ddt
class test_SlotW16_meth(TestCase):
    """unittest for SlotW16 methods"""
    @data(*SlotW16_test)
    def test_comp_surface(self, test_dict):
        """Check that the computation of the surface is correct