计算化学公社

 找回密码 Forget password
 注册 Register
Views: 12454|回复 Reply: 7
打印 Print 上一主题 Last thread 下一主题 Next thread

[Lammps] 求助,为什么用NVT模拟气液界面上水蒸发时得到压力为负数

[复制链接 Copy URL]

5

帖子

0

威望

109

eV
积分
114

Level 2 能力者

从官网下的in文件,得到的表面张力也不对。恳求各位看下哪出了问题。。

units real
atom_style full
read_data data.singleTIP4P-2005
include forcefield.TIP4P-2005
pair_modify tail no

replicate 20 20 20

variable xLo equal -0.5*lx
variable xHi equal 0.5*lx
variable yLo equal -0.5*ly
variable yHi equal 0.5*ly
variable zLo equal -0.5*lz
variable zHi equal 0.5*lz

# Recenter system coords about the origin (0,0,0):
displace_atoms all move ${xLo} ${yLo} ${zLo} units box

# Adjust box dimensions:
change_box all x final ${xLo} ${xHi} units box
change_box all y final ${yLo} ${yHi} units box
change_box all z final ${zLo} ${zHi} units box

# Increase z edge to yield "Vacuum|Water|Vacuum" system:
variable zLoNew equal -2.5*lz
variable zHiNew equal 2.5*lz
change_box all z final ${zLoNew} ${zHiNew} units box

variable Nblock equal 10000
variable Nrun equal 2.0*${Nblock}
# variable Ndump equal ${Nrun}/2
variable Ne equal 100
variable Nr equal ${Nblock}/${Ne}
variable Nf equal ${Nrun}
variable Dz equal 10

variable A_in_m equal 1e-10 # Angstrom in meter
variable atm_in_Pa equal 101325 # note: 1 Pa = 1 N/m^2
variable N_in_mN equal 1e3 # Newton in milliNewton
variable convFac equal ${A_in_m}*${atm_in_Pa}*${N_in_mN}

variable Text equal 340

group hydrogen type 1
group oxygen type 2

velocity all create ${Text} 12345

neighbor 2.0 bin
neigh_modify every 1 delay 0 check yes

timestep 2.0

# fix loadBalance all balance 20 z 5 1.05

fix constrain all shake 1.0e-4 100 0 b 1 a 1
fix integrate all nvt temp ${Text} ${Text} 200.0
fix removeMomentum all momentum 1 linear 1 1 1

compute T all temp
fix TAve all ave/time ${Ne} ${Nr} ${Nf} c_T

variable P equal press
fix PAve all ave/time ${Ne} ${Nr} ${Nf} v_P


variable xPress equal c_thermo_press[1]
variable yPress equal c_thermo_press[2]
variable zPress equal c_thermo_press[3]

# Evaluate and average surface tension in mN/m:
variable st equal 0.5*lz*(v_zPress-0.5*(v_xPress+v_yPress))*${convFac}
fix st all ave/time ${Ne} ${Nr} ${Nf} v_st

variable xyArea equal lx*ly

thermo_style custom step temp f_TAve press f_PAve v_xyArea lz f_st
thermo_modify flush yes
thermo ${Nrun}

compute A all chunk/atom bin/1d z center ${Dz} units box
fix massDensA all ave/chunk ${Ne} ${Nr} ${Nf} A density/mass &
    file massDensA.zProfile

dump trj all atom 100 wat.lammpstrj
dump_modify trj scale no sort id
dump 123 all custom 200 dump.h2o.lv.* id type x y z vx vy vz  c_A

run ${Nrun}




1569668432(1).png (9.28 KB, 下载次数 Times of downloads: 43)

1569668432(1).png

51

帖子

0

威望

729

eV
积分
780

Level 4 (黑子)

2#
发表于 Post on 2019-9-29 10:13:49 | 只看该作者 Only view this author
本帖最后由 灰天皮匠 于 2019-9-29 10:17 编辑

这个in文件看不太懂,倒是可以提一些建议。
1、看一下力场参数是不是不合适
2、搞清楚里面命令含义以及如何设置。就像timestep=2.0和nvt控温dt=200,别人是不是这样模拟的
3、输出文件dump中加入总能量看看
图片是lammps手册中关于压强公式的描述

press formula.png (237.32 KB, 下载次数 Times of downloads: 52)

press

press

5

帖子

0

威望

109

eV
积分
114

Level 2 能力者

3#
 楼主 Author| 发表于 Post on 2019-9-29 19:38:42 | 只看该作者 Only view this author
灰天皮匠 发表于 2019-9-29 10:13
这个in文件看不太懂,倒是可以提一些建议。
1、看一下力场参数是不是不合适
2、搞清楚里面命令含义以及如 ...

好的,我再看看,非常感谢。

209

帖子

0

威望

975

eV
积分
1184

Level 4 (黑子)

4#
发表于 Post on 2019-10-1 09:40:01 | 只看该作者 Only view this author
这个问题我没有做过,除了楼上上的建议我还有一个额外的看法,楼主有没有用其他系综看看计算结果,相变过程达到平衡态,两相的压力要相等,为何不用NPT系综呢

107

帖子

0

威望

467

eV
积分
574

Level 4 (黑子)

5#
发表于 Post on 2019-12-17 20:38:25 | 只看该作者 Only view this author
BQHY 发表于 2019-9-29 19:38
好的,我再看看,非常感谢。

老师您好,请问可以提供一下tip4p/2005.itp的水模型文件嘛?我最近也想用这个水模型,但是不知道从哪里可以找,谢谢老师!

5

帖子

0

威望

109

eV
积分
114

Level 2 能力者

6#
 楼主 Author| 发表于 Post on 2019-12-21 16:19:42 | 只看该作者 Only view this author
961106 发表于 2019-12-17 20:38
老师您好,请问可以提供一下tip4p/2005.itp的水模型文件嘛?我最近也想用这个水模型,但是不知道从哪里可 ...

我是在这个网站下的,你可以看看。http://www.orsi.sems.qmul.ac.uk/downloads.html

513

帖子

0

威望

4384

eV
积分
4897

Level 6 (一方通行)

truffle

7#
发表于 Post on 2019-12-21 16:38:29 | 只看该作者 Only view this author
Picardo 发表于 2019-10-1 09:40
这个问题我没有做过,除了楼上上的建议我还有一个额外的看法,楼主有没有用其他系综看看计算结果,相变过程 ...

NPT会不会直接把真空区压没了
No problem is insoluble in all conceivable circumstances.

107

帖子

0

威望

467

eV
积分
574

Level 4 (黑子)

8#
发表于 Post on 2020-1-3 09:36:44 | 只看该作者 Only view this author
BQHY 发表于 2019-12-21 16:19
我是在这个网站下的,你可以看看。http://www.orsi.sems.qmul.ac.uk/downloads.html

谢谢

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-2-20 00:05 , Processed in 0.209274 second(s), 23 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list