Professional Documents
Culture Documents
Introduction to
Hydraulics of Open
Channels
Module 1
3 lectures
Topics to be covered
Basic Concepts
Conservation Laws
Critical Flows
Uniform Flows
Unsteady Flows
Basic Concepts
Conservation Laws
The main conservation laws used in open channels are
Conservation Laws
Conservation of Mass
Conservation of Momentum
Conservation of Energy
Conservation of Mass
Conservation of Mass
In any control volume consisting of the fluid ( water)
under consideration, the net change of mass in the
control volume due to inflow and out flow is equal to
the the net rate of change of mass in the control
volume
This
Conservation of Energy
This law states that neither the energy can be
created or destroyed. It only changes its form.
Conservation of Energy
Mainly
the context of open channel flow the total energy due these
factors between any two sections is conserved
This
Critical flow
Fr=1
Uniform
Steady
Varied
Gradually
Gradually
Rapidly
Rapidly
Steady
Flow
Flow is said to be steady when discharge does
not change along the course of the channel
flow
Unsteady
Flow
Flow is said to be unsteady when the
discharge changes with time
Uniform
Flow
Flow is said to be uniform when both the depth
and discharge is same at any two sections of
Varied Flow
Flow is said to be gradually varied when ever
the depth changes gradually along the
channel
Rapidly
varied flow
Whenever the flow depth changes rapidly
along the channel the flow is termed rapidly
varied flow
Spatially
varied flow
Whenever the depth of flow changes
Unsteady
Flow
Whenever the discharge and depth of flow
changes with time, the flow is termed unsteady
flow
Types of possible flow
Steady uniform flow
kinematic wave
diffusion wave
dynamic wave
Definitions
Specific Energy
It is defined as the energy acquired by the
water at a section due to its depth and the
velocity with which it is flowing
Specific
Specific
v2/2g
Where y is the depth of flow at that
section and v is the average velocity of
flow
Definitions
Specific Force
F = Q2/gA +yA
The specific forces of two sections are equal
provided that the external forces and the
weight effect of water in the reach between
the two sections can be ignored.
At the critical state of flow the specific force is
a minimum for the given discharge.
Critical Flow
Flow is critical when the specific energy is
minimum. Also whenever the flow changes
from sub critical to super critical or vice versa
the flow has to go through critical condition
figure is shown in next slide
Sub-critical
E-y curve
1
y1
Emin
Critical Depth
Alternate Depths
yc
E=y
Characteristics of Critical
Flow
Specific
For
However,
Ac
Q2
2
Tc
gAc
Ac VC2
Tc
g
Vc
gy c
Uniform Flows
This
1 2 / 3 1/ 2
V R S
n
Where R = the hydraulic radius = A/P
P = wetted perimeter = f(y, S0)
Y = depth of the channel bed
S0 = bed slope (same as the energy slope, Sf)
n = the Mannings dimensional empirical constant
Uniform Flows
Energy Grade Line
Sf
y1
v22/2g
V12/2g
hf
y2
Control Volume
1
z2
z1
So
Datum
Uniform Flow
Example
This
by
AR S
Uniform Flow
This
where
direction of flow
Uniform Flow
W sin 0 Px 0
Or
Ax sin 0 Px 0
A
0 sin
P
Or
Uniform Flow
0 c f V 2 / 2
dx 1 Fr 2
Where
v2/2g
Datum
Now, let
2g
S 0 x y 2
y y 2 y1
2g
S f x
2
2
V2
V1
d V2
x
and 2 g 2 g dx 2 g
dx 2 g
After simplification,
S0 S f
dy
dx 1 d V 2 / 2 g / dy
dy 2 g
dy 2 gA 2
3
dy 2 g
2 gA dy
F
r
dy 2 g
gA 2 D
dx 1 Fr 2
Unsteady flows
Vw V c
c gy0
For shallow water waves
y0=undisturbed flow depth.
where
2.
3.
4.
5.
Unsteady flows
0
x t
The equation
Q A
q' 0
x
t
0
x
g x g t
Review of Hydraulics of
Pipe Flows
Module2
3 lectures
Contents
General introduction
Energy equation
General Introduction
General introduction
Energy equation
p1
V12
p2
V22
1
z1 h p
2
z2 ht hL
2g
2g
Where
p/ =pressure head
V2/2g =velocity head
z =elevation head
hp=head supplied by a pump
ht =head supplied to a turbine
hL =head loss between 1 and 2
Energy equation
Energy Grade Line
Hydraulic Grade Line
z2
hp
p/y
v2/2g
z1
Pump
z=0
Datum
Energy equation
Velocity head
A
V 3A
0 fV 2 / 8
h
L V2
f
D 2g
32V
S
Hagen-Poiseuille equation gives
64
VD
64
f
Nr
D 2 g
MINOR LOSSES
2.
2g
18.5 106 D 4V 2
Cv2 2 g
10
D
minor loss coefficient
by
K
Cv2
z2
hL
g 2 g
g 2 g
1.
2.
3.
( AV 2 )in ( AV 2 ) out
.
D 2g
2g
g dt
d
0 Adx VA out VA in
dt x1
For a steady flow first term on the right hand side is zero, then we
obtain
0 V a V A V a A
V
V a
Since
p gH
V
a
we can write as
a
V
g
Introduction to Numerical
Analysis and Its Role in
Computational Hydraulics
Module 3
2 lectures
Contents
Numerical computing
Computer arithmetic
Parallel processing
Examples of problems
needing numerical
treatment
1 cos 2 ( x ) dx
Computer arithmetic
1!
2!
3!
Computer arithmetic
Parallel processing
Parallel processing
Parallel processing
Types of parallel processing job: In general there are
three types of parallel computing jobs
Parallel task
Parametric sweep
Task flow
Parallel task
Parallel processing
Parametric Sweep
A parametric sweep consists of multiple instances of
the same program, usually serial, running
concurrently, with input supplied by an input file and
output directed to an output file. There is no
communication or interdependency among the tasks.
Typically, the parallelization is performed exclusively
(or almost exclusively) by the scheduler, based on the
fact that all the tasks are in the same job.
Task flow
Introduction to numerical
analysis
The following methods have been used
for numerical integration of the ODEs
Euler method
Modified Euler method
Runge-Kutta method
Predictor-Corrector method
Characteristics method
Finite difference method
Finite element method
Finite volume method
Spectral method
Boundary element method
Solution of System of
Linear and Non Linear
Equations
Module 4
(4 lectures)
Contents
Set of linear
equations
Matrix notation
Method of
solution:direct and
iterative
Pathology of linear
systems
Solution of nonlinear
systems :Picard and
Newton techniques
F2 ( x1, x2 ,..., xn ) 0
.
.
.
Fn ( x1, x2 ,..., xn ) 0
Matrix notation
Matrix : a rectangular array (n x m) of numbers
a11 a12
a21 a22
.
.
.
.
.
.
an 2
A aij .
.
.
an1
a1m
a2 m
.
.
.
anm
Matrix Addition:
C = A+B = [aij+ bij] = [cij], where
nxm
Matrix Multiplication:
AB = C = [aij][bij] = [cij], where
m
i 1,2,..., n,
j 1,2,..., r.
bi
No.ofcols.
k 1
aik xk ,
i 1,2,..., No.ofrows
.
.
.
.
.
.
an 2
A .
.
.
an1
a1m
a2 m
.
,
.
.
anm
x1
x2
.
x ,
.
.
xn
b1
b2
.
b ,
.
.
bn
0
1
0
0
0
0
1
0
0
0 I .
4
0
1
a 0
L b d
c e
0
0
f
a
U 0
0
c
e
f
Tri-diagonal matrix: if
nonzero elements only on
the diagonal and in the
position adjacent to the
diagonal
a
c
T 0
0
0
b
d
f
0
0
b
d
0
0 0 0
e 0 0
g h 0
i j k
0 l m
Transpose of a matrix A
(AT): Rows are written as
columns or vis a versa.
Determinant of a square
matrix A is given by:
a12
a
A 11
a21 a22
Examples
4
3 1
A 0 2 3
1 1
2
3
0 1
1
2 1
4 3 2
4 x1 2 x 2 x 3 15
3 x1 x 2 4 x 3 8
x1we
xcan
x 3 13 the set of equations as
Step1: Using Matrix notation
represent
2 3
x1
15
x2 8
x
13
3
4
Ab 3
1
1
4
3
15
8
13
4
3
1
2
1
1
1
4
3
4
3R1 4 R2 0
(1) R1 4 R3 0
15
8 ,
13
2 R2 10 R3
2
1
1
4
0
0
2
10
0
2
10
2
1
19
11
15
77
37
15
1
19
77
72 216
5
3
.
66670
0 3.66670 4
4.33340 11
0
2
0
1
0
0 0 15.0000
2.2000
1.4000
2.4000
12.4000
19.8000
0 0 5.9998 3.4000
4.8000
1.2000
0
1
0
0
0 0.04000 0.58000
0 0.27993 1.55990
1 0.82667 1.32000
0 1.55990 3.11970
0 0 0 0.49999
1 0 0 1.00010
0 1 0 0.33326
0 0 1 1.99990
1 u12
0 1
0 0
l33
l43 l44 0 0
0
0
0
0
0
a13
a23
a33
a43
a14
a24
a34
a44
j i,
i 1,2,..., n
li1 ai1
j 1
uij
lii
i j,
j 2,3,..., n.
u1 j
a1 j
l11
a1 j
a11
Gauss-Siedel Method
1
xi
ci aij x j ,
aii
j 1
j i
i 1,2,..., n
i 1
n
1
~
k 1
k 1
k
xi
ci aij x j aij x j ,
aii
j 1
j i 1
xik 1 xik w( ~
xik 1 xik )
i 1,2,..., n
Another form
i 1
n
w
k 1
k
k 1
xi (1 w) xi
(ci aij x j aij x kj )
aii
j 1
j i 1
Matrix Inversion
[A]x=c
x= [A-1]c
[A-1][A]=[I]=[A][A-1]
unknowns)
x + y = 3, 2x + 2y = 6
Inconsistent equations (no solution)
x + y = 3, 2x + 2y = 7
Singular
Method of iteration
2
2
x
x
4
;
e
y 1
Nonlinear system, example :
Assume x=f(x,y), y=g(x,y)
Initial guess for both x and y
Unknowns on the left hand side are computed
iteratively. Most recently computed values are used in
evaluating right hand side
1
x
y
g
g
1
x
y
f ( x0 )
'
f ( x0 )
x1 x0
f ( x1 )
'
f ( x1 )
n 0,1,2,...
Newton-Raphson method
F(x,y)=0, G(x,y)=0
Expand the equation, using Taylor series about x n and yn
F ( xn h, yn k ) 0 F ( xn , yn ) Fx ( xn , yn )h Fy ( xn , yn )k
G ( x n h, y n k ) 0 G ( x n , y n ) G x ( x n , y n ) h G y ( x n , y n ) k
h xn 1 xn , k yn 1 yn
GFy FGY
FxG y G x Fy
FG x GFx
k
FxG y G x Fy
Newton-Raphson method
F1
F
F
x1 1 x2 ... 1 xn F1 ( x1, x2 ,..., xn)
x1
x2
xn
F2
F
F
x1 2 x2 ... 2 xn F2 ( x1, x2 ,..., xn)
x1
x2
xn
.
.
.
Fn
F
F
x1 n x2 ... n xn Fn ( x1, x2 ,..., xn)
x1
x2
xn
i 1,2,3,..., n
S
Q p Rr Rs Q1
y
x
x
y
y
t
Where
Bi, j
Di , j
Fi, j
H i, j
[T yi , j T yi , j 1 ]
2y 2
[Txi , j Txi 1, j ]
2 x 2
[Txi , j Txi 1, j ]
2x 2
[T yi , j T yi , j 1 ]
2y 2
Ri , j
Si, j h0i , j
t
Si , j
t
(Q) pi , j ( R) ri , j ( R) si , j
1 1/ 2 2 / 3
Q So AR
n
Is negligibly small
The gradient of f w.r.t y is
dQ j
df
dy j
dy j
Q is a constant
df
1
d
So1 / 2
A j R 2j / 3
dy
dy j n
1 1 / 2 2 AR 1 / 3 dR
2 / 3 dA
So
R
n
3
dy
dy
j
1 1/ 2
1 dA
2 / 3 2 dR
So A j R j
n
3R dy A dy j
2 dR 1 dA
Q j
3R dy A dy j
dy j y j 1 y j
y j 1 y j
f (y j)
(df / dy ) j
3R dy A dy j
5 Bw 6 y j
3 y j ( Bw 2 y j )
Assignments
1. Solve the following set of equations by Gauss
elimination:
x1 x2 x3 3
2 x1 3x2 x3 6
x1 x2 x3 3
Assignments
3. Solve the following system by Newtons
method to obtain the solution near
(2.5,0.2,1.6)
2
2
2
x y z 9
xyz 1
x y z2 0
Assignments
5. Find the roots of the equation to 4
significant digits using Newton-Raphson
method
3
x 4x 1 0
x2 y2 4
xy 1
Numerical
Differentiation and
Numerical Integration
Module 5
3 lectures
Contents
Integration formulas
Trapezoidal rule
Simpsons rule
Gaussian-Quadrature
Multiple integrals
Derivatives
Derivatives from difference tables
We use the divided difference table to estimate
values for derivatives. Interpolating polynomial of
degree n that fits at points p0,p1,,pn in terms of
divided differences,
f ( x) Pn ( x) error
f [ x0 ] f [ x0 , x1 ]( x x0 )
f [ x0 , x1, x 2]( x x0 )( x x1 )
... f [ x0 , x1,..., xn ] ( x xi )
error
Derivatives continued
f ( n 1) ( )
Error ( x x0 )( x x1 )...( x xn )
.
(n 1)!
n
f ( n 1) ( )
Error ( xi x j )
,
j 0
(n 1)!
j i
in [x,x0,xn].
Derivatives continued
Evenly spaced data
When the data are evenly spaced, we can use a table of
function differences to construct the interpolating polynomial.
( x xi )
h
s ( s 1) 2
s ( s 1)( s 2) 3
Pn ( s ) f i sf i
fi
fi
2!
3!
n f i
... ( s j )
error ;
n!
j 0
in [x,x0,xn].
n 1
n
f ( n 1) ( )
Error ( s j )
,
j 0
(n 1)!
Derivatives continued
j f i
n j 1 j 1
1
.
f i ( s l )
h
j!
j 2 k 0 l 0
l k
Where
ds d ( x xi ) 1
dx dx
h
h
(1) n h n ( n 1)
Error
f
( ),
n 1
in [x1,, xn].
Derivatives continued
Simpler formulas
Forward difference approximation
For an estimate of f(xi), we get
f ' ( x)
1
1
1
1
[f i 2 f i 3 f i ... n f i ] x xi
h
2
3
n
1
1 2
1 2 (3)
h f ( ),
i
i
h
2
3
Derivatives cont
Central difference approximation
Assume we use a second degree polynomial that
matches the difference table at xi,xi+1 and xi+2 but
evaluate it for f(xi+1), using s=1, then
1
1 2
f ( xi 1 ) f i f i O (h 2 ),
h
2
'
1
1
(
f
f
)
(
f
2
f
f
)
i 1
i
i2
i 1
i error
h
2
1 fi 2 fi
error ,
h
2
1
error h 2 f (3) ( ) O (h 2 )
6
Derivatives cont
Higher-Order Derivatives
We can develop formulas for derivatives of higher
order based on evenly spaced data
Difference operator:
f ( xi ) fi f i 1 f i
Stepping operator :
Ef i f i 1
Or
:
E n fi fi n
Relation between E and : E=1+
n
n
n
Differentiation operator:D ( f ) df / dx, D ( f ) d / dx ( f )
Let us start withf i s E s f i ,
where
s ( x xi ) / h
Dfi s
d
d
f ( xi s )
( E s fi )
dx
dx
1 d
1
s
( E f i ) (ln E ) E s f i
h ds
h
Derivatives cont
If s=0, we get
1
ln(1 )
h
1
1
1
1
f i 2 f i 3 f i 4 f i ... ,
h
2
3
4
1
h2
2 f i 3 f i
11 4
5
f i 5 f i ... ,
12
6
Divided differences
Central-difference formula
Extrapolation techniques
Second-derivative computations
Richardson extrapolations
Integration formulas
The strategy for developing integration formula
is similar to that for numerical differentiation
Polynomial is passed through the points
defined by the function
Then integrate this polynomial approximation
to the function.
This allows to integrate a function at known
values
Newton-Cotes integration b f ( x)dx b P ( x )dx
a n 1
Newton-Cotes integration
formulas
x1
x0
x0
f ( x)dx ( f 0 sf 0 )dx
s 1
h ( f 0 sf 0 )ds
s 0
hf 0 s 10 hf 0
s
1
h( f 0 f 0 )
2
2
0
h
h
2 f 0 ( f1 f 0 ) ( f 0 f1 )
2
2
Newton-Cotes integration
formula cont...
Error
s3 s 2
1 3 "
h f (1)
h f (1 ),
6
4
12
0
3 "
Newton-Cotes integration
formula cont...
f ( x)dx
x0
x2
f ( x)dx
x0
x3
f ( x)dx
x0
h
1
( f 0 f1 ) h3 f " ( )
2
12
h
1 5 iv
( f 0 4 f1 f 2 )
h f ( ),
3
90
3h
3 5 iv
( f 0 3 f1 3 f 2 f 3 )
h f ( ).
8
80
Romberg integration
Simpsons rule
f ( x)dx
xi
f ( xi ) f ( xi 1 )
h
(x) ( fi f i 1 ),
2
2
i 12
( f i f i 1 )
f ( x)dx
( f1 f 2 f 2 f3 ... f n f n 1 );
h
( f1 2 f 2 2 f3 ... 2 f n f n 1 ).
2
f(x)
x1 = a x2
x3
x4
x5
Trapezoidal Rule
xn+1 = b
x0 1 x1
Local error
Global error
1 3 "
h [ f (1 ) f " ( 2 ) ... f " ( n )],
12
Romberg Integration
(more
f0 4 f1 f 2 .
With an error of
(b a ) 4 ( 4)
Error
h f ( )
180
3h
f ( x)dx
f0 3 f1 3 f 2 f3 .
8
Error
3 5 ( 4)
h f ( )
80
rule cont
[ f (a ) 3 f1 3 f 2 2 f 3 3 f 4 3 f 5 2 f 6
8
... 2 f n 3 3 f n 2 3 f n 1 f (b)]
80
h 4 f ( 4) ( )
f ( x)dx w1 f1 w2 f 2 w3 f 3
x1
Gaussian quadrature
Other formulas based on predetermined evenly
spaced x values
Now unknowns: 3 x-values and 3 weights; total 6
unknowns
For this a polynomial of degree 5 is needed to
interpolate
These formulas are Gaussian-quadrature formulas
Applied when f(x) is explicitly known
1
Example: a simple case of
a two term formula
1 f (t ) af (t1 ) bf (t2 ).
containing four unknown parameters
1
If we let
ba
f ( x)dx
a
ba
dt
2
(b a )t b a
2
(b a )t b a
f
2 1
2
dx
so that
then
Multiple integrals
f ( x, y )d A f ( x, y )dy dx f ( x, y )dx dy
A
j 1
i 1
f ( x, y )dxdy v j wi f ij
y x
3 2
Multiple integrals
i 1
f ( x)dx ai f ( xi ).
1 1 1
n n
f ( x, y, z )dxdydz ai a j ak f ( xi , yi , zk ).
1 1 1
i 1 j 1 k 1
Assignments
1. Use the Taylor series method to derive expressions
for f(x) and f (x) and their error terms using fvalues that precede f0. ( These are called
backward-difference formulas.)
2. Evaluate the following integrals by
(i)
Gauss method with 6 points
(ii)
Trapezoidal rule with 20 points
(iii)
Simpsons rule with 10 points
Compare the results. Is it preferable to integrate
backwards or forwards?
5
(a)
x
e
dx
0
(b)
3 x 1
x
e dx
0
Assignments
3. Compute the integral of f(x)=sin(x)/x between x=0 and x=1
using Simpsons 1/3 rule with h=0.5 and then with h=0.25.
from these two results, extrapolate to get a better result.
What is the order of the error after the extrapolation?
Compare your answer with the true answer.
a.
b.
Assignments
5. Integrate with varying values of x and y using the
trapezoidal rule in both directions, and show that the
error decreases about in proportion to h2:
1 1
2
2
(
x
y
)dxdy
0 0
3
2
x
yz
dxdydz
0 0 1
Numerical Solution of
Ordinary Differential
Equations
Module 6
(6 lectures)
Contents
Introduction
Introduction
Introduction
Introduction
Introduction
y ( x ) y (a ) f (t )dt
a
Taylor-series method
y '' ( x0 )
y ''' ( x0 )
2
y ( x) y ( x0 ) y ( x0 )( x x0 )
( x x0 )
( x x0 )3 ...
2!
3!
'
If we assume x x0 h
Since y ( x0 ) is initial condition, first term is known
y '' ( x0 ) 2 y ''' ( x0 ) 3
y ( x) y ( x0 ) y ( x0 )h
h
h ...
2!
3!
'
where 0<<h
Error
( ) 5
h ,
5!
)
h
y ( x0 h) y ( x0 ) y ' ( x0 )
,
2
yn 1 yn hy 'n O (h 2 ).
the error of yO(h):
1 yn 1' y 'n
'
y h y
O(h) h O(h3 ),
n 1
1
1
y 'n y 'n 1
O(h3 ).
yn 1 yn h
Runge-Kutta methods
yn 1 yn ak1 bk 2
k1 hf ( xn , yn ),
k 2 hf ( xn h, yn k1 ).
fx
fy f
The local error term for the 4 th order RungeKutta method is O(h5) ; the global error
would be O(h4).
Multi-step methods
The number of past points that are used sets the degree
of the polynomial and is therefore responsible for the
truncation error.
Multi-step methods
x n 1
x n 1
xn
xn
dy yn 1 yn f ( x, y )dx
More the past points, better the accuracy, until round-off error
is negligible
Multi-step methods
f ( x, y )
1 2
1
h ( f n 2 f n 1 f n 2 ) x 2 h(3 f n 4 f n 1 f n 2 ) x f n
2
2
Multi-step methods
Multi-step methods
Multi-step methods
Multi-step methods
Milnes method
dy
f ( x, y )
dx
xn1
xn1
xn1
dy
x dx dx x f ( x, y)dx x P2 ( x)dx
n 3
n 3
n 3
yn 1 yn 3
Where
4h
28 5 v
2 f n f n1 2 f n2 h y (1 )
3
90
xn 3 1 xn 1
Multi-step methods
xn1
xn1
dy
x dx dx x f ( x, y)dx x P2 ( x)dx
n 1
n 1
n1
5
h
h v
yn 1,c yn 1 f n 1 4 f n f n 1
y ( 2 )
3
90
Where
xn 1 2 xn 1
Multi-step methods
h
251 5 v
[55 f n 59 f n 1 37 f n 2 9 f n 3 ]
h y (1 )
24
720
Application to systems of
equations and higher-order
equations
dx
f t , x, ,
dt
dt 2
x(t0 ) x0,
dx
y,
dt
x(t0 ) x0,
dy
f (t , x, y ),
dt
y (t0 ) x0'
y f ( x, y, y ,..., y
y ( x0 ) A1 ,
(n)
y ' ( x0 ) A2 ,
.
.
.
y ( n 1) ( x0 ) An
'
( n 1)
),
( p z ) 0
ds
ds
1 Fr2
Or Gradually varied
can be written as
Sflow
dy
o Sf
dx
1 (Q 2 B) /( gA3 )
dx
C 2 ( gBy 3 BQ 2 )
ds ( p z )
t ( z cQ Q )
Assignments
1. Use the simple Euler method to solve for
y(0.1) from
dy
dx
x y xy
y ( 0) 1
x y
y (0) 2
Assignments
3. Solve the following simultaneous differential
equations by using
(i)
A fourth order Runge-Kutta method
(ii)
A fourth order Milne predictor-corrector algorithm
dy
dz
x yz, y xz, y (0) 0, z (0) 1.0
dx
dx
For
0.5 x 0.0
''
'
''
'
Assignments
5. Find y at x=0.6, given that
y '' yy ' , y (0) 1, y ' (0) 1
Begin the solution by the Taylor-series method, getting
y(0.1),y(0.2),y(0.3). The advance to x=0.6
employing the Adams-Moulton technique with h=0.1
on the equivalent set of first-order equations.
6. Solve the pair of simultaneous equations by the
modified Euler method for t=0.2(0.2)0.6. Recorrect
until reproduced to three decimals.
dx
dy
xy t , x(0) 0, x t , y (0) 1,
dt
dt
Introduction to Finite
Difference Techniques
Module 7
6 lectures
Contents
Types of finite
difference techniques
Methods of solution
Application of FD
techniques to steady
and unsteady flows in
open channels
Types of FD techniques
Types of FD techniques
x
)
f ( x0 x) f ( x0 ) xf ' ( x0 )
f '' ( x0 ) O(x)3
2!
Types of FD techniques
f(x0)=dy/dx at x=x0
O(x)3: terms of third order or higher order of
x
Similarly f(x0- x) may
be(expressed
as3
x) 2 ''
'
f ( x0 x) f ( x0 ) xf ( x0 )
Equation may
be written as
f ( x x) f ( x ) xf ' ( x
0
2!
f ( x0 ) O( x)
2
)
O
(
x
)
0
f ( x0 x) f ( x0 )
df
From this equation
O( x)
dx x x
0i
Types of FD techniques
f(x)
y=f(x)
B
x0-x
x0 x0+x
Types of FD techniques
Similarly
f ( x0 ) f ( x0 x)
df
O ( x )
dx x x
x
0i
f ( x0 x) f ( x0 )
df
dx x x
x
0i
Backward difference
formula
as shown below
f ( x0 ) f ( x0 x)
df
order accurate
0i
O(x) 2
dx x x
2x
0i
dx x x
2x
0i
k+1
k
t
k-1
i-1 i i+1
x
x
Forward:
Central:
f ik1 f ik
f
x
x
k
k
f
f
f
i 1
i 1
x
2x
Central:
k 1
k 1
f
f
f
i
i 1
x
x
f ik11 f ik 1
f
x
x
k 1
k 1
f
f
f
i 1
i 1
x
2x
Unstable scheme
Approximations
k
k
f
f
f
i 1
i 1
x
2x
f ik 1 f ik
f
t
t
Diffusive scheme
f
f
i 1
i 1
x
2x
fik 1 f *
f
t
t
This method is an explicit, two-step predictorcorrector scheme that is a second order accurate
both in space and time and is capable of capturing
the shocks without isolating them
This method has been applied for analyzing onedimensional, unsteady, open channel flows by
various hydraulic engineers
t
t
k
k
f
f
f
i
i 1
x
x
t
t
f i*1 f i*
f
x
x
k 1
1 *
( f i f i** )
2
3
f
f
i
i 1
i 2
f x
x
k
k
f
f
i
f x i 1
x
Corrector
fi* f i*1
fx
x
*
*
*
2 f i 3 f i 1 f i 2
fx
t
t
k 1
1 *
( f i f i** )
2
Gabutti scheme
f
i
i 1
fx
x
k
k
f
f
i
1
fx
x
f i** f ik
f
t
t
3
f
f
i
i 1
i 2
f x
x
k
k
k
2
f
3
f
f
i
i 1
i 2
f x
x
f
i 1
f x i
x
*
*
f
f
i
f x i 1
x
t
2t
f
( f ik11 f ik 1 )
x
(1 )( f ik1 f ik )
1
1
k 1
k 1
f ( f i 1 f i ) (1 )( f ik1 f ik )
2
2
Assignments
1. A large flat steel plate is 2 cm thick. If the initial
u 100(2 x) for
0 x 1
u
k 2u
t
c x 2
Take k=0.37 c=0.433.
Assignments
2. Solve for the temperature at t=2.06 sec in the 2-cm
thick steel slab of problem (1) if the initial
temperatures are given by
x
u ( x,0) 100 sin
f ( x)
2
x
Numerical Solution of
Partial Differential
Equations
Module 8
6 lectures
Contents
Classification of
PDEs
Approximation of
PDEs through Finite
difference method
Solution methods:
SOR
ADI
CGHS
Introduction
Classification of PDEs
2u
2u
u u
A
B
C
D x, y, u , , 0
xy
x y
x 2
y 2
Classification of PDEs
cont
2u
y
Classification of PDEs
cont
2C
x 2
C
C
u
0
x
t
Tg 2 y
0
2
2
w x
t
FD Approximation of PDEs
FD Approximation of PDEs
FD Approximation of PDEs
2u
x
2u
y
(y ) 2
0
FD Approximation of PDEs
ui, j
(x) 2
ui, j 1 2ui, j ui , j 1
(y ) 2
0.
ui 1, j 2ui, j ui 1, j
ui , j
u
ui 1, j ui, j 1 ui, j 1 4ui, j 0.
2 i 1, j
h
FD Approximation of PDEs
2
ui , j
1 4 1 ui, j 0.
2
1
h
4 1
6h 2 1
Methods of solution
Liebmanns Method
2ui, j
1
4
1
ui, j 0.
2
1
h
u
i 1, j
i 1, j
i , j 1
i, j 1
uij( k 1)
4
u ( k ) u ( k 1) u ( k ) u ( k 1) 4u ( k )
ij
i 1, j
i 1, j
i , j 1
i, j 1
( k 1)
(k )
uij
uij
u L 2u0 u R u A 2u0 u B
u
0
2
2
( x )
(y )
2
2
u
2
u
u
wise:
B
L
R
A
0
0
( k 1)
( k 2)
( k 2)
u0( k 2) u0( k 1) u L( k 1) 2u0( k 1) u R
2u0( k 2) u B
u A
.
uL
2 u0
uR
uA
2 u0 u B
( k 2)
( k 1)
( k 2) 1
( k 2)
( k 1) 1
( k 1)
uA
2 u0
uB
uL
2 u0
uR
.
CGHS method
CGHS method
CGHS method
where
B ei 1, ei 1 0.5
ei 1 H H i 1 ei di
CGHS method
x, y xi yi
i 1
CGHS method
CGHS method
K
Y
modified as
CGHS method
CGHS method
Initialize
s0 K r0
p0 s0
i0
CGHS method
Cont
ai si , ri / A pi , pi
H i 1 H i ai pi
ri 1 ri ai A pi
si 1 K 1ri 1
bi si 1, ri 1 / si , ri
p i 1 si 1 bi pi
i i 1
End do
CGHS method
CGHS method
Assignments
1. The equation
2u 2u u
2 2 2
2
x
y
x
0 x 2,0 y 2,
On the region
with u=0 on all
boundaries except for y=0, where u=1.0.
Assignments
3. Repeat the exercise 2, using A.D.I method. Provide
the Poisson equation as well as the boundary
conditions as given in the exercise 2.
2 1
9 | 12
Computation of Gradually
Varied and Unsteady
Open Channel Flows
Module 9
6 lectures
Contents
Numerical
integration methods
for solving Gradually
varied flows
Finite difference
methods for Saint
Venant-equations
Examples
Introduction
Introduction
Introduction
V2
H z d cos
2g
H= total head
z = vertical distance of the channel bottom above the datum
d= depth of flow section
= bottom slope angle
= energy coefficient
V= mean velocity of flow through the section
Differentiating
dH dz
dd
d V 2
cos
dx dx
dx
dx 2 g
dx cos d (V 2 / 2 g ) / dd
dx 1 d (V 2 / 2 g ) / dy
3
3
dy 2 g
2 g dy
dy
gA
gA
Since, Z A3 / T
The above may be written as
d V 2
Q 2
2
dy 2 g
gZ
After substituting
Zc 2
d V 2
dy 2 g
Z
2.22 R 4 / 3
n V
In general form,
V2
C 2R
Sf
Q2
K2
Computation of gradually
varied flows
Where
H = elevation of energy line above datum;
z =elevation of the channel bottom above the datum;
y = flow depth;
V = mean flow velocity, and
=velocity-head coefficient
The rate of variation of flow depth, y, with respect to
distance x is obtained by differentiating the above
equation.
dx 1 (Q 2 B) /( gA3 )
In which,
f ( x, y )
So S f
1 (Q 2 B) /( gA3 )
y1
x1
y2 y1 f ( x, y )dx
x1
In which
1 (Q 2 B) /( gA3 )
F ( x, y )
So S f
y2
x2 x1 F ( x, y )dy
y1
2V22
E2 y2
2g
Sf
Geometric mean friction slope
S f1 S f 2
2 S f1 S f 2
Sf
Harmonic mean friction slope
Sf
S f2
1
( S f1 S f 2 )( x2 x1 )
2
1
( S f1 S f 2 )( x2 x1 )
2
E2 E1
1
S o ( S f1 S f 2 )
2
2.
3.
1V12
H1 z1 y1
2g
H 2 H1 h f
1
( S f1 S f 2 )( x2 x1 )
2
2Q 2
2 gA22
1
1
S f 2 ( x2 x1 ) z 2 H1 S f1 ( x2 x1 ) 0
2
2
2Q 2
2 gA22
1
1
S f 2 ( x2 x1 ) z 2 H1 S f1 ( x2 x1 ) 0
2
2
Q 2 dA
1
d
Q 2n2
dy2
gA23
2 (x x )
2
1
dy2 2
dy2 Co2 A22 R 4 / 3
2
2 2
2 2
2 2
d
Q n
dR2
2Q n dA2 4 Q n
evaluated
as
dy2 C 2 A2 R 4 / 3 C 2 A2 R 4 / 3 dy2 3 C 2 A2 R 7 / 3 dy2
o 2 2
o 2 2
o 2 2
2Q 2 n 2 dA2 4 Q 2 n 2
1 dR2
B2 2 S f 2 dR2
2 S f 2
A
3 R2 dy2
2
dF
2Q 2 B2
B
2
2
1
( x2 x1 ) S f 2
dy2
A2 3 R2 dy2
gA23
y2 y*2
F ( y2 )
[dF / dy2 ]*
If
is less than a specified tolerance, ,
y*2
then
is the flow depth y2, at section 2;
y*2 y2 set
otherwise,
and repeat the
steps until a solution is obtained
1.
2.
Single-step methods
Predictor-corrector methods
So S fi
1 (Q 2 Bi ) /( gAi3 )
yi 1 yi f ( xi , yi )( xi 1 xi )
y y (x)
y yi 1/ 2
1
, in which x
xi xi 1 and
i 1/ 2
2
yi' 1/ 2
x xi 1/ 2
yi 1/ 2 yi
1 ' .
yi x
2
. Then
yi 1 yi yi' 1/ 2 x
or
yi 1 yithe
f modified
( xi 1/ 2 , yi 1/Euler
2 ) x method, is secondThis method, called
y i1
yi*1 yi yi' x
y y (x)
x xi 1
yi 1 f xi 1 , yi 1
and
from
1 '
yi yi' 1 x . This equation may be
2
1
*
y
f
(
x
,
y
)
f
(
x
,
y
i
i
i
i 1
i 1 ) x. This method called
written as i 1
2
the improved Euler method, is second order accurate.
1
yi 1 yi (k1 2k 2 2k3 k 4 )x
6
yi(01) yi f ( xi , yi )x
1
[ f ( xi , yi ) f ( xi 1, yi(1)1 )]x
2
1
[ f ( xi , yi ) f ( xi 1, yi(j11) )]x
2
, where =
Saint-Venant equations
g ( So S f )
x
x t
X - distance along the channel, t - time, vaverage velocity, y - depth of flow, a- cross
sectional area, w - top width, So- bed slope, Sf
- friction slope
Friction slope
Sf
n 2v 2
r4 / 3
Saint-Venant equations
and
t v c x v c t v c x y g S o S f
g So S f
dt c dt
dt
In which
a
U
va
va
F 2
v a gay
General formulation
n 1
n 1
f
( fi
S
ga ( s0 s f )
f i 1 ) ( f in f in1 )
t
Continued
n 1
n 1
n
n
f ( f i 1 fi ) (1 )( fi 1 fi )
x
x
x
1
1
( fin11 f in 1) (1 )( fin1 fin )
2
2
U in 1 U in11 2
t
( Fin11 Fin 1 ) (1 )( Fin1 Fin )
x
Boundary conditions:
Downstream boundary:
yin, j 11 yresd
Solution procedure
t
(va)in11 (va)in 1 (1 ) (va)in1 (va)in
x
ain ain1
(va)in 1 (va)in11 2
gat (1 )( s
t
(v 2 a gay )in11 (v 2 a gay )in 1
x
n
n
s
)
(
s
s
)
0
f i 1
0
f i
t 2
(v a gay )in1 (v 2 a gay )in
x
Assignments
1. Prove the following equation describes the
gradually varied flow in a channel having
variable cross section along its length:
2
dy S O S f V / gAA / x
dx
1 BV 2 / gA
Assignments
3. Using method of characteristics, write
a computer program to solve 1D
gradually varied unsteady flow in an
open channel as given by Saint-Venant
equations, assuming initial and
boundary conditions.
Solution of Pipe
Transients and Pipe
Network Problems
Module 10
6 Lectures
Contents
Basic equation of
transients
Method of
characteristics for its
solution
Complex boundary
condition
Pipe network problems
Node based and Loop
based models
Solution through
Newton and Picard
techniques
Basic equations of
transients
1. daily cycles
2. transient fluctuations
Basic equations of
transients
t ( A)dx ( AV )
( AV )1 0
x1
( A) ( AV ) 0
t
x
0
dt
A dt
dt
K dt
dt
D dp
2eE dt
A dt eE dt
a2
1
0
K
eE / DK dt
K/
1 ( DK ) / eE
Let us define
, where a is wave speed
with which pressure waves travel back and forth.
Method of characteristics
QQ 0
t
x 2 DA
L2 a 2
Q
H
gA
0
x
t
Method of characteristics
vv 0
g t x 2 Dg
H a 2 v
L2
0
t
g x
Where,
k
a
e1 (kD / E )
Method of characteristics
QQ 0
gA
x
2 DA
t
T x
Assume H=H(x,t);Q=Q(x,t)
Method of characteristics
dt
t
x dt
a 2
dt
1
a
Finally we get
dx
a
dt
dH H H dx
dt
t
x dt
dQ gA dH
f
QQ 0
dt
a dt
2 DA
Method of characteristics
Figure
t
P
Negative characteristic
line
Positive characteristic
line
Characteristic lines
Complex boundary
condition
QP1,1 Cn Ca H ru
Cp
Ca
Complex boundary
condition
Complex boundary
condition
Where
Cv (Q0 ) 2 /(Ca H 0 )
2.
2.
3.
4.
5.
Q( p) Q( p) C ( j ) 0,
p { j}
j 1,..., NJ
p { j}
Network Analysis
2. Energy conservation equations the energy
conservation equations state that the energy loss
along a path equals the difference in head at the
starting node and end node of the path.
h( p) h( p) H (s(l )) H (e(l )) 0
l 1,..., NL NPATH
p {l}
p {l}
Where h(p) is the head loss in element p(m), s(l) is
the starting node of path l, e(l) is the end of path 1,
NL is the number of loops, and NPATH is the
p {l}other than loops and
number of paths
refers to
the pipes belonging to path l. loop is a special case
of path, wherein, the starting node and end node
are the same, making the head loss around a loop
zero, that is, h( p ) h( p ) 0
Network Analysis
3. Element characteristics the equations defining
the element characteristics relate the flow through
the element to the head loss in the element. For a
pipe element, h(p) is given by,e
h( p ) R ( p )Q( p )
Network Analysis
For a pump element, h(p) is negative as head is gained in
the element. The characteristics of the pump element
are defined by the head-discharge relation of the
pump. This relationship may be expressed by a
polynomial or in an alternate form. In this study, the
following equation is used.
Q( p)
h( p) HR( m) C1(m) C 2( m).
QR (m)
C 3( m )
Network Analysis
Where HO(m) is the shutoff head of the m-th pump.
As h(p)=-HR(m) for rated flow,
C1(m) C 2(m) 1
From which C2(m)is determined. C3 (m) is obtained
by fitting the equation to the actual pump
characteristics.
(1 / e )
For a pipe element,
h( p )
H (i ) H ( j )
Q( p)
R( p)
R ( p ) (1/ e ) H (i ) H ( j )
(11 / e )
Network Analysis
1
H ( j ) H (i )
Q( p ) ()QR(m)
C1(m)
C
2
(
m
)
HR
(
m
)
1
C 3( m )
Network Analysis
nij
sgn Qij
Qij sgn( H i H j )( H i H j / K ij )
Qki U i
k 1
K ki
k 1
1 / nki
mi
Ui
dhl
(l=1,2,,L)
Where
Qii = initial estimate of the flow in i th pipe, L3/T
Ql = correction to flow in l th loop, L3/T
ml = number of pipes in l th loop
L = number of loops
Qi Qa Qb Qc
dF F ( x x) F ( x)
dx
x
F ( H i ) sgn( H j H i )
K ji
j 1
1 / nij
Ui 0
(i 1,2,..., K )
dF F (i 1) F (i )
F
F
F
H1
H 2 ...
H k
H1
H 2
H k
(1 / n ) 1
dH j
and
sgn H i H j
K ij
H H
i
j
d
sgn H i H j
dH i
K ij
nij Kij 1 / n
ij
1 / nij
Hi H j
nij Kij 1 / n
ij
ij
H i H j (1 / n )1
ij
dhl 0
Where
Ql=correction to l th loop to achieve convergence, L 3/T
Qii=initial estimates of flow in i th pipe (satisfies
continuity),L3/T
ml=number of pipes in loop l
K i (Qii Ql ) Qii Ql
Q(k 1) Q i 1
ml
K i ni Qii Ql
n 1
n 1
i 1
Assignments
1. How many Q equations must be set up for a
network with L loops (and pseudo-loops), N nodes,
and P pipes? How many H-equations must be set
up?
2. What are the primary differences between the
Hardy-Cross and Newton-Raphson method for
solving the Q equations?
3. For two pipes in parallel, with K1>K2, what is the
relationship between K1, K2, and Ke , the K for the
equivalent pipe replacing 1 and 2 (h=KQ n)?
a. K1>K2>Ke
b. K1>Ke>K2
c. Ke>K1>K2
Assignments
4. Derive the following momentum equation by
applying conservation of momentum for a control
volume for transient flow through a pipe
V
V 1 p fV V
V
0
t
x x
2D
5. Develop the system of equations for the following
network (consists of 8 nodes and 9 elements, out of
which 8 are pipe elements and the other is a pump
element) to find the values of the specified
unknowns. Also write a computer program to solve
the system of equations.
Assignments continued
1
2
- Pump element
6
7
Unknowns
H [2], H [4], H [5]
R [4], R [5]
C [6], C [7], C [8]
Contaminant Transport
in Open Channels and
Pipes
Module 11
5 lectures
Contents
Contaminant transport
Definition of terms
Introduction to ADE
equation
Few simple solutions
Solution of ADE
through FD methods
Problems associated
with solution methods
Demonstration of
methods for open
channel and pipe flows
Contaminant transport
Definition of terms
Terminologies related to contaminant
transport
Diffusion: It refers to random scattering
of particles in a flow to turbulent motion
C
x
2C
x 2
1 0
C (0, t ) C0
t0
C (, t ) 0
t0
1 vt
vl
C
1
(1 v t )
erfc
erfc
exp
2 Dt
Co 2
D
2 Dl t
l
Dl
x i 1
2
( Dl ) 1
i
x 2
2 C
1
2
x 2
Ci Ci 1
Ci 1 Ci Ci C0
( Dl ) 1
ui
2
x
t
i
x
2
( Dl ) 1
2 u Ci 1 Ci Ci C0
i
Ci 1 Ci
( Dl ) 1
x
Dl
x i 1
( Dl ) 1
i
2 ui 1 C
i
2
t
x
( Dl ) 1
u
C0
2 i C
i 1
2
x
t
x
( Dl ) 1
2 C
1
2
x 2
( Dl ) 1
i
2 ui 1 C
i
2
t
x
( Dl ) 1
u
C
2 i C
0
i
1
x
t
x 2
Ci 1 Ci flux (x)
C (0, t ) C0
t 0;
AA BB Ci CCCi 1 DD AA fluxx
The above three equations are solved for Ci at
all the nodes for the mesh. Thomas
Algorithm can be used to solve the set of
equations.
Assignments
1. Considering the one-dimensional flow of a solute
through the soil column, write a computer program for
solving the given contaminant transport equation by
finite difference technique. The boundary conditions
represented by the step function input are described
mathematically as:
C (1,0) 0
1 0
C (0, t ) C0
t0
C (, t ) 0
t0