Application of average pressure method in locating partial blockage of gas pipeline

In this paper, the applicability of average pressure method in the localization of partial blockage of gas pipeline was studied. It was proposed to transform the localization of partial blockage into a parameter optimization problem. Three optimization algorithms of PSO, GA and SAA were used to analyze the working conditions of 10 groups of laboratory experiments. The result shows that the combination of average pressure method and optimization algorithm has a strong propert in this location problem.


Introduction
Pipeline is the main way of natural gas transportation. In order to meet the national strong demand for natural gas, the total mileage of natural gas pipeline in China has increased year by year. By the end of 2020, 86,000 km of natural gas pipelines have been built [1] . Gas impurity deposition, corrosion product aggregation, hydrate formation and so on can lead to the occurrence of partial blockage. The existence of partial blockage will lead to the decrease of pipeline transportation efficiency and pigging ball blockage, which can directly lead to the functional failure of the whole pipeline system in serious cases. In 2005, hydrate blockage occurred in the seabed natural gas pipeline of Boxi oil and gas field, and then pigging ball blockage occurred in the process of pigging. In 2009, the Moxi-Xiaoxi segment of the gas transmission pipeline in the north inner ring of Sichuan Province was blocked due to accumulation of liquid and dirt, pigging ball damage and pipeline deformation, etc., resulting in the suspension of the Moxi-Nonglin segment.
The accumulation of blockage material is a gradual process, which also makes the operating parameters of the pipeline in the initial phase of partial blockage little different and therefore difficult to monitor. Once a complete blockage is formed, the pipeline will stop carrying immediately. Therefore, it is of great significance to carry out research on pipeline partial blockage positioning technology to ensure the stable operation of pipeline system [2] .
At present, locating Technology of Gas Pipeline blockage mainly includes [3][4] : (1)Stress-Strain detection method: According to the different strain variables of the plugging point and the normal pipeline under the same stress to locate the partial blockage. This method is expensive because of the need to dig pipes.
(2)X-Ray detection method: X-ray transmission imaging technology is used to locate the partial blockage, without the need to dig the pipeline, but the cost of this method is still expensive.
(3)Acoustic Dtection method: Locate partial blockage according to pipe echo signal, but the acoustic transmission ability is limited and the positioning ability is poor.
(4)Positive/Negative pressure wave detection method: Locate partial blockage through artificial manufacture of positive/negative pressure waves and analysis of echo signal, but a lot of noise exist in the echo signals, so it is necessary to use noise reduction method to process the pressure signal.
However, the average pressure method is simple in operation and very cheap. Combined with the parameter calibration and optimization algorithm, it can realize the rapid and accurate positioning of partial blockage [5] . In this paper, the average pressure method is used to study the positioning technology of partial blockage in gas transmission pipeline.

Analysis of partial blockage
When partial blockage occurs, pipeline running condition as shown in Figure 1 blow. The pressure at the starting point of the pipeline is increasing continuously; The pressure at the partial blockage point decrease abruptly due to the throttling effect; The pressure at the end of the pipeline is decreasing continuously. In addition, the existence of partial blockage lead to the reduction of gas flow [6] . After a period of time, the pressure and flow of the pipeline reached a stable state again, but it had deviated from the normal working condition.
Because of the existence of partial blockage, the pressure difference between the start and end points of the pipeline increases from ΔP 1 to ΔP 2 . By setting the threshold of ΔP change, it can be determined whether the pipeline is in the working state of partial blocking.

The principle of average pressure method
The core of the average pressure method is to locate the partial blockage by analyzing the changes of the pipeline inventory under the "shut-in" condition and the normal condition. As shown in Figure 2 blow. The starting point pressure of the pipeline rises to PQ 2 because of the existence of partial blockage. At the same time, the end point pressure drops to PZ 2 . Finally, both of the starting point pressure and end point pressure achieve stability. Under steady condition, the pressure, flow rate and inventory along the pipeline are also unchanged. Quickly close the start and end valves and perform a "shut-in" test. As a result of pipe segments before and after the partial blockage point are connected, the pressure along the pipeline will be automatically balanced and reach a stable value P_ average . When the pressure is stable, the pressure at all points of the pipeline are equal to P_ average [7] . After "shut-in" test, the inventory calculated by using P_ average . is recorded as the actual pipe inventory V c , and the pipe inventory calculated by integrating the pressure distribution curve along the pipeline is recorded as the theoretical pipe inventory V. Both V c and V satisfy the equation V c = V.
The pressure distribution along the gas pipeline can be calculated by equation (1).
In the above equation, Q is the volume flow of the pipeline, m 3 /s; C n is constant; D is the inner diameter of pipeline, m; Z is the gas compression factor; Δ is the relative density of gas; T is the pipeline operating temperature, K; L is the length of pipeline, m; PQ is the starting point pressure of pipeline, Pa; PZ is the end point pressure of the pipeline, Pa. For normal pipelines, the pressure distribution curve is the same whether the starting pressure or the end pressure is used. The existence of partial blockage makes the flow rate of the pipeline decrease continuously. At this time, the pressure distribution curve along the pipeline calculated using the starting point and the end point pressure does not coincide, the above calculation result as two pressure distribution curves, PQ 2 -PZ'and PQ'-PZ 2 , as shown in Fig. 2. The actual pressure distribution along the pipeline is shown as PQ 2 -A-C-PZ 2 curve.
After the "shut-in" test, the actual pipe inventory V c can be calculated by equation (2).
In the above equation, V c refers to actual pipe inventory, m 3 ; V gd is the pipeline volume, m 3 ; P 0 is the engineering standard condition pressure, 101325Pa; T 0 is engineering standard condition temperature, 293.15K; Z 0 is the air compression factor under engineering standard condition; Z is the compressibility factor of actual gas.
V c can be expressed as the rectangular area enclosed by P_ average and the coordinate axis. V is obtained by integrating the pipe length with the pressure distribution curve. The integral area is different due to the different plugging position. For example, the corresponding pipe inventory at 1,2 blockage positions is 0-PQ 2 -A-C-PZ 2 -L and 0-PQ 2 -B-D-PZ 2 -L shadow area. As shown in Fig. 2, the difference between the two integral areas is A-B-D-C. The point corresponding to the V which is the same as the calculation result of Vc is the partial blockage point.

Technical route
According to the above analysis, the partial blockage locating process can be equivalent to a parameter optimization problem. The variable to be optimized is the location of particial blockage point, the optimization objective function is the integral area of the pressure distribution curve V, and the optimal value of the objective function is the actual pipeline gas inventory volume Vc after the "shut-in" test. As shown in Equation In the above equation, a is the gas volume conversion parameter; l is the partial blockage point, km; L is the length of pipe, km; For this one variable optimization problem, it can be solved by modern optimization algorithm. Particle Swarm Optimization (PSO) algorithm has simple principle, fast calculation speed and strong adaptability, and is widely used to solve optimization problems. The principle of PSO algorithm is as follows: For the optimization problem with N independent variables, M particles are generated in the search space first, and the fitness of each particle is calculated. Then, each particle updates its own speed and direction of motion according to its own fitness optimal value Pbest and global fitness optimal solution Gbest, so as to constantly search for the optimal value. The updating relation of particle velocity and position is shown in (4).
In the above equation, V t i and X t i are the search speed and spatial position of the ith particle at time t ; c 1 and c 2 are the learning factors of the particle's own optimal fitness value and the overall optimal fitness value, respectively; w is the inertia weight of the particle itself; r 1 and r 2 are random numbers.
In this paper, PSO is mainly used to solve the optimization, and other optimization algorithms like Genetic Algorithm(GA),Simulated Annealing Algorithm (SAA) are used to compare. Based on the above analysis, the technical route of partial blockage locating technology is shown in Fig. 3:   Fig. 3. Technical route of partial blockage locating technology

Data Sources
The experimental data came from the Pipeline Network Simulation Comprehensive Laboratory of Xi 'an Shiyou University. The process of the experimental equipment is shown in Figure 4, and the equipment parameters are shown in Table 1.  The experimental medium is air. The air is first pressurized by the compressor, then removed by the airwater filter, and finally enters the PU pipe. The partial blockage can be simulated by adjusting the throttle valves opening at 95m and 190m of the pipeline. Running data of start and end point pressure, flow and temperature are collected by PLC equipment in real time.
First, the two throttle valves were fully opened for normal working conditions test to obtain the required PQ 0 and PZ 0 . These two parameters can then be used to check the roughness of the pipeline. Then adjust the opening of the two throttle valves respectively to simulate the partial blockage situation. Read the PQ 2 and PZ 2 after the pressure at the beginning and end of the pipeline is stable. PQ 2 and PZ 2 are used in combination with equation (1) to calculate the two theoretical pressure distribution curves. After the above operations were completed, a "shut-in" test on the pipeline is performed and the average pressure P_ average can be obtained. In this experiment, 5 separate tests were carried out on partial blockage points 1 and 2. Experimental data are shown in Table 2. Ten experiments were performed on the same day, when the air temperature was 23℃.

Analysis of calculation results
The parameters of PSO algorithm are set as follows: the total number of particle swarm is 50, the maximum number of iterations is 100, and the parameters w, c 1 and c 2 are 0.5, 0.6 and 0.6 respectively. All the calculation processes in this paper are realized through the software named MATLAB2019a. The loacting results of the three algorithms for the two partial blockage points are shown in Table 2. Three conclusions can be drawn from the analysis of the above calculation result:(1)From the locating result of the three algorithms, it can be seen that the idea of combining the average pressure method with the optimization algorithm is suitable for the locating problem of partial blockage;(2)The principles of the three algorithms are different, so there are differences in searching ability and searching time for the optimal value of partial bockage point. As can be seen from Table 3, the performance of PSO algorithm is the best method among the above three algorithms;(3)The existence of errors may be related to factors such as equipment aging, water is not filtered clean, closing the valve slowly. Eliminating these error sources can further improve the locating accuracy.

Conclusion and prospects
This paper studies the characteristic of pressure distribution along the gas transmission pipeline under the condition of partial blockage and the application of average pressure method in the locating of partial blockage. Average pressure method can locate the partial blockage point only by measuring the pipeline operation data under normal condition, partial blockage condition and "shut-in" condition. It does not need to collect realtime pipeline operation data and data denoising. This method is simple and easy to implement. On the basis of theoretical analysis, this paper proposes to transform the problem of blocking location into a parameter optimization problem and solve it by using optimization algorithms. Combined with the results of laboratory test analysis, the locating accuracy of the three algorithms is high, which verifies the feasibility and applicability of parameter optimization in the locating problem of partial blockage of gas transmission pipeline. This method also have a good application prospect. In order to further improve the locating accuracy and speed of partial blockage, we can consider from the following three aspects:(1) Select the optimization algorithm with stronger search ability and further optimize the parameters of the algorithm;(2) The pipe network simulation technology is used to solve the theoretical pressure distribution curve along the pipeline. At the same time, numerical integration method is used to calculate the theoretical pipe inventory;(3) If the "shutin" test cannot be carried out on the pipeline, the partial blockage point can be located by analyzing pipe inventory variation under different final stable conditions.