1 Introduction

Partial blockages commonly occur in pipelines due to many reasons such as silting, corrosion, tubercles, incorrect pipe fittings, jamming of valves and partial opening of non-return valve. The problems associated with blockages are excessive head loss, increase in energy consumption, severe transients, delivering low-head and low discharge, and wear and tear of pumps. It is almost impossible to avoid blockages and therefore it is very important to identify the blockages to take corrective actions at the earliest.

In the past, a number of algorithms were developed to identify blockages in a series pipeline using an unsteady flow response of the system. A technique was developed to determine opening size of a blockage and its location in the pipeline by studying Eigen frequency shifts and impedance at the resonance frequency [1]. Later, blockage detection methods were developed based on mass balance; however, these methods are not suitable to locate the blockages [2, 3]. Numerical experiments were carried out to study unsteady pressure responses of various types of blockages in natural gas pipelines [4]. An analytical method based on solution of pressures and discharges in the Fourier domain was developed; however, this method identifies multiple possible blockage locations [5]. Recently, a portable pressure wave maker was demonstrated to create pressure waves in a pipeline that is under investigation for detection of partial blockages and leaks based on singularities in reflected pressure waves measured at a few locations [6].

Lately, frequency response methods have become popular to detect blockages and leaks in simple pipe systems. The frequency response method analyses the response of a pipeline by relating input, output phases and amplitudes at each frequency. Amplification and attenuation of a transmitted signal were found at resonant frequency and at another frequency (anti-resonant frequency), respectively [7]. The frequency response of a pipeline depends on its input and output boundary conditions, wave speed, pipe frictional resistance, blockages and leaks. Frequency response of a pipeline can be obtained either by frequency sweeping technique developed or using a single excitation with a wide band input random binary frequency as proposed [8, 9]. Although, the frequency response methods [10, 11] are able to locate leaks and blockages, these methods are very sensitive to singularities in the pipeline system and may give rise to wrong results.

Analysis of pressure series in the time domain is a less complicated method to detect blockages in a pipeline. It was found that the presence of a blockage damps the pressure oscillation at the odd harmonics. On the contrary, presence of a blockage increases the amplitude of pressure oscillation at the even harmonics. The damping of pressure at odd harmonics was utilized to detect blockages in a single pipeline [12]. The relative pressure amplitude decrease at the odd harmonics was used to detect the leaks in simple pipelines [7, 11, 13, 14]. This method was further explored using the change in amplitude of pressure oscillation at odd harmonics to detect leaks in a branched pipeline [15]. A relative change in the water hammer pressure due to sudden closure of a terminal valve was used to detect leaks in simple pipelines [16]. An inverse leak detection method for water distribution networks was developed [17] and this particular method was extended using the Levenberg–Marquardt method [18]. However inverse leak detection methods have serious limitations such as requirement of huge search space and sensitivity to the initial guess. Alternative to these inverse matrix methods is the use of genetic algorithms (GAs). The GA method is found to search more widely in the solution domain and is quite robust in reaching the global optimum. At present, GA-based optimization methods are widely used in a variety of hydraulic engineering applications such as hydropower turbine blade shape optimization in order to increase power output [19] and calibration of water distribution networks [20], which are a few among its many applications. Inverse transient method and GAs were combined to calibrate the water distribution networks and, in addition, to find leaks at finite-difference (FD) nodes [20]. The proposed research is different from the methods proposed by Vitkovsy et al [20] and Liggett and Chen [18]. The main difference is that the present method is used for blockage detection, whereas the other methods developed are for leak detection and friction factor calibration. Previous methods have been restricted to calculating just the leak magnitudes at the given leak locations. In the proposed method, blockages are determined along the pipeline and not just at the junction nodes. In addition, the proposed method is an exact solution method and no extra measurements are needed. In this method, large matrices are not inverted at every time instant as used in the previous methods, but equations are solved explicitly to minimize computational cost. The proposed method uses only one pressure measurement to isolate up to two blockages. Another important novelty is that the proposed method employs steady oscillatory flow to minimize the damages in pipe system. The proposed method can be easily extended to the pipe networks.

In this paper, GAs are used with the method of characteristics (MOC) in the time domain to identify blockage location and to estimate blockage opening size. The chosen pipeline system has a constant pressure at the inlet and an oscillating valve at the outlet discharging water into the atmosphere. Valve operation with a particular amplitude and frequency is used to generate sinusoidal flow in the pipeline and the pressure response is obtained at the downstream valve. GA guesses blockage location and blockage opening size such that the computed pressure profile matches with the measured pressure profile.

The organization of the paper is as follows. Methodology of numerical simulations, including description of GAs, is presented first. It is followed by results and discussion, in which, the studies to detect a single blockage and two blockages, including obtaining the best amplitude and best frequency of steady oscillatory flow, are presented; later the limitations of the proposed methodology are introduced. The final part of the results and discussion demonstrates successful validation of the proposed methodology on a laboratory experimental set-up. Lastly, important conclusions are presented at the end.

2 Methodology

2.1 Governing equations

Rapidly varying flow variables (water hammer) in the conduit flows are functions of space (x) and time (t) coordinates. The spatial and temporal variations in pressure and velocity are calculated by solving the following continuity and momentum equations [8]:

$$ \frac{\partial p}{\partial t} + V\frac{\partial p}{\partial x} + \rho c^{2} \frac{\partial V}{\partial x} = 0 $$
(1)
$$ \frac{1}{\rho }\frac{\partial p}{\partial x} + \frac{\partial V}{\partial t} + V\frac{\partial V}{\partial x} + g {\text{sin }}\theta + \frac{f}{2D}V\left| V \right| = 0 $$
(2)

where p is pressure, V is velocity in \( x \)-direction, g is acceleration due to gravity, ρ is density, f is friction coefficient, D is inside diameter of the pipe, \( \theta \) is angle of the conduit with respect to the horizontal, c is the sound wave velocity, x is the co-ordinate along the pipeline and t is the time.

Unsteady flow is modelled by either explicit or implicit FD solution of the governing PDEs; however, the MOC solution has been extensively used for this purpose [8] and the same is utilized in the present study.

2.2 MOC

In the MOC, hyperbolic PDEs describing the transient flow are transformed into ODEs. Derivatives in ODEs are approximated numerically on the characteristic grid. For the solution of 1-D single-phase transient flow situations, especially if the speed of the sound wave is constant, the MOC has proven to be very efficient and easily programmable. Solving the governing equations by the MOC leads to the following ordinary differential equations. The MOC is stable for all mesh sizes \( \Delta x \) as long as \( \Delta t \le \Delta x/c \) is satisfied.

$$ \frac{dV}{dt} + \frac{1}{\rho c}\frac{dp}{dt} + g \sin \theta + \frac{f}{2D}V\left| V \right| = 0 $$
(3)
$$ \frac{dV}{dt} - \frac{1}{\rho c}\frac{dp}{dt} + g \sin \theta + \frac{f}{2D}V\left| V \right| = 0 $$
(4)
$$ \frac{dx}{dt} = V \pm c . $$
(5)

Equations (3) and (4) are valid only along lines given by Eq. (5). The slope lines given by Eq. (5) are called the MOC lines and unsteady disturbances propagate along these lines. Using the first-order approximation of friction losses in Eqs. (3) and (4), and integrating them along the characteristic lines, the following characteristic equations are derived [8]:

$$ Q_{n}^{t + \Delta t} = C_{P} - C_{a} H_{n}^{t + \Delta t} $$
(6)
$$ Q_{n}^{t + \Delta t} = C_{n} + C_{a} H_{n}^{t + \Delta t} $$
(7)

and

$$ C_{a} = \frac{gA}{a}. $$
(8)

Equations (6) and (7) are simultaneously solved to calculate \( Q \) and \( H \) at \( t + \Delta t \) at interior points along the pipeline. The discretized interior points are referred to as FD nodes in the rest of the paper.

At the boundaries, Eqs. (6) and (7) are required to be solved with additional equations to compute the unknown variables at time \( t + \Delta t \).

2.3 Equation for upstream reservoir

In this study, upstream boundary condition is specified as a reservoir. During transient conditions in the pipe, small oscillations in the water level are neglected. The head and discharge at the upstream boundary are obtained using the following equation, which includes an entrance loss:

$$ H_{1}^{t + \Delta t} = H_{o} - \left( {1 + k} \right)\frac{{Q_{P}^{2} }}{{2gA^{2} }} $$
(9)
$$ Q_{1}^{t + \Delta t} = \frac{{ - 1 + \sqrt {1 + 4k_{1} \left( {C_{n } + C_{a } H_{o} } \right)} }}{{2k_{1} }} $$
(10)

where \( k \) is the coefficient of entrance loss, \( k_{1} = \frac{{C_{a } \left( {1 + k} \right)}}{{2gA^{2} }} \) and \( H_{o} \) is the height of the reservoir water surface above the datum.

2.4 Equation for valve at downstream end (MOC)

An unsteady flow through a downstream valve using the MOC may be written as [8]

$$ Q_{n + 1}^{t + \Delta t} = 0.5\left( { - C_{v} + \sqrt {C_{v}^{2} + 4C_{P} C_{v} } } \right) $$
(11)
$$ H_{n + 1}^{t + \Delta t} = \frac{{C_{P} - Q_{n + 1}^{t + \Delta t} }}{{C_{a} }} $$
(12)

where \( Q_{n + 1}^{t + \Delta t} \) is discharge at time \( t + \Delta t \) at the valve node, \( H_{n + 1}^{t + \Delta t} \) is head at time \( t + \Delta t \) at the valve node; \( n \) is the number of reaches in pipe upstream of the valve.

$$ C_{v} = \left( {\tau Q_{n + 1}^{o} } \right)^{2} /\left( {C_{a} H_{n + 1}^{o} } \right) $$
(13)
$$ C_{P} = Q_{n}^{t} + \frac{gA}{c}H_{n}^{t} - R\Delta tQ_{n}^{t} \left| {Q_{n}^{t} } \right| $$
(14)
$$ C_{a} = \frac{gA}{c},R = f/2DA $$
(15)

where \( \tau \) is relative valve opening = \( \left( {C_{d} A_{v} } \right)/\left( {C_{d} A_{v} } \right)_{o} \), \( A_{v} \) is valve opening area, \( Q_{n + 1}^{o} \) is steady-state discharge at the valve node, \( H_{n + 1}^{o} \) is steady-state head at the valve node, \( g \) is acceleration due to gravity, \( A \) is cross-sectional area of the pipe upstream of the valve, \( D \) is diameter of the pipe upstream of the valve, \( c \) is pressure wave velocity, \( Q_{n}^{t} \) is discharge at time \( t \) at node ‘n’ of upstream pipe of the valve and \( H_{n}^{t} \) is head at time \( t \) at node ‘n’ of upstream pipe of the valve.

2.5 Equation for simulating blockage

A partial blockage can be simulated as an in-line valve (orifice) with a specific opening based on the blockage size [21]. The relation between head loss across a blockage and flow velocity in steady flow condition is given as

$$ \Delta H_{b} = \frac{1}{2gK}u^{2} $$
(16)
$$ K = \frac{{\left( {C_{c} C_{v} } \right)^{2} }}{{1 - C_{c}^{2} \left( {\frac{{A_{b} }}{{A_{o} }}} \right)^{2} }} $$
(17)
$$ A_{b} = \frac{{\pi D_{bl}^{2} }}{4} $$
(18)
$$ A_{o} = \frac{{\pi D_{o}^{2} }}{4} $$
(19)

where \( \Delta H_{b} \) is head loss across blockage, u is velocity through blockage, g is acceleration due to gravity, \( D_{bl} \) is the diameter of the blockage opening, \( D_{o} \) is diameter of the pipe, \( A_{b} \) is pipe area at the blockage location or constricted pipe area, \( A_{o} \) is area of the pipe, \( C_{c} \) is coefficient of the contraction and is assumed to be 0.62 in the simulations and \( C_{v} \) is the velocity coefficient, which is taken as 0.99.

In unsteady flows, a partial blockage is modelled as an inline valve (orifice) located at the junction of two pipes (‘i’ pipe and ‘i + 1’ pipe). In this case, the valve head loss equation must be solved simultaneously, where the end conditions arise from each of the pipes, with the continuity equation. In addition, the valve internal boundary must allow positive and negative flows. By solving the afore-mentioned equations, the flow rate through the blockage can be obtained as follows [21]:

$$ Q_{i,n + 1}^{t + \Delta t} = - C_{v} + \sqrt {C_{v}^{2} - C_{v} \left( {C_{n} + C_{p} } \right)} $$
(20)
$$ Q_{i,n + 1}^{t + \Delta t} = C_{v} - \sqrt {C_{v}^{2} - C_{v} \left( {C_{n} + C_{p} } \right)} $$
(21)
$$ C_{v} = \left( {\tau Q_{i,n + 1}^{o} } \right)^{2} /\left( {C_{a} \Delta H_{b} } \right). $$
(22)

Understanding Eqs. (20) and (21) reveals that a negative flow rate is possible only if \( C_{p} + C_{n} < 0. \) Hence, Eqs. (20) and (21) are used for \( C_{p} + C_{n} \ge 0 \) and \( C_{p} + C_{n} < 0 \), respectively. After computing the discharge, Eqs. (6) and (7) are used to calculate the head on the either side of the blockage.

3 GAs

The GA is a robust and proved optimization method to compute exact solutions to complex engineering problems. This method works with constrained and unconstrained optimizations problems based on a natural selection similar to natural genetics. It is found that the algorithm repeatedly improves a population of individual candidates, after each generation [22]. At each generation, GA randomly chooses individuals from current lot and uses them as parents to produce the offspring for subsequent generation. Survival of better individual in successive iterations is achieved with the genetic operators such as inheritance, mutation, selection and crossover based on evolutionary biology. GA works with population of individuals at each iteration whereas the classical optimization method works with a single solution. GA chooses next population based on random number generation whereas classical methods use deterministic computation.

A computer program simulates GAs in which population of individual solutions are evolved towards an optimal solution. GA starts from an initial population of individual candidates. Individual candidates are represented in double vector or binary strings of 0 s and 1 s; however, other encodings are also available. At each step (generation), the fitness function of each individual candidate is evaluated and the individual candidates with better fitness are selected stochastically, and these individual candidates are recombined using crossover and randomly mutated to form a new population (children). The children are then used in the next step of the algorithm and the same procedure is repeated in successive generations. Finally, GA stops, provided, it either reaches the maximum iterations or achieves a targeted fitness level for the iteration. Full details of the functioning of GAs and the basis of selecting parameters such as mutation and crossover values can be found in the literature [23]. In this study, the following GA options are chosen in the MATLAB optimization toolbox to perform simulations to identify blockages [24].

  • Population type: ‘doubleVector’.

  • Size of the population: 20.

  • Crossover fraction: 0.8.

  • Migration interval (migration takes place every 20 generations): 20.

  • Fitness limit (GA stops if the best fitness value is less than or equal to the value of fitness limit): 0.05.

The proposed inverse transient method using GA involves the fitting of a numerically modelled pressure to a measured pressure at the downstream end by minimizing the mismatch between them. As described, the objective of the GA is usually programmed to minimize the fitness values of a string, which may be obtained by the following equation:

$$ fitness = \mathop \sum \limits_{i = 1}^{i = N} \left( {H_{i}^{*} - H_{i} } \right)^{2} $$
(23)

where \( N \) is the total number of data points and \( i \) is time level; \( H_{i}^{*} \) and \( H_{i} \) are measured and simulated pressures, respectively, at time level \( i \).

4 Results and discussion

The main objective of the proposed research is to demonstrate the capability of the GAs to identify up to two blockages in a pipeline. Numerical simulations are carried to identify a single blockage as well as two blockages in a hypothetical pipeline. Finally, the proposed methodology is also validated experimentally on a laboratory piping system.

4.1 Single blockage

4.1a Case study of a hypothetical example:

Applicability of the proposed method for detecting a single blockage with a good accuracy is evaluated using simulations on a hypothetical pipeline system [15] as shown in figure 1. This example of a pipeline system consists of a single pipe element and two nodes. The pipeline is supplied with water from a constant-head reservoir at the inlet. The transient in the pipe system is initiated by operating a valve at the outlet. The valve is operated such that steady oscillatory flow is developed in the pipe system. A forward transient analysis is carried out for each case and the pressure history obtained at the downstream end is used in inverse format to identify the blockage location and its opening size.

Figure 1
figure 1

Single blockage in piping system.

For the simulations considered in the proposed research, the pipe system has been chosen with the following parameters: length \( L \) = 1600 m; diameter of the pipe \( D_{o} \) = 0.3 m; constant reservoir head \( H_{o} \) = 50, 40 and 20 m; wave speed \( c \) = 1200 m/s; \( Q_{o} \) = 0.1 m3/s; friction parameter \( f \) = 0.01; \( X \) is distance of the blockage from the upstream reservoir and \( L \) is length of the pipe (figure 1). The blockage opening size (\( D_{bl} \)) and the location of the blockage (\( X/L \)) are varied in the simulations.

A blockage may be characterized by its non-dimensional size \( Z = D_{bl} /D_{o} \), and its location \( X/L \). Thus, \( Z \) = 0.6 represents either a 60% opening at the blockage location or a 40% blockage. In this paper, \( Z \) value is varied from 0.6 to 0.33. As described earlier, the size of the blockage opening and the corresponding energy loss can be correlated using Eqs. (16)–(19) for the given flow conditions.

The transient flow in a piping system is affected by the location of a partial blockage and its size. This is investigated with respect to the steady oscillatory flow in the pipeline. It is observed that the pressure profile at the valve in a sinusoidal flow is distinctly different and follows a specific pattern for a given size of blockage and its location. The resulting pressure profiles due to the difference in both the blockage sizes and the locations in a steady oscillatory flow are presented in figures 24. Different blockage opening sizes \( D_{bl} \) = 0.12 and 0.10 m are modelled at locations 300, 900 and 1500 m with an upstream constant reservoir head of 50 m. The resulting pressure profiles at the downstream end are shown in figure 2a–c. It is observed that the peak pressure decreases with the decrease of opening (\( D_{bl} \)) at the blockage. Similarly, pressure profiles are obtained for constant head reservoir = 20 m and are presented in figure 3a–c. The maximum and minimum pressures at the valve after the development of steady oscillatory flow in the pipeline for a single blockage opening of sizes \( D_{bl} \) = 0.12 and 0.10 m at various locations for the constant reservoir head \( H_{o} \) = 50 m are shown in figure 2. For a blockage opening size of 0.12 m, the peak pressure at the valve is 95.48 m and it occurs for a blockage location at 1500 m from the reservoir, whereas the peak pressure is 93.41 m for the same blockage (\( D_{bl} \) = 0.12 m) located at 300 m, which shows that the peak pressure decreases as the blockage location moves nearer to the reservoir. However, it is observed that the minimum pressure pattern is contrary to that of the maximum pressure. For the blockage opening size \( D_{bl} \) = 0.12 m, the minimum pressure is 2.64 m and it occurs at the blockage location of 1500 m from the reservoir whereas the minimum pressure is 2.97 m for the same blockage opening size but at another location nearer to the reservoir, i.e., at the location \( X \) = 300 m. Therefore, it can be concluded that as the blockage shifts nearer to the reservoir, the minimum pressure increases. The afore-mentioned pattern of the maximum and minimum pressure is consistent for the blockage opening sizes 0.12 and 0.10 m. The effects of blockage size and its location on the peak pressures are more than those on the minimum pressures. Therefore, in the proposed methodology to identify the blockage, the difference in the peak pressures for different blockage locations is adopted as the main criterion. In addition, the pattern of the pressure profile with respect to the opening size of blockage and its location is the key to the identification of the blockage size and its location.

Figure 2
figure 2

Pressure profile for different blockage sizes when \( H_{o} \) = 50 m: (a) \( X \) = 300 m, (b) \( X \) = 900 m and (c) \( X \) = 1500 m.

Figure 3
figure 3

Pressure profile for different blockage sizes when \( H_{o} \) = 20 m: (a) \( X \) = 300 m, (b) \( X \) = 900 m and (c) \( X \) = 1500 m.

The minimum pressure difference between the peak pressures due to a single blockage with opening size \( D_{bl} = 0.12 \; {\text{and}} \; 0.10\, {\text{m}} \) for a constant reservoir head, either \( H_{o} = 20 \; {\text{or }}50\, {\text{m}} \), is more than 3.0 m, which is adequate to estimate the blockage opening size. The peak pressures at the valve for a given reservoir head of 50.0 m, for various blockage locations and with single-blockage opening sizes of 0.10 and 0.12 m, are plotted in figure 4a and b, respectively. It is observed that the minimum difference between the peak pressures for a given blockage size at any two blockage locations is more than 0.25 m, which is adequate to identify the blockage location.

Figure 4
figure 4

Peak pressures developed at the d/s end of the pipeline due to (a) \( D_{bl} \) = 0.10 m and (b) \( D_{bl} \) = 0.12 m placed at different locations (\( X \)) from the upstream reservoir, \( H_{o} \) = 50 m.

For the inverse problem, the measurements required for blockage detection simulations are generated by the MOC. The piping system has a constant-level reservoir at the inlet and a valve at the outlet. The \( \tau \) value, as a function of valve opening, varies with time and is specified by the following equation. Steady oscillatory flow is started from the valve half-opening of the valve and is oscillated between 10% and 90% of the full opening of valve.

$$ \tau \left( t \right) = \tau_{o} + \alpha \sin \frac{\beta }{{T_{P} }}t $$
(24)

where \( \tau \left( t \right) \) is relative valve opening at time \( t \); \( \tau_{o} \) is relative valve opening at the beginning, i.e., it is 0.5; \( \alpha \) is valve amplitude, \( T_{P} \) is theoretical natural time period of pipe system = \( 4L/a \), \( \beta \) is non-dimensional valve frequency = \( \omega /\omega_{n} \), \( \omega \) is valve frequency = \( \beta \omega_{n} \) and \( t \) is time in seconds. This is considered as a forward problem. The forward problem generates the pressure measurement at the downstream end of the pipe system. The proposed methodology for the blockage identification is then used in an inverse format. In the inverse problem, the simulated downstream pressure and the constant upstream head, except the blockage location and the blockage opening size, are given as input. The blockage identification is solved using optimization in the inverse problem.

The blockage size and the blockage location are decision variables in this optimization problem. Blockage size and blockage location are considered as continuous variables in GA. Blockage location is rounded to the nearest FD node because it is simulated only at FD nodes along the pipeline. Blockage size is rounded off to second decimal place. The initial population of vectors consisting of unknown blockage location and blockage size in the GA process is produced randomly using continuous values between the given lower and upper limits of the variables. Subsequent to a guess in the blockage location and its size, at any FD node by the GA, the pipe system is divided into two segments: the first pipe segment is represented between the upstream reservoir and the blockage, and the second pipe segment is represented between the blockage and the valve. The MOC is applied to the pipe system to simulate steady oscillatory flow at the valve to obtain fitness function of the assumed blockage parameters. To apply MOC, the hypothetical pipeline is divided into 32 reaches with reach length equal to 50.0 m; thus, \( \Delta t \) computed as 0.0416 s from the CFL criterion. The lower and upper limits for the blockage sizes are considered as 0.1 m (blockage opening size is equal to 1/3 of pipe diameter) and 0.3 m, respectively. Similarly, the lower and upper limits for the blockage locations are considered as 50.0 m (immediate downstream node of the constant head reservoir) and 1550.0 m (distance of immediate upstream node of the valve), respectively. Some changes are required in this methodology to extend it for the isolation of two blockages. Important changes in addition to the existing methodology are presented in the following paragraph.

To isolate two blockages, four continuous variables in GA are used to represent two blockage locations and two blockage sizes. In this algorithm two blockages are assumed along the pipeline. Now the pipeline is divided into three pipes: first pipe represents the segment between constant head reservoir and the first blockage, second pipe represents the pipe segment between the first blockage and the second blockage and the third pipe represents pipe segment between the second blockage and the downstream valve. The entire piping system is modelled using the MOC. Similar to the single blockage isolation, computed and measured pressure histories are compared at the valve to compute fitness function. In the next iteration, GA chooses another set of blockage locations and sizes. The procedure continues until GA reaches its stopping criteria. The set of blockage parameters (sizes and location of two blockages) corresponding to the minimum objective function attained is the final solution.

4.1b Determination of best amplitude and frequency:

It is observed that for a given constant reservoir head, discharge and piping system, the effect of blockage location on the transient pressure response at the valve is the maximum during oscillatory flow for a specific valve amplitude and frequency. In this paper, these specific values of valve amplitude and frequency are termed as the best amplitude and frequency. The best amplitude and frequency of valve oscillation are obtained using GA optimization. The problem formulation for obtaining the best amplitude and best frequency is as follows. For the given constant head reservoirs of 50.0, 40.0, 30.0 and 20.0 m, the blockage sizes of 0.15, 0.12 and 0.10 m are simulated at blockage locations of 300.0, 600.0, 900.0, 1200.0 and 1500.0 m and the corresponding pressure histories at the downstream end are obtained. These pressures are referred to as \( P_{300} \), \( P_{600} , P_{900} \), \( P_{1200} \) and \( P_{1500} \). The first pressure peak was discarded to avoid numerical oscillations if any in the pressure signal. It is also found that the steady oscillatory flow is developing only after the first peak. The maximum and minimum pressures in each pressure signal for various blockage locations are obtained. They are represented as \( P_{300}^{max} \), \( P_{300}^{min} , \) \( P_{600}^{max} \), \( P_{600}^{min} , \) \( P_{900}^{max} \), \( P_{900}^{min} \), \( P_{1200}^{max} , P_{1200}^{min} \) and \( P_{1500}^{max} \), \( P_{1500}^{min} \). Optimum values of \( \alpha \) and \( \beta \) in Eq. (15) are determined so as to maximize the minimum difference among \( P_{300}^{max} \), \( P_{600}^{max} \), \( P_{900}^{max} \), \( P_{1200}^{max} \) and \( P_{1500}^{max} \). The minimum difference should be more than 0.25 m because the measurement noise is inherent in the field applications. The available pressure transducers accuracy in the field is 0.05% of its range. Suppose that the range of pressure transducer is 0–200 m; then the maximum noise in the measurement is 0.1 m, and therefore 0.25 m is selected, which is on the safer side. The constraints of this optimization problem are as follows: all the maximum pressures should be less than or equal to 185.0 m and all the minimum pressures should be more than or equal to 0.3 to prevent pipe bursting and buckling. The constraints are as follows:

$$ P_{i}^{max} \le 185.0\,\, {\text{m}}\,\, {\text{and}}\,\, P_{i}^{min} \ge 0.3\, {\text{m for}}\, i = 300, 600, 900, 1200\, {\text{and}}\, 1500\,\, {\text{m}}. $$

The upper limit of the pressure is selected based on the following facts: (i) pre-stressed concrete pipes are ideally suited for water supply mains where operating pressures are between 6 and 20 kg/cm2 and (ii) C.I. and steel pipes are used where higher pressures around 24 kg/cm2 are possible. The minimum pressure limit is selected as the diameter of the pipeline to avoid negative pressures. Finally obtained best amplitudes and frequencies for different reservoir levels are given in following equation. These expressions are non-dimensional and applicable to any simple piping system similar to the hypothetical pipe system shown in figure 1.

$$ \beta = 2\pi ;\alpha = \left\{ {\begin{array}{*{20}c} {\frac{{0.16H_{o} }}{\Delta H}\,\, {\hbox{for}}\, \alpha \le 0.35 } \\ {0.35} \\ \end{array} } \right. $$
(25)

In Eq. (25), \( H_{o} \) is reservoir constant head; \( \Delta H \) = steady-state total head loss, which includes entrance loss, frictional loss and head loss across the blockage for a downstream valve in a fully open condition. Total head loss (\( \Delta H \)) is obtained by subtracting the head available at the valve from the constant reservoir head. It is observed that for a single blockage, the \( \alpha \) value varies from 0.25 to 0.35.

4.1c Detection of single blockage:

Many simulations are carried out for the identification of blockage by varying the opening sizes of blockage at various locations in the hypothetical piping system for upstream reservoir heads 50.0, 40.0, 30.0 and 20.0 m. The simulated blockage opening sizes are 0.18, 0.15 and 0.12 m and the blockage locations considered are 300, 600, 900, 1200 and 1500 m. It is observed that the proposed methodology is very accurate without any error in identifying the blockage location and size of the blockage. The average time taken by GA to reach the optimum solution is 900 s. The MOC takes 0.76 s to determine the fitness value after the GA guesses the blockage location. GA takes around 1200 generations to reach the minimum objective function.

A number of GA runs are used to investigate the effect of length of the pressure record on the accuracy of blockage identification. These runs include 100, 200, 300, 400 and 500 s long pressure data. Since there is no noise in the measurements, the GA has produced identical results in all the above cases. The GA run time is found to be directly proportional to the length of the pressure record used for the blockage identification. It is ideal to use a short pressure record. However, measurement noise is unavoidable in the field applications; therefore, the requirement of the length of pressure measurement varies proportionally with the measurement noise. It was observed that the increase in the length of measured pressure data decreases the average error in predicting the friction factors and lumped leak coefficients [20]. Simulations are carried out with an increasing noise in the measurements to test the adequacy of the 500 s pressure data. Noise in the measurements is increased gradually from 0% to 1% of the full range of the pressure transducer (0–185 m). From the results presented in table 1, it is obvious that 500 s long pressure data can be used up to 1% noise in the measurements without any appreciable error. Performance of GAs with noise is as robust as with no noise since the estimation of blockage location and blockage size is not affected by the increasing fitness function.

Table 1 Blockage detection numerical simulations with increasing noise in the measurements.

4.2 Two blockages:

The pipeline system consisting of two blockages is shown in figure 5. The pressure profiles developed at the valve of the pipeline in a sinusoidal flow affected by two equal blockages at different locations are presented in figure 6a and b. Two blockages of equal opening sizes \( D_{bl} \) = 0.12 m are modelled at a combination of locations with a constant reservoir head 50 m and the resulting pressure profiles at the downstream end are shown in figure 6a. It is observed that when the locations are nearer to the downstream end the peak pressure increases, and when the locations are away from the downstream end the peak pressure decreases. The pressure response is similar also for two equal blockages, \( D_{bl} \) = 0.12 m modelled at a combination of two different locations for given constant head reservoir = 40.0 m. The pressure responses are shown in figure 6b. For the two blockages with an equal opening size \( D_{bl} \) = 0.12 m, and a constant reservoir head \( H_{o} \) = 50 m, the developed steady oscillatory peak pressure is 86.80 m, which occurs at the blockage locations of 600 and 1500 m from the reservoir as shown in figure 6a. The peak pressure is 84.85 m for the blockages located at 300 and 600 m. It is observed that the peak pressure decreases as the blockage location shifts nearer to the reservoir. For the two equal blockage opening sizes of 0.12 m, the minimum pressure is 6.24 m, which occurs at the blockage locations of 600 and 1500 m from the reservoir. For the two equal blockage opening sizes of 0.12 m at the locations 300 and 600 m, the minimum pressure is 6.78 m. It is observed that as the blockages are moved nearer to the reservoir, the minimum pressure increases. The afore-mentioned maximum and minimum pressure pattern is consistent for the two blockages with equal opening \( D_{bl} \) = 0.12 m for a given reservoir head of 40.0 m.

Figure 5
figure 5

Schematic of two blockages in piping system.

Figure 6
figure 6

Peak pressures developed at the d/s end of the pipeline due to blockages placed at two locations: (a) \( D_{bl} \) = 0.12 m, \( H_{o} \) = 50 m and (b) \( D_{bl} \) = 0.12 m, \( H_{o} \) = 40.

4.2a Determination of best amplitude and frequency for two blockages:

The methodology to obtain the best amplitude and frequency of a valve oscillation to detect the two blockages using GA optimization is presented here. The problem formulation for obtaining the best amplitude and best frequency is as follows. For the given constant reservoir heads 50.0 and 40.0 m, the blockage opening sizes 0.15, 0.12 and 0.1 m are simulated at a combination of any two blockage locations among 300.0, 600.0, 900.0, 1200.0 and 1500.0 m, and the corresponding pressure histories at the downstream end are obtained. To limit the number of combinations, two equal blockages are considered. The combinations of blockage locations considered are (300, 600), (300, 900), (300, 1200), (300, 1500), (600, 900), (600, 1200), (600, 1500), (900, 1200), (900, 1500) and (1200, 1500 m). The pressure histories at these combination blockage location are referred to as \( P_{300,600} \), \( P_{300,900} \), \( P_{300,1200} \), \( P_{300,1500} \), \( P_{600,900} \), \( P_{600,1200} \), \( P_{600,1500} \), \( P_{900,1200} \), \( P_{900,1500} \) and \( P_{1200,1500} \). The maximum and minimum pressures after the first peak in each pressure signal are obtained. Optimum values of \( \alpha \) and \( \beta \) in Eq. (24) are obtained so as to maximize the minimum difference among \( P_{300,600}^{max} \), \( P_{300,900}^{max} \), \( P_{300,1200}^{max} \), \( P_{300,1500}^{max} \), \( P_{600,900}^{max} \), \( P_{600,1200}^{max} \), \( P_{600,1500}^{max} \), \( P_{900,1200}^{max} \), \( P_{900,1500}^{max} \) and \( P_{1200,1500}^{max} \). The minimum difference should be more than 0.25 m. The constraints of this optimization problem are as follows: all the maximum pressures should be less than or equal to 185.0 m and all the minimum pressures should be more than or equal to 0.3 m, i.e.

$$ P_{i}^{max} \le 185.0\,\, {\text{m}}\,\, {\text{and}}\,\, P_{i}^{min} \ge 0.3\,\, {\text{m}} \,\,{\text{for}}\,\, i = \left( {300, 600} \right) \ldots {\text{and}} \,\left( {1200, 1500} \right)\,\,{\text{m}}. $$

It is observed that for a head \( H_{o} \) = 50.0 m and two equal blockages with opening \( D_{bl} \) = 0.15 m the maximum difference between the peak pressures is only 0.15 m. Similarly, for 40.0 m head and two equal blockages of \( D_{bl} \) = 0.15 m the difference between the peak pressures is 0.15 m. Therefore, these blockages are difficult to be detected. For the head \( H_{o} \) = 50.0 and 40.0 m, two blockages of size \( D_{bl} \) = 0.12 m give the difference between the peak pressures to be more than 0.25 m. Finally obtained best amplitudes and frequencies for different reservoir levels are given in the following equation. These expressions are non-dimensional and applicable to any simple piping system similar to the hypothetical pipe system shown in figure 5.

$$ \beta = 2\pi ;\alpha = \left\{ {\begin{array}{*{20}c} {\frac{{0.14H_{o} }}{\Delta H} \,\,{\hbox{for}}\, \alpha \le 0.3 } \\ {0.3} \\ \end{array} } \right. $$
(26)

In Eq. (26), \( H_{o} \) is constant reservoir head; \( \Delta H \) is steady-state total head loss in piping system, which includes entrance loss, frictional loss and head loss across the blockages for downstream valve fully open condition. Total head loss (\( \Delta H) \) is obtained by subtracting the head available at the valve from the constant reservoir head. It is observed that for two blockages, the \( \alpha \) value varies from 0.2 to 0.3. It is noted that the required valve frequency of steady oscillatory flow is constant and does not change with the number of blockages in the pipe system.

4.2b Detection of two blockages:

The GA optimization problem is constrained by \( x_{2} - x_{1} \ge 0.5\;{\text{m}} \), where \( x_{1} \) and \( x_{2} \) are blockage locations in the upstream constant head reservoir. The reach length between the two FD nodes is 0.5 m. The lower and upper bounds for the blockage size are \( D_{bl} \) = 0.1 m and \( D_{bl} \) = 0.3 m, respectively. In this problem, the population size of GA is taken as 50. For a better convergence the final population is set to an initial population and the GA function is called four times to avoid converging into a local minimum.

A number of simulations are carried out to identify two blockages by varying the blockage opening sizes at various locations for upstream reservoir heads 50.0 and 40.0 m. The simulated blockage opening sizes are 0.15, 0.12 and 0.10 m and the blockage locations considered are a combination of 300, 600, 900, 1200 and 1500 m. It is observed that the proposed methodology is very accurate and there is no error in identifying the locations and the sizes of the two blockages. The average time taken by GA for converging to the optimum solution is around 2500 s. GA takes around 3000 generations to reach the minimum objective function. Two blockages detection simulations are carried out with up to 1% noise in the measurements. Results are presented in table 1.

4.2 Identifiable size of blockages

In order to apply the proposed method and to identify either a single blockage or two blockages, the non-dimensional variable \( \frac{{\left( {\Delta H_{b} } \right)\left( {H_{o} - \Delta H} \right)}}{{H_{o}^{2} }} \) should be sufficiently high. In the non-dimensional term, \( \Delta H_{b} \) is summation of head losses caused by all partial blockages in the piping system, \( \Delta H \) is the total head losses including entrance loss, frictional loss and head loss across the blockages in the piping system. Value of \( \left( {H_{o} - \Delta H} \right) \) gives the head available at downstream valve in a steady-state condition. The non-dimensional term explains that for the identification of a blockage, the head loss caused by the blockage should be dominant as compared with the frictional head losses in the piping system. Further study is required to determine the generalized threshold value of the non-dimensional term, which depends on the accuracy of pressure measurement as well as the numerical modelling.

4.3 Limitations of the methodology

The proposed methodology cannot be applicable to the harmonic flows in the pipelines. Nodes and antinodes are formed along the pipeline during the harmonic flows. Pipe flow oscillating in a certain harmonic frequency decides the location of the nodes and antinodes along the pipeline. In harmonic flows, the blockage located at any node gives the same pressure response as that of the blockage located at any other nodes; similarly, blockage located at any antinode gives the same pressure response as that of the blockage located at any other antinodes. If the proposed methodology is applied for the blockage detection in a harmonic flow, it gives a false location of blockage at any node or antinode depending on the actual blockage located at either the node or antinode.

Analysis of the pressure time series in harmonic flows is studied for blockage identification. The length of the pipeline and the wave speed considered are 1000 m and 1000 m/s, respectively. The wave speed and the pipe lengths are assumed such that the nodes and antinodes are formed at even fractions of the pipeline. The blockages are studied at distances of 100, 200, 250, 300, 400, 500, 600, 700, 750, 800 and 900 m from the upstream reservoir. Theoretical time period of the piping system is 4 s. Pressure responses are obtained at the downstream end of the piping system for the afore-mentioned blockage locations for the second, fourth and eight harmonics. The following observations are noted.

  1. a.

    For the eighth harmonic (\( T \) = 0.5 s), there is no difference in the pressure response due to the location of the blockage at nodes 250, 500 and 750 m. The same is true when the blockage is located at 125, 375, 625 and 875 m as well. It was also found that the pressure responses due to blockage at 300 and 800 m are exactly the same. This applies to the blockage at 200 and 700 m also. The blockage located at 200 and 300 m gives the same pressure peaks but the phase is different.

  2. b.

    For the fourth harmonic (\( T \) = 1.0 s), there is no difference in the pressure response between the blockage located at antinodes 250 and 750 m but the pressure response due to the blockage at node 500 m is completely different and with a higher peak.

  3. c.

    For the second harmonic (\( T \) = 2.0 s), there is no difference in the pressure peaks between the blockage located at 250 and 750 m but the phase of the oscillations is different. However, the pressure response due to blockage at antinode 500 m is completely different and with a lower peak.

It is known from the afore-mentioned observations that the proposed methodology may give wrong location for the blockage detection in harmonic flows.

4.4 Laboratory validation

The laboratory set-up to validate the proposed methodology for identification of partial blockages is explained in this section. The laboratory experiments are carried out in the water resources engineering laboratory of the University of South Carolina, Columbia, USA. The experimental set-up consists of a 160-m-long copper pipe with an external diameter of 28 mm and with a wall thickness of 1.3 mm as shown in figure 7. The pipeline is fixed to the wall and runs at different elevations with vertical curves of radius 1.5 m. The large vertical radius is chosen to avoid secondary currents and bend losses.

Figure 7
figure 7

(a) Layout of experimental set-up and (b) schematic with dimensions.

An upstream supply reservoir with a constant water level open to the atmosphere is used. Water flows from overhead tank to the constant-head reservoir (shown in figure 7), which in turn feeds the water to the experimental pipeline. The inflow to the constant-head reservoir is regulated by a float valve to maintain the constant water level. There are negligibly small oscillations in the water level in the constant-head reservoir and hence are not considered. The water level in the reservoir is 7.15 m above the delivery end of the pipeline. A ball valve located at the downstream end of the pipeline is used to control the flow rate and to create steady oscillatory flow. The valve is operated by a DC step motor to avoid cumulative position error and to reduce inertial effects during the starting and stopping of the valve, therefore giving a highly accurate valve operation. During a steady oscillatory flow generation, predetermined valve motion is programmed. Knowing the valve angle with respect to time, the valve opening area is determined with time.

Two pressure transducers are installed on the pipeline: first transducer at mid-length and second transducer at the valve. The pressure transmitters are of strain gauge type with an operating range of 0–70 m of water head. The accuracy of the pressure transmitter is 0.1% of the complete range. The response time of pressure transmitter is 0.22 ms. An advanced data acquisition system with two-way communication (analogue to digital and digital to analogue) is used to control the valve as well as to acquire the pressure data from two transmitters. The data acquisition system has two digital timers and triggers to accurately control the valve operation. Pressure data from two transmitters are used to calibrate the friction factor in the pipeline but pressure data measured at the valve only are used in blockage identification runs. Equivalent roughness height is calibrated first using the Haaland and Darcy–Weisbach equations by knowing head loss for various Reynolds numbers. For the blockage detection runs, calibrated equivalent roughness height and the initial steady-state Reynolds number are used to compute the friction factor. It is assumed that the friction factor is constant during the steady oscillatory flow. Using sudden valve closure experiments, the wave travel timings between the reservoir and the valve are measured. The calculated wave speed is found to be in the range of 1080–1220 m/s. The variation is attributed to the experimental error.

4.5a Valve characteristics of the experimental set-up:

Since the valve motion is controlled by a stepper motor, which in turn is controlled by a precise control software, the time history of the valve angle can be easily obtained knowing that the motion is linear between two consecutive motor steps and the pattern of stepping is predetermined for the motor. The stepping angle for the valve is calibrated using a protractor with a reading difference in angles up to 0.25°. The equation used for valve operation in the control program is presented as follows:

$$ \theta \left( t \right) = \theta_{o} { \sin }\left( {\frac{2\pi }{{T_{p} }}t} \right) $$
(27)

where \( \theta_{o} \) is the maximum closing angle, \( T_{p} \) is time period (time taken for one complete cycle of the valve operation) in seconds and \( t \) is time in seconds. Angle 0° corresponds to the fully opened position and angle 82° corresponds to the fully closed condition. Although valve angle range is 0–90°, \( \tau \) becomes effectively zero only at the valve angle 82°. In the blockage identification runs, valve angle (\( \theta \left( t \right) \)) was varied between 0° and 65°.

Prior to the transient or steady oscillatory experiments, a steady-state calibration is carefully done to obtain the valve head loss coefficient for different closing angles. Head loss at the valve is measured using a transducer located at the valve. The head loss coefficient is given by

$$ K_{V} = \frac{2g}{{V^{2} }}h_{L} $$
(28)

where \( V \) is the average steady velocity and \( h_{L} \) is the head loss through the valve during an initial steady state. The valve characteristics during a transient or a steady-oscillatory event are modelled using a non-dimensional parameter known as the effective valve opening \( \tau \), defined as [8] follows:

$$ \tau (t) =\frac {(C_{d} A)_{o} }{(C_{d} A)_{t} } $$
(29)

where \( C_{d} \) is coefficient of discharge of the valve and \( A \) is valve opening; ‘\( o \)’ refers to initial steady state and ‘\( t \)’ refers to the time level \( t \). The energy loss coefficient can be converted into an effective valve opening using the following relation:

$$ \tau \left( t \right) = \sqrt {\frac{{K_{o} }}{K}} $$
(30)

In Eq. (30), \( K_{o} \) is the loss coefficient for the steady-state conditions corresponding to the fully open valve. A regression equation (Eq. (31)) was developed between \( \theta \left( t \right) \) and \( \tau \) by determining the head loss values (\( K \)) for \( \theta \left( t \right) \) between 0° and 82°. Therefore, by knowing the valve angle position with time, the \( \tau \) value can be determined:

$$ \tau = - 2.56{\text{e}}^{ - 16} \theta^{10} + 1.19{\text{e}}^{ - 13} \theta^{9} - 2.37{\text{e}}^{ - 11} \theta^{8} + 2.67{\text{e}}^{ - 9} \theta^{7} - 1.84{\text{e}}^{ - 7} \theta^{6} + 8.00{\text{e}}^{ - 6} \theta^{5} - 2.14{\text{e}}^{ - 4} \theta^{4} + 0.003\theta^{3} - 0.027\theta^{2} + 0.074\theta + 1.00. $$
(31)

For field pipelines, area of the valve opening can be easily determined from valve opening angle \( \left( {\theta \left( t \right)} \right). \) Later, \( C_{d} \) value can be determined from the calibration curve supplied by the manufacturer and therefore \( \tau \) value can be determined using Eq. (29).

4.5b Laboratory experiments:

Steady-state calibration tests are conducted to determine the \( C_{c} \) values for blockage opening sizes 0.01 and 0.015 m. The \( C_{c} \) values are found to be 0.718 and 0.894, correspondingly. Based on the steady-state measurements, the friction factor of the pipe is estimated as 0.025 (for discharges of 0.000284, 0.000496 and 0.000405 m3/s). The wave speed considered in this study is 1200 m/s. The valve characteristic \( \tau_{o} \) = 0.8 at the full opening and the valve either progressively closes or opens with each movement equivalent to step \( \left( {\Delta \tau_{o} } \right) \) = 0.04.

Four experiments are carried out for single blockages. Two experiments are carried out for blockage opening size \( D_{bl} \) = 0.01 m and other two experiments are carried out for blockage opening size \( D_{bl} \) = 0.015 m. Details of these experiments are presented in table 2. Figure 8a and b compares the experimental pressure profile at the downstream end to the computed pressure simulated using MOC. The proposed methodology precisely estimated blockage locations, and the blockage opening sizes are estimated as 0.015 and 0.011 m, respectively, for the actual blockage opening sizes of 0.015 and 0.010 m.

Table 2 Details of experimental blockage detection runs.
Figure 8
figure 8

Experimental and simulated pressures for two blockage values: (a) \( D_{bl} \) = 15 mm for \( \theta_{o} \) = 60° and \( T_{p} \) = 122.40 s and (b) \( D_{bl} \) = 10 mm for \( \theta_{o} \) = 60° and \( T_{p} \) = 82.5 s.

Three experiments are carried out with two blockages in the pipeline. In these experiments, blockage opening sizes of 0.015 and 0.01 m are placed at 84.0 and 116.0 m, respectively. The \( C_{c} \) values are used as 0.718 and 0.894, respectively, for the blockages 0.015 and 0.010 m. Details of the experiments are presented in table 2. Figure 9a–c compares the experimental pressure profile at the downstream end to the computed pressure profile. The proposed methodology accurately estimates the blockage location, whereas the blockage opening sizes are estimated as 0.016 and 0.011 m for the blockage opening sizes of 0.015 and 0.010 m, respectively.

Figure 9
figure 9

Experimental and simulated pressures for two blockages of 15 and 10 mm for (a) \( \theta_{o} \) = 60°, \( T_{p} \) = 8.645 s, (b) \( \theta_{o} \) = 71.1°, \( T_{p} \) = 8.6485 s and (c) \( \theta_{o} \) = 71.5°, \( T_{p} \) = 10.8465 s.

5 Conclusions

The pressure response of a pipeline due to the steady oscillatory valve is influenced by the size and location of a blockage. In this paper, MOC is used in inverse setting with GA. The identification of the partial blockage size and the location by the proposed approach is very accurate with almost no error; however, the accuracy of the proposed method strongly depends on the accuracy of the mathematical modelling of the field pipe system. Also, this methodology works only for the non-harmonic flows.

It is observed that the deviation in pressure responses at the downstream valve due to a given blockage opening at different blockage locations is maximum for a specific amplitude and frequency of the steady oscillatory valve operation. For the piping system used in the simulations, generalized expressions for best amplitude and best frequencies are determined with respect to the constant reservoir heads for the single blockage and two blockages. To determine the applicability of the proposed method for the isolation of partial blockages, a non-dimensional variable is proposed, which should be greater than a threshold value. The proposed methodology is validated for both the single blockage and two blockages on a hypothetical simple pipeline system. Simulations are carried out for the detection of single blockage and two blockages with and without noise in the measurements. It is found that the proposed methodology can be used for up to 1% noise in the measurements without any error in estimating the partial blockage locations and sizes.

This new technique needs pressure monitoring at only one location in the piping system and has the advantage of not requiring the information on the transients in the pipeline prior to the formation of the blockage. The proposed methodology is also validated using the experiments on a laboratory pipeline for detection of single blockage and two blockages. The experimental results demonstrate that the location of the partial blockage and blockage opening size can be obtained with almost no error. Additional work is required for isolating more than two blockages in pipeline networks.