ANSYS循环搜索命令流【转】
本帖最后由 Chelsea 于 2011-3-13 08:17 编辑cm,nn,node !将钢筋节点编组
nsel,s,,,nn !选择钢筋节点
*get,nd,node,0,num,min !得到最小的节点编号
*get,nnod1,node,0,count !取出钢筋节点总数
*dim,nodes1,,nnod1 !定义钢筋节点编号数组,节点坐标数组
*dim,minnode1,,nnod1
*dim,aa1,array,nnod1
*dim,bb1,array,nnod1
*dim,cc1,array,nnod1
*do,i,1,nnod1,1 !数组赋值
nodes1(i)=nd
aa1(i)=nx(nd)
bb1(i)=ny(nd)
cc1(i)=nz(nd)
nd=ndnext(nd)
*enddo
nsel,inve !选择钢筋附近的节点(去除钢筋节点),找到钢筋的最近节点
*do,i,1,nnod1
minnode1(i)=node(aa1(i),bb1(i),cc1(i))
*enddo
allsel,all
!进行耦合
*do,i,1,nnod1,1
cp,i,uz,nodes1(i),minnode1(i)
cp,10000+i,ux,nodes1(i),minnode1(i)
cp,20000+i,uy,nodes1(i),minnode1(i)
*enddo
本帖最后由 Chelsea 于 2011-3-13 08:18 编辑
beyondboy你好,我试着嵌套了几次,都不成功,下面是我的一个拱桥的命令流,期待帮我看看,我的墩和腹拱之间的耦合就出现一个节点在两个组里面,期望高手改改我的命令流!
fini
/cle
/prep7
/title,"极限承载力分析"
*dim,xlx,,36
xlx(1)=74.25,72.43,70.61,68.79,66.97,65.15,62.905,60.66,58.415,56.17
xlx(11)=53.925,51.71,49.495,47.28,45.065,42.85,40.665,38.48,36.295,34.11
xlx(21)=31.925,29.77,27.615,25.46,23.305,21.15,19.025,16.9,14.775,12.65
xlx(31)=10.525,8.42,6.315,4.21,2.105,0
*do,i,1,36,1
angle=atan(0.5115*sinh(1.475*xlx(i)/74.25))
h=((2.5**3)/((1-(1-0.5225)*xlx(i)/74.25)*cos(angle)))**(1/3)
z1=-xlx(i)-(h/2)*sin(angle)
y1=-(32.474/1.30)*(cosh(1.475*(-xlx(i))/74.25)-1)+(h/2)*cos(angle)
z2=-xlx(i)+(h/2)*sin(angle)
y2=-(32.474/1.30)*(cosh(1.475*(-xlx(i))/74.25)-1)-(h/2)*cos(angle)
k,i,0,y1,z1
k,36+i,0,y2,z2
*enddo
*do,i,1,31,5
a,i,i+1,i+2,i+3,i+4,i+5,i+41,i+40,i+39,i+38,i+37,i+36
*enddo
arsym,z,1,7,1,100,0,0
allsel
nummrg,all
k,1001,0,0,100
k,1002,23.9,0,100
l,1001,1002
vdrag,1,2,3,4,5,6,151
vdrag,8,9,10,11,12,13,151
vdrag,7,14,,,,,151
ldel,151,,,1
allsel
nummrg,all
/view,1,-1,1,-1
allsel
vplo
!腹拱墩
*dim,zgd,,7
zgd(1)=65.154,53.929,42.854,31.929,21.154,10.529,0
*dim,kd,,7
kd(1)=1.9,1.75,1.6,1.45,1.3,1.15,1
*do,i,1,7,1
z=-zgd(i)
k,2000+i,0.1,2.25,z-kd(i)/2
k,2010+i,0.1,2.25,z+kd(i)/2
k,2020+i,23.9,2.25,z-kd(i)/2
k,2030+i,23.9,2.25,z+kd(i)/2
*enddo
*do,i,1,7,1
a,2000+i,2010+i,2030+i,2020+i
*enddo
k,4001,0,-23.123,0
k,4002,0,0,0
l,4001,4002
vdrag,172,,,,,,481
ldel,481,,,1
k,4001,0,-15.296,0
k,4002,0,0,0
l,4001,4002
vdrag,174,,,,,,481
ldel,481,,,1
k,4001,0,-9.365,0
k,4002,0,0,0
l,4001,4002
vdrag,186,,,,,,481
ldel,481,,,1
k,4001,0,-5.395,0
k,4002,0,0,0
l,4001,4002
vdrag,187,,,,,,481
ldel,481,,,1
k,4001,0,-2.735,0
k,4002,0,0,0
l,4001,4002
vdrag,188,,,,,,481
ldel,481,,,1
k,4001,0,-1.009,0
k,4002,0,0,0
l,4001,4002
vdrag,189,,,,,,481
ldel,481,,,1
k,4001,0,-0.7,0
k,4002,0,0,0
l,4001,4002
vdrag,190,,,,,,481
ldel,481,,,1
gplot
!挖空1
*dim,zgdx,,4
zgdx(1)=65.154,53.929,42.854,31.929
*dim,kdx,,4
kdx(1)=1.9,1.75,1.6,1.45
*dim,dkg,,4
dkg(1)=19.323,11.396,5.465,1.195
*do,i,1,4,1
z=-zgdx(i)
k,2040+i,3.26,-0.15,z-kdx(i)/2
k,2050+i,3.26,-0.15,z+kdx(i)/2
k,2060+i,6.86,-0.15,z-kdx(i)/2
k,2070+i,6.86,-0.15,z+kdx(i)/2
k,2080+i,3.26,-1.05-dkg(i),z-kdx(i)/2
k,2090+i,3.26,-1.05-dkg(i),z+kdx(i)/2
k,2100+i,6.86,-1.05-dkg(i),z-kdx(i)/2
k,2110+i,6.86,-1.05-dkg(i),z+kdx(i)/2
*enddo
*do,i,1,4,1
a,2040+i,2050+i,2090+i,2080+i
a,2060+i,2070+i,2110+i,2100+i
a,2080+i,2090+i,2110+i,2100+i
a,2040+i,2050+i,2070+i,2060+i
*enddo
ASEL,,,,226,229,1
VSBA,15,all
ASEL,,,,230,233,1
VSBA,16,all
ASEL,,,,234,237,1
VSBA,17,all
ASEL,,,,238,241,1
VSBA,18,all
VDELE,15
VDELE,16
VDELE,17
VDELE,22
!挖空2
*do,i,1,4,1
z=-zgdx(i)
k,2140+i,10.06,-0.15,z-kdx(i)/2
k,2150+i,10.06,-0.15,z+kdx(i)/2
k,2160+i,13.66,-0.15,z-kdx(i)/2
k,2170+i,13.66,-0.15,z+kdx(i)/2
k,2180+i,10.06,-1.05-dkg(i),z-kdx(i)/2
k,2190+i,10.06,-1.05-dkg(i),z+kdx(i)/2
k,2200+i,13.66,-1.05-dkg(i),z-kdx(i)/2
k,2210+i,13.66,-1.05-dkg(i),z+kdx(i)/2
*enddo
*do,i,1,4,1
a,2140+i,2150+i,2190+i,2180+i
a,2160+i,2170+i,2210+i,2200+i
a,2180+i,2190+i,2210+i,2200+i
a,2140+i,2150+i,2170+i,2160+i
*enddo
ASEL,s,,,207,209,2
ASEL,a,,,252,253,1
VSBA,23,all
ASEL,s,,,254,257,1
VSBA,24,all
ASEL,,,,258,261,1
VSBA,25,all
ASEL,,,,262,265,1
VSBA,26,all
VDELE,15
VDELE,17
VDELE,22
VDELE,24
!挖空3
*do,i,1,4,1
z=-zgdx(i)
k,2240+i,16.86,-0.15,z-kdx(i)/2
k,2250+i,16.86,-0.15,z+kdx(i)/2
k,2260+i,20.46,-0.15,z-kdx(i)/2
k,2270+i,20.46,-0.15,z+kdx(i)/2
k,2280+i,16.86,-1.05-dkg(i),z-kdx(i)/2
k,2290+i,16.86,-1.05-dkg(i),z+kdx(i)/2
k,2300+i,20.46,-1.05-dkg(i),z-kdx(i)/2
k,2310+i,20.46,-1.05-dkg(i),z+kdx(i)/2
*enddo
*do,i,1,4,1
a,2240+i,2250+i,2290+i,2280+i
a,2260+i,2270+i,2310+i,2300+i
a,2280+i,2290+i,2310+i,2300+i
a,2240+i,2250+i,2270+i,2260+i
*enddo
ASEL,s,,,250,251,1
ASEL,a,,,276,277,1
VSBA,16,all
ASEL,s,,,278,281,1
VSBA,18,all
ASEL,,,,282,285,1
VSBA,23,all
ASEL,,,,286,289,1
VSBA,25,all
VDELE,15
VDELE,16
VDELE,18
VDELE,23
numcmp,all
vsymm,z,15,17,1
vsymm,z,19,21,1
wpoff,0.1,-0.15,0
wprota,,90,,
vsbw,15
vsbw,19
vsbw,20
vsbw,21
vsbw,22
vsbw,25
vsbw,26
vsbw,27
wpcsys,-1
wpoff,0.1,-1.05-19.323,0
wprota,,90,,
vsbw,33
vsbw,29
wpcsys,-1
wpoff,0.1,-1.05-11.396,0
wprota,,90,,
vsbw,34
vsbw,30
wpcsys,-1
wpoff,0.1,-1.05-5.465,0
wprota,,90,,
vsbw,35
vsbw,31
wpcsys,-1
wpoff,0.1,-1.05-1.195,0
wprota,,90,,
vsbw,36
vsbw,32
wpcsys,-1
wpoff,3.26,0,0
wprota,,,90,
vsbw,21
vsbw,40
vsbw,22
vsbw,48
vsbw,25
vsbw,56
vsbw,26
vsbw,64
vsbw,20
vsbw,68
vsbw,19
vsbw,60
vsbw,15
vsbw,52
vsbw,28
vsbw,44
wpcsys,-1
wpoff,6.86,0,0
wprota,,,90,
vsbw,69
vsbw,70
vsbw,71
vsbw,72
vsbw,73
vsbw,74
vsbw,75
vsbw,76
vsbw,77
vsbw,78
vsbw,79
vsbw,80
vsbw,81
vsbw,82
vsbw,83
vsbw,84
wpcsys,-1
wpoff,10.06,0,0
wprota,,,90,
vsbw,85
vsbw,86
vsbw,87
vsbw,88
vsbw,89
vsbw,90
vsbw,91
vsbw,92
vsbw,93
vsbw,94
vsbw,95
vsbw,96
vsbw,97
vsbw,98
vsbw,99
vsbw,100
wpcsys,-1
wpoff,13.66,0,0
wprota,,,90,
vsbw,101
vsbw,102
vsbw,103
vsbw,104
vsbw,105
vsbw,106
vsbw,107
vsbw,108
vsbw,109
vsbw,110
vsbw,111
vsbw,112
vsbw,113
vsbw,114
vsbw,115
vsbw,116
wpcsys,-1
wpoff,16.86,0,0
wprota,,,90,
vsbw,117
vsbw,118
vsbw,119
vsbw,120
vsbw,121
vsbw,122
vsbw,123
vsbw,124
vsbw,125
vsbw,126
vsbw,127
vsbw,128
vsbw,129
vsbw,130
vsbw,131
vsbw,132
wpcsys,-1
wpoff,20.46,0,0
wprota,,,90,
vsbw,133
vsbw,134
vsbw,135
vsbw,136
vsbw,137
vsbw,138
vsbw,139
vsbw,140
vsbw,141
vsbw,142
vsbw,143
vsbw,144
vsbw,145
vsbw,146
vsbw,147
vsbw,148
wpcsys,-1
numcmp,all
/eshape,1
allsel
vplot
! 腹拱
wpoff,0.1,-0.519,70.8
wprota,,,90,
cyl4,,,5.455,27,6.055,153,23.7
wpcsys,-1
vgen,2,164,,,,,-11.3
vgen,2,165,,,,,-11.15
vgen,2,166,,,,,-11
vgen,2,167,,,,,-10.85
vgen,2,168,,,,,-10.7
vgen,2,169,,,,,-10.55
vsymm,z,164,170,1
/eshape
allsel
vplot
!墙座
v,468,466,439,440,212,226,107,106
v,516,514,487,488,222,236,112,111
v,548,546,519,520,232,246,117,116
v,580,578,551,552,242,256,122,121
v,476,474,471,472,252,266,127,126
v,484,482,479,480,262,288,132,131
v,311,312,309,310,285,271,35,135
v,307,308,305,306,268,199,31,32
v,303,304,301,302,195,189,26,27
v,299,300,297,298,185,179,21,22
v,295,296,293,294,175,99,16,17
v,291,292,289,290,95,89,11,12
v,279,280,267,278,85,78,6,7
wpoff,0,2.25,0
wprota,,-90,,
vsbw,all
wpcsys,-1
vdelet,191,218,1,1
numcmp,all
!赋属性
et,1,plane42
et,2,solid65
!1#材料(主拱)
mp,ex,2,1.5e10
mp,prxy,2,0.255
mp,dens,2,2780
tb,mkin,2
tbtemp,,strain
tbdata,,10e-4,15e-4,17.5e-4,20e-4,30e-4
tbtemp,,
tbdata,,15e6,18.75e6,19.68e6,20e6,17e6
real,1
tb,concr,2
tbtemp,,
tbdata,,0.20,0.8,1e6,20e6
asel,s,,,166
aplo
lesize,73,,,5
lesize,426,,,5
lesize,425,,,8
lesize,427,,,8
mshkey,1
amesh,166
vsel,s,,,1,14,1
type,2
mat,2
real,1
vsweep,all
aclear,all
allsel
vplot
!2#材料(腹拱与主墩)
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,EX,3,,1.45e10
MPDATA,PRXY,3,,0.255
MPTEMP,,,,,,,,
MPTEMP,1,0
MPDATA,DENS,3,,2750
TB,CONC,3,1,9,
TBTEMP,0
tbdata,,0.20,0.8,1e6,20e6
TBDATA,,,,,,,
vsel,,,,164,176,1
vatt,3,,2,
mshape,0,3d
mshkey,1
vmesh,164,176,1
vsel,,,,15,163,1
vatt,3,,2,
mshape,0,3d
mshkey,1
vmesh,15,163,1
vsel,,,,177,190,1
vatt,3,,2,
mshape,0,3d
mshkey,1
vmesh,177,190,1
!耦合1
asel,s,,,416 !选择第一个墩上部的所有节点,并编组
asel,a,,,625,881,64
asel,a,,,815
asel,a,,,463
asel,a,,,633,889,64
asel,a,,,823
asel,a,,,491
asel,a,,,641,897,64
asel,a,,,831
asel,a,,,519
asel,a,,,649,905,64
asel,a,,,839
asel,a,,,320
asel,a,,,326
asel,a,,,190
asel,a,,,189
asel,a,,,188
asel,a,,,381
asel,a,,,657,913,64
asel,a,,,846
asel,a,,,210
asel,a,,,665,921,64
asel,a,,,854
asel,a,,,205
asel,a,,,673,929,64
asel,a,,,862
asel,a,,,200
asel,a,,,681,934,64
asel,a,,,935
nsla
cm,nn,node
nsel,s,,,nn !选择墩上部节点
*get,nd,node,0,num,min !得到最小的节点编号
*get,nnod1,node,0,count !取出墩顶节点总数
*dim,nodes1,,nnod1 !定义墩顶节点编号数组,节点坐标数组
*dim,minnode1,,nnod1
*dim,aa1,array,nnod1
*dim,bb1,array,nnod1
*dim,cc1,array,nnod1
*do,i,1,nnod1,1 !数组赋值
nodes1(i)=nd
aa1(i)=nx(nd)
bb1(i)=ny(nd)
cc1(i)=nz(nd)
nd=ndnext(nd)
*enddo
nsel,inve !选择墩顶附近的节点(去除墩顶节点),找到墩顶的最近节点
*do,i,1,nnod1
minnode1(i)=node(aa1(i),bb1(i),cc1(i))
nsel,u,cp,,all
*enddo
allsel,all
!进行耦合
*do,i,1,nnod1,1
cp,i,uz,nodes1(i),minnode1(i)
cp,10000+i,ux,nodes1(i),minnode1(i)
cp,20000+i,uy,nodes1(i),minnode1(i)
*enddo
/plopts,date,0
!/triad,ltop
/view,1,-1,1,-1
eplo
fini
/solu
allsel
asel,s,,,26
asel,a,,,88
asel,a,,,1004
asel,a,,,1018
nsla,,1
d,all,all
fini
!!!!!!!!!!!!
/solu
allsel
antype,static
nropt,full,,1
autots,on
pred,on
neqit,50
kbc,0
cnvtol,f,100000,0.001,2
cnvtol,u,10,0.001,0
time,1
nsubst,50
allsel
acel,,9.81
allsel
outpr,all,all
outres,all,all
solve
fini
可以采用这种办法,将每个腹拱上需要耦合的节点定义为一个选择集,将美个立柱上的节点分别建立一个选择及,然后将最近的节点耦合。
下面是我以前做的一个桥的拼宽,建立选择集进行耦合的部分命令流,你可以参考下。
nsel,s,loc,x,5.95
nsel,r,loc,y,0
cm,count1,node !定义选择集
nsel,s,loc,x,5.95
nsel,r,loc,y,-0.22783
cm,count2,node !定义选择集
nsel,s,loc,x,6.05
nsel,r,loc,y,0
cm,count3,node !定义选择集
nsel,s,loc,x,6.05
nsel,r,loc,y,-0.233
cm,count4,node !定义选择集
cmsel,s,count1
*get,max1,node,0,count !得到选择集中的节点数目
*dim,a,,max1 !定义数组ojd(max1)
a(1)=31651
*do,i,1,max1-1
a(i+1)=nnear(a(i))
nsel,u,,,a(i)
*enddo
cmsel,s,count2
*get,max2,node,0,count !得到选择集中的节点数目
*dim,b,,max2 !定义数组ojd(max1)
b(1)=31649
*do,i,1,max2-1
b(i+1)=nnear(b(i))
nsel,u,,,b(i)
*enddo
cmsel,s,count3
*get,max3,node,0,count !得到选择集中的节点数目
*dim,c,,max3 !定义数组ojd(max1)
c(1)=36317
*do,i,1,max3-1
c(i+1)=nnear(c(i))
nsel,u,,,c(i)
*enddo
cmsel,s,count4
*get,max4,node,0,count !得到选择集中的节点数目
*dim,d,,max4 !定义数组ojd(max1)
d(1)=35548
*do,i,1,max4-1
d(i+1)=nnear(d(i))
nsel,u,,,d(i)
*enddo
allsel
*do,i,1,max1,1
cp,10000+10*i,ux,a(i),c(i)
cp,10001+10*i,uy,a(i),c(i)
cp,10002+10*i,uz,a(i),c(i)
*enddo
*do,i,1,max1,1
cp,100000+10*i,ux,b(i),d(i)
cp,100001+10*i,uy,b(i),d(i)
cp,100002+10*i,uz,b(i),d(i)
*enddo
另外提个小的建议,建模时候把腹拱和立墙离开一个小的距离,然后控制分网,在将要耦合的部分尽量出现相同数量的节点,便于耦合操作。
循环对称要怎么算啊 :@)请教下,ansys里面有专门的apdl编译器吗,像matlab里的m文件那样 其实命令流真的很好用。菜鸟来观看 恩..看看...不复杂...~~!
页:
[1]