Martín Di Blasi, REPSOL-YPF, C.F., Argentina;
Carlos Muravchik, Laboratorio de Electrónica Industrial, Control e Instrumentación (LEICI), UNLP, Argentina;
and Renan Martins Baptista, PETROBRAS R & D Center, rio de Janeiro, RJ, Brazil
A novel leak localization method for multi-section pipelines has been developed that is based on normal pressure drop patterns along the pipeline. The system continuously compares the measured pressure drops, and makes a decision based on the best fit to find the section where a leak can occur.
The method uses steady-state fluid equations, a recursive parameter estimation algorithm, and statistical decision and pattern recognition techniques. A modification has been introduced to consider the cost of making a wrong leaky section choice in terms of the excess volume spilled due to gravitational flow after pipeline shut down. This leads to a Bayesian decision scheme minimizing a risk functional. The costs are the spill volumes, obtained from dynamical simulation of the pipeline, under the various possible decision scenarios.
This system was recently used to look for leaks on a 500-km (roughly 310-mi), 32-in. crude oil pipeline. Findings from this effort and data obtained from a simulated leak experiment illustrate how the system can be used to find and locate leaks, and verify pipeline integrity.
Measuring flow and pressure
This new approach is based on the measurement of flow and pressure, typically included in the pipeline monitoring instrumentation. These measurements are normally contaminated by noise, calling for a statistical signal processing approach that stands on simple physical modeling.
The leak localization problem was solved in two steps. In the first step, the leaky section is found by means of a new pattern classification approach. In the second step, the location of the leak within the faulty section is estimated. The approach used for the latter step is adapted from the method of the break in the pressure profile.
The simplicity of the required calculations allowed an implementation on the company’s existing control and supervision systems of a 3,000-km (roughly 1,800-mi) pipeline system. This real-time implementation runs on the same programmable logic controllers (PLCs) that perform the regulation of the pumping stations.
Figure 1 shows the piezometric head or hydraulic pressure profile of a seven-segment pipeline. This shows a normal operating condition. It also depicts the steady-state profile after a leak in the fourth segment appeared, hence modifying the profile of all downstream segments. The jumps are due to the pressure steps generated by the pumping stations. While these are realistic profiles, the normal random noise or perturbations are not shown. Once the leakage has settled down, the loss of charge in the segments, from the fourth segment and moving downstream, decreases with regard to normal operating conditions. This occurs because the flow rate decreases due to the leak.
Note that it is possible to see that the leak is in the fourth segment, since this is the area where the differences with the normal profile start. The flow downstream of the leak point is smaller than it was before the fault began; hence the loss of pressure in those segments is smaller than under normal operation. It is apparent that an analysis of the time variations in the loss of pressure profiles must be quite relevant to localize the leaky segment of pipeline. Observe that instrument noise and perturbations obscure the present picture, and tend to mask the changes induced by the leak.
In this process, the following notation was employed:
A Pipeline internal cross-sectional area
D Pipeline internal diameter
f Darcy Weisbach friction factor
g Gravity acceleration
H Hydraulic grade line
L Pipeline segment length
Re Reynolds Number
Q Pipeline segment bulk flow rate
v Pipeline segment flow velocity
r Density
H1 Head of the segment’s receiving point
H2 Head of the segment’s sending point
e Pipeline internal rugosity
(INSERT IMAGE) Head loss due to friction in the i-th segment
(INSERT IMAGE) Incoming flow to the i-th segment
(INSERT IMAGE) Outgoing flow of the i-th segment
(INSERT IMAGE) Friction factor based on the incoming flow to the i-th segment
(INSERT IMAGE) Friction factor based on the outgoing flow of the i-th segment
(INSERT IMAGE) Probability density of leak being in segment Tk given the measured pressure discrepancy E
Vjk Spill volume at segment j, using contingency plan for segment k
Pressure discrepancies
Consider a pipeline of length L with only one product flowing in steady state, at a flow rate Q, as depicted in Figure 2. Let H1 be the head at the receiving point, H0 be the head at sending point; ?H denotes the head loss due to friction; with all three discounting the contribution of the altimetry.
The head gradient can be calculated from the Darcy-Weisbach formula:
(INSERT EQUATION) (1)
(INSERT EQUATION) (2)
The friction factor f(Re) may be theoretically calculated for a full circular pipe when the rugosity of the internal pipe wall or roughness height is known, by means of the Swamee-Jain formula:
(INSERT EQUATION) (3)
or with the help of the Colebrook-White iterative formula:
(INSERT EQUATION) (4)
This factor can also be estimated in real time from flow and pressure measurements. This is the approach that was employed in this study.
In order to make comparisons between the head loss before and after a leak occurs, the constant factor relating ?H and Q2 will be estimated for each segment. These equivalent factors, which differ by a constant of the previous friction factor, are defined for each pipe segment, and for each of the input and output flowrates to the segment as follows:
(INSERT EQUATION) (5)
where the index i ranges through all pipeline segments.
The head loss ?Hi is calculated using the aspiration and discharge pressures in the pumping stations, corrected by the altimetry. The factor f1i[n]corresponds to a friction factor as if the flow-rate in the whole i-th segment were constant and equal to the flow entering the upstream side of the segment. Similarly, f2i[n]assumes the flow-rate is constant and equal to the output flow in the downstream of the segment. While in normal operating condition, denoted by the superindex (.)0, the input and output flows to any segment are equal Q01i= Q02i thus, f1i[n]= f2i[n]for all i.
Both flows Q01i and Q02i are determined from the segment upstream and downstream of the pumping station. However, when the segment is in a leak condition, the equivalent factors differ. Indeed, assume that there is a leak in the i-th section and denote the flows with the superindex (.)1. Once the pipe is in steady state, the input flows in segments that are downstream with respect to the leak are smaller than in normal operating condition. Then:
(INSERT EQUATIONS) (6)
Similarly, when considering the output flows of each segment,
(INSERT EQUATION) (7)
Observe the key difference in the i-th segment.
Now, from (5) it is seen that real-time estimation of the equivalent friction factors can be realized by means of any recursive parameter estimation algorithms, such as recursive least squares [5], with ?Hi as measurements and Q1[n]and Q2[n] as regressors.
Taking as flow measurements those in the upstream end Q1 and in the downstream end of the segment Q2, the discrepancies of Type 1 and Type 2 are defined as follows:
(INSERT EQUATION) (8)
Under normal operating condition,
(INSERT EQUATION) (9)
where Q1i and Q2i are assumed to be measured with none or small error; and w[n] and v[n] are random sequences that concentrate the unmodeled random errors not present in Darcy’s formula, measurement noise, etc. Then, it can be assumed that
(INSERT EQUATION) (10)
thus, ?H becomes a random process with mean and variances given by
(INSERT EQUATION) (11)
A model with a time varying ?w2 is not justified because the localization of the leaky segment can be done with a short record of data. Within this time frame, the constancy of the factors causing the variations of ?H is a reasonable assumption. In addition, the recursive least squares algorithm may incorporate a suitable forgetting factor that permits an operator to discard old data and perform the estimation based on recent information.
Therefore, in normal operating conditions, the expected value of the discrepancies is given by:
(INSERT EQUATION) (12)
Recall that the friction factors f1i and f2i are recursively estimated minimizing E[e21i] and E[e22i].
However, under a leakage in one of the pipe’s segments, the recursive estimation must be halted so that the estimation algorithm does not mask evidence of a leak. This calls for a simultaneous leak detection scheme, which is also a requirement for the pipeline monitoring system. As will be explained later, under a leak condition, the expected value of the discrepancies is not null.
Vectors of pressure discrepancies are defined, grouping the individual segment discrepancies as follows:
(INSERT EQUATION) (13)
and
(INSERT EQUATION) (14)
Leak localization patterns
A leakage in a pipeline segment modifies the pressure discrepancy vectors defined in (13) and (14) in a unique and characteristic way for each segment, due to (6) and (7). This pattern of the discrepancy vectors is described below and is used to find the leaking segment.
Assume a sectional pipeline with N segments with a leak in the p-th one. The segments upstream of the leaky one, , the leak pattern is the average of the discrepancies,
(INSERT EQUATION) (15)
then
(INSERT EQUATION) (16)
because for Q1j = Q2j. 1? j ? p
For the leaky segment itself (j=p, of length Lp), i.e. assuming the leak appeared at the distance Lx from the upstream end, 0<Lx<Lp; the discrepancy given the condition that the leak is in the p-th segment at Lx is:
(INSERT EQUATION) (17)
If this is the only segment in leak, Q1p = Q1 and Q2p = Q2 then
(INSERT EQUATION) (18)
Observe that (18) assumes that Lx is given, that is (18) actually is E{e1p[n]/Lx}. To remove this conditioning, and obtain the unconditional pattern, one must average out with respect to Lx
(INSERT EQUATION) (19)
A-priori assuming that the leak in a segment is uniformly distributed in the segment length,
(INSERT EQUATION) (20)
For the segments that are downstream with respect to the leaky one (j > p)
(INSERT EQUATION) (21)
But now Q1j = Q2j, then
(INSERT EQUATION) (22)
The same line of reasoning is applied to the Type 2 discrepancy vector. Finally, the Type 1 and Type 2 patterns are given by:
(INSERT EQUATION) (23)
(INSERT EQUATION) (24)
Identifying the leak
The methodology to identify the leaking segment consists in finding the vector of discrepancies that best approximates one of the leak patterns. This is done with a typical pattern classification technique, measuring the geometric (Euclidean) distance between the vector of discrepancies (13)-(14) and the vector representing the pattern (23)-(24). Therefore, let the distances to the patterns of the j-th segment be
(INSERT EQUATION) (25)
Thus, a leakage in the p-th segment is declared when
(INSERT EQUATION) (26)
Theoretically, it would suffice using any one of the sets of discrepancies E1or E2 . Using both vectors simultaneously enables an operator to take advantage of all the available information that must produce a decrease of the classification errors. Once the leaking segment is found, the localization problem becomes similar to the case of having a single-segment pipeline.
Using head profiles
Localization of the leak within a leaking segment can be done by the method of break of piezometric profiles. A leak in a pipeline induces a discontinuity in the flow profile, causing a decrease downstream the leak point. Similarly, the leak originates a break in the hydraulic gradient as illustrated in Figure 3. The break in the profile occurs because the loss of pressure due to friction is smaller downstream the leak point, where the flow is smaller than upstream.
With (1) relating flow and hydraulic gradient it is possible to design an estimator of the leak position Lx. In the normal operating state:
(INSERT EQUATION) (27)
but when there is a leak in Lx
(INSERT EQUATION) (28)
Operating with (28) Lx can be written as
(INSERT EQUATION) (29)
Equation (29) relates the loss of pressure and the input and output flows with the leak position. In this way, it is possible to use measurable variables at both ends of the segment to estimate the leak location. Observe that using (29) assumes that the friction factor is known. This is not much of a problem, since it has been recursively estimated during the segment location stage.
The Reynolds number is a function of viscosity and flow-rate of the fluid, which change with time in an operating pipeline. As an example, to know the Reynolds number in a pipeline that carries several products in consecutive batches requires tracking their position in the pipe and the composition of the different batches.
Spill volume considerations
There is a cost associated to a leak that can be measured in terms of the spill volume. The causes are 1) volume spilled until leak detection; 2) volume spilled until the pumps are shutdown and block valves are closed; 3) volume spilled due to the gravitational flow. The latter may largely contribute the dominant portion. The best system performance is achieved by minimizing this cost.
For each of the seven segments of the chosen pipeline, hydraulic transient simulation techniques were used to devise suitable contingency plans. The best set of actions (line-valve closure and pumping station shut-down) after leak detection was determined in a way that minimizes total spill volume. If a leak occurs in segment Tj and its contingency plan is executed, the expected spill volume is denoted Vjj . But if the segment is not accurately located and Tk is chosen, a different contingency plan is executed. Here, the expected spill volume becomes Vjk >Vjj.
This cost information will be incorporated to the automatic segment localization strategy, modifying the pattern classification scheme. For that purpose, consider the classical Bayes detector [8] where the risk or average spill volume is computed for all possible leaky segment choices. Let E={E[1],...,E[L]} be the measured set of L discrepancy vectors used to choose the leaking segment. The risk associated to this discrepancy vector when the leak is truly in segment j is
(INSERT EQUATION) (30)
Given that the vector E is observed, the Bayes classificator decides that the leak occurs in segment Tp when
(INSERT EQUATION) (31)
If all the spill volumes Vjk were equal or in the event of not considering them at all, the classificator becomes the minimum Euclidean distance.
It is possible to show that the classifier decides that the leaky segment is Tp, following the rule (31), where:
(INSERT EQUATION) (44)
It can be seen that this expression depends not only on the Euclidean distances but also on the spill volumes in the right and wrong decisions.
A simulated case
The case discussed here corresponds to a seven-segment oil pipeline 500-km (roughly 310-mi), 32-in. diameter system that transports an average daily volume of 53,000 cubic meters. The pipeline has seven sections within pumping stations.
Figure 4 illustrates the evolution of the average estimated friction factors defined as:
(INSERT EQUATION) (45)
The various batches of transported product are easily distinguished from the changes in fi[n]. The recursive estimation of fi[n] from pressure and flow measurements permits tracking these changes and having a permanently updated factor.
An experiment was generated under real conditions producing a simulated leak, by deriving the fluid to a tank. This leak is in the fourth segment, at a position 30 km from the upstream end of the segment. The equivalent leak size is of 30% the normal operating flow.
Conclusions
The methodology presented here has been implemented on a 3,000-km (roughly 1,800-mi) pipeline network, and has been tested several times with satisfactory results. It is easy to implement as real-time algorithms integrated to other control functions in the pumping stations. In addition, it is clearly understood by control room operators.
The proposed system was programmed on the same PLCs used in the pumping stations to control normal operation. Thus, it could be programmed by the same personnel maintaining the SCADA system. A set of visualization screens were developed that are integrated to the rest of the monitoring and routine control of the pipeline.
While deriving the present approach, several simplifications were introduced that deserve a more extensive evaluation. In the first place, the piezometric head profiles are not exactly linear – or constant slope – in pipelines carrying multiple fluids. Each product causes a different frictional loss of charge as a function of its viscosity and Reynolds number. Therefore, the present analysis can only be seen as approximate.
When it comes to determining the leaking segment, the said simplification is less important than when locating the leak within the segment. This is because in segment determination, only the total loss of charge is used and this is quite well inferred from the measurements at the ends of the segment. It is not the case in leak location within the segment, where the estimates may improve introducing the loss of charge of each product using a profile with several slopes.
Some other details are currently under consideration such as the incorporation of flow measurement errors that may cause some bias in the estimates; a different a-priori distribution for the leak point; and using Mahalanobis distance rather than Euclidean, when the present covariance model for the noises is too crude.
Editor’s Note: This work was performed while Martín Di Blasi was employed with Repsol-YPF. He now holds a position in the Hydraulic Design-Business Development Engineering Department of Enbridge Pipeline Inc., Edmonton, Alberta.
Acknowledgment
Based on the paper “Pipeline Leak Localization using Pattern Recognition and a Bayes Detector (IPC2006-10211),”presented at the 6th International Pipeline Conference, Calgary, Alberta, Canada.
Recommended Reading
US Drillers Cut Oil, Gas Rigs for Third Week in a Row, Baker Hughes Says
2024-08-30 - The rig count is 8% below this time last year, according to Baker Hughes.
Helix Awarded Vessel Service, Charter Contracts Off Brazil
2024-08-28 - Helix Energy Solutions Group was awarded new three-year charter and service contracts, valued at an estimated $786 million, from Petrobras for Siem Helix 1 and Siem Helix 2.
Shell, Akselos Enter Enterprise Deal for Structural Performance Management
2024-08-28 - Shell Information Technology International will leverage Akselos’ structural performance management software to monitor the health and lifecycle of Shell’s critical assets in Qatar, Canada, the Gulf of Mexico and elsewhere.
From Exxon to APA, E&Ps Feel Need to Scratch Exploration Itch
2024-08-27 - Exxon Mobil is looking for its “next Permian,” which an executive said could be in Algeria.
E&P Highlights: Aug. 26, 2024
2024-08-26 - Here’s a roundup of the latest E&P headlines, with Ovintiv considering selling its Uinta assets and drilling operations beginning at the Anchois project offshore Morocco.