網頁

2019年9月10日 星期二

A reactive force field implementation in LAMMPS

LAMMPS在reax範例中的input腳本(in.CHO)
https://github.com/lammps/lammps/blob/master/examples/reax/CHO/in.CHO

# REAX potential for CHO system
# .....
units  real
atom_style charge

read_data data.CHO

pair_style reax/c lmp_control
pair_coeff * * ffield.reax.cho H C O

neighbor 2 bin
neigh_modify every 10 delay 0 check no

fix  1 all nve
fix             2 all qeq/reax 1 0.0 10.0 1e-6 param.qeq
fix             3 all temp/berendsen 500.0 500.0 100.0

timestep 0.25

#dump  1 all atom 30 dump.reax.cho

run  3000

其中data檔(data.CHO)為
https://github.com/lammps/lammps/blob/master/examples/reax/CHO/data.CHO

# CHO example

105 atoms
3 atom types

0 25.000 xlo xhi
0 25.000 ylo yhi
0 25.000 zlo zhi

Masses

1 1.0080
2 12.0107
3 15.9994

Atoms

   1 2 0.0 10.67229  14.36836  12.47166
   2 1 0.0 11.02446  14.91550  13.35233
   3 1 0.0 11.02446  14.91549  11.59096
   4 1 0.0  9.57932  14.41980  12.47166
   5 2 0.0 11.17534  12.87608  12.47165
   6 1 0.0 10.79792  12.33546  13.34037
   7 1 0.0 10.79790  12.33545  11.60294
   8 2 0.0 12.75013  12.93134  12.47163
   9 1 0.0 13.13241  13.47175  11.60486
  10 1 0.0 13.13241  13.47210  13.33818
  11 2 0.0 13.22294  11.42815  12.47199
  12 1 0.0 12.83858  10.89166  11.60377
  13 1 0.0 12.83959  10.89255  13.34119
  14 2 0.0 14.79762  11.45137  12.47107
  15 1 0.0 15.21044  10.43808  12.47354
  16 1 0.0 15.19550  11.96345  11.58877
  17 1 0.0 15.19648  11.96815  13.35018
  18 2 0.0  0.24250   0.91354   1.10383
  19 1 0.0  0.97225   1.67509   1.39797
  20 1 0.0 24.87363   1.18825   0.11010
  21 1 0.0 24.39847   0.98637   1.79630
  22 2 0.0  0.86944  24.46895   1.11508
  23 1 0.0  1.21047  24.19771   2.11484
  24 1 0.0  0.12679  23.71752   0.84453
  25 2 0.0  2.06454  24.48829   0.08825
  26 1 0.0  1.72846  24.75977  24.08683
  27 1 0.0  2.80951   0.23920   0.35408
  28 2 0.0  2.67036  23.03401   0.12171
  29 1 0.0  1.92204  22.28680  24.85503
  30 1 0.0  3.00638  22.76782   1.12450
  31 2 0.0  3.87027  23.02208  24.10132
  32 1 0.0  4.35176  22.04072  24.06515
  33 1 0.0  3.54082  23.26189  23.08511
  34 1 0.0  4.63935  23.75310  24.37121
  35 2 0.0  1.37929  14.62909  17.52744
  36 1 0.0  1.08393  15.52196  18.08818
  37 1 0.0  2.47385  14.59977  17.52258
  38 1 0.0  1.05260  14.77122  16.49293
  39 2 0.0  0.76275  13.31937  18.14786
  40 1 0.0 24.67295  13.35030  18.12450
  41 1 0.0  1.04396  12.44064  17.56651
  42 2 0.0  1.30113  13.22425  19.62581
  43 1 0.0  2.39107  13.19385  19.65447
  44 1 0.0  1.02336  14.10169  20.21106
  45 2 0.0  0.66878  11.90830  20.21883
  46 1 0.0  0.94960  11.03396  19.63080
  47 1 0.0 24.57945  11.94426  20.18968
  48 2 0.0  1.19125  11.78568  21.69954
  49 1 0.0  0.79365  10.89123  22.18875
  50 1 0.0  2.28374  11.72162  21.74071
  51 1 0.0  0.89616  12.64769  22.30679
  52 2 0.0 11.41750   7.16471  22.76002
  53 1 0.0 11.74866   7.28340  21.72336
  54 1 0.0 11.72154   8.06612  23.30055
  55 1 0.0 11.97469   6.32478  23.18558
  56 2 0.0  9.86319   6.92474  22.85179
  57 1 0.0  9.57626   6.01094  22.33031
  58 1 0.0  9.54930   6.78307  23.88660
  59 2 0.0  9.17390   8.18942  22.21244
  60 1 0.0  9.45849   9.10599  22.73021
  61 1 0.0  9.48557   8.33580  21.17777
  62 2 0.0  7.62459   7.92132  22.31840
  63 1 0.0  7.31756   7.77569  23.35472
  64 1 0.0  7.34468   7.00469  21.79795
  65 2 0.0  6.90692   9.17258  21.68631
  66 1 0.0  5.81845   9.06496  21.71809
  67 1 0.0  7.15914  10.09632  22.21721
  68 1 0.0  7.18992   9.31630  20.63835
  69 2 0.0  4.69047  14.13340  23.48572
  70 1 0.0  4.95366  15.17281  23.26391
  71 1 0.0  5.39163  13.78010  24.24888
  72 1 0.0  4.87514  13.55000  22.57874
  73 2 0.0  3.19477  13.99798  23.95930
  74 1 0.0  2.50599  14.33002  23.18163
  75 1 0.0  2.93803  12.95591  24.15345
  76 2 0.0  3.05322  14.87431   0.26136
  77 1 0.0  3.74058  14.54651   1.04202
  78 1 0.0  3.30993  15.91730   0.07257
  79 2 0.0  1.55058  14.71961   0.71013
  80 1 0.0  1.29864  13.67531   0.89801
  81 1 0.0  0.86725  15.05003  24.92701
  82 2 0.0  1.37850  15.58633   2.01380
  83 1 0.0  0.35341  15.53527   2.39297
  84 1 0.0  2.04062  15.24695   2.81709
  85 1 0.0  1.60704  16.64178   1.83261
  86 3 0.0  8.51658  13.05007  22.43728
  87 3 0.0  9.43965  13.72051  21.88842
  88 3 0.0 18.16518   4.73455   8.81928
  89 3 0.0 18.65469   4.57291   7.66370
  90 3 0.0  6.43553  20.34119  24.80049
  91 3 0.0  6.44898  20.31621  23.53493
  92 3 0.0 21.90539  11.54301  19.82384
  93 3 0.0 20.76137  11.61918  20.36007
  94 3 0.0  3.42232  11.07545   5.77130
  95 3 0.0  3.88671  10.95299   4.60048
  96 3 0.0 11.93988   4.94134  20.86058
  97 3 0.0 12.98804   5.47798  20.39555
  98 3 0.0 14.08646   9.50799  20.80806
  99 3 0.0 14.09449  10.68237  20.33642
 100 3 0.0  3.45246  19.93144  16.38965
 101 3 0.0  2.86282  19.60263  15.31936
 102 3 0.0 12.85008  21.95287  13.63796
 103 3 0.0 12.06593  21.16486  14.24238
 104 3 0.0 24.47055   7.42219  14.24997
 105 3 0.0 24.43181   7.37102  12.98624

reax的建模需要注意的是units選取real,atom_style為charge

units  real
atom_style charge

讀取模型的數據文件,可以嘗試用MS輸出car格式,利用LAMMPS中的msi2lmp工具轉化為所需的數據文件

read_data data.CHO

接著選取potential類型,注意pair_style和pair_coeff應在read_data或create_box後

pair_style reax/c lmp_control
pair_coeff * * ffield.reax.cho H C O


neighbor 2 bin
neigh_modify every 10 delay 0 check no

上述命令中lmp_control為控製文件,用於控制輸出軌跡文件trj,若無需要可將其替換為NULL

ffield.reax.cho存放在Lammps的potential資料夾
https://github.com/lammps/lammps/tree/master/potentials
,在使用其他系統時,可以選用ADF軟件中的potential文件(可以直接使用)。

fix  1 all nve
fix             2 all qeq/reax 1 0.0 10.0 1e-6 param.qeq
fix             3 all temp/berendsen 500.0 500.0 100.0

對於reax的分子動力學模擬,必須有電荷守恆條件(fix qeq / reax),其中param.qeq存放所需原子的參數,從左到右分別為原子類型,電負性(eV),自庫倫勢,軌道指數

1 5.3200 14.8732 1.0206
2 5.8678 14.0000 0.9000
3 8.5000 17.9978 1.0503

上述數值也存在於potential文件中,因此可以將param.qeq替換為REAX/ C,如下圖所示:


其次在進行模擬時,一般可以選用NVT,如果系統分子個數比較少,應增大溫度加快反應進程(去掉fix 1和fix 3改為)

fix           1 all nvt temp 3500.0 3500.0 100.0

reax的分子動力學模擬,time step應在0.1-1.0之間,一般選取0.25

timestep 0.25

執行後若要製作動畫,應生成dump文件

dump        1 all custom mass type xs ys zs fx fy fz

畫圖檔指令

topo readlammpsdata data.CHO charge

沒有留言:

張貼留言