LAMMPS 专题

LAMMPS RX 的 create_box 顺序

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

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

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

选择条件#

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

条件目录 主要样式 运行模式
p100-DPD-RX-rk4 pair_style hybrid/overlay, fix rx/kk, fix shardlow/kk, fix nve, fix eos/table/rx/kk, compute dpd, compute dpd/atom, compute property/atom, dump custom kokkos
p100-DPD-RX-rkf45 pair_style hybrid/overlay, fix rx/kk, fix shardlow/kk, fix nve, fix eos/table/rx/kk, compute dpd, compute dpd/atom, compute property/atom, dump custom kokkos
v100-DPD-RX-rkf45 pair_style hybrid/overlay, fix rx/kk, fix shardlow/kk, fix nve, fix eos/table/rx/kk, compute dpd, compute dpd/atom, compute property/atom, dump custom kokkos
v100-DPD-RX-rk4 pair_style hybrid/overlay, fix rx/kk, fix shardlow/kk, fix nve, fix eos/table/rx/kk, compute dpd, compute dpd/atom, compute property/atom, dump custom kokkos

输入与提交#

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

# Example for running DPD-RX

boundary        p p p
units           metal  # ev, ps
atom_style      dpd
atom_modify     map array

lattice         hcp 6.6520898 origin 0.0833333333333 0.25 0.25 orient z 1 0 0 orient x 0 1 0 orient y 0 0 1
region          box block 0 6.0 0 6.0 0.0 6.0 units lattice
create_box      2 box
fix             4 all rx/kk kinetics.dpdrx none dense lammps_rk4 1
region          atoms block 0 6.0 0 6.0 0.0 6.0 units lattice
create_atoms    1 region atoms

comm_modify     mode single vel yes
mass            * 222.12

#Set concentrations
set             atom * d_rdx 1.00
set             atom * d_h2 0.0
set             atom * d_no2 0.0
set             atom * d_n2 0.0
set             atom * d_hcn 0.0
set             atom * d_no 0.0
set             atom * d_h2o 0.0
set             atom * d_co 0.0
set             atom * d_co2 0.0

#Set the kinetic temperature of the particles
velocity        all create 2065.0 875661 dist gaussian loop geom

#Set the internal temperature of the particles
set             atom * dpd/theta 2065.00

timestep        0.001

pair_style      hybrid/overlay dpd/fdt/energy/kk 16.00 234324 exp6/rx/kk 16.00
pair_coeff      * * dpd/fdt/energy/kk 0.0 0.05 10.0 16.00
pair_coeff      * * exp6/rx/kk params.exp6 1fluid 1fluid exponent 1.0 1.0 16.00

fix             1 all shardlow/kk
fix             2 all nve
fix             3 all eos/table/rx/kk linear table.eos 4001 KEYWORD thermo.dpdrx

compute         dpdU all dpd
compute         dpdUatom all dpd/atom
compute         crdx all property/atom d_rdx

variable        totEnergy equal pe+c_dpdU[1]+c_dpdU[2]+c_dpdU[3]

thermo          1
thermo_style    custom step temp press vol pe ke c_dpdU[1] c_dpdU[2] c_dpdU[3] v_totEnergy c_dpdU[4] 
thermo_modify   format float %15.8f flush yes

dump            2 all custom 1 dump.dpdrx id x y z vx vy vz c_dpdUatom[1] c_dpdUatom[2] c_dpdUatom[3] c_dpdUatom[4] c_crdx
dump_modify     2 sort id

fix_modify      4 rx_chemistry off # Turning off reaction chemistry
run             10                 # for initial equilibration

fix_modify      4 rx_chemistry on # Turning chemistry back on
run             10                # actual simulation of reactions

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

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

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

lmp -k on g 1 -sf kk -pk kokkos newton on neigh half gpu/aware off -echo both -in in.lammps > native.out

查看输出#

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

cd work-new/p100-DPD-RX-rk4
tail -n 35 native.out

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

   Step          Temp          Press          Volume         PotEng         KinEng       c_dpdU[1]      c_dpdU[2]      c_dpdU[3]     v_totEnergy     c_dpdU[4]   
Loop time of 0.903111 on 1 procs for 10 steps with 864 atoms
   Step          Temp          Press          Volume         PotEng         KinEng       c_dpdU[1]      c_dpdU[2]      c_dpdU[3]     v_totEnergy     c_dpdU[4]   
Loop time of 0.928581 on 1 procs for 10 steps with 864 atoms
Total wall time: 0:00:02

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

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

本次输出示例#

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

   Step          Temp          Press          Volume         PotEng         KinEng       c_dpdU[1]      c_dpdU[2]      c_dpdU[3]     v_totEnergy     c_dpdU[4]   
         0    2065.00000000   1368.17463335 179834.51777865      0.00000000    230.35385810      0.00000000   7682.84786557      0.00000000   7682.84786557   2065.00000000
         1    2059.32733469   1364.41618455 179834.51777865      0.00000000    229.72106375      0.00000000   7683.48065992      0.00000000   7683.48065992   2065.15334533
         2    2062.48707502   1366.50968409 179834.51777865      0.00000000    230.07353754     -0.00000000   7683.12818614      0.00000000   7683.12818614   2065.06465097
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

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

100%查看原图 ↗