from numpy import deg2rad from compmech.conecyl import ConeCyl if __name__ == '__main__': cc = ConeCyl() cc.name = 'z33' cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.alphadeg = 0 cc.m1 = cc.m2 = cc.n2 = 40 cc.pdC = False cc.Fc = 2000. cc.add_SPL(0.4, pt=0.25, theta=deg2rad(-30)) cc.add_SPL(0.4, pt=0.25, theta=deg2rad(-60)) cc.add_SPL(0.4, pt=0.25, theta=deg2rad(-90)) cc.add_SPL(0.3, pt=0.25, theta=deg2rad(-120)) cc.add_SPL(0.3, pt=0.5, theta=deg2rad(-120)) cc.add_SPL(0.3, pt=0.75, theta=deg2rad(-120)) cc.add_SPL(0.4, pt=0.75, theta=deg2rad(-90)) cc.add_SPL(0.4, pt=0.75, theta=deg2rad(-60)) cc.add_SPL(0.4, pt=0.75, theta=deg2rad(-30)) cc.add_SPL(0.5, pt=0.75, theta=deg2rad(30)) cc.add_SPL(0.4, pt=0.50, theta=deg2rad(30))
def test_NL_static(): wmin_ref = [ ['clpt_donnell_bc1', -0.012689461685834305], ['clpt_donnell_bc2', -0.011741560192200845], ['clpt_donnell_bc3', -0.012634776822892537], ['clpt_donnell_bc4', -0.011499181513525969], ['fsdt_donnell_bc1', -0.012621439862441628], ] for model, wmin in wmin_ref: cc = ConeCyl() cc.model = model cc.m1 = 20 cc.m2 = 5 cc.n2 = 6 cc.name = 'Z33' cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.add_SPL(10, increment=False) for thetadeg in np.linspace(0, 360, 300, endpoint=False): cc.add_force(0., thetadeg, -15., 0, 0, increment=True) cc.analysis.initialInc = 0.5 cs = cc.static(NLgeom=True) cc.uvw(cs[0]) assert np.isclose(cc.w.min(), wmin, rtol=0.01)
def test_static(): wmin_ref = [ ['clpt_donnell_bc1', -0.0512249327106], ['clpt_donnell_bc2', -0.0500855846496], ['clpt_donnell_bc3', -0.0509280039584], ['clpt_donnell_bc4', -0.0498127720591], ['fsdt_donnell_bc1', -0.0516948646563], ['fsdt_donnell_bc2', -0.0505316013923], ['fsdt_donnell_bc3', -0.0513959737413], ['fsdt_donnell_bc4', -0.0502561654612], ] for model, wmin in wmin_ref: cc = ConeCyl() cc.model = model cc.m1 = 20 cc.m2 = 10 cc.n2 = 11 cc.name = 'Z33' cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.add_SPL(10) for thetadeg in np.linspace(0, 360, 300, endpoint=False): cc.add_force(0., thetadeg, -15., 0, 0, increment=True) cs = cc.static() cc.uvw(cs[0]) assert np.isclose(cc.w.min(), wmin, rtol=0.01)
def test1(): cc = ConeCyl() cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.alphadeg = 0. cc.m1 = 120 cc.m2 = 15 cc.n2 = 15 cc.thetaT = None cc.Fc = 1. cc.pdC = False cc.add_SPL(10.) cc.model = 'clpt_donnell_bc1' cc.lb() cc.Fc = cc.eigvals[0] cc.plot(cc.eigvecs[:,0]) cc.Fc = 100. regions_conditions(cc, 'k0L')
def convergence_nx_nt(): '''It was selected a hypothetical cone with the laminate of cylinder Z33 and a semi-vertex angle of 35. The data generated from this function is used to define the dictionary `nx_nt_table` inside `ConeCyl.rebuild()`. For simplification, it is assumed `m1=m2=n2`. ''' cc = ConeCyl() cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.alphadeg = 35. cc.linear_kinematics='clpt_donnell' cc.NL_kinematics='donnell_numerical' cc.Fc = 200000 cc.initialInc = 0.2 cc.minInc = 1.e-3 cc.modified_NR = False cc.compute_every_n = 10 cc.pd = False PLs = [5, 20, 30, 45, 60, 70, 80] PLs = [90] for n in [20, 25, 30, 35]: cc.m1 = cc.m2 = cc.n2 = n for nt in [60, 80, 100, 120]: cc.nx = cc.nt = nt print cProfile.runctx('curves = cc.SPLA(PLs, NLgeom=True)', globals(), locals(), 'tester.prof')
def test1(): cc = ConeCyl() cc.laminaprop = (123.55e3, 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.alphadeg = 0. cc.m1 = 120 cc.m2 = 15 cc.n2 = 15 cc.thetaT = None cc.Fc = 1. cc.pdC = False cc.add_SPL(10.) cc.model = 'clpt_donnell_bc1' cc.lb() cc.Fc = cc.eigvals[0] cc.plot(cc.eigvecs[:, 0]) cc.Fc = 100. regions_conditions(cc, 'k0L')
def convergence_nx_nt(): '''It was selected a hypothetical cone with the laminate of cylinder Z33 and a semi-vertex angle of 35. The data generated from this function is used to define the dictionary `nx_nt_table` inside `ConeCyl.rebuild()`. For simplification, it is assumed `m1=m2=n2`. ''' cc = ConeCyl() cc.laminaprop = (123.55e3, 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.alphadeg = 35. cc.linear_kinematics = 'clpt_donnell' cc.NL_kinematics = 'donnell_numerical' cc.Fc = 200000 cc.initialInc = 0.2 cc.minInc = 1.e-3 cc.modified_NR = False cc.compute_every_n = 10 cc.pd = False PLs = [5, 20, 30, 45, 60, 70, 80] PLs = [90] for n in [20, 25, 30, 35]: cc.m1 = cc.m2 = cc.n2 = n for nt in [60, 80, 100, 120]: cc.nx = cc.nt = nt print( cProfile.runctx('curves = cc.SPLA(PLs, NLgeom=True)', globals(), locals(), 'tester.prof'))
from compmech.conecyl import ConeCyl cc = ConeCyl() cc.model = 'clpt_donnell_bc1' cc.m1 = 15 cc.m2 = 16 cc.n2 = 17 cc.name = 'Z33' cc.laminaprop = (123.55e3 , 8.708e3, 0.319, 5.695e3, 5.695e3, 5.695e3) cc.stack = [0, 0, 19, -19, 37, -37, 45, -45, 51, -51] cc.plyt = 0.125 cc.r2 = 250. cc.H = 510. cc.add_SPL(10) cc.static() cc.plot(cc.cs[0], colorbar=True, filename='test.png')