# A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines

^{*}

## Abstract

**:**

## 1. Introduction

^{3}volumetric losses of liquid oil from Canada’s international and interprovincial oil pipelines. Detecting all leaks is an ongoing challenge, and the pipeline industry is highly motivated to enhance the current leak detection technologies and develop new ones.

_{0}), friction factor (f), wave speed (a), pipe length (L) and diameter (D), was developed for the purpose of characterizing the pipelines and simplifying the uncertainty analysis. Pipelines with identical R values were found to have the same hydraulic behavior. Uncertainties in the variables that are components of R factor were shown to have equal impact on leak detectability. Pipeline systems with low R values can generally tolerate higher uncertainties compared to those with high R values. Liou and Tian [13] compared two solution techniques of the water hammer equations and found that the Cauchy algorithm can tolerate more uncertainty in R factor compared to the time-marching algorithm. As these findings were based on pattern recognition, their applicability to other prevailing leak detection algorithms needs further investigation. API 1149 was updated in 2015 [14] and provided a framework to assess the effect of uncertainties on a full range of computational pipeline monitoring methods currently in use. The uncertainties associated with SCADA systems were also included, but the impact on leak detectability was evaluated with a simple mass balance method which may not be applicable to the more sophisticated real-time transient model-based leak detection systems.

## 2. Methodology

#### 2.1. Leak Detection System

_{1}is the penalty associated with the errors in measured pressure and flow rate; (${P}_{i}^{M}$ − ${P}_{i}^{A}$) and (${Q}_{i}^{M}$ − ${Q}_{i}^{A}$) are the adjustments Statefinder made to the measured pressure and flow rate at sensor location i, i.e., the variables to be optimized; ${REP}_{i}^{P}$ and ${REP}_{i}^{Q}$ are the repeatability of the pressure transmitters and flow meters and are used to calculate the constraints of the pressure and flow rate adjustments. The repeatability is estimated as the expected errors in the measured pressure and flow rate; W

_{1}and W

_{2}are the tuning weights assigned to pressure and flow rate measurements, respectively. A smaller weight indicates a higher level of uncertainty, and Statefinder assigns a lower penalty when making adjustments to the relevant variables [15]:

_{2}is the penalty associated with the errors in modelled pressure drop due to friction; W

_{3}is the corresponding tuning weight; FPDC

_{i}is a correction coefficient applied to the friction factor f of pipe segment i and it is the variable to be optimized. The constraint on FPDC

_{i}is calculated by Statefinder and is a function of flow rate and a user-specified parameter called VER which describes the amount of error in fluid viscosity [15]:

_{3}is the penalty associated with the errors in the rate of change of the modelled pressure, the friction correction coefficient, and the bulk modulus correction coefficient BMC. BMC is a variable to be optimized and is constrained by BMC

_{a,i}, which is the maximum allowed bulk modulus correction in the simulation for pipe segment i; Δt is time step and subscript prev represents the value at the previous time step; W

_{4}, W

_{5}, and W

_{6}are the corresponding tuning weights:

_{4}is the penalty associated with the error that cannot be explained by the above-mentioned uncertainties and thus may be induced by a leak, and W

_{7}is the corresponding tuning weight. DF

_{i}is defined as the “diagnostic flow” in pipeline segment i; if negative, indicates that fluid is being removed from the modelled pipeline [15]. Leak detection is often based on a volume imbalance, which is calculated by integrating DF over a period of time, or time window. Volume imbalance is typically monitored in different time windows (e.g., 5 min, 1 h, and 24 h), with smaller windows targeted to detect large leaks quicker and larger windows targeted to detect smaller leaks [17]. This is because in a longer time window, the volume imbalance caused by a small leak steadily increases and becomes distinguishable from the volume imbalance caused by uncertainties. In this study, volume imbalance in a one-hour time window was used to quantify leak detectability. A dimensionless volume imbalance (DVB) was defined as volume imbalance divided by the volume of fluid leaked out over 1 h. This allowed different testing scenarios with different sizes of leaks to be compared.

#### 2.2. Simulated Leak Test

#### 2.3. Study Pipeline

^{3}, viscosity of 4.57 mPa·s, and bulk modulus of 1.45 GPa was carried by the pipeline. Flow rate and pressure measurements were assumed to be available at both the upstream and downstream ends of the pipeline (Figure 1).

#### 2.4. Sources of Uncertainty

_{3}) was set to 1, which was the smallest value among all the tuning weights. W

_{1}and W

_{2}were set to 1 in all cases. This is because when “measured” data contain data noise, adjustment to the “measured” data is desirable and Statefinder was penalized less for making such an adjustment. The bound for the adjustment was determined by the sensor repeatability. For perfect data cases, repeatability of all sensors was set to be zero; thus, no adjustments to the measured pressures or flow rates would be made regardless of the values of W

_{1}and W

_{2}. In the cases where error was introduced randomly in any uncertainty sources, the tuning weights were set similar to those used in real pipelines. Measurements, friction, and bulk modulus were considered the most likely uncertainty sources; thus, W

_{1}, W

_{2}, W

_{3}, and W

_{6}were all set to 1. W

_{7}was set to the second smallest value (5) so that Statefinder assigned a lower penalty when generating diagnostic flow to account for the leak. Higher penalties were assigned to the rate of change for pressure and friction by setting W

_{4}to 10 and W

_{5}to 500.

## 3. Results and Discussion

#### 3.1. Uncertainty in R Factor

#### 3.1.1. Viscosity Uncertainty

_{c}is the friction factor after Statefinder adjusts it. As a result, the case with +20% error in R factor (i.e., +20% error in f) required an FPDC of 0.1667 while the case with −20% error in R factor (i.e., −20% error in f) required an FPDC of −0.25 in order to adjust the friction factor to the correct value. Therefore, the case with −20% error required more correction than the +20% error case in order to make full correction. The constraint on FPDC is calculated by Statefinder and is a function of the flow rate and VER, a-user specified parameter that is greater or equal to zero [15]. VER can be increased so that full correction can be made to the friction factor.

#### 3.1.2. Bulk Modulus Uncertainty

_{c}is the wave speed after correction. The bound for BMC is set by a constraint parameter called BMER and cannot exceed 0.5 [15]. Realistic errors of ±10% in bulk modulus were introduced to the leak detection system. It was found that the bulk modulus error only marginally affected leak detectability during steady state operating conditions. This is because the error in wave speed only affects transient cases, and the transient wave caused by a small leak (e.g., 5% leak) was of small magnitude. Leak detection times changed by less than ±1% compared to the baseline case when bulk modulus correction was disabled in Statefinder. Therefore, only results under transient operating conditions are discussed here. For all transient cases, BMER was set to allow Statefinder to fully correct the bulk modulus error. This required BMER to be 0.058 for +10% error and 0.078 for −10% error. Figure 4 shows the effect of bulk modulus errors on leak detectability in an R = 2.20 system with perfect data. For the case with a +10% error in bulk modulus, the DVB curve collapsed onto the baseline curve. However, for the case with a −10% error in bulk modulus, the DVB curve deviated from the baseline even though full correction was allowed. The leak was detected 4.9 and 7.0 min later than the 24.9 and 26.1 min with the baseline for flow decrease and increase transients, respectively.

#### 3.2. Uncertainty in Supervisory Control and Data Acquisition Data

#### 3.3. Low R System vs. High R System

#### 3.4. Random Uncertainty Sources

## 4. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- National Energy Board. Safety Performance Portal. Available online: https://www.neb-one.gc.ca/sftnvrnmnt/sft/dshbrd/index-eng.html (accessed on 10 October 2016).
- Geiger, G. State-of-the-art in leak detection and localization. Oil Gas Eur. Mag.
**2006**, 32, 193–198. [Google Scholar] - Po, A.; Xing, Y. Internal Free Swimming Pipeline Leakage Detection Technology—Smartball. In Proceedings of the International Conference on Pipelines and Trenchless Technology, Xi’an, China, 16–18 October 2011; American Society of Civil Engineers: Reston, VA, USA, 2011; pp. 996–1005. [Google Scholar]
- National Energy Board. Onshore Pipeline Regulations; SOR/99-294; Minister of Justice: Calgary, AB, Canada, 2010.
- Province of Alberta. Pipeline Act; Alberta Queen’s Print: Edmonton, AB, Canada, 2014; p. 32.
- American Petroleum Institute. Computational Pipeline Monitoring for Liquids; American Petroleum Institute Report 1130; American Petroleum Institute: Washington, DC, USA, 2002. [Google Scholar]
- Liou, C.P. Pipeline Leak Detection and Location. In Proceedings of the International Conference on Pipeline Design and Installation, Pipeline Division, American Society of Civil Engineers, Las Vegas, NV, USA, 24–29 September 1990. [Google Scholar]
- Al-Khomairi, A. Leak Detection in Long Pipelines Using the Least Squares Method. ASCE J. Hydraul. Res.
**2008**, 46, 392–401. [Google Scholar] [CrossRef] - He, G.; Liang, Y.; Li, Y.; Wu, M.; Sun, L.; Xie, C.; Li, F. A Method for Simulating the Entire Leaking Process and Calculating the Liquid Leakage Volume of A Damaged Pressurized Pipeline. J. Hazard. Mater.
**2017**, 332, 19–32. [Google Scholar] [CrossRef] [PubMed] - Al-Zahrani, M. Modeling and Simulation of Water Distribution System: A Case Study. Arab. J. Sci. Eng.
**2014**, 39, 1621–1636. [Google Scholar] [CrossRef] - Duan, H.F. Uncertainty Analysis of Transient Flow Modeling and Transient-based Leak Detection in Elastic Water Pipeline Systems. Water Resour. Manag.
**2015**, 29, 5413–5427. [Google Scholar] [CrossRef] - American Petroleum Institute. Pipeline Variable Uncertainties and Their Effects on Leak Detectability; American Petroleum Institute Report 1149; American Petroleum Institute: Washington, DC, USA, 1993. [Google Scholar]
- Liou, C.P.; Tian, J. Leak Detection—Transient Flow Simulation Approaches. ASME J. Energy Resour. Technol.
**1995**, 117, 243–248. [Google Scholar] [CrossRef] - American Petroleum Institute. Pipeline Variable Uncertainties and Their Effects on Leak Detectability; American Petroleum Institute Report 1149; American Petroleum Institute: Washington, DC, USA, 2015. [Google Scholar]
- DNV GL Group. Stoner Pipeline Simulator (SPS) 9.9.0 Help and Reference; DNV GL Group: Hong Kong, China, 2012. [Google Scholar]
- Wylie, E.B.; Streeter, V.L. Fluid Transient in Systems; Prentice Hall: Englewood Cliffs, NJ, USA, 1993; ISBN 10:0139344233. [Google Scholar]
- Canadian Standards Association. Z662-07 Oil and Gas Pipeline Systems: Annex E: Recommended Practice for Liquid Hydrocarbon Pipeline System Leak Detection; Canadian Standards Association: Mississauga, ON, Canada, 2007; pp. 388–392. [Google Scholar]
- Vinh, P. Adding Value to CPM Testing; American Petroleum Institute Pipeline Conference and Cybernetics Symposium: Phoenix, AZ, USA, 2012. [Google Scholar]
- Modisette, J. State Estimation of Pipeline Models Using the Ensemble Kalman Filter; Pipeline Simulation Interest Group (PSIG): Prague, Czech Republic, 2013; p. 31. [Google Scholar]
- Arifin, B.; Li, Z.; Shah, S.L. Pipeline Leak Detection Using Particle Filters. IFAC PapersOnLine
**2015**, 48, 76–81. [Google Scholar] [CrossRef] - Hung, D.; Mokamati, S. A Novel Approach to Leak Sensitivity Testing of Computational Pipeline Monitoring Systems for Hydrocarbon Liquid Pipelines with Hydraulic Simulators. In Proceedings of the 11th International Pipeline Conference, Calgary, AB, Canada, 26–30 September 2016. [Google Scholar]
- Pabon, S. Sensitivity Study of a Computer Model Based Leak Detection System in Liquid Pipelines. Master’s Thesis, University of Alberta, Edmonton, AB, Canada, 2015. [Google Scholar]

**Figure 2.**Effect of uncertainty in R factor on leak detectability in a system with R = 2.20 for a flow decrease transient: (

**a**) perfect data; and (

**b**) noisy data. Arrows in (

**a**) indicate the interception between the threshold line and the DVB curve.

**Figure 3.**Effect of viscosity error on leak detectability in a system with R = 2.20 with 1% Gaussian noise: (

**a**) flow decrease; and (

**b**) flow increase.

**Figure 4.**Effect of bulk modulus error on leak detectability in a system with R = 2.20 with perfect data: (

**a**) flow decrease; (

**b**) flow increase.

**Figure 5.**BMC behaviour for flow decrease transient initiated at: (

**a**) the downstream end; and (

**b**) upstream end with perfect data.

**Figure 6.**Effect of bulk modulus error on leak detectability with exact and excessive BMER in a system with R = 2.20 with perfect data.

**Figure 7.**Effect of bulk modulus error on leak detectability in a system with R = 2.20 with 1% Gaussian noise: (

**a**) flow decrease; and (

**b**) flow increase.

**Figure 8.**Effect of time skew on leak detectability in a system with R = 2.20 with perfect data (sensors contain a 10-s time skew): (

**a**) flow decrease; and (

**b**) flow increase.

**Figure 9.**Effect of time skew on leak detectability in a system with R = 2.20 with noisy data (sensors contain a 10-s time skew): (

**a**) flow decrease; (

**b**) flow increase; and (

**c**) steady state.

**Figure 10.**Delayed leak detection time for the 500 cases with random uncertainties under flow decrease conditions in systems where: (

**a**) R = 0.49; and (

**b**) R = 2.20.

**Figure 11.**Delayed leak detection time for the 500 cases with random uncertainties under steady state conditions in systems where: (

**a**) R = 0.49; and (

**b**) R = 2.20.

Variable | Variable Value | Equivalent Error in R | ||||
---|---|---|---|---|---|---|

Lower | Base | Upper | Lower | Base | Upper | |

Viscosity (mPa·s): R = 2.20 system | 1.31 | 4.57 | 11.53 | −20% | 0 | +20% |

Viscosity (mPa·s): R = 0.49 system | 1.69 | 4.57 | 9.85 | −20% | 0 | +20% |

Bulk modulus large (GPa) | 0.86 | 1.45 | 3.31 | +20% | 0 | −20% |

Bulk modulus realistic (GPa) | 1.30 | 1.45 | 1.59 | +3.5% | 0 | −3.0% |

Flow Condition | Pressure Sensor with Time Skew | Flow Meter with Time Skew |
---|---|---|

Steady State (with leak) | US | none |

none | DS | |

US | DS | |

Flow Decrease | none | US |

none | DS | |

DS | None | |

DS | US | |

DS | DS | |

Flow Increase | US | None |

none | US | |

none | DS | |

US | DS | |

US | US |

Variables | Range of Uncertainty | Tested Values |
---|---|---|

Viscosity | 1.31–11.53 mPa·s | random |

Bulk modulus | 1.30–1.59 GPa | random |

Data noise | - | 1%, 2% |

Time skew | - | 5 s, 10 s |

Polling time | - | 5 s, 10 s |

**Table 4.**Tuning weights in Statefinder for single error and random error scenarios: W

_{j}(j = 1–7) are weights assigned to measured pressure and flow rate, friction, rate of change of pressure, friction, and bulk modulus, and diagnostic flow, respectively. SCADA: supervisory control and data acquisition.

Tuning Weights | Viscosity Error | Bulk Modulus Error | SCADA Error | Random Error |
---|---|---|---|---|

W_{1} | 1 | 1 | 1 | 1 |

W_{2} | 1 | 1 | 1 | 1 |

W_{3} | 1 | 10^{7} | 10^{7} | 1 |

W_{4} | 10 | 10 | 10 | 10 |

W_{5} | 500 | 10^{7} | 10^{7} | 500 |

W_{6} | 10^{7} | 1 | 10^{7} | 1 |

W_{7} | 5 | 5 | 5 | 5 |

Data Type | Variable | Flow Condition | Level of Uncertainty | Baseline Detection Time (Minutes after Leak Starts) | Change in Detection Time (Min) | ||
---|---|---|---|---|---|---|---|

R = 0.49 | R = 2.20 | R = 0.49 | R = 2.20 | ||||

Perfect Data | Bulk Modulus | Flow Decrease | +10% | 24.2 | 24.9 | 0.7 | 0.0 |

−10% | 1.7 | 4.9 | |||||

Flow Increase | +10% | 24.5 | 26.1 | 0.5 | 0.0 | ||

−10% | 1.4 | 7.0 | |||||

Steady State | +10% | 24.4 | 25.5 | 0.05 | 0.2 | ||

−10% | −0.05 | −0.2 | |||||

Time Skew | Flow Decrease | 10 s | 24.2 | 24.9 | 2.5–3.9 | 0.6–3.1 | |

Flow Increase | 10 s | 24.5 | 26.1 | 0.8–2.2 | 0.5–3.3 | ||

Steady State | 10 s | 24.4 | 25.5 | 0.0 | 0.0 | ||

Noisy Data | Viscosity ^{1} | Flow Decrease | −20% f | 31.1 | 33.1 | −1.8 | −4.5 |

+20% f | 0.2 | 0.5 | |||||

Flow Increase | −20% f | 55.5 | 61.7 | −22.6 | −34.2 | ||

+20% f | 1.3 | 0.1 | |||||

Steady State | −20% f | 39.8 | 41.7 | −8.7 | −15.2 | ||

+20% f | 0.5 | −0.3 | |||||

Bulk Modulus | Flow Decrease | +10% | 31.1 | 33.1 | 0.1 | −1.0 | |

−10% | 0.4 | 4.9 | |||||

Flow Increase | +10% | 55.5 | 61.7 | 0.0 | −4.6 | ||

−10% | 1.3 | 7.1 | |||||

Steady State | +10% | 39.8 | 41.7 | 0.05 | 0.2 | ||

−10% | −0.02 | −0.3 | |||||

Time Skew | Flow Decrease | 10 s | 31.1 | 33.1 | 28.0 | 35.0 | |

Flow Increase | 10 s | 55.5 | 61.7 | Undetected | Undetected | ||

Steady State | 10 s | 39.8 | 41.7 | Undetected | Undetected |

^{1}Viscosity error was introduced to obtain ±20% error in the friction factor f.

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Lu, Z.; She, Y.; Loewen, M.
A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines. *Energies* **2017**, *10*, 1226.
https://doi.org/10.3390/en10081226

**AMA Style**

Lu Z, She Y, Loewen M.
A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines. *Energies*. 2017; 10(8):1226.
https://doi.org/10.3390/en10081226

**Chicago/Turabian Style**

Lu, Zhe, Yuntong She, and Mark Loewen.
2017. "A Sensitivity Analysis of a Computer Model-Based Leak Detection System for Oil Pipelines" *Energies* 10, no. 8: 1226.
https://doi.org/10.3390/en10081226