How to request nodal stress output in ABAQUS Python script

对着背影说爱祢 提交于 2019-12-24 14:50:18

问题


I need nodal stresses in the odb. I am aware that I can simply generate a query in the visualization module and therefore can obtain the averaged nodal stress (which I dont think will be of use as its performed after the analysis and I cannot do that in the odb as there is no nodal information for stresses). I can also edit the input file and use Position = NODES in the element output and then running the analysis by calling the input file as source. It generates stresses with nodal data and then every node has multiple stress values corresponding to every element. I have also averaged out those values in the script as its done in the visualization module. But now I need to automate this script for multiple simulations and the only place I am stuck is the to request the nodal output for the next iteration. I dont know whats an equivalent python command for Position = NODES which is written in the input file. I cannot keep calling the same input file as my nodal position for the next simulation is different that earlier model. Any thoughts on how do I go about it?


回答1:


Here's an example scripting the keyword editor. The trick to it is you need to search for an existing keyword and insert your new text before or after that.

model.keywordBlock.synchVersions()
def GetBlockPosition(model,blockPrefix):
 pos = 0
 for block in model.keywordBlock.sieBlocks:
  if string.lower(block[0:len(blockPrefix)])==string.lower(blockPrefix):return pos
  pos=pos+1
 return -1
model.keywordBlock.insert(GetBlockPosition(model,'*Restart')-1, """
*EL FILE,POSITION=AVERAGED AT NODES
S
""")

Do this as the very last thing before creating/submitting the job.



来源:https://stackoverflow.com/questions/35572838/how-to-request-nodal-stress-output-in-abaqus-python-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!