[lammps-users] System is not charge neutral

Hi all:

I am trying to build a ZrO2 unit cell using the lattice custom command.
The ZrO2 unit cell contains 4 Zr+4 and 8 O-2 atoms. My input file is:

units metal
atom_style charge
atom_modify map array
neighbor 0.3 bin
neigh_modify delay 0 every 20 check no
boundary p p f

lattice custom 5.129 basis 0.0 0.0 0.0 basis 0.25 0.25 0.25 &
                basis 0.75 0.75 0.25 basis 0.75 0.25 0.75 &
                basis 0.25 0.75 0.75 basis 0.25 0.25 0.75 &
                basis 0.75 0.75 0.75 basis 0.25 0.75 0.25 &
                basis 0.75 0.25 0.25 basis 0.0 0.5 0.5 &
                basis 0.5 0.0 0.5 basis 0.5 0.5 0.0
region bicrystal block 0.0 2.0 0.0 2.0 0.0 2.0
create_box 2 bicrystal

region grain_1 block 0.0 1.0 0.0 1.0 0.0 1.0
create_atoms 2 region grain_1 basis 1 1 basis 10 1 basis 11 1 &
                basis 12 1 basis 2 2 basis 3 2 basis 4 2 basis 5 2 &
                basis 6 2 basis 7 2 basis 8 2 basis 9 2

mass 1 91.22
mass 2 15.99
set atom 1 charge 4
set atom 2 charge -2
velocity all create 10.0 87287 mom no dist gaussian

pair_style buck/coul/long 4.0 10.0
pair_modify shift yes
pair_coeff 1 1 0.0 10.0 0.0
pair_coeff 2 2 9547.96 0.2192 32.0
pair_coeff 1 2 1502.11 0.3477 5.1
kspace_style ewald 1.0e-4
kspace_modify slab 3.0

minimize 1.0e-6 0.0 5000 10000
write_restart restart.gb

When I launch the script I get the message:

LAMMPS (15 Jan 2010)
Lattice spacing in x,y,z = 5.129 5.129 5.129
Created orthogonal box = (0 0 0) to (10.258 10.258 10.258)
  1 by 1 by 2 processor grid
Created 12 atoms
Setting atom values ...
  1 settings made for charge
Setting atom values ...
  1 settings made for charge
WARNING: Resetting reneighboring criteria during minimization
Ewald initialization ...
WARNING: System is not charge neutral, net charge = 2
  G vector = 0.273155
  vectors: actual 1d max = 122 8 2456
Setting up minimization ...
Memory usage per processor = 10.7215 Mbytes
Step Temp E_pair E_mol TotEng Press
       0 10 -22.403619 0 -22.389401 76911.719
ERROR: Lost atoms: original 12 current 10

The problem is that I cannot understand the WARNING: SYSTEM IS NOT CHARGE
NEUTRAL (which I think is the origin of the loss of atoms). I have checked
an image of the created unit cell and it contains 4 Zr and 8 O. In
addition, if I build the unit cell by using the read_data command I don't
get such a warning.

Is there anything wrong in my script? Any help?

Thanks in advance!

Juanjo

P.S.: The box intentionally doubles the unit cell size. Also the "f"
boundary condition has been used intentionally. I want to simulate a
bicrystal if I succeed...

2010/3/16 Juan José Meléndez Martí­nez <melendez@…33…1779…>

Hi all:

I am trying to build a ZrO2 unit cell using the lattice custom command.
The ZrO2 unit cell contains 4 Zr+4 and 8 O-2 atoms. My input file is:

units metal
atom_style charge
atom_modify map array
neighbor 0.3 bin
neigh_modify delay 0 every 20 check no
boundary p p f

lattice custom 5.129 basis 0.0 0.0 0.0 basis 0.25 0.25 0.25 &
basis 0.75 0.75 0.25 basis 0.75 0.25 0.75 &
basis 0.25 0.75 0.75 basis 0.25 0.25 0.75 &
basis 0.75 0.75 0.75 basis 0.25 0.75 0.25 &
basis 0.75 0.25 0.25 basis 0.0 0.5 0.5 &
basis 0.5 0.0 0.5 basis 0.5 0.5 0.0
region bicrystal block 0.0 2.0 0.0 2.0 0.0 2.0
create_box 2 bicrystal

region grain_1 block 0.0 1.0 0.0 1.0 0.0 1.0
create_atoms 2 region grain_1 basis 1 1 basis 10 1 basis 11 1 &
basis 12 1 basis 2 2 basis 3 2 basis 4 2 basis 5 2 &
basis 6 2 basis 7 2 basis 8 2 basis 9 2

mass 1 91.22
mass 2 15.99
set atom 1 charge 4
set atom 2 charge -2
velocity all create 10.0 87287 mom no dist gaussian

pair_style buck/coul/long 4.0 10.0
pair_modify shift yes
pair_coeff 1 1 0.0 10.0 0.0
pair_coeff 2 2 9547.96 0.2192 32.0
pair_coeff 1 2 1502.11 0.3477 5.1
kspace_style ewald 1.0e-4
kspace_modify slab 3.0

minimize 1.0e-6 0.0 5000 10000
write_restart restart.gb

When I launch the script I get the message:

LAMMPS (15 Jan 2010)
Lattice spacing in x,y,z = 5.129 5.129 5.129
Created orthogonal box = (0 0 0) to (10.258 10.258 10.258)
1 by 1 by 2 processor grid
Created 12 atoms
Setting atom values …
1 settings made for charge
Setting atom values …
1 settings made for charge
WARNING: Resetting reneighboring criteria during minimization
Ewald initialization …
WARNING: System is not charge neutral, net charge = 2
G vector = 0.273155
vectors: actual 1d max = 122 8 2456
Setting up minimization …
Memory usage per processor = 10.7215 Mbytes
Step Temp E_pair E_mol TotEng Press
0 10 -22.403619 0 -22.389401 76911.719
ERROR: Lost atoms: original 12 current 10

The problem is that I cannot understand the WARNING: SYSTEM IS NOT CHARGE
NEUTRAL (which I think is the origin of the loss of atoms). I have checked
an image of the created unit cell and it contains 4 Zr and 8 O. In
addition, if I build the unit cell by using the read_data command I don’t
get such a warning.

Is there anything wrong in my script? Any help?

José:

Your use of “set” is incorrect–it’s only setting atoms 1 and 2, when you want to set the types to have those charges. See:

http://lammps.sandia.gov/doc/set.html

on how to specify options for the set command.

–AEI

Have you tried dumping the time 0 snapshot of the system,
and including the Q of each atom? My guess is that
if you sum them up, your system won't be charge neutral.

Steve

2010/3/16 Ahmed E. Ismail <[email protected]...>: