!裂纹扩展程序
/prep7
et,1,plane82
mptemp,,,,,,,,
mptemp,1,0
mpdata,ex,1,,2.07e5
mpdata,prxy,1,,0.3
k,101,0,0,,
k,102,200,0,,
k,103,200,50,,
k,104,0,50,,
k,105,100,50,,
k,106,80,0,,
k,107,80,0,,
k,108,80,10,,
l,106,108
l,103,104
lextnd,1,108,100,1
lsbl,2,3
lplot
a,101,106,108,2,104
a,107,102,103,105,2,108
kscon,108,0.2,1,08,1,
mshape,1,2d !自由划分网格
mshkey,0
amesh,1
amesh,2
dk,101,all
dk,102,all
fk,105,fy,-200
finish
/sol
solve
finish
nplot
local,11,0,80,10,0,-90, , ,1,1, !建立以裂尖为原点的局部坐标系,裂纹面平行于x轴
nsel,s,loc,y,0 !在cs坐标系(当前坐标系)下选择y=0的结点
nsel,r,loc,x,0,0.2 !根据kscon命令可知沿裂纹面路径的x坐标
nlist !共选择5个点
*get,nnub,node,,count !获取节点总数nnub
*dim,aa,array,nnub
*get,aa(1),node,,num,min
*do,i,2,nnub
*get,aa(i),node,aa(i-1),nxth
*enddo
flst,2,nnub,1
*do,i,1,nnub
fitem,2,aa(i)
*enddo
path,101,nnub,30,20, !定义路径
ppath,p51x,1
path,stat
kcalc,1,1,3,0 !计算裂纹强度因子
finish
*get,ki1,kcalc,,k,1 !分别读取应力强度因子ki1,ki2
*get,ki2,kcalc,,k,2
*afun,deg !改变角度的单位为度
theta1=2*atan(0.25*(ki1/ki2-sqrt((ki1/ki2)**2+8))) !计算裂纹扩展角the=abs(theta1)
*dim,kt,array,20,3
kt(1,1)=ki1
kt(1,2)=ki2
kt(1,3)=theta1
*do,i,2,10 !循环的步数
aclear,1,2 !清除网格划分
坐标
adele,1,2,,0 !仅删除面1,2,保留线(如果直接删除线,关键点也将随之删除)
ldele,all,0 !删除所有的线
kdele,2 !删除关键点2
*get,kmax,kp,,num,max !获取最大关键点编号
k,kmax+2(i-1)-1,0,0 !在原局部坐标系下增加一个关键点,与之前裂尖关键点坐标相同
k,kmax+2(i-1),-3*cos(the),3*sin(the) !在原局部坐标系下增加另一个关键点,即为下一个裂尖关键点
kdele,kmax !因为一个面上不能定义两个KSCON,故需要删除前面在最大号关键点定义的KSCON,自动删除局部坐标
*get,kx,kp,kmax+2(i-1)-1,loc,x
*get,ky,kp,kmax+2(i-1)-1,loc,y
k,kmax,kx,ky
csdele,11
*get,knub,kp,,count !获取关键点的数目
*dim,kk,array,knub !建立一个一维矩阵
*get,kk(1),kp,,num,max !获取最大关键点编号
*do,j,2,knub
*get,kk(j),kp,kk(j-1),nxtl
*enddo
l,103,104 !连接关键点,自动编号为1,用于截取线段(如果角度过大,需连接l,102,103,并进行判定与哪条直线相交)
*do,ii,106,kk(1)
l,ii,ii+2 !连接关键点成线
ii=ii+1
*enddo
*get,lmax,line,,num,max !获取线的最大编号
lextnd,lmax,kk(1),200,1 !从裂尖方向延伸最大编号的线,自动生成关键点1
*get,lmax,line,,num,max !获取线的最大编号
lsbl,1,lmax !用线1截取生成的延伸线,在1上自动生成关键点2,同时删除关键点1
!通过判定关键点奇偶数来确定合成面需要的点
*do,j,2,knub
*if,kk(j),gt,108,and,kk(j),lt,kmax,then
*if,abs(nint(kk(j)/2)-kk(j)/2),le,0.1,then *get,kpos,kp,,count
*dim,os,array,kpos
*get,os(1),kp,,num,max
*do,jj,2,kpos
*get,os(jj),kp,os(jj-1),nxtl
*enddo
flst,2,kpos+7,3
fitem,2,108
判定奇偶数命令,如果为偶数
!
fitem,2,106
fitem,2,101
fitem,2,104
fitem,2,105 !必须选择关键点105,否则荷载无法施加
fitem,2,2
fitem,2,kk(1)
*do,jjj,1,kpos
fitem,2,os(jjj)
jjj=jjj+1
*enddo
a,p51x !利用关键点连接成面
*else
*get,kpjs,kp,,count
*dim,js,array,kpjs
*get,js(1),kp,,num,max
*do,jj,2,kpos
*get,js(jj),kp,js(jj-1),nxtl
*enddo
flst,2,kpjs+5,3
fitem,2,107
fitem,2,102
fitem,2,103
fitem,2,2
fitem,2,kk(1) !必须选择关键点105,否则荷载无法施加
*do,jjj,1,kpjs
fitem,2,js(jjj)
jjj=jjj+1
*enddo
a,p51x !利用关键点连接成面
*endif
*endif
*enddo
kscon,kk(1),0.2,1,08,1,
mshape,1,2d !自由划分网格
mshkey,0
amesh,1
amesh,2
dk,101,all
dk,102,all
fk,105,fy,-200
FINISH
/sol
/status,solu
solve
finish
*get,kx,kp,loc,kk(1),x !读取裂尖关键点的x坐标
*get,ky,kp,loc,kk(1),y !读取裂尖关键点的y坐标
local,11,0,kx,ky,0,-90+theta(i-1), , ,1,1, !旋转角度待修改
nsel,s,loc,y,0 !在CS坐标系(当前坐标系)下选择y=0的结点
nsel,r,loc,x,0,0.2 !根据kscon命令可知沿裂纹面路径的x坐标
nlist !共选择5个点
*get,nnub,node,,count !获取节点总数nnub
*dim,aa,array,nnub
*get,aa(1),node,,num,min
*do,i,2,nnub
*get,aa(i),node,aa(i-1),nxth
*enddo
flst,2,nnub,1
*do,i,1,nnub
filem,2,aa(i)
*enddo
path,101,nnub,30,20,
ppath,p51x,1
path,stat
kcalc,1,1,3,0
finish
*get,ki1,kcalc,,k,1 !分别读取应力强度因子ki1,ki2
*get,ki2,kcalc,,k,2
*afun,deg !改变角度的单位为度
theta1=2*atan(0.25*(ki1/ki2-sqrt((ki1/ki2)**2+8))) !计算裂纹扩展角the=abs(theta1)
*dim,kt,array,20,3
kt(i,1)=ki1
kt(i,2)=ki2
kt(i,3)=theta1
*enddo
坐标
因篇幅问题不能全部显示,请点此查看更多更全内容