<<

Bulk and shear in lattice Boltzmann equations

Paul J. Dellar∗ Department of Applied Mathematics and Theoretical Physics, University of Cambridge, Silver Street, Cambridge CB3 9EW, UK (Dated: submitted 14 Oct 2000, revised 17 May 2001, published 27th August 2001) Lattice Boltzmann equations (LBE) are a useful tool for simulating the incompressible Navier– Stokes equations. However, LBE actually simulate a compressible but usually isothermal fluid at some small but finite Mach number. There has been recent interest in using LBE at larger, but still subsonic, Mach numbers, for which the viscous terms in the resulting equation depart appreciably from those in the compressible Navier–Stokes equations. In particular, the isothermal constraint implies a nonzero “bulk” in addition to the usual shear viscosity. This difficulty arises at the level of the isothermal continuum Boltzmann equation prior to discretization. A remedy is proposed, and tested in numerical experiments with decaying sound waves. Conversely, an enhanced bulk viscosity is found useful for identifying or suppressing artifacts in under-resolved simulations of supposedly incompressible shear flows.

PACS numbers: 05.20.Dd 51.10.+y 47.11.+j published as DOI: 10.1103/PhysRevE.64.031203

I. INTRODUCTION scheme that allows the bulk viscosity to be adjusted, and to be set equal to zero if desired. This allows an accu- rate simulation of compressible flows, though still with Methods based on lattice Boltzmann equations (LBE) an isothermal . An ability to adjust the are a promising alternative to conventional numerical bulk viscosity should also be a useful addition to non- methods for simulating fluid flows [1]. Lattice Boltz- isothermal lattice Boltzmann schemes, or for simulating mann methods are straightforward to implement and materials other than dilute monatomic gases. Sterling have proved especially effective at simulating flows in & Chen [6] have already proposed a modified equilib- complicated geometries, and for exploiting parallel com- rium distribution that included an adjustable effect re- puter architectures. They are most commonly used to sembling bulk viscosity. However, their deviatoric stress simulate incompressible flows through solving the com- contained terms proportional to ∇ρ. Their scheme thus pressible, isothermal Navier–Stokes equations at small approximates continuum equations that differ from the Mach numbers. The Mach number Ma = u/c is the ra- s compressible Navier-Stokes equations, though they do co- tio of the fluid speed u to the sound speed c . When the s incide in the small Mach number limit. Mach number is small, temperature and density fluctua- tions are O(Ma2) so the flow is approximately isothermal The compressible Navier–Stokes equations may be and incompressible. written in the form The most common lattice Boltzmann scheme, which ∂ ρ + ∇· (ρu) = 0, (1a) expands the exact Maxwell–Boltzmann equilibrium dis- t 0 tribution to second order in Mach number and uses ∂t(ρu) + ∇· (pI + ρuu) = ∇·σ , (1b) a Bhatnagar–Gross–Krook (BGK) approximation [2] to the collision term, contains a spurious term of O(Ma3) [3] where ρ, u and p are the density, velocity, and ther- that limits its application to small Mach number flows. modynamic respectively. Viscous effects appear The spurious term may be eliminated by expanding the via the deviatoric stress σ0, sometimes denoted by τ [7], equilibrium distribution to higher order in Ma and us- which is conventionally placed on the right hand side of ing a more complicated lattice [4, 5]. However, the vis- (1b). In general, the pressure p is a function of the tem- cous stresses still differ by O(Ma2) from what is nor- perature θ, representing , as well as den- mally meant by the “Navier–Stokes equations” because sity, so the two equations above must be supplemented the bulk viscosity is nonzero. In particular, the viscous by an evolution equation for the temperature [8], stresses differ by O(Ma2) from those calculated from the 2 Boltzmann equation for a dilute monatomic gas. This (∂ + u · ∇)θ + θ∇·u = −∇·q. (2) difference is particularly relevant to recent efforts that t 3 have extended lattice Boltzmann schemes to finite, but still subsonic, Mach numbers [4, 5, 6]. We have written θ = kT , with k being Boltzmann’s con- In this paper we propose a modified lattice Boltzmann stant and T the conventional temperature. The flux q is normally taken to be q = −K∇θ, where the K may depend on both ρ and θ. On the assumptions that the deviatoric stress is lin- ∗Electronic address: [email protected]; early and isotropically related to the local velocity gra- URL: http://www.damtp.cam.ac.uk/user/pjd12 dient tensor ∇u, and vanishes for rigid rotations, the 2 deviatoric stress must take the generic form [7, 9, 10] general case, use of (5) instead of (3) implies a spurious generation of angular momentum via spatial in 2 σ0 = µ(∂ u + ∂ u − δ ∇·u) + µ0δ ∇·u. (3) the viscosity coefficients. αβ α β β α 3 αβ αβ Equations (1a-b,2), with particular values for µ, µ0 We follow Chen & Doolen [1] in using Greek indices for and K may be systematically derived from the contin- vector components, reserving Roman indices for labelling uum Boltzmann equation that describes a dilute gas of 0 discrete lattice vectors. Here µ and µ are the first, or monatomic particles undergoing binary collisions [8, 14, shear, and second, or bulk, dynamic viscosity coefficients 15]. This derivation employs a multiple scales expansion, respectively. These coefficients are material properties, the Chapman–Enskog expansion, which seeks solutions and in general will be functions of the local density and that are slowly varying on the length and timescales as- temperature, but it is worth emphasising that (3) de- sociated with particle collisions. However, the Navier– pends on the of the velocity u, and not on the Stokes equations with more general forms of µ, µ0 and gradient of the momentum ρu. for which the de- K are often justified empirically for a much wider range viatoric stress takes this form are often called Newtonian of materials than dilute monatomic gases, such as liquids fluids. In particular, the fluid simulated by Sterling & [7, 9, 10, 12, 13]. Chen’s [6] lattice Boltzmann scheme is not a Newtonian fluid for this reason. In particular, µ0 = 0 for a dilute monatomic gas, which The topic of bulk viscosity is complicated by differ- is one justification for writing (3) in the form given, where ent authors attaching different meanings to terms like the term proportional to the first viscosity µ has no trace. “pressure” and “bulk viscosity” [11]. We follow the con- Thus a nonzero µ0 implies a deviation in material proper- ventions of Landau & Lifshitz [9], since their terminol- ties from those of a dilute monatomic gas. Physically, a ogy is compatible with that normally used in the lattice material with µ0 = 0 is characterised by a lack of viscous Boltzmann literature. They rewrite the Navier–Stokes dissipation under purely isotropic expansion or contrac- momentum equation (1b) in conservative form as tion. We note that µ0 ≥ 0 is required for mechanical sta- bility. A nonzero value for µ0, along with modified values ∂t(ρu) + ∇·Π = 0, (4) for µ and K, has been derived by Choh [16, 17] from the

0 Bogoliubov-Born-Green-Kirkwood-Yvon (BBGKY) hier- where the tensor Π = pI + ρuu − σ is the total momen- archy which models non-dilute gases [8, 14, 17]. tum flux. The total stress σ = −pI + σ0 includes an ad- ditional isotropic contribution from the thermodynamic Lattice Boltzmann equations are usually used to sim- pressure p. The deviatoric stress is not necessarily trace- ulate the incompressible Navier–Stokes equations, which less with these definitions, Tr σ0 6= 0 in general, since the follow from the compressible Navier–Stokes equations in normal stress may differ from the thermodynamic pres- the limit of small Mach number, Ma = |u|/cs → 0, where sure. cs is the sound speed. If we rewrite the continuity equa- According to Landau & Lifshitz [9], the word “pres- tion (1a) to resemble the temperature equation, sure” means the thermodynamic pressure, given by p = θρ for a perfect gas. The “bulk viscosity” or “second vis- cosity coefficient” multiplies any isotropic term in the de- (∂t + u · ∇)ρ + ρ∇·u = 0. (6) viatoric stress in addition to the traceless term present in an ideal monatomic gas. This differs from the convention used by Batchelor [12] and Lamb [13], whose “pressure” the terms proportional to ∇·u in (6) and (2) are both is the mechanical pressure, meaning minus one third the 2 0 O(Ma ). Thus an initial state with constant values ρ0 trace of the stress tensor, so the µ term in (3) is ab- 2 and θ0 will be preserved to an accuracy of O(Ma ), i.e. sorbed into the “pressure.” Also Cercignani [14] and 2 2 Tritton [7] use the term “bulk viscosity” for the combina- ρ(x, t) = ρ0 + O(Ma ) and θ(x, t) = θ0 + O(Ma ). Most tion µ0 − (2/3)µ that multiplies ∇·u in (3). Thus dilute lattice Boltzmann formulations in fact assume that the 0 temperature is exactly constant, θ(x, t) = θ0, and adopt monatomic gases (µ = 0) have negative bulk viscosity in 2 this terminology. the isothermal equation of state p = cs ρ, with constant sound speed cs [1, 3]. Here cs is the isothermal or Newto- To complicate matter further, expressions of the form 2 nian sound speed, cs = dp/dρ at constant temperature, 0 0 rather than at constant [13]. However, we show ∂βσαβ = ∂β[µ∂βuα + (µ + µ/3)∂αuβ] (5) below that the isothermal assumption θ = θ0 changes the sometimes appear in the literature, with the combination form of the deviatoric stress, as well as the equation of µ0 + µ/3 labeled the “bulk viscosity” [5]. This is only a state as intended. While this change is itself O(Ma2), it correct rearrangement of (3) when the combined coeffi- becomes relevant when lattice Boltzmann equations are cient µ0 −2µ/3 is spatially uniform, i.e. ∇(µ0 −2µ/3) = 0. used to simulate flows in the finite Mach number regime. This holds for the particular case of an isothermal fluid Moreover, it appears to be significant in under-resolved using the BGK approximation with collision time τ ∝ lattice Boltzmann simulations of supposedly incompress- ρ−1, as in §V below, but does not hold in general. In the ible flows. 3

II. THE CONTINUUM BOLTZMANN slow variations in space and time via a Chapman-Enskog EQUATION expansion [8, 15, 17]. The Chapman-Enskog expansion introduces a small parameter ² into the collision time, so We consider the continuum Boltzmann BGK equation that (7) becomes [8, 14, 15, 17], 1 (0) 1 ∂tf + ξ · ∇f = − (f − f ). (11) ∂ f + ξ · ∇f = − (f − f (0)), (7) ²τ t τ Thus spatial and temporal derivatives appear at lower where f(x, ξ, t) is the single-particle distribution func- order in ² than the collision term. The parameter ² may tion, and ξ the microscopic particle velocity. The origi- be identified physically with the dimensionless mean free nal continuum Boltzmann equation employed an path, or Knudsen number, but its purpose is to order the operator on the right hand side which models binary col- terms in an expansion that avoids the moment closure lisions in a dilute monatomic gas. We have replaced this problem which plagues hydrodynamic turbulence. Only term by the Bhatnagar–Gross–Krook (BGK) approxima- moments of the known equilibrium distribution f (0) and tion [2], in which f relaxes towards an equilibrium distri- their derivatives in space and time are needed. In fact, (0) bution f with a single relaxation time τ. The Maxwell– ² may be absorbed into the collision time τ and so set Boltzmann equilibrium distribution in 3 is equal to unity in the formulae below. µ ¶ ρ (ξ − u)2 We pose a multiple scale expansion of both f and t, f (0) = exp − , (8) (2πθ)3/2 2θ but not x, in powers of ², where ρ, u and θ are the macroscopic density, velocity f = f (0) + ²f (1) + ²2f (2) + ··· , (12) and temperature as above. We have scaled velocities so ∂ = ∂ + ²∂ + ··· , 1/2 t t0 t1 that the isothermal sound speed cs = θ . The three macroscopic quantities are defined via moments of the where we may think of t0 and t1 as advective and diffu- distribution function f, sive (viscous) timescales respectively. We impose the two Z Z Z 1 solvability conditions ρ = fdξ, ρu = ξfdξ, ρθ = |ξ − u|2fdξ, (9) Z Z 3 f (n)dξ = ξf (n)dξ = 0, for n = 1, 2,.... (13) where the with respect to ξ are taken over all 3 (0) of R . We observe that the equilibrium distribution f (1) (2) depends on the coordinates x and t only through the x Thus the higher order terms f , f ,... do not con- and t dependence of ρ, u and θ. tribute to the macroscopic density or momentum. These For given ρ, u and θ, the Maxwell–Boltzmann distri- constraints, which reflect local and momentum con- servation under collisions, lead to evolution equations for bution is the distributionR that minimises the Boltzmann entropy functional H = f ln(f)dξ. The simplified BGK the macroscopic quantities. collision term on the right hand side of (7), like Boltz- Substituting the expansions (12) into the rescaled mann’s original binary collision term, drives the distri- Boltzmann equation (11), we obtain bution function f towards a local Maxwell–Boltzmann 1 (0) (∂ + ξ · ∇) f (0) = − f (1), (14a) equilibrium distribution f while preserving the local t0 τ density, momentum and temperature (internal energy). (0) (1) 1 (2) Thus the three moments (9) still hold if f is replaced ∂t1 f + (∂t0 + ξ · ∇) f = − f , (14b) (0) τ by f . These properties are all that are required to R reproduce the Navier–Stokes equations. The momentum at OR(1) and O(²). Taking the first two moments, (·)dξ flux tensor Π, and the equilibrium momentum flux tensor and (·)ξdξ, of (14a) we obtain Π(0), are given by the complete second moment tensors (0) (0) of f and f respectively, ∂t0 ρ + ∇· (ρu) = 0, ∂t0 (ρu) + ∇·Π = 0, (15) Z Z (0) Π = ξξfdξ, Π(0) = ξξf (0)dξ = θρI + ρuu. (10) where ρ, u and Π are defined in (9) and (10). The right hand sides vanish by virtue of the solvability conditions The second moment tensor is not conserved by either the (13). These two equations are equivalent to the Euler BGK or the Boltzmann binary collision term. In fact, equations for an inviscid fluid, namely equations (1a,b) 0 it is the difference σ0 = Π(0) − Π that gives rise to a with σ = 0. Similarly, we obtain deviatoric stress, and thus to viscous dissipation. (1) ∂t1 ρ = 0, ∂t1 (ρu) + ∇·Π = 0, (16) at next order in ², from the same two moments of (14b) A. Chapman-Enskog expansion and the solvability conditions. Neglecting terms of O(²2), equations (15) and (16) combine to give The Navier–Stokes equations may be derived from mo- (0) (1) ments of the continuum Boltmann equation in the limit of ∂tρ+∇· (ρu) = 0, ∂t(ρu)+∇· (Π +²Π ) = 0, (17) 4 which are equivalent to equations (1a) and (4). The devi- Thus the deviatoric stress σ0 = −²Π(1), is of the form atoric stress σ0 = −²Π(1) to this order of approximation. (3) with µ = ²τθ and µ0 = 0. The absence of the second (1) viscous effect, or the fact that Tr σ0 = 0, is a direct conse- An equation for the firstR correction stress Π follows from the second moment (·)ξξdξ of (14a), quence of internal energy conservation under collisions, as expressed by the temperature solvability condition (21). µZ ¶ (0) (0) 1 (1) An equation for ∂t1 θ, where thermal conduction ap- ∂ Π + ∇· ξξξf dξ = − Π . (18) 2 t0 τ pears, may be found from the |ξ − u| moment of (14b). The additional term takes the expected form q = −K∇θ, The third moment of the equilibrium distribution f (0) is where K = (5/2)µ = (5/2)ρθτ for the BGK approxima- given by tion. Z (0) ξαξβξγ f dξ =ρuαuβuγ (19) C. Isothermal approximation + θρ (uαδβγ + uβδγα + uγ δαβ) , As discussed in the Introduction, most lattice Boltz- (0) and we can compute ∂t0 Π from the leading order time mann formulations take the temperature to be exactly derivatives of ρ, u and θ, constant, θ = θ0, rather than allowing it to vary by O(Ma2) in response to a nonzero divergence ∇·u. Thus (0) ∂ Π =∂ (θρδ + ρu u ) = ∂ (θρ)δ the solvability condition (21) for the temperature, which t0 αβ t0 αβ α β t0 αβ (20) in fact represents conservation of energy under collisions, + uα∂t0 (ρuβ) + uβ∂t0 (ρuα) − uαuβ∂t0 ρ, is replaced by the constrain θ = θ0. (1) In this case the terms arising from ∂ θ and ∇θ in the so (18) in fact gives an explicit expression for Π in t0 terms of the instantaneous values of ρ, u, θ and their earlier calculation are missing, so now (18) simplifies to spatial derivatives. [3, 18, 19]

(1) Παβ = −τθρ(∂αuβ + ∂βuα). (25) B. Consistent approach The deviatoric stress σ0 = −²Π(1) is still of the form In the consistent approach [8, 15], an evolution equa- (3) with first viscosity coefficient µ = ²τρθ as before, tion for the temperature θ is obtained by imposing a third but now there is a nonzero second viscosity coefficient solvability condition, µ0 = (2/3)µ. Z By direct calculation, Tr Π(1) = −2τθρ∇·u, so the |ξ − u|2f (n)dξ = 0, for n = 1, 2,.... (21) analogue of (23) acquires a nonzero right hand side, µ ¶ µ ¶ 3 3 1 which reflects conservation of the internal energy ρθ un- ∂ ρθ + ∇· ρθu + θρ∇·u = − Tr Π(1), (26) t0 2 2 2τ der collisions. From the trace of (18) we obtain an energy equation in the form which exactly cancels the θρ∇·u forcing term. The in- µ ¶ µ ¶ ternal energy equation is now exactly satisfied by θ be- 3 1 2 1 2 5 1 (1) ing constant, since it then coincides with the continuity ∂t0 θρ+ ρu +∂γ ρu uγ + ρθuγ = − Παα. 2 2 2 2 2τ equation (1a). (22)

The right hand side vanishes using the three solvability III. FROM CONTINUUM BOLTZMANN TO conditions (13) and (21) together with the identity |ξ − LATTICE BOLTZMANN u|2 = ξ·ξ−2ξ·u+u·u. The kinetic energy term (1/2)ρu2 may be eliminated using the continuity and momentum Although lattice Boltzmann equations were first con- equations, leading to the internal energy equation structed as empirical extensions of the earlier lattice gas µ ¶ µ ¶ 3 3 automata (LGA) [20] to continuous distribution func- ∂ ρθ + ∇· ρθu + θρ∇·u = 0, (23) t0 2 2 tions [21, 22], they may also be derived systematically by truncating the continuum Boltzmann equation in ve- which is equivalent to the temperature equation (2) with locity space [23, 24, 25, 26]. This derivation determines K = 0, using the (1a). several otherwise arbitrary constants in the construction Using this new equation, along with (15), to eliminate [18, 26]. A lattice Boltzmann equation with a Coriolis force also arises naturally from the analogous derivation the time derivatives ∂t0 in (20), we obtain [8, 15] µ ¶ in a rotating frame [19]. 2 As lattice Boltzmann equations are normally used to Π(1) = −τθ ∂ u + ∂ u − δ ∇·u . (24) αβ α β β α 3 αβ simulate fluids at low Mach numbers, it is usual to exploit 5 the small Mach number to expand the exact equilibrium A. Two dimensional, nine speed lattice Boltzmann distribution f (0) up to second order in the macroscopic equation velocity u. Recall that we have scaled velocities so that 1/2 cs = θ is O(1) so |u| = O(Ma) ¿ 1. We replace the The most common quadrature formula in two dimen- exact Maxwell–Boltzmann distribution (8) by sions (D = 2) uses nine quadrature points, leading to the µ ¶ so-called nine speed lattice Boltzmann model [1, 3, 18]. If ξ · u (ξ · u)2 u2 we take the temperature θ = 1/3, the quadrature points f (0) = ρw(ξ) 1+ + − + O(u3), (27) θ 2θ2 2θ lie on an integer lattice,  where w(ξ) is the weight function (0, 0), i=0, ξ = (sin((i − 1)π/2), cos((i − 1)π/2)), i=1,2,3,4, ¡ ¢ i √ w(ξ) = (2πθ)−3/2 exp −ξ2/2θ . (28)  2(sin((2i − 1)π/4), cos((2i − 1)π/4)), i=5,6,7,8. R (33) The ρuuu term in the exact third moment ξξξf (0)dξ The corresponding weight factors are as calculated in (19) above disappears when f (0) is re-  placed by its truncated form (27). Thus the two devia- 4/9, i=0, toric stresses calculated above each acquire an extra term wi = 1/9, i=1,2,3,4, (34) 3  −τ∇·(ρuuu) [3]. Since this extra term is O(Ma ) it only 1/36, i=5,6,7,8, becomes appreciable in the finite Mach number regime [5]. and the discrete equilibrium distributions functions are With the expanded form (27) of the equilibrium dis- µ ¶ tribution f (0), the integrals appearing in equations (9), (0) 9 2 3 2 f = wiρ 1 + 3ξi · u + (ξi · u) − u . (35) (10) and (19) are all of the form i 2 2 Z Although the results follow from the construction via pn(ξ)w(ξ)dξ, 0 ≤ n ≤ 5, (29) Gaussian quadratures, the required moments may be evaluated directly with the aid of identities such as [18] where p (ξ) denotes a polynomial of degree n in the com- n X8 X8 1 X8 ponents of ξ. He & Luo [23, 24] realised, in the context of w ξ = 0, w ξ ξ = I, w ξ ξ ξ = 0. (36) i i i i i 3 i i i i lattice Boltzmann equations, that these integrals may be i=0 i=0 i=0 evaluated as sums using Gaussian quadrature formulae,

Z XN IV. FULLY DISCRETE LATTICE BOLTZMANN pn(ξ)w(ξ)dξ = wipn(ξi). (30) EQUATION i=0 To achieve a fully discrete lattice Boltzmann equation The points ξi are known as quadrature points, and the we must approximate (31) in x and t. Integrating (31) coefficients wi are the corresponding weights [27]. The along a characteristic for a time interval ∆t, we obtain number N of quadrature points required depends on the maximum degree n of the polynomial, and the fi(x + ξ ∆t, t + ∆t) − fi(x, t) = D of the ξ space. i Z ∆t Only the values of the distribution function as evalu- 1 (0) − fi(x + ξis, t + s) − fi (x + ξis, t + s)ds. ated at the quadrature points ξi need be evolved in x and τ 0 t, since these values are sufficient to evaluate the required (37) moments using (30). Thus the continuum Boltzmann equation (7) may be replaced by the lattice Boltzmann The integral may be approximated by the trapezium rule equation, with second order accuracy, thus

1 (0) fi(x + ξi∆t, t + ∆t) − fi(x, t) = ∂tfi + ξi · ∇fi = − (fi − fi ), for i = 0,...,N, (31) ³ τ ∆t (0) − fi(x + ξi∆t, t + ∆t) − fi (x + ξi∆t, t + ∆t) 2τ ´ where fi(x, t) = wif(x, ξi, t)/w(ξi) (compare equations (0) 3 (27) and (35)), and the macroscopic quantities of density, +fi(x, t) − fi (x, t) + O(∆t ). (38) momentum, and momentum flux are now given by (0) Unfortunately, fi (x + ξi∆t, t + ∆t) is not known inde- N N N X X X pendently of the set fi(x + ξi∆t, t + ∆t), so (38) appears ρ = fi, ρu = ξifi, Π = ξiξifi. (32) to yield a system of coupled nonlinear algebraic equations i=0 i=0 i=0 for the fi at time t + ∆t. However, the system may be 6 rendered fully explicit by a change of variables [19, 28]. librium distribution functions to be Introducing a different set of distribution functions f µ ¶ i ξ · u (ξ · u)2 |u|2 defined by f (0) = ρw 1 + + − i i θ 2θ2 2θ ∆t ³ ´ µ ¶ f (x, t) = f (x, t) + f (x, t) − f (0)(x, t) , (39) µ0 1 (|ξ |2 − Dθ) i i 2τ i i + w − i (Tr Π(1)). (43) i 2µ 3 2θ2 the above scheme (38) is algebraically equivalent to the The number of spatial dimensions is D, which appears fully explicit scheme (0) via Tr I = D. These fi are functions of {f1, . . . , fN } (1) f i(x + ξ∆t, t + ∆t) − f i(x, t) = through u and ρ as before, and now also through Tr Π ∆t ³ ´ as calculated in (46) below. The 1, ξ, and ξξξ moments − f (x, t) − f (0)(x, t) . (40) τ + ∆t/2 i of (43) are unchanged, while the ξξ moment becomes µ ¶ µ0 1 The macroscopic density, momentum, and momentum Π(0) = θρI + ρuu + − (Tr Π(1))I. (44) 2µ 3 flux are readily reconstructed from moments of the f i, (1) XN XN Since Tr Π = −2θρτ∇·u from (25), the combined mo- ρ = f i, ρu = ξif i, mentum flux tensor becomes i=0 i=0 (41) Π = Π(0) + Π(1) = θρI + ρuu − σ0, (45) µ ¶ XN ∆t ∆t (0) 0 1 + Π = ξiξif i + Π . where σ is the full deviatoric stress as in (3). The ratio 2τ 2τ 0 i=0 µ /µ appearing in (43) may be an arbitrary function of the local density ρ. This formulation is equivalent to the usual construction (0) (1) based on a Taylor expansion of the discrete equation As Tr Π itself depends on Tr Π via (44), the trace (40) which observes that second order accuracy may be of equation (42) rearranges to give · µ ¶¸ achieved with what looks like only a first order approx- ∆t µ0 1 1+ +D − Tr Π(1) =Tr Π−Dθρ−ρu2, (46) imation to (31), by replacing the relaxation time τ with 2τ 2µ 3 τ + ∆t/2 [1]. However, the variables often denoted fi ap- pearing in the discrete system are actually the f i in our which is the expression we used in conjunction with (43) (1) (0) notation, so the non-equilibrium momentum flux Π in to compute fi in terms of f i. We note that in three the fully discrete system (40) is given by dimensions with no bulk viscosity, D = 3 and µ0 = 0, the coefficient on the left hand side of (46) is saved from (0) Π − Π vanishing by the ∆t/(2τ) term. Thus it is possible to Π(1) = , (42) 1 + ∆t/(2τ) simulate flows with Tr σ0 = 0 using this scheme. This alteration to the equilibrium stress Π(0) also (0) rather than by Π − Π as in the continuous system. changes the pertubation stress Π(1), because equation (1) (0) (18) for Π contains the term −τ∂t0 Π . However, (0) V. DENSITY DEPENDENT VISCOSITIES the new term in Π is only O(τ), one order smaller than the other terms, so the new term in Π(1) is O(τ 2). If the Chapman–Enskog analysis of §II is applied to This new term is also one order smaller than the other terms in Π(1), and is thus comparable with the so-called the Boltzmann equation with Boltzmann’s original bi- (2) nary collision operator instead of the BGK approxima- Burnett terms involving fi that arise at higher order in tion, we find that the dynamic viscosity µ is independent the Chapman–Enskog expansion of the continuum Boltz- of density, and a function of temperature only. This sur- mann equation [14, 15]. Since we aim to recover the prising result, subsequently verified experimentally, was Navier–Stokes equations with modified bulk viscosity by one of the first successes of classical kinetic theory [17]. truncating the Chapman–Enskog expansion at O(τ), it (2) 2 To reproduce this using the BGK approximation it is nec- is consistent to neglect both Π and the new τ ∂t0 ∇·u essary to make the collision timescale τ inversely propor- term in Π(1). We show in §VII below that deviations tional to the local density, τ ∝ ρ−1, and thus a function from the intended Navier–Stokes behaviour at finite τ of . The analysis of §IV is unchanged, apart from are no worse than for the unmodified lattice Boltzmann τ being a function τ(x, t) instead of a constant. equation.

VI. ADJUSTABLE BULK VISCOSITY VII. NUMERICAL EXPERIMENTS

We modify the bulk viscosity coefficient in the isother- We performed numerical experiments to measure the mal lattice Boltzmann equation by redefining the equi- bulk viscosity of the two dimensional nine speed lattice 7

Boltzmann model with the modified equilibrium distri- 1.15 bution appearing in (43). We also investigated the effect ν′=(2/3)ν of varying bulk viscosity on a nominally incompressible but under-resolved simulation of a Kelvin–Helmholtz in- 1.1 ν′=(4/3)ν stability. Both sets of experiments were performed using periodic boundary conditions. ν′=ν/10 1.05

ν′=0 A. Sound waves 1

We measured the bulk viscosity from the rate of decay (measured / intended) ν′=4ν ′ of sound waves in numerical experiments. For flows of ν

+ 0.95

0 0 0 ν the form ρ = ρ0 + ρ (x, t) and u = u (x, t)xˆ, with ρ and ν′=10ν u0 both small, the linearised form of the Navier–Stokes (4/3) equations (1a,b) that govern sound waves may be reduced 0.9 to [13] µ ¶ 4 ∂ u = c2∂ u + ν + ν0 ∂ u, (47) 0.85 tt s xx 3 xxt 0 0.05 0.1 0.15 0.2 Ma/Re 0 0 where ν = µ/ρ0 and ν = µ /ρ0 are the kinematic shear and bulk viscosities respectively. This equation has so- FIG. 1: Ratio of measured to intended effective viscosity 0 lutions of the form u(x, t) ∝ exp(ikx + σt) provided σ (4/3)ν +ν for sound√ waves, plotted against Knudsen number satisfies the dispersion relation [13] Kn = Ma/Re = τ/ 3. The unmodified 9 speed lattice Boltz- mann scheme is equivalent to ν0 = (2/3)ν (uppermost solid " #1/2 line). µ ¶ µ ¶2 2 2 1 0 2 4 0 k σ =− ν+ ν k ± ikcs 1− ν+ν 2 . (48) 3 2 3 cs 1, it is convenient to choose the time unit so that a typical For small amplitude waves the nonlinear terms present in fluid velocity is of magnitude 1. The√ sound speed√ is then the lattice Boltzmann simulation are negligible, includ- 1/Ma, and the particle speeds are 3/Ma or 6/Ma. ing the O(Ma3) nonlinear correction ∇·(ρuuu) to the The Reynolds number is defined as Re = 1/ν˜, using the deviatoric stress. This was verified by observing that the effective viscosity and unit length and velocity scales, so numerical solutions decayed exponentially as predicted Ma/Re =ν/c ˜ s. by the linear theory. Sound waves in a hexagonal six The measured effective viscosities are close to their in- speed lattice Boltzmann scheme were studied previously tended values, indicated byν ˜m/ν˜ ≈ 1 in Fig. 1, for vari- in [29], but with an emphasis on nonlinear steepening at ous values of the ratio ν0/ν provided the Knudsen number finite amplitude. is not too large, in the sense that Ma/Re < 0.03 for a 1% Viscous dissipation of sound waves depends upon the error, and Ma/Re < 0.01 for a 0.1% error. The curve combinationν ˜ = (4/3)ν + ν0 of the shear and bulk vis- ν0 = (2/3)ν corresponds to the unmodified nine speed cosities, which we refer to as the effective viscosity. In lattice Boltzmann scheme, so the deviations introduced Fig. 1 we plot the ratioν ˜m/ν˜ of the measured effective by the modified bulk viscosity at finite Knudsen number viscosityν ˜m to its intended valueν ˜, for varyingν ˜ and are no worse than those already present. several fixed ratios ν0/ν of bulk to shear viscosities. The The curves in Fig. 1 are all parabolic for small τ. Since measured values were computed from the decay of the en- we have divided by τ in computing the ratio of the mea- 2 2 02 ergy E(t) = u + cs ρ by a least squares fit of a straight sured to intended decay rate, this implies that the devi- line to the logarithm ln E(t). The energy in fact decays ations in the measured decay rate are due to the super- in an oscillatory fashion, because viscous dissipation is Burnett corrections at O(τ 3) in the Chapman–Enskog proportional to the oscillatory instantaneous fluid veloc- expansion [15]. This is confirmed analytically in the ap- ity, but a simple straight line fit proved adequate. The pendix. The Burnett correction at O(τ 2), the first cor- initial conditions were u = 0 and ρ = 1 + 10−6 sin(2πx), rection beyond Navier–Stokes, is dispersive and so only using 64 lattice points. Simulations with larger values of alters the frequency, not the decay rate. This correction ν˜ used 128 bit arithmetic, with approximately 33 signifi- has been found by Qian & Zhou [30] for the unmodified 9 cant digits, so more oscillations could be followed before speed lattice Boltzmann scheme. It differs from the Bur- the sound wave decayed to the level of numerical round- nett correction to the continuum Boltzmann equation be- ing error. cause the ξ4 moment of the truncated equilibrium (27) 4 The independent variable√ in Fig. 1 is the Knudsen differs from the ξ of the original Maxwell–Boltzmann number Kn = Ma/Re = τ/ 3. Introducing dimension- equilibrium (8). less variables in which the simulation domain is of length For the purposes of simulating nearly incompressible 8

flows, the lattice Boltzmann scheme may be made accu- 1 rate for arbitrarily largeν ˜, corresponding to arbitrarily small Reynolds numbers, by making the Mach number sufficiently small. This is equivalent to taking sufficiently 0.8 small timesteps, by comparison with the timescale set by the fluid velocity and the lattice spacing, but not by comparison with the timescale of evolving sound waves. Demonstrating correct viscous dissipation of sound waves 0.6 is thus quite a strenuous test because the lattice Boltz-

mann scheme is intended to simulate motions that evolve y on timescales much longer than the periods of sound waves. 0.4

B. Doubly periodic shear layers 0.2 Minion & Brown [31] studied the performance of var- ious numerical schemes in under-resolved simulations of the 2D incompressible Navier–Stokes equations. Their 0 initial conditions corresponded to a perturbed shear 0 0.2 0.4 0.6 0.8 1 layer, x ( tanh(k(y − 1/4)), y ≤ 1/2, FIG. 2: Contours of vorticity at t = 1 from the unmodified ux = 9 speed lattice Boltzmann equation on a 128 × 128 grid with tanh(k(3/4 − y)), y > 1/2, (49) Ma = 0.04 and Re = 10000. Compare Fig. 8 in [31]. The contour interval is ∆ω = 6. uy = δ sin(2π(x + 1/4)), in the doubly periodic domain 0 ≤ x, y ≤ 1. The param- eter k controls the width of the shear layers, and δ the with the unmodified lattice Boltzmann equation. Con- magnitude of the initial perturbation. The shear layer is versely, enhancing the bulk viscosity to µ0 = 10µ suc- expected to roll up due to a Kelvin–Helmholtz instabil- cessfully prevents the formation of spurious vortices as ity excited by the O(δ) perturbation in uy. With k = 80, shown in Fig. 5. Increasing the bulk viscosity further δ = 0.05, and a Reynolds number Re = ν−1 = 10000, the to µ0 = 100µ produced no further visible changes. This thinning shear layer between the two rolling up vortices is all consistent with the spurious vortices being caused becomes under-resolved on a 128 × 128 grid. Minion & by an apparent divergence in the thin shear layers when Brown [31] found that conventional numerical schemes they become too narrow to be resolved by the grid. The using centred differences became unstable for this under- enhanced bulk viscosity acts to smooth out the flow at resolved flow, whereas the “robust” or “upwind” schemes just those points where there is an apparent divergence, that actively suppress grid-scale oscillations all produced but leaves the rest of the flow almost unaffected. two spurious secondary vortices at the thinnest points of In a well-resolved 256 × 256 simulations the vorticity the two shear layers. was independent of the bulk viscosity, with a fractional Fig. 2 shows that two spurious vortices are generated variation of 10−6 for 0 ≤ µ0/µ ≤ 100, and showed the ex- by the 9 speed lattice Boltzmann equation with unmod- pected second order convergence in Mach number based ified bulk viscosity. The vorticity ω = ∂xuy − ∂yux was on simulations with Ma = 0.01, 0.02, and 0.04. Although computed from the velocities ux and uy at grid points by there was still some discrepancy in the two main vortices spectrally accurate differentiation. The shear layers be- between the 128 × 128 simulations with enhanced bulk come under-resolved at t = 0.6, see top of Fig. 3, due to viscosity and the 256 × 256 simulations, most likely due stretching as the two large vorticies roll up. This stretch- to a slight shift in position of the vortex filaments, the ing is associated with a nonzero numerical divergence, discrepancy in the stretched shear layers was almost en- ∇·u 6= 0, at the two halfway points where the spurious tirely eliminated. vortices form, as shown in the lower half of Fig. 3. The numerical divergence is due to a lack of spatial resolution, and not to an insufficiently small Mach number, since VIII. CONCLUSION it was almost unchanged by reducing the Mach number from 0.04 to 0.01. Moreover, the divergence computed The usual derivation of lattice Boltzmann equations from Tr Π(1) was almost indistinguishable from that com- involves replacing the temperature evolution equation in puted by spectrally differentiating ux and uy. the Chapman–Enskog expansion by an isothermal as- Fig. 4 shows that removing the bulk viscosity, µ0 = 0, sumption. This introduces a bulk viscosity µ0 = 2µ/3 increases the strength of the spurious vortices compared into the deviatoric stress that is not present with a con- 9

1 1

0.8 0.8

0.6 0.6 y y

0.4 0.4

0.2 0.2

0 0 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 (a) x x 1 FIG. 4: Vorticity contours at t = 1. Stronger spurious vortices form in the absence of bulk viscosity, µ0 = 0. The contour interval is ∆ω = 6. 0.8

that sound waves experience the correct dissipation due to the intended bulk and shear viscosities. Deviations 0.6 from the intended behaviour due to a finite mean free path, i.e. a finite Knudsen number, are no worse than y in the unmodified lattice Boltzmann equation. An en- hanced bulk viscosity of the order of 10 ≤ µ0/µ ≤ 100 0.4 succeeded in suppressing spurious vortices created by an under-resolved nominally incompressible flow at high Reynolds number. This same modification could presum- 0.2 ably be applied to other lattice Boltzmann schemes, such as the 17 speed scheme in [5]. Sensitivity to varying bulk viscosity may be a useful aid to identifying spurious fea- tures in under-resolved simulations of the kind found by 0 Minion & Brown [31]. 0 0.2 0.4 0.6 0.8 1 (b) x

FIG. 3: Numerical vorticity (a) and divergence ∇·u (b) at Acknowledgments t = 0.6 with parameters as in Fig. 2. The divergence was (1) computed both spectrally from u, and from Tr Π using The author would like to thank John Hinch for com- (25). The peak divergence is 6% of the peak vorticity, and menting on a draft of this paper. Financial support from does not diminish as the Mach number is reduced from 0.04 to 0.01. Compare with Fig. 7 in [31]. The contour intervals St John’s College, Cambridge is gratefully acknowledged. are 6 and 0.5 respectively.

APPENDIX A: ANALYTICAL TREATMENT OF sistent treatment of the temperature. However the bulk DECAYING SOUND WAVES viscosity’s contribution to the deviatoric stress is read- ily adjusted, or removed altogether, by adding a term The viscous decay of sound waves may also be for- proportional to the local fluid divergence to the discrete mulated as a linear eigenvalue problem of the kind con- equilibrium distribution. This divergence is available at sidered in [32]. This resembles previous treatments of each lattice point from the non-equilibrium parts of the sound waves using the linearised continuum Boltzmann distribution functions. Numerical experiments confirm equation [14, 17]. We assume a distribution function of 10

1 O(τ 3). These results are shown as dotted lines in Fig. 6. As usual, the higher order effects leading to the Burnett and super-Burnett equations improve the agreement for small τ, at least in a periodic domain where the question 0.8 of boundary conditions for the higher order differential operators is straightforward, but do not provide a useful description for τ = O(1) [15, 32]. 0.6 In the purely one dimensional case, using the three speeds ξi = {−1, 0, 1} and weights wi = {1/6, 2/3, 1/6} y respectively, the resulting eigenvalue problem for the 0.4 modified system (40) is identical to that for the unmodi- fied system with the same effective viscosity (4/3)ν + ν0. The matrix is

0.2   1 (3 − γ)Ω γΩ/2 −γΩ  2γ 3 − γ 2γ  , (A3) 3 −γ/Ω γ/(2Ω) (3 − γ)/Ω 0 0 0.2 0.4 0.6 0.8 1 x where Ω = exp (2πi/M) for a lattice with M points, and γ = ∆t/(τ+∆t/2) as in (A2). Thus the finite τ behaviour FIG. 5: Vorticity contours at t = 1. An enhanced bulk vis- cosity, µ0 = 10µ, prevents the excessive thinning that leads of the three speed one dimensional scheme with variable to the formation of spurious vortices. An even larger bulk bulk viscosity is precisely the same as for the unmodified viscosity, µ0 = 100µ, produced indistinguishable results. The scheme with the same effective viscosity. contour interval is ∆ω = 6. the form 1.15 ν′=(2/3)ν (0) ikx+σt f i(x, t) = Fi + hie , (A1) 1.1 ν′ (0) =0 where Fi is the equilibrium distribution for a rest state with density ρ0, and the hi are small unknown constants. This describes a small amplitude sound wave with com- 1.05 ν′=10ν plex frequency σ and wavenumber k propagating in the x-direction. The linearised fully discrete lattice Boltz- (0) 1 mann equation, (40) with fi given by (43), then reduces ν′=0

to an eigenvalue problem of the form (measured / intended) ′ ³ ´ ν ikci∆x+σ∆t (0) (0) + 0.95 hie = hi − γ hi − (fi − Fi ) , (A2) ν ν′=10ν (4/3) for σ and the eigenvector hi. The constant γ = ∆t/(τ + 0.9 (0) (0) ∆t/2). The term fi − Fi is a function of {h0, . . . , h8} (0) P P because fi depends on ρ = ρ0 + hj and ρu = ξjhj. This function may be taken to be linear when the h are 0.85 i 0 0.05 0.1 0.15 0.2 sufficiently small. Ma/Re The resulting 9 × 9 matrix eigenvalue problem is not analytically tractable, but a numerical evaluation of the eigenvalues gives excellent agreement with the measured FIG. 6: Ratio of measured to intended effective viscosity decay rate of sound waves in the time dependent sys- 0 (4/3)ν +ν for sound√ waves, plotted against Knudsen number tem, as shown in Fig. 6. This analysis also confirms that Kn = Ma/Re = τ/ 3. Solid lines are from numerical exper- the deviations from the intended viscosity seen in Fig. 1 iments with decaying sound waves, as in Fig. 1, and the cir- are functions of τ only, and thus of the combined pa- cles are from the eigenvalue formulation in the appendix. The rameter Ma/Re. The parabolic behaviour of the relative dashed lines are the O(τ 3) behaviour from a small τ approx- decay rate for small τ, as shown in Fig. 1, may be cap- imation to the eigenvalues. The unmodified 9 speed lattice 0 tured through a perturbation expansion of the eigenval- Boltzmann scheme is equivalent to ν = (2/3)ν (uppermost ues, which may be found exactly for τ = 0, carried up to curve). 11

[1] S. Chen and G. D. Doolen, Lattice Boltzmann method for A. C. Cogley, Simulation of cavity flow by the lattice fluid flows, Annu. Rev. Mech. 30, 329 (1998). Boltzmann equation, J. Comput. Phys. 118, 329 (1995), [2] P. L. Bhatnagar, E. P. Gross, and M. Krook, A model arXiv:comp-gas/9401003. for collision process in gases. I. Small amplitude pro- [19] P. J. Dellar, A priori derivation of lattice Boltzmann cesses in charged and neutral one-component system, equations for rotating fluids, Submitted to Phys. Rev. Phys. Rev. 94, 511 (1954). E (2000). [3] Y.-H. Qian and S. A. Orszag, Lattice BGK models for [20] U. Frisch, B. Hasslacher, and Y. Pomeau, Lattice- the Navier–Stokes equation – nonlinear deviation in com- gas automata for the Navier–Stokes equations, pressible regimes, Europhys. Lett. 21, 255 (1993). Phys. Rev. Lett. 56, 1505 (1986). [4] Y. Chen, H. Ohashi, and M. Akiyama, Ther- [21] G. McNamara and G. Zanetti, Use of the Boltz- mal lattice Bhatnagar-Gross-Krook model without mann equation to simulate lattice-gas automata, nonlinear deviations in macrodynamic equations, Phys. Rev. Lett. 61, 2332 (1988). Phys. Rev. E 50, 2776 (1994). [22] H. Chen, S. Chen, and W. H. Matthaeus, Recovery of [5] Y.-H. Qian and Y. Zhou, Complete Galilean- the Navier–Stokes equations using lattice-gas Boltzmann invariant lattice BGK models for the Navier– method, Phys. Rev. A 45, R5339 (1992). Stokes equation, Europhys. Lett. 42, 359 (1998), also [23] X. He and L.-S. Luo, A priori derivation of the lattice ICASE Report TR-98-38, Institute for Computer Ap- Boltzmann equation, Phys. Rev. E 55, R6333 (1997). plications in Science and Engineering, NASA Langley [24] X. He and L.-S. Luo, Theory of the lattice Boltzmann Research Center. method: From the Boltzmann equation to the lattice [6] J. D. Sterling and S. Chen, Stability analysis of lattice Boltzmann equation, Phys. Rev. E 56, 6811 (1997). Boltzmann methods, J. Comput. Phys. 123, 196 (1996), [25] T. Abe, Derivation of the lattice Boltzmann method by arXiv:comp-gas/9306001. means of the discrete ordinate method for the Boltzmann [7] D. J. Tritton, Physical Fluid Dynamics (Oxford Univer- equation, J. Comput. Phys. 131, 241 (1997). sity Press, Oxford, 1988), 2nd ed. [26] X. Shan and X. He, Discretization of the [8] K. Huang, (Wiley, New York, Velocity Space in the Solution of the Boltz- 1987), 2nd ed. mann equation, Phys. Rev. Lett. 80, 65 (1998), [9] L. D. Landau and E. M. Lifshitz, Fluid Mechanics (Perg- arXiv:comp-gas/9712001. amon, Oxford, 1987), 2nd ed. [27] P. J. Davis and P. Rabinowitz, Methods for Numerical [10] K. Stewartson, The Theory of Laminar Boundary Layers Integration (Academic, New York, 1984), 2nd ed. in Compressible Fluids (Oxford University Press, Oxford, [28] X. He, X. Shan, and G. D. Doolen, Discrete 1964). Boltzmann equation model for nonideal gases, [11] L. Rosenhead et al., A discussion on the first and sec- Phys. Rev. E 57, R13 (1998). ond viscosities of fluids, Proc. Roy. Soc. Lond. A 226, 1 [29] J. M. Buick, C. L. Buckley, C. A. Greated, and (1954). J. Gilbert, Lattice Boltzmann BGK simulation of non- [12] G. K. Batchelor, An Introduction to Fluid Dynamics linear sound waves: the development of a shock front, (Cambridge University Press, Cambridge, 1967). J. Phys. A 33, 3917 (2000). [13] H. Lamb, Hydrodynamics (Cambridge University Press, [30] Y.-H. Qian and Y. Zhou, Higher-order dynamics in Cambridge, 1932), 6th ed. lattice-based models using the Chapman–Enskog method, [14] C. Cercignani, The Boltzmann Equations and its Appli- Phys. Rev. E 61, 2103 (2000). cations (Springer-Verlag, New York, 1988). [31] M. L. Minion and D. L. Brown, Performance of under- [15] S. Chapman and T. G. Cowling, resolved two-dimensional incompressible flow simula- The Mathematical Theory of Non-Uniform Gases tions, II, J. Comput. Phys. 138, 734 (1997). (Cambridge University Press, Cambridge, 1991), 3rd ed. [32] P. Lallemand and L.-S. Luo, Theory of the lattice Boltz- [16] S. T. Choh, The Kinetic Theory of Phenomena in Dense mann method: Dispersion, dissipation, isotropy, Galilean Gases, Ph.D. thesis, The University of Michigan. (1958). invariance, and stability, Phys. Rev. E 61, 6546 (2000), [17] G. E. Uhlenbeck and G. W. Ford, Lectures in Statisti- also ICASE Report TR-2000-17, Institute for Computer cal Mechanics, vol. 1 of Lectures in Applied Mathematics Applications in Science and Engineering, NASA Langley (American Mathematical Society, Providence, 1963). Research Center. [18] S. Hou, Q. Zou, S. Chen, G. D. Doolen, and