计算化学公社

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

[Lammps] LAMMPS分析固液体系中溶液离子MSD起始时刻MSD不为0的问题

[复制链接 Copy URL]

6

帖子

0

威望

73

eV
积分
79

Level 2 能力者

体系是上层为溶液,下层基底为固体,利用LAMMPS想要计算溶液中离子自运行100wstep后的MSD,因此lammps中的输入文件为运行100w步后的restart.文件,LAMMPS manual关于msd命令说是“The displacement of an atom is from its reference position. This is normally the original position at the time the compute command was issued, unless the average keyword is set to yes. ”将命令发出时刻的原子位置作为起始参考位置,所以MSD应该起始时刻应该是0,但我计算后的结果起始时刻的MSD不为零,并且此时的MSD数值对应的是把最初0step时的位置作为起始参考位置所得到的值,而不是把我输入的100wstep文件作为起始位置,想问下大家是什么原因呢?
以下是我的lammps code,我是将溶液中的离子按照距离表面的距离分到了不同的group里分别计算MSD,最后再附上其中一个group的MSD计算结果图:
  1. #Basic setup
  2. units                real
  3. boundary             p p p
  4. atom_style           full
  5. bond_style           harmonic
  6. angle_style          harmonic
  7. pair_style           lj/cut/coul/long 12.5
  8. timestep             1   
  9. neighbor             2 bin
  10. neigh_modify         every 2 delay 0 check yes one 3000

  11. #Structure
  12. read_restart         restart.1000000
  13. pair_modify          mix arithmetic
  14. kspace_style         ewald  1.0e-4   


  15. #Solution atom group
  16. group                Na  type 5
  17. group                O*  type 7
  18. group                h*  type 8
  19. group                Cu  type 10
  20. group                Cl  type 9

  21. #N-A-S-H group
  22. group                Al  type 2
  23. group                Si  type 1
  24. group                O   type 3 4
  25. group                H   type 6                 
  26. group                Geopolymer union Al Si O H Na
  27. group                Solution subtract all Geopolymer

  28. #divide the system into surface and solution part
  29. region              surface_part block INF INF INF INF 22 30 units box
  30. group               Surface_atom region surface_part

  31. region              solution_part_1 block INF INF INF INF 30 35 units box
  32. group               Solution_atom_1 region solution_part_1

  33. region              solution_part_2 block INF INF INF INF 35 40 units box
  34. group               Solution_atom_2 region solution_part_2

  35. region              solution_part_3 block INF INF INF INF 40 45 units box
  36. group               Solution_atom_3 region solution_part_3

  37. region              solution_part_4 block INF INF INF INF 45 50 units box
  38. group               Solution_atom_4 region solution_part_4

  39. #puts the Cu atoms into different part
  40. group               Cu_surface intersect Surface_atom Cu
  41. group               Cu_solution_1 intersect Solution_atom_1 Cu
  42. group               Cu_solution_2 intersect Solution_atom_2 Cu
  43. group               Cu_solution_3 intersect Solution_atom_3 Cu
  44. group               Cu_solution_4 intersect Solution_atom_4 Cu

  45. #initial temperature
  46. velocity             all create 300 39849 mom yes rot yes dist gaussian

  47. #Thermo outputs
  48. thermo               100
  49. thermo_style         custom step temp pe ke

  50. #rising temperature
  51. fix                  1 all nvt temp 300 300 1

  52. #计算Cu离子的surface part MSD
  53. #modified code
  54. compute              MSD1 Cu_surface msd com yes
  55. fix                  2 Cu_surface ave/time 100 5 500 c_MSD1[1] c_MSD1[2] c_MSD1[3] c_MSD1[4] file Cu_msd_surface.data mode scalar

  56. #计算Cu离子的solution part MSD
  57. compute              MSD2 Cu_solution_1 msd com yes
  58. fix                  3 Cu_solution_1 ave/time 100 5 500 c_MSD2[1] c_MSD2[2] c_MSD2[3] c_MSD2[4] file Cu_msd_solution_1.data mode scalar

  59. #计算Cu离子的solution part MSD
  60. compute              MSD3 Cu_solution_2 msd com yes
  61. fix                  4 Cu_solution_2 ave/time 100 5 500 c_MSD3[1] c_MSD3[2] c_MSD3[3] c_MSD3[4] file Cu_msd_solution_2.data mode scalar

  62. #计算Cu离子的solution part MSD
  63. compute              MSD4 Cu_solution_3 msd com yes
  64. fix                  5 Cu_solution_3 ave/time 100 5 500 c_MSD4[1] c_MSD4[2] c_MSD4[3] c_MSD4[4] file Cu_msd_solution_3.data mode scalar

  65. #计算Cu离子的solution part MSD
  66. compute              MSD5 Cu_solution_4 msd com yes
  67. fix                  6 Cu_solution_4 ave/time 100 5 500 c_MSD5[1] c_MSD5[2] c_MSD5[3] c_MSD5[4] file Cu_msd_solution_4.data mode scalar

  68. #dump
  69. dump                 1 all custom 100000 A1.sputter id type x y z
  70. run                  1000000
  71. write_restart        restart.2000000
复制代码



202309131205297772..png (16.12 KB, 下载次数 Times of downloads: 40)

Cu_msd_solution_1

Cu_msd_solution_1

395

帖子

8

威望

3908

eV
积分
4463

Level 6 (一方通行)

石墨

2#
发表于 Post on 2023-9-13 15:23:27 | 只看该作者 Only view this author
restart文件只是为了中断续算的,里面的step定义是比较模糊的,特别是一次模拟中进行了多个过程时,建议用data文件。
最靠谱的算各种轨迹分析/能量分析...的方法是:
1、正常做一次模拟,读入data文件而不是restart文件
2、跑的时候不要compute MSD或者compute RDF等等分析,而是较高频次地输出轨迹
3、跑完了把轨迹rerun一遍,这不会动力学走步,而是对每步重算能量和结构、以及各种分析

假如500步输出一次轨迹,那么事后rerun的基础时间成本仅仅是1/500。加了各种分析之后,也只是把该耗的那些时间补上。
这样做的好处是简单化,避免“路径依赖”的歧义,也避免因为各种分析中途出错而导致耗时很长的主采样挂掉。

评分 Rate

参与人数
Participants 1
eV +4 收起 理由
Reason
Mingxin + 4 正解

查看全部评分 View all ratings

自在飞花轻似梦,无边丝雨细如愁。

全自动反应动力学(ReaxFF、AIMD、NEP等)后处理工具网页版:http://cc-portal.xyz/reax_tools

6

帖子

0

威望

73

eV
积分
79

Level 2 能力者

3#
 楼主 Author| 发表于 Post on 2023-9-13 17:17:40 | 只看该作者 Only view this author
Graphite 发表于 2023-9-13 15:23
restart文件只是为了中断续算的,里面的step定义是比较模糊的,特别是一次模拟中进行了多个过程时,建议用d ...

谢谢您的解答,看来之前是对restart文件的应用理解有偏差,更感谢您建议的分析流程!我之前的分析过程确实不规范,学习到了!

8

帖子

0

威望

110

eV
积分
118

Level 2 能力者

4#
发表于 Post on 2023-10-19 22:48:46 | 只看该作者 Only view this author
Graphite 发表于 2023-9-13 15:23
restart文件只是为了中断续算的,里面的step定义是比较模糊的,特别是一次模拟中进行了多个过程时,建议用d ...

您好,请问一下假如第一次输出轨迹的时候没有计算MSD、RDF等一些参数,那么在第二次在不输出轨迹文件以及不进行rerun的情况下专门去计算这些参数,这样的结果正确吗?

395

帖子

8

威望

3908

eV
积分
4463

Level 6 (一方通行)

石墨

5#
发表于 Post on 2023-10-20 16:25:50 | 只看该作者 Only view this author
zhaoxiaollong 发表于 2023-10-19 22:48
您好,请问一下假如第一次输出轨迹的时候没有计算MSD、RDF等一些参数,那么在第二次在不输出轨迹文件以及 ...

可以,和保存轨迹再算是一样的。
自在飞花轻似梦,无边丝雨细如愁。

全自动反应动力学(ReaxFF、AIMD、NEP等)后处理工具网页版:http://cc-portal.xyz/reax_tools

16

帖子

0

威望

282

eV
积分
298

Level 3 能力者

6#
发表于 Post on 2025-6-10 15:52:20 | 只看该作者 Only view this author
大佬,您的data文件是咋建立的?

本版积分规则 Credits rule

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

GMT+8, 2025-8-14 01:06 , Processed in 0.155592 second(s), 24 queries , Gzip On.

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