Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations...

5
1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations ETH Zurich Outline Euler vs. Lagrange Euler Equations Two Quantities - Two Equations Conservation of Mass Density Flow Rate Conservation of Momentum Newton’s Second Law of Motion Material Derivative Internal and External Forces Implementation Simplified Model for Compressible Fluids Finite Differences and Euler Integration 3 M Müller – Fluid Equations ETH Zurich Lagrange vs. Euler displacement field u(x) follows particle we know where original particle is at any time u(x) velocity field v(x) is fixed in space we don’t know where original particle is v(x) Eulerian (velocity) approach Lagrangian (displacement) approach 4 M Müller – Fluid Equations ETH Zurich Lagrange vs. Euler typically computed on a mesh Finite Element Method elastic objects u(x) typically computed on a (regular) grid Finite Differences Method fluids v(x) Eulerian (velocity) approach Lagrangian (displacement) approach

Transcript of Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations...

Page 1: Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations

1

1M Müller – Fluid Equations

ETH Zurich

Fluid Equations

Matthias MüllerSeminar – Wintersemester 02/03

Movie

2M Müller – Fluid Equations

ETH ZurichOutline

Euler vs. LagrangeEuler Equations

Two Quantities - Two EquationsConservation of Mass

Density Flow RateConservation of Momentum

Newton’s Second Law of MotionMaterial DerivativeInternal and External Forces

ImplementationSimplified Model for Compressible FluidsFinite Differences and Euler Integration

3M Müller – Fluid Equations

ETH ZurichLagrange vs. Euler

• displacement field u(x)• follows particle• we know where original particle

is at any time

u(x)

• velocity field v(x)• is fixed in space• we don’t know where original

particle is

v(x)

Eulerian (velocity) approachLagrangian (displacement) approach

4M Müller – Fluid Equations

ETH ZurichLagrange vs. Euler

typically• computed on a mesh• Finite Element Method• elastic objects

u(x)

typically• computed on a (regular) grid• Finite Differences Method• fluids

v(x)

Eulerian (velocity) approachLagrangian (displacement) approach

Page 2: Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations

2

5M Müller – Fluid Equations

ETH ZurichTwo Continuous Quantities

Scalar field ρ(x,t) [kg/m3]

ρ(x,t)

Vector field v(x,t) [m/s] v(x,t)

For incompressible fluids: ρ(x,t) ≡ 1

=

),,,(

),,,(

),,,(

),,,(

tzyxw

tzyxv

tzyxu

tzyxv

6M Müller – Fluid Equations

ETH ZurichTwo Equations

ρ(x,t)

v(x,t)0)( =⋅∇+∂∂

vρρt

Conservation of mass

local increase flow out

vgv 2∇++−∇= µρρ pDt

D

Conservation of momentum

“m⋅a / volume”

“force / volume”

At every point x:

7M Müller – Fluid Equations

ETH ZurichDensity Flow Rate

dxdy

dz

8M Müller – Fluid Equations

ETH ZurichDensity Flow Rate

w(x,y,z+dz)⋅dx⋅dy⋅ρ(x,y,z+dz) mass flow rate out

-w(x,y,z)⋅dx⋅dy⋅ρ(x,y,z) mass flow rate out

w(w(x,y,zx,y,z))

dxdy

dz

w(w(x,y,z+dzx,y,z+dz))

Page 3: Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations

3

9M Müller – Fluid Equations

ETH ZurichDensity Flow Rate

= [w(x,y,z+dz)⋅dx⋅dy⋅ρ(x,y,z+dz)- w(x,y,z)⋅dx⋅dy⋅ρ(x,y,z)] /(dx⋅dy⋅dz)

= [w(x,y,z+dz)⋅ρ(x,y,z+dz) -w(x,y,z)⋅ρ(x,y,z)] /dz

= ∂/∂z (w⋅ρ)

w(x,y,z+dz)⋅dx⋅dy⋅ρ(x,y,z+dz) mass flow rate out

-w(x,y,z)⋅dx⋅dy⋅ρ(x,y,z) mass flow rate outw(w(x,y,zx,y,z))

dxdy

dz

w(w(x,y,z+dzx,y,z+dz))

net density flow rate out

10M Müller – Fluid Equations

ETH ZurichTotal Density Flow Rate

= ∇⋅ (ρv)= div (ρv)

w(w(x,y,zx,y,z))

dxdy

dz

w(w(x,y,z+dzx,y,z+dz)) total net density flow rate out

= ∂/∂x (u⋅ρ) + ∂/∂y (v⋅ρ) + ∂/∂z (w⋅ρ)

density increase rate inside= ∂ρ/∂t

0)( =⋅∇+∂∂

vρρt

mass conservation:

0=⋅∇ v

incompressible:

11M Müller – Fluid Equations

ETH ZurichMomentum Conservation

Newton’s second law per unit volume (Navier-Stokes, simplified!):

“m⋅a per volume” = “force per volume”

Material derivative of velocity (following the fluid):

vgv 2∇++−∇= µρρ pDt

D

t

v

tw

zv

yu

x

t

t

tt

z

zt

y

yt

x

xttztytx

tDt

D

∂∂+∇⋅=

∂∂+⋅

∂∂+⋅

∂∂+⋅

∂∂=

∂∂⋅

∂∂+

∂∂⋅

∂∂+

∂∂⋅

∂∂+

∂∂⋅

∂∂=

∂∂=

vv

vvvv

vvvvv

v)),(),(),((

12M Müller – Fluid Equations

ETH ZurichExternal Forces

Newton’s second law per unit volume:“m⋅a per volume” = “force per volume”

External forces:

vgv 2∇++−∇= µρρ pDt

D

• gravity force = mass ⋅ acceleration per volume• other user applied forces (force per volume!)

Page 4: Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations

4

13M Müller – Fluid Equations

ETH ZurichPressure

Newton’s second law per unit volume:“m⋅a per volume” = “force per volume”

vgv 2∇++−∇= µρρ pDt

D

p

p

p

p

f

f

f

z

y

x

zzyzyxzx

zyzyyxyx

zxzyxyxx

z

y

x

∇=

=

++++++

=

=

,

,

,

,,,

,,,

,,,

int

στττστττσ

f

=

=p

p

p

zzyzx

yzyyx

xzxyx

00

00

00

pressure

στττστττσ

σ

14M Müller – Fluid Equations

ETH ZurichPressure

Newton’s second law per unit volume:“m⋅a per volume” = “force per volume”

vgv 2∇++−∇= µρρ pDt

D

What is p?• for isotermal fluids:• pV = const• p = k/V = kρ

15M Müller – Fluid Equations

ETH ZurichViscosity

Newton’s second law per unit volume:“m⋅a per volume” = “force per volume”

vgv 2∇++−∇= µρρ pDt

D

++++++

=∇

zzyyxx

zzyyxx

zzyyxx

www

vvv

uuu

,,,

,,,

,,,

2 µµ v

Simplified viscosity force for incompressible fluids:

Scalar µ is the fluid’s viscosity

16M Müller – Fluid Equations

ETH ZurichPutting it all together

vgvvv 2∇++∇−=

∇⋅+

∂∂ µρρρ kt

0)( =⋅∇+∂∂

vρρt

Rearrange to get rates of change:

vgvvv 2∇++∇−∇⋅−=

∂∂

ρµρ

ρk

t

)( vρρ ⋅−∇=∂∂t

So far we have:

Page 5: Lagrange vs. Euler Fluid Equations...1 1 M Müller – Fluid Equations ETH Zurich Fluid Equations Matthias Müller Seminar – Wintersemester 02/03 Movie 2 M Müller – Fluid Equations

5

17M Müller – Fluid Equations

ETH ZurichFinite Difference Integration

On a uniform grid using finite differences we get:

vgvvv 2∇++∇−∇⋅−=

∂∂

ρµρ

ρk

t

)( vρρ ⋅−∇=∂∂t

h

vw

h

vvh

uu

t

kjikjikjikjikjikjikjikji

kjikjikjikjikji

1,,1,,,,,,,1,,1,,,,,

,,1,,1,,,,,,

−−−−

−−

−−

−−

−−=

∂∂

ρρρρ

ρρρ

Similar for change of velocity(see “A Fluid-Based Soft-Object Model”, IEEE Computer Graphics and Applications July 2002)

18M Müller – Fluid Equations

ETH ZurichTime Integration

Time step using Euler Integration:

tt

tt

kjikjikji

kjikjikji

∂∂

∆+=

∂∂

∆+=

,,,,,,

,,,,,,

vvv

ρρρ

Done! ☺

How to get a surface?• let particles flow with velocity field• particles define potential• use levelset method