目录
桩基边坡
模型生成
进行削坡
restore diji
def qiepo_par
x_pos=10
y_pos=20
dip=50
end
@qiepo_par
wall create id 5 vertices [x_pos-(45-y_pos)/math.tan(dip*math.pi/180.0)] [45] @x_pos @y_pos ...
@x_pos @y_pos 40 @y_pos
;用点坐标连成wall
;第一行为斜线(起点-终点),第二行为直线(起点-终点)
ball attribute displacement multiply 0
ball delete range plane origin @x_pos @y_pos dip @dip above ...
plane origin @x_pos @y_pos dip 0 above
;删除上方颗粒
cycle 1
solve
save qiepo
插入桩体
参数化建模
restore qiepo
def pile_par
pile_pos_x=0
pile_pos_y=35
pile_d=2
pile_length=20
end
@pile_par
wall generate id 6 box [pile_pos_x-pile_d*0.5] [pile_pos_x+pile_d*0.5] ...
[pile_pos_y-pile_length] [pile_pos_y] onewall
;规定x的范围和y的范围
ball delete range x [pile_pos_x-pile_d*0.5] [pile_pos_x+pile_d*0.5] ...
y [pile_pos_y-pile_length] [pile_pos_y]
cycle 1
solve
save pilewall
导入桩体
在生成box时需要注意加上radius
ball generate radius @rad box [pile_pos_x-pile_d*0.5+rad] [pile_pos_x+pile_d*0.5-rad] ... [pile_pos_y-pile_length+rad] [pile_pos_y-rad] cubic group pile
删除5到6的ID号的墙体
wall delete walls range id 5 6
restore pilewall
def pile_keli_par
rad=0.25
end
@pile_keli_par
ball generate radius @rad box [pile_pos_x-pile_d*0.5+rad] [pile_pos_x+pile_d*0.5-rad] ...
[pile_pos_y-pile_length+rad] [pile_pos_y-rad] cubic group pile
ball attribute density 3e3 damp 0.7
contact groupbehavior and
cmat add 1 model linearpbond method deformability emod 10e8 kratio 1.5 pb_deformability emod 10e8 kratio 1.5 ...
property pb_ten 10e6 pb_coh 8e6 pb_fa 50 fric 0.5 rgap 1e-6 range group pile
cmat apply
clean
contact method bond gap [rad*0.2] ;[rad*0.2]为默认值
wall delete walls range id 5 6
;删除之前护坡的墙体
cycle 1
solve
save zhuangji
通过内力分析滑面位置
查看剪力和弯矩(在之前的代码上进行修改)
通过剪力和弯矩发生突变的位置来获取边坡滑移的位置。
restore zhuangji
def GetJianLi(indexF)
id1=5425+indexF*4
id2=id1+1
id3=id1+2
id4=id1+3
ct1=contact.find("ball-ball",id1,id1+4) ;每两个颗粒之间加4
ct2=contact.find("ball-ball",id2,id2+4)
ct3=contact.find("ball-ball",id3,id3+4)
ct4=contact.find("ball-ball",id4,id4+4)
weizhi=contact.pos.y(ct1)
jianForce=0
jianForce+=contact.force.global.x(ct1)
jianForce+=contact.force.global.x(ct2)
jianForce+=contact.force.global.x(ct3)
jianForce+=contact.force.global.x(ct4)
jianStress=jianForce/pile_d
mid_pos_y=(contact.pos.x(ct1)+contact.pos.x(ct1)+contact.pos.x(ct1)+contact.pos.x(ct1))*0.25
wanju=0
wanju+=contact.force.normal(ct1)*(contact.pos.x(ct1)-mid_pos_y)
wanju+=contact.force.normal(ct2)*(contact.pos.x(ct2)-mid_pos_y)
wanju+=contact.force.normal(ct3)*(contact.pos.x(ct3)-mid_pos_y)
wanju+=contact.force.normal(ct4)*(contact.pos.x(ct4)-mid_pos_y)
end
def Create_Table
tb_jianli=table.create("jianli")
loop n(0,38)
GetJianLi(n)
table(tb_jianli,weizhi)=jianForce
;jianliVec=user.vector.create(vector(pile_pos_x,weizhi))
;user.vector.value(jianliVec)=vector(jianForce,0)
endloop
tb_wanju=table.create("wanju")
loop n(0,38)
GetJianLi(n)
table(tb_wanju,weizhi)=wanju
wanjuVec=user.vector.create(vector(pile_pos_x,weizhi))
user.vector.value(wanjuVec)=vector(wanju,0)
endloop
end
@Create_Table