Example #1
0
def ex2():
    ''' DKT esimerkki 1, pyörähdyssymmetrinen laatta jakautuneella kuormalla '''
    t = 25e-3
    E = 100e9
    nu = 0.3
    q = 100e3
    a = 1
    D = E * t**3 / (12 * (1 - nu**2))
    w = lambda r: -a**4 * q * (1 - r**2 / a**2)**2 / (64 * D)
    vmis = lambda r: (36 * D**2 * (a**2 * q * (1 - r**2 / a**2) /
                                   (8 * D) - q * r**2 /
                                   (8 * D))**2 / t**4 - 36 * D**2 *
                      (a**2 * q * (1 - r**2 / a**2) / (8 * D) - q * r**2 /
                       (8 * D)) *
                      (a**2 * nu * q * (1 - r**2 / a**2) /
                       (16 * D) + a**2 * q * (1 - r**2 / a**2) /
                       (16 * D) - q * r**2 / (8 * D)) / t**4 + 36 * D**2 *
                      (a**2 * nu * q * (1 - r**2 / a**2) /
                       (16 * D) + a**2 * q * (1 - r**2 / a**2) /
                       (16 * D) - q * r**2 / (8 * D))**2 / t**4)**(1 / 2)

    mesh = teefem.mesh.unitcircle(R=1)

    mat = teefem.materials.elastic(E=E, nu=nu)
    mdl = DKT(mesh=mesh)

    OM_el = mdl.elset['OM1']
    GA1_no = mdl.nset['GA1']

    teefem.assign_material(elements=OM_el, material=mat)

    bc1 = teefem.pressure_bc(pressure=lambda k, e: -q)
    bc2 = teefem.dirichlet_bc(encastre=True)

    teefem.assign_bc(elements=OM_el, bc=bc1)
    teefem.assign_bc(nodes=GA1_no, bc=bc2)

    carel = teefem.plate_functions.PlateCharacteristic(
        thickness=lambda k, e: t)
    teefem.assign_char(elements=OM_el, char=carel)

    mdl.static_solve()

    dymin = min([node.fields['DEPL']['DZ'] for node in mdl.nodes])

    print("DZ (acc)  : %0.14E" % (-w(0)))
    print("DZ        : %0.14E" % (dymin))
    #    print("DZ (CA)   : %0.14E"%(-1.74644966293971E-01))

    import matplotlib.pylab as plt
    #    mdl.plot()
    plotmdl(mdl, vmis)
    plt.show()
Example #2
0
def ex1():
    
    ''' Mindlin esimerkki 1, pyörähdyssymmetrinen laatta jakautuneella kuormalla '''
    
    t = 25e-3
    q = 100e3
    nu = 0.3
    E = 100.0e9
    a = 1
    D = E*t**3/(12*(1-nu**2))
    phi = 16/5*(t/a)**2/(1-nu)
    print phi
    w0 = q*a**4/(64*D)*(1+phi)


    mesh = teefem.mesh.unitcircle(R=1)
    
    mat = teefem.materials.elastic(E = E, nu = nu)
    mdl = MINR(mesh = mesh)
#    mdl = MIN(mesh = mesh)
    
    OM_el = mdl.elset['OM1']
    GA1_no = mdl.nset['GA1']

    teefem.assign_material(elements = OM_el, material = mat)
    
    bc1 = teefem.pressure_bc(pressure = lambda k,e: -q)
    bc2 = teefem.dirichlet_bc(encastre = True)
    
    teefem.assign_bc(elements = OM_el, bc = bc1)
    teefem.assign_bc(nodes = GA1_no, bc = bc2)

    carel = teefem.plate_functions.PlateCharacteristic(thickness = lambda k,e: t)
    teefem.assign_char(elements = OM_el, char = carel)

    mdl.static_solve()
    
    dz = [node.fields['DEPL']['DZ'] for node in mdl.nodes]
    print np.average(dz)
    dzmin = min(dz)
    
    print("DZ (acc)  : %0.14E"%(w0))
    print("DZ        : %0.14E"%(dzmin))
    
    import matplotlib.pylab as plt
    mdl.plot()
    plt.show()
Example #3
0
def test3():
    ''' DKT testi 3, suorakaidelaatan lommahdus '''
    t = 10e-3
    E = 210e9
    nu = 0.3
    a = 1
    b = 1

    mesh = teefem.mesh.unitsquare()
    mat = teefem.materials.elastic(E=E, nu=nu)
    mdl = DKT(mesh=mesh)

    OM_el = mdl.elset['OM1']

    teefem.assign_material(elements=OM_el, material=mat)

    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'],
                        mdl.nset['GA4'])
    teefem.assign_bc(
        nodes=nset1,
        bc=teefem.dirichlet_bc(dz=0),
    )

    carel = teefem.plate_functions.platechar(
        thickness=lambda k, e: t,
        Tx=lambda k, e: 1e6,
    )
    teefem.assign_char(elements=OM_el, char=carel)

    mdl.buckling_solve(n_modes=10)
    for i in range(4):
        mdl.plot_buckling(shapeidx=i)

    import matplotlib.pylab as plt
    plt.show()

    # Tarkka ratkaisu
    D = E * t**3 / (12 * (1 - nu**2))
    la = lambda m, n: np.pi**2 * D / b**2 * (m / (a / b) + n**2 / m *
                                             (a / b))**2
    print("Acc")
    r = range(1, 5)
    d = np.array([[la(i, j) for i in r] for j in r])
    print d / 1e6
Example #4
0
def ex2():
    ''' DKT esimerkki 1, pyörähdyssymmetrinen laatta jakautuneella kuormalla '''
    t = 25e-3
    E = 100e9
    nu = 0.3
    q = 100e3
    a = 1
    D = E*t**3/(12*(1-nu**2))
    w = lambda r: -a**4*q*(1 - r**2/a**2)**2/(64*D)
    vmis = lambda r: (36*D**2*(a**2*q*(1 - r**2/a**2)/(8*D) - q*r**2/(8*D))**2/t**4 - 36*D**2*(a**2*q*(1 - r**2/a**2)/(8*D) - q*r**2/(8*D))*(a**2*nu*q*(1 - r**2/a**2)/(16*D) + a**2*q*(1 - r**2/a**2)/(16*D) - q*r**2/(8*D))/t**4 + 36*D**2*(a**2*nu*q*(1 - r**2/a**2)/(16*D) + a**2*q*(1 - r**2/a**2)/(16*D) - q*r**2/(8*D))**2/t**4)**(1/2)

    mesh = teefem.mesh.unitcircle(R=1)
    
    mat = teefem.materials.elastic(E = E, nu = nu)
    mdl = DKT(mesh = mesh)
    
    OM_el = mdl.elset['OM1']
    GA1_no = mdl.nset['GA1']

    teefem.assign_material(elements = OM_el, material = mat)
    
    bc1 = teefem.pressure_bc(pressure = lambda k,e: -q)
    bc2 = teefem.dirichlet_bc(encastre = True)
    
    teefem.assign_bc(elements = OM_el, bc = bc1)
    teefem.assign_bc(nodes = GA1_no, bc = bc2)

    carel = teefem.plate_functions.PlateCharacteristic(thickness = lambda k,e: t)
    teefem.assign_char(elements = OM_el, char = carel)

    mdl.static_solve()
    
    dymin = min([node.fields['DEPL']['DZ'] for node in mdl.nodes])
    
    print("DZ (acc)  : %0.14E"%(-w(0)))
    print("DZ        : %0.14E"%(dymin))
#    print("DZ (CA)   : %0.14E"%(-1.74644966293971E-01))
    
    import matplotlib.pylab as plt
#    mdl.plot()
    plotmdl(mdl, vmis)
    plt.show()
Example #5
0
def test3():
    ''' DKT testi 3, suorakaidelaatan lommahdus '''
    t = 10e-3
    E = 210e9
    nu = 0.3
    a = 1
    b = 1

    mesh = teefem.mesh.unitsquare()
    mat = teefem.materials.elastic(E = E, nu = nu)
    mdl = DKT(mesh = mesh)
    
    OM_el = mdl.elset['OM1']

    teefem.assign_material(elements = OM_el, material = mat)
    
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    teefem.assign_bc(
        nodes = nset1, 
        bc = teefem.dirichlet_bc(dz = 0),
        )

    carel = teefem.plate_functions.platechar(
        thickness = lambda k,e: t,
        Tx = lambda k,e: 1e6,
        )
    teefem.assign_char(elements = OM_el, char = carel)

    mdl.buckling_solve(n_modes = 10)
    for i in range(4):
        mdl.plot_buckling(shapeidx = i)
    
    import matplotlib.pylab as plt
    plt.show()

    # Tarkka ratkaisu
    D = E*t**3/(12*(1-nu**2))
    la = lambda m,n: np.pi**2*D/b**2*(m/(a/b) + n**2/m*(a/b))**2
    print("Acc")
    r = range(1,5)
    d = np.array([[la(i,j) for i in r] for j in r])
    print d/1e6
Example #6
0
def test1():
    
    ''' Kalvo-ongelma testi, yksikkökalvo jota venytetään toisen akselin suuntaisesti '''

    q = 100
#    w = lambda r: -a**4*q*(1 - r**2/a**2)**2/(64*D) ???

    mesh = teefem.mesh.unitsquare()
    
    mdl = membrane(mesh = mesh)
    
    # Painekuorma
    teefem.assign_bc(
        elements = mdl.elset['OM1'],
        bc = teefem.pressure_bc(pressure = lambda k,e: -q),
        )
    
    # Vasen ja oikea reuna kiinni
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA3'])
#    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    teefem.assign_bc(
        nodes = nset1, 
        bc = teefem.dirichlet_bc(encastre = True)
        )

    # Esijännitys
    car = memchar(Tx = lambda k,e: 100)
#    car = memchar(Tx = lambda k,e: 100, Ty = lambda k,e: 100)
    teefem.assign_char(elements = mdl.elements, char = car)

    mdl.static_solve(export_matrices = False)
    
    dz = [node.fields['DEPL']['DZ'] for node in mdl.nodes]
    dymin = min(dz)
    
#    print("DZ (acc)  : %0.14E"%(-w(0)))
    print("DZ        : %0.14E"%(dymin))
#    print("DZ (CA)   : %0.14E"%(-1.74644966293971E-01))
    
    import matplotlib.pylab as plt
    mdl.plot()
    plt.show()
Example #7
0
def ex1():
    ''' Suorakaidelaatta, tasan jakautunut kuorma '''
    mesh = teefem.mesh.unitsquare()
    print mesh.status(fulloutput = True)
    mdl = DKT(mesh = mesh)
    mat = teefem.materials.elastic(E = 100.0e9, nu = 0.3)
    teefem.assign_material(elements = mdl.elset['OM1'], material = mat)
    load = teefem.pressure_bc(pressure = lambda k,e: -100.0e3)
    encastre = teefem.dirichlet_bc(encastre = True)
    teefem.assign_bc(elements = mdl.elset['OM1'], bc = load)
    teefem.assign_bc(nodes = mdl.nset['GA1'], bc = encastre)
    teefem.assign_bc(nodes = mdl.nset['GA2'], bc = encastre)
    teefem.assign_bc(nodes = mdl.nset['GA3'], bc = encastre)
    teefem.assign_bc(nodes = mdl.nset['GA4'], bc = encastre)
    carel = teefem.plate_functions.PlateCharacteristic(thickness = lambda k,e: 20e-3)
    teefem.assign_char(elements = mdl.elset['OM1'], char = carel)
    mdl.static_solve()
    dymin = min([node.fields['DEPL']['DZ'] for node in mdl.nodes])
    print("DZ: %0.14E"%(dymin*1000))
    plotmdl(mdl)
Example #8
0
def malli1():
    ''' DKT suorakaidelaatan lommahdus. '''

    mesh = teefem.geom.mesh(filename='geom.msh')
    mat = teefem.materials.elastic(E=E, nu=nu)
    mdl = dkt.dkt(mesh=mesh)

    OM_el = mdl.elset['OM1']

    teefem.assign_material(elements=OM_el, material=mat)

    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'],
                        mdl.nset['GA4'])
    teefem.assign_bc(
        nodes=nset1,
        bc=teefem.dirichlet_bc(dz=0),
    )

    carel = teefem.plate_functions.platechar(
        thickness=lambda k, e: t,
        Tx=lambda k, e: 1e6,
    )

    teefem.assign_char(elements=OM_el, char=carel)

    mdl.buckling_solve(n_modes=10)
    for i in range(4):
        mdl.plot_buckling(shapeidx=i)

    # Tarkka ratkaisu
    D = E * t**3 / (12 * (1 - nu**2))
    la = lambda m, n: np.pi**2 * D / b**2 * (m / (a / b) + n**2 / m *
                                             (a / b))**2
    print("Acc")
    r = range(1, 5)
    d = np.array([la(i, j) for i in r for j in r])
    for di in np.sort(d) / 1e6:
        print di

    import matplotlib.pylab as plt
    plt.show()
Example #9
0
def malli1():

    ''' DKT suorakaidelaatan lommahdus. '''


    mesh = teefem.geom.mesh(filename = 'geom.msh')
    mat = teefem.materials.elastic(E = E, nu = nu)
    mdl = dkt.dkt(mesh = mesh)
    
    OM_el = mdl.elset['OM1']

    teefem.assign_material(elements = OM_el, material = mat)
    
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    teefem.assign_bc(
        nodes = nset1, 
        bc = teefem.dirichlet_bc(dz = 0),
        )

    carel = teefem.plate_functions.platechar(
        thickness = lambda k,e: t,
        Tx = lambda k,e: 1e6,
        )

    teefem.assign_char(elements = OM_el, char = carel)

    mdl.buckling_solve(n_modes = 10)
    for i in range(4):
        mdl.plot_buckling(shapeidx = i)
    
    # Tarkka ratkaisu
    D = E*t**3/(12*(1-nu**2))
    la = lambda m,n: np.pi**2*D/b**2*(m/(a/b) + n**2/m*(a/b))**2
    print("Acc")
    r = range(1,5)
    d = np.array([la(i,j) for i in r for j in r])
    for di in np.sort(d)/1e6:
        print di

    import matplotlib.pylab as plt
    plt.show()
Example #10
0
def ex1():
    ''' Suorakaidelaatta, tasan jakautunut kuorma '''
    mesh = teefem.mesh.unitsquare()
    print mesh.status(fulloutput=True)
    mdl = DKT(mesh=mesh)
    mat = teefem.materials.elastic(E=100.0e9, nu=0.3)
    teefem.assign_material(elements=mdl.elset['OM1'], material=mat)
    load = teefem.pressure_bc(pressure=lambda k, e: -100.0e3)
    encastre = teefem.dirichlet_bc(encastre=True)
    teefem.assign_bc(elements=mdl.elset['OM1'], bc=load)
    teefem.assign_bc(nodes=mdl.nset['GA1'], bc=encastre)
    teefem.assign_bc(nodes=mdl.nset['GA2'], bc=encastre)
    teefem.assign_bc(nodes=mdl.nset['GA3'], bc=encastre)
    teefem.assign_bc(nodes=mdl.nset['GA4'], bc=encastre)
    carel = teefem.plate_functions.PlateCharacteristic(
        thickness=lambda k, e: 20e-3)
    teefem.assign_char(elements=mdl.elset['OM1'], char=carel)
    mdl.static_solve()
    dymin = min([node.fields['DEPL']['DZ'] for node in mdl.nodes])
    print("DZ: %0.14E" % (dymin * 1000))
    plotmdl(mdl)
Example #11
0
def test2():
    
    ''' Kalvo-ongelma testi, yksikkökalvon ominaismuodot ja taajuudet '''

    # Lähtötiedot
    m = 4
    T = 200
    a = np.pi
    b = np.pi

    mesh = teefem.mesh.unitsquare()
    
    mdl = membrane(mesh = mesh)
    
    # Kaikki reunat kiinni
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    print("len nset1: {0}".format(len(nset1)))
    teefem.assign_bc(
        nodes = nset1, 
        bc = teefem.dirichlet_bc(encastre = True)
        )

    # Esijännitys
    Tf = lambda k,e: T
    car = memchar(Tx = Tf, Ty = Tf, m = lambda k,e: m)
    teefem.assign_char(elements = mdl.elements, char = car)

    mdl.modal_solve(n_modes = 3, export_matrices = False)
    mdl.plot_modal(shapeidx = 0)

    # Tarkka ratkaisu
    w = lambda i,j: np.sqrt(T/m)*np.sqrt((i*np.pi/a)**2 + (j*np.pi/b)**2)
    print("acc:")
    X = range(1,4)
    for i in X:
        for j in X:
            print("i: {0}  j: {1}  w: {2}".format(i,j,w(i,j)))

    import matplotlib.pyplot as plt
    plt.show()
Example #12
0
def test1():
    ''' Kalvo-ongelma testi, yksikkökalvo jota venytetään toisen akselin suuntaisesti '''

    q = 100
    #    w = lambda r: -a**4*q*(1 - r**2/a**2)**2/(64*D) ???

    mesh = teefem.mesh.unitsquare()

    mdl = membrane(mesh=mesh)

    # Painekuorma
    teefem.assign_bc(
        elements=mdl.elset['OM1'],
        bc=teefem.pressure_bc(pressure=lambda k, e: -q),
    )

    # Vasen ja oikea reuna kiinni
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA3'])
    #    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    teefem.assign_bc(nodes=nset1, bc=teefem.dirichlet_bc(encastre=True))

    # Esijännitys
    car = memchar(Tx=lambda k, e: 100)
    #    car = memchar(Tx = lambda k,e: 100, Ty = lambda k,e: 100)
    teefem.assign_char(elements=mdl.elements, char=car)

    mdl.static_solve(export_matrices=False)

    dz = [node.fields['DEPL']['DZ'] for node in mdl.nodes]
    dymin = min(dz)

    #    print("DZ (acc)  : %0.14E"%(-w(0)))
    print("DZ        : %0.14E" % (dymin))
    #    print("DZ (CA)   : %0.14E"%(-1.74644966293971E-01))

    import matplotlib.pylab as plt
    mdl.plot()
    plt.show()
Example #13
0
def test2():
    ''' Kalvo-ongelma testi, yksikkökalvon ominaismuodot ja taajuudet '''

    # Lähtötiedot
    m = 4
    T = 200
    a = np.pi
    b = np.pi

    mesh = teefem.mesh.unitsquare()

    mdl = membrane(mesh=mesh)

    # Kaikki reunat kiinni
    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'],
                        mdl.nset['GA4'])
    print("len nset1: {0}".format(len(nset1)))
    teefem.assign_bc(nodes=nset1, bc=teefem.dirichlet_bc(encastre=True))

    # Esijännitys
    Tf = lambda k, e: T
    car = memchar(Tx=Tf, Ty=Tf, m=lambda k, e: m)
    teefem.assign_char(elements=mdl.elements, char=car)

    mdl.modal_solve(n_modes=3, export_matrices=False)
    mdl.plot_modal(shapeidx=0)

    # Tarkka ratkaisu
    w = lambda i, j: np.sqrt(T / m) * np.sqrt((i * np.pi / a)**2 +
                                              (j * np.pi / b)**2)
    print("acc:")
    X = range(1, 4)
    for i in X:
        for j in X:
            print("i: {0}  j: {1}  w: {2}".format(i, j, w(i, j)))

    import matplotlib.pyplot as plt
    plt.show()
Example #14
0
def ex1():
    ''' Ristikkorakenteen ratkaisu  '''
    
    n1 = teefem.geom.Node(x=0, y=0, z=0)
    n2 = teefem.geom.Node(x=1, y=0, z=0)
    n3 = teefem.geom.Node(x=0, y=1, z=0)
    
    s1 = teefem.geom.Seg2(nodes = (n1,n2))
    s2 = teefem.geom.Seg2(nodes = (n2,n3))
    s3 = teefem.geom.Seg2(nodes = (n3,n1))
    
    mesh1 = teefem.geom.Mesh()
    mesh1.nodes = set([n1,n2,n3])
    mesh1.shapes = set([s1,s2,s3])
    mesh1.nset['GA'] = set([n1,n3])
    mesh1.nset['LOAD'] = set([n2])
    mesh1.elset['OM'] = set([s1,s2,s3])

    model = Bar2DModel(mesh = mesh1)
    mat = teefem.materials.elastic(E = 210.0e9, nu = 0.3)
    teefem.assign_material(elements = model.elset['OM'], material = mat)

    load = teefem.nodal_force(DY = -100.0e3)
    encastre = teefem.dirichlet_bc(encastre = True)
    
    teefem.assign_bc(nodes = model.nset['LOAD'], bc = load)
    teefem.assign_bc(nodes = model.nset['GA'], bc = encastre)

    carel = BarCharacteristic(area = 10e-4)

    teefem.assign_char(elements = model.elset['OM'], char = carel)

    model.static_solve()

    dymin = min([node.fields['DEPL']['DY'] for node in model.nodes])
    print("DY: %0.14E"%(dymin*1000))
Example #15
0
def ex1():
    ''' Ristikkorakenteen ratkaisu  '''

    n1 = teefem.geom.Node(x=0, y=0, z=0)
    n2 = teefem.geom.Node(x=1, y=0, z=0)
    n3 = teefem.geom.Node(x=0, y=1, z=0)

    s1 = teefem.geom.Seg2(nodes=(n1, n2))
    s2 = teefem.geom.Seg2(nodes=(n2, n3))
    s3 = teefem.geom.Seg2(nodes=(n3, n1))

    mesh1 = teefem.geom.Mesh()
    mesh1.nodes = set([n1, n2, n3])
    mesh1.shapes = set([s1, s2, s3])
    mesh1.nset['GA'] = set([n1, n3])
    mesh1.nset['LOAD'] = set([n2])
    mesh1.elset['OM'] = set([s1, s2, s3])

    model = Bar2DModel(mesh=mesh1)
    mat = teefem.materials.elastic(E=210.0e9, nu=0.3)
    teefem.assign_material(elements=model.elset['OM'], material=mat)

    load = teefem.nodal_force(DY=-100.0e3)
    encastre = teefem.dirichlet_bc(encastre=True)

    teefem.assign_bc(nodes=model.nset['LOAD'], bc=load)
    teefem.assign_bc(nodes=model.nset['GA'], bc=encastre)

    carel = BarCharacteristic(area=10e-4)

    teefem.assign_char(elements=model.elset['OM'], char=carel)

    model.static_solve()

    dymin = min([node.fields['DEPL']['DY'] for node in model.nodes])
    print("DY: %0.14E" % (dymin * 1000))
Example #16
0
        - q * r ** 2 / (8 * D)
    )
    ** 2
    / t ** 4
) ** (1 / 2)
mesh = teefem.mesh.unitcircle(R=1)
mat = teefem.materials.elastic(E=E, nu=nu)
mdl = model(mesh=mesh)

OM_el = mdl.elset["OM1"]
GA1_no = mdl.nset["GA1"]

teefem.assign_material(elements=OM_el, material=mat)

bc1 = teefem.pressure_bc(pressure=lambda k, e: -q)
bc2 = teefem.dirichlet_bc(encastre=True)

teefem.assign_bc(elements=OM_el, bc=bc1)
teefem.assign_bc(nodes=GA1_no, bc=bc2)

carel = teefem.plate_functions.PlateCharacteristic(thickness=lambda k, e: t)
teefem.assign_char(elements=OM_el, char=carel)

mdl.static_solve()

dymin = min([node.fields["DEPL"]["DZ"] for node in mdl.nodes])

print("DZ (acc)  : %0.14E" % (w(0)))
print("DZ        : %0.14E" % (dymin))

import matplotlib.pylab as plt
Example #17
0
# Lähtötiedot
m = 1
T = 10
a = 2
b = 1

mesh = mesh(filename = 'geom.msh')

mdl = membrane(mesh = mesh)

# Kaikki reunat kiinni
nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])

assign_bc(
    nodes = nset1, 
    bc = dirichlet_bc(encastre = True)
    )

# Esijännitys
Tf = lambda k,e: T
car = memchar(Tx = Tf, Ty = Tf, m = lambda k,e: m)
assign_char(elements = mdl.elements, char = car)

mdl.modal_solve(n_modes = 4, export_matrices = False)

for i in range(4):
    mdl.plot_modal(shapeidx = i)

# Tarkka ratkaisu
w = lambda i,j: np.sqrt(T/m)*np.sqrt((i*np.pi/a)**2 + (j*np.pi/b)**2)
print("acc:")
Example #18
0
def malli0():
    ''' Tasojännitystilan ratkaisu. '''
    mesh = teefem.geom.mesh(filename = 'cplangeo.msh')
    mdl = cplan.cplan(mesh = mesh)
    OM1_el = mdl.elset['OM1']
    mat = teefem.materials.elastic(E = 210.0e9, nu = 0.3)
    teefem.assign_material(elements = OM1_el, material = mat)
#    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
#    nset1 = set().union(mdl.nset['GA2'], mdl.nset['GA4'])
    teefem.assign_bc(
        nodes = mdl.nset['GA5'], 
        bc = teefem.dirichlet_bc(dx=0,dy=0),
        )
    teefem.assign_bc(
        elements = mdl.elset['GA1'],
        bc = teefem.pressure_bc(pressure = lambda k: +q), # TJT oletuspaksuus t=1
        )
    teefem.assign_bc(
        elements = mdl.elset['GA3'],
        bc = teefem.pressure_bc(pressure = lambda k: -q), # TJT oletuspaksuus t=1
        )
    mdl.static_solve()
    
    ### Jälkikäsittelyä ###
    
    from scipy.interpolate import griddata
    
    # Primäärikenttä solmupisteissä
    x = []
    y = []
    dx = []
    dy = []
    for n in mdl.nodes:
        x.append(n.x)
        y.append(n.y)
        dx.append(n.fields['DEPL']['DX'])
        dy.append(n.fields['DEPL']['DY'])

    xx = []
    yy = []
    Nx = []
    Ny = []
    Nxy = []
    vmis = []
    for e in mdl.elset['OM1']:
        for ke in e.ipoints:
            xx.append(e.geom.x(*ke))
            yy.append(e.geom.y(*ke))
            S = e.S(*ke)
            Nx.append(S[0,0])
            Ny.append(S[1,0])
            Nxy.append(S[2,0])
            vmis.append(e.vmis(*ke))

    def plot(x,y,data,filename):
        plt.figure()
        # define grid.
        xi = np.linspace(min(x),max(x),100)
        yi = np.linspace(min(y),max(y),100)
        # grid the data.
        si = griddata((x, y), data, (xi[None,:], yi[:,None]), method='linear')
        # contour the gridded data, plotting dots at the randomly spaced data points.
        CS = plt.contour(xi,yi,si,30,linewidths=0.5,colors='k')
        CS = plt.contourf(xi,yi,si,30,cmap=plt.cm.jet)
        plt.colorbar() # draw colorbar
        # plot data points.
        # plt.scatter(x,y,marker='o',c='b',s=5)
        plt.xlim(min(x),max(x))
        plt.ylim(min(y),max(y))
        plt.savefig(filename)
        #plt.tight_layout()
    
    plot(x,y,dx,'dx.pdf')
    plot(x,y,dy,'dy.pdf')
    
    plot(xx,yy,Nx,'Nx.pdf')
    plot(xx,yy,Ny,'Ny.pdf')
    plot(xx,yy,Nxy,'Nxy.pdf')
    
    plt.show()
Example #19
0
mdl = teefem.models.cplan(mesh=mesh)

# Ryhmät
OM1_el = mdl.elset['OM1']  # Koko domain
GA1_no = mdl.nset['GA1']  # Vasen reuna
GA2_el = mdl.elset['GA2']  # Yläreuna
P1_no = mdl.nset['P1']  # Pistevoima

# Materiaali
mat = teefem.materials.elastic(E=210.0e9, nu=0.3)
teefem.assign_material(elements=OM1_el, material=mat)

# Reunaehdot, huom. TeeFEMissä tasojännitystila-elementin paksuus on oletuksena 1
bc1 = teefem.pressure_bc(pressure=lambda k: -q / t)
bc2 = teefem.dirichlet_bc(encastre=True)
bc3 = teefem.nodal_force(fy=-F / t)

# Kytketään reunaehdot malliin
# 1. Jakautunut kuormitus elementtiryhmään GA2
teefem.assign_bc(elements=GA2_el, bc=bc1)
# 2. Vasen reuna jäykästi kiinni
teefem.assign_bc(nodes=GA1_no, bc=bc2)
# 3. Pistevoima alareunaan
teefem.assign_bc(nodes=P1_no, bc=bc3)

# Ratkaisu
import time
t0 = time.clock()
mdl.static_solve()
t1 = time.clock()
Example #20
0
# Lähtötiedot
m = 1
T = 10
a = 2
b = 1

mesh = mesh(filename='geom.msh')

mdl = membrane(mesh=mesh)

# Kaikki reunat kiinni
nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'],
                    mdl.nset['GA4'])

assign_bc(nodes=nset1, bc=dirichlet_bc(encastre=True))

# Esijännitys
Tf = lambda k, e: T
car = memchar(Tx=Tf, Ty=Tf, m=lambda k, e: m)
assign_char(elements=mdl.elements, char=car)

mdl.modal_solve(n_modes=4, export_matrices=False)

for i in range(4):
    mdl.plot_modal(shapeidx=i)

# Tarkka ratkaisu
w = lambda i, j: np.sqrt(T / m) * np.sqrt((i * np.pi / a)**2 +
                                          (j * np.pi / b)**2)
print("acc:")
Example #21
0
def malli0():
    ''' Tasojännitystilan ratkaisu. '''
    mesh = teefem.geom.mesh(filename='cplangeo.msh')
    mdl = cplan.cplan(mesh=mesh)
    OM1_el = mdl.elset['OM1']
    mat = teefem.materials.elastic(E=210.0e9, nu=0.3)
    teefem.assign_material(elements=OM1_el, material=mat)
    #    nset1 = set().union(mdl.nset['GA1'], mdl.nset['GA2'], mdl.nset['GA3'], mdl.nset['GA4'])
    #    nset1 = set().union(mdl.nset['GA2'], mdl.nset['GA4'])
    teefem.assign_bc(
        nodes=mdl.nset['GA5'],
        bc=teefem.dirichlet_bc(dx=0, dy=0),
    )
    teefem.assign_bc(
        elements=mdl.elset['GA1'],
        bc=teefem.pressure_bc(pressure=lambda k: +q),  # TJT oletuspaksuus t=1
    )
    teefem.assign_bc(
        elements=mdl.elset['GA3'],
        bc=teefem.pressure_bc(pressure=lambda k: -q),  # TJT oletuspaksuus t=1
    )
    mdl.static_solve()

    ### Jälkikäsittelyä ###

    from scipy.interpolate import griddata

    # Primäärikenttä solmupisteissä
    x = []
    y = []
    dx = []
    dy = []
    for n in mdl.nodes:
        x.append(n.x)
        y.append(n.y)
        dx.append(n.fields['DEPL']['DX'])
        dy.append(n.fields['DEPL']['DY'])

    xx = []
    yy = []
    Nx = []
    Ny = []
    Nxy = []
    vmis = []
    for e in mdl.elset['OM1']:
        for ke in e.ipoints:
            xx.append(e.geom.x(*ke))
            yy.append(e.geom.y(*ke))
            S = e.S(*ke)
            Nx.append(S[0, 0])
            Ny.append(S[1, 0])
            Nxy.append(S[2, 0])
            vmis.append(e.vmis(*ke))

    def plot(x, y, data, filename):
        plt.figure()
        # define grid.
        xi = np.linspace(min(x), max(x), 100)
        yi = np.linspace(min(y), max(y), 100)
        # grid the data.
        si = griddata((x, y),
                      data, (xi[None, :], yi[:, None]),
                      method='linear')
        # contour the gridded data, plotting dots at the randomly spaced data points.
        CS = plt.contour(xi, yi, si, 30, linewidths=0.5, colors='k')
        CS = plt.contourf(xi, yi, si, 30, cmap=plt.cm.jet)
        plt.colorbar()  # draw colorbar
        # plot data points.
        # plt.scatter(x,y,marker='o',c='b',s=5)
        plt.xlim(min(x), max(x))
        plt.ylim(min(y), max(y))
        plt.savefig(filename)
        #plt.tight_layout()

    plot(x, y, dx, 'dx.pdf')
    plot(x, y, dy, 'dy.pdf')

    plot(xx, yy, Nx, 'Nx.pdf')
    plot(xx, yy, Ny, 'Ny.pdf')
    plot(xx, yy, Nxy, 'Nxy.pdf')

    plt.show()
Example #22
0
tf.assign_material(
    elements = mdl.elset['OM1'],
    material = tf.materials.elastic(E = E, nu = nu),
    )

# Jakautunut kuormitus
tf.assign_bc(
    elements = mdl.elset['OM1'], 
    bc = tf.pressure_bc(pressure = lambda k,e: -p0),
    )

# Jäykkä tuenta vasemmalle reunalle (GA4)
tf.assign_bc(
    nodes = mdl.nset['GA4'], 
    bc = tf.dirichlet_bc(encastre = True),
    )

# Niveltuenta ylös ja alas

bcnod = set().union(mdl.nset['GA1'],mdl.nset['GA3'])
tf.assign_bc(nodes = bcnod, bc = tf.dirichlet_bc(dz = 0))

carel = tf.plate_functions.PlateCharacteristic(thickness = t)
tf.assign_char(elements = mdl.elset['OM1'], char = carel)

mdl.static_solve()

# Jälkikäsittely

# Maksimitaipuma