dsmc direct simulation monte carlo of gas flows
TRANSCRIPT
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
1/20
1
Direct Simulation Monte Carlo(DSMC) of gas flows
Monte Carlo method: Definitions
Basic concepts of kinetic theory of gases Applications of DSMC Generic algorithm of the DSMC method Summary
Reading: G.A. Bird, Molecular gas dynamics and the direct simulationof gas flows. Clarendon Press, 1994
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
2/20
2
Direct Simulation Monte Carlo of gas flows: Definitions
Monte Carlo method is a generic numerical method for a variety ofmathematical problems based on computer generation of randomnumbers.
Direct simulation Monte Carlo (DSMC) method is the Monte Carlomethod for simulation of dilute gas flows on molecular level, i.e. onthe level of individual molecules. To date DSMC is the basicnumerical method in the kinetic theory of gases and rarefied gas
dynamics.
Kinetic theory of gases is a part of statistical physics where the flowof gases are considered on a molecular level and described in terms
of changes of probabilities of various states of gas molecules inspace and in time.
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
3/20
3
Dilute gas DSMC is applied for simulations of flows of a dilute gas Dilute gas is a gas where the density parameter (volume fraction) is small
= n d3
only binary collisions between gas molecules are important
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
4/20
4
Flow regimes of a dilute gas Collision frequency of a molecule with diameter d is the averaged number of collisions
of this molecule per unit time
Mean free path of a molecule = g (1 / ) = 1 / ( n )
Knudsen number Kn = /L = 1 / ( n L ), L is the flow length scale
Knudsen number is a measure of importance of collisions in a gas flowKn > 1 (Kn > 10)
Continuum flow Transitional flow Free molecular (collisionless) flow
2d
Collision cross-section = d2
g t
g
Relative velocity of molecules, g= |v1-v2|
gn
t
tgn=
=
L
Local equilibrium Non-equilibrium flows
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
5/20
5
Applications of DSMC simulations (I)
Aerospace applications: Flows in upper atmosphere and in vacuum
Planetary science and
Satellites and spacecraftson LEO and in deep space
Re-entry vehicles inupper atmosphere
Nozzles and jetsin space environment
Dynamics of upperplanetary atmospheres
Atmospheres of smallbodies (comets, etc)astrophysics
Global atmosphericevolution (Io, Enceladus, etc)
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
6/20
6
Applications of DSMC simulations (II)
Fast, non-equilibrium gas flows (laser ablation, evaporation, deposition)
Flows on microscale, microfluidics
Flows in microchannesFlows in electronic devices
and MEMSFlow over microparticlesand clusters
SootclustersSi waferHD
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
7/20
7
Basic approach of the DSMC method
Gas is represented by a set of Nsimulated molecules (similar to MD)X(t)=(r1(t),V1(t),,rN(t),VN(t))
Velocities Vi(and coordinates ri) of gas molecules are random variables. Thus, DSMC isa probabilistic approach in contrast to MD which is a deterministic one.
Gas flow is simulated as a change of X(t) in time due to
Free motion of molecules or motion under the effect of external (e.g. gravity) forces Pair interactions (collisions) between gas molecules
Interaction of molecules with surfaces of streamlined bodies, obstacles, channelwalls, etc.
Computational domain
ri vi
Rebound of a molecule from the wall
External force field fe
fei
Pair collision
In typical DSMC simulations(e.g. flow over a vehicle inEarth atmosphere) thecomputational domain is apart of a larger flow. Hence,some boundaries of a
domain are transparent formolecules and number ofsimulated molecules, N, isvaried in time.
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
8/20
8
Statistical weight of simulated molecules in DSMC
Number of collisions between molecules is defined by the collision frequency = n g. For the same velocities of gas molecules, the number of collisions depends on nand .
Consider two flows
Thus, in DSMC simulations the number of simulated molecules can not be equal to thenumber of molecules in real flow. This differs DSMC from MD, where every simulatedparticle represents one molecule of the real system.
Every simulated molecule in DSMC represents W molecules of real gas, whereW= n/nsim is the statistical weight of a simulated molecule. In order to make flow ofsimulated molecules the same as compared to the flow of real gas, the cross-section ofsimulated molecules is calculated as follows
W
n
n
sim
sim ==
If n1 1 = n2 2 ,
then the collision frequenciesare the same in both flows.
If other conditions in both flowsare the same, then two flows are
equivalent to each other.
n1, 1 n2, 2
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
9/20
9
DSMC algorithm (after G.A. Bird)
Any process (evolving in time or steady-state) is divided into short timeintervals time steps t
X(t)=(r1(t),V1(t),,rN(t),VN(t))
Xn= X(tn), state of simulated molecules at time tn
Xn+1
= X(tn+1
), state of simulated molecules at time tn+1
= tn
+
t At every time step, the change of Xn into Xn+1 (Xn Xn+1) is splitted into a
sequence of three basic stages Stage I. Collisionless motion of molecules (solution of the motion
equations)Xn X*
Stage II. Collision sampling (pair collisions between molecules)
X* X**
Stage III. Implementations of boundary conditions (interactions ofmolecules with surfaces, free inflow/outflow of molecules throughboundaries, etc)
X** Xn+1
Thus, in contrast with MD, where interaction between particles aredescribed by forces in equations of motion, in DSMC, interactionsbetween particles is described by means of a special random algorithm(collision sampling) which is a core of any DSMC computer code.
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
10/20
10
DSMC vs. Molecular Dynamics (MD) simulations
MD simulations: Direct solution of the motion equations at a time step
ei
j
iji
idt
dm ff
v+=2
2
eii
idt
dm f
v=2
2
Ni ,...,1=
=j
iji
idt
dm f
v2
2
Interaction force between molecules iandj External force
Both MD and DSMC are particle-based methods
DSMC simulations:
Splitting at a time step
(*)
Special probabalistic approach for sampling of binary collisions instead ofdirect solution of Eq. (*)
Use of statistical weights NNi sim
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
11/20
11
DSMC vs. MD and CFD in simulations of gas flows
Three alternative computational methodology
for simulations of gas flows
MD, Molecular dynamic simulations
DSMC, Direct simulation Monte Carlo
CFD, Computational fluid dynamics
LowModerateHighRelativecomputational cost
No limitations,usually, /L < 0.1
No limitations, usually,/L > 0.01
Less then 1micrometer
Typical flow lengthscale L
Continuum near-equilibrium flows
Transitional and freemolecular non-equilibrium flows
Dense gas flows,phase changes,complex molecules
Where applied
Dilute gasDilute gasDilute gas, densegas, clusters, etc.
Gas state
Navier-Stokesequations
Boltzmann kineticequation
Classical equationsof motion forparticles
Theoretical model
CFDDSMCMD
L
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
12/20
12
Stage I. Collisionless motion
X
n
= (r1n
,V1n
,,rNn
,VNn
)Xn X*
For every molecule, its equations of motion are solved for a time step
dri/dt= Vi, midVi/dt= fei, i= 1, , N
ri(t
n
)=r
i
n
,V
i(tn
)=V
i
n
,mi is the real mass of a gas molecule
In case of free motion (fei= 0)
X*=(r1*,V1n,,rN*,VNn)ri* = ri
n+ tVin
If external force field is present, the equations of motion are solvednumerically, e.g. by the Runge-Kutta method of the second order
X*=(r1*,V1
*,,rN*,VN
*)
ri= rin+ (t/2) Vi
n, Vi= Vin+ (t/2) fei(ri
n)
ri*= ri
n+ tVi, Vi
* = Vin+ tfei(ri)
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
13/20
13
Stage II. Collision sampling (after G.A. Bird)
X* = (r1
*,V1
*,,rN
*,VN
*)X* X**
Computational domain is divided into a mesh of cells.
For every molecule, the index of cell to which the molecule belongs is calculated(indexing of molecules).
At a time step, only collisions between molecules belonging to the same cell are takeninto account
Every collision is considered as a random event occurring with some probability ofcollision
In every cell, pairs of colliding molecules are randomly sampled (collision sampling in acell). For every pair of colliding molecules, pre-collisional velocities are replaced bytheir post-collisional values.
Cell
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
14/20
14
Collision sampling in a cell : Calculation of the
collision probability during time step
)(simij
|| ijijg g=
cell
ijsimij
ij V
tg
P
=
)(
ijij vvg =
ijg
tgij
Relative velocity of molecules i and j
Probability of a random collision
between molecules i and j duringtime step
Cell of volume Vcell containing Ncellmolecules
j
i
Molecules are assumed to be
distributed homogeneously withinthe cell
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
15/20
15
Collision sampling in a cell : Calculation of particle
velocities after a binary collision of hard sphere
Velocities
beforecollision
Velocities
aftercollision
Conservation laws of momentum,
energy, and angular momentum
Equations for molecule
velocities after collision
For hard sphere (HS) molecules unity vector n is an isotropic random vector:
==
===
2
1
22
cos1sin,21cos
),2sin(sin),2cos(sin,cos zyx nnn
i is a random number distributed with equal probability from 0 to 1.
In a computer code, it can be generated with the help of library functions,which are called random number generators.
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
16/20
16
Collision sampling in a cell: The primitive scheme
i = 1
j = i + 1
Pij = tij(sim)gij/ Vcell
< Pij
)2sin(sin
)2cos(sin
cos
cos1sin
21cos
2
2
2
1
=
=
=
=
=
z
y
x
n
n
n
j = j + 1
i = i + 1
j < Ncell
Does collision
between moleculesi and j occur?
no yes
yes
yes
no
noGo to the next cell
Calculation of the
collision probability
Calculation ofvelocities aftercollision
Are there otherpairs of moleculesin the cell?
Disadvantage of
the primitivescheme:
Number ofoperation ~ Ncell
2
In real DSMC
simulations, moreefficient schemes
for collisionsampling are used,e.g. the NTC scheme
by Bird
i < Ncell - 1
P( < Pij) = Pij
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
17/20
17
X**
= (r
1
**
,V
1
**
,,r
N
**
,V
N
**
)X** Xn+1
Implementation of boundary conditions depends on the specifics of the flow problemunder consideration. Typically, conditions on flow boundaries is the most specific partof the problem
Examples of boundary conditions
Impermeable boundary (e.g. solid surface):
rebound of molecules from the wall
Permeable boundary between the
computational domain and the reservoir
of molecules (e.g. Earth atmosphere) :
free motion of molecules through boundary
reproducing inflow/outflow fluxes
Stage III. Implementation of boundary conditions
Computational domainReservoir (Earth atmosphere)
Flow over a re-entry vehiclein Earth atmosphere
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
18/20
18
Rebound of molecules from an impermeable wall
Boundary condition is based on themodel describing the rebound of anindividual gas molecule from the wall.
The model should defined the velocity ofreflected molecule as a function of the
velocity of the incident molecule,Vr=Vr(Vi,nw,Tw,).
In DSMC simulations, velocity of everymolecule incident to the wall is replacedby the velocity of the reflected molecule.
In simulations, the Maxwell models of
molecule rebound are usually applied.
Maxwell model of specular scattering: Amolecule reflects from the wall like anideal billiard ball, i.e.
Vrx= Vix, Vry= - Viy, Vrz= Viz
Vr= Vi 2 ( Vi nw) nw
Disadvantage: heat flux and shear drag on
the wall are zero (Vr2 = Vi
2). The model is
capable to predict normal stress only.
Maxwell model of diffuse scattering: Velocity
distribution function of reflected molecules isassumed to be Maxwellian:
Random velocity of a reflected molecule can
be generated using random numbers i
Vi
nw
Vr
x
y
z Tw, wall temperature
)2sin(lg)/(2
lg)/(2
)2cos(lg)/(2
2exp
))/(2()(
21
3
21
2
2/3
=
=
=
=
wrz
wry
wrx
w
r
r
rr
TmkV
TmkV
TmkV
kT
m
Tmk
nf
VV
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
19/20
19
At every time step of DSMC simulations
1. All molecules moving from the computational domain intoreservoir is excluded from further simulations
2. Reservoir is filled by N=n
Vmolecules, where Vis the
reservoir volume. Random coordinates of every moleculein reservoir are generated homogeneously, randomvelocities are generated from the Maxwelian distribution.
3. All molecules in the reservoir are moved: Their positionsand velocities are changed with accordance to theirequations of motion during a time step.
4. All molecules from the reservoir that entered thecomputational domain during a time step are included tothe set of simulated molecules. All other molecules fromthe reservoir are excluded from further simulations.
Free inflow/outflow of molecules on a permeable boundary
( )
=
kT
m
Tmk
nf
2exp
))/(2()(
2
2/3
UVV
)2sin(lg)/(2
)2cos(lg)/(2)2cos(lg)/(2
65
43
21
+=
+=
+=
TmkUV
TmkUV
TmkUV
zz
yy
xx
Computational domainReservoir
3121
2121
1121
)(
)(
)(
+=
+=
+=
zzzz
yyyy
xxxx
x
y
x1 x2
Random coordinates:
Random velocities:
Maxwellian velocity distributionin the reservoir:
n, concentration
T, temperature,
U, gas velocity
-
7/29/2019 DSMC Direct Simulation Monte Carlo of Gas Flows
20/20
20
Summary
DSMC is a numerical method for simulations of free-molecular, transitional and
near-continuum flows of a dilute gas on a level of individual molecules.
It is usually used for flows where the local state of gas molecules is far from the
local equilibrium
As compared to MD, DSMC has the following distinctive features
Every simulated molecule in DSMC represents Wmolecules in real flow, typicallyW>> 1. It makes DSMC capable for simulation of flows with almost arbitrary lengthscale (e.g., planetary atmosphere).
Interactions between molecules are taken into account in the framework of a specialcollision sampling algorithm, where interactions (pair collisions) are considered as
random events and simulated based on generation of random numbers. Typically, an implementation of DSMC in a computer code relays on two types
of models describing
Pair collision between molecules
Rebound of a molecule from an impermeable wall
Though in this lecture we consider only hard sphere molecules, a variety of modelsexists for both inter-molecular and molecule-wall collisions. These models arecapable to account for many features of molecules in real gases (e.g., internaldegrees of freedom, etc.)
Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas
flows. Clarendon Press, 1994.