1 Introduction

Modern calibration methods of subsurface reservoirs can be generally classified into two approaches, one based on the optimization methods and the other based on the Bayesian inference [1]. The optimization methods adjust the unknown parameter values through an automated process to obtain reservoir models within the allowed range of a misfit function. Various optimization techniques have been developed in the literature, including neighborhood algorithm [2], particle swarm optimization [3], genetics algorithm [4], Levenberg–Marquardt [5], estimation of distribution [6], and LBFGS [7]. Existing optimization methods can be roughly categorized to the stochastic algorithms and the gradient-based algorithms. The gradient-based algorithms have several inherent limitations, including they require to compute the gradients at each step of the optimization process. Honoring the geological constraint is another challenging issue for these types of algorithms [8]. A definite advantage of the stochastic algorithms is the capability to easily honoring the geological constraints; the main drawback of these approaches is their inefficiency as they usually require large number of simulations for convergence [9, 10]. Approaches based on the Bayesian inference, on the other hand, aim at estimating the posterior probability for the reservoir properties [11]. Existing Bayesian inference methods broadly entail algorithms based on particle filters, such as the ensemble Kalman filter (EnKF) [12, 13], the sequential Monte Carlo methods [14], and the Markov Chains Monte Carlo (MCMC) approaches [15, 16]. Since characterization of the underground resources becomes very important especially during the tertiary recovery period, which most of the oil is still remained beneath the ground [17], opting a robust and efficient method during the reservoir's calibration is of great importance.

Although variety of data mining, artificial intelligence, and optimization algorithms are used in the petroleum industry for different purposes [1830], in the context of well-test analysis most researches are carried out over the application of the artificial neural networks (ANN), nonlinear regression, and meta-heuristic optimization algorithms. The first attempt to incorporate ANN in the well-testing interpretation comes back to 1990s when Al-Kaabi et al. [31] used normalized pressure-derivative data in log–log plot to train an ANN with the purpose of reservoir model recognition. Allain and Houze [32] tried to symbolically represent a reservoir model using the ANN method. Within the next year, Ershaghi et al. [33] employed multiple neural nets to recognize patterns for a specific conceptual reservoir model. They found that an activation number larger than 0.4 for a neuron is usually sufficient to select the reservoir model related to that neuron [33].

Athichanagorn and Horne [34] employed ANN in order to recognize eight different mostly appeared pressure patterns in pressure-derivative curves. Kumoluyi et al. [35] used higher-order neural networks to recognize the reservoir model from well-test data. Using higher-order neural networks allowed them to elude large amounts of weights at the neural network, which in turn leads to decreased training time [35]. Alajmi and Ertekin [36] fitted a degree-four polynomial over pressure data in semilog plot and used coefficients of the interpolated polynomial as part of the input data to the ANN. Kharrat and Razavi [37] fitted B-splines curve over pressure data and used its analytical derivative against time to generate pressure-derivative curves. The normalized pressure-derivative data were then given to the ANN in their study [37]. Adibifard et al. [38] introduced a new method to present the input test data to the ANN by fitting a Chebyshev-based polynomial over the synthesized pressure-derivative data. Their proposed method guaranteed fitting higher degrees of polynomials without losing precision over the polynomial coefficients [38].

Although there have been numerous studies, recently, to characterize hydrocarbon reservoirs by introducing different interpretation methods and models[39], accuracy of the estimated parameters is usually a direct function of the optimization technique embedded in the nonlinear regression problem. In this regard, there have been several studies on the applications of nonlinear regression in well-test analysis by using different sets of cost functions including LS (least square), LAV (least absolute value), and weighted cost function [4042]. Nanba and Horne [43] used a new MGC (modified Gauss–Cholesky) algorithm and justified the superiority of their algorithm over the GM (Gauss–Marquardt) and NB (Newton–Barua). Onur and Kuchuk [44] employed the maximum likelihood approach to carry out the nonlinear regression task. This method does not require acquiring a prior knowledge about the variance of the error data [44]. Recently, Adibifard et al. [45] employed a meta-heuristic optimization algorithm, namely PSO (particle swarm optimization) to carry out the nonlinear regression task for a homogenous reservoir model. A comprehensive review of recent research activities on subsurface flow model calibration can be found in [8, 46].

In this work, we study the application of the iterative ensemble Kalman methods as a derivative-free type of optimization algorithm for inverse problems arises in well-test analysis. Ensemble Kalman-based methods use the Kalman formula to generate an ensemble of posterior estimates of the reservoir parameters [47]. Since its introduction by Evensen in 1994, the number of publications about EnKF has become extensive and has been applied in various research fields entailing oceanography [4850], numerical weather prediction [51, 52], hydrology [5355], and petroleum reservoir history matching [13, 56, 57]. A chronological list of applications of EnKF can be found at [12]. Multiple variants of EnKF for state and parameter estimation in dynamic systems can be found at [12, 13, 58]. In essence, all the variants of EnKF use an ensemble of states and parameters that is sequentially updated by means of the Kalman formula, which assimilated the available data at a given time into the model. In this work, we are interested in studying the application of the iterative ensemble Kalman methods [59] for the solution of inverse problems arise in subsurface flow. While the objective of the standard EnKF approaches is to approximate the statistical properties of geological parameters conditioned to observation, via an ensemble, the objective of the iterative ensemble Kalman methods is to approximate the solution of inverse problems 1 using a deterministic derivative-free iterative scheme. Variants of the iterative ensemble methods have been proposed in the literature. Iglesias et al. [59] studied the properties of the iterative EnKF algorithm for inversion and demonstrated numerically that the method can be effective on a wide range of applications. He studied the convergence properties of the iterative regularized ensemble Kalman method and its efficiency comparing to other ensemble-based methods.

The organization of this paper is as follows: Section 2 presents the formulation of the iterative ensemble Kalman method. Section 3 studies the results of the iterative ensemble method for three different cases of well-test analysis, a homogenous reservoir model, a dual-porosity heterogeneous system, and a faulted discontinuous reservoir. Section 4 presents the conclusion and recommendation for future research works.

2 Iterative ensemble Kalman filter (EnKF)

The Kalman filter was developed by Kalman in 1960 in order to estimate the current state of a system by knowing its prior state and the current measurements [60]. This filtering approach is used for the following discrete-time controlled process, which is governed by the linear stochastic difference equation [61]:

$$u_{k + 1} = A_{k} u_{k} + Bx_{k} + h_{k} ,$$
(1)

The above equation relates the state parameters at the kth iteration, i.e., uk, to the state of the system at the k + 1th iteration, i.e., uk+1. xk is also the input of the system, and A and B are corresponding matrices, which make a connection between input, state at the previous time and the state at the next time. The observation data yk are calculated using the following equation:

$$y_{k} = H_{k} u_{k} + v_{k} ,$$
(2)

The random variables hk and vk are, respectively, the system and measurement noise, which are considered independent with normal PDF (probability distribution function). The normal PDF has the zero mean and variances of Q and R, respectively, for h and v [61]:

$$P\left( h \right)\sim N\left( {0,Q} \right)$$
$$P\left( v \right)\sim N\left( {0,R} \right),$$
(3)

Although EKF (extended Kalman filter) improves applicability of the Kalman filter for the nonlinear systems through incorporating the Jacobian of the dynamic matrix, it fails to address the entirely nonlinear dynamics [62]; therefore, another variant of Kalman filter is introduced, which is based on the evolution of the ensembles of the state parameters.

The ensemble Kalman filter (EnKF), which is a sequential data assimilation approach, was developed by Evensen [63]. The EnKF method was developed based on the prediction of the error statistics by using the Monte Carlo method and eliminated the unlimited error growth generated during the extended Kalman filter analysis [63]. In the EnKF, the true model is not known and the mean of the parameters is considered as the best estimate; thereby, the spreading of the other ensembles around the mean of the parameters is deemed as the error definition [64].

The EnKF acts as a suboptimal estimator in which the error statistics are forecasted by using the Monte Carlo simulations or ensemble integration in order to solve the following Fokker–Planck equation [62, 64]:

$$\frac{\partial F}{\partial t} + \sum\limits_{i} {\frac{{\partial \left( {f_{i} F} \right)}}{{\partial u_{i} }}} = \frac{1}{2}\sum\limits_{i,j} {\frac{{\partial F\left( {gQg^{T} } \right)_{ij} }}{{\partial u_{i} \partial u_{j} }},}$$
(4)

where at the above equation, u is the state parameters, F(u) is the probability density of the model states, fi is the component number i of the model operator f, and ygQgT is the covariance matrix for the model errors.

The Fokker–Planck equation is the fundamental equation to find the evolution of the error statistics over time. Actually, the EnKF method employs the Monte Carlo simulations to solve the Fokker–Planck equation, and the PDF of the state parameters is represented by using large ensemble models [64]. The merits of EnKF over EKF, in addition to its capability to handle the largely nonlinear systems, are its low computational time for cases with small ensemble size and large iterations [62]. One of the other advantages of the EnKF is that it does not require derivations of the tangent linear operator or the adjoint equations [65]. The iterative EnKF, which is adopted at this study to tackle the pressure transient nonlinear regression problem, is described at the following [59]:

Generate the initial ensembles of state parameters as \(\left\{ {u_{0}^{j} } \right\}_{j = 1}^{J}\), where J is the number of ensembles. Also, regenerate observational data for each ensemble by perturbing the actual measurement data by using the following equation:

$$y^{\left( j \right)} = y + \xi^{\left( j \right)} ,$$
(5)

where ξ(j) is picked up from the Gaussian distribution with mean zero, i.e., \(\xi^{\left( j \right)} \sim N\left( {0,\varGamma } \right)\).

  1. 1.

    Update the state parameters for n = 1 to maximum iteration by using the following prediction and analysis steps:

Prediction step:

$$w_{n}^{{\left( {j,f} \right)}} = G\left( {u_{n}^{\left( j \right)} } \right), \quad j\epsilon \left\{ {1, \ldots , J} \right\},$$
(6)

where G is the nonlinear operator which maps the unknown state parameters u to the measurement space.

$$\bar{w}_{n}^{f} = \frac{1}{J - 1}\mathop \sum \limits_{j = 1}^{J} w_{n}^{{\left( {j,f} \right)}} ,$$
(7)
$$\bar{u}_{n} = \frac{1}{J - 1}\mathop \sum \limits_{j = 1}^{J} u_{n}^{\left( j \right)} ,$$
(8)
$$C_{n}^{uw} = \frac{1}{J - 1}\mathop \sum \limits_{j = 1}^{J} \left( {u_{n}^{\left( j \right)} - \bar{u}_{n} } \right)\left( {w_{n}^{{\left( {j,f} \right)}} - \bar{w}_{n}^{f} } \right)^{T} ,$$
(9)
$$C_{n}^{ww} = \frac{1}{J - 1}\mathop \sum \limits_{j = 1}^{J} \left( {w_{n}^{{\left( {j,f} \right)}} - \bar{w}_{n}^{f} } \right)\left( {w_{n}^{{\left( {j,f} \right)}} - \bar{w}_{n}^{f} } \right)^{T} ,$$
(10)

Analysis step:

$$u_{n + 1}^{\left( j \right)} = u_{n}^{\left( j \right)} + C_{n}^{uw} \left( {C_{n}^{ww} + \varGamma } \right)^{ - 1} \left( {y^{\left( j \right)} - w_{n}^{{\left( {j,f} \right)}} } \right),$$
(11)
$$w_{n + 1}^{\left( j \right)} = w_{n}^{\left( j \right)} + C_{n}^{ww} \left( {C_{n}^{ww} + \varGamma } \right)^{ - 1} \left( {y^{\left( j \right)} - w_{n}^{{\left( {j,f} \right)}} } \right),$$
(12)
$$\bar{u}_{n + 1} = \frac{1}{J - 1}\mathop \sum \limits_{j = 1}^{J} u_{n + 1}^{\left( j \right)} ,$$
(13)

Check for convergence at each iteration.

At this paper, the nonlinear G operator is a mathematical model describing the wellbore pressure behavior by using the unknown well and reservoir parameters, known fluid and rock properties, and the well rate history data. Because of the complexity of the final solution, usually a Laplace inverse algorithm is used to convert the obtained wellbore solution from the Laplace media into the time domain. The Laplace solutions for various reservoir models are provided at Appendix A in the end of the paper. Stehfest algorithm and the method of Okoye et al. [66, 67] are employed at this study to regenerate the pressure derivative versus time data:

$$\left( {t_{\text{D}} \frac{{{\text{d}}p_{\text{wd}} }}{{{\text{d}}t_{\text{D}} }}} \right)_{i} = \left( {\frac{{{\text{d}}p_{\text{wd}} }}{{{\text{dln}}(t_{\text{D}} )}}} \right)_{i} = t_{\text{Di}} \left[ {{\mathcal{L}}^{ - 1} \left\{ {s\bar{p}_{\text{wd}} \left( s \right)} \right\}} \right]_{{t_{\text{Di}} }} .$$
(14)

3 Results and discussion

The iterative EnKF is applied to three different case studies entailing a homogenous, a dual-porosity, and a faulted reservoir. We present the well-test analysis using the iterative EnKF for these cases at the following subsections.

3.1 Infinite acting homogenous reservoir

The field data for this experiment belongs to Horne [68]. Due to the stabilization of the pressure-derivative at the end of the wellbore storage region, a homogenous reservoir model is adopted for the matching purpose. Fluid and rock are represented in Table 1. Pressure derivative against time data are provided in the log–log plot in Fig. 1.

Table 1 Fluid and rock data belonging to the Horne (1995) real case
Fig. 1
figure 1

Logarithmic plot of the pressure derivative versus time or the field case adopted from [68]

The measured derivative data are perturbed with the additive noise of 0.05 × tdp/dt. Totally, 200 ensembles are used for the EnKF method and the 50th iteration is used as the stopping criteria, as discussed in Igelsias et al. [59]. The convergence study of the iterative EnKF algorithm is not the scope of this study as it has been rigorously addressed in the literature. Six different perturbed versions of the measured data are illustrated in Fig. 2 along with the non-perturbed data.

Fig. 2
figure 2

Various realizations of the derivative data generated for the iterative EnKF method for the data taken from [68]

Figure 3 shows the result of the iterative EnKF algorithm to estimate the PDF (probability distribution function) of the unknown reservoir parameters. Also, the normal function is fitted over the PDF data for each state variable. Figure 4 demonstrates the fast convergence rate of the algorithm. Figure 5 shows that the variance of the results tends to decrease rapidly at the initial iterations, which demonstrate the robustness of the iterative EnKF technique to reach the final solution quickly. Table 2 compares the results of the iterative EnKF with those arrived by Adibifard et al. [45] by employing the PSO (particle swarm optimization) algorithm. Obviously, a good agreement is observed between our results and the results belonging to [45].

Fig. 3
figure 3

PDF (probability distribution function) of the reservoir parameters and the corresponding fitted normal curves for the field data belonging to [68]

Fig. 4
figure 4

Average reservoir parameters against iterations for the data taken from [68]

Fig. 5
figure 5

Variance data for each reservoir variable versus iterations for data belonging to [68]

Table 2  Comparison of the results obtained by the iterative ENKF and the PSO algroithm used by [45] for the homogeneous reservoir model

3.2 Dual-porosity fractured reservoir

For the dual-porosity model, which comprises both matrix and fracture systems, a drawdown test is simulated by using a commercial well-test software and the generated derivative data are used as a reference for data analysis for the iterative EnKF algorithm. Fluid and rock data used for the test simulation are provided in Table 3. In addition, to make the generated data more realistic, a quartz pressure gauge is used as the pressure transducer with gauge resolution of 0.01 psi and artificial noise of 0.15 psi is added to the data. The distorted derivative data are shown in Fig. 6. The vague at the trough in the derivative data would make it very difficult for any optimization algorithm to work because reservoir models with different fracture storativity ratios, i.e., ω, might mathematically match the data. Also, the distorted data corresponding to the initiation of the last radial flow from the homogenous system would make it tedious for the algorithm to accurately adjust the interporosity flow coefficient with the data. Therefore, through employing the distorted derivative data the robustness of the employed EnKF algorithm over the ambiguous data would be verified.

Table 3 Fluid and rock data for the simulated drawdown test in a fractured dual-porosity system
Fig. 6
figure 6

Logarithmic plot of derivative data versus well-test time for the simulated drawdown test belonging to a dual-porosity system

The amount of the noise included at the pressure-derivative data was proportional to each data point by the 0.05 × tdp/dt expression. Again, 200 ensembles were used within the algorithm and calculations were continued for 50 iterations. Different realizations of the observational data are depicted graphically in Fig. 7.

Fig. 7
figure 7

Different realizations of the measurements by inclusion of the Gaussian noise for the simulated dual-porosity model

Contrary to the homogenous model, because of the small amounts of the C, λ, and ω and also the increased complexity of the problem due to the higher number of state parameters of the system, the log(X) of the mentioned parameters was used for the calculations to assure spanning the search space for those small-range parameters. Calculations were made, and the PDF distribution of the corresponding state parameters is illustrated in Fig. 8. Convergence of the mean of the parameters is also shown in Fig. 9. Figures 8 and 9 clearly show that the convergence occurs very fast despite the higher complexity of the system with the increased number of unknown parameters. Most notably, the stabilization of the mean happens before the tenth iteration almost for all of the state parameters which unveils both the speed and robustness of the algorithm.

Fig. 8
figure 8

PDF (probability distribution function) data and the corresponding fitted normal curve for the simulated dual-porosity model

Fig. 9
figure 9

Mean of the state parameters against iterations for the simulated dual-porosity model

The estimated reservoir parameters that are the mean parameters at the last iteration are presented in Table 4 along with their corresponding relative error. Accordingly, the best reservoir model using the distorted derivative data is illustrated in Fig. 10. The maximum relative error is below six percent for the estimated parameters, which ultimately proves the robustness of the developed algorithm at this study in dealing with moderately distorted noisy data.

Table 4 Mean of the reservoir parameters obtained through iterative EnKF at the last iteration with corresponding relative error values
Fig. 10
figure 10

Obtained graphical match between the best outcome of the iterative EnKF and real noisy data (dual-porosity system)

Additionally, the meta-heuristic PSO (particle swarm optimization) algorithm was applied over the tested data and average of the unknown reservoir parameters and their variances are plotted versus the iterations in Fig. 11. The population size and number of iterations for the PSO algorithm remained the same as the iterative EnKF algorithm for comparison purpose. Evolution of the average and variance data over time for the PSO algorithm unveils that this algorithm fails to achieve convergence in the initial iterations contrary to the iterative EnKF algorithm. This indeed reveals the high convergence of the iterative EnKF algorithm in comparison with one of the well-known meta-heuristic optimization algorithms.

Fig. 11
figure 11

a Evolution of the average of the reservoir parameters and b variance of the estimated parameters over time for the simulated dual-porosity model using the PSO (particle swarm optimization) algorithm

3.3 Homogenous reservoir with a single linear fault

To verify the accuracy of the iterative EnKF model over the faulted reservoirs, another test data are simulated using a commercial well-test software for an infinite acting homogenous reservoir with a single linear fault. To make the data more realistic, an additive noise with an amplitude of 2.5 psi is added to the simulated data and also the drift factors of 0.2 psi/day were included into the pressure data. Fluid and rock data are given in Table 5, and the distorted pressure-derivative data are plotted in Fig. 12. It clearly shows that the derivative data are distorted in a manner that matching process becomes very difficult, especially for a faulted reservoir model. Hence, this is interesting to study the accuracy of the iterative EnKF for this challenging model. For this model, unknown reservoir parameters include reservoir permeability, wellbore storage coefficient, skin factor, and the perpendicular distance of the fault from the well.

Table 5 Fluid and rock data used to generate the pressure data for the homogeneous reservoir with a single fault
Fig. 12
figure 12

Generated pressure-derivative data for the homogenous reservoir with a linear fault discontinuity

The iterative EnKF method is applied over the derivative data, and the outcomes are provided in Figs. 13, 14 and 15. PDF results at the last iteration are plotted in Fig. 13, and the results approximately show a normal distribution for the unknown reservoir parameters. The mean of the unknown random parameters is provided in Table 6 along with their corresponding relative error, compared to the input values provided to the simulator. From the relative error prospective, the skin factor has the largest estimation error, while the estimation error of the wellbore storage is approximately zero. The second largest estimation error is the estimation of the well distance from the fault, i.e., Lf. The reason behind this might be related to the fact that the skin and Lf are usually highly sensitive to the level of the noise in the observed well-test data.

Fig. 13
figure 13

Obtained PDF for the ensembles at the last iteration with corresponding normal curve for the synthesized homogenous reservoir with a single fault

Fig. 14
figure 14

a Average of the reservoir parameters versus iteration and b variance of each parameter against the iteration

Fig. 15
figure 15

Evolution of the uncertainty parameters over iterations for the unknown reservoir parameters

Table 6 Estimated reservoir parameters for the homogenous model with a linear fault and corresponding relative error values

The convergence and variance plots in Fig. 14 show that the method converges very fast. The variance of the estimated unknown parameters rapidly moves toward zero for all the reservoir parameters. Figure 15 illustrates the estimation of the P10, P50, and P90 for the state parameters of the system for each iteration. Figure 16 demonstrates the high-quality match of the estimated reservoir parameters response to the distorted data and proves the efficiency of the iterative EnKF method to solve the inverse problems for the well-test analysis of the reservoirs with linear discontinuities.

Fig. 16
figure 16

Final match obtained over the derivative data for the synthesized  homogeneous fault model

In order to make a comparison between the employed iterative EnKF method and the PSO optimization algorithm, the PSO algorithm is used to estimate the reservoir parameters for this case, and evolution of the average reservoir parameters and their variances are plotted in Fig. 17. As shown in Fig. 17, the variance of the reservoir parameters does not exhibit any stabilization toward the zero horizontal line even after the twentieth iteration. In addition, the average of the reservoir parameters shows some oscillations even after the stabilizations.

Fig. 17
figure 17

a Evolution of the average of the reservoir parameters and b variance of the estimated parameters over time for the simulated linear fault model using the PSO (particle swarm optimization) algorithm

4 Conclusion

In this work, we studied the application of the iterative EnKF as a derivative-free type of optimization algorithm for inverse problems arises in the well-test analysis. We used the iterative EnKF method coupled with the Stehfest numerical Laplace inverse algorithm to estimate the unknown reservoir parameters. We conducted three different experiments for a homogenous reservoir model, dual-porosity reservoir model, and a faulted reservoir model to study the accuracy of the proposed algorithm. For all these test cases, the iterative EnKF method gives excellent matches with the true case with a few numbers of iterations. The key findings of this paper are as follows:

  • The convergence behavior of the iterative EnKF for three different case studies conducted in this work illustrates a very fast and robust solution to the inverse problems in the well test. The general convergence properties of the iterative EnKF have been previously studied in the literature, both numerically and analytically.

  • In high-dimensional cases, that the complexity of the inverse problem increases drastically, the iterative EnKF can give reasonably accurate results with a few numbers of iterations.

  • The variances of the state parameters decrease rapidly as the number of iterations increases. This holds for even considerably distorted derivative data, that a large amount of noise is added to the simulated data. In contrast, the well-known PSO (particle swarm optimization) algorithm has very low convergence based on the variance data when it is applied over the simulated tested data.

  • The only drawbacks of the iterative EnKF method may be the selection of the tuning parameters, i.e., the variance of the additive noise or the size of ensembles. This could be the one possible criterion for future research to effectively apply this method to solve the inverse problems in the well-test analysis.