Model-free optimal anti-slug control of a well-pipeline-riser in the K-Spice/LedaFlow simulator

Simplified models are developed for a 3-phase well-pipeline-riser and tested together with a high fidelity dynamic model built in K-Spice and LedaFlow. These models are developed from a subspace algorithm, i.e. Deterministic and Stochastic system identification and Realization (DSR), and implemented in a Linear Quadratic optimal Regulator (LQR) for stabilizing the slugging regime. We are comparing LQR with PI controller using different performance measures.


Introduction
In the offshore industry, multiphase transportation pipelines, which parts may consist of one or several risers, can introduce a set of different flow patterns, in particular; 'Severe slugging'.The signature of 'Severe slugging' phenomenon is large pressure and flow oscillations, and it is of great interest to stabilize this flow regime since it may endanger personnel and equipment, as well to reduce production rate.
A subset of papers proposing different anti-slug control solutions, is bulleted below: • Introduced gaslift at riser base as control input, controlling riser base pressure, in Alvarez and Al-Malki (2003).
• Cascade control strategies of a well-subsea-riser, controlling riser base pressure with topside-and subsea choke, in Godhavn et al. (2005) In this paper we will not use any models developed from mechanistic rules, actually, since the controlling results presented in this paper evolve only from a collection of data we may refer to this solution as Model-Free Control (MFC), a concept contained in Di Ruscio (2012).The previous mentioned paper demonstrates MFC on a lab-scale quadruple tank process using an LQR optimal controller.The proposed controller used is optimal in the sense that a standard linear quadratic performance index is minimized.The essential problem in this paper will be to identify system matrices for a linear state space model, using a subspace algorithm, i.e.DSR (Di Ruscio (1996)).The DSR algorithm has shown good performance over other algorithms, compared on an activated sludge process (Sotomayor et al. (2003)).The main contributions of this paper are itemized as follows: pipeline-riser example, using a subspace algorithm.
• Model-free optimal anti-slug control of 3 different cases, each described in Section 4.
A most valuable tool for investigating such slugging behavior, has been to use the 'state-of-art', modelling tools; LedaFlow multiphase flow simulator (LedaFlow) integrated with a K-Spice dynamic process simulator (K-Spice), developed and used by Kongsberg Oil & Gas Technologies for the last 30 years in the oil and gas industry.K-Spice and LedaFlow are high fidelity simulators and are well suited to investigate the real offshore well, pipeline, riser and topside process integrated in one dynamic model.LedaFlow is an independent and open simulator that is the first to provide slug capturing and the only solution that predicts hydrodynamic slugs.Enumerated as in sections, the paper is organized as follows: 1.In the introduction we present the anti-slug problem, past solutions and our contributions.
2. In the process description we describe the wellpipeline-riser.
3. In the theory section we define the system model, the problem and the functions which the results of this paper rest upon.
4. In the simulations section we identify models and implement them in a model-free optimal anti slug control for three different cases.

Process Description
A 3-phase well-pipeline-riser example integrated in the K-Spice/LedaFlow simulator is studied in this paper.This example has 3 manipulative inputs of interest for controlling flow/pressure; Topside choke, Subsea choke and Gaslift.Together with the sentences itemized below, the pipeline profile; Fig. 1 gives a brief description of the process example.
Figure 1: Illustration of the 3-phase well-pipeline-riser process integrated in the K-Spice/LedaFlow simulator.
Note that bara is the absolute pressure expressed in bar, where 0 bara is associated with total vaccum.
• Gaslift stabilize the production flow rate by decreasing the density and increasing the flow rate.
3 Theory where k ∈ N is the discrete time, xk ∈ R n is the predicted state vector, u k ∈ R r is the input vector, y k ∈ R m is the output vector and e k ∈ R m is white noise with unit covariance matrix, i.e.E(e k e T k ) = I.We may have the model in a traditional way by writing the common Kalman filter on innovations form, i.e.
where ε k = F e k is the innovations process, K = CF −1 is the Kalman filter gain matrix and E(ε k ε T k ) = F F T is the the innovations covariance matrix.Note that in this paper we have forced the feed-through matrix, E = 0, by setting g = 0 which is shown in Eq. 8.
Definition 3.2 (System Identification Problem) From known input and output time series, the problem is to identify a state space model, i.e the following system matrices (A, B, C, D, E, F ) in Eq. 1 and the initial state x0 .The time series are organized as output and input matrices, respectively (3) It is important to note that we are using centered data, i.e. u k := u k − u 0 and y k := y k − y 0 , where The removing of trends from the data will often increase the accuracy of the estimated model.

Definition 3.3 (Functions)
A set of functions are itemized below, essentially, the problems considered in this paper are solved, in MAT-LAB, by combining members from this set, structured inside (nested) for-loop(s).We may associate the MATLAB scripts with the function diagrams/block diagrams shown in Figs. 2, 3 and 4. • Pseudo Random Binary Sequence (PRBS), a MATLAB function designed as where U is as defined in Eq. 3 and The signal u k is PRBS such as the constant intervals T i are random in the interval T min ≤ T i ≤ T max .See e.g.Fig. 6.The reason for using a PRBS excitation signal is that we want to be able to identify a model with sufficiently high order n.Notice, that a pure step signal only is persistently exciting of order n = 1, Söderström and Stoica (1989).
• Deterministic and Stochastic system identification and Realization, (DSR) Di Ruscio (1996).The model matrices in Eqs.1,2 are identified using the following MATLAB function: where • Mean Square Error (MSE): where ŷd k is the output of the deterministic part of the model and with initial state xd 1 = x0 .
• Linear Quadratic Regulator (LQR), Di Ruscio (2012): where the state deviation ∆x k = xk − xk−1 and r k ∈ R m is the reference for the output y.A MAT-LAB script calculates the optimal feedback matrices: [G1, G2] = dlqdu pi(A, B, D, Q, P ), where Q and P are the weighting matrices for respectively reference tracking and control deviation.
• Integrated Absolute Error (IAE): We may calculate the IAE recursively, as shown in Di Ruscio (2010), in discrete time: where ∆t is the sampling time.
• Total Value (TV): where, Figure 4: Block diagram of the proposed members working together through iterations of k, bounded as 1 ≤ k ≤ N , to control y k .The 'LQR' block is as Eq.11 and the 'State estimator' block is as Eq.12.

Introduction
We present three cases for which we have applied MFC, where our goal is to control/stabilize the outlet flow.The sampling time is ∆t = 1 sec., however different simulation speeds may be used in the K-Spice/LedaFlow simulator.The steps performed in each case is enumerated below.
1. Identify an interesting operating point, i.e. a point where severe slugging is present.

Case A: Topside choke and introduced Gas lift
Introducing gaslift is said to to be the most effective way of stabilizing the slugging regime.Considering the open-loop simulation (Fig. 5), we see that introducing gaslift is stabilizing the flow.We define the case as Inputs and outputs were collected into U ∈ R N ×2 and Y ∈ R N (Fig. 6), where N = 3600 samples.The first 125 samples was removed, thereafter the set was divided into 2/3 for identification and 1/3 for validation.
It was observed that using both inputs u 1 and u 3 gave a higher order model, and worse prediction error than if we just used u 3 , hence we will assume a single-input and single-output (SISO) model with u 3 as input and set u 1 = 25.25.The model is identified with DSR-parameters; L = 7, J = 12, n = 5.
The steady state gain is approximately 1.8 and the poles are less than one in magnitude, hence the process is stable.
The model looks to have a good fit to the datasets, see Figs. (Fig. 7) and (Fig. 8), moreover, the model is performing better over the validation set (M SE = 0.9330), than the identification set (M SE = 1.0777).Fig. 9 shows a successful implementation of the LQR, where the weights are tuned (Q = 1 and P = 1000) using the identified model.We observe that the control input is moving on towards a constant value after a given time.We are not surprised by the good performance, since the model is proven good in both identification and validation.

Case B: Topside choke and Subsea choke
Two manipulative input variables are chosen; Topside choke, u1, and Subsea choke, u2.Considering the openloop simulations in Fig. 10 and some additional observations, we will assume that the process is marginally stable at 22 < u1 ≤ 100 and 30 ≤ u2 ≤ 45.Hence, we define following case as Input and output time-series were collected from an input experiment, (Fig. 11), and we identified a 5th order model (Fig. 11), from the first 5000 samples, with DSRparameters; L = 20, J = 23, n = 5, which gave minimum M SE = 2.4207 (Fig. 12).
Fig. 13 shows the controlling results of the LQR, tuned from trial-and-error methods.The LQR is introduced at T ime = 1000 and is in fact able to stabilize the outlet flow in the region which we assumed marginally stable.Note that we have set the controller limits equal to this region.Despite how awful the model fits the identification set (Fig. 12) we are actually achieving seemingly good controlling results with the LQR.

Case C: Topside choke
We choose to investigate a case with only the topside choke as input variable.Considering the open-loop simulations Fig. 14 and some additional observations, we will assume that the process is marginally stable at 22 < u1 ≤ 100.Hence, a case was constructed as A 4th order SISO model, with only output y2, was identified from the time-series (Fig. 15) with DSR-parameters; L = 5, J = 5, n = 4, with minimum M SE = 0.560 (Fig. 16).undesired slugging regime in the region assumed to have marginal stability, i.e. 22 < u1 ≤ 100.The LQR shows better reference tracking (IAE = 177.5)than the PI controller (IAE = 268.0).Small oscillations are shown to begin after 2500 Samples with the PI controller, however the LQR shows more promising results.It is important to note that the PI controller could probably be tuned better.

Concluding Remarks
Practical implementations of Model-free optimal anti-slug control was successfully demonstrated on three different cases on the 3-phase well-pipeline-riser example in the K-Spice/LedaFlow simulator.Linearized reduced order SSM was identified from a subspace algorithm, i.e.DSR, based on time-series, collected using an input experiment, i.e.PRBS.In each case we where able to stabilize the outlet flow, using the LQR and P I controllers.

Figure 5 :Figure 6 :Figure 7 :D
Figure 5: Open-loop simulations in K-Spice.Introducing the Gaslift choke at T ime = 1000 Samples.Topside choke was kept constant at u 1 = 25.Case A

Figure 10 :
Figure 10: Open-loop simulations in K-Spice.Subsea choke looks to have a much higher steady state gain than the topside choke.Case B

Figure 11 :Figure 12 :Figure 13 :Figure 14 :Figure 15 :Figure 16 :
Fig.17shows successful implementations of two different control strategies; LQR and PI.Both controllers are tuned using the identified model.The controllers are introduced at 500 Samples and are both able to stabilize the

Table 1 :
Comparing PI vs LQR control strategy using measures: Integrated Absolute Error (IAE) and Total Value (TV).See Fig.17