You are on page 1of 11

2023/9/21 16:31 颗粒力链描述式样的受力情况

颗粒力链描述式样的受力情况
原创 Lobby2020 超级大的lobby 2021-09-21 23:55

首先祝各位中秋节快乐,好长时间没有更新内容了,今天写一篇关于后处理的一个技
术,后面会夹带点私货。本文的技术方法参考的同济付龙龙老师的颗粒力链方法,这里
是我个人的理解写出来的实现方法,给各位参考。

一、理论方法

本理论认为颗粒的连接形成颗粒的力链,所以直接以颗粒形成力链。这里关于颗粒力
链有如下几个假设:1、形成力链的颗粒都属于高应力颗粒;2、颗粒之间主应力方向与
颗粒接触方向的夹角有一定的阈值;3、组成力链的颗粒数有一个阈值。所以这里的技
术方法也会有一些难点,包括高应力颗粒的筛选,方向夹角的计算等,下文一一解决。

二、高应力颗粒筛选

这里将颗粒大主应力大于平均值的颗粒认为是高应力颗粒。使用的是ball.stress来获
取颗粒的应力状态,也就是一个tensor。之后可以使用tensor.prin获取颗粒的主应力,
这个返回值为一个vector,其中的xyz分别为大中小主应力。分为两步,首先第一次遍
历获取总应力值来计算平均应力,第二次便利根据大主应力和平均应力的相对大小来判
定是否是高应力颗粒。

1 def findGaoYingliBall
2 loop foreach local bp1 ball.list
3 ball.group(bp1,2)="None"
4 endloop
5 local ball_stress_all=0
6 loop foreach local bp ball.list
7 local ball_stress=ball.stress(bp)
8 ball_stress_prin=tensor.prin(ball_stress)
9 ball_stress_1=comp.x(ball_stress_prin)
10 ball_stress_all+=ball_stress_1
11 endloop
12 local ball_stress_Mean=ball_stress_all/float(ball.num)
13 loop foreach local bp0 ball.list
14 ball_stress=ball.stress(bp0)

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 1/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

15 ball_stress_prin=tensor.prin(ball_stress)
16 ball_stress_1=comp.x(ball_stress_prin)
17 if ball_stress_1<ball_stress_Mean then
18 ball.group(bp0,2)="gaoyingli"
19 endif
20 endloop
21 end

运行结果如图,这里以直剪实验来表现,其实是可以看出来高应力颗粒的分布和力链
分布还是一致的。

三、单个颗粒的力链延申

一个力链颗粒的延申方向需要有两个条件:1、延申方向的颗粒属于高应力颗粒;2、
主应力和颗粒连线夹角小于阈值alpha;3、延申方向的颗粒是满足1 2条件中颗粒中的
最大应力对应的颗粒。

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 2/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

这里的一个点是使用math.atan反三角来获取应力的角度theta。连线向量为ball_L。
其余的没啥难点,仔细阅读应该是可以看懂的。
最终返回值就是下一个力链颗粒

1 ;find the neighbour ball of the target ball


2 def BalllinJie(ball_temp)
3 BalllinJieTemp=null
4 local stress_max_1=0
5 loop foreach local ct ball.contactmap(ball_temp)
6 local ct_ball1=contact.end1(ct)
7 ball_gebi=null
8 if ball.id(ct_ball1)=ball.id(ball_temp) then
9 ball_gebi=contact.end2(ct)
10 else
11 ball_gebi=contact.end1(ct)
12 endif
13 if type.pointer(ball_gebi)="Ball" then
14 if ball.group(ball_gebi,2)="gaoyingli" then
15 if ball.group(ball_gebi,3)="lilian"
16 continue
17 else
18 ball_L=ball.pos(ball_temp)-ball.pos(ball_gebi)
19 stress_linjie= ball.stress(ball_gebi)
20 ball_stress_prin=tensor.prin(stress_linjie)
21 sigm11=math.min(comp.xx(stress_linjie),comp.yy(stress_lin
22 sigm22=math.max(comp.xx(stress_linjie),comp.yy(stress_lin
23 sigm12=comp.xy(stress_linjie)
24 theta=math.atan2(2*sigm12,(sigm11-sigm22))
25 if theta<0 then
26 theta+=math.pi
27 endif
28 prin_dir=vector(math.cos(theta),math.sin(theta))
29 temp_canshu=math.dot(ball_L,prin_dir)/(math.mag(ball_L)*m
30 if temp_canshu<=1 then
31 if temp_canshu>math.cos(alpha*math.degrad) then
32 if BalllinJieTemp=null then
33 BalllinJieTemp=ball_gebi
34 stress_max_1=comp.x(ball_stress_prin)
https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 3/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

35 else
36 if comp.x(ball_stress_prin)<stress_max_1 then
37 BalllinJieTemp=ball_gebi
38 stress_max_1=comp.x(ball_stress_prin)
39 endif
40 endif
41 endif
42 endif
43 endif
44 endif
45 endif
46
47 endloop
48 BalllinJie=BalllinJieTemp
49 end

四、单条力链的生成

这里传入的是某个颗粒,然后形成一条力链,力链中的颗粒会储存在一个map结构
中-map_lilian。这里会调用上面介绍的函数来计算,从一个颗粒开始不停的计算下一个
颗粒,知道下一个颗粒的类型不是“Ball”为止,这里也对数目进行判定,如果小于3就不
对其进行生成。

1 ;find one force chain of start ball


2 def OneLiLianMap(ball_temp)
3 ball_qishi=ball_temp
4 map_lilian=map(1,ball_qishi)
5 ball.group(ball_qishi,3)="lilian"
6 count=1
7 loop while true
8 ball_next=BalllinJie(ball_qishi)
9 if type.pointer(ball_next)="Ball" then
10 count+=1
11 isadd=map.add(map_lilian,count,ball_next)
12 ball_qishi=ball_next
13 ball.group(ball_next,3)="lilian"

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 4/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

14 else
15 exit loop
16 endif
17 endloop
18 num=map.size(map_lilian)
19 if map.size(map_lilian) <3 then
20 loop n (1,map.size(map_lilian))
21 bp_temp=map.value(map_lilian,n)
22 ball.group(bp_temp,3)="None"
23 endloop
24 endif
25 OneLiLianMap=map_lilian
26 end

五、所有力链的生成

这也是我们调用的主函数,对高应力组中的颗粒进行遍历即可。

1 def calLilian
2 findGaoYingliBall
3 array maplilian(100000)
4 n_count=1
5 loop foreach bp ball.groupmap("gaoyingli",2)
6 if ball.group(bp,3)="lilian"
7 continue
8 else
9 maplilian(n_count)=OneLiLianMap(bp)
10 n_count+=1
11 endif
12 endloop
13 end

效果为:

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 5/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

可以看出和contact的效果几乎差不多,但是其作为一种比较新颖的后处理方式还是
比较有意思的,这里也可以对力链进行统计分析,其实也是类似与颗粒玫瑰花图类似的
方式。

1 def create_tab
2 table.delete("tongji")
3 tb=table.create(100)
4 table.name(tb)="tongji"
5 max_length=0
6 array_size=int(array.size(maplilian,1))
7 loop m(1,array_size)
8 map_temp=maplilian(m)
9 if type(map_temp)=10 then
10 if map.size(map_temp)>max_length then
11 max_length=map.size(map_temp)
12 endif
13 endif
14 endloop
15 loop n(3,int(max_length))
16 lilian_count=0

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 6/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

17 array_size=int(array.size(maplilian,1))
18 loop m(1,array_size)
19 map_temp=maplilian(m)
20 if type(map_temp)=10 then
21 if map.size(maplilian(m))=n then
22 lilian_count+=1
23 endif
24 endif
25 endloop
26 table(tb,n)=lilian_count
27 endloop
28 end

结果为:

可以看出只有三种尺寸的力链,分别是3个颗粒、4个颗粒和5个颗粒,基本上力链中的
颗粒数越多,其数目越少,这个也是合理的。

最后对2021版新课程做一下说明,目前免费开放前39节课,到双轴为止,其实到这
里也是满足入门需求了。
https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 7/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

40节之后的课程付费开放,目前定价89元,购买后可获得配套的代码。
下面为课程的目录图,后续也会继续更新。

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 8/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 9/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

后面还会继续更新,更新内容不定。

喜欢此内容的人还喜欢

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 10/11
2023/9/21 16:31 颗粒力链描述式样的受力情况

二维组构玫瑰花图拟合方法
超级大的lobby

【PFC6.0】基于水颗粒膨胀法的冻融循环模拟
超级大的lobby

https://mp.weixin.qq.com/s/pppqM3-QK700pAutQkgzNg 11/11

You might also like