本文介绍lammps向体系内动态添加原子的一种方法。
 在绝大多数的分子动力学模拟过程中,原子数量保持恒定。
 如果需要按一定步数动态的减少原子,可参考:
 删除蒸发原子
 动态的增加原子,可以使用fix deposit沉积命令:
 沉积案例
 也可以使用fix pour命令。
fix pour命令功能:
 在指定的区域内,每隔一定步数将特定数量的原子或分子插入box中,直到有N个原子或分子被插入。通常用来模拟颗粒在重力作用下倒入容器的过程。
fix pour语法:
 fix ID group-ID pour N type seed keyword values ... 、
 
- N为插入原子或者分子的总数量
 - type为插入原子或分子的类型
 - seed为随机数种子
 - keyword为关键词设置,如插入区域、分子模板等。
 
下面案例是lammps自带的一个fix pour案例,主要模拟在体系内插入3000个原子,原子在重力作用下沉积到底部的过程。
 为突出重点,删掉了若干不需要的语句。
 
in文件代码:
atom_style	sphere
boundary	p p fm
newton		off
comm_modify	vel yes
region		reg block -10 10 -10 10 -0.5 16 units box
create_box	1 reg
neighbor	0.2 bin
neigh_modify	delay 0
pair_style      gran/hooke/history 2000.0 NULL 50.0 NULL 0.5 0
pair_coeff	* *
timestep	0.001
fix		1 all nve/sphere
fix		2 all gravity 1.0 spherical 0.0 -180.0
fix		zlower all wall/gran hooke/history 2000.0 NULL 50.0 NULL 0.5 0 &
		zplane 0.0 2000.0 
region		slab block -9.0 9.0 -9.0 9.0 10.0 15.0 units box
fix		ins all pour 3000 1 300719 vol 0.13 50 region slab
dump		id all atom 1000 dump.xyz
run		25000
 
——————————————
 公众号:lammps加油站



















