LAMMPS 专题

LAMMPS SRD 与非球形动力学

用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。

更新于 2026-11-18约 6 分钟阅读按任务与环境选择适用配置
阅读本篇目录

下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 7 个已完成条件,按输入保留相互作用与操作参数。

选择条件#

解压并进入 lammps-srd-asphere-dynamics-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。

条件目录 主要样式 运行模式
SRD-sphere-mixture pair_style lj/cut, fix nve, fix enforce2d, fix srd, compute temp, dump custom gpu
SRD-pure fix srd, fix enforce2d, dump custom gpu
separate-shear-and-strict-walls-tri-SRD-compress-shear pair_style lj/cut, pair_style tri/lj, fix rigid/small, fix srd, compute temp/deform, compute temp, compute erotate/asphere, compute ke, compute pe, compute property/atom, fix deform, dump custom gpu
separate-shear-and-strict-walls-line-SRD-compress-shear pair_style lj/cut, pair_style line/lj, fix rigid, fix srd, fix enforce2d, compute temp/deform, compute temp, compute erotate/asphere, compute ke, compute pe, compute property/atom, fix deform, dump custom gpu
separate-shear-and-strict-walls-line-implicit-compress-shear pair_style line/lj, fix rigid, fix enforce2d, compute property/atom, compute erotate/asphere, compute ke, compute pe, fix deform, dump custom gpu
thermal-channel-walls-SRD-wall-slip fix wall/srd, fix srd, fix enforce2d, dump custom gpu
thermal-channel-walls-SRD-wall-noslip fix wall/srd, fix srd, fix enforce2d, dump custom gpu

输入与提交#

第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。

# 2d SRD test: big + small particles

units		lj
atom_style	sphere
atom_modify	first big
dimension	2

# create big particles with sigma 1.0

lattice		sq 0.4
region		box block 0 10 0 10 -0.5 0.5
create_box	2 box
create_atoms	1 region box
set		type 1 mass 1.0
set		type 1 diameter 1.0

group		big type 1
velocity	big create 1.44 87287 loop geom

# equilibrate big particles

pair_style	lj/cut 2.5
pair_coeff	1 1 1.0 1.0
pair_coeff	2 2 0.0 1.0 0.0
pair_coeff	1 2 0.0 1.0 0.0

neighbor	0.3 bin
neigh_modify	delay 0 every 1 check yes

fix		1 big nve
fix		2 all enforce2d

run		1000

unfix		1
unfix		2

# add small particles as hi density lattice

lattice		sq 0.4
region		plane block 0 10 0 10 -0.001 0.001
lattice		sq 85.0
create_atoms	2 region plane
set		type 2 mass 0.01
set		type 2 diameter 0.0

group		small type 2

velocity	small create 1.0 593849 loop geom

# delete overlaps
# must set 1-2 cutoff to non-zero value

pair_style	lj/cut 2.5
pair_coeff	1 1 1.0 1.0
# 完整输入见附件

在附件根目录提交第一组或所选条件。

sbatch --array=0 run.slurm
# 按 CASES 的完整列表提交
sbatch run.slurm

脚本申请一个 MPI 任务、一个 CPU 核和一张 P100,根据 MODES 加载对应模块。实际调用保存在 cases.json,例如第一组的命令参数为:

lmp -k off -pk omp 1 -echo both -in in.lammps > native.out

查看输出#

结果写入 work-new/条件名。先查看日志中的实际热力学表与结束信息。

cd work-new/SRD-sphere-mixture
tail -n 35 native.out

本次第一组的原生日志片段如下。

   Step          Temp          E_pair         E_mol          TotEng         Press     
Loop time of 0.0139316 on 2 procs for 1000 steps with 100 atoms
   Step          Temp          f_2[7]         TotEng        v_pebig         v_ebig         Press          f_2[1]         f_2[2]         f_2[3]         f_2[4]         f_2[5]         f_2[6]         f_2[8]         f_2[9]        f_2[10]    
Loop time of 1.64842 on 2 procs for 5000 steps with 14716 atoms
Total wall time: 0:00:01

原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 final.data。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。

再次运行前,将已有的同名 work-new 条件目录改名保存。

本次输出示例#

第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。

   Step          Temp          E_pair         E_mol          TotEng         Press     
         0   1.44          -0.54272        0              0.88288       -0.041088     
      1000   1.8791467     -0.97185784     0              0.8884974      0.61487657   
Loop time of 0.0139316 on 2 procs for 1000 steps with 100 atoms
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

放大后可滚动查看细节,按 Esc 关闭。

100%查看原图 ↗