Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the...

10
Monte Carlo Simulation of Low Mach Number Oscillatory Couette Flow and Applications Nicholas Liu Supervised by Professor John Sader and Dr Daniel Ladiges The University of Melbourne Vacation Research Scholarships are funded jointly by the Department of Education and Training and the Australian Mathematical Sciences Institute.

Transcript of Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the...

Page 1: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

Monte Carlo Simulation of Low Mach Number Oscillatory Couette Flow and Applications

Nicholas Liu

Supervised by Professor John Sader and Dr Daniel Ladiges

The University of Melbourne

Vacation Research Scholarships are funded jointly by the Department of Education and Training and the Australian Mathematical Sciences Institute.

Page 2: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

Abstract

Modelling of low Mach number oscillatory fluid flow around nanoscale devices is most accuratelyperformed using the Boltzmann equation due to the breakdown of the continuum assumption.Following the example of Ladiges and Sader (2015)[1], a deviational frequency-domain Monte Carlomethod using the Bhatnagar-Gross-Krook collision operator was reproduced to simulate the velocityprofile of oscillatory Couette flow, with an aim to simulate oscillatory motion normal to the planes.

Introduction

Nanoscale devices have become more and more sought after as technology advances, such as atomic-scale mass measurement[2] and atomic-scale imaging[3]. Then, the ability to be able to model fluidflows around these devices becomes particularly important to accurately and quantitatively describethe function of these devices.

Given an oscillating cantilever in some fluid, three parameters naturally arise which determinethe most suitable solution method:

1. the Knudsen number Kn, defined to be the ratio of the mean free path λ to the characteristiclength scale L of the system; and

2. the parameter θ, defined to be the ratio of the oscillation frequency ω to the particle meancollision frequency ν; and

3. the Mach number M, defined to be the ratio of the flow speed to the speed of sound in thefluid;

The Navier-Stokes equation, whose numerical solution is generally easily found by standard tech-niques, is valid in the limit where the first two parameters approach zero. However, if either ofthese parameters are not small, the Boltzmann equation has to be used instead.

1. Boltzmann equation

∂f

∂t+ v · ∇f = Q[f ] (1)

Unlike the Navier-Stokes equation, which is an equation in the fluid bulk velocity, the Boltzmannequation is an equation in the the number density distribution function f , given particle velocityv. Q is the collision operator that determines how collisions affect particles. It is evidently astatistical approach to modelling fluid behaviour, necessary if the particles cannot be modelled asa continuum.

The Boltzmann equation describes the evolution of f as a function of position and velocity.Therefore, its high dimensionality complicates solution using standard discretisation techniques. Inaddition, as boundary conditions may depend on the particle’s direction of travel, discontinuitiesin boundary conditions present further challenges. Monte Carlo simulations, which simulate theparticle behaviour, circumvent such difficulties entirely[1].

2

Page 3: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

2. Monte Carlo simulations

Real particles can be directly simulated by simulator particles, a method first suggested by Bird[4],in which rules derived from the Boltzmann equation determine how these particles are affected ateach step. Being a Monte Carlo method, the associated statistical noise becomes unacceptablylarge at the Mach numbers characteristic of nanoscale devices, rendering this method impracticalin simulating fluid flow.

Instead, as the perturbations from equilibrium are quite small at these Mach numbers, simu-lating the perturbation is preferable. Following Ladiges and Sader (2015)[1], the number densityperturbation was simulated directly using the velocities of simulator particles and compared usingtheoretical calculations[5].

Macroscopic properties can be calculated as statistical averages, interpreting the number densityas an unnormalised probability density function.

n =

∫R3

f(v) d3v (2)

u = 〈v〉 =1

n

∫R3

vf(v) d3v (3)

3. Statement of the problem

The simulation technique was tested with oscillatory Couette flow. Two parallel infinite plates areplaced at y = 0 and y = L, where the top plate oscillates sinusoidally at a fixed velocity amplitudeU and frequency ω relative to the bottom plate, held at rest.

While Navier-Stokes boundary conditions tend to be no-slip in the velocity, Boltzmann equationboundary conditions relate to the number density. In general, these boundary conditions can bediffuse, specular or a combination of both.

Diffuse boundary conditions model the outgoing particle, at boundaries, to be independent ofthe incoming particle and to be in thermal equilibrium with the boundary, which means

fb(x,v, t) =nb(x, t)

[2πRTb(x, t)]3/2exp

(−|c− ub(x, t)|2

2RTb(x, t)

)(4)

where all subscripted quantities refer to boundary values of the number density n, bulk velocityu and temperature T . Specular boundary conditions, on the other hand, change the sign of theparticle velocity.

fb(x,v, t) = f−(x,v − 2[(v − ub) · n]n, t) (5)

It is possible[6] to combine these boundary conditions to form a Maxwell boundary condition,although in practice the diffuse boundary condition generally suffices[7].

In this report, the Bhatnagar-Gross-Krook (BGK) collision operator[8] is used, which is of theform

Q[f ] = ν(feq − f) (6)

where feq is the number density distribution at local equilibrium.

feq =neq

[2πRTeq]3/2exp

(−|c− u|2

2RTeq

)(7)

The physical interpretation is that collisions act to restore the system back to local equilibrium ata rate given by the collision frequency.

3

Page 4: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

3.1 Linearisation and separation of variables

As deviations from equilibrium only are considered, the equation is rewritten in terms of the per-turbed number density distribution g, defined as

g = f − feq (8)

where f is the global equilibrium distribution at rest:

feq =n0

[2πRTeq]3/2exp

(− c2

2RTeq

)(9)

Then, the Boltzmann equation becomes

∂g

∂t+ v · ∇g = Q[g] (10)

whereQ[g] = ν(geq − g) = ν(feq − feq − g) (11)

geq can be interpreted as the difference between the local and the global equilibrium number den-sities. Using a linear approximation of the exponential, it can be shown that, to first order,

geq = feq

(v · uRT

)(12)

given that the temperature and density do not change, due to the lack of compression. Giventhe sinusoidal nature of both boundary conditions, with one of them amplitude zero, assume anexponential dependence on the number density distribution. All quantities with tildes are henceknown to have the time dependence factored out.

g(x,v, t) = g(x,v)e−iωt (13)

Moments of g are now time-separated perturbations from equilibrium. For instance, as theequilibrium velocity is zero, the bulk velocity is the same in magnitude as the velocity perturbation.The above transformations yield

v · ∇g = Q[g] + iωg (14)

whereQ[g] = ν(geq − g) (15)

3.2 Simulation method

If a virtual time variable τ is added to the left hand side of the equation, moving the advectiveterm to the right hand side yields

∂g

∂τ= −v · ∇g + Q[g] + iωg (16)

Operator splitting of the right hand side results in three equations, each describing the effect ofoscillation, advection and collision:

∂g

∂τ

∣∣∣∣osc

= iωg (17)

4

Page 5: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

∂g

∂τ

∣∣∣∣adv

= −v · ∇g (18)

∂g

∂τ

∣∣∣∣coll

= ν(geq − g) (19)

The effect each operator has on the simulation is determined then by solving each of these equations.The number density perturbation g is represented by simulator particles with positions, velocities

and weights. Weights have real and imaginary components that can take values of 0 or ±1; nonzeroweights describe an addition or removal of a fixed number Np particles as the perturbation fromequilibrium, depending on their sign. Particles are divided into cells of equal size based on theirposition, and cells are assigned bulk velocities calculated by Monte Carlo integration,

u =Npn0Vc

Nc∑i

Wici (20)

where Vc is the cell volume. Then, this calculated bulk velocity is used back in equation 12 tocalculate geq, using the time-independent u instead of u. Thus, the three operators can affect theweights or the positions of the particles as follows.

3.3 Oscillation operator

The solution to equation 17 is straightforward.

g(τ + ∆τ) = eiω∆τ g(τ) (21)

As the simulator particle weights represent the number density distribution perturbation fromequilibrium, this corresponds to multiplying all the weights by eiω∆τ , preserving the magnitude ofthe weight.

3.4 Advection operator

The solution to this equation is the travelling solution

x(τ + ∆τ) = x(τ) + v∆τ (22)

If particles hit either boundary, they are removed. This is because the diffuse boundary conditionrequires that the emitted particles be independent from the incoming particles. At the lowerboundary, to be re-emitted in equilibrium with a plate at rest, particles must be emitted fromthe global equilibrium distribution, which corresponds to zero perturbation, so no particles aregenerated here. In contrast, particles are generated at the moving plate as this is the primarysource of the perturbation and hence the motion. The generation distribution is then

ggenb (τ,v) = Ab∆τfeq(v)v · n(c · ubRT

)(23)

where Ab is the boundary area, n is the surface normal directed inwards and ub is the boundaryvelocity. The logic is that the number density distribution needs to be multiplied by a volumesuch that integration over velocity space produces a number of particles to generate. The extraterms compared to equation 12 are then responsible for this volume. After generation, particles arefurther advected for a random fraction of the time step ∆τ , the idea being that the time of collisionwith the boundary is random.

This operator is chiefly responsible for particles transferring between cells.

5

Page 6: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

3.5 Collision operator

Treating geq as independent to g, solving equation 19 by integrating factor results in the solution

g(u, τ + ∆τ) = e−ν∆τ g(u, τ) + (1− e−ν∆τ ) geq(u, τ) (24)

It is noteworthy that the first term represents a probability of e−ν∆τ of no change. Therefore, aproportion 1− e−ν∆τ of particles is deleted and replaced by particles from the distribution

ggen(τ,v) = Vc(1− e−ν∆τ )geq(τ,v) (25)

Again, a volume term is necessary to calculate the number of particles to generate. Particles arethen randomly placed within the cell after collision. The above three operators are constantlyrepeated until the desired convergence criterion is met.

3.6 Particle generation

For particles to accurately represent the number density perturbation distribution, they have torepresent an addition or removal of particles at each velocity relative to equilibrium. As equation 13allows perturbations and other related quantities to be complex, simulating complex distributions isa matter of simulating the real and imaginary components separately, storing the simulation resultsfrom the real component in the real weights and analogously for the complex component.

One method of generating particles is by the accept-reject method. Here, generating one-dimensional distributions will be described for clarity, but the same method applies in three dimen-sions. Suppose a velocity distribution f(x) is to be sampled using a known distribution g(x), suchthat there exists a positive constant M satisfying

|g(x)| ≥M |f(x)| ∀x (26)

Then, a sample X is generated from g. To generate a sample from f , note that the graph of M f(x)is under the graph of g(x), so a fraction of the sample X should be accepted. This is quantitativelyperformed by accepting the generated X with probability

p =M f(X)

g(X)(27)

Then, the appropriate real or imaginary weight is set to 1, and X is saved as the particle velocity.The above is summarised in the following figure.

6

Page 7: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

Figure 1: Illustration of the accept/reject selection process [9]

The above holds for non-negative distributions, which include all probability distributions. Asggen is a perturbation distribution, it can be positive or negative. Therefore, if the accepted X issuch that f(X) is negative, this is represented by a negative particle weight. As a result, non-zeroparticle weights can be complex with magnitudes 1 or

√2, depending on if one or both components

are nonzero.

Results and analysis

The y velocities, which is the main quantity of interest in the macroscopic case, was calculatedby equation (20) and plotted with the theoretical data[5]. In all of these graphs, the red dots arethe simulated real parts, the blue dots are the simulated imaginary parts, the black dots are thetheoretical real parts and the grey dots are the theoretical imaginary parts.

Simulations were ran until the total particle count equilibrated. Then, a certain number ofiterations after determination of particle equilibration was averaged over to produce these plots, toreduce any statistical variation.

7

Page 8: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

0.2 0.4 0.6 0.8 1.0Scaled position

-0.1

0.1

0.2

0.3

0.4

0.5

Scaled velocity amplitudeKn = 0.1, Theta = 10

0.2 0.4 0.6 0.8 1.0Scaled position

0.1

0.2

0.3

0.4

0.5

Scaled velocity amplitudeKn = 1, Theta = 1

8

Page 9: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

0.2 0.4 0.6 0.8 1.0Scaled position

0.0

0.1

0.2

0.3

0.4

0.5

Scaled velocity amplitudeKn = 10, Theta = 1

0.2 0.4 0.6 0.8 1.0Scaled position

-0.1

0.1

0.2

0.3

0.4

0.5

Scaled velocity amplitudeKn = 10, Theta = 100

Figure 2: Comparison of simulated data with theoretical data

9

Page 10: Monte Carlo Simulation of Low Mach Number Oscillatory ... · these parameters are not small, the Boltzmann equation has to be used instead. 1. Boltzmann equation @f @t + v rf= Q[f]

There is obviously agreement between theory and simulation for various cases, which stronglysupports the validity of the algorithm over a wide range of parameter values.

Conclusion

Solving the Boltzmann equation in the case of oscillatory Couette by simulating the individual hasbeen shown to be equivalent to numerical solution of the same equation. Moving forward, thismodel can then be extended to solve a variety of other problems in the future that may be relevantto nanotechnology.

References

[1] D. R. Ladiges and J. E. Sader, ”Frequency-domain deviational Monte Carlo method for linearoscillatory gas flows”, Physics of Fluids. 27, 102002 (2015)

[2] K. Jensen, Kwanpyo Kim, A. Zettl, ”An atomic-resolution nanomechanical sensor”, Nat. Nan-otech. 3, 533-537 (2008)

[3] G. Binnig, C. F. Quate, and C. Gerber, Atomic force microscope, Phys. Rev. Lett. 56(9),930-933 (1986)

[4] G. A. Bird, Molecular Gas Dynamics and the Direct Simulation of Gas Flows, Oxford Engi-neering Science Series (Clarendon Press, 1994)

[5] Y. W. Yap and J. E. Sader, High accuracy numerical solutions of the Boltzmann Bhatnagar-Gross-Krook equation for steady and oscillatory Couette flows, Phys. Fluids 24, 032004 (2012).

[6] J. C. Maxwell, ”On stresses in rareed gases arising from inequalities of temperature”, Philo-sophical Transactions of the Royal Society of London, pages 231256, 1879

[7] G. A. Bird. ”Molecular Gas Dynamics and the Direct Simulation of Gas Flows”, Oxford En-gineering Science Series, 1994.

[8] P.L. Bhatnagar, E.P. Gross, M. Krook, ”A model for collision processes in gases” Phys. Rev., 94, 511 (1954)

[9] Murray, I. (2009) ”Markov Chain Monte Carlo”,

http://videolectures.net/site/normal dl/tag=50736/mlss09ukmurray mcmc.pdf, 2009

10