Molecular Dynamics for Beginnners - Universiteit Twente · PDF fileMolecular Dynamics for...
Transcript of Molecular Dynamics for Beginnners - Universiteit Twente · PDF fileMolecular Dynamics for...
1
Molecular Dynamics for Beginnners
MSM, TS, CTW, UTwente, NL
Stefan Luding, [email protected]
Stefan Luding
MSM, TS, CTW, UTwente, NL
PDFs of the presentationsRennes1 -> entespace documentsgestion des mes espacesModSim2Luc OgerStefan_Luding_Cours
Graphics xballs:/home/public/modsim/xballs
/home/public/modsim/md1.cc
2
Granular Materials
Real:
• sand, soil, rock,
• grain, rice, lentils,
• powder, pills, granulate,
• micro- and nano-particles
Model Granular Materials
• steel/aluminum spheres
• spheres with dissipation/friction/adhesion
• Introduction
• Single Particles
• Particle Contacts/Interactions
• Many particle cooperative behavior
• Applications/Examples
• Conclusion
Single particle
Contacts
Many
particle simulation
Continuum Theory
Approach philosophy
3
Deterministic Models …
Navier Stokes
Kinetic Theory
Stat. Phys.
(Kinetic Theory)
…
Theory
LB
DSMC
MC
ED
MD
Abbrev.
Lattice (Boltzmann) Models
Direct Simulation Monte Carlo
Monte Carlo (random motion)
Event Driven (hard particles)
Molecular dynamics (soft particles)
Method
DCCSE – steps in simulation
1. Setting up a model
2. Analytical treatment
3. Numerical treatment
4. Implementation
5. Embedding
6. Visualisation
7. Validation
1. Particle model
2. Kinetic theory
3. Algorithms for MD
4. FORTRAN or C++/MPI
5. Linux – research codes
6. xballs X11 C-tool
7. theory/experiment
4
What is Molecular Dynamics ?
1. Specify interactions
between bodies (for example:
two spherical atoms)
2. Compute all forces
3. Integrate the equations
of motion for all particles (Verlet,
Runge-Kutta, Predictor-Corrector, …)
with fixed time-step dti j i
j i
m →≠
=∑x f&&
j i→f
Equations of motion2
2
ii i
d rm
dtf=rr
Overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
$ ( )i j
ij
i j
r rn n
r r
−= =
−
r rr
r r
c w
ii i ic wf f f m g= + +∑ ∑
rr r
Forces and torques:
Normal
Contacts
Many particle
simulation
Discrete particle model
Contact if Overlap > 0
5
i ijf m kδ δ γδ= − = +&& &
- really simple ☺☺☺☺
- linear, analytical
- very easy to implement
Linear Contact modeli
f
δ
overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
rel. velocity ( )i jnδ = − − ⋅
r r r& v v
acceleration ( )δ = − − ⋅r r r&&
i ja a n
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
i ijf m kδ δ γδ= − = +&& &
- really simple ☺☺☺☺
- linear, analytical
- very easy to implement
Linear Contact modeli
f
δ
overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
rel. velocity ( )i jnδ = − − ⋅
r r r& v v
acceleration
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
( )( )
1if f
j
jii j i
i jij
ffa a n n f n
m m mδ
=−
= − − ⋅ = − − ⋅ = − ⋅
r r
rrrr r r r r&&
6
i ijf m kδ δ γδ= − = +&& &
- really simple ☺☺☺☺
- linear, analytical
- very easy to implement
Linear Contact model
elastic freq.0
ij
km
ω =
eigen-freq.
visc. diss.
0ijk mδ γδ δ+ + =& &&
2 02
ij ij
k
m m
γδ δ δ+ + =& &&
2
0 2 0ω δ ηδ δ+ + =& &&
2 2
0ω ω η= −
2ij
m
γη =
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
i ijf m kδ δ γδ= − = +&& &
- really simple ☺☺☺☺
- linear, analytical
- very easy to implement
Linear Contact model
elastic freq.0
ij
km
ω =
eigen-freq.
visc. diss.
( ) exp( )sin( )t t tδ η ωω
= −0v
0ijk mδ γδ δ+ + =& &&
2 02
ij ij
k
m m
γδ δ δ+ + =& &&
2
0 2 0ω δ ηδ δ+ + =& &&
2 2
0ω ω η= −
2ij
m
γη =
[]
( ) exp( ) sin( )
cos( )
t t t
t
δ η η ωω
ω ω
= − −
+
& 0v
contact duration ct π
ω=
restitution coefficient( )
exp( )
c
c
tr
tη
= −
= −0
v
v
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
7
Linear Contact model (mw=∞)
elastic freq.0
ij
km
ω =
eigen-freq.
visc. diss.
2 2
0ω ω η= −
2ij
m
γη =
contact duration ct π
ω=
restitution coeff. exp( )c
r tη= −
particle-particle particle-wall
00
2
wall
i
km
ωω = =
2 2
0 2 4wallω ω η= −
2 2
wall
im
γ ηη = =
wallwallc c
t tπω
= >
exp( )wall wall wall
cr tη= −
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
Time-scales
contact duration ct π
ω= wall
wallc ct tπ
ω= >
time-step50
ct
t∆ <=
time between contacts
n ct t<
n ct t>
sound propagation ... with number of layers L c L
N t N
experiment T
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
8
Time-scales
contact duration ct π
ω= argl e small
c ct t>
time-step50
ct
t∆ <=
different sized particlesn c
t t<
n ct t>
sound propagation ... with number of layers L c L
N t N
experiment T
http://www.ica1.http://www.ica1.uniuni--stuttgartstuttgart.de/~.de/~luilui/PAPERS/coll2p./PAPERS/coll2p.pdfpdf
time between contacts
Equations of motion2
2
ii i
d rm
dtf=rr
Overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
$ ( )i j
ij
i j
r rn n
r r
−= =
−
r rr
r r
c w
ii i ic wf f f m g= + +∑ ∑
rr r
Forces and torques:
Normal
Contacts
Many particle
simulation
Discrete particle model
Contact if Overlap > 0
9
Convection
Segregation
10
Applications of Molecular Dynamics
• Gas-/Liquid-simulations
• Granular Materials
• Electro-spray
• Polymers, Membranes, …
• Process/Battlefield-simulations
• … and many others …
Molecular Dynamics examplefrom astrophysics
11
Algorithmic trick(s) for speed-up
• Linked cells neighborhood search O(1) (short range forces)
• Linked cells update after 10-100 time-steps O(N )
What is Molecular Dynamics ?
1. Specify interactions
between bodies (for example:
two spherical atoms)
2. Compute all forces
3. Integrate the equations
of motion for all particles (Verlet,
Runge-Kutta, Predictor-Corrector, …)
with fixed time-step dti j i
j i
m →≠
=∑x f&&
j i→f
12
Rigid interaction (hard spheres)
Stiff (rigid) interactions require dt=0
Events (=collisions) occur in zero-time(instantaneously)
that means: Integration is impossible !
1. Propagate particles between collisions
2. Identify next event (collision)
3. Apply collision matrix
Why use hard spheres ?
+ advantages
• Event driven (ED) is faster than MD
• Analytical kinetic theory is available
(with 99.9% agreement)
– drawback
• Implementation of arbitrary forces is expensive
• Parallelization is less successful
13
Why use hard spheres ?
+ advantages
• Event driven (ED) is faster than MD
• Analytical kinetic theory is available
(with 99.9% agreement)
– drawback
• Implementation of arbitrary forces is expensive
• Parallelization is less successful
Algorithm (serial)
0. Initialize
• Compute all forces O(1 )
• Integrate equations of motion t+dt
• O(N ) – goto 1.
Total effort: O(N )
14
Rigid interaction (hard spheres)
0. Stiff (rigid) interactions require dt=0
Events (=collisions) occur in zero-time (instantaneously)
Integration is impossible !
1. Propagate particles between collisions
2. Identify next event (collision)
3. Apply collision matrix
Rigid interaction (hard spheres)
1. Stiff (rigid) interactions require dt=0
Events (=collisions) occur in zero-time(instantaneously)
15
Rigid interaction (hard spheres)
2. Solve equation of motion between collisions
- trajectory
- contact
- event-time
( ) ( ) ( ) 212
0 0i i it t t= + +x x v g
( ) ( ) 1 2ij i jt t r r∆ = − = +x x x
( ) ( )( ) ( )2 2
1 20 0ij ij t r r∆ + ∆ = +x v
( ){
22 2 2
1 2 0ij ij ij ij
bc
t
a
r r t∆ − + + ∆ ⋅∆ + ∆ =x x v v1442443 14243
2
1,2
4
2
b bt
ca
a
− ± −=
Time evolution
position
tn
time
16
Rigid interaction (hard spheres)
( )1,2 1,2 1,21 2P mr= ± ∆+′v v
Collision rule (translational)
Momentum conservation + dissipation
with restitution coefficient (normal): r
Rigid interaction (hard spheres)
Collision rule (translational and rotational)
Restitution coefficient (normal): r (tangential) rt
( )1,2 1,2 1,21 2P mr= ± ∆+′v v ( )1,2 1,2 1,21 2t Lr Iω ω′ ± ∆= +
17
Time evolution
position
time
tn tn+1 tn+2
Algorithm (ED serial)
0. Initialize
• Propagate particle(s) to next event O(1)
• Compute event (collision or cell-change)
• Calculate new events and times O(1)
• Update priority queue (heap tree) O(logN )
• O(N ) – goto 1.
Total effort: O(N logN )
18
Algorithmic trick(s) for speed-up
• Linked cells neighborhood search O(1) (short range forces)
• Linked cells update not needed !
Performance
• Short range contacts
• Linked cells neighbourhood search
Cells per particle
low density high density
19
Algorithm (parallel)
0. Initialize
• Communication between processors
• Process next events tn to tn+m (see serial)
• Send and receive border-particle info
• If causality error then rollback goto 2.
• Synchronisation (for load-balancing and I/O)
• goto 1.
Parallelization – communication
processor 1 processor 2
border zone
20
Parallelization – load balancing
processor 1
processor 4
processor 3
processor 2
Parallelization – load balancing
processor 1
processor 4
processor 3
processor 2
21
Parallelization – load balancing
processor 1
processor 4
processor 3
processor 2
Performance (fixed N)
• Required memory per processor [MByte]1 2
33
c cN c
P P
∝ + +
22
Performance (3D fixed N)
• Fixed density and number of particles
1/ 2P∝
62.10N C= =
Performance (2D fixed N)
• Fixed density and number of particles
1/ 2P∝
62 10N C= =
23
Performance (3D fixed N/P)
• Fixed number of particles per processor
1/ 2P∝
4/ 4.10N P =
Two-phaseFlows
24
Two phaseFlows
Two phaseFlows withAggregation
25
From Boltzmann (low density) …
• binary collisions
• successive collisions are uncorrelated
• neglect boundary effects
• collision rate & pressure increase with density
• add coll.-transport of energy and momentum
… to Chapman-Enskog (high density)
Elastic Hard Sphere Model
… plot streaklines
simulate 2000 particlesin a peridoc box
26
Hard Sphere Modelν=0.01ν=0.25ν=0.70ν=0.80
r=0.95
ν=0.70
27
r =0.90
r =0.80
28
Collision parameter
Contact probability – correlation function
29
Collision rate – time scale
Pressure (Equation of State – 2D)
fluid, disordered
solid, ordered
phase transition
at critical density
PV/E-1=2ννννg(νννν)
30
Pressure (Equation of State – 3D)
fluid, disordered
solid, ordered
phase transition
at critical density
Pressure (Equation of State – 3D)
solid, ordered
phase transitionat critical density
grow … shrink …P P
d
d
a
t=
31
Pressure (Equation of State – 3D)
fluid, disordered
solid, ordered
phase transitionat critical density
slow … slower …
P Pd
d
a
t=
Elastic hard spheres in gravity
• N particles
• Kinetic Energy
• What is the density profile ?
gravity
32
Elastic hard spheres in gravity
• N particles
• Kinetic Energy
• What is the density profile ?
gravity
Elastic hard spheres in gravity
• N particles
• Kinetic Energy
• What is the density profile ?
gravity
33
Elastic hard spheres in gravity
• Pressure P global equation of state
• Shear Stress
• Energy Dissipation Rate I=0
0t
∂=
∂
0 i
i
P gx
ρ∂
= − +∂
elastic steady state:
mass & energy conservation – OK
momentum balance:
dev 0ijσ =
0iu I= =
Hard sphere gas in gravity
fluid, disorderedexponential tail
solid, ordered
phase transitionat critical density
34
Shear (energy and rate)
Shear (pressure and viscosity)
p µ
35
Shear (viscosity at high density)
homogeneous
inhomogeneous
⇒ dilatancy
critical density
Structure formation
Low density -> linear velocity profile
High density -> shear localization
36
Structure formation
Shear (first normal stress difference)
37
Equations of motion2
2
ii i
d rm
dtf=rr
Overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
$ ( )i j
ij
i j
r rn n
r r
−= =
−
r rr
r r
c w
ii i ic wf f f m g= + +∑ ∑
rr r
Forces and torques:
Normal
Contacts
Many particle
simulation
Discrete particle model – gravity ?!
Contact if Overlap > 0
Astrophysics
38
Experiment & Model for Sprays
• EHDA = ElectroHydroDynamic Atomisation
• DCT/PART – Marijnissen, Geerse, Winkels, …
liquid
high voltage
Experiment
•• Deposition analysisDeposition analysis: : TinopalTinopal visible with UVvisible with UV--lightlight
•• Applications: Applications:
GreenGreen--house sprays, medical inhalation,house sprays, medical inhalation,
Spray painting, Spray painting, nanonano--particle production particle production
39
Model
•• Solve NewtonSolve Newton’’s second law for every droplet s second law for every droplet ii
•• Forces acting on a dropletForces acting on a droplet
–– electric field forceelectric field force
–– gravitation forcegravitation force
riq E
im gr
ii i
d( v )F m
dt=∑
rr
–– drag forcedrag force
–– Coulomb interactionsCoulomb interactions
2( )
8D air i air i air iC d v v v v
πρ − −
r r r r
3
04
Nj ij
i
j i ij
q rq
rπε≠
∑r
Model
40
•• Real number of droplets is impossibleReal number of droplets is impossible
•• ScaleScale--up method to simulate the spray up method to simulate the spray
–– use few droplets with increased Coulomb interactionsuse few droplets with increased Coulomb interactions
,i Coulomb q iq f q=3
04
Nq j ij
q i
j i ij
f q rf q
rπε≠
∑r
Model
•• ScaleScale--up correlation between up correlation between ffqq and and ttprodprod
•• validity scalevalidity scale--upup 0 57
1 06(1) (1)
(2) (2)
.
.q prod
q prod
f t
f t
=
0
5
10
15
20
25
30
0 0.005 0.01 0.015 0.02 0.025
droplet production time tprod (s)
Co
ulo
mb
ch
arg
e f
ac
tor
f q
(-)
<rdep> = 0.0041
stdev = 5 . 10-5
Results
41
Electro-spray Model
•• DepositionDeposition
–– experimentexperiment –– simulationsimulation
y
x
Results
42
•• Density, shape and velocityDensity, shape and velocity
0.5 m/s
Results
•• SummarySummary
–– ScaleScale--up method worksup method works
–– EHDA spray can be qualitatively simulatedEHDA spray can be qualitatively simulated
–– Some simplificationsSome simplifications in the in the modelmodel
Results
43
•• Model including scaleModel including scale--up method worksup method works
–– validity has to be checked with other experimentsvalidity has to be checked with other experiments
•• MainMain challenges (for challenges (for modelingmodeling))
–– aeroaero--//hydrohydro--dynamics coupling dynamics coupling
–– more (more (chargedcharged) ) particlesparticles (2000 (2000 toto 101044--101055) )
Open questions
• Introduction
• Single Particles
• Particle Contacts/Interactions
• Many particle cooperative behavior
• Applications/Examples
• Conclusion
Single particle
Contacts
Many
particle simulation
Continuum Theory
Approach philosophy
E x p e r i
m e n t s
44
0.0 0.2 0.4 0.6 0.80.0
0.1
0.2
0.3
0.4
0.5
Norm
aliz
ed a
dhes
ion
forc
e (m
N/m
)
Normalized load (mN/m)
Contact force measurement (PIA)
Contact Force Measurement
45
Adhesion and Friction
20 30 40 50 60 70
65
70
75
80
85
Adh
äsio
ns [n
N]
Relative Luftfeuchte (%)
-1000-750 -500 -250 0 250 500 7500
100
200
300
400
500
Reibungskraft (nN)
Andruckkraft (nN)
Friction force (Friction force (nNnN))Adhesion force (Adhesion force (nNnN))
Normal force (Normal force (nNnN))relrel. humidity (%). humidity (%)
0 50 100 150 200 250-5
0
5
10
15
20Polystryrene
Defo
rmation
Hys
tere
sis
in n
m
Force in nN
0 1000 2000 3000-5
0
5
10
15
20
Borosilicate glass
Defo
rmation H
yste
resis
in n
m
Force in nN
Hysteresis (plastic deformation)
Collaborations:Collaborations:
MPIMPI--Polymer Science (Butt et al.)Polymer Science (Butt et al.)
Contact properties via AFMContact properties via AFM
46
Equations of motion2
2
ii i
d rm
dtf=rr
Overlap ( ) ( )1
2i j i jd d r r nδ = + − − ⋅
r r r
$ ( )i j
ij
i j
r rn n
r r
−= =
−
r rr
r r
c w
ii i ic wf f f m g= + +∑ ∑
rr r
Forces and torques:
Normal
Contacts
Many particle
simulation
Discrete particle model
Contact if Overlap > 0
( )1
2 0
for loading
for un-/reloading
- for unloading
hys
i
c
k
f k
k
δ
δ δ
δ
= −
( )max
0 1 2 max
2 1min max
2
min min
1 /
c
c
k k
k k
k k
f k
δ
δ δ
δ δ
δ
= −
−=
+
= −
Maximum overlap
stress-free overlap
strong attraction
attractive for
est at:
the max. : ce
- (too) simple ☺☺☺☺
- piecewise linear
- easy to implement
Contact model
47
1 for un-/re-loadinghys
i
k
f
δ
=
- (really too) simple ☺☺☺☺
- linear
- very easy to implement
Linear Contact model
3/ 2
1 for un-/re-loadinghys
i
k
f
δ
=
- simple ☺☺☺☺
- non-linear
- easy to implement
Hertz Contact model
48
3D
Anisotropy 3D
Sound3-dimensional modeling of sound propagation
Particle Technology, DelftChemTech, Julianalaan 136, 2628 BL Delft
Stefan Luding, [email protected]
P-wave shape and speed
49
•• AgglomerationAgglomeration
–– population balance population balance –– cluster evolutioncluster evolution
–– phase transitions, cooperative phase transitions, cooperative behaviorbehavior
•• MainMain challenges (for challenges (for modelingmodeling))
–– aeroaero--//hydrohydro--dynamics coupling dynamics coupling
–– cluster cluster stabilitystability, , statisticsstatistics, , sinteringsintering, ..., ...
Open questions