Vous êtes sur la page 1sur 15

JMBC-CFD-1, 2008 Pra

ti al Barry Koren, Part 1

1 Analysis of a partial di erential equation from uid dy-


nami s
Starting from the Euler equations of gas dynami s, the full potential equation,
2 2  2
( 2 u2) x2 + ( 2 v2) y2 2uv xy = 0; (1)
an be derived. In here, is the speed of sound and  the velo ity potential, for whi h
it holds (u; v) = ( x ; y ), with (u; v) the velo ity ve tor.
For the omputation of transoni ows around slender bodies (v  u), potential equation
(1) an be simpli ed to the transoni small perturbation (TSP) equation:
 
2 2   2   2 
1 M ( + 1)M x x2 + y2 = 0;
1 1
(2)
where M is the Ma h number at the in ow boundary and  the perturbation-velo ity
potential, for whi h it holds (u ; v ) = (   ) with (u ; v ) the perturbation velo ity,
1
0 0
;
x y
0 0

and with here the following relation between  and :


 = u x + :
1 (3)
A still simpler (be ause linear) equation is the Prandtl-Glauert equation
2 2
1 M 2  x2 + y2 = 0;
1
(4)
the rst-order approximation of the TSP equation. The Prandtl-Glauert equation is
either hyperboli or ellipti , depending on M . 1

1. Derive for whi h values of M the Prandtl-Glauert equation is hyperboli , and for
whi h values it is ellipti .
1

1
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 1

2. Consider the hyperboli ase of (4) and 


derivepthat the Riemann invariants and their
 along pM 2
orresponding hara teristi
p
lines are y
p
M1
2 1 x 1
1y x =
onstant, and y + M 2 1 x along M 2 1y + x = onstant.

1

1

2
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 1

3. Consider the 2D hannel given in Figure 1. The lower and upper wall are solid
walls. The hannel has a thin pro le at its lower wall. The hannel's left boundary
(x = 0) is in ow boundary and the right boundary (x = 3) out ow boundary.
y

y= f(x)

0 x
0 1 2 3

Figure 1: Channel

Give boundary onditions for the Prandtl-Glauert equation, at all four boundaries,
for su essively supersoni and subsoni in ow in the hannel.
Note that x = 0 at both the inlet and outlet yields a boundary-value problem
with Neumann onditions at all boundaries, whi h is ill-posed. (The solution  is
determined up to a onstant then.) At { at least { the inlet or the outlet, a Diri hlet
ondition for  must be imposed.
1

supersonic channel

0
0 1 2 3

subsonic channel

0
0 1 2 3

3
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 1

2 Analysis of some nite-di eren e s hemes for the linear


onve tion equation
As a model equation for the unsteady, 1-D Euler equations, we onsider the linear, s alar
onve tion equation
u
t
+ a u
x
= 0; with a a positive or negative onstant. (5)
1. Show with the modi ed equation for the upwind s heme { equation (39) in the
paper \Hyperboli Problems" from the le ture notes { that the upwind s heme is
higher than rst-order a urate for axt = 1. (In fa t, the upwind s heme is exa t
for axt = 1.)
Hint: derive the relation between t22u and x2u2 by ombining the two equations that
are obtained by di erentiating the modi ed equation with respe t to t and by dif-
ferentiating it with respe t to x.

4
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 1

2. Derive the modi ed equation for the leapfrog s heme, with respe t to grid point
m; l as given in Figure 14 of the paper \Hyperboli Problems" from the le ture notes.

5
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 1

3. Derive with Von Neumann stability analysis the ampli ation fa tor of the Lax-
Friedri hs s heme and the leapfrog s heme, and from that, for both s hemes, the
stability requirement on t.

6
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

1 Finite-di eren e methods applied to linear onve tion problem with


smooth initial solution
In this omputer exer ise the wave-propagation properties of some lassi al nite-di eren e s hemes will be
investigated for the linear onve tion equation
+ = 0 with a positive or negative onstant.
u

t
a
u

x
; (1) a

The spatial domain runs from = 0 to = 1 and is taken periodi , that is, the boundaries = 0 and = 1
x x x x

are glued together (the orresponding grid points, = 1 and = , oin ide). i i n

As initial solution we take a Gaussian entered around = 21 : x

( = 0) = 4( 12 )2 u x; t (2) b
x
;

with a parameter determining the width of the Gaussian. Asked in all ases: the solution at = 1, that
b t

is, after one period. The exa t dis rete solution ( = 1) is identi al to the initial solution. It is given in u x; t

Figure 1.
1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 1: Exa t dis rete solutions for b = 0:01 and from left to right: n = 21; 41; 81.

Use the Matlab program linearflow.m. This program is pre-programmed with the forward-in-time, entral-
in-spa e nite di eren e s heme, as dis ussed in Se tion 3.1 of the paper \Hyperboli Problems" from the
le ture notes (s heme number 0 in the Matlab program). Start by running the Matlab program and observe
the instability of this s heme for any value of
  (3)
a t

x
:

On your s reen the exa t dis rete solution is given in blue and the nite-di eren e solution in red.
You pro eed by implementing and testing the alternative s hemes des ribed in su essively Se tions 3.2.1 {
3.2.4 of the le ture notes: (i) the forward-in-time, upwind-in-spa e s heme, (ii) the Lax-Friedri hs s heme,
(iii) the leapfrog s heme, and (iv) the Lax-Wendro two-step s heme. For onvenien e, the fully pre-
programmed Matlab program linearflow-mother.m may also be used.
1.1 Forward-in-time, upwind-in-spa e s heme
1. Implement this s heme and run it for su essively = 1 1, = 1 0 and = 0 9, for in all three ases: : : :

= 41, = 1 and = 0 01. Sket h your numeri al solutions in the three graphs following next. In
n a b :

1
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

ea h of the three graphs the exa t dis rete solution has been pre-plotted. You may give omments, in
the box below the graphs, on ea h of the three numeri al solutions.
1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 2: Forward-in-time, upwind-in-spa e s heme, from left to right: = 1:1, = 1:0 and = 0:9.

2. Redo the same omputations as above, but now with = 1 instead of = 1 (wave travelling to the a a

left instead of to the right). Sket h your numeri al solutions in the three graphs given below and give
omments.
1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 3: Forward-in-time, upwind-in-spa e s heme, a = 1, from left to right: = 1:1, = 1:0 and = 0:9.

2
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

3. The parameter determines the width of the Gaussian. Take = 21, = 1 and = 0 5, and run
b n a :

the program for su essively = 10 2, = 10 4 and = 10 6. Sket h your numeri al solutions in


b b b

the three graphs given below, in whi h the exa t dis rete solutions have been pre-plotted. What do
you observe in the numeri al resolution of the maximum in the wave? Do you have an explanation for
this?
1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 4: Forward-in-time, upwind-in-spa e s heme, from left to right: b = 10 2 , b = 10 4 and b = 10 6 .

4. The Matlab program gives the 1-norm of the di eren e between the exa t dis rete solution at = 1
L t

and the numeri al solution. In the program this error is simply named error. Take = 1, = 0 01 a b :

and = 0 9, run the program for su essively = 21 41 81, ll in the errors in the table given below
: n ; ;

and investigate the order-of-a ura y-behavior of the s heme from these data.
1 -norm error n L

21
41
81
Table 1: Error behavior forward-in-time, upwind-in-spa e s heme.

3
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

1.2 Lax-Friedri hs s heme


1. Implement this s heme and run it for su essively = 1 1, = 1 0 and = 0 9, for in all three ases: : : :

= 41, = 1 and = 0 01. Sket h your numeri al solutions in the three graphs given below and give
n a b :

omments on ea h of the three numeri al solutions.


1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 5: Lax-Friedri hs s heme, from left to right: = 1:1, = 1:0 and = 0:9.

2. Take = 1, = 0 01 and = 0 9, run the program for su essively = 21 41 81, ll in the errors
a b : : n ; ;

in the table given below and investigate the order-of-a ura y-behavior of the Lax-Friedri hs s heme
from these data.
1 -norm error n L

21
41
81
Table 2: Error behavior Lax-Friedri hs s heme.

4
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

1.3 Leapfrog s heme


1. Implement this s heme and run it for su essively = 1 1, = 1 0 and = 0 9, for in all three ases: : : :

= 41, = 1 and = 0 01. Sket h your numeri al solutions in the three graphs given below and give
n a b :

omments on ea h of the three numeri al solutions.


1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 6: Leapfrog s heme, from left to right: = 1:1, = 1:0 and = 0:9.

2. Take = 1, = 0 01 and = 0 9, run the program for su essively = 21 41 81, ll in the errors in
a b : : n ; ;

the table given below and investigate the order-of-a ura y-behavior of the leapfrog s heme.
1 -norm error n L

21
41
81
Table 3: Error behavior leapfrog s heme.

5
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

1.4 Lax-Wendro two-step s heme


1. Implement this s heme and run it for su essively = 1 1, = 1 0 and = 0 9, for in all three ases: : : :

= 41, = 1 and = 0 01. Sket h your numeri al solutions in the three graphs given below and
n a b :

give omments on ea h of the three numeri al solutions. Make omparisons with the leapfrog s heme's
results and explain.
1.2 1.2 1.2

1 1 1

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

−0.2 −0.2 −0.2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 7: Lax-Wendro two-step s heme, from left to right: = 1:1, = 1:0 and = 0:9.

2. Take = 1, = 0 01 and = 0 9, run the program for su essively = 21 41 81, ll in the errors
a b : : n ; ;

in the table given below and investigate the order-of-a ura y-behavior of the Lax-Wendro two-step
s heme.
1 -norm error n L

21
41
81
Table 4: Error behavior Lax-Wendro two-step s heme.

6
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 2

2 Finite-di eren e methods applied to quasi-linear onve tion problem


For the previous linear equation, the leapfrog s heme is the most a urate of the s hemes investigated. In
the present exer ise we will apply the leapfrog s heme and the forward-in-time, upwind-in-spa e s heme to
the Burgers equation,
u

t
+ =0
u
u

x
: (4)
We onsider the same initial solution as in the previous linear exer ise. Use the Matlab program Burgers.m.
The program is fully pre-programmed. Run it for both s hemes, for su essively  max 
 = 2 1 0 5.
u t
; ; :

For this, you only have to hange the input parameters: s heme and . Write down your observations and
x

on lusions for the omputations with both s hemes, explain where possible.

7
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 3

1 Finite-volume methods applied to linear onve tion prob-


lem with dis ontinuous initial solution

In this omputer exer ise the a ura y and monotoni ity properties of some ell- entered
nite-volume methods are investigated, among these a higher-order a urate, monotone
method introdu ed in the le ture-notes paper \A Robust Finite-Volume Method for Con-
ve tion Problems".
The governing partial di erential equation is again
u u
+ a = 0; with a onstant. (1)
t x
The spatial domain is again x 2 [0; 1℄, with periodi boundary onditions.
The dis ontinuous initial solution is:
(
0; if 0:3  x  0:7,
u(x; t = 0) = (2)
1; elsewhere.
Time integration is done with an expli it, third-order a urate, three-stage Runge-Kutta
s heme.
Run the program finvol.m for su essively the parameter values flux=0,...,4. This
orresponds with the following methods for omputing the uxes:
flux method
0 rst-order upwind
1  = 13
2 limited  = 13 (Koren limiter)
3 minmod limiter
4 superbee limiter

In all runs, the time step is so small that the temporal dis retization error is negligible
with respe t to the spatial dis retization error.
First observe the qualitative di eren es between the methods 0,1 and 2, by omparing
the solutions at the pre-assigned nal time (tmax=5). In all graphs that will appear on
your s reen, the exa t dis rete solution is depi ted in blue and the numeri al solution in
red.
Next ompare the solutions for the three methods 2,3 and 4, and observe the qualitative
solution di eren es for the three limiters.
Rerun the methods 2,3 and 4 for CFL=1.0 instead of CFL=0.5. Observe the monotoni ity
properties of the orresponding solutions.

1
JMBC-CFD-1, 2008 Pra ti al Barry Koren, Part 3

2 Finite-volume methods applied to a sho k-tube problem

In this omputer exer ise the same study is performed as in the previous exer ise, but now
with a hyperboli system of quasi-linear partial di erential equations: the 1D, unsteady
Euler equations for a perfe t gas.
The initial onditions are those of Test 1, spe i ed in Table 2.1, p.18 of the le ture-notes
paper \Building Your Own Sho k Tube". In literature, this test ase is known as Sod's
problem. It on erns an initial solution with a high-density { high-pressure gas at the
left, and a low-density { low-pressure gas at the right, both at rest.
For the ux omputations, use is made of Roe's approximate Riemann solver, as des ribed
in abovementioned paper. For the left and right ell fa es needed for this Riemann solver,
the same ve s hemes are used as in the foregoing exer ise.
Run the program Roe MUSCL s heme.m for su essively the parameter values limtype=0,...,4,
whi h orresponds with:
limtype method
0 rst-order upwind
1  = 31
2 limited  = 31 (Koren limiter)
3 minmod limiter
4 superbee limiter

Also here, the time step is su h that the temporal dis retization error an be negle ted
in omparison with the spatial dis retization error. Contrary to the method des ribed
in the le ture-notes paper, time integration is not done with the se ond-order Han o k
s heme, but with a Runge-Kutta s heme instead.
In ea h run, ve solution omponents are plotted: density, velo ity, pressure, Ma h num-
ber and entropy. For ea h of these ve solution omponents the numeri al solution and
the exa t solution are plotted, the latter with a solid line without markers. (Without
markers, be ause it is the genuine exa t solution, not the dis rete exa t solution.) An ap-
propriate solution omponent for omparing the di erent solution methods is the Ma h
number. Note that the wiggles for the unlimited  = 31 s heme lead to intermediate
omputational results with an imaginary part, a bad property. (Fortunately, Matlab is
suÆ iently robust to withstand this feature.) Also note that the under- and overshoots
that still appear in the results of the limited s hemes diminish when re ning the grid.
You may play with the program by running the Tests 2; : : : ; 5 as spe i ed in Tables
2.3, 2.5, 2.7 and 2.9 of the le ture-notes paper \Building Your Own Sho k Tube". The
orresponding initial data an be assigned in the le problem spe ifi ation.m. In that
le, you an also nd the pre-assigned values of some more test ases.

Vous aimerez peut-être aussi