1
Simulation of floating bodies with
lattice Boltzmann
bySimon Bogner,
17.11.2011,
Lehrstuhl für Systemsimulation, Friedrich-Alexander Universität Erlangen
2
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
3
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
4
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Kinetic Origin of Lattice Boltzmann
■ Navier-Stokes equation for fluids– Continuum assumption: Macroscopic Variables are defined at every
point in space inside the medium– Behavior of the flow is described as equation of the macroscopic
variables
■ Boltzmann:– Microscopic assumption: Fluid is made up of particles (molecules)– Particles of mass m, defined by position and velocity.– Statistical mechanics: Description of kinetic behavior by means of
probabilistic methods (Large number of particles!)– Kinetic particle distribution function– is the number of particles within the volume element
around and velocity within around .x d v vd x
5
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Boltzmann Equation
■ Boltzmann: Macroscopic variables are moments of the statistical distribution function
■ Boltzmann Equation:
– LHS: transport term– RHS: collision term (hidden)
6
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
BGK Collision Model
■ Collision term:– Describes the changes in the particle motion due to collisions– Boltzmann: Time-independent two-body collisions (“Stosszahl
Ansatz”)■ Bhatnagar Gross Krook – Model
– H-Theorem: Thermodynamic systems strive towards a state of Equilibrium (Entropic behavior)
– Equilibrium state solution given by a Maxwell-Boltzmann distribution
(distribution of particle velocities in thermodynamic equilibrium)
■ BGK - Equation
– Collision term: Linear BGK - relaxation towards equilibrium
7
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
From the BGK Equation to Lattice Boltzmann
■ BGK Equation
– is function of
■ Discretization of velocity space– Restriction of particle velocities to finite set .– Set must span a discrete lattice (~grid) of cells.– Lattice velocities “connect” the cells.– Discrete set of particle distributions functions at each cell– D3Q19 – Model shown in figure
{c⃗i}
f ( x⃗ , v⃗ )
{ f i( x⃗ , t)}
8
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Lattice Boltzmann Scheme
■ Discretized equilibrium function
– Discrete approximation of around (low Mach number expansion) .
– is the lattice speed of sound (model dependent constant).
(… Skip lots of lots of mathematics … )Skip lots of lots of mathematics … )
u⃗=0f eq
c s
■ Stream and Collide Algorithm– Streaming:
– Collision:
– Dimensionless lattice relaxation time is related to the viscosity– Lattice Boltzmann scheme
τ
9
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Moments of the Lattice Boltzmann Model
■ Local macroscopic quantities are moments of the discrete particle distribution functions (PDFs):
■ Approximates Navier-Stokes in the incompressible limit.(See Hänel, D. Molekulare Gasdynamik; Succi, S. Lattice Boltzmann Equation for Fluid Dynamics and Beyond)
■ Mesoscopic Method
10
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
11
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Three - Phase Flow
■ Liquid-Gas-Solid Simulation– Free Surface Flows
● Everyday life: water & air● 2 immiscible fluids (a liquid and a gas)● Examples: river, bubbles & foam,
– Particulate Flows (Rigid Bodies)● Suspensions (e.g., paint, blood, colloids)
– Rigid Bodies in Free Surface Flow● Non-deformable Newtonian body physics● Examples: Ship, Weizenbier
Pictures taken from “Physics of Continuous Matters” (Benny Lautrup), and Wikipedia.
12
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas-Solid Lattice Boltzmann
■ Boltzmann method used to simulate the liquid phase■ Different cell types control the system behavior■ Figure: floating box in discrete lattice
– Gas, liquid, and solid cells represent the three phases– Interface cells model the free surface boundary– Computation uses a flag field to store the cell type of each cell– Flag field is updated dynamically
13
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas-Solid Lattice Boltzmann
■ Boltzmann method used for the liquid phase■ Interaction with other phases via boundary conditions■ Three phase transitions:
– Liquid-gas boundary (free surface)– Liquid-solid boundary (obstacle walls)– Solid-gas (no boundary for LBM scheme!)
14
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas-Solid Lattice Boltzmann
■ Boltzmann method used for the liquid phase■ Interaction with other phases via boundary conditions■ Three phase transitions:
– Liquid-gas boundary (free surface)– Liquid-solid boundary (obstacle walls)– Solid-gas (no boundary for LBM scheme!)
15
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas-Solid Lattice Boltzmann
■ Boltzmann method used for the liquid phase■ Interaction with other phases via boundary conditions■ Three phase transitions:
– Liquid-gas boundary (free surface)– Liquid-solid boundary (obstacle walls)– Solid-gas (no boundary for LBM scheme!)
16
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas-Solid Lattice Boltzmann
■ Boltzmann method used for the liquid phase■ Interaction with other phases via boundary conditions■ Three phase transitions:
– Liquid-gas boundary (free surface)– Liquid-solid boundary (obstacle walls)– Solid-gas (no boundary for LBM scheme!)
17
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas Boundary
■ Free surface boundary
– Boundary treatment is done at theinterface cells.
– PDFs only in liquid and interfacecells
– No PDFs defined in gas cells!
■ Free Surface Boundary Condition– Construct PDFs pointing towards liquid phase
from streamed PDFs according to
where incorporates the gas pressure, and is the local flow velocity.
– No tangential stresses at free surface boundary
ρG=1/cs2⋅pG
u⃗( x⃗ )
18
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Gas Boundary
■ Free Surface Boundary– Second moment of distribution functions:
– Split sum for momentum flux and stress tensor, respectively
– For equilibrium all stresses vanish (S=0), and p is the gas pressure.
19
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Liquid-Solid Boundary
■ Particle reflection at obstacles– Bounce back rule realized as a modified
stream step (figure)– Reflection is given by
with boundary velocity .– Flow velocity near wall equals boundary
velocity (no slip)
u⃗w
■ Momentum transfer Elastic collision of PDFs at the surface. Change in momentum
Force exerted locally onto boundary. Momentum exchange method: Calculate boundary stress directly from all PDF
reflections at a given surface.
20
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
21
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Multiphase Flow – Cell Conversion Scheme
■ Lattice configuration
■ Cell state (liquid, gas, interface, obstacle) stored as flag value in each cell
■ May change during simulation■ Free surface movement■ Rigid body movement
22
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Free Surface Movement
■ Free Surface Flow Model
– Volume of Fluid approach– Interface cells: Additional fill value stores the amount of
liquid in a cell, such that
■ Mass Exchange
– Mass balance is calculated during the stream step according to
– Fill level changes according to free surface movement
23
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Free Surface Movement
■ Free Surface Flow Model
– Mass balance is calculated during the stream step according to
– Interface cell converts to liquid, if .– Interface cell converts to gas, if .– May trigger further conversions to close interface layer
(assure valid boundary!).
– No direct conversions from liquid to gas or vice versa!
24
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Obstacle Movement
■ Obstacles are mapped to the lattice– Cell is treated as obstacle, if the center of the cell is
inside of the object shape (e.g., box shape, sphere shape, …)
■ Obstacle movement calculated from the fluid stresses– Physics engine calculates movement
from given surface stresses.
– Lattice has to be updated accordingto obstacle movement.
25
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Conversion Scheme with Obstacles
■ Free Surface: No direct transition between liquid and gas.
■ Remaining transitions are from obstacle to fluid, and back.
26
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Conversion Scheme with Obstacles
■ Consider a spherical particle with rightwards movement.
■ Direct conversions from fluid into obstacle (continuous lines) regardless of fluid state.
■ Conversions from obstacle back to fluid are critical (broken lines).
27
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Cell Conversion Algorithm
28
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Cell Conversion Algorithm
29
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
30
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulations with waLBerla and pe
■ Widely Applicable Latttice Boltzmann from Erlangen■ p.e. - Rigid body physics engine■ Software projects of the “Lehrstuhl für Systemsimulation”,
University of Erlangen-Nürnberg
31
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Showcase 1
■ 4096 Particles dropped into a Basin■ Spherical particles, radius 6 lattice units■ Red particles are heavier, green ones more lightweight■ Computed on 32 woodcrest processes■ ~ 3 days computation time
Watch online: http://youtu.be/leORsCgdRQM
32
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Showcase 2
■ Bubbe Rise in Particle Array■ Freely floating spherical particles (neutral material
density)
Watch online: http://youtu.be/MTOiDjcVuXU
33
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
34
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Stability - Literature
■ Floating Positions of Rigid Bodies
– Application: Hydrostatic Floating stability (as known from marine engineering)
– J.M.J. Journée and W.W. Massie: Offshore Hydromechanics, www.shipmotions.nl(some pictures and formulae taken from this book)
– Captain D.R. Derrett and C.B. Barrass: Ship Stability for Masters and Mates– Simon Bogner, Ulrich Rüde. Liquid-gas-solid flows with lattice Boltzmann –
Simulation of floating bodiesICMMES proceedings 2011 (submitted article under review)
35
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Bodies
■ Buoyancy Force– Archimedes: Lifting force equals the weight of the displaced fluid
mass
– Force acts at the center of buoyancy B– Partial Immersion: B is different from the center of gravity G
■ Floating behavior of half immersed cube– Assumption: Equilibrium of buoyancy and weight (vertical balance)– Unstable and stable equilibrium
(Equilibrium position for cube of specific density 0.5)
36
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Bodies – Rotational Stability
■ Unstable Equilibrium of Cube:
– Construction of B as the center of gravity of the immersed trapezoid
● Elongate each of the parallel sides (u and v) by its opposite in opposed directions
● Connect the newly obtained endpoints● Intersection with middle line of the parallel
sides gives B
– Horizontal displacement of G versus B
– Result: Rotational moment in the direction of heel.
➔ Upright position is unstable➔ 45° position is stable
37
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Bodies – Righting Moment
■ Heel from stable floating position
– Righting Moment opposes the heeling moment
– Shift of masses from to (shift of B)– Metacenter : Intersection of line
with the corresponding line of the upright position.
M H
N ϕ
Bϕ+α⋅ρ g⃗∇=Bϕ−α⋅F⃗ B
■ Righting Stability Moment
– (Momentum: )– Important for the stability of offshore
structures (ships, barges, ..)
M S=ρ g∇⋅GZ= F⃗ B⋅GZ
z e z i
lever arm× force
38
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Stability Formula
■ Wall-sided structure– Parallel side walls in upright position– Immersed and emerged volume parts
are wedges with triangular front side
■ Scribanti Formula
– Compute the metacenter for a given angle of heel.
– is the moment of inertia of the water plane.
– From follows and the righting moment
■ Example: Floating Box
I T
N ϕ
BN ϕ Bϕ
M S=ρ g∇⋅GZ
39
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Floating Box
■ Stability of Floating Box– For a cuboid, the Stability Formula can
be written as
with
– L, B and T are the length, width and draft of the box
■ Stability Curve– Righting moment at a given angle of
heel– Cube (b:h = 4:4): negative righting
moment; upright position unstable– Increased width means more stability
α
40
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
41
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Evaluation of Torque
■ Validation of righting moment of box structures
■ Half immersed box
■ Angle of heel 0°..30°
■ Tested b:h ratios 6:4 (a) and 5:4 (b)
■ Resolution of box in lattice units:– 24x16, 48x32, 96x64 (a)
– 20x16, 40x32, 80x64 (b)
42
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Evaluation of Torque
■ Ideal Stability Curve Versus Simulation
– Higher relative errors in (b) because of lower floating stability.– Convergence to ideal curve
43
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Convergence Test
■ Check for convergence of three-phase system (ideal floating positions)
■ Equilibrium for cube of density 0.5■ For cube of density 0.25, the stability curve
shows has a root at 26.57°(~“Angle of Loll”)
■ Same angle for density 0.75
44
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Floating Structures – Convergence Test
■ Demonstration of convergence to ideal floating positions■ Cubes of density 0.25, 0.5, and 0.75■ Low resolution of particles: 16x16 lattice units
Watch online: http://youtu.be/5F-qHsPIrYE
45
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Simulation of floating bodies with lattice Boltzmann
■ Lattice Boltzmann Method (LBM)– Kinetic origin of the lattice BGK Method
■ Multiphase Flow– 3 Phases: Liquid, gas and solid (rigid bodies)– Cell conversion scheme– Simulations with waLBerla and pe
■ Floating Bodies– Hydrostatic floating stability– Evaluation of forces
■ Outlook & Conclusion– Further applications
46
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Conclusion
■ Liquid-Gas-Solid Method so far...
– Arbitrary shaped rigid bodies or particles– Free surface flows– Ready for parallel computation (tested on woodcrest cluster)
■ Outlook
– Further development for bubbly flows (foams), like, e.g., flotation processes or chemical reactors
– Surface tension and contact line behavior with particles– Further validation, e.g., floating objects motion in waves, bubble-
particle interaction, …– ...– ...
47
Simon Bogner - Lehrstuhl für Systemsimulation - Friedrich-Alexander Universität Erlangen-Nürnberg
Thanks for Listening
Thank you for your attention!
Have a nice and pleasant evening.
http://www10.informatik.uni-erlangen.de