+ All Categories
Home > Documents > Design and Control of Pig Operations Through Pipelines

Design and Control of Pig Operations Through Pipelines

Date post: 28-Dec-2015
Category:
Upload: pedriim
View: 38 times
Download: 1 times
Share this document with a friend
Popular Tags:
9
Design and control of pig operations through pipelines S.T. Tolmasquim a , A.O. Nieckele b, a Petrobras Transporte S. A., Av. Presidente Vargas 328, Centro, 20091-060, Rio de Janeiro, RJ, Brazil b 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 abstract article info Article history: Received 16 November 2006 Accepted 13 July 2008 Keywords: pigging oil pipeline oil displacement gasliquid control valve To provide an efcient 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. liquidliquid, gasgas or liquidgas products in the pipeline. Modules to automatically control process variables were included to employ different strategies to reach an efcient operation. Different test cases were investigated to conrm 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 provide the necessary force to set the device in motion, and to perform 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 difculty 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 of the pig through the pipeline. Most of the available knowledge is based on eld experience. Hence, there is often some guesswork and, consequently, a degree of uncertainty in selecting the best pig by estimating its speed, the required driving pressure, and the amount of backward/forward bypass of uid. The pipeline network all over the world is becoming older, and at the same time concern over environmental issues has markedly increased. Pipeline operators are investing in inspection and main- tenance with the object of extending the lifetime of their pipelines. However, to be able to execute repairs, it is necessary to empty the entire pipeline or sections between pump stations, keeping valves and accessories installed. In many cases, oil is displaced from the pipeline by injection of inert gas, employing a sealing pig at the interface of the uids. The pig velocity is directly related to the sealing efciency of the pig, and requires that the liquid ow rate be maintained within certain limits. The ow rate and the pressure distribution depend directly on the prole 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, avoiding the occurrence of either slack ow or excess pressure. A typical sealing pig is formed by piston-type cups attached to a cylindrical body (Fig. 1a). In order to produce efcient sealing, pigs have nominal diameters larger than the pipe diameter. Fig. 1(b) is a sketch of a sealing operation. Gas pumped upstream 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 few papers have dealt with the motion of pigs in pipelines. In one of the rst investigations on pigging of gasliquid pipelines McDonald and Baker (1964) assumed a successive steady-state approach to model the phenomena, what leads to large calculation errors. Webb et al. (1987) investigated the use of an inert gas to displace oil from a long pipeline, and they mention the control of the oil ow by an outlet valve. Kohda et al. (1988) employed a pigging model with a drift ux model for a two-phase transient ow, and Minami and Shoham (1996) coupled the pigging model with the Taitel et al. (1989) quasi-steady gas-ow model. Santos et al. (2001) developed a model to predict the pig dynamics applied to Gas-Lift operations. Nguyen et al. (2001) and Kim et al. (2003) studied the dynamics of pigs through pipelines using the method of characteristics, and Azevedo et al. (2003) used the nite difference method. Nieckele et al. (2001) investigated several pigging Journal of Petroleum Science and Engineering 62 (2008) 102110 Corresponding author. Tel.: +55 213527 1182; fax: +55 213527 1165. E-mail addresses: [email protected] (S.T. Tolmasquim), [email protected] (A.O. Nieckele). 0920-4105/$ see front matter © 2008 Elsevier B.V. All rights reserved. doi:10.1016/j.petrol.2008.07.002 Contents lists available at ScienceDirect Journal of Petroleum Science and Engineering journal homepage: www.elsevier.com/locate/petrol
Transcript
Page 1: Design and Control of Pig Operations Through Pipelines

Journal of Petroleum Science and Engineering 62 (2008) 102–110

Contents lists available at ScienceDirect

Journal of Petroleum Science and Engineering

j ourna l homepage: www.e lsev ie r.com/ locate /pet ro l

Design and control of pig operations through pipelines

S.T. Tolmasquim a, A.O. Nieckele b,⁎a Petrobras Transporte S. A., Av. Presidente Vargas 328, Centro, 20091-060, Rio de Janeiro, RJ, Brazilb 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

⁎ Corresponding author. Tel.: +55 21 3527 1182; fax: +E-mail addresses: [email protected] (S.T. Tolma

(A.O. Nieckele).

0920-4105/$ – see front matter © 2008 Elsevier B.V. Aldoi:10.1016/j.petrol.2008.07.002

a b s t r a c t

a r t i c l e i n f o

Article history:

To provide an efficient tool t Received 16 November 2006Accepted 13 July 2008

Keywords:piggingoil pipelineoil displacementgas–liquidcontrol valve

o assist in the control and design of pig operations through pipelines, a numericalcode has been developed, based on a finite difference scheme. It allows the simulation of two-fluid transientflow, i.e. liquid–liquid, gas–gas or liquid–gas products in the pipeline. Modules to automatically controlprocess variables were included to employ different strategies to reach an efficient operation. Different testcases were investigated to confirm the robustness of the method. The results obtained with the code werecompared with a real oil displacement operation of a section of the OSPAR pipeline, with 762 mm diameterand 60 km length, owned by Petrobras; there was good agreement between the two, thereby validating themethod.

© 2008 Elsevier B.V. All rights reserved.

1. Introduction

Pigging is a common practice in the petroleum and natural gasindustry. In general terms, a pig is a solid plug that is introduced intothe pipeline to be serviced. Fluid is pumped upstream of the pig toprovide the necessary force to set the device inmotion, and to performthe desired task, i.e., removing deposits from the pipe wall, removingwater from the pipeline or driving an inspection tool. The use of pigshas become a standard industry procedure. A great variety of pigmodels is available for each particular application. A difficulty oftenfaced by the engineer when designing a pigging operation is the lackof reliable tools for the prediction of the many variables related to themotion of the pig through the pipeline. Most of the availableknowledge is based on field experience. Hence, there is often someguesswork and, consequently, a degree of uncertainty in selecting thebest pig by estimating its speed, the required driving pressure, and theamount of backward/forward bypass of fluid.

The pipeline network all over the world is becoming older, and atthe same time concern over environmental issues has markedlyincreased. Pipeline operators are investing in inspection and main-tenance with the object of extending the lifetime of their pipelines.However, to be able to execute repairs, it is necessary to empty theentire pipeline or sections between pump stations, keeping valves andaccessories installed. In many cases, oil is displaced from the pipelineby injection of inert gas, employing a sealing pig at the interface of the

55 21 3527 1165.squim), [email protected]

l rights reserved.

fluids. The pig velocity is directly related to the sealing efficiency of thepig, and requires that the liquid flow rate bemaintainedwithin certainlimits. The flow rate and the pressure distribution depend directly onthe profile and on the fact that while gas flows in one section of thepipeline there is liquid in another section. Therefore, the operationaldesign should also account for the pressure distribution along thepipeline, in order to guarantee the level of operating pressure in thepipeline, avoiding the occurrence of either slack flow or excesspressure.

A typical sealing pig is formed by piston-type cups attached to acylindrical body (Fig. 1a). In order to produce efficient sealing, pigshave nominal diameters larger than the pipe diameter. Fig. 1(b) is asketch of a sealing operation. Gas pumped upstream of the pigprovides the necessary pressure difference to overcome the contactforce at the wall, to displace the liquid downstream of the pig and toaccelerate the pig.

A few papers have dealt with themotion of pigs in pipelines. In oneof the first investigations on pigging of gas–liquid pipelines McDonaldand Baker (1964) assumed a successive steady-state approach tomodel the phenomena, what leads to large calculation errors. Webbet al. (1987) investigated the use of an inert gas to displace oil from along pipeline, and they mention the control of the oil flow by an outletvalve. Kohda et al. (1988) employed a pigging model with a drift fluxmodel for a two-phase transient flow, andMinami and Shoham (1996)coupled the pigging model with the Taitel et al. (1989) quasi-steadygas-flow model. Santos et al. (2001) developed a model to predict thepig dynamics applied to Gas-Lift operations. Nguyen et al. (2001) andKim et al. (2003) studied the dynamics of pigs through pipelines usingthemethod of characteristics, and Azevedo et al. (2003) used the finitedifference method. Nieckele et al. (2001) investigated several pigging

Page 2: Design and Control of Pig Operations Through Pipelines

Fig. 1. Sealing pig. (a) Typical sealing pig. (b) Schematic view of a sealing pig inside apipeline.

103S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

operations, including the dewatering operation in a riser for anisothermal situation, by the finite difference method. Recently, Xu andGong (2005) developed a simplified pigging model for predicting thepigging operation in gas-condensate horizontal pipelines with lowliquid-loading; this couples the phase-behavior model with thehydro-thermodynamic model.

The objective of the present work is to simulate the transient oildisplacement of a pipeline employing a sealing pig. To achieve anefficient operation, a method was developed to automatically controlprocess variables. Test cases are presented to illustrate the robustnessof the method, which considers a PID (Proportional, Integral andDerivative) controller. To validate the code developed, a transient oildisplacement of a pipeline employing a sealing pig is simulated andthe results are compared with field data.

2. Mathematical modeling

The motion of a pig inside a pipeline during an operation todisplace oil by injection of nitrogen can be obtained by the solution ofthe fluid flow problem coupledwith amodel to predict the pigmotion.The upstream fluid is gas, while the downstream fluid is liquid. Bothare considered to be Newtonian. For the present work, the fluid flow isisothermal. The pipeline is inclined in relation to the horizontaldirection, at an angle α. Pipe deformation due to pressure variationsalong the flow is considered. The governing equations for the fluid arethe continuity and momentum equations. The mass conservationequation can be written as (Wylie and Streeter, 1978)

@P@t

þ V@P@s

þ ρ a2

n@V@s

þ ρ a2

nVA@A@s

¼ 0 ð1Þ

where V, P and A are the velocity, pressure and cross-section area,respectively, and s is the flow direction. The fluid properties aredensity, ρ, and isothermal speed of sound, a. The wave speed is

ffiffiffiffiffiffiffiffiffiffia2=n

p,

where the coefficient ξ is given by

n ¼ 1þ ρ a2 CDDDref

; CD ¼ 1 − v2� �

wEDref ð2Þ

where D and Dref are the pipeline diameter and the reference diameterdetermined at atmospheric pressure Patm and CD is the pipedeformation coefficient due to pressure. In deriving CD, w is the pipewall thickness, E is the Young's modulus of elasticity of the pipematerial, and ν the Poisson's ratio. The diameter is determined from

D ¼ Dref

1− CD=2ð Þ P − Patmð Þ ð3Þ

Assuming that the angle between the center line of pipe and theouter line of pipe very small to be ignored, the linear momentumequation can be written as

@V@t

þ V@V@s

¼ −1ρ@P@s

−f2jV jVD

− g sin α ð4Þ

where g is the acceleration due to gravity, α is the angle of the pipecenter line with the horizontal direction. f is the hydrodynamicfriction factor coefficient, which depends on the Reynolds number,Re=ρ |V| D/μ, where μ is the absolute viscosity. In the turbulentregime, the friction factor is also a function of the pipe roughness ε. Tosimplify the solution, the friction factor is approximated by its fullydeveloped expression. For a laminar regime, Reb2000, it is specifiedas f=64/Re. For the turbulent regime, ReN2500, the friction factor isapproximated by Miller's correlation (Fox and McDonald, 2005),f =0.25 {log [(ε/D)/3.7 +5.74/Re0.9]}− 2. Between Re=2000 andRe=2500, to avoid sharp transition, a linear variation of the frictionfactor with the Reynolds number was assumed from its laminar to theturbulent value.

The coupling of the pig motionwith the fluid flow in the pipeline isobtained through a balance of forces acting on the pig, together withan equation that represents the drop in fluid pressure across thebypass holes in the pig (Azevedo et al., 2003). The force balance on thepig can be written as

mdVp

dt¼ P1−P2ð Þ A −m g sin α − Fat Vp

� � ð5Þ

where Vp is the pig velocity, m the pig mass, P1 and P2 the pressure onthe upstream and downstream faces of the pig and Fat(Vp) the contactforce between the pig and the pipe wall.

The contact force Fat(Vp) depends on xp, the axial pig positioninside the pipeline, indicating that the contact force can be allowed tovary along the pipe length. When the pig is not in motion, the contactforce varies from zero to the maximum static force in order to balancethe pressure force due to the fluid flow. Further, since the pig mayresist differently being pushed forward or backward, the maximumstatic force for a negative pressure gradient is Fstatneg, while for a positivepressure gradient it is Fstatpos. Once the pig is set in motion by the flow,the contact force assumes the constant value Fdyn; this represents thedynamic friction force, which is generally different from the staticforce. As in the previous situation, two different values for thedynamic contact force are allowed, Fdynneg and Fdyn

pos, depending on thedirection of the pig motion.

Fat Vp� � ¼ F xp

� �where −Fnegstat xp

� � � F xp� � � Fposstat xp

� �if Vp≈0 ð6Þ

Fat Vp� � ¼ −Fnegdyn xp

� �if Vp<0

Fposdyn xp� �

if VpN0

(ð7Þ

2.1. Moving coordinates

Since the pig moves in the computational domain, it is convenientto employ a coordinate system, η, that stretches and contracts in the

Page 3: Design and Control of Pig Operations Through Pipelines

104 S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

pipe, depending on the pig position. The fluid flow conservationequation must then be rewritten for the new coordinate system(Nieckele et al., 2001) as

@

@tPV

� �þ

~Vhη

@

@ηPV

� �þ

ρa2

hηn1

hηρ

2664

3775 @

@ηVP

� �¼ −

ρ a2~V

n A hη

@A@η

− g sin α

2664

3775− 0

f jV j2D

24

35 P

V

� �

ð8Þ

The absolute velocity V is equal to V+ug, where V is the relativevelocity and ug=(∂s/∂t)η is the grid velocity. hη=(∂s/∂η)t is the metricthat relates the two coordinates.

2.2. Fluid properties

The gas is considered to be a quasi-ideal gas; thus, the equation ofstate for an isothermal flow is

ρ ¼ P=a2; where a ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiZ Rgas Tref ;

qð9Þ

where Rgas is the gas constant, Tref the reference temperature, Z thecompressibility factor and a the isothermal speed of sound.

For the liquid, the following relationship between density andpressure was considered,

ρ ¼ ρref þ P−Prefð Þ=a2 ð10Þwhere ρref is the reference density evaluated from the referencepressure Pref. The liquid speed of sound a was defined as constant.

For each fluid, the absolute viscosity was considered as a functionof pressure in accordance with the following expression (ASTM D341-87, 1987):

μ ¼ μref exp cμ;p P − Prefð Þ� �; ð11Þ

where μref is the absolute viscosity evaluated at the reference pressurePref with coefficient cμ,p.

2.3. Initial and boundary conditions

The operations investigated in this model begin with the pipelinefilled with liquid and with no flow. Therefore, the initial conditioncorresponds to a zero velocity along the pipeline. The hydrostaticpressure distribution between two nodes can be obtained byintegrating Eq. (4), considering the density variation with pressure,Eq. (10). Beginning from the known pressure at the highest elevationof the pipeline, the pressure Ps +ds, at position s+ds is obtained fromthe pressure at the adjacent node Ps as

Psþds ¼ Pref þPS − Prefð Þ þ ρref a

2 1 − exp g Δz=a2� �� �

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 massflow rate or an equation that relates mass flow rate and pressure,representing a valve connecting the pipeline to a reservoir. For the lastcase, the mass flow rate at inlet and/or outlet are determined from

:min ¼ ρin Cd Ag

� �o;inχ

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2 Pt;in−P� �ρin

sð13Þ

:mout ¼ ρout Cd Ag

� �o;outχ

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi2 P−Pt;out� �ρout

;

sð14Þ

where (Cd Ag)o is the product of the valve discharge coefficient and thearea for the valve completely open. Pt is the reservoir pressure,upstream or downstream of the valve, and χ is the percentage of valveopening. The subscripts in and out refer to the inlet and outlet sectionsof the pipe.

3. Process control

The main goal of the system developed to control processesconsists in maintaining certain variables within desired operationallimits. This control can operate in an opened or closed loop. For thepresent work a closed loop is employed, where the value of thedesired variable is used to re-feed the system, in order to compensateexternal 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 controllermanipulates its output in order to eliminate the error. For example, ifthemeasuredmaximumpressure is not the desired value, the openingof a valve at the inlet of the pipeline is altered, in order tomaintain theprocess variable within the desired value.

There are situations in which it is necessary to simultaneouslycontrol two variables of the process. For example, if one wishes tocontrol the pig velocity and the minimum pressure with the pipelineoutlet valve. If the measured pig velocity is not the desired value, anew setting for the outlet valve is determined. The appropriate outletvalue opening is also determined based on the desirable minimumpressure. To guarantee that both variables are within the desirablevalues, the minimum outlet value opening is imposed to the process.Fig. 2(b) illustrates this situation, where the smallest output from thetwo controllers is employed to re-feed the system.

3.1. PID controller

A PID controller generates its output proportionally to the errorbetween the desired and measured quantity, the integral of the errorand the derivative of the error. Its output u(t) is given by the followingexpression (Isermann, 1981)

u tð Þ ¼ K e tð Þ þ 1TI∫ t0e τð Þdτ þ TD

de tð Þdt

; ð15Þ

where e(t) is the error and the multiplier factors K, TI and TD areknown as the controller gain, the integral time and derivative time,respectively.

The controller error can be defined 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 theprocess variable and CA is the controller action. This action can bedirect or reverse. For a direct action controller, when the processvariable increases, the output of the controller also increases, i.e.,the variable is maintained at the set point or above it. Thecontroller with reverse action decreases its output when theprocess variable increases, thereby maintaining the variable at orbelow its set point.

4. Numerical method

The set formed by the pig and flow equations, Eqs. (5) and (8),together with the appropriate boundary and initial conditions,requires a numerical method to obtain the desired time-dependentpressure and velocity fields. These equations were discretized by afinite difference method. A staggered mesh distribution was selectedto avoid unrealistic oscillatory solutions, as recommended by Patankar(1980). The equations were integrated in time by a totally implicitmethod. The space derivatives were approximated by the central

Page 4: Design and Control of Pig Operations Through Pipelines

105S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

difference method around the mesh point. The resulting coefficientmatrix is penta-diagonal, and can be easily solved by a direct penta-diagonal algorithm.

The total number of grid points inside the pipe was maintainedconstant in the numerical calculations of the flow field upstream anddownstream of the pig as well as for the pig dynamics calculations.However, as the pigmoves along the pipe, it is convenient to rearrangethe node distribution. The number of grid points upstream anddownstream of the pig was made proportional to the length of thepipe at each side of the pig.

5. Analysis of test cases

Two study cases are presented here to illustrate the method ofcontrol of the inlet or outlet valve opening tomaintain the pig velocityas well as the maximum and minimum pressure values inside thepipeline under desirable limits. Finally, to validate themethod, a liquiddisplacement operation in the OSPAR oil pipeline is examined.

5.1. Case 1—Pig velocity and minimum pressure control

Thefirst test case consists in oil removal from a horizontal pipeline bythe injection of nitrogen. A constant mass flow rate of nitrogen

:min equal

to 7.0 kg/s is imposed at the entrance. There is a valve at the pipelineoutlet. The reservoir pressure beyond the valve Pt,out is 196 kPa, and thefully open valve discharge coefficient (Cd Ag)o,out is 0.02 m2. The oilproperties are: ρ=900 kg/m3, a=1318 m/s and μ=70 cP at Pref=101 kPa.The nitrogen properties are: Rgas=296.9 N·m/(kg·K), z=1.04 andμ=0.015 cP at Pref=101 kPa, Tref=20 °C. The pipeline characteristics are:length L=40 km, diameter Dref=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 itscontact forces are: Fstat

neg=Fstatpos=Fdynneg=Fdynpos =29.6 kN, corresponding to apressure difference ΔP=P1−P2=196 kPa across the pig.

During the operation it is desirable to maintain pig velocity ataround 2 m/s, and a minimum pressure along the whole pipeline of490 kPa.

Fig. 2. Control system in a closed loop.

Initially, the problem is solved without any control. At time zero,the outlet valve is completely opened in 1 s and kept this way. Then, toillustrate the performance of the control method, both pig velocityand minimum pressure are controlled by a valve at the outlet of thepipeline. To control the pig velocity, the controller parameters ofEq. (15) are set as K=0.1, TI =0 s and TD=20 s, with a set point SP equalto 2 m/s. The minimum pressure control parameters are: K=10−6,TI =0 s, TD=20 s and SP=490 kPa.

Fig. 3 presents the pressure variation with time at six positionsdistributed along the pipeline for the casewithout PID control (Fig. 3a)and with PID control (Fig. 3b). The maximum allowable operatingpressure (MAOP) is also indicated at the figures. The presence of thepig causes a very large pressure gradient at the pipeline entrance(s=0 km) at the beginning of the operation. For this case themaximum pressure is not a problem, since all pressures are alwaysinferior to MAOP (Fig. 3). As the mass flow of nitrogen is constant atthe pipeline entrance, the pressure needed to maintain the flow ratediminishes as oil is replaced by nitrogen. At other positions thepressure increases with time until the pig passes through thatposition. The pressure jump across the pig can easily be seen by thevertical pressure variation at each location. After the passage of thepig, since the gas head loss is very small, the pressure distribution isvery similar to the entrance pressure.

It can be seen in Fig. 3a that without PID control the pressure at theexit of the pipeline (s=40 km) is approximately constant duringalmost all operation, slightly superior to the reservoir pressure of0.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 thevalve also increases owing to the high flow rate of the liquid. With PIDcontrol (Fig. 3b) the exit pressure is kept above 0.490 MPa during thewhole operation.

Fig. 4 illustrates the variation of the pig velocity with time.WithoutPID 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 does not surpass the velocity of 2m/s which isits 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

(a) one variable. (b) two variables.

Page 5: Design and Control of Pig Operations Through Pipelines

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.

106 S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

valve is delayed. Further, in order to guarantee the minimum desiredpressure, only 40% of the valve is opened at the beginning of theprocess (Fig. 5). Then the valve is gradually opened reaching the

Fig. 4. Case 1. Variation of pig velocity with time. (a) Without PID control. (b) With PIDcontrol.

maximum opening of 60% after about 4 h from the start of theoperation, when the pig velocity reaches 2 m/s. At this moment, theoutlet valve begins to close to maintain the pig velocity at the set point(Fig. 4b).

5.2. Case 2—Pig velocity and maximum pressure control

The second test case has a variable topography profile (Fig. 6), inwhich each pipeline segment is 5 km in length. The same pipe and oil asin thepreviousexample are employedwithMAOP set at 4.5MPa. Thepigmass is 27 kg and its contact forces are Fstat

neg=Fstatpos=Fdynneg=Fdynpos =18.4 kN,corresponding to a pressure difference ΔP of 98 kPa across the pig.

Initially, there is no flow, the pipe is full of oil and the hydrostaticpressure distribution is prescribed, where the pressure is set as294 kPa at the highest point of the pipeline. The operation begins by

Fig. 5. Case 1. Percentage of outlet valve opening during the operationwith PID control.

Page 6: Design and Control of Pig Operations Through Pipelines

Fig. 6. Pipeline profile.

107S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

injecting nitrogen into the pipeline. After 120 s, a constant mass flowrate of nitrogen equal to 9.0 kg/s is imposed at the entrance. At thepipe outlet there is a valve connected to a reservoir at atmospheric

Fig. 7. Case 2. Pressure variation with time at 10 positions uniformly distributed. (a) WithoutPmax with inlet valve.

pressure (Pt,out=101 kPa). The fully open valve discharge coefficient(Cd Ag)o,out is 0.025 m2.

Again, both pig velocity and minimum pressure are controlled bythe outlet valve opening. To control de pig velocity, its set point isSP=1.6 m/s, with the following control parameters: K=0.1, TI=0 s andTD=16 s. The minimum pressure control parameters are: K=10−6,TI =0 s, TD=20 s and its set point is SP=101 kPa. Without activating thecontroller procedure, the outlet valve is completely opened in 120 s.

In this example, the pressure distribution (Fig. 7) depends on twocombined effects, i.e., reduction of head loss by the substitution of theoil by nitrogen, and the elevation effect. In the uphill sections, the

PID control. (b) With PID control of Vp and Pmin with outlet valve. (c) With PID control of

Page 7: Design and Control of Pig Operations Through Pipelines

Fig. 9. Case 2. Extent of valve opening (%). (a) Pig velocity and minimum pressure PIDcontrol with outlet valve. (b) Maximum velocity PID control with inlet valve.

108 S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

hydrostatic pressure to be overcome reduces as the pig approaches thehighest peak, leading to a strong reduction in pressure. In the downhillsections the opposite occurs, explaining the periodic behavior of thepressure variation with time. After the pig has passed a certainlocation, the variation in gas pressure is very small and similar to theother stations filled with gas. At Fig. 7, the maximum allowableoperating pressure (MAOP) and minimum desired pressure Pmin arealso indicated. Without PID control the MAOP limit is surpassed(Fig. 7a); however, theminimumpressure limit is always satisfied. Thepig accelerates uphill owing to the reduction in pressure head, and itdecelerates downhill (Fig. 8a). Although the pressure behavior issimilar at all peaks, the pig accelerates a little more as it moves alongthe pipeline as a result of the smaller head loss of N2. In the finalsegment, pig velocities are very high, since there is no longer adescending segment to reduce this velocity.

Two controlled operations are examined. Initially, the pig velocityand minimum pressure are simultaneously controlled. To control thepig velocity (Fig. 8b) the outlet valve is periodically opened and closed(Fig. 9a). As time passes, the valve stays fully opened for successivelyshorter times, and to control the pig velocity in the final segment it isonly 18% open. Note, however, that although the pig velocity iscontrolled and theminimumpressure is never attained, themaximumpressure is again surpassed (Fig. 7b).

To control the maximum pressure, an inlet valve is thenconsidered and the control method is applied to it. The inletreservoir pressure Pt,in which feeds the pipeline is 3.92 MPa, and thefully open valve inlet discharge coefficient (Cd Ag)o,in is 0.003 m2. Theset point for the maximum flow rate is SP=9 kg/s, with the followingcontrol parameters: K=0.01, TI =0 s and TD=10 s. In order to absorbthe overshoot of the control system, the set point for the maximumpressure is proportional to the maximum allowable operatingpressure (MAOP) as SP=MAOP/1.15. The control parameters for themaximum pressure are: K=10−7, TI =0 s and TD=20 s. To guaranteethat the pressure is always inferior to the MAOP limit (Fig. 7c) andthe mass flow rate is inferior to 9 kg/s, the resulting maximum inletvalve opening was equal to 83% (Fig. 9b). Due to the pressureincrease the valve is closed to control its value. As time passes lessnitrogen is needed to displace the pig. Thus, to ensure the desired

Fig. 8. Case 2. Pig velocity (Vp) with pig position along pipeline (xp). (a) Without PIDcontrol. (b) With PID control.

pressure limits the valve is periodically closed and opened, but eachtime 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 intermediatepumping station at Itararé (60 km). Its main purpose is to take oil fromthe São Francisco do Sul Terminal (SFS) to the refinery. The oil wasremoved from the pipeline by the injection of nitrogen, with a 40 kgseparator flexpig. Owing to the pipeline profile (Fig. 10), the oildisplacement was from the refinery in Paraná (REPAR) to SFS, in theopposite direction to the normal operational direction. Liquid nitrogenwas stored in a low-pressure cryogenic cylinder. Leaving the cylinder,the nitrogen pressure was raised to the desired level; it was vaporizedand then injected into the pipeline. To avoid high pressure at placeswhere the altitude is low, especially near SFS, the valve at Itararé(diameter 762 mm) was kept closed. The alignment employed a valveof smaller diameter (203 mm), which introduced a pressure drop at

Fig. 10. Profile of the REPAR-Itararé section profile and maximum allowable operationpressure.

Page 8: Design and Control of Pig Operations Through Pipelines

Fig. 11. Variation in pressure over time at the REPAR refinery.

Fig. 13. Pressure at Itararé. Comparison between simulated and field data. (a) Totalpigging operation. (b) Detail of the final 8 h of the pigging operation.

109S.T. Tolmasquim, A.O. Nieckele / Journal of Petroleum Science and Engineering 62 (2008) 102–110

the station while maintaining the downstream pressure near toatmospheric pressure increasing the controllability of the system.

The simulationwas carried out from REPAR to Itararé (Fig. 10), wherethe pipeline characteristics are: length L=60 km, diameterDref=762mm,roughness ε=45.7 μm, Young's modulus of elasticity E=2.1×105MPa andPoisson's ratio ν=0.3. The wall thickness w varies from 9.53 mm to14.3 mm. The maximum allowable operation pressure MAOP is alsoillustrated 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 werePref=101 kPa and Tref=20 °C, respectively. The pig contact forces were allthe same (Fstatneg=Fstatpos=Fdynneg=Fdynpos), but they varied with the pipe thicknessfrom 85 kN to 83 kN.

The pressure variation with time, acquired by the SCADA (Super-visory, Control and Data Acquisition) system, was defined as the inletboundary condition (Fig. 11). At the pipeline section exit at Itararé, noflow informationwas available. Therefore, the level variation of the oilreceiving tank at SFS (Fig. 12a), also acquired by the SCADA system,was used to define the mass flow rate at the outflow boundary. The oilmass flow rate (Fig. 12b) was obtained by the following expression:

:m ¼ ρ Nt−Nt0

� �= t−t0ð Þ ð17Þ

where Nt and Nt0 are the tank levels at time t and previous time t0,respectively, and ρ is the density. No noise was eliminated from thedata to define the simulation boundary conditions.

Fig.12. Variation over time in (a) the level in the SFS oil receiving tank and (b) mass flowrate. (a) Receiving tank level. (b) Mass Flow Rate at Itararé.

A comparison between the pressure measured at Itararé and thepressure obtained with the present simulation for the fulloperation is shown in Fig. 13a, while a detail of the final 8 h ofthe pigging operation is illustrated in Fig. 13b. Owing to the noise ofthe imposed mass flow rate at the exit, the resulting pressure atItararé also presented several oscillations; however, the samepressure level was obtained. A steep variation of the field pressurecan be observed after 11 h of operation. At that moment, the oilmass flow rate was high so that the nitrogen pressure at theentrance was sufficient to displace the pig. However, a short timeafter this, the pig remained stuck at a low point of the profile, andit did not move until the pressure was recovered at REPAR. Thisbehavior can be seen in Fig. 12a, where the oil tank level was keptconstant from 11 h to 14 h, indicating that there was no flow. Thepig remained stationary during this time (Fig. 14). To inducemovement of the pig, the operator of the process opened a valve atItararé to reduce the pressure downstream of the pig and therebyincrease the pressure difference across it, so that the pig wouldstart to move again. This operation was not considered in thesimulation, and this explains the large discrepancy between thesimulated and field data for pressure during this time. With the

Fig. 14. Pig position with time. Comparison between simulated and field data.

Page 9: Design and Control of Pig Operations Through Pipelines

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 pigresumed its progress (Fig. 14). As the pig started to move thepressure level at Itararé recovered and the simulation agreed withthe field data. A very good agreement can be seen after 13 h(Fig. 13b), with the variation in outlet pressure with time beingclosely related to the simulated pressure. The outlet pressure is alsocorrelated with the position of the pig (Fig. 14) and the profile ofthe pipeline (Fig. 10).

One of the reasons for the discrepancy between the pressuremeasured and predicted can be related to the fact that the simulationwas performed with only one phase present inside the pipeline.However, during the beginning of the operation, the pipeline wasoperating in slack flow. After approximately 13 h of operation, thepipeline started to operate without slack flow until the pig reachedItararé, and this can explain the better agreement at the end of thepigging operation (Fig. 13b).

Fig. 15 presents a comparison of the measured nitrogen massflow rate with the numerical results obtained here. Fig. 15aillustrates the full operation, where once again oscillations areobserved and can be linked to fluctuation in the outlet mass flowrate. Fig. 15b shows the mass flow rate for the final 8 h of the piggingoperation. Although the numerical results present a high level ofoscillations, the correct level of mass flow rate was predicted. Thenegative mass flow rate in the simulation can be explained by thepresence of slack flow, which was not considered with the presentmodel. Owing to low pressure, the oil vaporizes; however, since thepresent numerical model does not predict this phenomenon, the lowpressure can only cause an adverse pressure gradient, leading to atheoretical reverse flow. Further, the data for instantaneous massflow rate were indirectly obtained from the pump rotation, leadingto considerable uncertainty. In spite of these limitations, thecomparison can be considered reasonable, especially after 13 h ofthe pigging operation (Figs. 13b and 15b).

Finally, although the measured data for pig position with time areadmittedly few, those that were obtained agree quite well with themodeled data (Fig. 14).

Fig.15.Mass flow rate at REPAR. Comparison between simulated and field data. (a) Totalpigging operation. (b) Detail of the final 8 h of the pigging operation.

6. Final remarks

To guarantee an efficient and safe pigging operation,maximumandminimum pressures in the pipeline as well as pig velocity must bemaintainedwithin stipulated limits.With the objective of providing anefficient tool to assist in the control and design of pig operationsthrough pipelines, a numerical code was developed based on a finitedifference scheme,which allows the simulation of gas–liquid transientflows in the pipeline. Modules based on the PID controller method toautomatically control process variables were included to employdifferent strategies to achieve an efficient operation. The opening ofboth inlet and outlet valves can be controlled. The test problemspresented illustrated the effectiveness of the method. Further, theresults obtainedwith the codewere comparablewith those of a real oildisplacement operation in a section of the OSPAR pipeline, with762 mm diameter and 60 km length, owned by Petrobras.

Although good results were obtained, it is clear that theweakness ofthe model lies in its inability to account for slack flow. This is a veryimportant phenomenon which must be included in the code. In fact, atthe moment two different approaches are being implemented toaccount for slack flow. In the first approach, the two-fluid model isbeing implemented downstreamof the pig, while only gas is consideredupstream. In the second approach, a cavitation model predicts the oilvaporization for pressures inferior to the oil vapor pressure.

Acknowledgement

The second author acknowledges the support awarded to thisresearch by the Brazilian Research Council, CNPq.

References

ASTM D341-87, 1987. Standard Viscosity Temperature Chart for Liquid PetroleumProducts.

Azevedo, L.F.A., Braga, A.M.B., Nieckele, A.O., Souza Mendes, P.R., 2003. SimulatingPipeline 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.

Verification of the theoretical model for analyzing dynamic behavior of the pig fromactual pigging. KSME Int. J. 17 (9), 1349–1357.

Kohda, K., Suzukawa, Y., Furukwa, H., 1988. A new method for analyzing transient flowafter pigging scores well. Oil Gas J. 9, 40–47.

McDonald, A., Baker, O., 1964. Multiphase flow 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 flow 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 throughpipelines. 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 flowcontrol in natural gas pipeline. KSME Int. J. 15 (8), 1165–1173.

Patankar, 1980. Numerical Heat Transfer and Fluid Flow. Hemisphere PublishingCorporation.

Santos, O.G., Bordalo, S.N., Alhanati, J.S., 2001. Study of the dynamics, optimization, andselection of intermittent gas-lift methods—a comprehensive model. J. Pet. Sci. Eng.32 (2), 231–248.

Taitel, Y., Shoham, O., Brill, J.P., 1989. Simplified transient solution and simulation oftwo-phase flow in pipelines. Chem. Eng. Sci. 44 (6), 1353–1359.

Webb, S., Bogucz, E., Levy, E., Barret, M., Snyder, C., Waters, C., 1987. Evacuation of aresidual 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.


Recommended