Sei sulla pagina 1di 5

Mini project: Water Pipe Network1

This mini project is inspired by a research article:

H. Jia, W. Wei, K. Xin, Hydraulic model for multi-sources reclai-


med water pipe network based on EPANET and its applications
in Beijing, China, Front. Environ. Sci. Engin. China 2008, 2(1):57–
62 (doi:10.1007/s117783-008-0013-0)

The article is about the design of a water pipe network in Beijing, for distri-
bution of reclaimed water. Several issues are discussed, one of which is the
water pressure at the network nodes.
In the mini project we will do a similar computation as is discussed in
the article. We will focus on the computation of the node pressure. We will
not use the real network data from Beijing, but a simpler model network. To
simplify the task, it has been subdivided into several parts. In your report,
you only have to incude the results for the final, most fully developed part.

Part 1
Begin by carrying out the computations for a very small water pipe network
with only four nodes, see the attached figure. The network nodes are enume-
rated with integers: 1, 2, 3, 4. The task is to compute the pressure at those
nodes points. The pressure value for node k is denoted by pk .
The pressure is given as the difference between the water pressure and
the surrounding atmospheric pressure. Consequently, the pressure value 0
corresponds to the atmospheric pressure.
The following relations are used to compute the pressure:

1. In pipe j the water flow speed Qj (m3 /s) can be expressed as:

Qj = kL (pin − pout ) . (1)

Notation: 1/k is the hydraulic resistance in the pipe; L is the pipe


length; pin is the pressure at inflow to the pipe and pout is the pressure
at outflow from the same pipe. The inverse hydraulic resistance k is
measured in m2 /(bar s), the pressure in bar and the length in meter.

2. The total inflow to a node equals the total outflow from the same node.

The following table contains values of k and L for the pipes in our
network:
1
Part 1 is based on Problem 5.1 in A. Quarteroni & F. Saleri, Scientific Computing
with MATLAB, Springer-Verlag Berlin Heidelberg, 2003

1
pipe k L pipe k L pipe k L
1 0.01 200 2 0.005 100 3 0.005 140
4 0.005 100 5 0.005 100 6 0.002 80
7 0.002 80 8 0.002 80 9 0.005 100
10 0.002 80
Moreover, the pressure in the water reservoir is 10 bar and the pressure p
at the water outlets is ca. 0 bar.
Relation 2 above can be expressed as follows for our network:

Node 1 : Q1 = Q2 + Q3 + Q4
Node 2 : Q2 = Q9 + Q10
Node 3 : Q4 = Q5 + Q6
Node 4 : Q3 + Q5 + Q9 = Q7 + Q8

Inserting (1) into these formulas and using the values from the table
yields the following system of four equations for the four pressure values p1 ,
p2 , p3 , p4 :
    
−3.70 0.50 0.50 0.70 p1 −20
 0.50 −1.16 0 0.50  p2   0 
=
    
0.50 0 −1.16 0.50 p3 0
  
    
0.70 0.50 0.50 −2.02 p4 0
Write a Matlab program that solves this system and displays the result.

Part 2
In the article that inspired this mini project, the goal was to design the
water pipe network appropriately. The authors used software for designing
and analyzing water pipe networks. To mimic this in our project, let us
assume that there is a program for drawing water pipe networks and that
the same software can automatically generate the coefficient matrix for the
corresponding system of linear equations for computing the node pressure
values. This coefficient matrix, A, is stored in a .MAT-file together with the
values of k and L for pipe 1, the outflow pipe from the water reservoir.
Modify your program from Part 1, so that it takes its input from such
a .MAT-file. You should load the file (Matlab command load), form the
right-hand side of the system of equations, and solve the system. Finally,
you should save the solution in another .MAT-file (Matlab command save).
See below for details about the load and save commands.
All equations except the first one have right-hand side 0. The right-hand
side of the first equation is −kLpr , where k och L are the values for pipe 1
and pr is the pressure in the water reservoir The value pr should be input by
the user at run-time. Only the solution vector should be saved in the output
file, no other data.

2
When the program is running, the user should be asked to enter the
name of the input file. Moreover, the user should be asked to choose a name
for the output file. Finally, the results should be presented as a plot of the
solution, with node numbers on the x-axis and pressure values on the y-axis.
If the name of the input file is stored as a text string in the variable
namein, the file can be read via the command load(namein). If the name
of the output file is stored as a text string in the variable nameout and the
solution vector is stored in the variable p, the command save(nameout,’p’)
stores the solution vector in the output file. The suffix .MAT is implicit in
calls to save and load, so there is no need to include the suffix in the file
name text strings. See the Matlab help window for more information.
Run the program and make sure that it works as intended. Via the course
web site you can get the files water4.mat, water40.mat och water400.mat.
The first of these contains the coefficient matrix for the network from Part 1.
Each of the other two files contains a coefficient matrix for a larger network,
with 40 and 400 nodes, respectively..

Part 3
One kind of computational experiment in this context would be to investi-
gate how the pressure in the water reservoir affects the node pressure.
Modify your program to allow for such an experiment. When the system
of equations has been solved and the solution has been presented, the user
should get the opportunity to repeat the computation with another value of
pr , etc., until the user chooses to not enter further pr values.
Make sure that your program uses an efficient approach for carrying out
the repeated computations. Give arguments in your report to convince the
reader that your approach is appropriate.
Run the program for the networks in water40.mat och water400.mat.
The results will show that the pressure in those networks will be too low.
An alternative could be to add an additional water reservoir to the network.
There are two additional files on the course web site, water40_2.mat and
water400_2.mat. They correspond to the same networks as in the previous
files, but with an additional water reservoir at the last node. The pipe from
the water reservoir to the last node has the same properties as pipe 1. For
the modified network, the final equation of the system should have right-
hand side −kLpr (same as for the first equation). How does the additional
water reservoir affect the node pressure?

Part 4 (not mandatory)


• Use the Matlab command cputime to measure the cpu time required
to solve each system of equations.

3
• Consider the properties of the coefficient matrix: can they be taken
advantage of to make the program more efficient? If you find such
possibilities, then try to implement such a solution. Begin by applying
the idea to the small network in water4.mat. If that is successful, you
can try to generalize the approach to the larger networks.

4
p=0
Q 10

2
Q2 Q9 p=0
Q8
Q1
1 4
Q3
Q4
Q5 Q7
p=0 3 p=0
Q6

Schematic view of a four-node water pipe network

Potrebbero piacerti anche