|
LAMMPS讲解27-乙醇水溶液液滴-moltemplate结合packmol建模moltemplate可以结合packmol进行建模。很方便,但是有几个细节需要注意。在lt文件的atom定义部分和xyz或pdb文件中原子顺序要一致。system.lt中import的顺序要和mix.inp文件中xyz或pdb文件的顺序一样。后面system.lt阵列的时候也要按照import的顺序。参考后面的各个文件就可以照猫画虎生成自己的data文件。 写好各个文件后首先执行 packmol < mix.inp 将生成的system.xyz拷贝到lt文件所在的目录下然后执行 moltemplate.sh -atomstyle "full" -xyz system.xyz system.lt 由于乙醇是调用oplsaa力场生成的,moltemplate会把所有的oplsaa中的type都写到data文件中,因此还需要执行 cleanup_moltemplate.sh 由此就完成了data文件 下面是各个文件 wat.lt: wat {
write("Data Atoms") { $atom:O $mol:. @atom:O -0.8476 0.000000000 0.00000 0.000000 $atom:H1 $mol:. @atom:H 0.4238 -0.816490431 0.00000 0.57735867 $atom:H2 $mol:. @atom:H 0.4238 0.816490431 0.00000 0.57735867 }
write_once("Data Masses") { @atom:O 15.9994 @atom:H 1.008 }
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("In Settings") { bond_coeff @bond:OH 600.0 1.0 angle_coeff @angle:HOH 75.0 109.47 pair_coeff @atom:O @atom:O 0.1553 3.166 pair_coeff @atom:H @atom:H 0.0 0.0 group spce type @atom:O @atom:H fix fShakeSPCE spce shake 0.0001 10 100 b @bond:OH a @angle:HOH }
write_once("In Init") { units real atom_style full pair_style lj/cut/coul/long 9.0 bond_style harmonic angle_style harmonic kspace_style pppm 0.0001 }
} yichun.lt: import oplsaa.lt
yichun inherits OPLSAA {
# atom-id mol-id atom-type charge x y z
write("Data Atoms") {
$atom:c1 $mol:... @atom:80 0.0 1.000 1.00000 0.00000 $atom:c2 $mol:... @atom:99 0.0 -0.515 1.00000 0.00000 $atom:o $mol:... @atom:96 0.0 -0.999 1.00000 1.33488 $atom:h1 $mol:... @atom:85 0.0 1.390 1.00129 -1.02181 $atom:h2 $mol:... @atom:85 0.0 1.387 0.11898 0.52261 $atom:h3 $mol:... @atom:85 0.0 1.385 1.87982 0.52630 $atom:h4 $mol:... @atom:85 0.0 -0.907 0.11841 -0.51618 $atom:h5 $mol:... @atom:85 0.0 -0.897 1.89393 -0.50150 $atom:h6 $mol:... @atom:97 0.0 -0.661 0.19796 1.76839 }
write('Data Bond List') { $bond:cc $atom:c1 $atom:c2 $bond:co $atom:c2 $atom:o $bond:ch1 $atom:c1 $atom:h1 $bond:ch2 $atom:c1 $atom:h2 $bond:ch3 $atom:c1 $atom:h3 $bond:ch4 $atom:c2 $atom:h4 $bond:ch5 $atom:c2 $atom:h5 $bond:oh $atom:o $atom:h6 }
} system.lt: import "wat.lt" import "yichun.lt"
# Periodic boundary conditions: write_once("Data Boundary") { 0.0 100 xlo xhi 0.0 100 ylo yhi 0.0 100 zlo zhi }
# Generate an array of 864 = 12 x 12 x 6 Butane molecules # which (more or less) uniformly fills the simulation box:
WAT = new wat [10].move(0, 0, 5.2) [10].move(0, 5.2, 0) [10].move(10.4, 0, 0)
YICHUN = new yichun [10].move(0, 0, 5.2) [10].move(0, 5.2, 0) [10].move(10.4, 0, 0)
wat.xyz: 3 water O 0.000000000 0.00000 0.000000 H -0.816490431 0.00000 0.57735867 H 0.816490431 0.00000 0.57735867
yichun.xyz:
9 yichun c1 1.000 1.00000 0.00000 c2 -0.515 1.00000 0.00000 o -0.999 1.00000 1.33488 h1 1.390 1.00129 -1.02181 h2 1.387 0.11898 0.52261 h3 1.385 1.87982 0.52630 h4 -0.907 0.11841 -0.51618 h5 -0.897 1.89393 -0.50150 h6 -0.661 0.19796 1.76839
mix.inp: tolerance 4.0
seed 12345
filetype xyz
output system.xyz
structure wat.xyz number 1000 inside sphere 50 50 50 40 end structure
structure yichun.xyz number 1000 inside sphere 50 50 50 40 end structure
感谢鲍路瑶老师的分享,内容来自于鲍老师分享出来的资料 如有需要添加微信:lmp_zhushou 进入微信群,帮助他人,共建社区 获取完整版lammps讲义可以加微信lmp_zhushou或加入QQ群994359511 |