Numerical Hydraulics
Block 2 – Computation of pressure surges
Markus Holzner
Contents of the course
Block 1 – The equations Block 2 – Computation of pressure surges
Block 3 – Open channel flow (flow in rivers)
Block 4 – Numerical solution of open channel flow
Block 5 – Transport of solutes in rivers
Block 6 – Heat transport in rivers
2
Till time t = 0: Steady state flow Q At time t = 0: Instantaneous closing of valve Observation: Sudden pressure rise at valve → pressure surge (water hammer)
Valve
3
Reservoir
The phenomenon
And some typical damages
Pipe damage in power station Okigawa
Burst pipe in power station Big Creek #3, USA
Pump damage in Azambuja Portugal
4
The phenomenon
5
6
Pressure wave propagates with wave velocity c
If valve closing time is smaller than the run time of the wave to the reflection point and back à surge is called Joukowski surge
Pressure vs. time at valve
50 100 150 200 250 300-1.5
-1
-0.5
0
0.5
1
1.5x 107 Druck am letzten Knoten gegen Zeit
Damping of amplitude through friction
7
The phenomenon
Negative pressure wave
The negative pressure wave cannot become lower than the vapour pressure of the fluid. If the pressure falls below the vapour pressure, a vapour bubble is formed. The water column separates from the valve. When the pressure increases again, the bubble collapses. This phenomenon is called cavitation.
8
Pressure surge with vapour bubble formation
9
Computed and observed pressure surge at two places along a pipe
Today, the reliable computation of pressure surges is possible
10
• Surge shaft • Wind kessel • Long closing time • Special valves
11
Surge tank Reservoir
Power house
Net falling height
Water table
Pressure tunnel
Pressure pipeline
Measures against pressure surges
• Continuity: Mass flux in – Mass flux out = Mass storage in section per unit time
• Momentum equation: Momentum flux in – Momentum flux out = S forces
The equations of unsteady pipe flow
Storage by compression of fluid or by dilatation of pipe (correspondingly: destorage)
There are: pressure forces, gravity, wall friction in pipe
Ffriction
Fpressure
Fgravity
pipe
pipe
12
ρ ⋅ A ⋅ v (x) ρ ⋅ A ⋅ v (x +∆ x)
∆ x
ρ ⋅ v ⋅Q (x) ρ ⋅ v ⋅Q (x +∆ x)
∆ x
The equations of unsteady pipe flow
• Continuity
• Momentum equation (per unit volume, a = inclination angle of pipe)
∂(ρA)∂t
+∂(ρAv)∂x
= 0 ⇒∂ρ∂t+ v ∂ρ
∂x+ ρ
∂v∂x+ρA∂A∂t+ v ∂A
∂x
⎛
⎝⎜
⎞
⎠⎟= 0
with ρ = ρ( p) and A= A( p)
0 02
sin( ) 0
/ 4 / 4
R
RR
v v pv g g It x x
x D I xV gfriction force g Ivolume x D D V x
ρ ρ ρ α ρ
τ π τ ρ ρπ
∂ ∂ ∂+ − + + =∂ ∂ ∂
Δ Δ= = = =Δ Δ
13
Further transformations (1)
• Continuity: As density and cross-sectional area depend on x and t only via the pressure p, the chain rule can be applied.
0
1 1 0
d p p dA p p vv vdp t x A dp t x x
d dA p p vvdp A dp t x x
ρ ρ ρ
ρρ
∂ ∂ ∂ ∂ ∂⎛ ⎞ ⎛ ⎞+ + + + = ⇒⎜ ⎟ ⎜ ⎟∂ ∂ ∂ ∂ ∂⎝ ⎠ ⎝ ⎠⎛ ⎞ ∂ ∂ ∂⎛ ⎞+ + + =⎜ ⎟⎜ ⎟∂ ∂ ∂⎝ ⎠⎝ ⎠
Using the moduli of elasticity of water EW und of the pipe Epipe
1 1 1 / 1'W pipe
d dA D edp A dp E E Eρ
ρ⎛ ⎞
+ = + =⎜ ⎟⎝ ⎠
e is the pipe wall thickness, E‘ is the combined modulus of elasticity of the system 14
Further transformations(2)
• Momentum equation
21 ( )2
2
R
R
h vI Hydraulics Ix D g
v vTaking intoaccount the flow direction I
Dg
λ
λ
Δ= =Δ
=
15
Outline • Linearized solution
• Finite differences method
– Basic properties – Exercise in class: equations in discretized form
• Characteristics method
– Equations – Exercise 1 (start in class, finish at home)
16
The equations of unsteady pipe flow
• Continuity
• Momentum equation
1 0'p p vv
E t x x∂ ∂ ∂⎛ ⎞+ + =⎜ ⎟∂ ∂ ∂⎝ ⎠
1sin( ) 02v vv v pv g
t x x Dλ
αρ
∂ ∂ ∂+ − + + =∂ ∂ ∂
2 PDE with 2 unknown functions p(x,t) und v(x,t) plus initial and boundary conditions
(1)
(2)
17
Boundary conditions • Pressure boundary condition: p given
– e.g. water level in reservoir, controlled pump
• Velocity/Flux boundary condition: v given – e.g. flow controlled (v from Q/A)
• Combination: Relation between pressure and flux given – Z. B. function of pressure reduction valve, characteristic
curve of pump
• Closing of a valve at the end of a pipe – Initially flow Q, then according to closing function reduction
to zero withing closing time of the valve.
18
Linearised equations
• Delete all terms in (1) and (2) which are non-linear (for convenience: a = 0):
1 0'p v
E t x∂ ∂+ =∂ ∂
1 0v pt xρ
∂ ∂+ =∂ ∂
General solution by elimination: - Take partial derivative of first equation
with respect to t - Take partial derivative of second
equation with respect to x Subtraction yields:
19
Linearised equations • Wave equation (for p, analogously for v)
which has general solution
• Wave with wave velocity
• Example: Modulus of elasticity of steel = 200‘000 MN/m2, Modulus of elasticity of water = 2‘000 MN/m2, wall thickness e = 0.02 m, D = 1 m, r = 1000 kg/m3 yields c = 1333 m/s
2 2
2 2
' 0p E pt xρ
∂ ∂− =∂ ∂
'Ecρ
=
( , ) ( )f x t f x ct= ±
20
Joukowski surge
• Estimate of water hammer after instantaneous closing of valve (neglecting friction, linearized equations): „Worst case“
• General solution:
0 ( ) ( )p p F x ct f x ct= + + + −
( )01 ( ) ( )v v F x ct f x ctcρ
= − + − −
Proof by insertion into linearised equations!! 21
Joukowski surge
• After t = 0 only the backward running wave F(x+ct) is found in the upstream
• v at the valve is 0 • Maximum Dp is given by:
• Solution:
0 ( )p p p F x ctΔ = − = +
01 ( )v F x ctcρ
− = − +
0p cvρΔ =
Example continued: c=1333 m/s, Q0=1 m3/s, L=100 m yields: Dp=1.7E6 N/m2 22
Numerical solution of the complete equations
• Difference method – Discretisation of space and time – Dx and Dt
• Difference equations for time step t, t+Dt • Problem: Discretisation „softens“ pressure
front numerically • Way out: Method of characteristics
– Follows the pressure signal in moving coordinate system
23
• Finite differences method
24
Numerical solution of the complete equations
• Normal difference method – Softening of pressure front
• Method of characteristics – Grid is adapted to frontal velocity (feasible, as
v<<c, c+v ≈ c-v ≈ c)
Method of characteristics
Front of pressure wave
Front of pressure wave cDt = Dx
cDt < Dx Dx
Dx 25
Method of characteristics
• Replacing equations (1) and (2) by 2 linear combinations
yields:
1( ) ( ) sin( ) 02v vv v p pv c v c g
t x c t x Dρλ
ρ ρ α∂ ∂ ∂ ∂⎛ ⎞ ⎛ ⎞+ + + + + − + =⎜ ⎟ ⎜ ⎟∂ ∂ ∂ ∂⎝ ⎠ ⎝ ⎠
1( ) ( ) sin( ) 02v vv v p pv c v c g
t x c t x Dρλ
ρ ρ α∂ ∂ ∂ ∂⎛ ⎞ ⎛ ⎞+ − − + − − + =⎜ ⎟ ⎜ ⎟∂ ∂ ∂ ∂⎝ ⎠ ⎝ ⎠
(1) (2) (1) (2)c and cρ ρ ρ ρ⋅ + ⋅ ⋅ − ⋅
26
Method of characteristics
• With total derivative along x(t)
the equations have the form: 1 sin( ) 0
2v vDv Dp dxg with v c c
Dt c Dt D dtρλ
ρ ρ α+ − + = = + ≈
1 sin( ) 02v vDv Dp dxg with v c c
Dt c Dt D dtρλ
ρ ρ α− − + = = − ≈ −
Forward characteristic
Backward characteristic
D dxDt t dt x
∂ ∂= +∂ ∂
(c is actually relative wave velocity with respect to average water movement.) 27
Difference scheme
Chose time step such that Dx = c Dt In every time step there are two unknowns at each of the N+1 nodes:
Divide pipe of length L in N sections, length of one section Dx = L/N
Node 1
section 1
Node N+1
section N x
1 1,j ji iv p+ +
To determine these unknowns 2N+2 equations are required. From quantities at time j quantities at time j+1 are computed. The new times j+1 become the old times j of the next time step.
Upper index time step, lower index node
28
Difference scheme
Dx
Dt
Dx = c Dt
i i-1 i+1
j
j +1 3
1
2
1 2
3
1j ji i
j
p ppx x
−−∂ =∂ Δ
1j ji i
i
p ppt t
+ −∂ =∂ Δ
1 11 1
, ,
.j j j ji i i i
i forward i backward
p p p pDp DpvizDt c t Dt c t
+ +− +− −= =
Δ Δ
Total derivative or derivative along characteristic line
space
time Using c + v ≈ c - v ≈ c node i communicates within time interval Dt with node i-1 via the forward characteristic and with node i+1via the backward characteristic
29
Difference form of equations
• Equations for nodes 2 to N: 2N-2 equations
1 11 11 11 sin( ) 02
j jj j j ji ii i i iv vv v p p g
t c t Dλ
αρ
+ +− −− −− −+ − + =
Δ Δ
forward characteristic
backward characteristic
1 11 11 11 sin( ) 02
j jj j j ji ii i i iv vv v p p g
t c t Dλ
αρ
+ ++ ++ +− −− − + =
Δ Δ
The pressure loss term is linearised by evaluating it at the old time j Equations can be solved for
1 1,j ji iv p+ +
The further equations are determined by the boundary conditions and the one characteristic which can be used at the respective boundary 30
Method of characteristics • Example: Reservoir with pipe which is closed instantaneously at t=0 • 2 further equations from boundary conditions
In the example: • 2 further equations from characteristic equations
In the example:
111 sin( ) 0
2
j jj j jN NN N Nv vv p p g
t c t Dλ
αρ
++− −+ − + =
Δ Δ
From forward characteristic for i=N+1
From backward characteristic for i=1
12 21 2 2 11 sin( ) 02
j jj j jB
v vv v p p gt c t D
λα
ρ
++− −− − + =
Δ Δ
1 11 10 ,j j
N Bv after closing of valve p reservoir pressure p+ ++ = =
31
Simplified case for basic Matlab-Program
a=0, friction neglected, equations nodes 2 to N
1 11 11 11 sin( ) 02
j jj j j ji ii i i iv vv v p p g
t c t Dλ
αρ
+ +− −− −− −+ − + =
Δ Δ
1 11 11 11 sin( ) 02
j jj j j ji ii i i iv vv v p p g
t c t Dλ
αρ
+ ++ ++ +− −− − + =
Δ Δ
forward characteristic
backward characteristic
= 0
= 0
Solution by subtracting resp. adding the two equations
)(5.0)(5.0
)(5.0)(5.0
11111
11111
ji
ji
ji
ji
ji
ji
ji
ji
ji
ji
ppvvcp
ppc
vvv
+−+−+
+−+−+
++−=
−++=
ρρ
32
Simplified case for basic Matlab-Program
2 equations from boundary conditions 1 11 10 ,j j
N Bv after closing of valve p reservoir pressure p+ ++ = =
2 equations from characteristics for i = 1 and i = N+1
111 sin( ) 0
2
j jj j jN NN N Nv vv p p g
t c t Dλ
αρ
++− −+ − + =
Δ Δ
From forward characteristic for i=N+1
From backward characteristic for i=1
12 21 2 2 11 sin( ) 02
j jj j jB
v vv v p p gt c t D
λα
ρ
++− −− − + =
Δ Δ
= 0
= 0
jN
jN
jN cvpp ρ+=++11
)(1 221
1j
Bjj pp
cvv −+=+
ρ33
Additions
• Formation of vapour bubble • Branching pipes • Closing functions • Pumps and pressure reduction valves • …. • Consistent initial conditions through steady
state computation of flow/pressure distribution
34
Example (1)
Tank 1 Tank 2
connecting pipe
valve
L=500 m D = 0.2 m, e = 0.01 m, roughness k = 0.0005 m r = 1000 kg/m3, Ew = 2000 MN/m2, Epiper = 210000 MN/m2
pressure downstream reservoir 80 mWS, pressure upstream reservoir 90 mWS closing time of valve1 s, Q before closing: 0.2 m3/s loss coefficient valve 2, time of calculation 60 s, number of pipe sections n = 10
Use Program „Hydraulic System“
35
Example (2)
Tank 1 Tank 2
Valve L=500 m
D = 0.2 m, e = 0.01 m, roughness k = 0.0005 m r = 1000 kg/m3, Ew = 2000 MN/m2, Epipe = 210000 MN/m2
pressure of both downstream reservoirs 80 mWS, pressure upstream reservoir 90 mWS closing time 1 s, Q before closing of valve: 0.2 m3/s loss coefficient of valve 2, computation time 60 s, number of pipe sections n = 10
Tank 3
L=500 m
36
Additions
• Formation of vapour bubble • Branching pipes • Different closing functions • Pumps and pressure reduction valves • …. • Consistent initial conditions through steady
state computation of flow/pressure distribution
37
Closing function • Expressed as Q=Q(t) or by degree of closure t, depending on
position of valve, t = f(t) • Valve closed: t = 0 • Valve completely open: t = 1 • In between: function corresponding to ratio of loss coefficients
t or Q (%)
time t 0
100
tclose 0
open closed
0
2
00 ξξ
⎟⎟⎠
⎞⎜⎜⎝
⎛=
ΔΔ
vv
pp
Index 0 refers to open valve
pp
vv
ΔΔ== 0
0
0
ξξτ
38
Valve as boundary condition • Valve directly in front of reservoir with pressure pB2 • Node N+1 • Linear closing function t = 1-t/tschliess • Determine new pressure and velocity at valve
1 11 11 0
1 2 2 20
22
j jN Nj
N B
v v p gp p withg v
ξ ξτ
+ ++ ++
+Δ= + =
( ) jN
jN
jN
jN
jN
jN vv
Dtcvvcpp
211
11
Δ−−−= ++
++
λρρ
From boundary condition
From forward characteristic
(1)
(2)
Inserting (1) into (2) yields quadratic equation for 11
++jNv
For t < tschliess:
39
Valve as boundary condition
⎟⎠⎞⎜
⎝⎛ Δ−−−
Δ−⎟⎟⎠
⎞⎜⎜⎝
⎛Δ
+Δ
−=++ tvv
Dpcvp
pv
pcv
pcvv j
NjN
jN
jNB
jN 222 2
0
20
22
0
20
2
0
20
211
λρτρτρτ
( ) jN
jN
jN
jN
jN
jN vv
Dtcvvcpp
211
11
Δ−−−= ++
++
λρρ
Only one of the two solutions is physically meaningful
For t > tschliess:
011 =
++jNv
40
Pump
( ) )4/(2
211
11 πλρρ Dvpvv
Dtcvvcpp j
NjN
jN
jN
jN
jN
jN ⋅Δ+Δ−−−= +
+++
Given characteristic function of pump:
)(Qfp =Δ
Pump at node i: Simply insert into characteristic equation. e.g. forward characteristic:
41
Formation of vapour bubble
( )jN
jN
jj vvtAVolVol 111
1 5.0 +++
+ +⋅Δ−=
If the pressure falls below the vapour pressure of the fluid a vapour bubble forms, which fixes the pressure at the vapour pressure of the fluid. The bubble grows as long as the pressure in the fluid does not rise. It collapses again when the pressure increases above the vapour pressure.
Additional equation: Forward characteristic in N:
1 10 : 0j jIf Vol Vol+ +< =
Volume balance of vapour bubble: volume Vol at valve
As long as the vapour bubble exists, the boundary condition v=0 at the valve must be replaced by the pressure boundary condition p = pvapour .
If Vol becomes 0 the vapour bubble has collapsed. The velocity in the volume equation is negative, as bubble grows as long as wave moves away from valve.
11
1 1( ) ( )j j jN N N vapourv v p p T
c cρ ρ++ = + −
42
Branching of pipe
i-1 i i+1
k k+1
Note that continuity requires that Ai-1vi-1=Akvk+Aivi
Characteristics along i -1 … k+1 and along i -1 … i+1
With different lengths of pipes the reflected waves return at different times. At the branching, partial reflection takes place. The pressure surge signal in a pipe grid therefore becomes much more complicated, but at the same time less extreme, as the interferences weaken the maximum.
43
Consistent initial conditions by steady state computation of flow/pressure
In the example:
Tank 1 Tank 2 connecting pipe
02
2
0
2
1 22 ivvPgv
gv
DLP ≡⇒=−− ξλ
In a grid with branchings a steady state computation of the whole grid is required
44
Measures against pressure surges
• Slowing down of closing process • Windkessel • Surge shaft • Special valves
air
45
Surge shaft oscillations Task: Write a program in Matlab for the calculation of the surge shaft oscillations
Simplified theory: see next page 46
Surge shaft oscillations • The following formulae can be used (approximation of rigid water
column) :
Solve for Z(t), Estimate the frequency under neglection of friction. Data: l = 200 m, d1 = 1.25 m, d2 = 4 m, Q = 2 m3/s at time t = 0 local losses negligible, l = 0.04, computation time from t = 0 to t = 120 s, instantaneous closing of valve at time t = 0.
1 2f
E E f
v vhdv Z lg gI with I and hldt l d gλ= − − = =
dtdZAvA 21 =
47
Surge shaft oscillations The surge in the following surge shaft is to be calculated using the
program Hydraulic System. Vary parameters and compare!
250 m ü. M.
Further data: Closing time 1 s, area surge shaft 95 m2, roughness pressure duct k=0.00161 m, modulus of elasticity pressure duct = 30 GN/m2, modulus of elasticity pressure duct = 30 GN/m2, Loss coefficient valve 2.1 (am ->av) and 2.0 (am<- av) resp., linear closing law, cross-section valve 1.5 m
w stands for wall thickness, in the pressure duct it is assumed as 2 m effectively.
48