分享一个聚合物链移动的lammps案例代码。
聚合物链数据在data文件内,由read_data命令读入。随机生成蓝色小球,数量可以任意设置。
在模拟过程中,聚合物链可以任意移动,蓝色小球固定不动。
当小球数量较少时,聚合物链移动不受影响,当蓝色球数量较多时,聚合物链移动受阻,类似于“走迷宫”。
代码已经全部注释,以供参考。
#自定义蓝色小球添加数量
variable npart equal 10
#模拟参数
dimension 2
units lj
atom_style molecular
boundary p p p
#近邻定义
neighbor 2.0 bin
neigh_modify every