Jillian 发表于 2015-10-5 21:55

Ansys命令流经典实例分享

本帖最后由 Jillian 于 2015-10-5 22:00 编辑

变形释放载荷经典例子
模型解释:(1)一个弹性结构受压(接触)变形,到发生塑性变形。(2)拿开压缩板,结构回弹,但不会回到原始位置。(3)这时计算蠕变,释放掉应力。(4)再压弹性结构到开始压缩位置。比较这四步的接触力。结果:第二,三步当然没有接触力,(若没有应力释放,第一、第四步接触力应一样,)有了应力释放,第四步接触力比第一步减小。

这个模型中的蠕变没用太好。用的是隐式6号蠕变方程,蠕变是时间和应力的函数,参数是乱定的(应力释放太快)。

/prep7

!------------CuSn8----------

ET,1,182,,,3
mp,ex,1,115e9
mp,prxy,1,0.3
r,1,0.3

TB,BKIN,1
TBDATA,1,470E6,0      

tm=100
*SET,C1,1.5625E-14      !ASSIGN VALUE
*SET,C2,1.5      !ASSIGN VALUE
*SET,C3,      !ASSIGN VALUE
*SET,C4,0      !ASSIGN VALUE
TB,CREEP,1,,,6      !ACTIVATE DATA TABLE
TBDATA,1,C1,C2,C3,C4      !DEFINE DATA FOR TABLE

!-----------contact-----------------
ET,9,169
ET,10,171   
R,9,,,0.1,0.1,,
!RMORE,,,1.0E20,0.0,1.0,
!RMORE,0.0,0,1.0,0,0,0.5
!RMORE,,,1.0,0.0
MP,MU,9,0.0

!----------------geometry

k,,2
k,,2,0.2
k,,,0.2
k,,-0.2
k,,-0.2,1.2
k,,,1
k,,2,1.2
k,,1,1
k,,1.25,1
k,,2,1
L,8,9,

k,,1.5,1.2
k,,1.75,1.45

L,       1,       2
L,       1,       4
L,       4,       5
L,       5,      11

larc,7,12,11,0.25
larc,11,12,7,0.25
L,       7,      10
L,      10,       9
L,       8,       6
L,       6,       3
L,       3,       2

LFILLT,11,10,0.3, ,
!*   
LFILLT,4,5,0.5, ,   
!*   
LFILLT,11,12,0.3, ,
!*   
LFILLT,4,3,0.5, ,   

   
FLST,2,16,4
FITEM,2,12   
FITEM,2,15   
FITEM,2,11   
FITEM,2,13   
FITEM,2,10   
FITEM,2,1   
FITEM,2,9   
FITEM,2,8   
FITEM,2,7   
FITEM,2,6   
FITEM,2,5   
FITEM,2,14   
FITEM,2,4   
FITEM,2,16   
FITEM,2,3   
FITEM,2,2   
AL,P51X

rect,1,3,1.45+0.001,1.5

type,1
mat,1

esize,0.05
amesh,all

!---------contact------------

alls

type,10
mat,9
real,9

lsel,s,,,6,7
nsll,s,1
esln,s,0
esurf,all

type,9
mat,9
real,9

lsel,s,,,17
nsll,s,1
esln,s,0
esurf,all

!------boundary

lsel,s,,,3
nsll,,1
d,all,ux
d,all,uy

lsel,s,,,19
nsll,,1
cp,11,uy,all
cplgen,11,ux
*get,nmin,node,,num,min
d,nmin,ux

ksel,s,,,10
nslk
*get,ndis,node,,num,min

fini

/solu

antype,static

nlgeom,on
autots,on

alls

save

rate,off
time,1e-8

d,nmin,uy,-0.3
nsub,20
outres,all,all
solve

*get,rf1,node,nmin,rf,fy
*get,dis1,node,ndis,u,y

time,2e-8

d,nmin,uy,0.0
nsub,20
outres,all,all
solve

*get,rf2,node,nmin,rf,fy
*get,dis2,node,ndis,u,y

!BFUNIF,TEMP,90
rate,on
TIME,tm
!NSUBST,10
OUTPR,BASIC,10         ! PRINT BASIC SOLUTION FOR EVERY 10TH SUBSTEP
OUTRES,ESOL,1          ! STORE ELEMENT SOLUTION FOR EVERY SUBSTEP
SOLVE

*get,rf3,node,nmin,rf,fy
*get,dis3,node,ndis,u,y

rate,off
time,tm+1e-8

d,nmin,uy,-0.3
nsub,20
outres,all,all
solve

*get,rf4,node,nmin,rf,fy
*get,dis4,node,ndis,u,y

/EOF

time,11

d,nmin,uy,-0.0
nsub,20
outres,all,all
solve

*get,rf11,node,nmin,rf,fy
*get,dis11,node,ndis,u,y

/eof

fini

/post1

*get,rf2,node,nmin,rf,fy
fini

/eof

Jillian 发表于 2015-10-5 21:57

高速铁路轨道有限元分析
RESUME,rail_2Dmesh,db   ! 重新开始,导入二维网格划分后的模型
/prep7                           ! 进入前处理
NUMMRG,ALL, , , ,LOW    ! 合并重节点,保留低编号
NUMCMP,ALL                  ! 压缩编号
EXTOPT,ESIZE,30,-0.3    ! 拖拉设置,在拖拉方向产生30个单元,
                                    ! 最小的单元是最大单元的0.3,
                                 ! 负号表示中间的单元小,两头的单元大
EXTOPT,ACLEAR,0         ! 拖拉后不删除原来的面
EXTOPT,ATTR,0,0,0   
MAT,1                        ! 拖拉后,体的材料特性
REAL,_Z4                     ! 拖拉后,体的实常数(默认)
ESYS,0                     ! 单元坐标系(默认)
VOFFST,1,568,         ! 将面1向正法线方向拖拉568个单位
VOFFST,2,568,         ! 将面2向正法线方向拖拉568个单位
VOFFST,3,568,         ! 将面3向正法线方向拖拉568个单位
NUMMRG,ALL, , , ,LOW   
NUMCMP,ALL               

EXTOPT,ESIZE,20,      ! 拖拉设置,在拖拉方向产生20个单元,
                                  ! 各个单元大小相等
EXTOPT,ACLEAR,0
EXTOPT,ATTR,0,0,0   
MAT,1   
REAL,_Z4
ESYS,0   
VOFFST,1,-568,            ! 将面1向负法线方向拖拉568个单位
VOFFST,2,-568,            ! 将面2向负法线方向拖拉568个单位
VOFFST,3,-568,            ! 将面3向负法线方向拖拉568个单位
NUMMRG,ALL, , , ,LOW
NUMCMP,ALL

VGEN,2,4, , ,1136      ! 体复制,将4号体复制一份到沿正法线方向
                                 ! 1136单位处(以现在位置为起点的相对距离)
VGEN,2,5, , ,1136      ! 体复制,将5号体复制一份到沿正法线方向
                                 ! 1136单位处(以现在位置为起点的相对距离)
VGEN,2,6, , ,1136      ! 体复制,将6号体复制一份到沿正法线方向
                                 ! 1136单位处(以现在位置为起点的相对距离)
NUMMRG,ALL, , , ,LOW
NUMCMP,ALL

VGEN,2,4, , ,-568      ! 体复制,将4号体复制一份到沿负法线方向
                              ! 568单位处(以现在位置为起点的相对距离)
VGEN,2,5, , ,-568      ! 体复制,将5号体复制一份到沿负法线方向
                              ! 568单位处(以现在位置为起点的相对距离)
VGEN,2,6, , ,-568      ! 体复制,将6号体复制一份到沿负法线方向
                              ! 568单位处(以现在位置为起点的相对距离)
NUMMRG,ALL, , , ,LOW
NUMCMP,ALL

VGEN,2,4, , ,1704
VGEN,2,5, , ,1704
VGEN,2,6, , ,1704
NUMMRG,ALL, , , ,LOW
NUMCMP,ALL

VGEN, ,ALL, , ,-284, , , , ,1    ! 体平移,将所有体沿负法线方向平移
                                          ! 284个单位(以现在位置为起点的相对距离)

NUMMRG,ALL, , , ,LOW
NUMCMP,ALL

NSEL,S,LOC,X,199,369         ! 轨枕处的约束
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL

NSEL,S,LOC,X,767,937   
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL

NSEL,S,LOC,X,1335,1420
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL

NSEL,S,LOC,X,-369,-199
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL

NSEL,S,LOC,X,-937,-767   
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL

NSEL,S,LOC,X,-1420,-1335
NSEL,R,LOC,Y,-79
D,ALL,ALL
ALLSEL,ALL
SAVE,rail_3Dmesh_withoutLoad,db    ! 保存数据库为文件格式
FINISH

RESUME,rail_3Dmesh_withoutLoad,db   ! 重新开始分析,恢复rail_3Dmesh_withoutLoad.db   
NSEL,S,LOC,X,0                                 ! 选择中跨跨中位置
NSEL,R,LOC,Y,94,100                         ! 选择中跨跨中位置的轨头节点
NSEL,R,LOC,Z,-25.330,0                      ! 选择中跨跨中位置的一侧轨头节点
/PNUM,NODE,1                                  ! 显示节点编号   
/VIEW,1,-1                                       ! 视图方向控制
/ANG,1   
/REPLOT                                          ! 图形重画
NPLOT                                          !节点重画
ALLSEL,ALL                                     ! 选择所有

Jillian 发表于 2015-10-5 21:58

火车过桥全过程仿真

/view,1,1,1,1
/eshape,1
cj=1.27
/prep7
mp,ex,1,2e11
mp,prxy,1,0.3
mp,dens,1,780
et,1,beam188
!上下弦杆
sectype,1,beam,I
secdata,0.46,0.46,0.46,0.02,0.02,0.012
!端斜杆
sectype,2,beam,I
secdata,0.6,0.6,0.46,0.02,0.02,0.012
!斜杆
sectype,3,beam,I
secdata,0.44,0.44,0.46,0.012,0.012,0.01
!竖杆
sectype,4,beam,I
secdata,0.26,0.26,0.46,0.012,0.012,0.01
!上下纵联
sectype,5,beam,I
secdata,0.12,0.12,0.24,0.012,0.012,0.01
!纵梁
sectype,6,beam,I
secdata,0.24,0.24,1.29,0.016,0.016,0.01
!横梁
sectype,7,beam,I
secdata,0.24,0.24,1.29,0.024,0.024,0.012
n,
n,,6

n,,0,0,8
n,,6,0,8
n,,6,8,8
n,,0,8,8

n,,0,0,16
n,,6,0,16
n,,6,8,16
n,,0,8,16

n,,0,0,24
n,,6,0,24
n,,6,8,24
n,,0,8,24

n,,0,0,32
n,,6,0,32
n,,6,8,32
n,,0,8,32

n,,0,0,40
n,,6,0,40
n,,6,8,40
n,,0,8,40

n,,0,0,48
n,,6,0,48
n,,6,8,48
n,,0,8,48

n,,0,0,56
n,,6,0,56
n,,6,8,56
n,,0,8,56

n,,0,0,64
n,,6,0,64

n,500,0,10,0
n,508,0,10,64
fill

n,600,2,10,0
n,601,4,10,0
n,602,6,10,0

!上下弦杆
secnum, 1
e,1,3,500
e,3,7,500
e,7,11,500
e,11,15,500
e,15,19,500
e,19,23,500
e,23,27,500
e,27,31,500
e,2,4,602
e,4,8,602
e,8,12,602
e,12,16,602
e,16,20,602
e,20,24,602
e,24,28,602
e,28,32,602

e,5,9,602
e,9,13,602
e,13,17,602
e,17,21,602
e,21,25,602
e,25,29,602
e,6,10,500
e,10,14,500
e,14,18,500
e,18,22,500
e,22,26,500
e,26,30,500


!端斜杆
secnum,2
e,1,6
e,2,5
e,29,32
e,30,31
!斜杆
secnum,3
e,6,7
e,7,14
e,14,15
e,15,22
e,22,23
e,23,30
e,5,8
e,8,13
e,13,16
e,16,21
e,21,24
e,24,29
!竖杆
secnum,4
e,3,6
e,4,5
e,7,10
e,8,9
e,11,14
e,12,13
e,15,18
e,16,17
e,19,22
e,20,21
e,23,26
e,24,25
e,27,30
e,28,29
!上纵联
secnum,5
e,5,6,501
e,5,10,502
e,6,9,501

e,9,10,502
e,9,14,503
e,10,13,502

e,13,14,503
e,13,18,504
e,14,17,503

e,17,18,504
e,17,22,505
e,18,21,504

e,21,22,505
e,21,26,506
e,22,25,505

e,25,26,506
e,25,30,506
e,26,29,506
e,29,30,506

!下纵联
e,1,4,500
e,2,3,501

e,3,8,501
e,4,7,502

e,7,12,502
e,8,11,503

e,11,16,503
e,12,15,504

e,15,20,504
e,16,19,505

e,19,24,505
e,20,23,506

e,23,28,506
e,24,27,507

e,27,32,507
e,28,31,508

!纵梁
secnum,6

n,33,2,0,0
n,161,2,0,64
fill
e,33,34,600
*repeat,128,1,1

n,162,4,0,0
n,290,4,0,64
fill
e,162,163,601
*repeat,128,1,1

!横梁
secnum,7
e,1,33,500
e,33,162,500
e,162,2,500

e,3,49,501
e,49,178,501
e,178,4,501

e,7,65,502
e,65,194,502
e,194,8,502

e,11,81,503
e,81,210,503
e,210,12,503

e,15,97,504
e,97,226,504
e,226,16,504

e,19,113,505
e,113,242,505
e,242,20,505

e,23,129,506
e,129,258,506
e,258,24,506

e,27,145,507
e,145,274,507
e,274,28,507

e,31,161,508
e,161,290,508
e,290,32,508

d,1,all
d,2,all
ddele,1,rotx
ddele,2,rotx
d,31,all
d,32,all
ddele,31,rotx
ddele,32,rotx
ddele,31,uz
ddele,32,uz

/solu
antype,static
i=0
*do,i,0,128,1
fdele,all,all
sfedele,all,all,pres
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,i*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-3)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-6)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-9)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-12)*0.5
f,all,fy,-cj*110000
nsel,all
!
*if,i,le,15,then

*elseif,i,le,75
    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,0,(i-15)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*46000
*elseif,i,gt,75
    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,(i-75)*0.5,(i-15)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*46000
    nsel,all

    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,0,(i-75)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*40000
*endif
allsel
outres,all,all
solve
*enddo
finish
/post26
numvar,50
timerange,1,130
!下弦
esol,2,1,1,smisc,1,fx1
esol,3,2,3,smisc,1,fx2
esol,4,3,7,smisc,1,fx3
esol,5,4,11,smisc,1,fx4
esol,6,5,15,smisc,1,fx6
esol,7,6,19,smisc,1,fx7
esol,8,7,23,smisc,1,fx8
esol,9,8,27,smisc,1,fx9
!上弦
esol,10,23,6,smisc,1,fx23
esol,11,24,10,smisc,1,fx24
esol,12,25,14,smisc,1,fx25
esol,13,26,18,smisc,1,fx26
esol,14,27,22,smisc,1,fx27
esol,15,28,26,smisc,1,fx28
!端斜杆
esol,16,29,6,smisc,1,fx29
esol,17,32,30,smisc,1,fx32
!斜杆
esol,18,33,6,smisc,1,fx33
esol,19,34,7,smisc,1,fx34
esol,20,35,14,smisc,1,fx35
esol,21,36,15,smisc,1,fx36
esol,22,37,22,smisc,1,fx37
esol,23,38,30,smisc,1,fx38
!竖杆
esol,24,45,6,smisc,1,fx45
esol,25,47,7,smisc,1,fx47
esol,26,49,14,smisc,1,fx49
esol,27,51,15,smisc,1,fx51
esol,28,53,22,smisc,1,fx53
esol,29,55,26,smisc,1,fx55
esol,30,57,30,smisc,1,fx57


prval,2,3,4,5,6,7,8,9
prval,10,11,12,13,14,15
prval,16,17
prval,18,19,20,21,22,23
prval,24,25,26,27,28,29,30






/view,1,1,1,1
/eshape,1
cj=1.27
/prep7
mp,ex,1,2e11
mp,prxy,1,0.3
mp,dens,1,780
et,1,beam188
!上下弦杆
sectype,1,beam,I
secdata,0.46,0.46,0.46,0.02,0.02,0.012
!端斜杆
sectype,2,beam,I
secdata,0.6,0.6,0.46,0.02,0.02,0.012
!斜杆
sectype,3,beam,I
secdata,0.44,0.44,0.46,0.012,0.012,0.01
!竖杆
sectype,4,beam,I
secdata,0.26,0.26,0.46,0.012,0.012,0.01
!上下纵联
sectype,5,beam,I
secdata,0.12,0.12,0.24,0.012,0.012,0.01
!纵梁
sectype,6,beam,I
secdata,0.24,0.24,1.29,0.016,0.016,0.01
!横梁
sectype,7,beam,I
secdata,0.24,0.24,1.29,0.024,0.024,0.012
n,
n,,6

n,,0,0,8
n,,6,0,8
n,,6,8,8
n,,0,8,8

n,,0,0,16
n,,6,0,16
n,,6,8,16
n,,0,8,16

n,,0,0,24
n,,6,0,24
n,,6,8,24
n,,0,8,24

n,,0,0,32
n,,6,0,32
n,,6,8,32
n,,0,8,32

n,,0,0,40
n,,6,0,40
n,,6,8,40
n,,0,8,40

n,,0,0,48
n,,6,0,48
n,,6,8,48
n,,0,8,48

n,,0,0,56
n,,6,0,56
n,,6,8,56
n,,0,8,56

n,,0,0,64
n,,6,0,64

n,500,0,10,0
n,508,0,10,64
fill

n,600,2,10,0
n,601,4,10,0
n,602,6,10,0

!上下弦杆
secnum, 1
e,1,3,500
e,3,7,500
e,7,11,500
e,11,15,500
e,15,19,500
e,19,23,500
e,23,27,500
e,27,31,500
e,2,4,602
e,4,8,602
e,8,12,602
e,12,16,602
e,16,20,602
e,20,24,602
e,24,28,602
e,28,32,602

e,5,9,602
e,9,13,602
e,13,17,602
e,17,21,602
e,21,25,602
e,25,29,602
e,6,10,500
e,10,14,500
e,14,18,500
e,18,22,500
e,22,26,500
e,26,30,500


!端斜杆
secnum,2
e,1,6
e,2,5
e,29,32
e,30,31
!斜杆
secnum,3
e,6,7
e,7,14
e,14,15
e,15,22
e,22,23
e,23,30
e,5,8
e,8,13
e,13,16
e,16,21
e,21,24
e,24,29
!竖杆
secnum,4
e,3,6
e,4,5
e,7,10
e,8,9
e,11,14
e,12,13
e,15,18
e,16,17
e,19,22
e,20,21
e,23,26
e,24,25
e,27,30
e,28,29
!上纵联
secnum,5
e,5,6,501
e,5,10,502
e,6,9,501

e,9,10,502
e,9,14,503
e,10,13,502

e,13,14,503
e,13,18,504
e,14,17,503

e,17,18,504
e,17,22,505
e,18,21,504

e,21,22,505
e,21,26,506
e,22,25,505

e,25,26,506
e,25,30,506
e,26,29,506
e,29,30,506

!下纵联
e,1,4,500
e,2,3,501

e,3,8,501
e,4,7,502

e,7,12,502
e,8,11,503

e,11,16,503
e,12,15,504

e,15,20,504
e,16,19,505

e,19,24,505
e,20,23,506

e,23,28,506
e,24,27,507

e,27,32,507
e,28,31,508

!纵梁
secnum,6

n,33,2,0,0
n,161,2,0,64
fill
e,33,34,600
*repeat,128,1,1

n,162,4,0,0
n,290,4,0,64
fill
e,162,163,601
*repeat,128,1,1

!横梁
secnum,7
e,1,33,500
e,33,162,500
e,162,2,500

e,3,49,501
e,49,178,501
e,178,4,501

e,7,65,502
e,65,194,502
e,194,8,502

e,11,81,503
e,81,210,503
e,210,12,503

e,15,97,504
e,97,226,504
e,226,16,504

e,19,113,505
e,113,242,505
e,242,20,505

e,23,129,506
e,129,258,506
e,258,24,506

e,27,145,507
e,145,274,507
e,274,28,507

e,31,161,508
e,161,290,508
e,290,32,508

d,1,all
d,2,all
ddele,1,rotx
ddele,2,rotx
d,31,all
d,32,all
ddele,31,rotx
ddele,32,rotx
ddele,31,uz
ddele,32,uz

/solu
antype,static
i=0
*do,i,0,128,1
fdele,all,all
sfedele,all,all,pres
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,i*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-3)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-6)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-9)*0.5
f,all,fy,-cj*110000
nsel,all
nsel,s,loc,x,2,4,2
nsel,r,loc,y,0
nsel,r,loc,z,(i-12)*0.5
f,all,fy,-cj*110000
nsel,all
!
*if,i,le,15,then

*elseif,i,le,75
    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,0,(i-15)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*46000
*elseif,i,gt,75
    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,(i-75)*0.5,(i-15)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*46000
    nsel,all

    nsel,s,loc,x,2,4,2
    nsel,r,loc,y,0
    nsel,r,loc,z,0,(i-75)*0.5,1
    esln
    esel,u,sec,,7
    sfbeam,all,1,pres,cj*40000
*endif
allsel
outres,all,all
solve
*enddo
finish
/post26
numvar,50
timerange,1,130
!下弦
esol,2,1,1,smisc,1,fx1
esol,3,2,3,smisc,1,fx2
esol,4,3,7,smisc,1,fx3
esol,5,4,11,smisc,1,fx4
esol,6,5,15,smisc,1,fx6
esol,7,6,19,smisc,1,fx7
esol,8,7,23,smisc,1,fx8
esol,9,8,27,smisc,1,fx9
!上弦
esol,10,23,6,smisc,1,fx23
esol,11,24,10,smisc,1,fx24
esol,12,25,14,smisc,1,fx25
esol,13,26,18,smisc,1,fx26
esol,14,27,22,smisc,1,fx27
esol,15,28,26,smisc,1,fx28
!端斜杆
esol,16,29,6,smisc,1,fx29
esol,17,32,30,smisc,1,fx32
!斜杆
esol,18,33,6,smisc,1,fx33
esol,19,34,7,smisc,1,fx34
esol,20,35,14,smisc,1,fx35
esol,21,36,15,smisc,1,fx36
esol,22,37,22,smisc,1,fx37
esol,23,38,30,smisc,1,fx38
!竖杆
esol,24,45,6,smisc,1,fx45
esol,25,47,7,smisc,1,fx47
esol,26,49,14,smisc,1,fx49
esol,27,51,15,smisc,1,fx51
esol,28,53,22,smisc,1,fx53
esol,29,55,26,smisc,1,fx55
esol,30,57,30,smisc,1,fx57


prval,2,3,4,5,6,7,8,9
prval,10,11,12,13,14,15
prval,16,17
prval,18,19,20,21,22,23
prval,24,25,26,27,28,29,30

Jillian 发表于 2015-10-5 21:59

斜齿轮命令流
*set,cn,0.5      !法面顶隙系数
*set,pi,3.1415929
*set,b,20          !齿宽
*set,b1,10         !螺旋角
*set,mn,2          !法向模数
*set,z,24          !齿数
*set,r,z*mn/cos(b1/180*pi)/2!分度圆半径
*set,rb,22.859   !基圆半径
*set,ra,r+cn*mn    !齿顶圆半径   
/prep7
csys,0
*do,i,1,11
x=rb*(cos(4.5*(i-1)*pi/180)+4.5*(i-1)*pi/180*sin(4.5*(i-1)*pi/180))
y=rb*(sin(4.5*(i-1)*pi/180)-4.5*(i-1)*pi/180*cos(4.5*(i-1)*pi/180))
k,i,x,y
*enddo
*do,i,1,9,2
spline,i,i+1,i+2
*enddo
k,12,rb-cn
l,1,12
lsel,all
lcomb,all
numcmp,all
wprota,-3.304         !齿根对应的圆周角的一半
csys,4
lsymm,y,1
wpcsys,1,0
csys,1
l,2,4
l,1,3
lfillt,1,3,0.5
lfillt,2,3,0.5
lsel,all
al,all
k,9,r
k,10,r,b1,b
l,9,10
vdrag,1,,,,,,7
vgen,z,1,,,,360/z
vsel,all
vadd,all
numcmp,all
cylind,ra,,,b
vsbv,2,1
numcmp,all
cylind,10,,,20             !轴孔
vsbv,1,2
numcmp,all
block,-3,3,,12.8,,20      !键槽
vsbv,1,2

Jillian 发表于 2015-10-5 21:59

叶片冲撞分析命令流
fini
/clear

! blade.inp is a supplement to Chapter 11 (ANSYS/LS-DYNA Seminar)

/title, Implicit-to-Explicit Sequential Solution

! Stress Initialization to Prescribed Geometry followed by Full Transient

! This is a simplified attempt to analyze the scenario when a
!jet engine fan blade snaps off and tears the engine apart

/uis,abort,off! do not display annoying status boxes...

! ===========================================================================

/filnam,implicit            ! implicit (ANSYS) portion of analysis

/prep7   
/view,,1,2,3
/ang,1

! Note:Only SHELL181 elements are used in this example, but other element
!      types (e.g., SOLID185) can also be used.However, there is a set of
!      companion element types that exist, which make the transition from/to
!      implicit to/from explicit "automatic" (etchg used instead of emodif):
!
!      LINK8      ===>LINK160
!      BEAM4      ===>BEAM161
!      SHELL181<===>SHELL163(181 accepts 163 stresses & thicknesses)
!      SOLID185<===>SOLID164(185 accepts 164 stresses at 5.6)
!      COMBIN14   ===>COMBI165
!      MASS21   ===>MASS166
!      LINK10   ===>LINK167
!
!      The LS-DYNA link and beam elements require a third node, which is
!      not always used in ANSYS, so these elements must be checked by the
!      user.Also, SHELL181 accepts thickness and stress information from
!      LS-DYNA.Prior to 5.6, it accepted the thicknesses and element
!      force and moment information from SHELL163, which was then used to
!      calculate the stresses that were already determined in LS-DYNA.
!      If more than 5 integration points are used through the thickness
!      (trapezoidal rule), then the old method of force and moment data
!      is used.SOLID185 should have KEYOPT(2)=1 (i.e., uniform reduced
!      integration with hourglass control) to be consistent with SOLID164.   

! It's best to think in terms of "parts" when the model is being created,
! because ANSYS/LS-DYNA requires part definitions for many of its commands
! (EDLOAD, EDCGEN, EDREAD, etc).By issuing the EDPART,Create command,
! ANSYS/LS-DYNA automatically creates parts that are based on unique sets
! of MAT, REAL, and TYPE numbers used by elements (listed sequentially via
! the ELIST command).These part lists can be updated after the model has
! been changed (EDPART,Update) or listed (EDPART,List) at any time before
! the SOLVE or EDWRITE,ANSYS/TAURUS/both commands are issued, at which
! point, the part list is set.

et,1,SHELL181               ! implicit shell elements for engine hub
et,2,SHELL181               ! implicit shell elements for blade platform
et,3,SHELL181               ! implicit shell elements for engine blades
et,4,SHELL181               ! implicit shell elements for engine duct
/eshape,1                   ! show element thicknesses (to check model)

r,1,0.50                  ! thickness of hub (flywheel shape)
r,2,0.50                  ! fan blade platform thickness
r,3,0.25                  ! fan blade average thickness
r,4,0.75                  ! engine duct (housing) thickness

! Note:Only small strains using linear material properties are allowed
!      in the implicit analysis, since only the resulting displacements
!      will be used in the stress initialization portion (first part)
!      of the explicit analysis.In other words, no path dependent
!      features are allowed in the implicit run.   

mp,ex,1,30.0e6            ! modulus of hub (psi)
mp,dens,1,7.33e-4         ! mass density of hub (lbf-sec^2/in^4)
mp,nuxy,1,0.30            ! Poisson's ratio (unitless)

mp,ex,2,30.0e6            ! modulus of blade platform (psi)
mp,dens,2,7.33e-4         ! mass density of blade platform (lbf-sec^2/in^4)
mp,nuxy,2,0.30            ! Poisson's ratio (unitless)

mp,ex,3,30.0e6            ! modulus of blade (psi)
mp,dens,3,7.33e-4         ! mass density of blade (lbf-sec^2/in^4)
mp,nuxy,3,0.30            ! Poisson's ratio (unitless)

mp,ex,4,30.0e6            ! modulus of engine duct (psi)
mp,dens,4,7.33e-4         ! density of duct not used (lbf-sec^2/in^4)
mp,nuxy,4,0.30            ! Poisson's ratio (unitless)

k,1,0,0,0                   ! create simplified jet engine geometry
k,2,0,0,1
l,1,2                     ! line #1 used to generate geometry...
lgen,2,1,,,5,0,0            ! inner radius of hub (line #2)
ldiv,2                      ! divide line #2 in half into lines #2 and #3
lgen,2,2,3,,5,0,0         ! outer radius of hub (lines #4 and #5)
l,5,7                     ! line #6 represents web of hub
local,11,1,0,0,0.5,0,0,90.0 ! local cs to twist blade
lgen,2, 4, 5,,0, -5.0,1.0   ! root of blade (break point at radius = 11")
lgen,2, 7, 8,,0,-12.5,1.5   ! create lines to "skin" blade...
lgen,2, 9,10,,0,-12.5,1.5
lgen,2,11,12,,0,-12.5,1.5
lgen,2,13,14,,0,-12.5,1.5
lgen,2,15,16,,0,-12.5,1.5
lgen,2,17,18,,0,-12.5,1.5
lsel,s,line,,7,20,1
lesize,all,,,2            ! specify esize = 0.25" for blades ("axially")
lsel,all

csys,0                      ! return to global coordinate system
kmodif,1,0,0,-2             ! move end-points of origin line for duct
kmodif,2,0,0, 3             ! duct axial length will be 5" for model...
lgen,2, 1,,,21,0,0          ! line #21 at 21" radius (engine duct or housing)
a,6,7,10,9                  ! platform at base of blade (area #1)
a,7,8,11,10               ! area #2
askin,7,9,11,13,15,17,19    ! twisting shape of blade "skinned" (area #3)
askin,8,10,12,14,16,18,20   ! area #4

csys,1                      ! use global cylindrical cs to copy blades, etc.
lesize,2,,,1                ! specify esize = 0.5" at inner hub radius
lesize,3,,,1                ! specify esize = 0.5" at inner hub radius
arotat,2,3,,,,,1,2,360,4    ! ring at hub inner radius (areas #5 - #12)
lesize,6,,,5                ! specify esize = 1" along hub web (radially)
arotat, 6,,,,,,1,2,360,4    ! hub disk (web) section (areas #13 - #16)
lesize,4,,,2                ! specify esize = 0.25" at hub outer radius
lesize,5,,,2                ! specify esize = 0.25" at hub outer radius
arotat,4,5,,,,,1,2,360,4    ! ring at hub outer radius (areas #17 - #24)
lesize,21,,,5               ! specify esize = 1" for engine duct (axially)
arotat,21,,,,,,1,2,360,4    ! engine housing (duct) ring (areas #25 - #28)
nummrg,kp

type,1                      ! engine hub element type
real,1                      ! constant hub thickness used throughout
mat,1                     ! engine hub material
esize,,9                  ! coarse mesh used (hub will become rigid body)
amesh,5,12                  ! mesh hub inner ring
amesh,13,16               ! mesh hub web (disk)
amesh,17,24               ! mesh hub outer ring

type,2                      ! blade platform element type
real,2                      ! platform thicker than adjoining blade
mat,2                     ! blade platform material
esize,,4                  ! 4 divisions along length of blade platform
amesh,1,2                   ! mesh platform at base of blade (copy below)

type,3                      ! fan blade element type   
real,3                      ! constant fan blade thickness used (I know ...)
mat,3                     ! fan blade material (only linear properties here)
esize,,36                   ! 36 divisions (esize = 0.25") along blade length   
amesh,3,4                   ! mesh fan blade (copy below)

agen,36,1,4,1, 0,10.0,0   ! generate all of the engine blades and platforms

type,4                      ! engine duct element type (not used here...)
real,4                      ! constant thickness cylindrical shape used
mat,4                     ! engine duct material
esize,,9                  ! use 36 element divisions circumferentially
amesh,25,28               ! mesh the engine housing (duct or shroud)
nummrg,kp

csys,0                      ! return to global coordinate system
nummrg,node               ! clean up any "loose ends" in the model...
nummrg,kp

! Note:No nodes or elements may be introduced for the first time in the
!      explicit portion of an implicit-to-explicit sequential analysis.   
!      All entities must be pre-defined in the implicit portion of the run,
!      even if they are not used there.All of these elements in question
!      must have all of the degrees of freedom (DOFs) of all of their   
!      nodes set to zero in the implicit run.Then, in the explicit run,
!      the elements are converted to the companion type and the DOFs from
!      the implicit run are deleted (and re-specified, as necessary).In
!      this example, the pressure loading on the engine duct (100 psi?) is
!      a second order effect and, is therefore, not modeled in the implicit
!      part of the sequential solution.Another example would be the
!      bird in a bird-strike analysis, which would probably best be modeled
!      with SOLID185 elements and then completely restrained here.In the
!      explicit run, the SOLID185 elements would be converted to SOLID164
!      elements and the DOFs would be deleted.The corresponding keyopts,
!      real constants, material properties, boundary conditions, and
!      loading would still need to be defined in the explicit analysis...

esel,s,type,,4            ! engine housing elements   
nsle                        ! engine housing nodes
d,all,all,0.0               ! fix all DOFs of unused entities
nsel,all
esel,all

fini
/solu
antype,static

! outpr,all,all
outres,all,all

omega,,,420.0               ! engine spin load (420.0 rad/sec = 4,010.7 rpm)
esel,s,type,,1            ! engine hub elements (rigid body in explicit run)
nsle                        ! engine hub nodes (not concerned with hub)
d,all,all,0.0               ! fix engine hub to allow loading of fan blades
nsel,all
esel,all

save
eplot
solve                     ! default solver used, but others OK, too
fini

/post1
set,last
/eshape,0
/graphics,full
/dscale,,1   
shell,bottom                ! results for bottom layer of shell element
plnsol,s,eqv                ! blade maximum von Mises stress at root
shell,top                   ! results for top layer of shell element
plnsol,s,eqv                ! blade maximum von Mises stress at root
fini

! ===========================================================================

/filnam,explicit            ! explicit (LS-DYNA) portion of analysis

/prep7
etchg,ite                   ! convert SHELL181 elements to SHELL163 elements
                            !default settings automatically specified...

! Note: The EMODIF command may be used instead of the ETCHG command, but
!       the latter is more automatic for "companion" elements (refer to the
!       ANSYS/LS-DYNA User's Guide - Release 5.6 for details).In both cases,
!       the shell element thicknesses, etc. still need to be re-specified...

r,1,,3,0.50               ! hub (3 int. pts. through 0.5" thickness)
r,2,,3,0.50               ! blade platform (same as above)
r,3,,5,0.25               ! blades (5 int. pts. through 0.25" thickness)
r,4,,5,0.75               ! duct (5 int. pts. through 0.75" thickness)   

edint,5                     ! saves data for all 5 layers (blades and duct)

esel,s,type,,1            ! hub elements
nsle                        ! hub nodes
ddele,all,all               ! remove imposed displacements from implicit run
edmp,rigid,1,7,4            ! convert hub to rigid body (only rotz = free)
nsel,all
esel,all

! Simulate one blade snapping off by unselecting a row of elements along the
! root.Alternatively, areas #1 and #2 could have been cleared (ACLEAR,1,2).

asel,s,area,,1,2            ! blade platform areas of blade #1
esla                        ! elements of first platform
nsle                        ! corresponding nodes
nsel,r,loc,x,10.7,11.1      ! reselect nodes of outer row of elements
esln,s,1                  ! select elements with all nodes active
cm,esnap,elem               ! row of elements to be unselected before SOLVE

asel,s,area,,3,4            ! blade #1 (projectile)
esla                        ! elements of first blade
cm,eproj,elem               ! element component for EDHIST command
nsle                        ! nodes of first blade
cm,nproj,node               ! node component for EDHIST command
asel,all
nsel,all
esel,all

! Use nonlinear (plastic) material properties for the fan blades:

!Note:First convert engineering stress versus engineering strain data
!         into true stress versus true (hencky) strain data.Then subtract
!         off the elastic true strain from the total true strain to find
!         the plastic true strain, which is used with the total true stress
!         in LS-DYNA *MAT_PIECEWISE_LINEAR_PLASTICITY material model #24.

!--------------------------------------------------------------------------
!Stress-Strain Data used with Piecewise Linear Plasticity (Power Law 8):
!--------------------------------------------------------------------------
!         Total   Total      Total      Total      Elastic    Plastic
! Stress/   Eng.      Eng.       True       True       True       True
! Strain    Stress    Strain   Stress   Strain   Strain   Strain
! Point   (psi)   (in/in)    (psi)      (in/in)    (in/in)    (in/in)
!--------------------------------------------------------------------------
!   1         0   0.0000          0   0.0000   0.0000   0.0000
!   2      60,000   0.0020   60,120   0.0020   0.0020   0.0000
!   3      77,500   0.0325   80,020   0.0320   0.0027   0.0293
!   4      83,300   0.0835   90,260   0.0802   0.0030   0.0772
!   5      98,000   0.1735    115,000   0.1600   0.0038   0.1562
!   6      98,300   0.2710    124,940   0.2398   0.0042   0.2356
!   7      76,400   1.2255    170,030   0.8000   0.0057   0.7943
!--------------------------------------------------------------------------

! Note: The first point on the stress/strain curve is NOT entered.
!       Start with the second point (where ordinate = yield stress).
!       Also, please follow the limits imposed by the *SET command.

*dim,strn,,6! define array for effective plastic true strain data
*dim,strs,,6! define array for effective total true stress data

strn(1)= 0.0, 0.0293, 0.0772, 0.1562, 0.2356, 0.7943! strain (in/in)
strs(1)= 60120., 80020., 90260., 115000., 124940., 170030.! stress (psi)

edcurve,add,1,strn,strs! load curve #1: abscissa=strain & ordinate=stress
tb,plaw,3,,,8            ! specify power law #8 for material (MAT) #3
tbdata,1,60120.0         ! yield stress, psi
tbdata,3,0.30            ! set material failure at 30% true plastic strain
tbdata,6,1               ! use load curve #1 for stress/strain data

! Note: Strain rate effects can be included by specifying the necessary
!       strain rate parameters and the load curve defining the strain rate
!       scaling effect on the yield stress.Please refer to Chapter 7
!       (Material Models) of the ANSYS/LS-DYNA User's Guide for a complete
!       description of this material model.

! Use nonlinear (plastic) material properties for the engine duct, too:

tb,plaw,4,,,8            ! specify power law #8 for material #4 (duct)
tbdata,1,60120.0         ! yield stress, psi
tbdata,3,0.50            ! set material failure at 50% true plastic strain
tbdat,6,1                ! use load curve #1 for stress/strain data
esel,s,type,,4         ! engine duct elements
nsle                     ! engine duct nodes
ddele,all,all            ! remove imposed displacements from implicit run
nsel,all
esel,all

! Allow GUI to recognize batch-defined material input

mpmod,1,7
mpmod,2,1
mpmod,3,28
mpmod,4,28

edcgen,ag                   ! automatic general contact

fini
/solu

! Using the REXPORT command, write the displacements (and rotations
! and temperatures) determined in the ANSYS implicit analysis to the
! ASCII "drelax" file.This command also sets the "m=drelax" option
! in the lsdyna script, prompting LS-DYNA to read the drelax file in.   

rexport,dyna,,,,,implicit,rst
   
! By issuing the EDDRELAX command, a stress initialization to a
! prescribed geometry analysis is requested.In a sequential
! implicit-to-explicit run, a "dynamic relaxation"analysis is
! performed in the pre-transient portion of the explicit analysis
! to preload the structure by imposing the deformed geometry over
! 101 time steps (with damping).The time during these 101 time
! steps can be thought of as "pseudo" time, since the time interval
! for the transient event begins at time equal to zero.Please
! note that, although the temperatures are being written to the
! "drelax" file, they are not currently being used.They will be
! supported in a later release.The remaining fields of the
! EDDRELAX command are ignored in an implicit-to-explicit analysis.

eddrelax,ansys            ! request stress initialization analysis...

! Impart initial spin velocity to nodes after stress initialization done

esel,s,type,,1,3,1          ! spinning engine components
nsle                        ! nodes of hub, blade platforms, and blades
cm,nrots,node               ! nodes initially spinning at 420.0 rad/sec

edivelo,nrots, 0,0,0, 420, 0,0,0, 90,90,0! Phase field set automatically

nsel,all
esel,all

! Continue spinning load on hub (converted to a rigid body now).

*dim,etime,,2               ! dimension explicit time array
*dim,spin,,2                ! dimension spin loading array
etime(1)=0.00               ! run time array out past termination time...
etime(2)=0.02               ! time array duration = 0.02 seconds
spin(1)=0.00                ! extending load curves facilitates restarts...
spin(2)=8.40                ! 8.4 radians in 0.02 seconds = 420 rad/sec

! Note:The EDPART command is used to create, update, and list part IDs
!      needed by the EDLOAD, EDCGEN, etc. commands.Please see Chapter
!      3 of the ANSYS/LS-DYNA 5.6 User's Guide for more information
!      concerning this topic.

edpart,create               ! create and list parts (part #1 = rigid body
                            ! hub, #2=platforms, #3=blades, and #4=duct)

! Below, "rbrz" is used to apply a rigid body rotation about the z-axis,
! since there is no straight-forward method to apply an omega to the rigid
! body at 5.6 (without editing the explicit.k input file).The load curve
! specified is the equivalent of a constant omega of 420 radians per second.

edload,add,rbrz,,1,etime,spin,0! Phase = 0 for sequential run (on part #1)

! The phase parameter on the EDLOAD command was added at ANSYS/LS-DYNA 5.4.
! The default value of zero is used for explicit transient loading in both
! a sequential implicit/explicit analysis and in an explicit-only analysis.   
! In these cases, the load curve is applicable to the LS-DYNA transient
! portion of the run.The other two phase options are not valid in a
! sequential analysis.They are used for explicit-only cases of stress
! initialization by dynamic relaxation (phase=1) OR stress initialization
! by dynamic relaxation followed by a transient analysis (phase=2).

nsel,s,loc,y,20.1,21.1      ! nodes on duct at wing attachment point
d,all,ux,0.0,,,,uy,uz ! fix duct in translation to wing
d,all,rotx,0.0,,,,roty,rotz ! fix duct in rotation to wing
nsel,all
esel,all

cmsel,u,esnap      ! unselect row of elements to "snap off" blade

time,0.010         ! termination time (can continue with EDSTART)
edrst,50             ! write data to results file 52 times (50+2)
edhtime,50         ! write data to history file 52 times (50+2)
edhist,eproj         ! elements belonging to snapped off blade
edhist,nproj         ! nodes belonging to snapped off blade
edenergy,1,1,1,1   ! output energies (hourglass, sliding interface ...)   
edout,glstat         ! output LS-DYNA global energy file (ASCII)
!!!edopt,add,,both      ! write results for both ANSYS and LS-TAURUS/LS-POST
edopt,add,,ansys   ! write results for just ANSYS

!!!edwrite,both,,k      ! create LS-DYNA input file (explicit.k)
edwrite,ansys,,k      ! create LS-DYNA input file (explicit.k)

save

/eof

! Note:If the LS-DYNA solver is run directly (from outside of ANSYS),
!      issue:/ansys56/bin/lsdyna56i=explicit.km=drelax

solve   ! overwrites the existing "explicit.k" input file and solves ...

fini
/post1   
/dscale,,1                  ! set displacement magnification to one
/view,,0.1,-0.75,0.65
set,first
layer,5                     ! top layer of shell element
plnsol,s,eqv                ! von Mises equivalent stress plot
layer,1                     ! bottom layer of shell element
plnsol,s,eqv                ! von Mises equivalent stress plot

andata,0.5,,2,1,33,2,0,1    ! animate every other frame up to substep 33 ...

fini
/exit

!2345678901234567890123456789012345678901234567890123456789012345678901234567890

! Note:Stress data is available for each layer.For the fan blades and
!      engine duct, five integration points are used (real constant NIP)
!      and the results are saved for each layer (EDIMT,5).However,
!      strain data is only available for the top and bottom layers.   
!      Although the LAYER,1 command gives both stress and strain data
!      for the bottom layer, the LAYER,2 command gives stress data for
!      the second layer, but gives strain data for the top layer (#5).   
!      To get stress data for the top layer, issue LAYER,5.Also, the
!      explicit results are for the integration point locations, which
!      are at the midplane of a given layer.To approximate surface
!      stresses and strains, a sufficient number of integration points
!      (layers) must be used through the thickness...

Jillian 发表于 2015-10-5 22:00

一个转动的分析模型


命令:/prep7
et,1,164
et,2,164
mp,ex,1,10e6
mp,dens,1,2.7e-4
mp,nuxy,1,.334

mp,ex,2,30e6
mp,dens,2,2.7e-4
mp,nuxy,2,.292

block,-10,10,-10,10,10,15
cylind,5,10,0,5

cylind,0,5,-10,10
esize,1
mshape,1,3d
mshkey,1
type,1
mat,1
vmesh,1 type,2
mat,2
vmesh,2

edcgen,assc,, ,0.5
esel,s,mat,,2
nsle,s
cm,box,node
alls
da,3,ux
da,3,uy
da,3,uz

da,4,ux
da,4,uy
da,4,uz

finish
/sol
*dim,t,array,2
*dim,r,array,2
t(1)=0,1 0
d(1)=10,1 0
edload,add,OMGZ,,box,t,r
time,1 0
edrst,10
edhtime,10
edout,glstat
edout,matsum
edout,rcforc
edout,rbdout

solve
finish
/post1
set,last
plnsol,s,eqv
finish
页: [1]
查看完整版本: Ansys命令流经典实例分享