AaronSpark 发表于 2006-5-16 07:33

一个完整的三维移动高斯分布表面热源焊接例子

/prep7
/UNITS,si

et,1,solid70
mp,c,1,544.28
mp,kxx,1,15.06
mp,dens,1,4500

block,0,30,0,15,0,3

esize,1
vmesh,all
FINISH

/SOLU
!PARAMETER TABLE TO INPUT HEAT FLUX AS A MOVING SOURCE
!SPEED OF HEAT SOURCE IN X DIRECTION v=(200/60)m/s
!GAUSS VARIATION ASSUMED IN X & Y DIRECTION AS q=qmax/EXP(K*R**2)
!TOTAL HEAT INPUT Q=3.14*qmax/K
!DIMENSIONING TABLE NAMED "FLUX2"
v=1
L=30
NUM_TIME=L/v+1
NUM_X=L/v+1

*DIM,FLUX2,TABLE,NUM_TIME,NUM_X,7,TIME,X,Y

*DO,K,1,7,1

*DO,I,1,NUM_TIME,1
FLUX2(I,0,K)=(I-1)
*ENDDO

*DO,J,1,NUM_X,1
FLUX2(0,J,K)=(J*v-v)
*ENDDO

Q=1000
KAPA=1/4
qmax=((Q*KAPA)/3.14159)
PERCENT=0.98
RADIUS=ABS(SQRT(1/KAPA*LOG(1/(1-PERCENT))))

!N=

*DO,ANTIME,1,NUM_TIME,1
*DO,N,0,15,1
XDIST=(N*v)
*IF,(ANTIME-N),GT,0,THEN
*IF,SQRT((XDIST)**2+((RADIUS/6)*(K-1))**2),LE,RADIUS,THEN
!
GAUSS=qmax/EXP(KAPA*((XDIST)**2+((RADIUS/6)*(K-1))**2))
FLUX2(ANTIME,ANTIME-N,K)=GAUSS*10e5
!
*ELSE
*ENDIF
*ENDIF
!
*IF,(ANTIME+N),LE,NUM_TIME,THEN
*IF,SQRT((XDIST)**2+((RADIUS/6)*(K-1))**2),LE,RADIUS,THEN
!
GAUSS=qmax/EXP(KAPA*((XDIST)**2+((RADIUS/6)*(K-1))**2))
FLUX2(ANTIME,ANTIME+N,K)=GAUSS*10e5
!
*ELSE
*ENDIF
*ENDIF
*ENDDO
*ENDDO
!
!INPUT Y DIRECTION DIVISIONS
!---------------------------
FLUX2(0,0,K)=(K-1)*(RADIUS/6)
*ENDDO

antype,trans
tunif,20
kbc,1

*SET,delt,1
timint,on
autots,off

*do,tm,1e-6,30,0.5
/VIEW, 1 ,1,1,1
/ANG, 1
/REP,FAST
FLST,2,1,5,ORDE,1
FITEM,2,2
/GO
!*
TIME,tm
AUTOTS,0
DELTIM, , , ,1
KBC,0
!*
TSRES,ERASE
FLST,2,1,5,ORDE,1
FITEM,2,2
/GO
!*
!*
SFA,P51X,1,HFLUX, %FLUX2%
/STATUS,SOLU
SOLVE
OUTRES,ALL,ALL,
/PSF,hflux,,2

/replot

*enddo
OUTRES,ALL,ALL,

FINISH

AaronSpark 发表于 2006-5-16 07:34

这个例子的看点:

1.建模.

2.死活单元.

3.相变.

4.局部坐标系.


/PREP7
!*********************
ET,1,SOLID70 !thermal solid

MP,KXX,1,.5e-3 !weld on right
MP,C,1,.2
MP,DENS,1,.2833
MPTEMP,1,0,2643,2750,2875,3000 !enthalpy as function of time
MPDATA,ENTH,1,1,0,128.1,163.8,174.2,184.6

MP,KXX,2,.5e-3 !solid material
MP,C,2,.2
MP,DENS,2,.2833

MP,KXX,3,0.5e-3 !weld on left
MP,C,3,.2 !for t=: only right weld, left weld has no therm conduct
MP,DENS,3,.2833 !for t>1000: left weld is activated

W=1.20
TL=.34
TWELD=.2 ! weld thickness
TPIVOT=TL ! thickness of support bar
TPHALF=TPIVOT/2
WIDTH=W ! width of support bar
WHALF=WIDTH/2
LCYL=2.5 ! length of cylinder
LHALF=LCYL/2
RID=.50 ! inside radius of cylinder
ROD=.75 ! outside radius of cylinder
*AFUN,DEG
ANG1=50-ASIN(TPHALF/ROD)-2*ASIN(TWELD/(2*ROD))
ANG2=50-ASIN(TPHALF/ROD)
ANG3=50+ASIN(TPHALF/ROD)
ANG4=50+ASIN(TPHALF/ROD)+2*ASIN(TWELD/(2*ROD))
WPST,-1 ,1 ,-10 ,10 ,.003 ,3

/PNUM,VOLU,1
/VIEW,1,-.2,.2,1
CYLIND,RID,ROD,-LHALF,-WHALF,-90,ANG1
CYLIND,RID,ROD,-WHALF,+WHALF,-90,ANG1
CYLIND,RID,ROD,+WHALF,+LHALF,-90,ANG1
CYLIND,RID,ROD,-LHALF,-WHALF,ANG1,ANG2
CYLIND,RID,ROD,-WHALF,+WHALF,ANG1,ANG2
CYLIND,RID,ROD,+WHALF,+LHALF,ANG1,ANG2
CYLIND,RID,ROD,-LHALF,-WHALF,ANG2,ANG3
CYLIND,RID,ROD,-WHALF,+WHALF,ANG2,ANG3
CYLIND,RID,ROD,+WHALF,+LHALF,ANG2,ANG3
CYLIND,RID,ROD,-LHALF,-WHALF,ANG3,ANG4
CYLIND,RID,ROD,-WHALF,+WHALF,ANG3,ANG4
CYLIND,RID,ROD,+WHALF,+LHALF,ANG3,ANG4
CYLIND,RID,ROD,-LHALF,-WHALF,ANG4,90
CYLIND,RID,ROD,-WHALF,+WHALF,ANG4,90
CYLIND,RID,ROD,+WHALF,+LHALF,ANG4,90

/TYPE,1,4
WPROT,50 ! vol 16 (used to trim welds)
BLOCK,.6,rod*cos(asin(tphalf/rod))+tweld,-tphalf,tphalf,-whalf,whalf
CSWPLA,11,0
KSEL,S,LOC,X,.75*COS(ASIN(TPHALF/ROD))
KSEL,R,LOC,Y,-TPHALF
KSEL,R,LOC,Z,LHALF
*GET,KNUM1,KP,,NUM,MAX
KSEL,S,LOC,X,.75*COS(ASIN(TPHALF/ROD))
KSEL,R,LOC,Y,TPHALF
KSEL,R,LOC,Z,LHALF
*GET,KNUM2,KP,,NUM,MAX
KSEL,ALL
WPRO,-50
CSYS,0
LOCAL,12,0,KX(KNUM1),KY(KNUM1)
CSYS,0
LOCAL,13,0,KX(KNUM2),KY(KNUM2)
WPCSYS,-1,12
VSEL,U,,,1,16
CYLIND,,TWELD,-WHALF,WHALF,(ANG1+ANG2)/2-90,70
/DIST,1,.6
/FOCUS,1,.47,.59
WPCSYS,-1,13
CYLIND,,TWELD,-WHALF,WHALF,35,90+(ANG3+ANG4)/2
VSEL,ALL
BOPT,keep,yes,
bopt,version,rv52
VSEL,S,,,5,17,12
VSBV,17,5
VSEL,A,,,16,19,3
VSBV,19,16
VSEL,A,,,11,18,7
VSBV,18,11
VSEL,A,,,16,21,5
VSBV,21,16
VSEL,ALL
WPSTYLE,default
/FOCUS,,.5,.5
/DIST,1,.6
CYLIN,.6,SQRT((ROD+.01)**2+TPHALF**2),-2,+2,10,90
BOPT,keep,no
VSEL,S,,,20,22,2
VSEL,A,,,23
VSEL,ALL
VOVLAP,20,22,23
VDELE,16,21,1,1
VDELE,28,,,1
/TYPE,1,4

CSYS,0
WPCSYS,-1
WPROT,50

NUMSTR,VOLU,29
block,ROD+.01,ROD*COS(ASIN(TPHALF/ROD))+TWELD,-TPHALF,TPHALF,-WHALF,WHALF
NUMSTR,VOLU,30
BLOCK,ROD*COS(ASIN(TPHALF/ROD))+TWELD,3,-TPHALF,TPHALF,-WHALF,WHALF
NUMMRG,KP
VSEL,S,,,24,26,2 ! right hand weld (make mat 1)
ESIZE,.1
VMESH,ALL
MAT,3
vsel,s,,,25,27,2 ! left hand weld (make mat 3 - dead)
vmesh,all
ALLSEL,ALL
VSEL,S,,,24,27,1
VSEL,A,,,30
VSEL,INVE
ESIZE,.1
MAT,2
VMESH,ALL
ESIZE,.2
LSEL,S,,,198,199
LESIZE,ALL,,,8,5,1
LSEL,S,,,196,201,5
LESIZE,ALL,,,8,.2,1
ALLSEL,ALL
VMESH,30
NUMCMP,all
WPSTYLE,,,,,,,,0
esel,s,mat,,3
ekill,all
allsel,all
SAVE,mesh,DB
FINI
!
!
!*********************
/SOLU
!*********************
ANTYPE,TRANS

!Initialization of temperatures
!----------------------------
TIMINT,OFF
ESEL,S,MAT,,1 !weld on right
NSLE
D,ALL,TEMP,3000 !To(weld)=3000
NSEL,INVE
D,ALL,TEMP,70 !To(steel)=70
TIME,1
KBC,0
NSUBST,2,2,2
OUTRES,BASIC,2
ALLSEL,all
SOLVE
SAVE,therm,db

!Phase change for weld on right (time varies from 1 to 100 and from 100 to 1000)
!----------------------------------------------------------------------------------
OUTRES,NSOL,1
DDELE,ALL,TEMP
TIMINT,ON
TINTP,,,,1
TIME,100 !phase change
DELTIME,1,.5,10
AUTOTS,ON
ASEL,S,EXT
ASEL,U,LOC,X,0
SFA,ALL,,CONV,5E-5,70
ALLSEL,ALL
SOLVE

TIME,1000 !solidification
DELTIME,50,10,500
AUTOTS,ON
SOLVE
FINI

!Phase change for weld on right (time varies from 1e3 to 1100 and from 1100 to 2000)
!---------------------------------------------------------------------------------------
/PREP7
EALIVE,ALL
ALLSEL,all
FINI

/SOLU
ANTYPE,TRANS,REST
vsel,s,,,17
vsel,a,,,19
nslv,,1
d,all,temp,3000
time,1001
nsubst,2,2,2
allsel,all
solve

ANTYPE,TRANS,REST
DDELE,ALL,TEMP
TIME,1100
DELTIME,1,.5,10
SOLVE
TIME,2000
DELTIME,100,10,200
SOLVE
FINI

lorry 发表于 2006-9-7 21:23

楼主的例子从何而来?望能提供更多的例子。

hxb944210 发表于 2006-9-26 10:12

例子不错,就是少了一点注释,跟编程一样,没有注释的代码别人总是很难看懂的。建议今后再上传类似例子时能有相关的注释。

新元素 发表于 2006-12-19 10:04

也是
我是新手
现在看命令流有点困难
建议
加上注释
毕竟还有广大的初级爱好者
谢谢

datace100 发表于 2008-4-25 17:15

感谢LZ !这个例子很好啊

xsdcaifu 发表于 2008-4-26 12:47

例子很好,这是两个例子吗?:@)

bavil 发表于 2008-5-9 14:17

zhi支持,就是看的不是很懂

onlyu 发表于 2008-5-9 17:18

不久我也要做这方面的东西,感谢了先,以后还得多多请教

lixiaoyu0323 发表于 2009-12-9 15:46

非常感谢,好好看咯:@)

yaojinnan2009 发表于 2009-12-18 16:23

谢谢啦。。。呵呵

守护蓝天 发表于 2011-1-3 15:23

下来研究下,现在正在做这方面的工作,急需这样的例子。还有这样的例子吗?

lzwlws 发表于 2011-3-9 11:44

正需要这个,只是得一行一行看,有点麻烦啊

lzwlws 发表于 2011-3-9 11:50

回复 1 # AaronSpark 的帖子

问下楼主,第28行的7,和47行的15怎么确定的?

gension 发表于 2011-3-30 13:10

能讲解一下否?
页: [1] 2
查看完整版本: 一个完整的三维移动高斯分布表面热源焊接例子