Introduction

The produced oil composition changes along its journey from the reservoir to surface facilities due to the change in pressure and temperature. Crude oil at downhole conditions (high pressure and temperature) may have dissolved gas that maintains the oil light components in equilibrium with the heavier components. When the pressure is reduced, the gas flashes from the oil changing oil composition and properties drastically. Oil and gas separation plants should be optimized to maintain high-quality oil by reducing the intermediate components flashing from the oil during the stage separation period. This can be achieved by optimizing the following parameters: number of stage separations, pressure, and temperature of each stage (Bahadori et al. 2008).

Downhole oil has high gas oil ratio (GOR) compared to the one at the surface (Abdel-Aal et al. 2003). The pressure losses due to potential and friction in the production tubing reduce the pressure of the oil stream that goes to the GOSP (Gas Oil Separation Plant). Separator pressure can be controlled and optimized using the backpressure control valve to maximize the amount of dissolved gas in solution to maximize the liquid recovery. Crude oil consists mainly of light components such as methane, ethane; intermediate components such as propane, butane, pentane, hexane; and heavy components that have C7+ components. The main objective of surface facilities is to separate the methane and ethane gas from the crude oil and maintain the intermediate components to maximize the liquid recovery. Maintaining the intermediate components in oil enhances the oil quality (higher API) leading to the higher oil price. Several separation methods can be used to separate the gas from oil such as differential and flash separation tests. In differential separation methods, gas is removed from the oil as the pressure is reduced. Previous research showed that differential separation maximized the recovery of the intermediate and heavier components from the oil and higher stock tank oil amount could be obtained (Clark 1969). Ahmed (2001) stated that in the differential separation methods, the separation of gas from oil at high pressures will help maintain to the intermediate and heavy components in the oil. However, the differential separation method is very expensive compared to the flash separation method as the former is difficult to be implemented in the field operations (Abdel-Aal et al. 2003).

Table 1 summarizes the previous work done on GOSP optimization along with the equations or AI models used. Also Table 1 lists the modeling approach that was used and pros and cons of each model.

Table 1 Summary of papers related to GOSP prediction

This paper is organized as follow: first section will explain the current empirical correlations to estimate GOSP parameters, second section will show the proposed artificial intelligence technique, third section will demonstrate and discuss the results.

Empirical correlations

The optimum number of separation stages is a function of the oil composition, well head pressure; therefore, it may differ from field to another (Gunnerud et al. 2012). During GOSP design, well head pressure declination with time should be considered as it impacts the separator entry pressure (Arnold and Stewart 1999).

Table 2 shows the steps to determine the optimum separation conditions of pressure and temperature using two-phase flash calculations. The optimum separator pressure that yields the maximum liquid recovery can be determined from the flash calculations using the vapor/liquid equilibrium method. As listed in the table, the first step is to determine the reduced properties of the gas, reduced pressure and reduced temperature. The two-phase flash calculations depend highly on the equilibrium constants between the liquid and gas phases (k). The two-phase equilibrium constant can be determined as shown in Table 2 (Abhvani and Beaumont 1987) using the gas mole fraction (yi) and liquid model fraction (xi). The second step is the material balance calculations in which the optimization will be done on the separator pressure and temperature that maximize the liquid recovery. Table 3 shows the critical properties Pci and Tci and Ttr listed in the previous equations that can be used to calculate the k-values at a given pressure and temperature to optimize the number of separation stages and the pressure and temperature of each separator.

Table 2 Steps of two-phase flash calculations
Table 3 Properties of different components

Artificial intelligence

The modern trend in data analytics and mining is integrating multi-dimensional and multi-modal data for value-added decision making in petroleum engineering applications. Over the years, various AI techniques have been implemented and attracted attention in various areas of geosciences and petroleum engineering applications (Passos et al. 2014). Many successful implementations of AI techniques in real oil and gas cases have attracted considerable interest in applying these techniques to predict challenging parameters in the petroleum industry. Some of the domains of the petroleum engineering in which AI techniques brought new values includes, porosity–permeability predictions (Abdulraheem et al. 2007; Nooruddin et al. 2013; Helmy et al. 2013; Anifowose et al. 2013), hydraulic flow unit identification (Shujath Ali et al. 2013), geomechanics parameters estimation (Yang and Rosenbaum 2002; Sonmez et al. 2004; Abdulraheem et al. 2009; Cevik et al. 2011; Tariq et al. 2016a, 2017a, b), geophysical well logs estimation (Tariq et al. 2016b; Elkatatny et al. 2018), well test parameters estimation (Artun 2017; Bazargan and Adibifard 2017), asphaltene prediction (Fattahi et al. 2015; Alimohammadi et al. 2017), water saturation prediction (Adebayo et al. 2015; Baziar et al. 2016) and many other oil and gas applications (Ahmadi 2011, 2012, 2015a, b, 2016; Ahmadi and Shadizadeh 2012; Ahmadi et al. 2014a, b, cd, e, f, 2015a, b, c, 2017; Ahmadi and Ebadi 2014; Ahmadi and Bahadori 2015; Ahmadi and Mahmoudi 2016; Ali Ahmadi and Ahmadi 2016). A common traditional AI technique which applied in petroleum engineering applications are: artificial neural networks (ANN), functional network (FN), support vector regressions (SVR’s), decision trees (Dt’s), and fuzzy logic (FL).

Elmabrouk et al. (2014) used regression analysis to develop a new correlation to predict the oil formation volume factor and bubble point pressure of the oil without the need for the full PVT data set. They only used gas–oil ratio, separator pressure, stock tank oil gravity, and reservoir temperature. They obtained accurate results compared to the actual measured values. Elshafei and Awady (2013) used the neural network technique to predict the performance of the GOSP multistage separation facility. They developed a technique that can be used to plan and operate the oil and gas separation facilities at the surface. They predicted parameters such as gas/oil ratio (GOR) in different stage separation. Ghaedi et al. (2014) used genetic algorithms to optimize the separator pressure in multistage separation. They showed the use of genetic-based approach enhanced the oil separation process and it increased the separated oil API.

This study explores the comparative performance of state-of-the-art and conventional AI techniques in the prediction of optimum separator pressure and the optimum number of stage separation of the GOSP that yields the maximum liquid recovery. The outcome of this study serves to assist users of AI techniques to make informed choices on the appropriate state-of-the-art techniques in petroleum production for improved predictions and better decision making especially when faced with limited and sparse integrated data. White box ANN was used to predict the optimum separation pressure and temperature based on the fluid composition of the flow stream.

Several authors including Elmabrouk et al. (2014) and Elshafei and Awady (2013) proposed a black box type of AI models. In all these papers, authors only mentioned the approach they have used to train their models. Readers of their papers cannot use them to make a prediction on a new dataset. In this study, the ANN model is translated into a simple mathematical model by extracting optimized weights and biases. This will allow readers to use ANN-based mathematical model to predict optimum separator pressure and temperature conditions by simply plug in the required input parameters without the need of using AI software to train ANN first and then make a prediction using trained model.

Optimum separator pressure prediction

Figure 1 shows the workflow that was followed to optimize the GOSP parameters of pressure and temperature.

Fig. 1
figure 1

Workflow of the proposed research study to model optimum GOSP parameters

To estimate the optimal value of optimum separator pressure, the following procedure is used:

  • Step 1 Normalize input parameters between − 1 and 1. Input parameters are denoted here by ‘Input’. The general equation for normalization is given by Eq. 1.

    $$X_{\text{norm}} = \frac{{\left( {{\text{Input}}_{\mathrm{max} } - {\text{Input}}_{\mathrm{min} } } \right)\left( {X - X_{\mathrm{min} } } \right)}}{{X_{\mathrm{max} } - X_{\mathrm{min} } }} + {\text{Input}}_{\mathrm{min} }$$
    (1)
    $$\begin{aligned} {\text{Input}}_{\mathrm{min} } = - 1 \hfill \\ {\text{Input}}_{\mathrm{max} } = 1 \hfill \\ \end{aligned}$$

    X is the input parameter, Xmin is the minimum value of trained input parameter and Xmax is the maximum value of the trained input parameter. Xmin and Xmax.

  • Step 2 Use the Empirical correlation shown in Eq. 8 (Appendix 1) to find the optimal value of the pressure.

  • Step 3 Equation 8 gives optimum separator pressure in normalized form \((P_{\text{norm}} )\) which is in the range of [− 1 to 1]. So, optimum separator pressure should be de-normalized and transform into real value form by applying Eqs. 4 and 5.

Optimum separator temperature prediction

To estimate the optimal value of optimum separator temperature, the following procedure is used:

  • Step 1 Normalize input temperature between [− 1, 1] as shown in Eq. 1.

  • Step 2 Use the Empirical correlation shown in Eq. 9 (Appendix 1) to find the optimal value of the pressure.

  • Step 3 De-normalize optimum separator temperature into real value form by applying Eqs. 6 and 7.

Results and discussion

Prediction of the optimum GOSP parameters using analytical techniques

In this part, the number of stage separation that yields the maximum liquid recovery will be predicted as well as the effect of water cut. The optimum pressure and temperature of each stage separation will be determined also based on the maximum liquid recovery. Table 2 equation list was used in this prediction for the oil stream composition listed in Table 3. The following stream properties and conditions are used: oil flow rate = 66,000 BPD, oil viscosity = 0.55 cP, GOR = 910 MSCF/bbl, first-stage separation pressure = 640 psi.

Effect of water cut on the liquid recovery (oil)

The effect of water cut on the liquid recovery from the first-stage separation is shown in Fig. 2. The water cut highly affected the liquid recovery from the first-stage separation as shown in the figure. The liquid recovery dropped from 68.6% at zero water cut to 48% at 30% water cut of the flow stream. Assuming that the majority of the water will be separated from the first-stage separation and the oil entering the other stages is water free, the liquid recovery is no longer function of the well stream water cut. Water cut does not affect the number of stage separations, but it only affects the first-stage efficiency because it affects the amount of liquid to the gas molar ratio in the first-stage separation which, in turn, affects the equilibrium constant calculations. This example shows that precaution should be taken when higher water cuts are encountered during the separation process because the water will highly impact the process of oil separation. The majority of oil fields starts producing with very low water cuts (some of them start with zero water cut). Due to water influx at later stages, the water production will increase dramatically, and water cut may reach 95% or more in some fields. During the GOSP design phase, water cut change along the field life should be considered.

Fig. 2
figure 2

Effect of water cut on oil recovery from the first-stage separation

Effect of number of stage separation on the extra oil recovery

Figure 3 shows the effect of the number of stage separation on the liquid recovery from the GOSP. The extra recovery tested in this example is defined as the difference between the recovery between the two successive stages. Three stage separations did not yield in incremental oil recovery for the flow stream given in the tested example. The four-stage separation was the optimum number that yields the maximum incremental oil recovery of about 3.5% excess recovery compared to 0.67% of the five-stage separation. Based on the field practice, if the incremental liquid recovery between the stage separations is less than 1%, the extra stage should not be considered because it will not be feasible from the economic point of view. Increasing the number of separation stages from three to four minimized the gas flash from the oil by keeping the gas in contact with the oil which maximized the oil recovery. Increasing the number of GOSP separations will allow for the small decrement in the separator pressures for the successive stages. As the liquid recovery is a strong function of the separator pressure, the flow stream coming from the wellhead or from the manifold should be adjusted based on the optimum separator pressure to yield the maximum liquid recovery. The flow stream pressure is a strong function of the wellhead pressure and the distance from the wellhead to the GOSP location. Pressure losses in the pipelines will reduce the pressure at the GOSP. Wellhead pressure depends on the flow mode. In the case of natural flowing well, it ranges from 100 to 500 psi. In artificially lifted wells, the wellhead pressure could be higher than 500 psi.

Fig. 3
figure 3

Effect of the number of stage separation on the extra oil recovery

Optimum pressure and temperature of the separation stage

The optimum separator pressure and temperature were calculated based on the flash calculations considering the well stream of constant composition. Composition variation during field life can be adjusted by providing the new stream composition.

The maximum liquid recovery was calculated based on the list of equations and steps in Table 2 at different separator pressures and temperatures and the equilibrium constant was calculated at these conditions. This method is very simple and accurate compared to the optimization of separation conditions based on wellhead pressure and stock tank atmospheric pressure.

Ling et al. (2013) provided an approximation to determine the optimum separator pressure based on the wellhead pressure. Applying their method for the tested example, where we have four-stage separation:

$${\text{Ratio}}_{p} = \left[ {\frac{{p_{\text{wh}} }}{{p_{\text{atm}} }}} \right]^{{\frac{1}{N}}} = \left[ {\frac{300}{14.7}} \right]^{{\frac{1}{3}}} = 2.73$$
(2)

The wellhead pressure, in this case, was 300 psi, and the stock tank pressure is atmospheric pressure; N is the number of stage separation − 1. Then, the primary separator pressure can be determined as follows:

$$p_{\text{primary}} = \frac{{p_{\text{wh}} }}{{{\text{Ratio}}_{p} }} = \frac{300}{2.73} = 110\,{\text{psi}}$$
(3)

Comparing this pressure to the one obtained based on the flash calculations which is 655 psi, there is a big difference between the two methods. The method suggested by Ling et al. (2013) does not consider the changes in wellhead pressure. In addition, Ling et al. (2013) method is not applicable for wells with very low wellhead pressures. On the other hand, our method does not depend on the wellhead pressure, the flow stream composition is needed, and the optimization process will be done independently.

Figures 4, 5 and 6 show the optimum separator pressure and temperature for the different stage separations. The optimum pressure in the first-stage separation is 655 psi, which is usually higher compared to the wellhead pressure. Also, we should consider the pressure losses due to potential energy loss and friction in the pipelines as well as restrictions, orifices, and valves. This means the well stream should be pumped to increase the inlet pressure of the separator to achieve the required optimum value. The GOSP design should consider these optimum pressures to maximize the liquid recovery from the separation process. Based on the flow rate of the well stream, the temperature at the surface could be very close to the one required at the separator to maximize the liquid recovery. The effect of temperature in other stages is negligible compared to the pressure effect. The optimum separator conditions should be performed based on the maximum liquid recovery, and then other properties such as API and GOR can be calculated. However, if optimization was done based on the maximum API and the lowest GOR, the results should be close to one based on maximum liquid recovery. Bahadori et al. (2008) determined the optimum separator conditions based on flash equilibrium during the summer and winter for a specific oil type. They have done their optimization based on the maximum oil API and the minimum GOR, and they obtained an optimum separator pressure of 600 psi during the summer and 100 psi during the winter time due to the change in temperature.

Fig. 4
figure 4

Optimum pressure for the first-stage separation

Fig. 5
figure 5

Optimum temperature for the first-stage separation

Fig. 6
figure 6

Optimum pressure and temperature for the three stages

Prediction of the optimum GOSP parameters using artificial intelligence techniques

Artificial neural network technique was used to train and test the input data to extract the empirical correlation that can be used to predict both pressure and temperature that yield the maximum liquid recovery from the GOSP. We created a GOSP model using industrial dynamic process simulator called “OmegaLand” to generate the data as shown in Fig. 7. The optimization was done for the first-stage separation in this study. Table 4 shows the statistics of the input data in which 70% was used for training and 30% used for testing. Figures 8 and 9 show the training and testing of the ANN model to predict the separator pressure. Figures 10 and 11 show the training and testing of the ANN model to predict the separator temperature.

Fig. 7
figure 7

GOSP model

Table 4 Data statistics
Table 5 Error analysis
Table 6 Neural network architecture
Fig. 8
figure 8

Training of ANN model to predict the optimum separator pressure

Fig. 9
figure 9

Testing of ANN model to predict the optimum separator pressure

Fig. 10
figure 10

Training of ANN model to predict the optimum separator temperature

Fig. 11
figure 11

Testing of ANN model to predict the optimum separator temperature

Optimum separator pressure estimation

An empirical expression based on weights and biases of the trained ANN model is developed to model and predict the optimum separator pressure. These weights (w1 and w2) and biases (b1 and b2) for optimum separator pressure prediction model are given in Table 7. The proposed optimum separator pressure ANN equation is given by Eq. 8 (Appendix 1). As mentioned before, the estimated optimum pressure value using Eq. 8 is normalized and it should be de-normalized and transformed into real form as shown below:

$$P_{\text{opt}} = \frac{{\left( {257.345 - 208.887} \right)\left( {P_{\text{norm}} + 1} \right)}}{2} + 208.887$$
(4)
$$P_{\text{opt}} = 24.229*P_{\text{norm}} + 233.116$$
(5)

Mathematical model for optimum separator temperature

An empirical expression based on weights and biases of the trained ANN model is developed to model predict optimum separator temperature. These weights (w1 and w2) and biases (b1 and b2) for optimum separator temperature prediction model are given in Table 8. The proposed optimum separator temperature ANN equation is given by Eq. 9 (Appendix 1). As mentioned before, the estimated optimum pressure value using Eq. 9 is normalized and it should be de-normalized and transformed into real form as shown below:

$$T_{\text{opt}} = \frac{{\left( {65.982 - 63.2} \right)\left( {T_{n} + 1} \right)}}{2} + 63.2$$
(6)
$$T_{\text{opt}} = 1.391*T_{n} + 64.591$$
(7)

Table 5 shows the error analysis for both separator pressure and temperature predictions. The coefficient of determination (R2) and the average absolute percentage error (AAPE) indicate that the empirical correlation extracted from the ANN model is accurate enough to predict the separator pressure and temperature in both testing and training phases. The architecture of the trained ANN model is given in Table 6.

Conclusions

In this study, the optimum GOSP pressure and temperature based on the fluid composition was determined based on analytical and AI techniques. The separator pressure was found to have a significant effect on the oil recovery from the individual separation stage. Artificial neural network (ANN) was used to predict the optimum pressure and temperature with high accuracy. This means with the fluid composition as inputs, the separator pressure and temperature can be predicted using the developed AI model.