lammps案例:分子自由落体运动模拟

大家好,我是小马老师。
本文分享一个比较有意思的lammps案例:分子的自由落体运动。
lammps提供了fix gravity命令可设置分子或者原子的加速度。
语法规则为:

fix ID group gravity magnitude style args

如设置x方向的加速度为100(单位为Force/mass,与units有关),可写为:

fix 1 all gravity 100.0 vector 1 0 0

本文案例和原子沉积类似,在盒子上方随机产生一定数量的分子,经过自由落体后到达盒子底部。
在盒子底部设置一个“墙”,防止原子跑出盒子外面。
分子采用刚体设置,与底部墙碰撞后停止运动。
模拟效果如下图所示:
在这里插入图片描述

lammps in文件代码如下:

#模型基本设置
units 		si 
boundary	p p f
newton		on
atom_style	sphere
atom_modify	map array sort 0 0
neighbor    0.42 bin
timestep 	0.0001
#创建盒子 
region		reg block 0 120 0 60 0 85 units box
create_box	1 reg
#设置原子属性
fix prop all property/atom mol ghost yes
#势函数设置
pair_style	gran/hooke/history 4e5 NULL 1e2 NULL 0.5 0
pair_coeff	* *
#分组
group		particles type 1
atom_modify     first particles
group		rigid type 1
neigh_modify	every 1 delay 0 check yes exclude molecule/intra all 
#热力学信息输出
thermo 		1000
thermo_style	custom step atoms ke
thermo_modify	flush yes lost warn
comm_modify	vel yes cutoff 3
#创建分子模型
molecule	mymol molecule.data
region		pourreg block 5 115 5 55 60 80 side in units box
#设置重力加速度
fix		gravfix all gravity 9.8 vector 0 0 -1 disable
#定义分子为刚体
fix		rigidfix all rigid/small molecule mol mymol gravity gravfix
#在pourreg区域内随机生成400个分子
fix		pourfix all pour 400 0 1234 region pourreg mol mymol rigid rigidfix
#设置底部墙
fix		zwall all wall/gran hooke/history 4000.0 NULL 100.0 NULL 0.5 0 zplane 0.1 NULL
#保存坐标文件
dump		1 all custom 1000 molecule_pour.xyz id type mass radius x y z fx fy fz
#启动运行
run		50000


如果在使用lammps过程中遇到什么问题,可到公众号或者QQ群留言。
公众号案例代码以及学习交流,请加QQ群:754749935
在这里插入图片描述

扫描关注微信公众号:lammps加油站。
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lammps加油站

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值