Please help. Tail correction in lj/expand: Possible bug

I was wondering if anyone who understands the LAMMPS source code (especially
pair*.h/cpp) could kindly have a quick look at this issue. I would really
appreciate some input.

Thanks for your help,
Ketan

Dear LAMMPS users and developers,

LAMMPS version: 18 April 2015

I am in the process of using pair_style lj/expand for some test
simulations. During my tests, I found that the tail corrections for energy
and pressure were unreasonably high for WCA like cut-offs. This lead me to
read the file pair_lj_expand.cpp . According to the manual (as well as the
code), the actual force cut-off is the user provided cut-off (Rc) + the
shift factor (Delta). However, this definition of cut-off is not reflected
in the tail corrections as coded in init_one().

In particular, I find that line 226 should be: “double shiftcut = -
cut[i][j];” instead of: “double shiftcut = shift[i][j] – cut[i][j];” Based
on some basic tests, I find that the modified code shows expected behavior.

I have attached the derivation for the tail corrections contribution for the
energy term. I believe that the source of the error is that the integration
limits were not adjusted during the integration-by-substitution
(highlighted). Could you please advise whether there is indeed an error in
the pair_lj_expand.cpp or I am missing something? Also, it seems as though
pair_lj_expand_omp.cpp inherits init_one() from pair_lj_expand.cpp … so only
one line might need to be changed.

Thanks,
Ketan Khare
Rensselaer Polytechnic Institute

Tail correction LJ Expand.pdf (222 KB)