Lattice-Gas Cellular Automata and Lattice Boltzmann Models - an Introduction
Total Page:16
File Type:pdf, Size:1020Kb
Dieter A. Wolf-Gladrow Alfred Wegener Institute for Polar and Marine Research, Postfach 12 01 61 D-27515 Bremerhaven Germany e-mail: [email protected] Version 1.05 Lattice-Gas Cellular Automata and Lattice Boltzmann Models - An Introduction June 26, 2005 Springer Berlin Heidelberg NewYork Hong Kong London Milan Paris Tokyo Contents 1 Introduction ............................................... -1 1.1 Preface ................................................ 0 1.2 Overview............................................... 2 1.3 The basic idea of lattice-gas cellular automata and lattice Boltzmannmodels ...................................... 5 1.3.1 TheNavier-Stokesequation......................... 5 1.3.2 Thebasicidea.................................... 7 1.3.3 Top-downversusbottom-up........................ 9 1.3.4 LGCAversusmoleculardynamics................... 9 2 Cellular Automata ......................................... 13 2.1 What are cellular automata? . 13 2.2 A short history of cellular automata . 14 2.3 One-dimensional cellular automata . 15 2.3.1 Qualitative characterization of one-dimensional cellular automata . 22 2.4 Two-dimensional cellular automata . 28 2.4.1 Neighborhoodsin2D.............................. 28 2.4.2 Fredkin’s game . 29 2.4.3 ‘Life’ ............................................ 30 2.4.4 CA: what else? Further reading . 34 2.4.5 FromCAtoLGCA................................ 35 VI Contents 3 Lattice-gas cellular automata .............................. 37 3.1 The HPP lattice-gas cellular automata . 37 3.1.1 Modeldescription................................. 37 3.1.2 Implementation of the HPP model: How to code lattice-gas cellular automata? . 42 3.1.3 Initialization...................................... 46 3.1.4 Coarse graining . 48 3.2 The FHP lattice-gas cellular automata . 51 3.2.1 The lattice and the collision rules . 51 3.2.2 MicrodynamicsoftheFHPmodel .................. 57 3.2.3 The Liouville equation . 62 3.2.4 Massandmomentumdensity....................... 63 3.2.5 Equilibrium mean occupation numbers . 64 3.2.6 Derivation of the macroscopic equations: multi-scale analysis.......................................... 67 3.2.7 Boundary conditions . 77 3.2.8 Inclusionofbodyforces ........................... 78 3.2.9 NumericalexperimentswithFHP ................... 79 3.2.10The8-bitFHPmodel ............................. 85 3.3 Lattice tensors and isotropy in the macroscopic limit . 88 3.3.1 Isotropictensors .................................. 88 3.3.2 Latticetensors:single-speedmodels.................. 89 3.3.3 Generalized lattice tensors for multi-speed models . 93 3.3.4 Thermal LBMs: D2Q13-FHP (multi-speed FHP model) 101 3.3.5 Exercises.........................................103 3.4 Desperately seeking a lattice for simulations in three dimensions .............................................104 3.4.1 Threedimensions..................................104 3.4.2 Fiveandhigherdimensions.........................106 3.4.3 Fourdimensions...................................108 3.5 FCHC .................................................109 3.5.1 Isometric collision rules for FCHC by H´enon..........110 3.5.2 FCHC, computers and modified collision rules . 111 3.5.3 IsometricrulesforHPPandFHP ...................112 Contents VII 3.5.4 Whatelse?.......................................113 3.6 The pair interaction (PI) lattice-gas cellular automata . 115 3.6.1 Lattice,cells,andinteractionin2D..................115 3.6.2 Macroscopicequations.............................118 3.6.3 Comparison of PI with FHP and FCHC . 121 3.6.4 The collision operator and propagation in C and FORTRAN.......................................121 3.7 Multi-speed and thermal lattice-gas cellular automata . 125 3.7.1 TheD3Q19model.................................125 3.7.2 TheD2Q9model..................................128 3.7.3 TheD2Q21model.................................131 3.7.4 Transsonic and supersonic flows: D2Q25, D2Q57, D2Q129..........................................131 3.8 Zanetti (‘staggered’) invariants . 132 3.8.1 FHP ............................................132 3.8.2 Significance of the Zanetti invariants . 132 3.9 Lattice-gas cellular automata: What else? . 134 4 Some statistical mechanics .................................137 4.1 TheBoltzmannequation.................................137 4.1.1 Five collision invariants and Maxwell’s distribution . 138 4.1.2 Boltzmann’s H-theorem . 139 4.1.3 TheBGKapproximation ..........................141 4.2 Chapman-Enskog: From Boltzmann to Navier-Stokes . 143 4.2.1 Theconservationlaws..............................144 4.2.2 TheEulerequation................................145 4.2.3 Chapman-Enskogexpansion........................145 4.3 The maximum entropy principle . 151 5 Lattice Boltzmann Models ................................157 5.1 From lattice-gas cellular automata to lattice Boltzmann models ................................................157 5.1.1 Lattice Boltzmann equation and Boltzmann equation . 158 5.1.2 Lattice Boltzmann models of the first generation . 161 5.2 BGKlatticeBoltzmannmodelin2D ......................163 VIII Contents 5.2.1 Derivation of the Wi ..............................168 5.2.2 Entropy and equilibrium distributions . 169 5.2.3 Derivation of the Navier-Stokes equations by multi-scaleanalysis ...............................172 5.2.4 Storage demand . 181 5.2.5 Simulation of two-dimensional decaying turbulence . 181 5.2.6 Boundary conditions for LBM. 187 5.3 HydrodynamiclatticeBoltzmannmodelsin3D .............193 5.3.1 3D-LBMwith19velocities .........................193 5.3.2 3D-LBM with 15 velocities and Koelman distribution . 194 5.3.3 3D-LBM with 15 velocities proposed by Chen et al. (D3Q15).........................................195 5.4 Equilibrium distributions: the ansatz method . 196 5.4.1 Multi-scale analysis . 197 5.4.2 Negative distribution functions at high speed of sound . 201 5.5 HydrodynamicLBMwithenergyequation .................203 5.6 Stability of lattice Boltzmann models . 206 5.6.1 Nonlinear stability analysis of uniform flows . 206 5.6.2 The method of linear stability analysis (von Neumann) 208 5.6.3 Linear stability analysis of BGK lattice Boltzmann models...........................................209 5.6.4 Summary.........................................213 5.7 SimulatingoceancirculationwithLBM ....................217 5.7.1 Introduction......................................217 5.7.2 The model of Munk (1950) . 217 5.7.3 ThelatticeBoltzmannmodel.......................220 5.8 AlatticeBoltzmannequationfordiffusion .................230 5.8.1 Finite differences approximation . 230 5.8.2 The lattice Boltzmann model for diffusion . 231 5.8.3 Multi-scale expansion . 232 5.8.4 The special case ω =1 .............................234 5.8.5 Thegeneralcase..................................234 5.8.6 Numericalexperiments.............................234 5.8.7 Summaryandconclusion...........................235 Contents IX 5.8.8 Diffusion equation with a diffusion coefficient depending on concentration . 238 5.8.9 Further reading . 239 5.9 LatticeBoltzmannmodel:Whatelse? .....................240 5.10Summaryandoutlook ...................................242 6 Appendix ..................................................245 6.1 Booleanalgebra ........................................246 6.2 FHP: After some algebra one finds ... 248 6.3 Coding of the collision operator of FHP-II and FHP-III in C . 252 6.4 Thermal LBM: derivation of the coefficients . 256 6.5 Schl¨aflisymbols ........................................262 6.6 Notation,symbolsandabbreviations.......................264 Index ..........................................................269 References .....................................................273 1 Introduction 0 1 Introduction 1.1 Preface Lattice-gas cellular automata (LGCA)1 and even more lattice Boltzmann models (LBM) are relatively new and promising methods for the numeri- cal solution of (nonlinear) partial differential equations. Each month several papers appear with new models, investigations of known models or methodi- cally interesting applications. The field of lattice-gas cellular automata started almost out of the blue in 1986 with the by now famous paper of Frisch, Has- slacher and Pomeau. These authors showed, that a kind of billiard game2 with collisions that conserve mass and momentum, in the macroscopic limit leads to the Navier-Stokes equation when the underlying lattice possesses a sufficient (hexagonal in two dimensions) symmetry. A few years later lattice Boltzmann models arose as an offspring of LGCA. Their higher flexibility compared to LGCA led to artificial microscopic models for several nonlinear partial differential equations including the Navier-Stokes equation. I have followed the exciting development of both methods since 1989 and from time to time have given courses on this topic at the Department of Physics and Electrical Engineering at the University of Bremen (Germany). The present book is an extended version of my lecture manuscript. The word ‘introduction’ in the title implies two things. Firstly, the level of presentation should be appropriate for undergraduate students. Thus meth- ods like the Chapman-Enskog expansion or the maximum entropy principle which are usually not taught in standard courses in physics or mathematics are discussed in some detail. Secondly, in an introduction many things have to be left out. This concerns, for instance, models with several colors which allow the simulation of multiphase flows3 or magnetohydrodynamics.