Next Article in Journal
Research on Electromagnetic Control Technology for the Roll Profile of Wide-Width Electrode Roll Press Rolls
Previous Article in Journal
Chemical Safety Inspection Path Optimization Problems Using Improved Multi-Objective Discrete Growth Optimization Algorithm
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Enhanced Leak Detection and Localization in Liquid Pipelines Using an Improved Extended Kalman Filter

1
College of Petroleum Engineering, Xi’an Shiyou University, Xi’an 710065, China
2
SUPCON Technology Co. Ltd., Hangzhou 310059, China
3
School of Science, Xi’an Shiyou University, Xi’an 710065, China
*
Authors to whom correspondence should be addressed.
Processes 2025, 13(5), 1447; https://doi.org/10.3390/pr13051447
Submission received: 14 March 2025 / Revised: 18 April 2025 / Accepted: 7 May 2025 / Published: 9 May 2025
(This article belongs to the Section Energy Systems)

Abstract

:
To address the challenges of accuracy and stability in current detection methods, this paper proposes an enhanced online leak detection and localization approach based on an improved pipeline flow model and the Extended Kalman Filter within the state-space method. By establishing a comprehensive pipeline flow model, the proposed method relies solely on flow and pressure data at both ends of the pipeline, while also accounting for noise interference from instrumentation. This allows for precise leak location identification and calculation of key parameters such as leak volume, pressure, and leakage coefficient. The study primarily focuses on the linearization of noise variation and the refinement of the leakage detection model. The proposed method incorporates noise dynamics throughout the entire nonlinear calculation process and utilizes the Jacobian matrix to achieve noise linearization. To improve the leakage model, the leakage position is replaced with pipeline length, and the fourth-order Runge–Kutta method is used to solve the resulting equations. Data simulations and experimental validation confirm the effectiveness and accuracy of the proposed method. The experimental results indicate that the relative error in leak localization is less than 2%, with an accuracy improvement of 1.4% and 1.5% compared to conventional methods.

1. Introduction

With the continuous expansion of the pipeline industry, the development and construction of oil and gas pipelines, as well as urban water supply systems, have accelerated, making the safe operation and management of pipelines increasingly important [1]. Once a pipeline leak occurs, it can lead to irreversible safety risks, casualties, environmental pollution, substantial economic losses, and serious consequences, significantly impacting society [2]. This highlights the growing importance of leak detection and isolation (LDI) technology [3].
LDI technology primarily functions by detecting changes in various variables caused by fluid leakage in pipelines. It monitors parameters such as sound, flow, temperature, and pressure to determine the presence of a leak [1,2,3,4,5]. Among the available LDI methods, approaches based on pipeline fluid models require only pipeline parameters, fluid properties, and real-time pressure and flow measurements. By solving flow equations, these methods can identify relevant leakage parameters and determine whether a leak has occurred [6,7]. A key advantage of this approach is that there is no need to add additional measurement equipment on the pipeline, with only the existing pressure gauge and flow sensors used. Moreover, it offers high calculation reliability and fast detection speed, making it widely adopted in factories and oil fields [8,9]. In addition, building on the fluid model framework [7,10,11], the state-space method combined with filtering techniques [12,13,14] can be used to estimate leakage parameters. This approach effectively mitigates measurement noise and enhances the accuracy of LDI [13,15,16].
Building on previous research, significant progress has been made in the field of leakage detection theory and its applications [8,17,18]. These methods primarily transform the partial differential equations governing pipeline flow into a state-space form, and then estimate leakage parameters using filtering techniques [19,20]. Delgado-Aguinaga [21] proposed a state observer method based on temperature effects and the extended Kalman filter (EKF). This approach applied leak detection technology to plastic pipes, examined the influence of temperature on pipe length, introduced a correction method for length variation, and considered the impact of these changes on leak parameter estimation. An experimental study was conducted to validate the method. Santos-Ruiz [14] proposed an EKF-based method that combines steady-state estimation and data fusion for pipeline leak detection and isolation. The LDI system was tested in real time using a data acquisition device implemented in a MATLAB R2017b environment. The method demonstrated effectiveness through online detection, localization, and quantification of non-concurrent leaks at various locations. Torres [17] introduced a classification method based on the Kalman filter (KF) and analyzed its application in pipeline leak detection and localization. The study emphasized the important role of leak detection in advancing KF-based computational pipeline monitoring systems. Jahanian [18] used the continuity and the momentum equations to derive the nonlinear equations of the system. EKF was employed for leak detection and localization, addressing the challenges of measurement and process noise. The filter demonstrated robustness to process noise, measurement inaccuracies, and parameter uncertainty, ensuring that the covariance of the state estimation error remains within acceptable bounds.
However, several challenges remain. One key issue is the error introduced when converting the pipeline system model into a state-space equation. While this error is small, it becomes more significant in long-distance pipeline systems, where even minor discrepancies cannot be overlooked. Additionally, for aging pipeline systems, the noise and fluctuations from long-term use pose a considerable challenge to accurate leak detection. These methods do not account for the variation of noise during the calculation process of EKF, but treat noise as a fixed data fluctuation. However, in real industrial applications, this approach is inadequate and can introduce significant errors. Another key problem lies in the numerical solution of partial differential equations, where the improved Euler method with second-order accuracy is used in the solution method, inevitably leading to further inaccuracies. To address these issues, this paper proposes a method that incorporates noise variation into the nonlinear model calculation process. The Jacobian matrix is used to linearize the noise matrix, transforming it from the control space to the state space, thereby mitigating errors caused by noise variation. Additionally, improvements are made to the leakage model and its solution method by employing the more accurate fourth-order Runge Kutta method. This reduces computational error and improves the accuracy of leak localization.

2. Materials and Methods

2.1. Pipeline Flow Model

The classical pipeline model is derived under several simplifying assumptions: the pipeline is straight with no additional equipment or branches, it is level (without slope), the fluid is incompressible, and the pipe’s cross-sectional area and fluid density remain constant. Temperature variations are also neglected [14]. Under these assumptions, the partial differential equation governing the transient fluid response is as follows:
Momentum equation:
q z , t t + g A h z , t z + f q 2 A d q z , t q z , t = 0
Continuity equation:
h z , t t + c 2 g A q z , t z = 0
where h(z,t) is the internal pressure of the pipe, indicated by the pressure head, m, q(z,t) is the pipeline flow rate, m3/s; z∈[0,L] is the pipe coordinate, m, t is the time coordinate, s, f(q) is the friction coefficient during fluid flow, d is the pipe diameter, m, A is the pipe’s cross sectional area, m2, c is the wave velocity, m3/s, and g is the acceleration due to gravity, m/s2.
Additionally, the boundary conditions are defined by the pressure and flow at both ends of the pipeline, expressed as follows:
h z = 0 , t = h i n t
h z = L , t = h o u t t
q z = 0 , t = q i n t
q z = L , t = q o u t t
It is worth noting here that these boundary conditions can be measured using pressure gauges and flow meters installed at both ends of the pipeline.
The friction coefficient plays a crucial role in the pipeline mathematical model, which is why this paper uses a variable friction coefficient to improve the accuracy of the calculations [19]. The formula for the friction coefficient is given by:
f q = 0.25 l o g 10 ε 3.7 d + 5.74 A ν q z , t d 0.9 2
where ε is the relative roughness of the pipe, and ν is the kinematic viscosity of the fluid, m2/s.

2.2. Pipeline Leakage Model

The pipeline leakage model is simplified as depicted in Figure 1, assuming a basic case with a single leakage point. In this model, h1 and q1 represent the pressure head and flow rate at the beginning of the pipeline, while h3 and q3 denote the pressure head and flow rate at the end of the pipeline. Additionally, h2, q2, and zL correspond to the pressure head, flow rate, and location of the pipeline leak, respectively. In theory, the leak could occur at any point along the pipeline, but for practical calculations, it is initially assumed to be near the midpoint. However, this assumption can be dynamically adjusted to accurately reflect the actual leak location.
In this model, the momentum and continuity equations are transformed into ordinary differential equations, which are easier to solve by discretizing the equations in the spatial variable z. The finite difference method is commonly used to solve these transient models. In this method [12], the difference quotient is used to approximate the partial differential, as shown below:
q z , t z Δ q z , t Δ z
In this study, the continuous pipeline is discretized into three points: {zk} = {0,zL,L}. After the leakage point is treated as a hole, the relationship between the pressure head at the leakage point and the leakage flow rate can be determined as:
q L = q 2 = λ h 2 , λ = C d A L 2 g
In Equation (9), considering the leakage flow rate q L = λ h z L , t , λ is the leakage coefficient. The dynamic leakage model [22] of the pipeline can be expressed as:
q 1 t = g A h 1 h 2 z L f q 1 2 A d q 1 q 1
h 2 t = c 2 g A q 1 q 3 λ h 2 z L
q 3 t = g A h 2 h 3 L z L f q 3 2 A d q 3 q 3
where: q 3 = q L , t , h 1 = h 0 , t , h 2 = h z L , t , h 3 = h L , t ;
q 1 = q 0 , t , q 3 = q L , t , h 1 = h 0 , t , h 2 = h z L , t , h 3 = h L , t
where zL represents the unknown leak location, and h2 is the pressure head at the leak point. h1 and h3 are considered known inputs (i.e., boundary conditions that can be measured), while q1, q3, zL, and h2 are the quantities to be calculated.

2.3. Leakage Detection Method Based on EKF

2.3.1. EKF Theory

The KF is an algorithm that utilizes a linear system state equation, along with the system’s input and output data, to estimate the system’s optimal state. Given that the observed data are typically contaminated with noise and interference, the process of optimal estimation can also be interpreted as a filtering process. Therefore, the KF is widely applied in both optimal estimation and filtering, though its application varies depending on the research objectives.
However, the flow state equation of a pipeline system is inherently nonlinear, which limits the direct application of the KF algorithm. To address this, the EKF is commonly employed in pipeline leak detection studies. For nonlinear systems, the EKF linearizes the nonlinear components by using a first-order Taylor expansion and neglecting second and higher-order terms, yielding an approximate linearized model. This model is then used with the KF for state estimation. The significance of the EKF lies in its ability to effectively handle PDE systems, such as those in pipeline flow models. It also efficiently manages the noise introduced by equipment, enabling optimal estimation of the system’s unknown states. These capabilities result in high computational accuracy when estimating pipeline leakage states, making EKF highly applicable in LDI systems.
The EKF algorithm consists of two main steps:
  • Prediction step:
State prediction:
x ¯ = f ( x , u )
where x denotes the state variable, u is the input matrix, and f ( x , u ) represents the process model.
Covariance prediction:
F = f ( x t , u t ) x x t , u t
P ¯ = F P F T + Q
where F represents the Jacobian matrix of the process model, P is the covariance of the prior state estimation error, P ¯ is the covariance of the next state estimation error, and Q is the covariance matrix of the process noise.
2.
Update step:
Optimal estimation:
H = h ( x t ¯ ) x ¯ x ¯ t
y = z h ( x ¯ )
x = x ¯ + K y
where H is the observation matrix, y is the output matrix, z is the measurement matrix, and K is the Kalman gain.
K = P ¯ H T ( H P ¯ H T + R ) 1
Covariance update:
P = ( I K H ) P ¯

2.3.2. Application of EKF in Leak Detection

As discussed in the previous section, the EKF serves as a state estimator for addressing nonlinear problems. In the context of pipeline leak detection, the pipeline model must be adapted to fit the state estimation form, and the essential parameters for the EKF algorithm need to be properly configured [18]. The main calculation can be outlined as follows:
In the pipeline leak detection problem, the boundary condition involves controlling the pressure at both ends of the pipeline. Consequently, the measured pressures at the ends of the pipeline are considered the input u to the EKF, while the measured flow rates at the ends of the pipeline are treated as the output y. This leads to the following relationships:
u = h i n , h o u t = h 1 , h 3 T
y = q i n , q o u t = q 1 , q 3 T
To design a discrete-time EKF for nonlinear models, the process model is derived from the pipeline leakage model. It is assumed that there is only one leak, and the diameter of the leak remains constant over time. The estimated parameters, including the leakage coefficient λ and the leakage location zL, are introduced, with λ ˙ = 0   a n d   z ˙ L = 0 . The state variables are defined as:
x = q 1 , h 2 , q 3 , z L , λ T
The extended model is expressed as:
x ˙ = x ˙ 1 x ˙ 2 x ˙ 3 x ˙ 4 x ˙ 5 = q ˙ 1 h ˙ 2 q ˙ 3 z ˙ L λ ˙ = = g A u 1 x 2 x 4 f x 1 2 A d x 1 x 1 c 2 g A x 3 x 1 x 5 x 2 x 4 g A x 2 u 2 L x 4 f x 3 2 A d x 3 x 3 0 0
In a more compact form, the model is represented as:
x ˙ = f x , u
Additionally, the model was simplified into ordinary differential equations, which are typically solved using numerical methods. In this paper, the solutions will be derived using the improved Euler method and the 4th-order Runge–Kutta method, with an evaluation of their accuracy. The calculation process is as follows:
The improved Euler method calculation formula is given by:
x k + 1 = x k + T s 2 f ( x k , u k ) + f ( x k + T s f ( x k , u k ) , u k
The 4th-order Runge–Kutta method calculation process is expressed as:
k 1 = f x n , y n k 2 = f x n + h 2 , y n + h 2 k 1 k 3 = f x n + h 2 , y n + h 2 k 2 k 4 = f x n + h , y n + h k 3 y n + 1 = y n + 1 6 k 1 + 2 k 2 + 2 k 3 + k 4
The state transition matrix is given by:
F = f x t , u t x x t , u t
The measurement model is given by:
y = H x + R y 1 y 2 = 1 0 0 0 0 0 0 1 0 0 x 1 x 2 x 3 x 4 x 5 + v 1 v 2
The observation matrix is given by:
H = h x t x x t = 1 0 0 0 0 0 0 1 0 0
The noise matrix is expressed as:
R = σ q 1 2 0 0 σ q 3 2
R represents the measurement covariance matrix, which is diagonal and accounts for the noise in the model’s output, that is, the noise originating from the measuring instrument. In the context of leakage detection, in this study, R is used to quantify the noise level of the flowmeters at both ends of the pipeline.
Additionally, input noise in the model must also be considered. Typically, the impact of noise is incorporated when calculating the covariance of the prior state estimation error, and Q is used to represent the covariance matrix of the process noise. The calculation is expressed as follows:
P = F P F T + Q
However, in a nonlinear model, the noise varies throughout the model’s computational process, making this approach unsuitable. To address this, an improved method for managing the influence of input noise is proposed. Since the motion model is nonlinear, it was linearized using the Jacobian matrix, denoted as V, to transform from control space to state space in the form VMVT. The Jacobian matrix V is given by:
V = f x , u u
This leads to an updated formula for calculating the covariance of the prior state estimation error:
P = F P F T + V M V T
The subsequent calculation process follows the EKF algorithm, as illustrated in Figure 2.

2.4. Enhancement of the EKF Algorithm with Steady-State Solution

During the practical application of leakage detection using the EKF algorithm, Delgado et al. [12,14] identified inaccuracies in the estimation of leakage location, which led to significant errors. To address this issue, this study proposes improvements to the EKF algorithm. The proposed solution assumes that the system is in a steady state both before and after leakage occurs, with the leakage size remaining constant.
In a steady-state leakage scenario, a substantial difference in flow rates from the start to the end point emerges post-leak. If the pipeline friction coefficients of both sections are assumed to be uniform, this assumption leads to discrepancies with the actual system, causing errors. Therefore, the friction coefficients of the two sections should be treated as distinct. Consequently, the flow model is revised as follows:
g A ( h 1 h 2 ) z L f ( q 1 ) 2 A d q 1 2 = 0
c 2 g A ( q 3 q 1 λ h 2 ) z L = 0
g A ( h 2 h 3 ) L z L f ( q 3 ) 2 A d q 3 2 = 0
By observing the three equations above, the first and third equations are solved simultaneously. Then, the results are substituted into the second equation. This results in the following expressions:
h 2 = f ( q 1 ) q 1 2 f ( q 3 ) q 3 2 L + 2 A 2 d g ( f ( q 1 ) q 1 2 h 3 f ( q 3 ) q 3 2 h 1 ) 2 A 2 d g f ( q 1 ) q 1 2 f ( q 3 ) q 3 2
z L = 2 A 2 d g h 1 h 3 f ( q 3 ) q 3 2 L f ( q 1 ) q 1 2 f ( q 3 ) q 3 2
λ = q 1 q 3 h 2
Furthermore, in the process of solving the leakage information using the EKF algorithm and steady-state method, a second improvement is proposed for the model. During the discretization of the leakage model within the continuity equation, zL should be replaced with the pipeline length L in the denominator of Equation (37). This adjustment holds significant physical meaning. For Equations (36) and (38), the momentum equation applies from the starting point to the leakage point, and the momentum equation is from the leakage point to the end point. On the other hand, the momentum equation in Equation (37) applies across the entire pipeline system as a continuity equation, representing mass conservation. Therefore, the denominator must reflect the flow conservation, and the numerator should account for the entire length of the pipeline, which justifies the replacement of zL with L. This modification resolves the computational error in the estimation of the pressure h2 at the leak and the leakage position zL.
In addition, the steady-state model solving step was incorporated into the EKF algorithm cycle. After obtaining the estimated state value based on the EKF filter and the steady-state solution of the dynamic leakage model, the next step is data fusion. Data fusion computes a moving weighted average of these two estimates, applying their respective variances as weighting factors. Specifically, the variance σ d 2 of the state value estimated by the EKF is continuously updated within the algorithm. On the other hand, the variance σ s 2 of the steady-state solution must be approximately calculated based on changes in the leakage at each time step. The data fusion equation is as follows:
x ^ = σ d 2 x ^ s + σ s 2 x ^ d σ d 2 + σ s 2
where x z L , q L represents the corrected value of data fusion for the leakage location and leakage amount, which differs from the previous state estimate. The decision fusion process between the EKF algorithm and the steady-state model is illustrated in Figure 3.

3. Results

To validate the correctness of the method discussed above, this paper employs two approaches: numerical simulation and practical experimentation, with detailed description provided below.

3.1. Numerical Simulation of Pipeline Leakage

3.1.1. Numerical Simulation of Pipeline Leakage Model

In this study, PipelineStudio V4.0.1 simulation software was utilized to establish the pipeline simulation model, as illustrated in Figure 4.
The model simulates a real 62 km water supply pipeline, with a pipeline diameter of 0.3 m and a leak diameter of 0.02 m. The fluid used in the simulation is water, with a density of 1000 m3/kg and a viscosity of 1.2 × 10−6 m2/s. Table 1 presents the pipe and fluid calculation parameters adopted in this investigation. Furthermore, the pipeline simulation model simplifies the pipeline station, pump station, valve, and other equipment, simulating pipeline leakage under simple conditions. It assumes that the pipeline has no diameter reduction, no elevation difference, no branches, etc. It is noted here that the model features a single pipeline with leakage occurring at the midpoint, with the leakage amount controlled via a leakage valve. Pipe1 and Pipe4 simplify the station process. The system detects only the pipeline between the outbound and inbound stations. Therefore, the pressure and flow required for detection correspond to the incoming and outgoing pressure and flow at the start of Pipe2 and the end of Pipe3, respectively, in the model.
It is important to note that the initial state estimation value corresponds to the approximate steady-state condition of the pipeline during operation, as described earlier. Therefore, the initial flow is set to the steady-state flow, the initial leakage pressure is assigned the average value of the pressures at both ends of the pipeline, and the initial leakage position is placed at the median point of the pipe length. The initial leakage coefficient is set to 0.002, with no deviation in the initial state. Table 2 presents the EKF algorithm parameter settings. The symbol σ denotes the data noise. Given that the data are simulated and exhibit good stationarity, the noise estimation method used is σ = x m a x x m i n / 6 . Since the pressure at the leak, the leakage position, and the leakage coefficient are the state variables to be estimated, noise cannot be directly estimated among these variables. However, the noise associated with leak pressure can be roughly estimated using the pressure noise at either the starting or end points. In this regard, the noise of the leakage position and leakage coefficient can also be roughly approximated, with minimal impact on the results.

3.1.2. Simulation with Results of Pipeline Leakage

The results of the pipeline leakage simulation experiment, using three different methods, are presented in Figure 5 and Table 3.

3.2. Practical Experiment and Results of Pipeline Leakage

3.2.1. Experimental Pipeline Leakage

The pipeline leakage experiment was conducted in the pipeline fluid laboratory, which serves as a research and teaching facility focused on pipeline transportation. The primary experimental equipment includes water tanks, centrifugal pumps, leakage valves, and data acquisition systems, as illustrated in Figure 6. The configuration of the experimental equipment and the corresponding data flow are presented in Figure 7. The relevant pipeline parameters are as follows: total pipeline length of 742.614 m, inner diameter of 36.8689 mm, wall thickness of 3.5 mm, and roughness of 0.04 mm. The pipeline features two leakage valves, located at 212.907 m and 616.589 m, respectively. Two leakage tests were conducted at these points. A summary of the main experimental equipment is presented in Table 4.
Experimental process:
Step 1: Fill the water tank to approximately 40% of its capacity, ensuring the liquid level reaches about 1 m. Next, activate the data acquisition system on the server to monitor the fluid flow process, then open the pipeline valve accordingly.
Step 2: Start the centrifugal pump at the outlet of the water tank and allow the fluid to flow through the entire pipeline and into water tank2.
Step 3: Once the flow has stabilized, record the pipeline flow data. Open leakage valve1 to initiate a simulated leak experiment, adjusting the leak size as needed. Wait for the data to stabilize, and then record the leak data and close the valve.
Step 4: After completing the leak experiment, wait for the system to stabilize before repeating Step 3. Multiple leakage simulation tests can be conducted as requested.
Step 5: Turn off the centrifugal pump, close the valve, and shut down the server.

3.2.2. Experiment and Results of Pipeline Leakage

In the first leakage experiment, after the laboratory equipment was powered on and the system stabilized, leak valve 2 was opened at 240 s to facilitate continuous leakage. The calculation results obtained from the three methods are presented in Figure 8 and Table 5.
The experimental procedure for the second leak is identical to that of the first; however, the operating status, leak location, and leak volume differ. At 240 s, leak valve 1 was opened to initiate continuous leakage. The calculation results obtained from the three methods are shown in Figure 9 and Table 6.

4. Discussion

As shown in Figure 5 and Table 3, during the simulation experiment for pipeline leakage, the steady-state model yields a high average accuracy in its calculated results. However, it exhibits significant fluctuations, a high degree of noise, and lacks stability. The error in leakage position for the steady-state model [14] is 2.733%. The EKF [19] algorithm, on the other hand, has a leakage position error of 1.195%. While this error is larger compared to the steady-state model, the EKF algorithm benefits from considering noise, which results in more stable and less fluctuating data. In this regard, the improved method, which combines the advantages of steady-state model and EKF algorithm has the advantages of both the steady-state model and the EKF algorithm, shows reduced fluctuations and higher accuracy. It is noted that the leakage position error in the improved method is only 0.833%.
Moreover, in the first leakage experiment, the leak detection results for the three methods are shown in Figure 8. A comparison of these calculation results is shown in Table 5. The leakage location estimates for the steady-state model, EKF algorithm, and improved method are 650.213 m, 597.692 m, and 606.349 m, respectively, with corresponding errors of 4.528%, 2.545%, and 1.378%, respectively. Additionally, the leakage pressure head estimates are 9.184 m, 8.318 m, and 8.517 m, with errors of 6.483%, 3.561%, and 1.255%, respectively. The calculated leak flow is 0.632 m3/s, 0.568 m3/s, and 0.583 m3/s, with errors of 6.194%, 4.537%, and 2.068%, respectively. Finally, the calculated leak coefficients are 0.216, 0.196, and 0.198, with errors of 6.691%, 3.223%, and 1.891%, respectively.
The leak detection calculation results for the three methods examined in this study are presented in Figure 9. A comparison of the calculation results for the three examined methods and the real values is presented in Table 6. The calculated leakage locations for the steady-state model, EKF algorithm, and improved method are 246.193 m, 195.652 m, and 203.185 m, with corresponding errors of 4.482%, 2.324%, and 1.309%, respectively. The calculated leakage pressure head values are 17.656 m, 16.219 m, and 16.523 m, with errors of 5.049%, 3.502%, and 1.691%, respectively. The leak flow rate calculations are 1.058 m3/s, 0.962 m3/s, and 0.976 m3/s, with errors of 5.702%, 3.886%, and 2.458%, respectively. Finally, the calculated leak coefficients are 0.263, 0.238, and 0.241, with errors of 7.824%, 2.482%, and 1.201%, respectively.
In the experiment comparing the three methods, the calculation accuracy of leakage detection is shown in Figure 10. As illustrated, the minimum accuracy for the steady-state method, the EKF algorithm, and the improved method are 92.21%, 91.14%, and 97.50%, respectively, while the average accuracy values are 95.39%, 96.60%, and 98.73%, respectively. It is evident that the proposed method achieves the highest accuracy, with an increase in average accuracy of 3.34% and 2.13% compared to the steady-state and EKF methods, respectively. This improvement is due to the fact that the improved method fully accounts for the influence of noise in the model and algorithm calculations, reducing errors caused by noise propagation. Additionally, the use of higher-order methods to solve the model further minimizes errors, resulting in the highest overall accuracy.
In addition, the average calculation time for the three methods was compared in the experiment, as shown in Figure 11. As seen from the figure, the average calculation time for the steady-state method is 137.53 s, for the EKF algorithm is 521.41 s, and for the improved method is 617.67 s. Among these, the steady-state method has the shortest calculation time, as it only requires solving the model equations. In contrast, the EKF algorithm, which is based on the model equation, incorporates the improved Euler method for equation solving, followed by prediction and update steps of the EKF state, significantly increasing the calculation process and, thus, the calculation time. The improved method in this paper has the same complexity as the other methods, but uses the fourth-order Runge–Kutta method to solve the equations, which adds extra calculation steps and increases the overall time. For the analysis of the equation complexity, the single-step complexity of the steady-state method is O (m), where m is the number of variables in the differential equation. The EKF has a complexity of tangu (2m), and the improved method in this paper has a complexity of tangu (4m). Therefore, while the improved method increases both the calculation time and complexity, the calculation time still meets the requirements for practical factory applications.

5. Conclusions

This paper proposed an online leak detection and localization method based on a pipeline flow model and the EKF algorithm. By establishing both the steady-state and transient models for pipeline leakage, the partial differential equations were simplified to ordinary differential equations, which were then transformed into state space form. Leakage parameters were estimated using the EKF algorithm. To enhance the accuracy of leakage detection and address the error propagation issues caused by noise fluctuations during the calculation process, an improved method was introduced. A key aspect of this improvement is the management of input noise by linearizing the noise matrix using the Jacobian matrix. The method for solving the equations was upgraded, and the fourth-order Runge–Kutta method was used to increase accuracy. Numerical simulations and laboratory leakage experiments were conducted to validate the accuracy of the proposed method. The results show that the leakage location estimation error remains within 2%. The average precision was improved by 3.34% and 2.13%, respectively. Overall, the proposed method in this paper demonstrated strong performance in leak detection.
However, this study has limitations. It does not consider the difference between experimental and actual leakage events, nor does it consider the effect of the shape of the leakage hole on the flow. The model also does not incorporate factors such as elevation changes, branch pipelines, and multi-point leakage, which are important in real-world engineering or factory scenarios, including equipment failure, maintenance, intermittent oil transportation, network failures, and other accidents. The method is currently applicable only to single-pipeline, single-point leakage cases, and performs well under the simple and stable operation of the pipeline system. Future research could explore whether implicit discrete solution methods for the pipeline model could enhance both the stability and accuracy of the leak detection process, while also taking into account the computational efficiency of the algorithm. Furthermore, the detection of multi-point pipeline leaks remains an underexplored area, offering a promising avenue for future study. Additionally, integrating traditional pipeline modeling techniques with modern machine learning methods for leak detection presents another worthwhile direction for further investigation. In order to obtain efficient, stable, and accurate leakage detection system, the goal is to reduce the workload of factory personnel and enhance safety in production.

Author Contributions

Conceptualization, Y.L. and S.W.; Methodology, Y.L., Q.G. and W.X.; Software, Y.L. and W.X.; Validation, Q.G.; Formal analysis, Q.G.; Investigation, Q.G.; Resources, Q.G.; Data curation, W.X.; Writing—original draft, Y.L.; Writing—review & editing, Y.L.; Visualization, S.W.; Supervision, W.X. and S.W.; Project administration, W.X. and S.W.; Funding acquisition, S.W. All authors have read and agreed to the published version of the manuscript.

Funding

The authors gratefully acknowledge the financial support provided by the Natural Science Foundation of Shaanxi Province (No. 2023-JC-YB-597).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author(s).

Conflicts of Interest

Author Qiao Guo was employed by the company SUPCON Technology Co. Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
EKFExtended Kalman Filter
LDILeak detection and isolation
KFKalman Filter
PDEPartial Differential Equation

References

  1. Ahmad, Z.; Nguyen, T.-K.; Rai, A.; Kim, J.-M. Industrial Fluid Pipeline Leak Detection and Localization Based on a Multiscale Mann-Whitney Test and Acoustic Emission Event Tracking. Mech. Syst. Signal Process. 2023, 189, 110067. [Google Scholar] [CrossRef]
  2. Wang, J.; Ren, L.; Jia, Z.; Jiang, T.; Wang, G. A Novel Pipeline Leak Detection and Localization Method Based on the FBG Pipe-Fixture Sensor Array and Compressed Sensing Theory. Mech. Syst. Signal Process. 2022, 169, 108669. [Google Scholar] [CrossRef]
  3. Zhang, L.; Jiang, H.; Zhang, J.; Chen, H.; Lu, H.; Li, J.; Hu, Z.; Xie, K. Acoustic Model for Leak Detection of Water Supply Pipeline. J. Pipeline Syst. Eng. Pract. 2024, 14, 153–168. [Google Scholar] [CrossRef]
  4. Sekhavati, J.; Hashemabadi, S.H.; Soroush, M. Computational Methods for Pipeline Leakage Detection and Localization: A Review and Comparative Study. J. Loss Prev. Process Ind. 2022, 77, 104771. [Google Scholar] [CrossRef]
  5. Behari, N.; Sheriff, M.Z.; Rahman, M.A.; Nounou, M.; Hassan, I.; Nounou, H. Chronic Leak Detection for Single and Multiphase Flow: A Critical Review on Onshore and Offshore Subsea and Arctic Conditions. J. Nat. Gas Sci. Eng. 2020, 81, 103460. [Google Scholar] [CrossRef]
  6. Zhang, L.; Lin, W. Trend Detection and Adaptive Removal in Pressure Signal for Pipeline Leak Monitoring. IEEE Sens. J. 2024, 23, 19815–19822. [Google Scholar] [CrossRef]
  7. Doshmanziari, R.; Khaloozadeh, H.; Nikoofard, A. Gas Pipeline Leakage Detection Based on Sensor Fusion under Model-Based Fault Detection Framework. J. Pet. Sci. Eng. 2020, 184, 106581. [Google Scholar] [CrossRef]
  8. Rahiman, W.; Wu, B.; Ding, Z. Fault Detection Using High Gain Observer: Application in Pipeline System; The University of Manchester: Manchester, UK, 2008. [Google Scholar]
  9. Adegboye, M.A.; Fung, W.-K.; Karnik, A. Recent Advances in Pipeline Monitoring and Oil Leakage Detection Technologies: Principles and Approaches. Sensors 2019, 19, 2548. [Google Scholar] [CrossRef] [PubMed]
  10. Lin, P.; Kang, X.; Huang, R. Numerical Simulation Based on a Weakly Compressible Model in the Multi-Elbow Pipe. Front. Energy Res. 2024, 10, 954632. [Google Scholar] [CrossRef]
  11. Henrie, M.; Carpenter, P.; Nicholas, R.E. Real-Time Transient Model–Based Leak Detection; Elsevier: Amsterdam, The Netherlands, 2016; pp. 57–89. [Google Scholar]
  12. Delgado-Aguiñaga, J.A.; Santos-Ruiz, I.; Besançon, G.; López-Estrada, F.R.; Puig, V. EKF-Based Observers for Multi-Leak Diagnosis in Branched Pipeline Systems. Mech. Syst. Signal Process. 2022, 178, 109198. [Google Scholar] [CrossRef]
  13. Uilhoorn, F.E. State-space estimation with a Bayesian filter in a coupled PDE system for transient gas flows. Appl. Math. Model. 2015, 39, 682–692. [Google Scholar] [CrossRef]
  14. Santos-Ruiz, I.; Bermúdez, J.R.; López-Estrada, F.R.; Puig, V.; Torres, L.; Delgado-Aguiñaga, J.A. Online Leak Diagnosis in Pipelines Using an EKF-Based and Steady-State Mixed Approach. Control Eng. Pract. 2018, 81, 55–64. [Google Scholar] [CrossRef]
  15. Arifin, B.M.S.; Li, Z.; Shah, S.L. Pipeline Leak Detection Using Particle Filters. IFAC-PapersOnLine 2015, 48, 76–81. [Google Scholar] [CrossRef]
  16. Anjana, G.R.; Kumar, K.R.S.; Kumar, M.S.M.; Amrutur, B. A Particle Filter Based Leak Detection Technique for Water Distribution gSystems. Procedia Eng. 2015, 119, 28–34. [Google Scholar] [CrossRef]
  17. Torres, L.; Jiménez-Cabas, J.; González, O.; Molina, L.; López-Estrada, F.-R. Kalman Filters for Leak Diagnosis in Pipelines: Brief History and Future Research. J. Mar. Sci. Eng. 2020, 8, 173. [Google Scholar] [CrossRef]
  18. Jahanian, M.; Ramezani, A.; Moarefianpour, A.; Shouredeli, M.A. Gas Pipeline Leakage Detection in the Presence of Parameter Uncertainty Using Robust Extended Kalman Filter. Trans. Inst. Meas. Control 2021, 43, 2044–2057. [Google Scholar] [CrossRef]
  19. Delgado-Aguiñaga, J.A.; Besancon, G.; Begovich, O.; Carvajal, J.E. Multi-Leak Diagnosis in Pipelines Based on Extended Kalman Filter. Control Eng. Pract. 2016, 49, 139–148. [Google Scholar] [CrossRef]
  20. Hou, Q.; Zhu, W. An EKF-Based Method and Experimental Study for Small Leakage Detection and Location in Natural Gas Pipelines. Appl. Sci. 2019, 9, 3193. [Google Scholar] [CrossRef]
  21. Delgado-Aguinaga, J.; Besancon, G.; Begovich, O. Leak isolation based on Extended Kalman Filter in a plastic pipeline under temperature variations with real-data validation. In Proceedings of the 2015 23rd Mediterranean Conference on Control and Automation (MED), Torremolinos, Spain, 16–19 June 2015; IEEE: Piscataway, NJ, USA, 2015; pp. 316–321. [Google Scholar]
  22. Navarro-Diaz, A.; Alejandro Delgado-Aguinaga, J.; Santos-Ruiz, I.; Puig, V. Real-Time Leak Diagnosis in Water Distribution Systems Based on a Bank of Observers and a Genetic Algorithm. Water 2022, 14, 3289. [Google Scholar] [CrossRef]
Figure 1. Schematic diagram of the pipeline single point leakage model.
Figure 1. Schematic diagram of the pipeline single point leakage model.
Processes 13 01447 g001
Figure 2. General scheme of the EKF algorithm.
Figure 2. General scheme of the EKF algorithm.
Processes 13 01447 g002
Figure 3. Decision fusion scheme between EKF and steady-state model.
Figure 3. Decision fusion scheme between EKF and steady-state model.
Processes 13 01447 g003
Figure 4. Pipeline leakage model simulation diagram.
Figure 4. Pipeline leakage model simulation diagram.
Processes 13 01447 g004
Figure 5. Comparison of leakage detection results for three methods.
Figure 5. Comparison of leakage detection results for three methods.
Processes 13 01447 g005aProcesses 13 01447 g005b
Figure 6. Physical drawings of laboratory piping and equipment.
Figure 6. Physical drawings of laboratory piping and equipment.
Processes 13 01447 g006
Figure 7. Schematic diagram of experimental equipment and data flow.
Figure 7. Schematic diagram of experimental equipment and data flow.
Processes 13 01447 g007
Figure 8. Comparison of leak detection calculation results from three methods in the first leak.
Figure 8. Comparison of leak detection calculation results from three methods in the first leak.
Processes 13 01447 g008
Figure 9. Comparison of leak detection calculation results from three methods in the second leak.
Figure 9. Comparison of leak detection calculation results from three methods in the second leak.
Processes 13 01447 g009
Figure 10. Comparison of leak detection calculation accuracy employing the three methods examined.
Figure 10. Comparison of leak detection calculation accuracy employing the three methods examined.
Processes 13 01447 g010aProcesses 13 01447 g010b
Figure 11. Comparison of computing time for the methods.
Figure 11. Comparison of computing time for the methods.
Processes 13 01447 g011
Table 1. Pipeline and fluid parameters.
Table 1. Pipeline and fluid parameters.
Pipeline ParameterValue
Pipeline diameter0.3 m
Pipeline length60 km
Pipe1 and Pipe4 length1 km
Pipe2 length20 km
Pipe3 length40 km
Leak valve diameter0.02 m
Roughness6.9859 × 10−5 m
Fluid density1000 m3/kg
Fluid viscosity1.2 × 10−6 m2/s
Acceleration due to gravity9.8 m/s2
Wave velocity1000 m/s
Table 2. EKF algorithm parameter settings.
Table 2. EKF algorithm parameter settings.
EKF ParameterValue
Estimate state x [0.1, 275, 0.1, 30,000, 0.002]
Error covariance matrix P P = d i a g 1,1 , 1,1 , 1
Covariance matrix of process noise Q Q = d i a g σ q 1 2 , σ h 2 2 , σ q 3 2 , σ z 2 , σ λ 2
Covariance matrix of measurement noise R R = d i a g σ q 1 2 , σ q 3 2
Table 3. Comparison of mean value calculation results after pipeline leakage.
Table 3. Comparison of mean value calculation results after pipeline leakage.
MethodLeakage Position (m)Leakage Pressure Head (m)Leak Flow (m3/s)Leak Coefficient
(10−4)
Real value20,000227.90.03282.379
Steady-state model20,474.667225.70.03202.321
EKF algorithm20,238.933207.70.03192.273
Improved method20,166.667228.00.03252.325
Table 4. Main equipment used in the experiment.
Table 4. Main equipment used in the experiment.
DeviceSpecifications and ModelManufacturer or Version
Centrifugal PumpCR10-5GRUNDFOS, Bjerringbro, Denmark
Electric Regulating ValveEV-409CUN25RPTGRAT, Wuhan, China
Pressure SensorBP93420-IXHengtong Electronic Ltd., Baoji, China
Flow SensorPROMASS FEndress+Hauser, Reinach, Switzerland
LAN SwitchS2326TP-EIHUAWEI, Shenzhen, China
Communication Module6ES7 341-10H02-OAE0SIEMENS, Nürnberg, Germany
PLC Programming SoftwareSIMATIC ManagerV5.5
SCADA System Configuration SoftwareSIMATIC WinCC ExplorerV7.0.3.0
SCADA ServerIBM System x3400M3, Intel E5506 2.13 GHzIBM, New York, NY, USA
Table 5. Comparison of calculation results for the three methods and the real values from the first leakage experiment.
Table 5. Comparison of calculation results for the three methods and the real values from the first leakage experiment.
MethodLeakage Position (m)Leakage Pressure Head (m)Leak Flow (m3/s)Leak Coefficient
(10−4)
Real value616.5898.6250.5950.202
Steady-state model650.2139.1840.6320.216
EKF algorithm597.6928.3180.5680.196
Improved method606.3498.5170.5830.198
Table 6. Comparison of calculation results for the three methods and the real values from the second leakage experiment.
Table 6. Comparison of calculation results for the three methods and the real values from the second leakage experiment.
MethodLeakage Position (m)Leakage Pressure Head (m)Leak Flow (m3/s)Leak Coefficient
(10−4)
Real value212.90716.8071.0010.244
Steady-state model246.19317.6561.0580.263
EKF algorithm195.65216.2190.9620.238
Improved method203.18516.5230.9760.241
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Liu, Y.; Guo, Q.; Xie, W.; Wang, S. Enhanced Leak Detection and Localization in Liquid Pipelines Using an Improved Extended Kalman Filter. Processes 2025, 13, 1447. https://doi.org/10.3390/pr13051447

AMA Style

Liu Y, Guo Q, Xie W, Wang S. Enhanced Leak Detection and Localization in Liquid Pipelines Using an Improved Extended Kalman Filter. Processes. 2025; 13(5):1447. https://doi.org/10.3390/pr13051447

Chicago/Turabian Style

Liu, Yuan, Qiao Guo, Wenhao Xie, and Shouxi Wang. 2025. "Enhanced Leak Detection and Localization in Liquid Pipelines Using an Improved Extended Kalman Filter" Processes 13, no. 5: 1447. https://doi.org/10.3390/pr13051447

APA Style

Liu, Y., Guo, Q., Xie, W., & Wang, S. (2025). Enhanced Leak Detection and Localization in Liquid Pipelines Using an Improved Extended Kalman Filter. Processes, 13(5), 1447. https://doi.org/10.3390/pr13051447

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop