The Slug Flow Problem in Oil Industry and Pi Level Control

The slug is a multiphase flow pattern that occurs in pipelines which connect the wells in seabed to production platforms in the surface in oil industry. It is characterized by irregular flows and surges from the accumulation of gas and liquid in any cross-section of a pipeline. In this work will be addressed the riser slugging, that combined or initiated by terrain slugging is the most serious case of instability in oil/water-dominated systems [5, 15, 21].


Introduction
The slug is a multiphase flow pattern that occurs in pipelines which connect the wells in seabed to production platforms in the surface in oil industry. It is characterized by irregular flows and surges from the accumulation of gas and liquid in any cross-section of a pipeline. In this work will be addressed the riser slugging, that combined or initiated by terrain slugging is the most serious case of instability in oil/water-dominated systems [5,15,21].
The cyclic behavior of the riser slugging, which is illustrated in Figure 1, can be divided into four phases: (i) Formation: gravity causes the liquid to accumulate in the low point in pipeline-riser system and the gas and liquid velocity is low enough to enable for this accumulation; (ii) Production: the liquid blocks the gas flow and a continuous liquid slug is produced in the riser, as long as the hydrostatic head of the liquid in the riser increases faster than the pressure drop over the pipeline-riser system, the slug will continue to grow; (iii) Blowout: when the pressure drop over the riser overcomes the hydrostatic head of the liquid in the riser the slug will be pushed out of the system; (iv) liquid fall back: after the majority of the liquid and the gas has left the riser the velocity of the gas is no longer high enough to drag the liquid upwards, the liquid will start flowing back down the riser and the accumulation of liquid starts over again [15].
The slug flow causes undesired consequences in the whole oil production such as: periods without liquid or gas production into the separator followed by very high liquid and gas rates when the liquid slug is being produced, emergency shutdown of the platform due to the high level of liquid in the separators, floods, corrosion and damages to the equipments of the process, high costs with maintenance. One or all these problems cause significant losses in oil industry. The main one has been of economic order, due to reduction in oil production capacity [6,8,[16][17][18][19][20].
Currently, control strategies are considered as a promising solution to handle the slug flow [4,5,7,10,15,20]. An alternative to the implementation of control strategies is to make use of a mathematical model that represents the dynamic of slug flow in pipeline-separator system. In this chapter has been used the dynamic model for a pipeline-separator system under the slug flow, with 5 (five) Ordinary Differential Equations (ODEs) coupled, nonlinear, 6 (six) tuning parameters and more than 40 (forty) internal, geometric and transport equations [10,13], denominated Sausen's model.
To carry out the simulation and implementation of control strategies in the Sausen's model, first it is necessary to calculate its tuning parameters. For this procedure, are used data from a case study performed by [18] in the OLGA commercial multiphase simulator widely used in the oil industry. Next it is important to check how the main variables of the model change their behavior considering a change in the model's tuning parameters. This testing, called sensitivity analysis, is an important tool to the building of the mathematical models, moreover, it provides a better understanding of the dynamic behavior of the system, for later implementation of control strategies.
In this context, from the sensitivity analysis, the Sausen's model has been an appropriate environment for application of the different feedback control strategies in the problem of the slug in oil industries through simulations. The model enables such strategies can be applied in consequence the slug, that is in the oil or gas output valve separator, as well as in their causes, in the top riser valve, or yet in the integrated system, in other words, in more than one valve simultaneously.
Therefore, as part of control strategies that can be used to avoid or minimize the slug flow, this chapter presents the application of the error-squared level control strategy Proportional Integral (PI) in the methodology by bands [10], whose purpose damping of the load flow rate oscillatory that occur in production's separators. This strategy is compared with the level controls strategy PI conventional [1], widely used in industrial processes; and with the level control strategy PI also in the methodology by bands.
The remainder of this chapter is organized as following. Section 2 presents the equation of the Sausen's model for a pipeline-separator system. Section 3 shows the simulation results of the Sausen's model. Section 4 presents the control strategies used to avoid or minimize the slug flow. Section 5 shows the simulation results and analysis of the control strategies applied the Sausen's model. And finally, in Section 6, are discussed the conclusions and future research directions.

Introduction
This section presents a mathematical model for the pipeline-separator system, illustrated in Figure 2 with biphase flow (gas-liquid). The model is the result of coupling the simplified dynamic model of Storkaas [15,17,20] with the model for a biphase horizontal cylindrical separator [22]. The new model has been called of Sausen's model.
The following are shown the modelling assumptions, the model equations, how the distribution of liquid and gas inside the pipeline for the separator occurs. Finally, are presented the simulation results for this model considering two settings for simulations: (i) the opening valve Z in top of the riser z = 20% (flow steady); and (ii) the opening valve Z in top of the riser z = 50% (slug flow).

Model assumption
The Sausen's model assumptions are presented as follow.
A1: Liquid dynamics in the upstream feed section of the pipeline have been neglected, that is, the liquid velocity in this section is constant.

A2:
Follows from assumption A1 that the gas volume is constant in the upstream feed section pipeline and that the volume variations due to liquid level h 1 (t) at the low point are neglected.

A3:
Only one dynamical state M L (t) for holdup liquid in the riser section. This state includes both the liquid in the riser and at the low point section (with level h 1 (t)).  A6: Stationary pressure balance over the riser (between pressures P 1 (t) and P 2 (t)).

A7:
There is not chemical reaction between the fluids (gas-liquid) in pipeline.
A8: Each one of the fluid consists of a single component in the separator.

A9:
The portion of liquid mixed with the gas in the entrance of the separator is neglected.
A10: Simplified valve equation for the gas and the liquid leaving the separator.

A11:
The liquid is incompressible.

A12:
The temperature is constant.

A13:
The gas has ideal behavior.

Model equations
The Sausen's model is composed of 5 (five) ODEs that are based on the mass conservation equations. The equations (1)-(3) represent the dynamics of the pipeline system and the equations (4)-(5) represent the dynamics of the separator: where: M L (t) is the liquid mass at low point in the pipeline, (kg); M G1 (t) is the gas mass in the upstream feed section of pipeline, (kg); M G2 (t) is the gas mass at the top of the riser, (kg); N(t) is the liquid level in the separator, (m); P G1 (t) is the gas pressure in the separator, (N/m 2 ); and theṀ L (t),Ṁ G1 (t),Ṁ G2 (t),Ṅ(t),Ṗ G1 (t) are their respective derivatives in relation to time; m L,in is the liquid mass flowrate that enters the upstream feed section of the pipeline, (kg/s); m G,in is the gas mass flowrate that enters in the upstream feed section of the pipeline, (kg/s); m L,out (t) is the liquid mass flowrate leaving through the valve at the top of the riser enters the separator, (kg/s); m G,out (t) is the gas mass flowrate leaving through the valve at the top of the riser enters the separator, (kg/s); m Gint (t) is the internal gas mass flowrate, (kg/s); m LS,out (t) is the liquid mass flowrate that leaves the separator through the valve Va 1 , (kg/s); m GS,out (t) is the gas mass flowrate that leaves the separator through the valve Va 2 , (kg/s); r s is the separator ray, (m); H 4 is the separator length, (m); ρ L is the liquid density, (kg/m 3 ); V S is the separator volume, (m 3 ); V LS (t) is the liquid volume in the separator, (m 3 ); Φ = RT M G is a constant; R is the ideal gas constant (8314 J K.kmol ); T is the temperature, (K); M G is the gas molecular weight, (kg/kmol).
The stationary pressure balance over the riser is assumed to be given by where: P 1 (t) is the gas pressure in the upstream feed section of the pipeline, (N/m 2 ); P 2 (t) is the gas pressure at the top of the riser, (N/m 2 ); g is the gravity (9.81m/s 2 );ρ(t) is the average mixture density in the riser, (kg/m 3 ); H 2 is the riser height, (m); h 1 (t) is the liquid level at the decline, (m).
A simplified valve equation is used to describe the flow through the Z valve at the top of the riser that is given by where: z is the valve position (0 − 100%); K 1 is the valve constant and a tuning parameter; ρ T (t) is the density upstream valve, (kg/m 3 ); P G1 (t) is the gas pressure into the separator, (N/m 2 ). It is possible to observe that the coupling between the pipeline and the separator occurs through a pressure relationship, in other words, the gas pressure into the separator P G1 (t) is the pressure before the Z valve at the top of the riser, according to equation (6).
Considering the result that has been shown in equation (6), it is also possible to obtain the liquid mass flowrate given by and the gas mass flowrate given by that leave through the Z valve at the top of the riser, where α m L (t) is the liquid fraction upstream valve.
The liquid mass flowrate that leaves the separator is represented by the Va 1 valve equation given by where: z L is the liquid valve opening (0 − 100%); K 4 is the valve constant and a tuning parameter; P OL2 is the downstream pressure after the V a1 valve, (N/m 2 ).
The gas mass flowrate that leaves the separator is represented by the Va 2 valve equation given by where: z G is the gas valve position (0 − 100%); K 5 is the valve constant and a tuning parameter; ρ G (t) is the gas density, (kg/m 3 ); P G2 is the downstream pressure after the V a2 valve, (N/m 2 ).
The boundary condition at the inlet (inflow m L,in and m G,in ) can either be constant or dependent on the pressure. In this work they are constant and have been considered disturbances of the process. The most critical section of the model is the phase distribution and phase velocities of the fluids in the pipeline-riser system. The gas velocity is based on an assumption of purely frictional pressure drop over the low point and the liquid distribution is based on an entrainment model. Finally, the internal, geometric and transport equations for the pipeline system are found in [15,17,20].

Displacement of the gas flow
The displacement of gas in the pipeline system occurs through a relationship between the gas mass flow and the variation of the pressure inside the pipeline. The acceleration has been neglected for the gas phase, so that it is the difference of the pressure that makes the fluids outflow pipeline above. Its equation is given by where: α L (t) is the average liquid fraction in riser.
It is considered that there are two situations in the riser: (i) h 1 (t) > H 1 , in this case the liquid is blocking the low point and the internal gas mass flowrate m Gint (t) is zero; (ii) h 1 (t) < H 1 , in this case the liquid is not blocking the low point, so the gas will flow from V G1 to V G2 (t) with a internal gas mass flowrate m Gint (t) = 0, where V G1 is the gas volume in upstream feed section of the pipeline, (m 3 ) and V G2 is the gas volume at the top of the riser, (m 3 ).
From physical insight, the two most important parameters determining the gas flowrate are the pressure drop over the low point and the free area given by the relative liquid level at the low point. This suggests that the gas transport could be described by a valve equation, where the pressure drop is driving the gas through a valve with opening ξ(t). Based on trial and error, the following valve equation has been proposed where: K 2 is the valve constant and a tuning parameter; f (h 1 (t)) =Â(t)ξ(t) eÂ(t) is the cross-section area at the low point, (m 2 ); h 1 (t) is the liquid level upstream in the decline, (m); H 1 is the critical liquid level, (m); ρ G1 (t) is the gas density in the volume 1, (kg/m 3 ). The internal gas mass flowrate from the volume V G1 to volume V G2 (t) is given by where: υ G1 (t) is the gas velocity at the low point, m/s. Therefore, substituting equation (10) into equation (9), it has been found that the gas velocity is

Entrainment equation
The distribution of liquid occurs through an entrainment equation. It is considered that the gas pushes the liquid riser upward, then the volume fraction of liquid (α LT (t)) that is leaving through the Z valve at the top of the riser is modelled.
The volume fraction of liquid will lie between two extremes: (i) when the liquid blocks the gas flow (υ G1 = 0), there is no gas flowing through the riser and α LT (t) = α * LT (t), in most cases there will be only gas leaving the riser, so α * LT (t) = 0, however, eventually the entering liquid may cause the liquid to fill up the riser and α * LT (t) will exceed zero; (ii) when the gas velocity is very high there will be no slip between the phases, so α LT (t) = α L (t), where α L (t) is the average liquid fraction in the riser.
The transition between these two extremes should be smooth and occurs as follows: when the liquid blocks the low point of the riser, the liquid fraction on top is α * LT (t) = 0, so the amount of liquid in the riser goes on increases until α * LT (t) > 0. At this moment the gas pressure and the gas velocity in the feed upstream section of the pipeline is very high, then the entrainment occurs. This transition depends on a parameter q(t). The entrainment equation is given by where and K 3 and n are tuning parameters of the model. The details of the modelling of the equation (12) are found in Storkaas [15].

Simulation and analysis results of the Sausen's model
In this section are presented the simulation results of the Sausen's model for a pipeline-separator system. Initially the tuning parameters are calculated: K 1 in Z valve equation (6), K 2 in gas velocity equation (11), K 3 and n in entrainment equation (12), K 4 in Va 1 liquid valve equation (7), and K 5 in Va 2 gas valve equation (8). The calculation of these tuning parameters depends on the available data from a real system or an experimental loop, but a complete set of data is not found in the literature and is not provided by oil industries. Therefore, to calculate the tuning parameters of the dynamic model are used the case study data carried out by Storkaas [15] through the multiphase commercial simulator OLGA [2] that accurately represents the pipeline system under slug flow [15] and the data of separator dimensioned from a tank of literature [10]. In this case study the transition of the steady flow to a slug flow occurs in the valve opening z = 13% (i.e., z crit = 13%). Table 1 presents the data for the simulation of the dynamic model and Table 2 presents the values of the tuning parameters of the dynamic model. Now are presented the simulation results considering the Z valve opening z = 12%. Figure 3 shows the varying pressures P 1 (t) in the upstream feed section and P 2 (t) at the top of the riser. Figure 4 shows the dynamics of the liquid mass flowrate (up-left) and the dynamics of the gas mass flowrate (down-left) that are entering the separator, and the dynamics of the liquid mass flowrate (up-right) and the dynamics of the gas mass flowrate (down-right) that are leaving the separator. Figure 5 shows the dynamics of the liquid level (left) and of the gas pressure (right) in the separator. It is possible to observe in all these simulation results that the varying pressures induce oscillations, but because the valve position is less than z crit , these oscillations eventually die out characterizing the steady flow in pipeline-separator system.  In the following section we are presenting the simulation results considering the Z valve opening z = 50%. Figure 6 shows the varying pressures throughout the pipeline system. Figure 7 presents the dynamics of the liquid mass flowrate (up-left) and the dynamics of the gas mass flowrate (down-left) that are entering the separator with peak mass flowrate of the 14 kg/s for the liquid and 2 kg/s for the gas, and the dynamics of the liquid mass flowrate (up-right) and the dynamics of the gas mass flowrate (down-right) that are leaving the separator. Figure 8 shows the dynamics of the liquid level (left) and of the gas pressure (right) in the separator. Finally, it has been observed that in all these simulation results the varying pressures induce periodical oscillations, characterizing the slug flow that happens in the pipeline-separator system. It has also been shown that the slug flow happens in intervals of 12 minutes.

Control strategies
Controller PI actuating in the oil output valve in the oil industry is the traditional method used to control the liquid level in production separators. If the controller is tuned to maintain a constant liquid level, the inflow variations will be transmitted to the separator output, in this case, causing instability in the downstream equipments. An ideal liquid level controller will let the level to vary in a permitted range (i.e., band) in order to make the outlet flow more smooth; this response specification cannot be reached by PI controller conventional for slug flow regime. Nunes [9] defined a denominated level control methodology by bands, which promotes level oscillations within certain limits, i.e, the level can vary between the maximum and the minimum of a band, as Figure 9, so that the output flowrate is close to the average value of the input flowrate. This strategy does not use flow measurements and can be applied to any production separator.
In the band control when the level is within the band, it is used the moving average of the control action of a slow PI controller, because reducing the capacity of performance of the controller gives a greater fluctuation in the liquid level within the separator. The moving average is calculated in a time interval, this interval should be greater than the period T of the slug flow. When the band limits are exceeded, the control action in moving average of the slow PI controller is switched to the PI controller of the fast action for a time, whose objective is return to the liquid level for within the band, if so, the action of the control again will be the moving average. To avoid abrupt changes in action control for switching between modes of operation within the band and outside the band, it is suggested to use the average between the actions of PI controller of the fast action and in moving average. Therefore, this paper performs the application in the Sausen's model of the level control strategy PI considering 3 (three) methodologies: (1) level control strategy PI conventional, the level shall remain fixed at setpoint; (2) level control strategy PI in the methodology by bands; (3) error-squared level control strategy PI in the methodology by bands.
The error-squared controller [14] is a continuous nonlinear function whose gain increases with the error. Its gain is computed as where k 1 is a linear part, k 2NL is a nonlinear one and e(t) is the tracking error. If k 2NL = 0 the controller is linear, but with k 2NL > 0 the function becomes squared-law.
In literature the error-squared controller is suggested to be used in liquid level control in production separators under load inflow variations. From the application of the error-squared controller, in liquid level control process in vessels, it is observed that small deviations from the setpoint resulted in very little change to the valve leaving the output flow almost unchanged. On the other hand large deviations are opposed by much stronger control action due to the larger error and the law of the error-squared, thereby preventing the level from rising too high in the vessel. The error-squared controller has the benefit of resulting in more steady downstream flow rate under normal operation with improved response when compared to the level control strategy conventional [12].
For implementation of the controllers it is used the algorithm control PI [1] in speed form, whose equation is given by where Δu(t) is the variation of the control action; k c is the gain controller; Δe(t) is the variation of the tracking error; T a is the sampling period of the controller; e(t) is the tracking error. It is considered that the valve dynamics, i.e., the time for its opening reach the value of the control action is short, so this implies that the valve opening is the control action itself.

Simulation and analysis results of the control strategies
This section presents the simulation results of the control strategies using the computational tool Matlab. To implement the control by bands it is used a separator with length 4.5 m and diameter 1.5m following the standards used by [9]. The setpoint for the controller is 0.75mn(i.e., separator half), the band is 0.2m, where the liquid level maximum permitted is 0.95m and the minimum is 0.55m. The bands were defined to follow the works of [3,9] Initially, for the first simulation, it is considered the Z valve opening at the top of the riser in z = 20% (slug flow). To simulate the level control strategy PI conventional the values used for the controller gain k c and the integral time T i are 10 and 1380s respectively, according to the heuristic method to tune level controllers proposed by Campus et al. (2006). In level control strategy PI in the methodology by bands the level can float freely within the band limits in separator. In this case, the controller PI with slow acting (i.e., within the band) uses controller gain k c = 0.001 and integral time T i = 100000s, and the PI controller with fast acting (i.e., out the band) uses k c = 0.15 and T i = 1000s. In error-squared control strategy PI in the methodology by bands, the gain linear and nonlinear of the controller are computed to following the methodology present in [11] based on Lyapunov stability theory. In this case, the error-squared level PI controller with slow acting (i.e., within the band) uses k c = 0.001, k 2NL = 0.000004 and T i = 100000s, and the PI controller with fast acting (i.e., out the band) uses k c = 0.15, k 2NL = 0.03 and T i = 1000s. The period for calculating the moving average of the PI controllers by band was T i = 1000s.   The following are presented simulation results for valve opening at the top of the riser, i.e., z = 20%, z = 25%, z = 30% and z = 35% (slug flow). Figure 12    Comparing the simulation results between the level control strategy PI and error-squared level control strategy PI both in the methodology by bands, it is observed that the second controller ( Figures 10 and 12 (b)) has respected strongly the defined bands, i.e., in 0.95m (higher band) and in 0.55m (lower band), because it has the more hard control action than the first controller ( Figure 10 and 12 (a)). However, when the liquid level reached the band limits for the error-squared level control strategy PI, at this time, the liquid output flow rate has a little more oscillatory flows than the ones found for the level controller PI by bands, but  . For both controllers simulation results of the liquid output flow rate are better than the results obtained with the level control strategy PI conventional. Considering the liquid output flow rate when the level is within the band, both processes (i.e., level control strategy PI and error-squared level control strategy PI both in the methodology by band) have similar trends.

Conclusion
In this chapter with objective of reducing the export oscillatory flow rate caused by slug flow, three methodologies of the level controls were implemented (1) level control strategy PI conventional; (2) level control strategy PI in the methodology by bands; (3) error-squared level control strategy PI in the methodology by bands.
The simulation results showed that the error-squared level control PI strategy in the methodology for bands presented the better results when compared with the level control strategy PI conventional, because reduced flow fluctuations caused by slug flow; and with the level control strategy PI in the methodology by bands, it probably happened because the first has highly respected the defined bands.
As suggestions for future work new control strategies can be implemented in integrated system, i.e., more than one valve simultaneously. Considering the mathematical modeling of the process, it was necessary to investigate a mathematical model with fewer parameters, along with the construction of an experimental platform, since the data of a real process is difficult to obtain and are not provided by oil industry.