Algorithm Search⌘K

Algorithmadvanced

Multiple-relaxation-time lattice Boltzmann method

Also called MRT lattice Boltzmann, MRT collision operator.

Lattice Boltzmann with collision in moment space, where each moment relaxes at its own rate. It is often more stable than BGK at low viscosity, and the free rates can place bounce-back walls exactly.

Time
Θ(K M) worst
Space
Θ(M) extra
Where
K = the number of time steps; M = the number of lattice nodes
Properties
conserves mass exactlyconserves momentum exactlydeterministicexplicitlocal collision
Origin
Dominique d'Humières, Pierre Lallemand, Li Shi Luo, 1992

The multiple-relaxation-time (MRT) lattice Boltzmann method is the lattice Boltzmann method with a different collision step. The BGK collision operator relaxes all nine populations of a D2Q9 node toward equilibrium at one rate 1/τ1/\tau. MRT first maps the populations to nine moments (density, energy, momentum, heat flux, stress), relaxes each moment at its own rate, and maps back. The shear rate fixes the viscosity as in BGK, and the other rates are free. The streaming step and the bounce-back walls are the same as in BGK.

In plain words

Each lattice node carries nine numbers, one for each direction a particle can move. A collision pushes these numbers toward a target that depends only on the local density and velocity. BGK pushes all nine with the same strength. MRT first rewrites the nine numbers as nine physical quantities: mass, momentum, energy, stress and two more. It then pushes each quantity with its own strength. Mass and momentum are not changed. The stress decides the viscosity. The other quantities have no physical role in slow flow, so you can choose their strengths to damp noise or to make walls sit exactly where you want them. If every strength is the same, MRT is exactly BGK.

The problem

Solve the weakly compressible Navier-Stokes equations on a lattice, as the lattice Boltzmann method does, but with a collision that has more than one free parameter. With BGK the single time τ\tau sets the viscosity ν=(τ−12)/3\nu = (\tau - \frac12)/3 and also every other property of the scheme: its stability at small ν\nu, the decay of nonhydrodynamic modes, and the position of bounce-back walls. MRT separates these. Units are lattice units: grid spacing 1, time step 1, cs2=13c_s^2 = \frac13.

The algorithm

The populations f0,…,f8f_0, \ldots, f_8 use the velocities c0=(0,0)c_0 = (0,0), c1=(1,0)c_1 = (1,0), c2=(0,1)c_2 = (0,1), c3=(−1,0)c_3 = (-1,0), c4=(0,−1)c_4 = (0,-1), c5=(1,1)c_5 = (1,1), c6=(−1,1)c_6 = (-1,1), c7=(−1,−1)c_7 = (-1,-1), c8=(1,−1)c_8 = (1,-1), in the same order as the lattice Boltzmann page. The moments are m=Mfm = Mf with the matrix of Lallemand and Luo (2000):

moment row of MM equilibrium meqm^{\mathrm{eq}} rate
ρ\rho (density) 1,1,1,1,1,1,1,1,11, 1, 1, 1, 1, 1, 1, 1, 1 ρ\rho any
ee (energy) −4,−1,−1,−1,−1,2,2,2,2-4, -1, -1, -1, -1, 2, 2, 2, 2 −2ρ+3ρ∣u∣2-2\rho + 3\rho\lvert u\rvert^2 ses_e
ϵ\epsilon (energy squared) 4,−2,−2,−2,−2,1,1,1,14, -2, -2, -2, -2, 1, 1, 1, 1 ρ−3ρ∣u∣2\rho - 3\rho\lvert u\rvert^2 sϵs_\epsilon
jxj_x (momentum) 0,1,0,−1,0,1,−1,−1,10, 1, 0, -1, 0, 1, -1, -1, 1 ρux\rho u_x any
qxq_x (heat flux) 0,−2,0,2,0,1,−1,−1,10, -2, 0, 2, 0, 1, -1, -1, 1 −ρux-\rho u_x sqs_q
jyj_y 0,0,1,0,−1,1,1,−1,−10, 0, 1, 0, -1, 1, 1, -1, -1 ρuy\rho u_y any
qyq_y 0,0,−2,0,2,1,1,−1,−10, 0, -2, 0, 2, 1, 1, -1, -1 −ρuy-\rho u_y sqs_q
pxxp_{xx} (normal stress) 0,1,−1,1,−1,0,0,0,00, 1, -1, 1, -1, 0, 0, 0, 0 ρ(ux2−uy2)\rho(u_x^2 - u_y^2) sνs_\nu
pxyp_{xy} (shear stress) 0,0,0,0,0,1,−1,1,−10, 0, 0, 0, 0, 1, -1, 1, -1 ρuxuy\rho u_x u_y sνs_\nu

The rows are orthogonal, so M−1=MTD−1M^{-1} = M^T D^{-1} with D=diag(9,36,36,6,12,6,12,4,4)D = \mathrm{diag}(9, 36, 36, 6, 12, 6, 12, 4, 4). SS is the diagonal matrix of the rates. FF is Guo's force term Fi=wi(3(ci−u)+9(ci⋅u)ci)⋅gF_i = w_i\bigl(3(c_i - u) + 9(c_i \cdot u)c_i\bigr) \cdot g for a body force gg per unit volume.

  1. MRT-D2Q9(n_x, n_y, S, K, init, g, walls)
  2. 1for each node x: (ρ, u) ← init(x); f(x) ← f^eq(ρ, u)
  3. 2repeat K times
  4. 3for each node x: ρ ← Σ f_i, u ← (Σ c_i f_i + g/2) / ρ
  5. 4m ← M f
  6. 5m* ← m - S (m - m^eq(ρ, u)) + (I - S/2) M F(u, g)
  7. 6f* ← M^-1 m*
  8. 7for each node x and each i: f_i(x + c_i) ← f*_i(x); if x + c_i is beyond a wall, f_ī(x) ← f*_i(x)
  9. 8return ρ, u at every node

Line L3 computes the density and the velocity, with the half force shift of Guo's scheme. Line L4 maps the populations to moments; with the integer rows of MM this is a few additions and no multiplications. Line L5 is the collision: the conserved moments ρ\rho, jxj_x and jyj_y equal their equilibrium (up to the force shift), so their rates have no effect, and each other moment moves toward its equilibrium by the fraction sks_k. Line L6 maps back. Line L7 is the streaming step of the lattice Boltzmann method, periodic in xx, with halfway bounce-back walls at y=−12y = -\frac12 and y=ny−12y = n_y - \frac12 when walls are on (ıˉ\bar\imath is the index with cıˉ=−cic_{\bar\imath} = -c_i).

The rates must lie in (0,2)(0, 2). The shear rate sets the kinematic viscosity

ν=13(1sν−12),\nu = \frac13\Bigl(\frac1{s_\nu} - \frac12\Bigr),

so sνs_\nu plays the role of 1/τ1/\tau. The rate ses_e sets the bulk viscosity. The rate sqs_q of the heat flux moments has no effect on the Navier-Stokes limit, but it changes the error terms, in particular at walls.

Example

One collision by hand. Take a node at rest with fi=wif_i = w_i, and add 1100\frac1{100} to f1f_1 and to f3f_3 (two populations along ±x\pm x). The moments are ρ=5150\rho = \frac{51}{50}, e=−10150e = -\frac{101}{50}, ϵ=2425\epsilon = \frac{24}{25}, pxx=150p_{xx} = \frac1{50}, and the others are 0. The velocity is 0, so the equilibrium moments are eeq=−2ρ=−5125e^{\mathrm{eq}} = -2\rho = -\frac{51}{25}, ϵeq=ρ=5150\epsilon^{\mathrm{eq}} = \rho = \frac{51}{50} and pxxeq=0p_{xx}^{\mathrm{eq}} = 0. Choose se=sϵ=1s_e = s_\epsilon = 1, sν=54s_\nu = \frac54 (so ν=0.1\nu = 0.1) and sq=89s_q = \frac89. Line L5 gives:

moment mm meqm^{\mathrm{eq}} rate m∗m^*
ρ\rho 1.021.02 1.021.02 any 1.021.02
ee −2.02-2.02 −2.04-2.04 1 −2.04-2.04
ϵ\epsilon 0.960.96 1.021.02 1 1.021.02
pxxp_{xx} 0.020.02 0 54\frac54 −0.005-0.005
others 0 0 0

The energy moments reach their equilibrium in one step, and the stress overshoots to −0.005-0.005, as any rate above 1 does. Line L6 gives f∗=(3475,2692400,1196,2692400,1196,17600,17600,17600,17600)≈(0.45333,0.11208,0.11458,0.11208,0.11458,0.02833,…)f^* = (\frac{34}{75}, \frac{269}{2400}, \frac{11}{96}, \frac{269}{2400}, \frac{11}{96}, \frac{17}{600}, \frac{17}{600}, \frac{17}{600}, \frac{17}{600}) \approx (0.45333, 0.11208, 0.11458, 0.11208, 0.11458, 0.02833, \ldots). BGK with τ=0.8\tau = 0.8 (the same viscosity) gives (4190,4013600,41360,4013600,41360,411440,…)≈(0.45556,0.11139,0.11389,…,0.02847)(\frac{41}{90}, \frac{401}{3600}, \frac{41}{360}, \frac{401}{3600}, \frac{41}{360}, \frac{41}{1440}, \ldots) \approx (0.45556, 0.11139, 0.11389, \ldots, 0.02847): the same density and the same stress −0.005-0.005, but the energy moments also overshoot, to e∗=−2.045e^* = -2.045 and ϵ∗=1.035\epsilon^* = 1.035, because they relax at 54\frac54 instead of 1. The test file checks the MRT fractions.

Poiseuille flow. A channel of ny=8n_y = 8 nodes, one node wide and periodic in xx, with halfway bounce-back walls and a force g=10−6g = 10^{-6} along xx, run to steady state. The exact profile is u(y)=g2ν(y+12)(ny−12−y)u(y) = \frac{g}{2\nu}(y + \frac12)(n_y - \frac12 - y). With sq=sνs_q = s_\nu (all nonconserved rates equal, which is BGK) the computed profile is the parabola plus a constant slip. With sqs_q chosen so that Λ=(1sν−12)(1sq−12)=316\Lambda = (\frac1{s_\nu} - \frac12)(\frac1{s_q} - \frac12) = \frac3{16}, the slip goes away:

sνs_\nu (τ=1/sν\tau = 1/s_\nu) 53\frac53 (0.6) 54\frac54 (0.8) 1 (1.0)
slip /g/g with sq=sνs_q = s_\nu −3.55-3.55 −0.65-0.65 0.250.25
sqs_q for Λ=316\Lambda = \frac3{16} 819\frac8{19} 89\frac89 87\frac87
max error /g/g with that sqs_q 1.8⋅10−91.8 \cdot 10^{-9} 5.1⋅10−105.1 \cdot 10^{-10} 4.5⋅10−104.5 \cdot 10^{-10}

The BGK slips match the formula s=g(2(τ−12)−38(τ−12))s = g\bigl(2(\tau - \frac12) - \frac3{8(\tau - \frac12)}\bigr) of the lattice Boltzmann page. The remaining errors with Λ=316\Lambda = \frac3{16} are the convergence tolerance of the run, not a discretization error. These runs used se=sϵ=sνs_e = s_\epsilon = s_\nu. This is a measurement; the result that the wall position depends on the rates only through Λ\Lambda, and that Λ=316\Lambda = \frac3{16} puts it exactly halfway for this flow, is from the analysis of Ginzburg and d'Humières (2003) for two-rate schemes.

Taylor-Green vortex. On an N×NN \times N periodic lattice with k=2π/Nk = 2\pi/N, u0=0.16/Nu_0 = 0.16/N, sν=54s_\nu = \frac54 and N2/8N^2/8 steps, the relative max error of uu against −u0cos⁡kxsin⁡ky e−2νk2t-u_0\cos kx\sin ky\,e^{-2\nu k^2 t} was:

sqs_q N=8N = 8 N=16N = 16 N=32N = 32 observed orders
54\frac54 (BGK) 8.64e-2 2.11e-2 5.26e-3 2.03, 2.01
1.1 7.96e-2 1.95e-2 4.84e-3 2.03, 2.01
89\frac89 (Λ=316\Lambda = \frac3{16}) 6.63e-2 1.62e-2 4.02e-3 2.03, 2.01

The order is 2 for every sqs_q; the rate changes only the constant.

Correctness

Proved in the correctness file, in exact arithmetic: the rows of MM are orthogonal; MfeqMf^{\mathrm{eq}} equals the closed-form meqm^{\mathrm{eq}} of the table; the collision of lines L3 to L6 keeps the density of each node and adds exactly gg to its momentum, for any rates of the conserved moments; with every rate equal to 1/τ1/\tau the collision is BGK with Guo forcing, term by term; and streaming permutes the populations, so the total mass is constant, and on a fully periodic lattice the total momentum grows by exactly nxnygn_xn_yg per step. The tests check all of this with fractions.Fraction, and check the BGK reduction against an independent BGK collision on 500 random nodes.

The link to the Navier-Stokes equations with ν=13(1sν−12)\nu = \frac13(\frac1{s_\nu} - \frac12) is a consistency result from the Chapman-Enskog expansion (Lallemand and Luo 2000). It holds for small Mach and Knudsen numbers, and it is not proved here. The Taylor-Green table shows the second order in space that it predicts.

Proof: The MRT collision conserves mass and momentum, and equal rates give BGKfull

We use the D2Q9 velocities c0=(0,0)c_0 = (0,0), c1=(1,0)c_1 = (1,0), c2=(0,1)c_2 = (0,1), c3=(−1,0)c_3 = (-1,0), c4=(0,−1)c_4 = (0,-1), c5=(1,1)c_5 = (1,1), c6=(−1,1)c_6 = (-1,1), c7=(−1,−1)c_7 = (-1,-1), c8=(1,−1)c_8 = (1,-1) and the weights w0=49w_0 = \frac49, w1..4=19w_{1..4} = \frac19, w5..8=136w_{5..8} = \frac1{36}. The rows of MM are, in order, ρ\rho, ee, ϵ\epsilon, jxj_x, qxq_x, jyj_y, qyq_y, pxxp_{xx} and pxyp_{xy}, as in the implementation. We claim four things, all in exact arithmetic:

  1. MM is invertible and M−1=MTD−1M^{-1} = M^T D^{-1} with D=diag(9,36,36,6,12,6,12,4,4)D = \mathrm{diag}(9, 36, 36, 6, 12, 6, 12, 4, 4).
  2. Mfeq(ρ,u)=meq(ρ,u)M f^{\mathrm{eq}}(\rho, u) = m^{\mathrm{eq}}(\rho, u), the closed form used on line L5.
  3. Lines L3 to L6 keep the density of a node and add exactly gg to its momentum ∑icifi\sum_i c_i f_i, whatever the rates of the conserved moments are. If every rate equals 1/τ1/\tau, lines L3 to L6 give the same f∗f^* as BGK collision with Guo forcing.
  4. Line L7 keeps the total mass. On a lattice that is periodic in both directions, it also keeps the total momentum. So the total mass is constant over a run, and on a periodic lattice the total momentum grows by exactly nxnygn_x n_y g per step.

Claim 1. Each row of MM has integer entries, and a direct computation of the 36 products of pairs of distinct rows gives 0 (the test test_rows_of_m_are_orthogonal does all 81 products). For example, the rows e=(−4,−1,−1,−1,−1,2,2,2,2)e = (-4,-1,-1,-1,-1,2,2,2,2) and ϵ=(4,−2,−2,−2,−2,1,1,1,1)\epsilon = (4,-2,-2,-2,-2,1,1,1,1) give −16+4⋅2+4⋅2=0-16 + 4 \cdot 2 + 4 \cdot 2 = 0. The squared lengths of the rows are the entries of DD. So MMT=DM M^T = D, and M−1=MTD−1M^{-1} = M^T D^{-1}.

Claim 2. Write fieq=wiρ(1+3ci⋅u+92(ci⋅u)2−32∣u∣2)f_i^{\mathrm{eq}} = w_i \rho (1 + 3 c_i \cdot u + \frac92 (c_i \cdot u)^2 - \frac32 |u|^2). Over the four axis velocities, ∑(ci⋅u)=0\sum (c_i \cdot u) = 0 and ∑(ci⋅u)2=2∣u∣2\sum (c_i \cdot u)^2 = 2|u|^2; over the four diagonal velocities, ∑(ci⋅u)=0\sum (c_i \cdot u) = 0 and ∑(ci⋅u)2=4∣u∣2\sum (c_i \cdot u)^2 = 4|u|^2. So the rest, axis and diagonal sums are

f0eq=49ρ(1−32∣u∣2),A=∑i=14fieq=19ρ(4+3∣u∣2),B=∑i=58fieq=19ρ(1+3∣u∣2).f_0^{\mathrm{eq}} = \tfrac49 \rho (1 - \tfrac32 |u|^2), \qquad A = \sum_{i=1}^4 f_i^{\mathrm{eq}} = \tfrac19 \rho (4 + 3|u|^2), \qquad B = \sum_{i=5}^8 f_i^{\mathrm{eq}} = \tfrac19 \rho (1 + 3|u|^2).

The rows ρ\rho, ee and ϵ\epsilon take the values (1,1,1)(1,1,1), (−4,−1,2)(-4,-1,2) and (4,−2,1)(4,-2,1) on the rest, axis and diagonal groups. Hence ρ\rho-row: f0+A+B=ρf_0 + A + B = \rho; e=−4f0−A+2B=ρ(−169−49+29)+ρ∣u∣2(249−39+69)=−2ρ+3ρ∣u∣2e = -4 f_0 - A + 2B = \rho(-\frac{16}9 - \frac49 + \frac29) + \rho|u|^2 (\frac{24}9 - \frac39 + \frac69) = -2\rho + 3\rho|u|^2; ϵ=4f0−2A+B=ρ(169−89+19)−ρ∣u∣2(249+69−39)=ρ−3ρ∣u∣2\epsilon = 4 f_0 - 2A + B = \rho(\frac{16}9 - \frac89 + \frac19) - \rho|u|^2(\frac{24}9 + \frac69 - \frac39) = \rho - 3\rho|u|^2.

For the odd rows only the term 3ci⋅u3 c_i \cdot u survives, because the even terms are equal for cic_i and −ci-c_i. The axis part is f1−f3=19ρ⋅6ux=23ρuxf_1 - f_3 = \frac19 \rho \cdot 6 u_x = \frac23 \rho u_x, and the diagonal part is f5−f6−f7+f8=136ρ⋅3⋅4ux=13ρuxf_5 - f_6 - f_7 + f_8 = \frac1{36} \rho \cdot 3 \cdot 4 u_x = \frac13 \rho u_x. So jx=23ρux+13ρux=ρuxj_x = \frac23 \rho u_x + \frac13 \rho u_x = \rho u_x and qx=−2⋅23ρux+13ρux=−ρuxq_x = -2 \cdot \frac23 \rho u_x + \frac13 \rho u_x = -\rho u_x. The yy rows follow by symmetry. For the stress rows only the term 92(ci⋅u)2\frac92 (c_i \cdot u)^2 survives: pxx=f1−f2+f3−f4=19ρ⋅92(2ux2−2uy2)=ρ(ux2−uy2)p_{xx} = f_1 - f_2 + f_3 - f_4 = \frac19 \rho \cdot \frac92 (2u_x^2 - 2u_y^2) = \rho(u_x^2 - u_y^2), and pxy=f5−f6+f7−f8=136ρ⋅92(2(ux+uy)2−2(ux−uy)2)=ρuxuyp_{xy} = f_5 - f_6 + f_7 - f_8 = \frac1{36}\rho \cdot \frac92 \bigl(2(u_x+u_y)^2 - 2(u_x-u_y)^2\bigr) = \rho u_x u_y. This is the closed form meq=(ρ,−2ρ+3ρ∣u∣2,ρ−3ρ∣u∣2,ρux,−ρux,ρuy,−ρuy,ρ(ux2−uy2),ρuxuy)m^{\mathrm{eq}} = (\rho, -2\rho + 3\rho|u|^2, \rho - 3\rho|u|^2, \rho u_x, -\rho u_x, \rho u_y, -\rho u_y, \rho(u_x^2 - u_y^2), \rho u_x u_y).

Claim 3. Let Fi=wi(3(ci−u)+9(ci⋅u)ci)⋅gF_i = w_i \bigl(3(c_i - u) + 9 (c_i \cdot u) c_i\bigr) \cdot g. The lattice sums ∑wi=1\sum w_i = 1, ∑wici=0\sum w_i c_i = 0, ∑wiciαciβ=13δαβ\sum w_i c_{i\alpha} c_{i\beta} = \frac13 \delta_{\alpha\beta} and ∑wiciαciβciγ=0\sum w_i c_{i\alpha} c_{i\beta} c_{i\gamma} = 0 give ∑iFi=−3u⋅g+9⋅13u⋅g=0\sum_i F_i = -3 u \cdot g + 9 \cdot \frac13 u \cdot g = 0 and ∑iciαFi=3⋅13gα=gα\sum_i c_{i\alpha} F_i = 3 \cdot \frac13 g_\alpha = g_\alpha. So the ρ\rho, jxj_x and jyj_y entries of MFM F are 00, gxg_x and gyg_y.

Line L3 sets ρ=m0\rho = m_0 and ρu=j+12g\rho u = j + \frac12 g, where j=(m3,m5)j = (m_3, m_5). By Claim 2, m0eq=ρ=m0m_0^{\mathrm{eq}} = \rho = m_0 and (m3eq,m5eq)=ρu=j+12g(m_3^{\mathrm{eq}}, m_5^{\mathrm{eq}}) = \rho u = j + \frac12 g. With any rate ss on the jxj_x row, line L5 gives

m3∗=m3−s(m3−m3−12gx)+(1−s2)gx=m3+gx,m_3^* = m_3 - s\bigl(m_3 - m_3 - \tfrac12 g_x\bigr) + \bigl(1 - \tfrac s2\bigr) g_x = m_3 + g_x,

and in the same way m5∗=m5+gym_5^* = m_5 + g_y and m0∗=m0m_0^* = m_0 for any rate on the ρ\rho row. Line L6 inverts MM exactly by Claim 1, so ∑ifi∗=m0\sum_i f_i^* = m_0 and ∑icifi∗=j+g\sum_i c_i f_i^* = j + g.

If S=1τIS = \frac1\tau I, line L5 reads m∗=(1−1τ)Mf+1τmeq+(1−12τ)MFm^* = (1 - \frac1\tau) M f + \frac1\tau m^{\mathrm{eq}} + (1 - \frac1{2\tau}) M F. By Claim 2, meq=Mfeqm^{\mathrm{eq}} = M f^{\mathrm{eq}}, so line L6 gives f∗=M−1m∗=f−1τ(f−feq)+(1−12τ)Ff^* = M^{-1} m^* = f - \frac1\tau (f - f^{\mathrm{eq}}) + (1 - \frac1{2\tau}) F, which is BGK collision with Guo forcing, term by term.

Claim 4. Line L7 moves the value fi∗(x)f_i^*(x) into one slot of the new array: slot (x+ci,i)(x + c_i, i) if x+cix + c_i is inside the lattice (with xx taken modulo nxn_x, and yy modulo nyn_y when there are no walls), else slot (x,ıˉ)(x, \bar\imath) with cıˉ=−cic_{\bar\imath} = -c_i. We show that this map from old slots to new slots is a bijection. Take a new slot (z,k)(z, k). If z−ckz - c_k is inside, the only old slot that maps to it is (z−ck,k)(z - c_k, k), because a bounced value at zz would need z+ckˉ=z−ckz + c_{\bar k} = z - c_k to lie beyond a wall. If z−ckz - c_k lies beyond a wall, then (z−ck,k)(z - c_k, k) does not exist, and the only old slot that maps to (z,k)(z, k) is (z,kˉ)(z, \bar k), whose target z+ckˉ=z−ckz + c_{\bar k} = z - c_k is beyond the wall. So every new slot gets exactly one value, and streaming permutes the values. The total mass ∑x,ifi(x)\sum_{x,i} f_i(x) is therefore the same before and after line L7. Without walls the permutation keeps the index ii of every value, so ∑x,icifi(x)\sum_{x,i} c_i f_i(x) is also kept.

Together with Claim 3, each step keeps the total mass exactly, and on a fully periodic lattice each step adds gg at each of the nxnyn_x n_y nodes and nothing else to the total momentum. The walls take momentum out (they exert the wall shear force), so with walls only the mass is conserved.

These are exact statements about the update. The claim that the scheme approximates the Navier-Stokes equations with ν=13(1sν−12)\nu = \frac13(\frac1{s_\nu} - \frac12) is a consistency result from the Chapman-Enskog expansion (Lallemand and Luo 2000), not part of this proof. ■\blacksquare

Complexity

In the real-RAM model with MM lattice nodes (in this section MM is the node count, not the moment matrix), one step does a constant amount of work per node. Line L4 is a fixed set of about 30 additions and a few doublings, line L5 is 9 multiply-adds, plus the 9 force moments when g≠0g \ne 0, line L6 is about 30 additions and 9 divisions by constants, and line L7 moves 9 values. That is a few times the work of a BGK collision, and Θ(M)\Theta(M) per step. KK steps cost Θ(KM)\Theta(KM). The lattice stores 9 populations per node, plus a second array for streaming, so the memory is Θ(M)\Theta(M). Reaching a physical time TT with grid spacing hh in diffusive scaling takes K∝T/h2K \propto T/h^2 steps, as for BGK.

Properties

  • Exact conservation. Mass is conserved exactly by every step, and momentum changes only by the force and by the walls.
  • Contains BGK. With S=1τIS = \frac1\tau I the method is BGK, so every BGK result applies as a special case.
  • Free rates. ses_e sets the bulk viscosity, sϵs_\epsilon and sqs_q act only on nonhydrodynamic moments. Tuning them changes stability and wall errors, not the viscosity.
  • Galilean invariance and isotropy. As for D2Q9 BGK, these hold only to second order in uu; Lallemand and Luo (2000) analyse the dispersion and the isotropy of the D2Q9 MRT model.
  • Second order in space for smooth flow, as measured above.

Variants and improvements

  • Two-relaxation-time (TRT). Ginzburg's TRT scheme uses one rate for all even moments and one for all odd moments. It is the simplest form of MRT that keeps the free parameter Λ\Lambda, and Λ=316\Lambda = \frac3{16} is the choice that puts halfway bounce-back walls exactly halfway for Poiseuille flow (Ginzburg and d'Humières 2003).
  • Other bases. The basis can use raw moments, central moments (moments in the frame moving with uu) or cumulants. Central moment and cumulant schemes reduce the Galilean errors at high speed.
  • Three dimensions. d'Humières et al. (2002) give D3Q15 and D3Q19 MRT models.
  • Turbulence. An eddy viscosity from a large eddy simulation model enters by changing sνs_\nu at each node.
  • Regularized and entropic schemes are other ways to make the collision more stable at small viscosity.

When to use it

Use MRT (or TRT) instead of BGK when the viscosity is small and BGK becomes unstable, when bounce-back walls must sit at a position that does not change with the viscosity (porous media, permeability computations), or when the bulk viscosity must differ from the shear viscosity. For smooth periodic flow at moderate viscosity, BGK is simpler and gives the same accuracy. MRT does not make the lattice Boltzmann method suitable for compressible flow or high Mach numbers.

Pitfalls

  • A basis that is not the one of the equilibrium table. The closed forms of meqm^{\mathrm{eq}} hold only for the rows of MM in the table above, in the velocity order above. With another velocity numbering, permute the columns of MM too, and check Mfeq=meqMf^{\mathrm{eq}} = m^{\mathrm{eq}} before the first run.
  • Using MTM^T as the inverse. The rows are orthogonal but not normalized, so line L6 needs MTD−1M^T D^{-1}, not MTM^T.
  • The force term in population space. Adding FF after line L6 with the BGK factor (1−12τ)(1 - \frac1{2\tau}) is wrong when the rates differ; the factor (I−S2)(I - \frac{S}{2}) must act in moment space on line L5.
  • Velocity without the half shift. Line L3 must use u=(∑cifi+g/2)/ρu = (\sum c_if_i + g/2)/\rho. Without the shift the scheme is first order in the force.
  • Expecting exact walls for free. With sq=sνs_q = s_\nu the wall slip of BGK remains. The wall position is exact only for the right Λ\Lambda, and only for flows like Poiseuille flow whose profile is at most quadratic.
  • Rates outside (0,2)(0, 2). A rate of 2 or more makes the moment grow instead of decay.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

multiple_relaxation_time_lattice_boltzmann.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/multiple-relaxation-time-lattice-boltzmann/. The authors are listed in prov/JZ1BG8.jsonl.

"""The multiple-relaxation-time (MRT) lattice Boltzmann method on D2Q9.

Lattice units: grid spacing 1, time step 1, c_s^2 = 1/3. The collision
works on the nine moments m = M f of the populations (the moment basis of
Lallemand and Luo 2000). Moment k relaxes toward its equilibrium with its
own rate s_k:

    m* = m - S (m - m_eq) + (I - S/2) M F,     f* = M^-1 m*,

where F is Guo's force term. The rates of the conserved moments (density
and momentum) do not matter, because m = m_eq for them. The shear rate
s_nu gives the kinematic viscosity nu = (1/s_nu - 1/2)/3. With every rate
equal to 1/tau the scheme is exactly the BGK scheme.

The x direction is periodic. In y the lattice is periodic, or it has two
walls halfway between nodes, at y = -1/2 and y = ny - 1/2 (halfway
bounce-back). Pass Fraction rates, forces and initial data with
exact=True to run in exact rational arithmetic.
"""

from dataclasses import dataclass
from fractions import Fraction
from typing import Any, Callable, List, Optional, Sequence, Tuple

C = [(0, 0), (1, 0), (0, 1), (-1, 0), (0, -1), (1, 1), (-1, 1), (-1, -1), (1, -1)]
OPP = [0, 3, 4, 1, 2, 7, 8, 5, 6]
W_EXACT = [Fraction(4, 9)] + [Fraction(1, 9)] * 4 + [Fraction(1, 36)] * 4
W_FLOAT = [float(w) for w in W_EXACT]

# Rows: rho, e, epsilon, j_x, q_x, j_y, q_y, p_xx, p_xy (Lallemand and Luo 2000).
M = [
    [1, 1, 1, 1, 1, 1, 1, 1, 1],
    [-4, -1, -1, -1, -1, 2, 2, 2, 2],
    [4, -2, -2, -2, -2, 1, 1, 1, 1],
    [0, 1, 0, -1, 0, 1, -1, -1, 1],
    [0, -2, 0, 2, 0, 1, -1, -1, 1],
    [0, 0, 1, 0, -1, 1, 1, -1, -1],
    [0, 0, -2, 0, 2, 1, 1, -1, -1],
    [0, 1, -1, 1, -1, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 1, -1, 1, -1],
]
# The rows of M are orthogonal: M M^T = diag(NORM2), so M^-1 = M^T diag(1/NORM2).
NORM2 = [9, 36, 36, 6, 12, 6, 12, 4, 4]


@dataclass
class MRTResult:
    """Density and velocity fields indexed [y][x], and the populations f[y * nx + x][i]."""

    rho: List[List[Any]]
    ux: List[List[Any]]
    uy: List[List[Any]]
    steps: int
    f: List[List[Any]]


def nu_of_rate(s_nu: Any) -> Any:
    """Kinematic viscosity of the shear rate: nu = (1/s_nu - 1/2)/3."""
    return (1 / s_nu - Fraction(1, 2)) / 3 if isinstance(s_nu, Fraction) else (1.0 / s_nu - 0.5) / 3.0


def magic_q_rate(s_nu: Any, magic: Any = Fraction(3, 16)) -> Any:
    """The rate s_q that gives (1/s_nu - 1/2)(1/s_q - 1/2) = magic."""
    half = Fraction(1, 2) if isinstance(s_nu, Fraction) else 0.5
    return 1 / (magic / (1 / s_nu - half) + half)


def rates(s_nu: Any, s_q: Any, s_e: Any = None, s_eps: Any = None) -> List[Any]:
    """The diagonal of S in the order of the rows of M. s_e and s_eps default to s_nu."""
    s_e = s_nu if s_e is None else s_e
    s_eps = s_nu if s_eps is None else s_eps
    zero = 0 * s_nu
    return [zero, s_e, s_eps, zero, s_q, zero, s_q, s_nu, s_nu]


def equilibrium(rho: Any, ux: Any, uy: Any, exact: bool = False) -> List[Any]:
    """D2Q9 equilibrium populations, second order in u."""
    w = W_EXACT if exact else W_FLOAT
    usq = ux * ux + uy * uy
    out = []
    for i in range(9):
        cu = C[i][0] * ux + C[i][1] * uy
        out.append(w[i] * rho * (1 + 3 * cu + Fraction(9, 2) * cu * cu - Fraction(3, 2) * usq)
                   if exact else w[i] * rho * (1 + 3 * cu + 4.5 * cu * cu - 1.5 * usq))
    return out


def equilibrium_moments(rho: Any, ux: Any, uy: Any) -> List[Any]:
    """m_eq = M f_eq in closed form."""
    jx, jy = rho * ux, rho * uy
    usq = ux * ux + uy * uy
    return [rho, -2 * rho + 3 * rho * usq, rho - 3 * rho * usq, jx, -jx, jy, -jy,
            rho * (ux * ux - uy * uy), rho * ux * uy]


def guo_force(ux: Any, uy: Any, gx: Any, gy: Any, exact: bool = False) -> List[Any]:
    """Guo's force populations F_i = w_i [3 (c_i - u) + 9 (c_i . u) c_i] . g."""
    w = W_EXACT if exact else W_FLOAT
    out = []
    for i in range(9):
        cx, cy = C[i]
        cu = cx * ux + cy * uy
        out.append(w[i] * ((3 * (cx - ux) + 9 * cu * cx) * gx + (3 * (cy - uy) + 9 * cu * cy) * gy))
    return out


def to_moments(f: Sequence[Any]) -> List[Any]:
    """m = M f, written out row by row."""
    f0, f1, f2, f3, f4, f5, f6, f7, f8 = f
    axes = f1 + f2 + f3 + f4
    diag = f5 + f6 + f7 + f8
    dx = f5 - f6 - f7 + f8
    dy = f5 + f6 - f7 - f8
    return [f0 + axes + diag, -4 * f0 - axes + 2 * diag, 4 * f0 - 2 * axes + diag,
            f1 - f3 + dx, 2 * (f3 - f1) + dx, f2 - f4 + dy, 2 * (f4 - f2) + dy,
            f1 - f2 + f3 - f4, f5 - f6 + f7 - f8]


def from_moments(m: Sequence[Any]) -> List[Any]:
    """f = M^-1 m = M^T diag(1/NORM2) m, written out column by column."""
    r, e, ep, jx, qx, jy, qy, pxx, pxy = (m[k] / NORM2[k] for k in range(9))
    a = r - e - 2 * ep
    d = r + 2 * e + ep
    return [r - 4 * e + 4 * ep,
            a + jx - 2 * qx + pxx, a + jy - 2 * qy - pxx,
            a - jx + 2 * qx + pxx, a - jy + 2 * qy - pxx,
            d + jx + qx + jy + qy + pxy, d - jx - qx + jy + qy - pxy,
            d - jx - qx - jy - qy + pxy, d + jx + qx - jy - qy - pxy]


def macros(f: Sequence[Any], gx: Any, gy: Any, half: Any) -> Tuple[Any, Any, Any]:
    """Density and velocity with the half force shift: u = (sum c_i f_i + g/2)/rho."""
    rho = sum(f)
    jx = sum(C[i][0] * f[i] for i in range(9))
    jy = sum(C[i][1] * f[i] for i in range(9))
    return rho, (jx + half * gx) / rho, (jy + half * gy) / rho


def collide(f: Sequence[Any], s: Sequence[Any], gx: Any = 0, gy: Any = 0,
            exact: bool = False) -> List[Any]:
    """One MRT collision at one node: lines L3 to L6."""
    half = Fraction(1, 2) if exact else 0.5
    rho, ux, uy = macros(f, gx, gy, half)                                     # @line L3
    m = to_moments(f)                                                         # @line L4
    meq = equilibrium_moments(rho, ux, uy)
    if gx or gy:
        mf = to_moments(guo_force(ux, uy, gx, gy, exact))
    else:
        mf = [0] * 9
    ms = [m[k] - s[k] * (m[k] - meq[k]) + (1 - half * s[k]) * mf[k]          # @line L5
          for k in range(9)]
    return from_moments(ms)                                                   # @line L6


def mrt_d2q9(nx: int, ny: int, s: Sequence[Any], steps: int,
             init: Callable[[int, int], Tuple[Any, Any, Any]],
             gx: Any = 0, gy: Any = 0, walls: bool = False, exact: bool = False,
             f0: Optional[List[List[Any]]] = None) -> MRTResult:
    """Run the MRT lattice Boltzmann method on an nx by ny lattice.

    s is the diagonal of S (see rates). init(x, y) returns (rho, ux, uy);
    the populations start at equilibrium unless f0 is given. Precondition:
    0 < s_k < 2 for the nonconserved moments, nx >= 1, ny >= 2 with walls.
    Cost: Theta(steps * nx * ny) node updates, each a constant number of
    operations (two 9 by 9 products with the fixed matrix M).
    """
    half = Fraction(1, 2) if exact else 0.5
    n = nx * ny
    if f0 is not None:
        f = [list(p) for p in f0]
    else:
        f = []
        for y in range(ny):                                                   # @line L1
            for x in range(nx):
                rho, ux, uy = init(x, y)
                f.append(equilibrium(rho, ux, uy, exact))
    for _ in range(steps):                                                    # @line L2
        post = [collide(f[k], s, gx, gy, exact) for k in range(n)]
        new = [[0] * 9 for _ in range(n)]
        for y in range(ny):                                                   # @line L7
            for x in range(nx):
                p = post[x + nx * y]
                for i in range(9):
                    xt = (x + C[i][0]) % nx
                    yt = y + C[i][1]
                    if walls and (yt < 0 or yt >= ny):
                        new[x + nx * y][OPP[i]] = p[i]
                        continue
                    new[xt + nx * (yt % ny)][i] = p[i]
        f = new
    rho_g, ux_g, uy_g = [], [], []
    for y in range(ny):                                                       # @line L8
        rr, uu, vv = [], [], []
        for x in range(nx):
            r, u, v = macros(f[x + nx * y], gx, gy, half)
            rr.append(r)
            uu.append(u)
            vv.append(v)
        rho_g.append(rr)
        ux_g.append(uu)
        uy_g.append(vv)
    return MRTResult(rho_g, ux_g, uy_g, steps, f)
test_multiple_relaxation_time_lattice_boltzmann.py 192 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/multiple-relaxation-time-lattice-boltzmann/. The authors are listed in prov/JZ1BG8.jsonl.

import math
import random
from fractions import Fraction as Fr

from multiple_relaxation_time_lattice_boltzmann import (
    C, M, NORM2, W_EXACT, collide, equilibrium, equilibrium_moments, from_moments,
    guo_force, magic_q_rate, mrt_d2q9, nu_of_rate, rates, to_moments)


def rand_fr(rng, lo=-50, hi=50, den=100):
    return Fr(rng.randint(lo, hi), den)


def rand_pops(rng):
    return [w * (1 + rand_fr(rng, -20, 20)) for w in W_EXACT]


# ---------------------------------------------------------------- the moment basis


def test_rows_of_m_are_orthogonal():
    for a in range(9):
        for b in range(9):
            d = sum(M[a][i] * M[b][i] for i in range(9))
            assert d == (NORM2[a] if a == b else 0)


def test_transform_matches_matrix_and_inverts_exactly():
    rng = random.Random(1)
    for _ in range(500):
        f = [rand_fr(rng) for _ in range(9)]
        m = to_moments(f)
        assert m == [sum(M[k][i] * f[i] for i in range(9)) for k in range(9)]
        assert from_moments(m) == f


def test_equilibrium_moments_closed_form():
    rng = random.Random(2)
    for _ in range(500):
        rho = 1 + rand_fr(rng, -30, 30)
        ux, uy = rand_fr(rng, -20, 20), rand_fr(rng, -20, 20)
        assert to_moments(equilibrium(rho, ux, uy, True)) == equilibrium_moments(rho, ux, uy)


def test_hand_example_equilibrium_moments():
    # rho = 1, u = (1/10, 0): e = -2 + 3/100, epsilon = 1 - 3/100, p_xx = 1/100
    m = equilibrium_moments(Fr(1), Fr(1, 10), Fr(0))
    assert m == [1, Fr(-197, 100), Fr(97, 100), Fr(1, 10), Fr(-1, 10), 0, 0, Fr(1, 100), 0]


# ---------------------------------------------------------------- collision


def bgk_collide(f, tau, gx, gy):
    """Independent oracle: BGK with Guo forcing in population space."""
    rho = sum(f)
    ux = (sum(C[i][0] * f[i] for i in range(9)) + gx / 2) / rho
    uy = (sum(C[i][1] * f[i] for i in range(9)) + gy / 2) / rho
    feq = equilibrium(rho, ux, uy, True)
    out = []
    for i in range(9):
        cx, cy = C[i]
        cu = cx * ux + cy * uy
        force = W_EXACT[i] * ((3 * (cx - ux) + 9 * cu * cx) * gx + (3 * (cy - uy) + 9 * cu * cy) * gy)
        out.append(f[i] - (f[i] - feq[i]) / tau + (1 - 1 / (2 * tau)) * force)
    return out


def test_equal_rates_give_bgk_exactly():
    rng = random.Random(3)
    for _ in range(500):
        f = rand_pops(rng)
        tau = Fr(rng.randint(51, 300), 100)
        gx, gy = rand_fr(rng, -10, 10, 1000), rand_fr(rng, -10, 10, 1000)
        s = [1 / tau] * 9
        assert collide(f, s, gx, gy, exact=True) == bgk_collide(f, tau, gx, gy)


def test_conserved_rates_do_not_matter():
    rng = random.Random(4)
    for _ in range(200):
        f = rand_pops(rng)
        gx, gy = rand_fr(rng, -10, 10, 1000), rand_fr(rng, -10, 10, 1000)
        s = rates(Fr(rng.randint(10, 190), 100), Fr(rng.randint(10, 190), 100),
                  Fr(rng.randint(10, 190), 100), Fr(rng.randint(10, 190), 100))
        s2 = list(s)
        for k in (0, 3, 5):
            s2[k] = Fr(rng.randint(10, 190), 100)
        assert collide(f, s, gx, gy, True) == collide(f, s2, gx, gy, True)


def test_collision_moments():
    # density kept, momentum gains exactly g
    rng = random.Random(5)
    for _ in range(200):
        f = rand_pops(rng)
        gx, gy = rand_fr(rng, -10, 10, 1000), rand_fr(rng, -10, 10, 1000)
        s = rates(Fr(rng.randint(10, 190), 100), Fr(rng.randint(10, 190), 100))
        a, b = to_moments(f), to_moments(collide(f, s, gx, gy, True))
        assert b[0] == a[0] and b[3] == a[3] + gx and b[5] == a[5] + gy


def test_hand_example_collision():
    f = list(W_EXACT)
    f[1] += Fr(1, 100)
    f[3] += Fr(1, 100)
    s = rates(Fr(5, 4), Fr(8, 9), Fr(1), Fr(1))
    out = collide(f, s, exact=True)
    assert out == [Fr(34, 75), Fr(269, 2400), Fr(11, 96), Fr(269, 2400), Fr(11, 96)] + [Fr(17, 600)] * 4
    assert to_moments(out) == [Fr(51, 50), Fr(-51, 25), Fr(51, 50), 0, 0, 0, 0, Fr(-1, 200), 0]
    bgk = collide(f, [Fr(5, 4)] * 9, exact=True)
    assert bgk == [Fr(41, 90), Fr(401, 3600), Fr(41, 360), Fr(401, 3600), Fr(41, 360)] + [Fr(41, 1440)] * 4


def test_guo_force_moments():
    u, v, gx, gy = Fr(1, 10), Fr(1, 20), Fr(1, 1000), Fr(0)
    mf = to_moments(guo_force(u, v, gx, gy, True))
    assert mf == [0, Fr(3, 5000), Fr(-3, 5000), Fr(1, 1000), Fr(-1, 1000), 0, 0, Fr(1, 5000), Fr(1, 20000)]


# ---------------------------------------------------------------- whole runs


def test_exact_conservation_on_a_small_lattice():
    rng = random.Random(6)
    nx, ny = 3, 4
    f0 = [rand_pops(rng) for _ in range(nx * ny)]
    s = rates(Fr(6, 5), Fr(11, 10), Fr(13, 10), Fr(7, 5))
    gx, gy = Fr(1, 500), Fr(-1, 700)
    mass0 = sum(sum(p) for p in f0)
    jx0 = sum(sum(C[i][0] * p[i] for i in range(9)) for p in f0)
    jy0 = sum(sum(C[i][1] * p[i] for i in range(9)) for p in f0)
    for steps in (1, 2, 3):
        res = mrt_d2q9(nx, ny, s, steps, None, gx, gy, walls=False, exact=True, f0=f0)
        assert sum(sum(p) for p in res.f) == mass0
        assert sum(sum(C[i][0] * p[i] for i in range(9)) for p in res.f) == jx0 + steps * nx * ny * gx
        assert sum(sum(C[i][1] * p[i] for i in range(9)) for p in res.f) == jy0 + steps * nx * ny * gy
        walled = mrt_d2q9(nx, ny, s, steps, None, gx, 0, walls=True, exact=True, f0=f0)
        assert sum(sum(p) for p in walled.f) == mass0


def poiseuille(s_nu, s_q, ny, g=1e-6):
    nu = nu_of_rate(s_nu)
    steps = int(30 * ny * ny / (math.pi ** 2 * nu)) + 100
    res = mrt_d2q9(1, ny, rates(s_nu, s_q), steps, lambda x, y: (1.0, 0.0, 0.0), gx=g, walls=True)
    return [(res.ux[y][0] - g / (2 * nu) * (y + 0.5) * (ny - 0.5 - y)) / g for y in range(ny)]


def test_poiseuille_magic_rate_is_exact():
    for s_nu in (1.0, 1 / 0.8):
        err = poiseuille(s_nu, magic_q_rate(s_nu), 6)
        assert max(abs(e) for e in err) < 1e-7


def test_poiseuille_bgk_rates_slip():
    for tau in (1.0, 0.8):
        lam = tau - 0.5
        slip = 2 * lam - 3 / (8 * lam)
        err = poiseuille(1 / tau, 1 / tau, 6)
        assert max(abs(e - slip) for e in err) < 1e-6


def test_magic_rate_value():
    assert magic_q_rate(Fr(1)) == Fr(8, 7)
    assert (1 / Fr(5, 4) - Fr(1, 2)) * (1 / magic_q_rate(Fr(5, 4)) - Fr(1, 2)) == Fr(3, 16)


def taylor_green_error(n, s_nu, s_q):
    nu = nu_of_rate(s_nu)
    k = 2 * math.pi / n
    u0 = 0.16 / n
    steps = n * n // 8

    def init(x, y):
        rho = 1.0 - 0.75 * u0 * u0 * (math.cos(2 * k * x) + math.cos(2 * k * y))
        return rho, -u0 * math.cos(k * x) * math.sin(k * y), u0 * math.sin(k * x) * math.cos(k * y)

    res = mrt_d2q9(n, n, rates(s_nu, s_q), steps, init)
    dec = math.exp(-2 * nu * k * k * steps)
    err = max(abs(res.ux[y][x] + u0 * math.cos(k * x) * math.sin(k * y) * dec)
              for y in range(n) for x in range(n))
    return err / (u0 * dec)


def test_taylor_green_second_order():
    e8 = taylor_green_error(8, 1.25, 1.1)
    e16 = taylor_green_error(16, 1.25, 1.1)
    assert abs(e8 - 0.0796) < 5e-4
    assert abs(math.log2(e8 / e16) - 2) < 0.2

History

Lattice Boltzmann models grew from lattice gas automata in the late 1980s. In 1992 d'Humières proposed a generalized lattice Boltzmann equation whose collision is a matrix acting in a basis of moments, in the same year that the single-rate BGK form of Qian, d'Humières and Lallemand and of Chen, Chen and Matthaeus appeared. BGK became the common choice because it is simple. Lallemand and Luo (2000) gave a full linear analysis of the D2Q9 MRT model, with the basis above, and showed that the free rates improve its stability. d'Humières, Ginzburg, Krafczyk, Lallemand and Luo (2002) extended the method to three dimensions, and Ginzburg and coworkers developed the two-relaxation-time form and the analysis of the wall position.

References

  1. D. d'Humières, Generalized lattice-Boltzmann equations, in B. D. Shizgal and D. P. Weaver (eds.), Rarefied Gas Dynamics: Theory and Simulations, Progress in Astronautics and Aeronautics 159, AIAA, 1992, pp. 450-458
  2. Pierre Lallemand and Li-Shi Luo, Theory of the lattice Boltzmann method: Dispersion, dissipation, isotropy, Galilean invariance, and stability, Physical Review E 61 (2000) 6546-6562, the D2Q9 moment basis, the equilibrium moments and the linear stability analysis
  3. Dominique d'Humières, Irina Ginzburg, Manfred Krafczyk, Pierre Lallemand and Li-Shi Luo, Multiple-relaxation-time lattice Boltzmann models in three dimensions, Philosophical Transactions of the Royal Society A 360 (2002) 437-451
  4. Irina Ginzburg and Dominique d'Humières, Multireflection boundary conditions for lattice Boltzmann models, Physical Review E 68 (2003) 066614, the dependence of the bounce-back wall position on the relaxation rates
  5. Timm Krüger, Halim Kusumaatmaja, Alexandr Kuzmin, Orest Shardt, Goncalo Silva and Erlend Magnus Viggen, The Lattice Boltzmann Method: Principles and Practice, Springer, 2017, Chapter 10 (MRT and TRT collision operators)
  6. Zhaoli Guo, Chuguang Zheng and Baochang Shi, Discrete lattice effects on the forcing term in the lattice Boltzmann method, Physical Review E 65 (2002) 046308

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example