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

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.

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 billiardball-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 t 2d

ngt = ng t

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

Local equilibrium

Non-equilibrium flows

Applications of DSMC simulations (I)


Aerospace applications: Flows in upper atmosphere and in vacuum
Satellites and spacecrafts on LEO and in deep space Re-entry vehicles in upper atmosphere Nozzles and jets in space environment

Planetary science and astrophysics


Dynamics of upper planetary atmospheres

Global atmospheric evolution (Io, Enceladus, etc)

Atmospheres of small bodies (comets, etc)

Applications of DSMC simulations (II)


Fast, non-equilibrium gas flows (laser ablation, evaporation, deposition)

Flows on microscale, microfluidics


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

HD

Si wafer

Soot 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 computational domain is a 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. Computational domain
7

ri fei

vi

Rebound of a molecule from the wall

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

sim

n = = W nsim

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 = f ij + f ei 2 dt j
Interaction force between molecules i and j

i = 1,..., N
External force

DSMC simulations:
Splitting at a time step

d 2 vi mi = f ei 2 dt d 2 vi mi = f ij 2 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 MD, Molecular dynamic simulations DSMC, Direct simulation Monte Carlo CFD, Computational fluid dynamics MD Theoretical model Classical equations of motion for particles Dilute gas, dense gas, clusters, etc. Dense gas flows, phase changes, complex molecules Less then 1 micrometer High DSMC Boltzmann kinetic equation Dilute gas CFD Navier-Stokes equations Dilute gas

Gas state

Where applied

Transitional and free molecular nonequilibrium flows

Continuum nearequilibrium flows

Typical flow length scale L Relative computational cost

No limitations, usually, No limitations, / L > 0.01 usually, / L < 0.1 Moderate Low
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 Vi(tn)=Vin, ri(tn)=rin, 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 |

g ij
ij ( sim )
j

Probability of a random collision between molecules i and j during time step

Pij =
g ij t

ij ( sim ) g ij t Vcell

14

Collision sampling in a cell : Calculation of particle velocities after a binary collision of hard sphere
Velocities before collision Conservation laws of momentum, energy, and angular momentum Velocities after collision Equations for molecule 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 21 , 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, which are called random number generators.
15

Collision sampling in a cell: The primitive scheme


i=1 j=i+1 Pij = tij(sim)gij / Vcell no < Pij yes
cos = 1 21 sin = 1 cos 2 n x = cos

Calculation of the collision probability Does collision between molecules i and j occur? Calculation of velocities after collision

Disadvantage of the primitive scheme: Number of operation ~ Ncell2 In real DSMC simulations, more efficient schemes for collision sampling are used, e.g. the NTC scheme by Bird

P( < Pij) = Pij

n y = sin cos( 2 2 ) n z = sin sin( 2 2 )

j=j+1 yes j < Ncell yes no i=i+1 i < Ncell - 1 no

Are there other pairs of molecules in the cell?

Go to the next cell

16

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 Impermeable boundary (e.g. solid surface): rebound of molecules from the wall Flow over a re-entry vehicle in Earth atmosphere

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 model describing the rebound of an individual gas molecule from the wall. The model should defined the velocity of reflected molecule as a function of the velocity of the incident molecule, Vr=Vr(Vi,nw,Tw,). Maxwell model of specular scattering: A molecule reflects from the wall like an ideal 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 = Vi2). The model is capable to predict normal stress only. Maxwell model of diffuse scattering: Velocity distribution function of reflected molecules is assumed to be Maxwellian:
mVr2 nr f (Vr ) = exp 2kT (2(k / m)Tr )3 / 2 w

y nw Vi z

Vr x

Tw, wall temperature

In DSMC simulations, velocity of every molecule incident to the wall is replaced by the velocity of the reflected molecule. In simulations, the Maxwell models of molecule rebound are usually applied.

Random velocity of a reflected molecule can be generated using random numbers i


Vrx = 2(k / m)Tw lg 1 cos(2 2 ) Vry = 2(k / m)Tw lg 3 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:

x1
1.

x2

m(V U )2 n f (V ) = exp 3/ 2 ( 2(k / m)T ) 2kT

At every time step of DSMC simulations All molecules moving from the computational domain into reservoir is excluded from further simulations Reservoir is filled by N=nV molecules, where V is the reservoir volume. Random coordinates of every molecule in reservoir are generated homogeneously, random velocities are generated from the Maxwelian distribution. All molecules in the reservoir are moved: Their positions and velocities are changed with accordance to their equations of motion during a time step. All molecules from the reservoir that entered the computational domain during a time step are included to the set of simulated molecules. All other molecules from the reservoir are excluded from further simulations.

n, concentration T, temperature, U, gas velocity Random coordinates:

2.

x = x1 + ( x2 x1 )1 y = y1 + ( y2 y1 ) 2 z = z1 + ( z 2 z1 ) 3
Random velocities:

3.

Vx = U x + 2(k / m)T lg 1 cos(2 2 ) V y = U y + 2(k / m)T lg 3 cos(2 4 ) Vz = U z + 2(k / m)T lg 5 sin(2 6 )

4.

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 20 flows. Clarendon Press, 1994.

Das könnte Ihnen auch gefallen