ansys及一些常用命令.docx
《ansys及一些常用命令.docx》由会员分享,可在线阅读,更多相关《ansys及一些常用命令.docx(25页珍藏版)》请在冰点文库上搜索。
ansys及一些常用命令
/PREP7前处理的一些常用命令:
ET,1,SOLID45定义单元类型
KEYOPT,1,2,1单元选项(OPTION)
MP,EX,1,100定义材料参数,1为材料号
tb,材料表(定义塑性、超弹性等)
*dim,rr,array,3,2定义数组rr为3行2列
k,1,X,Y,Z定义KEYPOINT1坐标
LSTR,1,2由1、2点生成线
lesize划分网格,尺寸定义
NUMMRG,KP,,,,LOW压缩节点号
asel,选择面
r,定义实常数
wpro,,-90,旋转工作平面
esln,s选择与节点相关的单元
emodif,all,real,i修改单元实常数
amesh对面划分网格
type,2
mat,2
real,1
esys,0(或aatt)激活单元类型2,材料号2,实常数1,单元坐标系
vsweep,all,,,扫掠网格
csys,4激活坐标系4
-------------------------------------------------------------------------------------------------------------------------------
numstr,kp,100!
definethefollowingkeypointnumberstartwithwiththe100
l,1,2,4!
如果CSYS=0则生成直线,如果CSYS=1则生成弧线,这个命令与当前的坐标系统有
lsel,!
取线
wprof,,12!
移坐标
alsv!
拾取一选定实体上的所有面
nsla!
同理,拾取一选定面上的所有节点
aatt,1,1,1!
等效于楼上的MAT,1TYPE,1REAL,1对面定义属性
mshke,0
!
网格格划分进行限定:
采用FREE进行划分;网格形状为四边形或六面体
mshape,1,2d
vmesh,2!
划分实体网格,后面的参数是实体编号如:
2
/solu!
进入求解过程
antype,static!
选择求解类型为静力分析
asel,s,loc,x,
nsla
d,all,uy,,,,,roty,rotz!
对选定的面上的所有节点施加UYROTYROTZ的对称约束.
allsel!
恢复全部选择等效于:
ASELL,ALLESEL,ALLNSEL,ALL
asel,s,,,1
sfa,all,1,press,1000!
对选定的面1施加均布力1000
allsel
/stat,slou!
显示求解状况
solve
/post1!
进入后处理
set,list!
列出求解的步数及相关信息
set,last!
读取最后一步结果
plns,s,eqv,,1!
绘出节点的等效应力云图
plns,epto,eqv!
绘出节点的等效应变云图
/post26!
进入时间后处理器
plvar,2!
对以定义的变量2用曲线绘出
/exit,save!
退出并存盘
好了,参照楼上师兄的命令,一个简单的ANSYS分析就进行完了.
愿大家共同进步!
!
*-->k,l,a,v,e,n,cm,et,mp,rwhere==>
k-->Keypoints
l-->Lines
a-->Area
v-->Volumes
e-->Elements
n-->Nodes
cm-->component
et-->elementtype
mp-->materialproperty
r-->realconstant
$-->d,f,sf,bf,ic,where==>
d-->DOFconstraint(ux...inStructural,Tempinthermal,
f-->ForceLoad(Heatinthermal)
sf-->Surfaceloadonnodes
bf-->BodyForceonNodes
$*-->dk-->DOFconstraintsonKP(Vx,Vy,Pres...inCFD)
dl-->DOFconstraintsonLines
da-->DOFconstraintsonAreas
fk-->ForceonKeypoints
sfl-->SurfaceloadonLines
sfa-->SurfaceloadonAreas
sfe-->Surfaceloadonelementfaces
bfk-->BodyForceonKeypoints
bfl-->BodyForceonLines
bfa-->BodyForceonArea
bfv-->BodyForceonVolumes
bfe-->BodyForceonElements
ic-->InitialConditions",
asba,p-->SubtractAreafromArea
asbl,p-->DivideAreabyline
vsba,p-->DividevolumebyArea
lsbw,p-->DividelinebyWorkplane
vsbw,p-->DividevolumebyWorkplane
asbw,p-->DivideareabyWorkplane
vsbv,p-->subtractVolumebyanothervolume
vdrag,p-->Dragareasalongalinetocreateanewvolume
adrag,p-->Draglinealongalinetocreateanewarea
ldrag,p-->DragKPalongalinetocreateanewline
k,p--->AllowsusertopickKPintheWorkplane
l,p--->CreatelinesfromexistingKP
ak,p--->CreateareafromKP
al,p--->Createareafromlines
v,p--->CreateVolumefromKP
va,p--->CreateVolumefromAreas
e,p--->CreateElemfromexistingnodes
en,p--->CreateElemfromnodes
D,p-->ToapplyDOFonnodes
DK,p-->ToapplyDOFonKeypoints
DL,p-->ApplyDOFonLines
DA,p-->ApplyDOFonAreas(symmetryorAnti-symmetrywillbeprompted)
****************
16b.FORCELoading:
COMMANDSYNTAX:
$*,p
Seethevalidcombinationsbelow:
f,p-->Forcesonnodes
fk,p-->ForceonKeypoints
(fa,porFV,porFL,p---->SinceforcecannotbeappliedonLinesorArea&volumes...thiscommanddoesnotexist.)
sf,p-->SurfaceLoadonasetofNodes
sfl,p-->SurfaceLoadonLines
sfa,p-->SurfaceLoadonArea
sfe,p-->SurfaceLoadonElement
(SFk,pandSFV,pdonotexistsincepressurecannotbeappliedonasingleKpandneithercanitbeappliedonavolume)
****************
16d.BodyForceLoad:
COMMANDSYNTAX:
bf*,p
Seethevalidcombinationsbelow:
bf,p-->BodyforceLoadonasetofNodes
bfk,p-->BodyforceLoadonKP
bfl,p-->BodyforceLoadonLines
bfa,p-->BodyforceLoadonAreas
bfv,p-->BodyforceLoadonVolumes
bfe,p-->BodyforceLoadonE
--------------------------------------------------------------------------------------------------------
ANSYS具有混合网格剖分的功能。
例如两个粘在一起的面,可以对一个面进行三角形划分,再对另一个面进行四边形划分。
过程见下列命令:
/prep7
et,1,42
rect,,1,,1
rect,1,2,,1
aglue,all
mshape,0,2d
amesh,1
mshape,1,2d
amesh,3
FINISH
/CLEAR
/Title,Cross-SectionalResultsofaSimpleCantileverBeam
/PREP7
!
Alldimsinmm
Width=60
Height=40
Length=400
BLC4,0,0,Width,Height,Length !
Createsarectangle
/ANGLE,1,60.000000,YS,1 !
Rotatesthedisplay
/REPLOT,FAST !
Fastredisplay
ET,1,SOLID45 !
Elementtype
MP,EX,1,200000 !
Young'sModulus
MP,PRXY,1,0.3 !
Poisson'sratio
esize,20 !
Elementsize
vmesh,all !
Meshthevolume
FINISH
/SOLU !
Entersolutionmode
ANTYPE,0 !
Staticanalysis
ASEL,S,LOC,Z,0 !
Areaselectatz=0
DA,All,ALL,0 !
Constrainthearea
ASEL,ALL !
Reselectallareas
KSEL,S,LOC,Z,Length !
Selectcertainkeypoint
KSEL,R,LOC,Y,Height
KSEL,R,LOC,X,Width
FK,All,FY,-2500 !
Forceonkeypoint
KSEL,ALL !
Reselectallkeypoints
SOLVE !
Solve
FINISH
/POST1 !
Enterpostprocessor
PLNSOL,U,SUM,0,1 !
Plotdeflection
WPOFFS,Width/2,0,0 !
Offsettheworkingplaneforcross-sectionview
WPROTA,0,0,90 !
Rotateworkingplane
/CPLANE,1 !
CuttingplanedefinedtousetheWP
/TYPE,1,8 !
QSLICEdisplay
WPCSYS,-1,0 !
Deflinesworkingplanelocation
WPOFFS,0,0,1/16*Length !
Offsettheworkingplane
/CPLANE,1 !
CuttingplanedefinedtousetheWP
/TYPE,1,5 !
Usethecappedhiddendisplay
PLNSOL,S,EQV,0,1 !
Plotequivalentstress
!
Animation
ANCUT,43,0.1,5,0.05,0,0.1,7,14,2!
Animatetheslices
1.2设材料线弹性、非线性特性
ump,lab,mat,co,c1,…….c4定义材料号及特性
lab:
待定义的特性项目(ex,alpx,reft,prxy,nuxy,gxy,mu,dens)
ex:
弹性模量
nuxy:
小泊松比
alpx:
热膨胀系数
reft:
参考温度
reft:
参考温度
prxy:
主泊松比
gxy:
剪切模量
mu:
摩擦系数
dens:
质量密度
mat:
材料编号(缺省为当前材料号)
co:
材料特性值,或材料之特性,温度曲线中的常数项
c1-c4:
材料的特性-温度曲线中1次项,2次项,3次项,4次项的系数
uTb,lab,mat,ntemp,npts,tbopt,eosopt定义非线性材料特性表
Lab:
材料特性表之种类
Bkin:
双线性随动强化
Biso:
双线性等向强化
Mkin:
多线性随动强化(最多5个点)
Miso:
多线性等向强化(最多100个点)
Dp:
dp模型
Mat:
材料号
Ntemp:
数据的温度数
对于bkin:
ntemp缺省为6
miso:
ntemp缺省为1,最多20
biso:
ntemp缺省为6,最多为6
dp:
ntemp,npts,tbopt全用不上
Npts:
对某一给定温度数据的点数
uTBTEMP,temp,kmod为材料表定义温度值
temp:
温度值
kmod:
缺省为定义一个新温度值
如果是某一整数,则重新定义材料表中的温度值
注意:
此命令一发生,则后面的TBDATA和TBPT均指此温度,应该按升序
若Kmod为crit,且temp为空,则其后的tbdata数据为solid46,shell99,solid191中所述破坏准则
如果kmod为strain,且temp为空,则其后tbdata数据为mkin中特性。
uTBDATA,stloc,c1,c2,c3,c4,c5,c6
给当前数据表定义数据(配合tbtemp,及tb使用)
stloc:
所要输入数据在数据表中的初始位置,缺省为上一次的位置加1
每重新发生一次tb或tbtemp命令上一次位置重设为1,
(发生tb后第一次用空闲此项,则c1赋给第一个常数)
utbpt,oper,x,y在应力-应变曲线上定义一个点
oper:
defi定义一个点
dele删除一个点
x,y:
坐标
-------------------------------------------------------------------------------------------------
!
ELLIPTbyHaiC.Tangintang/ansys
!
Createsanellipticarea
!
*USE,ELLIPT,A,B,N
!
wherex**2/a**2+y**2/b**2=1
!
andthewholeellipticarcisdividedintoNparts
!
equallybytheangleatorigin
*SET,A,ARG1
*SET,B,ARG2
*SET,N,ARG3
*AFUN,DEG
THETA=360.0/N
K,,A
*GET,KMIN,KP,,NUM,MAX
*DO,I,1,N
ANGX=I*THETA
X=A*COS(ANGX)
Y=B*SIN(ANGX)
K,,X,Y
**GET,KMAX,KP,,NUM,MAX
L,KMAX-1,KMAX
*ENDDO
*GET,LMAX,LINE,,NUM,MAX
LMIN=LMAX-N+1
NUMMRG,ALL
LSEL,S,LINE,,LMIN,LMAX
AL,ALL
LSEL,ALL
AnANSYSprogramUsingMacro
/PREP7
ET,1,42
R,1,.25
MP,EX,1,1e7
$*$USE,ELLIPT,.05,.2,36
/pnum,kp,1
RECTNG,,3,,2
/pnum,area,1
aplot
asba,2,1
kesize,10,.01
ksel,s,kp,,1,5
kesize,all,.04
ksel,s,kp,,38,40
kesize,all,.2
ksel,all
amesh,3
save
FINISH
/SOLU
lsel,s,line,,41,42
dl,all,3,symm
lsel,all
sfl,38,pres,-100
solve
FINISH
/POST1
PLNSOL,S,EQV
MeshRefinement
Highgradientareasgenerallyrequirefinermeshes.Meshes
canberefinedwith:
Adaptivemeshing
Useradjustment
Adaptivemeshingautomaticallyevaluatesmeshdiscretization
errorineachelementanddeterminesifaparticularmeshisfine
enough.Ifitisnot,theelementisrefinedwithfinermeshes
automatically.
Userscanalsorevisethemeshbymodifyingthemeshcontrols
aftertheyhavereviewedtheresultsofinitialruns.Onlythe
meshesintheregionsofsteepgradientsneedtoberevised.
UsuallythisislessCPUintensiveandismoreapplicabletothe
situationthatrequiresonlyminoradjustments.
Considerthesolutionforthesemi-infiniteplatewithanelliptic
crackinlastexample.Clearlythesteepgradientislocatednear
thecracktip,andonlythetipareaneedtoberefined.Solet's
binarilybisecttipelementmtimeswiththefollowingformula;
m=log(b/a+1)
AMeshRefinementExample
!
*USE,ELLIPTQ,A,B,N
*SET,A,ARG1
*SET,B,ARG2
*SET,N,ARG3
*AFUN,DEG
THETA=90.0/N
K
*GET,KMIN,KP,,NUM,MAX
K,,A
L,KMIN,KMIN+1
*GET,LMIN,LINE,,NUM,MAX
*IF,A,GT,B,THEN
M=LOG(A/B+1)
ANGX=THETA/2**(M+1)
*DO,I,1,M
ANGX=ANGX*2
X=A*COS(ANGX)
Y=B*SIN(ANGX)
K,,X,Y
*GET,KMAX,KP,,NUM,MAX
L,KMAX-1,KMAX
*ENDDO
*ENDIF
*DO,I,1,N