分子模拟水分子扩散系数计算教程LAMMPS

上传人:小鹤 文档编号:164235139 上传时间:2022-10-24 格式:DOCX 页数:6 大小:41.46KB
收藏 版权申诉 举报 下载
分子模拟水分子扩散系数计算教程LAMMPS_第1页
第1页 / 共6页
分子模拟水分子扩散系数计算教程LAMMPS_第2页
第2页 / 共6页
分子模拟水分子扩散系数计算教程LAMMPS_第3页
第3页 / 共6页
资源描述:

《分子模拟水分子扩散系数计算教程LAMMPS》由会员分享,可在线阅读,更多相关《分子模拟水分子扩散系数计算教程LAMMPS(6页珍藏版)》请在装配图网上搜索。

1、1. 基础理论扩散系数是衡量物质扩散程度的物理量,是表征物质传质的重要参数。自扩散系数是一个张量,在均相系统中通常取张量的对角线元素1D = _ (D + D + D )3 xx yy zzx y z表示方向,且D D D 三者相等。通常非对角线元素为0。xx yy zz分子模拟中,计算自扩散系数的方法比较常用的有Einstein equation和Green-Kubo equation。 此教程使用Einstein equation,即D 二_1_limd丄Xr(t)-r(0)2xx2Dim t* dtN丨,1i=1其中Dim是维度,r(t)即为i粒子t时刻的位置,N为粒子总数,尖括号表示系

2、综平均。其中 MSD =穆习叩)-ri(o)i2表示粒子的均方位移(Mean Square Displacement)。i=12. 模型构建模型构建使用的工具为: moltemplate一般在lammps/tools/目录下已有安装(参考了官网上的范例)需要的文件为spce.lt,包含水分子模型的参数System.lt,指定水分子的排列方式。# In moltemplate each molecule type is stored in a file whose format mimics the# format of a LAMMPS data file, with Atoms, Bonds

3、, and Angles sections.# Once defined, these molecules can be copied and moved to build larger systems.# SPCE (extended simple point charge) is one of several popular water models# (See Berendsen H.J.C et al., J.Phys.Chem. Vol91 pp.6269-6271,1987 for details)# file spce.lt# H1 H2# /#OSPCE # Definitio

4、n of the SPCE (water molecule type) # The Data Atoms section is a list of atom attributes (type, charge, x,y,z)write(Data Atoms) $atom:o $mol$atom:h1 $mol$atom:h2 $mol# AtomID MoleculeID AtomType Charge X Y Zatom:O -0.84760.0000000 0.00000 0.000000atom:H 0.4238 0.8164904 0.00000 0.5773590atom:H 0.42

5、38 -0.8164904 0.00000 0.5773590# Note: LAMMPS expects an integer in the 2nd column (the Molecule-ID number).#If we put $mol there, moltemplate will generate this integer for you# A list of the bonds in the molecule:# BondID BondType AtomID1 AtomID2write(Data Bonds) $bond:OH1 bond:OH $atom:o $atom:h1

6、$bond:OH2 bond:OH $atom:o $atom:h2# A list of the angles in the molecule:# AngleID AngleType AtomID1 AtomID2 AtomID3write(Data Angles) $angle:HOH angle:HOH $atom:h1 $atom:o $atom:h2# The mass of each atom type: write_once(Data Masses) atom:O 15.9994atom:H 1.008 # end of definition of SPCE water mole

7、cule type以及system.lt,创建模拟所需要的水分子盒子。import spce.lt # - This defines the SPCE water molecule.# Periodic boundary conditions: write_once(Data Boundary) 0.0 34.50 xlo xhi0.0 34.50 ylo yhi0.0 34.50 zlo zhi # The next command creates 1000 (10x10x10) copies of the SPCE water molecule# and arranges them in

8、a (rather dense) cubic lattice with# spacing 3.45 Angstroms. (The pressure must be equilibrated later.) wat = new SPCE 10.move(0.00, 0.00, 3.45)10.move(0.00, 3.45, 0.01)10.move(3.45, 0.01, 0.01) 运行:$ moltemplate.sh system.lt即可得到水分子的data文件:system.data。3. 参数设置以下为 in 文件:unitsreal#指定计算用的单位atom_stylefull

9、#data 文件的数据类型bond_styleharmonic#计算键能的方式angle_styleharmonic#计算键角相互作用的方式pair_stylelj/charmm/coul/long 9.0 10.0 10.0#非键相互作用的类型pair_modifymix arithmetic#非键相互作用的混合方法此范例所使用的LAMMPS版本为11 Aug 2017。运行LAMMPS所需的最基本文件为in文件,在in文件中也可以创建简单的结构模型。 此范例所需要的文件为in以及包含水分子模型的data文件。#计算长程库仑力的方式read_datasystem.data#读入结构文件bon

10、d_coeff11000.0 1.0#键参数angle_coeff11000.0 109.47#键角参数pair_coeff1 10.1553 3.166#O-O 非键相互作用pair_coeff2 20.0 2.058#H-H 非键相互作用group gSPCE type12#将 1, 2 原子设定为组fix fShakeSPCE gSPCE shake 0.0001 10 100 b 1 a 1#SHAKE 算法 令水分子为刚性kspace_style pppm 0.0001#时间步长#输出格式timestep 1.0dump 1 all custom 1000 traj.lammpstr

11、j id mol type q x y zdump_modify 1 sort id#按原子 id 排序fix fxnpt all npt temp 300.0 300.0 100.0 iso 1.0 1.0 1000.0 drag 1.0#npt 系综run 50000unfix fxnpt#解除 nptfix fxnvt all nvt temp 300.0 300.0 100.0#nvt 系综 nose-hoover 热浴thermo 100#log 文件中输出信息的频率compute msd gSPCE msd#计算 msdfix fxmsd gSPCE ave/time 1000 1

12、 1000 c_msd1 c_msd2 c_msd3 c_msd4 file msd.txt#输出 msdrun 600000#模拟时长可自行调整,此处为0.6 纳秒4. 运行模拟将 data 文件, in 文件放置在同一文件夹下,运行模拟。此处为 1000 个水分子,耗时较长。推荐使用并行计算。当然你也可以自行调整水分子的数 目以及模拟时长。5. 计算结果模拟得到水分子的MSD数据(msd.txt),将其作图。XXyyZZ01000-1S00-200-Slopexx=4.98217e-4Slopeyy=5.01173e-4Slopezz=5.35622e-41D0000 200000 300

13、000 400000 5DOOOO 600000 700000Time (fs)600-400-Slope=0.00154 totalFig. 水分子的 MSD 随时间变化因为xx,yy,zz三个方向扩散系数相同,因此我们取其斜率的平均值51167e - 4。此时维度为1,由Einstein关系我们可以得到扩散系数为5】167 e - 4/2 = 2558 e - 4A2/fs。即为 2558 e - 9m 2 / s 。总结1. 构建盒子时要保证密度的准确,因此先使用npt系综,再使用nvt系综来计算MSD。当 然也可以在创建盒子时直接给定密度(水分子均相密度为1gcm-3)。2. 保证模拟时长。3. 注意单位的换算。4. 不同水分子模型得到的扩散系数并不相同,此范例使用的是SPC/E水分子模型。

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!