|
LAMMPS讲解43-结合使用moltemplate和LAMMPS实现固体表面羟基化、接枝分子刷在进行LAMMPS模拟的时候经常会要求对固体表面进行羟基化。如果使用MS则需要建模后使用msi2lmp进行data文件转换。这个转换需要二次修改data文件中的type等,而且会出现各种各样意想不到的问题。这里提供一种新的方法,即使用moltemplate建模,然后利用LAMMPS中的fix bond/create 进行羟基化。这样方法可以完美地控制建模的质量。同时这是一种通用性很高的方法对于实现固体表面接枝官能团或接枝分子刷都是适用的。下面以铜表面的羟基化为例讲解建模过程。该模型同时也是水滴在羟基化铜表面的水滴润滑的模型。需要该模型的lt文件与in和data文件,请加微信lmp_zhushou获取。 建模思路是首先在moltemplate中建出铜块和铜块上部的排列整齐的羟基基团。建模需要编写三个lt文件,分别如下 OH.lt
oh { write("Data Atoms") { $atom:o $mol @atom:O -1.0 0.0000000 0.00000 10.0375 $atom:h $mol @atom:H 1.0 0.0000000 0.00000 11.0375 } write("Data Bonds") { $bond:OH @bond:OH $atom:o $atom:h } write_once("Data Masses") { @atom:O 15.9994 @atom:H 1.008 } write_once("In Settings") { bond_coeff @bond:OH 600.0 0.9572 pair_coeff @atom:O @atom:O 0.1550 3.1536 pair_coeff @atom:H @atom:H 0.0 0.0 } }
tip4p.lt
tip4p { write("Data Atoms") { $atom:o $mol @atom:O -1.040 0.0000000 0.00000 0.000000 $atom:h1 $mol @atom:H 0.520 0.75695 0.00000 0.585882 $atom:h2 $mol @atom:H 0.520 -0.75695 0.00000 0.585882 } write("Data Bonds") { $bond:OH1 @bond:OH $atom:o $atom:h1 $bond:OH2 @bond:OH $atom:o $atom:h2 } write("Data Angles") { $angle:HOH @angle:HOH $atom:h1 $atom:o $atom:h2 } write_once("Data Masses") { @atom:O 15.9994 @atom:H 1.008 } write_once("In Settings") { bond_coeff @bond:OH 600.0 0.9572 angle_coeff @angle:HOH 75.0 104.52 pair_coeff @atom:O @atom:O 0.1550 3.1536 pair_coeff @atom:H @atom:H 0.0 0.0 } write_once("In Init") { dimension 3 boundary p p p units real atom_style full bond_style harmonic angle_style harmonic pair_style lj/cut/tip4p/long 1 2 1 1 0.15 7.5 7.75 kspace_style pppm 0.0001 } }
system.lt
import "tip4p.lt" import "OH.lt" import "cu1.lt" write_once("Data Boundary") { 0.0 101.22 xlo xhi 0.0 101.22 ylo yhi -12 200.22 zlo zhi } wat = new tip4p [20].move(3.0, 0, 0) [20].move(0, 3.0, 0) [20].move(0, 0, 3.0) wat[*][*][*].move(20,20,70) cu1 = new cu1 [28].move(3.615, 0, 0) [28].move(0, 3.615, 0) [3].move(0, 0, 3.615) OH = new oh [14].move(7.23, 0, 0) [14].move(0, 7.23, 0) OH[*][*].move(0,0,1) 执行 moltemplate.sh -atomstyle "full" system.lt 生成如下模型
局部放大之后可以看到此时羟基和铜之间并没有键
此时需要使用LAMMPS的fix bond/create来创建键后写出data文件就是最终羟基化的铜表面。在运行LAMMPS的时候首先需要把data文件中的bond type的个数加一个以便生成新的bond。同时把system.in.settings中的参数拷贝到in文件后增加新添加的bond的bond_coeff。in文件如下 # ----------------- Init Section ----------------- boundary p p f atom_style full units real neighbor 3.0 bin neigh_modify every 1 delay 0 check yes bond_style harmonic angle_style harmonic pair_style lj/cut/tip4p/long 1 2 1 1 0.15 11.0 11.0 pair_modify mix geometric special_bonds lj/coul 0.0 0.0 0.5 kspace_style pppm/tip4p 0.0001 kspace_modify slab 3.0 # ----------------- Atom Definition Section ----------------- read_data system.data # ----------------- Settings Section ----------------- bond_coeff 1 600.0 0.9572 angle_coeff 1 75.0 104.52 pair_coeff 1 1 0.1550 3.1536 pair_coeff 2 2 0.0 0.0 bond_coeff 2 600.0 0.9572 bond_coeff 3 600.0 0.9572 #要创建的bond的参数 pair_coeff 3 3 0.1550 3.1536 pair_coeff 4 4 0.0 0.0 pair_coeff 5 5 0.0 0.0 # ----------------- Run Section ----------------- fix 5 all bond/create 1 3 5 1.1 3 prob 1.0 85784 iparam 1 3 jparam 1 5
thermo 1 thermo_style custom step f_5[1] f_5[2]
run 1 write_data system1.data
可以看到我们阵列了14*14个羟基,而正好生成了196个键,说明每个羟基都键结到了铜表面上。至此羟基化完成。新生成的data文件如下。可以看到羟基和铜之间的键。
感谢鲍路瑶老师的分享,内容来自于鲍老师分享出来的资料 如有需要添加微信:lmp_zhushou 进入微信群,帮助他人,共建社区 获取完整版lammps讲义可以加微信lmp_zhushou或加入QQ群994359511 |