7/27/2019 2011-Lecture-15.pdf
1/7
Computational Fluid Dynamics
Advection
Grtar Tryggvason!Spring 2011!
http://www.nd.edu/~gtryggva/CFD-Course/!
Computational Fluid Dynamics
Godunov Theorem (1959):!
Monotone behavior of a numerical solution cannot
be assured for linear finite-difference methods with
more than first-order accuracy.!
Godunovs Theorem!
5 7- .
.
.
Computational Fluid Dynamics
Flux LimitersReview
Computational Fluid Dynamics
The separation of space and time discretization is
generalized in the Method of Lines, where we convertthe PDE into a set of ODEs for each grid point bywriting:!
dfj
dt=1
hF
j+1/2
nF
j1/2
n( )
The time integration can, in principle, be done by any
standard ODE solver, although in practice we often
use second order Runge-Kutta methods!
Higher Order Methods!
Computational Fluid DynamicsFor the Linear Advection equation we have:!
r=f
j+1 f
j
fj f
j1
(r) =1
2;
(r) =r
2+
1
2;
(r) = r;
Second order upwind!
Fromms scheme!
Centered scheme (Beam-Warming)!
F
j+1/2
L= f
j+
1
2(r) f
j f
j1( )
Higher Order Methods!
Lax-Wendroff!
First order upwind!
(r) = 1
(r) = 0
Computational Fluid Dynamics
For the linear advection equation, it is possible to
do the advection step exactly, since the solution
simply moves with uniform velocity. This allows usto see the central role played by the reconstructed
slopes in each cell!
Higher Order Upwind!
7/27/2019 2011-Lecture-15.pdf
2/7
Computational Fluid DynamicsHigher Order Upwind!
j!j-1!
fj!1
jf
U!t
hfjn+1
= fjn h !U"t( )+U"tfj!1n
j!j-1!
fj!1
jf
U!t
fjn+1
= fjn+ sj x ! x j( )
hfj
n+1= f
j
n sj
2Ut
h Ut( )
+ fj1n+
sj1
2h Ut( )
Utfj1
n
fin+1
= fjn1! "( )+ "fj!1
n
f
j
n+1= f
j
n(1 ) + fj1
n
h
2(1 )(s
js
j1)
!=U"t
h
Computational Fluid Dynamics
j j+1!j-1! j+2!
1+jf 2+jf
jf1jf
Near shocks the linear reconstruction leads to over and
undershoots.!
To prevent oscillations, apply LIMITERS to reduce theslopes where they will cause oscillations but leave thenwhere they do not!
Many possible limiters can be designed!
Higher Order Upwind!
Computational Fluid Dynamics
In Gudunov like methods, the solution process consists
of three steps:!
1. Reconstruction of the solution in each cell!2. Advection of the solution, using the fluxes from one
cell to the next one!3. Construction of the average solution in each cell!
Only the reconstruction of the solution can lead tooscillations!
Higher Order Upwind!
Computational Fluid Dynamics
Designing Limiters:The Sweeby
diagram
Computational Fluid Dynamics
f
j+1/2
L= f
j+
1
2(r) f
j f
j1( )
r=f
j+1 f
j
fj f
j1
r
7/27/2019 2011-Lecture-15.pdf
3/7
Computational Fluid Dynamics
It can be shown that for a scheme to be second order
and TVD, the limiter must lie in the shaded region.!
1 2 3
1
2
r
! r( )
! = 2r
r=f
j+1 f
j
fj f
j1
! = r
Lax-Wendroff
Beam-Warming!
=1
Limiters!
Computational Fluid Dynamics
It has been found that it is also best to take the limiterto be between Lax-Wendroff and Beam Warming!
0 (r) r r 0
r=f
j+1 f
j
fj f
j1
(r)
r
= (1
r
)
Generally we also require thelimiters to be symmetric!
In many papers, r is defined as the inverse of the one used here!
Limiters!
Computational Fluid Dynamics
Using the limitations given by second order accuracy, TVD and
the requirement that the limiters lie between Lax-Wendroff andBeam-Warming, gives the Sweby-Diagram. !
The limiters must lie in the shaded region!
1 2 3
1
2
r
! r( )
! = 2r
! = r
Lax-Wendroff
Beam-Warming!
r=f
j+1 f
j
fj f
j1
Limiters!
Computational Fluid Dynamics
The Sweby region is not the only one that is used todesign limiters, but it is by far the most widely used. A
very large number of limiters have been proposed thatfall within this region. See, for example: !
N. P. Waterson and H. Deconinck. Design Principles
for bounded high-order convection schemesaunified approac. JCP 224 (2007), 182-207!
This paper treats only steady state problems.!
Limiters!
Computational Fluid Dynamics
The Minmod Limiter (Roe and others) !
1 2 3
1
2
r
! r( )
!=
2r
! = r
minmod!
r=f
j+1 f
j
fj f
j1
(r) = max[0,min(1,r)]
Simple and
generally workswell. Fairlydissipative!
Limiters!
Computational Fluid Dynamics
minmode!
T=1.0; h=0.01; dt=h/3!
Limiters!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
7/27/2019 2011-Lecture-15.pdf
4/7
Computational Fluid Dynamics
The Superbee Limiter (Roe)!
1 2 3
1
2
r
! r( )
! = 2r
! = r
superbee!
r=
fj+1
fj
fj fj1
(r) = max[0,min(2r,1),min(r,2)]
Superbee is generallyfound to be too
compressive andgenerates steps insmooth regions!
Limiters!
Computational Fluid Dynamics
Superbee!
T=1.0; h=0.01; dt=h/3!
Limiters!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Computational Fluid Dynamics
The original van Leer limiter!
1 2 3
1
2
r
! r( )
! = 2r
! = r
van Leerlimiter!
r=f
j+1 f
j
fj f
j1
(r) =
r+ r
1+ r
Smoothvariationno
abrupt switches!
Limiters!
Computational Fluid Dynamics
van Leer limiter!
T=1.0; h=0.01; dt=h/3!
Limiters!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Computational Fluid Dynamics
The MUSCL Limiter!
1 2 3
1
2
r
! r( )
!=
2r
! = r
MUSCL!
r=f
j+1 f
j
fj f
j1
(r) = max[0,min(2r,(r+1) / 2,2)]
One of the original
suggestions by vanLeer!
Limiters!
Computational Fluid Dynamics
T=1.0; h=0.01; dt=h/3!
The MUSCL Limiter!
Limiters!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
7/27/2019 2011-Lecture-15.pdf
5/7
Computational Fluid Dynamics
The Sweby Limiter (Sweby)!
1 2 3
1
2
r
! r( )
! = 2r
! = r
Sweby, beta=1.5!
r=
fj+1
fj
fj fj1
(r) = max[0,min(r,1),min(r,)]; 1 2
An example of a limiterwith abrupt switching
that traverses theinterior of the allowableregion!
Limiters!
Computational Fluid Dynamics
T=1.0; h=0.01; dt=h/3!
The Sweby Limiter (Sweby)!
Limiters!
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Computational Fluid Dynamics
minmode!
Superbee!
van Leer limiter!
MUSCL!
Sweby!
Limiters!
Computational Fluid DynamicsLimiters!
for m=1:nstep,m,time!hold off;plot(x,f,'linewidt',2); %axis([1 n 2.0, 4.5]); %plot solution !hold on;plot(x,fu,'r','linewidt',2);axis([0 length 0 2]); pause(0.1)!
foo=f;!for is=1:2 %two steps per timestep!fo=f;!for i=2:n-1, !bot=(fo(i)-fo(i-1));top=(fo(i+1)-fo(i)); r=top*bot/(bot^2+0.00001);!% Limiters!% psi=max([0, min([2*r,0.5*(r+1),2])]); % monotonized central (MC)!psi=max([0, min([1.5*r,1]),min([r,1.5]) ]); % Sweby !% psi=max([0, min([2*r,1]),min([r,2])]); % superbee gtext('superbee')!% psi=max([0, min([r,1])]); % minmod gtext('MINMOD')!% psi=(r+abs(r))/(r+1); % van Leer!% psi=0; % upwind!% psi=r;!fh(i)=fo(i)+0.5*psi*(fo(i)-fo(i-1));!
end;!
bot=(fo(1)-fo(n-1));top=(fo(2)-fo(1)); r=top*bot/(bot^2+0.00001);!% psi=max([0, min([2*r,0.5*(r+1),2])]); % monotonized central (MC)!psi=max([0, min([1.5*r,1]),min([r,1.5]) ]); % Sweby !% psi=max([0, min([2*r,1]),min([r,2])]); % superbee!% psi=max([0, min([r,1])]); % minmod!% psi=(r+abs(r))/(r+1); %van Leer!% psi=0; % upwind!% psi=r;!fh(1)=fo(1)+0.5*psi*(fo(1)-fo(n-1)); fh(n)=fh(1);!
for i=2:n-1,!f(i)=fo(i)-(dt/h)*(fh(i)-fh(i-1) );!
end;!
f(1)=fo(1)-(dt/h)*(fh(1)-fh(n-1) );f(n)=f(1);!end!
for i=1:n,f(i)=0.5*(f(i)+foo(i)); end % average the solution for second oder time step !
% one-dimensional linear advection using flux limiters !% This looks like the final and complete version of the program !% Feb. 21, 2011!%------------------------------------------------------------ !n=101; nstep=300; length=1.0;h=length/(n-1);!dt=0.333333333*h; time=0.0; for i=1:n, x(i)=h*(i-1);end!
f=zeros(n,1);fo=zeros(n,1);fh=zeros(n,1);foo=zeros(n,1);!fu=zeros(n,1);fuo=zeros(n,1);!for i=1:n, if (x(i)>=0.0 & x(i)=0.6 & x(i)=0.0 & x(i)=0.6 & x(i)
7/27/2019 2011-Lecture-15.pdf
6/7
Computational Fluid Dynamics
fjn+1/ 2
= fjnt
2hFj+1/ 2
n Fj1/ 2
n( )
fjn+1
= fjnt
hFj+1/ 2
n+1/ 2 Fj1/ 2
n+1/ 2( )
Fj+1/ 2n+1/ 2
= F fL( )
j+1/ 2
n +1/ 2
, fR( )
j+1/ 2
n +1/ 2
( )
Predictor step!
Variables!
fj+1/ 2L
= fjn+1/ 2
+1
2
Lfj
n+1/ 2 fj1
n+1/ 2( )
fj+1/ 2
R= fj+1
n+1/21
2
R fj+1
n+1/ 2 fj
n+1/2( )
Final step!
Limiting the variables:!
=1
Find:!
Limiters!
Computational Fluid Dynamics
fj
n+1/ 2= f
j
nt
2hF
j+1/ 2
n Fj1/ 2
n( )
fjn+1
= fjnt
hFj+1/ 2
n+j+1/ 2
LFj+1/ 2
n+1/ 2 Fj+1/ 2
n( )[ ](
Fj1/ 2n
+j1/ 2L
Fj1/ 2n+1/ 2
Fj1/ 2n( )[ ])
Fj+1/ 2n+1/ 2
= F fL( )
j+1/ 2
n+1/ 2
, fR( )
j+1/ 2
n+1/ 2
( )
Predictor step!
Variables!
Find:!
fj+1/ 2
L= f
j
n+1/ 2+1
2f
j
n+1/ 2 f
j1
n+1/2( )
fj+1/ 2
R= fj+1
n+1/ 2
1
2f
j+1
n+1/ 2 fj
n+1/ 2( )
Final step!
=1
Limiting the Fluxes!
Limiters!
Computational Fluid Dynamics
The approach described here has, on the whole, been a
very successful one, but the difficulty of preserving sharpdiscontinuity at the same time as we accurately advectsmooth solutions continues to be a challenge and
several groups continue to advance the state of the art.!
We will discuss some of those very briefly next time andtalk about the challenges in applying these ideas to the
full nonlinear and multidimensional Euler equations!
In addition to the use of nonlinear methods to captureshocks, such methods are increasingly being used forthe advection part of Navier-Stokes solvers!
Computational Fluid Dynamics
Multi-dimensional
flow
Computational Fluid Dynamics
Multidimensional hyperbolic problems aregenerally done using SPLITTING, where
each coordinate direction is treatedseparately!
Multidimensional Flow!
Computational Fluid Dynamics
Split versus unsplit advection!
fi, jn+1
= fi, jn+
ut
hfi1, j
n fi, j
n( ) +vt
hfi, j1
n fi, j
n( )
f
t+ u
f
x+ v
f
y= 0
Unsplit!
Multidimensional Flow!
7/27/2019 2011-Lecture-15.pdf
7/7
Computational Fluid Dynamics
Split versus unsplit advection!
ut!
vt!
(1-u) t!
(1-v)t!
fi, jn+1
= fi, jn+
uvt2
h2
fi1, j1n
fi, jn( )
+ (1 vt)ut
h2
fi1, jn
fi, jn( )+ (1 ut)
vt
h2
fi, j1n
fi, jn( )
= fi, jn+
ut
hfi1, j
n fi, j
n( )+vt
hfi, j1
n fi, j
n( )
+uvt
2
h2
fi1, j1n
fi1, jn
fi, j1n
+ fi, jn( )
f
t+ u
f
x+ v
f
y= 0
Fully unsplit!
Multidimensional Flow!
Computational Fluid Dynamics
Time splitting!
fi, j*
= fi, jn+
ut
hfi1, j
n fi, j
n( )
fi, jn+1
= fi, j*+
vt
hfi, j1
* fi, j
*( )
First!
then!
f
t+ u
f
x+ v
f
y= 0
Multidimensional Flow!
Computational Fluid Dynamics
0
510
1520
2530
0
5
10
15
20
25
30
0
0.5
1
1.5
5 1 0 1 5 20 25 3 0
5
10
15
20
25
30
5 10 15 20 25 30
5
10
15
20
25
30
5 10 15 20 25 30
5
10
15
20
25
30
Time-split! Unsplit!
Multidimensional Flow!
Computational Fluid Dynamics% two-dimensional timesplit advection using first order upwind %------------------------------------------------------------n=32;m=32;nstep=35;length=2.0;h=length/(n-1);dt=0.3*h;f=zeros(n,m);fo=zeros(n,m);f1=zeros(n,m);time=0.0;u=1.0; v=1.0; cx=0.35;cy=0.35;
for i=2:n-1, for j=2:m-1r=sqrt((cx-h*(i-1))^2+(cy-h*(j-1))^2);if(r < 0.2) f(i,j)=1.0;end
end,endfor l=1:nstep,l,timehold off;mesh(f); axis([0 n 0 m 0 1.5]);pause;
fo=f;for i=2:n-1, for j=2:m-1
f1(i,j)=fo(i,j)-(dt*u/h)*(fo(i,j)-fo(i-1,j));end,endfor i=2:n-1, for j=2:m-1
f(i,j)=f1(i,j)-(dt*v/h)*(f1(i,j)-f1(i,j-1)); end,end time=time+dt;
end;f2=figure; contour(f,10);axis square;
Multidimensional Flow!
Computational Fluid Dynamics
Splitting thus recovers some properties of theexact advection by allowing flux from diagonal
cells. This is one reason for focusing on one-dimensional schemes, since doingmultidimensional flow by splitting is actually better
than multidimensional discretization of the originalequations!
Multidimensional Flow!