예제 #1
0
def test_reduced_dof_freq_plate():
    models = ['plate_clt_donnell_bardell',
              'cpanel_clt_donnell_bardell']
    for model in models:
        print('Test reduced_dof solver, prestress=True, model={0}'.format(model))
        p = Panel()
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 100.
        p.alphadeg = 0.
        p.stack = [0, 90, -45, +45]
        p.plyt = 1e-3*0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.mu = 1.3e3
        p.m = 11
        p.n = 12
        p.Nxx = -60.
        p.Nyy = -5.
        k0 = p.calc_k0(silent=True)
        M = p.calc_kM(silent=True)
        kG0 = p.calc_kG0(silent=True)
        k0 += kG0
        eigvals, eigvecs = freq(k0, M, sparse_solver=True, reduced_dof=False, silent=True)
        reduced_false = eigvals[0]
        freq(k0, M, sparse_solver=True, reduced_dof=True, silent=True)
        reduced_true = eigvals[0]
        assert np.isclose(reduced_false, reduced_true, rtol=0.001)
예제 #2
0
def test_reduced_dof_freq_plate():
    models = ['plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell']
    for model in models:
        print(
            'Test reduced_dof solver, prestress=True, model={0}'.format(model))
        p = Panel()
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 100.
        p.alphadeg = 0.
        p.stack = [0, 90, -45, +45]
        p.plyt = 1e-3 * 0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.mu = 1.3e3
        p.m = 11
        p.n = 12
        p.Nxx = -60.
        p.Nyy = -5.
        k0 = p.calc_k0(silent=True)
        M = p.calc_kM(silent=True)
        kG0 = p.calc_kG0(silent=True)
        k0 += kG0
        eigvals, eigvecs = freq(k0,
                                M,
                                sparse_solver=True,
                                reduced_dof=False,
                                silent=True)
        reduced_false = eigvals[0]
        freq(k0, M, sparse_solver=True, reduced_dof=True, silent=True)
        reduced_true = eigvals[0]
        assert np.isclose(reduced_false, reduced_true, rtol=0.001)
예제 #3
0
def test_freq():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        for atype in [3, 4]:
            print('Frequency Analysis, atype={0}, model={1}'.format(
                  atype, model))
            p = Panel()
            p.model = model
            p.bc_ssss()
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3*0.125
            p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.3e3
            p.m = 11
            p.n = 12
            p.Nxx = -60.
            p.Nyy = -5.
            p.freq(sparse_solver=True, reduced_dof=False, silent=True,
                   atype=atype)
            if atype == 3:
                if '_w' in model:
                    assert np.allclose(p.eigvals[0], 19.9271684726)
                else:
                    assert np.allclose(p.eigvals[0], 17.8587479369)
            elif atype == 4:
                if '_w' in model:
                    assert np.allclose(p.eigvals[0], 40.3728103572)
                else:
                    assert np.allclose(p.eigvals[0], 39.3147553173)
예제 #4
0
def test_panel_aero():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell']:
        for atype in [1, 2]:
            print('Flutter Analysis Piston Theory, atype={0}, model={1}'.
                  format(atype, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3*0.125
            E2 = 8.7e9
            p.laminaprop = (142.5e9, E2, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.5e3
            p.m = 8
            p.n = 9

            # pre-stress applied when atype == 1
            p.Nxx = -60.
            p.Nyy = -5.

            # testing commong methodology based on betastar
            if atype == 1:
                betasstar = np.linspace(150, 350, 40)
            elif atype == 2:
                betasstar = np.linspace(670, 690, 40)
            betas = betasstar/(p.a**3/E2/(len(p.stack)*p.plyt)**3)
            p.beta = betas[0]
            p.freq(atype=1, reduced_dof=False, sparse_solver=False,
                   silent=True)
            out = np.zeros((len(betasstar), p.eigvals.shape[0]),
                    dtype=p.eigvals.dtype)
            for i, beta in enumerate(betas):
                p.beta = beta
                p.freq(atype=2, reduced_dof=False, sparse_solver=False,
                       silent=True)
                eigvals = p.eigvals*p.a**2/(np.pi**2*sum(p.plyts))*np.sqrt(p.mu/E2)
                out[i, :] = eigvals

            ind = np.where(np.any(out.imag != 0, axis=1))[0][0]
            if atype == 1:
                if not model.endswith('_w'):
                    assert np.isclose(betas[ind], 347.16346, atol=0.1, rtol=0)
                else:
                    assert np.isclose(betas[ind], 174.27885, atol=0.1, rtol=0)
            elif atype == 2:
                if not model.endswith('_w'):
                    assert np.isclose(betas[ind], 728.625, atol=0.1, rtol=0)
                else:
                    assert np.isclose(betas[ind], 728.625, atol=0.1, rtol=0)
예제 #5
0
def test_panel_freq():
    for model in [
            'plate_clt_donnell_bardell', 'plate_clt_donnell_bardell_w',
            'cpanel_clt_donnell_bardell', 'kpanel_clt_donnell_bardell'
    ]:
        for prestress in [True, False]:
            print('Frequency Analysis, prestress={0}, model={1}'.format(
                prestress, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3 * 0.125
            p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.3e3
            p.m = 11
            p.n = 12
            p.Nxx = -60.
            p.Nyy = -5.
            k0 = p.calc_k0(silent=True)
            M = p.calc_kM(silent=True)
            if prestress:
                kG0 = p.calc_kG0(silent=True)
                k0 += kG0
            eigvals, eigvecs = freq(k0,
                                    M,
                                    sparse_solver=True,
                                    reduced_dof=False,
                                    silent=True)
            if prestress:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 19.9272, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 17.85875, rtol=0.001)
            else:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 40.37281, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 39.31476, rtol=0.001)
예제 #6
0
def test_panel_freq():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        for prestress in [True, False]:
            print('Frequency Analysis, prestress={0}, model={1}'.format(
                  prestress, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3*0.125
            p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.3e3
            p.m = 11
            p.n = 12
            p.Nxx = -60.
            p.Nyy = -5.
            k0 = p.calc_k0(silent=True)
            M = p.calc_kM(silent=True)
            if prestress:
                kG0 = p.calc_kG0(silent=True)
                k0 += kG0
            eigvals, eigvecs = freq(k0, M, sparse_solver=True, reduced_dof=False, silent=True)
            if prestress:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 19.9272, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 17.85875, rtol=0.001)
            else:
                if '_w' in model:
                    assert np.isclose(eigvals[0], 40.37281, rtol=0.001)
                else:
                    assert np.isclose(eigvals[0], 39.31476, rtol=0.001)
예제 #7
0
def test_panel_lb():
    for model in [
            'plate_clt_donnell_bardell', 'plate_clt_donnell_bardell_w',
            'cpanel_clt_donnell_bardell', 'kpanel_clt_donnell_bardell'
    ]:
        print('Linear buckling for model {0}'.format(model))
        # ssss
        p = Panel()
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 88.47696, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 85.2912, atol=0.1, rtol=0)

        p.Nxx = 0
        p.Nyy = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 26.45882, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 25.17562, atol=0.1, rtol=0)

        # ssfs
        p = Panel()
        p.u2ty = 1
        p.v2ty = 1
        p.w2ty = 1
        p.u2ry = 1
        p.v2ry = 1
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 17.14427, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 15.842356, atol=0.1, rtol=0)

        p.u2tx = 1
        p.v2tx = 1
        p.w2tx = 1
        p.u2rx = 1
        p.v2rx = 1
        p.u2ty = 0
        p.v2ty = 0
        p.w2ty = 0
        p.u2ry = 0
        p.v2ry = 0
        p.Nxx = 0
        p.Nyy = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 15.809986, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 13.9421988, atol=0.1, rtol=0)
예제 #8
0
def test_panel_lb():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        print('Linear buckling for model {0}'.format(model))
        # ssss
        p = Panel()
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 88.47696, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 85.2912, atol=0.1, rtol=0)

        p.Nxx = 0
        p.Nyy = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 26.45882, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 25.17562, atol=0.1, rtol=0)

        # ssfs
        p = Panel()
        p.u2ty = 1
        p.v2ty = 1
        p.w2ty = 1
        p.u2ry = 1
        p.v2ry = 1
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 17.14427, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 15.842356, atol=0.1, rtol=0)

        p.u2tx = 1
        p.v2tx = 1
        p.w2tx = 1
        p.u2rx = 1
        p.v2rx = 1
        p.u2ty = 0
        p.v2ty = 0
        p.w2ty = 0
        p.u2ry = 0
        p.v2ry = 0
        p.Nxx = 0
        p.Nyy = -1
        k0 = p.calc_k0(silent=True)
        kG0 = p.calc_kG0(silent=True)
        eigvals, eigvecs = lb(k0, kG0, silent=True)
        if '_w' in model:
            assert np.isclose(eigvals[0], 15.809986, atol=0.1, rtol=0)
        else:
            assert np.isclose(eigvals[0], 13.9421988, atol=0.1, rtol=0)
예제 #9
0
def test_panel_aero():
    for model in [
            'plate_clt_donnell_bardell', 'plate_clt_donnell_bardell_w',
            'cpanel_clt_donnell_bardell'
    ]:
        for atype in [1, 2]:
            print(
                'Flutter Analysis Piston Theory, atype={0}, model={1}'.format(
                    atype, model))
            p = Panel()
            p.model = model
            p.a = 1.
            p.b = 0.5
            p.r = 1.e8
            p.alphadeg = 0.
            p.stack = [0, 90, -45, +45]
            p.plyt = 1e-3 * 0.125
            E2 = 8.7e9
            p.laminaprop = (142.5e9, E2, 0.28, 5.1e9, 5.1e9, 5.1e9)
            p.mu = 1.5e3
            p.m = 8
            p.n = 9

            # pre-stress applied when atype == 1
            p.Nxx = -60.
            p.Nyy = -5.

            # testing commong methodology based on betastar
            if atype == 1:
                betasstar = np.linspace(150, 350, 40)
            elif atype == 2:
                betasstar = np.linspace(670, 690, 40)
            betas = betasstar / (p.a**3 / E2 / (len(p.stack) * p.plyt)**3)
            p.beta = betas[0]
            p.freq(atype=1,
                   reduced_dof=False,
                   sparse_solver=False,
                   silent=True)
            out = np.zeros((len(betasstar), p.eigvals.shape[0]),
                           dtype=p.eigvals.dtype)
            for i, beta in enumerate(betas):
                p.beta = beta
                p.freq(atype=2,
                       reduced_dof=False,
                       sparse_solver=False,
                       silent=True)
                eigvals = p.eigvals * p.a**2 / (
                    np.pi**2 * sum(p.plyts)) * np.sqrt(p.mu / E2)
                out[i, :] = eigvals

            ind = np.where(np.any(out.imag != 0, axis=1))[0][0]
            if atype == 1:
                if not model.endswith('_w'):
                    assert np.isclose(betas[ind], 347.16346, atol=0.1, rtol=0)
                else:
                    assert np.isclose(betas[ind], 174.27885, atol=0.1, rtol=0)
            elif atype == 2:
                if not model.endswith('_w'):
                    assert np.isclose(betas[ind], 728.625, atol=0.1, rtol=0)
                else:
                    assert np.isclose(betas[ind], 728.625, atol=0.1, rtol=0)
예제 #10
0
def test_lb():
    for model in ['plate_clt_donnell_bardell',
                  'plate_clt_donnell_bardell_w',
                  'cpanel_clt_donnell_bardell',
                  'kpanel_clt_donnell_bardell']:
        print('Linear buckling for model {0}'.format(model))
        # ssss
        p = Panel()
        p.bc_ssss()
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        p.lb(silent=True)
        if '_w' in model:
            assert np.allclose(p.eigvals[0], 88.4769618837)
        else:
            assert np.allclose(p.eigvals[0], 85.2911727144)

        p.Nxx = 0
        p.Nyy = -1
        p.lb(silent=True)
        if '_w' in model:
            assert np.allclose(p.eigvals[0], 26.4588171556)
        else:
            assert np.allclose(p.eigvals[0], 25.1756170679)

        # ssfs
        p = Panel()
        p.bc_ssfs()
        p.m = 12
        p.n = 13
        p.stack = [0, 90, -45, +45]
        p.plyt = 0.125e-3
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model
        p.a = 1.
        p.b = 0.5
        p.r = 1.e8
        p.alphadeg = 0.
        p.Nxx = -1
        p.lb(silent=True)
        if '_w' in model:
            assert np.allclose(p.eigvals[0], 17.1442703121)
        else:
            assert np.allclose(p.eigvals[0], 15.8423562314)

        p.bc_sfss()
        p.Nxx = 0
        p.Nyy = -1
        p.lb(silent=True)
        if '_w' in model:
            assert np.allclose(p.eigvals[0], 15.8099861083)
        else:
            assert np.allclose(p.eigvals[0], 13.9421987614)