Inclusion of tank configurations as a variable in the cost optimization of branched piped-water networks

The classic problem of the capital cost optimization of branched piped networks consists of choosing pipe diameters for each pipe in the network from a discrete set of commercially available pipe diameters. Each pipe in the network can consist of multiple segments of differing diameters. Water networks also consist of intermediate tanks that act as buffers between incoming flow from the primary source and the outgoing flow to the demand nodes. The network from the primary source to the tanks is called the primary network, and the network from the tanks to the demand nodes is called the secondary network. During the design stage, the primary and secondary networks are optimized separately, with the tanks acting as demand nodes for the primary network. Typically the choice of tank locations, their elevations, and the set of demand nodes to be served by different tanks is manually made in an ad hoc fashion before any optimization is done. It is desirable therefore to include this tank configuration choice in the cost optimization process itself. In this work, we explain why the choice of tank configuration is important to the design of a network and describe an integer linear program model that integrates the tank configuration to the standard pipe diameter selection problem. In order to aid the designers of piped-water networks, the improved cost optimization formulation is incorporated into our existing network design system called JalTantra.


Introduction
The total capital cost of a water distribution network consists of several components such as pipes, tanks, and water treatment plants.Various cost optimization models have been proposed over the past few decades using various techniques such as linear programming (Alperovits and Shamir, 1977;Samani and Mottaghi, 2006), nonlinear programming (Bragalli et al., 2008), and genetic algorithms (Savic and Walters, 1997).In Hooda and Damani (2016) we presented a linear program formulation for the pipe cost optimization of gravity-fed branched piped-water networks that was optimal and fast.The solution was implemented in a water network design system called JalTantra.In this work, the scope of optimization is extended by also making the tank configuration a variable in the model.Thus our optimization metric changes from the pipe cost alone to the combined cost of pipes and tanks.This extension is also incorporated in JalTantra.Note that the networks considered are gravity-fed branched networks, as is typical in rural parts of developing countries.Heuristic or approximate techniques are usually employed for more complex networks, since the search space for the possible solutions is very large and the equations involved are non-convex.Since we restrict ourselves to gravity-fed branched networks, we effectively solve the problem using an integer linear program (ILP) model.

The tank configuration problem
The tank configuration problem is to do with the determination of the tank locations, heights, and capacities, as well as the downstream demand nodes that each tank will service.Introduction of tanks divides the network into a primary network and secondary networks.A primary network distributes the water from the source to the tanks.Each tank then distributes water to the demand nodes for which it is responsible.In developing countries where most of the rural population gets insufficient water per capita (as little as 40 L Published by Copernicus Publications on behalf of the Delft University of Technology.per person per day), in the absence of tanks, households at tail end of the network will not get even this meagre amount when those near the head of the network keep their taps open.Tanks thus help in providing a more equitable distribution of the limited supply of water.Typically this choice of tank configuration is made in an ad hoc manner, dependent on the intuition and experience of the designer.In the present work, this choice is integrated in our capital cost optimization formulation, which is implemented in the water network design software JalTantra.
Tank allocation in a network can be done in several ways.The choice can be a tank for each demand node or a single tank for the entire network or any other configuration in between these two extremes.This allocation then determines the tank capacity. Figure 1 depicts the two extreme configurations as well as the "optimal" one for a sample network with 6 demand nodes.Note how the choice affects the primary and secondary networks.

The two sources of capital cost considered: pipes and tanks
Individual nodes in the network have water demands and minimum pressure requirements.Diameters have to be selected for the pipes connecting the nodes, such that these requirements are met.The lower the diameter, the lower is the cost of the pipes, but the higher the friction losses (usually referred to as head loss).If there is too much head loss in the pipes, it may lead to insufficient pressures at the demand nodes.Therefore the goal is to reduce pipe cost under the constraint of minimum pressure requirements at the demand nodes.The choice of diameter is to be made from a discrete set of commercial pipe diameters that are available.
The capital cost for tanks depends on the size of the tanks to be built.However, note that the cost of a tank rises sublinearly, i.e. doubling the tank capacity changes the cost to less than double the original cost.

The push and pull of pipes and tanks on the total capital cost
The distribution of head loss in the network dictates whether the node pressure requirements are being satisfied or not.Head loss in a pipe depends on the length and diameter of the pipe used, as well as the flow through the pipe.For the branched networks, the flow in a pipe depends on whether the pipe is part of a primary network or a secondary network, which in turn depends on the choice of tank configurations.Typically the primary network runs for the entire day whereas secondary networks are scheduled to run for a few hours every day in order to manage the distribution of water.Thus flow rate in a secondary network is higher than that in a primary network.Therefore, for the same head loss across a pipe, higher diameters are required in the case of a secondary network.This means that the total pipe cost is minimized when the entire network is a primary network, that is, there is a tank installed at each demand node, and there are no secondary networks (as is the case in the second configuration shown in Fig. 1).The total tank capacity required for the network is the same regardless of the tank configuration, that is, the number, locations, and the allocation of demand nodes to the tanks.The cost for various configurations, however, would be different, since, as mentioned earlier, individual tank cost rises sublinearly with its capacity.Therefore the total tank cost is minimized when a single tank serves the entire network (as is the case in the first configuration shown in Fig. 1).
Drink.Water Eng.Sci., 10, 39-44, 2017 www.drink-water-eng-sci.net/10/39/2017/ For the "tank at each demand node" configuration, the pipe cost is minimum but the tank cost is maximum compared to any alternative configuration.In the case of a single tank, the tank cost is minimum but the pipe cost is maximum.The optimum-cost tank configuration therefore depends on the network topology and can lie anywhere between these two extremes.For example in the sample network shown in Fig. 1, the capital cost is minimized if three tanks are built.
In summary, the choice of tank configuration, i.e. the location, height and capacity of the tanks, and the set of demand nodes that each tank serves, is a non-trivial decision that has a direct impact on the capital-cost optimization of piped-water networks.
The rest of the paper is structured as follows.Section 2 describes in brief the problem formulation for the pipe diameter selection only.Section 3 provides details on the extension of the formulation to include tanks.Section 4 is a brief description of the environment used to build the JalTantra system.Conclusions and future work directions are presented in Sect. 5.

The pipe cost optimization problem
Typical rural networks are branched (acyclic).Since the network is acyclic, flow in each pipe can be computed easily from the node demands.For such a system, the following optimization problem was solved in Hooda and Damani (2016): input: source node (head), nodes (elevation, water demand, minimum pressure requirement), pipe (start/end node, length), Commercial pipe diameter (cost per unit length, roughness); output: length and diameter of segments for each pipe; objective: minimize total pipe cost; constraints: pressure at each node must exceed minimum pressure specified water demand must be met at each node pipe diameters can only take values from provided commercial pipe diameters.

The objective function
The objective function (O) to be minimized is the total cost of the pipe diameters (NP -available pipe diameters) chosen for the pipes (NL -total pipes) in the network.The diameters D ij can only be chosen from the set of available commercial pipe diameters.This restriction is represented via continuous variables l ij which represents the length of the j th pipe diameter in the ith pipe.The objective function therefore is: (1)

Pipe constraint
For each pipe the sum of the lengths of the various pipe diameters must equal the total pipe length L i : (2)

Node constraint
At each node n, a minimum amount of pressure P n needs to be maintained.The pressure at any node is calculated from subtracting the elevation of the node E n and the head loss in the pipes connecting the node to the reference node (S n ), i.e. the source for the network from the head provided by the reference node H R .The Hazen-Williams formula is used for head loss.Here f l i is the flow in link i and r j and d j are the roughness and diameter of j th pipe diameter, respectively.Therefore the pressure constraint for each node n is as follows: (3)

Extension of the formulation to include tank configuration
In order to include tank configuration as a variable in the model, tank cost is now included in the cost optimization.Tank cost is a piecewise linear function that is implemented using a lookup table .A binary variable e ij is introduced to represent the choice of row j of the cost table for each tank i.Several constraints are introduced to include tanks as well as to capture the simultaneous modelling of both the primary and secondary networks.Note that these constraints are in addition to the already described constraints of our previous model.

Objective cost
The additional objective cost term is the tank cost at each node (NN -total number of nodes).For each tank, cost is computed using each row of the tank cost table (NE -total number of rows in cost table).Here B j is the base cost, Unit j is the unit cost, Lo j is the lower capacity, and Up j is the upper capacity of row j in the tank cost table.Only one of the rows is then chosen for actual cost contribution using the binary variable e ij .
www.drink-water-eng-sci.net/10/39/2017/ Drink.Water Eng.Sci., 10, 39-44, 2017 Note that the tank-cost term is nonlinear since it contains a product of two variables e nj and d n .But this term is linearizable since e nj is a binary variable.The term z nj is introduced to represent e nj × d n and the following constraints are added: (5)

Tank constraints
The first tank constraint is to ensure that every tank height is bounded.
Next, the head constraint at each node is modified to include the tank height term Next, are the constraints that deal with allocation of demand nodes to tanks.
If a node i does not serve its own demand, i.e. it is part of a secondary network, then all its downstream nodes will also be part of a secondary network.
If a node i does not serve its own demand, then it cannot serve the demand of its downstream nodes.
For every node j , only one upstream node i (UP j -set of all upstream nodes for node j ) can serve its demand.
The total demand d i served by node i (DO j -set of all downstream nodes for node j ) is the sum of the demands of the downstream nodes that it serves.
For a node e, its incoming pipe will have primary flow only if the node serves itself.
If s ij is 1 then by definition, node i serves node j .Therefore each pipe k in the path from i to j belongs to a secondary network, i.e. f k = 0.
∀k : k is a pipe in the path between i and j (13)

Head-loss constraints
Next, the head loss is computed for each pipe.Note that head loss for the same pipe will be different depending on whether it is part of the primary network or secondary network.The additional flow depends on the number of supply hours in the two types of networks.
f l secondary = f l primary × SecondaryFlowFactor where SecondaryFlowFactor = SupplyHours primary SupplyHours secondary ( 14) where Before the introduction of tanks, the "source" node provided head to the entire network.Therefore the head at each node was computed as the head provided by the source minus the sum of all head losses along the path from the source to the node.But now each tank serves the roll of the source to the secondary network it is responsible for.The source remains responsible for the primary network.Therefore for each pipe i with a start node s and end node e, the following applies: where k si represents whether the secondary source of pipe i is its start node s.It is 1 only if node s serves itself and if the flow in pipe i is secondary.If k si is 1 then the effective head served by node s is the sum of its elevation and the tank height.Otherwise it is simply the head provided by the upstream source.Here, note that again we have product of variables.As before, since one of the terms is binary we can linearize these constraints.The linearization is omitted here for brevity.

Results for the sample network
Capital cost for the sample network shown in Fig. 2 was optimized using the extended model.In Table 2, apart from the optimal configuration, the cost breakup of the two extreme configurations, namely a single tank and tanks at each demand point, are also presented.The results are in line with expectations.The single tank configuration has the minimum tank cost and the tank at every node configuration has the minimum piping cost.The overall optimal configuration, however, has both tank and piping cost in the middle but an overall lower cost.

JalTantra system
The initial model used for the JalTantra system was the one laid out in Hooda and Damani (2016).It has now been extended with the tank configuration as described in the previous section.The implementation of the model includes variables and constraints dealing with parallel pipes, user-defined www.drink-water-eng-sci.net/10/39/2017/ Drink.Water Eng.Sci., 10, 39-44, 2017 pipe diameters and tank locations, etc.For brevity's sake their details have been omitted from this paper.The implementation is done using Java 7 and GLPK (GNU Linear Programming Kit) 4.55 Linear Program Solver.Java ILP 1.2a is used as the Java interface to the GLPK library.It also uses Google Maps API (2016) for GIS (geographic information system) functionality which allows the user to easily mark the network details as well as extract information such as node elevation and pipe lengths.A sample use case is shown in Fig. 2. The system is freely available at http: //www.cse.iitb.ac.in/jaltantra .

Conclusions and future work
The general cost optimization model of gravity-fed branched piped-water networks was extended by including tank configuration.The tank cost is added to the objective function along with several constraints to simultaneously capture both the primary and secondary networks created as a result of the introduction of tanks.Since we created an ILP to capture the problem, we solve the problem optimally.We have incorporated our extended solution in an update of the water network design system JalTantra, available publicly at http://www.cse.iitb.ac.in/jaltantra .
Future work would lie in incorporating more pipe-waternetwork design components such as valves and pumps.So far only a one-time capital cost of the network has been considered.The addition of pumps will bring in the aspect of operational cost as well, which will have to be incorporated into the objective cost.
Competing interests.The authors declare that they have no conflict of interest.

Figure 1 .
Figure 1.Alternate tank configurations for a sample network.

Table 1 .
Several variables are added to the model to capture the choice of tank configuration. is the source for secondary link i s ij 1 if the tank at ith node serves the j th node e nj 1 if the cost of tank at nth node is calculated by the j th row in the tank table

Table 2 .
Cost of different tank configurations.Sample network marked in JalTantra.