physical applications of cellular...

15
University of Ljubljana Faculty of mathematics and physics Seminar I b Physical Applications of Cellular Automata Author: Boˇ stjan Mavriˇ c Advisor: assist. prof. Marko ˇ Znidariˇ c Co-advisor: assist. dr. Martin Horvat Ljubljana, July 23, 2013 Abstract Cellular automata are models for discrete lattice dynamics. In seminar I present some abstract theory of cellular automata with some interesting applications in several scientific fields. The seminar concludes with description of widely used Boltzmann lattice models.

Upload: others

Post on 25-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

University of LjubljanaFaculty of mathematics and physics

Seminar Ib

Physical Applications of Cellular Automata

Author: Bostjan Mavric

Advisor: assist. prof. Marko Znidaric

Co-advisor: assist. dr. Martin Horvat

Ljubljana, July 23, 2013

Abstract

Cellular automata are models for discrete lattice dynamics. In seminar I present someabstract theory of cellular automata with some interesting applications in several scientificfields. The seminar concludes with description of widely used Boltzmann lattice models.

Page 2: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

Contents

1 Introduction 2

2 History 2

3 Formal description 2

4 Elementary cellular automata 4

5 Some applications of simple cellular automata models 55.1 Ising model dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55.2 Traffic models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65.3 Lattice gas automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

6 Lattice Boltzmann models 9

7 Conclusion 13

1

Page 3: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

1 Introduction

A cellular automaton is a discrete dynamical system defined on a lattice of sites with finitenumber of states, where at each time step every site determines its new state from states of itselfand nearest neighbors. It turns out that simple update rules can result in complex dynamics atlattice scale. By definition the cellular automata (CA) are discrete and homogeneous in spaceand time and local in their interaction. Since many processes in nature are governed by localand homogeneous rules, CA seem to be usable to model such processes.

Besides their use in physics, CA became also mathematical models for massively parallelcomputation. Some update rules can yield computationally universal cellular automata, mean-ing that with suitable initial conditions, such an automaton is capable of performing arbitrarycomputational task. Such models are of interest especially in artificial intelligence community.

2 History

Cellular automata were conceived in 1948 by von Neumann [1], who tried to find a reductionistmodel for biological evolution. He tired to abstract the set of primitive logical interactionsneeded for evolution of complex forms of organization necessary for emergence of life. Hemanaged to construct two-dimensional self-replicating automaton with 29 states per latticesite. Next important contribution in popularization of CA came in 1970 with Game of Life,with rules designed by Conway on purpose in such manner, that the dynamics of automatonwere as hard to predict as possible [2]. Widespread adoption was based on the fact that in thatera the computers became easily accessible and many enthusiasts used them to simulate thedynamics of Game of Life.

The field started to be of interest to physicists after work of Wolfram in 1980’s [3], whoshowed that the behavior of CA is similar to behavior of continuous systems, but in muchsimpler mathematical setup. Since then the CA have been applied to many different problems[1] with work culminating in state-of-art lattice Boltzmann models [2].

Figure 1: Popularity of string “cellular automata” in English literature indexed by Google Books[4], showing the steep rise of term usage in the 1980’s.

3 Formal description

In this section the basic mathematical definitions will be introduced and then used to formulateabstract cellular automata. Such strict definitions are rarely used in practice, but are used to

2

Page 4: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

derive theoretical results. The definitions are taken from the reference [5].In order to specify CA one must supply the following information:

• the regular lattice with dimension d ∈ Z+

• the finite state set S, which contains all the states every single cell can be in

• the neighborhood vector N = (~n1, . . . , ~nm), specifying the neighborhood used to updatethe cell state

• the local update rule f : Sm 7→ S, diving the prescription that determines the updatedstate from states of cells in the neighborhood.

The role of each variable specified above in an abstract automata is described below.For an positive integer d we define d-dimensional lattice called the cellular space Zd. El-

ements of Zd are called cells. Each cell can be in any state from a finite state set S . Aconfiguration c of d-dimensional cellular automata with state set S is a function

c : Zd 7→ S (1)

that assigns a state to each cell. It can be viewed as a snapshot of cell state of each cell at somemoment in time.

A d dimensional neighborhood vector of size m is a tuple

N = ( ~n1, ~n2, . . . , ~nm) (2)

where each ~ni ∈ Zd and ~ni 6= ~nj for each pair where i 6= j. The elements ~ni specify the locationsof neighbors of each cell. Cell ~n has m neighbors at sites ~n+ ~ni for i = 1, 2, . . . ,m.

The update rule of cellular automaton with state set S and size m neighborhood is a function

f : Sm 7→ S (3)

that specifies the new state of each cell f(s1, . . . , sm) based on the states s1, . . . , sm of itsneighbors. All cells use the same rule which is applied at all cells simultaneously. Applicationof update rule causes a global change in configuration c, which is changed to new configurationc′

c′(~n) = f (c (~n+ ~n1) , . . . , c (~n+ ~nm)) . (4)The induced transformation c 7→ c′ is the global transition function of cellular automata. If

we denote the set of all configurations c : Zd 7→ S with SZd , then the global transition functioncan be viewed as map

G : SZd 7→ SZd. (5)

This mapping is main object of study in cellular automata theory. Map G is iterated whichproduces time evolution

c 7→ G(c) 7→ G2(c) 7→ G3(c) 7→ . . . , (6)where time refers to number of applications of G performed. Each application of G takes onetime step, so Gt(c) is configuration at time t with initial condition c.

For simple enough update rules defined on simple neighborhoods some theorems exist thattell us something about long time behavior [5], but such update rules are rarely relevant inphysical applications.

Due to the wide spread use, some attention should be given to two neighborhood relateddefinitions. In literature two neighborhoods are often used. The first is the von Neumannneighborhoods of radius r for which vectors ~ni are of form (0, . . . , 0, ki, 0, . . . , 0), where ki ≤ r.The second is the Moore neighborhood, for which only |~ni| < r must hold. For the two-dimensional case both neighborhoods are shown on the figure 2

3

Page 5: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

(a) von Neumann neighborhood. (b) Moore neighborhood.

Figure 2: The most often used neighborhoods in two dimensional cellular automata.

4 Elementary cellular automata

Elementary CA are one-dimensional automata with two states S = {0, 1} and radius-1 neigh-borhood. Since neighborhood of each cell can be in one of 23 = 8 states only 256 differentupdate rules can be designed. Since some update rules are identical up to renaming the statesand reversing left to right, there are only 88 essentially different update rules.

Those rules were studied by Wolfram [3] in the 1980’s. He introduced convenient namingscheme for labeling rules, which has become standard. Each elementary rule is specified by aneight-bit sequence

f(000) f(001) f(010) f(011) f(100) f(101) f(110) f(111). (7)

This sequence is binary expansion of some integer from interval 0 . . . 255, called the Wolframnumber of the cellular automaton and often labeled by Wn, where n is Wolfram number. Theidentity update rule sequence given by the expansion (7) is 00110011, meaning that the updaterule is labeled by W51. This naming scheme can be easily generalized for d-dimensional CAand neighborhoods of any radius. An example of construction of such rule used for simulationsof traffic flow is presented in the section 5.2.

Based on empirical evidence Wolfram proposed separation of cellular automata in fourclasses:

1. Almost all initial configurations lead to the same uniform stationary configuration (figure3a)

2. Almost all initial configurations lead to a periodically repeating configuration (figure 3b)

3. Almost all initial conditions lead to essentially random looking behavior (figure 3c)

4. Localized structures with complex interactions emerge (figure 3d)

So called space-time diagrams for an example of each class are shown in figure 3. This kindof plots are often used in CA literature. Each line in plot represents the state of the chainat certain time. The initial state of chain is shown in topmost line, with subsequent statestime-ordered below.

Continuous systems can be found with behavior corresponding to the behavior of CA be-longing to first three classes [1]. Homogeneous final states corresponding to class 1 rules areanalogous to system with attracting fixed points. Asymptotically periodic final states found forCA belonging to class 2 have their analogy in limit cycles and seemingly random configurationsof automata belonging to class 3 are analogous to chaotic systems with strange attractors. Au-tomata belonging to fourth class have no obvious analogous continuous system although theyare sometimes described as soliton-like [1]. Certain rules belonging tho this class can be shownto be computationally universal, meaning that there exist initial conditions with time evolution

4

Page 6: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

(a) Class 1 rule W160. (b) Class 2 rule W72.

(c) Class 3 rule W45. (d) Class 4 rule W110.

Figure 3: Space-time diagrams belonging to representatives of each Wolfram class.

that correspond to some calculation being performed on Turing machine. Two famous examplesof such rules are W110 and the legendary Conway’s Game of Life. From computational sciencetheorems it follows that there is no “shortcut” at prediction of the behavior of such CA, meaningthat the most efficient simulation of system is system itself.

5 Some applications of simple cellular automata models

In this section I will present some applications of the approach exposed in previous sections.The models will be presented starting from simple examples that adhere strictly to the idea ofCA, to more involved models in which some requirements are omitted in order to better modelphysical phenomena.

5.1 Ising model dynamics

Simple CA can be used to simulate the quasi-dynamics of Ising model in any number of di-mensions [2]. Each lattice site can be in one of the states σz = ±1. The coupling betweenlattice sites is described by the von Neumann neighborhood. The spin of lattice site flips if localenergy is conserved. In contrast to Metropolis algorithm usually used to simulate Ising modeldynamics, where operations are performed on the canonical ensemble, the cellular automataapproach is used to simulate the microcanonical dynamics of Ising model.

In this kind of dynamics we assumed that the lattice sites in neighborhood remain un-changed, which is not necessarily true if all sites are updated simultaneously. To keep energyof lattice fixed the updating scheme must be changed. The lattice sites should be partitionedamong odd and even sub-lattices, like black and white squares on chessboard. The time stepthen consists of first updating the odd sub-lattice while keeping the even one fixed and thenupdating the even sub-lattice while keeping the odd one fixed as shown in figure 4.

5

Page 7: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

(a) Initial state. (b) Update of “black” sites. (c) Update of “white” sites.

Figure 4: Ising model update rule applied to 4 × 4 lattice. The spin is flipped if in its neigh-borhood the number of spins up is equal to the number of spins down.

In model so defined, some expected physical phenomena can be observed. If energy issufficiently low, the dynamics causes spontaneous magnetization to appear regardless of initialconditions, implying ferromagnetic behavior. However, there are some discrepancies for a sharpeye to see. The dynamics defined in this way is not ergodic. The problem can be easilydemonstrated if one considers evolution of the following one-dimensional chain with periodicboundary conditions

1001 Even sites−−−−−−→ 1100 Odd sites−−−−−−→ 0110 Even sites−−−−−−→ 0011 Odd sites−−−−−−→ 1001. (8)

We can see that the chain revisits initial configuration after two steps. It never evolves tothe state 0111, which also has the same energy, meaning that besides the energy there existsanother conserved quantity, which splits energy surface in independent regions [2]. The factthat the simulated system is not ergodic presents a problem for low-temperature simulations.This problem has been known for quite some time and several fixes have been proposed [6].The problem is usually resolved by allowing flips with small enough change in energy. In suchmanner magnetic energy of system ceases to be well defined and simulation models the canonicalensemble.

5.2 Traffic models

Figure 5: Update rules forone-lane traffic model. Thetop three squares represent thestate of neighborhood and thebottom single square representsthe new state of the middlecell. Traffic moves to the right.The sites occupied with cars areblack.

Traffic on a single lane can be elegantly simulated using CA[2, 7]. The road is represented by one-dimensional array ofcells. With value 1 we mark that a car occupies the cell,while value 0 means that the cell is free. To construct therule we need to assume that the drivers are short-sighted sothat the behavior of the car depends only on state of the cellsimmediately in front and behind the car. If cell in front of a caris free, the car moves forward and in case the cell is occupiedthe car stays in the same position. In case of traffic movingto the right, assumptions from above yield following updaterules shown in figure 5. In notation introduced by Wolfram [3]this rule is written as W184. We assume periodic boundaryconditions.

This kind of dynamics already captures one essential char-acteristic of traffic flow, namely the traffic congestion. Max-imum traffic flow is reached when only every second latticesite is occupied. When traffic density becomes larger, shock waves traveling backward occur,representing often observed stop-and-go behavior [7].

6

Page 8: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

More interesting are results obtained from traffic model in two dimensions. In such casesCA paradigm must be expanded by omitting homogeneity and uniqueness of update rule. Thischange must obviously be applied in order to adequately describe the rules in road junctions.With such change we pass from deterministic to probabilistic CA.

In case of roads with two opposite-direction traffic lanes, intersections are represented bytwo by two cell blocks. Due to the way the update rules on such blocks will be defined we shallcall these blocks rotaries. When a car enters the rotary, it has two options depending on theflag fr. If fr = 0 the car exits the rotary in the direction prescribed by traffic rules. If value ofthe flag is 1, the car stays in rotary and travels counterclockwise for π/2. With such update rulea roundabout with four exits can be simulated. To better simulate the real world behavior, theflag can be randomly set to either value. With such addition the model becomes probabilistic,since the new state is not uniquely determined by the states of the cells in its neighborhood.

Another usual companion to intersections are traffic lights. To simulate their effect on trafficflow using CA another basic postulate must be discarded. Since the traffic flow is regulated bystate of traffic lights, which vary with time, the update rule also becomes time-dependent.

Such simulations were used to demonstrate the advantages of roundabouts in comparisonto traffic light intersections [2, 8]. An example simulation is shown in figure 6. Also someimpressive simulations of rush hour traffic in Geneva were done [2].

Figure 6: Traffic simulation in Manhattan-like city. In figure (a) all intersections are round-abouts whereas in figure (b) intersections are regulated with traffic lights [2]. In case of traffic-light regulated traffic we can see larger density fluctuations, which means lower average trafficflow. In reality this effect is diminished by synchronized traffic lights.

5.3 Lattice gas automata

Lattice gas automata are cellular automata take on modeling of liquid and gas molecular dy-namics. In this seminar I will discuss the HPP model which is straightforward to explain andcontains all essential features of more involved models. The model was proposed by Hardy, dePazzis and Pomeaou in 1973, and is today relevant only for pedagogical reasons.

HPP model is defined on two dimensional square lattice with von Neumann neighborhood.Particles can move along main directions of the lattice defined by vectors ~ci, 0 < i < z,connecting z neighboring lattice sites. These vectors are called lattice velocities. Each latticesite can host one particle with each velocity ~ci.

Time step is split in two parts: collision and motion. The motion part propagates particlesto the neighboring site defined by the direction of vector ~ci as shown in figure 7a. In collisionstep the rule describing the interaction is applied to the particles entering the same site. Therule properties should mimic the microscopic properties of interaction that is being modeled.

7

Page 9: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

In case of computational fluid dynamics (CFD) the interaction should conserve momentum andparticle number. The HPP model keeps all configurations the same, except for two particlesexperiencing head-on collision, in which case the two particles will deflect in perpendiculardirection, as illustrated in figure 7b.

(a) Propagation. (b) Two-particle, head-on collision.

Figure 7: HPP update rules. Each lattice site can host four particles, each one with velocitydenoted by gray arrows. Occupied velocities are denoted as filled black arrows.

To extract density and velocity fields from simulation, some coarse graining must be em-ployed. Let nij ∈ {0, 1} denote occupancy of state with velocity ~cj on lattice site i. The latticeis then divided on large enough non overlapping sub-domains, which typically contain few tensof sites. Coarse grained quantities are then obtained by averaging over those sub-domains.Velocity in sub-domain Sk with Nk lattice sites is given by

~vk = 1Nk

∑i∈Sk,j

ni,j~cj (9)

and density byρk = 1

Nk

∑i∈Sk,j

ni,j . (10)

Sub-domains are equivalent to hydrodynamic volume in hydrodynamics, meaning that theyshould be large enough to have well defined averages and yet small enough to reflect fluctuationsin the simulated domain.

The update rules are constructed so that microscopically the number of particles and mo-mentum are conserved. Conservation of number of particles translates, after coarse graining,to continuity equation for density. It can be shown that using the above definition (10) thecontinuity equation is satisfied [2].

In figure 8 three consecutive frames of simulation of the Hirn experiment with HPP gas areshown. Interesting is transient phenomenon, where we see gas leaking out of container in jet,that remains parallel until it hits the wall. This is because the particles change the direction oftravel only when they scatter on particles traveling in opposite direction. Such scattering canoccur only when some particles have hit the wall and have reversed their direction of travel.Another interesting phenomenon can be observed, which is due to the reversibility of updaterule. Once the equilibrium is reached, if all particle velocities were reversed, all particles wouldgather again in the compartment from which they originated.

Although the conservation of momentum and conservation of particle number are built intothe model, it can be shown [9] that the Navier-Stokes equation for velocity field defined by (9)does not hold. This is due to two reasons. Firstly, some fourth-order tensors that are usedderivation of Navier-Stokes equation from update rule are not isotropic in case of the HPPmodel [9]. This can be fixed if similar dynamics is defined on a hexagonal lattice. Secondly,besides these two invariants, also some other, unwanted, so called spurious invariants exist. Anobvious example being the difference in number of particles traveling parallel and anti-parallelto lattice axis. Although spurious invariants do not affect conservation of particle number and

8

Page 10: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

momentum, they artificially limit the dynamics and do not have a counterpart in real world,which makes them an unwanted artifact of the update rule [9].

Figure 8: Simulation of Hirn’s experiment with HPP gas. Time increases from left to right.Since update rule is invariant to time reversal, opposite frame sequence can be simulated if allvelocities were inverted. [2]

6 Lattice Boltzmann models

Although entire seminar could be written dedicated only to the lattice Boltzmann models (LBmodels), only main idea and its application to CFD will be presented here. The main differencewith lattice gas models is that the coarse graining is performed before dynamics simulation. Inthis manner we achieve smoother solutions on lower number of cells than with lattice gas models.The update rules are defined on real-valued occupation probabilities fi for sites in each cell,which can be thought of as sub-domain averaged occupation numbers ni from previous section.With this approach we assume that multi-particle correlations are negligible, and dynamics isdefined only by two-particle collisions.

The idea follows from Boltzmann equation for one-particle distribution function f(~x,~v, t)

∂f

∂t+ ~v∇xf = Q, (11)

where Q stands for collision integral, that can be in general calculated from collision process[9, 10]. Although exact expressions can be found for lattice gas dynamics [7], in real worldsimulations the collisions in which more than two particles participate are rarely accounted for[10]. Also, expressions for collision terms resulting from exact description of dynamics are rarelyused in simulations due to them being difficult to numerically evaluate.

The exact dynamics of modeled system can be somewhat neglected if relaxation-time ap-proximation of Boltzmann equation is used. In this case the collision integral is replaced bya term proportional to the difference between equilibrium distribution f0, containing relevantdynamics information, and distribution at time t

∂f

∂t+ ~v∇xf = −1

τ(f − f0), (12)

where 1/τ is the collision frequency. LB models using this approximation are called LB-BGKmodels (BGK standing for Bhatnagar, Gross and Krook who proposed the relaxation timeapproximation). In real-life applications usually more than one relaxation time is used [9]. Sincecellular automata are defined on discrete lattice sites and for discrete velocities, the equation(12) must be discretized giving

fi(~x+ ~ci∆t, t+ ∆t)− fi(x, t) = −1τ

(fi(x, t)− f0

i (x, r)), (13)

where index i goes over all velocity vectors ~ci.

9

Page 11: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

~c1

~c2

~c5

~c3~c4

~c6 ~c7 ~c8

Figure 9: Velocity vectors ~ci

for D2Q9 LB model. The cir-cle in the center of the squarerepresents velocity ~c0 = 0. Wecan see that velocities with two(three if we count ~c0) differ-ent magnitudes are used, whichmust be weighed differently inorder to restore isotropy.

With our discretization scheme at hand, some commentson numerical properties are to be made. Such a scheme islinearly stable only if 0 < 1/τ < 2. The value of τ at the sametime also determines viscosity ν ∼ (τ − 1/2). The stabilitycondition for discretization scheme determines the upper valueof viscosity, while linear analysis predicts the scheme to bestable even in case ν = 0. Although it seems that even highMach-number flow simulations are possible, they are unstabledue to discrete lattice [9]. It can also be shown that suchscheme is of first order in time and of second order in spacediscretization [9].

All that remains to be done is to determine equilibriumvalues f0

i . For this to be done, the lattice and the velocities ~ci

are to be defined. In this seminar I will consider square latticewith nine velocity values. In literature LB models are labeledwith names of form DnQm, where n gives lattice dimensionand m gives the number of velocities per site. Our model canbe labeled as D2Q9.

Possible velocities at each site are shown in figure 9. Themodel is defined on Moore neighborhood, with four veloci-ties pointing parallel and anti-parallel to lattice axes and fourvelocities directed along diagonals. The ninth velocity repre-sents particle at rest. Ability to describe particles at rest results in Galllilean invariance ofNavier-Stokes equation resulting from model dynamics [9]. Because modulus of velocities di-rected along diagonals is larger than modulus of velocities along lattice axes some weight Wi

must be assigned to each velocity in order to restore model isotropy [7]. These weights willbe incorporated into equilibrium distribution and therefore definitions of density and densitycurrent become

ρ(~x, t) =m∑

i=1fi(~x, t) (14)

ρ(~x, t)~u(~x, t) =m∑

i=1fi(~x, t)~ci. (15)

Values of weights Wi are determined from an additional condition that should hold for fluid “atrest” ( meaning that ~j = 0 all over the system). They are chosen to be of Maxwell type, meaningthat the lattice velocity moments up to fourth order shall be identical to the respective velocitymoments of the Maxwell distribution. After solving the resulting system of linear equations weobtain the weights values, that are given in table 1.

c2i number of sites Wi/ρo

W0 0 1 49

W1 1 4 19

W2 2 4 136

Table 1: Values for weights Wi for D2Q9 LB model as given in [9].

The equilibrium distribution f0i is determined by maximization of entropy at each lattice

site. We use entropy defined by [9]

S(ρ,~j) = −∑

i

f0i (ρ,~j) log f

0i (ρ,~j)Wi

. (16)

10

Page 12: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

Coefficient f0i /Wi is used in argument of the logarithm, so that the resulting equilibrium distri-

butions are of form f0i = Wig(ρ,~j). Entropy must be maximal under two constraints, namely the

conservation of particle number and the conservation of momentum. With use of the Lagrangemultipliers A and B we arrive at the following functional

L(f0i ) = −

m∑i

f0i (ρ,~j) log f

0i (ρ,~j)Wi

+ ~B(ρ,~j)m∑

i=1f0

i (ρ,~j)~ci +A(ρ,~j)m∑

i=1f0

i (ρ,~j). (17)

First term represents the contribution of entropy, the second term represents the conservationof momentum and the third term demands the conservation of particle number. The functionalyeilds the following system of differential equations

∀i : ∂L

∂f0i

= −(

ln f0i

Wi+ 1

)+ ~B(ρ,~j)~ci +A(ρ,~j) = 0 (18)

which have solutions of the form

f0i (ρ,~j) = Wi exp

(C(ρ,~j) + ~B(ρ,~j)~ci

), (19)

where the coefficients C(ρ,~j) = A(ρ,~j)− 1 and ~B(ρ,~j) are yet to be determined. The solutionis then written as a series up to second order in ~j. Due to the lattice symmetries it is sufficientto use

~B(ρ,~j)=B1(ρ)~j +O(~j3). (20)C(ρ,~j)=C0(ρ) + C2(ρ)~j2 +O(~j4). (21)

Demanding consistency with equations (14) and (15) we arrive at equilibrium distribution [9]

f0i (ρ,~j) = Wi

ρ0

(ρ+ m

kBT~ci ·~j + m

2ρkBT

[m

kBT

(~ci ·~j

)2+ j2

]). (22)

Since the satisfies continuity equation for ρ and momentum were already demanded by equation(17) and since it can be shown [9] that for ~u = ~j/ρ Navier-Stokes equation holds, all theinformation necessary to perform CFD simulations is obtained.

The computational algorithm for LB methods is then as follows.

1. Collision step: At each cell update densities as defined by equation (13)

2. Streaming step: Propagate updated densities to the sites defined by the velocities ~ci:fi(~x+ ~ci∆t, t+ ∆t) = fi(~x, t+ ∆t).

Let us try and determine memory requirements for such algorithm. For each step we mustkeep in memory nine old and nine new floating point numbers fi for each site, resulting in2 · 9Ld memory slots where L is number of cells along one lattice direction and d is latticedimension. Due to the locality of the update rule not all old distributions fi are needed in thecalculation, which enables us to get rid of factor 2, arriving at O(9Ld) memory requirement.The same order we get also for time complexity, since at each time-step every lattice site must beupdated. The gains are obvious if we compare complexity to solving the system of Ld equationsfor Ld unknowns in case of finite elements method in traditional CDF, which results in timecomplexity of O(L3d) if Cholesky decomposition is used.

LB methods found their use for simulations of multi-phase and multi-component flows, whereother CFD methods have problems with the description of interfaces between fluids. They arealso very useful in simulating other interface phenomena e.g. wetting of solid surface, bubble

11

Page 13: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

dynamics, interface instabilities etc.. The method still has some difficulties with simulation ofhigh-Mach number flows and hydrodynamics coupled with heat transport.

Another deficiency is the fact that the number of particles in our simulation is fixed, meaningthat the simulations becomes unstable as soon as the density fluctuations become too large [11].Also problems can occur whenever some approximation used in the derivation of the schemedoes not hold. Problems can arise also if the densities fi become negative, since such valueshave no physical meaning. Such situation can occur in case of simulations of dilute gases, sincein that case the equilibrium value f0

i is ill-defined.An example demonstrating the advantages of lattice Boltzmann models is the simulation of

flow around submerged pipe [2] shown in figure 10. Of practical importance is the simulationof scour formation under submerged pipe of an oil pipeline. The scour forms because vortexescaused by pipe start to erode underlying seabed. If we come up with an reasonable modelto simulate the erosion and deposition of seabed material, the flexibility of lattice Boltzmannmodels enables us to perform the simulation. The results presented in figure 11 show goodagreement with laboratory experiments.

Figure 10: Lattice Boltzmann simulation of flow around submerged pipe. In top picture somevelocity lines are drawn, while in bottom picture profiles of x-component of the velocity fieldare plotted for some sites along x-axis.

Figure 11: Lattice Boltzmann simulation of scour forming under submerged pipe compared tolaboratory experiments. Experimental results are denoted by black and white circles, whileprofiles acquired with LB simulation at different times are plotted with lines.

12

Page 14: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

While with simple approaches presented in this seminar only simulations of flows withReynolds numbers up to few thousand are possible [12], higher Reynolds numbers can beachieved using more sophisticated methods that typically consist of multi-grid approaches com-bined with multi-relaxation time approximations. In this manner Reynolds number can reachthe order of 106 [13].

7 Conclusion

In conclusion, cellular automata models are a relatively new technique which has yet to findits place in computational physics. Main advantage of the cellular automata approach is thefact that the simulations can be efficiently run on parallel hardware, which is an importantfeature considering today’s highly parallel supercomputers. The future seems especially brightfor lattice Boltzmann models, since they are capable of simulations of non-homogeneous fluidsin complex geometries, a setting often dealt with in soft matter physics.

13

Page 15: Physical Applications of Cellular Automatamafija.fmf.uni-lj.si/seminar/files/2012_2013/cellautom.pdf · Cellular automata are models for discrete lattice dynamics. In seminar I present

References

[1] A. Ilachinski, Cellular automata: a discrete universe. World Scientific Publishing Company,Incorporated, 2001.

[2] B. Chopard, P. Luthi, and A. Masselot, “Cellular Automata and Lattice Boltzmann Tech-niques: An Approach to Model and Simulate Complex Systems,” in Advances in Physics,p. 98, 1998.

[3] S. Wolfram, “Statistical mechanics of cellular automata,” Rev. Mod. Phys., vol. 55, pp. 601–644, Jul 1983.

[4] “Google Ngram Viewer.” http://books.google.com/ngrams/graph?content=cellular+automata.Accessed 1. 5. 2013.

[5] J. Kari, Cellular Automata. University of Turku, 2013.

[6] H. Ottavi and O. Parodi, “Simulation of the Ising Model by Cellular Automata,” EPL(Europhysics Letters), vol. 8, no. 8, p. 741, 1989.

[7] B. Chopard, P. O. Luthi, and P.-A. Queloz, “Cellular automata model of car traffic in atwo-dimensional street network,” Journal of Physics A: Mathematical and General, vol. 29,no. 10, p. 2325, 1996.

[8] A. Adamatzky, R. Alonso-Sanz, and A. Lawniczak, Automata-2008: Theory and Applica-tions of Cellular Automata. Lightning Source Incorporated, 2008.

[9] D. Wolf-Gladrow, Lattice-Gas Cellular Automata and Lattice Boltzmann Models: An In-troduction. No. 1725 in Lattice-gas Cellular Automata and Lattice Boltzmann Models: AnIntroduction, Springer, 2000.

[10] F. Schwabl, Statistical Mechanics. Advanced Texts in Physics, Springer London, Limited,2002.

[11] S. Succi, M. Sbragaglia, and S. Ubertini, “Lattice Boltzmann Method,” vol. 5, no. 5,p. 9507, 2010.

[12] I. Mele, “Lattice Boltzmann Method,” 2013. Seminar.

[13] C. Bartlett, H. Chen, I. Staroselsky, J. Wanderer, and V. Yakhot, “Lattice Boltzmanntwo-equation model for turbulence simulations: High-Reynolds number flow past circularcylinder,” International Journal of Heat and Fluid Flow, vol. 42, no. 0, pp. 1–9, 2013.

14