python编辑abaqus脚本,将Abaqus宏转换为python脚本

本文档描述了作者如何尝试将Abaqus宏转换为Python脚本以提高效率,但遇到了导入错误。作者希望从Python文件中运行这个宏,而不是通过Abaqus GUI,然而遇到了'abaqus module may only be imported in the Abaqus kernel process'的错误。此外,还讨论了可能简化宏脚本的方法,特别是针对大量节点历史输出的求和操作。
摘要由CSDN通过智能技术生成

I am using Abaqus (6.13) to run FEM thermal simulations. I need to get the total external heat flux aplied on that model. My searches indicated that the only way to get it was to sum de RFLE history output on the whole model and it works fine. The problem is that I have a ~300 000 elements model and that the simple opening of the Report/XY window takes a couple of hours.

In order to simplify my exportations, I made an exporting macro with the macro manager of Abaqus. The recording starts before importing the odb in abaqus and ends after exporting the report containing the X/Y datas.

This generated macro is big (~900 000 lines) so I give you here a cropped version of it:

# -*- coding: mbcs -*-

# Do not delete the following import lines

from abaqus import *

from abaqusConstants import *

import __main__

def OdbMacro1():

import section

import regionToolset

import displayGroupMdbToolset as dgm

import part

import material

import assembly

import step

import interaction

import load

import mesh

import optimization

import job

import sketch

import visualization

import xyPlot

import displayGroupOdbToolset as dgo

import connectorBehavior

import os

os.chdir(r"C:\FolderPath")

session.mdbData.summary()

o1 = session.openOdb(name='C:\FolderPath\odb.odb')

session.viewports['Viewport: 1'].setValues(displayedObject=o1)

odb = session.odbs['C:\FolderPath\odb.odb']

xy0 = xyPlot.XYDataFromHistory(odb=odb,

outputVariableName='Nodal temperature: NT11 PI: PAD-1 Node 10 in NSET PADSURF_BACK',

steps=('Step-2', ), suppressQuery=True)

xy1 = xyPlot.XYDataFromHistory(odb=odb,

outputVariableName='Nodal temperature: NT11 PI: PAD-1 Node 10053 in NSET PADSURF_BACK',

steps=('Step-2', ), suppressQuery=True)

xy2 = xyPlot.XYDataFromHistory(odb=odb,

outputVariableName='Nodal temperature: NT11 PI: PAD-1 Node 10054 in NSET PADSURF_BACK',

steps=('Step-2', )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值