/title,Weld Analysis by "Element Birth and Death"
/prep7
/unit,si ! 采用国际单位制
!
et,1,13,4 ! 13号二维耦合单元, 同时具有温度和位移自由度
et,2,13,4
!
! 1号材料是钢
! 2号材料是铝
! 3号材料是铜
! 铝是本次分析中的焊料, 它将钢结构部分和铜结构部分焊接起来
! 下面是在几个温度点下, 各材料的弹性模量
mptemp,1,20,500,1000,1500,2000
mpdata,ex,1,1,1.93e11,1.50e11,0.70e11,0.10e11,0.01e11
mpdata,ex,2,1,1.02e11,0.50e11,0.08e11,0.001e11,0.0001e11
mpdata,ex,3,1,1.17e11,0.90e11,0.30e11,0.05e11,0.005e11
!
! 假设各材料都是双线性随动硬化弹塑性本构关系
! 下面是各材料在各温度点下的屈服应力和屈服后的弹性模量
tb,bkin,1,5
tbtemp,20,1
tbdata,1,1200e6,0.193e11
tbtemp,500,2
tbdata,1, 933e6,0.150e11
tbtemp,1000,3
tbdata,1, 435e6,0.070e11
tbtemp,1500,4
tbdata,1, 70e6,0.010e11
tbtemp,2000,5
tbdata,1, 7e6,0.001e11
!
tb,bkin,2,5
tbtemp,20,1
tbdata,1,800e6,0.102e11
tbtemp,500,2
tbdata,1,400e6,0.050e11
tbtemp,1000,3
tbdata,1, 70e6,0.008e11
tbtemp,1500,4
tbdata,1, 1e6,0.0001e11
tbtemp,2000,5
tbdata,1,0.1e6,0.00001e11
!
tb,bkin,3,5
tbtemp,20,1
tbdata,1,900e6,0.117e11
tbtemp,500,2
tbdata,1,700e6,0.090e11
tbtemp,1000,3
tbdata,1,230e6,0.030e11
tbtemp,1500,4
tbdata,1, 40e6,0.005e11
tbtemp,2000,5
tbdata,1, 4e6,0.0005e11
!
! 材料密度(假设为常值)
mp,dens,1,8030
mp,dens,2,4850
mp,dens,3,8900
! 热膨胀系数(假设为常值)
mp,alpx,1,1.78e-5
mp,alpx,2,9.36e-6
mp,alpx,3,1.66e-5
! 泊松比(假设为常值)
mp,nuxy,1,0.29
mp,nuxy,2,0.30
mp,nuxy,3,0.30
! 热传导系数(假设为常值)
mp,kxx,1,16.3
mp,kxx,2,7.44
mp,kxx,3,393
! 比热(假设为常值)
mp,c,1,502
mp,c,2,544
mp,c,3,385
! 热膨胀系数(假设为常值)
! 由于该13号单元还有磁自由度, 此处假设一磁特性, 但并不影响我们所关心的结果
mp,murx,1,1
mp,murx,2,1
mp,murx,3,1
! 假设焊料(铝)焊上去后的初始温度是1500℃
mp,reft,1,20
mp,reft,2,1500
mp,reft,3,20
*afun,deg
csys,0
width=.8
height=0.8
delt1=0.004
deltx=0.04*tan(50)
ar=0.04/sin(45)
br=0.04/sin(40)
k,1,,,
k,2,.08,0,0
k,3,.08,height,0
k,4,0,height,0
k,5,0.08+delt1+deltx,height/2-0.04,0
k,6,.676,height/2-0.04,0
k,7,.676,height/2+0.04,0
k,8,0.08+delt1+deltx,height/2+0.04,0
k,9,0.08+delt1,height/2,0
k,10,.08,height/2+ar,0
k,11,.08,height/2-br,0
k,12,.716,.4,0
k,13,0.72,height/2+ar,0
k,14,.72,height/2-br,0
k,15,.72,0,0
k,16,.8,0,0
k,17,.8,.8,0
k,18,.72,.8,0
larc,10,8,9,ar
larc,11,5,9,br
larc,7,13,12,ar
larc,6,14,12,br
a,1,2,3,4
a,8,10,11,5,9
a,8,9,5,6,12,7
a,6,14,13,7,12
a,18,17,16,15
esize,0.01 !指定网格边长的大
type,2 !!指定单元类型号
mat,2 !指定材料类型参考号
amesh,2 !对焊缝区划分网格
mat,4!指定材料类型参考号
amesh,4 !对焊缝区划分网格
esize,0.03
type,1
mat,1
amesh,1 !对母材区的左面划分网格
mat,3
amesh,3 !对母材区的左面划分网格
mat,5
amesh,5 !对母材区的右面划分网格
nummrg,all,,,,low !合并所有的实体
numcmp,all !压缩所有实体的编号包括节点和单元
eplot
/image,save,vmesh,bmp !将网格保存为一个位图文件,如图8-10所示
finish
!*************************施加约束***************************
/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,r,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,n3,,nse
*dim,n4,,nse
*dim,nex,,nse
*dim,ney,,nse
*dim,nez,,nse
*dim,neorder,,nse
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+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
*get,nez(i),elem,ne(i),cent,z
*enddo
!**************将叉形焊缝区的单元分成四部分,修改的位置**********************************
d=0
*do,i,1,nse
*if,ney(i),ge,0.42,then
d=d+1
n4(d)=ne(i)
*endif
*enddo
e=0
*do,i,1,nse
*if,ney(i),ge,0.4,and,ney(i),lt,0.42,then
e=e+1
n3(e)=ne(i)
*endif
*enddo
c=0
*do,i,1,nse
*if,ney(i),ge,0.38,and,ney(i),lt,0.4,then
c=c+1
n2(c)=ne(i)
*endif
*enddo
b=0
*do,i,1,nse
*if,ney(i),lt,0.38,then
b=b+1
n1(b)=ne(i)
*endif
*enddo
!*****************对焊缝区上中部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,e
*if,n3(i),ne,0,then
esel,a,elem,,n3(i)
*endif
*enddo
eplot
mine3=0
*dim,ne3,,e
*dim,nex3,,e
*dim,ney3,,e
*dim,nez3,,e
*do,i1,1,e
esel,u,elem,,mine3
*get,nse3,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne3(ii)=i
*endif
*enddo
*do,i,1,nse3
*get,ney3(i),elem,ne3(i),cent,y
*get,nex3(i),elem,ne3(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse3
*if,ney3(i),lt,miny,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*else
*if,ney3(i),eq,miny,then
*if,nex3(i),lt,minx,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*endif
*endif
*endif
*enddo
neorder(i1)=mine3 !记录焊缝区中上部分单元顺序编号
*enddo
!******对焊缝区中下部分的单元按质心Y坐标进行排序,与其上部分的过程相类似************
maxe2=0
esel,none
*do,i,1,c
*if,n2(i),ne,0,then
esel,a,elem,,n2(i)
*endif
*enddo
eplot
*dim,ne2,,c
*dim,nex2,,c
*dim,ney2,,c
*do,i1,1,c
esel,u,elem,,maxe2
*get,nse2,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne2(ii)=i
*endif
*enddo
*do,i,1,nse2
*get,ney2(i),elem,ne2(i),cent,y
*get,nex2(i),elem,ne2(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse2
*if,ney2(i),gt,maxy,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*else
*if,ney2(i),eq,maxy,then
*if,nex2(i),lt,maxx,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*endif
*endif
*endif
*enddo
neorder(i1+e)=maxe2 !记录焊缝区最下部分单元顺序编号
*enddo
!*****************对焊缝区最上部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,d
*if,n4(i),ne,0,then
esel,a,elem,,n4(i)
*endif
*enddo
eplot
mine4=0
*dim,ne4,,d
*dim,nex4,,d
*dim,ney4,,d
*do,i1,1,d
esel,u,elem,,mine4
*get,nse4,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne4(ii)=i
*endif
*enddo
*do,i,1,nse4
*get,ney4(i),elem,ne4(i),cent,y
*get,nex4(i),elem,ne4(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse4
*if,ney4(i),lt,miny,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*else
*if,ney4(i),eq,miny,then
*if,nex4(i),lt,minx,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c)=mine4 !记录焊缝区最上部分单元顺序编号
*enddo
!*****************对焊缝区最下部分的单元按质心Y坐标进行排序*******************
maxe=0
esel,none
*do,i,1,b
*if,n1(i),ne,0,then
esel,a,elem,,n1(i)
*endif
*enddo
eplot
*dim,ne1,,b
*dim,nex1,,b
*dim,ney1,,b
*do,i1,1,b
esel,u,elem,,maxe
*get,nse5,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne1(ii)=i
*endif
*enddo
*do,i,1,nse5
*get,ney1(i),elem,ne1(i),cent,y
*get,nex1(i),elem,ne1(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse5
*if,ney1(i),gt,maxy,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*else
*if,ney1(i),eq,maxy,then
*if,nex1(i),lt,maxx,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c+d)=maxe !记录焊缝区最下部分单元顺序编号
*enddo
!******************************************************************
max_tem=1500
delt=1e-3
dt=5
t=0
esel,all
eplot
/auto,1
/replot
*do,i,1,nse
ekill,neorder(i)
esel,s,live
eplot
*enddo
alls
outres,all,all
ic,all,temp,20
kbc,1
timint,0,struct
timint,0,mag
timint,1,therm
tintp,0.005,,,1,0.5,0.2
nsub1=2
nsub2=40
*do,i,1,nse
ealive,neorder(i)
esel,s,live
eplot
esel,all
t=t+delt
time,t
nsubst,1
*do,j,1,4
d,nelem(neorder(i),j),temp,max_tem
*enddo
*enddo
!************************求解*************************************
solve
t=t+delt
time,t
solve
*do,j,1,4
ddele,nelem(neorder(i),j),temp
*enddo
t=t+dt-2*delt
time,t
nsubst,nsub1
solve
*enddo
t=t+50000
time,t
nsubst,nsub2
solve
finish
!************************进入后处理*************************************
/post26
nsol,2,379,temp,,temp379
/gropt,axnsc,1.5,
plvar,2
/image,save,temp379,jpeg
finish
!********生成节点Von Mises当量应力云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1200e6/16,1200e6
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,stress,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,s,eqv
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,s,eqv
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,s,eqv
*enddo
/seg,off,stress,0.1
/image,save,stress,jpeg
finish
!********生成节点温度分布云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1500/16,1500
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,temp,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,temp
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,temp
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,temp
*enddo
/seg,off,temp,0.1
anim,1,1
!******************** 显示路径上的应力分布结果********************
set,last
csys,0
path,xdirection,2,10
ppath,1,1
ppath,2,2
pdef,,s,eqv
/gropt,axnsc,1.5,
plpath,seqv
/image,save,xpath,jpeg
path,ydirection,2,10
ppath,1,1
ppath,2,3
pdef,,s,eqv
/gropt,axnsc,1.5
plpath,seqv
/image,save,ypath,jpeg
finish
save
/title,Weld Analysis by "Element Birth and Death"
/prep7
/unit,si ! 采用国际单位制
!
et,1,13,4 ! 13号二维耦合单元, 同时具有温度和位移自由度
et,2,13,4
!
! 1号材料是钢
! 2号材料是铝
! 3号材料是铜
! 铝是本次分析中的焊料, 它将钢结构部分和铜结构部分焊接起来
! 下面是在几个温度点下, 各材料的弹性模量
mptemp,1,20,500,1000,1500,2000
mpdata,ex,1,1,1.93e11,1.50e11,0.70e11,0.10e11,0.01e11
mpdata,ex,2,1,1.02e11,0.50e11,0.08e11,0.001e11,0.0001e11
mpdata,ex,3,1,1.17e11,0.90e11,0.30e11,0.05e11,0.005e11
!
! 假设各材料都是双线性随动硬化弹塑性本构关系
! 下面是各材料在各温度点下的屈服应力和屈服后的弹性模量
tb,bkin,1,5
tbtemp,20,1
tbdata,1,1200e6,0.193e11
tbtemp,500,2
tbdata,1, 933e6,0.150e11
tbtemp,1000,3
tbdata,1, 435e6,0.070e11
tbtemp,1500,4
tbdata,1, 70e6,0.010e11
tbtemp,2000,5
tbdata,1, 7e6,0.001e11
!
tb,bkin,2,5
tbtemp,20,1
tbdata,1,800e6,0.102e11
tbtemp,500,2
tbdata,1,400e6,0.050e11
tbtemp,1000,3
tbdata,1, 70e6,0.008e11
tbtemp,1500,4
tbdata,1, 1e6,0.0001e11
tbtemp,2000,5
tbdata,1,0.1e6,0.00001e11
!
tb,bkin,3,5
tbtemp,20,1
tbdata,1,900e6,0.117e11
tbtemp,500,2
tbdata,1,700e6,0.090e11
tbtemp,1000,3
tbdata,1,230e6,0.030e11
tbtemp,1500,4
tbdata,1, 40e6,0.005e11
tbtemp,2000,5
tbdata,1, 4e6,0.0005e11
!
! 材料密度(假设为常值)
mp,dens,1,8030
mp,dens,2,4850
mp,dens,3,8900
! 热膨胀系数(假设为常值)
mp,alpx,1,1.78e-5
mp,alpx,2,9.36e-6
mp,alpx,3,1.66e-5
! 泊松比(假设为常值)
mp,nuxy,1,0.29
mp,nuxy,2,0.30
mp,nuxy,3,0.30
! 热传导系数(假设为常值)
mp,kxx,1,16.3
mp,kxx,2,7.44
mp,kxx,3,393
! 比热(假设为常值)
mp,c,1,502
mp,c,2,544
mp,c,3,385
! 热膨胀系数(假设为常值)
! 由于该13号单元还有磁自由度, 此处假设一磁特性, 但并不影响我们所关心的结果
mp,murx,1,1
mp,murx,2,1
mp,murx,3,1
! 假设焊料(铝)焊上去后的初始温度是1500℃
mp,reft,1,20
mp,reft,2,1500
mp,reft,3,20
*afun,deg
csys,0
width=.8
height=0.8
delt1=0.004
deltx=0.04*tan(50)
ar=0.04/sin(45)
br=0.04/sin(40)
k,1,,,
k,2,.08,0,0
k,3,.08,height,0
k,4,0,height,0
k,5,0.08+delt1+deltx,height/2-0.04,0
k,6,.676,height/2-0.04,0
k,7,.676,height/2+0.04,0
k,8,0.08+delt1+deltx,height/2+0.04,0
k,9,0.08+delt1,height/2,0
k,10,.08,height/2+ar,0
k,11,.08,height/2-br,0
k,12,.716,.4,0
k,13,0.72,height/2+ar,0
k,14,.72,height/2-br,0
k,15,.72,0,0
k,16,.8,0,0
k,17,.8,.8,0
k,18,.72,.8,0
larc,10,8,9,ar
larc,11,5,9,br
larc,7,13,12,ar
larc,6,14,12,br
a,1,2,3,4
a,8,10,11,5,9
a,8,9,5,6,12,7
a,6,14,13,7,12
a,18,17,16,15
esize,0.01 !指定网格边长的大
type,2 !!指定单元类型号
mat,2 !指定材料类型参考号
amesh,2 !对焊缝区划分网格
mat,4!指定材料类型参考号
amesh,4 !对焊缝区划分网格
esize,0.03
type,1
mat,1
amesh,1 !对母材区的左面划分网格
mat,3
amesh,3 !对母材区的左面划分网格
mat,5
amesh,5 !对母材区的右面划分网格
nummrg,all,,,,low !合并所有的实体
numcmp,all !压缩所有实体的编号包括节点和单元
eplot
/image,save,vmesh,bmp !将网格保存为一个位图文件,如图8-10所示
finish
!*************************施加约束***************************
/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,r,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,n3,,nse
*dim,n4,,nse
*dim,nex,,nse
*dim,ney,,nse
*dim,nez,,nse
*dim,neorder,,nse
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+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
*get,nez(i),elem,ne(i),cent,z
*enddo
!**************将叉形焊缝区的单元分成四部分,修改的位置**********************************
d=0
*do,i,1,nse
*if,ney(i),ge,0.42,then
d=d+1
n4(d)=ne(i)
*endif
*enddo
e=0
*do,i,1,nse
*if,ney(i),ge,0.4,and,ney(i),lt,0.42,then
e=e+1
n3(e)=ne(i)
*endif
*enddo
c=0
*do,i,1,nse
*if,ney(i),ge,0.38,and,ney(i),lt,0.4,then
c=c+1
n2(c)=ne(i)
*endif
*enddo
b=0
*do,i,1,nse
*if,ney(i),lt,0.38,then
b=b+1
n1(b)=ne(i)
*endif
*enddo
!*****************对焊缝区上中部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,e
*if,n3(i),ne,0,then
esel,a,elem,,n3(i)
*endif
*enddo
eplot
mine3=0
*dim,ne3,,e
*dim,nex3,,e
*dim,ney3,,e
*dim,nez3,,e
*do,i1,1,e
esel,u,elem,,mine3
*get,nse3,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne3(ii)=i
*endif
*enddo
*do,i,1,nse3
*get,ney3(i),elem,ne3(i),cent,y
*get,nex3(i),elem,ne3(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse3
*if,ney3(i),lt,miny,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*else
*if,ney3(i),eq,miny,then
*if,nex3(i),lt,minx,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*endif
*endif
*endif
*enddo
neorder(i1)=mine3 !记录焊缝区中上部分单元顺序编号
*enddo
!******对焊缝区中下部分的单元按质心Y坐标进行排序,与其上部分的过程相类似************
maxe2=0
esel,none
*do,i,1,c
*if,n2(i),ne,0,then
esel,a,elem,,n2(i)
*endif
*enddo
eplot
*dim,ne2,,c
*dim,nex2,,c
*dim,ney2,,c
*do,i1,1,c
esel,u,elem,,maxe2
*get,nse2,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne2(ii)=i
*endif
*enddo
*do,i,1,nse2
*get,ney2(i),elem,ne2(i),cent,y
*get,nex2(i),elem,ne2(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse2
*if,ney2(i),gt,maxy,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*else
*if,ney2(i),eq,maxy,then
*if,nex2(i),lt,maxx,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*endif
*endif
*endif
*enddo
neorder(i1+e)=maxe2 !记录焊缝区最下部分单元顺序编号
*enddo
!*****************对焊缝区最上部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,d
*if,n4(i),ne,0,then
esel,a,elem,,n4(i)
*endif
*enddo
eplot
mine4=0
*dim,ne4,,d
*dim,nex4,,d
*dim,ney4,,d
*do,i1,1,d
esel,u,elem,,mine4
*get,nse4,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne4(ii)=i
*endif
*enddo
*do,i,1,nse4
*get,ney4(i),elem,ne4(i),cent,y
*get,nex4(i),elem,ne4(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse4
*if,ney4(i),lt,miny,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*else
*if,ney4(i),eq,miny,then
*if,nex4(i),lt,minx,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c)=mine4 !记录焊缝区最上部分单元顺序编号
*enddo
!*****************对焊缝区最下部分的单元按质心Y坐标进行排序*******************
maxe=0
esel,none
*do,i,1,b
*if,n1(i),ne,0,then
esel,a,elem,,n1(i)
*endif
*enddo
eplot
*dim,ne1,,b
*dim,nex1,,b
*dim,ney1,,b
*do,i1,1,b
esel,u,elem,,maxe
*get,nse5,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne1(ii)=i
*endif
*enddo
*do,i,1,nse5
*get,ney1(i),elem,ne1(i),cent,y
*get,nex1(i),elem,ne1(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse5
*if,ney1(i),gt,maxy,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*else
*if,ney1(i),eq,maxy,then
*if,nex1(i),lt,maxx,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c+d)=maxe !记录焊缝区最下部分单元顺序编号
*enddo
!******************************************************************
max_tem=1500
delt=1e-3
dt=5
t=0
esel,all
eplot
/auto,1
/replot
*do,i,1,nse
ekill,neorder(i)
esel,s,live
eplot
*enddo
alls
outres,all,all
ic,all,temp,20
kbc,1
timint,0,struct
timint,0,mag
timint,1,therm
tintp,0.005,,,1,0.5,0.2
nsub1=2
nsub2=40
*do,i,1,nse
ealive,neorder(i)
esel,s,live
eplot
esel,all
t=t+delt
time,t
nsubst,1
*do,j,1,4
d,nelem(neorder(i),j),temp,max_tem
*enddo
*enddo
!************************求解*************************************
solve
t=t+delt
time,t
solve
*do,j,1,4
ddele,nelem(neorder(i),j),temp
*enddo
t=t+dt-2*delt
time,t
nsubst,nsub1
solve
*enddo
t=t+50000
time,t
nsubst,nsub2
solve
finish
!************************进入后处理*************************************
/post26
nsol,2,379,temp,,temp379
/gropt,axnsc,1.5,
plvar,2
/image,save,temp379,jpeg
finish
!********生成节点Von Mises当量应力云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1200e6/16,1200e6
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,stress,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,s,eqv
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,s,eqv
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,s,eqv
*enddo
/seg,off,stress,0.1
/image,save,stress,jpeg
finish
!********生成节点温度分布云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1500/16,1500
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,temp,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,temp
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,temp
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,temp
*enddo
/seg,off,temp,0.1
anim,1,1
!******************** 显示路径上的应力分布结果********************
set,last
csys,0
path,xdirection,2,10
ppath,1,1
ppath,2,2
pdef,,s,eqv
/gropt,axnsc,1.5,
plpath,seqv
/image,save,xpath,jpeg
path,ydirection,2,10
ppath,1,1
ppath,2,3
pdef,,s,eqv
/gropt,axnsc,1.5
plpath,seqv
/image,save,ypath,jpeg
finish
save
/title,Weld Analysis by "Element Birth and Death"
/prep7
/unit,si ! 采用国际单位制
!
et,1,13,4 ! 13号二维耦合单元, 同时具有温度和位移自由度
et,2,13,4
!
! 1号材料是钢
! 2号材料是铝
! 3号材料是铜
! 铝是本次分析中的焊料, 它将钢结构部分和铜结构部分焊接起来
! 下面是在几个温度点下, 各材料的弹性模量
mptemp,1,20,500,1000,1500,2000
mpdata,ex,1,1,1.93e11,1.50e11,0.70e11,0.10e11,0.01e11
mpdata,ex,2,1,1.02e11,0.50e11,0.08e11,0.001e11,0.0001e11
mpdata,ex,3,1,1.17e11,0.90e11,0.30e11,0.05e11,0.005e11
!
! 假设各材料都是双线性随动硬化弹塑性本构关系
! 下面是各材料在各温度点下的屈服应力和屈服后的弹性模量
tb,bkin,1,5
tbtemp,20,1
tbdata,1,1200e6,0.193e11
tbtemp,500,2
tbdata,1, 933e6,0.150e11
tbtemp,1000,3
tbdata,1, 435e6,0.070e11
tbtemp,1500,4
tbdata,1, 70e6,0.010e11
tbtemp,2000,5
tbdata,1, 7e6,0.001e11
!
tb,bkin,2,5
tbtemp,20,1
tbdata,1,800e6,0.102e11
tbtemp,500,2
tbdata,1,400e6,0.050e11
tbtemp,1000,3
tbdata,1, 70e6,0.008e11
tbtemp,1500,4
tbdata,1, 1e6,0.0001e11
tbtemp,2000,5
tbdata,1,0.1e6,0.00001e11
!
tb,bkin,3,5
tbtemp,20,1
tbdata,1,900e6,0.117e11
tbtemp,500,2
tbdata,1,700e6,0.090e11
tbtemp,1000,3
tbdata,1,230e6,0.030e11
tbtemp,1500,4
tbdata,1, 40e6,0.005e11
tbtemp,2000,5
tbdata,1, 4e6,0.0005e11
!
! 材料密度(假设为常值)
mp,dens,1,8030
mp,dens,2,4850
mp,dens,3,8900
! 热膨胀系数(假设为常值)
mp,alpx,1,1.78e-5
mp,alpx,2,9.36e-6
mp,alpx,3,1.66e-5
! 泊松比(假设为常值)
mp,nuxy,1,0.29
mp,nuxy,2,0.30
mp,nuxy,3,0.30
! 热传导系数(假设为常值)
mp,kxx,1,16.3
mp,kxx,2,7.44
mp,kxx,3,393
! 比热(假设为常值)
mp,c,1,502
mp,c,2,544
mp,c,3,385
! 热膨胀系数(假设为常值)
! 由于该13号单元还有磁自由度, 此处假设一磁特性, 但并不影响我们所关心的结果
mp,murx,1,1
mp,murx,2,1
mp,murx,3,1
! 假设焊料(铝)焊上去后的初始温度是1500℃
mp,reft,1,20
mp,reft,2,1500
mp,reft,3,20
*afun,deg
csys,0
width=.8
height=0.8
delt1=0.004
deltx=0.04*tan(50)
ar=0.04/sin(45)
br=0.04/sin(40)
k,1,,,
k,2,.08,0,0
k,3,.08,height,0
k,4,0,height,0
k,5,0.08+delt1+deltx,height/2-0.04,0
k,6,.676,height/2-0.04,0
k,7,.676,height/2+0.04,0
k,8,0.08+delt1+deltx,height/2+0.04,0
k,9,0.08+delt1,height/2,0
k,10,.08,height/2+ar,0
k,11,.08,height/2-br,0
k,12,.716,.4,0
k,13,0.72,height/2+ar,0
k,14,.72,height/2-br,0
k,15,.72,0,0
k,16,.8,0,0
k,17,.8,.8,0
k,18,.72,.8,0
larc,10,8,9,ar
larc,11,5,9,br
larc,7,13,12,ar
larc,6,14,12,br
a,1,2,3,4
a,8,10,11,5,9
a,8,9,5,6,12,7
a,6,14,13,7,12
a,18,17,16,15
esize,0.01 !指定网格边长的大
type,2 !!指定单元类型号
mat,2 !指定材料类型参考号
amesh,2 !对焊缝区划分网格
mat,4!指定材料类型参考号
amesh,4 !对焊缝区划分网格
esize,0.03
type,1
mat,1
amesh,1 !对母材区的左面划分网格
mat,3
amesh,3 !对母材区的左面划分网格
mat,5
amesh,5 !对母材区的右面划分网格
nummrg,all,,,,low !合并所有的实体
numcmp,all !压缩所有实体的编号包括节点和单元
eplot
/image,save,vmesh,bmp !将网格保存为一个位图文件,如图8-10所示
finish
!*************************施加约束***************************
/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,r,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,n3,,nse
*dim,n4,,nse
*dim,nex,,nse
*dim,ney,,nse
*dim,nez,,nse
*dim,neorder,,nse
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+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
*get,nez(i),elem,ne(i),cent,z
*enddo
!**************将叉形焊缝区的单元分成四部分,修改的位置**********************************
d=0
*do,i,1,nse
*if,ney(i),ge,0.42,then
d=d+1
n4(d)=ne(i)
*endif
*enddo
e=0
*do,i,1,nse
*if,ney(i),ge,0.4,and,ney(i),lt,0.42,then
e=e+1
n3(e)=ne(i)
*endif
*enddo
c=0
*do,i,1,nse
*if,ney(i),ge,0.38,and,ney(i),lt,0.4,then
c=c+1
n2(c)=ne(i)
*endif
*enddo
b=0
*do,i,1,nse
*if,ney(i),lt,0.38,then
b=b+1
n1(b)=ne(i)
*endif
*enddo
!*****************对焊缝区上中部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,e
*if,n3(i),ne,0,then
esel,a,elem,,n3(i)
*endif
*enddo
eplot
mine3=0
*dim,ne3,,e
*dim,nex3,,e
*dim,ney3,,e
*dim,nez3,,e
*do,i1,1,e
esel,u,elem,,mine3
*get,nse3,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne3(ii)=i
*endif
*enddo
*do,i,1,nse3
*get,ney3(i),elem,ne3(i),cent,y
*get,nex3(i),elem,ne3(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse3
*if,ney3(i),lt,miny,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*else
*if,ney3(i),eq,miny,then
*if,nex3(i),lt,minx,then
miny=ney3(i)
minx=nex3(i)
mine3=ne3(i)
*endif
*endif
*endif
*enddo
neorder(i1)=mine3 !记录焊缝区中上部分单元顺序编号
*enddo
!******对焊缝区中下部分的单元按质心Y坐标进行排序,与其上部分的过程相类似************
maxe2=0
esel,none
*do,i,1,c
*if,n2(i),ne,0,then
esel,a,elem,,n2(i)
*endif
*enddo
eplot
*dim,ne2,,c
*dim,nex2,,c
*dim,ney2,,c
*do,i1,1,c
esel,u,elem,,maxe2
*get,nse2,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne2(ii)=i
*endif
*enddo
*do,i,1,nse2
*get,ney2(i),elem,ne2(i),cent,y
*get,nex2(i),elem,ne2(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse2
*if,ney2(i),gt,maxy,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*else
*if,ney2(i),eq,maxy,then
*if,nex2(i),lt,maxx,then
maxy=ney2(i)
maxx=nex2(i)
maxe2=ne2(i)
*endif
*endif
*endif
*enddo
neorder(i1+e)=maxe2 !记录焊缝区最下部分单元顺序编号
*enddo
!*****************对焊缝区最上部分的单元按质心Y坐标进行排序*******************
esel,none
*do,i,1,d
*if,n4(i),ne,0,then
esel,a,elem,,n4(i)
*endif
*enddo
eplot
mine4=0
*dim,ne4,,d
*dim,nex4,,d
*dim,ney4,,d
*do,i1,1,d
esel,u,elem,,mine4
*get,nse4,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne4(ii)=i
*endif
*enddo
*do,i,1,nse4
*get,ney4(i),elem,ne4(i),cent,y
*get,nex4(i),elem,ne4(i),cent,x
*enddo
miny=1e20
minx=1e20
*do,i,1,nse4
*if,ney4(i),lt,miny,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*else
*if,ney4(i),eq,miny,then
*if,nex4(i),lt,minx,then
miny=ney4(i)
minx=nex4(i)
mine4=ne4(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c)=mine4 !记录焊缝区最上部分单元顺序编号
*enddo
!*****************对焊缝区最下部分的单元按质心Y坐标进行排序*******************
maxe=0
esel,none
*do,i,1,b
*if,n1(i),ne,0,then
esel,a,elem,,n1(i)
*endif
*enddo
eplot
*dim,ne1,,b
*dim,nex1,,b
*dim,ney1,,b
*do,i1,1,b
esel,u,elem,,maxe
*get,nse5,elem,,count
ii=0
*do,i,1,emax
*if,esel(i),eq,1,then
ii=ii+1
ne1(ii)=i
*endif
*enddo
*do,i,1,nse5
*get,ney1(i),elem,ne1(i),cent,y
*get,nex1(i),elem,ne1(i),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,i,1,nse5
*if,ney1(i),gt,maxy,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*else
*if,ney1(i),eq,maxy,then
*if,nex1(i),lt,maxx,then
maxy=ney1(i)
maxx=nex1(i)
maxe=ne1(i)
*endif
*endif
*endif
*enddo
neorder(i1+e+c+d)=maxe !记录焊缝区最下部分单元顺序编号
*enddo
!******************************************************************
max_tem=1500
delt=1e-3
dt=5
t=0
esel,all
eplot
/auto,1
/replot
*do,i,1,nse
ekill,neorder(i)
esel,s,live
eplot
*enddo
alls
outres,all,all
ic,all,temp,20
kbc,1
timint,0,struct
timint,0,mag
timint,1,therm
tintp,0.005,,,1,0.5,0.2
nsub1=2
nsub2=40
*do,i,1,nse
ealive,neorder(i)
esel,s,live
eplot
esel,all
t=t+delt
time,t
nsubst,1
*do,j,1,4
d,nelem(neorder(i),j),temp,max_tem
*enddo
*enddo
!************************求解*************************************
solve
t=t+delt
time,t
solve
*do,j,1,4
ddele,nelem(neorder(i),j),temp
*enddo
t=t+dt-2*delt
time,t
nsubst,nsub1
solve
*enddo
t=t+50000
time,t
nsubst,nsub2
solve
finish
!************************进入后处理*************************************
/post26
nsol,2,379,temp,,temp379
/gropt,axnsc,1.5,
plvar,2
/image,save,temp379,jpeg
finish
!********生成节点Von Mises当量应力云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1200e6/16,1200e6
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,stress,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,s,eqv
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,s,eqv
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,s,eqv
*enddo
/seg,off,stress,0.1
/image,save,stress,jpeg
finish
!********生成节点温度分布云图动画文件的程序段**********************
/post1
/seg,dele
/cont,1,15,0,1500/16,1500
/dscale,1,1.0
avprin,0,0
avres,1
/seg,multi,temp,0.1
esel,all
*do,i,1,nse
esel,u,elem,,neorder(i)
*enddo
*do,i,1,nse
esel,a,elem,,neorder(i)
set,(i-1)*3+1,1
plnsol,temp
*do,j,1,nsub1
set,(i-1)*3+3,j
plnsol,temp
*enddo
*enddo
*do,i,1,nsub2
set,(nse-1)*3+4,i
plnsol,temp
*enddo
/seg,off,temp,0.1
anim,1,1
!******************** 显示路径上的应力分布结果********************
set,last
csys,0
path,xdirection,2,10
ppath,1,1
ppath,2,2
pdef,,s,eqv
/gropt,axnsc,1.5,
plpath,seqv
/image,save,xpath,jpeg
path,ydirection,2,10
ppath,1,1
ppath,2,3
pdef,,s,eqv
/gropt,axnsc,1.5
plpath,seqv
/image,save,ypath,jpeg
finish
save
对,BFe是加在单元上,bf是加在节点上
|