The Finite Volume Method

33
The Finite Volume Method Ingo Philipp Flux Limiters TVD Computational Astrophysics

description

The Finite Volume Method. Flux Limiters TVD. Ingo Philipp. Computational Astrophysics. I ntegral F orm. impermeable wall. x 1. x 2. flow to the right. flow to the left. substance neither created nor destroyed in [x 1 , x 2 ]. - PowerPoint PPT Presentation

Transcript of The Finite Volume Method

Page 1: The Finite Volume  Method

The Finite Volume Method

Ingo Philipp

Flux Limiters TVD

Computational Astrophysics

Page 2: The Finite Volume  Method

Integral Form

x1 x2

impermeable wall

substance neither created nor destroyed in [x1, x2]

flow to the right

flow to the left

mass in [x1, x2] at time t2 > t1 in terms of the total mass at time t1 & the total (integrated) flux at each boundary during [t1, t2]

integral form of the conservation law!

Page 3: The Finite Volume  Method

differential form r(x,t) and v(x,t) are differentiable functions, i.e.

this doesn‘t hold if the densityis discontinuousThe integral form is more fundamental

physically and thus the appropriate

representationintegral form continues to be valideven for discontinuous solutions

DifferentialForm

Page 4: The Finite Volume  Method

a

dS

outflow

inflow

outflow defines a lost of some substance!

integral form

differential form:

differential form

balance law

General Form

Page 5: The Finite Volume  Method

The Finite Volume Method

xi xi+1xi-1

xi+1/2xi-1/2

Vi

Ui-1

UiUi+1

vertex centered

with

integral law is transferred to small control volumes

piecewise constant cell average for each

true for any

xNx1

U

stationary mesh – constant Dx

integrate over small time step Dt – how does the cell mean evolve in time?

mean evolution equation without approximation

Page 6: The Finite Volume  Method

1D & without sources Q

The Finite Volume Method

2D & flux approximation

(i,j)

xi+1/2xi-1/2

yj-1/2

yj+1/2

(0,1)

(0,-1)

(1,0)(-1,0)

Dx

Dy

quadrature – mid-point rule with

the true flux at the interfaces is replaced by a numerical flux function based on

Page 7: The Finite Volume  Method

use the cell averages to compute a polynomial representation of U for each cell

the easy way out: polynomial of 0th order

we could instead assume a linear behavior for

for

xi

xi-1 xi+1

the average value of over the control volume is regardless of the slope

where

Piecewise Linear Reconstruction

Page 8: The Finite Volume  Method

new set of variables and gives with

The Advection Equation

solve with IC

x t

characteristic

x

t

characteristic

profile doesn‘t change in shape – it shifts in positive v>0 orin negative v<0 direction

and

x

t

tn

DOD for U(x,t) is just the single point (x-v(t-tn), tn)

Page 9: The Finite Volume  Method

The Advection Equation

since we know the analytical solution we are able to compute the flux integrals(numerical flux functions) with the help of the polynomial reconstructed , i.e.

char

acte

ristic

s

tn

tn+1

xi-1 xi xi+1

and

characteristics

outflow – backtrack into ith cell at the nth

time levelinflow – backtrack into (i-1)th cell at the nth

time level

for

Page 10: The Finite Volume  Method

The Advection Equation

tn

tn+1

xi-1 xi xi+1

Page 11: The Finite Volume  Method

Choice of Slopes

upwind (Godunov‘s method)

centered slope (Fromm)

upwind slope (Beam-Warming)

downwind slope (Lax-Wendroff)

numerical DOD contains physical DOD & von Neumann stable if

Page 12: The Finite Volume  Method

upwind (Godunov‘s method)

UpwindU

(x,t

)

x

local discretization error

numerical diffusion

artificial diffusion

Page 13: The Finite Volume  Method

downwind slope (Lax-Wendroff)

Lax Wendroff

U(x

,t)

x

local discretization error

numerical dispersion

artificial diffusion

Page 14: The Finite Volume  Method

Beam Warming

upwind slope (Beam-Warming)

U(x

,t)

x

local discretization error

numerical dispersion

Page 15: The Finite Volume  Method

Beam Warming

upwind slope (Beam-Warming)

U(x

,t)

x

periodic boundary condition

Page 16: The Finite Volume  Method

centered slope (Fromm)

FrommU

(x,t

)

x

local discretization error

numerical dissipation

Page 17: The Finite Volume  Method

What went wrong ?downwind slope (Lax-Wendroff) applied to

1

0

J J+1J-1

initial profile

Page 18: The Finite Volume  Method

What went wrong ?downwind slope (Lax-Wendroff) applied to

1

0

J J+1J-1

Page 19: The Finite Volume  Method

What went wrong ?downwind slope (Lax-Wendroff) applied to

1

0

J J+1J-1

J J+1J-1

tn

tn+1

tn+2

J J+1

Page 20: The Finite Volume  Method

What went wrong ?downwind slope (Lax-Wendroff) applied to

1

0

J J+1J-1

J J+1J-1

tn

tn+1

tn+2

J J+1

1.125

0.375

overshoot

overshoot

Page 21: The Finite Volume  Method

What went wrong ?downwind slope (Lax-Wendroff) applied to

1

0

J J+1J-1

0.7

1.172

0.98

0.14

over

shoo

tov

ersh

oot

over

shoo

t

unde

rsho

ot

initial profile

Page 22: The Finite Volume  Method

What went wrong ?any negative slope in the Jth cell leads to a volume average > 1 at tn+1

to avoid oscillations just set the slope to zero

gives 1st order upwind method

but in smooth regions we want 2nd order accuracy (Lax-Wendroff)

benefit from both

near a discontinuity we may want to limit the slope in smooth regions we choose sth. like the Lax-Wendroff slope

…how much should we limit the slope? …how to control the flux?

…how do we measure oscillations in the solution?

TOTAL VARIATION

Page 23: The Finite Volume  Method

Flux Limiter …how to control the flux?

the time averaged flux at the interface should now be determined by the jump

gives us a jump

limited version of the jump

flux limiter function

for

measure of the smoothness of the data near

in smooth regions and

far from 1 near a discontinuity

we might want a flux limiter f function thathas values near 1 for q~1, but that reducesor increases the slope where the data is not

smooth

for

xi xi+1xi-1xi-2

Page 24: The Finite Volume  Method

upwind (Godunov‘s method)

centered slope (Fromm)

upwind slope (Beam-Warming)

downwind slope (Lax-Wendroff)

Flux Limiter

Page 25: The Finite Volume  Method

Total Variation

1

-1

0 p 2p

How does f(x) vary on [a,b] ?

supremum of sums over all partitions

to avoid oscillations we require that the method doesn‘t increase the total variation (TVNI)

for any starting data

Amiram Harten* (1983)

*High Resolution Schemes for Hyperbolic Conservation Laws

a TVNI scheme is monotonicity preserving

a monotone scheme is TVNIif initial condition is then

Godunov‘s theoremmonotone schemes can be at

most 1st order accurate

Page 26: The Finite Volume  Method

Harten’s Theorem

may in general be data dependent

THEOREM For any scheme of the above form, a sufficient condition for the scheme to be TVNI is that the coefficients satisfy

advection equation

for all values of and

and

CFL

if we are at an extremum and we should take

Osher and Chakravarthy (1984)TVD schemes must degenerate to 1st order accuracy at extremal points

Page 27: The Finite Volume  Method

1

2

2 31 Godunov

Fromm

Beam

-War

min

g

Lax-Wendroff

2nd order TVNI

andTotal Variation

1

2

2 31 Godunov

Fromm

Beam

-War

min

g

Lax-Wendroff

TVNI

none of these linear limiters generate a TVNI scheme

* High resolution schemes using flux-limiters for hyperbolic conservation laws

P.K. Sweby* (1984)

any 2nd order scheme relying on must be a weighted average of the LW and BW scheme

Page 28: The Finite Volume  Method

MinModU

(x,t

)

x

1

2

2 31

minmod

2nd order TVNI

slope limiter version

Godunov‘s methodupwind

Beam-Warming upwind slope

Lax-Wendroffdownwind slope

Page 29: The Finite Volume  Method

MonotonizedCentral Difference

U(x

,t)

x

MC

2nd order TVNI

2 31

1

2

slope limiter version

Godunov‘s methodupwind

~Beam-Warming upwind slope

~Lax-Wendroffdownwind slope

Frommcentered slope

Page 30: The Finite Volume  Method

Referenceswww.cfd-online.com

Page 31: The Finite Volume  Method

Upwind & CFL

updating scheme = upwind

tn

tn+1

tn

tn+1

information travels less than one grid cellin one time step

information travels more than one grid cellin one time step

necessary CFL stability conditionfulfilled

upwind method certainly unstable!

Page 32: The Finite Volume  Method

upwind (Godunov‘s method) centered slope (Fromm)

upwind slope (Beam-Warming) downwind slope (Lax-Wendroff)

Numerical Solution

x

U(x

,t)

Page 33: The Finite Volume  Method

downwind slope (Lax-Wendroff)

Lax Wendroff

U(x

,t)

x

periodic boundary condition