[lammps]Lost atoms in NVT after NPT simulation

Hi all,

I am a new LAMMPS user and I implemented the given input file ‘input.lammps’ to simulate pure flexible water as the lammps tutorial(https://github.com/lammpstutorials/lammpstutorials.github.io/blob/be50bf9002971d24ed3815dd18b006b73fd6db84/docs/inputs/level2/polymer-in-water/pureH2O/input.lammps).
The tutorial is doing NPT simulation, but I would like to do NVT simulation, so I add this at the end of the input file:

timestep 1.0
fix mynvt all nvt temp 300 300 100
thermo 1000
run 100

Then I got the error:“Lost atoms: original 1050 current 1048 (src/thermo.cpp:490)
Last command: run 100”

Could you please help me by telling me why this would happen and how to continue a NVT simulation?

Thanks.

This is my input file:

units real
atom_style full
bond_style harmonic
angle_style harmonic
dihedral_style harmonic
pair_style lj/cut/coul/long 12
kspace_style pppm 1e-5
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 1.0 angle yes

region box block -15 15 -15 15 -15 15
create_box 2 box &
bond/types 1 &
angle/types 1 &
extra/bond/per/atom 2 &
extra/angle/per/atom 1 &
extra/special/per/atom 2

mass 1 15.9994 # H2O O
mass 2 1.008 # H2O H

pair_coeff 1 1 0.119431704 3.400251
pair_coeff 2 2 0.0 0.0

bond_coeff 1 442.1606 0.972
angle_coeff 1 47.555878 103.0

molecule h2omol FlexibleH2O.txt
create_atoms 0 random 350 456415 NULL mol h2omol 454756 overlap 1.0 maxtry 50
group H2O type 1 2
minimize 1.0e-4 1.0e-6 100 1000
reset_timestep 0

fix mynpt all npt temp 300 300 100 iso 1 1 1000

dump mydmp all atom 1000 dump.lammpstrj
variable mytemp equal temp
variable myvol equal vol
fix myat1 all ave/time 10 10 100 v_mytemp file temperature.dat
fix myat2 all ave/time 10 10 100 v_myvol file volume.dat
variable myoxy equal count(H2O)/3 # divide by 3 to get the number of molecule, not atom
variable mydensity equal ${myoxy}/v_myvol
fix myat3 all ave/time 10 10 100 v_mydensity file density.dat

timestep 1.0
thermo 1000
run 1000

write_data H2O.data

timestep 1.0
fix mynvt all nvt temp 300 300 100
thermo 1000
run 100

Best regards,
Jiang

A timestep of 1fs is far too large to have a stable time integration for hydrogen atoms in a flexible water model. They move too fast due to the O-H vibrations that are not present in a rigid water potential.

This has nothing to do with NVT versus NPT, the problem is the inadequate timestep.

Thank you so much! Problem solved!

More importantly, I don’t see where you have done an unfix mynpt. As posted, you have two integrators running at once in the second run of your script, and I don’t believe that will work in the long term.

1 Like

Thank you very much for the notice!!