LAMMPS gives Error: Lost atoms when assign mass

Dear all,

I am trying to run a simulation, but when I assign mass in the input file I get an error. “Lost atoms…”.

I’ve included my input commands here…


3d Mie hydrogen test

variable x index 1
variable y index 1
variable z index 1

variable xx equal 20*$x
variable yy equal 20*$y
variable zz equal 20*$z

units real
atom_style full

lattice fcc 5.0
region box block 0 {xx} 0 {yy} 0 ${zz}
create_box 1 box
create_atoms 1 box
mass 1 1.6e-27

velocity all create 100 87287 loop geom

pair_style mie/cut 10.0
pair_coeff 1 1 0.0358 3.2574 8.00 6.00

#neighbor 0.3 bin
#neigh_modify delay 0 every 20 check no

thermo_style custom step temp pe etotal press density vol
thermo 10
fix 1 all nve

run 1000


Please note that the mass is small and the exponent is in negative.

I also found, if the exponent is positive then the error won’t show up.

May be I am not using the right units or atom_style. Can someone please help ?

Thanks,
Vishist

Hi, Currently your atoms have a mass of 1.6e-27 g/mol. Is it what you want?
Simon

Hi Simon,

Yes, I was wondering if it is possible to assign mass of an atom in grams ?

I tried different units like, si, cgs etc but every time I get the error message "Lost atoms: ". But when I set the mass exponent to something positive then the simulation runs.

Thanks,
Vishist

You can pick the unit system you prefer here. Since currently you are using the system ‘real’, masses are in g/mol.

Thanks Simon,

I already checked that page and tested with different units, but as I wrote earlier that the simulation runs as soon as I change the negative exponent of mass to the positive one.

Thanks !

But why are you only playing with the exponent ? Both 1.6e-27 g/mol and 1.6e27 g/mol are off by 27 orders of magnitude! Typical values for atomic masses are near 1-10 g/mol.

My problem is: I want to pass mass of a single hydrogen atom in kilo-gram. And when I pass it, no-matter what unit I use, the simulation just throw an error. I do not want to pass mass in AMU.

I am not playing with the exponents but the mass of a single hydrogen atom in kg is 1.6e-27 and when I assign it to the mass command, the simulation fails with the error message ERROR: Lost atoms: .

What should I do to pass 1.6e-27 to LAMMPS ?

Many thanks !

Mass of one hydrogen atom: 1.00784 AMU (or 1.67e-24 g or 1.67e-27 kg if you want).
Units real have masses measured in g/mol.

Q: If one atom of hydrogen has a mass of 1.67e-24 g, what mass would 1 mol of hydrogen atoms have?

A: well, 1 mol of hydrogen atoms = 6.02e23 hydrogen atoms.
1.67e-24g * 6.02E23 = 1.00784 g

mass of 1 mol of hydrogens in grams: 1.00784 g

1 Like

You can reason the crashing of your simulation by having in the back of your mind the fact that you are addressing the dynamics of your system classically (so Newtonian mechanics). It crashes when you use ultra tiny masses because the corresponding acceleration (and ultimately the velocities) are huge.

Thank you, Cecilia, for your reply. I see the point.
The conclusion is that there is no direct way to pass mass of an atom in kg to LAMMPS.

That is not correct. You can do that with “units si”. The issue is that all other settings have to also be in the corresponding units as defined by the “units” keyword setting.

If your mass is too small relative to the definition of the time step (which must be entered in seconds with “units si”), then you get lost atoms because the numerical integration of the equation of motions diverges. If your mass is too large, then atoms won’t move significantly within a timestep.

The problem is a conceptual one and thus one in your head. All input must be consistent and yours obviously is not.