55
Lattice Boltzmann Methods David Chas Bolton Brandon Schwartz Srisharan Shreedharan

Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Lattice Boltzmann Methods DavidChasBoltonBrandonSchwartz

SrisharanShreedharan

Page 2: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Introduction

Page 3: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Introduction

Page 4: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

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

Introduction

Page 5: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Introduction

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

Page 6: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Introduction

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

Page 7: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Introduction

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

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

Page 8: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Historical perspective

Page 9: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

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

Page 10: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

MaxwellDistributionFunction•  Measurestheprobability

thatacertainpercentageofapopulationofmoleculeswillbetravelingatacertainspeed

•  Heaviermoleculestravelslower(onaverage)

•  Theareaundereachdistributionis1

Page 11: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

BoltzmannTransportEquation/BGKCollisionOperator

•  Ifnocollisions

•  Sameequation,withcollisions

•  Ifnoexternalforce

•  BGKCollisionOperator

•  LBMEquation:

Page 12: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

DiscretizedLBMEquation

•  Turns1storderPDEintoalgebraicexpression

•  AddresseschallengespreviousCFM’sdidnot

•  Verystraightforwardtouse

Page 13: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

General principles & equations

Page 14: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

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

Page 15: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

•  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

Page 16: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Boundary Conditions

Bounce-Back:•  Modelssolidstationaryormoving

boundaryconditions.•  Whenaparticleencountersthe

boundaryitwillsimplybounceback.•  Boundarycanbeplacedbetweenthe

nodesorgoingthroughthecenterofthenodes.

•  Unknowndistributionsaftercollisionaref2,f5andf6.

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

Igor2013

Page 17: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Curved Boundary Conditions

Meietal.2000

Representthecurvedsurfacethroughasetofstairsteps.Requirestheboundarytoplacedbetweenthenodes.

Page 18: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

From Lattice Gas Automata to LBM

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

Page 19: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Example of LGA

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

Page 20: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

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

Page 21: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Collison vs no Collison •  Ifnocollisionsbetweenparticlestakeplace,thenthedistributionofparticlesshouldbethesamebeforeandafterforcewasappliedi.e

•  • Withcollisionstherewillbeadifferencebetweeninitialdistributionandfinaldistribution:

•  Dividethroughbydxdedt

• Where𝜴(f)isthecollisionoperator

Page 22: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Lattice Boltzmann Equation final form • Rateofchangeofourdistributionfunctionisequaltothecollisionoperator

•  Expandedform:

• Dividethroughbydt:

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

Page 23: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Collision Operator continued

•  Ifparticlesinoursystemcollide,thenitmusttakesometimefortheparticlestoreachanequilibriumstate.

•  Thetimetakentoreachtheequilibriumstateisafunctionofthetypeofcollisionandarelaxationtime

•  DuetothecomplexityoftheCollisionOperatortheBoltzmannequationcanbedifficulttosolve.

•  WecansolveforthecollisionoperatorbasedonBhatnagar,GrossandKrooksolution

Page 24: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

More on the collision operator

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

Page 25: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Equilibrium Distribution Function, fkEQ

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

•  k=numberofvelocities,𝛚k=weightingfactors

Page 26: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Going from continuous form to discretized

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

Page 27: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

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

Page 28: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Connecting microscopic quantities to macroscopic

quantities

•  Basicidea:Torelatemicroscopicphenomenatomacroscopicbehavior•  Wecanrepresentthedensityofafluidviathefollowingeq:

•  Canrepresentthefluidvelocityviathefollowingeq:

•  KineticEnergy:

Page 29: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Hand calculation

Page 30: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

HandCalculation•  ImaginealongtubeofgaswithaninitialtemperatureofT=0.

•  Attimesgreaterthan0,theleftboundaryofthetubehasatemperatureT=1.

•  Modelthechangeingastemperaturethroughoutthetubeastimeincreases–  Assumethetubeisnon-conductivesuchthatallheattransferoccursthroughthegas

Page 31: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

ProblemDescription•  Canbemodeledat1-Dproblem:

•  Wewillmodelwith3elements:

Page 32: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Workflow1.  Initializemacroscopicpropertiesand

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

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

elements2and3toci’s.

2.  Calculateequilibriumdistributionfunctions

Page 33: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 34: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

3.  CalculateCollisions:

1.  UsingtheBGKApproximationfortheCollisionOperator

4.  CalculateStreaming:

AfterInitialization…

Page 35: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 36: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 37: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 38: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

UpdateMacroscopicProperties

Page 39: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

UpdateMacroscopicProperties

Page 40: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Sameproblemfor100units

Page 41: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

FormofthesolutionwithincreasingT

Page 42: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Summary

Collision•  fi*

Stream•  fiatnewlocation

Movetonexttimestep•  t+dt

UpdateT,fieq

Initialize• T,fi,fieq

Page 43: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Numerical example using OpenLB

Page 44: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Example problem – 2D flow around cylinder

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

Page 45: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

0=Donothing1=Fluid2=noslip/bouncebackboundary

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

Page 46: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 47: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Re=20 (laminar flow)

t = 0 s t = 10 s

t = 5 s t = 15 s

Page 48: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Re=100 (turbulence with Karman vortex street)

t = 0 s t = 10 s

t = 5 s t = 15 s

Page 49: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution
Page 50: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Example applications

Page 51: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Rayleigh-Benard flow

Page 52: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Flow of particulates through nasal cavity

Page 53: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Flow through lungs - parallel processing

Page 54: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Turbulent flow in volcanoes

Page 55: Lattice Boltzmann Methods - Pennsylvania State University1. Initialize macroscopic properties and distribution functions 1. T w=1, all others 0. 2. Make an educated guess for distribution

Our favorite – flow in porous media