Notes on CFDEM syntax

写个Note是最好的学习方式了

BTW:这种input的方法倒是看起来简洁了,但是非常的不好用,尤其不好入门,又不好检查错误。说实话,这个破语法我感觉学完都不想用了,考虑写个脚本来给他生成算了。。垃圾Syntax,就像在用超级无敌老的电脑,要节约存储空间,所以每一行多写点东西。
现在存储这么便宜,每行写少一点,用个括号括起来指明范围,东西写清楚点别用简称让人一眼就看明白 不好么?非要搞这个乱七八糟的script语法。
DEM方法本来就非常费计算资源,现在内存这么便宜,多用点内存来提高速度多好? 

Case 1: 料斗流动
### Bin Flow Simulation

### This simulation involves inserting a set of particles into a cylindrical hopper,
### allowing them to settle under gravity, and then suddenly opening a stopper at the
### bottom of the hopper and allowing the particles to pour out. We track the
### flowrate of material from the hopper by tracking how many particles remain in the
### system as a function of time.
### Initialization
# Preliminaries, 预设置
units si
atom_style sphere
###atom_style 定义atom的类型,atom_style style args, 可以有sphere, bond, hybrid sphere bond

atom_modify map array
### 修改选择atom类型? map, first, sort;
###map 可选的方式有hash, array;array 每个线程都储存所有颗粒,比hash稍快
###然后sort 给value,每N个时间不长给排序一下。系统混乱的时间,对流体会更有效一些
### first也给某种类型,如colloid (乱七八糟好乱,以后再说)

boundary f f f
### f固定边界,m 移动边界
newton off
communicate single vel yes
### 线程间通信,single 单向,vel 速度,
#processors 2 2 3
# Declare domain
region domain block -0.138 0.138 -0.138 0.138 -0.0045 0.43 units box
create_box 2 domain
###声明计算域,create_box 声明在这个区域内使用的atom种类
# Neighbor listing
neighbor 0.003 bin
neigh_modify every 1 check no


### Setup
###fix用来设置参数,fix (新建)名字  组名字  建的东西(style?) 名字 数值啥的 (后面可以跟一大堆参数)
# Material and interaction properties required
fix m1 all property/global youngsModulus peratomtype 2.5e7 2.5e7
fix m2 all property/global poissonsRatio peratomtype 0.25 0.25
fix m3 all property/global coefficientRestitution peratomtypepair 2 0.5 0.5 0.5 0.5
fix m4 all property/global coefficientFriction peratomtypepair 2 0.2 0.175 0.175
0.5


# Particle insertion
fix pts all particletemplate/sphere 1 atom_type 1 density constant 1000 &
radius constant 0.0015
###为下面的命令 "particledistribution/discrete" 定义颗粒的类型,密度,半径

fix pdd all particledistribution/discrete 63243 1 pts 1.0
####为 fix insert/stream, fix insert/pack, fix insert/rate/region 和相关命令定义颗粒分布.
####第一个奇怪的数字"63243"是一个seed, (random number generator seed)需大于10000;第二个数字是ntemp,使用的模板数目(应该和上面定义的模板有关系)
####pts是上面一行 "particletemplate/sphere" 所定义的颗粒名字,数字是权重

region factory cylinder z 0 0 0.10 0.4 0.41 units box
####region ID style args keyword arg ...定义空间区域 “cylinder args = dim c1 c2 radius lo hi”   dim延展方向?c1 c2 为另外俩个方向的坐标,然后半径,lo 和hi为在dim方向的范围,units box是啥?反正units 默认就是box,为啥要写? keyword = side or units or move or rotate 

fix ins all insert/rate/region seed 123481 distributiontemplate pdd &
nparticles 150000 particlerate 150000 insert_every 1000 &
overlapcheck yes vel constant 0. 0. -1.0 region factory ntry_mc 10000
###每次都要新定义一个ID是什么鬼? 跟在insert/rate/region 后面的第一个又是必须的seed, 然后给个随意的数字;distributiontemplate 也是必须的关键字,使用 “dist-ID = ID of a fix_particledistribution_discrete to be used for particle insertion” 定义的ID,然而如果一定是要使用这个ID,是不是就可以不写了?后面跟着keywords了,1个或者多个, 

# Import mesh from cad:
fix cad1 all mesh/surface file hopper.stl type 2 scale 0.001
####用file定义输入的文件,type定义是哪个类型,scale,算了太明显了,还有一堆关键字


# Use the imported mesh as granular wall
fix geometry all wall/gran/hertz/history mesh n_meshes 1 meshes cad1
####这个就更不合理了,wall/gran 是一个style,然后hertz 是一个model value,这难道是早期的代码?

# Create stopper for funnel 从漏斗创建一个停止的板子吧,字面意思
fix stopper all wall/gran/hertz/history primitive type 2 zplane 0.0

# Define the physics
pair_style gran/hertz/history
pair_coeff * *
###“pair_style style args” example"pair_style gran model hertz tangential history" 所以这个真的是早期代码
###“pair_coeff I J args” 所以你给俩个星星是干啥?

### Detailed settings
# Integrator
fix integrate all nve/sphere
# Gravity
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
# Time step
timestep 0.00001

# Thermodynamic output settings
thermo_style custom step atoms ke cpu
thermo 10000 ##数字是输出时间步长间隔
thermo_modify norm no lost ignore


# Check time step and initialize dump file
fix ctg all check/timestep/gran 1 0.01 0.01
run 1
unfix ctg
####检查一下,然后再用unfix删除

# Create imaging information
dump dumpstl all stl 10000 dump*.stl
dump dmp all custom 10000 dump.1 id type type x y z ix iy iz vx vy vz &
fx fy fz omegax omegay omegaz radius
### "dump ID group-ID style N file args" N是时间步长数

### Execution and further settings
# Fill the hopper
run 150000 upto
# Pull the stopper
unfix stopper
run 300000

评论

热门博文