CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ljForce.c File Reference

Computes forces for the 12-6 Lennard Jones (LJ) potential. More...

#include "ljForce.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "constants.h"
#include "mytype.h"
#include "parallel.h"
#include "linkCells.h"
#include "memUtils.h"
#include "CoMDTypes.h"
Include dependency graph for ljForce.c:

Go to the source code of this file.

Data Structures

struct  LjPotentialSt
 Derived struct for a Lennard Jones potential. More...
 

Macros

#define POT_SHIFT   1.0
 

Typedefs

typedef struct LjPotentialSt LjPotential
 Derived struct for a Lennard Jones potential. More...
 

Functions

static int ljForce (SimFlat *s)
 
static void ljPrint (FILE *file, BasePotential *pot)
 
void ljDestroy (BasePotential **inppot)
 
BasePotentialinitLjPot (void)
 Initialize an Lennard Jones potential for Copper. More...
 

Detailed Description

Computes forces for the 12-6 Lennard Jones (LJ) potential.

The Lennard-Jones model is not a good representation for the bonding in copper, its use has been limited to constant volume simulations where the embedding energy contribution to the cohesive energy is not included in the two-body potential

The parameters here are taken from Wolf and Phillpot and fit to the room temperature lattice constant and the bulk melt temperature Ref: D. Wolf and S.Yip eds. Materials Interfaces (Chapman & Hall 1992) Page 230.

Notes on LJ:

http://en.wikipedia.org/wiki/Lennard_Jones_potential

The total inter-atomic potential energy in the LJ model is:

\[ E_{tot} = \sum_{ij} U_{LJ}(r_{ij}) \]

\[ U_{LJ}(r_{ij}) = 4 \epsilon \left\{ \left(\frac{\sigma}{r_{ij}}\right)^{12} - \left(\frac{\sigma}{r_{ij}}\right)^6 \right\} \]

where $\epsilon$ and $\sigma$ are the material parameters in the potential.

  • $\epsilon$ = well depth
  • $\sigma$ = hard sphere diameter

To limit the interation range, the LJ potential is typically truncated to zero at some cutoff distance. A common choice for the cutoff distance is 2.5 * $\sigma$. This implementation can optionally shift the potential slightly upward so the value of the potential is zero at the cuotff distance. This shift has no effect on the particle dynamics.

The force on atom i is given by

\[ F_i = -\nabla_i \sum_{jk} U_{LJ}(r_{jk}) \]

where the subsrcipt i on the gradient operator indicates that the derivatives are taken with respect to the coordinates of atom i. Liberal use of the chain rule leads to the expression

\begin{eqnarray*} F_i &=& - \sum_j U'_{LJ}(r_{ij})\hat{r}_{ij}\\ &=& \sum_j 24 \frac{\epsilon}{r_{ij}} \left\{ 2 \left(\frac{\sigma}{r_{ij}}\right)^{12} - \left(\frac{\sigma}{r_{ij}}\right)^6 \right\} \hat{r}_{ij} \end{eqnarray*}

where $\hat{r}_{ij}$ is a unit vector in the direction from atom i to atom j.

Definition in file ljForce.c.

Macro Definition Documentation

#define POT_SHIFT   1.0

Definition at line 75 of file ljForce.c.

Typedef Documentation

typedef struct LjPotentialSt LjPotential

Derived struct for a Lennard Jones potential.

Polymorphic with BasePotential.

See Also
BasePotential

Function Documentation

BasePotential* initLjPot ( void  )
read

Initialize an Lennard Jones potential for Copper.

Definition at line 110 of file ljForce.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ljDestroy ( BasePotential **  inppot)

Definition at line 98 of file ljForce.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int ljForce ( SimFlat s)
static

Definition at line 144 of file ljForce.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ljPrint ( FILE *  file,
BasePotential pot 
)
static

Definition at line 130 of file ljForce.c.

Here is the caller graph for this function: