!ANSYS命令流
!将ANSYS模型文件转到ABAQUS模型文件
!选中所有单元
Allsel,all
! 输出节点
*GET,NNode,NODE,,COUNT, , , , ! 得到当前模型中的总节点数
*CFOPEN,Toabaqus,inp
*VWRITE
('*HEADING')
*VWRITE
('Fracture Mechanical Analysis of metal crack with FRP')
*VWRITE
('*NODE,SYSTEM=R')
*DO,I,1,NNode
*VWRITE,Chrval(i),',',NX(I),',',NY(I),',',NZ(I)
(A8,A1,F10.5,A1,F10.5,A1,F10.5)
*ENDDO
Allsel,all
*GET,NumberofNode,NODE,,COUNT, , , ,
ESEL,S,ENAME,,95
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , , ! 得到当前模型中的最小单元号
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是95号(95号单元)
*IF,ENAME,EQ,95,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*GET,EN3,ELEM,nd,NODE,3
*GET,EN4,ELEM,nd,NODE,4
*GET,EN5,ELEM,nd,NODE,5
*GET,EN6,ELEM,nd,NODE,6
*GET,EN7,ELEM,nd,NODE,7
*GET,EN8,ELEM,nd,NODE,8
*GET,EN9,ELEM,nd,NODE,9
*GET,EN10,ELEM,nd,NODE,10
*GET,EN11,ELEM,nd,NODE,11
*GET,EN12,ELEM,nd,NODE,12
*GET,EN13,ELEM,nd,NODE,13
*GET,EN14,ELEM,nd,NODE,14
*GET,EN15,ELEM,nd,NODE,15
*GET,EN16,ELEM,nd,NODE,16
*GET,EN17,ELEM,nd,NODE,17
*GET,EN18,ELEM,nd,NODE,18
*GET,EN19,ELEM,nd,NODE,19
*GET,EN20,ELEM,nd,NODE,20
ENN1=EN1
ENN2=EN2
ENN3=EN3
ENN4=EN5
ENN5=EN6
ENN6=EN7
x1=Nx(EN1)
y1=Ny(EN1)
Z1=Nz(EN1)
x2=Nx(EN2)
y2=Ny(EN2)
Z2=Nz(EN2)
ENN7=NumberofNode+(I-1)*5+1
ENN8=EN10
ENN9=EN12
x5=Nx(EN5)
y5=Ny(EN5)
Z5=Nz(EN5)
x6=Nx(EN6)
y6=Ny(EN6)
Z6=Nz(EN6)
ENN10=NumberofNode+(I-1)*5+2
ENN11=EN14
ENN12=EN16
ENN13=NumberofNode+(I-1)*5+3
ENN14=NumberofNode+(I-1)*5+4
ENN15=NumberofNode+(I-1)*5+5
x3=Nx(EN3)
y3=Ny(EN3)
Z3=Nz(EN3)
x7=Nx(EN7)
y7=Ny(EN7)
Z7=Nz(EN7)
*VWRITE,Chrval(ENN7),',',(X1+X2)/2,',',(y1+y2)/2,',',(z1+z2)/2
(A8,3(A1,F10.5))
*VWRITE,Chrval(ENN10),',',(X5+X6)/2,',',(y5+y6)/2,',',(z5+z6)/2
(A8,3(A1,F10.5))
*VWRITE,Chrval(ENN13),',',(X5+X1)/2,',',(y5+y1)/2,',',(z5+z1)/2
(A8,3(A1,F10.5))
*VWRITE,Chrval(ENN14),',',(X6+X2)/2,',',(y6+y2)/2,',',(z6+z2)/2
(A8,3(A1,F10.5))
*VWRITE,Chrval(ENN15),',',(X3+X7)/2,',',(y3+y7)/2,',',(z3+z7)/2
(A8,3(A1,F10.5))
nd =ELnext(nd)
*END IF
*ENDDO
!输出实体单元
*VWRITE
('*ELEMENT,TYPE=C3D8,ELSET=Esolid1')
Allsel,all
ESEL,S,ENAME,,45
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是45号(45号单元)
*IF,ENAME,EQ,45,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*GET,EN3,ELEM,nd,NODE,3
*GET,EN4,ELEM,nd,NODE,4
*GET,EN5,ELEM,nd,NODE,5
*GET,EN6,ELEM,nd,NODE,6
*GET,EN7,ELEM,nd,NODE,7
*GET,EN8,ELEM,nd,NODE,8
*VWRITE,Chrval(nd),',',Chrval(EN1),',',Chrval(EN2),',',Chrval(EN3),',',Chrval(EN4),',',Chrval(EN5),',',Chrval(EN6),',',Chrval(EN7),',',Chrval(EN8)
(A8,8(A1,A8))
nd = ELnext(nd)
*END IF
*ENDDO
*VWRITE
('*ELEMENT,TYPE=C3D15 ,ELSET=Esolid2')
Allsel,all
*GET,NumberofNode,NODE,,COUNT, , , ,
ESEL,S,ENAME,,95
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是95号(95号单元)
*IF,ENAME,EQ,95,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*GET,EN3,ELEM,nd,NODE,3
*GET,EN4,ELEM,nd,NODE,4
*GET,EN5,ELEM,nd,NODE,5
*GET,EN6,ELEM,nd,NODE,6
*GET,EN7,ELEM,nd,NODE,7
*GET,EN8,ELEM,nd,NODE,8
*GET,EN9,ELEM,nd,NODE,9
*GET,EN10,ELEM,nd,NODE,10
*GET,EN11,ELEM,nd,NODE,11
*GET,EN12,ELEM,nd,NODE,12
*GET,EN13,ELEM,nd,NODE,13
*GET,EN14,ELEM,nd,NODE,14
*GET,EN15,ELEM,nd,NODE,15
*GET,EN16,ELEM,nd,NODE,16
*GET,EN17,ELEM,nd,NODE,17
*GET,EN18,ELEM,nd,NODE,18
*GET,EN19,ELEM,nd,NODE,19
*GET,EN20,ELEM,nd,NODE,20
ENN1=EN1
ENN2=EN2
ENN3=EN3
ENN4=EN5
ENN5=EN6
ENN6=EN7
x1=Nx(EN1)
y1=Ny(EN1)
Z1=Nz(EN1)
x2=Nx(EN2)
y2=Ny(EN2)
Z2=Nz(EN2)
ENN7=NumberofNode+(I-1)*5+1
ENN8=EN10
ENN9=EN12
x5=Nx(EN5)
y5=Ny(EN5)
Z5=Nz(EN5)
x6=Nx(EN6)
y6=Ny(EN6)
Z6=Nz(EN6)
ENN10=NumberofNode+(I-1)*5+2
ENN11=EN14
ENN12=EN16
ENN13=NumberofNode+(I-1)*5+3
ENN14=NumberofNode+(I-1)*5+4
ENN15=NumberofNode+(I-1)*5+5
x3=Nx(EN3)
y3=Ny(EN3)
Z3=Nz(EN3)
x7=Nx(EN7)
y7=Ny(EN7)
Z7=Nz(EN7)
*VWRITE,Chrval(nd),',',Chrval(ENN1),',',Chrval(ENN2),',',Chrval(ENN3),',',Chrval(ENN4),',',Chrval(ENN5),',',Chrval(ENN6),',',Chrval(ENN7),','
(A8,A1,7(A8,A1))
*VWRITE,Chrval(ENN8),',',Chrval(ENN9),',',Chrval(ENN10),',',Chrval(ENN11),',',Chrval(ENN12),',',Chrval(ENN13),',',Chrval(ENN14),',',Chrval(ENN15)
(7(A8,A1),A8)
nd = ELnext(nd)
*END IF
*ENDDO
Allsel,all
*VWRITE
('*SOLID SECTION,MATERIAL=Steel,ELSET=Esolid1')
*VWRITE
('1.,')
*VWRITE
('*SOLID SECTION,MATERIAL=Steel,ELSET=Esolid2')
*VWRITE
('1.,')
*VWRITE
('*MATERIAL,NAME=Steel')
*VWRITE
('*ELASTIC')
*VWRITE,Esteel,',',Vsteel
(E9.1,A1,F5.1)
!输出单元壳单元
*VWRITE
('*ELEMENT,TYPE=S4,ELSET=EShell')
Allsel,all
ESEL,S,ENAME,,63
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是63号(63号单元)
*IF,ENAME,EQ,63,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*GET,EN3,ELEM,nd,NODE,3
*GET,EN4,ELEM,nd,NODE,4
*VWRITE,Chrval(nd),',',Chrval(EN1),',',Chrval(EN2),',',Chrval(EN3),',',Chrval(EN4)
(A8,4(A1,A8))
nd = ELnext(nd)
*END IF
*ENDDO
Allsel,all
*VWRITE
('*Shell SECTION,MATERIAL=FRP,ELSET=EShell')
*VWRITE,Chrval(tpatch),',','5'
(A8,A1,A1)
*VWRITE
('*Material, name=FRP')
*VWRITE
('*Elastic')
*VWRITE,Epatch,',',Vpatch
(E9.1,A1,F5.1)
!输出弹簧单元
ESEL,S,TYPE,,5
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是14号(14号单元)
*IF,ENAME,EQ,14,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*VWRITE,'*ELEMENT',',','TYPE=','Spring2',',','ELSET=ES',CHRVAL(i)
(A8,A1,A5,A7,A1,A8,A4)
*VWRITE,Chrval(ND),',',Chrval(EN1),',',Chrval(EN2)
(A8,A1,A8,A1,A8)
*VWRITE,'*Spring',',','Elset=ES',CHRVAL(i)
(A7,A1,A8,A4)
*VWRITE,CHRVAL(1),',',CHRVAL(1)
(A1,A1,A1))
*GET,NumofReal,ELEM,Nd,ATTR,REAL
*GET,Kxx,RCON,NumofReal,CONST,1,
*VWRITE,Kxx
(F15.8)
nd =ELnext(nd)
*END IF
*ENDDO
NN=Nelem
Allsel,all
ESEL,S,TYPE,,6
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是14号(14号单元)
*IF,ENAME,EQ,14,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*VWRITE,'*ELEMENT',',','TYPE=','Spring2',',','ELSET=ES',CHRVAL(NN+i)
(A8,A1,A5,A7,A1,A8,A4)
*VWRITE,Chrval(ND),',',Chrval(EN1),',',Chrval(EN2)
(A8,A1,A8,A1,A8)
*VWRITE,'*Spring',',','Elset=ES',CHRVAL(NN+i)
(A7,A1,A8,A4)
*VWRITE,CHRVAL(2),',',CHRVAL(2)
(A1,A1,A1))
*GET,NumofReal,ELEM,Nd,ATTR,REAL
*GET,Kyy,RCON,NumofReal,CONST,1,
*VWRITE,Kyy
(F15.8)
nd =ELnext(nd)
*END IF
*ENDDO
NN=Nelem+NN
Allsel,all
ESEL,S,TYPE,,7
*GET,NElem,ELEM,,COUNT, , , , ! 得到当前模型中的总单元数
!对单元集进行循环
*GET,nd,ELEM,,NUM,MIN, , , ,
*DO,I,1,NElem
!得到当前单元的类型
*GET,ENAME,ELEM,nd,ATTR,ENAM
!如果是14号(14号单元)
*IF,ENAME,EQ,14,THEN
!得到该单元的节点编号
*GET,EN1,ELEM,nd,NODE,1
*GET,EN2,ELEM,nd,NODE,2
*VWRITE,'*ELEMENT',',','TYPE=','Spring2',',','ELSET=ES',CHRVAL(NN+i)
(A8,A1,A5,A7,A1,A8,A4)
*VWRITE,Chrval(ND),',',Chrval(EN1),',',Chrval(EN2)
(A8,A1,A8,A1,A8)
*VWRITE,'*Spring',',','Elset=ES',CHRVAL(NN+i)
(A7,A1,A8,A4)
*VWRITE,CHRVAL(3),',',CHRVAL(3)
(A1,A1,A1))
*GET,NumofReal,ELEM,Nd,ATTR,REAL
*GET,Kzz,RCON,NumofReal,CONST,1,
*VWRITE,Kzz
(F15.8)
nd =ELnext(nd)
*END IF
*ENDDO
Allsel,all
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!约束方程!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Nsel,s,Loc,z,tglue+tpatch/2
*Get,nnod3,NODE,0,COUNT
*Dim,nodes3,array,nnod3
*Dim,xy3,array,nnod3,2
*Get,nd,NODE,0,NUM,MIN
*Do,I,1,nnod3,1
nodes3(I)= nd
xy3(I,1) = Nx(nd)
xy3(I,2) = Ny(nd)
nd = Ndnext(nd)
*Enddo
allsel,all
NSEL,S,LOC,Z,tglue
*Get,nnod4,NODE,0,COUNT
*Dim,nodes4,array,nnod4
*Dim,xy4,array,nnod4,2
*Get,nd,NODE,0,NUM,MIN
*Do,I,1,nnod4,1
nodes4(I)= nd
xy4(I,1) = Nx(nd)
xy4(I,2) = Ny(nd)
nd = Ndnext(nd)
*Enddo
allsel,all
*Do,I,1,nnod3,1
*Do,J,1,nnod4,1
*If,xy3(I,1),NE,xy4(J,1),Cycle
*If,xy3(I,2),NE,xy4(J,2),Cycle
*VWRITE
('*EQUATION')
*VWRITE
('3')
*VWRITE,CHRVAL(Nodes4(J)),',',CHRVAL(1),',',1.0,',',CHRVAL(Nodes3(I)),',',CHRVAL(4),',',tpatch/2,',',CHRVAL(Nodes3(I)),',',CHRVAL(1),',',-1.0
(A8,A1,A1,A1,F3.1,A1,A8,A1,A1,A1,F8.5,A1,A8,A1,A1,A1,F8.5)
*VWRITE
('*EQUATION')
*VWRITE
('3')
*VWRITE,CHRVAL(Nodes4(J)),',',CHRVAL(2),',',1.0,',',CHRVAL(Nodes3(I)),',',CHRVAL(5),',',tpatch/2,',',CHRVAL(Nodes3(I)),',',CHRVAL(2),',',-1.0
(A8,A1,A1,A1,F3.1,A1,A8,A1,A1,A1,F8.5,A1,A8,A1,A1,A1,F8.5)
*VWRITE
('*EQUATION')
*VWRITE
('2')
*VWRITE,CHRVAL(Nodes4(J)),',',CHRVAL(3),',',1.0,',',CHRVAL(Nodes3(I)),',',CHRVAL(3),',',-1.0
(A8,A1,A1,A1,F3.1,A1,A8,A1,A1,A1,F8.5)
!CE,3*(I-1)+1,0,Nodes4(J),UX,1,Nodes3(I),ROTX,tpatch/2,Nodes3(I),Ux,-1,
!CE,3*(I-1)+2,0,Nodes4(J),UY,1,Nodes3(I),ROTY,tpatch/2,Nodes3(I),UY,-1,
!CE,3*(I-1)+3,0,Nodes4(J),UZ,1,Nodes3(I),Uz,-1,
*Enddo
*Enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!约束方程!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 边界条件!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ANSYS to ABAQUS.part01.rar (200 KB)
ANSYS to ABAQUS.part02.rar (200 KB)
ANSYS to ABAQUS.part03.rar (200 KB)
ANSYS to ABAQUS.part04.rar (156.65 KB)
|