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)
def test_panel_fkG_num(): 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.nx = 9 p.ny = 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) p.lb(silent=True) assert np.isclose(p.eigvals[0], 4.5290911349518277, atol=0.01, rtol=0) p.lb(silent=True, c=p.analysis.cs[0]) assert np.isclose(p.eigvals[0], 4.5345057669315239, atol=0.01, rtol=0)
def test_panel_fkG_num(): 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.nx = 9 p.ny = 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) p.lb(silent=True) assert np.isclose(p.eigvals[0], 4.5290911349518277, atol=0.01, rtol=0) p.lb(silent=True, c=p.analysis.cs[0]) assert np.isclose(p.eigvals[0], 4.5345057669315239, atol=0.01, rtol=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)
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
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
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)