[lammps-users] LAMMPS Ignoring negative sign on charge?

Dear list,

I am trying to simulate a box of SPC/E water without Ewald (lj/cut/coul/cut).

You can find copies of my input files here:

http://gubbins.ncsu.edu/users/joshua/lammps_question/

I'm using LAMMPS marked March 24, 2010 which was compiled with KSPACE,
MANYBODY, MOLECULE, and OPT.

The oxygen atoms (atom type 1) has a charge of -0.8476 and the
hydrogen atom (atom type 2) has a charge of +0.4238.

The initial structure (initial.conf) should be equilibrated with a
potential energy of about -45.2 kJ/mol (measured from MC simulations
with no Ewald).

I'm getting positive values for the Coulombic energy. When I change
the charge on the oxygen from -0.8476 to +0.8476, LAMMPS outputs
exactly the same energy for the initial structure as it does when it
is -0.8476. If I change the value to something else, say +0.4238 (or
-0.4238), I do get a different value for the energy.

Therefore, it appears that LAMMPS is reading the absolute value of the
charge but ignoring the sign on my charge.

Is there something wrong with my format of my input? I had thought
that the formatting wasn't a huge deal.

Thanks in advance for your help. I'm probably missing something very stupid.

Josh

Dear list,

dear josh,

I am trying to simulate a box of SPC/E water without Ewald (lj/cut/coul/cut).

You can find copies of my input files here:

http://gubbins.ncsu.edu/users/joshua/lammps_question/

I'm using LAMMPS marked March 24, 2010 which was compiled with KSPACE,
MANYBODY, MOLECULE, and OPT.

The oxygen atoms (atom type 1) has a charge of -0.8476 and the
hydrogen atom (atom type 2) has a charge of +0.4238.

The initial structure (initial.conf) should be equilibrated with a
potential energy of about -45.2 kJ/mol (measured from MC simulations
with no Ewald).

I'm getting positive values for the Coulombic energy. When I change
the charge on the oxygen from -0.8476 to +0.8476, LAMMPS outputs
exactly the same energy for the initial structure as it does when it
is -0.8476. If I change the value to something else, say +0.4238 (or
-0.4238), I do get a different value for the energy.

your problem is here:
#Lennard-Jones Parameters
pair_coeff 2 2 0.0000000000 0.000 0.1
pair_coeff 1 2 0.0000000000 0.000 0.1

with the last two lines you set the cutoff not only
for the lennard jones to 0.1 angstrom but also for
the H-H and H-O coulomb interactions.

since lennard-jones and coulomb share a neighborlist
in the lj/cut/coul/cut style, there is no benefit from
setting the LJ cutoff shorter. you already set global
cutoffs, just keep them and don't override them from
the individual pair coeffs.

Therefore, it appears that LAMMPS is reading the absolute value of the
charge but ignoring the sign on my charge.

nope.

Is there something wrong with my format of my input? I had thought
that the formatting wasn't a huge deal.

it is not about formatting. :wink:

Thanks in advance for your help. I'm probably missing something very stupid.

yep.

cheers,
   axel.

Josh,
Maybe I’m mistaken, but shouldn’t the potential energy be the same if you flip the sign? The direction of the force will change, certainly, but the magnitude of the energy should be the same. At least that is my understanding.

Jonathan

Doh! Thanks Axel!