Direct Simulation Monte Carlo (DSMC) of gas lz2n/mse627/notes/DSMC.pdf• Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas flows . Clarendon Press, 1994. 2 Direct Simulation Monte Carlo of gas flows: Definitions

Download Direct Simulation Monte Carlo (DSMC) of gas  lz2n/mse627/notes/DSMC.pdf• Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas flows . Clarendon Press, 1994. 2 Direct Simulation Monte Carlo of gas flows: Definitions

Post on 16-Apr-2018




3 download

Embed Size (px)


<ul><li><p>1</p><p>Direct Simulation Monte Carlo (DSMC) of gas flows</p><p> Monte Carlo method: Definitions Basic concepts of kinetic theory of gases Applications of DSMC Generic algorithm of the DSMC method Summary</p><p> Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas flows. Clarendon Press, 1994</p></li><li><p>2</p><p>Direct Simulation Monte Carlo of gas flows: Definitions</p><p> Monte Carlo method is a generic numerical method for a variety of mathematical problems based on computer generation of random numbers.</p><p> 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 gasdynamics.</p><p> 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.</p></li><li><p>3</p><p>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</p><p> = n d3 </p><p> only binary collisions between gas molecules are important</p></li><li><p>4</p><p>Flow regimes of a dilute gas Collision frequency of a molecule with diameter d is the averaged number of collisions </p><p>of this molecule per unit time</p><p> Mean free path of a molecule = g (1 / ) = 1 / ( n )</p><p> Knudsen number Kn = / L = 1 / ( n L ), L is the flow length scaleKnudsen number is a measure of importance of collisions in a gas flow</p><p>Kn &gt; 1 (Kn &gt; 10)</p><p>Continuum flow Transitional flow Free molecular (collisionless) flow</p><p>2d</p><p>Collision cross-section = d2</p><p>g t</p><p>g</p><p>Relative velocity of molecules, g = |v1-v2|</p><p>gnt</p><p>tgn =</p><p>=</p><p>L</p><p>Local equilibrium Non-equilibrium flows</p></li><li><p>5</p><p>Applications of DSMC simulations (I)</p><p> Aerospace applications: Flows in upper atmosphere and in vacuum</p><p> Planetary science and </p><p>Satellites and spacecrafts on LEO and in deep space</p><p>Re-entry vehicles inupper atmosphere</p><p>Nozzles and jetsin space environment</p><p>Dynamics of upper planetary atmospheres</p><p>Atmospheres of smallbodies (comets, etc) astrophysics</p><p>Global atmospheric evolution (Io, Enceladus, etc)</p></li><li><p>6</p><p>Applications of DSMC simulations (II)</p><p> Fast, non-equilibrium gas flows (laser ablation, evaporation, deposition)</p><p> Flows on microscale, microfluidics</p><p>Flows in microchannesFlows in electronic devices and MEMS</p><p>Flow over microparticlesand clusters</p><p>Soot clustersSi waferHD</p></li><li><p>7</p><p>Basic approach of the DSMC method Gas is represented by a set of N simulated molecules (similar to MD)</p><p>X(t)=(r1(t),V1(t),,rN(t),VN(t))</p><p> 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.</p><p> 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 </p><p>walls, etc.</p><p>Computational domain</p><p>ri vi</p><p>Rebound of a molecule from the wall</p><p>External force field fe</p><p>fei</p><p>Pair collision</p><p>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.</p></li><li><p>8</p><p>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 . </p><p> Consider two flows</p><p> 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.</p><p> 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</p><p>Wn</p><p>n</p><p>simsim ==</p><p>If n1 1 = n2 2 ,then the collision frequencies are the same in both flows.</p><p>If other conditions in both flows are the same, then two flows are equivalent to each other.</p><p>n1, 1 n2, 2</p></li><li><p>9</p><p>DSMC algorithm (after G.A. Bird)</p><p> Any process (evolving in time or steady-state) is divided into short time intervals time steps t</p><p>X(t)=(r1(t),V1(t),,rN(t),VN(t))</p><p>Xn = X(tn), state of simulated molecules at time tnXn+1 = X(tn+1), state of simulated molecules at time tn+1 = tn + t</p><p> 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 </p><p>equations)Xn X*</p><p> Stage II. Collision sampling (pair collisions between molecules) X* X**</p><p> Stage III. Implementations of boundary conditions (interactions of molecules with surfaces, free inflow/outflow of molecules through boundaries, etc)</p><p>X** Xn+1Thus, 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.</p></li><li><p>10</p><p>DSMC vs. Molecular Dynamics (MD) simulations</p><p>MD simulations: Direct solution of the motion equations at a time step</p><p>eij</p><p>iji</p><p>i dt</p><p>dm ff</p><p>v +=22</p><p>eii</p><p>i dt</p><p>dm f</p><p>v =2</p><p>2</p><p>Ni ,...,1=</p><p>=j</p><p>iji</p><p>i dt</p><p>dm f</p><p>v2</p><p>2</p><p>Interaction force between molecules i and j External force</p><p> Both MD and DSMC are particle-based methods</p><p>DSMC simulations:</p><p> Splitting at a time step</p><p>(*)</p><p> Special probabalistic approach for sampling of binary collisions instead of direct solution of Eq. (*)</p><p> Use of statistical weights NNi sim </p></li><li><p>11</p><p>DSMC vs. MD and CFD in simulations of gas flowsThree alternative computational methodology for simulations of gas flows</p><p> MD, Molecular dynamic simulations</p><p> DSMC, Direct simulation Monte Carlo CFD, Computational fluid dynamics</p><p>LowModerateHighRelative computational cost</p><p>No limitations, usually, / L &lt; 0.1</p><p>No limitations, usually, / L &gt; 0.01</p><p>Less then 1 micrometer</p><p>Typical flow length scale L</p><p>Continuum near-equilibrium flows</p><p>Transitional and free molecular non-equilibrium flows</p><p>Dense gas flows, phase changes, complex molecules</p><p>Where applied</p><p>Dilute gasDilute gasDilute gas, dense gas, clusters, etc.</p><p>Gas state</p><p>Navier-Stokes equations</p><p>Boltzmann kinetic equation</p><p>Classical equations of motion for particles</p><p>Theoretical model</p><p>CFDDSMCMD</p><p>L</p></li><li><p>12</p><p>Stage I. Collisionless motionXn = (r1n,V1n,,rNn,VNn)</p><p>Xn X*</p><p> For every molecule, its equations of motion are solved for a time stepdri/dt = Vi, mi dVi/dt = fei, i = 1, , Nri(tn)=rin, Vi(tn)=Vin, </p><p>mi is the real mass of a gas molecule</p><p> In case of free motion (fei = 0)X*=(r1*,V1n,,rN*,VNn)</p><p>ri* = rin + t Vin</p><p> If external force field is present, the equations of motion are solved numerically, e.g. by the Runge-Kutta method of the second order</p><p>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)</p></li><li><p>13</p><p>Stage II. Collision sampling (after G.A. Bird)X* = (r1*,V1*,,rN*,VN*)</p><p>X* X**</p><p> Computational domain is divided into a mesh of cells.</p><p> For every molecule, the index of cell to which the molecule belongs is calculated (indexing of molecules).</p><p> At a time step, only collisions between molecules belonging to the same cell are taken into account</p><p> Every collision is considered as a random event occurring with some probability of collision</p><p> 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.</p><p>Cell</p></li><li><p>14</p><p>Collision sampling in a cell : Calculation of the collision probability during time step</p><p>)(simij</p><p>|| ijijg g=</p><p>cell</p><p>ijsimijij V</p><p>tgP</p><p>= )(</p><p>ijij vvg =</p><p>ijg</p><p>tgij</p><p>Relative velocity of molecules i and j</p><p>Probability of a random collision between molecules i and j during time step</p><p>Cell of volume Vcell containing Ncellmolecules</p><p>j</p><p>i</p><p>Molecules are assumed to be distributed homogeneously within the cell</p></li><li><p>15</p><p>Collision sampling in a cell : Calculation of particle velocities after a binary collision of hard sphere</p><p>Velocitiesbeforecollision</p><p>Velocitiesaftercollision</p><p>Conservation laws of momentum,energy, and angular momentum</p><p>Equations for moleculevelocities after collision</p><p>For hard sphere (HS) molecules unity vector n is an isotropic random vector:</p><p>==</p><p>===2</p><p>1</p><p>22</p><p>cos1sin ,21cos </p><p>),2sin(sin ),2cos(sin ,cos zyx nnn</p><p>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.</p></li><li><p>16</p><p>Collision sampling in a cell: The primitive scheme</p><p>i = 1</p><p>j = i + 1</p><p>Pij = tij(sim)gij / Vcell</p><p> &lt; Pij</p><p>)2sin(sin</p><p> )2cos(sin</p><p> cos</p><p>cos1sin</p><p> 21cos</p><p>2</p><p>2</p><p>2</p><p>1</p><p>=</p><p>==</p><p>=</p><p>=</p><p>z</p><p>y</p><p>x</p><p>n</p><p>n</p><p>n</p><p>j = j + 1</p><p>i = i + 1</p><p>j &lt; Ncell</p><p>Does collision between moleculesi and j occur?</p><p>no yes</p><p>yes</p><p>yes</p><p>no</p><p>noGo to the next cell</p><p>Calculation of the collision probability</p><p>Calculation ofvelocities aftercollision</p><p>Are there otherpairs of moleculesin the cell?</p><p>Disadvantage of the primitive scheme:</p><p>Number of operation ~ Ncell2</p><p>In real DSMCsimulations, moreefficient schemesfor collisionsampling are used,e.g. the NTC schemeby Bird</p><p>i &lt; Ncell - 1</p><p>P( &lt; Pij) = Pij</p></li><li><p>17</p><p>X** = (r1**,V1**,,rN**,VN**)X** Xn+1</p><p> 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</p><p> Examples of boundary conditions Impermeable boundary (e.g. solid surface): </p><p>rebound of molecules from the wall</p><p> Permeable boundary between the computational domain and the reservoir of molecules (e.g. Earth atmosphere) : free motion of molecules through boundaryreproducing inflow/outflow fluxes</p><p>Stage III. Implementation of boundary conditions</p><p>Computational domainReservoir (Earth atmosphere)</p><p>Flow over a re-entry vehiclein Earth atmosphere</p></li><li><p>18</p><p>Rebound of molecules from an impermeable wall Boundary condition is based on the </p><p>model describing the rebound of an individual gas molecule from the wall.</p><p> The model should defined the velocity of reflected molecule as a function of the velocity of the incident molecule, Vr=Vr(Vi,nw,Tw,).</p><p> In DSMC simulations, velocity of every molecule incident to the wall is replaced by the velocity of the reflected molecule.</p><p> In simulations, the Maxwell models of </p><p>molecule rebound are usually applied.</p><p>Maxwell model of specular scattering: A molecule reflects from the wall like anideal billiard ball, i.e.</p><p>Vrx = Vix, Vry = - Viy, Vrz = Viz</p><p>Vr = Vi 2 ( Vi nw ) nw</p><p>Disadvantage: heat flux and shear drag on the wall are zero (Vr2 = Vi2). The model is capable to predict normal stress only.</p><p>Maxwell model of diffuse scattering: Velocity distribution function of reflected molecules is assumed to be Maxwellian:</p><p>Random velocity of a reflected molecule can be generated using random numbers i</p><p>Vi</p><p>nwVr</p><p>x</p><p>y</p><p>z Tw, wall temperature</p><p>)2sin(lg)/(2</p><p>lg)/(2</p><p>)2cos(lg)/(2</p><p>2exp</p><p>))/(2()(</p><p>21</p><p>3</p><p>21</p><p>2</p><p>2/3</p><p>=</p><p>=</p><p>=</p><p>=</p><p>wrz</p><p>wry</p><p>wrx</p><p>w</p><p>r</p><p>r</p><p>rr</p><p>TmkV</p><p>TmkV</p><p>TmkV</p><p>kT</p><p>m</p><p>Tmk</p><p>nf</p><p>VV</p></li><li><p>19</p><p>At every time step of DSMC simulations</p><p>1. All molecules moving from the computational domain into reservoir is excluded from further simulations</p><p>2. Reservoir is filled by N=n</p><p>V molecules, where V is the </p><p>reservoir volume. Random coordinates of every molecule in reservoir are generated homogeneously, random velocities are generated from the Maxwelian distribution.</p><p>3. All molecules in the reservoir are moved: Their positions and velocities are changed with accordance to their equations of motion during a time step.</p><p>4. 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. </p><p>Free inflow/outflow of molecules on a permeable boundary</p><p>( )</p><p>=</p><p>kT</p><p>m</p><p>Tmk</p><p>nf</p><p>2exp</p><p>))/(2()(</p><p>2</p><p>2/3</p><p>UVV</p><p>)2sin(lg)/(2</p><p>)2cos(lg)/(2</p><p>)2cos(lg)/(2</p><p>65</p><p>43</p><p>21</p><p>+=</p><p>+=</p><p>+=</p><p>TmkUV</p><p>TmkUV</p><p>TmkUV</p><p>zz</p><p>yy</p><p>xx</p><p>Computational domainReservoir</p><p>3121</p><p>2121</p><p>1121</p><p>)(</p><p>)(</p><p>)(</p><p>+=+=</p><p>+=</p><p>zzzz</p><p>yyyy</p><p>xxxx</p><p>x</p><p>y</p><p>x1 x2</p><p>Random coordinates:</p><p>Random velocities:</p><p>Maxwellian velocity distributionin the reservoir:</p><p>n, concentration</p><p>T, temperature,</p><p>U, gas velocity</p></li><li><p>20</p><p>Summary DSMC is a numerical method for simulations of free-molecular, transitional and </p><p>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 </p><p>local equilibrium As compared to MD, DSMC has the following distinctive features Every simulated molecule in DSMC represents W molecules in real flow, typically </p><p>W &gt;&gt; 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 </p><p>collision sampling algorithm, where interactions (pair collisions) are considered as random events and simulated based on generation of random numbers.</p><p> Typically, an implementation of DSMC in a computer code relays on two types of models describing Pair collision between molecules</p><p> Rebound of a molecule from an impermeable wall Though in this lecture we consider only hard sphere molecules, a variety of models </p><p>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.)</p><p> Reading: G.A. Bird, Molecular gas dynamics and the direct simulation of gas flows. Clarendon Press, 1994.</p></li></ul>


View more >