computer modeling and simulation of natural phenomena
play

Computer modeling and simulation of natural phenomena Bastien - PowerPoint PPT Presentation

Computer modeling and simulation of natural phenomena Bastien Chopard Computer Science Department, University of Geneva, Switzerland Lugano, Oct 18, 2016 Examples of models and methods I N-body systems, molecular dynamics I Mathematical


  1. Forest fire (1) a burning tree becomes an empty site ; (2) a green tree becomes a burning tree if at least one of its nearest neighbors is burning ; (3) at an empty site, a tree grows with probability p ; (4) A tree without a burning nearest neighbor becomes a burning tree during one time step with probability f (lightning).

  2. Complex systems Rule of the Game of Life : I Birth if exactly 3 I Square lattice, 8 living neighbors neighbors I Death if less than 2 I Cells are dead or alive or more than 3 (0/1) neighbors t t+10 t+20

  3. Complex Behavior in the game of life Collective behaviors develop (beyond the local rule) “Gliders” (organized structures of cell) can emerge and can move collectively. t=0 t=1 t=2 t=3 t=4

  4. Complex Behavior in the game of life A glider gun (image : Internet) I There are more complex structures with more complex behavior : a zoology of organisms. I The game of life is a Universal computer

  5. Langton’s ant This is an hypothetical animal moving on a 2D lattice, acoring to simple rules, which depend on the color of the cell on which the ant sits.

  6. The rules

  7. Some evolution steps

  8. Some evolution steps

  9. Some evolution steps

  10. Some evolution steps

  11. Some evolution steps

  12. Some evolution steps

  13. Some evolution steps

  14. Some evolution steps

  15. Some evolution steps

  16. Where does the ant go in the long run I Animation...

  17. Where does the ant go in the long run t=6900 t=10431 t=12000 I

  18. The ants always escape to infinity for any initial coloration of the cells

  19. What about many ants ? I Adapt the “change of I The trajectory can be color” rule bounded or not I Cooperative and I Past/futur symmetry destructive e ff ects explains periodic motion t=2600 t=4900 t=8564

  20. Impact on the scientific methodolgy I The laws are perfectly known I But we cannot predict the details of the movements (when does a highway appears) I Microscopic knolwdge is not enough to predict the macroscopic behavior I Then, the only solution is the observe the behavior I The only information we have on the trajectory are the reflect of the symmetries of the rule

  21. Prediction means to compute faster than reality t=0 t=31 t=43 t=75 t=248 t=292 t=357 t=358 t=359 t=360 t=511 t=571

  22. Prediction means to compute faster than reality (a) (b) (c)

  23. Wolfram’s rules 256 one-dimensional, 3 neighbors Cellular Automata : (a) (b) (c) (d) Coombs, Stephen 2009, The Geometry and Pigmentation of Seashells

  24. Wolfram’s rules : complexity classes (a) (b) (c) (d) I Class I Reaches a fixed point I Class II Reaches a limit cycle I Class III self-similar, chaotic attractor I Class IV unpredicable persistent structures, irreducible, universal computer Note : it is undecidable whether a rule belongs or not to a given class.

  25. Wolfram’s rules : 1D, 5 neighbors

  26. Other simple rules I time-tunnel Sum ( t ) = C ( t ) + N ( t ) + S ( t ) + E ( t ) + W ( t ) ⇢ C ( t � 1) if Sum ( t ) 2 { 0 , 5 } C ( t + 1) = 1 � C ( t � 1) if Sum ( t ) 2 { 1 , 2 , 3 , 4 } I random C ( t + 1) = ( S ( t ) . and . E ( t )) . xor . W ( t ) . xor . N ( t ) . xor . C ( t ) I string : a one-dimensional spring-bead system

  27. Tra ffi c Models A vehicle can move only when the downstream cell is free. time t time t+1

  28. Flow diagram The car density at time t on a road segment of length L is defined as ρ ( t ) = N ( t ) L where N is the no of cars along L The average velocity < v > at time t on this segment is defined as < v > = M ( t ) N ( t ) where M ( t ) is the number of car moving at time t The tra ffi c flow j is defined as j = ρ < v >

  29. Flow diagram of rule 184 1 Traffic flow 0 0 1 car density

  30. Tra ffi c in a Manhattan-like city f g (a) (b) d c (a) (b) a b h 1 0.35 e free rotary Traffic flow <v> road spacing=256 flip-flop road spacing=32 free rotary road spacing=4 traffic-light 0 0 0 1 0 1 car density car density

  31. Case of the city of Geneva Origin Destination I 1066 junctions 2 I 3145 road 4 3 3 segments 1 4 2 I 560886 road cells 1 I 85055 cars

  32. Travel time during the rush hour Trip 2 35 30 Travel time [minutes] 25 20 Average travel time 15 insertion probability 10 p2 0 5 10 15 20 25 30 35 40 45 Departure time [minutes] Trip 3 35 p1 30 time Travel time [minutes] 25 0 I I I 2 3 3 20 Average travel time 15 10 0 5 10 15 20 25 30 35 40 45 Departure time [minutes]

  33. Lattice gases Fully discrete molecular dynamics

  34. Example : HPP model collision rules (a) I HPP : Hardy, Pomeau, de Pazzis, 1971 : kinetic theory of point particles on the D2Q4 lattice (b) I FHP : Frisch, Hasslacher and Pomeau, 1986 : first LGA reproducing a (almost) correct (c) hydrodynamic behavior (Navier-Stokes eq.) time t time t+1 Exact mass and momentum conservation : that is what really matters for a fluid ! ! !

  35. FHP model p=1/2 p=1/2 Stochastic rule with Conservation of mass and momentum.

  36. Flow past an obstacle (FHP)

  37. Why can such a simple model work ? I At a macroscopic scale, the detail of the interaction does not matter so much I Only conservation laws and symmetries are important I We can invent our own fluid, especially one adapted to computer simulation

  38. Demos I Pressure/density wave : aniotropy I Reversibility I Spurious invariants : momentum along each line and column, checkerboard invariant I Di ff usion, DLA, reaction-di ff usion models I Snow transport by wind

  39. Lattice Boltzmann (LB) models I Lattice Gases implement an exact dynamics I But they require large simulations, statistical averages and have little freedom to adjust problem parameters I In the early 1990s, the discrete Boltzmann equation describing the average dynamics of a lattice Gas was re-interpreted (with improvements) as a flow solver I ! Lattice Boltzmann models

  40. The lattice Boltzmann (LB) method : the historical way I Historically, LB was born from Lattice Gases , discrete kinetic models of colliding particles I Now the LB method is often derived by a discretization procedure (in velocity, space and time variables) of the standard Boltzmann equation ∂ t f ( v , r , t ) + v · ∂ r f ( v , r , t ) = Ω ( f ) I where f ( v , r , t ) is the density distribution of particles at location r , time t , with velocity v .

  41. The Lattice Boltzmann scheme : definitions v 3 v 4 v 2 v 5 v 1 v 6 v 7 v 8 I Possible particle velocities : v i , i = 0 , 1 , ..., q � 1 I Lattice spacing : ∆ x , time step : ∆ t , | v i | = ∆ x / ∆ t .

  42. The Lattice Boltzmann scheme : definitions Collision Propagation I Possible particle velocities : v i , i = 0 , 1 , ..., q � 1 I Lattice spacing : ∆ x , time step : ∆ t , | v i | = ∆ x / ∆ t . I f in i ( r , t ) is the density of particle entering site r with velocity v i , at time t .

  43. The Lattice Boltzmann scheme : definitions Collision Propagation I Possible particle velocities : v i , i = 0 , 1 , ..., q � 1 I Lattice spacing : ∆ x , time step : ∆ t , | v i | = ∆ x / ∆ t . I f in i ( r , t ) is the density of particle entering site r with velocity v i , at time t . I Density : ρ ( r , t ) = P i f in ; i

  44. The Lattice Boltzmann scheme : definitions Collision Propagation I Possible particle velocities : v i , i = 0 , 1 , ..., q � 1 I Lattice spacing : ∆ x , time step : ∆ t , | v i | = ∆ x / ∆ t . I f in i ( r , t ) is the density of particle entering site r with velocity v i , at time t . I Density : ρ ( r , t ) = P i f in ; i i f in I Velocity : ρ u = P i v i

  45. The Lattice Boltzmann scheme : definitions Collision Propagation I Possible particle velocities : v i , i = 0 , 1 , ..., q � 1 I Lattice spacing : ∆ x , time step : ∆ t , | v i | = ∆ x / ∆ t . I f in i ( r , t ) is the density of particle entering site r with velocity v i , at time t . I Density : ρ ( r , t ) = P i f in ; i i f in I Velocity : ρ u = P i v i I Momentum tensor Π ↵� = P i f in i ( r , t ) v i ↵ v i �

  46. The Lattice Boltzmann scheme : dynamics Collision Propagation I Collision : f out = f in + Ω i ( f ) i i I Propagation : f in i ( r + ∆ t v i , t + ∆ t ) = f out ( r , t ) i Collision and Propagation : f i ( r + ∆ t v i , t + τ ) = f i ( r , t ) + Ω i ( f ) (1) where f = f in

  47. The single relaxation time LB scheme (BGK) The collision term Ω i is a relaxation towards a prescribed local equilibrium distribution Ω i ( f ) = 1 τ ( f eq ( ρ , u ) � f i ) (2) i where = ρ w i (1 + v i · u + 1 f eq Q i ↵� u ↵ u � ) (3) i c 2 c 4 s s contains the desired physics (here hydrodynamics) and Q i ↵� is Q i ↵� = v i ↵ v i � � c 2 s δ ↵� τ is a constant called the relaxation time

  48. Choice of the v i and lattice weight w i The “microscopic” velocities v i must be such that there exists constants w i and c 2 s so that : X = 1 w i i X w i v i = 0 i X c 2 w i v i ↵ v i � = s δ ↵� i X w i v i ↵ v i � v i � = 0 i X c 4 w i v i ↵ v i � v i � v i � = s ( δ ↵� δ �� + δ ↵� δ �� + δ ↵� δ �� ) i X = 0 (4) w i v i ↵ v i � v i � v i � v i ✏ i

  49. Lattice Geometries D d Q q d is the space dimension and q the number of microscopic velocities I D2Q9 : 2D, square lattice with diagonals and rest particles. I D3Q19 : 3D, with rest particles have enough symmetries. v 3 v 4 v 2 v 5 v 1 v 6 v 7 v 8 w 0 = 4 / 9 w 1 = w 3 = w 5 = w 7 = 1 / 9 w 2 = w 4 = w 6 = w 8 = 1 / 36

  50. Continuous limit Up to order O ( ∆ x 2 ) and O ( ∆ t 2 ), and provied that Ma << 1, the LB eq. f i ( r + ∆ t v i , t + τ ) = f i ( r , t ) + 1 τ ( f eq � f i ) (5) i is equivalent to Navier-Stokes equations ⇢ ∂ t ρ + ∂ ↵ ρ u ↵ = 0 (6) ∂ t u + ( u · r ) u = � 1 ⇢ r p + ν r 2 u for ρ = P i f i and ρ u = P i f i u .

  51. Properties : Viscosity : ν = c 2 s ∆ t ( τ � 1 / 2) Pressure : p = ρ c 2 s Thus, LB-fluids are compressible

  52. Relations between the f i ’s and the hydrodynamic quantites Hydrodynamic quantities f i from the hydrodynamic quantities from the f i I f = f eq + f neq I ρ = P i f i I f eq = ρ w i (1 + v i · u 1 s + s Q i ↵� u ↵ u � ) I ρ u = P i f i v i i c 2 2 c 4 I f neq = � ∆ t τ w i I Π ↵� = P i v i ↵ v i � f i s Q i ↵� ρ S ↵� i c 2 where S ↵� = (1 / 2)( ∂ ↵ u � + ∂ � u ↵ ) and Q i ↵� = v i ↵ v i � � c 2 s δ ↵�

  53. Boundary conditions (a) (b) (c) (a) Specular reflection, (b) bounce back condition and (c) trapping wall condition The Bounce Back rule implements a no-slip condition. It is the most common choice : f out = f in i − i

  54. Boundary conditions : beyond bounce-back f 7 f 8 f 6 f 1 f 5 f 2 f 4 f 3 Compute the missing population so as to have the desired physical properties

  55. Pros and cons on the LB method + Closer to physics than to - Recent methods mathematics - No e ffi cient unstructured + Quite flexible to new grids developments, intuitive, - Intrinsically a time multiphysics dependent solver + Complicated geometries, - Not always so easy cartesian grids - Still some work to have a + no need to solve a Poisson fully consistent equation thermo-hydrodynamical + Parallelization model.

  56. More advantages... I Streaming is exact I Non-linearity is local I Numerical viscosity is negative I Extended range of validity for larger Knudsen numbers I Palabos open source LB software (http ://www.palabos.org)

  57. Wave equation f 2 v 2 f 0 v 3 v 1 f 1 f 3 f 1 v 4 f 4 (a) (b) f i ( r + τ v i , t + τ ) = f i ( r , t ) + 2( f eq � f i ) (7) i f eq = a ρ + b u · v i i Conservation of ρ , its current u and time reversibility. Note that P f 2 i is also conserved. This is equivalent to ∂ 2 t ρ + c 2 r 2 ρ = 0

  58. CA for Reaction-Di ff usion processes C A B A B C ν =1 ν =0 p 0 p p 2 p Di ff usion Reaction

  59. LB Reaction-Di ff usion � f i ) + ∆ t f i ( r + ∆ t v i , t + τ ) = f i ( r , t ) + ω ( f eq 2 d R (8) i with R the reaction term (for instance R = � k ρ 2 ). and f eq = 1 2 d ρ This is equivalent to ∂ t ρ = D r 2 ρ + R

  60. Demos http ://cui.unige.ch/ ⇠ chopard/CA/Animation/root.html

  61. Palabos : an Open-Source solver (UNIGE) Multiphysics, same code from laptop to massively parallel computer : (www.palabos.org) Droplet Pumps Washing machines Energy converter Air conditioning sedimentation

  62. Simulation of river Rhone in Geneva

Recommend


More recommend