Journal of Petroleum Science and Engineering 62 (2008) 102–11 110 0
Contents lists available at ScienceDirect
Journal of Petroleum Science and Engineering j o u r n a l h o m e p a g e : w w w. e l s ev i e r. c o m / l o c a t e / p e t r o l
Design and control of pig operations through pipelines S.T. Tolmasquim a, A.O. Niec Nieckele kele b,⁎ a b
Petrobras Transporte S. A., Av. Presidente Vargas 328, Centro, 20091-060, Rio de Janeiro, RJ, Brazil Department of Mechanical Engineering, Pontifícia Universidade Católica de Rio de Janeiro, PUC/Rio, R. Marquês de São Vicente 225, Gávea, 22453-900, Rio de Janeiro, RJ, Brazil
a r t i c l e
i n f o
Article history: Received 16 November 2006 Accepted 13 July 2008 Keywords: pigging oil pipeline oil displacement gas–liquid control valve
a b s t r a c t
To provide an ef �cient tool to assist in the control and design of pig operations through pipelines, a numerical code has been developed, based on a � nite difference scheme. It allows the simulation of two- �uid transient �ow, i.e. liquid–liquid, gas–gas or liquid–gas products in the pipeline. Modules to automatically control process variables were included to employ different strategies to reach an ef �cient operation. Different test cases were investigated to con�rm the robustness of the method. The results obtained with the code were compared with a real oil displacement operation of a section of the OSPAR pipeline, with 762 mm diameter and 60 km length, owned by Petrobras; there was good agreement between the two, thereby validating the method. © 2008 Elsevier B.V. All rights reserved.
1. Introduction
Pigging is a common practice in the petroleum and natural gas industry. In general terms, a pig is a solid plug that is introduced into the pipeline to be serviced. Fluid is pumped upstream of the pig to provid pro vide e thenece thenecessa ssary ry for force ce to setthe dev devicein icein mot motion ion,, andto per perfor form m the desired task, i.e., removing deposits from the pipe wall, removing water from the pipeline or driving an inspection tool. The use of pigs has become a standard industry procedure. A great variety of pig models is available for each particular application. A dif �culty often faced by the engineer when designing a pigging operation is the lack of reliable tools for the prediction of the many variables related to the motion mot ion of the pig thr throug ough h the pipeline pipeline.. Mos Mostt of the availab available le knowledge is based on �eld experience. Hence, there is often some guesswork and, consequently, consequently, a degree of uncertainty in selecting the bestt pig by es bes estim timati ating ng its spe speed, ed, the re requ quire ired d dri drivin ving g pre press ssure ure,, and the � uid. amount of backward/forward bypass of � The pipeline network all over the world is becoming older, and at the same time conc concern ern over envi environm ronmenta entall issu issues es has mar markedl kedly y increased. Pipeline operators are investing in inspection and maintenance with the object of extending the lifetime of their pipelines. However, to be able to execute repairs, it is necessary to empty the entire enti re pipe pipeline line or sect sections ions betw between een pump stati stations, ons, keep keeping ing valv valves es and accessories installed. In many cases, oil is displaced from the pipeline by inje injection ction of inert inert gas, empl employin oying g a sealing sealing pig at the interfa interface ce of the
Corresponding author. Tel.: +55 21 3527 1182; 1182; fax: +55 21 3527 1165. 1165. E-mail addresses:
[email protected] addresses:
[email protected] (S.T. (S.T. Tolmasquim Tolmasquim), ),
[email protected] [email protected] (A.O. Nieckele). ⁎
0920-4105/$ – see front matter matter © 2008 Elsevier B.V. All rights reserved. reserved. doi:10.1016/j.petrol.2008.07.002 doi: 10.1016/j.petrol.2008.07.002
�uid uids. s. Thepig vel veloc ocity ity is dir direc ectlyrela tlyrelatedto tedto theseali thesealing ng ef �cie cienc ncy y of the
pig, andrequ pig, andrequir ires es tha thatt theliqu theliquid id �ow rat rate e be mai mainta ntaine ined d wit withincerta hincertain in limits. The � ow rate and the pressure distribution depend directly on the pro�le and on the fact that while gas � ows in one section of the pipeline there is liquid in another section. Therefore, the operational design should also account for the pressure distribution along the pipeline, in order to guarantee the level of operating pressure in the pipeline, pipel ine, avoiding avoiding the occur occurrenc rence e of eith either er slac slack k �ow or ex exces cesss pressure. A typical sealing pig is formed by piston-type cups attached to a cylindrical body (Fig. (Fig. 1a). 1a). In order to produce ef �cient sealing, pigs have nominal diameters larger than the pipe diameter. Fig. 1(b) 1(b) is a sketch ske tch of a sea sealin ling g ope opera ratio tion. n. Gas pumped pumped ups upstre tream am of the pig provides the necessary pressure difference to overcome the contact force at the wall, to displace the liquid downstream of the pig and to accelerate the pig. A fe few w pa pape pershav rshave e de deal altt wi with th th the e mo moti tionof onof pi pigs gs inpipe inpipeli line nes. s. In on one e of the �rst investigat investigations ions on piggi pigging ng of gas–liquid pipelines McDonald pipelines McDonald and Bake Bakerr (1 (1964) 964) assumed assumed a succ successi essive ve stea steady-s dy-state tate appr approach oach to model the phenomena, what leads to large calculation errors. Webb et al. (1987) investigated (1987) investigated the use of an inert gas to displace oil from a long lon g pip pipeli eline,and ne,and the they y me menti ntion on the con contro troll of the oil �ow byan ou outl tlet et valve. Kohda valve. Kohda et al. (1988) employed (1988) employed a pigging model with a drift � ux model mod el fora two two-ph -phasetrans asetransien ientt �ow ow,, and Mina Minami mi and Shoha Shoham m (1 (1996) 996) coupled the pigging model with the Taitel et al. (1989) quasi-steady gas-�ow model. Santos model. Santos et al. (2001) developed (2001) developed a model to predict the pig dynamics applied to Gas-Lift operations. Nguyen operations. Nguyen et al. (2001) and (2001) and Kim et al. (2003) (2003) studi studied ed the dynam dynamics ics of pigs through through pipelin pipelines es usin using g the meth method od of char characte acterist ristics, ics, and Aze Azeve vedo do et al. (200 (2003) 3) use used d the �nite difference method. Nieckele method. Nieckele et al. (2001) investigated several pigging
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
103
where D and Dref are the pipeline diameter and the reference diameter determined at atmospheric pressure P atm and C D is the pipe deformation coef �cient due to pressure. In deriving C D, w is the pipe wall thickness, E is the Young's modulus of elasticity of the pipe material, and ν the Poisson's ratio. The diameter is determined from D¼
Dref 1 ð C D =2Þð P P atm Þ −
ð3Þ
−
Assuming that the angle between the center line of pipe and the outer line of pipe very small to be ignored, the linear momentum equation can be written as @ V @ V 1 @ P f jV jV þ V ¼ g sin α @ t @ s ρ @ s 2 D −
Fig. 1. Sealing pig. (a) Typical sealing pig. (b) Schematic view of a sealing pig inside a pipeline.
operations, including the dewatering operation in a riser for an isothermal situation, by the �nite difference method. Recently, Xu and Gong (2005) developed a simpli�ed pigging model for predicting the pigging operation in gas-condensate horizontal pipelines with low liquid-loading; this couples the phase-behavior model with the hydro-thermodynamic model. The objective of the present work is to simulate the transient oil displacement of a pipeline employing a sealing pig. To achieve an ef �cient operation, a method was developed to automatically control process variables. Test cases are presented to illustrate the robustness of the method, which considers a PID (Proportional, Integral and Derivative) controller. To validate the code developed, a transient oil displacement of a pipeline employing a sealing pig is simulated and the results are compared with � eld data. 2. Mathematical modeling
The motion of a pig inside a pipeline during an operation to displace oil by injection of nitrogen can be obtained by the solution of the �uid �ow problem coupled with a model to predict thepig motion. The upstream � uid is gas, while the downstream � uid is liquid. Both areconsidered to be Newtonian. Forthe present work, the �uid �owis isothermal. The pipeline is inclined in relation to the horizontal direction, at an angle α . Pipe deformation due to pressure variations along the �ow is considered. The governing equations for the �uid are the continuity and momentum equations. The mass conservation equation can be written as (Wylie and Streeter, 1978) @ P @ P ρ a2 @ V ρ a2 V @ A þ V þ þ ¼0 n @ s n A @ s @ t @ s
ð1Þ
p ffiffi ffi ffi ffi
n¼
1 v2 D C D ; C D ¼ Dref Dref wE
−
ð2Þ
ð4Þ
−
where g is the acceleration due to gravity, α is the angle of the pipe center line with the horizontal direction. f is the hydrodynamic friction factor coef �cient, which depends on the Reynolds number, Re= ρ |V | D/ μ , where μ is the absolute viscosity. In the turbulent regime, the friction factor is also a function of the pipe roughness ε . To simplify the solution, the friction factor is approximated by its fully developed expression. For a laminar regime, Re b 2000, it is speci �ed as f =64/Re. For the turbulent regime, Re N 2500, the friction factor is approximated by Miller's correlation (Fox and McDonald, 2005), f =0.25 {log [( ε / D)/3.7+5.74/Re 0.9 ]} − 2 . Between Re =2000 and Re=2500, to avoid sharp transition, a linear variation of the friction factor with the Reynolds number was assumed from its laminar to the turbulent value. The coupling of the pig motionwith the �uid �ow in the pipeline is obtained through a balance of forces acting on the pig, together with an equation that represents the drop in �uid pressure across the bypass holes in the pig (Azevedo et al., 2003). The force balance on the pig can be written as m
dV p ¼ ðP 1 P 2 Þ A m g sin α F at V p dt −
−
−
ð5Þ
where V p is the pig velocity, m the pig mass, P 1 and P 2 the pressure on the upstream and downstream faces of the pig and F at(V p) the contact force between the pig and the pipe wall. The contact force F at(V p) depends on xp, the axial pig position inside the pipeline, indicating that the contact force can be allowed to vary along the pipe length. When the pig is not in motion, the contact force varies from zero to the maximum static force in order to balance the pressure force due to the �uid �ow. Further, since the pig may resist differently being pushed forward or backward, the maximum static force for a negative pressure gradient is F sneg tat , while for a positive pressure gradient it is F spos . Once the pig is set in motion by the � ow, tat the contact force assumes the constant value F dyn; this represents the dynamic friction force, which is generally different from the static force. As in the previous situation, two different values for the pos dynamic contact force are allowed, F dneg yn and F dyn, depending on the direction of the pig motion.
(
F at V p ¼ F xp where
where V , P and A are the velocity, pressure and cross-section area, respectively, and s is the �ow direction. The �uid properties are density, ρ, and isothermal speed of sound,a. The wave speed is a2 =n, where the coef �cient ξ is given by 1 þ ρ a2
−
F at V p ¼
neg F dyn xp pos F dyn xp −
neg pos F stat xp F xp F stat xp
−
if if
V p<0 V p N0
if V p 0 ð6Þ ≈
ð7Þ
2.1. Moving coordinates Since the pig moves in the computational domain, it is convenient to employ a coordinate system, η , that stretches and contracts in the
104
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
pipe, depending on the pig position. The �uid �ow conservation equation must then be rewritten for the new coordinate system (Nieckele et al., 2001) as ρa2 h η n @ V ¼ 1 @ η P h η ρ
26 37 26 4 5 4
~ @ P V @ P þ þ @ t V h η @ η V
~ ρ a2 V @ A n A h η @ η g sin α
−
−
3 2 3 75 4 j j 5 −
0 f V 2D
P V
ð8Þ
The absolute velocity V is equal to V + ug, where V is the relative velocity and u g = (∂s/∂t ) η is the grid velocity. h η =(∂s/∂ η )t is the metric that relates the two coordinates. ˜
˜
2.2. Fluid properties The gas is considered to be a quasi-ideal gas; thus, the equation of state for an isothermal � ow is
ρ ¼ P =a2 ; where
a¼
q ffiffi ffi ffi ffi ffi ffi ffi ffi ffi ffi
Z Rgas T ref ;
ð9Þ
where R gas is the gas constant, T ref the reference temperature, Z the compressibility factor and a the isothermal speed of sound. For the liquid, the following relationship between density and pressure was considered,
ρ ¼ ρref þ ðP P ref Þ=a2
ð10Þ
−
where ρref is the reference density evaluated from the reference pressure P ref . The liquid speed of sound a was de�ned as constant. For each � uid, the absolute viscosity was considered as a function of pressure in accordance with the following expression (ASTM D34187, 1987):
μ ¼ μ ref exp c μ ;p ðP P ref Þ ; −
ð11Þ
where μ ref is the absolute viscosity evaluated at the reference pressure P ref with coef �cient c μ ,p.
The operations investigated in this model begin with the pipeline with liquid and with no �ow. Therefore, the initial condition corresponds to a zero velocity along the pipeline. The hydrostatic pressure distribution between two nodes can be obtained by integrating Eq. (4), considering the density variation with pressure, Eq. (10). Beginning from the known pressure at the highest elevation of the pipeline, the pressure P s + ds, at position s + ds is obtained from the pressure at the adjacent node P s as �lled
ðP S P ref Þ þ ρref a 2 1 exp g Δ z=a2 P sþds ¼ P ref þ expð g Δ z=a2 Þ
−
ð12Þ
where z = s sin α is the vertical coordinate. To solve the conservation equation, Eq. (8), two boundary conditions are necessary; these can be known pressure, known mass �ow rate or an equation that relates mass �ow rate and pressure, representing a valve connecting the pipeline to a reservoir. For the last case, the mass � ow rate at inlet and/or outlet are determined from
s ffiffi ffi ffi ffi ffi ffi ffi ffi ffi ffi
: min ¼ ρin C d A g
o;in
χ
2 P t;in P ρin −
s ffiffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi
: mout ¼ ρout C d A g
o;out
χ
2 P P t;out ; ρout −
3. Process control
The main goal of the system developed to control processes consists in maintaining certain variables within desired operational limits. This control can operate in an opened or closed loop. For the present work a closed loop is employed, where the value of the desired variable is used to re-feed the system, in order to compensate external and internal perturbations of an industrial process ( Fig. 2). The controller compares the desired value with the measured value, and if there is a discrepancy between these values, the controller manipulates its output in order to eliminate the error. For example, if themeasured maximum pressure is notthe desired value, the opening of a valve at the inlet of the pipeline is altered, in order to maintain the process variable within the desired value. There are situations in which it is necessary to simultaneously control two variables of the process. For example, if one wishes to control the pig velocity and the minimum pressure with the pipeline outlet valve. If the measured pig velocity is not the desired value, a new setting for the outlet valve is determined. The appropriate outlet value opening is also determined based on the desirable minimum pressure. To guarantee that both variables are within the desirable values, the minimum outlet value opening is imposed to the process. Fig. 2(b) illustrates this situation, where the smallest output from the two controllers is employed to re-feed the system. 3.1. PID controller A PID controller generates its output proportionally to the error between the desired and measured quantity, the integral of the error and the derivative of the error. Its output u(t ) is given by the following expression (Isermann, 1981) 1 t deðt Þ ; uðt Þ ¼ K eðt Þ þ ∫ 0 eð τ Þdτ þ T D T I dt
2.3. Initial and boundary conditions
−
where (C d Ag)o is the product of the valve discharge coef �cient and the area for the valve completely open. P t is the reservoir pressure, upstream or downstream of the valve, and χ is the percentage of valve opening. The subscripts in and out refer to the inlet and outlet sections of the pipe.
ð13Þ
ð14Þ
ð15Þ
where e(t ) is the error and the multiplier factors K, T I and T D are known as the controller gain, the integral time and derivative time, respectively. The controller error can be de �ned as (Grimble, 2004) eðt Þ ¼ ðPV ð t Þ SP Þ CA −
;
CA ¼ 1 or 1; −
ð16Þ
where PV(t ) is the process variable, SP is the set point to control the process variable and CA is the controller action. This action can be direct or reverse. For a direct action controller, when the process variable increases, the output of the controller also increases, i.e., the variable is maintained at the set point or above it. The controller with reverse action decreases its output when the process variable increases, thereby maintaining the variable at or below its set point. 4. Numerical method
The set formed by the pig and �ow equations, Eqs. (5) and (8), together with the appropriate boundary and initial conditions, requires a numerical method to obtain the desired time-dependent pressure and velocity �elds. These equations were discretized by a �nite difference method. A staggered mesh distribution was selected to avoid unrealistic oscillatory solutions, as recommended by Patankar (1980). The equations were integrated in time by a totally implicit method. The space derivatives were approximated by the central
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
difference method around the mesh point. The resulting coef �cient matrix is penta-diagonal, and can be easily solved by a direct pentadiagonal algorithm. The total number of grid points inside the pipe was maintained constant in the numerical calculations of the � ow � eld upstream and downstream of the pig as well as for the pig dynamics calculations. However, as thepig moves along thepipe,it is convenient to rearrange the node distribution. The number of grid points upstream and downstream of the pig was made proportional to the length of the pipe at each side of the pig. 5. Analysis of test cases
Two study cases are presented here to illustrate the method of control of the inlet or outlet valve opening to maintain the pig velocity as well as the maximum and minimum pressure values inside the pipeline underdesirable limits. Finally, to validate the method, a liquid displacement operation in the OSPAR oil pipeline is examined. 5.1. Case 1—Pig velocity and minimum pressure control The �rsttest case consists in oilremoval from a horizontal pipeline by : the injection of nitrogen. A constant mass �ow rate of nitrogen min equal to 7.0 kg/s is imposed at the entrance. There is a valve at the pipeline outlet. The reservoir pressure beyond the valve P t,out is 196 kPa, and the fully open valve discharge coef �cient (C d Ag)o,out is 0.02 m2. The oil properties are: ρ =900 kg/m3, a =1318 m/s and μ =70 cP at P ref =101 kPa. The nitrogen properties are: Rgas = 296.9 N·m/(kg·K), z =1.04 and μ =0.015 cP at P ref =101 kPa, T ref =20 °C. The pipeline characteristics are: length L =40 km, diameter D ref =457 mm, wall thickness w =9.53 mm, roughness ε =45.7 μ m, Young's modulus of elasticity E =2.1×105 MPa, Poisson's ratio ν = 0.3. The maximum allowable operating pressure (MAOP) was set equal to 3.82 MPa. The pig mass m is 20 kg and its pos neg pos contact forces are: F sneg tat =F stat =F dyn =F dyn =29.6 kN, corresponding to a pressure difference Δ P =P 1 − P 2 =196 kPa across the pig. During the operation it is desirable to maintain pig velocity at around 2 m/s, and a minimum pressure along the whole pipeline of 490 kPa.
105
Initially, the problem is solved without any control. At time zero, the outlet valve is completely openedin 1 s and kept this way.Then, to illustrate the performance of the control method, both pig velocity and minimum pressure are controlled by a valve at the outlet of the pipeline. To control the pig velocity, the controller parameters of Eq. (15) are set as K =0.1, T I =0 s and T D =20 s, with a set point SP equal to 2 m/s. The minimum pressure control parameters are: K = 10− 6, T I =0 s, T D =20 s and SP=490 kPa. Fig. 3 presents the pressure variation with time at six positions distributed along thepipelinefor thecase without PID control (Fig. 3a) and with PID control (Fig. 3b). The maximum allowable operating pressure (MAOP) is also indicated at the � gures. The presence of the pig causes a very large pressure gradient at the pipeline entrance (s =0 km) at the beginning of the operation. For this case the maximum pressure is not a problem, since all pressures are always inferior to MAOP (Fig. 3). As the mass � ow of nitrogen is constant at the pipeline entrance, the pressure needed to maintain the � ow rate diminishes as oil is replaced by nitrogen. At other positions the pressure increases with time until the pig passes through that position. The pressure jump across the pig can easily be seen by the vertical pressure variation at each location. After the passage of the pig, since the gas head loss is very small, the pressure distribution is very similar to the entrance pressure. Itcanbe seenin Fig. 3a that without PID control the pressureat the exit of the pipeline (s = 40 km) is approximately constant during almost all operation, slightly superior to the reservoir pressure of 0.196 MPa and below the minimum desirable pressure of 0.490 MPa. After 5 h of operation it rapidly increases as the head loss through the valve also increases owing to the high �ow rate of the liquid. With PID control (Fig. 3b) the exit pressure is kept above 0.490 MPa during the whole operation. Fig. 4 illustratesthe variation of thepig velocity with time. Without PID control the pig velocity continuously increases with time (Fig. 4a), since the oil resistance decreases. When PID control is activated (Fig.4b) the pig velocity doesnot surpass the velocityof 2 m/s which is its set point. Without PID control the outlet valve is completely opened in 1 s, however when the PID control is activated, the opening of the outlet
Fig. 2. Control system in a closed loop. (a) one variable. (b) two variables.
106
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
Fig. 3. Case 1. Pressure variation with time at s =0, 10, 20, 30, 35 and 40 km. (a) Without PID control. (b) With PID control.
valve is delayed. Further, in order to guarantee the minimum desired pressure, only 40% of the valve is opened at the beginning of the process (Fig. 5). Then the valve is gradually opened reaching the
maximum opening of 60% after about 4 h from the start of the operation, when the pig velocity reaches 2 m/s. At this moment, the outlet valve begins to close to maintain the pig velocityat theset point (Fig. 4b). 5.2. Case 2—Pig velocity and maximum pressure control The second test case has a variable topography pro �le (Fig. 6), in which each pipeline segment is 5 km in length.The same pipe and oilas in thepreviousexample areemployed with MAOP setat 4.5MPa. Thepig pos neg pos mass is 27 kg and its contact forces are F sneg tat =F stat =F dyn =F dyn =18.4 kN, corresponding to a pressure difference ΔP of 98 kPa across the pig. Initially, there is no � ow, the pipe is full of oil and the hydrostatic pressure distribution is prescribed, where the pressure is set as 294 kPa at the highest point of the pipeline. The operation begins by
Fig. 4. Case 1. Variation of pig velocity with time. (a) Without PID control. (b) With PID control.
Fig. 5. Case 1. Percentage of outlet valve opening during the operation with PID control.
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
Fig. 6. Pipeline pro�le.
injecting nitrogen into the pipeline. After 120 s, a constant mass � ow rate of nitrogen equal to 9.0 kg/s is imposed at the entrance. At the pipe outlet there is a valve connected to a reservoir at atmospheric
107
pressure (P t,out =101 kPa). The fully open valve discharge coef �cient (C d A g)o,out is 0.025 m2. Again, both pig velocity and minimum pressure are controlled by the outlet valve opening. To control de pig velocity, its set point is SP=1.6 m/s, with the following control parameters: K =0.1, T I =0 s and T D = 16 s. The minimum pressure control parameters are: K = 10− 6, T I =0 s, T D =20 s and its set point is SP=101 kPa. Without activating the controller procedure, the outlet valve is completely opened in 120 s. In this example, the pressure distribution (Fig. 7) depends on two combined effects, i.e., reduction of head loss by the substitution of the oil by nitrogen, and the elevation effect. In the uphill sections, the
Fig. 7. Case 2. Pressure variation with time at 10 positions uniformly distributed. (a) Without PID control. (b) With PID control of V p and P min with outlet valve. (c) With PID control of P max with inlet valve.
108
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
hydrostaticpressure to be overcomereduces as thepig approaches the highest peak, leading to a strongreduction in pressure. In thedownhill sections the opposite occurs, explaining the periodic behavior of the pressure variation with time. After the pig has passed a certain location, the variation in gas pressure is very small and similar to the other stations �lled with gas. At Fig. 7, the maximum allowable operating pressure (MAOP) and minimum desired pressure P min are also indicated. Without PID control the MAOP limit is surpassed (Fig. 7a); however, theminimum pressurelimit is always satis�ed. The pig accelerates uphill owing to the reduction in pressure head, and it decelerates downhill (Fig. 8a). Although the pressure behavior is similar at all peaks, the pig accelerates a little more as it moves along the pipeline as a result of the smaller head loss of N 2. In the �nal segment, pig velocities are very high, since there is no longer a descending segment to reduce this velocity. Two controlled operations are examined. Initially, the pig velocity and minimum pressure are simultaneously controlled. To control the pig velocity (Fig. 8b) the outlet valve is periodically opened and closed (Fig. 9a). As time passes, the valve stays fully opened for successively shorter times, and to control the pig velocity in the � nal segment it is only 18% open. Note, however, that although the pig velocity is controlled and the minimum pressure is never attained, the maximum pressure is again surpassed (Fig. 7b). To control the maximum pressure, an inlet valve is then considered and the control method is applied to it. The inlet reservoir pressure P t,in which feeds the pipeline is 3.92 MPa, and the fully open valve inlet discharge coef �cient (C d Ag)o,in is 0.003 m2. The set point for the maximum � ow rate is SP = 9 kg/s, with the following control parameters: K =0.01, T I =0 s and T D =10 s. In order to absorb the overshoot of the control system, the set point for the maximum pressure is proportional to the maximum allowable operating pressure (MAOP) as SP=MAOP/1.15. The control parameters for the maximum pressure are: K = 10− 7, T I =0 s and T D =20 s. To guarantee that the pressure is always inferior to the MAOP limit ( Fig. 7c) and the mass � ow rate is inferior to 9 kg/s, the resulting maximum inlet valve opening was equal to 83% (Fig. 9b). Due to the pressure increase the valve is closed to control its value. As time passes less nitrogen is needed to displace the pig. Thus, to ensure the desired
Fig. 8. Case 2. Pig velocity (V p) with pig position along pipeline ( xp). (a) Without PID control. (b) With PID control.
Fig. 9. Case 2. Extent of valve opening (%). (a) Pig velocity and minimum pressure PID control with outlet valve. (b) Maximum velocity PID control with inlet valve.
pressure limits the valve is periodically closed and opened, but each time to a smaller percentage (Fig. 9b). 5.3. Case 3—Liquid displacement operation in the OSPAR oil pipeline The OSPAR pipeline is 117 km in length, with an intermediate pumping station at Itararé (60 km). Itsmain purpose is to take oil from the São Francisco do Sul Terminal (SFS) to the re �nery. The oil was removed from the pipeline by the injection of nitrogen, with a 40 kg separator �expig . Owing to the pipeline pro�le (Fig. 10), the oil displacement was from the re �nery in Paraná (REPAR) to SFS, in the opposite direction to the normal operational direction. Liquid nitrogen was stored in a low-pressure cryogenic cylinder. Leaving the cylinder, the nitrogen pressure was raised to the desired level; it was vaporized and then injected into the pipeline. To avoid high pressure at places where the altitude is low, especially near SFS, the valve at Itararé (diameter 762 mm) was kept closed. The alignment employed a valve of smaller diameter (203 mm), which introduced a pressure drop at
Fig. 10. Pro �le of the REPAR-Itararé section pro�le and maximum allowable operation pressure.
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
109
Fig. 11. Variation in pressure over time at the REPAR re �nery.
the station while maintaining the downstream pressure near to atmospheric pressure increasing the controllability of the system. The simulation was carried out from REPAR to Itararé (Fig.10), where the pipeline characteristics are: length L =60 km,diameterDref =762 mm, roughness ε =45.7 μ m, Young's modulus of elasticity E =2.1×105 MPa and Poisson's ratio ν =0.3. The wall thickness w varies from 9.53 mm to 14.3 mm. The maximum allowable operation pressure MAOP is also illustrated in Fig.10. The oil properties were: ρ =828 kg/m3, a=1218 m/s, and μ = 2.6 cP. The nitrogen properties were: Rgas =296.9 N·m/(kg·K), z=1.04 and μ =0.015 cP. The reference pressure and temperature were P ref =101 kPa and T ref =20 °C, respectively. The pig contact forces were all pos neg pos the same (F sneg tat =F stat =F dyn =F dyn), but they varied with the pipe thickness from 85 kN to 83 kN. The pressure variation with time, acquired by the SCADA (Supervisory, Control and Data Acquisition) system, was de�ned as the inlet boundary condition (Fig. 11). At the pipeline section exit at Itararé, no �ow information was available. Therefore, the level variation of the oil receiving tank at SFS (Fig. 12a), also acquired by the SCADA system, was used to de�ne the mass �ow rate at the out�ow boundary. The oil mass � ow rate (Fig. 12b) was obtained by the following expression: : m ¼ ρ N t N t0 =ð t t 0 Þ
−
−
ð17Þ
where N t and Nt0 are the tank levels at time t and previous time t 0, respectively, and ρ is the density. No noise was eliminated from the data to de�ne the simulation boundary conditions.
Fig.12. Variationover time in (a)the level in theSFS oilreceivingtankand (b)mass �ow rate. (a) Receiving tank level. (b) Mass Flow Rate at Itararé.
Fig. 13. Pressure at Itararé. Comparison between simulated and �eld data. (a) Total pigging operation. (b) Detail of the � nal 8 h of the pigging operation.
A comparison between the pressure measured at Itararé and the pressure obtained with the present simulation for the full operation is shown in Fig. 13a, while a detail of the �nal 8 h of the pigging operation is illustrated in Fig. 13b. Owing to the noise of the imposed mass �ow rate at the exit, the resulting pressure at Itararé also presented several oscillations; however, the same pressure level was obtained. A steep variation of the �eld pressure can be observed after 11 h of operation. At that moment, the oil mass �ow rate was high so that the nitrogen pressure at the entrance was suf �cient to displace the pig. However, a short time after this, the pig remained stuck at a low point of the pro �le, and it did not move until the pressure was recovered at REPAR. This behavior can be seen in Fig. 12a, where the oil tank level was kept constant from 11 h to 14 h, indicating that there was no �ow. The pig remained stationary during this time (Fig. 14). To induce movement of the pig, the operator of the process opened a valve at Itararé to reduce the pressure downstream of the pig and thereby increase the pressure difference across it, so that the pig would start to move again. This operation was not considered in the simulation, and this explains the large discrepancy between the simulated and �eld data for pressure during this time. With the
Fig. 14. Pig position with time. Comparison between simulated and � eld data.
110
S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102 –110
pipe blocked, the inlet pressure increased (see Fig. 11), and the pig resumed its progress (Fig. 14). As the pig started to move the pressure level at Itararé recovered and the simulation agreed with the �eld data. A very good agreement can be seen after 13 h (Fig. 13b), with the variation in outlet pressure with time being closely related to the simulated pressure. The outlet pressure is also correlated with the position of the pig (Fig. 14) and the pro�le of the pipeline (Fig. 10). One of the reasons for the discrepancy between the pressure measured and predicted can be related to the fact that the simulation was performed with only one phase present inside the pipeline. However, during the beginning of the operation, the pipeline was operating in slack �ow. After approximately 13 h of operation, the pipeline started to operate without slack �ow until the pig reached Itararé, and this can explain the better agreement at the end of the pigging operation (Fig. 13b). Fig. 15 presents a comparison of the measured nitrogen mass �ow rate with the numerical results obtained here. Fig. 15a illustrates the full operation, where once again oscillations are observed and can be linked to �uctuation in the outlet mass �ow rate. Fig. 15b shows the mass � ow rate for the � nal 8 h of the pigging operation. Although the numerical results present a high level of oscillations, the correct level of mass �ow rate was predicted. The negative mass �ow rate in the simulation can be explained by the presence of slack �ow, which was not considered with the present model. Owing to low pressure, the oil vaporizes; however, since the present numerical model does not predict this phenomenon, the low pressure can only cause an adverse pressure gradient, leading to a theoretical reverse �ow. Further, the data for instantaneous mass �ow rate were indirectly obtained from the pump rotation, leading to considerable uncertainty. In spite of these limitations, the comparison can be considered reasonable, especially after 13 h of the pigging operation (Figs. 13b and 15b). Finally, although the measured data for pig position with time are admittedly few, those that were obtained agree quite well with the modeled data (Fig. 14).
Fig. 15. Mass �ow rateat REPAR. Comparisonbetween simulated and �eld data. (a) Total pigging operation. (b) Detail of the � nal 8 h of the pigging operation.
6. Final remarks
To guaranteean ef �cient and safepigging operation, maximum and minimum pressures in the pipeline as well as pig velocity must be maintained within stipulated limits. Withthe objective of providing an ef �cient tool to assist in the control and design of pig operations through pipelines, a numerical code was developed based on a � nite difference scheme, which allows the simulation of gas–liquid transient �ows in the pipeline. Modules based on the PID controller method to automatically control process variables were included to employ different strategies to achieve an ef �cient operation. The opening of both inlet and outlet valves can be controlled. The test problems presented illustrated the effectiveness of the method. Further, the results obtained with thecodewerecomparablewith those of a real oil displacement operation in a section of the OSPAR pipeline, with 762 mm diameter and 60 km length, owned by Petrobras. Although good resultswere obtained, it is clear that the weakness of the model lies in its inability to account for slack �ow. This is a very important phenomenon which must be included in the code. In fact, at the moment two different approaches are being implemented to account for slack �ow. In the �rst approach, the two-�uid model is being implemented downstream of the pig, while only gas is considered upstream. In the second approach, a cavitation model predicts the oil vaporization for pressures inferior to the oil vapor pressure. Acknowledgement
The second author acknowledges the support awarded to this research by the Brazilian Research Council, CNPq.
References ASTM D341-87, 1987. Standard Viscosity Temperature Chart for Liquid Petroleum Products. Azevedo, L.F.A., Braga, A.M.B., Nieckele, A.O., Souza Mendes, P.R., 2003. Simulating Pipeline Pigging Operations, 3 rd Edn. . Pipeline Pigging & Integrity Technology. Clarion Technical Publishers, Houston, TX, pp. 79–107. Fox, R.W., McDonald, A.T., 2005. Introduction to Fluid Mechanics, 5th Edn. Wiley. Grimble, M.J., 2004. Integral Minimum Variance Control and Benchmarking. . Journal of Process Control, vol. 14(2). Elsevier Science, pp. 177–191. Isermann, R.,1981. Digital Control Systems, Revised and Enlarged Translation of Digitale Regelsysteme 1977. Springer-Verlag, Berlin. Kim, D.K., Cho, S.H., Park, S.S., Rho, Y.W., Yoo, H.R., Nguyen, T.T., Kim, S.B., 2003. Veri�cationof thetheoreticalmodel foranalyzing dynamic behaviorof thepig from actual pigging. KSME Int. J. 17 (9), 1349–1357. Kohda, K., Suzukawa, Y., Furukwa, H., 1988. A new method for analyzing transient � ow after pigging scores well. Oil Gas J. 9, 40–47. McDonald, A., Baker, O., 1964. Multiphase �ow in (gas) pipelines. Oil and Gas Journal, 62 (24): 68–71, 62(25): 171 –175, 62(26): 64 –67, 62(27): 118 –119. Minami, K., Shoham, O., 1996. Pigging dynamics in two-phase �ow pipelines: experiment and modeling. Int. J. Multiph. Flow 22 (1), 145–146. Nieckele, A.O., Azevedo, L.F.A., Braga, A.M.B., 2001. Transient pig motion through pipelines. J. Energy Resour. Technol. ASME 123, 260–269. Nguyen, T.T., Kim, S.B., Yoo, H.R., Rho, Y.W., 2001. Modeling and simulation for pig � ow control in natural gas pipeline. KSME Int. J. 15 (8), 1165 –1173. Patankar, 1980. Numerical Heat Transfer and Fluid Flow. Hemisphere Publishing Corporation. Santos, O.G., Bordalo, S.N., Alhanati, J.S., 2001. Study of the dynamics, optimization, and selection of intermittent gas-lift methods—a comprehensive model. J. Pet. Sci. Eng. 32 (2), 231 –248. Taitel, Y., Shoham, O., Brill, J.P., 1989. Simpli�ed transient solution and simulation of two-phase � ow in pipelines. Chem. Eng. Sci. 44 (6), 1353–1359. Webb, S., Bogucz, E., Levy, E., Barret, M., Snyder, C., Waters, C., 1987. Evacuation of a residual oil pipeline by inert gas displacement. SPE Prod. Eng. 14042, 45 –50. Wylie, Streeter, 1978. Compressible Flow in Pipes. McGraw Hill. Xu, X.X., Gong, J.,2005. Pigging simulation for horizontal gas-condensate pipelines with low-liquid loading. J. Pet. Sci. Eng. 48 (3–4), 272–280.