ERROR: Lost atoms: original 1500 current 1495 (src/thermo.cpp:488)

I am trying to simulate a mixture of CO2 and N2, but I keep getting ‘ERROR: Lost atoms’. I further increased the size of the box, performed minimization yet I am still getting the error. I understand there should be a rigidifying command, but I am finding it hard to implement it. Please Can anybody help. Below are my input script and data file. Thank you

units real
atom_style full
boundary p p p

read_data CO2_initial.data

pair_style lj/cut/coul/long 12
pair_modify tail yes
bond_style harmonic
angle_style harmonic
kspace_style pppm 1.0e-4

include PARM.lammps

molecule N2 N2.mol
create_atoms 0 random 5 428515 NULL mol N2 645341

group CO2 type 1 2
group n2 type 3 4
#neighbor 2.0 bin
#neigh_modify every 1 delay 0 check yes

#Minimization

thermo 10
min_style sd
minimize 1.0e-4 1.0e-6 1000 10000

variable dt equal 1
timestep ${dt}

reset_timestep 0

velocity all create 300 4932567 dist uniform
variable kinetic_energy equal ke
variable potential_energy equal pe
variable pressure equal press
variable Temperature equal temp
variable Density equal density
variable total_energy equal etotal

fix 1 all npt temp 300 300 100 iso 78.9539 78.9539 1000
thermo 1000
#fix myave1 all ave/time 10 100 1000 v_Temperature v_kinetic_energy v_potential_energy v_total_energy v_pressure file energy1.data
thermo_style custom step temp density epair ke etotal press vol
run 500000

DATA FILE

**N2**
# N2 molecule file. TraPPE model.

3 atoms
2 bonds
1 angles

Coords
    
1   0.0 0.00 0.00
2   -0.55 0.00 0.00
3   0.55 0.00 0.00

Types

1   3
2   4 
3   4 
 

Charges

1    0.964
2   -0.482
3   -0.482

Bonds

1   1      1      2
2   1      1      3

Angles

1   1      2      1      3
--------------------------------------------------------------------------


**PARM**

# Masses

mass            1   12.0107  #C
mass            2   15.9994  #O
mass            3   1e-20    #COM
mass            4   14.005 #N

# Pair coeff

pair_coeff      1 1 0.05365359 2.8000       
pair_coeff      2 2 0.15698643 3.05000          
pair_coeff      1 2 0.09177627989 2.9250   
pair_coeff      4 4 0.07153812 3.31000
pair_coeff      1 4 0.06195382926 3.055
pair_coeff      2 4 0.1059741198 3.180 
pair_coeff      * 3 0.000000000000 0.000    

# Bond coeff

bond_coeff      1 5000.00 1.16 
bond_coeff      2 5000.00 0.55

# Angle coeff

angle_coeff     1 500.0 180.00
angle_coeff     2 500.0 180.00

Hi @anokye,

The Lost Atoms error is an often discussed problem. You might find useful help looking for it in the archives of the mailing list.

When you say:

If you mention Shake algorithm, please have a look at the documentation for fix shake. You do not have a complicated forcefield. The command is rather straightforward to use.

please I have looked at the documentation on fix shake and I quote " SHAKE or RATTLE should not be used to constrain an angle at 180 degrees (e.g. a linear CO2 molecule). This causes a divergence when solving the constraint equations numerically. You can use fix rigid or fix rigid/small instead to make a linear molecule rigid.

if I am to use fix rigid, please how do I implement the fix rigid command since I am considering a mixture of CO2 and N2?

thank you

Why is that a problem?

Please, the problem is how can I impose the fix rigid on a group type of molecules, let’s say the N2 and at the same time fix ensemble for the whole system?

I don’t see a problem except for you trying to think like a human and expecting LAMMPS to do the same. But LAMMPS is a computer program and thus just follows the rules it has been programmed to follow, regardless of whether it makes sense to you.

The rules are very simple and described in the documentation. Except for when the documentation of the individual fix style explicitly says so, fix commands always operate only on the atoms in the fix group and that also applies to fix rigid (see documentation of “fix” and “fix rigid”). Then, within fix rigid you have three options to group atoms in the fix group into rigid bodies: 1) all atoms form a single rigid body, 2) atoms are grouped into rigid bodies by their group membership, and 3) atoms are grouped into rigid bodies by their molecule ID. There are not “group types” in LAMMPS and there is no distinction between what type of molecule a rigid body represents. Fix rigid just blindly applies the rules. For the fix rigid/small variants, only option 3) is available. That is it. I don’t see any reason why you cannot run the simulation you describe with fix rigid or fix rigid/small or their nose-hoover based variants…

2 Likes

There is a problem with your N2 molecular template data file

Can you please tell me the mistake?

Thank you so much