简体   繁体   English

如何在ABAQUS Python脚本中请求节点应力输出

[英]How to request nodal stress output in ABAQUS Python script

I need nodal stresses in the odb. 我需要在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). 我知道我可以在可视化模块中简单地生成一个查询,因此可以获取平均节点应力(我认为分析后的节点应力不起作用,并且由于没有节点,所以我无法在odb中这样做)有关压力的信息)。 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. 我还可以编辑输入文件,并在元素输出中使用Position = NODES,然后通过将输入文件称为源来运行分析。 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. 我不知道在输入文件中写入的Position = NODES等效的python命令是什么。 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? 我对此有何想法?

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. 在创建/提交作业之前,这是最后一件事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM