找回密码
 注册
Simdroid-非首页
查看: 61|回复: 0

焊接模拟H型钢出现了问题,附命令流,期待高手出现。

[复制链接]
发表于 2010-4-25 13:32:12 | 显示全部楼层 |阅读模式 来自 合肥工业大学
我的焊接模拟H型钢焊接过程,生成温度和应力动画,想做三维的模拟,但是例子太少,先做了二维的,可是运行的时候老师说调用结果文件 file.rst出错,我也不知道什么地方有错误,期待高手出现。


fini
/clear
/title, Weld Analysis by "Element Birth and Death"
/prep7
/unit,si
et,1,13,4
et,2,13,4
mptemp,1,20,500,800,1200,1500                           
mpdata,ex,1,,2.09e11,1.72e11,1.33e11,0.84e11,0.45e11     
mpdata,ex,2,,2.16e11,1.78e11,1.42e11,1.04e11,0.68e11     
mpdata,ex,3,,2.12e11,1.75e11,1.39e11,1.07e11,0.83e11     
tb,bkin,1,5               
tbtemp,20,1
tbdata,1,315e6,0.209e11
tbtemp,500,2
tbdata,1,212e6,0.172e11
tbtemp,800,3
tbdata,1,153e6,0.133e11
tbtemp,1200,4
tbdata,1,93e6,0.084e11
tbtemp,1500,5
tbdata,1,33e6,0.045e11
tb,bkin,2,5               
tbtemp,20,1
tbdata,1,314e6,0.216e11
tbtemp,500,2
tbdata,1,203e6,0.178e11
tbtemp,800,3
tbdata,1,153e6,0.142e11
tbtemp,1200,4
tbdata,1,63e6,0.104e11
tbtemp,1500,5
tbdata,1,13e6,0.068e11
tb,bkin,3,5               
tbtemp,20,1
tbdata,1,330e6,0.212e11
tbtemp,500,2
tbdata,1,213e6,0.175e11
tbtemp,800,3
tbdata,1,153e6,0.139e11
tbtemp,1200,4
tbdata,1,73e6,0.107e11
tbtemp,1500,5
tbdata,1,13e6,0.083e11
mp,dens,1,7850
mp,dens,2,7770
mp,dens,3,7860
mp,alpx,1,1.23e-5
mp,alpx,2,1.38e-5
mp,alpx,3,1.48e-5
mp,nuxy,1,0.30
mp,nuxy,2,0.29
mp,nuxy,3,0.29
mp,kxx,1,33
mp,kxx,2,32
mp,kxx,3,34
mp,c,1,561
mp,c,2,683
mp,c,3,983
mp,murx,1,1            
mp,murx,2,1
mp,murx,3,1
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                                
alls
!**************************************************************************************
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,nex,,nse
*dim,ney,,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               
*enddo
d=0
*do,i,1,nse                                 
*if,ney(i),ge,height/2,then                        
  d=d+1                                    
  n2(d)=ne(i)
*endif
*enddo
c=0
*do,i,1,nse
*if,ney(i),lt,height/2,then                 
  c=c+1                                      
  n1(c)=ne(i)
*endif
*enddo
esel,none                                    
*do,i,1,d
*if,n2(i),ne,0,then                        
  esel,a,elem,,n2(i)
*endif
*enddo
eplot                                       

!*************************对焊缝区上部分的单元按质心Y坐标进行排序****************************

mine=0
*dim,ne2,,d                                 
*dim,nex2,,d
*dim,ney2,,d
*do,i1,1,d                                    
esel,u,elem,,mine                           
*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
miny=1e20                                 
minx=1e20
*do,i,1,nse2
  *if,ney2(i),lt,miny,then                  
   miny=ney2(i)
   minx=nex2(i)
   mine=ne2(i)                              
  *else
  *if,ney2(i),eq,miny,then
  *if,nex2(i),lt,minx,then
   miny=ney2(i)
   minx=nex2(i)
   mine=ne2(i)
  *endif
  *endif
  *endif
*enddo
neorder(i1)=mine                           
*enddo
!*********对焊缝区下部分的单元按质心Y坐标进行排序,与其上部分的过程相类似******************
maxe=0
esel,none
*do,j,1,c
*if,n1(j),ne,0,then
  esel,a,elem,,n1(j)
*endif
*enddo
eplot
*dim,ne1,,c
*dim,nex1,,c
*dim,ney1,,c
*do,j1,1,c
esel,u,elem,,maxe
*get,nse3,elem,,count
jj=0
*do,j,1,emax
  *if,esel(j),eq,1,then
    jj=jj+1
    ne1(jj)=j
  *endif
*enddo
*do,j,1,nse3
   *get,ney1(j),elem,ne1(j),cent,y
   *get,nex1(j),elem,ne1(j),cent,x
*enddo
maxy=-1e10
maxx=-1e10
*do,j,1,nse3
  *if,ney1(j),gt,maxy,then
     maxy=ney1(j)
     maxx=nex1(j)
     maxe=ne1(j)
  *else
  *if,ney1(j),eq,maxy,then
  *if,nex1(j),lt,maxx,then
     maxy=ney1(j)
     maxx=nex1(j)
     maxe=ne1(j)
  *endif
  *endif
  *endif
*enddo
neorder(j1+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
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-20 19:49 , Processed in 0.027645 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表