The Finite Volume Method
description
Transcript of The Finite Volume Method
The Finite Volume Method
Ingo Philipp
Flux Limiters TVD
Computational Astrophysics
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!
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
a
dS
outflow
inflow
outflow defines a lost of some substance!
integral form
differential form:
differential form
balance law
General Form
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
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
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
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)
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
The Advection Equation
tn
tn+1
xi-1 xi xi+1
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
upwind (Godunov‘s method)
UpwindU
(x,t
)
x
local discretization error
numerical diffusion
artificial diffusion
downwind slope (Lax-Wendroff)
Lax Wendroff
U(x
,t)
x
local discretization error
numerical dispersion
artificial diffusion
Beam Warming
upwind slope (Beam-Warming)
U(x
,t)
x
local discretization error
numerical dispersion
Beam Warming
upwind slope (Beam-Warming)
U(x
,t)
x
periodic boundary condition
centered slope (Fromm)
FrommU
(x,t
)
x
local discretization error
numerical dissipation
What went wrong ?downwind slope (Lax-Wendroff) applied to
1
0
J J+1J-1
initial profile
What went wrong ?downwind slope (Lax-Wendroff) applied to
1
0
J J+1J-1
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
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
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
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
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
upwind (Godunov‘s method)
centered slope (Fromm)
upwind slope (Beam-Warming)
downwind slope (Lax-Wendroff)
Flux Limiter
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
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
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
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
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
Referenceswww.cfd-online.com
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!
upwind (Godunov‘s method) centered slope (Fromm)
upwind slope (Beam-Warming) downwind slope (Lax-Wendroff)
Numerical Solution
x
U(x
,t)
downwind slope (Lax-Wendroff)
Lax Wendroff
U(x
,t)
x
periodic boundary condition