马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
- /UNITS,SI
- /CONFIG,NRES,10000
- /PREP7
- ET,1,SOLID70 !单元类型,1表示此单元编号为1
- MP,DENS,1,7930 !定义材料密度
- MP,C,1,502 !定义材料比热
- mptemp,1,20,100,500
- mpdata,kxx,1,1,12.1,16.3,21.4 !kxx热导系数
- /VIEW,1,1,1,1
- !*************定义基板尺寸***********
- lx=0.1
- lz=0.1
- ly=0.006 !基板大小
- !*************定义焊接参数***********
- layer=7 !总的焊接道数
- lap=1/3 !两道之间搭接量
- weld=0.01 !每道焊道宽度
- wweld=layer*weld-(layer-1)*lap*weld !焊道的总宽度
- wheight=0.004 !焊道的高度
- remain=0.01
- LSIZE=0.002
- V=0.008 !速度
- pi=3.1415926
- U=25
- I=180
- Q=U*I !电源有效功率(在此,可以对Q通过UI来调整)
- R=0.006 !电源有效热半径
- effect=0.8
- Qmax=effect*Q/(pi*R*R) !中心处最大热流
- tm=(lx-2*remain)/V !一道的总时间
- tinc=LSIZE/V !每小段的时间间隔
- !*****************建立模型,生成网格**************
- block,0,lx,0,ly,0,lz !创建一个块体积,可以根据基板尺寸调整坐标
- wpoff,remain,ly,(lz-wweld)/2 !随着坐标系轴的变化平移工作平面
- block,0,lx-2*remain,0,wheight,0,wweld
- vsbw,all,,delete !对block布尔运算
- wpoff,,,wweld
- vsbw,all,,delete
- wprota,90,90 !转动工作面
- vsbw,all,,delete
- wpoff,,,lx-2*remain
- vsbw,all,,delete
- save
- vglue,all !粘合所有的几何体
- lsel,s,,,9,12,1
- lsel,a,,,25,26,1
- lsel,a,,,30
- lsel,a,,,32
- lsel,a,,,38
- lsel,a,,,45
- lsel,a,,,59
- lsel,a,,,73
- lesize,all,0.005,,,0.2,,,,1
- allsel,all
- lsel,s,,,13,16,1
- lsel,a,,,19,21,1
- lsel,a,,,23,24,1
- lsel,a,,,34
- lsel,a,,,41,44,1
- lsel,a,,,63,64,1
- lsel,a,,,77,78,1
- lsel,a,,,81,82,1
- lesize,all,0.001,,,1,,,,1
- allsel,all
- lsel,s,,,1
- lsel,a,,,3,6,1
- lsel,a,,,8
- lsel,a,,,27
- lsel,a,,,29
- lsel,a,,,31
- lsel,a,,,33
- lsel,a,,,35
- lsel,a,,,37
- lsel,a,,,40
- lsel,a,,,50
- lsel,a,,,53
- lsel,a,,,55
- lsel,a,,,62
- lsel,a,,,67
- lsel,a,,,69
- lsel,a,,,85
- lesize,all,0.002,,,1,,,,1
- allsel,all
- lsel,s,,,46
- lsel,a,,,86
- lsel,a,,,88
- lesize,all,0.001,,,5,,,,1
- allsel,all
- vsweep,all
- /PNUM,DEFA
- EPLOT
- fini
- !*******************进入后处理器*********************
- /solu
- antype,trans,new
- !nlgeom,on
- timint,0,struct
- timint,1,therm
- timint,0,mag
- timint,0,elect
- tref,25
- nropt,auto
- autos,on
- kbc,0
- pred,on
- lnsrch,on
- !************杀死焊缝去单元***********
- nsel,s,loc,y,ly,ly+wheight
- esln,s,1
- ekill,all
- allsel,all
- esel,s,live
- eplot
- !**********施加对流载荷*************
- esel,s,live
- nsel,s,loc,z,0
- nsel,a,loc,z,lz
- nsel,a,loc,x,0
- nsel,a,loc,x,lx
- sf,all,conv,10,25
- !************定义数组维数**********
- MAX_TIME=1+tm/tinc
- !MAX_X=1+(lx-2*remain)/LSIZE
- MAX_X=1+lx/LSIZE
- MAX_Z=1+lz/LSIZE
- !*************定义table数组
- ******************************************
- *DIM,heatflux,TABLE,MAX_X,MAX_Z,MAX_TIME,X,Z,TIME
- *do,n,1,layer,1
- m=mod(n,2)
- *if,m,eq,1,then
- !n=1
- *DO,K,1,MAX_TIME,1
- *DO,I,1,MAX_X,1
- heatflux(I,0,K)=(I-1)*LSIZE
- *ENDDO
- *DO,J,1,MAX_Z,1
- heatflux(0,J,K)=(J-1)*LSIZE
- *ENDDO
- *DO,I,1,MAX_X,1
- *DO,J,1,MAX_Z,1
- XCENTER=remain+V*(K-1)*tinc
- ZCENTER=2*(n-1)*weld/3+(lz-wweld)/2+weld/2
- DISTANCE=SQRT(((I-1)*LSIZE-XCENTER)**2+((J-1)*LSIZE-
- ZCENTER)**2)
- *IF,DISTANCE,LE,R,THEN
- heatflux(I,J,K)=Qmax/EXP(2*DISTANCE**2/(R**2))
- *ELSE
- heatflux(I,J,K)=0
- *ENDIF
- *ENDDO
- *ENDDO
- heatflux(0,0,K)=(K-1)*tinc
- !**********激活单元*********
- esel,s,live
- nsel,s,loc,x,xcenter-0.002,xcenter+0.001
- nsel,r,loc,z,zcenter-weld/2,zcenter+weld/2
- nsel,r,loc,y,ly,ly+wheight
- esln,s,0
- ealive,all
- allsel,all
- !**********施加热流载荷**********
- esel,s,live
- nsel,s,loc,Y,ly
- sf,all,hflux,%heatflux%
- allsel,all
- !************求解*****************
- time,(n-1)*(tm+tinc)+k*lsize/v
- nsubst,2
- SOLVE
- !*************删除热流载荷***********
- nsel,s,loc,y,ly
- sfdele,all,hflux
- allsel,all
- esel,s,live
- eplot
- OUTRES,ALL,ALL,
- /PSF,HFLUX,,2
- /REPLOT
- OUTRES,ALL,ALL,
- *ENDDO
-
- *else
- !n=2
- *DO,K,1,MAX_TIME,1
- *DO,I,1,MAX_X,1
- heatflux(I,0,K)=(I-1)*LSIZE
- *ENDDO
- *DO,J,1,MAX_Z,1
- heatflux(0,J,K)=(J-1)*LSIZE
- *ENDDO
- *DO,I,1,MAX_X,1
- *DO,J,1,MAX_Z,1
- XCENTER=lx-remain-V*(K-1)*tinc
- ZCENTER=2*(n-1)*weld/3+(lz-wweld)/2+weld/2
- DISTANCE=SQRT(((I-1)*LSIZE-XCENTER)**2+((J-1)*LSIZE-
- ZCENTER)**2)
- *IF,DISTANCE,LE,R,THEN
- heatflux(I,J,K)=Qmax/EXP(2*DISTANCE**2/(R**2))
- *ELSE
- heatflux(I,J,K)=0
- *ENDIF
- *ENDDO
- *ENDDO
- heatflux(0,0,K)=(K-1)*tinc
- !**********激活单元*********
- esel,s,live
- nsel,s,loc,x,xcenter-0.001,xcenter+0.002
- nsel,r,loc,z,zcenter-weld/2,zcenter+weld/2
- nsel,r,loc,y,ly,ly+wheight
- esln,s,0
- ealive,all
- allsel,all
- !**********施加热流载荷**********
- esel,s,live
- nsel,s,loc,Y,ly
- sf,all,hflux,%heatflux%
- allsel,all
- !************求解*****************
- time,(n-1)*(tm+tinc)+k*lsize/v
- nsubst,2
- SOLVE
- !*************删除热流载荷***********
- nsel,s,loc,y,ly
- sfdele,all,hflux
- allsel,all
- esel,s,live
- eplot
- OUTRES,ALL,ALL,
- /PSF,HFLUX,,2
- /REPLOT
- OUTRES,ALL,ALL,
- *ENDDO
- *endif
- *enddo
- FINISH
复制代码
|