找回密码
 注册
Simdroid-非首页
查看: 193|回复: 1

求助!!!ansys-焊接生死单元命令流

[复制链接]
发表于 2014-3-18 19:15:22 | 显示全部楼层 |阅读模式 来自 陕西西安
下面是《ANSYS操作命令与参数化编程》中关于焊接生死单元的使用实例,从头看下去,看得很费劲,因为对命令流不熟悉,看到下面的一段,卡住了:
*do,i,1,nse2
*if,ney(2),lt,miny,then
miny=ney2(i)
minx=nex2(i)
mine=ne2(i)
*else
*if,ney2(i),eq,miny,then
*if,nex2(i),lt,minx,then
miny=ney2(i)
minx=nex2(i)
mine=ne2(i)
*endif
*endif
*endif
*enddo
neorder(i1)=mine
*enddo
有几个问题:
(1)这一段是对单元序号进行排序,以便于后面进行进行从下往上的熔敷金属填充。但是我总感觉这段命令流没有实现单元的排序?希望高手帮我解释一下?
(2)假如i=1、2、3,第一个if成立,但是i=4的时候不成立了,接着就执行else后面的两个if,这两个if是“且”的关系,所以必须同时满足,要是else后面的这两个if也不满足,就endif,然后执行i=5,是这样吧。

下面是我看懂了的命令流。希望大家多多交流
/batch
/title,weld analysis by element birth and death
/prep7
/unit,si
et,1,13,4
et,2,13,4
mptemp,1,20,500,800,1200,1500
mpdata,ex,1,1,2.09e11,1.72e11,1.33e11,0.84e11,0.45e11
TB,bkin,1,5
TBTEMP,20,1
TBDATA,1,315E6,0.209E11
TBTEMP,500,2
TBDATA,1,212E6,0.172E11
TBTEMP,800,3
TBDATA,1,153E6,0.133E11
TBTEMP,1200,4
TBDATA,1,93E6,0.084E11
TBTEMP,1500,5
TBDATA,1,33E6,0.045E11

MP,DENS,1,7850
MP,ALPX,1,1.23E-5
MP,NUXY,1,0.3
MP,KXX,1,33
MP,C,561
MP,MURX,1,1
MP,REFT,1,20
*AFUN,DEG
CSYS,0
width=0.1
height=0.03
ar=0.0135*tan(30)
ex=0.01/tan(60)
df=ar+ex
cf=df/cos(60)

k,1,0,0,0
k,2,width/2-0.01-ar,0,0
k,3,width/2+0.01+ar,0,0
k,4,width,0,0
k,5,width/2-0.01,height/2-0.01,0
k,6,width/2+0.01,height/2-0.01,0
k,7,width/2-0.01,height/2+0.01,0
k,8,width/2+0.01,height/2+0.01,0
k,9,0,height,0
k,10,width/2-0.01-ar,height,0
k,11,width/2+0.01+ar,height,0
k,12,width,height,0

n,1,width/2+0.01+ar,height,0
n,2,width,height,0
n,3,width/2+0.01+ar,0

larc,10,11,7,cf
larc,2,3,5,cf
a,1,2,5,7,10,9
a,10,7,5,2,3,6,8,11
a,3,4,12,11,8,6

esize,0.003
type,2
mat,1
amesh,2
esize,0.003
type,1
mat,1
amesh,1,3
nummrg,all,,,,low
numcmp,all
eplot

/solu
antype,4
trnopt,full
nsel,all
*get,minx,node,,mnloc,x
nsel,s,loc,x,minx
d,all,ux,0
*get,miny,node,,mnloc,y
nsel,s,loc,y,miny
d,all,uy,0

nsel,all
*get,minx,node,,mnloc,x
nsel,s,loc,x,minx
d,all,temp,20
nsel,all
*get,maxx,node,,mxloc,x
nsel,s,loc,x,maxx
d,all,temp,20

*set,nna,2
esel,all
*get,emax,elem,,num,max
asel,s,area,,nna
esla
*get,nse,elem,,count
*dim,ne,,nse
*dim,n1,,nse
*dim,n2,,nse
*dim,nex,,nse
*dim,ney,,nse
*dim,neorder,,nse

ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=i+1
ne(ii)=i
*endif
*enddo

*do,i,1,nse
*get,ney(i),elem,ne(i),cent,y
*get,nex(i),elem,ne(i),cent,x
*enddo

d=0

*do,i,1,nse
*if,ney(i),get,height/2,then
d=d+1
n2(d)=ne(i)        
*endif
*enddo

c=0
*do,i,1,nse
*if,ney(i),lt,height/2,then
c=c+1
nl(c)=ne(i)
*endif
*enddo

esel,none
*do,i,1,d
*if,n2(i),ne,0,then
esel,a,elem,,n2(i)
*endif
*enddo
eplot


mine=0
*dim,ne2,,d
*dim,nex2,,d
*dim,ney2,,d
*do,i1,1,d
esel,u,elem,,mine
*get,nse2,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne2(i)=i
*endif
*enddo
*do,i,1,nse2
*get,ney2(i),elem,ne2(i),cent,y
*get,nex2(i),elem,ne2(i),cent,x
*enddo

miny=le20
mine=1e20

*do,i,1,nse2
*if,ney(2),lt,miny,then
miny=ney2(i)
minx=nex2(i)
mine=ne2(i)
*else
*if,ney2(i),eq,miny,then
*if,nex2(i),lt,minx,then
miny=ney2(i)
minx=nex2(i)
mine=ne2(i)
*endif
*endif
*endif
*enddo
neorder(i1)=mine
*enddo

发表于 2016-9-6 15:24:36 | 显示全部楼层 来自 天津
Simdroid开发平台
这论坛也是一潭死水。。。找不到答案,伤心
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-6-30 13:41 , Processed in 0.026260 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表