Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Introduction
• Lattice Gas Automata was described in 1986 by Frisch,Hasslacher and Pomeau.
• In 1988 McNamara & Zanetti introduced Lattice BoltzmannMethod as an improved method compared to LGA.
• LBM treats fluid as particles that stream along given directions(lattice links) and collide at lattice sites
• It’s strongly based on kinetic theory - discrete approach - wesolve discrete kind of the Boltzmann Transport Equation (BTE).
2 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM in few steps
• Select velocity model(D1Q3,D1Q5,D2Q5,D2Q9,D3Q15,D3Q19,D3Q27), fi,ti,cs
• Divide domain into lattice sites (mark solid and fluid sites,compute links intersections for curved boundary, setup inlet,outlet, symmetry, periodic sites)
• Compute relaxation parameter/parameters• Solve discrete Boltzmann transport equation
1. Apply BC2. Compute moments - macro variables3. Compute equilibrium distribution functions (collision)4. Send fi along its characteristic velocity vector (stream)
Do all of this using CUDA in multiGPU environment to obtainextremely powerfull CFD solver!
3 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Boltzmann Transport Equation
Equation for the evolution of number of molecules.∂f
∂t+∂f
∂r· c +
F
m· ∂f∂c
= Ω
BTE describes statistics of the system by distribution functions(DF) f(r, c, t) i.e. number of molecules at time t which haveposition and velocity between r + dr and c + dc. Equation for theevolution of number of molecules.
∂f
∂t+∂f
∂r· c +
F
m· ∂f∂c
= Ω
4 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Moments of distribution function
Relation between BTE and macroscopic quantities are obtainedfrom appropriate moments:
ρ(r, t) = m
∫f(r, c, t)dc
ρ(r, t)u(r, t) = m
∫cf(r, c, t)dc
ρε(r, t) =1
2m
∫|ξ|2f(r, c, t)dc, ε =
DkBT
2m
Pij = m
∫ξiξjf(r, c, t)dξ (stress tensor)
Qijk = m
∫ξiξjξkf(r, c, t)dξ (heat flux tensor)
ξ = ci − u(r, t) (peculiar velocity)5 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Collisional integral & BGK approximation
Collision integral for 2-body collision is of the form:
Ω =
∫(f1′2′ − f12)gσ(g, ω)dωdp2
σ - differential cross section (expressing molecules with relativespeed g = gω around the solid angle ω), Boltzmann’s closureassumption (molecular chaos , Stosszahlansatz)
f12 = f1f2
Generally, Ω is uncloseable (BBGKY hierarchy), in 1954Bhatnagar, Groos and Krook (BGK) introduced simplified collisionoperator:
Ω = ω(f eq − f) =1
τ(f eq − f)
ω collision frequency, τ relaxation factor, f eq the local equilibriumdistribution function6 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Collisional integral properties
Collisional integral Ω has exactly five collisional invariants ψk(c)∫Ωψk(c)dc = 0
The elementary collision invariants read
ψ0 = 1, (ψ1, ψ2, ψ3) = c, ψ4 = c2
general invariants φk(c) can be written as linear combination of ψk
φ(c) = A+ B · c + Cc2
There exist positive functions f of form exp(φ) that give vanishingcollisional integral
Ω(f, f) = 0
Maxwell distribution function is special case of them7 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Discrete Boltzmann Equation
Introducing BGK approximation and neglecting external forces wehave
∂f
∂t+ c · ∇f =
1
τ(f eq − f)
Now we discretize velocities along finite set of specific directions ci
∂fi∂t
+ ci · ∇fi =1
τ(f eqi − fi)
linear PDEs of advection type with source term
next we discretize time and spatial derivatives
8 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
BTE discretization in 1D
fi(x, t+ δt)− fi(x, t)δt
+ cifi(x+ δx, t+ δt)− fi(x, t+ δt)
δx=
= −1
τ(fi(x, t)− f eqi (x, t))
note that δx = ciδt, then
fi(x+ ciδt, t+ δt) = fi(x, t) +δt
τ[f eqi (x, t)− fi(x, t)]
for simplicity we can assume that
δt = δx = 1
9 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Equilibrium distribution function
Take the normalized Maxwell’s DF in form
f =3ρ
2πe−
32c2e
3(c·u−u2
2
)/2
and expand second exponential around stationary state
f =3ρ
2πe−
32c2[1 + 3(c · u)− 3
2u2 + · · ·
]General form of discrete equilibrium DF is
f eqi = Φti[A+Bci · u + C(ci · u)2 +Du2
]For conserved quantities we have:
Φ =
n∑i=0
f eqi =
n∑i=0
fi, Φui =
n∑i=0
f eqi ci =
n∑i=0
fici
10 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Chapman-Enskog Expansion in 1D – gateway tomacro scale
Relation between relaxation time τ and macroscopic transportproperty of simulated matter can be obtained by performingChapman-Enskog expansion (small perturbance analysis).First we expand fi in terms of small ε
fi(x, t) = f0i + εf1i + ε2f2i + · · · ,where f0i = f eqi
Updated DF is expanded using Taylor series
fi(x+ ciδt, t+ δt) = fi(x, t) +∂fi∂tδt+
∂fi∂x
ciδt+
+1
2δt2(∂2fi∂t2
+ 2∂2fi∂t∂x
ci +∂2fi∂x2
cici
)+ O(δt)3
Then appropriate scaling is introduced to establish relationshipbetween meso and macro scale parameters.
11 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM D1Q3 Model
1D model with 3 discrete velocities
C E Wci 0 1 -1ti 4/6 1/6 1/6
lattice speed of sound cs = 1√2
(needed for equilibrium DF)
12 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM D2Q9 Model
2D model with 9 discrete velocities
C E N W S NE NW SW SEci (0,0)(1,0)(0,1)(-1,0)(0,-1)(1,1)(-1,1)(-1,-1)(1,-1)ti 4/9 1/9 1/9 1/9 1/9 1/36 1/36 1/36 1/36
lattice speed of sound cs = 1√3
13 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
3D model with 6 discrete velocities (heat& mass transfer)
cs =1√2
tc =1
4t =
1
8
14 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM D3Q19 Model
3D model with 19 discrete velocities
weights 1/3, 1/18, 1/36, lattice speed of sound cs = 1√3
15 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM D3Q27 Model
weights 8/27, 2/27, 1/54, 1/216, lattice speed of sound cs = 1√3
16 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Computing Algorithm
Algorithm for LBM-BGK model• Initialize fi in lattice sites with f eqi (ρini,uini)• Setup τ according to problem solved• Repeat until steady state or desired time is achieved
1. Compute macroscopic quantities from fi2. Compute equilibrium DF and collide3. Stream fi along lattice links4. Apply BC
17 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Boundary conditions
Imposing BC in LBM is nontrivial except periodic & symmetry BC,in other cases bounce-back is usually usedPossible method for straight boundary velocity/pressureinlet/outlet are
• Inamuro BC• Zhou-He BC• Regularized BC• D’Orazzio
BC for temperature• Yu
BC for curved geometries• and several others18 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
LBM models
Presented LBM model is called Single Relaxation Time (SRT) dueto one parameter of relaxation τ . This can (and will for high Re)cause numerical instabilities. To overcome this other approacheswere presented• Multiple Relaxation Time (MRT/TRT) model of d’Humieres et al.• Entropic LBM (ELBM) by Karlin et al.• Hybrid methods like LBM-FD, LBM-FEM and LBM-FVM• Other LBMs with improved Galilean
invariance(CascadedLBM,FCM-LBM), KBC, Cumulant Method
19 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Heat Diffusion in 2D (D2Q9)
Non-dimensionalized heat diffusion equation reads
∂φ
∂t= α
(∂2φ
∂x2+∂2φ
∂y2
)with α = λ/ρC. From Chapman-Enskog expansion we have
αlb =δx
3δt
(τ
δt− 1
2
), f eqi = tiφ(x, t)
20 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Advection-Diffusion in 2D (D2Q9)
Non-dimensionalized advection-diffusion equation reads
∂φ
∂t+ u
∂φ
∂x+ v
∂φ
∂y= α
(∂2φ
∂x2+∂2φ
∂y2
)with α = ρC/λ. From Chapman-Enskog expansion we have
αlb =δx
3δt
(τ
δt− 1
2
), f eqi = tiφ(x, t)
(1 +
ci · uc2s
)
21 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Navier-Stokes in 2D (D2Q9)
Non-dimensionalized NS equations read
∂u
∂x+∂v
∂y= 0
∂u
∂t+∂u2
∂x+∂uv
∂y= −∂p
∂x+
1
Re
[∂
∂x
(∂u
∂x
)+
∂
∂y
(∂u
∂y
)]∂v
∂t+∂vu
∂x+∂v2
∂y= −∂p
∂y+
1
Re
[∂
∂x
(∂v
∂x
)+
∂
∂y
(∂v
∂y
)]with Re = l20/(t0ν). From Chapman-Enskog expansion we have
νlb =δx2
3δt
(τ
δt− 1
2
), f eqi = tiφ(x, t)
(1 +
ci · uc2s
+(ci · u)2
2c4s− u2
2c2s
)22 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Navier-Stokes in 3D
Macroscopic equations for 3D Navier-Stokes for naturalconvection flows:
∇ · u = 0
∂u
∂t+ (u · ∇) u = −∇p+ ν∆u− gβ(T − T0)
∂T
∂t+∇ · (uT ) = α∆T
Extra term is Boussinesq forcing term:
FB = −gβ(T − T0)
23 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
A note on units
LBM solves DBTE in terms of lattice units, but the real problem isin physical units, we have to compute the LBM parameters basedon physical units, solve the DBTE and then recompute the unitsback. The procedure is as follows:• Compute Reynolds number of the physical flow, setup the
lattice viscosityu0,pl0,pνp
=u0,lbNlb
νlb
• Solve DBTE, calculate lattice macroscopic variables, andrecalculate units
up =ulbu0,pu0,lb
, tp = tlbu0,lbl0,pNlbu0,p
The only constraint here is ulb < cs = 1√3(D2Q9)
24 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Multiple Relaxation Time LBM
Stability of SRT can be improved by performing collision inmoment space,
fi(x+ ciδt, t+ δt)− fi(x, t) = −M−1S[m(x, t)−mreq(x, t)]
m = (m0,m1, . . . ,mn)T are vectors of moments, S is diagonalmatrix of relaxation times for each moment and mapping betweendistribution and moment spaces is given by
m = Mf , f = M−1m
for D2Q9 model the vector of moments reads
m = (ρ, e, ε, jx, qx, jy, qy, pxx, pxy)T
and the equilibrium moment vector reads
meq = (ρ,−2ρ+3(j2x+j2y), ρ−3(j2x+j2y), jx,−jx, jy,−jy, (j2x−j2y), jxjy)T
25 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
MRT Matrix
26 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
MRT Projection
Set all moments except density,momentum and momentum flux toequilibrium (Ladd 94’)Compute postcollisional momentum flux
Π∗ = Π− 1
τ
(Π−Π(0)
)and reconstruct postcollisional DF (no matrix operations in orderto transform DF to momentum space and then back!)
f∗i = ti
[ρ
(5
2− 3
2‖ci‖2 + 3u · ci
)+
9
2Π∗ : cc− 3
2TrΠ∗
]+ δtFB,i
27 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
MRT Algorithm - Flow field part
• Compute Πneq = Π−Πeq
• Compute τt = .5(√
τ2 + 18C2∆2x|S| − τ
), where τ = 3νlb + 0.5
• Compute Π∗ = Π + ωΠneq, ω = 1τ+τt
• Updatef∗i = ti
[ρ(52 −
32‖ci‖
2 + 3u · ci)
+ 92Π∗ : cc− 3
2TrΠ∗]
+ FB,i
Sij =3τ
2ρΠneqij Πeq
ij =ρ
3δij+ρuiuj |S| =
(S2ii + 2(S2xy + S2xz + S2yz)
) 12
Πxx =∑i
fic2i,x Πyy =
∑i
fic2i,y Πzz =
∑i
fic2i,z
Πxy =∑i
fici,xci,y Πxz =∑i
fici,xci,z Πyz =∑i
fici,yci,z
ρ =∑i
fi ρu =∑i
fici+FB
2FB,i = c2sti
(1− 1
2τf
)(ci − u)·(FB)
28 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cascaded and Factorized Central Moment LBMs
Recent models of LBM uses collisional terms with improvedGalilean invariancy - Cascaded Lattice Boltzmann Models, theypossess enhanced stability and very small numerical diffusion.Based on CLBM Factorized Central Moment LBM was presentedby M. Geier in 2009, ultra stable model with small Mach numberbeing the only one limiting factor. CLBM is multiple relaxation timeLBM and use central moments
κxmyn =∑i
fi(cix − ux)m(ciy − uy)n
to compute post-collision states of fi instead of raw moments
πxmyn =∑i
ficmixc
niy
29 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cascaded LBM
Now we take orthogonal transformation matrix K
K =
1 0 0 −4 0 0 0 0 41 −1 1 2 0 1 −1 1 11 −1 0 −1 1 0 0 −2 −21 −1 −1 2 0 −1 1 1 11 0 −1 −1 −1 0 −2 0 −21 1 −1 2 0 1 1 −1 11 1 0 −1 1 0 0 2 −21 1 1 2 0 −1 −1 −1 11 0 1 −1 −1 0 2 0 −2
and assume that post-collision state f∗ is in equlibrium
feq,∗ = f + KT · knext we compute central moments of both sides of the equationabove...30 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cascaded LBM cnt’d.
So we obtain system of linear equations for k to be solved
6 2 0 0 0 06 −2 0 0 0 00 0 −4 0 0 0−6uy −2uy 8ux −4 0 0−6ux −2ux 8uy 0 −4 0
8 + 6(u2x + u2y) 2(u2y − u2x) −16uxuy 8uy 8ux 4
·
k3k4k5k6k7k8
=
=
κeqxx − κxxκeqyy − κyyκeqxy − κxyκeqxxy − κxxyκeqxyy − κxyyκeqxxyy − κxxyy
=
ρc2s − κxxρc2s − κyy0− κxy0− κxxy0− κxyy
ρc4s − κxxyy
31 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cascaded LBM cnt’d.
Solving the system for ki and relaxing them gives us post-collisionstates in momentum space, which is then transformed back byK−1, k3, k4 and k5 are given by
k3 =1
12τ3(ρ(u2x+u2y)−fE−fN−fS−fW−2(fSE+fSW+fNE+fNW−ρ/3)
k4 =1
4τ4(fN + fS − fE − fW + ρ(u2x − u2y)
k5 =1
4τ5(fNE + fSW − fNW − fSE − uxuyρ)
for isotropic viscosity we set τ4 = τ5 = τ and compute τ from
ν+ =1
cs
(τ − 1
2
)This method is stable even for τ4 = τ5 = .5 and all other τi equal to1 (zero viscosity).32 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Factorized Central Moment LBM
To improve Galilean invariancy, and thus stability and accuracy ofthe CLBM, the Factorized Central Moment LBM was proposed byGeier in 2009.For D2Q9 model, the only difference is in k8.
k8 =1
4
[κatxxyy − κxxyy − 8k3 − 6k4(u
2x + u2y)− 2k4(u
2y − u2x)+
+16k5uxuy − 8k6uy − 8k7ux]
where κatxxyy is defined as• κatxxyy = κeqxxyy = ρc4s for CLBM• κatxxyy = κ∗xxκ
∗yy for FCM
and postcollision states κ∗xx, κ∗yy are given by:
κ∗xx = 6k3 + 2k4 + κxx = 6k3 + 2k4 + πxx − ρu2xκ∗yy = 6k3 − 2k4 + κyy = 6k3 − 2k4 + πyy − ρu2y
33 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
KBC Model
It is LBM with Entropic correction inside
fi(x+ ∆x, t+ 1) = (1− β)fi(x, t) + βfmirri (x, t)
for SRT BGK:
fmirri = 2feqi − fi, ν = c2s
(1
2β− 1
2
)in KBC (Karlin, Bosch, Chikatamarla) one should use:
fmirri = ki + [2seqi − si] + [(1− γ)hi + γheqi ]
wherefi = ki + si + hi
and γ is entropic stabilizer computed by
γ =1
β−(
2− 1
β
)< ∆s|∆h >< ∆h|∆h >
, < x|y >=
b∑i=1
xiyifeqi34 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Smagorinsky-Lilly SGS LES LBM
Stability of LBM can be improved by using turbulence model i.e.alter the viscosity with the turbulent one.
ν = νlaminar + νturbulent
Large Eddy Simulation concept is very convenient for LBM. UsingSmagorinsky approach, the eddy viscosity is given by
νt = (CSM∆)2|S|, |S| =√
2Sij Sij
we need to compute S, but from C-E expansion we directly have
Π(1)ij ≈ −2τc2sρδtSij
but what the Π is?35 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Π(1) approximation
Again from C-E expansion we have
Π(1)ij =
∑α
cαicαjf(1)α ≈
∑α
cαicαj (fα − f eqα )
so we can define
Π =
√Π
(1)ij Π
(1)ij =
√2τc2sδt|S| =
√Q
and then
τ =1
2
τ0 +
√τ20 +
(CSM∆
c2sδt
)2 √8Qρ
36 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
SRT+LES - Temperature field
Simple SRT BGK• Compute T =
∑i gi
• Compute τg,t = .5(√
τ2g + 18C2∆2x|S| − τg
), where
τg = 3αlb + 0.5
• Update g∗i = gi + 1τg+τg,t
(geqi (T,u)− gi)
37 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
MRT - Temperature field
MRT D2Q5 LBM is used for temperature field (passive scalar)approximation. The second population of DF gi is introduced andMRT is applied:
gi(x+ ciδt, t+ δt)− gi(x, t) = −M−1S[m(x, t)−meq(x, t)]
where equilibrium moments and matrix S are defined as
meq = (T, uxT, uyT, aT, 0) S = diag(0,1
τα,
1
τα,
1
τe,
1
τν)
The thermal diffusivity is obtained from
α+ =4 + a
10
(τα −
1
2
)We can use a = −2/3 together with
(τν − .5)(τα − .5) = (τe − .5)(τα − .5) = 1/6
38 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM Algorithm - Temperature field part
Cascaded scheme applied to one conservation law (joint workwith Keerti Sharma).
KT =
1 1 1 1 10 −1 0 1 00 0 −1 0 14 −1 −1 −1 −10 −1 1 −1 1
.with a collision step
~gc = ~g + K · ~k(~g,~geq, ω1, . . . , ω5),
39 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM - details
Collision here is rather complicated now
k1k2k3k4k5
=
0
ω22
(κeqx − κx)
ω32
(κeqy − κy)
−ω44
(κeqxx+yy − κxx+yy + κ
eqyy−xx − κyy−xx)− uxω2
2(κeqx − κx)− uyω3
2(κeq
y − κy)ω54
(κeqxx+yy − κxx+yy − κ
eqyy−xx + κyy−xx) +
uxω22
(κeqx − κx)− uyω3
2(κeq
y − κy)
,
and gives us following solution
∂T
∂t+∂Tux∂x
+∂Tuy∂y
=a
2
(1
ω2− 1
2
)∂2T
∂x2+a
2
(1
ω3− 1
2
)∂2T
∂y2+O(∆t3).
thermal diffusivities in x and y directions are defined by
αx =a
2
(1
ω2− 1
2
)αy =
a
2
(1
ω3− 1
2
)40 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Using CUDA for GPU
• parallel computing platform and programming model created byNVIDIA
• CUDA platform is accessible through extensions to C, C++ andFortran
• domain is divided into the grid consisting of blocks of threads• pull algorithm with flattened arrays
41 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Pull vs. algorithm
Pull algorithm• Stream step (uncoalesced read)• Apply BC• Compute macroscopic variables• Collide & write post-collision state back (coalesced write)Push algorithm• Read DF (coalesced read)• Apply BC• Compute macroscopic variables• Collide & Stream(uncoalesced write)
42 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CUDA performance D2Q9 FCM-MRT
43 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Validation of the MRT-TLBM - Thermal storageexperiment
We try to simulate experiment1 of rock packed bed heating.
1Meier et al., Solar Energy Materials (24) 199944 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Comparison of results with experimental data
200
300
400
500
600
700
800
900
0 0.2 0.4 0.6 0.8 1 1.2 1.4
tem
pe
ratu
re [
K]
distance [m]
average temp 1200saverage temp 3000saverage temp 4800s
exp 1200sexp 3000sexp 4800s
45 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Shaft furnace
No we consider larger problem of approx 5m x 2.5m of packedbed of solid lumps of different diameters.
46 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Shaft furnace - Results
47 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Forced convection - cylinder with heated core
Several benchmark and other fancy heat-transfer problemsincluding forced and natural convection.
U0
D2D
10D
40D
20D
10D
48 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cooling of Cylinder with Heated Core
49 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cooling of Cylinder with Heated Core
0
0.2
0.4
0.6
0.8
1
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180
(T-T
c)/(
Th-
Tc)
φ
ks/kf=0.5 Refks/kf=0.5 CTLBM
ks/kf=1 Refks/kf=1 CTLBM
ks/kf=4 Refks/kf=4 CTLBM
ks/kf=20 Refks/kf=20 CTLBM
50 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cooling of Cylinders with Heated Core
U0 D
3D20D
4D
2D2.5D
51 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cooling of Cylinders with Heated Core Pr=1
52 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Cooling of Cylinders with Heated Core Pr=7.2
53 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Double Shear Layer Vortex Test
Ulb(x, y, 0) =
U0 tanh(80(y/(N − 1)− 0.25)) y/(N − 1) ≤ 0.5
U0 tanh(80(0.75− y/(N − 1))) y/(N − 1) > 0.5
Vlb(x, y, 0) = 0.05U0 sin(2π(x/(N − 1) + .25))
Tlb(x, y, 0) =
1 1
4 ≤ y/(N − 1) < 34
0 elsewhere
54 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Double Shear Layer Vortex Test
55 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM for natural convection flows
2D simulation of natural convection around heated cylinder indifferentially heated square cavity at Ra=2.24 · 107
(ongoing work with Keerti Sharma)
56 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Heating furnace
• We want to compute flow in an heating furnace• 3D turbulent flow - D3Q19/D3Q27 lattices are used• CO2 = 7.81% H2O=14.84% N2=73.01% O2=4.88%• vin = 1.808 m/s Tin = 1000C ν = 2.22 · 10−4m2/s
57 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Summary
• ∆t = 8.8 · 10−4 s, ∆x = 0.016 m ≈ 12M LS• 1s - 1130 iterations, 1 it takes approx. 0.01 s of GPU time
58 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Fixed bed
• Fixed bed of different icosahedral particles - generated bysettleDyn
• 3D turbulent flow - D3Q19 lattice is used• Air is flowing across the bed• vin = 0.5 m/s, ν = 1 · 10−5m2/s
59 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Fixed bed
• ∆t = 3.2 · 10−4 s, ∆x = 0.016 m ≈ 5.7M LS• 1s - 3125 iterations, 1 it lasts ≈ 0.007 s of GPU time
60 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Natural convection in a room
• Cold room (Tini = 15C) is heated by two heaters(Theater = 70C)
• Outside the building, the Winter is coming (Tout = −20C)• Heaters are situated under the window and at the opposite wall.61 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Multiphase
Future work? What about multiphase flows?
62 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Conlusions
PROS• Easy implementation of complex geometry• LBM proved its efficiency in computing various types of fluid
problems• Scheme is local in space and explicit in time i.e. good
scalability for parallel computing (GPGPU, clusters...)• There are still open problems and ongoing research of LBMCONS• Dreadful evaluation of BC’s compared to traditional CFD
methods• Regular square grid, need for multi-block lattices or
interpolation schemes for very accurate curved geometry• Numerical instabilities for high Re flows with BGK (MRT, ELBM,
Fractional step LBM, CLBM, Cumulants,...)63 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM - CLBM for 1 conservation law
Cascaded scheme applied to one conservation law.
KT =
1 1 1 1 10 −1 0 1 00 0 −1 0 14 −1 −1 −1 −10 −1 1 −1 1
.
K′ =[~M0, ~Mx, ~My, ~Mxx+yy, ~Myy−xx
],
where ~M0 = [1, 1, 1, 1, 1]T, Mx,i = ci,x, My,i = ci,y,Mxx+yy,i = c2i,x + c2i,y, Myy−xx,i = c2i,y − c2i,x, with a collision step
~gc = ~g + K · ~k(~g,~geq, ω1, . . . , ω5),
64 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Collision cascade
Now compute central moments for both sides of the previous eq.
~gc = ~g + K · ~k(~g,~geq, ω1, . . . , ω5) /∑i
(ci,x − ux)m(ci,y − uy)n
to obtain system of eq. with the shift matrix S
S
k1k2k3k4k5
=
0 0 0 0 00 2 0 0 00 0 2 0 00 −4ux 0 −2 −20 0 −4uy −2 2
k1k2k3k4k5
=
0
κeqx − κxκeqy − κyκeqxx − κxxκeqyy − κyy
(1)
65 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM Collision Scheme
We solve for ki’s and eventually obtain
k1 = 0
k2 =ω2
2(κeqx − κx)
k3 =ω3
2(κeqy − κy)
k4 = −ω4
4(κeqxx − κxx + κeqyy − κyy)−
uxω2
2(κeqx − κx)− uyω3
2(κeqy − κy)
k5 =ω5
4(κxx − κeqxx + κeqyy − κyy)−
uxω2
2(κeqx − κx) +
uyω3
2(κeqy − κy)
66 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
CTLBM in Raw Moments Representation
We can also reformulate the collision in raw moment to obtain
~mc = ~m+ M ·K · M(~meq − ~m).
with
M ·K · M =
0 0 0 0 00 ω2 0 0 00 0 ω3 0 00 (ω2 − ω4)2ux (ω3 − ω4)2uy ω4 00 (ω5 − ω2)2ux (ω3 − ω5)2uy 0 ω5
where
~m = [m0,mx,my,mxx +myy,myy −mxx]T
~meq = [T, Tux, Tuy, aT, 0]T
67 of 69
Intro LBM Fundamentals SRT-BGK MRT CLBM/FCM KBC Turbulence HM Transfer CUDA Show Conclude Hydrodynamic Limit of CTLBM
Derivation of an equivalent partial differential equation (EPDE -very useful technique! promoted by F. Dubois) yields2
m(3)0 −m
c(3)0 + ∂tm
eq(1)0 + ∂xm
eq(2)x + ∂ym
eq(2)y =(
1
ω2+
1
ω3− 1
)∂xym
eq(1)xy +
(1
ω2− 1
2
)∂xxm
eq(1)xx +
(1
ω3− 1
2
)∂yym
eq(1)yy .
For D2Q5 lattice model mxy = meqxy = 0 and m0 = meq
0 = T ,meqx = Tux, meq
y = Tuy, meqxx = meq
yy = T a2 the final PDE is
∂T
∂t+∂Tux∂x
+∂Tuy∂y
=a
2
(1
ω2− 1
2
)∂2T
∂x2+a
2
(1
ω3− 1
2
)∂2T
∂y2+O(∆t3).
i.e. the Fourier-Kirchhoff with diffusivities
αx =a
2
(1
ω2− 1
2
)αy =
a
2
(1
ω3− 1
2
)2For details check our last article in International Journal of Thermal Sciences
];)68 of 69