Esempio n. 1
0
def test_elements_odd_length():
    tim0 = ST_ShaftElement(
        L=[1, 1.1],
        idl=0,
        odl=[0.1, 0.2],
        material=steel,
        is_random=["L", "odl"],
    )
    shaft_elm = [tim0, tim0]

    disk0 = ST_DiskElement(n=0, m=[20, 30, 40], Id=1, Ip=1, is_random=["m"])
    disk1 = ST_DiskElement(n=2, m=[20, 30, 40], Id=1, Ip=1, is_random=["m"])
    disks = [disk0, disk1]

    brg0 = ST_BearingElement(
        n=0,
        kxx=[1e6, 2e6],
        cxx=[1e3, 2e3],
        is_random=["kxx", "cxx"],
    )
    brg1 = ST_BearingElement(
        n=2,
        kxx=[1e6, 2e6],
        cxx=[1e3, 2e3],
        is_random=["kxx", "cxx"],
    )
    bearings = [brg0, brg1]

    with pytest.raises(ValueError) as ex:
        ST_Rotor(shaft_elm, disks, bearings)
    assert "not all the random elements lists have the same length." in str(
        ex.value)
Esempio n. 2
0
def test_st_shaft_elements_odd_length():
    tim0 = ST_ShaftElement(L=[1, 1.1],
                           idl=0,
                           odl=[0.1, 0.2],
                           material=steel,
                           is_random=["L", "odl"])
    tim1 = ST_ShaftElement(
        L=[1, 1.1, 1.2],
        idl=0,
        odl=[0.1, 0.2, 0.3],
        material=steel,
        is_random=["L", "odl"],
    )
    shaft_elm = [tim0, tim1]

    with pytest.raises(ValueError) as ex:
        ST_Rotor(shaft_elm)
    assert "not all random shaft elements lists have same length." in str(
        ex.value)
Esempio n. 3
0
def rand_shaft():
    E = [209e9, 211e9]
    st_steel = ST_Material(name="Steel", rho=7810, E=E, G_s=81.2e9)
    elm = ST_ShaftElement(
        L=[1.0, 1.1],
        idl=[0.01, 0.02],
        odl=[0.1, 0.2],
        material=st_steel,
        is_random=["L", "idl", "odl", "material"],
    )
    return elm