PFC3D建模流程和代码解释
更新时间:2023-12-08 02:15:01 阅读量: 教育文库 文档下载
- cc建模流程推荐度:
- 相关推荐
本示例表示生成球体在一定的空间内进行运动的部分代码以及代码表示意义。 新建一个PFC3D模型必要部分生成的整体日志。PFC3D建模需要的部分和代码解释
********************************************** * Logging started at 周三 八月 30 16:50:55 2017 * By pfc3d Version 5.00 Release 025 * *
* Job Title: Pandect example
********************************************** pfc3d>
pfc3d>; 3-设置模型名称,可有可无。 pfc3d>title 'Pandect example' pfc3d>
pfc3d>; 4-设定计算区域(必要条件) pfc3d>; Set the domain extent
pfc3d>domain extent -10.0 10.0 -20 20 ; domain当中有两个关键词是condition和extent,condition指的是边界条件 periodic ;destroy ;stop ;reflect;condition默认值是stop。
extent指的是模型区域 pfc3d>
pfc3d>; 5-指定随机种子(若不指定,种子随机) pfc3d>set random 10001;默认值是一万,且数量级是相同的数量级,也就是该随机数值10000不能过大,不能过小。设置随机种子以后,生成的颗粒的半径和位置都在范围内随机。 pfc3d>
pfc3d>; 6-生成及修改模型组件(必要条件),有三种命令是来生成颗粒的,generate,create,distribute。
pfc3d>; Generate 30 balls in a box,wall就是一个生成颗粒的容器。 pfc3d>wall generate box -5.0 5.0
--- The wall boxWallBottom1 with id 1 and 2 facets has been created --- The wall boxWallTop2 with id 2 and 2 facets has been created --- The wall boxWallLeft3 with id 3 and 2 facets has been created --- The wall boxWallRight4 with id 4 and 2 facets has been created --- The wall boxWallFront5 with id 5 and 2 facets has been created --- The wall boxWallBack6 with id 6 and 2 facets has been created pfc3d>;ball create
pfc3d>ball generate radius 1.0 1.4 box -5.0 5.0 number 1000 +++ Fewer balls were generated than specified! 34 balls out of 1000 generated in 20000 tries. pfc3d>;ball distribute pfc3d>
pfc3d>; 7-组件分组,颗粒分组,墙体分组。 pfc3d>
pfc3d>ball group small_balls range radius 1.0 1.2
--- Group small_balls assigned to 14 Balls in slot 1. pfc3d>ball group big_balls range radius 1.2 1.4 --- Group big_balls assigned to 20 Balls in slot 1. pfc3d>
pfc3d>; 8-施加实体属性(必要条件),实体属性的意思是这些属性是作用在颗粒的中心的。 pfc3d>; Assign ball density,颗粒的实体属性一般都是由attribute这个属性来添加。fix是来限制颗粒的移动方向和位移。 pfc3d>ball attribute density 100.0
--- Attribute density initialized in 34 ball(s). pfc3d>ball fix zvelocity range group big_balls --- Fixity conditions changed in 20 balls. pfc3d>
pfc3d>pause key
Press any key to continue --
pfc3d>
pfc3d>ball attribute radius multiply 1.2;这是半径放大和缩小倍数的,这句话的意思是,生成的半径乘以1.2倍。
--- Attribute radius initialized in 34 ball(s).
pfc3d>ball attribute damp 0.7; 局部阻尼,PFC3.0-4.0默认值是0.7,在PFC5.0是0.0 --- Attribute damp initialized in 34 ball(s). pfc3d>
pfc3d>pause key
Press any key to continue --
pfc3d>
pfc3d>; 9-指定接触模型(必要条件)
pfc3d>; Modify the default slots of the Contact Model Assignment Table
pfc3d>; Here we choose the linear contact model (with kn=1e6) for all contact types
pfc3d>cmat default model linear property kn 1.0e6 fric 0.0;定义法向刚度为10的6次方。 pfc3d>
pfc3d>; 10-设置表面属性,也就是说这些属性是作用在颗粒表面的。
pfc3d>ball property kn 2e6 ks 1e6 fric 0.0;要通过属性转换才能转到50行的fric --- Property kn assigned to 34 ball(s) in range. --- Property ks assigned to 34 ball(s) in range. --- Property fric assigned to 34 ball(s) in range. pfc3d>
pfc3d>; 11-添加重力场 pfc3d>; Activate gravity pfc3d>set gravity 10.0 pfc3d>
pfc3d>; 12-设定时间步长(若不指定,取默认值,默认值为模拟时间步长) pfc3d>set timestep maximum 5e-3
--- maximum timestep set to 0.005 in mechanical process.
pfc3d>
pfc3d>def timestep
Def> timestep = math.sqrt(m/K)
Def> time = mech.age;得到模拟时间从而设置时间步长的时候要将时间步长设置的小于该模拟时间,否则该设置的时间步长将会被忽略。 Def>end pfc3d>
pfc3d>; 13-记录数据
pfc3d>wall history id 1 zcontactforce id 1 --- Created history 1 Z-ContactForce of wall 1 pfc3d>
pfc3d>pause 5;现在是数字,指的是暂停五秒,如果是pause key的话,则是摁任意键继续。 pfc3d>
pfc3d>; 14-计算求解(必要条件)主要是三个命令,step,cycle,solve time。 pfc3d>; Solve for a given time and save the model
pfc3d>;step 1000,step很少用,几乎用不到。step和cycle后面都是跟的步数。 pfc3d>;cycle 2002 pfc3d>solve time 10.0
Cycle Total Timestep Mech Time Clock --------- ---------- ----------- ------------ -----------
2000 2000 5.00000E-03 1.000000e+01 00:00:00:24 1.000000e+01
--- Limit time of 1.000000e+01 met in process(es): mech Ball (1.000000e+01),mech Clump (1.000000e+01),mech Wall (1.000000e+01). --- Cycling ended at: 2017-08-30 16:51:36 pfc3d>
pfc3d>; 15-输出数据
pfc3d>history write 1 file wzcforce ;.csv,如果不加扩展名默认的扩展名是.his,his文件可以用文本打开。
--- History contents written to file D:/安装程序/PFC/PFC学习版2d+3d+例子/01-模型基本组成/PFC5.0-3D/wzcforce.his. pfc3d>
pfc3d>; 16-保存模型及模型调用,保存模型是以.p3sav为扩展名的一个文件。通过restore来调用模型。
pfc3d>save pandect_example
--- Model saved to file D:/安装程序/PFC/PFC学习版2d+3d+例子/01-模型基本组成/PFC5.0-3D/pandect_example.p3sav pfc3d>
pfc3d>;pause
pfc3d>;cmat命令一个模型当中前后计算设置不同的接触最好不要。
pfc3d>;ball attribute displacement multiply 0.0,清空颗粒的位移。清空以后都是0. pfc3d>
pfc3d>set log off
**********************************************
* Logging ended at 周三 八月 30 16:51:37 2017
**********************************************
建模部分代码-建立尾矿坝的一部分
new
domain extent -50 350 -50 350
ball distribute porosity 0.06 radius 0.5 0.75 box 0 300 0 200 ball attribute density 2500 damp 0.7 geometry import 01.dxf
ball del rang geometry 01 count 1 not wall import geometry 01 geometry import 02.dxf wall import geometry 02 [porosity=0.04] [area=7948]
set random 10001 def ball_creat i=50000
a=area*(1-porosity) loop while area_sum<=a f1 = math.random.uniform f2 = math.random.uniform f3 = math.random.uniform radius_1=0.75+f3*(2-0.75) x_1=2+80*f1 y_1=2+42*f2 command
ball create id=@i radius=@radius_1 x=@x_1 y=@y_1 endcommand i=i+1
area_1=radius_1*radius_1*math.pi area_sum=area_sum+area_1 end_loop end
@ball_creat
ball attribute density 2700
cmat default type ball-facet model linear property kn 1e10
cmat default type ball-ball model linearpbond method deform emod 2e8 kratio 2 cyc 100000 calm 1000 wall del
geometry del
geometry import 02.dxf geometry import 05.dxf geometry import 06.dxf
ball group 1 rang geometry 02 count 1
ball group 2 rang geometry 05 count 1 ball group 3 rang geometry 06 count 1 save model
接触模型的部分代码书写
例子一
; fname: cmat1.p2dat ;
; Illustrate simple usage of the CMAT
; (All default slots filled with the same data)
;============================================================================== new
set random 10001
domain extent -1.5e-2 1.5e-2 condition destroy;定义该计算区域 wall generate box -1.0e-2 1.0e-2 onewall;生成墙体
ball generate number 200 radius 0.4e-3 0.6e-3 box -1.0e-2 1.0e-2 ;生成了200个颗粒,也可能生成不了那么多的颗粒,半径为0.4*10的-3次方,0.6*10的-3次方,颗粒范围为-1.0*10的-2次方即为-0.01,0.01
ball attribute density 2500.0;设置密度为2500
; set ALL the default slots of the CMAT
cmat default model linear property kn 1e6 dp_nratio 0.0;指定了接触模型为线性接触模型,法向刚度为10的6次方,法向临界阻尼比为0.0
set gravity 9.81;设置了重力加速度为9.81 cycle 1000
pause key
; set ALL the default slots of the CMAT
cmat default model linear property kn 1e7 dp_nratio 0.2 lin_mode 1;指定了接触模型为线性接触模型,法向刚度为10的7次方,法向临界阻尼比为0.2,控制接触力的法向接触更新模式为1.
cmat apply range x 0.0 1.5e-2;接触模型的应用范围为x方向0.0到0.015,cmat apply指的是将新建的模型添加在已有的模型上。
solve aratio 1e-4;solve aratio等于平均不平衡力与平均接触力的比值,默认值是10的-5次方。但是不能太小,因为太小了以后会造成模型完成时间过长。用step和cycle也是可以求解的。 save cmat1;保存接触模型为1.
return
;============================================================================== ; eof: cmat1.p2dat 例子二
; fname: cmat2.p2dat ;
; Illustrate simple usage of the CMAT
; (Default slots filled with the different data)
;============================================================================== new
set random 10001
domain extent -1.5e-2 1.5e-2 condition destroy wall generate box -1.0e-2 1.0e-2 onewall
ball generate number 200 radius 0.4e-3 0.6e-3 box -1.0e-2 1.0e-2
ball attribute density 2500.0;生成了和cmat1一样的模型,只是在接触模型上有了变化。
; set different contact models for the ball-ball and ball-facet contact types cmat default type ball-ball ...
model hertz ...;赫兹接触模型,颗粒与颗粒之间
property hz_shear 30e9 hz_poiss 0.3 ...;赫兹切向模量30的9次方,赫兹泊松比为0.3
fric 0.25 ...;摩擦系数0.25 dp_nratio 0.2;法向临界阻尼比为0.2
cmat default type ball-facet ... model linear ...
property kn 1e6 dp_nratio 0.2
set gravity 9.81 solve
save cmat2
return;对两种接触模型分别定义
;============================================================================== ; eof: cmat2.p2dat 例子三
; fname: cmat3.p2dat ;
; Illustrate advanced usage of the CMAT
; (Default and Optional slots filled with different data)
;============================================================================== new
set random 10001
domain extent -1.5e-2 1.5e-2 condition destroy;生成了两组颗粒,在ball generate当中用了
group命令
wall generate box -1.0e-2 1.0e-2 onewall
ball generate number 100 radius 0.4e-3 0.6e-3 box -1.0e-2 1.0e-2 group glass ;玻璃球 ball generate number 100 radius 0.4e-3 0.6e-3 box -1.0e-2 1.0e-2 group steel ;钢球
ball attribute density 2500.0 range group glass;定义密度 ball attribute density 7500.0 range group steel
;contact group left range x -1.5e-2 0 ;contact group right range x 0 1.5e-2
contact groupbehavior and ;contact groupbehavior后面有三个关键词,and,or ,contact。and关键词指的是颗粒与颗粒之间的接触是cmat add 定义的模型作用的范围只限于该组内部的接触,而对于另外组的接触则不定义。如果说是选的关键词是or定义的范围只要颗粒属于这个组,则定义的模型范围是所有与这个组相接触。contact关键词是用来根据颗粒的分组来判断接触的。通过对接触分组来对某个范围内的颗粒定义接触。
;不论cmat add 1 model hertz ,cmat add 2 model hertz ,cmat default type ball-ball,cmat default type ball-facet 这四个的顺序怎么样,总是按照这个顺序来执行 cmat add 1 model hertz ...
property hz_shear 30e9 hz_poiss 0.3 ...;30Gpa的切向模量,0.3的泊松比 fric 0.25 ...;0.25的摩擦系数
dp_nratio 0.2 ...;0.2的法向临界阻尼比 range group glass;区域范围为玻璃球组合
cmat add 2 model hertz ...;添加赫兹模型2 property hz_shear 70e9 hz_poiss 0.3 ... fric 0.05 ... dp_nratio 0.2 ... range group steel;区域范围为钢球组合
cmat default type ball-ball ...
model hertz ... property hz_shear 50e9 hz_poiss 0.3 ... fric 0.05 ... dp_nratio 0.2
cmat default type ball-facet ... model linear ... property kn 1e6 dp_nratio 0.2
set gravity 9.81 solve
save cmat3
return
;============================================================================== ; eof: cmat3.p2dat
正在阅读:
PFC3D建模流程和代码解释12-08
徐州市小学英语毕业毕业生文化素质调研性英语试卷 - 图文09-30
高中化学解题方法归纳(难点19~24)11-16
先秦诸子选读名句默写03-25
税票鉴赏_ 社会主义新时期地方题材印花税票_ 明清榷关印花税票_05-11
2016水利协会质检员题库03-28
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 建模
- 流程
- 解释
- 代码
- PFC3D
- 发酵工程有关习题
- 测试结果试卷查看
- 2019年春八年级数学下册第19章四边形本章中考演练练习新版沪科版20190218217
- MODIS Products Table
- 小数加减法易错题
- 四川省成都市石室中学2019届高三上学期一诊模拟考试(二)试题生物+五套理综模拟卷
- 江苏省射阳县第二中学高三上学期期中 - 数学数学
- 2019九年级数学上册 第二十四章 圆 章末复习(四)圆习题(新版)新人教版
- 能量法答案
- 安徽省五河县第二中学高中地理2.1.3荒漠化的防治学案(无答案)新人教版必修3
- 电机课后习题答案2014
- 《高等教育学概论》练习题
- 知其不可而为之公开课教案
- 2018年全国导游资格考试《地方导游基础知识》章节练习题
- 物理课堂观察量表(2)
- 中国科技需要的根本转变:从传统人治到竞争优胜体制
- 乡镇党委书记在全县总结表彰大会上的表态发言
- 小学一年级体育教案(表格式)
- 西安科技大学学术型硕士研究生招生专业目录 - 图文
- 宏观经济学习题 - 图文