计算化学公社

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

[Lammps] LAMMPS GPU包加速下CO₂–壁面相互作用出现能量突变与bond lost错误

[复制链接 Copy URL]

2

帖子

0

威望

37

eV
积分
39

Level 2 能力者

各位老师好,我在进行 CO₂ 驱替烷烃体系的分子动力学模拟 时遇到了稳定性问题。
模拟体系包括石英孔壁、烷烃以及CO₂,使用的力场与软件环境如下:
  • CO₂: EPM2
  • 石英: CLAYFF
  • 烷烃: GAFF2
  • 软件版本: LAMMPS (22 Jul 2025)
  • 加速方式: GPU包


模拟设置概述:
边界条件: p p p
pair_style: lj/cut/coul/long 10.0 14.0
kspace_style: pppm 5.0e-5
积分步长: timestep 1.0
恒温器: NVT (T = 330 K)
驱替方式: 通过对上下游活塞(wall groups)施加不同方向的恒定力实现压力差驱替(200 atm vs. 50 atm)

具体问题:
在GPU加速的计算中,模拟运行到一定时间后,体系出现能量突增(energy spike),随后发生“bond lost”错误,导致CO₂分子解体、体系“爆炸”。
通过对崩溃前的 restart 文件重算,发现:

  • 崩溃前出现 CO₂ 分子速度极大化(velocity spike)
  • 增大 CO₂–壁面之间 LJ 平衡距离(通过调整 ε 和 σ 参数)未能解决问题
  • 关闭 GPU 加速(纯 CPU 计算)后,体系可以安全跨过该时刻
  • 同时观察到:库伦截断距离 (cutoff) 越大,体系越容易崩溃,但 GPU 利用率随 cutoff 增大而提升。


相关in文件:
  1. units real
  2. dimension 3
  3. boundary p p p
  4. atom_style full
  5. bond_style harmonic
  6. pair_style lj/cut/coul/long 10.0 14.0
  7. angle_style harmonic
  8. dihedral_style fourier
  9. special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.8333
  10. kspace_style pppm 5.0e-5
  11. pair_modify mix arithmetic

  12. read_data combined_system.data
  13. include combined_system.in.settings
  14. change_box all z final -150 700.0

  15. # groups
  16. group upper_wall id 213292:230217
  17. group lower_wall id 230218:247143
  18. group mobile subtract all upper_wall lower_wall freeze_group
  19. group oil type 1 2
  20. group CO2 type 8 9
  21. group quartz_surface subtract mobile oil CO2
  22. group liquid union oil CO2

  23. neighbor 2.5 bin
  24. neigh_modify delay 0 every 1 check yes one 4000

  25. velocity mobile create 330.0 12345 dist gaussian
  26. fix thermo_liquid liquid nvt temp 330.0 330.0 100.0
  27. fix thermo_surface quartz_surface nvt temp 330.0 330.0 100.0
  28. fix freeze_atoms freeze_group setforce 0.0 0.0 0.0

  29. # piston forces
  30. variable area equal "111.32 * 114.01"
  31. variable P_hi equal 200.0
  32. variable P_lo equal 50.0
  33. variable P2F equal 1.4583e-5
  34. variable F_hi_final equal "-v_P_hi * v_area * v_P2F"
  35. variable F_lo_final equal "v_P_lo * v_area * v_P2F"

  36. variable N_hi equal count(upper_wall)
  37. variable N_lo equal count(lower_wall)
  38. variable f_hi_per_atom equal v_F_hi_final/v_N_hi
  39. variable f_lo_per_atom equal v_F_lo_final/v_N_lo

  40. fix f_force_hi_ramp upper_wall addforce 0.0 0.0 v_f_hi_per_atom
  41. fix f_force_lo_ramp lower_wall addforce 0.0 0.0 v_f_lo_per_atom
  42. fix wall all_walls nve

  43. run 2000000
复制代码
已尝试的解决方法
  • 调整 LJ 参数(增加壁面与 CO₂ 的平衡距离)→ 仍出现爆炸;
  • 减小库伦 cutoff → 稳定性提升,但 GPU 利用率下降;
  • 关闭 GPU 包 → 体系稳定运行。


202510280914076328..png (80.87 KB, 下载次数 Times of downloads: 1)

模拟过程爆炸情况

模拟过程爆炸情况

202510280912581429..png (116.33 KB, 下载次数 Times of downloads: 0)

模拟爆炸前

模拟爆炸前

2

帖子

0

威望

35

eV
积分
37

Level 2 能力者

2#
发表于 Post on 2025-10-28 14:25:31 | 只看该作者 Only view this author
个人感觉跟用了GPU加速关系不大,关键还是模拟不够稳定导致的,但从描述来看也没有出现构型很不合理的(也可能是图太小了or截图不完整)。直接用刚性的CO2和CH4力场就可以了吧,不仅不会出现lost bond还不会被审稿人挑刺(我之前用非刚性的力场被审稿人质疑timestep太大),非要用bond力场的话timestep得取<1.0 fs,用run_style respa 2 2计算。

2

帖子

0

威望

37

eV
积分
39

Level 2 能力者

3#
 楼主 Author| 发表于 Post on 2025-10-28 15:46:53 | 只看该作者 Only view this author
TROBRIZE 发表于 2025-10-28 14:25
个人感觉跟用了GPU加速关系不大,关键还是模拟不够稳定导致的,但从描述来看也没有出现构型很不合理的(也 ...

感谢回复,这里主要烷烃不是纯甲烷,更长的烷烃将C-H键固定好像不太合适吧

2

帖子

0

威望

35

eV
积分
37

Level 2 能力者

4#
发表于 Post on 2025-10-28 20:00:39 | 只看该作者 Only view this author
本帖最后由 TROBRIZE 于 2025-10-28 20:08 编辑
c2jeremy 发表于 2025-10-28 15:46
感谢回复,这里主要烷烃不是纯甲烷,更长的烷烃将C-H键固定好像不太合适吧

抱歉没看清楚以为是甲烷……烷烃的话就只能先试试用respa跑到稳定构象了。不过我感觉CO2密度是不是太大了,如果不是做临界态的话密度改小点试试?或者活塞压力改小一点试试。

本版积分规则 Credits rule

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

GMT+8, 2026-1-25 07:33 , Processed in 0.167319 second(s), 23 queries , Gzip On.

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