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

Lecture

Calculation of diffusion
coefficient
Diffusion coefficient
Mutual diffusion coefficient D. It appears in Fick’s law for the
diffusive flux of a component i in another component j. The diffusion
coefficient, or diffusivity, is a measure of the component i mobility
inside the system j, and depends on the nature of both components.

J i  Dij rÑwi Relates diffusive flux to concentration gradient

Diffusion coefficient is important for a number of relevant problems

Self diffusion coefficient, Ds, is defined as

r
J i  Dsi, j wi Ñmi
Relates diffusive flux to

RT Chemical potential gradient

And is an intrinsic measure of the mobility of species i in the medium j


Diffusion coefficient
Although self diffusion is a true measure of molecule mobility in the
diffusive flux, whose true driving force is chemical potential gradient
rather than concentration gradient (indeed diffusive fluxes can arise
also from large temperature and pressure gradients, besides
concentration gradients), mutual diffusion coefficients are of more
practical use
Relation between D and Ds
r 1 Ñmi 1 mi
Dsi, j wi Ñmi  Dij r Ñwi Dij 
RT
Dsi, j
1

RT
Dsi, j
 ln wi
RT Ñwi
Pure mobility wi
mi  mi ref   RT ln ai 
  ln ai Thermodynamic
Dij  Dsi, j   factor
  ln w
i

D and Ds are related by means of a thermodynamic factor


Diffusion coefficient
Thermodynamic factor is identically 1 (D=Ds) in two cases:
a) Pure species (self diffusion of component in an environment of
equal moleculesno concentration gradient)
b) Dilute mixture (wi linear with ai according to Henry’s law)
When none of such conditions is met, we must use a thermodynamic
model (or experimental data about the mixture) to estimate the
thermodynamic factor. For instance with an activity coefficient model:
  ln ai    ln gi wi  wi 
gi  gi wi     
  ln w    ln wi 
i  

e.g. if we use Flory-Huggins model   ln a 


i 
    1  i  1  2cij i 
2

  ln wi 

Ds can be estimated from molecular simulationsD


Calculation of Ds
Consider a particle moving, due to diffusion, in a system. In such a case we can
obtain the Self-Diffusion coefficient via Molecular Simulations using :
2
ri t   ri 0 Einstein’s relation between D and mean
Dsi, j  lim
t  6t squared displacement

This quantity is known as the mean squared displacement (MSD) and


represents the mean-squared distance over which the tagged particle has
moved in a time interval t. It comes from an analysis of the particle trajectory

298 K 358 K Trajectory of an oxygen


molecule in
amorphous cis-1,4-
polyisoprene (a) at 298
K and (b) at 358 K
during 1.5 ns

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Calculation of transport properties
In a small system, with periodic boundary conditions, the volume inspected is
limited and, if we calculate D from Einstein’s law with t, we get D0, because
the maximum achievable MSD is of order V2/3.
For system of smaller size we can estimate the MSD from the so-called velocity
autocorrelation function
We can define the velocity auto correlation function of a tagged particle
moving in an ensemble of equal particles:
1
Z t   v(t)  v(0)
3
It is a measure of the projection of the particle velocity onto its initial
value, averaged over initial conditions. Its value at t=0 is given by the
equipartition theorem:

1 2 kBT kB Boltzmann constant


Z 0  v (0)  T Temperature
3 m m mass
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Calculation of transport properties

At long times (compared to the characteristic relaxation times of the substance


considered) the initial and final velocities will be completely uncorrelated
Thus Z(t)0. (molecules collide with each other and change direction,
“forgetting” their previous velocity)..

MSD and velocity autocorrelation function are correlated


t t t

ri t   ri 0   v(t')dt'   v(t')dt'   v(t'')dt''


2
ri t   ri 0 
0 0 0
t t t t' t t'

 v(t')dt'   v(t'')dt''  2 dt ' dt '' v(t')  v(t'')  6 dt ' dt ''Z t ' t ''
0 0 0 0 0 0

A change of variable from t’’ to (t’-t’’) followed by an integration by parts yields:


t
 t ' t '' 
 6t  1 
2
ri t   ri 0 
Z t ' t ''d (t ' t '')
 t 
0
Calculation of transport properties
2
ri t   ri 0
D  lim
t  6t

Green-Kubo and  This is a GREEN-KUBO type of formula

 Z t dt
Einstein are equivalent
and choice should be
D (relates a macroscopic kinetic quantity
to the time integral of a microscopic
made based on 0 time-correlation function) and is valid
convenience also for other properties,

GREEN 1
KUBO for h
VkBT  sxy t  sxy 0 dt
VISCOSITY 0

 N
1 
Where sxy   mi vxivyi   x ij fy rij 

i 1 
 2 j i 
fy=force component in direction y ; fy=-dV/dy
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Calculation of transport properties

Example of the MSD fitting from a MD run

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
100 ps NVT RUN, force field= Dreiding, T=298 K, Amorphous
builder density = 0.000656 g/cm3, (exp. value at 298 K); 100 molecules in the box

Note that total energy is almost entirely due to kinetic energy, while the non
bonded terms (Van der Waals, Coulomb) are almost zero (IDEAL GAS)
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Example: Self diffusion of CH4
Note that the radial distribution function of CH4 (ideal gas), e.g. the C-C one,
must be constant and around 1 (random distribution)
CH4 Radius of gyration
Example: Self diffusion of CH4
Now launch a 100 ps NPT RUN

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
Analyze the OUTPUT|Analyze|Transport Properties|Correlation
functions and diffusion coefficient

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
Analyze the OUTPUT|Analyze|Transport Properties|Correlation
functions and diffusion coefficient |Mean Square Displacement

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
If you have mapped the atoms into the cell, the system will warn
you and ask if you want to continueclick NOgo back into the
MODIFY CELL menu and unclick «Map atoms into cell» and
repeat MSD calculation

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
After clicking on MSD the system will generate a graph like this

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4
Go Back to the Analyze menu, and select the time range over
which to interpolate for Einstein’s correlation validity (choose
the linear range, e.g. between 50 and 90 ps

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Example: Self diffusion of CH4

D(calc) = 0.090 cm2/s


D(exp) = 0.240 cm2/s

431- 78648 Laboratory of Molecular Design and


Materials Simulation
CH4- enlarge the box
The simulation can be size-limited.
Increase the box to 200 molecules of CH4 and repeat he
simulation
D=0.14 cm2/s
Viscosity calculation
TOOL: Analyze|Rheological properties|VISCOSITY
This tool calculates the shear and bulk viscosity by using equilibrium molecular
dynamics (EMD). EMD methods use the Green-Kubo equations to relate the
fluctuations of the off-diagonal elements of the pressure tensor to viscosity.
These expressions are exact only in the limit of long simulation time and large
system size and yield viscosity in the Newtonian limit (zero shear rate).
To perform this analysis you need to have an NVE MD run generated with
LAMMPS. The .log file which will be used for the analysis needs to have information
of the pressure tensor components and be sufficiently large with adequate time step
intervals. The following entries need to be specified :
Correlation time (ps): the time used in the integration of the autocorrelation fuction.
Shear viscosity: check to calculate the shear viscosity.
Bulk viscosity: check to calculate the bulk viscosity.
Choose units: select the units to use.
Number of blocks: set the number of blocks for calculating statistics.
Browse: locate the NVE MD run to analyze and select the .log file.
The calculation generates a window with the results where, also, analysis of the run
parameters can be found. It, also, generates graphs for bulk and/or shear viscosity
with time, and bulk/shear stress tensor correlation functions.

You might also like