[lammps-users] Lost atoms error in when using multiple groups in gcmc with nvt simulation

Hi Lammps Users,

I have been trying to run a simulation of two liquid films with vapour filling the space between the two. I am trying to use the hybrid gcmc/nvt approach for the simulation. I was able to simulate a single phase film with fix nvt and fix gcmc using dynamic/dof to account for the addition/loss of atoms when using gcmc.
However, when I am trying to do it across the three regions, I get a lost atoms error. Following is the input script I am using-

atom_style atomic

units lj

boundary p p p

region box block 0 15 0 15 0 22 units box

create_box 1 box

lattice fcc 0.7

region box1 block 0 15 0 15 0 8 units box

create_atoms 1 region box1

region box2 block 0 15 0 15 14 22 units box

create_atoms 1 region box2

region box3 block 0 15 0 15 8 14 units box

create_atoms 1 random 90 2873 box3

group phase1 region box1

group phase2 region box2

group phase3 region box3

mass 1 1.0

pair_style lj/cut 2.5

pair_coeff 1 1 1.0 1.0 2.5

neighbor 0.3 bin

neigh_modify delay 5

Fixes

compute mdtemp1 phase1 temp

compute_modify mdtemp1 dynamic/dof yes

fix mdnvt1 phase1 nvt temp 0.99 0.99 $(100*dt)

fix_modify mdnvt1 temp mdtemp1

fix 1 phase1 gcmc 100 10 20 1 635422 0.99 -3.0 0.15

compute mdtemp2 phase2 temp

compute_modify mdtemp2 dynamic/dof yes

fix mdnvt2 phase2 nvt temp 0.99 0.99 $(100*dt)

fix_modify mdnvt2 temp mdtemp2

fix 2 phase2 gcmc 100 10 20 1 423663 0.99 -3.0 0.15

compute mdtemp3 phase3 temp

compute_modify mdtemp3 dynamic/dof yes

fix mdnvt3 phase3 nvt temp 0.99 0.99 $(100*dt)

fix_modify mdnvt3 temp mdtemp3

fix 3 phase3 gcmc 100 10 20 1 498292 0.99 -3.0 0.15

dump 1 all atom 35000 films.out

thermo 200

thermo_style custom elapsed atoms density press temp

timestep 0.001

run 35000

The error I get says the following-

Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (15.000000 15.000000 22.000000) 1 by 1 by 1 MPI processor grid Lattice spacing in x,y,z = 1.7878071 1.7878071 1.7878071 Created 1301 atoms create_atoms CPU = 0.003 seconds Created 1301 atoms create_atoms CPU = 0.001 seconds Lattice spacing in x,y,z = 3.6840315 3.6840315 3.6840315 Created 121 atoms create_atoms CPU = 0.000 seconds 1301 atoms in group phase1 1301 atoms in group phase2 121 atoms in group phase3 WARNING: Temperature for fix modify is not for group all (src/fix_nh.cpp:1428) WARNING: Temperature for fix modify is not for group all (src/fix_nh.cpp:1428) WARNING: Temperature for fix modify is not for group all (src/fix_nh.cpp:1428) Neighbor list info … update every 1 steps, delay 5 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 2.8 ghost atom cutoff = 2.8 binsize = 1.4, bins = 11 11 16 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cut, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton stencil: half/bin/3d/newton bin: standard Setting up Verlet run … Unit style : lj Current step : 0 Time step : 0.001 Per MPI rank memory allocation (min/avg/max) = 4.382 | 4.382 | 4.382 Mbytes Elapsed Atoms Density Press Temp 0 2723 0.55010101 738925.86 0 ERROR: Lost atoms: original 2714 current 2666 (src/thermo.cpp:427) Last command: run 35000

Any help would be appreciated.

-Aaditya Joshi
Graduate Research Asst.
Purdue University

This has nothing to do with using gcmc, but is just a consequence of how you set up your system.
When you create atom in random positions, it is quite likely to have some close contacts. Those will lead to very high potential energy and those atoms will then “shoot” through your simulation box. If they move too fast, then LAMMPS cannot keep track of them passing through periodic boundaries anymore (e.g. if they sped up so much they would pass through the entire box in just one time step) and reports them as “lost atoms”.
You can confirm this by disabling the gcmc fixes.
A simple remedy is to add a line like

delete_atoms overlap 0.5 all all

after creating your atoms to delete all atoms that are in close contact.

Axel.

1 Like