如能有大佬解决,万分感谢!!!(可要补偿)
命令流如下:FINISH
/CLEAR
!Ansys底色变为白色方便画图
/RGB,INDEX,100,100,100, 0
/RGB,INDEX, 80, 80, 80,13
/RGB,INDEX, 60, 60, 60,14
/RGB,INDEX, 0, 0, 0,15
/REPLOT
!前处理
/PREP7
!模型参数设定
E1=210E9
E2=105E9
ET,1,SHELL181
MP,EX,1,E1
MP,EX,2,E2
MP,DENS,1,7800
MP,PRXY,1,0.3
MP,DENS,2,7800
MP,PRXY,2,0.3
SECT,1,shell,,
SECDATA, 0.004,1,0.0,3
SECOFFSET,MID
SECCONTROL,,,, , , ,
MP,DAMP,1,0.002
!建立关键点
K,1,,,,
K,2,0.1,,,
K,3,0.2,,,
K,4,0.3,,,
K,5,0.4,,,
K,6,0.5,,,
K,7,0.6,,,
K,8,0.7,,,
K,9,0.8,,,
K,10,0.9,,,
KGEN,10,1,10 , , ,0.1, , ,0
!建立面
*do,i,1,9,1
a,i,i+1,i+11,i+10
*enddo
*do,i,11,19,1
a,i,i+1,i+11,i+10
*enddo
*do,i,21,29,1
a,i,i+1,i+11,i+10
*enddo
*do,i,31,39,1
a,i,i+1,i+11,i+10
*enddo
*do,i,41,49,1
a,i,i+1,i+11,i+10
*enddo
*do,i,51,59,1
a,i,i+1,i+11,i+10
*enddo
*do,i,61,69,1
a,i,i+1,i+11,i+10
*enddo
*do,i,71,79,1
a,i,i+1,i+11,i+10
*enddo
*do,i,81,89,1
a,i,i+1,i+11,i+10
*enddo
AGLUE,ALL
!划分网格
ESIZE,0.025
TYPE,1
MAT,1
*do,i,1,81,1
amesh,i
*enddo
!后处理
/SOL
!四边固支边界条件
DL,1, ,ALL,
DL,4, ,ALL,
DL,163, ,ALL,
DL,27, ,ALL,
*do,i,5,26,3
DL,i, ,ALL,
*enddo
*do,i,31,164,19
DL,i, ,ALL,
*enddo
*do,i,46,179,19
DL,i, ,ALL,
*enddo
*do,i,166,180,2
DL,i, ,ALL,
*enddo
!分析类型完全法瞬态分析,采取集中质量形式
ANTYPE,4
TRNOPT,FULL
LUMPM,1
!创建读取激励信息的宏文件
*create,REread,mac
*dim,excitation,table,524300,1,,time,force
*vread,excitation(1,1),excitation,txt,,ijk
(f11.6)
*do,i,1,524300
excitation(i,0)=i*0.0005
*enddo
*end
REread
!*vplot,excitation(1,0),excitation(1,1)
!求解时间,时间积分步长以及子步的设置
T=262.15
tt=0.0005
nnum=1
nsubst,nnum
nn=nnum*T/tt
!施加载荷激励,结果输出控制就是因为这一步因为循环次数太多了50多万次,因为需要50多万个加速度数据所以就这样了,有没有什么办法优化呢?
*Do,i,tt,T,tt
time,i
F,418,FZ,excitation(i)
OUTRES,A,ALL
solve
*enddo
!后处理
/post26
!求解结点加速度
NSOL,2,1105,A,Z, 0AZ_1105
NSOL,3,1153,A,Z, 0AZ_1153
NSOL,4,1201,A,Z, 0AZ_1201
NSOL,5,661,A,Z, 0AZ_661
NSOL,6,709,A,Z, 0AZ_709
NSOL,7,757,A,Z, 0AZ_757
NSOL,8,217,A,Z, 0AZ_217
NSOL,9,265,A,Z, 0AZ_265
NSOL,10,313,A,Z, 0AZ_313
!画出加速度响应图
XVAR,1
PLVAR,2
/image,save,'0AZ_1105',jpg
XVAR,1
PLVAR,3
/image,save,'0AZ_1153',jpg
XVAR,1
PLVAR,4
/image,save,'0AZ_1201',jpg
XVAR,1
PLVAR,5
/image,save,'0AZ_661',jpg
XVAR,1
PLVAR,6
/image,save,'0AZ_709',jpg
XVAR,1
PLVAR,7
/image,save,'0AZ_757 ',jpg
XVAR,1
PLVAR,8
/image,save,'0AZ_217',jpg
XVAR,1
PLVAR,9
/image,save,'0AZ_265',jpg
XVAR,1
PLVAR,10
/image,save,'0AZ_313',jpg
!创建一维数组变量用于存储加速度数据
*dim,variable2,array,nn
vget,variable2,2
*dim,variable3,array,nn
vget,variable3,3
*dim,variable4,array,nn
vget,variable4,4
*dim,variable5,array,nn
vget,variable5,5
*dim,variable6,array,nn
vget,variable6,6
*dim,variable7,array,nn
vget,variable7,7
*dim,variable8,array,nn
vget,variable8,8
*dim,variable9,array,nn
vget,variable9,9
*dim,variable10,array,nn
vget,variable10,10
!创建宏文件读取加速度数据记录到txt
*dim,aa,array,nn,9
*create,REwrite,mac
*do,i,1,nn
aa(i,1)=variable2(i)
aa(i,2)=variable3(i)
aa(i,3)=variable4(i)
aa(i,4)=variable5(i)
aa(i,5)=variable6(i)
aa(i,6)=variable7(i)
aa(i,7)=variable8(i)
aa(i,8)=variable9(i)
aa(i,9)=variable10(i)
*enddo
*mwrite,aa,0AZ,TXT,,jik,9,nn
(9f18.6)
*end
REwrite
FINISH
|