Need help on Density Calculation

Dear all,

I am totally new to the lammps software. I tried to predict the density of a liquid mixture but got a number that was far too large for it to be practical. Does anyone know what could have caused the crash? It also got an error message:

Step Temp PotEng KinEng TotEng Press Volume Press Density

8223500 319.74428 11534.527 7844.9411 19379.468 -41543.547 1522.272 -41543.547 66.68667
8223600 259.91617 12047.533 6377.0556 18424.588 -59658.136 1519.9259 -59658.136 66.789607
8223700 188.87832 13569.224 4634.1385 18203.362 -177026.26 1518.0255 -177026.26 66.873217
8223800 336.89446 11384.575 8265.7217 19650.297 31217.222 1515.832 31217.222 66.969988
ERROR on proc 0: Bond atoms 6030 6042 missing on proc 0 at step 8223876 (…/neigh_bond.cpp:65)

Here is my input file:

LJ system with NPT ensemble

units real
dimension 3
atom_style full

neighbor 2.0 bin
neigh_modify every 2 delay 0 check yes page 1000000

bond_style harmonic
angle_style harmonic
dihedral_style harmonic
improper_style cvff

atom_modify sort 0 0.0

read_restart as-298-2.lammps-run01_08

fix 1 all npt temp 298.15 298.15 100.0 iso 0.0 0.0 1000.0
#fix npt temp 298.15 298.15 100.0
#special_bonds lj/coul 0.0 0.0 0.5 angle yes dihedral yes

timestep 1.0

thermo_style custom step temp pe ke etotal press vol press density
dump 2 all xyz 100 xyz.file

thermo 100

restart 10000 as-298-1.lammps-run01_09 as-298-2.lammps-run01_09

run 2000000

#true flag 1

Thank you for the help,


I don’t see anything obviously wrong with your script.

Why do you say the density is wrong? It should

be g/cm^3 for your units. You can check it yourself

by your volume and the number of atoms in it.

The error has to do with the dynamics being bad, i.e.

atoms moving too far before reneighboring. What

is your pair style cutoff (you do have a pair style?)

If you don’t then you may need to use comm_modify

cutoff to insure ghost atoms are known from far

enough away. You could also use every 1 in the re-neighbor

and verify that reneighboring is only happening every

few steps. E.g. 10-20.


No pair style and

atom_modify sort 0 0.0

Means you've got a non-interacting ideal gas with a very thin ghost layer, hence the error. You need a pair style.