lammps模拟中刚体的设置方法

大家好,我是小马老师。
本文介绍lammps模拟中刚体的设置方法。
在有些lammps模拟中,需要把部分原子组设为刚体,如纳米切削过程中,可把刀具设为刚体。
被设为刚体的原子组结构不发生变化,因此,可通过neigh_modify exclude命令取消刚体内部原子之间相互作用力,以节省计算资源,加快计算速度。
在lammps中,设置刚体的命令为fix rigid。
例如,把刀具tool设为刚体,命令为:

fix 1 tool rigid single

体系内的分子设为刚体,命令为:

fix 1 all rigid/small molecule

本文以lammps官方案例介绍同时设置多个刚体的方法。
用到的命令为:

fix rigid group N

这个命令可同时设置N个原子组为刚体,使用比较灵活。
在这里插入图片描述

下面给出全部in文件代码,data.rigid为初始模型,该文件可加QQ群:754749935下载。
代码已尽量详细注释,以供参考,如果理解起来有困难,可参加本公众号的一对一培训辅导,可快速入门lammps。

#模型基本参数设置,模拟单位LJ
units		lj
#原子类型为atomic
atom_style	atomic
#力场类型为LJ/cut
pair_style	lj/cut 2.5
#读入模型文件
read_data	data.rigid
#摩尔质量设置
mass		* 1
#力场参数设置
pair_coeff  * * 1 1
#温度初始化
velocity 	all create 100.0 4928459
#根据原子ID对原子进行分组,共分9组
group		clump1 id <> 1 9
group		clump2 id <> 10 18
group		clump3 id <> 19 27
group		clump4 id <> 28 36
group		clump5 id <> 37 45
group		clump6 id <> 46 54
group		clump7 id <> 55 63
group		clump8 id <> 64 72
group		clump9 id <> 73 81
#这行是我自己加的,把不同的原子组设置为不同的原子类型
#便于在ovito中以不同的颜色显示
set			group clump1 type 1
set			group clump2 type 2
set			group clump3 type 3
set			group clump4 type 4
set			group clump5 type 5
set			group clump6 type 6
set			group clump7 type 7
set			group clump8 type 8
set			group clump9 type 9
#设置以上9个原子组为刚体
fix 1 all rigid group 9 clump1 clump2 clump3 clump4 clump5 &
	  	      clump6 clump7 clump8 clump9
#设置近邻列表时排除同组内的原子
#作用是取消原子组内原子之间的相互作用力
neigh_modify	exclude group clump1 clump1
neigh_modify	exclude group clump2 clump2
neigh_modify	exclude group clump3 clump3
neigh_modify	exclude group clump4 clump4
neigh_modify	exclude group clump5 clump5
neigh_modify	exclude group clump6 clump6
neigh_modify	exclude group clump7 clump7
neigh_modify	exclude group clump8 clump8
neigh_modify	exclude group clump9 clump9
#每100步在屏幕上输出默认的热力学信息
thermo		100
#每50步保存一次坐标文件
dump		1 all atom 50 dump.xyz
#步长为0.0001
timestep 	0.0001
#运行10000步
run		10000

公众号案例代码以及学习交流,请加QQ群:754749935
在这里插入图片描述

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

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

lammps加油站

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

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

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

打赏作者

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

抵扣说明:

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

余额充值