62
Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University rect Simulation Monte Carlo: Theory, Methods, and Application Santa Fe, New Mexico; September 13-16, 2009 DSMC: Fundamentals through Advanced Concepts Short Course

Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Embed Size (px)

Citation preview

Page 1: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Traditional DSMCAlejandro L. Garcia

Department of PhysicsSan Jose State University

Direct Simulation Monte Carlo: Theory, Methods, and ApplicationsSanta Fe, New Mexico; September 13-16, 2009

DSMC: Fundamentals through Advanced ConceptsShort Course

Page 2: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Short Course Topics

Topics addressed in this short course include:•Traditional DSMC•Sophisticated DSMC•Accuracy & Efficiency•Fluctuations•DSMC/PDE hybrids•Dense gas variants•Transient flows•Chemistry

Important topics we won’t havetime to discuss include:•Complex geometries•Axially symmetric flows•Collision models•Internal degrees of freedom•Special applications (e.g., granular gases, plasmas)•Theoretical foundations•Alternative algorithms

But all the topics above will be touched on during the DSMC09 workshop this week.

Page 3: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Direct Simulation Monte Carlo

• DSMC developed by Graeme Bird (late 60’s)• Popular in aerospace engineering (70’s)• Variants & improvements (early 80’s)• Applications in physics & chemistry (late 80’s)• Used for micro/nano-scale flows (early 90’s)• Extended to dense gases & liquids (late 90’s)• Used for granular gas simulations (early 00’s)

Realm of DSMC applications continues to expand (e.g., planetary science, Brownian mechanics)

Development of DSMC

Page 4: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Physical Scales for Dilute Gases

Mean Free P

ath

Collision

Collision

MolecularDiameter

System Size

Gradient Scale

Quantum scale Kinetic scale Hydrodynamic scale

T/T

DSMC is the dominant numerical algorithm at the kinetic scale

DSMC applications are expanding to multi-scale problems

Page 5: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Particle vs. Continuum

KnudsenNumber =

Mean Free Path

System Length

Equilibrium fluctuations are noticeable when the number of particles < 106 .

When is the continuum description of a gas not

accurate? We are

here

Rarefied/ Aerospace

Microscale Flows

– inter-atomic spacingd – atomic diameter

When Kn > 0.1, continuum description is not accurate Fluctuations

From G.A. Bird

Page 6: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Molecular Dynamics for Dilute Gases

Molecular dynamics inefficient for simulating the kinetic scale.

Relevant time scale is mean free time but MD computational time step limited by time of collision.

DSMC time step is large because collisions are evaluated stochastically.

Mean Free P

athCollision

Page 7: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

DSMC Algorithm

• Initialize system with particles

• Loop over time steps

– Create particles at open boundaries

– Move all the particles

– Process any interactions of particle & boundaries

– Sort particles into cells

– Sample statistical values

– Select and execute random collisions

Example: Flow past a sphere

G.A. Bird, Molecular Gas Dynamics and Direct Simulation of Gas Flows, Clarendon, Oxford (1994) F. Alexander and A. Garcia, Computers in Physics, 11 588 (1997)

Page 8: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Random NumbersNeed a high-quality random number generator for the uniform (0,1) distribution, such as Mersenne Twister.

Many distributions (e.g., Gaussian, exponential) may be generated by the inversion method:

Generate random value x with distribution P(x) as x = f (R) where R is uniformly distributed in (0,1).

Most other distributions are generated by the accept-reject method:

Draw xtry uniformly in the range of x;Accept it if P(xtry) > max{P(x)}R else draw again.

Be careful to use high-quality algorithms and be sure that you verify your implementation with independent testing.

Page 9: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

InitializationDivide the system into cells and generate particles in each cell according to desired density, fluid velocity, and temperature.

From density, determine number of particles in cell volume, N, either rounding to nearest integer or from Poisson distribution.

Assign each particle a position in the cell, either uniformly or from the linear distribution using the density gradient.

From fluid velocity and temperature, assign each particle a velocity from Maxwell-Boltzmann distribution P(v; {u,T}) or from the Chapman-Enskog distribution .

Be careful initializing particles for initial value problems.

}),,,{;( TTP uuv

Page 10: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Ballistic Motion

Particles motion is ballistic; during a time step, particle positions are updated as,

r(t +t) = r(t) + v(t)

The particles move without interaction and can even overlap.

For transient flows, on the first time step use ½ (Strang splitting) to maintain accuracy. If measuring non-conserved variables (e.g., fluxes) then time-center the sampling (half move, sample, half move, collisions) for all steps.

Page 11: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Simple Boundaries

With periodic boundaries particles are re-introduced on the opposite side of the system.

Specular surfaces modeled by ballistic (mirror) reflection of point particles.

Remove

Inject

Be careful with corners.

Be careful with body forces.

Page 12: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Thermal WallsA more realistic treatment of a material surface is a thermal wall, which resets the velocity of a particle as a biased-Maxwellian distribution,

x

y

z

uw

These distributions (exponential and Gaussian) are simple to generate by inversion.

Walls can also be part-thermal, part-specular (accommodation).

Page 13: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Reservoir BoundaryInflow/outflow boundary conditions commonly treated as a reservoir with given density, fluid velocity, temperature.

Particles in the main system are removed if they cross the boundary into the reservoir.

Particles injected from reservoir to main system by either:• Surface generator: From number flux determines number to be injected; generate particle velocities from surface distribution (e.g., inflow Maxwellian).• Volume generator: Initialize a “ghost cell” with particles before the ballistic move; discard any that do not cross the boundary into the main system during the move phase.

Page 14: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Traditional DSMC Collisions

• Sort particles into spatial collision cells

• Loop over collision cells– Compute collision

frequency in a cell

– Select random collision partners within cell

– Process each collision

Collision pair with large relative velocity are more likelyto collide but they do not have to be on a collision trajectory.

Selectedcollisionpartners

Page 15: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

where the functional form of the collision rate, R, depends on the intermolecular model.

For hard spheres of diameter d, the collision rate is,

where is the average relative velocity.

Collision Rate

Number of collisions that should occur during time step is

,...,,, rcoll vdVNRM

rv

V

vdNNvdVNR r

r 2

)1(,,,

2

Early DSMC implementations used N Nav instead of N(N 1), where Nav is an estimated average value of N.

Page 16: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Collision SelectionsTo avoid having to compute the average relative velocity for all particle pairs in a cell, a larger number of attempted collisions are selected and some are rejected.

Number of collisions attempted during a time step is,

max,,, vdVNRM cand

where vmax ≥ max{vr} is estimated maximum relative velocity.An attempted collision is accepted with probability,

max,,,

,,,),(

vdVNR

vdVNRP

jir

ji

vvvv

Early DSMC implementations rounded Mcand down and carried fraction to next time step. Modern approach is to randomly round to nearest integer (or use Poisson dist.).

Page 17: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Post-Collision Velocities

Post-collision velocities

(6 variables) given by:• Conservation of

momentum (3 constraints)• Conservation of energy

(1 constraint)• Random collision solid

angle (2 choices)

v1

v2 v2’

v1’

Vcm

vr

vr’

Direction of vr’ is uniformly distributed in the unit sphere

Selection of the post-collision velocities must satisfy detailed balance.

Page 18: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Random Solid Angle

y

x

zPost-collision relative velocity is,

The azimuthal angle is just,

Polar angle distribution is,

But with change of variable,

So,

Generated by inversion method

Page 19: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Molecules & “Simulators”

Physical Molecules DSMC Simulators

In DSMC the number of simulation particles (“simulators”) is typically a small fraction of the number physical molecules.Each simulator represents Nef physical molecules.

Nef = 2

Accuracy of DSMC goes as 1/N; for traditional DSMC about 20 particles per collision cell is the rule-of-thumb.

Page 20: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

DSMC “Parliament”

DSMC dynamics is correct if:

• The DSMC simulators are an unbiased sample of the physical population (unbiased parliament).• Collision rate is increased by Nef so the number of collisions per unit time for a simulator is same as for a physical molecule.• In sampling, each simulator counts as Nef physical molecules.

Early DSMC implementations used a different representation, rescaling the simulator diameter and mass to maintain the same physical mean free path and mass density.

Page 21: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Ballistic & Collisional Transport

By their ballistic motion particles carry mass, momentum and energy.In a dilute gas, this is the only source of transport.

In DSMC, momentum and energy are also transported by the collisions. The larger the collision cell, the more collisional transport (greater average separation between particle pairs).

v v

Page 22: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Cell Size and Time StepCan calculate collisional transport by Green-Kubo theory; error is quadratic in cell size and time step.

Collisional transport is incorrect so to minimize it the cell size in DSMC is limited to a fraction of a mean free path.

For similar reasons, the time step is limited to a fraction of a mean collision time.

Due to symmetry, the collisional transport does not affect the pressure. However, if we restrict collisions to only particles moving towards each other then this symmetry is broken and DSMC has a non-ideal gas equation of state.

Page 23: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Advanced Topics in DSMCAlejandro L. Garcia

Department of PhysicsSan Jose State University

Direct Simulation Monte Carlo: Theory, Methods, and ApplicationsSanta Fe, New Mexico; September 13-16, 2009

DSMC: Fundamentals through Advanced ConceptsShort Course

Page 24: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Fluctuations in DSMC

• Hydrodynamic fluctuations (density, temperature, etc.) have nothing to do with Monte Carlo aspect of DSMC.

• Variance of fluctuations in DSMC is exact at equilibrium (due to uniform distribution for position and Maxwell-Boltzmann for velocity).

• Time-correlations correct (at hydrodynamic scale)• Non-equilibrium fluctuations correct (at

hydrodynamic scale)

Page 25: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Sampling and FluctuationsMeasurements in DSMC are done by statistical sampling.

For volume measurements the particles are sorted into sampling cells and polled.

For surface measurements, particles crossing a surface during a time interval are counted.

vi

Many sample measurements are required due to fluctuations.

Page 26: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Error Bars

Error bars may be estimated by equilibrium variances since non-equilibrium corrections are small.

In general, the standard deviation for sampled valued goes as 1/N where N is the number of simulators.

If each simulator represents one molecule then the fluctuations are the same as in the physical system.

If Nef >> 1 then the fluctuations are much greater than in the physical system, with correspondingly larger error bars.

Page 27: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Statistical Error (Fluid Velocity)Fractional error in fluid velocity

Ma

11/2

SNu

Su

uE

x

x

x

uu

where S is number of samples, Ma is Mach number.

For desired accuracy of Eu = 1% with N = 100 simulators/cell

S 102 samples for Ma =1.0 (Aerospace flow) S 108 samples for Ma = 0.001 (Microscale flow)

222 Ma

1

Ma

1

uENS

N. Hadjiconstantinou, A. Garcia, M. Bazant, and G. He, J. Comp. Phys. 187 274-297 (2003).

Page 28: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Statistical Error (Other Variables)

Fractional error in density, temperature, pressure

SNE

1

For given ET , number of samples S 1/Ma4

Fractional error in temperature difference

where Brinkman number; Br 1, if T due to viscous heating

SNE T

1

Ma

Br2

SN

CET

SN

CEP

)1(, OCC

Page 29: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Statistical Error (Fluxes)Fractional error in stress and heat flux

SNE

1

MaKn

1

Comparing state versus flux variables

SNEq

1

MaKn

Br2

KnuE

E Kn

Tq

EE

Typically Kn < 0.1 so error bars for fluxes significantly greater; measurements such as drag force are difficult for low Mach number flows.

Page 30: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Variance Reduction in DSMCVariance reduction in DSMC has been difficult to achieve, in part because DSMC is already an importance sampling algorithm for the Boltzmann equation.

Attempts to mollify the fluctuations in DSMC, while preserving accuracy at kinetic scales, have been mostly unsuccessful.

A promising approach is Hadjiconstantinou’s low-variance algorithm, which is loosely based on DSMC.

Page 31: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Fluctuations and Statistical Bias

Suppose we dynamically vary the cell sizes so that each cell has the same number of particles.

This is helpful in that DSMC is not accurate when N is too small.

Yet there could be unintended consequences when we replace fluctuations in N with fluctuations in V.

Given the presence of fluctuations in DSMC, we need to be careful to avoid all sources of statistical bias.

Page 32: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

DSMC Collision RateThe average number of collisions in a cell is

V

vN

V

vNN

v

v

V

vNN

PMM

rr

MAXr

rMAXr

ACCEPTTRY

22

)1(

2

)1(

2?

In general so equality does not hold.

Want thisUse this

2)1( NNN

For PoissonVV /1/1

Page 33: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Unbiased Measurements

How should one estimate hydrodynamic quantities, such as fluid velocity, from particle velocities?

Page 34: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Instantaneous Fluid VelocityCenter-of-mass velocity in a cell C

mN

mv

M

Ju

N

Cii

Average particle velocity

Note that vu

N

Ciiv

Nv

1vi

Page 35: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Estimating Mean Fluid Velocity

Mean of instantaneous fluid velocity

S

j

tN

Ciji

j

S

jj

j

tvtNS

tuS

u1

)(

1

)()(

11)(

1

where S is number of samples

S

j j

S

j

tN

Ci ji

tN

tvu

j

)(

)()(

*

Alternative estimate is cumulative average

Are these equivalent? If not, which is correct?

Page 36: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Mechanical & Hydrodynamic Variables

Mechanical variables:

Mass, M ; Momentum, J ; Kinetic Energy, E

Hydrodynamic variables:

Fluid velocity, u ; Temperature, T ; Pressure, P

Relations: u(M,J) = J / M

T(M,J,E), P(M,J,E) more complicated

Page 37: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Instantaneous vs. Cumulative

From the definitions above,

M

Ju

M

Ju

*

MeanInstantaneousVelocity

MeanCumulativeVelocity

At equilibrium these are equivalent but not out of equilibriumdue to correlation of fluctuations in density and momentum.

The mean value of instantaneous velocity has a statistical bias (proportional to 1/N). This leads to anomalous results, such as a non-zero fluid velocity normal to a solid wall with a temperature gradient.

0u

0*u

Page 38: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Non-intensive Temperature

Mean instantaneous temperature has similar bias (1/N), so < T > is not an intensive quantity.Temperature of cell A = temperature of cell B yetnot equal to temperature of super-cell (A U B)

A

B

Page 39: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Brownian Systems

“Adiabatic” PistonProblem

Chambers have gases at different temperatures, equal pressures.Walls are perfectly elastic yet gases come to common temperature.

ColdHot

Piston

Heat is conducted between the chambers by the non-equilibrium Brownian motion of the piston.

Pressure Pressure

How?

Fluctuations in DSMC are not always a nuisance; there are interesting phenomena that rely on fluctuations.

Page 40: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

0 1 2 3 4 5 6 7 8 9 10

x 105

0.25

0.3

0.35

0.4

0.45

0.5

0.55

time

(x-p

isto

n)/

L

Adiabatic Piston by DSMC

0 1 2 3 4 5 6 7 8 9 10

x 105

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

time

en

erg

y p

er

pa

rtic

le

LeftRight 0.5

timetime

TL(t)

TR(t)

Temperatures

Piston Position

Single run 20 run ensemble

Initial State: X = L/4, M = 64 mNL = NR = 320, TR = 3 TL

Page 41: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Feynman’s Ratchet & Pawl

HOT

COLDCarnot* engine driven by fluctuations

* almost

Brownian motors and nanoscale machines

Page 42: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Violate 2nd Law of Thermo?

WARMWARM

NO. Fluctuations also lift the pawl, dropping the weight back down.

pawl

Page 43: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Triangula Brownian Motor

Hot gas Cold gas

P. Meurs, C. Van den Broeck, and A. Garcia, Physical Review E 70 051109 (2004).

Feynman’s complicated mechanical geometry not needed.

An asymmetrically shaped Brownian object in a non-equilibrium system (e.g., dual-temperature distribution) is enough.

Page 44: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

DSMC / PDE Hybrids

• Fast (few variables, simple relations)

• Accurate (high order methods)

• Approximate (incompressible, inviscid)

• More Physics (molecular details)

• Boundary conditions• Stable (H-theorem)

Each approach has its own relative advantages

Algorithm Refinement mantra is “best of both worlds”

PDE Solvers DSMC

Page 45: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Adaptive Mesh & Algorithm Refinement

AMAR is a multi-algorithm method based on Adaptive Mesh Refinement.

DSMC used at the finest level of refinement; all other levels use continuum equations of hydrodynamics (e.g., Navier-Stokes).

Interaction between continuum/DSMC is the exactly the same as between mesh refinement levels.

Mass, momentum, and energy are exactly conserved.

A. Garcia, J. Bell, Wm. Y. Crutchfield and B. Alder, J. Comp. Phys. 154 134-55 (1999).S. Wijesinghe, R. Hornung, A. Garcia, and N. Hadjiconstantinou, J. Fluids Eng. 126 768- 77 (2004).

Page 46: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Continuum to DSMC interface is modeled using a reservoir boundary set with continuum values.

Coupling continuum DSMC

Tp,,

Reservoir particles generated from the Chapman-Enskog distribution, which includes velocity and temperature gradient, to avoid creating a “slip” layer at the interface.

Page 47: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

• “State-based” coupling: Continuum grid is extended into the DSMC region

• “Flux-based” coupling: Continuum fluxes are determined from particles crossing the interface

Coupling DSMC continuum

Tp,, Tp,,

Page 48: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Procedure

Beginning of a time step Continuum grid data and DSMC particles are currently synchronized at time t. Momentum and energy densities given by hydrodynamic values , v and T.

Page 49: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Procedure

Advance continuum grid Evaluate the fluxes between grid points to compute new values of *, v*, and T* at time t+*.

Store both new and old grid point values.

Page 50: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Procedure

Create buffer particles Generate particles in the zone surrounding the DSMC region with time-interpolated values of density, velocity, temperature, and their gradients from continuum grid.

Note: Buffer can be replaced with direct injection, which is more efficient.

Page 51: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Procedure

Move DSMC particles Particles enter and leave the system; discard all finishing outside.

Record fluxesMass, momentum and energy fluxes due to particles crossing the interface are recorded.

Finish DSMC step Perform particle collisions and any other DSMC dynamics.

Page 52: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Synchronization

Reset overlaying grid Compute total mass, momentum, and energy for particles in continuum grid cells. Set hydrodynamic variables in these cells by these values.

Page 53: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

AMAR Synchronization

Refluxing

Reset the mass, momentum, & energy density in grid points bordering DSMC by the difference between the continuum fluxes and the DSMC particle fluxes. Preserves exact conservation.

Page 54: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Summary of AMARStart Advance Grid Fill Buffers

Move particles Overlay to Grid Reflux

Page 55: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Interface PositioningDSMC/PDE hybrids are accurate if the interface between the algorithms is located where the continuum PDE

description is still accurate.

Various “breakdown” parameters used to estimate the breakdown of the continuum approximation:

Local gradient Knudsen number

Non-dimensional Stress & Heat Flux

Kn

iij q~,~max

Page 56: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Stochastic Navier-Stokes PDEsLandau introduced fluctuations into the Navier-Stokes equations by adding white noise fluxes of stress and heat.

Hyperbolic Fluxes Parabolic Fluxes Stochastic Fluxes

Page 57: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Comparison with DSMC

Spatial correlation of density

Time correlation of density

DSMC used in testing the numerical schemes for stochastic Navier-Stokes

Page 58: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Brownian Motion

Hybrid using deterministic PDE does not produce correct Brownian motion; correct using stochastic PDE.

A. Donev, J. B. Bell, A. L. Garcia, and B. J. Alder, in preparation.

Vel

ocit

y A

utoc

orre

lati

on F

unct

ion

DeterministicPDE Hybrid

Stochastic& Particle

Page 59: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

DSMC Variants for Dense Gases

DSMC variants have been developed for dense gasesof hard spheres, * Consistent Boltzmann Algorithm (CBA) * Enskog-DSMC

and for general potentials, * Consistent Universal Boltzmann Algorithm (CUBA)

Basic idea is to modify the collision process so that the collisional transport produces the desired non-ideal equation of state.

Page 60: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Consistent Boltzmann Algorithm (CBA)

F. Alexander, A. Garcia and B. Alder, Physical Review Letters 74 5212 (1995)

In CBA, a particle’s position as well as its velocity changes upon collision.

The displacement of position has magnitude equal to the diameter.

Direction is along the apse line (line between their centers) for a hard sphere collision with the same change in the relative velocity.

Very easy to implement in DSMC (really!).

Before

After

Before After

Page 61: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Stochastic Hard-Sphere Dynamics

DDS

vi

vj

vijvn

A. Donev, B.J. Alder, and A. Garcia, Physical Review Letters 101, 075902 (2008).

Page 62: Traditional DSMC Alejandro L. Garcia Department of Physics San Jose State University Direct Simulation Monte Carlo: Theory, Methods, and Applications Santa

Properties of SHSD

Unlike other dense gas variants, hydrodynamic fluctuations in SHSD are consistent with the equation of state (e.g., variance of density is consistent with the compressibility).

Pair

Cor

rela

tion

Fun

ctio

n, g

2(x)SHSD scheme has an

equation of state anda pair correlation function identical to that of a dense gas of penetrable spheresinteracting with linear core pair potentials.