Documente Academic
Documente Profesional
Documente Cultură
1.- Input
Input data of example 13.9 [1]
3a.- Flowsheet
Flow diagram of VB code
3b.- Code_VB
Visual Basic code
3c.- Output_VB_Head
Table with output of VB program
( graphic deleted)
3d.- Output_VB_Flow
Table with output of VB program
(graphic deleted)
29.05.2016
rev.28.03.2019
cteristics.
H Valve openings
I.- Celerity
Comments
References
Notes:
To see hidden sheets:
Right click on any label
Click on Unhide…
Select a sheet
click OK
To hide a sheet:
Right click on the sheet label
Click on hide
To go to VB environment:
On main menu, click on Developer
In Controls group, click on View Code
www.piping-tools.net
Water hammer. Method of characteristics. Example solved using Visual Basic and Finite Differences.xlsm
cjcruz[at]piping-tools.net
Basic water hammer program
Example 13.9 from [1]
Notes
- Do not insert neither rows nor columns before the input data
ranges (in yellow), since these cells are read from the VB code.
(Before means to the left, or above)
Original Streeter values - The number of sections "N" is a variable input valid only for the VB pr
of the CVA matrix The finite diferences calcualtion has a number of sections defined by th
CVoriginals number of columns used. Thus, to change the number of sections the ta
0.06 to be modified and columns needs to be added or deleted.
0.03
0.01 - To simulate an increased valve closing velocity, the initial opening
0.003 is mantained with the value
0.001 and the rest of the matrix elements are modified as
0.0005 CVA(I) = CVAoriginal(I) / Divider
m/s²
Example 13.9 [1], solved by finite differences
Input data
Reservoir water level elevation Hres = 100 m
Pipe length L= 4800 m
Pipe diameter d= 2 m
Pipe friction factor f= 0.022 -
Velocity of sound wave A= 1200 m/s
Number of sections N= 4 (Note 1)
Time interval of CVA values DCV = 5 s
Maximum elapsed time Tmax = 50 s
"CVA matrix"
CVA(1) = 0.06 m²
CVA(2) = 0.03 m²
CVA(3) = 0.01 m²
CVA(4) = 0.003 m²
CVA(5) = 0.001 m²
CVA(6) = 0.0005 m²
CVA(7) = 0.0002 m²
CVA(8) = 0 m²
CVA(9) = 0 m²
CVA(10) = 0 m²
CVA(11) = 0 m²
This _R value is valid only for the number of ∫ v⋅|v|⋅dx= Δx⋅|v A|⋅v A (C-9 )
A
segments "N" defined in the input of the finite When using the approximation
P
difference table.
∫ v⋅|v|⋅dx= Δx⋅|v A|⋅v P (C-10 )
A
Initial piezometric height at Node "I" (E-19) the flow rate equation becomes
H(I)0 = Hres - (I - 1) * _R * Q0 ^ 2 H P .1 −H 2 + B⋅Q2
Q P ,1 = (F-4 )b
B +R⋅|Q 2|
Equations (F-4) and (F-4)b have different expressions and when evaluated
Nevertheless, the use of one or the other expression does not have an im
√
Initial conditions (T = 0) Q0=
L
H res m3
s
( E−15)
In compact form
√
QP , NS =−g⋅CV 2⋅( B+R⋅|QN|) + ( g⋅( B+R⋅|QN|)⋅CV
1 2 3 4 5 6
Note 1
The here presented solution, (method of finite differences) requires that the
table must have a number of columns according to the selected number of
sections "N". For this reason, if the number of sections "N" has to be changed,
it would also be required a modification of the number of columns of the table.
Thus, although de number of sections is an input variable, it is not enough to
change only the value of "N". The table should also be modified
Return to Index
Help variables
Area of pipe section Valve opening
Ap = (Pi() / 4) * d ^ 2 The product of the valve opening Av and the d
Ap = 3.14159 m² Cd is CV = Cd * Av
The CV-values at the time interval DCV = 5 (s
B= A / (g * Ap) CVA-values and are given in the "CVA matrix
B= 38.950 s/m² The initial VCA-value, CVA(1) corresponds to
next CVA-value is CVA(2), and corresponds t
Index for the valve position other CV-values are given at time intervals of
NS = N+1 Annex H presents the method for the interpol
NS = 5 CV-values at time intervals of one second.
K value
Length of a section Integer value required for the determination o
DX = L/N K= Int(t / DCV) + 1
DX = 1200 m CV-value.
Linear interpolation for a time "t"
Time required for the wave to CV = Index(CVA,K,1) + ( t-(K-1)*DCV )*( Index(CVA,K+1,1)-Inde
travel through a section
DT = L / (A * N) Initial CV value: CV0
DT = 1.0 s Let CV0 = CV(1)
CV(1) = 0.06
CV0 = 0.06
C P =H N +B⋅Q N (G−5 )
w rate at the reservoir (F-4) B P =B+R⋅|Q N| (G−6 )
= (Hp,1 - H2 + B * Q2 - _R*Abs(Q2) * Q2) / B
CV =( C d⋅A v ) : product of area of valve opening
Flow rate at the reservoir, at the time "t" and discharge coefficient
CV =( C d⋅A v ) : product of area of valve opening
and discharge coefficient
Piezometric height at the reservoir,at the time "t"
is example, this height is a constant value, equal to H res Piezometric height at the valve
Piezometric height at section 2, at the previous time "t-Dt"
Flow ratet at section 2, at the previous time "t-Dt" H P,NS=( C P −B P⋅Q P , NS ) ( G −3)
equation is obtained when using the approximation Compact form of boundary conditions for the valve
√ L
H res m3
s
( E−15) Interior points
f⋅( )+
D 1 I = 2 to I = N
2⋅g⋅A 2p 2⋅g⋅CV 2 CP = HI-1 + B * QI-1
2
I )0 = H res - ( I-1 )⋅R⋅Q0 ( E-19) BP = B + R * Abs(QI-1)
CM = HI+1 - B * QI+1
BM = B + R * Abs(QI+1)
QP,I = (CP - CM) / (BP + BM)
HP,I = CP - BP * QP,I
,1= H res (at any time t ) (E-20 )
In reference [1],
=H N + B⋅QN (G−5 )
(D-1) -> [1], (13.6.11) a
=B+ R⋅|Q N| (G−6 ) (D-2) -> [1], (13.6.11) b
(D-3) -> [1], (13.6.13) ForC+
(D-4) -> [1], (13.6.12) a
NS)=−g⋅CV
2
√
⋅B P+ ( g⋅B P⋅CV 2 ) +2⋅g⋅CV 2⋅C P
2
(G-4 ) (D-5) -> [1], (13.6.12) b
NS=C P −B P⋅Q P, NS (G-3 ) (D-6) -> [1], (13.6.14) ForC-
(D-7) -> [1], (13.6.15) a (Note 5)
(D-8) -> [1], (13.6.15) b (Note 5)
NS =−g⋅CV
2
√ 2
⋅( B+R⋅|QN|) + ( g⋅( B+R⋅|QN|)⋅CV 2 ) +2⋅g⋅CV 2⋅( H N +B⋅QN )
(G-7 )
NS=( H N +B⋅Q N )− ( B+R⋅|Q N|)⋅Q P,NS (G−8 )
NS =−g⋅CV
2
√ 2
⋅( B+R⋅|QN|) + ( g⋅( B+R⋅|QN|)⋅CV 2 ) +2⋅g⋅CV 2⋅( H N +B⋅QN )
(G-7 )
NS= ( H N +B⋅Q N )− ( B+R⋅|QN|)⋅Q P,NS (G−8 )
Note (5). No equation number in [1]
7 8 9
m²
m²
Page 2 of 4
e boundary conditions
2
B P⋅CV 2 ) +CV 2⋅2⋅g⋅C P (G-4 )
valve opening
valve opening
( G−3)
3 of 4
(D-1)
(D-2)
(D-4)
(D-5)
(D-7)
(D-8)
Nodes
2 3 4 5
Hres = 100 m AR = (Pi() / 4) * D ^ 2
L= 4800 m AR = 3.14159
D= Water hammer.
2 Pressure
m vs time,
B= with ratio
A / (g * AR) x/L as parameter
180.00 f= 0.022 From- finite differences
B= table
38.950
A= 1200 m/s NS = N+1
N= 4 - N= 5
DCV = 5 s DX = L/N
Pressure [m.w.c.]
Tmax = 50 s DX = 1200
160.00
DT = L / (A * N)
CVA(1) = 0.06
Valve m² DT = 1
CVA(2) = 0.03 m² HP(1) = Hres
CVA(3) = 0.01 m² HP(1) = 100
140.00 CVA(4) = 0.003 m² CV = CVA(1)
CVA(5) = 0.001 m² CV = 0.06
CVA(6) = 0.0005 m² Q0 = / (f * L / (2 * g * D * AR ^ 2) + 1 / (2 * g * CV ^ 2))) 'Eq (A) .
Sqr(Hres
80.00 Reservoir
x/L = 0. Res ervoi r x/L = 0.25 x/L = 0.5 x/Lboundary
= 0.75 x/L = 1. Val ve
conditions
Eq.(3) & /4)
T K CV 1
60.00
0 0.00 1 0.06 H(I) 100
Q(I) 2.63
1 1.00 1 0.054 H(I) 100
Q(I) 2.63
2 2.00 1 0.048 H(I) 100
Q(I) 2.6320
3 3.00 1 0.042 H(I) 100
Q(I) 2.63199
4 4.00 1 0.036 H(I) 100
Q(I) 2.63199
5 5.00 2 0.030 H(I) 100
Q(I) 2.27875
6 6.00 2 0.026 H(I) 100
Q(I) 1.89528
7 7.00 2 0.022 H(I) 100
Q(I) 1.47969
8 8.00 2 0.018 H(I) 100
Q(I) 1.02816
9 9.00 2 0.014 H(I) 100
Q(I) 0.53759
10 10.00 3 0.010 H(I) 100
Q(I) 0.18690
11 11.00 3 0.009 H(I) 100
Q(I) -0.18515
12 12.00 3 0.007 H(I) 100
Q(I) -0.57837
13 13.00 3 0.006 H(I) 100
Q(I) -0.70434
14 14.00 3 0.004 H(I) 100
Q(I) -0.79173
15 15.00 4 0.003 H(I) 100
Q(I) -0.57299
16 16.00 4 0.003 H(I) 100
Q(I) -0.30987
17 17.00 4 0.002 H(I) 100
Q(I) 0.00273
18 18.00 4 0.002 H(I) 100
Q(I) 0.20241
19 19.00 4 0.001 H(I) 100
Q(I) 0.43386
20 20.00 5 0.001 H(I) 100
Q(I) 0.77394
21 21.00 5 0.001 H(I) 100
Q(I) 0.86395
22 22.00 5 0.001 H(I) 100
Q(I) 0.91837
23 23.00 5 0.001 H(I) 100
Q(I) 0.67847
24 24.00 5 0.001 H(I) 100
Q(I) 0.39086
25 25.00 6 0.001 H(I) 100
Q(I) 0.07628
26 26.00 6 0.000 H(I) 100
Q(I) -0.12862
27 27.00 6 0.000 H(I) 100
Q(I) -0.36574
28 28.00 6 0.000 H(I) 100
Q(I) -0.71056
29 29.00 6 0.000 H(I) 100
Q(I) -0.80966
30 30.00 7 0.000 H(I) 100
Q(I) -0.86941
31 31.00 7 0.000 H(I) 100
Q(I) -0.63850
32 32.00 7 0.000 H(I) 100
Q(I) -0.35933
33 33.00 7 0.000 H(I) 100
Q(I) -0.05279
34 34.00 7 0.000 H(I) 100
Q(I) 0.14541
35 35.00 8 0.000 H(I) 100
Q(I) 0.37768
36 36.00 8 0.000 H(I) 100
Q(I) 0.71691
37 37.00 8 0.000 H(I) 100
Q(I) 0.81249
38 38.00 8 0.000 H(I) 100
Q(I) 0.86878
39 39.00 8 0.000 H(I) 100
Q(I) 0.63634
40 40.00 9 0.000 H(I) 100
Q(I) 0.35818
Return to Index
/ 4) * D ^ 2 Initial conditions (T = 0)
For I = 1 To NS Water hammer. Flow rate vs time, w
tio x/L as parameterQ(I) = Q0 Eq.1) From finite differen
able Q(I) = Round(Q(I),
3.00
3)
H(I) = Hres - (I - 1) * _R * Q0 ^ 2 ... 'Eq. Eq. (2)
H(I) = Round(H(I), 3)
Next I 2.50
30 35 40 45 0.00
0 5 10 15 20 25
Eq.(n)
20 25 30 35 40 Time t [s] 45
39.0031
39.0092
39.0129
38.9966
38.9769
38.9555
38.9591
38.9752
38.9987
39.0055
39.0096
38.9938
38.9748
38.9539
38.9602
38.9760
38.9992
39.0057
39.0095
38.9937
29.05.2016
4100:
CV = CVA(K) + (T - (K - 1) * DCV) * (CVA(K + 1) - CVA(K)) / DCV
4200:
Boundary condition at the valve
nput" sheet CP = H(N) + B * Q(N)
BP = B + R * Abs(Q(N))
QP(NS) = -g * BP * CV ^ 2 + Sqr((g * BP * CV ^ 2) ^ 2 + 2 * g * CV
HP(NS) = CP - BP * QP(NS)
Eq. (13.6.8a) 4600:
Eq. (13.6.2) Boundary condition at the reservoi
HP(1) = Hres
QP(1) = (HP(1) - H(2) + B * Q(2)) / (B + R * Abs(Q(2)))
4800:
Interior sections
Eq. (E-20) For I = 2 To N
Eq. (E-15) CP = H(I - 1) + B * Q(I - 1)
BP = B + R * Abs(Q(I - 1))
Eq. (E-13) CM = H(I + 1) - B * Q(I + 1)
Eq. (E-21)= Eq. (E-16)a BM = B + R * Abs(Q(I + 1))
QP(I) = (CP - CM) / (BP + BM)
HP(I) = CP - BP * QP(I)
Next I
Eq (E-19) 5200:
Calculated values are reassigned
For I = 1 To NS
H(I) = HP(I)
Q(I) = QP(I)
Next I
Eq. (13.6.11a)
Eq. (13.6.11b)
Eq. (13.6.12a)
Eq. (13.6.12a)
Eq. 13.6.15)
Eq. (13.6.16)
3 4 5
Streeter code of examp
+ 1 / (2 * g * CV^2 ) ) ) (E-19) E(19) --> [1], sheet "4b.- Streeter code, line 2900
(E-15) E(15) --> [1], sheet "4b.- Streeter code, line 2700
F-4)b F(4)b --> [1], sheet "4b.- Streeter code, line 4700
29.05.2016
Page 2 of 9
Page 3 of 9
(13.6.8a)
(13.6.8b)
Page 4 of 9
Page 5 of 9
Page 6 of 9
Page 7 of 9
Page 8 of 9
Page 9 of 9
C. Method of characteristics
Theory
∂v 1 ∂ p f⋅v⋅|v|
L1= + +g⋅sin ( θ )+ =0 Eq. ( L1)
∂t ρ ∂ x 2⋅d
∂v 1 ∂ p f⋅v⋅|v|
L1= + +g⋅sin ( θ )+ =0 Eq. ( L1)
∂t ρ ∂ x 2⋅d
∂p ∂v
L2= +ρ⋅a2⋅ =0 Eq . (L 2)
∂t ∂x
L=L1+λ⋅L2 Eq.( L)
∂v 1 ∂ p f⋅v⋅|v|
L1= + +g⋅sin ( θ ) + =0 Eq. ( L1)
∂t ρ ∂ x 2⋅d
∂p ∂v
L2= + ρ⋅a2⋅ =0 Eq. (L2)
∂t ∂x
∂v 1 ∂ p f⋅v⋅|v| ∂ p ∂v
L= +
∂t ρ ∂ x
+g⋅sin ( θ )+
2⋅d (
+λ⋅ +ρ⋅a2⋅ =0
∂t )
∂x
∂v 1 ∂ p f⋅v⋅|v| ∂ p ∂v
+ +g⋅sin ( θ ) + +λ⋅ +λ⋅ρ⋅a2⋅ =0
∂t ρ ∂x 2⋅d ∂t ∂x
∂v 2 ∂v 1 ∂ p ∂ p f⋅v⋅|v|
⋅ρ⋅a ⋅λ+ + +λ⋅ +g⋅sin ( θ ) + =0
∂x ∂t ρ ∂x ∂t 2⋅d
∂v 2 ∂v 1 ∂p ∂p f⋅v⋅|v|
(∂x ∂t ) (
ρ⋅λ ∂ x ∂ t )
⋅ρ⋅a ⋅λ+ + λ⋅ ⋅ + + g⋅sin ( θ ) +
2⋅d
=0
(C-1)
The first term of equation
∂v 2 ∂v 1 ∂p ∂p f⋅v⋅|v|
(∂x ∂t ) (
⋅ρ⋅a ⋅λ+ + λ⋅ ⋅ + + g⋅sin ( θ ) +
ρ⋅λ ∂ x ∂ t 2⋅d
=0 )
(C-1)
dv dx
is the total derivative , if λ⋅ρ⋅a 2=
dt dt
dv
Evaluation of
dt
dv ∂ v dx ∂ v
= ⋅ +
dt ∂ x dt ∂t
so, if
dx
=λ⋅ρ⋅a2
dt
dv ∂ v ∂v
= ⋅λ⋅ρ⋅a2 + ( C-2)
dt ∂ x ∂t
Equations ( C-2 ) and ( C-3 ) are both correct, Replacing the total derivatives
dx ∂v ∂ v dv
if in both cases has the same value. ⋅ρ⋅a 2⋅λ+ =
dt
∂x ∂t dt
Thus, it must be accomplish that
dx
and
=λ⋅ρ⋅a2 (C-4 ) a 1 ∂ p ∂ p dp
dt ⋅ + =
and also ρ⋅λ ∂ x ∂ t dt
dx 1 in equation (C-1)
= (C-4 ) b
dt ρ⋅λ ∂v ∂v 1 ∂ p ∂p f⋅v
thus
2 1
( ∂x ) (
∂t )
L= ⋅ρ⋅a 2⋅λ+ + λ⋅ ⋅ + +g⋅sin ( θ ) +
ρ⋅λ ∂ x ∂ t 2⋅d
λ⋅ρ⋅a = ( C-4) one obtains
ρ⋅λ
dv dp f⋅v⋅|v|
and +λ⋅ +g⋅sin ( θ )+ =0
1 dt dt 2⋅d
λ2 =
= (C-4 ) b
dt ρ⋅λ ∂v ∂v 1 ∂ p ∂p f⋅v
thus
2 1
L= (
∂x ∂t ) ( )
⋅ρ⋅a 2⋅λ+ + λ⋅ ⋅ + +g⋅sin ( θ ) +
ρ⋅λ ∂ x ∂ t 2⋅d
λ⋅ρ⋅a = ( C-4) one obtains
ρ⋅λ
dv dp f⋅v⋅|v|
and +λ⋅ +g⋅sin ( θ )+ =0
1 dt dt 2⋅d
λ2 = 2 2 1
ρ ⋅a and with λ=± (C-5)
1 2 ρ⋅a
2
λ= ( )
ρ⋅a the equation for L becomes
Thus dv 1 dp f⋅v⋅|v|
L= ± ⋅ +g⋅sin ( θ ) + =0
1 dt ρ⋅a dt 2⋅d
λ=± (C-5)
ρ⋅a subject to the conditions of equation ( C-5)
(C-5) --> [1], (13,6,1)
Since the equation (C-6) is only valid when the equation (C-5) is satisfied,
it is convenient to represent the solution as a graph of "x" vs "t".
It is considered the case of a system with a pipe that runs from the origin
"O", upstream, down to the discharge point.
It is denoted by "x" a point somewhere along the pipe and "t" the time
in which the dependent variables "v" and "p" are determined.
Section AP
The graphic represents two points, "A" and "B" , along the pipe, separed
by a distance 2*Dx, valid for a time "t".
Consider that the conditions are known in the point "A" (vA, pA, xA and tA);
then the equation (C-6) , with a positive slope
dv 1 dp f⋅v⋅|v|
+ ⋅ +g⋅sin ( θ ) + =0 (C + )
dt ρ⋅a dt 2⋅d
is valid throughout the AP line or an extension of it.
This line, with the "+" sign, is called the equation "C + "
The slope of the curve AP is Δt 1
=
Δx a
where "a" is the speed of a sound wave in the pipe.
Section AP
The equation (C-6), for the case of the + sign (section AP), is
dv 1 dp f⋅v⋅|v|
+ ⋅ +g⋅sin ( θ )+ =0 Eq . C+
dt ρ⋅a dt 2⋅d
multiplying by ρ⋅a⋅dt
dv 1 dp f⋅v⋅|v|
⋅ρ⋅a⋅dt + ⋅ ⋅ρ⋅a⋅dt+g⋅sin ( θ )⋅ρ⋅a⋅dt+ ⋅ρ⋅a⋅dt=0
dt ρ⋅a dt 2⋅d
f⋅v⋅|v|
ρ⋅a⋅dv+dp+g⋅sin ( θ )⋅ρ⋅a⋅dt+¿ ρ⋅a⋅dt⋅ =0
2⋅d
and considering that
a⋅dt=dx
f⋅v⋅|v|
ρ⋅a⋅dv+dp+g⋅sin ( θ )⋅ρ⋅a⋅dt+¿ ρ⋅dx⋅ =0
2⋅d
integrating from point A to P
P P P P
f⋅v⋅|v|
∫ ρ⋅a⋅dv+ ∫ ∫dp+ g⋅sin ( θ )
⋅ ρ⋅dx+∫ 2⋅d =0 (C-8)
ρ⋅dx⋅
A A A A
+
Equation C section A to P
Replacing equation
pP− p A=ρ⋅g⋅( H P− H A )− ρ⋅g⋅Δx⋅sin ( θ )
(C-15)
into equation
ρ⋅Δx⋅f⋅|v A|⋅v A
ρ⋅a⋅( v P−v A ) + ( p P−p A ) +ρ⋅g⋅sin ( θ )⋅Δx+ =0 (C-8)
2⋅d
one obtains
ρ⋅a⋅( v P−v A ) + ( ρ⋅g⋅( H P−H A ) −ρ⋅g⋅Δx⋅sin ( θ ) )+
ρ⋅Δx⋅f⋅|v A|⋅v A
A A
ρ⋅a⋅( v P−v A ) + ( p P−p A ) +ρ⋅g⋅sin ( θ )⋅Δx+ =0 (C-8)
2⋅d
one obtains
ρ⋅a⋅( v P−v A ) + ( ρ⋅g⋅( H P−H A ) −ρ⋅g⋅Δx⋅sin ( θ ) )+
ρ⋅Δx⋅f⋅|v A|⋅v A
+ρ⋅g⋅sin ( θ )⋅Δx+ =0
2⋅d
ρ⋅Δx⋅f⋅|v A|⋅v A
ρ⋅a⋅( v P−v A ) +ρ⋅g⋅( H P− H A ) + =0
2⋅d
The L1 and L2 equations have two unknowns: "v" and "p". These equations can be "
combined using an unknown multiplier l , as follows
L=L1+ λ⋅L 2 Eq .( L)
It will be shown that any two different real values of l generate two equations
in "v" and "p" containing all the physics of the original equations L1 and L2 and
also can replace any solution.
Similarly, the second term of equation (C-1)
∂v 2 ∂v 1 ∂p ∂ p f⋅v⋅|v|
(∂x ∂t ) (
⋅ρ⋅a ⋅λ+ + λ⋅ ⋅ + + g⋅sin ( θ ) +
ρ⋅λ ∂ x ∂ t ) 2⋅d
=0
(C-1)
dp 1 dx
is the total derivative , if =
dt ρ⋅λ dt
dp
Evaluation of
dt
dp ∂ p dx ∂ p
= ⋅ +
dt ∂ x dt ∂t
if
dx 1
=
dt ρ⋅λ
dp ∂ p 1 ∂p
= ⋅ + (C-3)
dt ∂ x ρ⋅λ ∂ t
s
(C-5)
( )
ρ⋅ ±
ρ⋅a
dx
f⋅v⋅|v| =±a (C-7)
+ =0 (C-6) dt
2⋅d
equation ( C-5)
(e) --> [1], (13,6,1)
(C-6) --> [1], (13,6,3) (C-7) --> [1], (13,6,2)
=0 (C-8)
(C-9 )
v A|⋅v A
=0 (C-11) --> [1], (13,6,4)
(C-11)
tant along the tube .
tion BP
on of equation
0 (C-12)
o point B
(C-13) --> [1], (13,6,5)
⋅v B
=0
(C-13)
nt along the tube.
dividing by ρ⋅g
ρ⋅a ρ⋅g ρ⋅Δx⋅f⋅|v A|⋅v P
⋅( v P−v A) + ⋅( H P−H A ) + =0
ρ⋅g ρ⋅g ρ⋅g⋅2⋅d
a Δx⋅f⋅|v A|⋅v P
⋅( v P−v A ) +( H P−H A ) + =0
g g⋅2⋅d
a Δx⋅f⋅|v A|⋅v A
H P=H A− ⋅(v P−v A ) −
g 2⋅g⋅d
and with
Qp QA Qp QA
v P= and v A= , v P−v A = -
Ap Ap Ap Ap
1
v P−v A = ⋅( Q p - Q A)
Ap
a Δx⋅f⋅|Q A|⋅Q A
and with
Q Q Q Q
v P= p and v A= A , v P−v A = p - A
Ap Ap Ap Ap
1
v P−v A = ⋅( Q p - Q A)
Ap
a Δx⋅f⋅|Q A|⋅Q A
H P=H A− ⋅( Q p - Q A )− (C-16) (C-16) --> [1], (13,6,7)
g⋅A p 2⋅g⋅d⋅A 2p
+ for the use of the aproxim
Equation C from A to P
with (C-9)
+ (C-18)b ([1]_13.6.9)
A −B⋅ Q p -
( Q A ) -R⋅|Q A|⋅QP (for C ) (C-18) b
− (C-19)b ([1]_13.6.10)
B +B⋅ Q p -
( Q B ) +R⋅|Q B|⋅Q P ( for C ) (C-19 )b
Rev. cjc. 23.10.2015
1 of 15
2 of 15
5 of 15
wo real, different
, that transformed
two ODE subject to
v⋅|v|
=0 (C-6)
d
d
6 of 15
he slope is
1
−
Δx
Δt
C-7)
egment BP is
7 of 15
8 of 15
9 of 15
10 of 15
11 of 15
12 of 15
13 of 15
θ)
ng
⋅g⋅( H P− H A )− ρ⋅g⋅Δx⋅sin ( θ )
(C-15)
14 of 15
(C-16) --> [1], (13,6,7)
for the use of the aproximation
with (C-9)
15 of 15
In reference [1],
(C-4) -> [1], (13.6.1)
(C-4)a -> [1], (13.6.1)
(C-4)b -> [1], (13.6.1)
(C-6) -> [1], (13.6.3)
(C-7) -> [1], (13.6.2)
D. Interior points
Equations (D-7) and (D-8) allow the determination of the flow rate "Q" and
of the piezometric height "H" of an interior point "P" at a position "I",
and at a time "t", if the information of the previous time is known
Interior points
where
ometric height of an interior point C P=H I-1+B⋅Q I −1 ( D−1)
B P=B+R⋅|Q I−1| ( D−2)
e piezometric height at a point P at C M =H I +1 −B⋅QI +1 ( D−4)
on I and at a time t B M =B+R⋅|Q I +1| ( D−5)
C P−B P⋅Q P , I ( D−8 ) and the values of the flow rates
QI −1 and Q I +1 and of the
piezometric heights HI-1 and
H I +1 at the previous time are known .
P
t+Dt
C+ C-
t Dx Dx
A B
x
I-1 I I+1
Figure 1. x - t graphic
From Annex D
ming
-1 +B⋅Q I −1 ( D−1 )
+R⋅|Q I−1| ( D−2 )
n ( AP) becomes ( for C + )
+
P −B ⋅Q
P P,I for C ( D−3 )
ly for ( BP)
I +1 −B⋅Q I +1 ( D−4 )
+R⋅|Q I +1| ( D−5 )
n ( BP) becomes ( for C− )
−
M +B ⋅Q
M P,I for C ( D−6 )
eight at an interior point Knowing the data of the previous point (I-1)
and of the posterior point ( I +1), the values of
n be found from equation C P , B P , CM and BM can be calculated.
eight at an interior point Knowing the data of the previous point (I-1)
and of the posterior point ( I +1), the values of
n be found from equation C P , B P , CM and BM can be calculated.
⋅QP , I ( D−6)
The solution of the equations (D-3 ) and (D-6) are
M
(D-7 ) C P −C M
QP,I= ( D−7 )
B P +B M
H P , I =C P−B P⋅Q P , I ( D−8 )
This procedure can be used in the calcualtion of all
interior sections.
In reference [1],
(D-1) -> [1], (13.6.11) a
(D-2) -> [1], (13.6.11) b
(D-3) -> [1], (13.6.13) ForC+
(D-4) -> [1], (13.6.12) a
(D-5) -> [1], (13.6.12) b
(D-6) -> [1], (13.6.14) ForC-
(D-7) -> [1], (13.6.15) a no equation number in [1]
(D-8) -> [1], (13.6.15) b no equation number in [1]
D−1)
−2)
D−4)
−5)
ates
nd
re known .
2 of 5
3 of 5
4 of 5
5 of 5
E. Initial conditions
f⋅Δx
R= (C-17b)
2⋅g⋅D⋅A 2p
(
L
2⋅g⋅D⋅A p 2 0
(
L
2⋅g⋅D⋅A p 2 0
E.2. Initial piezometric height at the valve inlet E.3. Initial flow rate
The initial flow rate ( time t = 0 ) is
Initial piezometric height at the valve
√
Q20 H res m3
H v_0 = ( E-13 ) Q0 = (
2⋅g⋅CV 02 L s
f⋅( ) +1
D
2⋅g⋅A 2p 2⋅g⋅CV 02
√
equation (E-5 ), H res m
3
Q0= (
Q20 Q20
=f⋅ ( )(
L
⋅ 2
+
)
D 2⋅g⋅A p 2⋅g⋅CV 02
f⋅
L
( ) +1
D
s
2 2
2⋅g⋅A p 2⋅g⋅CV 0
( )
L
2
=Q0⋅
( ) +1
f⋅
D The initial flow rate ( time t = 0 ) is
2⋅g⋅A2p 2⋅g⋅CV 02
√
H res m
3
Q0 = ( E−15)
H res f⋅
L
( ) +1 s
D
L
f⋅ ( ) +1
D
2⋅g⋅A 2p 2⋅g⋅CV 02
2⋅g⋅A 2p 2⋅g⋅CV 02
( time t = 0 ) is
m3
( E−15)
s
⋅CV 02
valve opening
e initial time t0
2 of 7
ht at the valve
c pressure velocity at
he valve
c pressure velocity at
he valve
(E-5 )
e valve
(mwc) ( E-6 )
(mwc) ( E-7 )
3 of 7
Replacing equation
Q0
v v_0= ( E-12 )
CV 0
into equation
v 2v_0
Hv_0 = ( E-9 )
2⋅g
one gets
into equation
v 2v_0
Hv_0 = ( E-9 )
2⋅g
one gets
2
Q0
H v_0 = ( E-13 )
2⋅g⋅CV 02
4 of 7
Nomenclature
= 0 ) is H res : Reservoir height
ΔHfr =Pipe friction loss
ΔHv =Valve pressure loss
3 H kin_v =Kinematic pressure at valve
m
( E−15) H kin_p =Kinematic pressure in pipe
s H res =ΔHfr + ΔH v
Q0 : initial flow rate ( m3 / s )
A p : pipe secction area ( m² )
ΔH: pressure loss (mwc)
f: Darcy-Weisbach friction coefficient
L: pipe length (m)
d: pipe inside diameter (m)
V v : initial velocity at the valve (m/s)
0
5 of 7
⋅ΔHseg_0
f⋅Δx
etric height at R=
2⋅g⋅D⋅A 2p
(C-17b)
⋅R⋅Q20 ( E-19)
⋅R⋅Q20 ( E-19)
6 of 7
e
(E-20 )
7 of 7
F. Reservoir boundary conditionsl conditions
From Annex C
for a section C− the applicable equation is
H P=H B+B⋅( Q p - Q B ) +R⋅|Q B|⋅Q B ( for C− ) (C-19)
H P=H B+B⋅Q p - B⋅QB +R⋅|QB|⋅Q B
H P=H B+R⋅|Q B|⋅QB - B⋅Q B+B⋅Q p
For a point P located at a node I ,
point B will be located in node I +1 .
H P ,I =H I +1 +R⋅|QI +1|⋅Q I +1 - B⋅Q I +1 +B⋅Qp,I ( F-1)
__________ CM __________
with
point B will be located in node I +1 .
H P ,I =H I +1 +R⋅|QI +1|⋅Q I +1 - B⋅Q I +1 +B⋅Qp,I ( F-1)
__________ CM __________
with
C M =H I +1 +R⋅|QI +1|⋅QI +1 - B⋅QI +1 (F-2)
then
H P ,I =C M +B⋅Q P ,I (for C−) ( F-3)
C-
For a point P located
point B will be locate
I=2
Dx x
H P, I =H I +1 +R⋅|Q I +1|⋅
1 B __________ CM
Figure F-1. Upstream end with
C M =H I +1 +R⋅|Q I +1|⋅Q
then
H P, I =C M +B⋅QP , I
Return to Index
Reservoir
i=1
Replacing equation
C M =H I +1 +R⋅|QI +1|⋅QI +1 - B⋅QI +1 (F-2)
C-19) into equation for C−
H P , I =C M +B⋅Q P ,I (for C− ) (F-3)
one obtains
H P , I =H I +1 +R⋅|QI +1|⋅Q I +1 - B⋅Q I +1 +B⋅Q P,I
At the boundary, I = 1 .
H P , 1= H 1+1 +R⋅|Q 1+1|⋅Q1+1 - B⋅Q1+1 +B⋅QP ,1
F-1) H P , 1= H 2 +R⋅|Q2|⋅Q2 - B⋅Q2 +B⋅Q P ,1
and
B⋅Q P,1 =H P, 1 - H 2 + B⋅Q2 −R⋅|Q2|⋅Q2
H P , 1= H 1+1 +R⋅|Q 1+1|⋅Q1+1 - B⋅Q1+1 +B⋅QP ,1
F-1) H P , 1= H 2 +R⋅|Q2|⋅Q2 - B⋅Q2 +B⋅Q P ,1
and
B⋅Q P,1 =H P, 1 - H 2 + B⋅Q2 −R⋅|Q2|⋅Q2
(F-2) Thus, the equation for the flow rate at the
reservoir boundary is
H P ,1 - H 2 + B⋅Q2−R⋅|Q2|⋅Q2
( F-3) QP ,1= ( F-4)
B
At the boundary, I = 1 .
=H B +B⋅( Q p - Q B ) +R⋅|QB|⋅Q P (for C−) (C-19)b H P, 1 =H 1+1 +R⋅|Q1+1|⋅Q P ,1 - B⋅Q1+1 +B⋅Q P ,1
=H B +B⋅Q p - B⋅Q B+R⋅|Q B|⋅QP H P, 1 =H 2 +R⋅|Q2|⋅Q P ,1 - B⋅Q2 +B⋅QP ,1
=H B +R⋅|QB|⋅Q P - B⋅QB +B⋅Q p H P, 1 −H 2 + B⋅Q 2=R⋅|Q 2|⋅Q P ,1 +B⋅Q P, 1
R⋅|Q 2|⋅Q P, 1 +B⋅Q P ,1 =H P ,1 −H 2 + B⋅Q2
a point P located at a node I (index P,I), Q P, 1⋅( R⋅|Q2|+B ) =H P ,1 −H 2 + B⋅Q 2
nt B will be located in node I + 1 .
Thus, the equation for the flow rate at the
I =H I +1 +R⋅|Q I +1|⋅Q P , I - B⋅Q I +1 +B⋅Q P,I (F-1)b reservoir boundary is
__________ CM __________ H P. 1 −H 2 + B⋅Q2
Q P , 1=
h B+R⋅|Q2|
=H I +1 +R⋅|Q I +1|⋅Q P, I - B⋅Q I +1 (F-2)b where the approximation of equation
P
n ∫ v⋅|v| dx=Δx⋅|v A|⋅v P
I =C M +B⋅Q P , I (for C− ) (F-3)b A
was use
Rev. cjc. 23.10.2015
1 of 5
ht at the reservoir
time t ) ( E-20)
2 of 5
i=1 i=2
3 of 5
-2)
F-3)
1
1
( F-4)
4 of 5
he piezometric
will have the
Hres . Thus
( E-20)
oint and the
=1
5 of 5
n
+1|⋅Q P, I - B⋅Q I +1 (F-2)b
−
C
I (for C− ) (F-3)b
I = 1.
1+1|⋅Q P ,1 - B⋅Q 1+1 +B⋅Q P ,1
⋅Q P ,1 - B⋅Q2 +B⋅Q P ,1
=R⋅|Q 2|⋅Q P ,1 +B⋅Q P, 1
P ,1 =H P ,1 −H 2 + B⋅Q 2
H P ,1 −H 2 + B⋅Q2
mation of equation
A|⋅v P (C-10)
G. Valve boundary conditions
√ 2
QP ( NS)=−g⋅CV 2⋅B P + ( g⋅B P⋅CV 2 ) +CV 2⋅2⋅g⋅C P ( G-4 )
C P =H N + B⋅QN ( G−5 )
B P =B+ R⋅|Q N| (G−6 )
Replacing equation
HP,NS=( C P−B P⋅Q P , NS ) (G−3 )
into equation
Q2P , NS =CV 2⋅2⋅g⋅H P , NS (G−2)
one has
Q2P , NS =CV 2⋅2⋅g⋅( C P−B P⋅QP , NS )
Q2P , NS =CV 2⋅2⋅g⋅C P−CV 2⋅2⋅g⋅B P⋅Q P, NS
Q2P , NS =CV 2⋅2⋅g⋅C P−2⋅g⋅CV 2⋅B P⋅Q P, NS
Q2P , NS +2⋅g⋅CV 2⋅B P⋅Q P, NS −CV 2⋅2⋅g⋅C P=0
_______b________ _____c______
QP , NS =CV ⋅2⋅g⋅C P−CV ⋅2⋅g⋅B P⋅Q P, NS
Q2P , NS =CV 2⋅2⋅g⋅C P−2⋅g⋅CV 2⋅B P⋅Q P, NS
Q2P , NS +2⋅g⋅CV 2⋅B P⋅Q P, NS −CV 2⋅2⋅g⋅C P=0
_______b________ _____c______
thus, with
b=2⋅g⋅CV 2⋅B P
and
c=−CV 2⋅2⋅g⋅C P
one has
Q2P , NS +b⋅Q P, NS +c=0
√ 2
QP ( NS)=−g⋅CV 2⋅( B+R⋅|Q N|) + ( g⋅( B+R⋅|Q N|)⋅CV 2 ) +2⋅g⋅CV 2⋅( H N +B⋅Q N )
(G
H P,NS=( H N +B⋅Q N )− ( B+R⋅|QN|)⋅Q P, NS (G−8 )
2
√
QP ( NS)=−g⋅CV ⋅( B P) + ( g⋅( BP )⋅CV 2 2
) +2⋅g⋅CV 2⋅( C P ) (G-7 )a
√
1 2
x=−g⋅CV 2⋅B P+ ⋅( 2⋅g⋅CV 2⋅B P) −(−CV 2⋅2⋅g⋅C P)
4
(G−3)
√ 2 2
+ ( g⋅( B+R⋅|QN|)⋅CV ) +2⋅g⋅CV 2⋅( H N +B⋅QN ) (
2
⋅( H N +B⋅Q N )
(G-7 )
P ) (G-7 )a
(G−8)a
2 of 6
3 of 6
4of 6
g⋅C P)
CP (G-4 )
CP (G-4 )
(G-3)
5 of 6
6 of 6
⋅( H N +B⋅QN ) (G-7 )
Q P, NS (G−8)
This annex does not correspond to the theory of the method of characteristics and only de
acteristics and only develops the relationship between time and the opening of the valve in the example 13.9 Streete
]
43 43.00 9 0.000000
44 44.00 9 0.000000 0.07
45 45.00 10 0.000000
46 46.00 10 0.000000 0.06
47 47.00 10 0.000000
2) 48 48.00 10 0.000000 0.05
49 49.00 10 0.000000
50 50.00 11 - 0.04
ix is the 0.03
0.02
s CVA(1)
0.01
0
he times t = 0 0.00 10.00
Rev. cjc. 23.10.2015
1 of 1
n the example 13.9 Streeter [1].
Application
DCV = 5
T= 1
K= Int(T/DCV) + 1
K= 1
T - (K-1) =
T= 1
K= 1
T - (K-1) = 1
CV = 0.054
DCV = 5
Elapsed Calculation CV =
time of parameter Cd*A
Row valve closure for CV (Interpolation)
number T Eq. (H-1) Eq. (H-2)
[s] K CV
0 0.00 1 0.06
1 1.00 1 0.054
2 2.00 1 0.048
3 3.00 1 0.042
4 4.00 1 0.036
5 5.00 2 0.03
cv
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0.00 10.00 20.00 30.00 40.00 50.00 60.00
6.- Celerity Operating pressure
Water hammer. Joukovsky / Michaud
From sheet "2.- F. D. Table"
Celerity, critical time, and pressures Hres = 100
developed in a "sudden" and a "not L= 4800
sudden shutoff". D= 2
f= 0.022
1.- Input data a= 1200
N= 4
Operating flowrate DCV = 5
From sheet "2.- F. D. Table", Initial flow rate Q 0 Tmax = 50
Q = Q0 = 2.6 m /s 3
Pop = Hres / g
Pop = 10.2
Pipe data
Material: Carbon Steel
dn = 78 in
sch = STD -
L= 4800 m
Steel pipe elasticity module
Et = 2,060,000 bar
Bulk modulus and density of water
K= 21,133 bar
r= 1,000 kg/m³
The resulting water hammer pressure for a closing time less then the crtitical time is
ptot_SS = 198.6 m.w.c.
To obtain a sudden closure in the routine, set in "sheet 1.- Input", the Divider-value to a high value.
For example, set Divider = 100
For this setting, the graphic form sheet 2b.- Graphic F-D. will show a maximum pressure a little
over 200 m.w.c.
From the valve opening graphic, for the setting Divider = 100, it is clear that the valve is practically
fully closed after 6 seconds.
Thus, we have a case of a sudden closure.
dn Schedule /Thickness
in For
1/ 2 5 t=
3/ 4 10
1 20 Bulk modulus "K" of water [bar], a
1 1/ 2 30 Temperature ºC
2 40 0
3 60 20202
4 80 Schedules http://www.mhhe.com/engcs/civil/f
5 100
6 120
8 140
10 160
12 STD
14 XS
16 XXS
18 6.35
20 7.14
22 7.92
24 8.74
26 9.53
28 10.31
30 11.13
32 11.91 Thicknesses
34 12.7
36 14.27
38 15.88
40 16.66
42 17.48
44 19.05
46 22.23
48 25.4
54
60
66
72
78
84
90
96
102
108
120
144
Return to Index
Pipe dimensions
di = c
m Pipe_Imp_CS_Dint_dn_sch a
m di = #VALUE! mm K d
m Streeter uses a diameter of 2000 mm
1
E t s
- To mantain the input data unchanged, let
m/s di = 2000 mm a : celerity (wave velocity) (m/s)
- s= Pipe_Imp_CS_Thickness_dn_sch c: speed of sound (m/s)
s s= #VALUE! mm d: inside pipe diameter (mm)
s s: minimum wall thickness (mm)
Pipe section area K: water bulk modulus (bar)
bar A= (pi()/4)*d^2 a=
d= 2.0 m c=
A= 3.1416 m2 K=
Et =
Fluid velocity d=
v= Q/A s=
Q= 2.63 m3/s a=
A= 3.1416 m2 The value of the celerity used by Streeter exa
v= 0.84 m/s a=
instead of the here calculated value.
Speed of sound in water To mantain Streeter imput data unchanged, t
c (K / r )^0.5 value used for the celerity wil be
K= 2.1E+09 Pa a=
r= 1000 kg/m³
c= 1453.7 m/s
2⋅L⋅Δv
hNSS =
Opened area [cm²]
g⋅Δτ
ue to a high value. Δv 2⋅L Open area as function
⋅ 700
g⋅¿ Δτ
essure a little a⋅Δv 2⋅L 600
⋅
g⋅¿ a⋅Δτ 500
a⋅Δv 400
h NSS=¿hNSS =¿ =h SS
g 300
2⋅L 200
h NSS=h SS⋅
a⋅Δτ 100
g⋅¿ Δτ
Open
a⋅Δv 2⋅L 600
⋅
g⋅¿ a⋅Δτ 500
a⋅Δv 400
alve is practically h NSS=¿hNSS =¿ =h SS
g 300
2⋅L 200
h NSS=h SS⋅
a⋅Δτ 100
2⋅L 1
h NSS=h SS⋅ ⋅ 0
0 1 2 3 4
a Δτ Elapsed time
with
2⋅L
τc=
a
1
h NSS=h SS⋅τ c⋅
Δτ
τc
h NSS=h SS⋅
Δτ
10 ªC
c
K d
1
E t s
elerity (wave velocity) (m/s)
eed of sound (m/s)
ide pipe diameter (mm)
nimum wall thickness (mm)
ater bulk modulus (bar)
c / (1 + (K/Et) * (d/s) )^(0.5)
1453.7 m/s
2.1E+09 Pa
2.1E+11 Pa
2000 mm
#VALUE! mm
#VALUE! m/s
value of the celerity used by Streeter example is
1200 m/s
ad of the here calculated value.
antain Streeter imput data unchanged, the
used for the celerity wil be
1200 m/s
2 of 3
essure developed due to valve
off in the time interval Dt > tc
pop + hNSS
0.0 bar
2.7 bar
2.7 bar
26.3 m.w.c.
3 of 3
1. A tank supplying water by gravity through a pipe, with a valve at its lower end.
Required is the water hammer due to slow or fast closing of the valve.
The first case corresponds to the case discussed in this document, except that
it was not considered a pipe slope.
The problem has been solved in this way in order to be able to make a
comparison with the Streeter solution.
It needs an explanation, the fact thus the frequency of the resulting wave is not constant.
Is this a contradiction?
It could be that is only a result of the mathematical application.
Also, the result when applying a dividers greater than 100 has to be analyzed.
Return to Index
Hres = 100 m
Figure 13.23_a
[1] Mecanica de Fluidos
Victor L.Streeter y E. Benjamin
Mc Graw Hill,
Octava edicion, (3era en español)
1988
[2] Fluid%20Transients%20,Wylie,Streeter.pdf
https://html1-f.scribdassets.com/4sri9g76v45ikt2c/images/3-40e82ba1e0.jpg
[4] www.piping-tools.net
Water hammer. Method of characteristics. Equations, Boundary conditions and Initial condit
Water hammer. Method of characteristics. Example solved using Visual Basic and Finite Dif
cjcruz@piping-tools.net
Carlos J. Cruz
Return to Index
e82ba1e0.jpg