Skip to content

hherbol/Grad-MCSMRFF

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

More Complicated Simple Reactive Force Field (MCSMRFF)

A custom force field for the implementation of reactive, directional bonds in Molecular Dynamics. Force field encompasses Tersoff potentials, Coulombic potentials, and Lennard-Jones potentials. This codebase includes three main codes:

  1. LAMMPs code adjustment for implementing MCSMRFF
  2. Training set generator
  3. Automatic parameterization method

The Force Field

The MCSMRFF force field works as follows:

  1. All atoms within some cutoff are described by Lennard-Jones (LJ) and Coulomb potentials
  2. Those atoms for which it is defined, will also have the Tersoff potential applied to it.
  3. All remaining atomic interactions will be described by the Optimized Potential for Liquid Simulation (OPLS-AA) forcefield.

Using the pair_style hybrid/overlay command, we can specify the pair styles of all atoms to be a function of both Tersoff and a custom pair style: lj/cut/coul/inout. This is simply:

pair_style hybrid/overlay lj/cut/coul/inout alpha R_cut_inner R_cut_outer tersoff

Where α is a damping parameter (in inverse distance units), Rcut, inner is an inner cutoff, and Rcut, outer is an outer cutoff. The distinction between the two cutoffs is that it allows for a smooth transition between the pair style being completely "on" (r < Rcut, inner) and "off" (r > Rcut, outer). When specifying pair coefficients, use the following syntax:

pair_coeff i j lj/cut/coul/inout epsilon_ij sigma_ij R_cut_inner

Where $\epsilon_{ij} = \sqrt{\epsilon_i * \epsilon_j}$ and $\sigma_{ij} = \sqrt{\sigma_i * \sigma_j}$.

The Tersoff Potential (1, 2, 3) is well described on the LAMMPs website, but in short describes 3-body atomic interactions as follows:

$$E &= \frac{1}{2} \sum_i \sum_{j\ne i} V_{ij}$$$$V_{ij} &= f_C(r_{ij}) \left [a_{ij} f_R(r_{ij}) + b_{ij} f_A(r_{ij})\right ]$$$$\begin{aligned} f_C(r) &= \left \{ \begin{matrix} 1 &,& r < R-D \\ \frac{1}{2}-\frac{1}{2}sin(\frac{\pi}{2}\frac{r-R}{D}) &,& R-D < r < R+D \\ 0 &,& r > R+D \end{matrix} \right. \end{aligned}$$$$f_R(r) &= A e^{-\lambda_1 r}$$$$f_A(r) &= -B e^{-\lambda_2 r}$$$$a_{ij} &= (1+\alpha^n\eta_{ij}^n)^{-\frac{1}{2n}}$$$$\eta_{ij} &= \sum_{k\ne i,j} f_C(r_{ik})e^{\lambda_4^m(r_{ij}-r_{ik})^m}$$$$b_{ij} &= (1+\beta^n\xi_{ij}^n)^{-\frac{1}{2n}}$$$$\xi_{ij} &= \sum_{k\ne i,j}f_C(r_{ik})g(\theta_{ijk})e^{\lambda_3^m(r_{ij}-r_{ik})^m}$$$$g(\theta) &= \gamma_{ijk} \left ( 1 + \frac{c^2}{d^2} - \frac{c^2}{\left[ d^2 + (cos\theta_{ijk} - cos\theta_0)^2\right ]} \right )$$

Note, this is not the "pure" original implementaion by Tersoff, but instead a generalization to accomodate updates to the method. Fundamentally, the Tersoff potential works by describing potential as a function of fR(r), the repulsive term, and fA(r), the attractive term. A smoothing function, fC(r), is applied so as to maintatain a continuous transition for a cutoff distance. bij is included to account for the bond-order, and is assumed to be a monotonically decreasing function of the coordination of atoms i and j. That is, $b_{ij} \propto z^{-\frac{1}{2n}}$, where z describes the coordination number. bij is also a function of ξij, which counts the number of bonds to atom i (excluding i-j). aij is poorly described in the original implementation, but seems to describe a correction term for systems in which ηij is exponentially large. This occurs for atoms outside of the first-neighbor shell. That is to say that the repulsive term fR(r) decreases for atoms further away. Interestingly enough, this implementation of the Tersoff potential is not used in LAMMPs, and further not used in example implementations by Tersoff. Thus, it is typical for aij = 1. Finally, the function g(θ) describes the angular contribution to the bonding terms.

To accomodate variations of this potential, m and γijk are used. γijk scales the angular contribution to bij, and m changes from 3 to 1 depending on whether the Nord et al. variation is to be used.

Looking through these equations, the following are all terms that we must parameterize (note, we follow the trend of setting aij = 1):

R - The cutoff distance at which 50% of the potential is in effect.

D - The buffer distance before and after R for the smoothing function fC(rij).

A - The constant scalar for the repulsive function fR(rij).

λ1 - The exponential decay of the repulsive function fR(rij).

B - The constant scalar for the repulsive function fA(rij).

λ2 - The exponential decay of the attractive function fA(rij).

n - An exponential to decay factor of bij to accomodate for the change in decay rate of low and high coordinations ξij.

beta - A scalar for the impact of the coordination contribution ξij.

m - An exponential to accomodate the Tersoff potential (3) or the Nord variation (1).

λ3 - The exponential factor of the bond coordination term ξij.

γijk - Scaling term for the impact of the angular contribution to the bond coordination.

c - How strong the angular contribution is to the bond coordination.

d - How sharp the angular contribution is to the bond coordination.

cosθ0 - The minimum angle for which this contribution is minimized.

Installation

  1. Download LAMMPS (older versions here). Some versions will not work - the 7 Dec 2015 is the one we've tested the most, so use that one.
  2. Open a terminal in the src directory in your lammps folder
  3. In your LAMMPS src directory run make yes-manybody
  4. If you don't have an SSH key, generate one like this (if you do, skip to step 8):

    When prompted to "Enter a file in which to save the key," press Enter

    If asked to Overwrite, enter 'y'

    At the prompt, type a secure passphrase

    Retype your secure passphrase

  5. Add the new SSH key to your GitHub account

    In the top right corner of any GitHub page in your browser, click on your profile photo, then click 'Settings'

    In the user settings sidebar, click 'SSH keys'

    Click 'New SSH key'

    In the "Title" field, add a descriptive label for the new key

    Copy and Paste the contents from the 'id_rsa.pub' file into the "Key" field

    Click 'Add SSH key'

  6. Load your keys into your SSH agent

    Enter passphrase

  7. Test your SSH connection

    You should see the message "Hi 'username'! You've successfully authenicated, but GitHub does not provide shell access."

  8. Clone repository wherever

  9. Copy over contents of Grad-MCSMRFF/LAMMPS to your lammps src folder. Note, this overwrites the min.h and pair_tersoff.h files.
  10. Make using the new Makefile.mcsmrff

  11. Add the path of Grad-MCSMRFF/MCSMRFF/pys to your PYTHONPATH variable:

  12. You're done! Now you can use lammps with the lmp_mcsmrff file in your lammps/src directory.

About

A LAMMPS min_style for parameterizing force fields

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 75.7%
  • C++ 24.3%