28
1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo [email protected]ffalo.edu

1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo [email protected]

Embed Size (px)

Citation preview

Page 1: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

1

CE 530 Molecular Simulation

Lecture 12

David A. Kofke

Department of Chemical Engineering

SUNY Buffalo

[email protected]

Page 2: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

2

Review

Several equivalent ways to formulate classical mechanics• Newtonian, Lagrangian, Hamiltonian

• Lagrangian and Hamiltonian independent of coordinates

• Hamiltonian preferred because of central role of phase space to development

Molecular dynamics• numerical integration of equations of motion for multibody

system

• Verlet algorithms simple and popular

Page 3: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

3

Dynamical Properties

How does the system respond collectively when put in a state of non-equilibrium?

Conserved quantities• mass, momentum, energy

• where does it go, and how quickly?

• relate to macroscopic transport coefficients

Non-conserved quantities• how quickly do they appear and vanish?

• relate to spectroscopic measurements

What do we compute in simulation to measure the macroscopic property?

Page 4: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

4

Macroscopic Transport Phenomena Dynamical behavior of conserved quantities

• densities change only by redistribution on macroscopic time scale

Differential balance

Constitutive equation

Our aim is to obtain the phenomenological transport coefficients by molecular simulation• note that the “laws” are (often very good) approximations that apply to not-too-large

gradients

• in principle coefficients depend on c, T, and v

( , )0

c t

t

r

j( , )

0pT t

ct

r

q( , )

0D t

Dt v r

D c j k T q xy y x v

Fick’s law Fourier’s law Newton’s law

Mass Energy Momentum

Page 5: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

5

Approaches to Evaluating Transport Properties Need a non-equilibrium condition Method 1: Establish a non-equilibrium steady state

• “Non-equilibrium molecular dynamics” NEMD

• Requires continuous addition and removal of conserved quantities

• Usually involves application of work, so must apply thermostat

• Only one transport property measured at a time

• Gives good statistics (high “signal-to-noise ratio”)

• Requires extrapolation to “linear regime”

Method 2: Rely on natural fluctuations• Any given configuration has natural anisotropy of mass, momentum, energy

• Observe how these natural fluctuations dissipate

• All transport properties measurable at once

• Poor signal-to-noise ratio

Page 6: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

6

Mass Transfer Self-diffusion

• diffusion in a pure substance

• consider tagging molecules and watching how they migrate

Diffusion equations• Combine mass balance with Fick’s law

• Take as boundary condition a point concentration at the origin

Solution

Second moment

2 ( , ) 0c

D c tt

r

( , ) ( )c t r r

2/ 2( , ) (2 ) exp

2d r

c t DtDt

r

2 2( ) ( , )

2

r t r c t d

dDt

r r RMS displacement increases as t1/2

Compare to ballistic r ~ t

For given configuration, each molecule represents a point of high concentration (fluctuation)

Page 7: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

7

Interpretation Right-hand side is macroscopic property

• applicable at macroscopic time scales

For any given configuration, each atom represents a point of high concentration (a weak fluctuation)

View left-hand side of formula as the movement of this atom• ensemble average over all initial conditions

• asymptotic linear behavior of mean-square displacement gives diffusion constant

• independent data can be collected for each molecule

2 ( ) 2r t dDt

2 21 1( ) ( ) ( ) ( , ; 0)N N N Nr t d d r t t p r r r p

2r

t

Slope here gives D

2 21( ) ( )iNr t r t

Einstein equation

Page 8: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

8

Time Correlation Function Alternative but equivalent formulation is possible Write position r at time t as sum of displacements

0 0

( ) ( )t t

dt d d

dt

rr v

dt

dt

dt

r(t)v

Page 9: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

9

Time Correlation Function Alternative but equivalent formulation is possible Write position r at time t as sum of displacements Then

0 0

( ) ( )t t

dt d d

dt

rr v

1

1

21 1 2 2

0 0

1 2 2 10 0

1 2 2 10 0

1 2 1 20 0

10 0

0

( ) ( ) ( )

( ) ( )

2 ( ) ( )

2 (0) ( )

2 (0) ( )

2 2 (0) ( )

t t

t t

t

t

t t

t

r t d d

d d

d d

d d

d d

dDt t d

v v

v v

v v

v v

v v

v v

r2 in terms of displacement integrals

rearrange order of averages

1 2 1 2 1 2( ) ( ) 2 ( )

correlation depends only on time difference, not time origin

1 2substitute

0

1(0) ( )D d

d

v v Green-Kubo equation

t

Page 10: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

10

Velocity Autocorrelation Function

0

1(0) ( )D d

d

v v

( ) (0) ( )C t t v v

Backscattering

Definition

Typical behavior

Zero slope (soft potentials)Diffusion constant is area under the curve

Asymptotic behavior (t) is nontrivial (depends on d)

2(0) /C v dkT m

Page 11: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

11

Other Transport Properties

Diffusivity

Shear viscosity

Thermal conductivity

0

1( ) (0)xy xydt t

VkT

12

1

( )N

yxy xi i ij y iji

i i j

m v v x f r

20

1( ) (0)T dt q t q

VkT

21 12 2

1

( )N

i i iji i j

dq m v u r

dt

0

1(0) ( )D dt t

Vd

v v 1

N

ii

v v

Page 12: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

12

Evaluating Time Correlation Functions Measure phase-space property A(rN,pN) for a sequence of time

intervals

Tabulate the TCF for the same intervals• each time in simulation serves as a new time origin for the TCF

A(t0) A(t1) A(t2) A(t3) A(t4) A(t5) A(t6) A(t7) A(t8) A(t9)

A0A1 A1A2 A2A3 A3A4 A4A5 A5A6 A6A7 A7A8 A8A9

A(t0) A(t1) A(t2) A(t3) A(t4) A(t5) A(t6) A(t7) A(t8) A(t9)

+ + + + + + + + +...( ) (0)A t A

A0A2 A1A3 A2A4 A3A5 A4A6 A5A7 A6A8 A7A9

A(t0) A(t1) A(t2) A(t3) A(t4) A(t5) A(t6) A(t7) A(t8) A(t9)

+ + + + + + + +...(2 ) (0)A t A

A0A5 A1A6 A2A7 A3A8 A4A9

A(t0) A(t1) A(t2) A(t3) A(t4) A(t5) A(t6) A(t7) A(t8) A(t9)

+ + + +(5 ) (0)A t A +...

tt

Page 13: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

13

Direct Approach to TCF

Decide beforehand the time range (0,tmax) for evaluation of C(t)

• let n be the number of time steps in tmax

At each simulation time step, update sums for all times in (0,tmax)

• n sums to update

• store values of A(t) for past n time steps

• at time step k:

Considerations• trade off range of C(t) against storage of history of A(t)

• requires n2 operations to evaluate TCF

1, ,i k i kc A A i n

kk-n

Page 14: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

14

Fourier Transform Approach to TCF

Fourier transform

Convolution

Fourier convolution theorem

Application to TCF

ˆ ( ) ( ) i tf f t e dt

( ) ( ) ( )C t A B t d

( ) ( ) ( )C A B

12

ˆ( ) ( ) i tf t f e d

0

0 0( ) ( ) ( )t

C t t t t v v Sum over time origins

2ˆ ˆ( ) ( )C v With FFT, operation scales as n ln(n)

Page 15: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

15

Coarse-Graining Approach to TCF 1.

Evaluating long-time behavior can be expensive• for time interval T, need to store T/t values (perhaps for each atom)

But long-time behavior does not (usually) depend on details of short time motions resolved at simulation time step

Short time behaviors can be coarse-grained to retain information needed to compute long-time properties• TCF is given approximately

• mean-square displacement can be computed without loss

Method due to Frenkel and Smit

Page 16: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

16

Coarse-Graining Approach to TCF 2.

(1) (1)v

n0

Page 17: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

17

Coarse-Graining Approach to TCF 2.

(1) (1)v

n0

(1) (2)v

Page 18: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

18

Coarse-Graining Approach to TCF 2.

(1) (1)v

n0

(1) (2)v (1) (3)v

(2) (1)v

n0

Page 19: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

19

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v

Page 20: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

20

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v

Page 21: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

21

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

n0

(2) (2)v

Page 22: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

22

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

(2) (2)v

(1) (7)v

Page 23: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

23

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

(2) (2)v

(1) (7)v (1) (8)v

Page 24: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

24

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

(2) (2)v

(1) (7)v (1) (8)v (1) (9)v

n0

(2) (3)v

n0

(3) (1)v

Page 25: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

25

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

n0

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

(2) (2)v

(1) (7)v (1) (8)v (1) (9)v

(2) (3)v

(3) (1)v

(1) (10)v

et cetera

Page 26: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

26

Coarse-Graining Approach to TCF 2.

(1) (1)v (1) (2)v (1) (3)v

(2) (1)v

(1) (4)v (1) (5)v (1) (6)v

(2) (2)v

(1) (7)v (1) (8)v (1) (9)v

(2) (3)v

(3) (1)v

(1) (10)v

n30

This term gives the net velocityover this interval

Approximate TCF3 (3) (3)(0) ( ) (0) (1)n t v v v v

Page 27: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

27

Coarse-Graining Approach: Resource Requirements

Memory• for each level, store n sub-blocks

• for simulation of length T = nkt requires k n stored valuescompare to nk values for direct method

Computation• each level j requires update (summing n terms) every 1/nj steps

• total

• scales linearly with length of total correlation timecompare to T2 or T ln(T) for other methods

2

1 1 11

1

k

k

n n n nT t

t n t nn nn

Tt

Page 28: 1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

28

Summary Dynamical properties describe the way collective behaviors cause

macroscopic observables to redistribute or decay Evaluation of transport coefficients requires non-equilibrium condition

• NEMD imposes macroscopic non-equilibrium steady state

• EMD approach uses natural fluctuations from equilibrium

Two formulations to connect macroscopic to microscopic• Einstein relation describes long-time asymptotic behavior

• Green-Kubo relation connects to time correlation function

Several approaches to evaluation of correlation functions• direct: simple but inefficient

• Fourier transform: less simple, more efficient

• coarse graining: least simple, most efficient, approximate