柔性簇Cluster模擬基本框架介紹
PFC中基本單元有ball和clump,當然最新的有block。ball模擬圓形剛性顆粒,clump模擬不規則形狀剛性顆粒。對于非剛性顆粒來說,柔性簇Cluster方法便可以比較好的去模擬了。但是目前來說cluster方法介紹的并不是很多,這節課主要針對于cluster的模擬框架進行介紹。
本文介紹的cluster框架有兩個主要步驟:1、導出cluster中ball的位置信息;2、在雙軸或者別的實驗的框架中將ball顆粒換為cluster。
本文只介紹圓形柔性簇的方法,非圓形道理是一樣的。
一、標定cluster單元的微觀參數
首先在按形狀生成墻,并且在形狀內生成顆粒。這里注意形狀中心放在原點,這樣可以在預壓的時候進行徑向伺服。
newset random 10001def parlijing=0.1rdmax=0.009rdmin=0.006poro=0.08end@pardomain extent [-lijing*2] [lijing*2]wall generate circle position 0 0 radius [lijing*0.5]ball distribute radius @rdmin @rdmax porosity @poro ...range annulus center 0 0 radius 0 [lijing*0.5]ball attribute density 2.7e3 damp 0.7cmat default model linear method deform emod 1e8 kratio 1.5cycle 1000 calm 2cmat default model linear method deform emod 1e8 kratio 1.5 property fric 0.2cmat applysolvesave init_model
第二步是進行預壓:
restore init_model=-1e6]=0.2]=global.step-1]=100]def sevro_wallscomputer_stressif global.step>timestep_now thenget_gr(sevro_factor)=gr_freqendifrVel=gr*(wrss-trr) ;wrss小于trr,rvel是正值,墻收縮,速度和方向矢量反向loop foreach vt wall.vertex.listvt_pos=wall.vertex.pos(vt)fangxiang_mag=math.sqrt(comp.x(vt_pos)^2+Comp.y(vt_pos)^2)fang_normal=vector(comp.x(vt_pos),comp.y(vt_pos))/fangxiang_magvel=rVel*fang_normal*(-1)= velendloopend=wall.find(1)]=wall.vertex.find(1) ]def get_chicun=wall.vertex.pos(vt1)wlr=math.sqrt(comp.x(pos)^2+Comp.y(pos)^2)enddef computer_stressget_chicunwrss=0loop foreach ct wall.contactmap(wp)ct_force=contact.force.global(ct)force_mag=math.sqrt(comp.x(ct_force)^2+Comp.y(ct_force)^2)=force_magendloop=-wrss/(2*math.pi*wlr)enddef get_gr(fac)zonggangR=0loop foreach ct wall.contactmap(wp)=contact.prop(ct,"kn")endloopgr=fac*2*math.pi*wlr/(zonggangR*global.timestep)end@get_gr(@sevro_factor)set fish callback -1.0 @sevro_wallshistory id 1 @wrsshistory id 2 @grcycle 1solve aratio 1e-5save yuya
這個概念和巖石差不多,調整到合適的賦存應力。
第三步是給參數了,這里的參數用的常用的煤巖的參數。這里注意不需要給膠結,我們需要的是加膠結前顆粒的位置,膠結可以在模擬cluster的時候加。這一步主要是對彈性參數進行調整。
restore yuya[pb_coh=10e6][ten_coh=2.7]cmat default type ball-facet model linear method deformability emod 10e8 kratio 1.5 property fric 0.2cmat default type ball-ball model linearpbond method deformability ...emod 12e8 kratio 1.5 pb_deformability emod 54e8 kratio 1.5 ...property pb_coh [pb_coh] pb_ten [pb_coh*ten_coh] pb_fa 50 fric 0cmat applycleancycle 1solvesave fucan
最后一步就是導出顆粒的位置了,這里使用table實現數據的傳輸,將顆粒的位置和半徑存入table中。
restore fucandef create_tabletb_pos=table.create("cluster_template_pos_big")loop foreach bp ball.listtable(tb_pos,ball.pos.x(bp))=ball.pos.y(bp)endlooptb_rad=table.create("cluster_template_rad_big")loop foreach bp ball.listtable(tb_rad,ball.pos.x(bp))=ball.radius(bp)endloopend@create_tabletable cluster_template_pos_big write cluster_template_pos_big truncatetable cluster_template_rad_big write cluster_template_rad_big truncatedef get_lijingcluster_lijing=0loop foreach bp ball.listlijing_temp=math.mag(ball.pos(bp))+ball.radius(bp)if lijing_temp*2.0> cluster_lijing thencluster_lijing=lijing_temp*2.0endifendloopend@get_lijingsave ball_pos
這里注意一下顆粒的粒徑,由于預壓的時候圓形半徑會發生改變,一開始是0.1m,后面的0.123才是cluster真實的粒徑。這里需要注意一下。
同樣的道理可以再生成一個粒徑的cluster模板,目錄下生成了四個table,這個是我們后面需要用到的。
二、進行cluster雙軸
框架還是用我常用的雙軸框架。這里注意粒徑的選取取決于上一步做的cluster模板。我們這里只有兩個粒徑。
1、成樣:
newset random 10001def parwidth=1.5lijing1=0.123lijing2=0.09443height=width*2.0poro=0.12end@pardomain extent [-width*5] [width*5]wall generate box [-width*0.5] [width*0.5] [-height*0.5] [height*0.5] expand 1.5ball distribute porosity @poro numbins 2 ...bin 1 radius [lijing1*0.5] v 0.5 group cluster_template_big ...bin 2 radius [lijing2*0.5] v 0.5 group cluster_template_small ...box [-width*0.5] [width*0.5] [-height*0.5] [height*0.5]ball attribute density 2.7e3 damp 0.7cmat default model linear method deformability emod 10e8 kratio 1.5cycle 2000 calm 5solvesave sample
2、預壓:
restore sample=-1e4]=-1e4]=0.5]=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_ySevro=true thenYvel=gy*(wyss-tyy)=-Yvel=Yvelendifenddef wp_iniwpDown=wall.find(1)wpRight=wall.find(2)wpUp=wall.find(3)wpLeft=wall.find(4)end@wp_inidef computer_chiCunwlx=wall.pos.x(wpRight)-wall.pos.x(wpLeft)wly=wall.pos.y(wpUp)-wall.pos.y(wpDown)enddef compute_stresscomputer_chiCunwxss=-(wall.force.contact.x(wpRight)-wall.force.contact.x(wpLeft))*0.5/wlywyss=-(wall.force.contact.y(wpUp)-wall.force.contact.y(wpDown))*0.5/wlxenddef get_g(fac)gx=0gy=0zongKNX=100e6*2*10zongKNY=100e6*2*10loop 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")endloopgx=fac*wly/(zongKNX*global.timestep)gy=fac*wlx/(zongKNY*global.timestep)endset fish callback -1.0 @sevro_wallshistory id 1 @wxsshistory id 2 @wysshistory id 3 @gxhistory id 4 @gycycle 1solvesave yuya
3、將ball換為cluster
這里注意將第一步生成的table復制粘貼到這個模擬的目錄下,導入后進行cluster的生成。這里面細節比較多,就不一一講解了,讀者可以自己理解一下。
restore yuyacmat default type ball-facet model linear method deformability emod 10e8 kratio 1.5=10e6]=2.7]contact groupbehavior andcmat default type ball-ball model linearpbond method deformability ...emod 12e8 kratio 1.5 pb_deformability emod 54e8 kratio 1.5 ...property pb_coh [pb_coh] pb_ten [pb_coh*ten_coh] pb_fa 50 fric 0.5table cluster_template_pos_big read cluster_template_pos_bigtable cluster_template_rad_big read cluster_template_rad_bigtable cluster_template_pos_small read cluster_template_pos_smalltable cluster_template_rad_small read cluster_template_rad_small=table.find("cluster_template_pos_big")]=table.find("cluster_template_rad_big")]=table.find("cluster_template_pos_small")]=table.find("cluster_template_rad_small")]=table.size(tb_pos_big)]=table.size(tb_pos_small)]def genghuan_clustercount_cluster=0loop foreach bp ball.groupmap("cluster_template_big")x_pos=ball.pos.x(bp)y_pos=ball.pos.y(bp)ball.delete(bp)jiaodu=math.random.uniform*math.pi*2sin_jiaodu=math.sin(jiaodu)cos_jiaodu=math.cos(jiaodu)loop n(1,tb_size_big)ct_posX=table.x(tb_pos_big,n)ct_posY=table.y(tb_pos_big,n)ct_rad=table.y(tb_rad_big,n)cluster_pos_x=x_pos+(-1)*sin_jiaodu*ct_posX+cos_jiaodu*ct_posYcluster_pos_y=y_pos+cos_jiaodu*ct_posX+sin_jiaodu*ct_posYpos_vec=vector(cluster_pos_x,cluster_pos_y)bp_temp=ball.create(ct_rad,pos_vec)="big_cluster"geoup_2_name=string.build("cluter_num_%1",count_cluster)=geoup_2_nameendloopcommandcleancontact method bond gap [lijing1*0.08*0.2] range group @geoup_2_name slot 2endcommand=1endlooploop foreach bp ball.groupmap("cluster_template_small")x_pos=ball.pos.x(bp)y_pos=ball.pos.y(bp)ball.delete(bp)jiaodu=math.random.uniform*math.pi*2sin_jiaodu=math.sin(jiaodu)cos_jiaodu=math.cos(jiaodu)loop n(1,tb_size_small)ct_posX=table.x(tb_pos_small,n)ct_posY=table.y(tb_pos_small,n)ct_rad=table.y(tb_rad_small,n)cluster_pos_x=x_pos+(-1)*sin_jiaodu*ct_posX+cos_jiaodu*ct_posYcluster_pos_y=y_pos+cos_jiaodu*ct_posX+sin_jiaodu*ct_posYpos_vec=vector(cluster_pos_x,cluster_pos_y)bp_temp=ball.create(ct_rad,pos_vec)="small_cluster"geoup_2_name=string.build("cluter_num_%1",count_cluster)=geoup_2_nameendloopcommandcleancontact method bond gap [lijing1*0.08*0.2] range group @geoup_2_name slot 2endcommand=1endloopend@genghuan_clusterball attribute density 2.7e3 damp 0.7cycle 1solvesave cluster_sample
可以看一下pb_state觀察一下這其中的效果。可以看到不同cluster之間是沒有膠結的。
4、加圍壓
后面就跟雙軸一樣了,只是第三步不一樣。
restore cluster_sample=-300e3]=-300e3]cycle 1solvesave weiya
5、加載:
restore weiyaset mech age 0ball attribute displacement multiply 0[streainRatio=1e-2][do_xSevro=true][do_ySevro=false]wall attribute yvelocity [wly*streainRatio*0.5] range id 1wall attribute yvelocity [-wly*streainRatio*0.5] range id 3[Ix0=wlx][Iy0=wly]def computer_strainwexx=(wlx-Ix0)/Ix0weyy=(wly-Iy0)/Iy0weVol=wexx+weyypianyingli=(wyss-wxss)endset fish callback -1.1 @computer_strainhistory deletehistory id 1 @wysshistory id 2 @weyyhistory id 3 @wxsshistory id 4 @wexxhistory id 5 @weVolhistory id 6 @pianyingli[stop_me=0]def stop_meif weyy<-20e-2 thenstop_me=1endifend[baocunpinlv=-1e-2][time_record=weyy+1][count=0]def savefileif weyy-time_record <= baocunpinlv thenfilename=string.build("jieguo_%1",count)commandsave @filenameendcommandtime_record=weyycount +=1endifendset fish callback -1.0 @savefilesolve fishhalt @stop_mesave result
看一下應力應變,由于顆粒不多,波動還是比較大的。
位移圖和剛性顆粒差不多。
我們看一下細觀:
對于低圍壓來說,基本上都不會壞,這里的特性可能和剛性差不多。
這里嘗試一下1mpa的圍壓:
應力應變:
細觀:
可以看到很多顆粒被壓壞了。
放大點看看:
本文只給出模擬框架,分析方面不多,讀者可以根據自己需求加入一些后處理。
工程師必備
- 項目客服
- 培訓客服
- 平臺客服
TOP




















