Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Middle 

East Technical University – Department of Metallurgical & Materials Engineering

Molecular Dynamics
Prepared and Presented by :

Assoc.Prof.Dr. Caner Şimşir

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 1/19


Basics of Molecular Dynamics for Atomic Systems
 Basic idea of MD is simple: calculate the forces on the atoms and solve Newton`s equations to
determine how they move.
 Newton`s second law states that :
 2
 d ri
Fi  mi ai  mi 2
dt
 From classical mechanics, we know that force is the gradient of the potential energy :

 d  rij  rij 
 
 N
Fi  iU  r        fij  rij 
j  i  drij rij  j i
 
d  rij  rij


fij  rij  
drij rij
 If rij is small fij will be repulsive as dϕ/dr<0. If rij is large fij will be attractive as dϕ/dr>0.

 After setting the initial conditions, the equation of motion for atom i is :

2
d ri 1  1
dt 2

mi
Fi 
mi
 f r 
j i
ij ij

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 2/19


Numerical Integration of Newton`s Equations
 Simplest approach is to determine accelerations
from forces and integrating the equations of
motions twice.
  
vi  t   t   vi  t   ai  t   t
   1
ri  t   t   ri  t   vi  t   t  ai  t   t 2
2
 However, this approach is not self-consistent.
 A number of methods that preserve self-
consistency have been developed. Verlet
algorithm is one of those in which :
   1
ri  t   t   ri  t   vi  t   t  ai  t   t 2
2
   
ri  t   t   2ri  t   ri  t   t   t  ai  t   t 2
 
 ri  t   t   ri  t   t 
vi  t  
2 t
 Other algorithms include
 Velocity Verlet Algorithm
 Predictor-Corrector Methods
2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 3/19
Examining the Reliability of a Simulation
N  N N N
H r , p   K  p  U r 
 Hamiltonian (H) function equals E, the internal
energy of the system. For systems in which the
potential energy does not depend on velocities
(i.e. no frictional forces), E = K + U is a constant.
 Similarly, it can also be showed that total linear
momentum is also conserved. So, when choosing
initial velocities, it is best that total momentum
P=0 to eliminate the drift of the atoms during the
simulation.
  N
P   pi
i 1
 The validity of choice of integration scheme and
time step can be justified by checking the
following criterion:
max  E   min  E 
 104
E

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 4/19


Connection to Thermodynamics
 In a standard molecular dynamics simulation with a fixed number of particles N, in a volume V,
system is in microcanonical ensemble.
 The kinetic and potential are not fixed but at equilibrium will fluctuate around their average
values. Other thermodynamic quantities such pressure and temperature can be calculated.
Their average values obtained by averaging over time, correspond to the equivalent
thermodynamic system.
 The simplest connection to thermodynamics is through temperature, which is not a fixed
quantity for standard molecular dynamics simulation.
2 K 2K t 
T   t  
3Nk B 3Nk B
 An MD simulation is started with a chosen set of initial velocities describing initial kinetic
energy and initial temperature θ(0). However as the system evolves, the equilibrium value of
kinetic energy can be very different than the initial value.
 If the goal is to model a material under specific conditions, then the inability to specify those
conditions is limiting. Ways to achieve a desired temperature or perform a simulation at a fixed
temperature are discussed later.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 5/19


Connection to Thermodynamics
 We can write the average pressure in classical MD calculation as :

N
N 1 
P  kB T 
V 3V
 ri iU
i 1

 For the systems described by central-force potentials, the equation reduces to :

N 1 N N
d
P  kB T 
V 3V

i 1 j i
rij
drij
 The form of the equation is very similar to:

  ij  ij 
 
 N d  r r
Fi  iU  r        fij  rij 
j  i  drij rij  j i
 
 So, the evaluation of pressure requires only little extra work.

 Any other thermodynamic quantities that depend explicitly on averages of functions of the
atomic positions and momenta can be determined in an MD simulation.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 6/19


Initial Conditions
 Unit cells are used only to place the atoms in their
initial conditions.
 The system must be large enough to encompass
the basic structures to be modeled: If one is
interested in thermo-dynamics, then the
simulation cell is large enough to reduce size-
dependent errors.
 Once the # of atoms and shape of the simulation
cell is chosen the positions and the velocities
must be given some initial values.
 Choosing initial positions and velocity determines
the energy of the system (which is constant).
 The key is to ensure that initial positions are close vix2
1 
to what is expected.
  vix   e 2 2
 The initial velocities can be chosen in a number 2 2
of ways:
 They can be chosen from a Maxwell-
Boltzmann distribution for a desired starting
temperature (Tinit). k BT
 They can be randomly picked. 
mi

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 7/19


Steps in a MD Simulation
 
a) Initializer  and p

b) Calculate Kinit, Uinit , E=Kinit+Uinit and forces on each atom Fi
c) For nequil steps:
1. Solve ri  t   t  and  pi  t   t  from values and forces at time t.

2. Calculate K, U, E=K+U as well as i F
3. Check for drift of values indicating that the system is not equilibrated.
4. When equilibrated, restart.
d) For n time steps:
1. Solve ri  t   t  and  pi  t   t  from values and forces at time t.

2. Calculate K, U, E=K+U and i F
3. Accumulate values of K,U etc. for averaging.
e) Analyze the data: averages and correlations, etc.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 8/19


An Example Calculation
 To make discussion more specific, we take
as an example a simple MD simulation using
LJP.

 1 12  1 6 
 *  rij   4  *    *  
 rij   rij  
 
 r
24  2   1   *
 12 6
* * r   r* 
fij  rij    2  *    *  rij  
rij  rij   rij  
 
 For molecular dynamics, introducing a cut-off
can cause discontinuities both in the force
and the potential, which can lead to poor
energy conservation.
 The discontinuity in potential can be
eliminated by shifting φ*(r*) by φ*(rc*).
 The discontinuity in the force can be
eliminated by smoothly interpolating
Lennard-Jones potential so that potential and
its first few derivatives are zero at rc*. φBG*(r*)
is such a potential.
2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 9/19
Central Force Potentials and the Properties of Solids
 Consider a 6x6x6 system of 4-atom FCC
unit cell (864 atoms).
 ρ*=0.55
 δ*=0.005
 T*=0.2
 rc*= 5
 Over the course of first 1500 time steps
there is a rapid variation of thermodynamic
variables, after which a steady convergence
to an equilibrated state.
 Notice that both K*/N and U*/N varies
significantly E*/N is constant.
 Figure also points out a drawback of
standard molecular dynamics simulations :
 Although we started the simulation at
T*=0.2, the final temperature is
T*=0.74.
 Similarly, since the volume is constant,
the final pressure is unknown a-priori.
 It should also be noted that only “averaged”
values of T* and P* have a thermodynamic
meaning.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 10/19


Averaging

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 11/19


Averaging
 One can calculate the average of quantities :
 max
1
U 
 max


U  
1

 Similarly, variance of U can be calculated by :


 max
1
 U    U 
2 2
  2
 U2  U
U
 max  1

 Relative error in <U> (σU/<U>) is proportional with 1/√N.


 σ2U does not give a measure of well the average values are calculated in a simulation. However
σ2<U> is the quantitative measure of statistical error in a simulation.
 One way to evaluate the variance of the mean is to divide the data into smaller sets, then
average the data in each of those sets, creating a list of averages from which the variance can
be determined.
 If the data are divided nb bins of equal length τb, then the average quantities are given by:

nb  0  b
1 1
U 
nb
U
i 1
i
U ı

b
 U T 
 
 0

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 12/19


Spatial Correlation Functions
 In addition to thermodynamic quantities, MD
simulations also provides information about the
structure of the material.
 Pair distribution function g(r), gives the
probability that for any atom there sits another
atom a distance r away from it.
 g(r) does not provide information about the
direction of the atom but only how far is it.
 The form of g(r) in the first figure (ρ*=0.55,
<T*>=0.8, <P*>=-0.25) is typical of a liquid with
broad peaks that asymptotes to g(r)=1.
 In order to have a solid we set ρ*=1. We did
variation of different starting temperatures that will
lead to similar <T*> and we found that T*init=1.4
leads to <T*>=0.74, <P*>=1.8.
 Second figure is a typical g(r) of a solid with well-
defined peaks with low probability of having atoms
in between the peaks.
 # of atoms in the peaks 12, 6 , 18, etc. located at
(1,√2,√3..)a0. Where a0=1.12. It is clearly an FCC
structure.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 13/19


Spatial Correlation Functions
 Another metric indicating whether the system is
solid or a liquid is the translational order
parameter ρ(k), where k is a reciprocal lattice
vector of the solid structure.
 Using a reciprocal lattice vector k=(2π/a0)(-1,1,-1)
of FCC lattice, where a0 is the unit cell length.
 ρ(k) = 1 for a perfect lattice by definition.
 ρ(k) = 0 for a liquid or any other crystal structure
yielding the same result.
 The first system starts with a perfect FCC
structure and lost FCC ordering in 300-400 time
steps.
 Second figure also starts with a perfect FCC lattice
and ρ(k) decreases to 0.90 after a very short
while. This is due to thermal vibrations. The
structure is clearly FCC or some other structure
with the same reciprocal lattice vector.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 14/19


Time Correlation Functions
 Correlation functions can tell us more than
structural information: They can provide
insight into dynamics of atomic motion.
 Time correlation functions, which represent
how values of a quantity at one time are
related with its value at another time. Such
functions provide a measure for many
quantities, including loss of order over time.
 Velocity autocorrelation function cvv(t) is
proportional to
 
v t   v  0
where the averages are over the all particles.
 One can show that the diffusion coefficient
(D) can be expressed as an integral over
velocity autocorrelation function cvv(t).

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 15/19


Velocity Rescaling
 Practical weakness of simulations in the
microcanonical ensemble is the inability to
set a specific temperature.
 Here, we discuss an approach in which the
simulations remain in the microcanonical
ensemble (NVE) but the system is driven to
a specific temperature.
 The easiest way to force the system to be at
a specific temperature is to rescale the
velocities.
 If the desired temperature is Ts, the system
can be forced to take on the temperature by
rescaling the velocities by:

Ts
v new
i  vi
T
 Rescaling is repeated over time as the
system drifts away from the desired
temperature.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 16/19


Limitations of Molecular Dynamics
 Intermolecular potentials are approximations to the true interactions and they may not give a
particularly accurate representation of the specified material.
 For example, materials in which the bonding is distorted from spherical symmetry, for example
covalently bonded solids, are less well described than those with simple bonding.
 Similarly, if the bonding is dynamic, for example if there is a change in bonding depending on
atomic positions, the simple descriptions are less likely to be applicable.
 MD simulations are limited by the computational burden of calculating forces and energies,
which scales with N when cut-offs are used.
 Doubling the size of the unit cell while keeping the density requires 8N atoms, resulting in 8
times longer run time.
 Until the development of parallel computers, simulations with a few hundred thousand atoms
were considered very large. Today, multimillion atom simulations are common and multibillion
atoms is possible with very large clusters.
 The time steps in molecular dynamics are very small. These short times make the study of
many physical processes quite challenging.

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 17/19


Molecular Dynamics in Materials Research
 Structure and Thermodynamics
 Extreme Conditions
 Defect Structure, properties and Dynamics
 MD simulations are limited by the computational burden of calculating forces and energies,
which scales with N when cut-offs are used.
 Deposition
 and many more…

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 18/19


Middle East Technical University – Department of Metallurgical & Materials Engineering

Thanks for listening.
Prepared and Presented by :

Assoc.Prof.Dr. Caner Şimşir

2019 Spring METE 350 – Multi‐scale Modeling in Materials Science and Engineering 19/19

You might also like