这里有一个例子,是出自一本书《ANSYS高级工程有限元分析范例精选》
!螺栓和法兰连接的接触分析(带预紧)
finish
/clear
/prep7
*set,rad_i,1250/2
*set,rad_pani,705
*set,rad_o,2450/2
*set,rad_pano,1830
*set,rad_b,180/2
*set,m_bolt,160
*set,m_bh1,350+170+50
*set,m_bh2,350+170+250
*set,m_nut,280/2
*set,h_nut,170
*set,rad_drill,2140/2
*set,rad_m,750+150
*set,h_m,18
*set,rad_bi,1950/2
*set,rad_bo,2330/2
*set,rad_bh,5
*set,f_rad,45
*set,fh_rad,1855/2
*set,r_fillt,125
*set,n,15
*set,key_w,290
*set,key_h,130
*set,th,200
*set,flang_h1,350
*set,flang_h2,350
*set,h_shaft,350+490
*set,h_sh,H_shaft+500
*set,pi,acos(-1)
*set,elemsize,60
/graphics,power
*set,disp_b,0.75
*set,zmax,h_sh
*set,f_ext,22.9215e+5*12
*set,f_eef,30.827e+5*12
*set,r_out,rad_pano
*set,t_w,375
*set,u_r,r_out-t_w
/prep7
et,1,185
mp,ex,1,2.06e5
mp,nuxy,1,0.29
mp,dens,1,7.85e-9
mp,ex,2,2.06e5
mp,nuxy,2,0.29
mp,dens,2,7.85e-9
mp,ex,3,2.06e5
mp,nuxy,3,0.29
mp,dens,3,7.85e-9
mp,mu,4,0.15
k,1,rad_i,0,h_m
k,2,rad_m,0,0
k,3,rad_i+th
k,4,rad_o,
k,5,rad_o,0,flang_h1
k,6,rad_m,0,flang_h1
k,7,rad_i+th,0,flang_h1
k,8,rad_i+th,0,h_shaft
k,9,rad_i,0,h_shaft
k,10,rad_i,0,flang_h1
k,11,rad_m,0,H_M
k,12,rad_i+th,0,H_sh
k,13,rad_i,0,h_sh
k,14,rad_bi,0,rad_bh
k,15,rad_bo,0,rad_bh
k,16,rad_bi
k,17,rad_bo
k,18,rad_bi,0,flang_h1
k,19,rad_bo,0,flang_h1
k,20,rad_i+th+f_rad,0,flang_h1
k,21,fh_rad
k,22,fh_rad,0,flang_h1+h_shaft
k,23,fh_rad,0,flang_h1
l,8,20
l,20,5
l,21,22
lfillt,1,2,125
lstr,1,10
lstr,10,9
lstr,9,13
lstr,13,12
lstr,12,8
lstr,8,9
lstr,8,24
lstr,1,11
lstr,11,2
lstr,2,21
lstr,21,4
lstr,4,5
lstr,10,23
lstr,5,23
lptn,all
al,7,8,9,10
al,1,22,21,16,6,10
al,5,11,12,13,18,16
a,5,4,21,23
alls
lsla
lsel,invert
ldele,all
ksll
ksel,invert
kdele,all
APLOT
alls
csys,1
kgen,2,1,,,,n,,,0
l,1,3
vdrag,all,,,,,,2
csys,0
cyl4,,,rad_bi,,rad_bo,,rad_bh
vsbv,4,5
cyl4,rad_drill,0,rad_b,,,,flang_h1+100
csys,1
vgen,,4,,,,n,,,,1
vsbv,6,4
wpro,n,,
csys,4
vsymm,y,all,,,,0,0
wpro,-n,,
csys,0
rectng,0,rad_o+100,0,key_w/2
vsel,all
aslv
asel,invert
vext,all,,,0,0,key_h
alls
vptn,all
vdele,11,,,1
vdele,12,,,1
vdele,15,,,1
vdele,16,,,1
vdele,18,,,1
wpoff,0,key_w/2,0
wpro,,90
vsbw,all
wpcsys,-1,0
wpoff,0,0,key_h
vsbw,all
wpcsys,-1,0
csys,0
cyl4,,,rad_bi,,rad_bo,,flang_h1
vptn,all
vdele,33,,,1
wpoff,0,0,rad_bh
vsbw,all
wpoff,0,0,-rad_bh
cylind,rad_pani,rad_pano,0,-flang_h2,0,2*n
cyl4,rad_drill,0,rad_b,,,,flang_h2+100
csys,1
vgen,,16,,,,n,-flang_h2,,,1
vsbv,15,16
vsel,s,loc,z,0,h_sh+100
cm,shaft,volu
alls
vsel,s,loc,z,0,-flang_h2-100
cm,pan,volu
alls
esize,elemsize,0,
mat,1
cmsel,,shaft
vsweep,all
mat,2
alls
cmsel,,pan
vsweep,all
alls
cmsel,,shaft
aslv
lsla
ksll
wpro,2*n,,
csys,1
cmsel,u,pan
vsel,r,loc,y,n,2*n
csys,4
vsymm,y,all,,,,0,0
wpro,n,,
vsel,s,loc,z,0,h_sh+100
vsymm,y,all,,,,0,0
eslv
nsle
nummrg,kp
nummrg,node
alls
wpcsys,-1,0
cmsel,,pan
aslv
lsla
ksll
wpro,2*n
csys,4
vsymm,y,all,,,,0,0
wpro,2*n
csys,4
csys,1
vsel,r,loc,y,2*n,4*n
csys,4
vsymm,y,all,,,,0,0
alls
wpcsys,-1,0
vsel,s,loc,z,0,-flang_h2-100
aslv
lsla
ksll
eslv
nsle
nummrg,kp
nummrg,node
vsel,s,loc,z,0,h_sh+100
cm,shaft,volu
alls
vsel,s,loc,z,0,-flang_h2-100
cm,pan,volu
alls
csys,0
cylind,m_bolt/2,,m_bh1,-m_bh2,0,360
rpr4,6,,,m_nut,2*n,h_nut
vgen,,95,,,,,flang_h1,,,1
vgen,2,95,,,,,-flang_h2-flang_h1-h_nut,,0
cmsel,u,pan
cmsel,u,shaft
vptn,all
cm,b_temp,volu
vgen,,all,,,rad_drill,,,,,1
csys,1
vgen,,all,,,,n,,,,1
mat,3
esize,elemsize/2,0,
vsweep,all
vgen,4,all,,,,n*2,,,0
vclear,b_temp
vdele,b_temp
vgen,,all,,,,-n*2,,,,1
cm,bvolu,volu
alls
psmesh,1,b100,,volu,95,0,z,0,,,,b_100
psmesh,2,b200,,volu,116,0,z,0,,,,b_200
psmesh,3,b300,,volu,109,0,z,0,,,,b_300
cmsel,r,shaft
aslv
asel,r,loc,z,0
cm,as_con,area
alls
cmsel,r,pan
aslv
asel,r,loc,z,0
cm,ap_tar,area
alls
/com,contact pair creation -start
mat,4
r,3
real,3
et,3,170
et,4,174
keyopt,4,9,0
cmsel,s,ap_tar
type,3
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,as_con
type,4
nsla,s,1
esln,s,0
esurf,all
allsel
cmsel,r,bvolu
aslv
asel,r,loc,z,flang_h1
cm,ab1_con,area
alls
cmsel,r,shaft
aslv
asel,r,loc,z,flang_h1
csys,1
asel,r,loc,x,fh_rad,rad_o
csys,0
cm,abs_tar,area
alls
/com, contact pair creation - start
mat,4
r,4
real,4
et,5,170
et,6,174
keyopt,5,9,0
cmsel,s,abs_tar
type,5
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,ab1_con
type,6
nsla,s,1
esln,s,0
esurf,all
allsel
/com, contact pair creation - end
cmsel,r,bvolu
aslv
asel,r,loc,z,-flang_h2
cm,ab2_con,area
alls
cmsel,r,pan
aslv
asel,r,loc,z,-flang_h2
cm,abp_tar,area
alls
/com, contact pair creation - start
mat,4
r,5
real,5
et,7,170
et,8,174
keyopt,7,9,0
cmsel,s,abp_tar
type,7
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,ab2_con
type,8
nsla,s,1
esln,s,0
esurf,all
allsel
/com, contact pair creation - end
/SOL
alls
lsclear,all
antype,0
autots,1
nsubst,25,100,1
outres,all,all
eqslv,pcg,1e-8
time,15
csys,1
asel,s,loc,y,0
da,all,symm
alls
asel,s,loc,y,90
da,all,symm
alls
sload,1,9,lock,disp,disp_b,1,2
sload,2,9,lock,disp,disp_b,1,2
sload,3,9,lock,disp,disp_b,1,2
cmsel,s,pan
nslv,r,1
nsel,r,loc,z,0
csys,1
nsel,r,loc,x,u_r,r_out
d,all,all
alls
sbctran
lswrite,1
lswrite,2
nsel,s,loc,z,zmax-1,zmax+10
*get,nload,node,,count
f,all,fz,f_ext/nload/4
alls
lswrite,3
lssolve,1,3,1
/post
set,last
plnsol,s,eqv,0,1
!!! checked apdl , all "sb" should be "S B".
*set,rad_i,1250/2
*set,rad_pani,705
*set,rad_o,2450/2
*set,rad_pano,1830
*set,rad_b,180/2
*set,m_bolt,160
*set,m_bh1,350+170+50
*set,m_bh2,350+170+250
*set,m_nut,280/2
*set,h_nut,170
*set,rad_drill,2140/2
*set,rad_m,750+150
*set,h_m,18
*set,rad_bi,1950/2
*set,rad_bo,2330/2
*set,rad_bh,5
*set,f_rad,45
*set,fh_rad,1855/2
*set,r_fillt,125
*set,n,15
*set,key_w,290
*set,key_h,130
*set,th,200
*set,flang_h1,350
*set,flang_h2,350
*set,h_shaft,350+490
*set,h_sh,H_shaft+500
*set,pi,acos(-1)
*set,elemsize,60
/graphics,power
*set,disp_b,0.75
*set,zmax,h_sh
*set,f_ext,22.9215e+5*12
*set,f_eef,30.827e+5*12
*set,r_out,rad_pano
*set,t_w,375
*set,u_r,r_out-t_w
/prep7
et,1,185
mp,ex,1,2.06e5
mp,nuxy,1,0.29
mp,dens,1,7.85e-9
mp,ex,2,2.06e5
mp,nuxy,2,0.29
mp,dens,2,7.85e-9
mp,ex,3,2.06e5
mp,nuxy,3,0.29
mp,dens,3,7.85e-9
mp,mu,4,0.15
k,1,rad_i,0,h_m
k,2,rad_m,0,0
k,3,rad_i+th
k,4,rad_o, 0,
k,5,rad_o,0,flang_h1
k,6,rad_m,0,flang_h1
k,7,rad_i+th,0,flang_h1
k,8,rad_i+th,0,h_shaft
k,9,rad_i,0,h_shaft
k,10,rad_i,0,flang_h1
k,11,rad_m,0,H_M
k,12,rad_i+th,0,H_sh
k,13,rad_i,0,h_sh
k,14,rad_bi,0,rad_bh
k,15,rad_bo,0,rad_bh
k,16,rad_bi
k,17,rad_bo
k,18,rad_bi,0,flang_h1
k,19,rad_bo,0,flang_h1
k,20,rad_i+th+f_rad,0,flang_h1
k,21,fh_rad ,
k,22,fh_rad,0,flang_h1+h_shaft
k,23,fh_rad,0,flang_h1
l,8,20
l,20,5
l,21,22
lfillt,1,2,125
lstr,1,10
lstr,10,9
lstr,9,13
lstr,13,12
lstr,12,8
lstr,8,9
lstr,8,24
lstr,1,11
lstr,11,2
lstr,2,21
lstr,21,4
lstr,4,5
lstr,10,23
lstr,5,23
lptn,all
al,7,8,9,10
al,1,22,21,16,6,10
al,5,11,12,13,18,16
a,5,4,21,23
alls
lsla
lsel,invert
ldele,all
ksll
ksel,invert
kdele,all
APLOT
alls
csys,1
kgen,2,1,,,,n,,,0
l,1,3
vdrag,all,,,,,,2
csys,0
cyl4,,,rad_bi,,rad_bo,,rad_bh
vsbv,4,5
cyl4,rad_drill,0,rad_b,,,,flang_h1+100
csys,1
vgen,,4,,,,n,,,,1
vsbv,6,4
wpro,n,,
csys,4
vsymm,y,all,,,,0,0
wpro,-n,,
csys,0
rectng,0,rad_o+100,0,key_w/2
vsel,all
aslv
asel,invert
vext,all,,,0,0,key_h
alls
vptn,all
vdele,11,,,1
vdele,12,,,1
vdele,15,,,1
vdele,16,,,1
vdele,18,,,1
wpoff,0,key_w/2,0
wpro,,90
vsbw,all
wpcsys,-1,0
wpoff,0,0,key_h
vsbw,all
wpcsys,-1,0
csys,0
cyl4,,,rad_bi,,rad_bo,,flang_h1
vptn,all
vdele,33,,,1
wpoff,0,0,rad_bh
vsbw,all
wpoff,0,0,-rad_bh
!!! set up the lower circle plate
cylind,rad_pani,rad_pano,0,-flang_h2,0,2*n
cyl4,rad_drill,0,rad_b,,,,flang_h2+100
csys,1
vgen,,16,,,,n,-flang_h2,,,1
vsbv,15,16
!!! set up components
vsel,s,loc,z,0,h_sh+100
cm,shaft,volu
alls
vsel,s,loc,z,0,-flang_h2-100
cm,pan,volu
alls
esize,elemsize,0,
mat,1
cmsel,,shaft
vsweep,all
mat,2
alls
cmsel,,pan
vsweep,all
alls
cmsel,,shaft
aslv
lsla
ksll
wpro,2*n,,
csys,1
cmsel,u,pan
vsel,r,loc,y,n,2*n
csys,4
vsymm,y,all,,,,0,0
wpro,n,,
vsel,s,loc,z,0,h_sh+100
vsymm,y,all,,,,0,0
eslv
nsle
nummrg,kp
nummrg,node
alls
wpcsys,-1,0
cmsel,,pan
aslv
lsla
ksll
wpro,2*n
csys,4
vsymm,y,all,,,,0,0
wpro,2*n
csys,4
csys,1
vsel,r,loc,y,2*n,4*n
csys,4
vsymm,y,all,,,,0,0
alls
wpcsys,-1,0
vsel,s,loc,z,0,-flang_h2-100
aslv
lsla
ksll
eslv
nsle
nummrg,kp
nummrg,node
vsel,s,loc,z,0,h_sh+100
cm,shaft,volu
alls
vsel,s,loc,z,0,-flang_h2-100
cm,pan,volu
alls
csys,0
cylind,m_bolt/2,,m_bh1,-m_bh2,0,360
rpr4,6,,,m_nut,2*n,h_nut
vgen,,95,,,,,flang_h1,,,1
vgen,2,95,,,,,-flang_h2-flang_h1-h_nut,,0
cmsel,u,pan
cmsel,u,shaft
vptn,all
cm,b_temp,volu
vgen,,all,,,rad_drill,,,,,1
csys,1
vgen,,all,,,,n,,,,1
mat,3
esize,elemsize/2,0,
vsweep,all
vgen,4,all,,,,n*2,,,0
vclear,b_temp
vdele,b_temp
vgen,,all,,,,-n*2,,,,1
cm,bvolu,volu
alls
psmesh,1,b100,,volu,95,0,z,0,,,,b_100
psmesh,2,b200,,volu,116,0,z,0,,,,b_200
psmesh,3,b300,,volu,109,0,z,0,,,,b_300
cmsel,r,shaft
aslv
asel,r,loc,z,0
cm,as_con,area
alls
cmsel,r,pan
aslv
asel,r,loc,z,0
cm,ap_tar,area
alls
/com,contact pair creation -start
mat,4
r,3
real,3
et,3,170
et,4,174
keyopt,4,9,0
cmsel,s,ap_tar
type,3
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,as_con
type,4
nsla,s,1
esln,s,0
esurf,all
allsel
cmsel,r,bvolu
aslv
asel,r,loc,z,flang_h1
cm,ab1_con,area
alls
cmsel,r,shaft
aslv
asel,r,loc,z,flang_h1
csys,1
asel,r,loc,x,fh_rad,rad_o
csys,0
cm,abs_tar,area
alls
/com, contact pair creation - start
mat,4
r,4
real,4
et,5,170
et,6,174
keyopt,5,9,0
cmsel,s,abs_tar
type,5
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,ab1_con
type,6
nsla,s,1
esln,s,0
esurf,all
allsel
/com, contact pair creation - end
cmsel,r,bvolu
aslv
asel,r,loc,z,-flang_h2
cm,ab2_con,area
alls
cmsel,r,pan
aslv
asel,r,loc,z,-flang_h2
cm,abp_tar,area
alls
/com, contact pair creation - start
mat,4
r,5
real,5
et,7,170
et,8,174
keyopt,7,9,0
cmsel,s,abp_tar
type,7
nsla,s,1
esln,s,0
esurf,all
alls
cmsel,s,ab2_con
type,8
nsla,s,1
esln,s,0
esurf,all
allsel
/com, contact pair creation - end
/SOL
alls
lsclear,all
antype,0
autots,1
nsubst,25,100,1
outres,all,all
eqslv,pcg,1e-8
time,15
csys,1
asel,s,loc,y,0
da,all,symm
alls
asel,s,loc,y,90
da,all,symm
alls
sload,1,9,lock,disp,disp_b,1,2
sload,2,9,lock,disp,disp_b,1,2
sload,3,9,lock,disp,disp_b,1,2
cmsel,s,pan
nslv,r,1
nsel,r,loc,z,0
csys,1
nsel,r,loc,x,u_r,r_out
d,all,all
alls
sbctran
lswrite,1
lswrite,2
nsel,s,loc,z,zmax-1,zmax+10
*get,nload,node,,count
f,all,fz,f_ext/nload/4
alls
lswrite,3
lssolve,1,3,1
/post
set,last
plnsol,s,eqv,0,1 |