Dear Professor,
Thank you so much for taking the time to respond to my questions and for your valuable advice. I am truly honored to receive your reply.
I must admit that my familiarity with the literature is still quite limited, and my understanding of molecular dynamics remains incomplete. When faced with a challenge like this, I realize my current ability is not yet sufficient to resolve it on my own.
Following your suggestions, I have actively tried to improve my approach. Specifically, I switched from using “change box” to “fix deform.” Due to the presence of long-range electrostatic interactions handled by PPPM, I also implemented a reflecting wall in the z-direction that adjusts dynamically along with the deformation.
Unfortunately, the issue of rising temperature continues to persist. After running the simulation for two full days—now reaching 6,727,000 steps—the length in the z-direction has expanded from 39.9 Å to 154.46 Å, and the temperature has increased from 360 K to 758 K. Given these results, I feel I must seek further guidance in finding a new solution.
Once again, thank you for your patience and support. I sincerely hope to learn from your expertise and would be deeply grateful for any further suggestions you might offer. The files I have prepared are attached below for your reference.
Respectfully yours,
Yu Xing
Basic settings
units real
dimension 3
boundary p p f
atom_style full
timestep 2.0
#-----
Neighbor list settings
neighbor 2 bin
neigh_modify delay 0 every 1 check yes
#-----
Simulation box
region whole block -18.95 20.95 -18.95 20.95 -18.95 20.95
region liquid block -17.95 19.95 -17.95 19.95 -17.95 19.95
create_box 2 whole bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2
#-----
Atom types
mass 1 15.9994 # O
mass 2 1.008 # H
#-----
Water molecule definition
molecule H2O spce.mol
#-----
create atoms
lattice bcc 3.788
create_atoms 0 region liquid mol H2O 1000
write_data water.data
#-----
Group definitions
group liquid region liquid
#-----
Force field settings
SPC/E water model
pair_style lj/cut/coul/long 9.0
pair_coeff 1 1 0.1553 3.166 # O-O
pair_coeff 1 2 0.0 0.0 # O-H
pair_coeff 2 2 0.0 0.0 # H-H
Bond and angle parameters
bond_style harmonic
bond_coeff 1 1000.0 1.0 # O-H bond
angle_style harmonic
angle_coeff 1 100.0 109.47 #1=Hw-Ow-Hw
Long-range electrostatics
kspace_style pppm 1.0e-4
kspace_modify slab 3.0
#-----
fix rigid all shake 0.0001 20 0 b 1 a 1
fix zwalls all wall/reflect zhi EDGE zlo EDGE units box
#-----
Energy minimization
min_style cg
minimize 1.0e-1 1.0e-3 100 1000
reset_timestep 0
===
Initial velocities
velocity all create 360 12345 rot yes dist gaussian
NVT integration
fix nvt liquid nvt temp 360 360 100
Thermodynamic output for NVT
thermo 1000
thermo_style custom step press pe temp ke density lx ly lz
Trajectory output for NVT
dump nvt all custom 1000 nvt.lammpstrj id type x y z vx vy vz
dump_modify nvt sort id
Run NVT
run 1000000
write_restart restart.equil
variable target_lz equal 1000
variable rate equal 0.00001
variable interval equal 1000
variable loops equal 48000
#-----
fix deform all deform 1 z vel 0.00001 units box remap v
fix walls all wall/reflect zhi EDGE zlo EDGE units box
fix nve all nve
#-----
thermo 1000
thermo_style custom step time temp press density lz
dump flash all custom 1000 flash.lammpstrj id type x y z
dump_modify flash sort id
#-----
print “Starting main loop…”
variable i loop {loops}
label main_loop
run {interval}
#-----
unfix walls
fix walls all wall/reflect zhi EDGE zlo EDGE units box
next i
jump SELF main_loop
#-----
unfix deform
run 200000
write_data flash_final.data
write_restart restart.flash
print “Simulation completed successfully!”