Research Article  Open Access
Liang Zhang, Jiawei Zhou, Honggang He, "Modeling and Simulation of Pigging for a Gas Pipeline Using a Bypass Pig", Mathematical Problems in Engineering, vol. 2020, Article ID 2047352, 12 pages, 2020. https://doi.org/10.1155/2020/2047352
Modeling and Simulation of Pigging for a Gas Pipeline Using a Bypass Pig
Abstract
The pipeline inspection gauge (PIG, lowercase pig is commonly used) with a bypass valve is widely used in pipeline inspection because it operates at a low speed without reducing the flow rate. Understanding the dynamics of a bypass pig in a gas pipeline would contribute to the design of the pig and the control of pig speed. This paper deals with the dynamic model for the process of a bypass pig travelling through a hilly gas pipeline. The method of characteristics (MOC) is used to solve the equations of unsteady gas flow. The backward flow of the gas in the bypass valve and pipe is shown by a simulation of pigging for a hilly gas pipeline. Parametric sensitivity analysis of pigging in the horizontal gas pipe using a bypass pig is then carried out. The results indicate that the speed of a bypass pig is most sensitive to the gas speed in the pipe followed by the bypass area and the friction of the pig. A formula, obtained from the results of the simulations using response surface methodology (RSM), is presented to predict the steady speed of a bypass pig in the horizontal gas pipeline.
1. Introduction
Regular pigging for the gas pipelines is one standard procedure for the operators. Generally, a pig is a piston that is installed in a pipe to perform certain operations such as liquid removal, inspection of the pipe, and cleaning out debris. Fluid is pumped upstream of the pig to drive it in motion [1–3]. In many cases, the flow rate in the pipelines is required not to decrease too much during the pigging operations because of the demand of the downstream [4–6]. However, the pig speed needs to be limited to within a moderate range during such operations [7, 8]. In particular, intelligent pigs for pipeline inspection require that the pigging speed be limited to medium. Therefore, implementation of a bypass control strategy is the only appropriate technique for several such pigging operations [9, 10].
In general, a bypass control strategy uses a bypass valve to adjust the pressure difference between the tail and nose of the pig. As a part of the fluid pours out of the bypass hole through the pig body, the pig speed can be reduced to a desired range.
A literature investigation indicates that few studies focus on bypass valve pigs. Nguyen et al. performed modeling and simulation of pig flow control in a natural gas pipeline [11]. The dynamics of a pig with a fixed bypass in the gas pipeline was studied by Hosseinalipour et al. In this research, the basic equations of gas flow were discretized by the finite difference method [12]. Tan et al. studied a new butterflyshaped bypass valve and presented its working principle [13]. Lesani et al. explored the derivation and solution of two and threedimensional (2D and 3D, respectively) dynamic equations for the pig passing through the liquid pipeline [5].
The prediction and control of the pig speed is critical to the pigging operation. To understand the dynamic behavior of the pig, the pig dynamic equation must be coupled with the governing equations of flows [14–16]. The method of characteristics (MOC) was employed to transform the partial differential equations of flows to ordinary differential equations [17–19]. This method is quite efficient to solve the governing equations of transient gas flows.
There already exist some works relating to the dynamics of the pig in gas pipelines. Esmaeilzadeh et al. presented a mathematical model of the dynamics of a pig travelling through gas pipelines [17]. The process of a pig restarting from a stoppage in a horizontal gas pipe was simulated by Nguyen et al. In this paper, the gas equations were solved by MOC [11]. Xu and Li developed a pigging mathematical model coupling with the quasisteadystate flow model [20]. In addition, Mirshamsi and Rafeeyan analyzed the process of a pig through a 3D gas pipeline by assuming the pig as a rigid body with a bypass [21, 22]. It seems that few of the studies pay attention to the backward flow of gas in the bypass valve and pipe. Therefore, the simulation of pigging for hilly gas pipelines would be a difficulty for these pigging models.
A literature survey reveals that very few papers focus on the simulations of pigging in hilly gas pipelines using a pig with a bypass valve. Also, there are few calculations or simulations for estimating the speed of the bypass pig in gas pipelines. This paper deals with the dynamic model for the process of a bypass pig travelling through a hilly gas pipeline. The equations for unsteady gas flow are solved by MOC. The bypass flow through the pig is assumed to be incompressible for calculating the pressure difference between the tail and nose of the pig. In this pigging model, the backward flow of gas in the bypass valve and pipe is taken into account, which is shown by a simulation of pigging for a hilly gas pipeline. Parametric sensitivity analysis of pigging in the horizontal gas pipe using a bypass pig is then carried out. Lastly, RSM is used to study the steady speed of a bypass pig in the horizontal gas pipeline. A formula, obtained from the results of the RSM simulations, is presented to predict the steady speed of a bypass pig in the horizontal gas pipeline.
2. Mathematical Modeling
2.1. Pig Dynamic Equation
The model of a pig moving in a pipeline with a bypass valve is shown in Figure 1. An amount of the flow in a pipeline passes through the bypass hole and builds up a pressure difference between the tail and nose of the pig, which drives the pig in motion. The dynamic equation of the pig can be expressed as follows:where m, , A_{p}, A_{h}, p_{tail}, p_{nose}, F_{fp}, F_{p}, and θ are the mass of the pig, velocity of the pig, crosssectional area of the pipe, area of the bypass hole, pressure on the pig tail, pressure on the pig nose, friction force of the pig, driving force generated by the pressure difference, and angle between the pipe and the horizontal plane, respectively.
As is known, there are occasions that the pig stops in the pipeline and requires a larger driving pressure to push it in motion. Thus, the relationship between the static friction F_{sta} and dynamic friction F_{dyn} of the pig can be expressed in the following form:
2.2. Model of Gas Flow in a Hilly Pipeline
The following assumptions are adopted to simplify the pigging model:(1)The gas is an ideal gas(2)The gas flow is quasisteady heat flow(3)The fluid in the pipeline is a singlephase gas(4)The diameter of the pipeline is unchanged during pigging
The unsteady flow dynamics can be modeled based on the fundamental fluid dynamic equations [11, 17, 18, 23]: continuity equation, momentum equation, and energy equation, respectively, as follows:where u, ρ, p, x, , and t are the velocity, density, pressure, distance, gravity parameter, and time, respectively. In addition, F_{f}, A_{p}, γ, S, and q are the friction force, crosssectional area of the pipe, ratio of specific heat, pipe perimeter, and rate of heat inflow, respectively.
In gas pipelines, there are occasions that the gas flows backward, which causes the friction force F_{f} to reverse. Therefore, the sign function of velocity sgn (u) should be added before the friction force F_{f}. From the perspective of the fluid mechanics books and papers, the friction factor and the friction force are given, respectively, as follows [24]:where Re, d, k, and f are the Reynolds number, diameter of the pipe, pipe wall roughness, and friction factor, respectively. Equations (3)∼(5) can be rewritten in the following form:where
The nonlinear hyperbolic partial differential system of equation (7) can be transformed into ordinary differential equations which can be integrated by finite differences. Matrix A has 3 real eigenvalues, λ:where c is the sound speed. Thus, the eigenvectors of matrix A can be written as
For each pair of λ and υ, equation (7) can be rewritten in the form
By writing equation (7) along the characteristic line, now we get the compatibility equations:
Figure 2 shows the relationship between variables u, p, and ρ at the time step t_{j−1} and at the following time step t_{j} [17, 25]. At the time step t_{j−1}, variables u, p, and ρ at grid points S, M, and R are obtained from linear interpolation of the data on O, N, and L. Then, the gas flow parameters at point P can be derived from previously calculated grid points S, M, and R.
Equations (12)∼(14) are integrated along the corresponding characteristic line to obtain the desired variables. Equations (15)∼(17) are obtained by linear interpolation. In the following three equations, X denotes the desired parameters u, p, or ρ:
According to equations (12)∼(14), we getwhere
The sampling time, ∆t, and the sampling distance, ∆x, are chosen under the CFL stability condition [24]:
2.3. Pressure Difference Generated by the Bypass
Generally, a bypass valve is used in a smart pig for pipeline inspection. Several conventional pigging operations for liquid and debris removal should be done before using the smart pig. In a clean pipe, the pressure difference between the tail and the nose of the pig is generally in the range of 0.3∼1.5 bar. Therefore, the pressure disturbance generated by the pig is negligible compared to the gas pressure, typically up to several megapascals. In addition, when the speed of natural gas is less than 200 m/s, it can be treated as incompressible with an error less than 5% [25].
With the assumption that the gas can be treated as incompressible as it passes through the bypass valve, the gas velocity on the tail and nose of the pig can be written as the following:where u_{tail}, u_{nose}, and are the gas velocity on the tail of the pig, on the nose of the pig, and in the hole of the pig, respectively.
In gas pipelines, the speed of pigs can be erratic, which makes the driving pressure of the pig positive or negative. From the perspective of the fluid mechanics books and papers, the pressure difference generated by the bypass valve is given as follows [10]:
In this equation, C_{h} is the discharge coefficient of the valve, which is determined by the structure of the valve and the properties of the medium. Generally, C_{h} is between 0.6 and 0.8.
2.4. Boundary Conditions
In this paper, the boundary conditions are considered as constant inlet flow rate and constant pressure at the outlet. As shown in Figure 3, using the backward and forward characteristics next to the pig, the pressure on the tail and nose of the pig can be expressed as follows [25]:
To calculate equation (23), the gas parameters at points R_{tail} and N_{tail} should be obtained firstly, which can be solved as the following steps [25]:(1)Calculate the gas parameters at point N_{tail} by linear extrapolating from two points L and N:(2)Find out the position of point R_{tail}:(3)Calculate the flow parameters at point R_{tail} by linear interpolating from two points L and N:
With the gas parameters at points T and O, the gas parameters at points N_{nose} and S_{nose} can be calculated in the same way, which can be expressed as follows:
If p_{tail}>p_{nose}, substituting equations (21) and (23) into equation (22), we get the relationshipwhere
By solving equation (28) under the condition of > , the velocity of bypass flow can be written as follows:
If p_{tail} < p_{nose}, substituting equations (21) and (23) into equation (22), we get the relationshipwhere
By solving equation (28) under the condition of < , the velocity of bypass flow can be written as follows:
Substituting into equation (21), the values u_{tail} and u_{nose} can be calculated. Now, parameters p_{tial} and p_{nose} can be obtained by solving equation (23).
2.5. Initial Conditions
Steadystate momentum equation (4) and energy equation (5) for gas flow can be converted into ordinary differential equations by assuming ∂/∂t = 0. Now, we get the steadystate equations:
The initial fluid variables u, p, and ρ for both upstream and downstream gas flows can be calculated by solving equations (34)∼(36) using the Runge–Kutta method.
2.6. Numerical Solution
In general, a number of discrete points are adopted to express the pipe curve. Thus, sinθ in equation (1) of each point can be expressed by the adjacent points. At each time step, sinθ of the current pig position can be obtained by interpolation of the adjacent points. Then, the speed and position of the pig can be solved from equation (1) by using the Runge–Kutta method.
To simulate the pigging process in the gas pipeline, the pipeline is divided into two sections: one behind the pig and the other in front of it. At the first time step, the dynamic equations for both upstream and downstream gas flows are solved to obtain the driving pressure of the pig. In the next step, the Runge–Kutta method is used to solve the speed equation of the pig to obtain speed and the new position of the pig. The calculations are repeated until the pig arrives at a given position in the pipeline or the time step reaches the end.
3. Simulation of Pigging for a Hilly Gas Pipeline Using a Pig with a Bypass
A pipe curve shown in Figure 4 is used for the simulation of pigging in a hilly natural gas pipeline using a pig with the bypass hole. Numerical values of the parameters used in this pigging simulation are shown in Table 1.

In order to test the mesh independence, numerical solution is carried out by utilizing the grid systems with 800,000 cells, 1,250,000 cells, 5,000,000 cells, and 20,000,000 cells at an initial position of 4700 m and in a computing time of 200 s. The pig speed of these simulations is figured out in Figure 5. The pig speed gap between grid systems of 5 M and 20 M cells is much smaller than the gap between 0.8 M and 1.2 M. Thus, to balance computational economy and prediction accuracy, the grid system of 5 M cells is chosen for this study.
The pig speed and the gas speed in the bypass valve are figured out in Figures 6 and 7, which show that the two speeds increase to a high level when the pig moves into a downhill section. In addition, the pig stops quickly when it rushes into the uphill section because the pressure difference between the tail and nose of the pig reduces to a level that is insufficient to overcome the friction, shown in Figure 8. This way, the gas in the bypass flows backwards for a period of time. After 10 seconds, the gas speed in the bypass value increases to about 12 m/s, building up a pressure difference of about 0.35 bar to drive the pig in motion.
The pressure on the pig tail and nose and pressure difference between the tail and nose of the pig during pigging are shown in Figure 8. It can be seen that when the pig moves to the uphill section, the gas pressure on the nose of the pig increases because of the compression generated by the pig. Additionally, the pressure on the pig nose rises in the uphill section due to the action of gravity. As a result, it is difficult to establish the pressure difference at the tail and nose of the pig, and it requires an increase of gas pressure on the pig tail. This way, the pig speed decreases after starting. After hesitating for about 12 seconds, the pig then can move smoothly.
The distributions of gas pressure and speed are presented as 3D diagrams shown in Figures 9(a) and 9(b), respectively. It can be seen that the gas pressure increases when the pig climbs the uphill section and decreases when the pig travels in the downhill section. In addition, the shock wave of the gas speed, generated by a high speed of the pig, will continue to move forward.
(a)
(b)
4. Simulation of Pigging in the Horizontal Pipe Using a Bypass Pig
Typically, natural gas pipelines are primarily horizontal or near horizontal. Therefore, the design of bypass pigs and pigging operations generally considers pigging in horizontal pipelines. In this study, a 5 km horizontal gas pipeline is used for calculating the steady speed of the bypass pig. The parameters of the pigging system are listed out in Table 1. The pressure on the pig tail and nose and pressure difference between the tail and nose of the pig are shown in Figure 10(a). The pig speed and the gas speed in the bypass hole are figured out in Figure 10(b). The results show that the pressures and speeds fluctuated within 60 seconds after the pig was started and then gradually reached a stable value.
(a)
(b)
Parametric sensitivity analysis of pigging in the horizontal gas pipe using a bypass pig is then carried out. As shown in Figure 11, the steady speed of a bypass pig is primarily determined by the pipe diameter, gas speed in the pipe, bypass area, and the friction force of the pig. The mass of the pig makes little difference to the results. Additionally, the pig speed is most sensitive to the gas speed in the pipe followed by the bypass area.
(a)
(b)
(c)
(d)
(e)
(f)
5. Calculation of Steady Speed of the Bypass Pig Using RSM
Response surface methodology (RSM) is a statistical experimental method for optimizing stochastic processes. The objective is to find out the quantitative law between the experimental index [26, 27]. In this research, RSM is used to study the steady speed of a bypass pig in the horizontal gas pipeline. The steady speeds a pig achieved from each run of RSM are listed out in Table 2. An empirical formula for estimating the steady speed of a bypass pig in the horizontal gas pipeline, obtained from the results of the RSM simulations, is as follows:

In this equation, A, B, C, D, and E are the pipe diameter (m), gas pressure (bar), gas speed in the pipe (m/s), proportion of the bypass area to the crosssectional area of the pipe (%), and driving pressure of the pig generated by the friction of the pig (bar), respectively. Model graphs of equation (37) are shown in Figure 12. The actual value and predicted value of pig speed are compared in Figure 13, which shows a good agreement within an error of 5%.
Obviously, the speed of a bypass pig is mainly determined by the gas speed in the pipeline and can be reduced in several ways: by reducing gas speed and pressure, increasing the bypass valve area, and increasing friction force of the pig.
6. Conclusion
A calculation scheme using MOC to solve the equations of gas flow for estimating the dynamics of the bypass pig has been shown. In this model, the backward flow of the gas in the bypass valve and pipe was taken into account, which was shown by a simulation of pigging for a hilly gas pipeline. Parametric sensitivity analysis of pigging in the horizontal gas pipe using a bypass pig was then carried out. Then, RSM was used to study the steady speed of a bypass pig in the horizontal gas pipeline.
The results indicate that the steady speed of a bypass pig is primarily determined by the pipe diameter, gas speed in the pipe, bypass area, and the friction force of the pig. Additionally, the speed of a bypass pig is most sensitive to the gas speed in the pipe followed by the bypass area and the friction of the pig.
Furthermore, the formula obtained from the results of the RSM simulations can be used to predict the steady speed of a bypass pig in the horizontal gas pipeline. Thus, it could contribute to the design of the bypass pig and the control of pig speed.
Last but not the least, the proposed method and solution can be used to predict the speed of a bypass pig, the gas parameters, and the position of the pig after a given time in pigging operation for a hilly or horizontal gas pipeline.
Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This research work was supported by the Graduate Innovation Foundation of SWPU (CX2019BY12) and Research Project of Yibin University (2019QD18).
References
 X. Zhu, S. Zhang, G. Tan, D. Wang, and W. Wang, “Experimental study on dynamics of rotatable bypassvalve in speed control pig in gas pipeline,” Measurement, vol. 47, pp. 686–692, 2014. View at: Publisher Site  Google Scholar
 Z. Liang, W. He, and W. Cai, “Speed simulation of bypass hole PIG with a brake unit in liquid pipe,” Journal of Natural Gas Science and Engineering, vol. 42, pp. 40–47, 2017. View at: Publisher Site  Google Scholar
 M. Mirshamsi and M. Rafeeyan, “Speed control of pipeline pig using the QFT method,” Oil & Gas Science and Technology—Revue D’IFP Energies Nouvelles, vol. 67, no. 4, pp. 693–701, 2012. View at: Publisher Site  Google Scholar
 M. H. W. Hendrix, H. P. Ijsseldijk, W. P. Breugem et al., “Development of speed controlled pigging for low pressure pipelines,” in Proceedings of the 18th International Conference on Multiphase Production Technology, MPT 2017, pp. 501–509, BHR Group Limited, Cannes, France, June 2017. View at: Google Scholar
 M. Lesani, M. Rafeeyan, and A. Sohankar, “Dynamic analysis of small pig through two and threedimensional liquid pipeline,” Journal of Applied Fluid Mechanics, vol. 5, pp. 75–83, 2012. View at: Publisher Site  Google Scholar
 Z. Guo and Z. Liang, “Analysis of the pipeline pullback load for horizontal directional drilling,” KSCE Journal of Civil Engineering, vol. 22, no. 12, pp. 5133–5142, 2018. View at: Publisher Site  Google Scholar
 H. Zhang, S. Zhang, S. Liu, X. Zhu, and B. Tang, “Chatter vibration phenomenon of pipeline inspection gauges (PIGs) in natural gas pipeline,” Journal of Natural Gas Science and Engineering, vol. 27, pp. 1129–1140, 2015. View at: Publisher Site  Google Scholar
 A. O. Tolmasquim and A. O. Nieckele, “Design and control of pig operations through pipelines,” Journal of Petroleum Science and Engineering, vol. 62, no. 34, pp. 102–110, 2008. View at: Publisher Site  Google Scholar
 A. H. Mohamad and M. H. Fakhruldin, “Recent developments in speed control system of pipeline PIGs for deepwater pipeline applications,” World Academy of Science, Engineering and Technology, vol. 6, pp. 360–363, 2012. View at: Google Scholar
 T. T. Nguyen, H. R. Yoo, Y. W. Rho et al., “Speed control of pig using bypass flow in natural gas pipeline,” in Proceedings of the 2001 IEEE International Symposium on Industrial Electronics Proceedings (ISIE 2001), pp. 863–868, Institute of Electrical and Electronics Engineers Inc, Busan, South Korea, June 2001. View at: Google Scholar
 T. T. Nguyen, S. B. Kim, H. R. Yoo, and Y. W. Rho, “Modeling and simulation for PIG flow control in natural gas pipeline,” KSME International Journal, vol. 15, no. 8, pp. 1165–1173, 2001. View at: Publisher Site  Google Scholar
 S. M. Hosseinalipour, A. Zarif Khalili, and A. Salimi, “Numerical simulation of pig motion through gas pipelines,” in Proceedings of the 16th Australasian Fluid Mechanics Conference, 16AFMC, pp. 971–975, University of Queensland, Gold Coast, Australia, December 2007. View at: Google Scholar
 G. B. Tan, S. M. Zhang, and X. X. Zhu, “Design of the speed regulating pig with butterfly bypassvalve,” in Proceedings of the 2nd International Conference on Manufacturing Science and Engineering, ICMSE 2011, pp. 429–432, Trans Tech Publications, Guilin, China, April 2011. View at: Google Scholar
 A. O. Nieckele, L. F. A. Braga, and L. F. A. Azevedo, “Transient pig motion through gas and liquid pipelines,” Journal of Energy Resources Technology, vol. 123, no. 4, pp. 260–269, 2001. View at: Publisher Site  Google Scholar
 H. Honggang, L. Zheng, and G. Yishan, “Inlet pressure simulation of pigging in uphill gas pipeline,” Mechanics & Industry, vol. 20, no. 4, p. 406, 2019. View at: Publisher Site  Google Scholar
 L. Zheng, H. Honggang, and C. Xiao, “Molding and simulation of pig speed with brake unit in gas pipeline,” Journal of Pipeline Systems Engineering and Practice, vol. 11, no. 1, 2020. View at: Publisher Site  Google Scholar
 F. Esmaeilzadeh, M. Mowla, and M. Asemani, “Mathematical modeling and simulation of pigging operation in gas and liquid pipelines,” Journal of Petroleum Science and Engineering, vol. 69, no. 12, pp. 100–106, 2009. View at: Publisher Site  Google Scholar
 Z. He and Z. Liang, “Speed simulation of pig restarting from stoppage in gas pipeline,” Mathematical Problems in Engineering, vol. 2019, Article ID 4036253, 10 pages, 2019. View at: Publisher Site  Google Scholar
 H. He and Z. Liang, “Simulation of pigging with a brake unit in hilly gas pipeline,” Journal of Applied Fluid Mechanics, vol. 12, 2019. View at: Publisher Site  Google Scholar
 J. Y. Xu and C. J. Li, “Quasisteady state numerical modeling of pigging operation in gas pipelines,” in Mechanical, Industrial, and Manufacturing Engineering, M. Ma, Ed., pp. 202–207, Newark: Information Engineering Research Institute, Texas City, USA, 2011. View at: Google Scholar
 M. Mirshamsi and M. Rafeeyan, “Dynamic analysis and simulation of long pig in gas pipeline,” Journal of Natural Gas Science and Engineering, vol. 23, pp. 294–303, 2015. View at: Publisher Site  Google Scholar
 M. Mirshamsi and M. Rafeeyan, “Dynamic analysis of pig through two and three dimensional gas pipeline,” Journal of Applied Fluid Mechanics, vol. 8, no. 1, pp. 43–54, 2015. View at: Publisher Site  Google Scholar
 S. Xie, Z. Liang, L. Zhang, Y. Wang, H. Ding, and J. Zhang, “Numerical investigation on heat transfer performance and flow characteristics in enhanced tube with dimples and protrusions,” International Journal of Heat and Mass Transfer, vol. 122, pp. 602–613, 2018. View at: Publisher Site  Google Scholar
 A. Dale and H. P. Richard, Computational Fluid Mechanics and Heat Transfer, CRC Press, Boca Raton, FL, USA, 3rd edition, 2012.
 T. T. Nguyen, S. B. Kim, H. R. Yoo, and Y. W. Rho, “Modeling and simulation for PIG with bypass flow control in natural gas pipeline,” KSME International Journal, vol. 15, no. 9, pp. 1302–1310, 2001. View at: Publisher Site  Google Scholar
 M. A. Bezerra, R. E. Santelli, E. P. Oliveira, L. S. Villar, and L. A. Escaleira, “Response surface methodology (RSM) as a tool for optimization in analytical chemistry,” Talanta, vol. 76, no. 5, pp. 965–977, 2008. View at: Publisher Site  Google Scholar
 M. Asadollahzadeh, H. Tavakoli, M. TorabMostaedi, G. Hosseini, and A. Hemmati, “Response surface methodology based on central composite design as a chemometric tool for optimization of dispersivesolidification liquidliquid microextraction for speciation of inorganic arsenic in environmental water samples,” Talanta, vol. 123, pp. 25–31, 2014. View at: Publisher Site  Google Scholar
Copyright
Copyright © 2020 Liang Zhang et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.