!上表面上没有对流换热边界条件 !单位制:米、秒、摄氏度
! /CLEAR,START /FILNAME,temp,0
/COM,ANSYS RELEASE 10.0 UP20050718 00:09:52 11/26/2007
/CONFIG, NRES, 5000
/PREP7 /VIEW,1,1,2,3
/ANG,1 /REP,FAST
!*
!=============================================================================
==================!指定单元
ET,1,SOLID70
!* !*
!=============================================================================
==================!材料属性
!=============================================================================
========!316L MPTEMP,,,,,,,, MPTEMP,1,0 MPDATA,DENS,1,,7850 MPTEMP,,,,,,,, MPTEMP,1,20 MPTEMP,2,300 MPTEMP,3,900 MPTEMP,4,1400 MPTEMP,5,2000 MPDATA,KXX,1,,18.6 MPDATA,KXX,1,,21.4
MPDATA,KXX,1,,28.4 MPDATA,KXX,1,,33.9 MPDATA,KXX,1,,48 MPTEMP,,,,,,,, MPTEMP,1,20 MPTEMP,2,600 MPTEMP,3,800 MPTEMP,4,1400 MPTEMP,5,2000 MPDATA,C,1,,502 MPDATA,C,1,,612 MPDATA,C,1,,635 MPDATA,C,1,,659 MPDATA,C,1,,670 MPTEMP,,,,,,,, MPTEMP,1,20 MPTEMP,2,1300 MPTEMP,3,1410 MPTEMP,4,1440 MPTEMP,5,1550 MPTEMP,6,2000 MPDATA,ENTH,1,,7.88e7 MPDATA,ENTH,1,,6.131e9 MPDATA,ENTH,1,,7.347e9 MPDATA,ENTH,1,,9.145e9 MPDATA,ENTH,1,,1.03e10 MPDATA,ENTH,1,,1.272e10
!=============================================================================
==================!定义常量
WidthBase=0.025 !宽度 HeightBase=0.02 !基底高度
Length=0.09 !长度
WidthClad=0.0015 !宽度 HeightDeposition=0.00375 !覆层高度
Layer=15 !层数
HeightClad=HeightDeposition/layer
dt=0.0001 !小量
Temp=20 !环境温度 InitTemp=300 !初始温度 CoffConv=30 !对流换热系数
!=============================================================================
==================!定义常量
Velocity=0.003 !扫描速度 StepDis=0.0015 !每个载荷步位移
LaserPower=700 !激光功率 Radius=0.0015 !激光光斑半径 Area=3.14159265*(Radius**2) !激光光斑面积 Factor=0.3 !吸收因子
StepTime=StepDis/Velocity !每个载荷步时间 TotalTime=(Length+Radius*2)/Velocity !载荷持续时间(扫描一层)
StepNum=(Length+Radius*2)/StepDis !载荷步数
!=============================================================================
==================!建模
BLOCK,0,Length,0,-0.0066,0,WidthClad, BLOCK,0,Length,0,-0.0066,WidthClad,0.0067 BLOCK,0,Length,-0.0066,-HeightBase,0,WidthClad,
K, ,0,0,WidthBase, K, ,Length,0,WidthBase, K, ,0,-HeightBase,WidthBase, K, ,Length,-HeightBase,WidthBase,
V, 16, 13, 27, 25, 15, 14, 28, 26 V, 24, 21, 27, 13, 23, 22, 28, 14
BLOCK,0,Length,0,HeightDeposition,0,WidthClad,
VGLUE,ALL NUMCMP,ALL
!=============================================================================
==================!划分网格
LSEL, S, LOC, Y, dt, HeightDeposition-dt, !高度方向
LESIZE, ALL, , , Layer,
LSEL,S,LOC,Y,-DT,-0.0066+DT
LSEL,R,LOC,X,0 LESIZE,ALL,,,4,2
LSEL,S,LOC,Y,-DT,-0.0066+DT
LSEL,R,LOC,X,Length LESIZE,ALL,,,4,0.5
LSEL,S,LOC,Y,-0.0066-DT,-HeightBase+DT LSEL,R, LOC, Z, 0, WidthBase-DT,
LESIZE,ALL,,,4,2
LSEL,S,LOC,Y,-0.0066-DT,-HeightBase+DT
LSEL,R, LOC, Z, WidthBase,
LESIZE,ALL,,,4,0.5
LSEL, S, LOC, X, dt, Length-dt, !长度方向
LESIZE, ALL, , , Length/StepDis,
LSEL, S, LOC, Z, dt, WidthClad-dt, !宽度方向
LESIZE, ALL, , , 1,
LSEL,S,LOC,Z,WidthClad+DT,0.0067-DT
LESIZE,ALL,,,4,
LSEL,S,LOC,Z,0.0067+DT,WidthBase-DT
LSEL,R,LOC,Y,-DT,-HeightBase
LESIZE,ALL,,,4,2
LSEL,S,LOC,Z,0.0067+DT,WidthBase-DT
LSEL,R,LOC,Y,0 LESIZE,ALL,,,4,0.5
VSEL,S,LOC,Y,0,HeightDeposition !网格划分
TYPE,1 MAT,1 MSHAPE,0,3D MSHKEY,1 VMESH,ALL
VSEL,S,LOC,Y,-1,0 !网格划分
TYPE,1 MAT,1 MSHAPE,0,3D MSHKEY,1 VMESH,ALL
ALLSEL,ALL
!=============================================================================
==================!基底边界条件、初始条件
NSEL, S, LOC, Y, -HeightBase, 0 !基底初始温度
IC,ALL,TEMP,InitTemp
ALLSEL,ALL
NSEL, S, LOC, Y, -HeightBase, 0 !基底侧面,换热边界条件
NSEL, R, LOC, Z, WidthBase SF, ALL, CONV, CoffConv, Temp
ALLSEL,ALL
NSEL, S, LOC, Y, -HeightBase, 0 !基底左端面,换热边界条
件
NSEL, R, LOC, X, 0 SF, ALL, CONV, CoffConv, Temp
ALLSEL,ALL
NSEL, S, LOC, Y, -HeightBase, 0 !基底右端面,换热边界条
件
NSEL, R, LOC, X, Length SF, ALL, CONV, CoffConv, Temp
ALLSEL,ALL
NSEL, S, LOC, Y, 0 !基底上表面,换热边界
条件
NSEL, R, LOC, Z, WidthClad, WidthBase
SF, ALL, CONV, CoffConv, Temp
ALLSEL,ALL
FINISH /SOLU
!=============================================================================
==================!瞬态分析参数设置
ANTYPE,4 !分析类型:瞬态
!*
TRNOPT,FULL !求解方法:完全的N-R方法
LNSRCH, on !*
!DELTIM,0.01,0.001,0.05 !载荷子步(默认子步时间步长、最
小、最大)——载荷步为0.333
NSUBST, 4
CNVTOL,HEAT, ,0.01,2,0.000001, !收敛准则:控制热流 OUTRES,NSOL,LAST !结果输出:所有
!=============================================================================
==================!杀死单元
NSEL, S, LOC, Y, 0, HeightDeposition !杀死熔覆层单元
ESLN, S, 1, ALL EKILL,ALL ALLSEL,ALL
ESEL,S,LIVE EPLOT
ESEL,S,LIVE !激活单元的上表面,指定为对
流换热边条 NSLE,S,1 NSEL,R,LOC,Y,0 NSEL,R,LOC,Z,0,Radius SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
!=============================================================================
==================!预热
*DO, i, 1, 2
m=mod(i,2)
*IF,m,EQ,1,THEN !如果为奇数层,向右扫描
*DO, k, 1, StepNum, 1
TIME,TotalTime*(i-1)+StepTime*k !载荷步结束时间 KBC, 1 !载荷步内载荷随时间分布:
常数
LeftX=StepDis*(k-1) RightX=StepDis*k
NSEL, S, LOC, Y, 0
ESEL, S, LIVE ESLN, R, 0 NSLE, S, 1
NSEL, R, LOC, x, RightX-2*Radius, RightX
NSEL, R, LOC, Z, 0, Radius !激活单元的上表面,加
热流密度 ESLN, S, 1
SFE, ALL, 4, HFLUX, , LaserPower*Factor/Area, , ,
ALLSEL, ALL
SOLVE SAVE
SFEDELE,ALL,4,HFLUX !删除热流密度载荷
ALLSEL, ALL
ESEL,S,LIVE !激活单元的上表面,
指定为对流换热边条 NSLE,S,1 NSEL,R,LOC,Y,0
NSEL, R, LOC, x, LeftX-2*StepDis, RightX-2*StepDis
NSEL, R, LOC, Z, O, Radius SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE EPLOT
*ENDDO
*ELSE !如果为偶数层,向左扫描
*DO, k, 1, StepNum, 1
TIME,TotalTime*(i-1)+StepTime*k !载荷步结束时间 KBC, 1 !载荷步内载荷随时间分布:
常数
LeftX=Length-StepDis*k RightX=Length-StepDis*(k-1)
NSEL, S, LOC, Y, 0 ESEL, S, LIVE ESLN, R, 0 NSLE, S, 1
NSEL, R, LOC, x, RightX-2*Radius, RightX
NSEL, R, LOC, Z, 0, Radius !激活单元的上表面,加
热流密度 ESLN, S, 1
SFE, ALL, 4, HFLUX, , LaserPower*Factor/Area, , ,
ALLSEL, ALL
SOLVE SAVE
SFEDELE,ALL,4,HFLUX !激活单元的上表面,
删除载荷 ALLSEL, ALL
ESEL,S,LIVE !激活单元的上表面,
指定为对流换热边条 NSLE,S,1 NSEL,R,LOC,Y,0
NSEL, R, LOC, x, LeftX-2*StepDis, RightX-2*StepDis
NSEL, R, LOC, Z, O, Radius SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE EPLOT
*ENDDO
*ENDIF *ENDDO ESEL,S,LIVE EPLOT
!=============================================================================
==================!熔覆
*DO, i, 1, Layer, 1
m=mod(i,2)
*IF,m,EQ,1,THEN !如果为奇数层,向右扫描
*DO, k, 1, StepNum, 1
TIME,TotalTime*(i+1)+StepTime*k !载荷步结束时间 KBC, 1 !载荷步内载荷随时间分布:
常数
LeftX=StepDis*(k-1) RightX=StepDis*k
NSEL, S, LOC, Y, HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
NSEL, R, LOC, x, LeftX, RightX
ESLN, S, 1 EALIVE,ALL ALLSEL, ALL
NSEL, S, LOC, Y, HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
NSEL, R, LOC, x, RightX-2*Radius, RightX
NSEL, R, LOC, Z, 0, Radius !激活单元的上表面,加
热流密度
ESLN, S, 1
SFE, ALL, 4, HFLUX, , LaserPower*Factor/Area, , ,
ALLSEL, ALL
ESEL,S,LIVE !激活单元的表面,如
果包含左端面,指定为对流换热边条
NSLE,S,1 NSEL,R,LOC,X,0
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE !激活单元的表面,如
果包含右端面,指定为对流换热边条
NSLE,S,1 NSEL,R,LOC,X,Length
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE !激活单元的侧面,指
定为对流换热边条 NSLE,S,1
NSEL,R,LOC,Z,WidthClad
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
SOLVE SAVE
SFEDELE,ALL,4,HFLUX !删除热流密度载荷
ALLSEL, ALL
ESEL,S,LIVE !激活单元的上表面,
指定为对流换热边条
NSLE,S,1
NSEL,R,LOC,Y,HeightDeposition/Layer*i
NSEL, R, LOC, x, LeftX-2*StepDis, RightX-2*StepDis
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
NSEL,S,LOC,Y,HeightDeposition/Layer*(i-1) !激活单元的下表面,删
除对流换热边条 ESEL, S, LIVE ESLN, R, 0 NSLE, S, 1
NSEL, R, LOC, x, LeftX-2*StepDis,RightX-2*StepDis
NSEL, R, LOC, Z, 0, Radius
NSEL, U, LOC, Y, HeightDeposition/Layer*i
ESLN, S, 1
NSEL, R, LOC, Y,HeightDeposition/Layer*(i-1)
SFDELE, ALL, CONV
ALLSEL,ALL
ESEL,S,LIVE EPLOT
*ENDDO
*ELSE !如果为偶数层,向左扫描
*DO, k, 1, StepNum, 1
TIME,TotalTime*(i+1)+StepTime*k !载荷步结束时间 KBC, 1 !载荷步内载荷随时间分布:
常数
LeftX=Length-StepDis*k RightX=Length-StepDis*(k-1)
NSEL, S, LOC, Y, HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
NSEL, R, LOC, x, LeftX, RightX
ESLN, S, 1 EALIVE,ALL ALLSEL, ALL
NSEL, S, LOC, Y, HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
NSEL, R, LOC, x, LeftX, LeftX+2*Radius
NSEL, R, LOC, Z, 0, Radius !激活单元的上表面,加
热流密度 ESLN, S, 1
SFE, ALL, 4, HFLUX, , LaserPower*Factor/Area, , ,
ALLSEL, ALL
ESEL,S,LIVE !激活单元的表面,如
果包含左端面,指定为对流换热边条
NSLE,S,1 NSEL,R,LOC,X,0
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE !激活单元的表面,如
果包含右端面,指定为对流换热边条
NSLE,S,1 NSEL,R,LOC,X,Length
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
ESEL,S,LIVE !激活单元的侧面,指
定为对流换热边条 NSLE,S,1
NSEL,R,LOC,Z,WidthClad
NSEL,R,LOC,Y,HeightDeposition/Layer*(i-1), HeightDeposition/Layer*i
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
SOLVE SAVE
SFEDELE,ALL,4,HFLUX !激活单元的上表面,
删除载荷 ALLSEL, ALL
ESEL,S,LIVE !激活单元的上表面,
指定为对流换热边条 NSLE,S,1
NSEL,R,LOC,Y,HeightDeposition/Layer*i
NSEL, R, LOC, x, LeftX+2*StepDis, RightX+2*StepDis
SF,ALL,CONV,CoffConv,Temp
ALLSEL,ALL
NSEL,S,LOC,Y,HeightDeposition/Layer*(i-1) !激活单元的下表面,删
除对流换热边条 ESEL, S, LIVE ESLN, R, 0 NSLE, S, 1
NSEL, R, LOC, x, LeftX+2*StepDis,RightX+2*StepDis
NSEL, R, LOC, Z, 0, Radius
NSEL, U, LOC, Y, HeightDeposition/Layer*i
ESLN, S, 1
NSEL, R, LOC, Y,HeightDeposition/Layer*(i-1)
SFDELE, ALL, CONV
ALLSEL,ALL
ESEL,S,LIVE EPLOT
*ENDDO
*ENDIF
*ENDDO ESEL,S,LIVE EPLOT
!=============================================================================
==================!冷却
!=============================================================================
=!~100s
*DO, k, 1, 2, 1
TIME,TotalTime*(Layer+2)+50*k !载荷步结
束时间 NSUBST, 5 KBC, 1 SOLVE SAVE
*ENDDO
!=============================================================================
=!~1000s
*DO, k, 1, 9, 1
TIME,TotalTime*(Layer+2)+100+100*k !载
荷步结束时间 NSUBST, 5 KBC, 1 SOLVE SAVE
*ENDDO
!=============================================================================
=!~3000s
*DO, k, 1, 10, 1
TIME,TotalTime*(Layer+2)+1000+200*k !载
荷步结束时间 NSUBST, 5 KBC, 1 SOLVE SAVE
*ENDDO
!=============================================================================
=!~10000s
*DO, k, 1, 14, 1
TIME,TotalTime*(Layer+2)+3000+500*k !载
荷步结束时间 NSUBST, 5 KBC, 1 SOLVE SAVE
*ENDDO
FINISH
【我的硕士论文的一部分】求解应力场
!修改速度、时间子步步长、载荷文件位置 !如果修改基底的热膨胀系数,要修改宏文件
!单位制:米、秒、摄氏度
/CLEAR,START /FILNAME,stress,0
/COM,ANSYS RELEASE 10.0 UP20050718 20:15:52 09/10/2007
/CONFIG, NRES, 5000
/PREP7 /PAGE, 1000, , 1000, /VIEW,1,1,2,3
/ANG,1 /REP,FAST
!*
!=============================================================================
==================!指定单元
ET,1,45 !* !*
!=============================================================================
==================!材料属性
!=====================================================================!316L
MPTEMP,,,,,,,, MPTEMP,1,0 MPDATA,DENS,1,,7850
MPTEMP,,,,,,,, MPTEMP,1,0
MPDATA,ALPX,1,,1.75E-005
MPTEMP,,,,,,,, MPTEMP,1,20 MPTEMP,2,300 MPTEMP,3,600
MPTEMP,4,900 MPTEMP,5,1300 MPDATA,EX,1,,2.0E+11 MPDATA,EX,1,,1.7E+11 MPDATA,EX,1,,1.5E+11 MPDATA,EX,1,,5.0E+10 MPDATA,EX,1,,0.4E+10 MPDATA,PRXY,1,,0.25 MPDATA,PRXY,1,,0.25 MPDATA,PRXY,1,,0.25 MPDATA,PRXY,1,,0.25 MPDATA,PRXY,1,,0.25
TB,KINH,1,5,4,0 TBTEMP,20 TBPT,,0,0 TBPT,,7E-4,1.4E8 TBPT,,0.0012,1.83E8 TBPT,,0.1,2.16E9 TBTEMP,300 TBPT,,0,0 TBPT,,5.5E-4,9.35E7 TBPT,,0.0012,1.27E8 TBPT,,0.1,1.84E9 TBTEMP,600 TBPT,,0,0 TBPT,,3.2E-4,4.8E7 TBPT,,0.0012,7.19E7 TBPT,,0.1,1.54E9 TBTEMP,900 TBPT,,0,0 TBPT,,2.5E-4,1.25E7 TBPT,,0.0012,5.1E7 TBPT,,0.1,5.45E8 TBTEMP,1300 TBPT,,0,0
TBPT,,2.5E-4,1E6 TBPT,,0.00375,1.13E7 TBPT,,0.1,7.05E7
!=====================================================================!A3
ExpandCoeff=1.75E-005
!structural->nonlinear->inelastic->rate independent->kinematic hardening
plasticity->mises plasticity->bilinear
!=============================================================================
==================!定义常量
WidthBase=0.025 !宽度 HeightBase=0.02 !基底高度
Length=0.09 !长度
WidthClad=0.0015 !宽度 HeightDeposition=0.00375 !覆层高度
Layer=15 !层数
HeightClad=HeightDeposition/layer
dt=0.0001 !小量
Temp=20 !环境温度 InitTemp=300 !初始温度 CoffConv=30 !对流换热系数
!=============================================================================
==================!定义常量
Velocity=0.003 !扫描速度 StepDis=0.0015 !每个载荷步位移
LaserPower=700 !激光功率 Radius=0.0015 !激光光斑半径 Area=3.14159265*(Radius**2) !激光光斑面积 Factor=0.3 !吸收因子
StepTime=StepDis/Velocity !每个载荷步时间 TotalTime=(Length+Radius*2)/Velocity !载荷持续时间(扫描一层)
StepNum=(Length+Radius*2)/StepDis !载荷步数
!=============================================================================
==================!建模
BLOCK,0,Length,0,-0.0066,0,WidthClad, BLOCK,0,Length,0,-0.0066,WidthClad,0.0067 BLOCK,0,Length,-0.0066,-HeightBase,0,WidthClad,
K, ,0,0,WidthBase, K, ,Length,0,WidthBase, K, ,0,-HeightBase,WidthBase, K, ,Length,-HeightBase,WidthBase,
V, 16, 13, 27, 25, 15, 14, 28, 26 V, 24, 21, 27, 13, 23, 22, 28, 14
BLOCK,0,Length,0,HeightDeposition,0,WidthClad,
VGLUE,ALL NUMCMP,ALL
!=============================================================================
==================!划分网格
LSEL, S, LOC, Y, dt, HeightDeposition-dt, !高度方向
LESIZE, ALL, , , Layer,
LSEL,S,LOC,Y,-DT,-0.0066+DT
LSEL,R,LOC,X,0
LESIZE,ALL,,,4,2
LSEL,S,LOC,Y,-DT,-0.0066+DT
LSEL,R,LOC,X,Length LESIZE,ALL,,,4,0.5
LSEL,S,LOC,Y,-0.0066-DT,-HeightBase+DT LSEL,R, LOC, Z, 0, WidthBase-DT,
LESIZE,ALL,,,4,2
LSEL,S,LOC,Y,-0.0066-DT,-HeightBase+DT
LSEL,R, LOC, Z, WidthBase,
LESIZE,ALL,,,4,0.5
LSEL, S, LOC, X, dt, Length-dt, !LESIZE, ALL, , , Length/StepDis,
LSEL, S, LOC, Z, dt, WidthClad-dt, !LESIZE, ALL, , , 1,
LSEL,S,LOC,Z,WidthClad+DT,0.0067-DT
LESIZE,ALL,,,4,
LSEL,S,LOC,Z,0.0067+DT,WidthBase-DT
LSEL,R,LOC,Y,-DT,-HeightBase
LESIZE,ALL,,,4,2
LSEL,S,LOC,Z,0.0067+DT,WidthBase-DT
LSEL,R,LOC,Y,0 LESIZE,ALL,,,4,0.5
VSEL,S,LOC,Y,0,HeightDeposition !TYPE,1 MAT,1
长度方向
宽度方向
网格划分
MSHAPE,0,3D MSHKEY,1 VMESH,ALL
VSEL,S,LOC,Y,-1,0 !网格划分
TYPE,1 MAT,1 MSHAPE,0,3D MSHKEY,1 VMESH,ALL
ALLSEL,ALL
VSEL,S,LOC,Y,-0.0066-DT,-HeightBase+DT
!删除热影响区外的单元 VSEL,A,LOC,Z,0.0067+DT,WidthBase-DT
VCLEAR,ALL VDELE,ALL, , ,1 ALLSEL,ALL
FINISH
!=============================================================================
==================!瞬态分析参数设置
/SOL
ANTYPE,4 !分析类型:瞬态
TRNOPT,FULL !求解方法:对于材料非线性,这是唯一
的方法
NLGEOM,on !大变形分析
LNSRCH, on
NSUBST, 4 NEQIT,30
CNVTOL,U,,0.05,2,, !收敛准则:控制位移
CNVTOL,F,,0.01,2, !收敛准则:控制力 OUTRES,NSOL,LAST !结果输出:
TREF, Temp
!=============================================================================
==================!杀死单元
NSEL, S, LOC, Y, 0, HeightDeposition !杀死熔覆层单元
ESLN, S, 1 EKILL,ALL ALLSEL,ALL
ESEL,S,LIVE EPLOT
NSEL,S,LOC,Z,0 !对称边条(相当于三个约束,UZ,ROTX,ROTY)
D,ALL,UZ,0
NSEL,S,LOC,Y,-0.0066 !固定中心点(增加两个约束,
UX,UY)
NSEL,R,LOC,Z,0 NSEL,R,LOC,X,length/2
D,ALL,ALL,0
NSEL,S,LOC,Y,-0.0066,0 !固定中心线(增加一个约束,ROTZ)
NSEL,R,LOC,Z,0 NSEL,R,LOC,X,length/2
D,ALL,UX,0
ALLSEL,ALL
SAVE
!=============================================================================
==================!熔覆
*DO,m,1,Layer
k=mod(m,2)
*IF,K,EQ,1,THEN
*DO,n,1,StepNum,
KBC,0
TIME,TotalTime*(m-1)+StepTime*n
LeftX=StepDis*(n-1) RightX=StepDis*n
NSEL, S, LOC, Y, HeightDeposition/Layer*(m-1), HeightDeposition/Layer*m !熔覆层生长
NSEL, R, LOC, x, LeftX, RightX
ESLN, S, 1 EALIVE,ALL ALLSEL, ALL
LDREAD,TEMP,StepNum*(m+1)+n,last,, ,'temp','rth','F:\emp\\different
velocity\\3' !读取体载荷
NSEL,S,BF,TEMP,1300,3000 BF, ALL, TEMP, 1300
ESEL,S,LIVE !显示生单元
EPLOT ALLSEL,ALL
MyDBC !宏命令
ALLSEL,ALL
SOLVE SAVE
*ENDDO
*ELSEIF,K,EQ,0,THEN
*DO,n,1,StepNum,
KBC,0
TIME,TotalTime*(m-1)+StepTime*n
LeftX=Length-StepDis*(n-1) RightX=Length-StepDis*n
NSEL, S, LOC, Y, HeightDeposition/Layer*(m-1), HeightDeposition/Layer*m
NSEL, R, LOC, x, LeftX, RightX
ESLN, S, 1 EALIVE,ALL ALLSEL, ALL
LDREAD,TEMP,StepNum*(m+1)+n,last,, ,'temp','rth','F:\emp\\different
velocity\\3'
NSEL,S,BF,TEMP,1300,3000 BF, ALL, TEMP, 1300
ESEL,S,LIVE !显示生单元
EPLOT ALLSEL,ALL
MyDBC !宏命令
ALLSEL,ALL
SOLVE SAVE
*ENDDO
*ENDIF *ENDDO
!=============================================================================
==================!冷却 *DO, k, 1, 35, 1
TIME,TotalTime*Layer+0.5*k !载荷步结束
时间
NSUBST, 4
KBC, 0 !载荷步内载荷随时间分布:
常数
LDREAD,TEMP,StepNum*(Layer+2)+K,last,, ,'temp','rth','F:\emp\\different
velocity\\3'
NSEL,S,BF,TEMP,1300,3000 BF, ALL, TEMP, 1300
ESEL,S,LIVE !显示生单元
EPLOT ALLSEL,ALL
MyDBC !宏命令
ALLSEL,ALL
SOLVE SAVE
*ENDDO
ESEL,S,LIVE EPLOT
FINISH
【补充】
其中的宏命令是加比较复杂的位移边条,可以去掉,然后加上你需要的边界条件
即可;
因篇幅问题不能全部显示,请点此查看更多更全内容