clump的基本使用

目录

clump的基本使用

geometry的四种生成方式

常用的geometry的fish

生成clump模板

批量生成clump


clump的基本使用


A clump is a rigid collection of  rigid spherical pebbles. (clump以pebble为基本单元


geometry的四种生成方式


geometry:

几何系统允许用户创建、导入和导出几何数据。这些数据可以用各种方式与模型互动。这些数据可以用范围逻辑作为过滤器,也可以用绘图作为可视化的辅助工具。FISH的额外变量和组名可以分配给几何数据。FISH可以用来创建和操作数据。几何数据被组织成几何集,它是节点、边和多边形的命名集合。

几何对象的创建不需要一个域,因为它们不是模型组件。几何导入命令用于从文件中导入几何数据,该文件可以是.stl、.dxf或Itasca几何格式。(可以用ai矢量绘图软件绘制,可以输出为stl或者dxf)

生成多边形:geometry polygon

①edge 边

②node 点

③输入位置矢量

④外部导入

在plot中的geometry中查看

new

;geometry node id 1 -1 -1
;geometry node id 2 1 -1
;geometry node id 3 2 0
;geometry node id 4 1 1
;geometry node id 5 -1 1
;geometry node id 6 -2 0
;;geometry polygon nodes 1 2 3 4 5 6
;geometry edge id 1 node 1 node 2 
;geometry edge id 2 node 2 node 3 
;geometry edge id 3 node 3 node 4 
;geometry edge id 4 node 4 node 5 
;geometry edge id 5 node 5 node 6 
;geometry edge id 6 node 6 node 1
;
;geometry polygon edges 1 2 3 4 5 6

;geometry polygon positions -1 -1 ...
;                           1 -1 ...
;                           2 0 ...
;                           1 1 ...
;                           -1 1 ...
;                           -2 0 

;导入在ai中绘制的矢量图片
geometry import geo.dxf

save addgeo

常用的geometry的fish


 基本的fish用法:

loop foreach nd geom.node.list(g) 

restore addgeo

def geo_set
    g = geom.set.find("geo") 
    x_min=1e100
    x_max=-1e100
    
    y_min=1e100
    y_max=-1e100
    loop foreach nd geom.node.list(g) 
        local x_pos_local_node=geom.node.pos.x(nd)
        if x_pos_local_node>x_max then
            x_max=x_pos_local_node
        endif
        if x_pos_local_node<x_min then
            x_min=x_pos_local_node
        endif
        local y_pos_local_node=geom.node.pos.y(nd)
        if y_pos_local_node>y_max then
            y_max=y_pos_local_node
        endif
        if y_pos_local_node<y_min then
            y_min=y_pos_local_node
        endif
    endloop
    ;global的变量在右侧状态栏可以看到,如果不想看到可以添加local关键字
end
@geo_set
;首先查找几何体尺寸

[scale=1/(x_max-x_min)]

def scale_geo
    g = geom.set.find("geo") 
    loop foreach nd geom.node.list(g) 
        geom.node.pos.x(nd)=  geom.node.pos.x(nd)*scale 
        geom.node.pos.y(nd)=  geom.node.pos.y(nd)*scale 
    endloop
end
@scale_geo
@geo_set

def move_geo_toOrigin
    g = geom.set.find("geo")
    loop foreach nd geom.node.list(g)
        geom.node.pos.x(nd)=  geom.node.pos.x(nd)-(x_max+x_min)*0.5
         geom.node.pos.y(nd)=  geom.node.pos.y(nd)-(y_max+y_min)*0.5
    endloop
end
@move_geo_toOrigin
@geo_set
;把几何体移动到原点

生成clump模板


template模板

Create a clump template. The inertial attributes must be specified upon creation. One can either specify them directly (i.e., specify the volume, inertia, and position) or specify their calculation from the pebble distribution (with the pebcalculate keyword) or from the surface description (with the surfcalculate keyword). The pebbles may be specified directly or automatically via the Bubble Pack algorithm of Taghavi (2011). The clump, and all pebbles, are translated so that the clump centroid coincides with the origin. The original clump position is also retained and can be used for replication.

Clump templates are assumed to have unit density, and the inertia must reflect this condition.块状模板被假定为具有单位密度,而惯性必须反映这一条件。

surfcalculate 表面计算
假设密度均匀,从面的描述中计算出惯性属性。这个关键字不能与惯性、pebcalculate、位置、体积、x、y或z关键字一起给出。

;通过模板生成单个clump
restore addgeo

domain extent -2 2
clump template  create geometry geo ...
            bubble pack distance 160 ratio 0.1 surfcalculate
geometry delete
clump replicate angle 0 diameter 1 position 0 0 name geo
;distance 160 数字越大,粘聚性越好,数目越多。clump是用圆形/球体生成的
;ratio为比例,指块状模板中保留的最小和最大卵石的比率。ratio越小越好,越小边界越好
;删掉之前的geometry

save create_clump

批量生成clump


①clump generate

产生不重叠的块状物。当创建了目标数量的块状物或达到了尝试放置块状物而不重叠的次数时,这个过程就会停止。默认情况下,团块的位置和大小是从整个模型域的均匀分布中提取的。

 ②clump distribute

不建议用,clump内部的基本单元pebble和墙体有接触,会有较大阻力,溢出墙体。

解决办法

 wall generate box -0.6 0.6 expand 2 ;添加expand
wall attribute xvel 1 range id 4  ;对墙体施加一定速度
wall attribute xvel -1 range id 2
wall attribute yvel 1 range id 1
wall attribute yvel -1 range id 3

cycle 2000 calm 50

solve time 0.1
wall attribute vel 0 0
solve 
save create_clump
;将墙体进行放大再压缩

diameter直径
指定用于缩放团块的线性尺寸是{二维的磁盘;三维的球体}的体积等效直径

restore create_clump
domain extent -10 10
;clump generate number 500 size 0.1 box -2 2 diameter 方法一
 wall generate box -0.6 0.6 expand 2

clump distribute porosity 0.2 numbin 1 ...
        bin 1 size  0.1 volumefraction  1 diameter ...
        box -0.5 0.5
clump attribute density 3e3 damp 0.7  ;clump需要赋值密度和阻尼
cmat default model linear property kn 1e8  ks 1e8 fric 0.5  ;设置为线性模型

wall attribute xvel 1 range id 4
wall attribute xvel -1 range id 2
wall attribute yvel 1 range id 1
wall attribute yvel -1 range id 3

cycle 2000 calm 50

solve time 0.1
wall attribute vel 0 0
solve 
save create_clump

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值