Professional Documents
Culture Documents
http://www.nd.edu/~gtryggva/CFD-Course/!
Advection !
Grtar Tryggvason! Spring 2011!
0.5
-0.5
10
20
30
40
50
60
70
80
df j dt
1 n F Fjn1/ 2 h j +1/ 2
The time integration can, in principle, be done by any standard ODE solver, although in practice we often use second order Runge-Kutta methods!
1 FjL = f j + ( r ) f j f j 1 + 1/ 2 2
r=
f j +1 f j f j f j 1
For the linear advection equation, it is possible to do the advection step exactly, since the solution simply moves with uniform velocity. This allows us to see the central role played by the reconstructed slopes in each cell!
(r ) = 1 (r ) = 0
f j !1
!=
U"t h
To prevent oscillations, apply LIMITERS to reduce the slopes where they will cause oscillations but leave then where they do not!
f j 1 fj f j +1 f j+2
j-1
j!
U!t
fj
f jn +1 = f jn + s j ( x ! x j )
f j !1
sj hf jn +1 = f jn U t h U t 2
)
j-1
!
j-1
j!
j!
j+1
j+2
1 f jL = f j + ( r ) f j f j 1 + 1/ 2 2
r=
f j +1 f j f j f j 1
r<0 local change of sign of the slopes! r<1 slope change! r=1: same slopes (linear f)! r>1 slope change!
To design schemes that prevent the emergence of unphysical oscillations, we need a precise denition of what we mean by no oscillations. A few such criteria have been proposed but the most widely used on is based on the Total Variation, dened by!
TV =
f dx x
r<0: revert to low order uxes by taking the limiter to be zero! r=1: take the limiter to be 1!
It can be shown that many equations have the property that the Total Variation of the solution cannot grow in time. Schemes that preserve that behavior are generally referred to as Total Variation Diminishing (TVD) schemes.!
0 (r ) r
!( r)
r 0
r= f j +1 f j f j f j 1
! = 2r
!=r
Beam-Warming!
2
Lax-Wendroff!
=1
r=
f j +1 f j f j f j 1
(r ) 1 = ( ) r r
In many papers, r is dened as the inverse of the one used here!
3
r
! = 2r
!=r
Beam-Warming!
2
Lax-Wendroff!
r=
f j +1 f j f j f j 1
3
r
r=
f j +1 f j f j f j 1
minmode!
2 1.8
( r ) = max[0,min(1, r )]
!( r)
1.6
1.4
! = 2r
!=r
2
minmod!
1.2
0.8
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
3
r
r=
f j +1 f j f j f j 1
2 1.8
Superbee!
1.6
1.4
! = 2r
!=r
1.2
superbee! Superbee is generally found to be too compressive and generates steps in smooth regions!
0.8
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
3
r
r=
f j +1 f j f j f j 1
2 1.8
(r ) =
!( r)
r+ r 1+ r
!=r
1.6
1.4
! = 2r
1.2
0.8
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
r=
f j +1 f j f j f j 1
( r ) = max[0,min(2r ,( r + 1) / 2,2)]
!( r)
1.6
1.4
! = 2r
!=r
1.2
0.8
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
r=
f j +1 f j f j f j 1
1.6
1.4
! = 2r
!=r
1.2
Sweby, beta=1.5! An example of a limiter with abrupt switching that traverses the interior of the allowable region!
0.8
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
3
r
Superbee!
MUSCL!
%-----------------------! % rst order upwind! fuo=fu; for i=2:n-1,fu(i)=fuo(i)-(dt/h)*(fuo(i)-fuo(i-1)); end! fu(1)=fuo(1)-(dt/h)*(fuo(1)-fuo(n-1));fu(n)=fu(1);! time=time+dt;! end;! f=zeros(n,1);! for i=1:n, if (x(i)>=0.0 & x(i)<=0.6), f(i)=exp(-100*(x(i)-0.3)^2); end; end; ! for i=1:n, if (x(i)>=0.6 & x(i)<=0.8), f(i)=1.0; end; end; %initial conditions! hold on;plot(x,f,'k','linewidt',2);! % print -depsc tempg!
abdquckest!
t = f ( F jn+1/ 2 F jn1/ 2 ) 2h
n j
Variables!
= 1
t n (F j +1/ 2 F jn1/ 2 ) 2h 1 1/ 2 f jL+1/ 2 = f jn +1/ 2 + ( f jn +1/ 2 f jn+ ) 1 2 1 1/ 2 1/ 2 f jR+1/ 2 = f jn++ ( f jn++ f jn +1/ 2 ) 1 1 2 f jn +1/ 2 = f jn
1/ 2 L R F jn++ 1/ 2 = F ( f ) j +1/ 2 , ( f ) j +1/ 2 n +1/ 2 n +1/ 2
= 1
Find:!
)
n +1/ 2 j 1/ 2
Final step!
f jn +1 = f jn
n +1 j
([
[F
n j 1/ 2
L j 1/ 2
(F
n j 1/ 2
] )])
The approach described here has, on the whole, been a very successful one, but the difculty of preserving sharp discontinuity at the same time as we accurately advect smooth solutions continues to be a challenge and several groups continue to advance the state of the art.! We will discuss some of those very briey next time and talk about the challenges in applying these ideas to the full nonlinear and multidimensional Euler equations! In addition to the use of nonlinear methods to capture shocks, such methods are increasingly being used for the advection part of Navier-Stokes solvers!
Multi-dimensional ow !
f f f +u +v =0 t x y
Multidimensional hyperbolic problems are generally done using SPLITTING, where each coordinate direction is treated separately!
Unsplit!
f i,nj+1 = f i,nj +
f f f +u +v =0 t x y
Fully unsplit!
fi ,nj+1 = fi ,nj + uvt 2 n fi 1, j 1 fi ,nj h2 u t n vt + (1 vt ) 2 fi 1, j fi ,nj + (1 u t ) 2 fi ,nj 1 fi ,nj h h u t n vt n = fi ,nj + fi 1, j fi ,nj + fi , j 1 fi ,nj h h uvt 2 n n n + fi 1, j 1 fi n 1, j fi , j 1 + fi , j 2 h
f f f +u +v =0 t x y
Time splitting! First!
n f i* , j = f i, j +
then!
f i,nj+1 = f i* ,j +
25
1
20
0.5
15
0 30 25 20 15 10 5 0 0 5 15 10 20 25 30
10
10
15
20
25
30
30
30
25
25
20
20
15
15
10
10
Time-split!
5 10 15 20 25 30
Unsplit!
5 10 15 20 25 30
for l=1:nstep,l,time hold 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,end for 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=gure; contour(f,10);axis square;