#### Abstract

Pigging is a common operation in the oil and gas industry. Because of the compressibility of the gas, starting up a pipeline inspection gauge (pig) from a stoppage can generate a very high speed of the pig, which is dangerous to the pipe and the pig itself. Understanding the maximum speed a pig achieves in the restarting process would contribute to pig design and safe pigging. This paper presents the modeling of a pig restarting from a stoppage in gas pipeline. In the model, the transient equations of gas flow are solved by method of characteristics (MOC). Runge-Kutta method is used for solving the pig speed equation. The process of a pig restarting from a stoppage in a horizontal gas pipe is simulated. The results indicate that the maximum speed a pig achieves from a stoppage is primarily determined by the pressure of the pipe and the pressure change caused by the obstructions. Furthermore, response surface methodology (RSM) is used to study the maximum speed of pig. An empirical formula is present to predict the maximum speed of a pig restarting from a stoppage in gas pipeline.

#### 1. Introduction

To date, a large variety of pigs have evolved to perform operations such as locating obstructions, cleaning out debris and deposits, liquid removal, and inspection for corrosion spots or damage in pipes [1–3]. Fluid is pumped upstream of the pig to drive the pig in motion. Due to the compressibility of natural gas, the speed of pigs in natural gas pipelines can be erratic [4–6]. At present, there seems to be no effective measures to control the speed of conventional pigs for cleaning operations [4, 7, 8].

In pigging operations for the horizontal gas pipeline, there are occasions that the pig stops at some positions in the pipelines, which can be identified by the increase of upstream pressure or the decrease of downstream pressure [9, 10]. There are a variety of obstacles that can cause the pig to get stuck, such as welds, bends, pipe deformation, scaling, corrosion, and the like [11].

Currently, the release of a pig from a stoppage can be divided into two ways: forward push and backward push. The forward push means the release of a pig from a stoppage by increasing the upstream pressure and/or decreasing the downstream pressure. If the forward push is failed, backward push can be considered in some cases, i.e., increasing the downstream pressure and/or decreasing the upstream pressure to push the pig out of the pipeline through the inlet. In these situations, the pig can easily reach a very high speed that would be dangerous for the pipe and the pig itself [12–14]. The pig can easily cause damage and deformation to its cups by passing a bend at high speed or encountering obstacles inside the pipe [15]. At present, the operator seems to be unaware of the specific maximum speed that a pig can reach during the startup process. Therefore, it is difficult to consider the impact of high speed on the pig in the design of the pig.

To understand the dynamic behavior of the pig, the pig dynamic equation must be solved together with the governing equations of flows [2, 16]. The method of characteristics (MOC) was employed to transform the partial differential equations of flows to ordinary differential equations. This method is quite efficient to solve the governing equations of transient gas flows [17–19]. Mirshamsi et al. considered the pig train as a chain not a particle and presented the dynamics of a long pig travelling through gas pipe [20]. Xu and Li developed a pigging mathematical model coupling with the quasi-steady state flow model [21].

A literature survey reveals that very few papers pay attention to the maximum speed of pig as it restarts from a stoppage in gas pipeline. This paper deals with the dynamic model of the process of a normal pig restarting from a stoppage in horizontal gas pipeline. The equations for unsteady gas flow in pipe are solved by MOC. Then the differential pressure between pig tail and nose is gotten from MOC results. Thus the pig dynamic equation is solved by Runge-Kutta method. The process of a pig restarting from a stoppage in gas pipeline is simulated. The results indicate that the maximum speed a pig achieves from a stoppage is primarily determined by the pressure of the pipe and the pressure change caused by the obstructions. Furthermore, RSM is used to study the maximum speed of pig. Based on the results of the RSM simulations, an empirical formula is present to predict the maximum speed of a pig restarting from a stoppage in gas pipeline.

#### 2. Mathematical Modeling

##### 2.1. Pig Dynamic Equation

Figure 1 shows a small pig moving inside a pipeline. The dynamic equation of the pig is as follows:In this equation, is the mass of the pig, is the friction force between the pig and the pipeline wall, and is the inclination angel of the pipeline. To simulate the process of pig restarting from a stoppage, we assume the friction force is much higher at a given position; i.e., ( is cross-sectional area of pipe). At other positions, the friction force remains at a normal level; i.e., . The driving force is derived from the differential pressure at the tail and nose of the pig which are calculated from upstream and downstream flow dynamics in each calculation step.

The driving force is derived from the pressure difference between the tail and front of the pig. The pressure difference is calculated by the upstream and downstream flow dynamics in each calculation step [22].

##### 2.2. Gas Flow Model in Pipeline

The following assumptions are adopted to simplify the model:

(1) The gas is ideal gas.

(2) The fluid in the pipeline is a single-phase gas.

(3) The gas flow is quasi-steady heat flow.

(4) The stiffness of the pipeline is large enough to keep the diameter unchanged during pigging.

The transient flow dynamics can be modeled based on the continuity equation, momentum equation, and energy equation, respectively, as follows [17, 18]:where, , , , , , and are the velocity, density, pressure, distance, gravity parameter, and time, respectively. In addition, , , , , , and are the angle between the centerline and the horizontal plane, cross-sectional area of the pipe, pipe perimeter, ratio of specific heat, rate of heat inflow, and the friction force per unit pipe length, respectively. From perspective of the fluid mechanics books and papers, the friction factor and the friction force are given, respectively, as follows [23]:where, , , , and are the Reynolds number, diameter of the pipe, pipe wall roughness, and friction factor, respectively. Equations (2) ~ (4) can be rewritten in the following form:where

Equation (7) can be transformed into ordinary differential equations which can be integrated by finite differences. Matrix has 3 real eigenvalues :where is the wave speed. A compatible equation is obtained by multiplying the eigenvectors of the system. The eigenvectors of matrix are

For each pair of and , (7) can be rewritten in the form as follows:

By writing (7) along the characteristics line, now we get the compatibility equations:

Figure 2 shows the relationship between fluid variables , , and at the time step and at following time step . At the time step , variables , , and at grid points , , and are obtained from linear interpolation of the data on , , and . Then the gas flow parameters at point can be derived from previous calculated grid points , , and .

According to the characteristic lines in Figure 2, based on the linear interpolation, (15) ~ (17) can be obtained [17]. In these equations, will be replaced by the desired calculating value* u*,* p*, or* ρ*.

According to (12)~(14), we getwhere

The sampling time, , and the sampling distance, , are chosen under the CFL stability condition [23].

##### 2.3. Initial and Boundary Conditions

To analyze the restarting process of a pig in horizontal gas pipeline, we made the following assumption: the pig stopped in the pipeline and the gas stopped flowing. It means at the initial moment, the gas velocity is zero and the pressure is equal everywhere.

It is assumed that the upstream and downstream gas flows are fully coupled to the pig. Therefore, the velocity of gas at the tail and nose of the pig is equal to that of the pig [17, 18].

Three kinds of boundary conditions are used: (1) constant inlet flow rate and constant pressure at the outlet, simulating the releasing of a stuck pig by increasing upstream pressure; (2) constant inlet pressure and constant flow rate at the outlet, simulating the releasing of a stuck pig by pressure relief of downstream; (3) constant inlet flow rate and the outlet pressure to decrease in the rate of inlet pressure increase, which simulates the unstuck pig in the way of inlet pressurization together with outlet relief.

##### 2.4. Numerical Solution

To simulate the pigging process in gas pipeline, the pipe is divided into two sections: one behind the pig and the other in front of it. Figure 3 shows the computational scheme of the fluid-solid coupling process. At time step , the dynamic equations for both upstream and downstream gas flows are solved, to get the differential pressure between pig nose and tail. In the next step, the Runge-Kutta method is applied to solve the speed equation of the pig, thus obtaining the speed and the new position of the pig.

As the pig moves across one or more grids during time step , the grids on upstream and downstream of flows must be updated for calculating the gas parameters. Then, the pressure difference between the tail and nose of the pig can be obtained to calculate the pig motion at time step . The calculations should be repeated until the pig arrives at a given position in pipeline or the time step reaches the deadline.

#### 3. Parametric Sensitivity Analysis of Pig Restarting from a Stoppage

In this section, a 6 km horizontal gas pipeline is used for the simulation of pig restarting from a stoppage. Values of the parameters adopted are shown in Table 1. The pig is assumed to stop at a position 3 km from the inlet of the pipeline. The unlocking of a pig by increasing upstream pressure and/or decreasing downstream pressure is discussed.

Figure 4 illustrates the pig speed due to different pressure strategies to release it. For all cases, high velocity is attained when the pig starts moving (reaching 17 m/s), due to the need to overcome the contact force. Additionally, the pig speed of increasing upstream pressure is slightly lower than the pig speed of decreasing downstream pressure. The maximum speed a pig achieves from a stoppage, in the way of inlet pressurization together with outlet relief, is between the maximum speed corresponding to the inlet pressurization and that of outlet relief. Furthermore, the speed curve of inlet pressurization together with outlet relief oscillates sharply after its highest speed. The pig gradually stabilized after about 500 m from the starting position.

Pressure on the nose and tail of the pig in the three conditions is shown in Figure 5. It shows that the pig starts to move at the time the pressure difference between the tail and nose of the pig, generated by a decrease of the pressure on pig nose and/or an increase of the pressure on pig tail, overcomes the obstruction (5 bar). As the pig runs at a high speed, the pressure on its tail decreases and the pressure on its nose increases rapidly, because of the compression generated by the pig.

**(a)**

**(b)**

**(c)**

The distributions of gas parameters are shown in Figure 6, which shows that the gas density is directly related to its pressure. The gas velocity is affected by the speed of the pig. When the pig moves at high speed, the shock wave of the gas velocity will continue to move forward. Based on the parameters used in this paper, the pig drive pressure is established in a shorter time in the way of inlet pressurization together with outlet relief.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(g)**

**(h)**

**(i)**

Parametric sensitivity analysis of pig restarting from a stoppage in a horizontal gas pipeline is then carried out. To release a pig from a stoppage in the way of increasing upstream pressure of decreasing downstream pressure is discussed. As shown in Figures 7 and 8, it seems that the following parameters have little effect on the maximum speed of pig: mass of the pig, pipe diameter, position of the pig, and the length of the pipeline. The maximum speed a pig reached in the two conditions of restarting is primarily determined by the pressure of the pipe and the pressure change caused by the obstructions.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

**(f)**

Examining Figure 7(d), it can be seen that the pipeline length presents a larger influence on the results, especially for short pipelines, since the amount of gas contained therein is reduced. Actually, the gas pipeline is relatively long, and the pipeline inlet and outlet are generally connected to a storage tank or another pipeline. Therefore, the shorter pipeline is not discussed further.

#### 4. Calculation of Maximum Speed of Pig from a Stoppage 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 and each factor and to find the best combination of each factor level [24, 25]. In this study, RSM is used to study the maximum speed of a pig restarting from a stoppage in horizontal gas pipeline. The pressure of the pipeline and the change of gas pressure (inlet and/or outlet) caused by the obstructions are discussed in the simulations. The maximum speeds pig achieved in the three conditions are listed out in Table 2.

The results show that the maximum velocity obtained by inlet pressurization is close to that obtained by outlet depressurization. Moreover, the maximum speed a pig reaches, in the way of inlet pressurization together with outlet relief, is generally between the maximum speed corresponding to the inlet pressurization and that of outlet relief. Hence, an empirical formula for estimating the maximum speed a pig achieves from a restarting process, obtained from the average of the three results of the RSM simulations, is as follows.

In this equation,* v*_{max},* p,* and* F*_{obs} are maximum speed pig achieves from a stoppage by increasing upstream pressure and/or decreasing downstream pressure [m/s], gas pressure [bar], and pressure change of the inlet and/or outlet of the pipeline caused by a stoppage [bar], respectively. The residuals of (25) are figured out in Figures 9(a) and 9(b), respectively. The residuals indicate that the formula obtained is in good agreement with the results of the RSM simulations.

**(a)**

**(b)**

**(c)**

Compared with (25), the residuals of the maximum speed a pig reached in the way of inlet pressurization together with outlet relief or by increasing upstream pressure and by decreasing downstream pressure are figured out in Figures 9(a), 9(b), and 9(c), respectively. The residuals indicate that the formula obtained is in good agreement with the results of the RSM simulations. It should be noticed that when the pig is released from an obstacle that requires a high pressure change of inlet/outlet (up to 8 bar) in a low pressure gas pipeline (about 20 bar), the maximum speeds a pig reaches in different ways are quite different.

Model graphs of the obtained formulas are shown in Figure 10. Obviously, when a pig encounters an obstacle that generates a high pressure change in a low pressure pipeline, the pig is easy to reach high speeds during its start-up process. Furthermore, the maximum speed a pig reaches in high pressure gas pipeline (up to 80 bar) is much lower than that in low pressure gas pipeline.

#### 5. Conclusion

A calculation scheme using MOC to solve the equations of gas flow for estimating the pig dynamics has been shown. The process of a pig restarting from a stoppage in gas pipeline was simulated. The maximum speed a pig achieved from a stoppage was studied using RSM.

The results of the parametric sensitivity analysis of the start-up process indicate that the maximum speed a pig achieves from a stoppage is primarily determined by the pressure of the pipe and the pressure change caused by the obstructions.

An empirical formula for estimating the maximum speed of a pig restarting from a stoppage in gas pipeline is obtained from the results of the RSM simulations. The maximum speed of pig restarting from a stoppage in horizontal gas pipeline can be predicted based on the gas pressure and the pressure change of upstream and/or downstream. The empirical formulas obtained would contribute to pig design and safe pigging.

#### 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 was supported by the Graduate Innovation Foundation of School of Mechatronic Engineering of SWPU (CX2014BY09).