Open Access
 Issue Mechanics & Industry Volume 20, Number 4, 2019 406 8 https://doi.org/10.1051/meca/2019020 11 July 2019

## 1 Introduction

Regular pigging for the gas pipelines has become a standard procedure for operators. Generally, a pig is a plug installed in the pipeline to execute certain operations, such as liquid removal, inspection of the pipe and cleaning out debris . Fluid is a pumped upstream of the pig to push the pig forward. Because of the compressibility of gas and the coupling effect between gas and pig, the speed of pig in gas pipeline may be unstable . Thereby, the prediction of speed and the position of the pig are essential for pigging operators [7,8].

In order to understand the dynamic characteristics of the pig, the fluid-structure interaction (FSI) method can be used to solve the pig motion equation and the gas equation . There have already been some works relating to the dynamics of the pig in gas pipelines. The MOC is efficient in solving one-dimensional gas flow equation, so it is widely used in pigging model [13,14].

The maximum speed a pig achieves from a stoppage in gas pipeline is studied by Honggang and Zheng . In this paper, the gas equations are solved by the MOC. The Runge-Kutta method is employed to address the speed equation of the pig and to solve the ordinary differential equations of the steady state equations of the gas. The dynamics of a pig with a fixed bypass in the gas pipeline have been studied by Hosseinalipour et al. . Mirshamsi et al. presented a dynamic model of a long pig passing through a two-dimensional gas pipeline, and carried out simulation analysis . Jingyuan and Changjun developed a pigging mathematical model coupling with the quasi-steady state flow model . Flow control in natural gas and liquid pipeline were considered by Solghar .

The above pigging models mainly simulate the pigging process in horizontal or small-dip pipelines. In these pigging models, the friction of gas flow is considered as a scalar. For instance, the change of its direction generated by the backward flow of the gas is not considered. Thus, the simulation of pigging for hilly gas pipelines would be difficult for the pigging models.

In the pigging operations for hilly gas pipelines, occasionally the pig will get stuck in the pipeline, which can be identified by the increase of upstream pressure. At present, the operators tend to attribute this phenomenon to the increase of the resistance between the pig and the pipe wall, such as the corrosion of pipe, bends, welding lines, pipe deformation and other reasons. Nonetheless, it seems that very few researches would pay attention to the coupling of the gas and the pig in the hilly gas pipeline. Actually, the coupling of the gas and the pig would lead to a stoppage of the pig in the uphill gas pipe.

It seems that very few calculations or simulations focus on the pigging in hilly gas pipelines. This paper deals with the pigging model of a conventional pig moving through a hilly gas pipeline. In the model, the gas equation is solved by MOC method and the speed equation of pig is solved by Runge-Kutta method. Then, the process of a pig moving through an uphill gas pipeline is simulated. The results show that the ratio of the inlet pressure rise, during a pigging in an uphill gas pipe, is mainly determined by the inclination of the pipeline. Later, an empirical formula is presented to predict the inlet pressure of a gas pipeline with uphill sections during the pigging operation.

## 2 Mathematical modeling

### 2.1 Pig dynamic equation

Figure 1 shows the forces acting on a pig in a two-dimensional pipe. The dynamic equation of the pig can be written as follows : (1)

In this equation, v pig is the velocity of the pig; m refers to the mass of the pig; Ffp denotes the friction force of the pig. The driving force FP is derived from the pressure difference between the front and back of the pigging device. The pressure difference is calculated by the upstream and downstream flow dynamics in each calculation step.

Typically, a two-dimensional pipe is represented by elevation icons, so it can be discretized into a series of points in the form of elevation vs. distance. Thus, sinθ in the equation (1) of each point can be expressed by the adjacent points. At each time step, the inclination parameter sinθ of the current pig position can be obtained by the interpolation of the adjacent points. Subsequently, the speed and position of the pig can be solved from equation (1) by utilizing the Range-Kuta method. Additionally, the inclination parameter sinθ in the gas equations can be calculated in the same way. Fig. 1Load analysis of a pig moving in a two-dimensional pipeline.

### 2.2 Gas flow model in hilly pipeline

The unsteady flow dynamics can be modeled based on the fundamental fluid dynamic equations as below [1315,20,21]: (2) (3) (4) where, u, p, ρ, g, x and t refer to velocity, pressure, density, gravity parameter, distance and time, respectively. In addition, notation θ is the angle of the pipeline, A denotes the area of the pipe, S means the pipe perimeter, q is the rate of the heat inflow, γ refers to the ratio of specific heat, and the friction force per unit pipe length is represented by Ff .

In the hilly gas pipelines, there would be an occasion that the gas flows backward, which causes the friction force Ff to reverse. Therefore, the sign function of velocity sgn(u) should be added before the friction. The friction factor and the friction force per unit pipe length are provided respectively as below : (5) (6)where, d, k, f, and Re are the diameter of the pipe, pipe wall roughness, friction factor, and Reynolds number, respectively. The solution of gas equations by using MOC is detailed in the Appendix A.

### 2.3 Initial and boundary conditions

Typically, the downstream gas pipeline is relatively long, and its outlet is connected to a tank or other pipeline. In this way, the outlet pressure is considerably consistent when the pig stops in the gas pipeline for a short time. Hence, the boundary condition of the constant outlet pressure and constant flow rate at the inlet is used, which stimulates the release of a stuck pig by increasing the upstream pressure. The assumption is made only for simplicity and would bring some errors when the pig is close to the outlet.

It is assumed that the upstream and downstream flows are completely coupled by the pig. Therefore, the flow velocities at the tail and nose of the pig equal to the speed of pig . The steady state momentum equation (3) and energy equation (4) for the gas flow can be transformed to ordinary differential equations, by assuming ∂/∂t = 0. Now the steady state equations can be obtained: (7) (8) (9)

The initial fluid variables u, p, and ρ for both upstream and downstream gas flows can be calculated by solving equations (79) with the use of the Runge-Kutta method.

### 2.4 Numerical solution

There are two parts of the pipeline, including the one in front of the pig and another one behind it, so as to facilitate the process of pigging in the gas pipeline . The dynamic equations for the gas flows in downstream and upstream can be addressed to gain differential pressure between the pig's tail and nose. The Runge-Kutta approach in the next step can be used to solve the pig's speed equation and to gain the pig's new position and speed.

It is important to update the grids on the flows' downstream and upstream to calculate the parameters of gas as the pig moves across one or more grids in the step of ti . Later on, to calculate the motion of pig at the time step of ti+ 1, the differential pressure at the pig's tail and nose can be derived. The calculations can be repeated till the time step reaches the end or the pig reaches a certain position in the pipeline .

## 3 Simulation of pigging in uphill pipeline

The values of the parameters are shown in Table 1. A pipeline curve with an inclination section of 27.5 degree is adopted in the simulation, which is figured in Figure 2.

The pig speed of the calculation is shown in Figure 2, which indicates that the pig stops and moves backward when it gets to the uphill section. After hesitating for several times, the pig finally gets to a middle position of the climbing section, and then starts to accelerate. When the pig passes over the uphill segment, a maximum speed of approximately 17 m/s can be achieved.

The inlet pressure, compared with the pig speed, is presented in Figure 3. It can be seen that the inlet pressure increases significantly to drive the pig through the uphill section. After the pig passes the uphill section, the inlet pressure is then reduced to the normal level. The backward movement of the pig is also shown in Figure 3. Within 60 to 70 s, the pig moves backward at a low speed of about 0.2 m/s.

During the pigging, the pressure on the pig tail and nose, the inlet pressure and the pressure difference between the front and rear of the pig are indicated in Figure 4. It can be seen that when the pig moves to the uphill section, the gas pressure at the front of the pig increases due to the compression generated by the pig. Additionally, when the gas in the inclined pipe stops flowing, the pressure rise is more obvious due to the action of gravity. As a result, the pressure difference at the front and rear of the pig reverses, which means the pressure at the front of the pig is much higher now. In this way, as shown in Figures 2 and 3, the pig stops quickly after starting. After hesitating for approximately 70 s, the pig finally gets to a middle position of the climbing section, and then moves smoothly.

The distributions of gas parameters during the pigging are shown in Figure 5. It can be seen in Figure 5A that the gas velocity is coupled with the speed of the pig. As the pig moves at a high speed, the gas flow rate increases accordingly. Additionally, as the pig climbs the uphill segment during 60 ∼ 120 s, the gas pressure rises significantly, which is shown in Figure 5B. When the pig passes through the uphill section, the gas pressure later returns to normal.

The parametric sensitivity analysis of pigging in the uphill segment is then carried out. As shown in Figure 6, the following parameters have little effect on the ratio of inlet pressure rise: mass of the pig, friction of the pig and the pipe, pipe diameter, gas pressure, gas speed and the length of the uphill. The ratio of inlet pressure rise during the pigging process is mainly determined by the inclination of the pipe and requires the uphill pipe to exceed a certain length.

Table 1

Numerical values for the simulation. Fig. 2Pig speed vs. pipe curve. Fig. 3Pig speed vs. inlet pressure of the pipeline. Fig. 4Pressure at the pig tail, pressure at the pig nose, inlet pressure and pressure difference during the pigging. Fig. 5Three-dimensional surface map of gas parameters. (A) Gas speed of pigging in the uphill pipe; (B) gas pressure of pigging in the uphill pipe. Fig. 6Parametric sensitivity analysis of pigging in an uphill segment. (A) Increase of mass or contact force; (B) the effect of pipe diameter changes on the results; (C) sensitivity of gas pressure to the results; (D) sensitivity of gas speed to the results; (E) sensitivity of uphill length to the results; (F) sensitivity of uphill inclination to the results.

## 4 Calculation of inlet pressure rise generated by a stoppage

A series of pipes with different inclination angles (10 ∼ 90 degrees), as shown in Figure 7A, is utilized to calculate the ratio of inlet pressure rise. Using the parameters listed in Table 1, the inlet pressures during the pigging are shown in Figure 7B. The minimum length of the uphill pipe and the ratio of the inlet pressure rise, as calculated from the results of the pigging simulations, are fitted to the formulas as follows: (10) (11) in which, L min is the minimum length of uphill pipe, [m]; R pr refers to the ratio of inlet pressure rise, [%]; x means the angle of a pipe inclination, [degree, 10 ∼ 90]. The values obtained from the simulation and the values predicted by equations (10) and (11) are compared in Figure 8, which indicates a good agreement.

Now, to predict the ratio of inlet pressure rise generated by an uphill segment of gas pipeline, the following steps can be used: to determine whether the inclined pipe exceeds the minimum length calculated by the equation (10); then to use equation (11) to calculate the pressure increment. It should be noticed that the inclination of the pipe determines the ratio of inlet pressure rise during the pigging process. Therefore, the increase in the gas pressure in the high-pressure pipe is more pronounced than in the low-pressure pipe. Last but not least, as the boundary condition of the constant inlet flow rate and constant outlet pressure is adopted in the above simulations, the formula presented would bring some errors when the pig is close to the outlet of pipeline. Fig. 7Simulations of pigging in uphill pipe with different inclination angles. (A) Pipe curves for the pigging simulations; (B) inlet pressures of the simulations. Fig. 8Actual values vs. Predicted values. (A) Calculations of minimum length of the uphill section; (B) increase ratio of inlet pressure during pigging in the uphill segments.

## 5 Conclusion

A pigging model using FSI to estimate the dynamic behavior of the pig has been shown. The process of pigging in a hilly gas pipeline is also simulated. The inlet pressure rise during pigging in an uphill segment of gas pipeline is studied.

The results show that the pig gets stuck in the uphill segment of the pipe, due to the coupling between the gas and the pig. In this condition, a higher pressure of the upstream would be needed to pull the pig through the uphill segment. The ratio of inlet pressure rise, during a pigging in an uphill gas pipe, is mainly determined by the inclination of the pipe. The formula presented can be utilized to predict the inlet pressure of a gas pipeline with uphill sections, and to determine whether the pig passes through a particular uphill section of pipeline.

In addition, the proposed method and solution can be used to predict the gas pressure, pig speed, the stoppage of pig as well as the position of pig in pigging operation for a hilly pipeline.

## Nomenclature

A : Area of pipe

c : Sound speed

d : Diameter of the pipe

Ff : Friction force per unit pipe length

Ffp : Friction force between of pig

Fp : Deriving force of pig

f : Friction factor

g : Gravity parameter

k : Pipe wall roughness

m : Pig mass

p : Gas pressure

q : Rate of heat inflow

Re : Reynolds number

S : Pipe inner perimeter

t : Time

u : Velocity of gas

v pig : Velocity of gas

x : Distance

µ : Coefficient of friction force

θ : Angle of pipe

ρ : Density of gas

γ : Ratio of specific heat

λ : Real eigenvalue

## Appendix A Solution of Gas Equations using MOC

MOC can effectively transform the partial differential equations of gas flow into ordinary differential equations that can be solved numerically. The solution steps are shown below .

Equations (24) can be rewritten in the following form: (12)where,

u = [ρ u p]  T ,  The nonlinear hyperbolic partial differential system of equation (12) can be transformed into ordinary differential equations integrated by the finite differences. Matrix A has 3 real eigenvalues λ: In which c refers to the sound speed. The compatibility equations are obtained by multiplying the system given by the eigenvectors. The eigenvectors of matrix A are: For each pair of λ and υ, equation (12) can be rewritten in the form: (13)

By writing equation (12) along the characteristics line, now we can obtain the compatibility equations: (14) (15) (16)

The relationship between the fluid variables u, p, and ρ at the time step tj−1 and at following time step tj . is presented in Figure A1. At the time step tj−1 , variables u, p, and ρ at grid points S, M and R are obtained from the linear interpolation of the data on O, N and L. Subsequently, the gas flow parameters at point P can be derived from the previous calculated grid points S, M and R. Fig. A1Characteristics used in MOC.

Equations (1416) are integrated along the corresponding characteristic line dx/dt to obtain the desired variables. From linear interpolation, equations (1719) can be obtained. In these equations, X will be replaced by the desired calculating values, including u, p, or ρ. (17) (18) (19)

According to the equations (1416), we get: (20) (21) (22)where, (23) (24) (25)

The space step, Δx, and the time step, Δt, are chosen under the stability condition . (26)

## References

1. H. Zhang, S.M. Zhang, S.H. Liu, X.X. Zhu, B. Tang, Chatter vibration phenomenon of pipeline inspection gauges (PIGs) in natural gas pipeline, J. Nat. Gas Sci. Eng. 27 (2015) 1129–1140 [Google Scholar]
2. S.T. Tolmasquim, A.O. Nieckele, Design and control of pig operations through pipelines, J. Pet. Sci. Eng. 62 (2008) 102–110 [Google Scholar]
3. A.A. Ayati, J. Kolaas, A. Jensen, G.W. Johnson, Combined simultaneous two-phase PIV and interface elevation measurements in stratified gas/liquid pipe flow, Int. J. Multiph. Flow 74 (2015) 45–58 [CrossRef] [Google Scholar]
4. X. Zhu, S. Zhang, G. Tan, D. Wang, W. Wang, Experimental study on dynamics of rotatable bypass-valve in speed control pig in gas pipeline, Measurement 47 (2014) 686–692 [CrossRef] [Google Scholar]
5. Z. Liang, H. He, W. Cai, Speed simulation of bypass hole PIG with a brake unit in liquid pipe, J. Nat. Gas Sci. Eng. 42 (2017) 40–47 [Google Scholar]
6. M.M. Mirshamsi, M. Rafeeyan, Speed control of pipeline pig using the QFT method, Oil Gas Sci. Technol. 67 (2012) 693–701 [CrossRef] [Google Scholar]
7. M.H.W. Hendrix, H.P. Ijsseldijk, W.P. Breugem, R.A.W.M. Henkes, Development of speed controlled pigging for low pressure pipelines, Paper presented at: 18th International Conference on Multiphase Production Technology, MPT 2017, June 7, 2017–June 9, 2017, Cannes, France [Google Scholar]
8. M. Lesani, M. Rafeeyan, A. Sohankar, Dynamic analysis of small pig through two and three-dimensional liquid pipeline, J. Appl. Fluid Mech. 5 (2012) 75–83 [Google Scholar]
9. A.O. Nieckele, A.M.B. Braga, L.F.A. Azevedo, Transient pig motion through gas and liquid pipelines, J. Energy Resour. Technol. 123 (2001) 260–269 [Google Scholar]
10. X.X. Zhu, D.G. Wang, H. Yeung, S.M. Zhang, S.H. Liu, Comparison of linear and nonlinear simulations of bidirectional pig contact forces in gas pipelines, J. Nat. Gas Sci. Eng. 27 (2015) 151–157 [Google Scholar]
11. X. Zhu, X. Li, C. Zhao, S. Zhang, S. Li, Dynamic simulation and experimental research on the motion of odometer passing over the weld, J. Nat. Gas Sci. Eng. 30 (2016) 205–212 [Google Scholar]
12. G.A. Groote, P.B.J. Van De Camp, P. Veenstra, G. Broze, R.A.W.M. Henkes, By-pass pigging without or with speed control for gas-condensate pipelines, Paper presented at: SPE – Abu Dhabi International Petroleum Exhibition and Conference, ADIPEC 2015, November 9, 2015–November 12, 2015, Abu Dhabi, United arab emirates [Google Scholar]
13. F. Esmaeilzadeh, D. Mowla, M. Asemani, Mathematical modeling and simulation of pigging operation in gas and liquid pipelines, J. Pet. Sci. Eng. 69 (2009) 100–106 [Google Scholar]
14. T.T. Nguyen, S.B. Kim, H.R. Yoo, Y.W. Rho, Modeling and simulation for PIG flow control in natural gas pipeline, KSME Int. J. 15 (2001) 1165–1173 [CrossRef] [Google Scholar]
15. H.G. He, Z. Liang, Speed simulation of pig restarting from stoppage in gas pipeline, Math. Probl. Eng. 10 (2019) 4036253 [Google Scholar]
16. S.M. Hosseinalipour, A. Zarif Khalili, A. Salimi, Numerical simulation of pig motion through gas pipelines, Paper presented at: 16th Australasian Fluid Mechanics Conference, 16AFMC, December 3, 2007–December 7, 2007, Gold Coast, QLD, Australia [Google Scholar]
17. M. Mirshamsi, M. Rafeeyan, Dynamic analysis and simulation of long pig in gas pipeline, J. Nat. Gas Sci. Eng. 23 (2015) 294–303 [Google Scholar]
18. J.Y. Xu, C.J. Li, Quasi-steady state numerical modeling of pigging operation in gas pipelines, in: M. Ma (ed.), Mechanical, industrial, and manufacturing engineering, Newark: Information Engineering Research Inst, USA, 2011, pp. 202–207 [Google Scholar]
19. A.A. Solghar, M. Davoudian, Analysis of transient PIG motion in natural gas pipeline, Mechanics & Industry 13 (2012) 293–300 [CrossRef] [EDP Sciences] [Google Scholar]
20. S. Xie, Z. Liang, L. Zhang, Y. Wang, H. Ding, J. Zhang, Numerical investigation on heat transfer performance and flow characteristics in enhanced tube with dimples and protrusions, Int. J. Heat Mass Transf. 122 (2018) 602–613 [Google Scholar]
21. H. He, Z. Liang, Simulation of pigging with a brake unit in hilly gas pipeline, J. Appl. Fluid Mech. 12 (2019) 1497–1509 [CrossRef] [Google Scholar]
22. D. Anderson, J.C. Tannehill, R.H. Pletcher, Computational fluid mechanics and heat transfer, 3rd ed., CRC Press, Boca Raton, 2012 [Google Scholar]

Cite this article as: H. He, Z. Liang, Y. Guo, Inlet pressure simulation of pigging in uphill gas pipeline, Mechanics & Industry 20, 406 (2019)

## All Tables

Table 1

Numerical values for the simulation.

## All Figures Fig. 1Load analysis of a pig moving in a two-dimensional pipeline. In the text Fig. 2Pig speed vs. pipe curve. In the text Fig. 3Pig speed vs. inlet pressure of the pipeline. In the text Fig. 4Pressure at the pig tail, pressure at the pig nose, inlet pressure and pressure difference during the pigging. In the text Fig. 5Three-dimensional surface map of gas parameters. (A) Gas speed of pigging in the uphill pipe; (B) gas pressure of pigging in the uphill pipe. In the text Fig. 6Parametric sensitivity analysis of pigging in an uphill segment. (A) Increase of mass or contact force; (B) the effect of pipe diameter changes on the results; (C) sensitivity of gas pressure to the results; (D) sensitivity of gas speed to the results; (E) sensitivity of uphill length to the results; (F) sensitivity of uphill inclination to the results. In the text Fig. 7Simulations of pigging in uphill pipe with different inclination angles. (A) Pipe curves for the pigging simulations; (B) inlet pressures of the simulations. In the text Fig. 8Actual values vs. Predicted values. (A) Calculations of minimum length of the uphill section; (B) increase ratio of inlet pressure during pigging in the uphill segments. In the text Fig. A1Characteristics used in MOC. In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.