LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] pair style table for Coulombic and dispersion pair interactions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] pair style table for Coulombic and dispersion pair interactions


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Wed, 13 Sep 2017 14:30:48 -0400



On Wed, Sep 13, 2017 at 1:49 PM, Jo <jojo412202@...24...> wrote:
Thank you!

I have implemented the coul/long tables and correctly matched analytically tabulated tables with the pair write tables produced from simulation as an exercise.

I am now trying to implement another functional form using tables.  The functional form is the normal coulombic form with an erfc-style damping function and Buckingham-like dispersion contribution.  I tabulated the table analytically using the functional form and used pair table to read the tables in the input file.  I then used pair_write to check that the simulation is correctly reading the tabulated tables.  However, there is discrepancy at short range (<0.5 angstrom) where the pair_write outputs the force converging to 0 (see attached graph) while my analytically tabulated tables go to a very high energy at small distances.  

I found another questions in the mailing list archives that might be relevent:


where you mention that there is something regarding matching the cutoff that is used in screening with real space with the cutoff in screening.  Can you clarify on what this means?  The cutoff of my tabulated potential is 14 A, and inner cutoff of 0.1 A.  The conversion parameter in the real space coulombic potential (alpha) I used is 0.1, which is from the gewald output for a coul/long simulation I ran with this model (this is perhaps not the exact alpha I should use, but I thought it would be a close estimate).  

Could the discrepancies of my input tables and pair write tables be a result of cutoffs?

unlikely. from your graph it looks like your analytical table has a discontinuity at the lower cutoff, where the potential energy drops to zero.​
the output from pair_write looks like it was the result of fitting splines to this (badly formed?) input. getting things right at the lower cutoff is a known difficulty of using tables.
your data points for force and energy have to be smoooooth.

axel.

 
  What else can I check to figure out why the pair write is not outputting the tables I input?

Best,

Jo

On Fri, Sep 8, 2017 at 12:04 PM, Axel Kohlmeyer <akohlmey@...24...> wrote:


On Fri, Sep 8, 2017 at 11:47 AM, Jo <jojo412202@...24...> wrote:
Thank you! I have followed your suggestions to better understand how to use tables and have a few questions regarding that:

- I first tested coul/cut with pair write to generate a table for that potential. I then ran the same simulation using pair_style table (with the tabulated potential of coul/cut), expecting to produce the same potential as coul/cut.  The two simulation did produce the same energy, however the coul/cut approach allowed lammps to recognize that the energy was categorized as E_coul in the thermo output, while using pair_style table the energy was calculated as E_vdw.  Is there a way to tell lammps that the tabulated potential using pair_table is coulombic energy rather than vdw?

​no. ​the basic logic in LAMMPS is the following: if a pair-wise(!) force/energy is computed based on the atom type it will be tallied into E_vdw, if it is computed based on the individual atom's charge, it will be tallied into E_coul. for tables - as explained previously - you *have* to tie the charge to the atom type, since the charge value is included into the table. thus the logical way to handle this is to tally the energy into E_vdw.
 

- I was able to match the analytical form of coul/cut with the pair write output of lammps. However, for the coul/long and kspace, what is the convergence parameter alpha (gewald in the source code?) that I can use in the analytical _expression_, following the functional form of the real space ewald pair wise calculation?

​it is automatically determined and should be printed to the screen when you run a coul/long style. or you can set it explicitly yourself. for details, please consult the manual.

axel.​

 

Thank you!

On Tue, Sep 5, 2017 at 7:26 PM, Axel Kohlmeyer <akohlmey@...24...> wrote:
some general comments:

- since you are obviously struggling to understand how tables work in LAMMPS, you should start by doing a tabulation for a functional form that exists analytically in LAMMPS. this way you can compare what you are doing with the tables to the corresponding results from the original analytical form. to start right away with your target is asking for trouble.

- when tabulating coulomb, there are many issues to worry about, e.g. for tables to work you *must* have a different atom type for each atom that has a unique combination of atom type and charge. when using a coul/* pair style, this is not required, i.e. you can have the same atom type (i.e. the same lj/cut or other potential) with different atomic (partial) charges. with tables, those atoms have to have different types.

- when starting with tables, it is often a big help to build the first set of tables using the pair_write command and then compare those with the output of the analytical form (see above) and the output of your program generating the tables

- i would start first with a small test system without coulomb, then add coul/cut, then add coul/long and kspace

- for tabulation of the coloumb, you can create a combined table with lj/cut (or equivalent) and coul/long (or equivalent) or create separate tables. in the second case, for hybrid/overlay, you have to specify pair style table twice.

there is little point in answering your questions unless you have worked your way through these suggestions and when you are done, it is likely, that you don't need to ask those questions again.

axel.


On Tue, Sep 5, 2017 at 7:09 PM, Jo <jojo412202@...24...> wrote:
Hello,

I have a bit of confusion about the documentation regarding using tables, found in pair_table:

If your tabulated potential(s) are designed to be used as the short-range part of one of the long-range solvers specified by the kspace_style command, then you must use one or more of the optional keywords listed above for the pair_style command. These are ewald or pppm or msm or dispersion or tip4p. This is so LAMMPS can insure the short-range potential and long-range solver are compatible with each other, as it does for other short-range pair styles, such as pair_style lj/cut/coul/long. Note that it is up to you to insure the tabulated values for each pair of atom types has the correct functional form to be compatible with the matching long-range solver.

What does "compatible with the matching long-range solver" entail?  How can I ensure that it matches with the long range solver?  The table I made of the short range potential is simply the original coulombic interaction dampened at short distances.

Below is what I think might be how it works:

In creating the table, I assume I can use the functional form of the real space ewald solver: 0.5*qq/r*erfc(alpha*r), where alpha is the real/reciprocal space partition parameter (1/cutoff).  From what I understand, I must match this partition parameter/cutoff by making the kspace_modify gewald value the same, thus matching the cutoffs.  Is this correct and is there more matching I need to check to make sure it is compatible?

Additionally, if I would like to use tables for both coulombic and dispersion potentials, can I combine the energies in 1 table to be used in the realspace short range?  I was unable to find information about making 2 sets of tables compatible in the documentation.

Thank you in advance!

J

On Tue, Sep 5, 2017 at 5:23 AM, Michał Kański <michal.kanski@...2460...> wrote:

The manual answers those questions:

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

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

 

Michal

 

 

From: Jo
Sent: wtorek, 5 września 2017 05:10
To: lammps-users@...655....net
Subject: [lammps-users] pair style table for Coulombic and dispersion pair interactions

 

Hello,

 

I would like to implement a simulation that utilizes tables for the pair potentials for both the short range coulombic interactions and the dispersion interactions.  The tables I made for the coulumbic interactions are short range and I would like for it to be combined with the ewald long range calculations using kspace.  I have not been able to get both sets of tables to work in the input file.

 

What I have tried:

 

hybrid overlay table linear 1500 ${cutoff} coul/long${cutoff}

pair modify pair coul/long table linear 1500

 

However, I get errors saying illegal pair_style.  How should I implement both tables at the same time?  How can I let lammps know that one set of the tables is for coulombic together with kspace ewald, and the other set is for dispersion?  

 

Also, for the coulombic tables, I made the potentials simply from (q*q/r)*damping_factor, is this adequate for it to fit together with kspace ewald?

 

Thank you!

 

Jo

 



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...655....net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...655....net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...6297....sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...12...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.