예제 #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()
예제 #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()
예제 #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
예제 #4
0
파일: dkt.py 프로젝트: adesam01/FEMTools
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()
예제 #5
0
파일: dkt.py 프로젝트: adesam01/FEMTools
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
예제 #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()
예제 #7
0
파일: dkt.py 프로젝트: adesam01/FEMTools
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)
예제 #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()
예제 #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()
예제 #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)
예제 #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()
예제 #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()
예제 #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()
예제 #14
0
파일: bar2d.py 프로젝트: adesam01/FEMTools
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))
예제 #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))
예제 #16
0
                   (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

mdl.plot()
#plotmdl(mdl, vmis)
plt.show()
예제 #17
0
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:")
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)))

plt.show()
예제 #18
0
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:")
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)))
예제 #19
0
# 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
dzmin = min([node.fields['DEPL']['DZ'] for node in mdl.nodes])
print("DZ min: {0:5.4e}".format(dzmin))

#mdl.plot()
plt.show()
예제 #20
0
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

mdl.plot()
# plotmdl(mdl, vmis)
plt.show()