Sie sind auf Seite 1von 20

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 simulation
of gas flows. Clarendon Press, 1994

1
Direct Simulation Monte Carlo of gas flows: Definitions
• Monte Carlo method is a generic numerical method for a variety of
mathematical problems based on computer generation of random
numbers.

• Direct simulation Monte Carlo (DSMC) method is the Monte Carlo


method for simulation of dilute gas flows on molecular level, i.e. on
the level of individual molecules. To date DSMC is the basic
numerical method in the kinetic theory of gases and rarefied gas
dynamics.

• Kinetic theory of gases is a part of statistical physics where the flow


of gases are considered on a molecular level and described in terms
of changes of probabilities of various states of gas molecules in
space and in time.

2
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 << 1
n is the numerical concentration of gas molecule
d is the diameter of gas molecules
• In Earth atmosphere, air can be considered as a dilute gas at any altitude, e.g.
on the Earth surface n = 2.7 x 1025 m-3, d = 3.7 x 10-10 m, and ε = 1.4 x 10-3

• For a dilute gas


– Collision length scale d is much smaller then the average distance between
molecules l = 1 / n1/3 = d / ε1/3, d << l =>
• most of time every molecule moves without interactions with other
ones, hence, an interaction between molecules can be considered as
an instant change of their velocities, i.e. as a collision between ‘billiard-
ball’-like particles.
• Real process of molecular motion can be divided into two stages:
(I) collisionless (free) motion of molecules and
(II) instant collisions between them

– If PN is the probability of simultaneous interaction between N gas


molecules, then PN+1/PN ∝ ε =>
• only binary collisions between gas molecules are important
3
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
Relative velocity of molecules, g = |v1-v2| Collision cross-section σ = π d2

g nσg∆t
ν= = nσg
∆t
g · ∆t 2d
• 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 flow
Kn << 1 (Kn < 0.01) Kn ~ 1 Kn >> 1 (Kn > 10)
Continuum flow Transitional flow Free molecular (collisionless) flow

4
Local equilibrium Non-equilibrium flows
Applications of DSMC simulations (I)
• Aerospace applications: Flows in upper atmosphere and in vacuum
Satellites and spacecrafts Re-entry vehicles in Nozzles and jets
on LEO and in deep space upper atmosphere in space environment

• Planetary science and Global atmospheric Atmospheres of small


astrophysics evolution (Io, Enceladus, etc) bodies (comets, etc)
Dynamics of upper
planetary atmospheres

5
Applications of DSMC simulations (II)
• Fast, non-equilibrium gas flows (laser ablation, evaporation, deposition)

• Flows on microscale, microfluidics


Flows in electronic devices Flow over microparticles
and MEMS Flows in microchannes and clusters

Soot
HD Si wafer clusters
6
Basic approach of the DSMC method
• Gas is represented by a set of N simulated 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 is
a 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, channel
walls, etc.
Pair collision
External force field fe In typical DSMC simulations
(e.g. flow over a vehicle in
Earth atmosphere) the
ri vi computational domain is a
fei part of a larger flow. Hence,
some boundaries of a
domain are ‘transparent’ for
molecules and number of
simulated molecules, N, is
varied in time.

Rebound of a molecule from the wall Computational domain


7
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 n and σ.
• Consider two flows

n1, σ1 n2, σ2 If n1 σ1 = n2 σ2 ,
then the collision frequencies
are the same in both flows.

If other conditions in both flows


are the same, then two flows are
equivalent to each other.

• Thus, in DSMC simulations the number of simulated molecules can not be equal to the
number of molecules in real flow. This differs DSMC from MD, where every simulated
particle represents one molecule of the real system.
• Every simulated molecule in DSMC represents W molecules of real gas, where
W = n / nsim is the statistical weight of a simulated molecule. In order to make flow of
simulated molecules the same as compared to the flow of real gas, the cross-section of
simulated molecules is calculated as follows
n
σ sim =σ = σW
nsim 8
DSMC algorithm (after G.A. Bird)
• Any process (evolving in time or steady-state) is divided into short time
intervals – 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 of
molecules with surfaces, free inflow/outflow of molecules through
boundaries, etc)
X** → Xn+1
Thus, in contrast with MD, where interaction between particles are
described by forces in equations of motion, in DSMC, interactions
between particles is described by means of a special random algorithm
(collision sampling) which is a core of any DSMC computer code.
9
DSMC vs. Molecular Dynamics (MD) simulations
 Both MD and DSMC are particle-based methods
MD simulations: Direct solution of the motion equations at a time step
d 2 vi
mi 2
= ∑ f ij + f ei i = 1,..., N
dt j

Interaction force between molecules i and j External force


DSMC simulations:
d 2 vi
 Splitting at a time step mi 2
= f ei
dt
d 2 vi
mi 2
= ∑ f ij (*)
dt j
 Special probabalistic approach for sampling of binary collisions instead of
direct solution of Eq. (*)

 Use of statistical weights i = 1,..., N sim << N


10
DSMC vs. MD and CFD in simulations of gas flows
Three alternative computational methodology
for simulations of gas flows
L
• MD, Molecular dynamic simulations
• DSMC, Direct simulation Monte Carlo
• CFD, Computational fluid dynamics

MD DSMC CFD
Theoretical model Classical equations Boltzmann kinetic Navier-Stokes
of motion for equation equations
particles
Gas state Dilute gas, dense Dilute gas Dilute gas
gas, clusters, etc.

Where applied Dense gas flows, Transitional and free Continuum near-
phase changes, molecular non- equilibrium flows
complex molecules equilibrium flows
Typical flow length Less then 1 No limitations, usually, No limitations,
scale L micrometer λ / L > 0.01 usually, λ / L < 0.1

Relative High Moderate Low


computational cost
11
Stage I. Collisionless motion
Xn = (r1n,V1n,…,rNn,VNn)
Xn → X*
• For every molecule, its equations of motion are solved for a time step
dri/dt = Vi, mi dVi/dt = fei, i = 1, …, N
ri(tn)=rin, Vi(tn)=Vin,
mi is the real mass of a gas molecule

• In case of free motion (fei = 0)


X*=(r1*,V1n,…,rN*,VNn)
ri* = rin + ∆t Vin
• If external force field is present, the equations of motion are solved
numerically, e.g. by the Runge-Kutta method of the second order
X*=(r1*,V1*,…,rN*,VN*)
ri = rin + (∆t/2) Vin, Vi = Vin + (∆t/2) fei(rin)
ri* = rin + ∆t Vi, Vi* = Vin + ∆t fei(ri)

12
Stage II. Collision sampling (after G.A. Bird)
X* = (r1*,V1*,…,rN*,VN*)
X* → X**
• Computational domain is divided into a mesh of cells.

Cell
• 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 taken
into account
• Every collision is considered as a random event occurring with some probability of
collision
• In every cell, pairs of colliding molecules are randomly sampled (collision sampling in a
cell). For every pair of colliding molecules, pre-collisional velocities are replaced by
their post-collisional values.
13
Collision sampling in a cell : Calculation of the
collision probability during time step
Cell of volume Vcell containing Ncell
molecules Molecules are assumed to be
distributed homogeneously within
the cell

Relative velocity of molecules i and j


g ij = v j − v i g ij =| g ij |

i Probability of a random collision


between molecules i and j during
time step
g ij
σij ( sim ) g ij ∆t
Pij =
σij (sim ) Vcell
j g ij ∆t

14
Collision sampling in a cell : Calculation of particle
velocities after a binary collision of hard sphere
Velocities Velocities
before after
collision collision

Conservation laws of momentum, Equations for molecule


energy, and angular momentum velocities after collision

For hard sphere (HS) molecules unity vector n is an isotropic random vector:
nx = cos θ, n y = sin θ cos(2πα 2 ), nz = sin θ sin(2πα 2 ),
cos θ = 1 − 2α1 , sin θ = 1 − cos 2 θ
α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, 15
which are called ‘random number generators’.
Collision sampling in a cell: The ‘primitive’ scheme

i=1

j=i+1 Disadvantage of
Calculation of the the primitive
Pij = ∆tσij(sim)gij / Vcell collision probability scheme:

no yes Does collision Number of


α < Pij between molecules operation ~ Ncell2
cos θ = 1 − 2α1
sin θ = 1 − cos 2 θ
i and j occur?
n x = cos θ In real DSMC
n y = sin θ cos( 2πα 2 ) Calculation of
P(α < Pij) = Pij n z = sin θ sin( 2πα 2 )
simulations, more
velocities after efficient schemes
collision for collision
sampling are used,
e.g. the NTC scheme
j=j+1 Are there other by Bird
yes no pairs of molecules
j < Ncell in the cell?
i=i+1
yes no 16
i < Ncell - 1 Go to the next cell
Stage III. Implementation of boundary conditions
X** = (r1**,V1**,…,rN**,VN**)
X** → Xn+1
• Implementation of boundary conditions depends on the specifics of the flow problem
under consideration. Typically, conditions on flow boundaries is the most specific part
of the problem

• Examples of boundary conditions Flow over a re-entry vehicle


– Impermeable boundary (e.g. solid surface): in Earth atmosphere
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

Reservoir (Earth atmosphere) Computational domain

17
Rebound of molecules from an impermeable wall
• Boundary condition is based on the Maxwell model of specular scattering: A
model describing the rebound of an molecule reflects from the wall like an
individual gas molecule from the wall. ideal billiard ball, i.e.

• The model should defined the velocity of Vrx = Vix, Vry = - Viy, Vrz = Viz
reflected molecule as a function of the Vr = Vi – 2 ( Vi · nw ) nw
velocity of the incident molecule,
Vr=Vr(Vi,nw,Tw,…). Disadvantage: heat flux and shear drag on
the wall are zero (Vr2 = Vi2). The model is
y capable to predict normal stress only.
Vr
nw Maxwell model of diffuse scattering: Velocity
distribution function of reflected molecules is
Vi
x assumed to be Maxwellian:
nr  mVr2 
Tw, wall temperature f (Vr ) = exp − 
z (2π(k / m)Tr )3 / 2  2 kTw 

• In DSMC simulations, velocity of every Random velocity of a reflected molecule can


molecule incident to the wall is replaced be generated using random numbers αi
by the velocity of the reflected molecule. Vrx = − 2(k / m)Tw lg α1 cos(2πα 2 )

• In simulations, the Maxwell models of Vry = − 2(k / m)Tw lg α 3


molecule rebound are usually applied. Vrz = − 2(k / m)Tw lg α1 sin(2πα 2 )
18
Free inflow/outflow of molecules on a permeable boundary
y
Reservoir Computational domain Maxwellian velocity distribution
in the reservoir:
n∞  m(V − U ∞ )2 
f (V ) = exp − 

( 2π(k / m)T∞ ) 3/ 2
 2kT∞ 
x1 x2 x
n∞, concentration
At every time step of DSMC simulations T∞, temperature,
U∞, gas velocity
1. All molecules moving from the computational domain into
reservoir is excluded from further simulations
Random coordinates:
2. Reservoir is filled by N∞=n∞V molecules, where V is the x = x1 + ( x2 − x1 )α1
reservoir volume. Random coordinates of every molecule
in reservoir are generated homogeneously, random y = y1 + ( y2 − y1 )α 2
velocities are generated from the Maxwelian distribution. z = z1 + ( z 2 − z1 )α 3

3. All molecules in the reservoir ‘are moved’: Their positions Random velocities:
and velocities are changed with accordance to their
equations of motion during a time step. Vx = U ∞x + − 2(k / m)T∞ lg α1 cos(2πα 2 )
4. All molecules from the reservoir that entered the V y = U ∞y + − 2(k / m)T∞ lg α 3 cos(2πα 4 )
computational domain during a time step are included to
the set of simulated molecules. All other molecules from Vz = U ∞z + − 2(k / m)T∞ lg α 5 sin(2πα 6 )
the reservoir are excluded from further simulations.

19
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 W molecules in real flow, typically
W >> 1. It makes DSMC capable for simulation of flows with almost arbitrary length
scale (e.g., planetary atmosphere).
 Interactions between molecules are taken into account in the framework of a special
collision 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 models
exists for both inter-molecular and molecule-wall collisions. These models are
capable to account for many features of molecules in real gases (e.g., internal
degrees of freedom, etc.)
 Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas
flows. Clarendon Press, 1994. 20

Das könnte Ihnen auch gefallen