conservation mass - university of notre damegtryggva/cfd-course2017/lecture-4...the conservation law...

12
Computational Fluid Dynamics Computational Fluid Dynamics http://www.nd.edu/~gtryggva/CFD-Course/ Grétar Tryggvason Lecture 4 January 30, 2017 Computational Fluid Dynamics The Equations Governing Fluid Motion http://www.nd.edu/~gtryggva/CFD-Course/ Computational Fluid Dynamics Derivation of the equations governing fluid flow in integral form Conservation of Mass Conservation of Momentum Conservation of Energy Differential form Summary Incompressible flows Inviscid compressible flows Outline Computational Fluid Dynamics Conservation of Mass Computational Fluid Dynamics In general, mass can be added or removed: time t The conservation law must be stated as: Original Mass Mass Added Final Mass + = Mass Removed - time t+t Conservation of Mass Computational Fluid Dynamics We now apply this statement to an arbitrary control volume in an arbitrary flow field Conservation of Mass Rate of increase of mass Net influx of mass =

Upload: others

Post on 18-Jul-2020

8 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Computational Fluid Dynamics

http://www.nd.edu/~gtryggva/CFD-Course/

Grétar Tryggvason

Lecture 4January 30, 2017

Computational Fluid Dynamics

The Equations Governing Fluid

Motion

http://www.nd.edu/~gtryggva/CFD-Course/

Computational Fluid Dynamics

Derivation of the equations governing fluid flow in integral form

Conservation of MassConservation of MomentumConservation of Energy

Differential formSummaryIncompressible flowsInviscid compressible flows

OutlineComputational Fluid Dynamics

Conservationof

Mass

Computational Fluid Dynamics

In general, mass can be added or removed:

time tThe conservation law must be stated as:

OriginalMass

MassAdded

FinalMass += Mass

Removed-

time t+∆t

Conservation of MassComputational Fluid Dynamics

We now apply this statement to an arbitrary control volume in an arbitrary flow field

Conservation of Mass

Rate of increase of mass

Net influx of mass=

Page 2: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Control volume VControl surface S

∂∂t

ρdvV∫

The rate of change of total mass in the control volume is given by:

Total mass

Rate of change

Conservation of MassComputational Fluid Dynamics

Control volume VControl surface S

To find the mass flux throughthe control surface, let�s examinea small part of the surface where the velocity is normal to the surface

Conservation of Mass

Computational Fluid Dynamics

U∆t

∆A

Mass flow through the boundary ∆A during ∆t is: time t time t+∆t

Density ρVelocity Ux

Select a small rectangle outside the boundary such that during time ∆t it flows into the CV:

Conservation of Mass

where Ux = -u·n

ρUxΔtΔA

Computational Fluid Dynamics

The sign of the normal component of the velocity determines whether the fluid flows in or out of the control volume. We will take the outflow to be positive:

− ρu ⋅ndsS∫

The net in-flow through the boundary of the control volume is therefore:

Mass flow normal to boundary

Integral over the boundary

Negative since this is net inflow

u ⋅n < 0 Inflow

Conservation of Mass

Computational Fluid Dynamics

∂∂t

ρdvV∫ = − ρu ⋅nds

S∫

Conservation of Mass Equation in Integral Form

Conservation of Mass

Net inflow of massRate of change of mass

Computational Fluid Dynamics

Conservationof

momentum

Page 3: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Rate of increase of momentum

Net influx of momentum

Body forces

Surface forces

= + +

Momentum per volume:

Momentum in control volume:

ρu

ρu dvV∫

Conservation of momentumComputational Fluid Dynamics

Control volume VControl surface SThe rate of

change of momentum in the control volume is given by:

Total momentum

Rate of change

∂∂t

ρu dvV∫

Rate of change of momentum

Computational Fluid Dynamics

Ux∆t

∆A

Momentum flow through the boundary ∆A during ∆t is: time t time t+∆t

Density ρVelocity u

Select a small rectangle outside the boundary such that during time ∆t it flows into the CV:

− ρuu ⋅nds∫

In/out flow of momentum

Ux

Ux = -u·n so the net influx of momentum per unit time (divided by ∆t ) is:

ρu( )UxΔtΔA

Computational Fluid Dynamics

Control volume V

Body forces, such as gravity act on the fluid in the control volume.

Total body force

ρ f dvV∫

f

dv

Body force

Computational Fluid Dynamics

Control volume VControl surface SThe viscous

force is given by the dot product of the normal with the stress tensor T

Total stress force

T ⋅n

S∫ dS

T•nds

Viscous forceComputational Fluid DynamicsViscous flux of momentum

T = −p + λ∇⋅u( )I + 2µD

D =12∇u +∇uT( )

Dij =12

∂ui∂x j

+∂uj∂xi

⎝ ⎜ ⎞

⎠ ⎟

Stress Tensor

Deformation Tensor

Whose components are:

∇ ⋅u = 0

T = −pI+ 2µD

For incompressible flows

And the stress tensor is

Page 4: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Control volume VControl surface SThe pressure

produces a normal force on the control surface. The total force is:

Total pressure force

pn

S∫ dS

pn

ds

Pressure forceComputational Fluid DynamicsConservation of Momentum

∂∂t

ρudv∫ = − ρuu ⋅nds − Tn∫ ds∫ + ρ f dv∫

∂∂t

ρudv∫ = − ρuu ⋅nds − pn∫ ds∫ + 2µD∫ ⋅nds + ρ f dv∫

Gathering the terms

Substitute for the stress tensor

Rate of change of momentum

Net inflow of momentum Total

pressureTotal viscous force

Total body force

T = −pI+ 2µD

Computational Fluid Dynamics

Conservationof

energy

Computational Fluid Dynamics

∂∂t

ρ e + 12u2⎛

⎝⎜⎞⎠⎟dv∫ = − ρ e + 1

2u2⎛

⎝⎜⎞⎠⎟u ⋅nds∫

+ u ⋅ f dv +V∫ n ⋅ (uT)ds∫ − n ⋅qds∫

Conservation of energy

Rate of change of kinetic+internal energy

Work done by body forces

Net inflow of kinetic+internal energy

Net heat flow

Net work done by the stress tensor

The energy equation in integral form

Computational Fluid Dynamics

Differential Formof

the Governing Equations

Computational Fluid Dynamics

The Divergence or Gauss Theorem can be used to convert surface integrals to volume integrals

∇ ⋅aV∫ dv = a ⋅n ds

S∫

Differential form

Page 5: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Start with the integral form of the mass conservation equation∂∂t

ρdvV∫ = − ρu ⋅nds

S∫Using Gauss�s theorem

ρu ⋅nds =S∫ ∇ ⋅(ρu)dv

V∫The mass conservation equations becomes

∂∂t

ρdvV∫ = − ∇ ⋅(ρu)dv

V∫

Differential formComputational Fluid Dynamics

Rearranging∂∂t

ρdvV∫ + ∇⋅ (ρu)dv

V∫ = 0

∂ρ∂t

+ ∇⋅ (ρu)⎛ ⎝

⎞ ⎠ dvV∫ = 0

Since the control volume is fixed, the derivative can be moved under the integral sign

Rearranging

∂ρ∂tdv

V∫ + ∇⋅(ρu)dvV∫ = 0

Differential form

Computational Fluid Dynamics

∂ρ∂t

+∇ ⋅(ρu) = 0

∂ρ∂t

+ ∇⋅ (ρu)⎛ ⎝

⎞ ⎠ dvV∫ = 0

This equation must hold for ANY control volume, no matte what shape and size. Therefore the integrand must be equal to zero

Differential formComputational Fluid Dynamics

DρDt

+ ρ∇ ⋅u = 0

∇ ⋅ (ρu) = u ⋅ ∇ρ + ρ∇ ⋅u

The mass conservation equation becomes:

Expanding the divergence term:

∂ρ∂t

+ ∇ ⋅ (ρu) = ∂ρ∂t

+ u ⋅ ∇ρ + ρ∇ ⋅u

or

where

D()Dt

= ∂()∂t

+ u ⋅ ∇() Convective derivative

Differential form

Computational Fluid DynamicsDifferential form

∂∂t

ρu dv∫ = ρ f dv∫ + (nT− ρu(u ⋅n))ds∫

The differential form of the momentum equation is derived in the same way:Start with

Rewrite as:

∂∂t

ρu dv∫ = ρ f dv∫ + ∇ ⋅∫ T− ρuu( )dv

To get:∂ρu∂t

= ρ f +∇⋅(T − ρuu)

Computational Fluid Dynamics

Using the mass conservation equation the advection part can be rewritten:

∂ρu∂t

+ ∇ ⋅ ρuu =

u ∂ρ∂t

+ u∇ ⋅uρ + ρ ∂u∂t

+ ρu ⋅ ∇u =

u ∂ρ∂t

+ ∇ ⋅uρ⎛ ⎝ ⎜

⎞ ⎠ ⎟ + ρ Du

Dt= ρ Du

Dt

Differential form

=0, by mass conservation

Page 6: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

The momentum equation equation

∂ρu∂t

= ρ f +∇ ⋅ (T − ρuu)

ρDuDt

= ρ f + ∇⋅T

Can therefore be rewritten as

Differential form

where

ρ DuDt

= ρ ∂u∂t

+ u ⋅ ∇u⎛ ⎝ ⎜

⎞ ⎠ ⎟

Computational Fluid Dynamics

The energy equation equation can be converted to a differential form in the same way. It is usually simplified by subtracting the �mechanical energy��

Differential form

Computational Fluid Dynamics

The �mechanical energy equation� is obtained by taking the dot product of the momentum equation and the velocity:

ρ∂∂t

u2

2⎛ ⎝ ⎜ ⎞

⎠ ⎟ = −ρu ⋅ ∇ u2

2⎛ ⎝ ⎜ ⎞

⎠ ⎟ + ρu ⋅ fb + u ⋅ ∇ ⋅T( )

The result is:

The �mechanical energy equation�

u ⋅ ρ ∂u∂t

+ ρu ⋅ ∇u = ρ f + ∇⋅T⎛ ⎝

⎞ ⎠

Differential formComputational Fluid Dynamics

The final result is

ρDeDt

− T ⋅ ∇u +∇ ⋅q = 0

Subtract the �mechanical energy equation� from the energy equation

Using the constitutive relation presented earlier for the stress tensor and Fourie�s law for the heat conduction:

q = −k∇T

T = −p + λ∇⋅u( )I + 2µD

Differential form

Computational Fluid Dynamics

The final result is

ρDeDt

+ p∇⋅u =Φ+∇ ⋅ k∇T

is the dissipation function and is the rate at which work is converted into heat.

µ, λ, k

p = p(e,ρ); T = T (e,ρ);

where

Φ = λ(∇⋅u)2 + 2µD ⋅D

Generally we also need:

and equations for

Differential formComputational Fluid Dynamics

Summaryof

governing equations

Page 7: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

∂∂t

ρdvV∫ = − ρu ⋅nds

S∫

∂∂t

ρudv∫ = ρ f dv∫ + (nT − ρu(u ⋅n))ds∫

∂∂t

ρ(e + 12u2 )dv∫ = u ⋅ ρ f dv∫ + n ⋅ (uT − ρ(e + 1

2u2 ) − q)ds∫

Integral Form

Computational Fluid Dynamics

∂ρ∂t

+ ∇ ⋅ (ρu) = 0

∂ρu∂t

= ρ f + ∇ ⋅ (T− ρuu)

∂∂t

ρ(e + 12u2)=

∇ ⋅ ρ(e + 12u2)u −uT+q

⎛ ⎝ ⎜

⎞ ⎠ ⎟

Conservative Form

DρDt

+ ρ∇⋅u = 0

ρDuDt

= ρ f +∇ ⋅T

ρDeDt

= T∇⋅u − ∇⋅q

Convective Form

Computational Fluid Dynamics

Special CasesCompressible inviscid flowsIncompressible flows

Stokes flowPotential flows Not in this course!

Computational Fluid Dynamics

Inviscid compressible flows

Computational Fluid Dynamics

∂U∂t

+∂E∂x

+∂F∂y

+∂G∂z

= 0

U =

ρρu

ρv

ρw

ρE

⎜⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟⎟

E =

ρuρu2 + p

ρuv

ρuw

ρE + p( )u

⎜⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟⎟

F =

ρvρuv

ρv2 + p

ρvw

ρE + p( )v

⎜⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟⎟

G =

ρuρuw

ρvw

ρw2 + p

ρE + p( )u

⎜⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟⎟

p = ρRT; e = cvT; h = c pT; γ = c p /cv

cv =R

γ −1; p = (γ −1)ρe; T =

(γ −1)eR

;Assuming Ideal Gas

T = −pIWhere we have taken

Computational Fluid Dynamics

Incompressible flow

Page 8: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Incompressible flows:

Navier-Stokes equations (conservation of momentum)

DρDt

= 0

DρDt

+ ρ∇⋅u = 0

∇ ⋅u = 0

∂∂tρu = −∇⋅ ρuu-∇P + ρ fb +∇⋅µ ∇u + ∇Tu( )

ρ∂∂tu + ρu ⋅ ∇u = -∇P + ρ fb + µ∇ 2u

For constant viscosity

Computational Fluid DynamicsObjectives:

∂u∂t

+ u∂u∂x

+ v∂u∂y

= −1ρ∂P∂x

+µρ

∂ 2u∂x2

+∂ 2u∂y2

⎛ ⎝ ⎜ ⎞

∂u∂x

+∂v∂y

= 0

∂v∂t

+ u∂v∂x

+ v∂v∂y

= −1ρ∂P∂y

+µρ

∂ 2v∂x2

+∂ 2v∂y2

⎛ ⎝ ⎜ ⎞

The 2D Navier-Stokes Equations for incompressible, homogeneous flow:

Computational Fluid Dynamics

u ⋅nds = 0S∫

∂∂t

udVV∫ = − uu ⋅n

S∫ dS +ν ∇u ⋅nS∫ dS − 1

ρ pnxS∫ dS

∂∂t

vdVV∫ = − vu ⋅n

S∫ dS +ν ∇v ⋅nS∫ dS − 1

ρ pnyS∫ dS

Incompressibility (conservation of mass)

Navier-Stokes equations (conservation of momentum)

Computational Fluid Dynamics

Needed to accelerate/decelerate a fluid particle: Easy to use if viscous forces are small

Needed to prevent accumulation/depletion of fluid particles: Use if there are strong viscous forces

The role of pressure:

Pressure and Advection

Advection:

Newton�s law of motion: In the absence of forces, a fluid particle will move in a straight line

Computational Fluid Dynamics

The pressure opposes local accumulation of fluid. For compressible flow, the pressure increases if the density increases. For incompressible flows, the pressure takes on whatever value necessary to prevent local accumulation:

High Pressure Low Pressure

∇ ⋅u < 0

∇ ⋅u > 0

PressureComputational Fluid Dynamics

Increasing pressure slows the fluid down and decreasing pressure accelerates it

Pressure increases

Pressure decreases

Slowing down Speeding up

Pressure

Page 9: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Diffusion of fluid momentum is the result of friction between fluid particles moving at uneven speed. The velocity of fluid particles initially moving with different velocities will gradually become the same. Due to friction, more and more of the fluid next to a solid wall will move with the wall velocity.

ViscosityComputational Fluid Dynamics

For all but the lowest Reynolds numbers, the fluid flow is unstable and unsteady, forming transient whorls and vortices that greatly increase the transfer of momentum over what viscosity alone can do.

The Kelvin Helmholtz instability of a slip line between flows in different directions is one of the fundamental ways in which steady flow becomes unstable.

Instability and unsteadyness

Time

Computational Fluid Dynamics

Nondimensional Numbers—the Reynolds number

Computational Fluid DynamicsNondimensional Numbers

∂u∂t

+ u∂u∂x

+ v∂u∂y

= −1ρ∂P∂x

+µρ

∂ 2u∂x2

+∂ 2u∂y2

⎛ ⎝ ⎜ ⎞

˜ u , ˜ v =u,vU

; ˜ x , ˜ y =x, yL

; ˜ t =UtL

U 2

L∂ ˜ u ∂˜ t

+ ˜ u ∂ ˜ u ∂˜ x

+ ˜ v ∂˜ u ∂˜ y

⎛ ⎝ ⎜ ⎞

⎠ = −

1Lρ

∂P∂˜ x

+UL2

µρ

∂ 2 ˜ u ∂˜ x 2

+∂ 2 ˜ u ∂˜ y 2

⎛ ⎝ ⎜ ⎞

⎠ ⎟

∂˜ u ∂˜ t

+ ˜ u ∂ ˜ u ∂˜ x

+ ˜ v ∂˜ u ∂˜ y

= −L

U 21

Lρ∂P∂˜ x

+L

U 2UL2

µρ

∂ 2 ˜ u ∂˜ x 2

+∂ 2 ˜ u ∂˜ y 2

⎛ ⎝ ⎜ ⎞

⎠ ⎟

Computational Fluid Dynamics

∂˜ u ∂˜ t

+ ˜ u ∂ ˜ u ∂˜ x

+ ˜ v ∂˜ u ∂˜ y

= −L

U 21

Lρ∂P∂˜ x

+L

U 2UL2

µρ

∂ 2 ˜ u ∂˜ x 2

+∂ 2 ˜ u ∂˜ y 2

⎛ ⎝ ⎜ ⎞

⎠ ⎟

LU 2

1Lρ

∂P∂˜ x

=1

ρU 2∂P∂˜ x

=∂ ˜ P ∂˜ x

LU 2

UL2

µρ

ULρ=1Re

˜ P =PρU 2

Re =ρUL

µ

where

where

Nondimensional NumbersComputational Fluid Dynamics

∂˜ u ∂˜ t

+ ˜ u ∂ ˜ u ∂˜ x

+ ˜ v ∂˜ u ∂˜ y

= −∂ ˜ P ∂˜ x

+1

Re∂ 2 ˜ u ∂˜ x 2

+∂ 2 ˜ u ∂˜ y 2

⎛ ⎝ ⎜ ⎞

⎠ ⎟

∂˜ v ∂˜ t

+ ˜ u ∂˜ v ∂˜ x

+ ˜ v ∂ ˜ v ∂˜ y

= −∂ ˜ P ∂˜ y

+1Re

∂ 2 ˜ v ∂˜ x 2

+∂ 2 ˜ v ∂ ˜ y 2

⎛ ⎝ ⎜ ⎞

⎠ ⎟

The momentum equations are:

∂ u∂ x

+∂ v∂ y

= 0

The continuity equation is unchanged

Nondimensional Numbers

Page 10: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

Derivation of the equations governing fluid flow in integral form

Conservation of MassConservation of MomentumConservation of Energy

Differential formSummaryIncompressible flowsInviscid compressible flows

OutlineComputational Fluid Dynamics

Integral versus differentialform of the

governing equations

Computational Fluid Dynamics

When using FINITE VOLUME approximations, we work directly with the integral form of the conservation principles. The average values of f in a small volume are stored

xj-1/2 xj+1/2

fj+1

f j−1fj

x

f

xj-1 xj xj+1

Finite Volume ApproximationsComputational Fluid Dynamics

∂f∂t+∂F∂x

= 0

∂f∂tdx

Δx∫ +

∂F∂x

Δx∫ dx = 0

ddt

f dxΔx∫ + Fj+1/ 2 − Fj−1/ 2 = 0

To derive an equation that governs the evolution of the average value in each cell, consider:

Integrating the equation over a small control volume of size h= Δx=xj+1-xj

yields: The volume is fixed in space

Finite Volume Approximations

Computational Fluid Dynamics

ddt(hf j) = Fj−1/ 2 − Fj+1/ 2

fj =1h

f dxΔx∫

where the average in each cell is defined by:

or:

Fj-1/2 is the flow of f into cell jFj+1/2 is the flow of f out off cell j F is usually called the flux function

Finite Volume ApproximationsComputational Fluid Dynamics

Notation:

xj-1/2 xj+1/2

Fj+1/ 2fj

xj

Fj−1/ 2Flow of f into cell j

Flow of f out of cell j

Average value of f in cell j

Center of cell j

Left boundary of cell j Right boundary of cell j

Finite Volume Approximations

Page 11: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

F =Uf

F = −D∂f∂x

F =Uf − D∂f∂x

Advection

Diffusion

Advection/Diffusion

The exact form of F depends on the problem:

Finite Volume ApproximationsComputational Fluid Dynamics

ddt(hf j) = Fj−1/ 2 − Fj+1/ 2

The statement

Is exactly the original conservation law

Rate of increase in f = inflow of f -outflow of f

The rate of increase of the average value of f is equal to the inflow into the control volume minus the outflow from the control volume

Finite Volume Approximations

Computational Fluid Dynamics

∂f∂t

+U∂f∂x

=D∂ 2 f∂x 2

Example: advection/diffusion equation

were

F =Uf − D∂f∂x

∂f∂t+∂F∂x

= 0

Rewrite:

Assume here that U is a constant

Finite Volume ApproximationsComputational Fluid Dynamics

xj-1/2 xj+1/2

Fj+1/ 2fj

xj

Average value of f in cell j

ddt(hf j) = Fj−1/ 2 − Fj+1/ 2

For each cell

fj =1h

f dxΔx∫

Fj+1/ 2 =Uf j+1/ 2 −D∂f∂x j+1/ 2

Finite Volume Approximations

Computational Fluid Dynamics

xj-1/2 xj+1/2

Fj+1/ 2fj

xj

Average value of f in cell j

fj+1 / 2 ≈ 12 ( f j+1 + f j)

∂f∂x j+1 / 2

≈fj+1 − fjh

Fj+1/ 2 =Uf j+1/ 2 −D∂f∂x j+1/ 2

Approximate:

and

f at a cell boundary gradient of f at a cell boundary

Need to find

Finite Volume ApproximationsComputational Fluid Dynamics

Fj+1/ 2 =Uf j+1/ 2 −D∂f∂x j+1/ 2

≈12U ( f j+1 + f j) −D

f j+1 − f jh

⎝ ⎜ ⎞

Approximate:

Fj−1/ 2 =Uf j−1/ 2 −D∂f∂x j−1/ 2

≈12U ( f j + f j−1) −D

f j − f j−1h

⎝ ⎜ ⎞

and

ddt

fj ≈1Δt( fj

n+1 − fjn ) time derivative of f

Finite Volume Approximations

Page 12: Conservation Mass - University of Notre Damegtryggva/CFD-Course2017/Lecture-4...The conservation law must be stated as: Original Mass Mass Added Final Mass = + Mass Removed-time t+∆t

Computational Fluid Dynamics

hΔt( f jn+1 − f jn ) =

−U (12 ( f j+1 + f j ) − 12 ( f j + f j−1)) +D f j+1 − f j

h−f j − f j−1

h⎛

⎝ ⎜ ⎞

f jn +1 − f j

n

Δt+U2h( f j+1 − f j−1) =

Dh2

f j+1 − 2 f j + f j−1( )

Or, rearranging the terms:

Substituting:

Which is exactly the same as the finite difference equation if we take the average value to be the same as the value in the center of the cell

Finite Volume ApproximationsComputational Fluid Dynamics

Example:

U=1; D=0.05; k=1

N=21Δt=0.05

Exact

Numerical

Finite Volume Approximations

Computational Fluid Dynamics

The finite volume point of view has two main advantages over the finite difference point of view

1. Working directly with the conservation principle (no implicit assumption of smoothness and differentiability)

2. Easier visualization of how the solution is updated (the fluxes have a physical meaning)

Analysis of accuracy and stability is, however, usually easier using the finite difference point of view

Finite Volume ApproximationsComputational Fluid Dynamics

Most physical laws are based on CONSERVATION principles: In the absence of explicit sources or sinks, f is neither created nor destroyed.

For a control volume fixed in space, we can state the conservation of f as:

Finite Volume Approximations

Amount of f in a control volume after a given time interval Δt

Amount of f that flows into the control volume during Δt

Amount of f that flows out of the control volume during Δt

Amount of f in the control volume at the beginning of the time interval Δt

= + -

Computational Fluid DynamicsFinite Volume Approximations

Rate of increase of f in a control volume during a given time interval Δt

Net rate of flow of f into the control volume during the time interval Δt

=

This can be restated in rate form as:

The mathematical equivalent of this statement is:

ddt

f dv = − fu ⋅nCS!∫CV∫ ds

While we can derive a partial differential expression from this equation, often it is better to work directly with the conservation principle in integral form