event driven programming - eth z...event driven programming 1 as opposed to „batch“ programming...
TRANSCRIPT
Event driven programming
1
As opposed to „batch“ programming
the flow of the programme is not
determined by loops but by events
and therefore has branching points
and conditional logic.
Paradigma in Computer Science and
important for GUI and Java.
Event driven Molecular Dynamics
B.J. Alder and T.E. Wainwright (1957)
Consider rigid objects of finite volume (e.g. billiard
balls) which normally one would like to describe
by a hard core potential which in classical MD
cannot be handled because of the infinite forces.
In „event driven“ simulations the collisions between
particles are considered as instantaneous events
and between them particles do not interact.
Event driven MD
Event driven MD
In this method no forces are calculated. Only
binary collisions are considered, i.e. interactions
between three or more particles are neglected.
Between two collision events the particles follow
ballistic trajectories. One needs to calculate the
time tc between two collisions and then obtain
the velocities of the two particles after the collision
from the velocities of the particles before the
collision from a look-up table.
The collision event (2d)
ij i jv v v
ij i jr r r
Consider the collision of two rigid disks i and j:
The „collision angle“ θ is the angle between
and relative
velocity
t
Collision time tc
0
( )
( )
ij ij i j
ij ij ij i j
r t R R
r t v t R R
2 22 2 0 02 0ij ij ij ij ij ij i jv t r v t r R R
min ( )c ij ijt t
Calculate for each pair of
particles (i, j) the time tij when
the next collision will occur.
The time tc when the next collision occurs in the
system is then the minimum over all pairs (i, j):
occuring for pair (i*, j*).
t0 is the time at which the last collision occurred and we set rij0 rij(t0) .
Propagation step
Due to the global minimization the algorithm
is not easily parallelizable nor vectorizable.
Once tc has been determined
one moves particles by:
! !i i i i c i i cr r v t t i and
Then the collision between the pair (i*, j*) occurs.
Propagation step
Knowing position and angle of a particle i
at a time t*, since which it had no collision, one
can determine its position at a later time as:
2* * *
* *
1
2
i i i z
i i i
r t r t v t t g e t t
t t t t i
One can also add simple accelerations, like gravity g.
Identifying an event
Unfortunately the loop to
calculate tc is of order N 2 when
simply checking all pairs.
Tricks due to Lubachevsky (1992)
allow to reduce this to order N log(N).
The idea behind is based on lists of events
and binary stacks.
Boris D. Lubachevsky
Lubachevsky trick
Store additionally to the particle position and
velocity for each particle the last event and the next
event, i.e. keeping track of the time of the event and
the partner particle involved in the event.
In practice, this can be implemented in 6
arrays of dimension N (number of particles in the
system). Alternatively, one creates a list of pointers
pointing to a data structure for each particle
consisting of 6 variables.
Note: Same time tij may occur twice in t (i) (i = 1..N).
From this we get for the next collision in the system:
Lubachevsky trickStoring the last event is needed as particles are only
updated after being involved in an event. For each
particle i the time t (i) is the minimal time of all
possible collisions involving this particle:( ) min ( )i
j ijt t
( )min ( )ic it t
Straightforward strategy would require order O(N).
Lubachevsky trick Organize the t (i) in increasing order implicitely in a stack:
• The vector part[m] points to particle i which is at the position m in the stack. (Sometimes also a vector pos[i] is stored giving position m of particle i in the stack.)
• This constitutes an implicit ordering of the collision times t (i) , where m = 1 points to the smallest time.
• part[1] is particle with minimal collision time:tc= t (part[1]) .
• After the event for both particles all 6 entries (event times, new partners, positions and velocities) have to be updated. Additionally, the vector part[m] has to be re-ordered.
Lubachevsky trick
Straightforward calculation of the new collision
times would be of order O(N) when checking for
both particles with all other particles. Collision
lists for each particle or division into „sectors“
(cells) reduce the order to O(1) per event. These sector boundaries have to be treated similaras obstacles, i.e. when particles cross sector boundaries a „collision event“ happens.
Lubachevsky trick
Re-ordering the heap after each event
is of order O(log N) when using,
e.g. binary trees for sorting
For sorting so called „tournament
trees“ can be used (M. Marin, 1993). For sorting algorithmssee also D. Knuth, „The Art of Computer Programming“.
Tournament tree
Example of tournament tree for 4 particles:
before collision after collision
Depth of the tree (log2N) determines maximum
number of comparisons for re-ordering.
Scaling with sizePerformance benchmark for fixed number of events
~ log (N)
Typically: number of events proportional to N
→ order of method N log(N).
Propagation step
Note: using the event lists,
once tc has been determined,
one moves only particles i*, j*
involved in the collision by:
! ! * *i ( , )i i i c i i cr r v t t i i j and
Then the collision between the pair (i*, j*)
occurs according to the collision rule.
Collision with perfect slip
, after before after beforen ni i j j
i j
p pv v v v
m m
Use energy and momentum conservation at collision.
From momentum conservation we obtain:
Insert into energy conservation:
2 2 2 21 1 1 1
2 2 2 2before before after after
i i j j i i j jm v m v m v m v
Collision with perfect slip
222 2
22 2
1 1 1 1
2 2 2 2
1 1
2 2
2 2
before before before beforen ni i j j i i i j
i j
before before before beforen n ni i i j j j
i i j
p pm v m v m v m v
m m
p p p pm v v m v v
m m m
2
22
1 1
2 2 0 2 2
2 2
n
j
before beforen n n ni i j j
i i j j
before beforeni i j j
i
m
p p p pm v m v
m m m m
p pm v m v
m
2 2
n nn
j i j
p p
m m m
Collision with perfect slip
i jeff
i j
m mm
m m
2 before beforen eff i jp m v v n n
Define „effective mass“:
Use the fact that the momentum change must be
parallel to the normal direction n and therefore
multiply this equation on both sides with n.
Collision with perfect slip
for collision between particles i and j:
2
2
jafter before before beforei i i j
i j
after before before beforeij j i j
i j
mv v v v n n
m m
mv v v v n n
m m
after before before beforei i i j
after before before beforej j i j
v v v v n n
v v v v n n
for mi =mj
Collision with perfect slip
for collision between particles i and j
make look-up table
and mi =mj :
after before ni i ij
after before nj j ij
v v v n
v v v n
Event driven simulation
perfect slip
Collision with rotation
' '
' '
' '
i i i i
j j j j
i j i j
I Rm v v n
I Rm v v n
v v v v
' ' 'i i j j i i
Rmv v n
I
i iij
d dvI r f mr
dt dt
Eq. of motion for rotation:
Consider collision
between spheres i
and j having the same
radius R, moment of
inertia I and mass m.
Collision with general slip
nij ij
tij ij i j i j
u u n n
u u n v v R n
This means a condition for the relative velocity u
between the particles at their contact point.
't tij t iju e u
1te energy conserving:
general slip condition:
1 perfect slip
0 no slipt
t
e
e
Collision with general slip
1 '
' ' ' '
' ' ' '
t t tt ij ij ij
i j i j i j i j
i i j j i i j j
e u u u
v v R n v v R n
v v v v R n
tij ij i j i ju u n v v R n
't tij t iju e u
Consider only the tangential component:
Collision with general slip
1 ' ' ' 'tt ij i i j j i i j je u v v v v R n
' ' ' 'i i j j i i j j
Rm Rmv v n v v n
I I
2
1 2 ' 2 '
1' ,
2 1
1analogously: '
2 1
tt ij i i i i
tt ijt t
i i
tt ijt t
j j
e u v v q v v n
e u mRv v q
q I
e uv v
q
Collision with general slip
1 ' ' ' 'tt ij i i j j i i j je u v v v v R n
' ' ' 'i i j j i i j j
Rm Rmv v n v v n
I I
1
2
1
1
1 2 ' 2 '
1' ,
2 1
1analogously: '
2 1
tt ij i i i i
tt ij
i i
tt ij
j j
e u R q n
e u n mRq
IR q
e u n
R q
Collision with general slip
2eff
eff
m Rq
I
1
1
1'
2 1
1'
2 1
1'
2 1
1'
2 1
tt ijn
i i ij
tt ijn
j j ij
tt ij
i i
tt ij
j j
e uv v u
q
e uv v u
q
e u n
R q
e u n
R q
make look-up table
Inelastic collisions
Even collisions between billiard balls are inelastic.
Energy is dissipated through vibrations (sound)
and eventually also small plastic deformation or
heat production. Dissipation is quantified through
the material dependent „restitution coefficient“ r
which is the fraction of not dissipated energy after
a collision. One has r = 1 for elastic collisions and
r = 0 in case of perfect plasticity.
Inelastic collisions
2afterafter finaln
n before initial beforen
vE hr r
E h v
The restitution coefficient r can be measured by
letting the particle fall from a height hinitial on a plate
of same material and measuring the rebounce
height hfinal:
, after aftern t
n n t tbefore beforen t
v ve r e r
v v
One also defines normal and tangential coefficients:
Inelastic collisions
after after before beforej i n j iv v n e v v n
steel 0.93
aluminum 0.8
plastic 0.6
examples for en:
Inelastic normal collision
nij ij i ju u n n v v n n
The normal component of the relative velocity u
between the particles at their contact point:
'n nij n iju e u
1 ' ' '
' ' 2 ' 2 '
n n nn ij ij ij i j i j
i i j j i i j j
e u u u v v n n v v n n
v v v v n n v v n n v v n n
dissipation through normal coefficient of restitution en :
' 'i j i jv v v v
using momentum conservation:
Inelastic normal collision
1 2 ' 2 'nn ij i i j je u v v n n v v n n
1 1' , '
2 2n nn n
i i ij j j ij
e ev v u v v u
For perfect slip we get:
(1 ) before beforen eff n i jp m e v v n n
Inelastic collision with general slip
2eff
eff
m Rq
I
1
1
11'
2 2 1
11'
2 2 1
1'
2 1
1'
2 1
tt ijnn
i i ij
tt ijnn
j j ij
tt ij
i i
tt ij
j j
e uev v u
q
e uev v u
q
e u n
R q
e u n
R q
make look-up table
Inelastic collapse
Physical effectis the formation of clusters in a granular gas.
Inelastic collapse
If an inelastic sphere jumps on a plate it will perform in a finite time ttot an infinity of collisions.
Finite time singularity
1 1
2 2 12 =2 1
1
initial initialj
tot jj j
h ht t r
g g r
S. McNamara and W.R. Young (1994)
Finite time singularity
7 4 3r <The effect occurs for three particles if
→ ←↔
min
ln(1 )
1
rn
r
Minimum number of particles for
which the effect occurs if r 1:
PROBLEM FOR LARGE DENSITIES
S. McNamara and W.R. Young, Phys. Fluids A, 4, 496 (1992)
TC-model for ED
Real collisions are not instantanous,
but they have a certain duration.
Solution in ED: use coefficient of restitution
dependent on time elapsed since last event
(collision with another particle).
With this one can overcome finite time singularity.
S. Luding and S. McNamara (1998)
Stefan Luding
Sean McNamara
TC-model for ED
Simplest implementation: set coefficient of
restitution to one (perfectly elastic) if time t (i)
since last collision for both partners
is less than tcontact :
( ) ( )( , ) contact contactif or
1 otherwise
i ji j r t t t t
r
More complex dependency on t (i) can be used,
adjusted to the behavior of specific materials.
TC-model for EDCompare dissipation affected by tcontact:
soft particles hard particles (TC-model)
contactt contactt
TC-model for ED
During the contact between two particles
additional collisions with other particles
can occur (non binary collisions)
and then dissipation is smaller.
Also for soft particles it is known
that they dissipate less energy
when they are in contact with
other particles.
TC-model for ED
Sand swimming in a dense granular medium
by T. Shimada et al (2009)
Inelastic collisions with MD
efff kr r m r i j i jr R R x x
( ) sin( )before
tvr t t e
2 2 20 0 , ,
2eff eff
k
m m
Consider a one dimensional damped oscillator:
with
The solution is:
with
One can also introduce inelasticity in MD
with potentials and finite time steps Δt.
viscous damping
Inelastic collisions with MD
2
4
22 2
2 2
( )
( )
4 ln
2 lnln
effm k
n
eff n
effn
n
Tr t Te
r t
m k e
m ke
e
e e
The collision time T lasts a half period T=π/ω.
A viscous damping γ uniquely describes
the dissipation by a restitution coefficient en.
2 20
20
2
eff
eff
k
m
m
Granular interaction
Straightforward implementation
of damped harmonic oscillator
(„spring-dashpot“)
leads to artificial attraction.
Solution:
Allow for repulsive forces only.
Plastic deformation
elasticplastic
Plasticity involves a remnant deformation which corresponds effectively to a change in the radius.
Plastic deformation
O.R. Walton and L.Braun (1986)
force
displacement
plastic deformation
Stiffness largerwhen moving apart
Plastic deformation
1
hys2 0
for loading
for unloading
kf
k
1 22ij ij
c
m mt
k k
asymmetric collision time
green area is dissipated energy
max max
max max 0
1
2
1
2
1
2
before
after
after
before
E f
E f
kEr
E k
max max1 2
max max 0
, f f
k k
Calculate k1 and k2 from r and tc .
Coulomb friction
inclined chute
tant nF F
µ is frictioncoefficient
Coulomb friction
if
if
0
0
t s n t
t d n t
f f v
f f v
•
•
μμs
μd
vt
s d experimentally:
μd ≈ 0.1 – 0.5
static case
dynamic case
= friction coefficientstatic dynamic
Coulomb friction with ED
for
for
1 1
1 1
before beforet eff t i j s
before beforet d eff n i j s
p m e v v t v
p m e v v n v
The tangential restitution coefficient et ≈ ½en.
Tangential momentum transfer
due to dynamic Coulomb friction:vt
S. Luding: http://www2.msm.ctw.utwente.n/sluding/PAPERS/coll2p.pdf
Coulomb friction with MD
min , ( )
min , ( )
t t d n t
t s s n t
f v f sign v
f k f sign v
s s nk f
P.A. Cundall and O.D.L. Strack (1979)
DEM = Discrete Element Method
dynamic
static
When then spring is removed.
Put spring with spring constant ks .
Peter Cundall
Applications of DEM
P.A. Cundall: Founder of Itasca Consulting group
→ PFC3D (DEM-modelling tool)
Applications of DEM
P.A. Cundall: Founder of Itasca Consulting group
→ PFC3D (DEM-modelling tool)
Applications of DEM
P.A. Cundall: Founder of Itasca Consulting group
→ PFC3D (DEM-modelling tool)
Elliptic particles (2D)
Overlap algorithm for two ellipses:2 2 2 2
1 2 1 2
1, 1a a b bx x y y x x y y
a a b b
1a2a
1b
2bar
br
Orthonormal vectors
along major axes:
1 2 1 2, and ,u u v v
2 2,T Tk k k k k k
k k
A a u u B b v v
Rotated ellipses defined
by matrices A, B:↔ ↔
J. W. Perram andM. S. Wertheim
(1985)
A B
Elliptic particles (2D)
( ) ( ) ( )TA a aG r r r A r r
where
Ellipse A can be described by the function:
1 if is inside ellipse
( ) 1 if is on ellipse
1 if is outside ellipse A
r A
G r r A
r A
Find the global minimum over all r for fixed λ by
Elliptic particles (2D)
1
2 ( ) 2 1 ( ) 0
( ) 1 ( ) 1
( ) 1 1
m a m b
m m a b
m a b
A r r B r r
Ar Br Ar Br
r A B Ar Br
( , ) ( ) (1 ) ( )A BG r G r G r
Define for λ [0,1] the function :
( , ) 0r mG r
( ) ( ) ( )TA a aG r r r A r r
Elliptic particles (2D)
( ) 1 ( ) 1m m a bAr Br Ar Br
ab b ar r r
( ) 1 ( ) 1 1m m a ab aAr Br Ar Br Br
1 1 1
1 ( ) 1
1 ( ) 1
m a ab
m a ab
A B r r Br
B A r r A r
define:
Elliptic particles (2D)
This minimum rm(λ) describes a path from the center
of B to the center of A parametrized by λ [0,1]
11 1 1
11 1 1
( ) (1 ) (1 )
( ) (1 )
m a ab
m b ab
r r A A B r
r r B A B r
and analogously :
1 1 11 ( ) 1m a abB A r r A r
Elliptic particles (2D)
11 1 1
11 1 1
( ) (1 ) (1 )
( ) (1 )
m a ab
m b ab
r r A A B r
r r B A B r
( , ) ( ) ( ) (1 )( ) ( )T Ta a b bG r r r A r r r r B r r
2 22 1 1 1 2 1 1 1
1 1
( ), ( ) ( ) (1 )( ) ( )
1 (1 ) 1 (1 )
1 (1 ) (1 )
( ) T Tm m a m a m b m b
T Tab ab ab ab
Tab
G r r r A r r r r B r r
r A A B r r B A B r
r A B A
S
21 1
abB r
Inserting the minimum rm(λ) into G (r, λ) defines
the overlap function S(λ) :
Elliptic particles (2D)
One gets for the overlap function S(λ)
(non-negative for λ [0,1]):
11 1( ) (1 ) (1 ) ,T
ab ab ab b aS r A B r r r r
11 1 2( , ) (1 ) (1 ) ,T
m m r m m r ab ab rF A B e A B e r r re
Maximize S(λ) for λ [0,1] → λm , defines contact index:
overlap if F(A,B) < 1, tangent if F(A,B) = 1, no contact if F(A,B) > 1
Elliptic particles (2D)
Set F(A,B) to unity to find distance r* at which
the particles would just touch:
*
2r abr e r
1/ 21* 1 1(1 ) (1 )Tm m r m m rr e A B e
→ overlap vector:
Obtain contact point:
*pc pcr r
Elliptic particles (2D)
example:
Influence of elongation
on packing fraction
for elliptic particles
N. Berntsen, 2001
Elliptic particles (2D)
Elliptic particles (2D)
Superellipsoids (3D)G.W. Delaney, P.W. Cleary (2009), F. Alonso-Marroquín
Generalized ellipsoid:
a,b,c: major axes
shape parameter m
(m = 2: ellipsoid)
here: a = b = 1, c = α
→ elongated particles,
platelets, etc.
1m m m
x y z
a b c
Superellipsoids (3D)
G.W. Delaney,
P.W. Cleary (2009):
1125 particles to
study shape influence
on packing fraction.
Advantage:
good control of shape
by two parameters
α and m
ijF
ijF
jv
jv
1 ( )i i ix t x t v t t
1i ii
i
v t v t tm
F
1i i it t t t
1i ii
t t tI
iT
min ,ij
n t nij ij
Yn v n v F t
l
ijF
A
ij
m g
i ijF F i ijj
TT
MD for polygons
A = overlap area
i j
two dimensions
Polygonal particles
Area detected by using
simple geometry, e.g.
area S1AiS2Aj can be
decomposed in triangles.
Many different types of
contacts, when consider-
ing polygonal particles.
Some types have to be
treated separately.
Polygonal particles
Edge-edge contact: cut area has to be added
discontinuities can appear when particles move→ change in particle area is added,such that total area changes continuously.
Torque at contact
Particles can rotate against each other:
Torque acting against this rotation also depends on
size and shape of the contact area.
Polyhedra (3d)
A.V. Potapov, C. S. Campbell (1996):
Huge number of different contact types
approximately
12000
Delauney tetrahedra
Polyhedra (3d)
A.V. Potapov, C. S. Campbell (1996)
Fragmentation by impact
SpheropolygonsFernando Alonso-Marroquin, EPL, 83, 14001 (2008)
Minkowski sum
, ,
( , ) ( , )
,
if 0 ...
0 if 0
ij i j j ii j i j
i j V E
F F d V E F d V E
d V E r r x x
y y
y
Spheropolygons
polygon of 62 edges 726 disks
Spheropolygons
Dilation Technique
Mathematical Morphology (1964)
Jean Serra
simulating snow with cylindrical ice particles (=dilated lines) :
Dilation Technique
2 2 2
2 2 2
2 2 2
2 2 2
1
1
x y z
a b c
x y z
a R b R c R
example ellipsoids
2 2 1 1d p r p r
apply elastic band algorithm on:
Force at the end of d is the tangential component of a spring along d (by substracting the normal component). → d converges towards becoming the shortest distance.
Rocks fallingon a pileusing the dilatation technique of Serra (1986)
M.A. Hopkins
DEM simulation of heap
90
Constraint DynamicsConsider rigid objects of finite volume (e.g. billiard balls) which normally one would like to describe by a hard core potential which in classical MD cannot be handled because of the infinite forces.
But we would like to know the forces so that also event driven simulations are not suited.
Idea: Interactions fully determined by constraints!
Contact dynamics is typically used for granulates, rocks, machine parts, etc.
91
Contact Dynamics (CD)
Contact Dynamics treats rigid particles and is good
for long-lasting contacts as they occur in dense
packings. At contacts one imposes constraint forces
that prevent the penetration of particles.
Advantage: Δt not related to duration of collision
P. Lötstedt (1982)
J.J. Moreau and M. Jean (1992)
Jean Jacques Moreau
Per Lötstedt
92
Signorini-Graph: perfect volume exclusion (perfectly rigid particles)
Coulomb-Graph: friction between particles with relative tangential velocity vs
Contact Dynamics
Non-smooth dynamics n
n
n
s
ss
93
First: no friction between particles with relative tangential velocity vs
considered (added later).
Thus: only normal forces at contacts!
Contact Dynamics
n
94
Contact DynamicsCollisions of rigid bodies give rise to discontinuous velocities, thus higher order schemes are not beneficial.
Use implicit Euler integration:
1( ) ( ) ( )
( ) ( ) ( )
i i ii
i i i
v t t v t F t t tm
r t t r t v t t t
exti iF R
external contact
95
2extF1
extF
Example: two particles (1D)Matrix H transforms contact forces (loc) into particle forces, HT particle velocities into relative velocities (loc).
1 12 1
2 2
1
2
( 1,1)
1
1
locn
locloc locnn nloc
n
v vv v v
v v
R RR R
R R
TH
H
1 2
1 2m m m
1v2v
96
Example: two particles (1D)
Newton‘s equation in vectorial form:
1 1 1
2 2 2
1 ext
ext
v R Fd
v Rdt m F
Use for contact quantities (transformation by H):
12 1
2
11 1 1( 1,1)
1
extlocloc loc ext extnn next
eff
FdvR R F F
dt m m mF
effective mass
2 1
1 ext extF Fm
/ 2effm m
acceleration without contact forces
97
Example: two particles (1D)
The equation has two unknowns:
Using the implicit Euler integration leads to relation:
2 1
1 1 ext ext
eff
locn l
n
lc
ocn ov t t
R t F Ft m m
vt
t
Use the constraint (Signorini) as condition
to calculate the contact force Rnloc.
2 1
1 1locl ext ex
e fn
f
ocn tdF F
d mR
t m
v
98
Example: two particles (1D)
Split solution of this equation in two steps:
, ( )( )( )
locloc n
loc freen
en ff
v t v t tm
t
tR t t
,2 1
1( ) ( )loc free loc ext ext
n nv t t v t F F tm
where
2 1
1 1locn ext ext
eff
locn loc
n
v t tR t t
v tF F
t m m
99
illustrates solutions for persisting contactand for open contact.
Example: two particles (1D)
Graphical interpretation:
Signorini condition at contact (d = 0) can be re-formulated in terms of the local velocity.
Intersect with
locnR
locnv
, ( )( )( )
locloc n
loc freen
en ff
v t v t tm
t
tR t t
100
Example: two particles (1D)
No overlap (after Δt):
Graph is shifted by –d/Δt to account for non-zero distance.
Now intersection works for all contact cases:
• no contact
• closing contact
• persisting contact
• opening contact
locnR
locnv
,loc freenvd
t
effm
t
( ) ( ) ( ) 0locnd t t d t v t t t
→ simple implementation
101
i.e. no contact or closing contact.
Otherwise a contact persists or forms during the time step, i.e. the gap d closes. In that case impose:
and thus, the contact force can be calculated:
Example: two particles
,( ) ( ) ( ) 0loc freend t t d t v t t t
( )( ) ( ) 0 ( )loc loc
n n
d td t v t t t v t t
t
Check what would happen without the contact force.
0locnR
,( ) /( )
( )loc freen
efo
fl cn
d t t v t tR m
tt t
If then
102
Dissipation
Note: Collisions between grains are usually inelastic, i.e. energy is dissipated through vibrations (sound) and eventually also small plastic deformation or heat production.
Here we assumed the simplest case of perfect plasticity, where the full energy is dissipated.
103
Coulomb friction
if
if
0
0
s s n s
s d n s
f f v
f f v
•
•
μμs
μd
vs
s d experimentally:
μd ≈ 0.1 – 0.5
static case
dynamic case (dissipation)
= friction coefficientstatic dynamic
104
Coulomb-Graph: Friction between particles with relative tangential velocity vs ,simplification
Additional unknown, solution as for normal force:Intersect with linear relation of and obtained from Newton‘s equation of motion.
Note: for spheres not coupled to normal direction!
Contact Dynamics
n
n
s
ss
loctR
loctR
loctv
s d
105
Contact DynamicsOne frictionless contact in 3D, spherical particles:
Angular velocities and torques are not needed.
Particles velocities and forces are:,
1,2 1,2 1,2,
1,2 1,2 1,2 1,2 1,2 1,2,
1,2 1,2 1,2
, ,
x x x ext
y y ext y ext
z z z ext
v R F
v v R R F F
v R F
(R1,2 are forces on the particles due to contact forces)
At contact: only normal components Rnloc and vn
loc
have to be considered.
106
Simple transformation:
Note: compressive contact force is positive
Contact Dynamics
One frictionless contact in 3D, spherical particles:
normal vector:
2 1 1 2( ), ,loc loc locn n nv n v v R nR R nR
1 2
1v
2vn
x
y
z
n
n n
n
107
Simple geometrical transformation:
For friction one would have to add angular velocities and torques.
Contact Dynamics
2 1 1 2( ), ,loc loc locn n nv n v v R nR R nR
1 1
2 2
,loc T locn n
v Rv H HR
v R
,, , , , ,Tx y z x y zH n n n n n n
→ Matrices H and HT:
108
Contact Dynamics
General case:
Consider N particles with generalised coordinates q and forces R, Fext .
11 1
1 1 0
, ,
0
ext
ext
extN N N
NN
Rv F
T
q R F
v R F
T
In 2D one has 3N components (2 translational and 1 rotational per particle) ,
in 3D one has 6N components (3 translational and
3 rotational per particle) .
109
Contact DynamicsContact network:
Be c the number of contacts. Define generalised relative velocities u and contact forces Rloc :
1 1
,
loc loc
loc
loc locc c
v R
u R
v R
2D: 2c components (1 normal and 1 tangential per contact)
3D: 3c components (1 normal and 2 tangential per contact)
Here we do not consider contact torques.
110
Contact Dynamics
,T locu H q R HR
The transformation H is given by a
2c×3N matrix in 2D and a 3c×6N matrix in 3D.
( ) ( ) extM q t R t F Newton‘s equation of motion:
1 0 0 0
0 0
0 0 0
i
i i
N i
m
M m
I
with in 2D
Define the diagonal mass matrix M:
111
Contact Dynamics
,T locu H q R HR
( ) ( ) extM q t R t F
1 1
1 1
( )
T
T ext
T T exloc t
H q
H M R t M F
H M H H M F
u
R
1 1 ( ) ( ) extq t M R t M F
112
1 1TeffM H M H
Contact Dynamics relation between the contact quantities:
1 1locT T extH M H H Mu R F
effective inverse mass matrix
inverse mass matrix
(( ) )( )
free
efl c
fo u tu t t
R tt
tt
M
implicit Euler integration:
113
Contact Dynamics
Perform direct inversion of local inverse mass matrix.
Then implement the constraints by checking if contacts close and determine u(t+Δt) .
This is difficult because it is not unique.
iterative solution(neighboring contacts as external forces)
114
Contact Dynamicswithout friction with friction
More examples:http://alert.epfl.ch/Archive/ALERT2008/school08/Radjai&Dubois/slides_alert2008_public.mov
many applications: granular materials, masonry, ...
115
CD: more contact laws
rolling friction:Add additional contact torque. more unknowns(1 in 2D, 3 in 3D) more constraints
ωr
r,eff
T loc
r,eff
FN FC+( )
FN FC+( )
−μ
μ
cohesion:Add to Signorini conditionan attractive force within a range.
Many variations of contact laws are possible.
116
CD: more contact laws
Collapsing soil/granular structure:Gravity leads to collapse, cohesive force stabilizes structures.
Two extremes:
• very fast deposition
• very slow depositon
117
Non-spherical objects
Up to now only spherical particles. Non-spherical objects can be composed of spherical objects, e.g. by additional constraints between particles.
For non spherical rigid objects of finite volume (e.g. polyhedra) this can be done approximately.
Contact Dynamics
Sandstorm
Particles in Fluids
• Sedimentation
• Fluidized beds
• Size segregation under shear
• Hydraulic transport
• Filtering
• Saltation
• Rheology of suspensions (e.g. blood)
• Sandstorms
• Oceanic pollution and planktion
• Volcanic explosions....
Fluidized Bed
Incompressible Navier-Stokes equation:
Equation of motion of fluid
1( )
uu u p u
t
0u
and are velocity and pressure field of the fluid, and its density and dynamic viscosity.
( )u x
( )p x
0
( ) u const
t
Reynolds number Re
Reuh
u is characteristc velocityh is characteristic length
µ is dynamic viscosity
Re << 1 is the Stokes limit (laminar flow)
Re >> 1 is turbulent limit (Euler equation)
Solvers for NS equation
• Penalty method with MAC
• Finite Volume Method (FLUENT)
• Turbulent case: k-ε model, DNS, LES or spectral method
• Lattice Boltzmann Method
• Discrete methods: DPD, SPH, SRD, DSMC..
CFD = Computational Fluid Dynamics
One particle in fluid
0vu
fluid
e.g. pull sphere through fluid
0v
Γ
no-slip condition:
create shear in fluid : exchange momentum
movingboundary condition
Drag force
AdFD
jiij ij
j i
uup
x x
drag force
stress tensor
η = µ is dynamic viscosity
(Bernoulli‘s principle)
Homogeneous flow
Re << 1 Stokes law:
FD = 6π η R u(exact for Re = 0)
R
u
Re >> 1 Newton‘s law: FD = 0.22π R2 u2
general drag law:
CD is the drag coefficient
22Re
8
D DF C
Drag
no dragStokesNewton
Compare Sphere and Cylinder
Drag coefficient CD
0.687241 0.15Re Re 1000
Re0.44 Re 1000
p pD p
p
C
3 22 3
321 , Re
Ref av
D pp
DC
v u
Examples for empirical relations for drag coefficient
Gidaspow, 1994:
Chen, 1997:
Drag
Inhomogeneous flow
In velocity or pressure gradients: Lift forcesare perpendicular to the direction of the external flow,
important for wings of airplanes.
lift force: CL is lift coefficient21
2L LF C Au
Torque on particle
CMT r dA
vorticity
Magnus effect
Gustav Magnus
important for soccer22MF R u
when particle rotates
for cylinder:
Many particles in fluids
22
Re8 DD CF
•The particles are dragged bythe fluid with a force:
simulating particles moving in a sheared fluid
This image cannot currently be displayed.
•The fluid mediates an effectiveforce between the particles ,called
•„hydrodynamic interaction“.
1 2 1 2
1 2
r r R R
R R
1, Re 1
Lubrication
Sabri Ergun, 1952
Drag at high volume fraction
Re << 1
FD = 6π K η R u
4.7
3
1 , 0.225 , 0.2 3 1
K
Stokes limit
Stokesian Dynamics (Brady and Bossis, 1985)
John F. Brady
Georges Bossis
3
1( )
8S r r
G rr r
Stokeslet = Greens function of the Stokes equation
1up u
t
Re = 0
Stokes equation
Stokes limit
Hydrodynamic interaction between the particles:
( )i ij i j jj i
u M r r u
mobility-matrix
for Re = 0 mobility matrix exact
invert a full matrix only a few thousand particles
1
( ) i
N S
ii
u x G n d
General solution
for N particlesthrough convolution:
ijk uup
x x
Calculation of stress tensor on a grid
Calculate pressure and velocity gradientthrough interpolation.
ijk
ijkf n
Calculate drag forceat surface element ijk
Re < 100
Numerical technique
Calculate stress tensor directly by evaluating the gradients of the velocity field
through interpolation on the numerical grid,e.g. using Chebychev polynomials:
0
N
n nn
f x c T x
cos arccosh cosh arccosnT x n x n x
0
1
22
1 1
1
2 1
2n n n
T x
T x x
T x x
T x xT x T x
1 1( ) walls
uu u p u f
t
1 21
1 1
( )
k kk k k kk
u up u u u f
t
Momentum loss of fluid
Fluid goes through particle but loses momentum.Momentum should not be substracted at center ofmass of the particle but at each surface element.
Impermeable particles
commercial discrete volume solver on an adaptive triangulated mesh
Constantly remeshing ,is computationally very costly.
Numerical technique for 0 < Re < 200
Method of A.L. Fogelson and C.S. Peskin:Advect markers that were placed in the particle and then put springs between
their new an their old position.These springs then pull the particle.
Sedimentation
• Sedimentation ist the descent ofparticles in a fluid due to the action ofgravity.
• The interaction between the particlesand the fluid is given by the conditionthat the velocity of the fluid on theentire surface of each particle is equalto the velocity of this particle.
• Measure settling velocity, i.e. velocityof the upper front.
• If particles are of different speciesthen one has several fronts.
• Open question: size dependence ofthe density fluctuations.
Sedimentation
comparing experiment and simulation
Glass beadsdescendingin silicon oil
using penaltymethod withMAC grid
Sedimentation velocity
1954
settling velocity vS = v0 (1-Φ)5
Φ = volume fraction of particles
Sedimentation of platelets
Oblate ellipsoids descendin a fluid under the actionof gravity.
This has applications inbiology (blood), industry(paint) and geology (clay).
Draft, Kiss and Tumble
draft kiss tumble
Draft, Kiss and Tumble
vertical velocity horizontal velocity
Lattice Boltzmann Method
Sauro Succi : The Lattice Boltzmann Equation for Fluid Dynamics and Beyond
(Oxford Univ. Press, 2001)
where the equilibrium distribution is defined as:
Define on each site x of a lattice on each outgoing bond ia velocity distribution function f(x,vi,t) which is updated as:
weights wi in equilibrium distribution:
two dimensions (D2Q9)
three dimensions (D3Q19)
Lattice Boltzmann Method
Tony Ladd1994
Suspensions of solid particles with LBM
Apply no-slip condition, i.e. elastic bounce back for each individual streamimg direction that crosses boundary.
Sedimentation
Settling of four spherocylinders
Shear flow
A.J.C. Ladd, J.Fluid Mech., 1994
using Lattice
BoltzmannMethod
Shear cell
Shear flow
Velocity distributions under shear
exponential tailsJens Harting 2006
using LBMtechnique ofT. Ladd
different number of particles N
average over1010 velocities
Stochastic Rotation Dynamics (SRD)
• introduction of representative fluid particles
• collective interaction by rotation of local particle velocities
• very simple dynamics, that recovers hydrodynamics correctly
• Brownian motion is intrinsic
A. Malevanets and R. Kapral (1999)
or Multi-particle Collision Dynamics (MPC)
Sedimentationusing SRD
Péclet number :Pe = Lu/D = 5
by J. Padding
• Assume spherical particles
• Use molecular dynamics for the simulation
• DLVO potentials describe the dominant
particle-particle interaction:
- screened Coulomb potential
(ions / counterions), repulsive
- Van-der-Waals-attraction for
short distances
• Hertz force for overlapping particles
• Lubrication force ~
Simulating clay
Al2O3 interaction potentials
Shear flow
Shear viscosity
Viscosity at small vs
Martin Hecht, 2006
Density correlation
Martin Hecht, 2006
Direct Simulation Monte Carlo (DSMC)
G.A. Bird (1963)
Good for large Knudsen numbers,i.e. mean free path is greater thana representative physical length scale.Popular in aerospace engineering.
G.A. Bird, Molecular Gas Dynamics and Direct Simulation of Gas Flows, Clarendon, Oxford (1994) F. Alexander and A. Garcia, Computers in Physics, 11 588 (1997)
Divide the system into cells and generate particles in each cell according to desired density, fluid velocity, and temperature.For fluid velocity and temperature, assign to each particle a velocity from Maxwell-Boltzmann distribution.
Molecules and “Simulators”
Physical Molecules DSMC Simulators
In DSMC the number of simulation particles (“simulators”) is typically a small fraction of the number of physical molecules.Each simulator represents Nef physical molecules.
Nef = 2
Accuracy of DSMC goes as 1/N; for traditional DSMC about 20 particles per collision cell is the rule-of-thumb.
DSMC Collisions
• Sort particles into spatial collision cells
• Loop over collision cells– Compute collision
frequency in a cell– Select random collision
partners within cell– Process each collision
Collision pair with large relative velocity are more likelyto collide but they do not have to be on a collision trajectory.
Selectedcollisionpartners
Thermal Walls
A more realistic treatment of a material surface is a thermal wall, which resets the velocity of a particle as a biased-Maxwellian distribution.
x
y
z
uw
Walls can also be part-thermal, part-specular.
DSMC vs ED
Dissipative Particle Dynamics (DPD)
P.J. Hoogerbrugge and J.M.V.A. Koelman (1992)
Make MD of soft particles with forces:
with conservative force:
random force:
and dissipative force:
C R Di ij ij ij
i j
F f f f
1 1
0 1
ij ij ij ijCij
ij
a r r rf
r
( ) R Rij ij ij ijf w r r
( ) D Dij ij ij ij ijf w r v r r
unit vector indirection connectingthe centers of mass
Dissipative Particle Dynamics (DPD)
( ) R Rij ij ij ijf w r r ( ) D D
ij ij ij ij ijf w r v r r
Both forces conserve momentum. θij is a Gaussian distributed random number.
22 1 1
( ) ( ) 0 1
ij ijD Rij ij
ij
r rw r w r
r
The weight functions wR(rij) and wD(rij) must be chosen such as to fulfill thermal equilibrium . One possibility is:
P. Español and P. Warren (1995)
random force dissipative force
Dissipative Particle Dynamics (DPD)
Dense suspension of ellipsoids to simulate the rheology of high performance concrete using more than one million fluid particles (NIST)
Hybrid simulation
A. Donev
Flow through a porous medium
two-dimensionalrealization by
placing randomlydisks that do notoverlap (RSA)
important foroil recovery,filtration andfluidized beds
Stokes number:
uinertial impaction
direct interception
diffusion
Massive tracerparticles of diameter dp,
velocity upand density p
are released.
Filtration
δ D
x
y
u
St : = D and St 0: = 0
= capture efficiency
Filtration: Trajectories of particles
St = 2.0610-4
St = 8.1210-3
Stokes number:
Non-Newtonian fluids
11 2 , nA Cross fluid:
Bingham fluid:
0 00
0 0 0
0 0
for
for BA
Example: styling gel, i.e.vinyl acetate/vinylpyrrolidone copolymer (PVP/PA)
Example: tooth paste
Non-Newtonian flow through filter
Cross fluid
porosity ε = 0.7
Particles in Turbulent Fluids
• Saltation
• Aerosols
• Fluidized beds
• Local plankton concentration
• Pneumatic transport
• Turbulent mixing
Aeolian Saltation
The Mechanism of Saltation
h
Windh
• Grains are drawn from the ground and accelerated by the wind. With moreenergy they impact again against the surface and eject a splash of newparticles. In this way more and more grains saltate until saturation is reacheddue to momentum conservation.
Ralph A. Bagnold
The turbulent air flow
*
0
lnx
u zu z
z
logarithmic velocity profile of the horizontalcomponent of the velocity as function of height y:
0.4 is the von Kármán constant
z0 is the roughness lengthLudwig Prandtl, 1924
wind strength
Sketch of the system
• Logarithmic wind profile above the sand bed starts at height , which must be determined
0 0*
0
( ) lnx
z z huu z
z
0h
2 ( )( )
8p
p p
dF C u v u v
D D
DEM model of bed in moving fluid
The fluid exerts on the particles the drag force:
i i D collm x F F
3 22 332
1 , ReRe
f avD
DC
v u
coll n ij n ij ij
i jij
i j
ij i j i j
k c
R R
F n
x xn
x x
x x
Dissipative collisions between particles
kn elastic spring constant, cn damping coefficient
2exp
4n
n
eff n n
ce
m k c
The restitution coefficient en
is given by cn through:
Including Feedback
• The reaction-drag forces exerted by the particles on thewind slow down the wind.
• The grain-stress generated by the accelerated particles iscalculated through (A = area of sand bed, f = force density)
• The grain-stress modifies the shear velocity in the saltationlayer by
• With this one determines the wind profile using
:
( ) ( ') 'i
ig
i z zz
Fz f z dz
A
* 2*
( )( ) : 1 g
a
zu z u
u
( )u zdu
dz z
Apply drag forces on particles
( )jtV z
1( ) ( )j jt tv z v z 0
1( ) : ( )jt tv z v z
Wind Profile
Calculate drag forces
Calculate grain stress
Integrate
( )jtV z
[ ( )]i tF V z
:
( )i
ig
i z z
Fz
A
( )u zdv
dz z
* 2
*
( )( ) : 1 g
a
zu z u
u
: 1j j
Feedback Algorithm
u* = 0.5m/s u* = 1.0m/s u* = 1.5m/s
Aeolian Saltation
Role of collisions in preferential concentation
Pico-Phytoplankton distribution
Particles in Turbulent Flow
Particle motion
0.687
3 ,
8
2421 0.15Re Re 1000
, ReRe0.44 Re 1000
,
fDi i drag coll drag i i i
i i
i ip pD pp
fp
i jcoll n ij n ij ij ij
i
Cm m
R
RC
k c
x F F F u v u v
u v
x xF n n
x
j
ij i j i jR R
x
x x
2exp
4n
n
eff n n
ce
m k c
K. Alvelius, Phys. of Fluids 11, 1880 (1999)
The random force g (x, t) should generate an isotropicand homogeneous turbulent velocity field.To be divergence free its Fourier transform must fulfill:
, 0t k g k
1 2, , ,ran rant A t B t g k k e k k e k
Turbulent forcing
1 2 2
1
0
y
x
x y
ke k
k k
2 2 22 2
1 -
x z
y z
x yx y
k ke k k
k k k k k
Turbulent forcing
12exp sin
2ran
S kA i
k
22exp cos
2ran
S kB i
k
21exp 1 , 2 1
0 otherwisef fA c k k k kS k
with
121exp
b
a
kin
fk
PA c k k dk
t
and
1
2in i iP g t g t
where the powerinput is given by:
kf corresponds to the length scale of energyinjection
Preferential concentration
2d slice of a 3d system
Particle mixing in turbulent channel flow
• Consider a channel through which particles are dragged by a turbulent flow.
• Do not calculate the whole fluid field, but rather use a stochastic approach to model the influence of the turbulent velocity field on the particle movement.
• The particle density is constant throughout the system.• Concentrate on a small region in the center of the channel, which means
we ignore the effects of the walls.• Study the mixing of two types of spherical particles.
Particle mixing in turbulent channel flow
Fluid velocity inside the channel: )()( tuutu t
mean fluid velocity intrinsic fluctuations
Use the empirical drag law to couple the particle movement to the fluid velocity )(tu
Intrinsic velocity fluctuations
The mean fluid velocity is kept constant:
The fluctuating part is determined by using the stochastic model introduced by A. M. Reynolds (Phys. Rev. Lett. 91 (2003), 084503) that reproduces well the experimentally observed distributions and autocorrelations of velocities and accelerations of tracer particles in fully developed turbulence.
The model calculates a time series for the velocity of a tracer particle. For every “real” particle we generate a tracer particle and evolve it in time. The velocity of the tracer particle then gives us a stream line and the “real” particle is dragged into the direction of this line.
.constu
)(tut
1 2 11
1 1 1 1 1
2 1 1 1 12
2
2 ,
t
t
a
t t La
u L L
t t t t
d T dt T dd
da T t a dt T tdt
T t T t ddu a dt dx u dt
ln
Stochastic differential equations for and each component of the acceleration at .
Intrinsic velocity fluctuations
Log of local dissipation rateA.M. Reynolds (2003)
Particle mixing in turbulent channel flow
QM in a nutshell I
2*
( )
1
r
r r r r
r dr
wave function
QM deals with wave functions. Their absolute value is related to the probability density of finding a particle at a given position.
Probablitiy of finding a particle at position r.normalization
226
QM in a nutshell II
2
2
2
H E
H V rm
The wave functions are the eigenfunctions of the Schrödinger equation (SG). Their eigenvalues correspond to their energies E.
Hamiltonian with kinetic energy and potential V(r)
Time independent SG
The ground state is the eigenfunction corresponding to the smallest eigenvalue. This is the wave function of interest.
227
QM in a nutshell III
For more than one particle the wave function depends on all particle positions.
The density has now the meaning of the probability of finding the particles at the given positions.
*
1 1 1
*
1 1 1
, , , , , ,
, , , , 1
n n n
n n n
r r r r r r
r r r r dr dr
normalization228
For more than one particle the wave function has a symmetry: „Bosons“ are symmetric and „Fermions“ are antisymmetric when exchanging two particle positions.
1 1
1 1
,..., ,..., ,..., ,..., ,..., ,...,
,..., ,..., ,..., ,..., ,..., ,...,
i j n j i n
i j n j i n
r r r r r r r r
r r r r r r r r
Symmetric (ex: photons, like to be in the same state):
Antisymmetric (ex: electrons, don‘t like to be in the same state):
229
QM in a nutshell IV
QM in a nutshell V
QM particles own a special character: their spin.
Electrons can have two kind of spins (up or down).
Since electrons are fermions every state can be occupied only once.
Different spins count as different states.
Therefore every eigenfunction can be occupied with an up- and a down-spin electron.
230
Many particles
For many-particle wave functions often single body wave functions are glued together. To keep the antisymmetry the Slater determinant is used:
1 1 1
1
1
1, ,
!
N
N
N N N
r r
r rN
r r
Calculation of this determinant is a computationally expensive job.
231
Note: Using Slater determinants of single body wave functions is already an approximation. The differences are called correlation effects.
Electrons vs ionsQM is important for particles with small masses:
22
2T
m
For large particle masses
as ions (atomic cores) the QM is not anymore important.
Electrons need to be treated with QM, ions not.As the ion mass is 3 orders of magnitude larger than the electron mass, the motion can therefore be separated (Born-Oppenheimer).
=> It makes sense to calculate the electron distribution for fixed ions.
232
Born-Oppenheimer Approximation
The Born-Oppenheimer Approximation implies thatthe time step for the motion of ions has to be smallenough, such that when ions move, the electrons donot skip any energy level transition.
1( ) ( ) ( ) ( )i i i iR R R R R
R u t
Small time step
BO Approximation Hydrogen Molecule
Otherwise the dynamics is not correct as for example in the oscillationof the hydrogen molecule.
Large time steps
235
Hohenberg-Kohn Theorem
(1964)
Pierre Hohenberg Walter Kohn . (Nobel prize 1998)
If the ground state is not degenerated, all information of this ground state is present in its density distribution. All the observables can be calculated by only using the density distribution. The knowledge of the wave functions is not needed.
E E
Kohn – Sham equation
(1965)
Lu Jeu Sham
Proposing non-interacting single particles moving in a potential, only depending on the density distribution. Many-particle effects are handled using correction terms.
Walter Kohn
236
Kohn – Sham energy
2* 2
*
*
( ) ( )2
1 ( ) ( )( ) ( ) '
2 '
( ) ( )
( ) ( )
KS i i i effi
eff extern xc
i i ii
i j ij
E f r r dr Vm
r rV r V r dr dr dr E
r r
r f r r d r
r r d r
237
occupation number
Instead of Slater determinant use single particle wave functions.
orthonormality condition
kinetic energy
xc x cE E E
correction for many particle effects
exchange
correlation
22
*
( ) ( ) ( )2
1 ( ) ( ')( ) ( ) ( ) '
2 '
( ) ( )
eff i i i
eff extern xc
i j ij
V r r rm
r rV r r V r dr dr E
r r
r r dr
Kohn – Sham equation2
( ) i ii
r f
xE
Since no Slater determinant is used, the antisymmetry is missing. It is considered by adding a correction term in .
potential from ions
238
orthonormality
xcE
Exchange-Correlation Energy
239
1 21 1 2
1 2
( , )1[ ] ( )
2xc
D r rE dV r dV
r r
Exchange-correlation hole density: Probability offinding an electron at r1, knowing that there is anelectron at position r2.
Until here, density functional theory is formallyexact to describe a many body quantum system.Since computing the exchange-correlation holedensity is too complicated, there areapproximations.
Kohn – Sham orbitals
Unlike for real many-particle orbitals theeigenvalues of the single particle orbitalshave no physical meaning. The sum ofthem is not the total energy!
The only physical meaning of the singleparticle wave functions is that they yieldthe correct density.
240
Local density approximation (LDA)
How to get the correction term?
The free electron gas can be calculated analytically using Slater determinants.
The LDA approximates the Kohn-Sham correction energy locally with the correction energy of the free electron gas with the same density.
1
3 433 3
( ) ( )4
LDAx xE r dr r dr
Using the free electron gas
241
Local density approximation (LDA)
As single body wave functions are used, also a correction to consider the correlation effects has to be included. This correction is called . And it is also treated using LDA assuming that the electrons are homogeneously distributed.
No analytic expression for is known.
242
( )LDAc cE r d r
cE
c
Local density approximation (LDA)
LDA has been applied for calculations of band structures and the calculation of the total energy in solid-state physics.
In quantum chemistry it has been much less popular since chemical bonds need more accurate results.
=> A better approximation is needed.
243
Generalized gradient approx. I
It is possible to improve the LDA by adding a dependence on the gradient of the density. This approach is called General Gradient Approximation (GGA).
GGA improves the resulting energies.
( ), ( )GGAx xE r r dr
More and more derivatives could be added, but results do not improve much.
244
and similar for the correlation correction
245
Generalized gradient approximation II
The most used GGA is the one of Axel Becke (his paper has been cited more than 17000 times) .
Axel Becke
(1988)
Several proposals exist for such an approximation:
2
43
LGC LDAX XE E d r
2
43
1
4 3
1 6 sinh
with , 0.0042
Becke LDAX X
xE E dr
x x
x
Frank Herman
(1969)
Generalized gradient approx. III
GGA gives much better results than LDA. They can be used to calculate all kinds of chemical bonds like covalent, ionic, metallic, and hydrogen bridges.
However DFT using GGA fails to describe van der Waals interactions properly.
246
Improving the van der Waals interactions
Grimme (2006) introduced an additional term:
In this empirical correction are parameters and is the distance between two ions.
247
16
6 61 1
/ 1
1
1 ij r
ijN N
disp dmp iji j i ij
dmp ij d R R
CE s f R
R
f Re
,,6 6 rij Rs C
ijR
Implementation of wave functions
For the implementation of the wave functions, the single particle wave functions are often expanded in an orthonormal basis system with some cutoff.
In solid state physics a plane wave basis is often used (plane wave functions are not localized, as the electrons in crystals).
j jk kk
c
248
ikxk e
Number of wave functions
For 16 water molecules a cutoff of about 70 Ry is needed. This corresponds in this case to about 15000 plain waves per electron.
249
Localized basis sets
For localized basis sets so called „Pulay forces“ appear. These are numerical forces coming from the finite basis. These Pulay forces can be up to an order of magnitude bigger than the physical forces and have to be corrected.
250
2
( ) l rl lr c r e Example: Gaussian type orbitals
Using localized basis sets can help to decrease the number of basis functions for chemical problems.
Wave functions are then dependent on the ion positions.
Paul Pulay1969
Forces on external potential
The Hellmann-Feynman theorem tells how to calculate the forces of the external potential (moving the ions in the ion-electron potential).
2
2| |
d Rm
dt R
H
Hellmann-Feynman theorem
251
Adding the time dependence
Introducing the time dependence is now easy:
Born-Oppenheimer:
- Solve the electronic problem.
- Move the ions due to Hellmann-Feynman using classical MD methods.
Problem: solving the electronic problem every time step is very expensive.
252
iterate
253
Born Oppenheim Method
Simulation of two guanidium molecules using Born-Oppenheimer technique in the CP2K code.
Institute for Computational Molecular Science, Temple University
254
Car – Parrinello method
Roberto Car Michele Parrinello
(1984)
Ab initio method to calculate molecular structures once then use Hellmann-Feynman for ion forces and an artificial force on the electron single particle wave functions.
Car-Parrinello method
R.Car and M. Parrinello came up with the following Hamiltonian:
21, , ,
2 2
,
n n ICP i i i i
I iI
KS n Ion ni
PH R R
M
E R E R
ion-kinetic energy
Kohn-Sham Energy
artificial mass
plus the constraint that the single particle wave functions must be orthonormal.
255
ion-ion energyartificial kinetic energy of the wave functions.
NOT QM-KINETIC ENERGY
Car-Parrinello method
Using Euler-Lagrange we get the equation of motion:
21 1[{ }, ]
2 2
KS
I I ij i jijI I
KS Ion
i ij jji i
KS N Ionsconst I I I i i i
I i
EM R
R R
E E
E M R E R E
forcing orthonormality of the wave functions
1) Look for wave functions minimizing Kohn-Sham energy.
2) Proceed with Car-Parrinello equation of motion.256
257
Car – Parrinello method
The fictious mass μ of the electrons is a tunable
parameter of the method describing how stiff
the electron motion is coupled to the nuclei.
If μ→ 0 the electronic response is very rapid
and the electrons remain to a sufficiently high
degree in the ground state. But numerically one
wants to avoid too large accelerations. So electron
dynamics is made artificially slower than reality.
Car – Parrinello method
Since the electronic configuration is now following an equation of motion, the integration step has to be small enough to resolve the electronic motion. Since μ is usually smaller than the mass of the ions, the CP time steps are usually smaller than the time steps of the direct Born-Oppenheimer approach. Often time steps of the order of a tenth of a femtosecond are used.
258
( )i r IR The electrons have to
adiabatically follow the nuclei
If there is an energy transfer from the nuclei to the electrons
the electronic temperature increases
and the system leaves the BO surface
( ) ( )CP BOI IR t R t
E
Necessary condition for CP-MD
(Pastore, Smargiassi and Buda, Phys. Rev. A 44, 6334, 1991)
CP: continous line
BO: points CP BOF F
The difference is small and
oscillatory
Comparison of CP and BOMD forces (Si crystal )
Advantages of Car-Parrinello
Comparing Car-Parrinello with „classical“ Born-Oppenheimer:
+ Car-Parrinello equations need much less computer time per time step. But they need smaller time steps. There is still speed gain in real time.
+ Smaller energy-fluctuations since always the same bindings are considered.
- Problems with light ions for big μ
262
263
Simplicity of plane-waves (PW) basis, requires pseudopotentials
The Fourier transform implies :
- Details in real space are described if their characteristic length is larger than the inverse of the largest wavevector.
- Quality of a plane wave basis set can be systematically increased by increasing the cut-off energy.
Problem : huge number of PWs is required to describe localizedfeatures (core orbitals, oscillations of other orbitals close to the nucleus)
Pseudopotentials (or, in general, « pseudization »)to eliminate the undesirable small wavelength features.
264
Pseudopotentials
Electrons in the inner shellsdo not contribute to valencebonding – so they are frozenin the state they have in anisolated atom.
Neglecting the frozen coredoes not add anycontribution to the energy(von Barth and Gelatt,1980).
The choice of pseudopotentials
265
CPMD works with several types of pseudopotentials:
The most commonly used for non-metallic atoms are Martin-Troullier(MT) [Phys. Rev. B, 43, 1993 (1991)]:- Work well for light main group elements: C, N, O, S, P etc.- However, if one changes the functional one must also change the pseudopotentials.- They are not appropriate for transition metals.- Typical cut-off: 70 RyWith transition metals you need to use Goedecker-Hutter or Vanderbilt ultra soft:- GH require large cutoff, cover most elements.- Vanderbilt: low cut-off ~ 40Ry, more calculations required, in CPMD.
266
Car – Parrinello method
This method is applied in solid state physics,
atomic and molecular physics and can study
crystalline structure, liquids and amorphous
materials. The method can be substantially
improved by using tight-binding potentials
and by representing part of the electronic
wave functions in Fourier space using FFT.
Too big artificial mass
Larger μ implies larger time steps. How large might μ be? What effect does a too large μ have?
267
For water it seems that μ should be at most 1/5 of the lightest ion (H, D or T).
Grossman et al. J. Chem. Phys. 120, 300 (2004)
Effect on different GGA‘s
268
One of the approximations was the GGA.
What is its effect?
Changing the GGA has a big effect on g(r) of water.
VandeVondele et al.
J. Chem. Phys. 122, 014515 (2005)
2H O
Further possibilities
Krack et al. J. Chem. Phys. 9404 117, (2002)
Since the electronic structure is known, new properties like the X-ray scattering intensity can be measured.
269
270
Car – Parrinello method
Simulation of 32
water molecules
and one hydronium
ion (H3O+) at 400K
and density 1 g/cm3
during 500 ps.
by Axel Kohlmeyer
CP2K Molecular Dynamics
271
- Linear combination of Gaussian-type orbitals (GTO) for Kohn-Sham orbitals.
- Auxiliary plane wave (PW) basis set for electronic charge density, and long term Coulomb interaction.
Implementation of the Gaussian and plane waves (GPW) basis:
( )PW GTO GTO PW
Removing the PW contribution of the GTO
Comparing PW with Gaussians in Car-Parrinello method
272
The Advantages of PWHas a better scaling than Gaussian based methods-without loss of accuracy.Plane-waves are easy to program-fast math libraries. No Pulay Forces.Can do solids, polymers and molecules all in same framework.Many properties are easy to calculate with PW.
The Disadvantages of PWCare must be taken with real space grid and energy cut-off.Ripple noise makes it hard to converge structures.To do isolated molecules requires a lot of work: screening of images.Need lots of plane-waves.Chemists have to learn Solid state physics lingo-culture gap.
The Problems of PWExchange is non-trivial and very expensive to include in this formalism.Pseudo-potentials!
CP2K: Advantages and Disadvantages
273
Advantage:- Benefiting combination of the best of the two
basis set.
Disadvantages:- Computational overhead due to
transformation steps.- More complicated code.- Combination of advantages implies possibly
also the combination of disadvantages.
CP2K: Larger simulations possible
274
Left: Spin density illustrates the extent of the hole in liquid water just after
ionization. Right: Three views of the DNA crystal.- A hybrid Gaussian and plane wave density functional scheme. Lippert G, Hutter J, Parrinello M: mol. phys. 92 (3): 477-487 1997.- An efficient orbital transformation method for electronic structure calculations. VandeVondele J, Hutter J: j.
chem. phys. 118 (10) : 4365-4369 2003.
BigDFT: Wavelets
275
Wavelets as a basis set for Kohn-Sham system.
1. Localized both in real and in Fourier space.
2. Allow for adaptivity (for internal electrons).
3. Systematic basis set.
J. of Chem. Phys., 129 014109 (2008), L. Genovese, A. Neelov, S. Goedecker, T. Deutsch, S. A. Ghasemi, A. Willand, D. Caliste, O. Zilberberg, M. Rayson, A. Bergman and R. Schneider, "Daubechies wavelets as a basis set for density functional pseudopotential calculations".
276
Wavelets and Scaling function
, ,
( , , ) ( ) ( ) ( )i lmn l m nl m n
x y z c x y z wavelets
Kohn-Sham orbital expansion coefficients
Scaling function: low resolution levels = linear combination of high resolution levels:
( ) (2 )m
l j lj m
x h x j
277
Wavelets and Scaling function
It is possible to reconstruct the missing information for the coarseness of the resolution.
(2 ) ( ) ( )m m
l j l j lj m j m
x h x j g x j
Another wavelet
Increase the resolution without modifying grid space!
BigDFT: Resolution
Fine grid: High resolution Coarse grid: Low resolution
Problem: Cubic scaling
For systems bigger than 500 atoms:orthonormalization operation is predominant (N3).
Path Integral CPMD
Simulation of proton transfer in FI-FA dimer using PIMD to improve the behaviour of the H-atoms.
by Anatole von Lilienfeld
279
280
Questions of last semester
• Critical behaviour of the Ising model
• M(RT)2 canonical Monte Carlo
• Detailed balance
• Finite size scaling
281
15 relevant questions
• Fluctuation-dissipation theorem for M
• Dynamic correlations and dynamic scaling
• Glauber and Kawasaki dynamics
• Creutz demons
• Binder cumulants
• First order transitions (Potts model)
• Swendsen-Wang cluster algorithm
282
15 relevant questions
• Verlet and leap frog schemes• Verlet tables and linked cells• Particle – mesh method• Constraint method with Lagrange
multipliers• Rigid bodies, quaternions• Nosé – Hoover thermostat• Event driven simulations• Inelasticity and finite time singularity