Model-Free Predictive Anti-Slug Control of a Well-Pipeline-Riser

Simplified linearized discrete time dynamic state space models are developed for a 3-phase well-pipelineriser and tested together with a high fidelity dynamic model built in K-Spice and LedaFlow. In addition the Meglio pipeline-riser model is used as an example process. These models are developed from a subspace algorithm, i.e. Deterministic and Stochastic system identification and Realization (DSR), and implemented in a Model Predictive Controller (MPC) for stabilizing the slugging regime. The MPC, LQR and PI control strategies are tested.


Introduction
Severe-slugging is a problem regarding well-pipelineriser processes in the offshore industry and is characterized by significant flow rate and pressure oscillations observed at the topside choke.This flow needs to be stabilized or it might damage both downstream equipment and personnel (Courbot (1996)).
One solution, which is regarded as the most costeffective, is to introduce active feedback where we define the topside choke valve as the manipulative variable and some pressure, flow rate or density measurements as the controlling variable.We may also define the flow rate as the goal variable, as it is what we want to maximize.
On this approach, Schmidt Z. (1979), may be viewed as the first contribution, however this was a rather experimental approach where an upstream pressure measurement together with the flow rate measurement, the choke valve was automatically changed, by algorithm, to counteract the slugging regime.
To maximize the goal variable a controller needs to be designed to operate around an open-loop unstable working point, here the largest possible choke opening which stabilizes the system may be defined as a performance measure of the controller.Model-based control using mechanistic models is a popular approach for designing controllers.Some of these mechanistic models are presented in Storkaas andSkogestad (2003b), Di Meglio et al. (2009), Jahanshahi and Skogestad (2013) and compared in Jahanshahi and Skogestad (2013).
In Dalen et al. (2015), a so called Model-Free Linear-Quadratic Regulator (MFLQR) was demonstrated on a well-pipeline-riser example integrated in the K-Spice/LedaFlow simulator (K-Spice, LedaFlow).Different input-output cases were considered for solving the slugging problem, where the most satisfying re-sults were when introducing gas-lift, however this is a rather expensive solution, as large quantities of gas are needed.It is less expensive to stabilize the flow regime, or controlling the bottom riser pressure, by active choking of the topside choke valve also demonstrated in the paper.
The concept of model free optimal control is not new and was used in Favoreel et al. (1999) in order to identify a Linear-Quadratic-Gaussian (LQG) controller directly from closed loop subspace system identification.The subspace method used was however/regardless biased and the controller has to be partly known.
In this paper we will define bottom-riser pressure as the controlling variable and topside choke valve as the manipulative variable.In particular, demonstrations of Model-Free Predictive Control (MFPC) is performed on the 3 state Di Meglio model (Di Meglio et al. (2009)) and on the K-Spice/LedaFlow simulator (K-Spice, LedaFlow).
The contributions of this paper can be itemized as follows.
The rest of the paper is organized as follows.In Sec. 2 we define the MFPC algorithm.In Sec. 3 we present results of the MFPC algorithm on the Di Meglio model (Di Meglio et al. (2009)) and the K-Spice/LedaFlow simulator.In Sec. 4 we discuss and summarize the results.In Sec. 5 we present the concluding remarks.In Appendix A we provide a complete model description of the Di Meglio model (Di Meglio et al. (2009)).

Theory
Definition 2.1 (State observer) Define the following Kalman filter on state deviation form, i.e.
where k ∈ N is the discrete time, ∆x k ∈ R n is the predicted state deviation vector, ∆u k ∈ R r is the input deviation vector, y k ∈ R m is the output vector and K is the Kalman filter gain matrix.The observer matrices A, B, D, K are identified as in Eq. (2).

Definition 2.2 (Optimal model)
The model matrices in Eq. (1) are found using the following MATLAB function, where Y and U are identification matrices, containing collected data from an experimental design.
It is important to note that choosing the model based on lowest Mean Square Error (MSE), calculated from simulated output, as in Dalen et al. (2015), might not give the optimal model order, and according to Akaike (1974).The optimal model will be refereed to as DSR J L , where J is the past horizon and L is the future horizon (see Di Ruscio (1996) for a detailed description).

Definition 2.3 (MPC Algorithm)
We consider the simple MPC algorithm presented in Di Ruscio (2013).
Given the pre-defined matrices, H, O L Ã, F T L Q, as defined in Di Ruscio (2013), and the reference matrix, r k+1|L , we have for each time-instant k that The optimal unconstrained predictive control is The actual control is However, if the constrains are active, the problem renders a general QP problem, i.e. ∆u * k|L = arg min where and J 0 is not used.The vector b k depends on the constraints.
As an example regarding the linear inequality in Eq. ( 7), we consider the input rate of change constraints, Eq. ( 9) may be expressed as A∆u k|L ≤ b k , where A complete example which introduces the constraints of both the input rate of change and the input amplitude can be found in Section 3.2 and Appendix A in Di Ruscio (2013).

MPC Process
State observer

Di Meglio model
We consider the 3 state model presented in Di Meglio et al. ( 2009), which was calibrated in Di Meglio et al. (2010b), for reproducing the slugging regime present in a real oil well located in the North Sea.The model is rather simple, but with an introduced virtual valve located at the bottom of the riser the model proves sufficient to investigate the physical aspects of the slugging phenomenon.
This model may be formulated as a continuous nonlinear state space model, as where Here, in Eq. ( 12), m g,cb is the mass of gas in the elongated bubble, m g,r is the mass of gas in the riser, m l,r is the mass of liquid in the riser and the output y is the pressure at the riser bottom.See Di Meglio et al. (2009) for details.The main control u is the topside choke.The complete model for direct implementation is presented in Appendix A with parameters as in Tab.

6.
The continuous non-linear model may be linearized around steady state operating points u s and x s , which leads to a discrete time linear model, Now, we present results on the MFPC based upon two different datasets with length, N = 2000 samples, each excited around different choke openings, @0.15 and @0.20, illustrated in Figs. 2 and 7, respectively.The sampling time is chosen equal to 100 sec.
We can define our two cases as Note that u > 0.205 is considered the bifurcation point, i.e. the choke opening where the process becomes marginally stable.
We removed the first 200 samples.Now, the first 1301 were stored in input and output identification vectors U ∈ R N id and Y ∈ R N id , respectively.The validation vectors were made from all the data, stored as U ∈ R Nv and Y ∈ R Nv , illustrated in Fig. 2. The vectors U and Y were redefined with centered data, i.e. subtracted by the mean values u m = 0.151 and y m = 188.3(Fig. 3).
Next, a 3rd order model was identified (Eq.14) using dsr op as in Eq. ( 2), and Eqs. ( 15) and ( 17) for Sampling time is 100 sec.@0.15 an observability canonical form version of DSR 12 3 , for @0.15 and @0.20 operating points, respectively.The original DSR 12 3 is shown in Eq. ( 16).Fig. 4 shows three models; DSR 9 3 , PEM and LIN, simulated over the validation data, where the best performing model was the dsr with V DSR = 0.1912, V P EM = 0.2175 and V LIN = 0.2182 (See Tab. 1).A well-known algorithm in system identificaiton is the Prediction Error Method (PEM), which can be found in the system identication toolbox (Ljung (2007)).

Discussion
Interestingly, considering Tab. 1 , the dsr model is performing better than the PEM and the linearized model in both cases; 0.15 and 0.20.
Considering Tab. 2 the best performing controller seems to be MPC(L=20) based at @0.20, stabilizing up to 0.39.However, MPC(L=20) based at 0.15 is surprisingly achieving stabilizing up to 0.37.The LQR seems to be the runnerup best candidate.

The K-Spice/LedaFlow simulator
We perform model-free anti-slug control on a well-pipelineriser (Fig. 12), integrated in the K-Spice/LedaFlow simulator, high fidelity simulators developed by Kongsberg Oil & Gas Technologies (K-Spice, LedaFlow).We define following case as Note that bara is the absolute pressure expressed in bar, where 0 bara is associated with total vacuum.
The simulator was run with simulation speed 50 times real-time and the sample time was chosen to be 1 sec.Input and output data were collected from an open loop input experiment (Fig. 13).The samples from 600 to 2000 were stored in identification matrices U ∈ R N and Y ∈ R N , where N = 1400.The samples from 600 to 2350 were stored in validation matrices.The matrices were redefined with centered data, i.e. subtracted by mean values um = 44.9 and ym = 58.3.Figure 13: Data collected from the K-Spice/LedaFlow simulator.The data from 600 to 2000 Samples were used for identification, while the data from 600 to 2350 were used for validation.The simulation speed was 50 times real-time.The sampling time is equal to 1 sec.
An optimal model was identified (Eq.18), i.e. the model from DSR J L having the lowest prediction error using deterministic output (as described in Eqs. ( 9)-( 10 (18) We identified a similar 4th order model from the PEM algorithm, Tab. 3 shows how closely related these models are.Both models were compared over the validation set (Fig. 16), where dsr had the lowest prediction error, VDSR = 0.3932.It can be seen that both the controllers; MPC and LQR have successfully stabilized the undesired oscillating flow, up to 52 % choke opening, but the production/outlet flow remains constant at 42.9 [kg/s].Both strategies also have quite similar performances, the difference is that the MPC is predictive, as illustrated in Fig. 19.
The LQR matrices G1 and G2 in u k = u k−1 + G1∆x k + G2(y k−1 − r k ) are as in Eq. ( 19).     the goal was to stabilize the outlet flow/bottom riser pressure at highest possible choke opening.

Discussion and summary
For the Di Meglio model we have that the MPFC, based @0.20 (marginally stable is defined at 0.205), was able to stabilize up to 0.39, while the other one, based @0.15, achieved 0.37.The runner-up candidate, i.e. the MFLQR, did only differ from the MFPC in terms of performance indices TV and IAE.Note that the PI controller could probably be tuned better for this case.
For the K-Spice/LedaFlow simulator we based the MFPC around a marginally stable working point, i.e. @44.9 %, and it was able to stabilize up to 52%.

Concluding Remarks
Practical implementation of MFPC was successfully demonstrated on a well-pipeline-riser process described by a 3-state non-linear model, thereafter it was demonstrated on the K-Spice/LedaFlow simulator.

Figure 2 :
Figure 2: Raw data with length, N = 2000 samples.Identification and validation with lengths, N id = 1301 and N v = 1800.Sampling time is 100 sec.@0.15

Figure 4 :Figure 5 :
Figure 4: The identified models simulated and compared to validation data gathered from the real process (Di Meglio).We have the following validation performances (measured with MSE); V DSR 9 3 = 0.1912, V P EM = 0.2175 and V LIN = 0.2182.

Figure 6 :
Figure 6: The subfigure above illustrates how the MPC converges to the LQR when the prediction horizon, L increases.The subfigure below illustrates the controller performances.MPC (L=20) and the LQR based @0.15 are able to stabilize the slugging regime up to choke opening 0.37 (zoomed in on the first and last part of Fig. 5.)

Figure 11 :
Figure 11: The subfigure above illustrates how the MPC converges to the LQR when the prediction horizon, L increases.The subfigure below illustrates the controller performances.The MPC (L=20) and the LQR, based @0.20, are able to stabilize the slugging regime up to choke opening 0.39.(zoomed in on the first and last part of Fig. 10.

Figure 12 :
Figure 12: Illustration of the 3-phase well-pipeline-riser process integrated in the K-Spice/LedaFlow simulator.

Figure 14 :Figure 16 :
Figure 14: Illustration of the identified model DSR 8 8 in Eq. (18) simulated over the identification set resulting in V M SE = 0.3753.
An implementation of the MPC on the K-Spice/LedaFlow simulator is shown in Fig.17.A prediction horizon, L = 20, and the following weights were chosen; Q = 20 and R = 1 based on simulation on the identified model.

Figure 17 :
Figure 17: Implementation of MFPC and MFLQR on the K-Spice/LedaFlow simulator.Stabilizing up to 51.3 % choke opening.Simulation speed is 50 times real time.Sampling time is 1 sec.

Table 1 :
Summary: Comparing models from DSR J L , PEM and Linearized (LIN).We have the prediction error for simulated output, V M SE , the steady state gain, H d , and absolute eigenvalues, abs(eig(A)), for each of linear models, Mod.@ means around working point.

Table 3 :
Comparing models identified from dsr and pem.

Table 5 :
Initial values for the simulations on Di Meglio model.The ODE is solved each timestep with MATLAB ode15s (sampling time, ∆t = 100 sec.)

Table 6 :
Parameters for the Di Meglio model Eqs.22.