1.lammps的代碼如下:
region 1 block -0 50 0 50 0 50 units box side in #創建區域
#創建一個長方體區域,名稱為1,坐標的單位就與命令units說指定的距離單位相同
create_box 2 1 &
bond/types 1 &
angle/types 1 &
extra/bond/per/atom 2 &
extra/angle/per/atom 1 &
extra/special/per/atom 2
#在區域1里邊創建一個box,設定該box支持多少種原子類型、鍵類型、角類型和每個原子包含鍵和角的類型。
molecule h2omol spc.mol #額外准備一個spc.mol文件
lattice sc 5 #晶格常數設定為5,如果是4,則生成的原子數會更加多。代表每隔5A生成一個水分子
create_atoms 1 region 1 mol h2omol 1234 units box
#create_atoms 0 random 2000 1234 1 mol h2omol 1234 units box #這個命令生成的水分子會發生重疊,計算易出錯。
2.如何計算生成水分子的個數呢?
如上的代碼,晶格常數sc為5,那么相當於一個水分子在盒子中所占的體積是5*5*5=125 A3。
所創建的region的體積(水盒子的體積)為50*50*50=125*1000,
水盒子的體積 / 一個水分子在盒子中的體積 = 水分子的個數。
如上代碼可以生成1000個水分子,即3000個原子。
3.一個有各種水模型的data文件和力場文件 http://www.orsi.sems.qmul.ac.uk/downloads.html
1.spc.mol文件的內容下入:
# SPCE 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
2 1 1 0
3 1 1 0
Special Bonds
1 2 3
2 1 3
3 1 2
2.tip4p/2005.mol如下:
# tip4p/2005 molecule file.
3 atoms
2 bonds
1 angles
Coords
1 1.55000 1.55000 1.50000
2 1.55000 2.30695 2.08588
3 1.55000 0.79305 2.08588
Types
1 1
2 2
3 2
Charges
1 -1.1128
2 0.5564
3 0.5564
Bonds
1 1 1 2
2 1 1 3
Angles
1 1 2 1 3