Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 142

Loop solution using Newton Raphson method

Modification of example from ref [1]

Loop with four pipes.


First step: calculation make use of assumed values

Input data
f L D
Pipe Nº (assumed) m mm
1 0.02 300 150
2 0.02 200 150
3 0.02 300 300
4 0.02 200 300

Qin = 0.6 m3/s


Qout = 0.6 m3/s

Yellow cells: data


Magenta cells: assumptions
Orange cells:. results

Start of calculations 8⋅f⋅L


K=
g⋅π 2⋅d 5
1.- Determination of K-values
f L D K
Pipe Nº Assumed) m m s2/m5
1 0.02 300 0.15 6531
2 0.02 200 0.15 4354
3 0.02 300 0.3 204
4 0.02 200 0.3 136

6.- Derivatives of equations F1 to F4

DF1/DQ1 = 1 = 1 DF1/DQ2 = 0
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1
DF4/DQ1 = 2*K1*Q1 = 13061.54 Q1 DF4/DQ2 = 2*K2*Q2

7.- Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4

8.- Substitute the derivatives

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 13061.54 Q1 8707.6959808

9.- Calculate values of F1 to F4 using actual flows


F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

F1 = 0.00
F2 = 0.00
F3 = 0.00
F4 = 2717.754

10.- Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 6530.77199 4353.8479904

11.- Solve the matrix to obtain the flow corrections


4x4
DQ1 0.00248 -0.40124 0.00373
DQ2 = - 0.00248 0.59876 0.00373
DQ3 -0.00248 -0.59876 0.99627
DQ4 0.99752 0.40124 -0.00373

4x1
DQ1 0.248137
DQ2 = - 0.248137
DQ3 -0.248137
DQ4 -0.248137

Let the maximum acceptable correctio


DQ1 -0.248137 DQmax = |
DQ2 = -0.248137 Since not all values are less or equal D
DQ3 0.248137 Iterration is required
DQ4 0.248137

12.- Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = 0.5 +
Q2 = Q2 + DQ2 Q2 = 0.5 +
Q3 = Q3 + DQ3 Q3 = 0.1 +
Q4 = Q4 + DQ4 Q4 = 0.1 +

The process is repeated with the new flow rates, until all correction values have a value near zer
Iteration Nº 0

Qin 1 Q1 2
L1
1 d1
K1
Q4 L4 L2
d d2 2
4 K4 Loop 1 K2
4 Q2
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

Qin 1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

2.- Initial flow rate assumptions K


s2/m5 Qin
Q1 = 0.5 m /s
3
K1 = 6531
Qin

Q2 = 0.5 m3/s K2 = 4354

Q3 = 0.1 m3/s K3 >= 204

Q4 = 0.1 m /s
3
K4 = 136

3.- Assign loop positive direction


as clockweise (Figure 3)

4.- Nodal discharge functions

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2 (could have been: Q1 - Q2)
F3 = Q2 + Q3 - Qout

5.- Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

= 0 DF1/DQ3 = 0 = 0 DF1/DQ4 =
= 1 DF2/DQ3 = 0 = 0 DF2/DQ4 =
= 1 DF3/DQ3 = 1 = 1 DF3/DQ4 =
= 8707.696 Q2 DF4/DQ3 = -2*K3*Q3 = -408.1732 Q3 DF4/DQ4 =

(-1) F1
* F2
F3
F4

0 1 (-1) F1
0 0 * F2
1 0 F3
Q2 -408.1732 Q3 -272.1155 Q4 F4

K
s2/m5
Q1 = 0.5 K1 = 6531
Q2 = 0.5 K2 = 4354
Q3 = 0.1 K3 >= 204
Q4 = 0.1 K4 = 136
Qin = 0.6
Qout = 0.6

0 1 (-1) 0
0 0 * 0
1 0 0
-40.81732 -27.21155 2717.75355

13.- Friction factor


4x1
0.00009 0 Let a water kinematic viscosity of
0.00009 * 0 n= 1.30E-06
-0.00009 0
-0.00009 2717.7536 Reynolds number
Re = v*d/n

Q
Pipe Nº m3/s
1 0.252
the maximum acceptable correction-value be 2 0.252
| 0.001| 3 0.348
e not all values are less or equal DQmax 4 0.348
ation is required
Let a maximum acceptable flow velocity vM
At least one velocity-value is greater then the
Diameter change is required inext iteration

14.- Data to be used as input in the next itera


-0.248137 Q1 = 0.252 m /s
3

-0.248137 Q2 = 0.252 m3/s


0.248137 Q3 = 0.348 m3/s
0.248137 Q4 = 0.348 m3/s Pipe Nº
1
2
3
ection values have a value near zero 4
rec.cjc.27.10.2018
1

g= 9.80665

For applications with more than 1 loop, cases where


two loops have a common pipe, see
www.piping-tools.net
Pipes. Network analysis using the Hardy Cross method _SI units

Qin 1 Q1 2

1
Qin

Q4
Loop 1
4 2
Q2

3 Qout
Q3
4 3

Figure 3

1 = 1
0 = 0
0 = 0
-2*K4*Q4 = -272.1155 Q4

3
4
Let an absolute rugosty for all pipes
Rabs = 0.01 mm
kinematic viscosity of Rabs = 0.00001 mm
m²/s
Relative rugosity
Rrel = Rabs / d

Friction factor (VBA function)


f= Pipe_Friction_Factor_Rrel_Re

d A v Re Rrel f
m m² m/s - - -
0.15 0.017671 14.3 1.6E+06 6.67E-05 #VALUE!
0.15 0.017671 14.3 1.6E+06 6.67E-05 #VALUE!
0.3 0.070686 4.9 1.1E+06 3.33E-05 #VALUE!
0.3 0.070686 4.9 1.1E+06 3.3333E-05 #VALUE!
um acceptable flow velocity vMax = 3 m/s
velocity-value is greater then the maximum value
hange is required inext iteration

be used as input in the next iteration

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
- m m s²m5 m3/s
#VALUE! 300 0.15 6531 0.252
#VALUE! 200 0.15 4354 0.252
#VALUE! 300 0.30 204 0.348
#VALUE! 200 0.30 136 0.348
Loop solution using Newton Raphson method

Data results from Iteration Nº 0 (diameters changed)

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
Pipe Nº - m m s²m5 m3/s
1 #VALUE! 300.0 0.400 6531 0.2519
2 #VALUE! 200.0 0.400 4354 0.2519
3 #VALUE! 300.0 0.500 204 0.3481
4 #VALUE! 200.0 0.500 136 0.3481

Qin = 0.6 m3/s


Qout = 0.6 m3/s

Data results from Iteration Nº 0 (without any change)

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
Pipe Nº - m m s²m5 m3/s
1 #VALUE! 300.0 0.150 6531 0.252
2 #VALUE! 200.0 0.150 4354 0.252
3 #VALUE! 300.0 0.300 204 0.348
4 #VALUE! 200.0 0.300 136 0.348

Start of calculations 8⋅f⋅L


K=
g⋅π 2⋅d 5
1.- Determination of K-values
f L D K
Pipe Nº Assumed) m m s2/m5
1 #VALUE! 300.0 0.400 #VALUE!
2 #VALUE! 200.0 0.400 #VALUE!
3 #VALUE! 300.0 0.500 #VALUE!
4 #VALUE! 200.0 0.500 #VALUE!

6.- Derivatives of equations F1 to F4

DF1/DQ1 = 1 = 1 DF1/DQ2 = 0 =
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1 =
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1 =
DF4/DQ1 = 2*K1*Q1 = #VALUE! Q1 DF4/DQ2 = 2*K2*Q2 =

7.- Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4 (-1)


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4 *
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4

8.- Substitute the derivatives

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 #VALUE! Q1 #VALUE! Q2

9.- Calculate values of F1 to F4 using actual flows


F1 = Q1 + Q4 - Qin Q1 =
F2 = -Q1 + Q2 Q2 =
F3 = Q2 + Q3 - Qout Q3 =
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2 Q4 =
Qin =
Qout =
F1 = 0.00
F2 = 0.00
F3 = 0.00
F4 = #VALUE!

10.- Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0 0
DQ2 = - -1 1 0
DQ3 0 1 1
DQ4 #VALUE! #VALUE! #VALUE!

11.- Solve the matrix to obtain the flow corrections


4x4
DQ1 #VALUE! #VALUE! #VALUE! #VALUE!
DQ2 = - #VALUE! #VALUE! #VALUE! #VALUE!
DQ3 #VALUE! #VALUE! #VALUE! #VALUE!
DQ4 #VALUE! #VALUE! #VALUE! #VALUE!

4x1
DQ1 #VALUE!
DQ2 = - #VALUE!
DQ3 #VALUE!
DQ4 #VALUE!

Let the maximum acceptable correcti


DQ1 #VALUE! DQmax =
| 0.001|
DQ2 = #VALUE! #VALUE!
DQ3 #VALUE! #VALUE!
DQ4 #VALUE!

12.- Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = 0.251863 + #VALUE!


Q2 = Q2 + DQ2 Q2 = 0.251863 + #VALUE!
Q3 = Q3 + DQ3 Q3 = 0.348137 + #VALUE!
Q4 = Q4 + DQ4 Q4 = 0.348137 + #VALUE!

The process is repeated with the new flow rates, until all correction values have a value near
Iteration Nº 1

Qin 1 Q1 2
L1
1 d1
K1
Q4 L4 L2
d d2 2
4 K4 Loop 1 K2
4 Q2
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

Qin 1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

2.- Flow rates from previous iteration K


s2/m5 Qin 1
Q1 = 0.2519 m /s
3
K1 = #VALUE!
Qin

Q2 = 0.2519 m3/s K2 = #VALUE!

Q3 = 0.3481 m3/s K3 >= #VALUE! Q4


Q4 = 0.3481 m /s
3
K4 = #VALUE!
4

3.- Assign loop positive direction


Assigned in iteration Nº 0 (Figure 3)

4.- Nodal discharge functions 4

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2 (could have been: Q1 - Q2)
F3 = Q2 + Q3 - Qout

5.- Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

0 DF1/DQ3 = 0 = 0 DF1/DQ4 = 1 =
1 DF2/DQ3 = 0 = 0 DF2/DQ4 = 0 =
1 DF3/DQ3 = 1 = 1 DF3/DQ4 = 0 =
#VALUE! Q2 DF4/DQ3 = -2*K3*Q3 = #VALUE! Q3 DF4/DQ4 = -2*K4*Q4 =

F1
F2
F3
F4

0 1 (-1) F1
0 0 * F2
1 0 F3
#VALUE! Q3 #VALUE! Q4 F4

K
s2/m5
0.251863 K1 = #VALUE!
0.251863 K2 = #VALUE!
0.348137 K3 >= #VALUE!
0.348137 K4 = #VALUE!
0.6
0.6

1 (-1) 0
0 * 0
0 0
#VALUE! #VALUE!

13.- Friction factor


4x1
0 Let a water kinematic viscosity of
* 0 n= 1.30E-06 m²/s
0
#VALUE! Reynolds number
Re = v*d/n

Q d A
Pipe Nº m /s
3
m m²
1 #VALUE! 0.4 0.125664
aximum acceptable correction-value be 2 #VALUE! 0.4 0.125664
| 3 #VALUE! 0.5 0.19635
4 #VALUE! 0.5 0.19635
Let a maximum acceptable flow velocity vMax =
#VALUE!
#VALUE!

14.- Data to be used as input in the next iteration


Q1 = #VALUE! m /s
3

Q2 = #VALUE! m3/s Frict. fact. Length


Q3 = #VALUE! m /s
3
f L
Q4 = #VALUE! m /s
3
Pipe Nº - m
1 #VALUE! 300.0
2 #VALUE! 200.0
3 #VALUE! 300.0
n values have a value near zero 4 #VALUE! 200.0
1

g= 9.80665

Q1 2

1
1

Loop 1
2
Q2

3 Qout
Q3
3

Figure 3

1
0
0
#VALUE! Q4

3
4
Let an absolute rugosty for all pipes
Rabs = 0.01 mm
Rabs = 0.00001 mm

Relative rugosity
Rrel = Rabs / d

Friction factor (VBA function)


f= Pipe_Friction_Factor_Rrel_Re

v Re Rrel f
m/s - - -
#VALUE! #VALUE! 2.50E-05 #VALUE!
#VALUE! #VALUE! 2.50E-05 #VALUE!
#VALUE! #VALUE! 2.00E-05 #VALUE!
#VALUE! #VALUE! 0.00002 #VALUE!
velocity vMax = 3 m/s

the next iteration

Diameter K.value Flow rate


d K Q
m s²m5 m3/s
0.4 #VALUE! #VALUE!
0.4 #VALUE! #VALUE!
0.50 #VALUE! #VALUE!
0.50 #VALUE! #VALUE!
Loop solution using Newton Raphson method Iteration Nº 2

Data results from Iteration Nº 1 Qin 1

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
Q4
Pipe Nº - m m s²m5 m3/s
1 #VALUE! 300.0 0.400 #VALUE! #VALUE!
2 #VALUE! 200.0 0.400 #VALUE! #VALUE!
3 #VALUE! 300.0 0.500 #VALUE! #VALUE!
4 #VALUE! 200.0 0.500 #VALUE! #VALUE!

Qin = 0.6 m3/s


Qout = 0.6 m3/s

Qin 1

Q4

Start of calculations 8⋅f⋅L


K=
g⋅π 2⋅d 5
1.- Determination of K-values
f L D K
Pipe Nº Assumed) m m s2/m5
1 #VALUE! 300.0 0.400 #VALUE!
2 #VALUE! 200.0 0.400 #VALUE!
3 #VALUE! 300.0 0.500 #VALUE!
4 #VALUE! 200.0 0.500 #VALUE!

6.- Derivatives of equations F1 to F4

DF1/DQ1 = 1 = 1 DF1/DQ2 = 0 = 0
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1 = 1
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1 = 1
DF4/DQ1 = 2*K1*Q1 = #VALUE! Q1 DF4/DQ2 = 2*K2*Q2 = #VALUE! Q2

7.- Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4 (-1) F1


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4 * F2
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4 F3
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4 F4

8.- Substitute the derivatives

DQ1 1 0 0
DQ2 = - -1 1 0
DQ3 0 1 1
DQ4 #VALUE! Q1 #VALUE! Q2 #VALUE! Q3

9.- Calculate values of F1 to F4 using actual flows


F1 = Q1 + Q4 - Qin Q1 = #VALUE! K1 =
F2 = -Q1 + Q2 Q2 = #VALUE! K2 =
F3 = Q2 + Q3 - Qout Q3 = #VALUE! K3 >=
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2 Q4 = #VALUE! K4 =
Qin = 0.6
Qout = 0.6
F1 = #VALUE!
F2 = #VALUE!
F3 = #VALUE!
F4 = #VALUE!

10.- Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0 0 1 (-1)
DQ2 = - -1 1 0 0 *
DQ3 0 1 1 0
DQ4 #VALUE! #VALUE! #VALUE! #VALUE!

11.- Solve the matrix to obtain the flow corrections


4x4 4x1
DQ1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
DQ2 = - #VALUE! #VALUE! #VALUE! #VALUE! * #VALUE!
DQ3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
DQ4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

4x1
DQ1 #VALUE!
DQ2 = - #VALUE!
DQ3 #VALUE!
DQ4 #VALUE!

Let the maximum acceptable correction-value be


DQ1 #VALUE! DQmax =
| 0.001|
DQ2 = #VALUE! #VALUE!
DQ3 #VALUE! #VALUE!
DQ4 #VALUE!

12.- Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = #VALUE! + #VALUE! Q1 =


Q2 = Q2 + DQ2 Q2 = #VALUE! + #VALUE! Q2 =
Q3 = Q3 + DQ3 Q3 = #VALUE! + #VALUE! Q3 =
Q4 = Q4 + DQ4 Q4 = #VALUE! + #VALUE! Q4 =

The process is repeated with the new flow rates, until all correction values have a value near zero
Iteration Nº 2

1 Q1 2
L1
1 d1
K1
Q4 L4 L2
d d2 2
4 K4 Loop 1 K2
4 Q2
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

2.- Flow rates from previous iteration K


s2/m5 Qin 1 Q1
Q1 = #VALUE! m3/s K1 = #VALUE!
1
Qin

1
Q2 = #VALUE! m3/s K2 = #VALUE!

Q3 = #VALUE! m3/s K3 >= #VALUE! Q4


Q4 = #VALUE! m /s3 Loop 1
K4 = #VALUE!
4

3.- Assign loop positive direction


Assigned in iteration Nº 0 (Figure 3)
3
Q3
4.- Nodal discharge functions 4

F1 = Q1 + Q4 - Qin Figure 3
F2 = -Q1 + Q2 (could have been: Q1 - Q2)
F3 = Q2 + Q3 - Qout

5.- Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

DF1/DQ3 = 0 = 0 DF1/DQ4 = 1 = 1
DF2/DQ3 = 0 = 0 DF2/DQ4 = 0 = 0
DF3/DQ3 = 1 = 1 DF3/DQ4 = 0 = 0
DF4/DQ3 = -2*K3*Q3 = #VALUE! Q3 DF4/DQ4 = -2*K4*Q4 = #VALUE! Q4

1 (-1) F1
0 * F2
0 F3
#VALUE! Q4 F4

K
s2/m5
#VALUE!
#VALUE!
#VALUE!
#VALUE!

#VALUE!
#VALUE!
#VALUE!
#VALUE!

13.- Friction factor Let an absolute rugosty for all pipes


Rabs = 0.01
Let a water kinematic viscosity of Rabs = 0.00001
n= 1.30E-06 m²/s
Relative rugosity
Reynolds number Rrel = Rabs / d
Re = v*d/n
Friction factor (VBA function)
f= Pipe_Friction_Factor_Rre

Q d A v Re
Pipe Nº m /s
3
m m² m/s -
1 #VALUE! 0.4 0.125664 #VALUE! #VALUE!
rection-value be 2 #VALUE! 0.4 0.125664 #VALUE! #VALUE!
3 #VALUE! 0.5 0.19635 #VALUE! #VALUE!
4 #VALUE! 0.5 0.19635 #VALUE! #VALUE!
Let a maximum acceptable flow velocity vMax = 3
#VALUE!
#VALUE!

14.- Data to be used as input in the next iteration


#VALUE! m /s
3

#VALUE! m3/s Frict. fact. Length Diameter K.value


#VALUE! m /s
3
f L d K
#VALUE! m /s
3
Pipe Nº - m m s²m5
1 #VALUE! 300.0 0.4 #VALUE!
2 #VALUE! 200.0 0.4 #VALUE!
3 #VALUE! 300.0 0.50 #VALUE!
4 #VALUE! 200.0 0.50 #VALUE!
1

Loop solution using Newton


g= 9.80665

Data results from Iteration Nº 2

Pipe Nº
1
2
3
4

Qin =
Qout =

Start of calculations
Q1 2
1.- Determination of K-values
f
Pipe Nº Assumed)
Loop 1 1 #VALUE!
2
Q2 2 #VALUE!
3 #VALUE!
4 #VALUE!
Qout

6.- Derivatives of equations F1 to F4

DF1/DQ1 = 1
DF2/DQ1 = 1
DF3/DQ1 = 0
DF4/DQ1 = 2*K1*Q1

7.- Assemble equations in matrix for

DQ1
DQ2 =
DQ3
DQ4

3
8.- Substitute the derivati

DQ1
DQ2
DQ3
DQ4

9.- Calculate values of F1


F1 =
F2 =
F3 =
F4 =

F1 =
F2 =
F3 =
F4 =

10.- Substitute values of

4
olute rugosty for all pipes 11.- Solve the matrix to obtain the fl
mm
mm DQ1
DQ2
DQ3
DQ4

ctor (VBA function)


Pipe_Friction_Factor_Rrel_Re DQ1
DQ2
Rrel f DQ3
- - DQ4
2.50E-05 #VALUE!
2.50E-05 #VALUE!
2.00E-05 #VALUE! DQ1
0.00002 #VALUE! DQ2
DQ3
m/s DQ4

12.- Calculated new flows using obta

Q1 =
Flow rate Q2 =
Q Q3 =
m /s3
Q4 =
#VALUE!
#VALUE!
#VALUE!
#VALUE! The process is repeated w
lution using Newton Raphson method Iteration Nº 3

ts from Iteration Nº 2 Qin 1

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
Q4 L4
- m m s²m5 m3/s d
#VALUE! 300.0 0.400 #VALUE! #VALUE! 4 K4 Loop 1
4

#VALUE! 200.0 0.400 #VALUE! #VALUE!


#VALUE! 300.0 0.500 #VALUE! #VALUE!
#VALUE! 200.0 0.500 #VALUE! #VALUE!
Q3
4

0.6 m3/s
0.6 m3/s

Qin 1

Q4
4

Q3
4

8⋅f⋅L 2.- Flow rates from previous iteratio


K=
g⋅π 2⋅d 5
mination of K-values Q1 = #VALUE!
L D K Q2 = #VALUE!
m m s2/m5 Q3 = #VALUE!
300.0 0.400 #VALUE! Q4 = #VALUE!
200.0 0.400 #VALUE!
300.0 0.500 #VALUE! 3.- Assign loop positive direction
200.0 0.500 #VALUE! Assigned in iteration Nº 0 (Figure

4.- Nodal discharge functions

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout

5.- Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*
tives of equations F1 to F4

= 1 DF1/DQ2 = 0 = 0 DF1/DQ3 = 0
= -1 DF2/DQ2 = 1 = 1 DF2/DQ3 = 0
= 0 DF3/DQ2 = 1 = 1 DF3/DQ3 = 1
= #VALUE! Q1 DF4/DQ2 = 2*K2*Q2 = #VALUE! Q2 DF4/DQ3 = -2*K3*Q3

ble equations in matrix form

DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4 (-1) F1


- DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4 * F2
DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4 F3
DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4 F4

8.- Substitute the derivatives

1 0 0 1
= - -1 1 0 0
0 1 1 0
#VALUE! Q1 #VALUE! Q2 #VALUE! Q3 #VALUE! Q4

9.- Calculate values of F1 to F4 using actual flows K


s2/m5
Q1 + Q4 - Qin Q1 = #VALUE! K1 = #VALUE!
-Q1 + Q2 Q2 = #VALUE! K2 = #VALUE!
Q2 + Q3 - Qout Q3 = #VALUE! K3 >= #VALUE!
K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2 Q4 = #VALUE! K4 = #VALUE!
Qin = 0.6
Qout = 0.6
#VALUE!
#VALUE!
#VALUE!
#VALUE!

10.- Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0 0 1 (-1) #VALUE!


DQ2 = - -1 1 0 0 * #VALUE!
DQ3 0 1 1 0 #VALUE!
DQ4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

the matrix to obtain the flow corrections


4x4 4x1
#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
= - #VALUE! #VALUE! #VALUE! #VALUE! * #VALUE!
#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

4x1
#VALUE!
= - #VALUE!
#VALUE!
#VALUE!

Let the maximum acceptable correction-value be


#VALUE! DQmax =
| 0.001|
= #VALUE! #VALUE!
#VALUE! #VALUE!
#VALUE!

ated new flows using obtained corrections

Q1 + DQ1 Q1 = #VALUE! + #VALUE! Q1 = #VALUE! m3/s


Q2 + DQ2 Q2 = #VALUE! + #VALUE! Q2 = #VALUE! m3/s
Q3 + DQ3 Q3 = #VALUE! + #VALUE! Q3 = #VALUE! m3/s
Q4 + DQ4 Q4 = #VALUE! + #VALUE! Q4 = #VALUE! m3/s

The process is repeated with the new flow rates, until all correction values have a value near zero
Q1 2
L1
1 d1
K1
L2
d2 2
Loop 1 K2 Q2
L3
d3
K3 Qout
3
Q3
3

Figure 1

Q1 2

2
Q2

3 Qout
Q3
3

Figure 2

ates from previous iteration K


s2/m5 Qin 1 Q1 2
m /s
3
K1 = #VALUE!
1
Qin

1
m3/s K2 = #VALUE!

m3/s K3 >= #VALUE! Q4


m /s
3 Loop 1
K4 = #VALUE!
4 2
Q2
loop positive direction
d in iteration Nº 0 (Figure 3)
3
Q3
discharge functions 4 3

Q1 + Q4 - Qin Figure 3
(could have been: Q1 - Q2)
Q2 + Q3 - Qout

ead-loss function
K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

= 0 DF1/DQ4 = 1 = 1
= 0 DF2/DQ4 = 0 = 0
= 1 DF3/DQ4 = 0 = 0
= #VALUE! Q3 DF4/DQ4 = -2*K4*Q4 = #VALUE! Q4

(-1) F1
* F2
F3
F4
13.- Friction factor Let an absolute rugosty for all pipes
Rabs = 0.01 mm
Let a water kinematic viscosity of Rabs = 0.00001 mm
n= 1.30E-06 m²/s
Relative rugosity
Reynolds number Rrel = Rabs / d
Re = v*d/n
Friction factor (VBA function)
f= Pipe_Friction_Factor_Rrel_Re

Q d A v Re Rrel f
Pipe Nº m /s
3
m m² m/s - - -
1 #VALUE! 0.4 0.125664 #VALUE! #VALUE! 2.50E-05 #VALUE!
2 #VALUE! 0.4 0.125664 #VALUE! #VALUE! 2.50E-05 #VALUE!
3 #VALUE! 0.5 0.19635 #VALUE! #VALUE! 2.00E-05 #VALUE!
4 #VALUE! 0.5 0.19635 #VALUE! #VALUE! 0.00002 #VALUE!
Let a maximum acceptable flow velocity vMax = 3 m/s
#VALUE!
#VALUE!

14.- Data to be used as input in the next iteration

Frict. fact. Length Diameter K.value Flow rate


f L d K Q
Pipe Nº - m m s²m5 m3/s
1 #VALUE! 300.0 0.4 #VALUE! #VALUE!
2 #VALUE! 200.0 0.4 #VALUE! #VALUE!
3 #VALUE! 300.0 0.50 #VALUE! #VALUE!
4 #VALUE! 200.0 0.50 #VALUE! #VALUE!
1

g= 9.80665

2
Q2

Qout

3
4
Example 1 [1]
L D K
Pipe Nº m mm s /m5
2

1 300 150 6528


2 200 150 4352
3 300 150 6528
4 200 150 4352

Q1 = 0.6 m3/s
Q3 = 0.6 m3/s

f= 0.02 -
L D K
Pipe Nº m mm s /m5
2

1 300 150 6528


2 200 150 4352
3 300 150 6528
4 200 150 4352

Q1 = 0.6 m3/s
Q3 = 0.6 m3/s

f= 0.02 -

Balance in nodes
1 Q1 + Q4 - 0.6 = 0
2 Q1 + Q2 = 0
3 Q2 + Q3 -0.6 = 0
4

Loop equation

Darcy-Weisbach

8⋅f⋅L Microsoft Equation

K= 2 5 3.0

g⋅π ⋅d
H mcf = K⋅Q2
h= K * Q^2 [mcf]
Example 1 [1]
Loop with four pipes

L D K
Pipe Nº m mm s /m5
2

1 300 150 6528


2 200 150 4352
3 300 150 6528
4 200 150 4352

Qin = 0.6 m3/s


Qout = 0.6 m3/s

f= 0.02 -

Nodal equations
Node 1 Q1 + Q4 - Qin = 0
Node 2 - Q1+ Q2 = 0
Node 3 Q2 + Q3 - Qout = 0
Node 4

Loop equation
K1*Q1^2+K2*Q2^2+K3*Q3^2+K4*Q4^2 = 0

Initial flow rate assumptions K


s2/m5 Qin 1
Q1 = 0.5 m /s3
K1 = 6528

Q2 = 0.5 m /s3
K2 = 4352

Q3 = 0.1 m /s3
K3 >= 6528 Q4
Q4 = 0.1 m /s3
K4 = 4352
4
Q4
4

Assign loop positive direction


as clockweise (Fifure 3)

Nodal discharge functions 4

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout

Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

Derivatives of equations F1 to F4
DF1/DQ1 = 1 = 1 DF1/DQ2 = 0
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1
DF4/DQ1 = 2*K1*Q1 = 13056 Q1 DF4/DQ2 = 2*K2*Q2

Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4

Substitute the derivatives

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 13056 Q1 8704 Q2

Calculate values of F1 to F4 using actual flows

F1 = Q1 + Q4 - Qin Q1 =
F2 = -Q1 + Q2 Q2 =
F3 = Q2 + Q3 - Qout Q3 =
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2 Q4 =
Qin =
Qout =
F1 = 0
F2 = 0
F3 = 0
F4 = 2611.2

Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0 0
DQ2 = - -1 1 0
DQ3 0 1 1
DQ4 6528 4352 -1305.6

Solve the matrix to obtain tger flow corrections


4x4
DQ1 0.06667 -0.43333 0.10000
DQ2 = - 0.06667 0.56667 0.10000
DQ3 -0.06667 -0.56667 0.90000
DQ4 0.93333 0.43333 -0.10000

4x1
DQ1 0.2
DQ2 = - 0.2
DQ3 -0.2
DQ4 -0.2

DQ1 -0.2
DQ2 = -0.2
DQ3 0.2
DQ4 0.2

Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = 0.5 +
Q2 = Q2 + DQ2 Q2 = 0.5 +
Q3 = Q3 + DQ3 Q3 = 0.1 +
Q4 = Q4 + DQ4 Q4 = 0.1 +

The process is repeated with the new flow rates


Revised values of F and derivatives dF/DQ values are obtained.
Qin 1 Q1 2
L1
1 d1
K1
Q4 L4 L2
d d2 2
4 4 Loop 1 K2
K4 Q2
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

Qin 1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

Q1 2

Loop 1
4 2
Q2
Loop 1
4 2
Q2

3 Qout
Q3
4 3

Figure 3

∂F1/∂Q1

= 0 DF1/DQ3 = 0 = 0 DF1/DQ4 =
= 1 DF2/DQ3 = 0 = 0 DF2/DQ4 =
= 1 DF3/DQ3 = 1 = 1 DF3/DQ4 =
= 8704 Q2 DF4/DQ3 = -2*K3*Q3 = -13056 Q3 DF4/DQ4 =

(-1) F1
* F2
F3
F4

0 1 (-1) F1
0 0 * F2
1 0 F3
-13056 Q3 -8704 Q4 F4

K
s /m5
2

0.5 K1 = 6528
0.5 K2 = 4352
0.1 K3 >= 6528
0.1 K4 = 4352
0.6
0.6
1 (-1) 0
0 * 0
0 0
-870.4 2611.2

4x1
0.00008 0
0.00008 * 0
-0.00008 0
-0.00008 2611.2

-0.2 Q1 = 0.3
-0.2 Q2 = 0.3
0.2 Q3 = 0.3
0.2 Q4 = 0.3
1 = 1
0 = 0
0 = 0
-2*K4*Q4 = -8704 Q4
Balance in nodes
1 Q1 + Q4 - 0.6 = 0
2 Q1 + Q2 = 0
3 Q2 + Q3 -0.6 = 0
4

Loop equation

h= K * Q^2 [mcf]
Darcy-Weisbach
Microsoft Equation

8⋅f⋅L 3.0

K= 2 5
g⋅π ⋅d
H mcf = K⋅Q2
First iteration step
Loop with four pipes.

Input data
L D K
Pipe Nº m mm s2/m5
1 300 150 6528
2 200 150 4352
3 300 150 6528
4 200 150 4352

Qin = 0.6 m3/s


Qout = 0.6 m3/s

f= 0.02 -

Nodal equations
Node 1 Q1 + Q4 - Qin = 0
Node 2 - Q1+ Q2 = 0
Node 3 Q2 + Q3 - Qout = 0
Node 4

Loop equation
K1*Q1^2+K2*Q2^2+K3*Q3^2+K4*Q4^2 = 0

Initial flow rate assumptions K


s /m5
2
Qin 1
Q1 = 0.5 m /s3
K1 = 6528

Q2 = 0.5 m /s3
K2 = 4352
Q3 = 0.1 m3/s K3 >= 6528 Q4
Q4 = 0.1 m3/s K4 = 4352
4

Assign loop positive direction


as clockweise (Fifure 3)

Nodal discharge functions 4

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout

Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

Derivatives of equations F1 to F4
DF1/DQ1 = 1 = 1 DF1/DQ2 = 0
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1
DF4/DQ1 = 2*K1*Q1 = 13056 Q1 DF4/DQ2 = 2*K2*Q2

Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4

Substitute the derivatives

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 13056 Q1 8704

Calculate values of F1 to F4 using actual flows

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

F1 = 0.00
F2 = 0.00
F3 = 0.00
F4 = 2611.2

Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 6528 4352

Solve the matrix to obtain tger flow corrections


4x4
DQ1 0.06667 -0.43333 0.10000
DQ2 = - 0.06667 0.56667 0.10000
DQ3 -0.06667 -0.56667 0.90000
DQ4 0.93333 0.43333 -0.10000

4x1
DQ1 0.2
DQ2 = - 0.2
DQ3 -0.2
DQ4 -0.2

DQ1 -0.2
DQ2 = -0.2
DQ3 0.2 Iterration required
DQ4 0.2
Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = 0.5 +
Q2 = Q2 + DQ2 Q2 = 0.5 +
Q3 = Q3 + DQ3 Q3 = 0.1 +
Q4 = Q4 + DQ4 Q4 = 0.1 +

The process is repeated with the new flow rates, until all correction values have a value near zer
Qin 1 Q1 2
L1
1 d1
K1
Q4 L4 L2
d d2 2
4 K4 Loop 1 K2
4 Q2
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

Qin 1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

Q1 2

1
Loop 1
4 2
Q2

3 Qout
Q3
4 3

Figure 3

= 0 DF1/DQ3 = 0 = 0 DF1/DQ4 =
= 1 DF2/DQ3 = 0 = 0 DF2/DQ4 =
= 1 DF3/DQ3 = 1 = 1 DF3/DQ4 =
= 8704 Q2 DF4/DQ3 = -2*K3*Q3 = -13056 Q3 DF4/DQ4 =

(-1) F1
* F2
F3
F4

0 1 (-1) F1
0 0 * F2
1 0 F3
Q2 -13056 Q3 -8704 Q4 F4

K
s /m5
2

Q1 = 0.5 K1 = 6528
Q2 = 0.5 K2 = 4352
Q3 = 0.1 K3 >= 6528
Q4 = 0.1 K4 = 4352
Qin = 0.6
Qout = 0.6

0 1 (-1) 0
0 0 * 0
1 0 0
-1305.6 -870.4 2611.2

4x1
0.00008 0
0.00008 * 0
-0.00008 0
-0.00008 2611.2

ration required
-0.2 Q1 = 0.3
-0.2 Q2 = 0.3
0.2 Q3 = 0.3
0.2 Q4 = 0.3

ection values have a value near zero


1

g= 9.80665
8⋅f⋅L
K=
g⋅π 2⋅d5
2
H mcf = K⋅Q Microsoft Equation
3.0

Pipe Nº f L d K
m m s /m5
2

1 0.02 300 0.15 6531


2 0.02 200 0.15 4354
3 0.02 300 0.15 6531
4 0.02 200 0.15 4354

The f factor must be reclaculated if a


more exat solution is required
f= f(Rrel, Re)

2
1 = 1
0 = 0
0 = 0
-2*K4*Q4 = -8704 Q4

3
4
Second iteration step
Loop with four pipes.

Input data
L D K
Pipe Nº m mm s2/m5
1 300 150 6528
2 200 150 4352
3 300 150 6528
4 200 150 4352

Qin = 0.6 m3/s


Qout = 0.6 m3/s

f= 0.02 -

Nodal equations
Node 1 Q1 + Q4 - Qin = 0
Node 2 - Q1+ Q2 = 0
Node 3 Q2 + Q3 - Qout = 0
Node 4

Loop equation
K1*Q1^2+K2*Q2^2+K3*Q3^2+K4*Q4^2 = 0

From first iteration step K


s /m5
2
Qin 1
Q1 = 0.3 m /s 3
K1 = 6528

Q2 = 0.3 m /s 3
K2 = 4352
Q3 = 0.3 m3/s K3 >= 6528 Q4
Q4 = 0.3 m3/s K4 = 4352
4

Assign loop positive direction


as clockweise (Fifure 3)

Nodal discharge functions 4

F1 = Q1 + Q4 - Qin
F2 = -Q1 + Q2
F3 = Q2 + Q3 - Qout

Loop head-loss function


F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2

Derivatives of equations F1 to F4
DF1/DQ1 = 1 = 1 DF1/DQ2 = 0 =
DF2/DQ1 = 1 = -1 DF2/DQ2 = 1 =
DF3/DQ1 = 0 = 0 DF3/DQ2 = 1 =
DF4/DQ1 = 2*K1*Q1 = 13056 Q1 DF4/DQ2 = 2*K2*Q2 =

Assemble equations in matrix form

DQ1 DF1/DQ1 DF1/DQ2 DF1/DQ3 DF1/DQ4 (-1)


DQ2 = - DF2/DQ1 DF2/DQ2 DF2/DQ3 DF2/DQ4 *
DQ3 DF3/DQ1 DF3/DQ2 DF3/DQ3 DF3/DQ4
DQ4 DF4/DQ1 DF4/DQ2 DF4/DQ3 DF4/DQ4

Substitute the derivatives

DQ1 1 0
DQ2 = - -1 1
DQ3 0 1
DQ4 13056 Q1 8704 Q2

Calculate values of F1 to F4 using actual flows

F1 = Q1 + Q4 - Qin Q1 =
F2 = -Q1 + Q2 Q2 =
F3 = Q2 + Q3 - Qout Q3 =
F4 = K1*Q1^2 + K2*Q2^2 - K3*Q3^2 - K4*Q4^2 Q4 =
Qin =
Qout =
F1 = 0
F2 = 0
F3 = 0
F4 = 0

Substitute values of F1 to F4 and Q1 to Q4 in the matrix

DQ1 1 0 0
DQ2 = - -1 1 0
DQ3 0 1 1
DQ4 3916.8 2611.2 -3916.8

Solve the matrix to obtain tger flow corrections


4x4
DQ1 0.20000 -0.50000 0.30000 0.00008
DQ2 = - 0.20000 0.50000 0.30000 0.00008
DQ3 -0.20000 -0.50000 0.70000 -0.00008
DQ4 0.80000 0.50000 -0.30000 -0.00008

4x1
DQ1 0
DQ2 = - 0
DQ3 0
DQ4 0

DQ1 0.0
DQ2 = 0.0
DQ3 0.0 Iteration finished
DQ4 0.0
Calculated new flows using obtained corrections

Q1 = Q1 + DQ1 Q1 = 0.3 + 0
Q2 = Q2 + DQ2 Q2 = 0.3 + 0
Q3 = Q3 + DQ3 Q3 = 0.3 + 0
Q4 = Q4 + DQ4 Q4 = 0.3 + 0

The process is repeated with the new flow rates, until all correction values have a value near
Qin 1 Q1 2
L1 8⋅f
1 d1
K1
K=
Q4 L4 L2 g⋅π
d d2
4 K4
4
Loop 1 K2
2
Q2 H mcf =
L3
d3
K3 Qout
3
Q3
4 3

Figure 1

Qin 1 Q1 2

Q4
4 2
Q2

3 Qout
Q3
4 3

Figure 2

Q1 2

1
Loop 1
2
Q2

3 Qout
Q3
3

Figure 3

0 DF1/DQ3 = 0 = 0 DF1/DQ4 = 1 =
1 DF2/DQ3 = 0 = 0 DF2/DQ4 = 0 =
1 DF3/DQ3 = 1 = 1 DF3/DQ4 = 0 =
8704 Q2 DF4/DQ3 = -2*K3*Q3 = -13056 Q3 DF4/DQ4 = -2*K4*Q4 =

F1
F2
F3
F4

0 1 (-1) F1 Microsoft Equation


3.0
0 0 * F2
1 0 F3
-13056 Q3 -8704 Q4 F4

K
s /m5
2

0.3 K1 = 6528
0.3 K2 = 4352
0.3 K3 >= 6528
0.3 K4 = 4352
0.6
0.6

1 (-1) 0
0 * 0
0 0
-2611.2 0

4x1
0
* 0
0
0
Q1 = 0.3
Q2 = 0.3
Q3 = 0.3
Q4 = 0.3

n values have a value near zero


1

g= 9.80665
8⋅f⋅L
K=
g⋅π 2⋅d5
2
H mcf = K⋅Q Microsoft Equation
3.0

Pipe Nº f L d K
m m s /m5
2

1 0.02 300 0.15 6531


2 0.02 200 0.15 4354
3 0.02 300 0.15 6531
4 0.02 200 0.15 4354

The f factor must be reclaculated if a


more exat solution is required
f= f(Rrel, Re)

2
1
0
0
-8704 Q4

3
4
[1]
1. - Number nodes, pipes and loops

2. - Nodal discharge equations


jn

F j = ∑ Q jn −q j (Eq . a)
n=1
F j : Flow function of node j
th
Q jn : discharge in n pipe at node j
q j : nodal withdrawal
jn: total nuber of pipes at node j

3. - Head-loss equations
For all loops (n = 1, k n )
kn
F k =∑ K n⋅Qkn⋅|Qkn|= 0 (Eq . b)
n=1
F k : Head-loss function of node k
th
Qkn : Flow rate in k pipe
k n : total pipes in k th loop
F k : Head-loss function of node k
th
Qkn : Flow rate in k pipe
k n : total pipes in k th loop

Microsoft Equation
3.0

4 . - Assume initial pipe flows Q1, Q2, and Q3 .. .


satisfying continuity equations

5 . - Determine friction factors, f i , in all pipes


and compute corresponfing K value
8⋅f i⋅Li
Ki = 2 5
(Eq . c )
π ⋅g⋅Di

∂ Fn
6 . - Find values of partial derivatives and
∂Qi
functions F n , using the initial pipes flows Q i
and Ki

7 . - Find ΔQi . The equations generated are of the


form A⋅x = b, qhich can be solved for ΔQi

8 . - Using the obtained ΔQ i values, the pipe flow


rates are modified and the process is repeated again
until calculated ΔQi is very small
Microsoft Equation
3.0
[1]

1. - Number nodes, pipes and loops

2. - Nodal discharge equations


jn

F j = ∑ Q jn −q j (Eq . a)
n=1
F j : Flow function of node j
th
Q jn : discharge in n pipe at node j
q j : nodal withdrawal
jn: total nuber of pipes at node j

3. - Head-loss equations
For all loops (n = 1, k n )
kn
F k =∑ K n⋅Qkn⋅|Qkn|= 0 (Eq . b )
n=1
F k : Head-loss function of node k
th
Qkn : Flow rate in k pipe
k n : total pipes in k th loop Microsoft Equation
3.0
4 . - Assume initial pipe flows Q1, Q2, and Q3 .. . 8⋅f
satisfying continuity equations K=
g⋅π
5 . - Determine friction factors, f i , in all pipes H mcf =
and compute corresponfing K value
8⋅f i⋅Li
Ki = 2 5
(Eq . c )
π ⋅g⋅Di

∂ Fn
6 . - Find values of partial derivatives and
∂Qi
functions F n , using the initial pipes flows Q i
and Ki

7 . - Find ΔQi . The equations generated are of the


form A⋅x = b, qhich can be solved for ΔQi

8 . - Using the obtained ΔQ i values, the pipe flow


rates are modified and the process is repeated again
until calculated ΔQi is very small
Microsoft Equation
Microsoft Equation
3.0
3.0
8⋅f⋅L
K=
g⋅π 2⋅d5
H mcf = K⋅Q2 Microsoft Equation
3.0

Microsoft Equation
3.0
Example 2. [1]
Three loops, 10 pipes
F=ρ⋅g⋅A m ²⋅H mcf Darcy-Weisbach
p= ρ⋅g⋅H mcf
kg m L ρ
⋅ ⋅ m [ Pa ] Δp Pa=f⋅ ⋅ ⋅v 2
m 3 s² d 2
p[Pa ] =ρ⋅g⋅H mcf L ρ Q2
Δp Pa=f⋅ ⋅ ⋅ 2
H mmcf d 2 A
p[Pa ] =ρ⋅g⋅ L ρ Q2
1000 Δp Pa=f⋅ ⋅ ⋅
( )
for water, let d 2 π 22
⋅d
kg 4
ρ=1000 3 2
m L ρ Q
Δp Pa=f⋅ ⋅ ⋅ 2
H mmcf d 2 π
p[Pa ] =1000⋅g⋅ ⋅d 4
1000 16
p[Pa ] =g⋅H mmcf L 16⋅ρ Q 2
Δp Pa=f⋅ 4 ⋅ ⋅ 2
d⋅d 2 π
Microsoft Equation
8⋅f ρ⋅L
3.0
Δp Pa= 2 ⋅ 5 ⋅Q2
π d
isbach Darcy-Weisbach

ρ 8⋅f⋅L
⋅ ⋅v 2 K= 2 5
2 g⋅π ⋅d
ρ Q2 H mcf = K⋅Q2
⋅ ⋅ 2
2 A p[Pa] =g⋅H mmcf
ρ Q2 p[ Pa]
⋅ ⋅
H mmcf =
( )
2 π 22
⋅d g
4
2
ρ Q P Pa
⋅ ⋅ 2 =K⋅Q 2
2 π g
⋅d 4
16 P Pa=K⋅g⋅Q2
16⋅ρ Q 2

4 2
⋅ 2
⋅d π
ρ⋅L
⋅ 5 ⋅Q 2
Microsoft Equation
3.0
Microsoft Equation
d 3.0
Darcy-Weisbach

8⋅f⋅L
K= 2 5
g⋅π ⋅d
H mcf = K⋅Q2
p[Pa ] =g⋅H mmcf
p[ Pa]
H mmcf =
g

Microsoft Equation
3.0

8⋅f⋅L
K=
g⋅π 2⋅d5
H mcf = K⋅Q 2 Microsoft Equation
3.0
[1] Analysis of water supply distribution networks
Mohsin Siddique
https://www.slideshare.net/yourmohsin/pipe-network-analysis

You might also like