Académique Documents
Professionnel Documents
Culture Documents
simulation of a gas flow at the molecular level. While there is a limit to the size
of the flow-field with respect to the molecular mean free path, personal computers
now allow solutions well into the continuum flow regime. The method can be
applied to basic problems in gas dynamics and practical applications range from
micro-electro-mechanics systems (MEMS) to astrophysical flows. DSMC
calculations have assisted in the design of vacuum systems, including those for
semiconductor manufacture, and of many space vehicles and missions.
The method was introduced by the author fifty years ago and it has been the
subject of two monographs that have been published by Oxford University Press.
It is now twenty years since the second of these was written and, since that time,
most DSMC procedures have been superseded or significantly modified. In
addition, visual interactive DSMC application programs have been developed that
have proved to be readily applicable by non-specialists to a wide variety of practical
problems. The computational variables are set automatically within the code and
the programs report whether or not the criteria for a good calculation have been
met. This book is concerned with the theory behind the current DSMC molecular
models and procedures, with their integration into general purpose programs, and
with the validation and demonstration of these programs. The DSMC and
associated programs, including all source codes, can be freely downloaded through
links that are provided in the book.
The main accompanying program is simply called the "DSMC program" and, in
future versions of the book, it will be applicable to homogeneous (or
zero-dimensional) flows through to three-dimensional flow. All DSMC simulations
are time-accurate unsteady calculations, but the flow may become steady at large
times. The current version of the DSMC code is applicable only to zero and
one-dimensional flows and the older DS2V code is employed for the
two-dimensional validation and demonstration cases. It is because of this
temporary use of the older and well-proven program that the DS2V source code
is made freely available for the first time.
Most of the homogeneous flow cases are validation studies, but include internal
mode relaxation studies and spontaneous and forced ignition leading to combustion
in an oxygen-hydrogen mixture. The one-dimensional cases include the structure
of a re-entry shock wave that takes into account electronic excitation as well as
dissociation, recombination and exchange reactions. They also include a
spherically imploding shock wave and a spherical blast wave. The two-dimensional
and axially-symmetric demonstration cases range from a typical MEMS flow to
aspects of the flow around rotating planets. Intermediate cases include the
formation and structure of a combustion wave, a vacuum pump driven by thermal
creep, a typical vacuum processing chamber, and the flow around a typical re-entry
vehicle.
The first version of the DSMC.F90 program can be applied to homogeneous gases
and one-dimensional flows with plane, cylindrical or spherical geometry. Future
versions will extend it to cover two-dimensional flows with plane or axially-symmetric
geometry and three-dimensional flows. All DSMC calculations have physical time
as a variable and are unsteady flows. However, if the boundary conditions are such
that a time-invariant state is attained at large times, this steady flow can be studied.
!***********************
constants
PI=3.1415926535897932D00
DPI=6.283185307179586D00
SPI=1.772453850905516D00
BOLTZ=1.380658D-23
AVOG=6.022169D26
!***********************
10 NNC DEFAULT=0--0 to select collision partner randomly from collision cell, 1 for
. nearest-neighbour collisions
11 SAMPRAT DEFAULT=5--the number of time steps in a sampling interval
12 OUTRAT DEFAULT=50--the number of flow samples in a file output interval
.
13 FRACSAM DEFAULT=0.5--fraction of the output interval over which a time-averaged
sample is taken in an unsteady flow
14 IMTS DEFAULT=0--0 to set the move time step to the instantaneous overall time
. step that changes with time, 1 to use a cell dependent collision time, 2 to
keep the time step fixed at the initial value
15 TLIM DEFAULT=1.D20 sets an indefinite run - set if a define STOP time is
. required
16 READ_DATA Subroutine to read Gas data
.
17 IGAS Type of gas: hard sphere, ideal N2, real O2 etc.
.
18 FND(1) Number density of the gas
.
19 FTMP(1) Free stream temperature of Gas
.
20 MMVM the maximum number of vibrational modes of any species
.
21 MELE the maximum number of electronic states of any molecule
.
22 MVIBL the maximum number of vibrational levels for detailed balance lists
23 MMRM 0 if gas is completely monatomic, 1 if some species have rotation
24 MSP the number of molecular species
25 MEX number of exchange or chain reactions
26 MMEX maximum number of exchange reactions involving the same precollision
pair of molecules
27 MNSR the number oF surface reactions
28 SP(1,L) reference diameter of species L
SP(2,L) reference temperature of species L
SP(3,L) viscosity-temperature power law of species L
SP(4,L) reciprocal of the VSS scattering parameter
SP(5,L) molecular mass of species L
SP(6,L) the heat of formation at 273 K.
29 ISPR(1,L) number of rotational degrees of freedom of species L
.
30 ISPR(2,L) 0,1 for constant, polynomial rotational relaxation collision number
31 SPR(1,L) constant rotational relaxation collision number or constant in a second order
SPR(2,L) polynomial coefficient of temperature in the polynomial
SPR(3,L) coefficient of temperature squared in the
32 ISPV(1) number of vibrational modes
46 SPREX(1,J,L,M,K at lower temperature, the Jth reverse exchange reaction of L,M cumulative
) level K viv. dist of post reac mol
SPREX(2,J,L,M,K !-- ditto at higher temperature
)
47 TNEX(N) total number of exchange reaction N
48 NEX(N,L,M) the code number of the Nth exchange or chain reaction in L,M collisions
49 VRRD(1,L,M,K) dissociation rate coefficient to species L, M for vibration level K at 5,000
VRRD(2,L,M,K) K
similar for 15,000 K
50 VRREX(1,J,L,M,K Jth exchange rate coefficient to species L,M for vibrational level K at 1,000
) K
VRREX(2,J,L,M,K similar for 3,000 K
)
51 ITYPE(K) the type of boundary at the minimum x (K=1) and maximum x (K=2)
boundaries
! 0 for a stream boundary
! 1 for a plane of symmetry
! 2 for a solid surface
! 3 for a vacuum
52 MOLSC The desired number of molecules in a sampling cell: 10000*IMEG
53 IGS 0 for initial gas, 1 for stream(s) or reference gas
54 DMOM Sum of momentum of initial molecules
All data items must be set in base SI units and the program employs base SI units
throughout. The data files do not fully specify the gaseous medium. Instead, the
details of the gas species, or combinations of gas species and the potential chemical
reactions between them, are set as subroutines within the source code. The user
is expected to prepare a new subroutine whenever the existing subroutines are
inadequate for the problem to be studied.
CASE
ICLASS 0
ITYPE 1
ISECS 0
MSP 1
1
5
The mean collision rate per molecule for the mixture is obtained as the sum over
the species weighted by the number fraction. i.e. p
The collision time is written as inverse of the mean collision rate. Similarly the mean
free path (FP, FPM) is given by Equations 2.40 and 2.41.
The initial velocity components of the simulated molecule in an equilibrium gas are
generated from the distribution function of Eqn. (2.9). The cumulative distribution
function is
and cannot be inverted. The most common alternative to the inverse cumulative
distribution procedure is the acceptance-rejection procedure. The ratio of the
probability of a particular value of the variate to the maximum probability is equal
to the ratio of the distribution function to the maximum value of the distribution.
A problem with the application of the acceptance-rejection procedure to the velocity
components is that they range from minus infinity to infinity. Cut-off limits have to
be applied to the allowed range of u' etc. values and, the wider the limits, the less
efficient the procedure.
For the generation of representative initial values of the rotational energy, the
required Boltzmann distribution is given in Eq. 4.6-4.9
10
and the cumulative distribution function for the special case of two rotational degrees
of freedom is
11
Thus, sampling from the above distribution as
12
An acceptance-rejection procedure is required for other than a diatomic gas and the
ratio of the probability to the maximum probability for the rotational energy of a
polyatomic molecule is
13
14
The simple harmonic model will be employed for the vibrational mode and a level
will be stored for each vibrational mode of a simulated molecule with one or more
vibrational modes. Each vibrational mode contributes two degrees of freedom and
above Eqn. (4.9) for two degrees of rotational freedom is consistent with the
Boltzmann distribution. The simplest procedure for generating the initial distribution
of levels is to apply Eqn. (4.8) for the vibrational energy and to truncate this energy
to the energy of the highest available level. A representative vibrational level of a
mode with a characteristic vibrational temperature
15
Collisions:
No collisions calculated if there are less than two molecules in collision cell. There
are separate collision and sampling cells and every molecule, as well as every
collision cell, is assigned a time parameter. These parameters are kept up to date
with the physical flow time through time steps that vary over the flow field and are
continuously adapted to the local mean collision time. The specified number of
molecules in the sampling cells is generally at least one order of magnitude larger
than the number in a collision cell. All calculations start at zero time and the initial
cell structure reflects the initial state of the flow which is generally a uniform flow.
The number of simulated molecules at any location generally changes with time and
there is often a need to adapt the cells to reflect the changes in the distribution
of number density over the flow field. There is an opportunity for the user to initiate
cell adaption whenever the flow is restarted.
The molecule moves and collisions are uncoupled over a small time step that is
set to a fixed fraction of the local mean collision time. The density in some
applications varies by several orders of magnitude over the flow field. The region
of highest density is often the most important and a good calculation requires that
the time step be small in comparison with the mean collision time in that region.
Note that the molecules move and collisions are calculated in a collision cell when
their times fall more than half a time step behind the overall time step. This means
that the average molecule and collision times are, at all times, equal to the flow
time. Equation 2.33 is employed to calculate the collision cross section, and a
collision takes place if the ratio of product of collision cross section and relative
velocity to maximum value of product of cross section and relative velocity exceeds
a random number.
A time parameter tcell is assigned to each collision cell and collisions appropriate
to tcell are calculated whenever tcell falls 0.5 tcell behind the overall flow time. The
time step tcell is set to a specified small fraction of the sampled mean collision time
in the sampling cell in which the collision cell lies.
16
This expression contains the mean value of the number of molecules. This takes
some time to establish and may change rapidly in an unsteady flow. Also, it has
a finite value when there is only one molecule in a collision cell and this number
has to be carried forward along with the remainder when the number of selections
is truncated to an integer. While these are minor problems, they may be avoided
if advantage is taken of a mathematical property of the Poisson distribution that
describes the fluctuations in the molecule number.
17
18
Early DSMC programs employed a single set of cells and the number of simulated
molecules per cell was generally around twenty or thirty. It soon became clear that
the mean spacing between collision pairs was too large in comparison with the mean
free path and this led to the introduction of sub-cells. These have now been
superseded by separate sets of collision and sampling cells and the emphasis has
been on the reduction of the mean separation between the molecules that are
accepted as collision pairs. The early DSMC programs regarded the molecules
within a cell as representative of the molecules at the location of the cell and the
relative locations of the molecules within the cell were ignored. This continues to
be an option with regard to the selection of collision pairs from collision cells. The
smaller the size of the collision cells, the smaller the ratio of the mean separation
of the collision pairs to the local mean free path.
19
20
The maximum value of the product of the total collision cross-section and the relative
speed is initially set to a reasonably large value and, should a larger value be
encountered during a calculation, it is increased.
21
22
23
There is a continuous set (i.e. an infinite number) of levels beyond the dissociation
limit so that, if imax is above the dissociation level, it must be selected and
dissociation occurs. The condition for dissociation is therefore
24
25
26
Recombination:
The Q-K procedures are sufficiently simple that analytical expressions can be
derived for the corresponding rate coefficients in an equilibrium gas. The Q-K
predicted rates have been shown (e.g., Gallis et al, 2010) to be generally within
the bounds of uncertainty of the generally accepted rates. Moreover, because the
predicted rates are in the form of a summation over the vibrational levels,
expressions may be written down for the vibrationally resolved rates. These allow
the post-reaction vibrational state of the product molecules to be set to values that
satisfy the detailed balance principle. The Larsen-Borgnakke procedures lead to
equilibrium in a non-reacting gas, but their application to reacting gases, as in the
TCE model, leads to a failure of equipartition with regard to the vibrational
temperatures.
All molecular models are phenomenological to some extent and, while the degree
of physical realism should be kept in mind, the accuracy of the results that are
produced by the model is the primary consideration. A model with a greater degree
of physical realism does not necessarily lead to a more accurate result!
27
allows an almost exact fit of ratio of forward and backward kinetic rates to the
equilibrium constant. The reference volume is most conveniently set to the volume
of the sphere with radius equal to the sum of the reference radii of the three
molecules. The probability of recombination is:
28
where n is the number density. The total energy of the recombined molecule is
calculated from the constituents, p and q as
29
The rotational, vibrational and electronic energy of the molecule formed after
recombination would be zero. Add the energy released from recombination to get
the total energy of the molecule
29
to the above energy, now add the relative kinetic energy of the recombined molecule
and thrid body particle. Now, set the vibrational energy of the recombined molecule
to enforce detailed balance.
30
Electronic Relaxation:
It employs direct sampling from the Boltzmann distribution. The electronic levels are
irregularly spaced and few in number. A very large fraction of the molecules are
initially in the ground state and a direct sampling from the Boltzmann distribution
is feasible. For a given temperature, the fraction of molecules in each level is
calculated from Eqn. (2.12). A random fraction is generated and the molecule is
initially placed in the ground state. If the random fraction is below the fraction in
the ground state, it remains in the ground state. If not, the level is progressively
increased until the cumulative fraction exceeds the random fraction.
32
Steps:
33
Probability of post-collision level is proportional to i*
34
35
Vibration Relaxation:
36
37
38
Potential post-collision states are chosen uniformly from the states equal to or below
imax and are selected through an acceptance-rejection routine with probability
39
Now consider the L-B redistribution between the translational mode as group b and
a quantized internal mode with two degrees of freedom of molecule 1 as group a.
Equation (3.25) can then be applied with the energy equal to the sum of the
pre-collision translational energy and the energy of the pre-collision state. is a
constant in the redistribution Ec .
40
where
41
For a gas mixture, the preceding equations are applied separately to each molecular
species in order to generate the initial equilibrium gas.
Rotational Relaxation:
Usually, DSMC calculations employ the rotational collision number Zrot = 5. In other
words, it means that, on average, the rotational energy relaxation occurs once every
five collisions. In general, this is a good approximation for engineering problems;
however, more realistic models for rotational collision number as a function of the
translational temperature or translational energy have been proposed.
42
43
44
45
46
For example, consider the special case of the assignment of energy to a single
internal mode with two degrees of freedom. Eqn. (3.24) then reduces to
47
49
After the L-B procedure the velocities of the species are adjusted for reflecting the
change in kinetic energy. The velocity of centre of mass does not change during
the collision. The post collision velcoities are calculated based on either the VHS
model or the VSS model. Use equations 3.7 and 3.18.
Dissociation Temperature:
50
50
In the case of the DSMC simulation of dissociation-recombination in a homogeneous
gas, it is readily shown that this degree of dissociation is the ratio of the final to
the initial number of simulated molecules minus one. The energy available to atoms
for motion is basically rotational and electronic energy of the pre-dissociation
molecule. Set all internal energies in electronic, rotation, vibration modes, if any,
for both the species formed after dissociation.
The program calculates the characteristic dissociation temperature from the heats
of formation and sets it as SPVM(4,K,L). Dissociation is regarded as an integral part
of vibration excitation and no additional data is required. There is one characteristic
temperature for each vibration mode.
1
where
Moving Molecules:
In symmetry boundary conditions, molecule exit from one boundary and enters from
the other. There is no reflection or removal of the molecule from the system. Particle
moves in fraction of overall timestep.
1
CR
Most simulations of chemical reactions in DSMC have employed the TCE method
that was detailed in Bird (1994). This has now been superseded by the
quantum-kinetic, or Q-K method and this will be implemented exclusively in the
programs in this book. This theory (Bird, 2011) is based on the quantum vibration
model.
Now consider exchange and chain reactions. An exchange reaction has one stable
molecule and one radical both before and after the reaction. A reaction between
two stable molecules that leads to one or more radicals is, like thermal dissociation,
a chain-initiating reaction. When a pre-reaction pair comprised of one stable
molecule and one radical leads to two radicals, it is a chain-branching reaction, while
the opposite is a chain-terminating reaction.
in which A and C are the molecules that split, while B and D are either molecules
or atoms. The phenomenological DSMC procedure for these reactions is analogous
to that for the dissociation model. For the forward or endothermic reactions, the
reaction probability is equal to that of Eqn. (3.36) with i* set to imax defined by Eqn.
(3.35) and with Ec replaced by the activation energy that applies to the reaction.
This is a relative probability that must be normalized through division by the sum
of probabilities from the ground state to imax . Therefore
This is satisfactory only if the level imaxkvib in the numerator is replaced by Ea. Thus
The summation in the denominator is unity when Ea/k is less than vib and only a
few terms need be calculated when the activation energy is small.
The default activation energy for the forward exchange reaction is the heat of
reaction and for the reverse reaction it is zero. To ensure that the ratio of the number
of forward to reverse exchange reaction is consistent with that predicted by statistical
mechanics, it is necessary to adjust the activation energy in phenomenological
manner. The collision energy is given as: