You are on page 1of 47

Elective Module:

CE4-33 Molecular Modelling of Fluids

Molecular Modelling of Fluids Session 8 – Slide 1 © Imperial College London


Sessions 8 & 9:
Molecular Simulation Approaches

George Jackson

Molecular Modelling of Fluids Session 8 – Slide 2 © Imperial College London


Outline
Molecular Simulation Approaches
o Session 8
• Molecular force fields
• Molecular-dynamics simulation
• Interactive Class 4 – Demonstration of molecular
simulation

o Session 9
• Monte Carlo simulation
• Advanced molecular modelling methods
• Mini Project 3

Molecular Modelling of Fluids Session 8 – Slide 3 © Imperial College London


Interactions Between Molecules
History of Intermolecular potentials
Isaac Newton (1642-1727) Principia Mathematica (1687)

• Universal law of gravitation (attraction)


m1m2
Force F =G 2
r
∂W 1
Potential F= W∝
∂r r
Molecular Modelling of Fluids Session 8 – Slide 4 © Imperial College London
Interactions Between Molecules
History of Intermolecular potentials
Inverse-Square Law:
Physical quantity (force) is
inversely proportional to the
area (square distance) from
the source.

• Universal law (e.g., gravity, electromagentism, etc.)


1
Force F∝
4π r 2
1
Potential W∝
r

Molecular Modelling of Fluids Session 8 – Slide 5 © Imperial College London


Interactions Between Molecules
History of Intermolecular potentials
Roger Boscovich (1711-1787) Theoria Philosophiae Naturalis (1758)

• Attractions and repulsions

Boscovich
model of atom

Molecular Modelling of Fluids Session 8 – Slide 6 © Imperial College London


Interactions Between Molecules
History of Intermolecular potentials
Rudolf Julius Emanuel Clausius (1822-1888) (1857-1958)

• Hard particles (hard-sphere potential and mean-free path)


∂W
Force F∝
∂r
 ∞ when r < σ
Potential W (r ) = 
 0 when r ≥ σ
Molecular Modelling of Fluids Session 8 – Slide 7 © Imperial College London
Interactions Between Molecules
History of Intermolecular potentials
James Clerk Maxwell (1831-1879) (1866)

• Maxwellian particles (soft repulsions)


1
Force F∝
r5
∂W 1
Potential F= W∝
∂r r4
Molecular Modelling of Fluids Session 8 – Slide 8 © Imperial College London
Interactions Between Molecules
History of Intermolecular potentials
Johannes Diderik van der Waals (1837-1923) (1873)
b repulsive constant
(excluded volume)

4 3
v pair
exc = πσ
3
2
• Equation of state b=v total
exc = N Aπσ 3
3

a attractive constant
a = − N A2 2π ∫ u (r ) r 2 dr
Molecular Modelling of Fluids Session 8 – Slide 9 © Imperial College London
Interactions Between Molecules
History of Intermolecular potentials
Gustav Mie (1868-1957) (1903)

• Soft repulsions and attractive interactions (van der Waals)

Molecular Modelling of Fluids Session 8 – Slide 10 © Imperial College London


Interactions Between Molecules
History of Intermolecular potentials
Edgar Grüneisen (1877-1949) (1912)

• Soft repulsions and attractive interactions (explicit)

Molecular Modelling of Fluids Session 8 – Slide 11 © Imperial College London


Interactions Between Molecules
History of Intermolecular potentials
John Edward Lennard-Jones (1894-1954) (1924-1931)

• Generalized pair LJ potential

• By 1931 Lennard-Jones settled


on the n = 12, m = 6 form
Molecular Modelling of Fluids Session 8 – Slide 12 © Imperial College London
Interactions Between Molecules
History of Intermolecular potentials
 σ 12  σ  6 
Lennard-Jones (12-6) Potential u (r ) = 4ε   −   
 r   r  

Argon

LJ

QM

Molecular Modelling of Fluids Session 8 – Slide 13 © Imperial College London


Interactions Between Molecules
Generic form of intermolecular pair potential u(r)
for simple molecules:

• Repulsive interactions
between electronic u (r )
 r 
u (r ) = C exp − 
orbitals at short Pauli
ab
 σ 
ab
ab

ab Pair Potential
inter-separations (Pauli exclusion);

• Attractive interactions u (r ) = − 3 α α I I
London a b 1
I +I
ab a b
2 rab6
due to induced electric 1
a b


dipoles at intermediate r 6
ab

inter-separations (London forces). a rAB b

Molecular Modelling of Fluids Session 8 – Slide 14 © Imperial College London


Interactions Between Molecules
Force Fields for Molecules Comprising Many Atoms:
• Diatomic molecules

Overall potential energy


  
u (rij , ωi , ω j ) = ∑∑ uab (rab )
a b

• Polyatomic molecules

Molecular Modelling of Fluids Session 8 – Slide 15 © Imperial College London


Interactions Between Molecules
Force Fields for Molecules Comprising Many Atoms:
• Dealing with polar interactions

Distributed charge models


uncharged
  sites

uij = ∑∑ uab LJ
(rab )
a b

+ ∑∑ ucdCoulomb (rcd )
TIP4P/2005 model of water c
d 
charged sites

δ+ δ − δ+
Molecular Modelling of Fluids Session 8 – Slide 16 © Imperial College London
Interactions Between Molecules
Force Fields for Molecules Comprising Many Atoms:
• Lennard-Jones

• Coulombic

• Bond stretching

• Bond bending

• Torsions

Molecular Modelling of Fluids Session 8 – Slide 17 © Imperial College London


Interactions Between Molecules
Overall Potential Energy of N Particle System:

( ) = ∑ u (r ) + ∑∑ u (r , r ) + ∑∑ ∑ u (r , r , r ) + ...
N N N N N N
N
Ur 1 i 2 i j 3 i j k
i =1 i =1 j >i i =1 j >i k > j >i

singlet pair triplet


external field ~ 90% ~ 10% < 1%

for a typical liquid state

• Effective pair potentials most commonly employed for


computational efficiency:
( )
(ri , r j )
N N
U r N ≈ ∑∑ u eff
2
i =1 j >i

Molecular Modelling of Fluids Session 8 – Slide 18 © Imperial College London


Molecular Simulation
The Rôle of Molecular Simulation:

Test of approximations Test of intermolecular


in theories potential models
SIMULATION

THEORY EXPERIMENT
Test of models
and theories

Molecular Modelling of Fluids Session 8 – Slide 19 © Imperial College London


Molecular Simulation
The Rôle of Molecular Simulation:
• Independent test of approximation made in theories with
essentially exact treatment of well defined intermolecular
potential models.
• Independent test of underlying intermolecular model in
describing the thermophysical properties of real systems.
• Study fundamental nature of physical interactions – isolate
features in complex systems.
• Provides powerful predictive capabilities to complement
experiments.
• Simulate behaviour at extreme conditions (high temperature
and pressure) where experiments are difficult or impossible.
Molecular Modelling of Fluids Session 8 – Slide 20 © Imperial College London
Molecular Simulation
Types of Molecular Simulation:
• Molecular Dynamics (MD) – time averages

Molecular Modelling of Fluids Session 8 – Slide 21 © Imperial College London


Molecular Simulation
Types of Molecular Simulation:
• Monte Carlo (MC) – configurational (ensemble) averages

Molecular Modelling of Fluids Session 8 – Slide 22 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Start with a simple cartesian reference frame:
y

Molecular Modelling of Fluids Session 8 – Slide 23 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Define a “simulation box” or “cell”:
y

Ly

Lx x
Lz

z Often (e.g., fluids) the box is cubic …

Molecular Modelling of Fluids Session 8 – Slide 24 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
… but it needn’t be:
y

Ly

Lx x
Lz

Molecular Modelling of Fluids Session 8 – Slide 25 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Insert atoms or molecules in box:
y

Ly

~ N = 103 to 109
particles

Lx x
Lz

z Volume, V = Lx Ly Lz
(Number) Density ρ = N / V

Molecular Modelling of Fluids Session 8 – Slide 26 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Choose a intermolecular pair potential, u(r), e.g., hard
sphere, Lennard-Jones, etc.
y

Ly
u(rij)
rij rij

ri
rj

Lx x (Hard potentials problematic for MD)


Lz

z Particles now have size, e.g., for hard-sphere


potential, packing fraction η = πσ 3ρ / 6 σ
Molecular Modelling of Fluids Session 8 – Slide 27 © Imperial College London
Generic Features of Molecular
Dynamics and Monte Carlo
• Although the simulation box is represented with walls:

~ 103 to 109
particles

the walls of the “simulation box” are usually assumed


to have no physical presence

Molecular Modelling of Fluids Session 8 – Slide 28 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• System Size (Boundary) Effects Due to Box
2 dimensions 1
4 N edge 2
4
Rsurf = = 1

1
N N 2

N edge
2
Fraction “associated” with surface
1
N edge
2

e.g. N = 100, Rsurf = 40%

3 dimensions 6 N face 6
2
3

Rsurf = = 1
2
N N3
1 N face
3

N edge
3
Fraction “associated” with surface
1
N edge
3

e.g. N = 1000, Rsurf = 60%


Molecular Modelling of Fluids Session 8 – Slide 29 © Imperial College London
Generic Features of Molecular
Dynamics and Monte Carlo
• Real systems have ~ NA ~ 1023 particles. Is it
possible to simulate bulk matter?

• Yes the macroscopic system can be described by


using Periodic Boundary Conditions.

• The cell is imagined to be surrounded on all sides


by exact replicas of itself, extending to infinity.

• When a particle leaves the box at one wall, its


image enters the box at the opposite face:
Molecular Modelling of Fluids Session 8 – Slide 30 © Imperial College London
Generic Features of Molecular
Dynamics and Monte Carlo
• Periodic Boundary Conditions (PBC) – No surface

… …

No boundary … …
surface

… …

Molecular Modelling of Fluids Session 8 – Slide 31 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Minimum Image Convention (MIC ) – Interactions

… …

Bulk properties
represented
No boundary … …
with N = 100 to
surface
1000 particles

… …

Molecular Modelling of Fluids Session 8 – Slide 32 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Truncating the Interactions to Speed Up Simulation
• Potentials decay slowly to infinity
– At large r, u(r) is negligible, but same effort to calculate.
– Potential is truncated, e.g., at rc ~ 2.5σ to 7σ
• Discontinuity in the force at rc
– Can give rise to anomalies
– Many workers use a shifted-force potential
– Force, f (r), is shifted vertically to go smoothly to zero at
rc
f (r)

rc r

Molecular Modelling of Fluids Session 8 – Slide 33 © Imperial College London


Generic Features of Molecular
Dynamics and Monte Carlo
• Truncating the Interactions

… …

… rc …

… …

Molecular Modelling of Fluids Session 8 – Slide 34 © Imperial College London


Recap of Statistical Mechanics
• Thermodynamics −
Mathematical relations between macroscopic properties.
No information at the molecular (microscopic) level.

• Statistical mechanics −
Microscopic description of macroscopic properties.

• Average macroscopic properties (observables)


τ
(
Aobs = A r N (t ); p N (t ) ) time
= lim
τ →∞ τ
1
∫ A (
r N
(t ); p N
)
(t ) dt
0

t1 t2 t3 tM


Molecular Modelling of Fluids Session 8 – Slide 35 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Time averages −
τ
(
Aobs = A r N (t ); p N (t ) ) time
= lim
τ →∞ τ
1
∫ A (
r N
(t ); p N
)
(t ) dt
0

• Integral over trajectory in phase space −


MD is the general numerical procedure to determine the time
evolution of coordinates rN(t), and momenta pN(t). Equations
of motion usually solved numerically for M discrete time steps.
Aobs = A(r (t ); p (t ) ) ( (ti ) )
1 M
N N
time
≈ lim
M →∞ M

i =1
A r N
(t i ); p N

t1 t2 t3 tM


Molecular Modelling of Fluids Session 8 – Slide 36 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Equations of motion (Newtonian form) −
mi a i = f i (
miri = p i = −∇ ri U r N (t ) ) ∀i particles

• Finite different approaches (Verlet algorithm, 1967)


Taylor expansion about coordinates at time t
ri (t + ∆t ) = ri (t ) + ri (t )∆t +
1
2!
1
( )
ri (t )∆t 2 + ri (t )∆t 3 + O ∆t 4
3!
1
2!
  2 1
3!
( )
ri (t − ∆t ) = ri (t ) − ri (t )∆t + ri (t )∆t − ri (t )∆t 3 + O ∆t 4

⇒ ri (t + ∆t ) = 2ri (t ) − ri (t − ∆t ) + ri (t )∆t 2 + O ∆t 4 ( )


1 2 No explicit need
≈ 2ri (t ) − ri (t − ∆t ) + f i (t )∆t for velocity
mi
Molecular Modelling of Fluids Session 8 – Slide 37 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Verlet Algorithm −
t – δt t t + δt

r
v
f
Start initial velocities v(t0) from, e.g., Gaussian or
Maxwell-Boltzmann distribution.
(At t = 0, the “previous” position is given by r(t0 – δt) ≈ r(t0) – v(t0)δt )

Molecular Modelling of Fluids Session 8 – Slide 38 © Imperial College London


Molecular Dynamics (MD)
Simulation
• Verlet Algorithm −
t – δt t t + δt

r
v
f

Given previous position and current position,


compute current force from current position and u(r).
Then, from the three “blue” quantities …
Molecular Modelling of Fluids Session 8 – Slide 39 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Verlet Algorithm −
t – δt t t + δt

r
v
f

Compute new position.


Then …

Molecular Modelling of Fluids Session 8 – Slide 40 © Imperial College London


Molecular Dynamics (MD)
Simulation
• Verlet Algorithm −
t – 2δt t – δt t t + δt

r
v
f

New position becomes current position;


Repeat until averages are obtained to required
accuracy.

Molecular Modelling of Fluids Session 8 – Slide 41 © Imperial CollegeLondon


Molecular Dynamics (MD)
Simulation
• Various Finite-Difference Algorithms:
– Verlet
• Doesn’t keep track of velocities
• Issues with precision (adding numbers of widely differing
magnitude)
– Leap-frog
• Variant of Verlet
• Better precision
• Velocities calculated – but at “half time step”
– Velocity Verlet
• Better precision than Verlet
• Keeps track of velocities
– Gear predictor-corrector
• Predict ri, vi, ai etc at t + δt based on ri(t)
• Compute forces; correct predictions based on force calculation
Molecular Modelling of Fluids Session 8 – Slide 42 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Various Finite-Difference Algorithms:
– Verlet
• Doesn’t keep track of velocities
• Issues with precision (adding numbers of widely differing
magnitude) unless time-step is small
– Leap-frog
• Variant of Verlet
• Better precision
1
• Velocities calculated – but at “half time step” t + δt
2
– Velocity Verlet
• Better precision than Verlet
• Keeps track of velocities
– Gear predictor-corrector
• Predict ri, vi, ai etc at t + δt based on ri(t)
• Compute forces; correct predictions based on force calculation
Molecular Modelling of Fluids Session 8 – Slide 43 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Various Finite-Difference Algorithms:
– Usually based on Taylor-series expansion(s)
– Mathematically equivalent

• Quality of algorithm:
– Stability of algorithm with larger δt
– Errors are numerical, e.g., round off
• round-off errors with Gear smaller than with Verlet
– Hard to say which is the “best” algorithm
• personal choice?
• some “ensemble algorithms” may be easier to implement in one
than another
Molecular Modelling of Fluids Session 8 – Slide 44 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Equilibration:
− The initial configuration and velocities are
chosen at the start. Does this cause a bias in
the simulation?

− No, the system “forgets” the initial conditions


very quickly
− how quickly depends on simulation and properties of interest
− for simulations of simple gases, only thirty or forty MD steps
needed ( ~ 200 fs)
− for polycrystals (solids) may need a few hundred ps

− Following the “equilibration period” one can start


accumulating the averages of required properties
Molecular Modelling of Fluids Session 8 – Slide 45 © Imperial College London
Molecular Dynamics (MD)
Simulation
• Equilibration:

To be continued

Molecular Modelling of Fluids Session 8 – Slide 46 © Imperial College London


Next Session

Monte Carlo Simulation

Molecular Modelling of Fluids Session 8 – Slide 47 © Imperial College London

You might also like