Stress extraction on beam 188(Create finite element model directly with E command or Use the L command to create a line and then assign section properties and divide the mesh) #1946
-
I saw a code about calculating beam stress and deflection in pyansy official tutorial.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @bismarck1943 For this kind of simply supported, uniform pressure loaded Timoshenko beam the displacement is a forth order polynomial along the length of the beam. Whereas the cubic option chosen (shape function) is third order. So it's not that the results are wrong; just inaccurate as we are trying to describe a 4th order polynomial with up to 3rd order term. Just need more elements along the length to get a more accurate answer. Doubling the number of beam elements to 4 total brings the s_eqv_max down to 104,960. Double again to 8 elements and the stress goes down to 103,040 (about 0.6% error). Double again and are down to about 0.1% error. Mike import os
from ansys.mapdl.core import launch_mapdl
path = os.getcwd()
mapdl = launch_mapdl(run_location = path, additional_switches = '-smp')
sec_num = 1
b=3
h=5
w = 10000
mapdl.clear()
mapdl.prep7()
mapdl.et(1, "BEAM188")
mapdl.keyopt(1, 3, 3) # Cubic shape function
mapdl.mp("EX", 1, 2e11)
mapdl.mp("PRXY", 1, 0.3)
mapdl.sectype(sec_num, "BEAM", "RECT")
mapdl.secdata(b,h)
mapdl.k(1, 0, 0, 0)
mapdl.k(2, 32, 0, 0)
mapdl.k(100,8,1)
mapdl.l(1, 2)
mapdl.latt(1, 1, 1, "",100, 1)
mapdl.lesize("ALL",2)
mapdl.lmesh("ALL")
mapdl.finish()
mapdl.slashsolu()
mapdl.antype("STATIC")
node_1 = mapdl.queries.node(0,0,0)
node_2 = mapdl.queries.node(32,0,0)
mapdl.d(node_1, "UX", lab2="UY",lab3="UZ",lab4="ROTX",lab5="ROTY")
mapdl.d(node_2, "UY",lab2="UZ",lab3="ROTX",lab4="ROTY")
mapdl.sfbeam('all', 1, "PRES", w)
out = mapdl.solve()
mapdl.finish()
mapdl.post1()
mapdl.set('last')
s_eqv_max = mapdl.get_value("secr",'',"s","eqv","max")
print('MAX',s_eqv_max)
mapdl.exit() |
Beta Was this translation helpful? Give feedback.
Hi @bismarck1943
Distributed parallel solves does not store the results in the MAPDL database after a solve; so we need to read in the results from the result file with the SET command in order to post process. Depending on how you ran the MAPDL batch vs the default PyMAPDL MAPDL instance (defaults to distributed parallel) that could explain getting a 0 for some result.
For this kind of simply supported, uniform pressure loaded Timoshenko beam the displacement is a forth order polynomial along the length of the beam. Whereas the cubic option chosen (shape function) is third order. So it's not that the results are wrong; just inaccurate as we are trying to describe a 4th order polynomial w…