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)
def test_st_disk_elements_odd_length(): tim0 = ShaftElement(L=0.25, idl=0, odl=0.05, material=steel) tim1 = ShaftElement(L=0.25, idl=0, odl=0.05, material=steel) shaft_elm = [tim0, tim1] disk0 = ST_DiskElement(n=0, m=[20, 30], Id=1, Ip=1, is_random=["m"]) disk1 = ST_DiskElement(n=2, m=[20, 30, 40], Id=1, Ip=1, is_random=["m"]) with pytest.raises(ValueError) as ex: ST_Rotor(shaft_elm, [disk0, disk1]) assert "not all random disk elements lists have same length." in str( ex.value)
def rand_disk_from_inertia(): elm = ST_DiskElement(n=1, m=[30, 40], Id=[0.2, 0.3], Ip=[0.5, 0.7], is_random=["m", "Id", "Ip"]) return elm
def rand_disk_from_geometry(): E = [209e9, 211e9] st_steel = ST_Material(name="Steel", rho=7810, E=E, G_s=81.2e9) elm = ST_DiskElement.from_geometry( n=1, material=st_steel, width=[0.07, 0.08], i_d=[0.05, 0.06], o_d=[0.30, 0.40], is_random=["material", "width", "i_d", "o_d"], ) return elm