Professional Documents
Culture Documents
8.1
INTRODUCTION
Severalnumericaltechniqueshave been developedto solve the panial differential
equationsof unsteadyflow. Some of thesetechniquesare more applicablein specific typesof engineeringproblems than in others.The purposeof this chapter and
the next one is to introduce the engineerto the more commonlv used techniques,
especiallythosefound in well,known commercialcodes,as well as ro assistin identifying the most appropriatetechniquefor a given problem. This chaprerconcentrateson solving the govcming equationsdevelopedin Chapter ? with no major
simplifications.Chapter 9 considerssimplified forms of the gorerning equarions
and correspondingnumerical solution techniquesthat often are employedin some
types of flood routing problems.
The methodsdevelopedin this chapterdependon approximationsof the derivatives in the goveming equations, either in characteristicform or in the original partial differential form. The major difference between the two approachesis tiat the
derivatives are approximated on the characteristic grid along rhe characteristics
themselvesin the caseof the characteristicform of the equationsor on a fixed rectangularr-l grid in the caseof the original panial differentialequations.The former
case is refened to as the method of characte ristics,while the laner includes both
explicit and implicit finite difference methods.Explicit finire differencemerhods
advancethe solution to the end of the time step at a single grid node, using an
explicit tunction of the dependentvariablesalready determinedfor several grid
nodes at the beginning of the time step. Implicit methods, on rhe other hand,
approximatethe derivativesusing values of the dependentvariablesboth at the
beginningof the time step, where they are krown, and at the end of the time step
296
Cnrlttl
fcrrmore than one grid node,u'herethe dependentvariablcsare unknown. In the latter case,a systemof simultaneouseqLrations
must be solvedto adlance the solution
by one time step.
The method of characteristicsgenerallyis utilized only in special cases,often
as a check on some other nrethod.However,it frequentlyis used in explicit finite
differencetcchniquesfor a more accurateapproxinlationof boundary conditions.
The explicit finite differencemethodis usedin problenrsof rapid transientssuchas
those in the headraceor tailraceof hydroelectricturbine operarions.A nunrberof
readily available codes such as BRANCH (Schaffranek,Baltzer. and Goldberg
l98l), FLDWAV (Fread and l-ewis 1995),and UNET (U.S. Army Corps of Engineers 1995) inrplement the implicit finite differencenrethodto solve problemsof
flood routing and dam brcaks.
ln contrastto finite differencemethods.finite clement methods approximate
the solution rather than the differentialequrtions by using polynonial shapefunctions that dcpend on the unknown nodal valuesof the dependentvariablcs.In rhe
Galerkin approach,the residualsbetweenthe approximatesolution and the exact
solution are minimized by integratingthe product of weighting functions and the
residualover the solution domain of finite elementsand setting the result to zero.
The finite element method has bcen applied to problems of discontinuousopen
channelflow causedby surges(Katopedesand Wu 1986).Becauseit is not usedas
extensivelyas finite differencemethodsin widely availablenumericalcodesfor the
solution of the one-dinensionalunsteadyflow equations,it is nor discussedhere.
In finite differencetechniques,the continuousgoverningequarionsare approximated and transformedinto discretedifferenceequationsllhercfore, it is essential
that methodsbe chosen for which the truncationerror in the approximationof $e
equationgoes to zero as the time step,At, and spatialstep..&. approachzero.Such
a condition is refened to as colrsiste/rc)(Ames 1969).Without consistency.extraneous terms that are incompatiblewith the original differential equationsmay be
introduced.Consistencyalone,however,may not guaranteethe ultimate goal of the
finite differenceapproximationof the governingequations,which is for the solution to approachthe true solution as Ar, Ar -J 0; that is, converge.If small errors
such as roundoff errors grow during the numericalsolution process.then the solution becomesunstable,so that the enor grows without bound, swamping the true
solution and preventing convergence.
The pitfall of instability is rhat a perfecrly
reasonablefinite differenceapproximationcan lead to garbagefor a solution.The
remedy may be to place limits on the discretizationsize,but in some casesit may
be necessaryto switch to a completelydifferentapproximationscheme.Such difficulties can cause unacceptablemistakesthrough uninforned use of commercial
codes or casualprogramming of seeminglystraightforwardfinite differencetechniques,as is illustratedin this chapter.
Application of numerical techniquesin hydraulicshas become commonplace
as computershave become more powerful. Desktopcomputersthat are as fast as
mainframecomputersof a only a decadeago are very affordable.In addition.cumberso:ne batch processing and text-basedoutput have been replaced by userfriendly program interfacesand colorful graphics.In this environment of readily
accessiblecomputationalhydraulics,the importanceof proper calibration and ver-
CHApTER8: Nunrerical
Solutionofthe Unsteady
Flow Equations 29'/
ification of numerical models of unsteadyflow cannot be overenrphasized.
Application of any of the numerical techniquesdiscussedin the next two chapters
rcquirescomparisonsof computedresuitswith measurements
in the field or laboratory and appropriateadjusttnentof calibrationfactorsthat have physical validity.
The model also should be verified with entirely different data sets from thoseused
in the calibrationprocedure.It is insufficientto acceptnumericalnrodel resultson
the basisof qualitativesimilarity with what might be expectedto occur. Engineers
must be demandingof numericalmethodsand neverignorethe crucial link between
numericalanalysisand laboratoryand field data.
8.2
I\{ETHODOF CHARACI'ERISTICS
As discussed
in Chapter7, the transfonnation
of the equations
of unsteadyflow
into characteristic
form givesrise to two familiesof characteristics
that form a kind
of naturalcoordinate
s)'stemthatis partof thesolution.In thenumericalmethodof
characteristics,
a numericalsolutionof thc tlansformed
equations
is soughtalongthe
characteristic
directions,
Cl andC2.With reference
to Figure8.1,*'e seeka solution for velocityy anddepth) at pointP in thecharacteristic
planeasa functionof
vadablesat L and R. For simplicity,the rectangular
the valuesof the dependent
ty
XL
xp XR
FIGURE 8.1
Numericalsolutionof the govemingequationsin characteristicform on the characteristic
gnd.
298
Flow tquations
Cs,qpret 8: NunrericalSolutionofthe Unsteady
.l,'
8(So
Sr) dt
xp-xL+f'{u*.o
) ,
Vp- 2cp: Vt z.^+
x p : , r R+
s/)dr
f s(So
[,_'tr,
oo,
(8.1)
(8.2)
(8.3)
(8.4)
(8.8)
299
^{
A R
I
t
l
,\x
FIGURE 8.2
Numericalsolutionby the methodof specified
time intervals
on thecharactedstic
grid overgrid.
laid on a rectangular
In the Hanree method, fixed time intervals and uniform spatial intervalsare
specified,and the solution at point P is projectedbackwardin time to points R and
S, as shown in Figure 8.2. In this case,the generalnonrectangularcross sectionis
considered,so that the equationsof interest are (7.21a-d). The finitc difference
approximationsof the derivativesalong the characteristicsare substituted,and the
resultingdiscreteequationsare given by
(8.e)
(8.10)
(8.1l)
(8.12)
300
Vc-Vn
Vc-V^
- r(V* + c*)
Ax
= r(V^ + c^)
(8.l3)
r^). In a sirn-
( 8 .l 4 )
If we solve for V^ and c^ from (8. l3) and (8. l4), we have
vR
cI
V, L r(
Vrc^ + crV^)
| + r(V,-
V^|
cr- c^)
cc*rV*(co-cc)
| + r(cr-
( 8 .l 5 )
( 8 .l 6 )
c^)
V, I r\crV"
ctVc)
l+r(-Vr*Vu*cg-c6)
gqjj.Yr(.. _, ,,,)
(8.r7)
(8.18)
l*r(c6-c6)
r I +
f(v"
+ .".rl-f
"t'": (." * .r)
.r'"c,
frsc*
v ) (S/R
^.^.
^ , . l l .(8.19)
- .ts)Arl.l
St
\
l D
(8
\'D
l-
( S , "- S e ) g J r
(8.20)
Equations
with the interpola(ion
8.19and 8.20,together
equations,
canbe usedto
solveexpiicitlyfor y and,yat all interiorpointsof ther-r plane.beginningwith the
initialconditions
specified
on the-raxis.At therightandleft boundaries
for subcritical flow, (8.9)and (8.1l) aresolvedsimultaneously
with the boundaryconditions.
The tirnestep,however,mustbe chosensuchtha(theCourantconditionis satisfied
for all grid pointsat a giventimelevelunlessthemodifications
suggested
by GoldbergandWylie ( 1983)for an implicittimelineinterpolation
are implemenred.
Headrace
301
:----+ o(l)
Fieservoir
Turbine
o= o0(r)
Ho- constant
tL
!++
Pftrl-J ,
I'IGURE8.3
Boundary conditionsfor the hydroclectricturbine Ioad acceptanceproblem.
8.3
BOUNDARY
CONDITIONS
As an initial illustration of the applicationof boundary conditions, considerthe
hydroelectricturbine load acceptance/rejection
problem shown in Figure 8.3. The
reservoirat the upstreamend supplieswater to a headracechannel,which in turn
conveysthe dischargeto the turbine shown schematicallyat the downstreamend
althoughin reality it is at the bottom of the pensrocks.When the turbine is brought
on-line in a relativelyshorttime, a netrtive wavepropagatesupstreamfrom the turbine and then is reflectedback as a positivewave.This is the load acceptanceproblem. In contrast,the load rejectionproblem occurs \\,henthe turbine is shut down
in a finite but shon time interval,causinga surgeto propagateupstream.In either
case, the boundary condition set by the reservoir ar the left hand boundary is the
maintenanceof a constantvalueof headH = H^ in the reservoir.At the downstream
boundary,the turbine dischargeis specifiedas a function of time. 0 : O0(r).
Considerfirst the upstreamboundarycondition at r : 0, illustratedin the characteristicplane in Figure 8.3 bclow the headraceentrance.Onll the backward(C2)
characteristicfrom 5 to P is of interest,and the equationto be satisfiedalong that
characteristicis Equation 8. I l, which can be rearrangedto give
P|o
Y" - -. = V, -:
SYc
g ( S r 5- S e ) A r- K ,
(8 . 21 )
302
(8.22)
Hr=),+;
u":arf' *
(8 . 2 3)
At eachtime step,(8.23)givesthc valueof V" at -t : 0 and (8 2 | ) or (8 22) prov lgl u eo l r ' " .
d u c e rt h ee o r r c s p o n d i n
is shownin Figtheforward(C| ) charactcristic
boundary,
At thedownstream
ure 8.3 wherethe boundaryconditionis givenby Q - QoQ)at x : xL The equaas
is (8.9),whichcanbe reananged
alongthecharacteristic
tion to be satisfied
v,*T
= u^*
- so)ar
= Kn
s(srr
(8.24)
(82s)
Qolt) : VpAp
on the unknowndepth,
areaof flow tbatdepends
in whichA, is the cross-sectional
for thegivenchannelshape.On solving(8 24)
yo, andon thegeometricparameters
algebraicequationin Ip.
into (8.25),theresultis a nonlinear
for Vpandsubstituting
Sincethis boundaryconditionmustbe appliedat eYerytime step,the NewtonRaphsontechniqueis chosenfor its solution,with the functionf definedby
- o"(-T .
Fop): co(,)
(^)
(8.26)
r(Y*')
l..,b,!)
(8.27)
303
P1o
oP2
O = lo9p2l
Ratingcurve
(a) RiverFloodRouting
Mainstem
YP1=YP2=YPz
Qp1 + Qp2 = Qp3
(b) RiverJunclion
-_-_;-ep2
P2
P'l
(c)Weir
FIGUREE.4
conditions
for unsteady
Additionaltypesof boundary
flow.
(8.28)
304
hand boundaryis multiplicd by A" and rearrangedto producea funclion, F, that can
be solved for -r'"utilizing Ncwton-Raphsoniteration:
++
r0,")=/.,(r,")
A,Kr
(829)
Ap2Vpl-
,) Pl
,rPl
AplVp3
(8.30)
(8.31)
(8.32
)
(8.33)
in which P and L : heightandcrestlengthof weir and C, : dischargecoeffiat R and S haveto be written in termsof two
cient.The interpolationequations
separatepoints,Pr and P2.for which velocityand depthare determinedin the
previoustlme step.
Both the boundaryconditionsand the characteristicequationsfor the interior
They also
in this sectionas first-orderapproximations
grid pointsare expressed
as describedby Liggettand
approximations,
as second-order
could be expressed
shouldbe usedfor the
Cunge(19?5),but in anycasethesameorderapproximation
boundaryconditionsas for theinteriorgrid points.
for subcritical
flow.If
in Figure8.4 aredescribed
All theboundaryconditions
the flow is supercritical,both unknownsmustbe specifiedon the upstreamboundary, while no boundaryconditionsare specifiedat the downstreamboundary,as
equations
for theCl andC2 characin Chapter7. Thetwo characteristic
explained
boundary'
at thedownstream
teristicsaresolvedsimultaneously
as
Boundaryconditionsare specifiedusing the methodof characteristics
describedin this chapterfor both the numericalmethodof characteristicsandthe
explicit finite difference methodto be discussednext. Otherwise, instability or
of the yariablesat the boundariescan result.In the implicit finite
overspecification
8.4
EXPI,ICIT FINITE DIFFERENCEMETHODS
Althoughexplicitfinitedilfercnce
techniques
arerelatirely simpleto program,
they
with instabilitythatgo beyondthe satisfacarc fraughtwith difficultiesassociated
As anexample,
considerthe cornputational
molecule
tion of the Courantcondition.
moleculedefinesthegrid pointsused
illustratedin Figure8.5a.Theconrputational
approximltions
of thc dcrivatires for a particularnumerical
in the finiredifference
The grid pointsareidentifiedby thesubscripts
i andsuperscripts
t to indischeme.
respectively.
For example,
catespatialintervalsandtimeintervals,
1f-r is thediswherex
cretevalueof thedepthat a distance
of (iAr) from the left handboundary,
: 0, if uniformspatialintervalsareused,andat a time that is (k + I ) time steps
from the initial time of t : 0, but the time stepsmay be nonuniformdue to the
requirements
of the Courantcondition.The timeand spacederivatives
in theorigon thisgrid andwithinthecominalpanialdifferential
equations
areapproximated
putationalmolecule,which is appliedrepeatedly
for all the interiorpointsat any
giventime step.
For the computational
moleculeillustratedin Figure 8.5a,an unstablefinite
are approximated
as
differenceschemeresultsif the V andy derivatives
av
At
:'
a v _ v : + t - v ; _ t.
Ax
2Ar
(E.34)
(8.3s)
306
CHAPTER 8:
(k + 1).\t
klt
(a) UnstableScheme
Ax
(k+ 1)Al
(kr 1)lt
(k + 112)Jt
(k- 1)ar
klt
( l - 1 ) A x t A x ( t+ 1 ) " r x
Ax
--tLt/zl
kAt
(l+ 1)Ax
- -t-
+112
.1t2
11i
Itf_,
( l - 1 ) . l xi l A x l ( i + 1 ) A x
(i- 1/2)Lx (i+ 112)Lx
(c) LeapfrogScheme
(d) Lax-WendroffScheme
FIGURB 8.5
Computational
molecules
for someexplicitfinitedifference
schemes.
solution at adjacentgrid pointsat the lrh time level. Using the generalfunction,/,
to representthe dependentvariables,the derivativesbecome
At
af,
d.r
2L,
(8.36)
(8.37)
'_
r/l
]r,.*
7tr;.,-r',,)
L)rul., - ul r
vir,= Ivi., + v! ) -*
( 8 . 38 )
(4j1-)rvi-, - v1_,;
+ st'so ,.,[qd.
+ (si)f '
2
(8.3e)
(8.40)
- (* . *r"),
o!"=;@:, +et.,)#J+ * ,o4):.,
,]
+a,rdi.,d
+l , , )
\
( 8 . 4 1)