专栏名称: 材料人
分享材料领域内新闻资讯,材料人网原创文章以及公告。
目录
相关文章推荐
无线徐州  ·  后天查成绩!复试攻略都在这儿了→ ·  8 小时前  
无线徐州  ·  后天查成绩!复试攻略都在这儿了→ ·  8 小时前  
51好读  ›  专栏  ›  材料人

#计算专栏#液体水模拟:怎么用lammps建立水分子模型

材料人  · 公众号  ·  · 2021-01-07 09:01

正文

本文系材料人网lammps干货分享专栏供稿,欢迎点击原文链接或扫描文末二维码订阅。
水分子建模的方法有很多,比如可以用Material Studio、Packmol等辅助建模软件建立水或者冰结构模型,但是有些情况不能借助于其他软件建立水分子模型,比如使用氧气分子冲击靶材时,怎么建立氧气分子模型呢?因此本例中展示不借助其他辅助软件,只用lammps软件实现水分子模型的建立。学会此方法,不仅可以更加方便的建立模型,还能够更加熟练的掌握lammps的建模技巧。

本例中所需要的输入文件包括,水分子文件(H2O.txt)和模拟文件(in)。
in文件内容如下:
# global model settings
units           real
atom_style      full
boundary        p p p
pair_style      lj/cut/coul/long  14
pair_modify     mix arithmetic tail yes
kspace_style    ewald 0.0001
bond_style      harmonic
angle_style     harmonic

# box, start molecules on simple cubic lattice
lattice         sc 3.2
region          box block 0 10 0 10 0 10
create_box      2 box                       &
bond/types 1                &
angle/types 1               &
extra/bond/per/atom 2       &
extra/angle/per/atom 1      &
extra/special/per/atom 2
molecule        h2omol H2O.txt
create_atoms    0 box mol h2omol 456 units box

# rigid SPC/E water model
pair_coeff      1 1 0.15535 3.166
pair_coeff      * 2 0.0000 0.0000
bond_coeff      1     1000       1.0
angle_coeff     1      100       109.47

# masses
mass 1 15.9994
mass 2 1.0

# MD settings
thermo          100
thermo_style    custom step temp pe etotal press vol pxx pyy pzz enthalpy lx ly lz
group           h2o type 1 2
neighbor        2.0 bin
neigh_modify    every 1 delay 1 check yes
velocity        all create 300.0 54654
timestep        1.0
minimize        1e-6 1e-8 10000 10000
reset_timestep  0

dump            dump all custom 1000 dump.lammpstrj id type x y z
# rigid constraints with thermostat
fix             wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol
fix             MD  h2o npt temp 300.0 300.0 100 iso 1.0 1.0 1000.0
run             10000

H2O.txt内容如下:
# H2O molecule file.
3 atoms
2 bonds
1 angles
Coords
1    1.12456   0.09298   1.27452
2    1.53683   0.75606   1.89928
3    0.49482   0.56390   0.65678
Types
1        1
2        2
3        2
Charges
1       -0.8472
2        0.4236
3        0.4236
Bonds
1   1      1      2
2   1      1      3
Angles
1   1      2      1      3
Shake Flags
1 1
2 1
3 1
Shake Atoms
1 1 2 3
2 1 2 3
3 1 2 3
Shake Bond Types
1 1 1 1
2 1 1 1
3 1 1 1
Special Bond Counts
1 2 0 0






请到「今天看啥」查看全文