Fluid dynamics Math background Physics Simulation Related - - PowerPoint PPT Presentation

fluid dynamics
SMART_READER_LITE
LIVE PREVIEW

Fluid dynamics Math background Physics Simulation Related - - PowerPoint PPT Presentation

Fluid dynamics Math background Physics Simulation Related phenomena Frontiers in graphics Rigid fluids Fields Domain R 2 Scalar field f : R Vector field f : R 2 Types of


slide-1
SLIDE 1

Fluid dynamics

slide-2
SLIDE 2
  • Math background
  • Physics
  • Simulation
  • Related phenomena
  • Frontiers in graphics
  • Rigid fluids
slide-3
SLIDE 3
  • Domain
  • Scalar field
  • Vector field

Fields

Ω ⊆ R2 f : Ω → R f : Ω → R2

slide-4
SLIDE 4

Types of derivatives

  • Derivatives measure how something changes

due to its parameters

  • Temporal derivatives
  • Spatial derivatives
  • gradient operator
  • divergence operator
  • Laplacian operator

∂f ∂t

∇f = ∂f ∂x, ∂f ∂y T ∇ · f = ∂f x ∂x + ∂f y ∂y ∇2f = ∇ · (∇f) = ∂2f ∂x + ∂2f ∂y

slide-5
SLIDE 5
  • Math background
  • Physics
  • Simulation
  • Related phenomena
  • Frontiers in graphics
  • Rigid fluids
slide-6
SLIDE 6

Representation

Domain Ω Density ρ : Ω → [0, 1] Velocity u : Ω → R3

slide-7
SLIDE 7

“Coffee cup” equation

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f ∇ · u = 0

Navier-Stokes

u: velocity p: pressure s: kinematic viscosity f: body force ρ: fluid density

Momentum equation Incompressibility condition

slide-8
SLIDE 8

Momentum equation

  • Each particle represents a little blob of fluid

with mass m, a volume V, and a velocity u

  • The acceleration of the particle
  • The Newton’s law

a ≡ Du Dt mDu Dt = F

slide-9
SLIDE 9

Forces acting on fluids

  • Gravity: mg
  • Pressure: -∇p
  • Imbalance of higher pressure
  • Viscosity: µ∇·∇u
  • Force that makes particle moves at average

speed

  • dynamic viscosity coefficient: µ
slide-10
SLIDE 10

Momentum equation

ρDu Dt = ρg − ∇p + µ∇ · ∇u mDu Dt = mg − V ∇p + V µ∇ · ∇u Du Dt + 1 ρ∇p = g + s∇ · ∇u

The movement of a blob of fluid Divide by volume Rearrange equation giving Navier-Stoke

slide-11
SLIDE 11

Lagrangian v.s. Eulerian

  • Lagrangian point of view describes motion as

points travel around space over time

  • Eulerian point of view describes motion as the

change of velocity field in a stationary domain

  • Lagrangian approach is conceptually easier, but

Eulerian approach makes the spatial gradient easier to compute/approximate

slide-12
SLIDE 12

Material derivative

Dq Dt = ∂q ∂t + u ∂q ∂x + v ∂q ∂y + w ∂q ∂z = ∂q ∂t + ∇q · u = Dq Dt d dtq(t, x) = ∂q ∂t + ∇q · dx dt

slide-13
SLIDE 13

Advection

  • Advection describe how quantity, q, moves

with the velocity field u

  • Density
  • Velocity

Du Dt = ∂u ∂t + u · ∇u Dρ Dt = ∂ρ ∂t + u · ∇ρ

slide-14
SLIDE 14

Advection

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Advection

∇ · u = 0

Projection Diffusion Body force

Du Dt + 1 ρ∇p = g + s∇ · ∇u

momentum equation

slide-15
SLIDE 15

Density advection

∂ρ ∂t = −(u · ∇)ρ

slide-16
SLIDE 16

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Velocity advection

s.t. ∇ · u = 0

slide-17
SLIDE 17

Projection

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Advection

∇ · u = 0

Projection Diffusion Body force

slide-18
SLIDE 18

∇ · u > 0? ∇ · u < 0?

Divergence free

slide-19
SLIDE 19

∇ ∙ u = 0

Divergence free

∇ ∙ u ≠ 0

slide-20
SLIDE 20

Projection

s.t. ∇ · u = 0

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

slide-21
SLIDE 21

Diffusion

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Advection

∇ · u = 0

Projection Diffusion Body force

slide-22
SLIDE 22

High viscosity fluids

slide-23
SLIDE 23

Dropping viscosity

  • Viscosity plays a minor role in most fluids
  • Numeric methods introduce errors which can

be physically reinterpreted as viscosity

  • Fluid with no viscosity is called “inviscid”
slide-24
SLIDE 24

Body force

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Advection

∇ · u = 0

Projection Diffusion Body force

slide-25
SLIDE 25

External forces

  • Gravity
  • Heat
  • Surface tension
  • User-specified forces (stirring coffee)
slide-26
SLIDE 26

Boundary conditions

  • Solid walls
  • The fluid cannot go in and out of it
  • Control the normal velocity
  • Free surfaces
  • Air can be represented as a region where

the pressure is zero

  • Do not control the velocity at the surface
slide-27
SLIDE 27

Solid boundary

  • Velocity at the boundary
  • No-slip condition:
  • Pressure at the boundary
  • Make the fluid incompressible AND enforce the

solid boundary condition

u · ˆ n = usolid · ˆ n u = usolid

slide-28
SLIDE 28

Physics recap

  • Physical quantity represented as fields
  • Navier-Stokes PDE describes the dynamics
slide-29
SLIDE 29
  • Math background
  • Physics
  • Simulation
  • Related phenomena
  • Frontiers in graphics
  • Rigid fluids
slide-30
SLIDE 30
  • What is the representation for fluids?
  • represent velocity and pressure
  • What is the equation of motion for fluids?
  • approximate Navier-Stokes in a discrete

domain

  • compute Navier-Stokes efficiently

Challenges

slide-31
SLIDE 31

Grid structure

pi,j

pi−1,j

pi+1,j pi,j+1 pi,j−1 vi,j+1/2 vi,j−1/2 ui−1/2,j ui+1/2,j

slide-32
SLIDE 32

Explicit integration

  • Solving for the differential equation explicitly,

namely

  • You get this...

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f ut+1 = ut + h ˙ u(t)

slide-33
SLIDE 33

Explicit integration

slide-34
SLIDE 34

Stable fluids

Invented by Jos Stam Simple, fast, and unconditionally stable

slide-35
SLIDE 35

Splitting methods

  • Suppose we had a system
  • We define simulation function Sf
  • Then we could define

∂x ∂t = f(x) = g(x) + h(x) Sf(x, ∆t) : x(t) → x(t) + ∆tf(x) Sf(x, ∆t) : x(t + ∆t) = Sg(x, ∆t) ◦ Sh(x, ∆t)

slide-36
SLIDE 36

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Splitting methods

w0(x) w1(x) w2(x) w3(x) w4(x) add force Advect Diffuse Project w0 = u(x, t) u(x, t+Δt) = w4

slide-37
SLIDE 37

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Splitting methods

w0(x) w1(x) w2(x) w3(x) w4(x) add force Advect Diffuse Project w0 = u(x, t) u(x, t+Δt) = w4

slide-38
SLIDE 38

Body forces

slide-39
SLIDE 39

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Splitting methods

w0(x) w1(x) w2(x) w3(x) w4(x) add force Advect Diffuse Project w0 = u(x, t) u(x, t+Δt) = w4

slide-40
SLIDE 40

Advection

slide-41
SLIDE 41
slide-42
SLIDE 42

Numerical dissipation

  • Semi-Lagrangian advection tend to smooth out

sharp features by averaging the velocity field

  • The numerical errors result in a different

advection equation solved by semi-Largrangian

  • Smooth out small vortices in inviscid fluids

∂q ∂t + u ∂q ∂x = u∆x ∂2q ∂x2

slide-43
SLIDE 43

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Splitting methods

w0(x) w1(x) w2(x) w3(x) w4(x) add force Advect Diffuse Project w0 = u(x, t) u(x, t+Δt) = w4

slide-44
SLIDE 44

Diffusion

  • Solve for the effect of viscosity
  • Use an implicit method for stable result

∂w2 ∂t = ν∇2w2 (I − ν∆t∇2)w3(x) = w2(x)

slide-45
SLIDE 45

∂u ∂t = −(u · ∇)u − 1 ρ∇p + s∇2u + f

Splitting methods

w0(x) w1(x) w2(x) w3(x) w4(x) add force Advect Diffuse Project w0 = u(x, t) u(x, t+Δt) = w4

slide-46
SLIDE 46

Projection

P( )

slide-47
SLIDE 47

Projection

  • Projection step subtracts off the pressure from

the intermediate velocity field w3

  • project(Δt, u) must satisfies two conditions:
  • divergence free:
  • boundary velocity:

∇ · ut+1 = 0 ut+1 · ˆ n = usolid · ˆ n w4 = w3 − ∆t1 ρ∇p

slide-48
SLIDE 48

Boundary conditions

  • Dirichlet boundary condition for free surfaces
  • Neumann boundary condition for solid walls

pi+1,j pi,j ui+1/2,j

pi+1,j = pi,j + ρ∆x ∆t (ui+1/2,j − usolid) ut+1

i+1/2,j = ui+1/2,j − ∆t1

ρ pi+1,j − pi,j ∆x ut+1

i+1/2,j = usolid

since

slide-49
SLIDE 49

Divergence-free condition

pi,j

pi−1,j

pi+1,j pi,j+1 pi,j−1

vi,j+1/2 vi,j−1/2 ui−1/2,j ui+1/2,j

ut+1

i+1/2,j − ut+1 i−1/2,j

∆x + vt+1

i,j+1/2 − vt+1 i,j−1/2

∆x = 0 ui+1/2,j − ∆t1 ρ pi+1,j − pi,j ∆x

replace ut+1

i+1/2,j (and other terms)

with result in a discrete Poisson equation

∆t ρ 4pi,j − pi+1,j − pi,j+1 − pi−1,j − pi,j−1 ∆x2
  • = −
ui+1/2,j − ui−1/2,j ∆x + vi,j+1/2 − vi,j−1/2 ∆x
slide-50
SLIDE 50

The pressure equations

  • If grid cell (i, j + 1) is in air

and (i+1, j) is a solid

  • replace pi,j+1 with zero
  • replace pi+1,j with the value

from Neumann condition

pi,j

pi−1,j

pi+1,j pi,j+1 pi,j−1

vi,j+1/2 vi,j−1/2 ui−1/2,j ui+1/2,j

∆t ρ 4pi,j − pi+1,j − pi,j+1 − pi−1,j − pi,j−1 ∆x2
  • = −
ui+1/2,j − ui−1/2,j ∆x + vi,j+1/2 − vi,j−1/2 ∆x
  • pi,j + ρ∆x
∆t (ui+1/2,j − usolid)
slide-51
SLIDE 51

Solve a linear system

  • Ap = b
  • Construct matrix A:
  • diagonal entry: # of non-solid neighbors
  • off-diagonal: 0 if the neighbor is non-fluid

cell and -1 if the neighbor is fluid cell

  • A is symmetric positive definite
  • Use preconditioned conjugate gradient