예제 #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_fkG_num_Fnxny():
    for model in ['plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell']:
        print('Checking fkG_num for model {0}'.format(model))
        # ssss
        p = Panel()
        p.a = 8.
        p.b = 4.
        p.r = 1.e8
        p.stack = [0, 90, 90, 0, -45, +45]
        p.plyt = 1e-3 * 0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model

        p.Nxx = -1.

        p.m = 8
        p.n = 9

        p.u1ty = 1
        p.u2ty = 1
        p.u2tx = 1

        p.v1tx = 0
        p.v2tx = 1
        p.v1ty = 1
        p.v2ty = 1

        num = 1000.
        f = 0.
        for i in range(int(num)):
            if i == 0 or i == num - 2:
                fx = p.Nxx * p.b / (num - 1.) / 2.
            else:
                fx = p.Nxx * p.b / (num - 1.)
            p.add_force(x=p.a,
                        y=i * p.b / (num - 1.),
                        fx=fx,
                        fy=0.,
                        fz=0.,
                        cte=True)
            f += fx

        p.static(silent=True)
        c = p.analysis.cs[0]

        p.lb(silent=True)
        assert np.isclose(p.eigvals[0], 4.5290911349518801, atol=0.01, rtol=0)

        nx = 9
        ny = 9
        Fnxny = p.F
        p.lb(silent=True, c=c, Fnxny=Fnxny, nx=nx, ny=ny)
        assert np.isclose(p.eigvals[0], 4.532851973656947, atol=0.01, rtol=0)

        nx = 12
        ny = 10
        Fnxny = np.array([[p.F] * ny] * nx)
        p.lb(silent=True, c=c, Fnxny=Fnxny, nx=nx, ny=ny)
        assert np.isclose(p.eigvals[0], 4.532851973656947, atol=0.01, rtol=0)
예제 #5
0
def test_panel_fkG_num_Fnxny():
    for model in ['plate_clt_donnell_bardell',
                  'cpanel_clt_donnell_bardell']:
        print('Checking fkG_num for model {0}'.format(model))
        # ssss
        p = Panel()
        p.a = 8.
        p.b = 4.
        p.r = 1.e8
        p.stack = [0, 90, 90, 0, -45, +45]
        p.plyt = 1e-3*0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.model = model

        p.Nxx = -1.

        p.m = 8
        p.n = 9

        p.u1ty = 1
        p.u2ty = 1
        p.u2tx = 1

        p.v1tx = 0
        p.v2tx = 1
        p.v1ty = 1
        p.v2ty = 1

        num = 1000.
        f = 0.
        for i in range(int(num)):
            if i == 0 or i == num - 2:
                fx = p.Nxx*p.b/(num-1.)/2.
            else:
                fx = p.Nxx*p.b/(num-1.)
            p.add_force(x=p.a, y=i*p.b/(num-1.), fx=fx, fy=0., fz=0.,
                        cte=True)
            f += fx

        p.static(silent=True)
        c = p.analysis.cs[0]

        p.lb(silent=True)
        assert np.isclose(p.eigvals[0], 4.5290911349518801, atol=0.01, rtol=0)

        nx = 9
        ny = 9
        Fnxny = p.F
        p.lb(silent=True, c=c, Fnxny=Fnxny, nx=nx, ny=ny)
        assert np.isclose(p.eigvals[0], 4.532851973656947, atol=0.01, rtol=0)

        nx = 12
        ny = 10
        Fnxny = np.array([[p.F]*ny]*nx)
        p.lb(silent=True, c=c, Fnxny=Fnxny, nx=nx, ny=ny)
        assert np.isclose(p.eigvals[0], 4.532851973656947, atol=0.01, rtol=0)
예제 #6
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)
예제 #7
0
def test_panel_field_outputs():
    m = 7
    n = 6
    #TODO implement for conical panels
    strain_field = dict(exx=None, eyy=None, gxy=None, kxx=None, kyy=None, kxy=None)
    stress_field = dict(Nxx=None, Nyy=None, Nxy=None, Mxx=None, Myy=None, Mxy=None)
    for model in ['plate_clt_donnell_bardell',
                  'cpanel_clt_donnell_bardell']:
        p = Panel()
        p.model = model
        p.u1tx = 1
        p.u1ty = 1
        p.u2ty = 1
        p.v1tx = 0
        p.v2tx = 0
        p.v1ty = 0
        p.v2ty = 0

        p.a = 2.
        p.b = 1.
        p.r = 1.e5
        p.stack = [0, -45, +45, 90, +45, -45, 0, 0]
        p.plyt = 1e-3*0.125
        p.laminaprop = (142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 5.1e9)
        p.nx = m
        p.ny = n
        p.m = m
        p.n = n

        P = 1000.
        npts = 100
        p.forces_inc = []
        for y in np.linspace(0, p.b, npts):
            p.forces_inc.append([0., y, P/(npts-1.), 0, 0])
        p.forces_inc[0][2] /= 2.
        p.forces_inc[-1][2] /= 2.

        p.static()
        c = p.analysis.cs[0]
        Ns = p.stress(c, gridx=50, gridy=50)
        es = p.strain(c, gridx=50, gridy=50)
        for k, v in strain_field.items():
            if v is None:
                strain_field[k] = es.get(k).min()
            else:
                assert np.isclose(strain_field[k], es.get(k).min(), rtol=0.05)
            p.plot(c, vec=k, filename='tmp_test_panel_strain_field_%s.png' % k)
        for k, v in stress_field.items():
            if v is None:
                stress_field[k] = Ns.get(k).min()
            else:
                assert np.isclose(stress_field[k], Ns.get(k).min(), rtol=0.05)
            p.plot(c, vec=k, filename='tmp_test_panel_stress_field_%s.png' % k)
예제 #8
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)
예제 #9
0
def test_fint():
    m = 6
    n = 6
    for model in ['plate_clt_donnell_bardell',
                  'cpanel_clt_donnell_bardell'
                  ]:
        p = Panel()
        p.model = model
        p.w1tx = 0
        p.w1rx = 1
        p.u1tx = 1
        p.u1ty = 1
        p.u2ty = 1
        p.a = 2.
        p.b = 1.
        p.r = 1.e5
        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.nx = m
        p.ny = n
        p.m = m
        p.n = n

        P = 1000.
        npts = 100
        p.forces_inc = []
        for y in np.linspace(0, p.b, npts):
            p.forces_inc.append([0., y, P/(npts-1.), 0, 0])
        p.forces_inc[0][2] /= 2.
        p.forces_inc[-1][2] /= 2.
        p.forces.append([p.a/2., p.b/2., 0, 0, 0.001])

        p.static(NLgeom=True, silent=True)
        c = p.analysis.cs[0]
        p.plot(c, vec='w', filename='tmp_test_non_linear.png', colorbar=True)


        p.uvw(p.analysis.cs[0])
        assert np.isclose(p.w.max(), 0.000144768080125, rtol=0.001)
예제 #10
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)
예제 #11
0
def test_kT():
    mns = [[4, 4], [4, 5], [4, 6], [5, 5], [5, 6], [6, 6],
           [8, 9], [9, 8]]
    for m, n in mns:
        for model in ['plate_clt_donnell_bardell',
                      'cpanel_clt_donnell_bardell']:
            p = Panel()
            p.model = model
            p.w1tx = 0
            p.u1tx = 1
            p.u1ty = 1
            p.u2ty = 1
            p.a = 2.
            p.b = 0.5
            p.r = 10
            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.m = m
            p.n = n
            p.nx = m
            p.ny = n

            P = 1000.
            npts = 5
            p.forces_inc = []
            for y in np.linspace(0, p.b, npts):
                p.forces_inc.append([0., y, P/(npts-1.), 0, 0])
            p.forces_inc[0][2] /= 2.
            p.forces_inc[-1][2] /= 2.

            k0 = p.calc_k0(silent=True)
            kT = p.calc_kT(c=np.zeros(p.get_size()), silent=True)

            error = np.abs(kT-k0).sum()

            assert error < 1.e-7
예제 #12
0
def test_kT():
    mns = [[4, 4], [4, 5], [4, 6], [5, 5], [5, 6], [6, 6], [8, 9], [9, 8]]
    for m, n in mns:
        for model in [
                'plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell'
        ]:
            p = Panel()
            p.model = model
            p.w1tx = 0
            p.u1tx = 1
            p.u1ty = 1
            p.u2ty = 1
            p.a = 2.
            p.b = 0.5
            p.r = 10
            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.m = m
            p.n = n
            p.nx = m
            p.ny = n

            P = 1000.
            npts = 5
            p.forces_inc = []
            for y in np.linspace(0, p.b, npts):
                p.forces_inc.append([0., y, P / (npts - 1.), 0, 0])
            p.forces_inc[0][2] /= 2.
            p.forces_inc[-1][2] /= 2.

            k0 = p.calc_k0(silent=True)
            kT = p.calc_kT(c=np.zeros(p.get_size()), silent=True)

            error = np.abs(kT - k0).sum()

            assert error < 1.e-7
예제 #13
0
def test_fint():
    m = 6
    n = 6
    for model in ['plate_clt_donnell_bardell', 'cpanel_clt_donnell_bardell']:
        p = Panel()
        p.model = model
        p.w1tx = 0
        p.w1rx = 1
        p.u1tx = 1
        p.u1ty = 1
        p.u2ty = 1
        p.a = 2.
        p.b = 1.
        p.r = 1.e5
        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.nx = m
        p.ny = n
        p.m = m
        p.n = n

        P = 1000.
        npts = 100
        p.forces_inc = []
        for y in np.linspace(0, p.b, npts):
            p.forces_inc.append([0., y, P / (npts - 1.), 0, 0])
        p.forces_inc[0][2] /= 2.
        p.forces_inc[-1][2] /= 2.
        p.forces.append([p.a / 2., p.b / 2., 0, 0, 0.001])

        p.static(NLgeom=True, silent=True)
        c = p.analysis.cs[0]
        p.plot(c, vec='w', filename='tmp_test_non_linear.png', colorbar=True)

        p.uvw(p.analysis.cs[0])
        assert np.isclose(p.w.max(), 0.000144768080125, rtol=0.001)
예제 #14
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)
예제 #15
0
    def add_panel(self, y1, y2, stack=None, plyts=None, plyt=None,
            laminaprops=None, laminaprop=None, model=None, mu=None, **kwargs):
        """Add a new panel to the current panel bay

        Parameters
        ----------
        y1 : float
            Position of the first panel edge along `y`.
        y2 : float
            Position of the second panel edge along `y`.
        stack : list, optional
            Panel stacking sequence. If not given the stacking sequence of the
            bay will be used.
        plyts : list, optional
            Thicknesses for each panel ply. If not supplied the bay ``plyts``
            attribute will be used.
        plyt : float, optional
            Unique thickness to be used for all panel plies. If not supplied
            the bay ``plyt`` attribute will be used.
        laminaprops : list, optional
            Lamina properties for each panel ply.
        laminaprop : list, optional
            Unique lamina properties for all panel plies.
        model : str, optional
            Not recommended to pass this parameter, but the user can use a
            different model for each panel. It is recommended to defined
            ``model`` for the bay object.
        mu : float, optional
            Panel material density. If not given the bay density will be used.

        Notes
        -----
        Additional parameters can be passed using the ``kwargs``.

        """
        p = Panel()
        p.m = self.m
        p.n = self.n
        p.a = self.a
        p.b = self.b
        p.r = self.r
        p.y1 = y1
        p.y2 = y2
        p.d = 0.
        p.model = model if model is not None else self.model
        p.stack = stack if stack is not None else self.stack
        p.plyt = plyt if plyt is not None else self.plyt
        p.plyts = plyts if plyts is not None else self.plyts
        p.laminaprop = laminaprop if laminaprop is not None else self.laminaprop
        p.laminaprops = laminaprops if laminaprops is not None else self.laminaprops
        p.mu = mu if mu is not None else self.mu

        p.u1tx = self.u1tx
        p.u1rx = self.u1rx
        p.u2tx = self.u2tx
        p.u2rx = self.u2rx
        p.v1tx = self.v1tx
        p.v1rx = self.v1rx
        p.v2tx = self.v2tx
        p.v2rx = self.v2rx
        p.w1tx = self.w1tx
        p.w1rx = self.w1rx
        p.w2tx = self.w2tx
        p.w2rx = self.w2rx
        p.u1ty = self.u1ty
        p.u1ry = self.u1ry
        p.u2ty = self.u2ty
        p.u2ry = self.u2ry
        p.v1ty = self.v1ty
        p.v1ry = self.v1ry
        p.v2ty = self.v2ty
        p.v2ry = self.v2ry
        p.w1ty = self.w1ty
        p.w1ry = self.w1ry
        p.w2ty = self.w2ty
        p.w2ry = self.w2ry

        for k, v in kwargs.items():
            setattr(p, k, v)

        self.panels.append(p)
예제 #16
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)
예제 #17
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)
예제 #18
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)