Nan results for atom positions

Dear all,

I ran the lammps for a short run time to see the position trajectory of water and carbon molecules in a simulation box. In timestep=0 there is a position for the atoms but from next timesteps I got nan for all atoms. As follows

ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
4950
ITEM: BOX BOUNDS pp pp pp
-15 15
-15 15
-15 15
ITEM: ATOMS id type xs ys zs
1 3 0.0666667 0.0666667 0
2 3 0.0666667 0.133333 0
15 3 0.0666667 0 0
16 3 0.133333 0.0666667 0
17 3 0.133333 0.133333 0
30 3 0.133333 0 0
211 3 0 0.0666667 0
212 3 0 0.133333 0
225 3 0 0 0
226 3 0.0666667 0.0666667 0
227 3 0.0666667 0.133333 0
240 3 0.0666667 0 0
241 3 0.133333 0.0666667 0

ITEM: TIMESTEP
500
ITEM: NUMBER OF ATOMS
4950
ITEM: BOX BOUNDS pp pp pp
-15 15
-15 15
-15 15
ITEM: ATOMS id type xs ys zs
1 3 -nan -nan -nan
2 3 -nan -nan -nan
15 3 -nan -nan -nan
16 3 -nan -nan -nan
17 3 -nan -nan -nan
30 3 -nan -nan -nan
211 3 -nan -nan -nan
212 3 -nan -nan -nan
225 3 -nan -nan -nan
226 3 -nan -nan -nan
227 3 -nan -nan -nan

Could anybody help me to figure it out?

My input

***************** Initialization *********************

units real
dimension 3
boundary p p p
atom_style full
read_data atmdata.dat

group ox type 1
group hy type 2
group ca type 3
set group ox charge -0.8476
set group hy charge 0.4238
set group ca charge 0.0000

pair_style dpd/tstat 300.0 300.0 10.0 34387
comm_style brick
comm_modify vel yes
pair_style lj/cut/coul/long 10.0 10.0
pair_coeff 1 1 0.1553 3.169
pair_coeff 1 2 0.000000 0.000
pair_coeff 1 3 0.093627 3.190
pair_coeff 2 2 0.000000 0.000
pair_coeff 2 3 0.000000 0.0000
pair_coeff 3 3 0.000000 0.0000
velocity ox create 300.0 34387 rot yes dist gaussian # for Oxygen
velocity hy create 300.0 34387 rot yes dist gaussian # for Hydrogen
kspace_style ewald 1.0e-6

*************** Setting ******************************

neighbor 2.0 bin
neigh_modify delay 0 every 10 check yes

thermo 100
thermo_style custom step elapsed dt time atoms
thermo_modify norm no flush yes

fix nvt all nvt temp 300.0 300.0 1.0
#fix 1 ox rigid/small molecule
#fix 2 hy rigid/small molecule
#fix 1 hy shake 1e-4 20 0 b 2 a 2

#dumps
dump trj all atom 500 wat.lammpstrj
#dump trj all waterdump all atom 500 dump.waterinfo

write_data waterinfo.data
write_restart waterinfo.restart

timestep 0.2
run 500

NaN for atom positions typically means bad dynamics, typically due to large overlaps between atoms in the initial configuration. How high is the potential energy do during the first few time steps?

Dear Stefan,

Thank you for your reply. For the potential energy also “-nan” disclosed. Any suggestion …

Yes: Make sure there is little to no overlap between atoms in your initial configuration. How you do that is up to you.

My suggestions as I have experienced this before:

1- Have you minimized the energy of your system firstly? ( minimize command )

2- try improving your command: neigh_modify delay 0 every 10 check yes

3- try a smaller time step and increase it gradually in steps.

I would also improve the Tdamp parameter in fix nvt command.

Good luck

Dear Xialoin,

Thank you for your suggestions. Actually, I am simulating a small box with Carbon material as the wall and SPC/E water model inside the box. I’ve written a code to transfer positions data from DLPOLY to lammps data format. As you suggested me I performed the points but I got “nan” yet. A small part of my output file is as follows

ITEM: TIMESTEP
500
ITEM: NUMBER OF ATOMS
80
ITEM: BOX BOUNDS pp pp pp
-5 5
-5 5
-5 5
ITEM: ATOMS id type xs ys zs
1 3 -nan -nan -nan
2 3 -nan -nan -nan
3 3 -nan -nan -nan
4 3 -nan -nan -nan
5 3 -nan -nan -nan

I checked everything about my input and data files and I think they are right. Please take a look at my input and data files so maybe I am making a mistake somewhere.

Thanks in advance

atmdata1.dat (10 KB)

input_script.lmp (1.68 KB)

Dear Xialoin,

Thank you for your suggestions. Actually, I am simulating a small box with
Carbon material as the wall and SPC/E water model inside the box. I've
written a code to transfer positions data from DLPOLY to lammps data format.
As you suggested me I performed the points but I got "nan" yet. A small part
of my output file is as follows

ITEM: TIMESTEP
500
ITEM: NUMBER OF ATOMS
80
ITEM: BOX BOUNDS pp pp pp
-5 5
-5 5
-5 5
ITEM: ATOMS id type xs ys zs
1 3 -nan -nan -nan
2 3 -nan -nan -nan
3 3 -nan -nan -nan
4 3 -nan -nan -nan
5 3 -nan -nan -nan

I checked everything about my input and data files and I think they are
right. Please take a look at my input and data files so maybe I am making a
mistake somewhere.

if your input was correct, you wouldn't get "NaN"s. debugging input
and data is *your* job unless you can provide convincing info that
there is a bug in LAMMPS (this is not convincing at all).
the best way to debug a process is to simplify it. set up a (much)
simpler system and make it work. once you are confident, that you know
how to use LAMMPS correctly for a simple system, you can move on to
more complex set ups and simulation inputs. this is common sense and
should be standard practice. just dumping your input on a mailing list
is not.

axel.