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

Y.

Jun Huang

Introduction of a FORTRAN
code for Mixture Algorithm in
Molecular Dynamics Simulation
January 22, 2013

Preface

The simulations of granular flow is a very important of computational fluid dynamics (CFD). A granular material is a conglomeration of discrete solid, macroscopic
particles characterized by a loss of energy whenever the particles interact. The constituents that compose granular material must be large enough such that they are not
subject to thermal motion fluctuations. Granular flow phenomena are frequently in
the industrial and our daily life. The particle-particle interaction plays an important
role in granular flows, which makes the granular flows have some strong non-linear
characterizes. Hence, the granular materials are so different from the normal materials, either solids of liquids. Because of these special characterizes, there is no accepted set of fundamental equations for describing the granular flows. Furthermore,
the classical methods (e.g. infinite element method and infinite volume methods or
algorithms) and continuous assumption (e.g. Naiver-Stokes equations) for common
solids and fluids cannot predict the behavior of granular flow well. On the other
hand, because of the understand in contact mechanics and friction mechanics, the
solution of granular flow also can be carried from the microptic scale of particleparticle interaction. Molecular dynamics (MD) is a form of computation simulation
in which particles are allowed to interaction for a period of time by approximations
of know physics, giving a view of the motion of the particles. This method was firstly developed for study of proteins,bio-molecules and material science in which the
basic particles are atoms or molecules. Hence, this method is named as molecular
dynamics. With the development of the computer technology, the MD becomes a
powerful tool in simulating the complex granular flow. There are some commercial
MD simulation softwares for granular flow already, such as EDEM, developed by
DEM Solution. However, the big problem in front us is still the simulation time.
Parallel computing in cluster is a new direction to improve the efficiency of CFD,
but the cost of cluster is much higher than PC. In order to optimize the code and
make it available in PC, a collection of FORTRAN subroutines for solving granular
flow was developed by me. This is a brief discerption of my code. The source codes
in FORTRAN are listed in the end of this report as appendixes. Hopes more and
more people can help me to develop this code.

Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 Brief History and Overall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Data Structure and Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
1
3

Search Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Original Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Body Fitted Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Neighbor List Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Neighbor List Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Collision Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Coefficients of Restitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Time-driven Method (TDM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.1 Visco-elastic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2 Constant COR in the normal direction . . . . . . . . . . . . . . . . . . .
3.2.3 Time step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Event-driven Method (EDM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 Conception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.2 Time step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.3 Oblique Collision Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4 Coordinates transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.1 2-D problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.2 3-D problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Time Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Hybrid Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Coupling with SPH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

DEM Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

15
15
16
16
18
19
19
19
22
23
23
23
24

vii

viii

Contents

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Chapter 1

Introduction

1.1 Brief History and Overall


The code was firstly developed using Event driven model (EDM) when i was a doctoral student in Lappeenranta University of Technology, Finland. That code is quite
simple and the boundaries are instead by a series of hard particle with zero velocity.
I worked in the Department of Applied Mathematics, the Hong Kong Polytechnic
University in 2008-2009. During this time, i modified the original code in to Time
driven model (TDM) and some simple boundaries are added to code. But the structure is the code is not so good yet. Because of a lot of idea in this code is obtained
from the user hand book of EDEM and therefore the code is named Shanzhai DEM,
which means cheap copy DEM in Chinese. Now the version attached in this report
is rewritten as a collection of FORTRAN subroutines. And the contact algorithm is
a mixture of TDM and EDM. This is my own idea and therefore the code is not a
simply Shanzhai more, a new name is given as MATEP (Mixture Algorithm of TDM
and EDM package) .
MD is a kind of discrete element method (DEM) and the element in MD is the
real particles, e.g. the grains sand, atoms and so on. The two basic ideas of the MD
simulation is obtain a particle-particle interaction model and intergrade the changes
if velocity and position of every particle after a certain time length by considering
all forces added to the particle. The acceleration of each particle can be described
by the Langevin equations, given by
a=

F
m

(1.1)

The coordinating velocity and displacement are given as,

u=

adt

(1.2)

and

1 Introduction

r=

udt

(1.3)

.
In granular flows, the particle-particle interaction is because of the overlapping
due to the contact. Hence, such interaction only occurs when the distance between
the centers of two spherical particles less than the sum of the two radii, that
|ki j | < Ri + Ri

(1.4)

START
t=t0

neighbor
search

acceleration
due to field
for each particle

binary collison
leads to acceleration (TDM)
or velocity & position (EDM)
due to contact

t=t+dt
no
Intergration
t >t finial

to obtain new vlocity and


potition for each particle

sum of acceleration
(TDM)

yes
END
Fig. 1.1 Basic Flow chart

The brief flow chart of the programm is shown in Figure 1.1. In order to optimize
the programm, there are some other sections in our code. These sections, either presented in the flow chart or not are written as subroutines in our package. Here, a
brief introduction of theses subroutines are given one by one. The details of these
subroutines will be given in the later Chapters. The functions of these subroutines
are listed as follows.
1.instat: This is the subroutines to initialize the properties of the particles, e.g.
velocities, positions, size and so on.
2.dtp1: This subroutine is used to determine the time step dt.
3.dtpint: This subroutine is the same as the subroutine dtp1. Because some
parameters are constants, such as the biggest size of particles, which should be used
in each roop when the main program calls the subroutine dtp1. In order to
avoid repeat calculation, these parameters are obtained from this subroutine.

1.2 Data Structure and Parameters

4. reset: After each loop, some memory should be clear, e.g. the cancelations
in this subroutine.
5. field: This subroutine is used to calculate the acceleration due to external
force, like gravity.
6. binary:This subroutine is used to calculate the acceleration due to particleparticle interaction.
7. bcp and bcp2: These two subroutines are used to calculate the accelerations
due to particle-wall contact.
8. velocityp: Employing the relations of u(t + dt) = u(t) + a(t)dt and r(t +
dt) = r(t) + u(t + dt)dt give the status of particles after the time step dt
9. outputp: save the data to hard driver.
Except the subroutines listed above, in the main program there are any other subroutines, such as search searchMesh. These subroutines are helpful to
speed the simulation and the details will be introduced in the next chapters also.

1.2 Data Structure and Parameters


All the data about the status of particles are used in a matrix named stma with 14
columns and n rows, where n is the number of particles . Each row is for a single
particle and each particle is numbered by an ID number. The order of particles in this
matrix is the same as the its ID. The first column is for the radius, the second column
is the density of the particle and the third column is recorded the mass. These three
parameters are kept as constant in the example given in this report. If two of them
are known, the rest one can be calculated from the other two parameters. The 4th
and 5th columns are for the positions of the particle in x and y- direction. The 6th
and 7th columns are for the velocities of the particle in x and y-direction. The 8th
column is the angular velocity. And the 9-11st columns are the accelerations for the
two transition and rotation. The rest three columns are blank currently for the works
in future. For example, if the material of the particles are not uniform more, the
corresponding information can be saved in these columns. In addition, some other
parameters are given in the the main program also.
1. xlower, xupper, ylower and yupper are the minimum and maximum
value of the calculation domain in both x and y direction.
2.tp0 is the initial time. Usually it is set as zero.

1 Introduction

3.tpfinal is the finial time of the whole simulation.


4. tpout is the time gap between two output files.
5. rhop is the density of particles. If there are more than one materials in the
particles, the density should be claimed in the matrix stma.
6. fricp is surface roughness of the particles. Similar as the density, we suppose
all particles are make from the same material and with the same material properties.
7. young is the Youngs modulus, pois is the poissons ratio, g0 is the shear
modulus, youngr is the relative Youngs modulus, ginf is the long term shear
modulus and tau is the relaxation time. All these properties will be used when calculating contact force.
8. e is the normal coefficient of restitution (NCR).
Except these listed above, there are any other parameters, like rhoF, vis are
used when the dry granular material coupled with fluid phase. Here only dry granular flow is introduced.

Chapter 2

Search Algorithms

2.1 Original Algorithms


For MD simulation, there are a huge number of parities in the system. Selecting
the pairs, between which contact is possible is an important work. The simplest
algorithm, namely the direct search method, is calculating the distances between
every pairs in the system. For a system with N particles, thus operation should be
considered N(N 1)/2 times in every time step. Hence, this algorithm is also called
N 2 algorithm . It is an impossible task when the N is large.

center [htb!]
Fig. 2.1 Link cells for a simulation of granular flows in a U-shape tube.

An available algorithm can be used for searching the neighbors is employed in


our code, which is called Linked-cell method [?] or Verlet algorithm. Lets assume
the simulation domain is rectangular that = L1 L2 , where Lx and Ly are the
side length, Lx = xupper- xlower and Ly =yupper-ylower. The domain is
decomposed into square cells of size cellp cellp as shown in Figure. The
center of each particle must be located in one of thus square cells. The total number
5

2 Search Algorithms

of such cells in the whole domain is given by,


Ncell = Nx Ny

(2.1)

where Nx = int(Lx /cellp) + 1 and Ny = int(Ly /cellp) + 1. here int is the floor
function to obtained the next largest integer. In the code, the matrix to saved the
location of each particles in such square cells is named lsg (square-grid). The
first letter l is to define the elements in this matrix are integers. The size of lsg
is nump 2. Same as the matrix stma, nump is the number of particles in the
system. Each of the cell in the lsg list should has eight neighboring cells, except
those located at the boundaries, as shown in Figure 2.2. Of course, for 3-D problem,
the number of neighboring cells is 33 1.

Fig. 2.2 Illustration of the link cell method: for the black particle located in the central dark gray
cell, only those solid particles in the gray cells are added to its Verlet list.

In order to make sure all of the cell has eight neighboring cells, two rows and
two columns extra cells are added to the square cell matrix lsg and the new cells
added to the matrix is called Ghost cell . Thus, Nx = int(Lx /cellp) + 3 and Ny =
int(Ly /cellp) + 3 There is no particles in any of the ghost cells. After adding the
ghost cells, each particle corresponds a non-ghost cell in the matrix lsg and each
non-ghost cell has eight neighboring cells. These nine cells are called linked-cells to
this particle. There is a critical distance cellp |ri + r j |. When the distance of the
particle and any of the particles located in these linked-cells is less than this critical
distance. This pair of particles must be considered as neighboring to each other. This
critical distance cellp |ri + r j | is called cut-off distance , where ri and r j are the
radii of this pair of particles. In order to make sure cellp (ri + r j ) being positive,
it is required that
cellp > (ri + r j )

(2.2)

For a multi-sized particle system, the minimum size of the square cells is given by,

2.2 Body Fitted Algorithms

cellp > 2(rmax )

(2.3)

where rmax is the radius of the biggest particle in the system.


A new matrix NB (it should be named NP for neighboring particles, but i made a
mistake in the very beginning :) ) with nump rows is set up. Each row in this matrix
is in the form of {N, Id1 , Id2 , IdN , 0, 0, , 0}. Here the first element N shows
the total number of neighboring particles with a smaller ID than the corresponding
particles in the linked-cell and Idi are the ID of these neighboring particles.
It is better to notice that there is another one column matrix named nbx with
nump elements. It is the first column of NB. Hence, each element is record the total
neighboring particles. Using nbx, it is easy to calculate the local volume fraction.
Another skill of searching algorithm is to assume the neighboring list does not
change too much in several time steps and therefore it is unnecessary to obtained the
neighbor list every time step. As discussed above, the cut-off distance dc is cellp
|ri + r j |, the minimum time for the particle out of the cut-off circle to contact with
that located in the center of the cut-off circle is given by,
t = dc /|2Umax |

(2.4)

Hence, the number of time step can omit the calculating of matrix NB equals,
Ntime gap = int(t/dt)

(2.5)

where dt is the time step obtained from subroutines dtpint and dtp1.
The code for setting of the cells for link-cell method is given in the subroutine
searchsize and the code for lsg and NB is given in subroutine search.

2.2 Body Fitted Algorithms


For the U shaped tube problem shown in Figure 2.2, there is a shortage of the original Verlet algorithm. Most of the link cells are always empty, which may occupy a
lot of memory. In order to avoid the waster of memory, a new algorithm called Body
Fitted Link Cell (BFLC) was developed.
In mathematics, a body fitted orthogonal curvilinear coordinates g = (g1, , gD)
should be set firstly, in which the reference vector gi = 0 (i .= 1) is along the direction
of the pipe, as shown in Figure 2.3. Because this coordinate system is an orthogonal,
which means [?],
gi j = 0, i = j
(2.6)
This new curvilinear coordinate system is diffeomorphic to the Cartesian coordinate system patch on the manifold. Hence, it can be derived from a Cartesian
coordinate system by using a transformation that is locally invertible at each point.
In other words, any point in the Cartesian coordinate system can be converted to the

2 Search Algorithms

Fig. 2.3 Sketch of BFLC in a body fitted coordinate system for a U-shaped pipeline. This pipeline
is same as that shown in Fig.??.

body fitted curvilinear coordinate system and back. The basis vectors in these two
coordinate systems, ei and gi are related by,
gj =

xn i
e

i=1D j

where the position in vector form is

i=1D

(2.7)

xi ei and

j g j in the two coordi-

j=1D

nates systems respectively. Here, e is used for the Cartesian coordinate system and
g is used for the body fitted coordinate system. Combining the transitions and scale
factor, these partial derivatives can be organized into a Jacobian. In R3 it is given
by,

x1

1

x1


2
J=

x1

de1

x2 x3
0
1 1

x2 x3
0
2 2

x2 x3
0
3 3

2
3
de de 1

(2.8)

where deD are the transitions and J44 is the scale factor. Hence,
[g1 , g2 , g3 , 1]T = J[e1 , e2 , e3 , 1]T

(2.9)

However, sometimes it is different find a proper smooth function for fitting the
pipeline route. A common method is using piecewise functions to describe the
pipeline route along. The intervals can be written as {N1 , N2 , , Nm } as shown in
Fig.2.4. In a Cartesian coordinate system, the distance between every two neighboring intervals is defined as,

2.2 Body Fitted Algorithms

Fig. 2.4 Bisection method for searching the closest interval to the particle p.

[
lj =

|xij xij1 |2

]1
2

(2.10)

i=1

The contravariant basis vector g1 is describes by these piecewise functions under


the covariant reference vectors ei . For a given particle p, the corresponding sub-cell
has the same index in g1 direction, which is the nearest interval in {N1 , N2 , , Nm }.
The bisection method can be used for identifying this index, which is a very simple
and robust method. The algorithm of this method is given as,
i = min[i : |p, Ni |, j : |p, N j |]
j = int( i+2 j )

(2.11)

For the first time of neighbor search at the very beginning of a simulation, substituting i = 1 and j = m into this equation and comparing the distances the two intervals in the ends to the given particle p. The bigger one is instead by |p, Nint( 1+m ) |.
2
This operation should be repeated until i = j. For the later neighbor searches, this
particle must be located in either the same sub-cell or the neighboring neighboring
sub-cells. And therefore for the index for the sub-cell in the g1 direction is given by,
i = min[i : |p, Ni |, j : |p, N j |, k : |p, Nk |]

(2.12)

in which, j = i 1 and k = i + 1.
On the other hand, the corresponding Euler angles for the tangent lines at these
intervals {N1 , N2 , , Nm } can be written into another [m D] matrix. If the origins
of the two coordinate systems are located in the same point, and all elements are
constants, the Jacobian becomes a rotation matrix, which acts such rotation as shown
in Fig.2.5 in 3-D space. Assuming = 0 and the scale factor is 1, this matrix is given
by,

cos sin 0 0 cos sin 0 0


sin cos 0 0 sin cos 0 0

R=
(2.13)
0
0 1 0 0
0 1 0
0
0 01
0
0 01

10

(a)

2 Search Algorithms

(b)

Fig. 2.5 Rotation of coordinate system, (a) R3 and (b) R2 .

Fig.2.6 shows some sub-cells in the g coordinate system. For 2-D, this matrix is
simplified as a minor of the first square matrix in the right hand,

cos sin 0
R = sin cos 0
(2.14)
0
0 1
This rotation matrix leads to a new Cartesian coordinate system e , with one basis
vector e1 in the same direction as g1 at Ni . The other indexes for sub-cell for each
particles can be obtained by substituting the components in e into eqn.??.

Fig. 2.6 BFLC in an orthogonal curvilinear coordinate system in R3 .

2.2 Body Fitted Algorithms

11

Fig. 2.7 Simplified the BFLC algorithm in R2 .

For 2-D problems, a more simple method is to set the whole domain in the same
side of coordinate g2 being positive, as shown in Fig. 2.7. The sub-cell index for g2
direction is obtained by,
|p, Ni |
(2.15)
j = int 1
li,0
Thus, the shape of each sub-cell becomes a sector ring. The length of each side can
be calculated by,
li,1 j
Ri, j
(2.16)
= 1
Ri,1
li,1
where R is the curvature. And
v
( )2 v
( )2
u
u
1
1
u
u
l
li,0
i,0
t
t
1 )2
1 )]2
[( j 1)li,0
li,2 j = ( jli,0
2
2

(2.17)

When the curvature R is much greater than the radius of the pipeline, namely R
1 . The first values of l 2 with different j are 0.866, 1.086, 1.022,
|p, Ni |, li,1 j = li,0
i, j
1.011, . It is not difficulty to prove that these values form a sequence monotone
converging towards 1 when j 2. Because li,2 j is a function of the distance between
2 , along the reference vector gD = 0 (D 2), it must be
two neighboring intervals, li,0
2
emphasized that all li,0 should be equal to avoid the sub-cell decomposition because
of different li,2 j . Secondly, the curvature of the pipeline should be much greater than
1 is required to make sure
the radius of the pipeline, R0 . Otherwise a huge length li,0
the size of those sub-cells far from the reference vector. The big size of sub-cell
increases the number of neighbors in the Verlet list to some particles.

12

2 Search Algorithms

Currently, I only finished the code for 2-D problem. The code for the U shaped
tube shown in Figure 2.2 will the an example to explain how the code works for the
BFLC algorithm.
The corresponding codes for BFLC are the subroutines named searchsize,
search2 and search3. Here, the searchsize is used for calculating the size
of the mesh that how many cells alone the g1 axis and how many cells in the g2 direction. The subroutine search2 is only called in the beginning of running, which
is used for the operation shown in Figure 2.4. Once, the location of each particle is
obtained. The particle must located in the same or the neighboring link cells in the
next Verlet list. Hence, in the subroutine search3, only these nine link cells are
considered.

2.3 Neighbor List Update


Neighbor searching is a time-consuming task. To abandon this concept in each time
step, a possible method is to select an appropriate size of the link-cells and repeat the
neighbor reaching process every N time steps. This a compromise method between
the direct search method and link-cell methods.
The time step in a DEM simulation, dt, should no less than 1/50 of the shortest
collision time, dtc [?]. . While the collision time ,dtc , could be calculated using the
properties and the relative speed between the two colliding particles. The details of
the collision time will be given in the next chapter. On the other hand, searching the
whole N particles system, it is each to obtain the fastest particle. Here the speed
of each particle is given as,
d

| vmax |= max[ (vki )]1/2

i [1, N]

(2.18)

k=1

In practice, a more simple assessment of the fast speed is used,


| vmax |= 2 max(vdi )

i [1, N]

(2.19)

The second expression not only avoids the complex calculation process, but also
offers a sufficient estimation. The relative speed between two colliding speed is no
greater than 2 | vmax |.
For original algorithm and square link-cells as shown in Fig.2.2, the distance
from a particle located in the central dark gray cell to another particle located in the
light gray cell,di j , is no greater than (Lx ri r j ), where Lx is the sixteenth of the
link-cell and ri , r j are the radius of the two particles. Hence, the gaps between two
neighbor searching process, dtns , is given by
dtns =

Lx r i r j
2 | vmax |

(2.20)

2.4 Neighbor List Index

13

And the neighbor searching process can be repeated every int(dtns /dt) time steps.

2.4 Neighbor List Index


In the codes shown in the appendix, a 2-D neighbor list index is set up after each
neighbor searching process. Figure 2.8 shows a part of this index table. Here the first
column is the ID of each particles from 1 to N. The second column is the number
of neighboring particles in the neighboring cells and the ID of those neighboring
particles are given in the rest elements of this table. For the other empty elements in
this table, 0 are fulfilled. In this table, the particles with ID number 1 and 2 have no
neighbor and therefore the second elements in the first two lines are zeros. While for
the particles with ID number 127, it has four numbers. Hence the second element
in the corresponding line is 4. And 2, 23, 78 and 82 are the ID of those neighboring
particles.
,'

QXPEHURIQHLJKERUV











,'RIQHLJKERUV
Fig. 2.8 A part of a 2-D neighbor list index.

The disadvantage of this 2-D neighbor list index is that there is too many 0 element in the table, which may consume a lot of memory space. It is noted that to avoid
repeating the neighboring pairs in the table, only when the ID of those neighboring
particles are smaller that of the particle in the first column and the corresponding
row will be recorded in this index table. The first 0 in each line is used as a logical
deduction wheatear this row is finished or not. In Liu and Lius book [?], they used
another neighbor index, which is called chain index. The chain index becomes two
1-D arrays,particle i and particle j , to record the neighboring pairs, as shown in
Fig.2.9. When the index points to n, the colliding pairs is the the nth particles in
the arrays particle i and particle j . Comparing with the 2-D neighboring list, the

14

2 Search Algorithms

1-D list uses less empty element and avoids lots of logical deduction. The first zero
elements in particle i and particle j show the end of the neighbor list.
RUGHURISDLUQQQQQQQQQQQP
SDUWLFOHi
SDUWLFOHj

Fig. 2.9 A part of a 1-D neighbor list index corresponding to that shown in Fig.2.8.

Chapter 3

Collision Process

3.1 Coefficients of Restitution


No matter how complex a particulate system is, the basic interaction in the system
is the binary particles contact process. After a contact process, the velocities of the
these two particles are changed. To characterize the velocity changes, two coefficients of restitution (COR) e and are introduced for the normal direction and the
tangential direction respectively. The definitions of these coefficients are expressed
o
as ratio of the post-contact velocity, uo
i j and the pre-contact velocity, ui j , at the contact point, o, given as,

e=

k uo
ij
k uoij

(3.1)

and

k uo
ij
k uoij

(3.2)

where k is the unit vector along the center line from particle i to j. If k uoij = 0,
namely normal collision, approaches to infinite and becomes non-physical meaning. To avoid approaching infinite, it is required that the pre-contact relative tangential velocity cannot be zero. Otherwise, k uoij = k uoij + , where is a tiny
real number. In other words, all the binary contact problems in the codes is considered as oblique collisions, namely k uoij = 0.
The ranges of the two COR are 0 6 e 6 1 and 1 6 6 1 respectively. Note
that when e = 1, the collision is elastic and when e = 0, the collision is completely
inelastic. Bridges et al. [?] did some experiments to measure the normal COR, e,
of an ice ball hitting a fixed wall and they found the curve of the normal impact
velocity un against the coefficient, e, follows the power law,

15

16

3 Collision Process

e = Bun b

(3.3)

where B and b two position constants depending on the material properties. Later,
Bridges and his cooperators [?] found the effect of the particle size. They modified
the aforementioned model. Instead of the power law model, an exponential law was
set up for small normal velocity, that
e = C exp( un ) + Bun b
= C exp( un )

(3.4)
(3.5)

where C, , B and b become contacts depending on the size of particles, as well as


the material properties. Otherwise the second term in the first row would become
dominant and this equation can be simplified to eq.(3.3).
However, there is a shortage of these two expression that the value of e becomes
infinite when un approaches to zero. Hence, Schwager and Poschel gave another
expression, that [?]
e = 1 (1 e0 )(un /u0 )n

(3.6)

where e0 and u0 are two adjustable parameters and n is given as 0.2.


On the other hand, due to the different value of , Lun and Savage [?] classified
the collision into five categories:
= 1, the smooth surface slips over each other;
1 < 6 0, the particles slips over each other, but some kinetic energy of
transition transfers to rotation energy;
= 0, the surface friction and inelasticity are sufficient to eliminate the tangential relative velocities after collision, which is also called rolling;
0 6 < 1, the tangential velocity is not only reduced in magnitude but also
reversed after collision, which is called sticking;
= 1, all the kinetic energy is transferred into elastic strain energy.
Lun and Bent [?] suggested a phenomenological constant 0 characterizing the
limitation of the COR in tangential direction for sticking contacts. Consulting the
measurement of Maw [?], they suggested that 0 = 0.4 by averaging the experimental data. Zamankahan and Huang [?] repeated this phenomenon by finite element
simulation.

3.2 Time-driven Method (TDM)


3.2.1 Visco-elastic Model
The calculation of the contact force between each discrete element in the time-driven
method used in the HAET algorithm is based on the original method of Cundall and
Strack [?]. An integration method, which is introduced in Sec.??, can be employed

3.2 Time-driven Method (TDM)

17

to calculate the changes in velocity and position for each particle after a certain
time by considering all the forces on the particle. Some of the forces acting between
particles originate from the deformation of the particles when they are in contact
with their neighbors, as shown in the Fig.3.1. Ramirez [?] suggested that the normal particle-particle collision process could be modeled as a spring-dashpot system,
where the normal force, Fn , is the sum of an elastic term, Fne , and a viscous term,
Fnd ,
Fn = Fne + Fnd
= Kn n + n n n

(3.7)

where n is the overlap, n = ri + r j di j (n > 0), Kn is the effective stiffness


coefficient, n is the damping coefficient, ri, j is the radius of each particle and di j
is the distance between the two centers of the particles. By means of dimensionless
analysis of Hertzs theory [?] [?], it is shown that = 3/2. In addition, Kuwabara
and Kono pointed out that = 0.5 [?]. For oblique collision, the magnitude of the
tangential force, | Ft,i |, is obtained from Coulombs friction law where | Ft,i |= |
Fn,i |.

wall
Og

Oi

Oj

Oi

(a)

(b)

Fig. 3.1 Spring-dashpot models: (a) binary collision and (b) collision with the wall.

The normal and tangential components of impulse are given by dJn = Fn dt and
dJt = Ft dt respectively, where dt is the time step in the integration. Considering
the balance of impulses and the exchanges of momentum due to collisions of all
particles in contact, the velocities of a particle after the time step, dt, are given by,
Jn,t
m
J

t
= +
I

un,t = un,t +

(3.8a)
(3.8b)

where u is velocity in translation and is the angular velocity in rotation. The prime
means the status at the end of the time step and the corresponding symbol without

18

3 Collision Process

prime is the status at the beginning of the time step. I = 0.4mr2 is the moment of
inertia for a spherical particle.
When a particle collides with the wall, an imaginary particle is created temporarily, as shown in Fig.3.1.b. Sometimes, the imaginary particle is also called
ghost particle. The imaginary particle is a mirror of the real one and the surface
of the wall is the plane of symmetry. A collision happens between the real and the
imaginary particles.

3.2.2 Constant COR in the normal direction


The coefficients in eq.3.7 are described in more detail in refs.[?][?] for a constant
COR in the normal direction, e. For a constant COR in normal direction, e, the
effective stiffness coefficient is given by [?],
4
Kn = Yr rr
3
and the damping coefficient is given as a function related to e, that [?],

n = 2 (5kn mr )/6

(3.9)

(3.10)

Here, Yr is the effective Youngs modulus given by


Yr = Y /2(1 2 )

(3.11)

where Y is the Youngs modulus, is the Poissons ratio and the subscripts 1 and 2
indicate the two colliding particles respectively. rr and mr are effective radius and
effective mass, given by
1
1
+ )1
r1 r2

(3.12)

1
1 1
+
)
m1 m2

(3.13)

rr = (
and
mr = (

is the damping coefficient associated to the dashpot and COR in normal direction,
e, that
=

ln(e)
( 2 + ln2 e)0.5

(3.14)

kn is given by

kn = 2Yr rr

(3.15)

3.3 Event-driven Method (EDM)

19

3.2.3 Time step


According to refs. [?][?], the time step in TDM should be less than 2% of the shortest binary collision time, and it cannot exceed the Rayleigh time. As shown in refs.
[?][?], the contact time for a constant e is given by,

tc =
(2Kn /mr )(1 2 )

(3.16)

The Rayleigh time is the time required for a Rayleigh wave to travel the diameter of
an elastic particle. given by,
tR =

rmin
/G
0.16 + 0.88

(3.17)

where rmin is the smallest particle radius, G is the shear modulus and is the Poissons ratio. Since the Rayleigh time is proportional to the binary collision time, the
time steps calculated from the collision time and the Rayleigh time are very close
[?][?].

3.3 Event-driven Method (EDM)


3.3.1 Conception
In TDM model, calculating the interaction force due to overlapping is a time consuming work. To simplified the contact process, EDM model is used to speed the
simulation. In the Event-driven method (EDM) there is an event, e.g. collision, inside the system which controls the system dynamics. When an event occurs, there
is a change in the system dynamics. This change needs to be updated at the next
time step. The concept of overlapping is not used in the EDM model and the particles keep in the spherical shapes. Due to this reason it is also called hard particle
model. The Event-driven method typically has two functions to perform, calculating the next collision time and implementing the collision dynamics. Whenever the
distance between spherical particles equals the sum of the two radii, then an event,
a collision, occurs. The velocities of the particles will change suddenly [?]. Fig.3.2
is a sketch for the compassion of TDM and EDM models. The states of the two
post-collational particles are obtained from the pre-collational and the CORs. And
the time for the collusion process, tc , approaches to zero.
A sketch of a binary collision is is plotted in Fig.3.3. The normal direction is
along the z-axis. The law of momentum conservation in the normal direction (zaxis) is given by,
m1 u1,z + m2 u2,z = m1 u1,z + m2 u2,z

(3.18)

20

3 Collision Process

(a)
F=0

F=0

F>0

F>0

F>0

F>0

F=0

F=0

F=0

collision time tc

&ROOLVLRQ
3URFHVV

(b)

tc=
Fig. 3.2 Sketch of the TDM method and EDM method. (a) is the TDM method and (b) is the EDM
method.

u1,x
1,x
O1

u2,x
u1,y
1,y
u1,z
1,z

2,x
O2

u2,y
2,y
u2,z
2,z

x
y
z
Fig. 3.3 Sketch of a binary collision.

Eq.3.1 can be rewritten as,


e=

u1,z u2,z
u1,z u2,z

(3.19)

3.3 Event-driven Method (EDM)

21

Combining eqs. 3.1 and 3.19 leads to,


u1,z =

m1 u1,z + m2 u2,z em2 (u1,z u2,z )


m1 + m2

(3.20a)

u2,z = u1,z + e(u1,z u2,z )

(3.20b)

The two components in the tangential directions are independent of each other.
Here, only the component in the xdirection is considered. The ycomponent can
be obtained using a similar method. The shear coefficient of restitution given in
eq.3.2 can be rewritten as,

1,y r1 ) (u2,x u2,x + 2,y r2 +


2,y r2 )
(u1,x + u1,x + 1,y r1 +
(3.21)
(u1,x + 1,y r1 ) (u2,x 2,y r2 )

In TDM model, the change in angular velocity for any sphere i in the binary
system is,

i,y =
Ii

tc

(Fx,i ri ) dt

(3.22)

where the moment of inertia is I = 0.4mi ri2 and tc is the collision time. The change
in tangential velocity is given by,

ux,i =

tc Fx,i dt

mi

(3.23)

These two equations not only lead to the relationship between the change of
angular velocity and the tangential velocity as given as


ui,t

= ri
(3.24)

i 2.5
but also the relationship between the two spheres, as follows,

u1,y
m2
=
u2,y
m1
1,x I2 r1

=
2,x I1 r2

(3.25a)
(3.25b)

1,y ,
2,y , u1,x can be written as functions of u2,x . Substituting all
Thus,
of these four terms into eq.3.21 gives u2,x , as,
u2,x = (1 + )

u2,x + 2,y r2 u1,x 1,y r1


1.5 + 3.5m2 /m1

The post-collisional velocity components are given by,

(3.26)

22

3 Collision Process

u1,x = u1,x u1,x

(3.27a)

u2,x = u2,x + u2,x


1,y
1,y = 1,y

2,y
2,y = 2,y

(3.27b)
(3.27c)
(3.27d)

3.3.2 Time step


The necessary condition for collision between two particles was given by in Allen
and Tildesleys [?] algorithm. Consider a pair of spherical particles, as shown in
Fig.3.4, with radii ri and r j , and positions at time t, pi and p j respectively. The
amount of time for the coming collision is given by the smaller real root of the
equation,

bi j b2i j u2i j (p2i j (ri + r j )2 )


ti j =
(3.28)
ui j
where ui j is the magnitude of the relative velocity between the two particles,
ui j = ui u j , and bi j is defined as bi j = ui j pi j with pi j = pi p j . For a multibody system, the time step is the amount of time between consecutive events,
dtEDM = min( ti j ). In other words, it is determined by the shortest free flight time
between all the particles [?]. The number of particles in the system also affects the
time step in the EDM simulations. From a statistical point of view, the larger the
number of particles in the system, the higher the probability of the existence of a
short free flight path even when the global volume fraction is the same.

Oj

pij (t)

Oi

u j (t)

ui (t)

Oj
Oi

dt)

p ij (t+

Fig. 3.4 Illustration of relative position vectors before and at the collision time with the corresponding velocity vectors.

3.4 Coordinates transition

23

3.3.3 Oblique Collision Model


There are several EDM models for the relationship between the coefficients e and
. According to Zamankhan and Huang [?], can be written as,
(
)
m j unij
1+e
mi
= 1 +
mr +
+
(3.29)

mr
Ind,i Ind, j uti j
where Ind is the non-dimensional moment of inertia. For spherical particles, Ind =
0.4. unij and uti j are the two components of relative velocity in the normal and tangential direction respectively. As mentioned in Sec.3.1 that cannot be greater than
phenomenological constant 0 . Huang [?] gave another expression for based on
finite element method simulation (FEM), that,
1+
uinj
= 0.12(arctan i j )2.98 + 0.92
1+e
ut

(3.30)

3.4 Coordinates transition


3.4.1 2-D problem
For binary collision simulation, the basic elements includes the velocities, positions
and accelerations. Both velocities and accelerations are vectors. Both for DEM and
TDM models, calculating the magnitude of the relative velocity in normal direction
and tangential direction is very important. In 2-D problem, there are two components for transitions and one for rotation in a Cartesian coordinates system. Matrix
algebra can rotate the system and two components in the new system either parallel
or normal to the line linking the centers of the two particles, ki j .
[ ] [
] [ ]
x
cos sin
x
=
y
sin cos
y

(3.31)

where is the angle between the vector ki j and the x coordinate. It also can be
written as
[x y ]T = J[x y]T

(3.32)

where J is a Jacobian. Employing this equation, we can obtain four new velocities, namely, un , i, un , j, ut , i and ut , j. Here the subtribes n for normal components
and t for tangential components. In the program, we use u for normal velocity and

24

3 Collision Process

v for tangential velocity and the four velocities are ui, uj, vi and vj. The value
of is obtained by

= arctan

y j yi
x j xi

(3.33)

The corresponding codes in the program is given as


alpha=datan((paj(5)-pai(5))/(paj(4)-pai(4)))
Here pai and paj are two 14 element arraies, which are obtained from the
matrix stma for the two colliding particles. As an invertible process of eq.3.32, it
is given as as,
[x y]T = J1 [x y ]T

(3.34)

where J1 is the invertible matrix of Jacobian, J. J1 also can be obtained by substituting to instead of in the expression of J.
Considering the antisymmetry of the tangent function, it is requires that xi < x j .
Otherwise, using the codes to exchange the data of pai and paj.
lpos=0
if (pai(4)>paj(4)) then
pak=pai
pai=paj
paj=pak
lpos=1
end if
Here lpos=1 means that pai and paj are exchanged and they will be changed
again.

3.4.2 3-D problem


For 3-D problem, consider two spherical particles in a Cartesian coordinate system [X,Y, Z]T as shown in Fig.3.5.a, each of the particles has 6 degrees of freedom
(DOF), three for translation and three for rotation.
A Jacobian J can be found, which rotates the coordinate system as shown in
Fig.3.5.b and makes the unit vector k parallel to the z-axis [?],
J[kX , kY , kZ ]T = [0, 0, 1]T
where,

(3.35)

3.4 Coordinates transition

25

(b)

(a)

(c)

Fig. 3.5 Rotation of coordinate system for binary collision. (a) the coordinates [X,Y, Z]T and the
velocity components before rotation, (b) the coordinates [x, y, z]T and the velocity components after
rotation, (c) The Eular angles in [X,Y, Z]T coordinate system. The gray areas in (a) and (b) are the
contact circles.

cos sin
J = sin cos
0
0

0 1 0
0
cos sin 0
0 0 cos sin sin cos 0
1 0 sin cos
0
0
1

(3.36)

, and are the Euler angles of the vector k in the original coordinate system,
as shown in Fig.3.5.c. If = 0, the Jacobian becomes,

cos cos sin sin cos sin sin cos 0


(3.37)
J = sin cos + cos sin sin sin + cos cos 0
0
0
1
The pre-collisional velocities in the rotated coordinate system are given by,
[ux , uy , uz ]T = J[uX , uY , uZ ]T

(3.38a)

[ x , y , z ]T = J[ X , Y , Z ]T

(3.38b)

Same as aforementioned in 2-D problem, the invertible process from the new
coordinate system to the ordinal system can employ the invertible matrix J1 , which
can be obtained by substituting to instead of in eq.3.37.

Chapter 4

Time Integration

As mentioned by Allen and Tildesley (1987) [?], the frequently used integration
method is named after Verlet (1967) [?]. The Verlet algorithm is base on positions
r(t), accelerations a(t) and positions in the previous time step r(t dt) to predict
the status of each particles, as
r(t + dt) = 2r(t) r(t dt) + dt 2 a(t)

t-dt

d+dt

d-dt

d+dt

d-dt

d+dt

(4.1)

d-dt

d+dt
p
u
a

p
u
a
p
u
a

Fig. 4.1 Various forms of the Verlet algorithm. (a) The original form, (b) The leapfrog form and
(c) The velocity form.

Except the original Verlet algorithm, there are some other various forms of the
Verlet algorithms, as shown in Figure 4.1. In the code, the accelerations a(t), and
new velocities u(t + dt) and positions r(t + dt) are obtained from Swope et al.
(1982) [?], that,
u(t + dt) = u(t) + a(t)dt

(4.2)

and
27

28

4 Time Integration

r(t + dt) = r(t) + u(t + dt)dt


Then the integration section in the codes follows the statements as,
DO WHILE (T0<TIME)
DO M=1, M1-1
DATA1(6,M)=DATA1(6,M)+DATA1(9,M)*DTS
DATA1(7,M)=DATA1(7,M)+DATA1(10,M)*DTS
DATA1(4,M)=DATA1(4,M)+0.5*DATA1(6,M)*DTS
DATA1(5,M)=DATA1(5,M)+0.5*DATA1(7,M)*DTS
ENDDO
T0=T0+DTS
ENDDO
While in practice, IF (T0<TIME) THEN GOTO ,

(4.3)

Chapter 5

Hybrid Algorithm

29

Chapter 6

Coupling with SPH

31

Chapter 7

DEM Codes

33

Appendix

35

Index

N 2 algorithm, 5
bcp2, 3
bcp, 3
binary, 3
dtp1, 2
dtpint, 2
field, 3
fricp, 4
instat, 2
outputp, 3
reset, 3
rhop, 4
tp0, 3
tpfinal, 4
tpout, 4
velocityp, 3
xlower, 3
xupper, 3
ylower, 3
yupper, 3

effective stiffness coefficient, 17, 18


effective Youngs modulus, 18
event-driven method (EDM), 19

binary collision time, 19


body fitted link cell method (BFLC), 7

oblique collision, 15
original algorithm, 5
overlapping, 17

chain index, 13
coefficient of restitution, COR, 15
Constant Normal COR, 18
contact time, 12
cut-off distance, 6, 7
damping coefficient, 17
direct search method, 5, 12
discrete element method (DEM), 1
EDM, 1
effective mass, 18
effective radius, 18

ghost cell, 6
ghost particle, 18
granular material, v
hard particle model, 19
imaginary particle, 18
initial time, 3
Jabobian, 8, 23, 24
linked-cell method, 5
MATEP, 1
moment of inertia, 18
normal coefficient of restitution (NCR), 4
normal collision, 15

poissons ratio, 4
Rayleigh time, 19
relaxation time, 4
rolling, 16
Shanzhai DEM, 1
shear modulus, 4
slip, 16
sticking, 16
stma, 3
subroutine, 2
surface friction, 4

37

38

Index

time-driven method (TDM), 16

visco-elastic Model, 16

Verlet algorithm, 5, 27

Youngs modulus, 4

You might also like