目录
形成地基
PFC2D5.0
new
domain extent -100 100
wall generate box -40 40 0 80
ball distribute porosity 0.2 radius 0.5 0.8 box -39.5 39.5 0.5 44.5
ball attribute density 2e3 damp 0.7
;为了防止颗粒溢出,需要把边界适量调小
cmat default type ball-ball model linear property kn 1e9 ks 1e9 fric 0.5
cmat default type ball-facet model linear property kn 1e9
cycle 2000 calm 2
;防止颗粒溢出,把calm的周期缩短
set gravity 9.8
solve
save sample
ball delete range y 40 100
;删除上部的球体
cycle 1
solve
;每次solve前需要用cycle 1来打破平衡状态
;运行会比较慢,如果预压的话,运行就会快很多
save diji
model calm. Calm the model. For mechanical processes, all linear and rotational velocities are set to 0.
table展示地应力分布
用测量圆和table展示天然地基的地应力分布。
restore diji
def create_measure
measure_rad=4.0
x_pos=0
y_incri=(40-measure_rad*2.0)/7.0
loop n(1,8)
y_pos=measure_rad+(n-1)*y_incri
command
measure create position @x_pos @y_pos ...
radius @measure_rad
endcommand
endloop
end
@create_measure
;创建多个测量圆,在循环里写一些变量,而不变量写在外面
;在fish里使用command,用@加变量名,可以在command里使用fish
;一次性生成8个测量圆
def get_stress_yy
tb=table.create("shuxiang_stress")
loop n(1,8)
mp=measure.find(n)
stress_yy=measure.stress.yy(mp)
pos_y=40-measure.pos.y(mp)
table(tb,stress_yy)=pos_y
endloop
end
;table 允许自行定义x值和y值,比hist更加灵活
;mp=measure.find(n)查找指针
;table(tb,stress_yy)=pos_y ,tb表示table指针,而stress_yy表示x坐标,pos_y表示y坐标
;在plot items里打开table查看曲线
;mark里面可以改变曲线标注样式
def get_k0
tb=table.create("k0")
loop n(1,8)
mp=measure.find(n)
k0=measure.stress.xx(mp)/measure.stress.yy(mp)
pos_y=40-measure.pos.y(mp)
table(tb,k0)=pos_y
endloop
end
@get_k0
;k0等于横向土压力除以竖向土压力
使用交集范围削坡
restore diji
ball attribute displacement multiply 0
;位移清零
ball delete range plane origin 20 20 dip 70 above ...
plane origin 20 20 dip 0 above
;这两个平面相交,然后削坡
cycle 1
solve
;cycle 1 和 solve 建议搭配使用,cycle 1来打破平衡状态,solve则进行再次求解。