We are testing the ewald summation convergence and found that we get two different behaviors depending on how we set the charge. From the manual, the two methods for setting charge appear to be equivalent, but perhaps method 2 is incorrect. In method 1, we use atom_style charge and in method 2, we use atom_style atomic but also use
fix 1 all property/atom q
In both cases we use
set (group or type index) charge -1
set (group or type index) charge 1
to fix the values of the charges. The problem we encounter is that in method 1, the ewald sum is stable with respect to the real-space cut off, while in method 2, the ewald sum is very sensitive to the real-space cut off, not converging to the correct answer. We would appreciate your advice about what might be incorrect about our method 2. Below are listed the in.lammps and resulting ewald sums for the two cases. Thanks in advance for your advice.
Natalie Holzwarth and Ahmad Al-Qawasmeh
=======method 1 in.lammps=======================
clear
Initialize simulation box
dimension 3
boundary p p p
units metal
atom_style charge
Create geometry
lattice sc ${latconst}
region box block 0 1 0 1 0 1 units lattice
create_box 2 box
#Insert Particles: Insert ions into NaCl structure
create_atoms 1 single 0.0 0.0 0.0 units lattice
create_atoms 1 single 0.5 0.5 0.0 units lattice
create_atoms 1 single 0.5 0.0 0.5 units lattice
create_atoms 1 single 0.0 0.5 0.5 units lattice
create_atoms 2 single 0.5 0.0 0.0 units lattice
create_atoms 2 single 0.0 0.5 0.0 units lattice
create_atoms 2 single 0.0 0.0 0.5 units lattice
create_atoms 2 single 0.5 0.5 0.5 units lattice
Create groups
group A type 1 #A for anions
group C type 2 #C for cations
group ions type 1 2
Set masses
mass 1 35.45
mass 2 22.99
Set charges
set group A charge -1
set group C charge 1
Initilize velocities
velocity all set 0.0 0.0 0.0
thermo_style custom etotal pe ecoul
thermo 1
Set potentials
pair_style coul/long ${ewcut}
pair_coeff * *
kspace_style ewald 1.e-9
pair_modify table 0
variable v1 equal pe
variable v2 equal ecoul
run 0
print “lattice {latconst} {ewcut} {v1} {v2}” append sum.dat