Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and...

Post on 01-Jun-2020

1 views 0 download

Transcript of Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and...

Lattice Boltzmann Methods DavidChasBoltonBrandonSchwartz

SrisharanShreedharan

Introduction

Introduction

• Fictitiousassemblageofmolecules• Usesparticleprobabilitydistributionfunctioninsteadofsimulatingeverymolecule’spositionandvelocity• Particlescanonlymovefromnodetonodewithinalatticeorbetweenlattices,basedonprescribedboundaryconditions.• Incompressibleflowisassumedandparticles‘stream’&‘collide’

Introduction

Introduction

LBM&FEM:• Lattice<-->Mesh• Boltzmannequation<-->Navier-Stokesequation• Weightingparameter<-->InterpolationfunctionLBM&DEM• Mesoscopicparametersareusedtoestimatemacroscaleproperties(density,velocity,internalenergy)

Introduction

LBMvsconventionalCFD:- Uses1storderadvectionPDEinsteadof2ndorderconvectionPDE- DiscretizationisimplicitinBoltzmannequation- Solvedasa’stream’stepand‘collision’stepoveralllatticesandsimplekineticboundariesapplied

Introduction

LBMadvantages:• Supportsmassiveparallelcomputingsincelocallattice-levelstepscanbesolvedindependentlyandsimultaneously• Noneedof‘interface’elementsformulti-component/multi-phasefluidflows• Multi-scalestudiesoverwiderangeofparticlesizespossible

LBMdrawbacks:• Needsmorememory/storagethanNavier-Stokessolvers• CannotstablyhandlecompressibleflowsorMachnumbershigherthan0.3• RequiresexternalpackagesforTHMcoupling

Historical perspective

HistoricalPerspective•  LBMformulatedin1988byMcNamaraandZanetti

–  1859:Maxwell’sdistributionfunction–  1868:Boltzmanntransportequation–  1954:Bhatnagar,Gross,andKrook(BGK)collisionoperator–  1956:FEMbyTurner–  1973,76:Hardy,Pomeau,anddePazzis(HPP)model/LatticeGasAutomata(LGA)

–  1980:Finitevolumemethod(FVM)atImperialCollege

MaxwellDistributionFunction•  Measurestheprobability

thatacertainpercentageofapopulationofmoleculeswillbetravelingatacertainspeed

•  Heaviermoleculestravelslower(onaverage)

•  Theareaundereachdistributionis1

BoltzmannTransportEquation/BGKCollisionOperator

•  Ifnocollisions

•  Sameequation,withcollisions

•  Ifnoexternalforce

•  BGKCollisionOperator

•  LBMEquation:

DiscretizedLBMEquation

•  Turns1storderPDEintoalgebraicexpression

•  AddresseschallengespreviousCFM’sdidnot

•  Verystraightforwardtouse

General principles & equations

Lattice Arrangements

•  DescriptionofthelatticeanddegreeofproblemisrepresentedviaDnQm

•  m=speed,#ofthelinkagesofanode,numberofvelocitydirections

•  N=dimensionoftheproblem

•  Particlesarerestrictedtomovevialinkagesandareallowedtointeractatnodes

•  Particlesmovealongthelinkagesatthelatticespeed;normallyassumethatinagiventimesteptheparticlesmovefromonecellnodetothenext.

Exampleofa1dproblemSource:A.AMohamad

Exampleofa2dproblemSource:http://www.cims.nyu.edu/~billbao/report930.pdf

D2Q9

•  D1Q3isdescribedwiththreevelocitiesc0,c1,c2andf0,f1f2.c0=0forcenterparticle

•  Totalnumberofparticlesnotallowedtoexceed3

•  Particle'sarefreetomovetotheleftorright

•  Eachparticleisassignedaparticularweight,whichisafunctionofhowclosethatparticleistothecentralnodeandthevelocities.

•  ForD1Q3theweightingfactors,𝛚I,are4/6,1/6,1/6forf0,f1,f2

•  Speedofsound,Cs,is1/(3^.5)

•  Thesumofallweightsmustequal1.

Lattice Arrangements

Boundary Conditions

Bounce-Back:•  Modelssolidstationaryormoving

boundaryconditions.•  Whenaparticleencountersthe

boundaryitwillsimplybounceback.•  Boundarycanbeplacedbetweenthe

nodesorgoingthroughthecenterofthenodes.

•  Unknowndistributionsaftercollisionaref2,f5andf6.

•  Focusingonbottomlayerweseethatf2=f4,f6=f8,f5=f7.

Igor2013

Curved Boundary Conditions

Meietal.2000

Representthecurvedsurfacethroughasetofstairsteps.Requirestheboundarytoplacedbetweenthenodes.

From Lattice Gas Automata to LBM

•  ForLGAparticlesrestrictedtomovewithinalattice• Werepresenttheparticlesinspaceandtimevia• X=position,t=timeandi=directionoftheparticlevelocity• Ni=1=>particleispresentatsitexandtimetviceversaifNi=0• Candescribehowtheparticlesevolveinspaceandtimevia:•  •  ei=localparticlevelocities,𝜴i=collisionoperatori=collisionoperator• Collisionsarelocal

Example of LGA

Attimet-1particleisoccupiedatsite1and4Attimet,particlescollideAttimet+1,particlesmoveoffindirectionsofe2ande5.(governedbyscatteringrules)

Derivation of Lattice Boltzmann Equation from LGA

• RatherthandescribingparticlesviaBooleanalgebrawecanrepresentthemthroughadistributionfunction•  Fk=average(nk)• Distributionfunction,f(x,e,t);wherex=position,e=velocity,t=time•  Ifweapplysomeforce,f,ontheparticlestheirpositionsandvelocitieswillchangefromxx+edt;ee+F/Mdt

Collison vs no Collison •  Ifnocollisionsbetweenparticlestakeplace,thenthedistributionofparticlesshouldbethesamebeforeandafterforcewasappliedi.e

•  • Withcollisionstherewillbeadifferencebetweeninitialdistributionandfinaldistribution:

•  Dividethroughbydxdedt

• Where𝜴(f)isthecollisionoperator

Lattice Boltzmann Equation final form • Rateofchangeofourdistributionfunctionisequaltothecollisionoperator

•  Expandedform:

• Dividethroughbydt:

• Note,e=dx/dt;de/dt=F/m•  IfweassumeF=0,i.enoexternalforcesthen:

Collision Operator continued

•  Ifparticlesinoursystemcollide,thenitmusttakesometimefortheparticlestoreachanequilibriumstate.

•  Thetimetakentoreachtheequilibriumstateisafunctionofthetypeofcollisionandarelaxationtime

•  DuetothecomplexityoftheCollisionOperatortheBoltzmannequationcanbedifficulttosolve.

•  WecansolveforthecollisionoperatorbasedonBhatnagar,GrossandKrooksolution

More on the collision operator

Thecollisionoperator𝜴(f)isreplacedwiththeBGKoperator:𝜏=istherelaxationratetowardsequilibriumandisrelatedtoviscosityby:shouldbeintherangeof.5-2fkEQ=equilibriumdistributionfunctionfkEQisanexpansionoftheMaxwellDistributionFunctionassumingalowMachnumber:M=u/cs<<1Whereu=macroscopicvelocityofthefluid,cs=speedofsound,𝛒=macroscopicfluidvelocity

Equilibrium Distribution Function, fkEQ

• Note,TaylorsExpansionfore^-x=1-x+x2/2-x3/3!• UsingTaylorsExpansionwecanrewritetheequilibriumdistributionfunctionasfollows:

•  k=numberofvelocities,𝛚k=weightingfactors

Going from continuous form to discretized

Recall,thatthecollisionoperator,𝜴(f),istherateofchangeofparticledistributionfunction.Expandingtheparticledistributionfunctionoutintoitscounterparts,weobtaintheequationtotheright:Again,dividingthroughbydt,andassumingnoexternalforcesyieldsthefollowing:

Continuous to discrete •  Recall,thatthecollisionoperatorissimply:𝜴(f)=-1/𝜏(f-feq)

•  -1/𝜏(f-feq)=∂f/∂t+∂f/∂x*c

•  Nowmultiplythroughbydt

•  -dt/𝜏(f-feq)=(∂f/∂t+∂f/∂x*c)dt (1)

•  Note,Taylorseriesexpansion:f(x+∆x,t+∆t)=f(x,t)+∆f+c*(∆f/∆x)∆t

•  SubstitutethesecondtermintheTaylorSerieswithEq1

•  f(x+∆x,t+∆t)=f(x,t)-∆t/𝜏(f-feq)=DiscretizedversionofLBM

Connecting microscopic quantities to macroscopic

quantities

•  Basicidea:Torelatemicroscopicphenomenatomacroscopicbehavior•  Wecanrepresentthedensityofafluidviathefollowingeq:

•  Canrepresentthefluidvelocityviathefollowingeq:

•  KineticEnergy:

Hand calculation

HandCalculation•  ImaginealongtubeofgaswithaninitialtemperatureofT=0.

•  Attimesgreaterthan0,theleftboundaryofthetubehasatemperatureT=1.

•  Modelthechangeingastemperaturethroughoutthetubeastimeincreases–  Assumethetubeisnon-conductivesuchthatallheattransferoccursthroughthegas

ProblemDescription•  Canbemodeledat1-Dproblem:

•  Wewillmodelwith3elements:

Workflow1.  Initializemacroscopicpropertiesand

distributionfunctions1.  Tw=1,allothers0.2.  Makeaneducatedguessfordistributionfunction(for

diffusionequation,itdoesn’treallymatter)1.  Forinitialfi’s,setfi’sinelement1towi’sandfi’sin

elements2and3toci’s.

2.  Calculateequilibriumdistributionfunctions

3.  CalculateCollisions:

1.  UsingtheBGKApproximationfortheCollisionOperator

4.  CalculateStreaming:

AfterInitialization…

UpdateMacroscopicProperties

UpdateMacroscopicProperties

Sameproblemfor100units

FormofthesolutionwithincreasingT

Summary

Collision•  fi*

Stream•  fiatnewlocation

Movetonexttimestep•  t+dt

UpdateT,fieq

Initialize• T,fi,fieq

Numerical example using OpenLB

Example problem – 2D flow around cylinder

• Steadyflowaroundacylinderinachannel• Poiseuilleflowprofileatinlet• Dirichletboundaryofp=0atoutlet• Elasticbounce-backalongwalls• Reynoldsnumber=20and100forlaminarandturbulentflowsrespectively• D2Q9system

0=Donothing1=Fluid2=noslip/bouncebackboundary

3=velocityboundary4=constant(zeroinourcase)boundary5=curvedboundary(cylinder)

Re=20 (laminar flow)

t = 0 s t = 10 s

t = 5 s t = 15 s

Re=100 (turbulence with Karman vortex street)

t = 0 s t = 10 s

t = 5 s t = 15 s

Example applications

Rayleigh-Benard flow

Flow of particulates through nasal cavity

Flow through lungs - parallel processing

Turbulent flow in volcanoes

Our favorite – flow in porous media