• Aucun résultat trouvé

The Fluid Model

2.1 Lattice gas: a short introduction

2.1.1 Cellular automata

Cellular automata (CA) are fictitious physical system, where [Chopard et al. 1998a]:

• space domain is a regular lattice (Γ); each lattice noderis linked toq neigh-bors {r+ci}i=0,q−1;

• the cell states N(r, t) belong to a finite set of values;

1“Everything should be made as simple as possible but not simpler” A. Einstein, cited in [ChopardetDroz 1998]

• evolution is synchronous, discrete in time and update depends only on the local state and those of the nearest neigbors following a rule ℜ:

N(r, t+ 1) =ℜ(N(r, t), N(r+c0, t). . . N(r+cq−1, t)) (2.1) The game of life

This famous cellular automata was proposed by the mathematician John Conway in the seventies [Gardner 1970]: on a 2D lattice, where each node is linked to eight neighbors (north, north-east, east, south-east, south, south-west, west and north-west), a cell can be either dead (0) or alive (1):

• a dead cell surrounded by exactly 3 alive cells regains life,

• a living cell surrounded by less than two cells alive cells dies of isolation,

• a living cell surrounded by more than three cells alive neighbors dies of overcrowdness.

LetσN(r, t) (abbreviated σN) be the sum of the neighboring alive cells of site r at timet:

σN(r, t) = X3

i=0

N(r+ci, t) The evolution rule can therefore be written as:

N(r, t+ 1) =

Even if this rules can be seen as a toy model at first glance, a closer look shows how this CA can exhibit complex behaviors, and even be able to reproduce any computational process. However, although it is very rich from the theoritical point of view, it is far from representing a real animal “game of life process”.

We will focus in the following paragraphs on CA designed to model a fluid, namely the lattice gas automata (LGA).

HPP

The earliest LGA is the HPP model (Hardy, Pomeau and de Pazzis [Hardy et al. 1973]), where a very simplified molecular dynamics is described: Boolean particles move synchronously on a square lattice (four neighbors); only one particle can travel at once on a lattice link (exclusion principle); a collision takes place when more than one particle enter a site at the same time step, accordingly to the rule described in figure 2.1.

c2

c1

time t time t+1 c3

c0

Figure 2.1: HPP collision. Only when two particles enter a site with opposite directions, they are deflected perpendiculary; all the other configurations remain identical.

From a more practical point of view, four vectors {ci}i=0,1,2,3 describe the lattice Γ. The local state of a cell consists of 4 Boolean values {Fi(r, t)}i=0,1,2,3 where Fi(r, t) = 0/1 indicates the absence/presence of a particle travelling in direction ci on site r, at time t.

If only one particle, with velocityci, enters the site at time t, it is streamed to r+ci at timet+ 1; if two particles enter a site with opposite velocities, they collide and are deflected in the perpendicular direction; when more particles enter the site, the situation remains unchanged and particles are only streamed. This collision rule can be written as:

Fi(r+ci, t+ 1) = Fi(r, t)

− Fi(r, t)Fi+2(r, t)(1−Fi+1(r, t))(1−Fi+3(r, t))

+ Fi+1(r, t)Fi+3(r, t)(1−Fi(r, t))(1−Fi+2(r, t)) (2.2) where all indexes are taken modulo 4, the first term is for the statu quo, the second one when only one particle in direction i and another in the opposite direction (i+ 2) enter the site, thus Fi vanishes, and the last one when only two particles are entering the site in direction perpendicular to ci (i+ 1 and i+ 3), thus Fi becomes 1.

Basic definitions

It is therefore very natural to define the number of particle:

ρ(r, t) =

qf−1

X

i=0

Fi(r, t) (2.3)

1/2

time t+1 1/2

time t

Figure 2.2: FHP collision, on an hexagonal lattice. When only two particles enter a site with opposite directions, they are deflected with a probability 1/2 of 60 or

−60 degres. When three particles enter the site in a way that the momentum is zero, their velocity are inversed.

and the local momentum,i.e. the number of particles multiplied by the velocity:

J(r, t) =

qf−1

X

i=0

Fi(r, t)ci =ρ(r, t)u(r, t) (2.4) where qf is the number of neighbors for the fluid cellular automata. The usual density and momentum are usually obtained averaging these terms.

FHP, FHP-III

Although the HPP formulation is elegant, it cannot be considered as a fluid model (i.e. satisfying the Navier-Stokes equations), because of some intrinsic anisotropy of the lattice preventing a coherent definition of the momentum tensor. However, an hexagonal lattice (qf = 6) can satisfy this isotropy assumption, and collision rules were imagined by Frisch, Hasslacher and Pomeau (FHP) [Frischet al. 1986]

(see figure 2.2).

time t time t+1

Figure 2.3: FHP-III collisions involving a rest particle (the others are the same as for the FHP model). Density and momentum are conserved, but not the energy.

However, it is conserved on average over the collisions.

collision streaming

time t time t+1

solid

Figure 2.4: FHP evolution step, decomposed in two stages: a) collision, b) infor-mation streaming to the neighboring cells.

To get richer collisions, a particle at rest is added in the FHP-III set of rules.

In this case, qf is considered to be 7, and one of the indexes is used for the rest particles. Later, even multi-speed models have been proposed in the litterature [Doolen 1990].

One can notice that, for each rule, mass and momentum, as defined in equa-tions (2.3) and (2.4), are conserved. This, together with some lattice isotropy assumption, ensures that the system satisfies the Navier Stokes equations, up to some non Galilean invariance correction term [Chopard et al. 1998a, Qian et al. 1996a];

the latter problem will vanish when using a Lattice Boltzmann model, i.e. in the practical model used in the framework of this thesis.

However, in these models, viscosity depends on the collision rule and the average density of particles. Thus it exists only in a restrictive range and cannot be tuned to reach interessant values (in the aim of modelling turbulent situations).

Solid as boundary conditions

As the fluid is described by CA particles, evolving synchronously on a regular lattice, the interaction with solid can be handled in a very efficient and elegant way: instead of interacting normally according to the rules described above, a particle entering a solid site simply bounce back (inversing its velocity).

To be or not to be solid is considered as a new Boolean variable, one more in the description of the local cell state, and the bounce back condition can be incorporated as is in the CA set of rules.

Implementation

The cellular automata implementation will be more thoroughly discussed in chapter 4, however a CA evolution step can be summarized as a parallel (syn-chronously on all the lattice sites) two stage mechanism:

1. collision computations, based on the local information; as the local situation can be described byqf bits, alookup tablewith 2qf entries returning aqf bit

integer can store all the possible evolutions; this lookup table can computed at once and the collision step becomes only a memory load rather than a expression computation;

2. streaming of information to the neighboring cells.

Such an evolution step, for the FHP rule, is displayed in figure 2.4.