Imacdonaldpdf
Imacdonaldpdf
Free Surface/Pressurized
Flow in Pipes
Ian MacDonald
September 1992
Submitted to the
Department of Mathematics,
University of Reading,
vice versa. Normally we require two di erent sets of equations to model these
di erent regimes, however with the use of a thin slot in the channel sot, we can
model both using only the open channel equations. When this is done numerically,
using Roe's scheme, serious oscillations are observed in the time history of the
solution. In this work, possible causes of these oscillations are investigated, and
Acknowledgements
I would like to thank Dr.M.J.Baines, Dr.A.Priestly and Dr.P.K.Sweby of the
tions 3
3 Roe's Scheme 13
5 Godunov's Scheme 28
5.1 The Exact Riemann Solver for the Open Channel Equations : : : 28
i
6 Smoothing Techniques 33
8 `Shock' Fitting 48
8.1 Description : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 48
9 Conclusions 57
ii
Chapter 1
Introduction
In a closed channel (pipe, channel with sot) there are often situations which
involve a transition from free surface ow to pressurized ow, or vice versa. For
example if we have a closed channel in a hydraulic plant, with initially free surface
ow, then the start-up of machinery (pumps, turbines) may cause a steep wave
which in turn may give rise to pressurized ow conditions. Flows with this kind of
transition are particularly hard to model because these two di erent ow regimes
track any interface between the two di erent regimes, and solve the appropriate
equations for each section. We shall see that by putting a thin vertical slot in
the channel sot we can simulate pressurized ow with the same equations as we
model free surface ow. Hence we can model both ow regimes with this one set
need keep track of any interfaces between ow regimes, since all sections of the
We require a numerical scheme to solve this problem, of which there are many
1
for conservation laws. Traditional schemes, such as Lax Wendro and central
di erence, are unsplit (that is they take no account of the direction of ow).
Since the 1980's, upwind schemes have become popular, since they are found to
give better results for conservation laws, the main examples of these being Roe,
Roe's scheme has been tried in [1] for this problem, but the scheme is ob-
served to give oscillations in time. In this work we investigate the cause of these
In chapter 2 we quote and describe the open channel equations, justify the
use of the slot and set up the problem that forms the basis of this work.
The rst thing we do after reproducing the results in [1], is to try some other
upwind schemes in order to see what e ect they have on the oscillations. This
forms chapters 3 to 5.
The presence of the narrow slot causes a sharp jump in the characteristic
waves speeds as we enter the slot. In chapter 6 we try two di erent ways of
smoothing this jump to see what e ect this has on the oscillations.
chapters.
2
Chapter 2
Simulation of Pressurized Flow
with the Open Channel
Equations
in conservation form as follows (see [12] pp. 451 or [2] pp. 7, for the derivation),
@w @F (w )
+ =D (2:1)
@t @x
where
2 3 2 3 2 3
6
6 7
7 66 77 6 0 77
75 , D = 664
A Q
w=6 7 , F(w) = 6 75 :
4 5 4 Q
2
Q + I1(A) (
gA S0 Sf )
A
h = water depth
3
Q = ow rate
S0 = bottom slope
Sf = friction slope
g = gravitational acceleration
Zh
I1 (A) = g (h )b( )d:
0
b( )
We shall use Manning's formula to calculate the frictional resistance Ff (see [12]
pp. 454-457),
Ff =
gAv v j j n
2
R
4=3 1:49
where
Q
v =
A
R = hydraulic radius
wetted area
=
wetted perimeter
4
= density
1
Sf = Ff
gA
hence
Sf =
j j
v v n
2
(2:2)
R
4=3 1:49
@w @w
+ J (w ) =D
@t @x
where
2 d
c = ( )
I1 A :
dA
d
Z h dh d
Z h
2
c = (
g h )( )
b d = (
g h )( )
b d
0 0
dA dA dh
Z h
!
dh
= g ( ) + g (h
b d h)b(h)
dA 0
dh
Zh
= g b( )d:
dA 0
Z h
A = ( )
b d
0
so
dA
= b(h) = bs
dh
5
where bs is the channel width at the free surface; hence we have that
2 gA
c = : (2:3)
bs
Q Q
1 = c , 2 = +c
A A
6
2.2 Simulation of Pressurized Flows
Equation (2.1) applies to ows in open channels, where there is a free surface. In
a closed channel, while the water is below the sot, we can continue to use the
open channel equations as before. If part of the free surface reaches the sot,
then this portion of the ow will no longer have a free surface and hence will be
pressurized. In this portion, the open channel equations will no longer be valid.
celerity c, compared to the wave celerity of free surface ow. This arises from
the fact that when the ow is pressurized, there is no additional storage volume
left; hence if the ow changes at the upstream end the e ect is immediately
transmitted downstream.
we can add a narrow vertical slot in the channel sot as shown in gure 2.2
While normal free surface conditions hold, the slot has no e ect. When the
ow is pressurized the free surface level is in the slot. Because the slot is very
narrow, the volume of water it holds is negligible compared to the pipe volume,
so the continuity equation still holds. We see from equation (2.3) that the small
slot width, wsl , produces a large celerity c. This large wave celerity is an attempt
to approximate the very large wave celerity of pressurized ow. Hence, using the
slot, we can simulate pressurized ow using the open channel equations. The slot
The problem does not have an analytic solution, and hence a numerical ap-
proach is required. It is anticipated that the problem will cause numerical prob-
7
- sl
w
6
hch
? wch -
Figure 2.2: Rectangular channel with slot in sot (slot width exaggerated)
lems, because of the sudden change in channel width as we enter the slot.
In the next section are the details of the particular problem that will form the
8
2.3 Description of the Problem
The problem tackled in this work is from [1]. It consists of a rectangular channel,
Channel slope = 0
( 0) = 0:06528 m2
A x;
( 0) = 0 m3 s
Q x;
1
:
9
At x = 10:0
Time (s) Water depth (m) Time (s) Water depth (m)
0.2
0.19
0.18
0.17
0.16
Water height at x=0
Channel Soffit
0.15
0.14
0.13
0.12
0.11
0.1
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5
time (s)
10
The main thing that we need to calculate for our problem, is the integral
I1 (A) =
ch !
>
>
> (A Acrit) hch g (A Acrit )
2
>
: crit
gA + + A > Acrit
wsl 2 2wsl
where Acrit = hch wch .
0.16
0.14
0.12
0.1
I1(A)
0.08
0.06
0.04
0.02
A=Acrit
0.0
0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08
except at A = Acrit. c is not strictly de ned at this point, although we can take
c (see gure 2.5) is then discontinuous at A = Acrit, and the jump is given by
c = c+ c :
11
9
5
c(A)
4
A=Acrit
3
0
0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
12
Chapter 3
Roe's Scheme
with other schemes used in this work, we approximate the solution function w(x),
by a set of piecewise constant states fwj g, of constant width x (see gure 3.1).
wj +1
wj
wj 1
r r - x
(j 1=2)x (j +1=2)x
13
and is given by
1 Z (j +1=2)x
wj = w (x)dx
x (j 1=2)x
This property ensures that the piecewise constant approximation has the `same
Suppose fwjn g are the cell averages to some approximation of the exact so-
lution of the PDE (2.1) with D = 0, at t = nt. We then have a sequence of
In Roe's scheme we approximate the Jacobian, J (w), in the interval [j x; (j + 1)x]
then solve the Riemann problem exactly, with this new constant matrix (see
below).
1. As wL ! wR ! w
J~(wL ; wR ) ! J (w)
2. For any wL ; wR
These three properties ensure conservation, and that any shock will satisfy the
14
where
A ~ = (AL AR)1=2
~ (AL)1=2 QR + (AR)1=2 QL
Q =
(AL)1=2 + (AR)1=2
8" #1=2
>
> I1 (AR) I1 (AL)
>
>
>
>
>
AR 6 0
AL =
>
>
<
AR AL
~= >
c
>
>
> " #1=2
>
>
> g (AR + AL )
>
>
: AR AL = 0
(bs )R + (bs )L
J~ has eigenvalues
~ ~
~ =Q
1 ~ , ~ 2 = ~ + c~
c
Q
~
A A
wR wL = ~ 1 e~1 + ~ 2 e~2
Here ~ 1 and ~ 2 are found to be the strengths of the waves corresponding to the
The source term D in (2.1) can also be decomposed onto the eigenvectors as
follows
~
D = ~1e~1 + ~2e~2
15
where ~
D is some average of DL and DR , which are the source terms on the left
~
~1 = D
~
2 ~1
~2 = ~1:
~
e1 and ~e2) using an explicit Euler scheme. This is carried out for j = 0; 1; . . . ; N
1:
We now use the following procedure to update the solution to the next time
level.
For j = 0; 1; . . . ; N 1
9
>
>
>
if ~ i;j +1=2 > 0 then increment wj +1 by i;j +1=2 ; =
i = 1; 2
>
>
>
else increment wj by i;j +1=2 : ;
Figure 3.2 shows the transfers for one possible case. The solution is now
updated except for the updates due to the boundary conditions, which will be
t
max(j~1;j +1=2 j; j~2;j +1=2 j) 1
x
16
1;j +1=2 2;j +1=2
YHHH *
wjn
wjn+1
t t -
(j +1=2)x
The resulting scheme is rst order in space and time. The scheme can be
chosen to ensure second order accuracy whilst keeping shocks sharp and free of
oscillations (see [3] and [8]). The results in this project do not use a limiter
however.
that only incoming waves are updated from the appropriate boundary condition.
Outgoing waves are allowed to pass freely from the region. If at a boundary both
waves move into the region, then two boundary conditions are required in order
17
at a boundary, then it is only appropriate to overwrite the incoming characteristic
The only case encountered in this work is where we have only one incoming
wave at each end, and we wish to specify the height of the water at the boundaries
for each time step. We can directly overwrite the area variable, A, with the new
area (calculated from the new height), but we do not know what to do with the
Q variable. This problem can be solved by extrapolating from the interior values
near the boundary, an incoming wave at the boundary. The strength of this wave
is chosen so as to give the correct value of A at the boundary. This wave is then
used to increment the Q value at the boundary. See [3] for details.
In rare situations Roe's scheme can give unphysical solutions, i.e. entropy
violating. The solution can have a shock, when the correct entropy satisfying
ensure that solutions do not violate the entropy condition. This modi cation was
18
3.2 Results and Discussion
Figure 3.3 shows water height against distance along the channel, at several di er-
ent times. Before the surface reaches the slot, the numerical solution is smooth
and well behaved. After the surface goes into the slot, a sharp front develops
which separates the pressurized ow from the free surface ow. This front is
shock-like, but is not a shock. A low frequency oscillation develops behind this
0.2
0.19
0.18
0.17
t=3.0 t=6.0
0.16
t=4.5
0.15
Water Height (m)
0.14
t=1.5
0.13 t=0.0
0.12
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0
Figure 3.3: Water height against distance along channel, at several di erent times.
The problem occurs when we look at a time history of the water height, at a
particular distance along the channel. Figure 3.4 shows such a history at distance
3:5m. The water height initially remains constant, and then rises smoothly until
it reaches the slot. It then rises very sharply into the slot; after this there is
19
a series of high frequency oscillations, which eventually decay and the height
returns to smooth variation. The oscillations are the ones observed in [1] which
0.2
0.19 x=3.5 m
0.18
0.17
0.16
0.15
Water Height
0.14
0.13
0.12
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5
Time (s)
The most obvious explanation for the oscillations is the discontinuity in the
wave celerity, which causes a discontinuity in the characteristic wave speeds (see
Figure 2.5). Of course, the scheme cannot resolve this discontinuity, but sees a
sharp change in wave speeds as the surface enters the slot. Another problem could
be the piece-wise constant approximation, because near the front the solution does
not vary smoothly; hence this approximation can become a poor one. The source
term could be a cause, but this can practically be ruled out since the oscillations
When the grid is made ner and a smaller time step is used (in order to satisfy
20
the CFL condition), we observe that the the oscillations increase in frequency and
0.2
0.19 x=3.5 m
0.18
0.17
0.16
Water Height (m)
0.15
0.14
0.13
0.12 dt=0.0025 s
dx=0.0625 m
0.11
0.1
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5
Time (s)
assuming that the characteristic speeds are constant; we take some kind of average
for these constant values. This could be the problem, since the characteristic
speeds do not vary smoothly near the pressurized/free surface interface. This
21
can, perhaps, take account of the sharp variation in a better way. This will be
22
Chapter 4
The Osher and Solomon Scheme
This scheme was used, in order to see if the oscillations observed with Roe's
@w ( )
@f w
+ = 0; ( 0) = (x)
w x;
@t @x
n+1 t
wj = wjn (f (wjn+1 ) f (wjn ) + f+ (wjn ) (
f+ wj
n
1 ))
x
0
wj = (j x)
Here
Z u
f+ u ( )= ( ) 0(s)ds
s f
0
23
Z u
f (u) = (1 ( ))f 0(s)ds
s
0
where
( )=1
u , f
0 (u) > 0
( )=0
u , f
0 (u) 0:
where J is the Jacobian and is some matrix that needs to be chosen. We also
Let the eigenvalues of J be denoted by 1 (w) < 2 (w) < ... < m (w) with
whose j
th
column is ej (w), then we have that
T
1
(w)J (w)T (w) = diagfk (w)g:
De ning (w) by
1
T (w)diagf1 + sign(k (w ))gT
1
(w) = (w)
2
we have
If j
is the path connecting wj 1 to wj , then we decompose this curve into
m sub-curves
j
[
m
j
= k:
k=1
24
These sub-curves are related to rarefaction or compression wave solutions and are
de ned by
8
>
> (k)
for either 0 s s(kj ) or 0 s s(kj )
dw
>
< = ek
j
k = >
ds
>
>
: w(k) (0) = w(k+1) (s(kj+1
)
)
with
(j ) (j )
w(m+1) (sm+1 ) = wj 1 and w(1) (s1 ) = wj :
(j ) at which
sk k (w(k) (s(kj ) )) = 0. Call this point w
jk = w(k) (s(kj ) ), a sonic point.
25
given by
(s) = A2 (s(2j )) + s
A
1
2 Z 3
s c(A2 (s(j )) + ) 2 (j )
( )
Q (s) = (A (s2 ) + s) 4
1 2 (j ) 2 Q s 2 5
d +
(j ) (j )
A (s 2 ) + A (s 2 )
0 2 2
j
2 is given by
2
A (s) = Aj 1 + s
"Z s #
2 c(Aj 1 ) + ) Qj 1
Q (s) = (Aj 1 + s) d +
0 Aj 1 + Aj 1
t
max(j1 j; j2 j) 1
x
For this scheme it is best to implement the source terms in a pointwise manner,
i.e.
"m Z Z !#
t X
wjn+1 = wjn J
+
(w)dw + J (w)dw + D(wjn )t:
x k=1 j
k
j +1
k
Implementing boundary conditions is more dicult for this scheme than for
Roe's scheme. The crude way that was used for this work was as follows. At the
boundary use only the valid part of the scheme. E.g. at the left hand boundary
"m Z !#
n+1 n t X
w0 = w0 J (w)dw + D(w0n )t:
x k=1 1
k
n+1
The new value of A0 is then directly written in.
Unlike Roe's scheme, all solutions given by the Osher and Solomon scheme
26
4.3 Results and Discussion
The Osher and Solomon scheme solves each Riemann problem approximately,
but in a di erent way to Roe. This could have some e ect on the oscillations,
and in fact it does. This can be seen from gure 4.1, which shows a comparison
of the results from this scheme against those from Roe. The oscillations are
considerably larger than those from Roe; this was not expected, because the
scheme's approximate Riemann solver is more elaborate than that of Roe, and
should take better account of the sharp variation of the characteristic wave speeds
0.19
0.18
0.17
Water Height (m)
0.16
0.15
0.14
Osher and
0.13 Solomon
0.12 Roe
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
Figure 4.1: Comparison of results from Osher & Solomon against those from Roe.
The next step is to go one better, and solve each Riemann problem exactly
before we re-average.
27
Chapter 5
Godunov's Scheme
After observing that both Roe's scheme and the Osher and Solomon scheme
both su er from the oscillations, the following question must be asked; are the
oscillations due to the approximate nature of the Riemann solvers? This was
tested by using the exact Riemann solver, i.e. using Godunov's method.
has a solution which just depends on the ratio x=t . Call it w(R)(x=t; wL ; wR ).
state. Each of these waves will either be a shock wave or a rarefaction wave
28
(see [11]). Let us de ne the following curves in the (A; Q) plane,
8 " #1=29
< I1 (A) I1 (A0 )
=
S1 (w0 ) = (A; Q); A 0; v = v0 ( A0 )
: A
(A A0)AA0 ;
8 " # 1 =2 9
< I1 (A) I1 (A0 )
=
S2 (w0 ) = ( A; Q); A 0; v = v0 + (A A0 )
: (A A0)AA0 ;:
Q Q0
Z A c(s)
v = ; ; v0 = and h(A) = ? ds
A A0 A s
A
?
0 is some arbitrary reference state.
1 (w0 ) represents the states w that can be connected to w0 on the right by
more details)
If we solve exactly each Riemann problem, and then calculate the cell averages
t
wjn+1 = wJn (F(w(jR+1) =2 ) (R )
F(wj 1=2 ))
x
t
max(j1 j; j2 j) 1
x
29
0.05
0.04
0.03
wL
0.02
0.01
( wL )
Q
0.0
w
-0.01
wR
-0.02
( wR )
-0.03
-0.04
-0.05
0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11
to ensure that neighbouring Riemann problems do not interact. See [4] , [3] pp.
8
>
>
>
>
>
> if A AR and 2 (wR ) 0;
>
>
<
ws = wR or
>
>
>
>
>
>
>
: if A AR and Q QR;
>
30
ws = 1 (wL ) \f
1 = 0g if 1 (wL ) < 0 1 (w
);
ws = 2 (wR ) \f 2 = 0g if 2 (w
) < 0 2 (wR );
ws
=w in other cases.
w is given by the non-trivial intersection of 1 (wL) and 2 (wR ) (see gure 5.1).
This is the constant state in the solution of the Riemann problem. A non-linear
.
equation needs to be solved, in order to calculate w
w? next to the boundary (outside region) such that, when using the scheme on
31
5.2 Results and Discussion
In Godunov's scheme we are solving each Riemann problem exactly, before we
re-average. This process is much more time consuming than the previous two
schemes. Any errors that come from this scheme are due solely to the re-averaging
process. Figure 5.2 shows results for Godunov, against those from Roe. There is a
slight improvement in the oscillations; the rst oscillation has a smaller amplitude.
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14
Godunov
0.13
0.12 Roe
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
Figure 5.2: Comparison of results from Godunov against those from Roe.
These results indicate that it is not the approximate Riemann solvers that
are to blame, but the re-averaging process; hence we are unlikely to improve
the situation by solely modifying the Riemann solvers while keeping piecewise
constant states.
32
Chapter 6
Smoothing Techniques
2
1
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
33
Figure 6.1 is a plot of the sets of eigenvalues,f1;j +1=2 g; f2;j +1=2 g from Roe's
scheme. The sharp change in the eigenvalues occurs where the ow changes from
being above the sot to below it. It was thought that these sharp jumps were
the cause of the oscillations. To test this, the eigenvalues were processed, after
being calculated, so as to reduce the sharpness of the jump. These new sets of
eigenvalues,f?1;j +1=2 g; f?2;j +1=2 g, were then used in the calculation of all further
quantities. The `smoothing' process was carried out for each time step, and in
?
i;j +1=2 = i;j +1=2 + tj2+1=2i;j +1=2
i = 1; 2 and j = 1; . . . . . . ; N 2, where
Figure 6.2 shows the modi ed eigenvalues, at the same time as in gure 6.1.
These have been generated from the modi ed scheme, using smoothing at each
time step. The value used for was 0:5. Figure 6.3 shows the corresponding time
modi ed the other properties of the solution. Notice in particular the loss in
height at, and after the oscillations; this loss is not recovered later on in time.
Increasing results in the oscillations being reduced in size, however, the deteri-
oration described above increases. As we reduce the oscillations grow, and the
34
10 t=3.000 s dx=0.125 m
9
8 dt=0.005 s
7
6
5
4
Modified eigenvalues
3
2
1
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
Figure 6.2: Modi ed eigenvalues from using the modi ed Roe's scheme ( = 0:5)
about 0:5 gives the best compromise between size of oscillations, and deterioration
of solution.
This method is not a very elegant and convincing way of doing things. How-
ever, it indicates that the size of oscillations is related to the sharpness of the
jump in the wave speeds. Next we shall see a way of doing virtually the same
35
0.2 x=3.5 m
0.19
0.18
0.17
Height of Water (m)
0.16
0.15
0.14
0.13 smoothing
0.12 ( =0.5)
dx=0.125 dt=0.005 Roe
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
Figure 6.3: Results using modi ed Roe's scheme ( = 0:5)
36
6.2 Sloped Roof Technique
The sharp jump in the eigenvalues, in Roe's scheme, is due to the sudden jump
in the channel width from wch to wsl . Another way to make the jump in the
eigenvalues less sharp, is to make the channel go from width wch to width wsl in a
continuous manner. The simplest way of doing this is to make the channel width
vary linearly from wch to wsl in a height 2. See gure 6.4.
- slw
H
H ?
?
6
HHH 6
6
hch
? wch -
This is the only way that could be found of continuously varying the width such as
to make such things as the integral I1 and the hydraulic radius easy to calculate.
Since the slot is just a mechanism for simulating pressurized ow, using the
37
open channel equations, we are not losing much by this alteration as long as is
small. Also when the water is above the linearly varied width region (h > hch + ),
the wetted area for a given height will be the same as if we had not made the
alteration. This is because we have not created any new volume in the channel.
Figure 6.5 shows the integral I1 for the modi ed channel; I1 is now di eren-
tiable at A = Acrit. Moreover c ( gure 6.6) is now continuous at this point, and
0.16
0.14
0.12
0.1
=0.075hch
0.08
I1(A)
0.06
0.04
0.02
A=Acrit
0.0
0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08
A
For this technique we have to make the same compromise as for the method
in section 6.1. Figure 6.7 shows the results for = 0:075hch ; they are slightly
38
9
6 =0.075hch
4
c(A)
1 A=Acrit
0
0.0 0.02 0.04 0.06 0.08 0.1
A
better than when smoothing the eigenvalues, since we do not lose height after
the oscillations as in that method. Figure 6.8 shows the results for = 0:11hch ;
notice the further deterioration of the solution, but the smaller oscillations. An
39
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14
0.13 Modified
Channel
0.12 =0.075hch
dx=0.125 m dt=0.005 s
0.11 Roe
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
channel.
40
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14 Modified
0.13 Channel
=0.11hch
0.12 Roe
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
channel.
41
Chapter 7
Di erent Schemes Using Roe
Decomposition
Roe's scheme can be written in the following form
Wn+1 Wn
= G(Wn ) (7:1)
t
where 2 3 2 3
66 w0n 77 66 g0 77
66 77 66 7
66 wn 77 66 g 777
Wn = 6
6 1 77 ; G(W) = 66 1 77 :
66 . 77 66 . 77
66 .. 77 66 .. 77
64 75 64 75
n
wN gN
using the states W. Where we mean the usual Roe approximation to the space
42
7.1 Implicit Roe's Scheme
One way to make Roe's scheme implicit is in the following way,
Wn+1 Wn
= G(Wn+ )
t
where
An iterative method is needed to carry out this scheme, since Wn+1 is unknown.
We initially set Wn+1 = Wn , then use the scheme to calculate a better approx-
imation to Wn+1 ; this value is then used to get a better approximation, and so
on. We stop the process when we have got an accurate enough value. Of course
we need to implement the boundary conditions as usual, after the iteration has
converged.
Implicit schemes are well known to be more stable, than their corresponding
cillations; see gure 7.1 for results for = 1. There is a similar improvement
as for the smoothing techniques, but in this case there is no deterioration in the
solution. The implicit scheme is much more time consuming than the explicit
version, and this may make it impractical. The best value for was found to be
1:0.
Figure 7.2 shows results from using the implicit scheme, with the modi ed
channel ( = 1; = 0:75hch ). These are probably the best results seen so far; the
oscillations are very small, and the rest of the solution compares well with Roe.
43
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14 Implict
0.13 Roe
( =1)
0.12
dx=0.125 m dt=0.005 s Roe
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
44
x=3.5 m
0.2
0.19
0.18
0.17
Water Height (m)
0.16
0.15
0.14
Impl. Roe
0.13 with mod. chan.
0.12 ( =1, =0.075hch)
dx=0.125 m dt=0.005s
0.11 Roe
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
Figure 7.2: Results from implicit Roe with modi ed channel.( = 1; = 0:075hch )
45
7.2 Alternative Time Stepping
From equation 7.1 it can be seen that Roe's scheme uses Euler time stepping. It
would be an idea to try and change to a di erent time stepping, in order to see
what di erence this would make. See [10] for more information on di erent time
t
Wn+1 = Wn + (K1 + 2K2 + 2K3 + K4)
6
where
K1 = G(Wn )
K2 = G(Wn + 2t K1 )
K3 = G(Wn + 2t K2 )
K4 = G(Wn + K3 ):
The Runge-Kutta fourth-order scheme results in a slight improvement in the
oscillations, but not as much as the implicit scheme in the previous section. This
Linear Multistep Methods were also tried, including implicit ones; some were
unstable and needed the CFL number reducing. None of these gave an improve-
ment better than the implicit scheme described in the previous section.
46
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14
RK4
0.13
0.12 Roe
dt=0.125 m dr=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
47
Chapter 8
`Shock' Fitting
8.1 Description
There is now quite a lot of evidence indicating that the problem is due to piecewise
front at the pressurized/free surface interface is so sharp that we could treat it like
a discontinuity. If we were to ensure that the front was at the interface between
two grid cells, then the solution in both the neighbouring cells would be smooth;
to do this, we will need to work on a non-uniform grid and allow the grid to alter
in time. We will also need to be able to nd and keep track of the position of the
front. The following is a simple way of achieving the above, by modifying Roe's
scheme.
Until the front develops, and is found, we proceed as before with the ordinary
Roe's scheme. The following criterion is used to identify the front, and calculate
48
its position (see [6]). The front is in cell k if all of the following hold.
rk > 0; j k 1j 1
r ; j k+1j 1
r
with
n
Ak 1 Acrit and Ak +1
n
Acrit :
rj is given by
n n
hj hj 1
rj = n n
hj +1 hj
where n
hj is the water height corresponding to area Ajn .
wk 1 wk 1
wk
wk+1 wk+1
-
r r -x
r
(k 1=2+)x
r r -
x
the three states near cell k (see gure 8.1), by a single discontinuity. If the
Note that Q will only be conserved by this process if the front in Q is at the same
49
Step 2: Modi cation of Grid.
We next need to place the front at the interface, between two cells. This is done
by eliminating cell k and extending the size of its two neighbours, in such a way
that we end up with the second part of gure 8.1. We now get a new set of states,
of non-uniform size 8
>
>
?
>
< wjn if j k 1
wj =
>
>
>
:
: wjn+1 if j > k 1
State j has width fj x, where fj is given by the following
8
>
>
>
>
>
> 1+ if j = k 1
>
>
<
fj = 2 if j = k
>
>
>
:
>
>
>
>
>
:1 otherwise:
We now apply Roe's scheme to these new set of states, but because the cells
are not all the same size we need a few changes. For each Riemann problem
we calculate the eigenvalues and wave strengths exactly as before. The change
comes in the updating; the modi ed procedure is as follows. For the j th Riemann
We now use the following procedure to update the solution to the next time
level,
50
For j = 0; 1; . . . ; N 2
9
>
>
>
if ~ i;j +1=2 > 0 then increment wj?+1 by i;j +1=2 ; =
i = 1; 2
>
>
>
else increment wj? by i;j +1=2 : ;
We now have values for the states at the new time level and we use these to nd
wk? 1
wk?
wk?+1
r r
(k 1=2+)x
t r r r -x
Figure 8.2: Finding the new position of front using three states.
We now use the three states, shown in gure 8.2, to get the new position of
the front. We do this in the same way as step 1. The new value for given by
? ?
!
0 = (1 )
Aj +1 Aj
? ?
Aj +1 Aj 1
51
wk? 1
wk?+1
r r
(k 1=2+0 )x
t r r r -
x
We now wish to get values for the original uniform grid that we started with.
There is no unique way of doing this. After trying several ways, it was found that
chosen were conservation and the position of the front. Depending on the value
52
If 0 1 then the front has not moved cells. From conservation we get
z1 + z2 = 0 wk? 1 + (1
0 )w?
k+1 :
0 w? + (1 0 )z = z :
k 1 2 1
If 0 > 1 then the front has moved one cell to the right. From conservation
we get
z1 + z2 = 0 wk? 1 + (1
0 )w?
k+1 :
(0 1)z1 + (2
0)w?
k+1 = z2 :
We are now in the position to do another time step. We now know the new
position of the front, so we need never repeat step 1 again; we can just start with
step 2.
53
8.2 Results and Discussion
Figure 8.4 shows result for this `shock' tting method. The results are extremely
good; there is not a sign of an oscillation. The solution behaves slightly peculiarly
just before the height starts to rise sharply, and again after it has nished rising
0.2
x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14
0.13
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
serious, and are much better than having oscillations. Figure 8.5 is a comparison
of these results against Roe. From this it seems as if we have a slight deterioration
in the solution. If we run Roe on an eight times ner grid with an eight times
smaller time step, it can be seen, from gure 8.6 that the `shock' tting method
54
x=3.5 m
0.2
0.19
0.18
Water Height (m)
0.17
0.16
0.15
0.14
‘Shock’
0.13 Fitting
0.12 Roe
dx=0.125 m dt=0.005 s
0.11
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
55
0.2 x=3.5 m
0.19
0.18
0.17
0.16
Water Height (m)
0.15
0.14
0.13
0.12
‘Shock’ fitting dx=0.125m, dt=0.005s
0.11
Roe dx=0.01562m, dt=0.00062s
0.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0
Time (s)
Figure 8.6: Results with `shock' tting compared with Roe on a very ne grid.
This `shock' tting approach seems very promising, and has plenty of scope
for improvement, especially in step 5. It should not be too hard to make a more
re ned version. The scheme is to all intents and purposes conservative. The only
slight exception, is when we nd the front for the rst time. At this time we
assume the fronts in both Q and A are at the same position. This assumption
nating a cell, to subdivide the cell containing the front. The major drawback of
this alternative way is that we will sometimes get very small cells. This results
in us needing a very small time step, in order to satisfy the CFL condition. By
extending the cells we are sure that the minimum cell size is always x.
56
Chapter 9
Conclusions
Throughout this work, we have been unable to pinpoint, exactly, the cause of the
oscillations; however it is felt that we have gone some way to understanding the
cause.
solvers was not a signi cant factor in causing the oscillations. The approximation
of piecewise constant states seemed to play a much bigger part. The rst signif-
icant improvement in the oscillations was found with the smoothing techniques,
however these are seriously limited by the deterioration of the solution. The
implicit scheme from section 7.1 did not cause such deterioration, but was very
slow, and has limited scope for improvement. The most promising method found
was the `shock' tting approach in chapter 8. For our problem this approach
gave very good results, with the total elimination of the oscillations, although we
have found that for a more severe problem where the pressurized ow has a more
realistic wave celerity, the oscillations do return. Given time, there is much scope
for improving and re ning this method, and it seems likely that this is the most
57
fruitful direction. Another approach that might be considered is increasing the
58
Bibliography
[1] Baines,M.J. & Mao,A. & Di Flippo,A., Unsteady 1-D Flows with
Steep Waves in Plant Channels: The Use of Roe's Upwind TVD Di erence
2: Computational Methods for Inviscid and Viscous Flows. John Wiley &
Sons, 1990.
59
[7] Osher,S. & Solomon,F., Upwind Di erence Schemes for Hyperbolic Sys-
339-374.
[8] Priestly,A., Roe Type Schemes for the 2-D Shallow Water Equations. Read-
Verlag, 1983.
60