PFCdocumentation_ PFC examples

目录

PFC examples

Balls in a Box

Clumps in a Box

Attributes and Properties


PFC examples


Balls in a Box


        模拟了 30 个在盒子中相互作用的球。

        The one-wall keyword is given to force all generated facets to belong to the same wall, as opposed to creating one wall for each face of the box. 

        PFC要求球具有非零密度,以便求解球的运动方程。一 如果存在密度为零的球,则在循环序列开始时发生错误。

; fname: cmlinear_simple.p3dat
;
;  Exercise the Linear contact model
;==============================================================================
model new
model title 'Balls in a box'

; Set the domain extent指定属性域
model domain extent -10.0 10.0

; Modify the default slots of the Contact Model Assignment Table
; Here we choose the linear contact model (with kn=1e6) for all contact types
;使用线性接触模型
contact cmat default model linear property kn 1.0e6

; Generate 30 balls in a box
wall generate box -5.0 5.0 one-wall
model random 10001
ball generate radius 1.0 1.4 box -5.0 5.0 number 30

; Assign ball density
ball attribute density 100.0

; Activate gravity
model gravity 10.0

;Save the initial state保存初始状态
model save 'initial-state'

; Solve for a given time and save the model
;使用模型求解命令循环系统,目标时间限制为 10.0 个时间单位
model solve time 10.0
model save 'caseA-nodamping'

; Restore the initial state
model restore 'initial-state'

;更改模型状态,将耗散引入模型
; Modify the default slots of the Contact Model Assignment Table
; Newly created contacts will use these settings
contact cmat default model linear ...
                     property kn 1.0e6 ks 1.0e6 fric 0.25 dp_nratio 0.1
; Apply the CMAT to existing contacts as well
; Note that the contact model will be overridden (and therefore all previous 
; information will be lost)
contact cmat apply

; Solve for a given time and save the model
model solve time 10.0
model save 'caseB-damping'

return
;==============================================================================
; eof: cmlinear_simple.p3dat

Clumps in a Box


Clumps in a Box


       (1)指定域和接触模型,并赋值。

model new
model title 'Clumps in a box'

; Set the domain extent and the random seed
model domain extent -10.0 10.0
model random 12001

; Modify the default slots of the Contact Model Assignment Table
; Here we choose the linear contact model for all contact types
contact cmat default model linear property kn 1.0e6         ...
            ks 5.0e5 dp_nratio 0.5 fric 0.3

        (2)创建第一个团块模板(clump)

; Create a clump template, specifying the interia tensor and volume
[rad = 0.5]
[vc   = (4.0/3.0)*math.pi*(rad)^3]
[moic = (2.0/5.0) * vc * rad^2]
clump template create name 'single'                 ...
            pebbles 1                               ...
            @rad 0 0 0                              ...
            volume @vc                              ...
            inertia @moic @moic @moic 0 0 0

        (3)创建第二个团块模板,团块由两个半径相同的重叠鹅卵石组成。 pebcalculate计算

; Create a clump template, specifying the calculation of the
; inertial properties from the pebbles via voxelization
clump template create name 'dyad'                   ...
            pebbles 2                               ...
            @rad [-rad*0.5] 0 0                     ...
            @rad [rad*0.5] 0 0                      ...
            pebcalculate 0.005

        (3)创建第三个团块模板, distance 关键字指定卵石分布平滑度的角度度量

; Create a clump template from an stl file, filling it with 
; the bubblepack algorithm
geometry import 'dolos.stl'
clump template create name 'dolos'                  ...
            geometry 'dolos'                        ...
            bubblepack ratio 0.3 distance 120       ...
            surfcalculate
;geometry用作块的表面描述符的几何图形集的名称。
;bubblepack指定通过Taghavi(2011)的Bubble Pack算法创建块状模板卵石。
;surfcalculate 假设密度均匀,根据表面描述计算惯性属性。

        (4)clump generate将50个团块放在一个盒子中,没有重叠。

clump generate diameter size 1.5 number 50          ...
            box -5.0 5.0 -5.0 5.0 -5.0 0.0          ...
            group 'bottom'

        (5)根据指定的模板控制团块的比例及其相对于模板方向的方向

clump generate diameter size 1.5 number 25          ...
            box -5.0 5.0 -5.0 5.0 0.0 5.0           ... 
            templates 2                             ... 
            'dyad' 0.3 'dolos' 0.7                  ...
            azimuth 45.0 45.0                       ...
            tilt 90.0 90.0                          ...
            elevation 45.0 45.0                     ...
            group 'top1'
            
clump generate diameter size 1.5 number 25          ...
            box -5.0 5.0 -5.0 5.0 0.0 5.0           ... 
            templates 2                             ... 
            'dyad' 0.7 'dolos' 0.3                  ...
            azimuth -45.0 -45.0                     ...
            tilt 90.0 90.0                          ...
            elevation 45.0 45.0                     ...
            group 'top2'
; azimuth 方位,方位角范围,以随机旋转团块模板左右。
;tilt 倾斜的范围,以随机旋转簇模板。
;elevation 海拔高度,在标高范围内随意旋转团块模板左右。向上旋转是绕y轴向右旋转。

        (6)分配重力,进行求解

; Assign clump density
clump attribute density 100.0

; Activate gravity
model gravity 10.0

;Save the initial state
model save 'initial-state'

; Solve for a given time and save the model
model solve time 0.8
model save 'intermediate-time'

; Solve again to equilibrium and save the model
model solve ratio-average 1e-4
model save 'final-model'

Attributes and Properties


  • Attributes are intrinsic characteristics of model components such as position, velocity, size, etc. The list of attributes is unchanging. Bodies (balls, clumps, and walls), pieces (balls, pebbles, and facets) and contacts have attributes.  Attributes can also be listed in PFC with the ball list attributeclump list attribute, and wall list attribute commands.
  • Properties apply exclusively to pieces and are lists of string/value pairs specified by the user. By default, pieces are devoid of properties. These string/value pairs are meant to represent the surface conditions of the pieces and may be used by contact models to determine how pieces interact.

Mistaken Property Assignment

; fname: attributes_and_properties.p3dat
;
;  Demonstrate the distinction between ball attributes and ball properties
;==============================================================================
model new
model title 'Attributes and Properties'

; generate a loose assembly of balls 
model domain extent -10.0 10.0
model random 10001
ball generate number 10 radius 0.5 box -0.5 0.5 -0.5 0.5 -9.0 9.0

; set a nonzero x-velocity to part of the balls 
ball attribute velocity-x 1.0 range position-z -10.0  0.0

; create a property with name 'xvelocity' to the other balls 
ball property 'velocity-x' 1.0 range position-z   0.0 10.0

; set density and cycle - note that only part of the balls actually moved 
ball attribute density 1.0
model mechanical timestep fix 1e-2
model solve time 2

return
;==============================================================================
; eof: attributes_and_properties.p3dat

        球的颜色由其“velocity-x”属性着色。底部的五个球没有渲染,因为它们没有“velocity-x”属性。另一方面,没有为前五个球渲染箭头,因为没有为这些球分配速度。因此,一旦循环开始,带有属性分配的球就不会移动。(the balls with the property assignment)


Property Assignment for Contact Inheritance

        在这种情况下,在墙隔板的两侧生成相同数量的球。线性接触模型被指定为所有接触类型的默认接触模型,但在 CMAT 中未指定任何属性。左侧的球的 kn 值比右侧的球高 200 倍,因此右侧压实度大。

; fname: properties_in_contacts.p3dat
;  Demonstrate ball properties being used to set contact model properties
;==============================================================================
model new
model title 'Properties in Contacts'

; create the domain
model domain extent -10.0 10.0 -5.0 5.0 -10.0 10.0 condition reflect

; use the linear contact model 
contact cmat default model linear

; generate an assembly 用box把左右分开
model random 10001
ball generate number 140 radius 1.0 box -10 0 -5 5 -10 10 tries 300000
ball generate number 140 radius 1.0 box 0 10 -5 5 -10 10 tries 300000

; assign the density and local damping
ball attribute density 1000 damp 0.7

;set gravity重力
model gravity 10

; assign properties balls for the linear contact model to use
;赋予不同刚度
ball property 'kn' 1e8 range position-x -10 0
ball property 'kn' 5e5 range position-x 0 10
ball property 'fric' 0.7

; put a partition between the two sides
wall generate plane dip 90 dip-direction 90
wall property 'kn' 1e7

; let them drop
model solve time 10

return
;==============================================================================
; eof: properties_in_contacts.p3dat

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值