怎么在abaqus中打开abaqus中的例题

怎么在abaqus中打开abaqus中的例题,第1张

第一步:

ABAQUS中的例题一般都是.inp文件格式的。你需要使用如下ABAQUS命令从ABAQUS的例题数据库中获得这些.inp模型文件:

Overview

The abaqus fetch utility is used to extract sample Abaqus input files, user subroutine files, journal files,

parametric study script files, or postprocessing programs from the compressed archive files provided with

the release (for problems in the Abaqus Example Problems Manual, the Abaqus Benchmarks Manual,

and the Abaqus Verification Manual). File names are specified in the manuals. If no file extension is

specified, all files corresponding to the name given will be extracted.

Wildcard expressions can be used when specifying the file names and include the following:

• An asterisk (*) matches a sequence of zero or more characters.

• A question mark (?) matches exactly one character.

• A bracketed item [...] matches any single character found inside the bracketsranges are specified

by a beginning character, a hyphen, and an ending character. If an exclamation point (!) or a caret

(^) follow the left bracket, the range of characters within the brackets is complementedthat is,

anything except the characters inside the brackets is considered a match.

Any character that might otherwise be interpreted or modified by the operating system, particularly on

UNIX platforms, should be placed inside quotation marks. If no matches are found using the wildcard

expressions, the abaqus fetch utility attempts to extract a file with the name specified.

Command summary

abaqus fetch job=job-name

[input=input-file]

第二步:运行这些.inp文件。

第三步:用ABAQUS/CAE打开运行结果文件即可。

功能一:实行提交多个job的功能。

对象:Job object

使用:在源文件开始写上import job,源程序用mdb.jobs[name]

使用名字为name的job对象。

建立一个job对象的方法:

利用已有的inp文件中建立job:mdb.JobFromInputFile()

利用已有的cae中建立job:

Job(...)

建议用第一种方法。

设定参数的方法:

利用第一种方法建立job的时候,可以设定很多的参数,比如type,queue,userSubroutine等。格

式:mdb.JobFromInputFile(name=,inputFile=,type=,queue=,userSubroutine=,…….)。

也可以先建立一个job,然后利用job对象的setValues来设定参数,格式:job.setValues(type=,queue=,userSubroutine=,…….)。

一个简单的例子:

文件:job.py

from abaqusConstants import *

import job

mdb.JobFromInputFile(name='job-1-1',inputFileName='Job-1.inp')

#基于inp文件Job-1.inp建立名称为job-1-1的job

mdb.jobs['job-1-1'].setValues(waitMinutes=1)

#设定参数

mdb.jobs['job-1-1'].submit()

#提交任务

mdb.jobs['job-1-1'].waitForCompletion()

运行:

在cmd下面运行:Abaqus cae nogui=job.py

如果是多个job,同样道理了,不多说了。

功能二:

后处理,提取需要的数据,形成可以用其他软件处理的文件

功能:提取odb文件中某个set中的数据(可以是应力、应变和位移、坐标等),建立一个外部文件,把提取的结果写到这个文件中,利用tecplot处理。

1)在Odb对象中提取场变量

odb-》steps-》frams-》fieldoutputs【变量名称】

具体odb对象中的各个成员如下图

2)在场变量中选取所需要set的变量:

Odb-》rootAssembly-》Sets

或者odb-》rootAssembly-》instances-》Sets

上面两种方法取决了你在inp文件种是在assembly定义了Set还是在Instance中定义了Set。具体的如下图

文件:plot.py

from odbAccess import *

from abaqusConstants import *

import string

print 'begin abaqus python'

print 'today is 10-29'

print 'this code is for 3node_sin.odb'

odb = openOdb(path='3node_sin.odb')

myAssembly = odb.rootAssembly

f=open('plot/3node_sin1.dat','w')

f.write('TITLE = Example: Simple XY Plot\n')

f.write('VARIABLES = "X-Coordinate", "Y-Coordinate"\n')

#建立一个tecplot的dat文件

i=1

while i<100:

Frame = odb.steps['Step-1'].frames

print odb.steps['Step-1'].frames

coordinate=Frame.fieldOutputs['COORD']

#提取节点坐标数据

center =

odb.rootAssembly.nodeSets['Set-1']

centerCoordinate = coordinate.getSubset(region=center)

centerValues = centerCoordinate.values

#提取Set-1集合中的节点坐标

count=len(centerValues)

s='ZONE T=" '+str(i)+' Zone", I='+str(count)+', F=POINT\n'

f.write(s)

for v in centerValues:

s2=str(v.data[0])

s3=str(v.data[1])

f.write(s2)

f.write('\t')

f.write('\t')

f.write(s3)

f.write('\t')

f.write('\n')

print ii=i+50

#写入tecplot的dat文件中

运行:

Cmd中运行:abaqus scrip=plot.py

之所以用python因为abaqus的界面是基于python的,用它来进行批处理或者后处理是比较不错的,希望能和大家分享abaqus的更多功能。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/12029168.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存