二维的砂土前面已经做过了,这里介绍一下三维砂土边坡的过程,顺便将方格染色功能升级成三维的方块染色。
整个建模思路和二维一样,首先成样,之后预压,加重力沉降,切坡平衡。
首先是成样:
newdef parwidth=1.0height=width*0.5length=width*0.5rdmax=0.009rdmin=0.006end@pardomain extent -1 1wall generate box [-width*0.5] [width*0.5] [-length*0.5] [length*0.5] [-height*0.5] [height*0.5] expand 1.5ball distribute porosity 0.4 radius @rdmin @rdmax box [-width*0.5+rdmin] [width*0.5-rdmin] ...[length*0.5-rdmin] ...[height*0.5-rdmin]cmat default model linear method deformability emod 100e6 kratio 1.5ball attribute density 2.7e3 damp 0.7cycle 2000 calm 50solvesave sample
成样后的模型如图:

预压代码如图:
restore sampleball property fric 0.5=-12.5e3]=-12.5e3]=-12.5e3]=0.1]=true]=true]=true]=100]=global.step-1]def sevro_wallscompute_stressif timestepNow<global.step thenget_g(sevro_factor)=sevro_freqendifif do_xSevro=true thenXvel=gx*(wxss-txx)=-Xvel=Xvelendifif do_zSevro=true thenZvel=gz*(wzss-tzz)=-Zvel=Zvelendifif do_ySevro=true thenYvel=gy*(wyss-tyy)=Yvel=-Yvelendifenddef wp_iniwpDown=wall.find(1)wpUp=wall.find(2)wpLeft=wall.find(3)wpRight=wall.find(4)wpFront=wall.find(5)wpBack=wall.find(6)end@wp_inidef computer_chiCunwlx=wall.pos.x(wpRight)-wall.pos.x(wpLeft)wlz=wall.pos.z(wpUp)-wall.pos.z(wpDown)wly=-wall.pos.y(wpFront)+wall.pos.y(wpBack)enddef compute_stresscomputer_chiCunwxss=-(wall.force.contact.x(wpRight)-wall.force.contact.x(wpLeft))*0.5/(wly*wlz)wzss=-(wall.force.contact.z(wpUp)-wall.force.contact.z(wpDown))*0.5/(wlx*wly)wyss=(wall.force.contact.y(wpFront)-wall.force.contact.y(wpBack))*0.5/(wlx*wlz)enddef get_g(fac)gx=0gy=0gz=0zongKNX=1e6zongKNY=1e6zongKNZ=1e6loop foreach ct wall.contactmap(wpLeft)=contact.prop(ct,"kn")endlooploop foreach ct wall.contactmap(wpRight)=contact.prop(ct,"kn")endlooploop foreach ct wall.contactmap(wpUp)=contact.prop(ct,"kn")endlooploop foreach ct wall.contactmap(wpDown)=contact.prop(ct,"kn")endlooploop foreach ct wall.contactmap(wpFront)=contact.prop(ct,"kn")endlooploop foreach ct wall.contactmap(wpBack)=contact.prop(ct,"kn")endloopgx=fac*wly*wlz/(zongKNX*global.timestep)gy=fac*wlx*wlz/(zongKNY*global.timestep)gz=fac*wlx*wly/(zongKNZ*global.timestep)end@get_g(@sevro_factor)@compute_stressset fish callback -1.0 @sevro_wallsdef addbondcommandcontact method bond gap [MH_smalaradius*0.5]endcommandendhistory id 1 @wxsshistory id 2 @wysshistory id 3 @wzsscycle 1solvesave yuya
预压后的应力为:

第三步加地应力,到这里为止除了维度,和二维是一样的:
restore yuyaset gravity [9.8*80.0/wlx]wall delete walls range id 2wall attribute vel 0set fish callback -1.0 remove @sevro_wallscycle 1solvesave zizhong
地应力力链分布为:

第四步对二维的方格染色升级到三维,代码为:
restore zizhongdef sousuoFanweilocal xyzMinMax=array.create(3,2)local x_min=1e100local y_min=1e100local z_min=1e100local x_max=-1e100local y_max=-1e100local z_max=-1e100loop foreach bp ball.listif x_min>ball.pos.x(bp)-ball.radius(bp) thenx_min=ball.pos.x(bp)-ball.radius(bp)endifif x_max<ball.pos.x(bp)+ball.radius(bp) thenx_max=ball.pos.x(bp)+ball.radius(bp)endifif y_min>ball.pos.y(bp)-ball.radius(bp) theny_min=ball.pos.y(bp)-ball.radius(bp)endifif y_max<ball.pos.y(bp)+ball.radius(bp) theny_max=ball.pos.y(bp)+ball.radius(bp)endifif z_min>ball.pos.z(bp)-ball.radius(bp) thenz_min=ball.pos.z(bp)-ball.radius(bp)endifif z_max<ball.pos.z(bp)+ball.radius(bp) thenz_max=ball.pos.z(bp)+ball.radius(bp)endifendloop=x_min=x_max=y_min=y_max=z_min=z_maxsousuoFanwei=xyzMinMaxenddef ranselocal xyz_min_max=sousuoFanweilocal NWidth=10.0 ;横向方块数目local NLength=5.0local NHeight=5.0;纵向数目local stepwidth=(xyz_min_max(1,2)-xyz_min_max(1,1))/NWidthlocal steplength=(xyz_min_max(2,2)-xyz_min_max(2,1))/NLengthlocal stepheight=(xyz_min_max(3,2)-xyz_min_max(3,1))/NHeightloop local n (1,NWidth)local minwidth=xyz_min_max(1,1)+stepwidth*(n-1)loop local m (1,NHeight)local minlength=xyz_min_max(2,1)+steplength*(m-1)loop k(1,NHeight)local minheight=xyz_min_max(3,1)+stepheight*(k-1)if (n+m+k)/2-(n+m+k)/2.0=0 thencommandball group gg1 slot 5 range x [minwidth] [minwidth+stepwidth] ...y [minlength] [minlength+steplength] ...z [minheight] [minheight+stepheight]endcommandelsecommandball group gg2 slot 5 range x [minwidth] [minwidth+stepwidth] ...y [minlength] [minlength+steplength] ...z [minheight] [minheight+stepheight]endcommandendifendloopendloopendloopend@ransesave ranse
染色后的试样为:

最后一步进行切坡;
restore ranseball attribute displacement multiply 0set mech age 0=wlx*0.5*0.1]=-wlz*0.5*0.1]=70]ball delete range plane origin @kengjiaoX 0 @kengjiaoZ dip @pojiao dd 90 above ...plane origin @kengjiaoX 0 @kengjiaoZ dip 0 dd 90 abovecycle 1solve time 10save qiepo
切坡前的状态为:

运算完后的状态为:

可以从染色图中比较明显的看出滑裂面的位置。
当然位移图也可以:
