Introduction

Estimation of well bottom-hole pressure at any existing operating conditions is continuously needed in oil and gas wells to monitor fluid movements inside the wellbore and the nearby wellbore regions. Petroleum wells normally produce a mixture of liquids and gases at the surface. The phase distribution typically changes due to the pressure variations along the course of the flow. At pressure above the bubble point pressure of the liquid phase, particularly at the bottom of the well, the flow is the single phase, i.e., oil phase only, but as oil moves up inside the vertical well, the hydrostatic pressure drop causes liberation of gases from the oil phase which resulted in the multiphase flow of oil and gas (Hagedorn and Brown 1965; Govier and Fogarasi 1975). Multiphase flow is a simultaneous flow of two or three phases such as oil, gas, and water which can start producing any time in the life of well (Beggs and Brill 1973). Multiphase flow phenomenon has also gained considerable attention in many other science fields including mechanical, civil, chemical, and nuclear engineering (Jahanandish et al. 2011). The representative prediction of the pressure drop in a vertical well during the simultaneous multiphase flow of fluids is a well-known problem in the petroleum industry (Hagedorn and Brown 1965). The need to properly estimate pressure drop in a vertical well is very necessary for the accurate forecast of production performances and for the appropriate well completions design and artificial-lift systems (Ansari et al. 1994).

Nowadays, smart well completion is very common, in which down-hole pressure gauges are permanently installed at the bottom of the well to measure FBHP. However, these pressure gauges need constant calibration and maintenance to prevent malfunctioning and misleading readings (Davies and Aggrey 2007; Al-Shammari 2011). In case of conventional well completions, frequently intervening a well to measure FBHP is an exhaustive job which is linked with several risks like production interruptions and economic losses. For these purposes, the real-time information of FBHP is very handy for production engineers.

Numerous mechanistic and empirical models were developed to estimate the pressure drop inside the tubing in a vertical well. Most of the empirical models and correlations were formulated under laboratory scale, which eventually become less accurate when up-scaled to field situations (Pucknell et al. 1993). The most commonly used correlations are Duns and Ros (1963); Hagedorn and Brown (1965); Aziz and Govier (1972); Beggs and Brill (1973); and Mukherjee and Brill (1983). Several studies have shown that these empirical correlations estimate pressure drop in multiphase flowing wells with large errors and high level of uncertainty (Asheim 1986; Pucknell et al. 1993; Takacs 2001; Lawson and Brill 1974). Mechanistic models are based on theoretical approaches to calculate multiphase flow characteristics such as mixture densities, flow patterns, and liquid hold ups. The most commonly used mechanistic models in petroleum engineering calculations are Kabir and Hasan (1986), Ansari et al. (1994), Chokshi et al. (1996), and Gomez et al. (1999).

The past two decades have seen significant increase in computational intelligence (CI) applications in various areas of geosciences and petroleum engineering (PETE). The relevance of CI in PETE applications stems from CI’s ability to handle the huge streams of data generated in the field such as seismic data, petrophysical well log data, and injection and production data. Every wiggle in the log and every blip in the data signify something and have the potential to be used in addressing pertinent issues. Also, in the real world, the basic assumptions used in the derivation of the physical equations may be violated, due to numerous reasons such as anisotropy, heterogeneity, nonlinearity, nonelasticity, and nonideal fluid behavior. CI can address such complications with relative ease (Anifowose et al. 2017). Some of the domains of the petroleum engineering in which CI techniques brought new innovations include porosity–permeability predictions (Abdulraheem et al. 2007; El-Sebakhy et al. 2012; Nooruddin et al. 2013; Helmy et al. 2013; Anifowose et al. 2013, 2014, 2017), hydraulic flow unit identification (Shujath Ali et al. 2013), rock mechanical parameters estimation (Yang and Rosenbaum 2002; Sonmez et al. 2004; Abdulraheem et al. 2009; Cevik et al. 2011; Tariq et al. 2018b), missing petrophysical well logs estimation (Tariq et al. 2019), well-testing parameters estimation (Artun 2017; Bazargan and Adibifard 2017), asphaltene and wax precipitation predictions (Rezaian et al. 2010; Adeyemi and Sulaimon 2012; Fattahi et al. 2015; Alimohammadi et al. 2017), water saturation prediction (Adebayo et al. 2015; Bageri et al. 2015; Baziar et al. 2016, 2018; Khan et al. 2018), gas compressibility factor (Mohagheghian et al. 2015; Tariq and Mahmoud 2019), oil well drilling rate of penetration optimization (Gidh et al. 2012), and many other oil and gas applications (Ashena et al. 2010; Jahanandish et al. 2011; Asoodeh 2013; Rammay and Abdulraheem 2016).

An artificial neural network (ANN) is one of the most powerful and robust CI tools for solving complex nonlinear problems, including function approximation, pattern recognition, parameter selection, and automated control and optimization (Maren 1990; Huang et al. 1996). This technique is originated from the learning principles of biological neurons found in human body (Graves et al. 2009). Recent advances in the mathematics of neural network and its ability to solve complex and nonlinear problems have gained wide recognition in the petroleum industry (Anifowose et al. 2014).

Petroleum industry has paid significant attention to use CI technique to predict FBHP in oil and gas wells. Osman et al. (2005) developed the model for estimating bottom-hole flowing pressure using artificial intelligence (AI) tools. Their model was based on 300 data points. Jahanandish et al. (2011) presented an ANN model for the estimation of the BHP. Their model was developed on 413 data points. Al-Shammari (2011) predicted BHP using adaptive neuro-fuzzy interference system (ANFIS) on 596 data points obtained from Middle Eastern fields. He used Genfis-2 (subtractive clustering) to develop ANFIS model for BHP prediction. Bello and Asafa (2014) predicted the FBHP and bottom-hole temperature using functional network technique. They have used 200 data points from multiple wells. Li et al. (2014) designed a calculation procedure to predict BHP using multiphase correlation and trained ANN model. They predicted BHP with 23% average absolute percentage error (AAPE) and 0.176 std. Ebrahimi and Khamehchi (2015) used ANN technique on the data obtained from Middle Eastern field to improve the prediction of BHP. Their objective was to test several optimization algorithms to optimize ANN parameters and then compare their results with conventional methods in oil and gas industry. Memon et al. (2015) created dynamic well surrogate reservoir models (SRM) to predict flowing well bottom-hole pressure using radial basis function neural network (RBF). The input data of their model were porosity and permeability of different layers in SRM and production rate. The output data of their model were extorted from a SRM model. Ayoub et al. (2015) presented the model to predict the pressure drop in a multiphase flow vertical well using the group method of data-handling (GMDH) approach. The GMDH is a commonly used regression technique based on constructing high-order polynomials (Karnazes and Bonnell 1982; Assaleh et al. 2013). Ahmadi et al. (2016) predicted FBHP at different time steps for an initially undersaturated reservoir using surrogated reservoir modeling and radial basis neural network approach. They have used the output of reservoir simulator such as oil rate, gas rate, and saturation to predict FBHP. Chen et al. (2017) used support vector regression (SVR) to predict FBHP in gas wells. They have used the measured FBHP data from Sulige gas field as an output parameter. Their model was based on the well perforation depth, flowing water rate, flowing gas rate, relative gas density, average wellbore temperature, casing pressure, and gas compressibility factor.

It can be inferred from the literature survey that CI methods can be applied to estimate FBHP. The previous analytical and mechanistic models (Duns and Ros 1963; Hagedorn and Brown 1965; Beggs and Brill 1973; Mukherjee and Brill 1985; Kabir and Hasan 1986; Ansari et al. 1994; Gomez et al. 1999) are built on the parameters which can be determined from the laboratory analysis. This means that they are not capable of giving real-time FBHP values under existing operating conditions. Also, these models are computationally very expensive to execute. Two major problems with the previous works are going to be addressed in this study. Firstly, previous CI research studies predicted the FBHP using laboratory-dependent inputs, so the first objective is to identify the real-time input parameters that are readily available on the surface to estimate the real-time FBHP with good accuracy. Secondly, previous researchers (Osman et al. 2005; Davies and Aggrey 2007; Jahanandish et al. 2011; Al-Shammari 2011; Adebayo et al. 2013; Bello and Asafa 2014; Memon et al. 2014, 2015; Li et al. 2014; Ayoub et al. 2015; Ebrahimi and Khamehchi 2015; Awadalla and Yousef 2016; Chen et al. 2017) proposed a black box type of CI 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 predict FBHP on a new dataset, so the second objective is to develop robust ANN-based mathematical model to predict real-time flowing bottom-hole pressure (FBHP) by using real-time surface production data parameters. To improve the accuracy of the ANN model, particle swarm optimization (PSO) algorithm is used to optimize the weights and biases of the trained neural network to predict FBHP; previously, Ebrahimi and Khamehchi (2015) and Awadalla and Yousef (2016) used optimization algorithms to optimize the parameters of ANN model. In this study, ANN model is translated into simple mathematical model by extracting optimized weights and biases. This will allow readers to use proposed model without the need for any CI software.

Methodology

Data acquisition and preprocessing

Data analysis and preprocessing are the key steps to perform carefully, since the prediction performance of CI models is highly dependent on the quality of the data. A total of 206 data points were obtained from published sources (Govier and Fogarasi 1975; Asheim 1986). In these sources, the pressure data were obtained from the BHP surveys by lowering the down-hole pressure gauges inside the well just above the perforations to record the well bottom-hole flowing pressure. Table 1 lists some of the data points used for FBHP prediction modeling. To scrutinize the quality of the obtained data and to remove any suspicious outliers, various mechanistic and empirical models were used to predict the FBHP and their results were then compared with the measured actual values. Data points which constantly caused poor predictions by all mechanistic models and correlations were assumed to be erroneous and therefore deleted. The mechanistic and empirical models used to check the quality of the data were Duns and Ros (1963), Hagedorn and Brown (1965), Beggs and Brill (1973), Mukherjee and Brill (1985), Kabir and Hasan (1986), Ansari et al. (1994), and Gomez et al. (1999).

Table 1 Sample of the collected datasets (206 points) from different sources

Data analysis and description

The real-time production data used in this study were taken from the perfectly vertical wells with no any form of artificial lift, and all wells were completely naturally flowing. FBHP was measured at the depth of perforation. Dataset consists of total of nine input parameters such as well perforation depth, flowing oil rate (qo), flowing gas rate (qg), flowing water rate (qg), production tubing internal diameter (\(\emptyset\)), surface temperature (STM), well bottom-hole temperature (BTM), oil gravity (API), and wellhead pressure (\(P_{\text{wh}}\)). The output is measured FBHP. The ranges of input parameters employed are perforation depth, 4500–7550 ft, qo, 280–19,800 bbl/day, qg, 33.6–27,400 MScf/D, qg, 0–11,000 bbl/day, \(\emptyset\), 1.995–4.000 inches, STM, 76–160 °F, BTM, 157–215 °F, and \(P_{\text{wh}}\), 80–960 psia. The ranges of all investigated input parameters are considered practically reasonable in the petroleum field and are comparable with previously published studies. A complete statistical description of the data used in the training of the model is given in Table 2.

Table 2 Statistical description of (a) training dataset and (b) testing dataset

The next most imperative step taken in the data analysis process of this study was to determine the relative importance (in terms of correlation coefficient (CC)) of each input parameter with the FBHP. The CC was calculated between the FBHPs with each input using Pearson’s correlation coefficient method. The definitions of CC and other statistical parameters are given in “Appendix A.” In general, the CC value ranges from − 1 to 1, in which the values close to + 1 show strong direct relationship between two parameters while the CC values close to zero show no relationship between two parameters and the CC values close to − 1 show strong indirect relationship between two variables. Figure 1 shows that the FBHP is a good direct function of perforation depth, oil rate, and wellhead pressure. The CC values for perforation depth, oil rate, and wellhead pressure with FBHP are 0.65, 0.56, and 0.56, respectively. FBHP is a weak function of surface temperature and bottom-hole temperature as shown in Fig. 1. The CC values for surface and bottom-hole temperature with FBHP are 0.29 and 0.35, respectively. However, the rest of the parameters have moderate relationship with FBHP.

Fig. 1
figure 1

Relative importance of input parameters with flowing bottom-hole pressure

ANN algorithm

In this study, ANN model is designed on the three components, namely learning algorithm, transfer function, and a signal processing element termed as neurons. Network consists of three structural layers: an input layer, a hidden layer, and an output layer. Input layer consists of nine input parameters which are well perforation depth, flowing oil rate (qo), flowing gas rate (qg), flowing water rate (qw), tubing string internal diameter (\(\emptyset\)), surface temperature (STM), well bottom-hole temperature (BTM), oil gravity (API), and wellhead pressure (\(P_{\text{wh}}\)). The learning rate and the number of neurons inside the hidden layer are the key components in ANN structure (Gitifar et al. 2013; Ashena and Thonhauser 2015). During training of the model, data were transferred from input layer to the single hidden layer and from the hidden layer to the output layer to get required output (Jorjani et al. 2008). Each layer connects with subsequent layer by connections termed as weights and auxiliary functions termed as biases (Lippman and Lippman 1987). Network functionality strongly depends on the tuning of these weights and biases (Hinton et al. 2006). At the output layer, the predicted and actual values were compared and the difference between the two calculated is called as error. To improve the predictive capability of the system, the error was transferred back to the layers to tune up the weights and biases. This process of iteration is called as epoch. ANN then self-corrects iteratively and becomes better with progressive training runs. The final model at the end of training phase is a representation of the transfer function between the inputs and the desired output (Rao and Ramamurti 1993). In the current study, it is found that fewer number of neurons result in underfitting problem while excessive number of neurons cause more computational time with memorization or overfitting problem, which is also proved by other studies (Mohaghegh 2017).

Mathematically, the signal of neuron can be expressed by Eq. 1:

$$Z_{i} = \sigma (\mu_{i} + b_{i} )$$
(1)

where

$$\mu_{k} = \mathop \sum \limits_{j = 1}^{{N_{h} }} w_{ij} x_{j}$$
(2)

where \(w_{ij}\) is the weight of input j of neuron i and \(x_{j}\) is the input parameter, \(b_{i}\) is the bias. \(Z_{i}\) is the output signal of neural network, and \(\sigma (x)\) is the transfer function. There are three types of transfer function, namely: piecewise linear function, sigmoidal function, and threshold function (Yang et al. 1996). The most commonly used transfer function employed in feed-forward neural network (FFNN) is sigmoidal function (Ashena and Thonhauser 2015), given by Eq. 3:

$$\sigma (x) = \frac{1}{{1 + e^{ - sx} }}$$
(3)

where ‘s’ is the slope parameter of the sigmoid function. By changing the parameter, a different slope of sigmoid function can be achieved.

In ANN, two types of models were investigated, namely radial basis function neural network function and FFNN. A comparison between these two models based on minimum averaged absolute percentage error (AAPE) and highest coefficient of determination (R2) was made between actual and predicted values. FFNN model was based on three structural layers, namely an input layer, a single hidden layer and an output layer. Sensitivity of number of neurons in the single hidden layer was performed by varying them in the range of 5 to 30. The optimum number of neurons was found to be 20, since this combination ended up in highest R2 and lowest AAPE in training/testing phases of the modeling. Sensitivity for selecting optimum transfer function between input layer and the single hidden layer was also executed between log-sigmoidal- and tan-sigmoidal-type transfer functions. Tan-sigmoidal-type transfer function performed better than the log-sigmoidal. To get the initial weights and biases, back-propagation Levenberg-Marquardt (LM) learning algorithm was selected. To further tune the weights and biases to improve the quality of prediction, PSO a computational evolutionary algorithm was coupled with ANN.

Design of hybrid PSO-ANN model

In this study, particle swarm optimization (PSO) algorithm is used to optimize the weights and biases of the trained ANN model. PSO is a stochastic population-based evolutionary algorithm, motivated by the societal attitude of fish schooling and birds clustering (Kennedy 1997; Shi and Eberhart 1998; Abido 2002). ANN coupled with PSO has proved to be better and faster predictive tool in comparison against the conventional ANN technique (Catalao et al. 2010; Vasumathi and Moorthi 2012; Wang et al. 2015; Tariq et al. 2016; Jahed Armaghani et al. 2017; Chatterjee et al. 2017; Tariq et al. 2018a; Ethaib et al. 2018). PSO represents population of random solutions in the search space as particles assigning random velocities to them and iteratively tuning the fitness of the particles until the best solution called global best is achieved. PSO initializes based on predefined algorithm parameters (i.e., population, weight, cognitive parameters, etc.). It then randomly generates particle locations in the solution search space for initial objective function evaluation. Particles velocity term is given by Eq. 4:

$$v_{i} (n + 1) = \omega v_{i} (n) + \left\{ {c_{1} \times {\text{rand}}[0,1] \times \left( {p_{i}^{b} - p_{i} (n)} \right)} \right\} + \left\{ {c_{2} \times {\text{rand}}[0,1] \times \left( {p_{gb} - p_{i} (n)} \right)} \right\}$$
(4)

where \(\omega\) is the weight \((0 \le w \le 1.2)\), \(v_{i}\) particle velocity, \(c_{1}\) cognitive parameter \((0 \le c_{1} \le 1.2)\), \(c_{2}\) cognitive parameter \((0 \le c_{2} \le 1.2)\), \(n\) iteration number, \(p_{i}^{b}\) particle best solution, \(p_{gb}\) global best solution, and \(p_{i}\) particle \(i\) position at any iteration.

The inertia term in the particle velocity equation \((wv_{i} (n))\) ensures the particle moves toward its original direction, whiles its weight \((w)\) ensures the particle rate of acceleration moves toward its original direction. The cognitive component \(c_{1} \times {\text{rand}}[0,1] \times (p_{i}^{b} - p_{i} (n))\) memorizes the particle previous best solution obtained. The social component \(c_{2} \times {\text{rand}}[0,1] \times (p_{\text{gb}} - p_{i} (n))\) moves the particle toward the global best fitness. New position for each candidate solution in the solution search space is generated by sum of the current position and velocity:

$$p_{i} (n + 1) = p_{i} (n) + v_{i} (n).$$
(5)

An objective function (a function that is desired to be minimized) is determined to assign the global best value, if the current best value is better than the values obtained in the previous iteration. The pseudocode for PSO-ANN algorithm is given in Table 3. After optimization, tuned weights and biases from the optimized model were retrieved.

Table 3 Pseudocode for PSO-ANN algorithm

Results and discussion

A total of 206 data points were divided randomly into two sets with the proportion of 70:30. The set with 70% of the dataset (145 data points) were used for training of the models, and the other set with 30% of the dataset (60 data points) were used to test the prediction capabilities of the trained models. The histogram plots for training and testing datasets are given in Figs. 2 and 3.

Fig. 2
figure 2

Frequency histograms of training dataset (145 data points)

Fig. 3
figure 3

Frequency histograms of testing dataset (60 data points)

In ANN, two types of models, FFNN and RBF, were tested. During training, FFNN predicted FBHP with AAPE of 10% and R2 of 0.90, while RBF type of ANN predicted FBHP with AAPE of 13.6% and R2 of 0.853. During testing, FFNN predicted FBHP with AAPE of 12.3 and R2 of 0.89 while RBF predicted FBHP with AAPE of 13.6% and R2 of 0.879, as shown in Table 4. Based on the lowest AAPE and highest R2, FFNN was selected as better ANN type compared to RBF for the prediction of FBHP

Table 4 Prediction comparison of ANN types, FFNN and RBF

To improve the accuracy of the model, the hybrid PSO-ANN algorithm is applied for the prediction of FBHP in a vertical well. On a set of random data which is 70% the total data (145 data points), PSO-ANN predicted FBHP with the AAPE of 2.0% while ANN predicted the FBHP with the AAPE of 10% as shown in Fig. 4. For the set of data which were dedicated for testing the generalization capabilities and stability of the trained model (30% of the total data, 60 data points), PSO-ANN predicted FBHP with AAPE of 3.1%, while ANN predicted FBHP with the AAPE of 12% as shown in Fig. 5.

Fig. 4
figure 4

FBHP prediction using optimized and unoptimized models (training dataset)

Fig. 5
figure 5

FBHP prediction using optimized and unoptimized models (testing dataset)

Comparing the performance of two models; PSO-ANN and ordinary ANN, during training ANN model predicted FBHP with less AAPE than ordinary ANN, respectively, on the other hand PSO-ANN gave R2 of 0.98 which is higher than the R2 produced by ordinary ANN which is 0.9. During testing the unseen data, PSO-ANN also outperformed ANN and yielded lower AAPE and higher R2. Figure 6 shows the comparison cross-plots between actual and predicted FBHP for both during training and testing phases.

Fig. 6
figure 6

Training and testing cross-plot of FBHP prediction using PSO-ANN and ANN models

Development of an ANN-based mathematical model for FBHP prediction

A FFNN model is created by a series of three layers, an input layer, a single hidden layer, and an output layer. Hidden layer neurons use their weights \(w_{1}\) and biases \(b_{1}\). These parameters are described by Eq. 6:

$$\sigma_{L} \left( {\mathop \sum \limits_{j = 1}^{{N_{P} }} w_{{1_{j} }} x_{j} + b_{1} } \right)$$
(6)

where \(N_{P}\) is the total number of inputs, \(x\) are the input parameters, and \(\sigma_{L}\) is the transfer function between the input layer and the single hidden layer. The output of the whole network ‘\(\mu_{P}\)’ can be expressed as in Eq. 7:

$$\mu_{P} \left( \varphi \right) = \sigma_{o} \left[ {\mathop \sum \limits_{i = 1}^{{N_{h} }} w_{{2_{i} }} \sigma_{L} \left( {\mathop \sum \limits_{j = 1}^{{N_{P} }} w_{{1_{i,j} }} x_{j} + b_{1i} } \right) + b_{2} } \right]$$
(7)

where \(\sigma_{o}\) is a transfer function between the single hidden layer and the output layer and \(N_{h}\) is the hidden layer number of neurons. Weights between the input layer and the hidden layer are a matrix denoted by \(w_{1}\), and weights between the hidden layer and the output layer are a vector denoted by \(w_{2}\). Biases between the input layer and the hidden layer are denoted by \(b_{1}\), and bias between the hidden layer and the output layer is termed as \(b_{2}\).

The proposed PSO-ANN model is trained with nine input parameters which are \({\text{Depth}}\), \(q_{\text{o}}\), \(q_{\text{g}}\), \(q_{\text{w}}\), \(\emptyset_{n}\), \({\text{API}}\), \({\text{STM}}\), \({\text{BTM}}\), and \(P_{\text{wh}}\), with one hidden layer containing 20 neurons, tan-sigmoidal as a transfer function between input layer and hidden layer, and pure linear as a transfer function between the hidden layer and the output layer. Figure 7 shows the general architecture of the proposed model. Table 5 shows the list of learning parameters involved in the training and testing of the proposed model. An empirical correlation is developed from the proposed PSO-ANN model. An empirical correlation depends on the associated weights and biases which are listed in Table 6. The proposed equation can be written more specifically as in Eq. 8:

$$\begin{aligned} {\text{FBHP}}_{\text{n}} & = \sigma_{o} \left[ {\mathop \sum \limits_{i = 1}^{{N_{h} }} w_{{2_{i} }} \sigma_{L} (w_{{1_{i,1} }} \,{\text{Depth}}_{n} + w_{{1_{i,2} }} q_{{{\text{o}}_{n} }} + w_{{1_{i,3} }} q_{{{\text{g}}_{n} }} + w_{{1_{i,4} }} q_{{{\text{w}}_{n} }} + w_{{1_{i,5} }} \emptyset_{n} } \right. \\ & \quad \left. { + \,w_{{1_{i,6} }} {\text{API}}_{n} + w_{{1_{i,7} }} {\text{STM}}_{n} + w_{{1_{i,8} }} {\text{BTM}}_{n} + w_{{1_{i,9} }} P_{{{\text{wh}}_{n} }} + b_{{1_{i} }} ) + b_{2} } \right] \\ \end{aligned}$$
(8)

where \(\sigma_{L} (x) = (2/1 + e^{ - 2x} ) - 1\), \(\sigma_{o} \left( x \right) = x\)

$${\text{FBHP}} = \frac{{(3217 - 1227)({\text{FBHP}}_{n} + 1)}}{2} + 1227$$
(9)
Fig. 7
figure 7

Architecture of PSO-ANN model for FBHP

Table 5 PSO-optimized neural network architecture
Table 6 Weights and biases of proposed FBHP empirical model

The detailed procedure to use the proposed equation is given in “Appendix B.”

Evaluation and validation of the proposed model to predict FBHP

Evaluation and validation of new equation is based on published data and group trend analysis.

Comparison of the proposed FBHP model with other correlations and mechanistic model

A total of 50 data points from the published data by Peffer et al. (1988) were utilized to validate the generalization capability of the proposed PSO-ANN model. To achieve this purpose, various mechanistic and empirical models were tested on the same dataset. The mechanistic and empirical models tested were Duns and Ros (1963), Hagedorn and Brown (1965), Beggs and Brill (1973), Mukherjee and Brill (1985), Kabir and Hasan (1986), Ansari et al. (1994), and Gomez et al. (1999). Table 7 shows the list of various statistical parameters obtained from the comparison for evaluation purposes. To demonstrate the strength of the proposed model, R2 and AAPE were used as suitable pointers of robustness. Analysis of Table 7 shows that PSO-ANN model outperforms all other investigated mechanistic and empirical models by giving less AAPE and high R2 between actual and predicted datasets.

Table 7 Statistical analysis of the comparison between empirical correlations, mechanistic models, and proposed ANN model on testing dataset

Group trend analysis

A group trend analysis was carried out to assess the strength of the proposed empirical model and to make sure that how effectively the proposed model captures the physical phenomenon behind each scenario. To achieve this, synthetic datasets were created, where in every set of data only one input parameter was varied from its minimum to maximum values while all other parameters were kept constant at their average values. FBHP is calculated and plotted in Figs. 8, 9, 10, 11, and 12 with different scenarios which are changing flow rate of oil, changing flow rate of gas, changing flow rate of water, changing depth of perforations, and changing GLRs with different tubing IDs.

Fig. 8
figure 8

Effect of changing oil rate on flowing bottom-hole pressure at tubing IDs of 2.875, 3.500 and 4.000 inches

Fig. 9
figure 9

Effect of changing gas rate on flowing bottom-hole pressure at tubing IDs of 2.875, 3.500 and 4.000 inches

Fig. 10
figure 10

Effect of changing water rate on flowing bottom-hole pressure at tubing IDs of 2.875, 3.500 and 4.000 inches

Fig. 11
figure 11

Effect of changing depth on flowing bottom-hole pressure at tubing IDs of 1.995, 2.375, 2.875, 3.500 and 4.000 inches

Fig. 12
figure 12

Effect of changing depth with different gas–liquid ratios (GLRs) on flowing bottom-hole pressure at tubing diameter of 4.000 inches

Effect of changing oil flow rate on FBHP curve

Figure 8 shows the effect of increasing oil rate on FBHP with three different tubing IDs of sizes 2.875, 3.5, and 4.0 inches. Increase in tubing diameter reduces frictional losses which helps in increasing the flow rate. For instance, at the FBHP of 2500 psi, the 2.875” tubing gives 8500 bbls/day, the 3.5” tubing gives 13,200 bbls/day, and 4” tubing gives 18,700 bbls/day. Figure 8 also shows that as the oil flow rate is increasing, the FBHP is decreased to certain value and then starts increasing. The value at which FBHP is minimum at increasing oil flow rate is known as liquid loading point. It is a minimum oil rate needed to keep the well unloaded. For example, in case of 2.875 inches tubing, the minimum of 4000 bbls/day of flow rate is needed to keep the well unloaded. This information is needed to evaluate the size of tubing which is going to be installed in a well and to determine the rate at which the well starts to deliver for a specific size of tubing. PSO-ANN model accurately predicted the effect of liquid loading on FBHP with the increase in oil production rate.

Effect of changing gas flow rate on FBHP curve

Figure 9 shows the effect of increasing gas rate on FBHP with three different tubing IDs of sizes 2.875, 3.5, and 4 inches. Figure 9 shows that as the gas flow rate is increasing, the FBHP is also increasing. This type of trend is also justified by general energy equation. PSO-ANN model predicted the correct trend of increasing FBHP with the increasing gas production rate.

Effect of changing water flow rate on FBHP curve

Figure 10 shows the effect of increasing water rate on FBHP with three different tubing IDs of sizes 2.875, 3.5, and 4 inches. Again, PSO-ANN model predicted the accurate trend with the sensitivity of water rate which shows that the higher water rate gives higher FBHP.

Effect of changing perforation depth on FBHP curve

Figure 11 shows the effect of changing tubing perforation depth on FBHP. Sensitivity analysis with five different tubing IDs of sizes 1.995, 2.375, 2.875, 3.5, and 4.0 inches was performed. It is a well-documented fact that the pressure drop inside the vertical well is a result from three components which are hydrostatic pressure loss, frictional pressure loss, and kinetic pressure loss. For the case of vertical well, pressure losses due to kinetics are very minimal and can be neglected. Increase in perforation depth increases the hydrostatic component (function of the fluid density and depth) and therefore increases the FBHP. As can be depicted from Fig. 11, the proposed PSO-ANN model can capture the right physics which shows the increase in tubing pressure with the increase in perforation depth.

Effect of changing gas–liquid ratio (GLR) with perforation depth on FBHP curve

Figure 12 shows the effect of changing gas–liquid ratio (GLR) with the changing depth on FBHP curve using constant tubing ID of 4.0 inches. As expected and depicted from Fig. 12, the increase in GLR results in decrease in FBHP.

Conclusions

The real-time prediction of the FBHP with real-time surface production data parameters helps in minimizing the cost of conducting sequential pressure surveys via running expensive wireline tools (having pressure-measuring gauges) inside the down-hole. The new approach avoids the need for unnecessary production interruptions to record bottom-hole pressures. Real-time assessment of FBHP allows engineer to model real-time inflow performance relationship curves (IPR), which in turn helps in identifying early well problems, and hence, prompt interventions can be taken to uphold the potential of the well. This method of estimating FBHP is also a good alternative in areas of high security concerns and adverse weather situations. The dataset used to develop proposed model is based on the true vertical depth of the tubing where the perforation was done, however the new model can also be used to measure the FBHP at the heel of the horizontal well, while the pressure drop from the toe to the heel of the horizontal well can be estimated from existing analytical equations (Ozkan et al. 1995, 1999; Su and Gudmundsson 1998) based on the dip angle that includes friction losses and gravity values in cases when perfect horizontal well was not drilled. The approach used in this study can also be extended to the inclined wells by training the model on a measured depth with the additional input of inclination angles. Based on observations and results, the following conclusions can be inferred:

  1. 1.

    A hybrid application of ANN and PSO served as one of the robust CI techniques to predict FBHP in a producing well.

  2. 2.

    PSO-ANN model predicted FBHP with a R2 of 0.98 and AAPE of 2.0%.

  3. 3.

    The proposed PSO-ANN model outperformed former mechanistic and empirical models for FBHP predictions.

  4. 4.

    The accurate prediction by the proposed model in a group trend analysis shows that the proposed model is capturing the right physics.

  5. 5.

    The new model can be applicable for a wide range of operating conditions as defined in Table 2a.

  6. 6.

    From overall results, it can be said that the new model can be used as a cost-effective alternative in terms of eliminating the need for intervening the well to record FBHP by running pressure-measuring tools.

  7. 7.

    The new mathematical model formulated from tuned weights and biases of PSO-ANN can be utilized to predict FBHP in new wells without the need for expensive commercial software for AI training purposes.