1 Introduction

The geologic heterogeneity of formations significantly affects the subsurface flow and transport, especially when there exist complex fracture networks, which are extensively distributed in fractured rock formations such as shale or tight reservoirs. The fracture networks provide main transport channels for natural gas in shale reservoirs (Liu and Reynolds 2019) and increase geothermal flow of hot dry rock geothermal energy system in which the fractures are stimulated by hydraulic fracturing and serve as high conductivity media for oil and gas movement in hydrocarbon fractured reservoirs. However, usually, there is not enough useful information about complex fractures in geological models before production forecast because it is not feasible at present to construct discrete fracture systems vividly on an engineering scale limited to the accuracy of field measurements on fracture discontinuity. In practical field applications, in fact, fracture discontinuity is usually detected by some geological surveys such as outcrop, rock cores or from indirect probes including seismic, borehole imaging and logging test. Then, those observation data are used to simulate the fracture networks by a stochastic function model, whereas it is uncertain that the fracture simulation model could be used in practical production forecast directly and needs to be calibrated. Fortunately, the inversion approaches in sub-earth area involving hydrology, thermal energy of hot dry rock and hydrocarbon reservoir present an opportunity to tackle the challenging problem. In recent years, it has gradually been an urgent request to obtain the geostatistical characterization of complex fracture networks accurately by numerical inverse approaches combining measurement techniques.

In the last decades, the problem of subsurface model calibration in distributed systems has been widely studied (Yeh 1986). One active area of study is the characterization calibration of reservoir properties such as permeability, porosity and conductivity as well as aquifer geometry. For example, the permeability distribution of the Soultz-sous-Forêts reservoir was estimated by the ensemble Kalman filter (Vogt et al. 2012); the sedimentary facies consisting of sand, gravel and clay were quantified by an improved Bayesian method with total variation (Lee and Kitanidis 2013); and the aquifer performance was calibrated by an automatically matching method (Gajdica et al. 1988). Besides, the inverse problem for sub-earth geological properties could be transformed to the mathematical model and optimization measurement bridging on subsurface fluid flow equation. Yeh (1975) applied different mathematical approaches including quasi-linearization, maximum principle of the optimal control and gradient searching, for quantification of aquifer parameters. Recently, there have been serials of promoted approaches based on Bayesian formulation, challenging the complicated optimization problems. For instance, the sparse randomized maximum likelihood method was advanced to solve the high-dimensionality problem in the inversing process for subsurface flow (Khaninezhad and Jafarpour 2014). The two-stage procedure based on simultaneous perturbation stochastic algorithm (SPSA) (Zhang et al. 2016a) was proposed to improve the efficiency for inversing reservoir field models, and a hierarchal calibration framework with multiscale spectral-domain parameterization was used for complex fractured reservoirs (Kang et al. 2014). The ensemble Kalman filter (ENKF) to subsurface flow model calibration being capable of resolving nonlinear problems has also been extensively studied in the past decade (Aanonsen et al. 2009; Chen and Zhang 2006). Besides, proxies and Markov chain Monte Carlo method were used to quantify the uncertainty and assess the value of information for a pilot project (Chen et al. 2017). Furthermore, a stochastic simplex approximate gradient (StoSAG) method was proposed for optimization in sync with the uncertainty quantification (Fonseca et al. 2017).

Another attractive object is to take the discrete fractures into account when simulating subsurface flow, considering the high conductivity and sufficient storage capacity within fracture networks. For instance, the fracture flow equation derived from the Navier–Stokes formulation has been added to the subsurface flow model (Basha and El-Asmar 2003). Moreover, more specific works such as the connectivity of two-dimensional fracture networks on simulation (Darcel et al. 2003b), solute transport through a single fracture (Yarwood et al. 2006) and the construction of fracture networks modeled by the stochastic method (Andersson et al. 1984) have been studied. Besides, a comprehensive fracture model comprising of natural and hydraulic fractures is applied in unconventional reservoirs (Weng et al. 2014). In view of above work, when researching on the fractured formation, fracture networks have become an important part of the geological model for numerical simulation. To simulate the future dynamic performance as reasonable as possible, it is necessary to accurately obtain properties of the fracture networks. In recent years, geological information is usually provided by seismic detection, logging test and outcrop. However, it is not appropriate to directly use that information for predictive simulation, because the initial data are far different from the reality. Thus, calibrating the uncertainty by matching monitoring data which is known as “inversion process” is crucial for forecast job (Chen et al. 2018). Although some work about calibrating fractured geological model has been done such as quantifying the uncertainty of hydraulic tests in fractured rocks based on a geostatistical approach (Bisdom et al. 2014; Blessent et al. 2011; Zhang et al. 2016b), there are a few studies of inversing the complex fracture model properties for both theory and application. For this reason, we are working on quantifying the uncertainty of the complex fracture model for subsurface flow based on the Bayesian formulation and we mainly focus on the two-dimensional fracture model at present. In the future, some new multi-objective optimization algorithms may be used to further solve the problem (Zhang et al. 2018a; Liu and Forouzanfar 2017; Chen et al. 2017).

In Sect. 2, we build the generation method of the complex fracture model, which are divided into two systems including “Pattern A” and “Pattern B” fracture models. Discrete single fracture (two-dimensional) could be described by several characteristic properties, which are the center position, length, orientation, aperture, etc, while, for complex fracture systems, more characteristics such as density, the probability distribution function of length and orientation are needed to depict in the model. Thus, this section introduces how to construct a complex fracture model and all of its parameters, some of which are chosen to be inversion parameters. It should be noted that only the uncertainty of selected parameters which are associated with fracture network geometry remains to be quantified, while for simplification, some other factors such as fracture aperture are not considered. In Sect. 3, we illustrate the theory of the Bayesian formulation and solve the question by SPSA. In Sect. 4, we firstly estimate the impact of small-scale fractures in simulation by comparing the difference of observation data under two scenarios. Then, we demonstrate the calibration of numerical experiments and analyze the feasibility of this method. Section 5 finally concludes the innovation of the work and introduces the outlook.

2 Complex fracture model construction

In recent years, there are many studies of generation mechanisms of the discrete fracture model (Bonnet et al. 2011). Darcel et al. (2003a) raised stereological rules for fractal fracture networks which should be developed in three dimensions (Lee et al. 1990; Dowd et al. 2007) divided the fractures into independent subsets according to the fracture orientation and then modeled the correlations of the subsets by the hierarchical model and the plurigaussian simulation, respectively. Above works consider the fracture networks as an integral system to simulate. However, for fractured rocks, the flow dynamics is significantly predominated by large-scale fractures; this characteristic has a great impact on the propagation of hydraulic fractures and the flow capacity of porous media (Liang et al. 2016; Mi et al. 2014). As a result, large-scale fractures should be quantified more accurately than a large number of small-scale fractures. Additionally, fracture networks are classified into several patterns based on the fracture length in some research (Eftekhari et al. 2013). Thus, in this work, the fracture system is separated into two sections: (1) the first one, hereinafter referred to as “Pattern A,” is a homogeneous or heterogeneous system comprising a large number of small-scale fractures (see as box region  A in Fig. 1); (2) the other one, hereinafter referred to as “Pattern B,” is a cluster system consisting of big fractures and the surrounding small-scale fractures (see as ellipse region B in Fig. 1).

Fig. 1
figure 1

Open fractures and veins in flat-lying carbonates in the Potiguar Basin (Bisdom et al. 2014), box region A represents “Pattern A” fracture system, ellipse region B represents “Pattern B” fracture system

It is obvious that the first stage of fracture modeling is to collect geological data for the statistical analysis. Then, we can obtain the detailed information about the fracture position, fracture length, fracture orientation, fracture density, etc. Based on those properties, a complex fracture model can be constructed. It is assumed that the geological data have been observed by some measurements such as outcrop or logging (Ozkaya and Mattner 2003), etc., and we only concentrate on the fracture generation mechanism. The first step is fracture position modeling, which are usually separated from other fracture properties. Then, other properties such as fracture length and orientation are simulated, respectively, or simultaneously.

2.1 Fracture position modeling

The fracture position can be represented by a single point which usually is the center of the fracture. Then, the spatial distribution of fractures can be modeled by geostatistics or a point process. In the point process, the fracture density, \(N_{i}\), or the number of fracture points within a unit area usually is the modeled variable. And for each divided subset, the fracture density can be derived from the point intensity, \(\lambda_{i}\), which can be obtained through the analyzed dataset. The derivation models which transform the point intensity into the fracture density are introduced in Xu and Dowd (2010). In this paper, the study worked on the fracture position modeling, advanced homogeneous or non-homogeneous Poisson model and cluster point process model, which are applied to “Pattern A” and “Pattern B” fracture position modeling, respectively.

2.1.1 “Pattern A” fracture system position modeling

There are some assumptions of the position distribution in the interest region A:

  1. 1.

    Divide the interest region A (two-dimensional) into m subregions, \(A_{1} ,\;A_{2} ,\; \ldots ,\;A_{m}\), where \(A_{1} ,\;A_{2} ,\; \ldots ,\;A_{m}\) are disjoint and any subregion, Ai, is bounded Borel set;

  2. 2.

    The number of fracture points falling inside the subregion \(A_{i}\), \(N\left( {A_{i} } \right)\), obeys the Poisson distribution with mean \(\mu_{i} = \lambda_{i} \cdot r(A_{i} )\), where \(\lambda_{i}\) is the density of the distribution, \(r(A_{i} )\) is the area of the subregion \(A_{i}\), and for any disjoint \(A_{1} ,\;A_{2} ,\; \ldots ,\;A_{m}\), \(N\left( {A_{1} } \right),\;N\left( {A_{2} } \right),\; \ldots ,\;N\left( {A_{m} } \right)\) are independent variables with each other.

And the steps of generating “Pattern A” fracture position can be illustrated as follows:

  • Step 1 Divide region \(A\) into \(m\) subregions, \(A_{1} ,\;A_{2} ,\; \ldots ,\;A_{m}\) (Fig. 2), where \(A_{1} ,\;A_{2} ,\; \ldots ,\;A_{m}\) are disjoint.

    Fig. 2
    figure 2

    Division subregions of “Pattern A” system

  • Step 2 Based on the Poisson distribution, generate a random variable \(N_{i}\) in each subregion \(A_{i}\).

    $$P(N_{i} = n) = \text{e}^{{ - \mu_{i} }} \frac{{\mu_{i}^{n} }}{n!}$$
    (1)
  • Step 3 The random variables \(N_{i} = n\) represent the number that fracture points fall in the subregion \(A_{i}\). Then, for each of the \(n\) events, generate two values from the uniform distribution and use them as the position coordinate inside the subregion \(A_{i}\). Figure 3a–c shows the homogeneous Poisson distribution, and Fig. 3d shows the non-homogeneous Poisson distribution.

    Fig. 3
    figure 3

    Fracture location simulation in each subregion. ac Homogeneous and their point intensities are \(\lambda = 2, \, \lambda = 4, \, \lambda = 6\), respectively. d Heterogeneous and its region comprising four-point intensities, respectively, \(\lambda = 2, \, \lambda = 4, \, \lambda = 6\) and \(\lambda = 10\)

  • Step 4 Repeat Step 2 and Step 3 until all subregions of A have been traversed.

2.1.2 “Pattern B” fracture system position modeling

Fractures in subsurface of the earth are the reflection of geophysical or geothermal activities. These activities usually create large-scale fractures along the preferential orientation as well as small fractures around the big fractures. The distribution of fracture points in “Pattern B” system is very similar to the cluster point model (Fig. 4) which can be simulated by parent–daughter modeling or hierarchical modeling (Lee et al. 1990). In this paper, we assume that the region of the cluster point model can be simply represented by an ellipse area, even though there are more complicated models. We assume large-scale fractures of the cluster as the parent fracture and assume small-scale fractures around the big fractures as daughters. We use the parent–daughter method to simulate the cluster point model and the realization comprises three steps.

  • Step 1 In the ellipse region, \(B\), generate \(N_{\text{p}}\) parent fractures which could be confirmed by prior geological information in field applications.

  • Step 2 For each parent, \(p_{i} \left( {i = 1,\;2,\; \ldots ,N_{\text{p}} } \right)\), generate a random variable representing the number of daughters \(N_{{{\text{d}}i}}\), and \(N_{{{\text{d}}i}}\) is generated independently for each parent from the same probability distribution. In here, we still use the Poisson distribution with mean \(\mu_{i} = \beta_{i} \cdot r(B_{i} )\), where \(\beta_{i}\) is the distribution density and \(r(B_{i} )\) is the area of the region \(B\).

  • Step 3 Confirm the location of daughters relative to its parent position. For each daughter, its location \(l_{i} (i = 1,\;2,\; \ldots ,\;N_{\text{p}} )\) is a node on the parent fracture, each \(l_{i}\) corresponds a starting point of each daughter, and daughter fractures are iteratively generated from \(l_{i}\). Therefore, the daughter could be determined to connect with the parent. We assume the positions of daughters obey a probability distribution function.

    $$P(x,\;y) = {\text{e}}^{ - \xi d(x,\;y)}$$
    (2)

    where \((x,\;y)\) are the relative coordinate to its parent fracture, \(P(x,\;y)\) is the probability that the daughter fracture falls in this location, and \(\xi\) is a constant that reflects the geological characteristic. Obviously, the relationship of position distribution between daughters and the parent fracture of “Pattern B” system is symbiosis. Besides, it should be clarified that the positions of two daughters whether they are from the same or different parents are considered independent.

Fig. 4
figure 4

Cluster fractures of “Pattern B” system, including a parent fracture and daughter fractures

2.2 Fracture length distribution modeling

Bonnet et al. (2011) made a comprehensive survey for the scaling of the fracture system. For the fracture length distribution, early studies consider that it can be best described by lognormal (Priest and Hudson 1976; Rouleau and Gale 1985) or exponential laws (Cruden 1977; Hudson and Priest 1979, 1983; Nur 1982); however, recent studies (Darcel et al. 2003a, b) tend to believe that the power laws and fractal geometry can provide more extensively applicable descriptive tools which are not only for scaling properties but also for other fracture characterizations (density, attitude).

In the last decades, different methods (Falconer 1990; Feder 1988; Mandelbrot 1982; Vicsek 1992) of determining fractal dimension are proposed depending on quantity measurements. Specifically, those classical methods include the mass dimension, the box-counting method, etc.

Power laws with fractal dimensionality have been validated on a 2-D natural fracture pattern (Bour et al. 2002). Based on the double power law, proposed by Davy et al. (1990), the density and scale properties of fractures could be described by a simple statistical model.

$$n(l,S) = \kappa S^{D} l^{ - a}$$
(3)

where the number of fractures whose length is in the range \(\left[ {l,\;l + \text{d} l} \right]\) and whose center is constrained in the system size \(S\), can be obtained from \(N(l) = n(l,S) \cdot \text{d} l\); \(a\) is the characteristic exponent of the fracture length distribution; \(\kappa\) is a constant parameter which controls the density of fractures; \(D\) is the fractal dimension of the fracture systems, and the fractal dimension defines the scaling of fractures. Combining Eq. (3) with a multiplicative cascade process (Meakin 1991; Schertzer and Lovejoy 1987), the probability distribution of fracture length will be finally produced. In this section, the fractal dimension method for the distribution of fracture length is applied to “Pattern A” system and “Pattern B” system excepting the parent fractures of “Pattern B” system, because parent fractures are sparsely distributed in the system and its length needs to be calibrated solely. It should be noted that the fractal dimension is assumed as a known argument and has not been as the calibration parameter in the inversion process. Besides, in this section, we just refer the method (Darcel et al. 2003a; Zhang et al. 2018b) for fracture length modeling. For this reason, it is better to read the original article if readers want to research on this branch.

2.3 Generate complex fracture model

The process of generating fracture systems is a stochastic modeling from the chosen probability distribution function based on the measured geological information. The object of Sect. 2 is to illustrate the generation mechanism of complex fracture systems and determines the inversion parameters which will be calibrated by matching observation data in Sect. 3.

Sections 2.1 and 2.2 provide the methods simulating the fracture position and length. It is said that natural fractures are signatures of geophysical or geothermal activities. Therefore, the principle stress of formation rock significantly influences the distribution of fracture orientations. In this paper, we assume that the fracture orientation follows the wrapped normal (2-D) distribution (Xu and Dowd 2010), which can be expressed as:

$$f(\theta ) = \frac{1}{{\sqrt {2\uppi } }}\sigma \text{e}^{{ - \frac{(\theta - \eta )}{{2\sigma^{2} }}}}$$
(4)

where \(\theta\) is the orientation angle, \(\sigma \;(\sigma > 0)\) and \(\eta\;(\eta\in[0,\;2\uppi])\)are the parameters of the distribution.

For the fracture aperture, we consider it as a constant although the value of the aperture is different between large-scale fractures of “Pattern B” and small-scale fractures of “Pattern A.”

Table 1 lists all the parameters for constructing a complex fracture system, part of which is representative and significant for the entire fracture system and needed to be modified to close the reality as precisely as possible.

Table 1 Properties with its forms and specific parameters and the selected inversion parameters

We assign the design value to the parameters in Table 1, and based on the generation mechanism, the complex fracture model demonstrated in Fig. 5, which imitates the outcrop of Potiguar Basin shown in Fig. 1, can be constructed.

Fig. 5
figure 5

Realization of a complex fracture system

3 Model calibration

Model calibration is a process of determining the uncertainty of model variables measured by technical means or tools from subsurface geological formation, and it is usually assumed that there is a theoretical model for subsurface flow relating the observed data to the model variables. In this paper, model variables are the physical properties of fracture systems, and the detailed properties and parameters are introduced in Sect. 2.3. The key parameter of historical fitting in conventional reservoirs is the permeability field. However, in fractured reservoirs, fractures have a great impact on oil production. In high-permeability reservoirs, fractures affect fluid flow; in low-permeability formations, fractures almost dominate fluid flow; therefore, the parameters that need to be calibrated in the inversion process focus on the key parameters of fractures. Commonly, for complex fracture systems, the characteristics of large-scale fractures predominate the subsurface flow significantly, as well as the density and main direction of small-scale fractures being also the crucial elements as a result of the strong correlation between the density and connectivity. Consequently, the density and orientation parameters of small-scale fractures, \(\lambda\), \(\eta_{A}\) in “Pattern A” systems and \(\beta\) in “Pattern B” systems, and the properties of large-scale fractures including the center coordinate, \((x_{o} ,\;y_{o} )\), size, \(L\), the orientation angle, \(\theta_{B}\), are selected to be the inversion parameters.

In this paper, we use geological properties which are learned from the measured datasets to represent prior geological models of complex fracture systems. We advance an approach using the Bayesian formulation to describe the inversion problem. We solve the Bayesian inverse problem with the gradient optimization by SPSA. To examine the performance of this method, we apply this formulation to two-dimensional fracture model calibration problems for uncertainty quantification.

3.1 Bayesian formulation

The general Bayesian formulation of the inverse problems that arise in subsurface flow in fractured media is expressed as:

$$p({\mathbf{m}}|{\mathbf{d}}_{\text{obs}} ) \propto p({\mathbf{d}}_{\text{obs}} |{\mathbf{m}})p({\mathbf{m}})$$
(5)

where \({\mathbf{m}}\) is uncertain fracture properties (e.g., fracture location, fracture density), \({\mathbf{d}}_{\text{obs}}\) is the vector of observation data (e.g., fluid flow rate, cumulative liquid volume), and the probability density function (PDF) \(p({\mathbf{m}})\), \(p({\mathbf{d}}_{\text{obs}} |{\mathbf{m}})\) and \(p({\mathbf{m}}|{\mathbf{d}}_{\text{obs}} )\) represent the prior, likelihood and posterior distributions.

According to the geostatistical theory, geophysical fracture properties \({\mathbf{m}}\) obey the Gaussian distribution with prior mean \({\mathbf{m}}_{\text{pr}}\) and covariance matrix \({\mathbf{C}}_{{\mathbf{M}}}\) (Zhang et al. 2017a). Then, its probability density function \(p({\mathbf{m}})\) can be written as:

$$p({\mathbf{m}}) = \frac{1}{{(2\uppi )^{{N_{\text{m}} /2}} \det ({\mathbf{C}}_{\text{M}} )}}\exp \left( { - \frac{{({\mathbf{m - m}}_{\text{pr}} )^{\text T} {\mathbf{C}}_{\text{M}}^{ - 1} ({\mathbf{m}} - {\mathbf{m}}_{\text{pr}} )}}{2}} \right) \propto \exp \left[ {({\mathbf{m}} - {\mathbf{m}}_{\text{pr}} )^{\text{T}} {\mathbf{C}}_{\text{M}}^{ - 1} ({\mathbf{m}} - {\mathbf{m}}_{\text{pr}} )} \right]$$
(6)

where \({\mathbf{m}}_{\text{pr}}\) is the prior mean model which is defined as the average model of the initial ensemble. \(N_{\text{m}}\) is the type number of model properties. The incomplete observation data exist measurement error \(\varepsilon\). det() is the square matrix function, and the observation error is the Gaussian distribution with zero mean and a covariance matrix \({\mathbf{C}}_{\text{D}}\), \(\varepsilon \in (0,\;{\mathbf{C}}_{\text{D}} )\).

$${\mathbf{d}}_{\text{obs}} = g\left( {\mathbf{m}} \right) + \varepsilon$$
(7)

where \(g( \cdot )\) represents the subsurface flow simulation in fractured rock and the simulation model consists of a set of mass conservation equations and boundary conditions. In this paper, the solution of the simulation can be achieved by MATLAB Reservoir Simulation Toolbox (MRST) (Lie 2015; Zhang et al. 2019).

Given model variables, its probability function \(p\left( {{\mathbf{d}}_{\text{obs}} |{\mathbf{m}}} \right)\) can be written as follows:

$$p\left( {{\mathbf{d}}_{\text{obs}} |{\mathbf{m}}} \right) = \frac{1}{{\left( {2\uppi } \right)^{{N_{\text{d}} /2}} \det \left( {{\mathbf{C}}_{\text{D}} } \right)}}\exp \left( { - \frac{{\left( {{\mathbf{d}}_{\text{obs}} - g\left( {\mathbf{m}} \right)} \right)^{\text{T}} {\mathbf{C}}_{\text{D}}^{ - 1} \left( {{\mathbf{d}}_{\text{obs}} - g\left( {\mathbf{m}} \right)} \right)}}{2}} \right) \propto \exp \left[ {\left( {{\mathbf{d}}_{\text{obs}} - g\left( {\mathbf{m}} \right)} \right)^{\text{T}} {\mathbf{C}}_{\text{M}}^{ - 1} \left( {{\mathbf{d}}_{\text{obs}} - g\left( {\mathbf{m}} \right)} \right)} \right]$$
(8)

where \(N_{\text{d}}\) is the type number of observation data. \({\mathbf{C}}_{\text{D}}\) is the covariance of observation data. According to the Bayesian theory, given observation data, the probability function of fracture parameters can be expressed as follows:

$$p({\mathbf{m}}|{\mathbf{d}}_{\text{obs}} ) \propto p({\mathbf{d}}_{\text{obs}} |{\mathbf{m}})p({\mathbf{m}}) \propto \exp \left[ { - \frac{1}{2}({\mathbf{d}}_{\text{obs}} - g({\mathbf{m}}))^{\text T} {\mathbf{C}}_{\text{D}}^{ - 1} ({\mathbf{d}}_{\text{obs}} - g({\mathbf{m}}))} \right.\left. { - \frac{1}{2}({\mathbf{m - m}}_{\text{pr}} )^{\text T} {\mathbf{C}}_{\text{M}}^{ - 1} ({\mathbf{m - m}}_{\text{pr}} )} \right]$$
(9)

As a minimization problem, the model calibration aims at minimizing the mismatch between observation data and simulation data. As shown in Eq. (10), the Bayesian formulation taken from Eq. (9) substitutes the objective function into two items: one aims at closing the updated model to the prior mean model as much as possible and the other aims at closing the simulation data to observation data as much as possible.

$$O({\mathbf{m}}) = \;\frac{1}{2}({\mathbf{m - m}}_{\text{pr}} )^{\text T} {\mathbf{C}}_{\text{M}}^{ - 1} ({\mathbf{m - m}}_{\text{pr}} ) + \frac{1}{2}({\mathbf{d}}_{\text{obs}} - g({\mathbf{m}}))^{\text T} {\mathbf{C}}_{\text{D}}^{ - 1} ({\mathbf{d}}_{\text{obs}} - g({\mathbf{m}}))$$
(10)

3.2 Simultaneous perturbation stochastic algorithm (SPSA)

SPSA was introduced in 1987 (Spall 1987) and was completely analyzed in Spall and Chin’s papers (Spall 1992; Chin 1994); they handled local minimum problem by using the stepped SPSA gain sequence. Gao et al.(2007) were the first to apply SPSA algorithm to the oil reservoir model calibration. The essential feature of SPSA, which is relatively proper in tackling challenging multivariate optimization problems, is a stochastic gradient approximation that requires only two measurements of the loss function regardless of the number of parameters being optimized. It is similar to the finite difference method since they both obtain search direction by adding perturbations, but much more efficient. Unfortunately, the gradient of the standard SPSA could be quite rough and may not generate a reasonable geological model; in this paper, we adopt a modified SPSA proposed in previous literature (Li and Reynolds 2011; Zhang et al. 2017b). The stochastic gradient can be calculated as follows:

$$\hat{g}^{k} \left( {s_{\text{opt}}^{k} } \right) = \frac{{O\left( {s_{\text{opt}}^{k} + \varepsilon_{k} \Delta_{k} } \right) - O\left( {s_{\text{opt}}^{k} } \right)}}{{\varepsilon_{k} }} \times \Delta_{k}$$
(11)

where \(s_{\text{opt}}^{k}\) is the pseudo-parameter at the kth iteration, \(\Delta_{k}\) is the perturbation vector with all its elements conforming to the Gaussian distribution, and \(\varepsilon_{k}\) is a positive scalar (usually takes a small value). Then, the pseudo-parameter at the next iteration can be determined as:

$$s_{\text{opt}}^{k + 1} = s_{\text{opt}}^{k} + \alpha_{k} \frac{{\hat{g}^{k} \left( {s_{\text{opt}}^{k} } \right)}}{{\left\| {\hat{g}^{k} \left( {s_{\text{opt}}^{k} } \right)} \right\|_{\infty } }} \times \Delta_{k}$$
(12)

where \(\alpha_{k}\) is the step size which is determined according to the non-precise linear search.

Li et al. (2010) also proved that the expectation of stochastic gradients is the real gradients. Therefore, we take the average of several stochastic gradients as the SPSA gradient.

$$\overline{{\hat{g}^{k} \left( {s_{\text{opt}}^{k} } \right)}} = \frac{1}{{N_{{\text{a}}} }}\sum\limits_{j = 1}^{{N_{{\text{a}}} }} {\hat{g}_{j}^{k} \left( {s_{\text{opt}}^{k} } \right)}$$
(13)

In this paper, we execute the SPSA process in a parallel mode with two or three simulations running simultaneously which could greatly save computation time. The technical diagram of SPSA is shown in Fig. 6.

Fig. 6
figure 6

Flowchart of SPSA algorithm

4 Numerical experiments

We use numerical experiments from subsurface two-phase flow coupling complex fracture systems in the two-dimensional (2-D) model to evaluate the performance of the inversion approach (Li et al. 2017; Xu et al. 2018; Yang et al. 2015). The two-phase flow equations (e.g., oil and water) for immiscible fluids in porous media from MRST can be derived from the mass conservation principle and Darcy’s law which are compactly introduced in “Appendix” section. In this study, the two-dimensional model is a \(400 \times 4 0 0\) fractured reservoir under a scenario with an injection well and eight production wells. Figure 7a shows the well configuration. There is one injection well at the center of the model and eight production wells around the injection well. The liquid production rate of each production well is controlled to meet the target specified value; the injection rate of the injection well is controlled to meet the target specified value. For the two-phase flow model, we define constant fluid densities and viscosities. In this exercise, we estimate the parameters of the complex fracture system by minimizing the data misfit between the reference model and the updated model. Those data include well water production rate (WWPR) and well oil production rate (WOPR) which are provided at each producer with the project for a two-year calibration period, and this period is divided into 50 equal time steps in simulation. Before the calibration workflow, we compare two scenarios to evaluate the impact of small-scale fractures on simulation observation, and the observation difference determines whether the properties of small-scale fractures can be estimated in the calibration workflow. The result shows that the difference in some wells is observable. Then, following application is the calibration workflow based on the integral complex fracture generation and the Bayesian formulation. In this application, the provided is the reference model which is constructed from the real geological parameters to generate synthetic WWPR and WOPR observations. It should be noted that the vertical unit of production rate versus time is m3/day responding to the shale formation, and the abscissa unit is 1 time step which is equal to 14.4 days. The specific values of other parameters are described in Table 2.

Fig. 7
figure 7

a Well configuration. b Simple fracture model and the corresponding water saturation field at final time step. c Complex fracture model and the corresponding water saturation field at final time step

Table 2 Parameters in Fig. 7b, c (unstructured grid)

In the past, large-scale fractures are considered the important flow transport media; on the contrary, small-scale fractures are always ignored in the calibration process. Actually, the small-scale fractures also contribute to the fluid flow whether in real subsurface flow or in simulation solution. Thus, to evaluate the impact of small-scale fractures in “Pattern A” and “Pattern B” systems on simulation, we firstly demonstrate a contrary application which comprise two models shown in Fig. 7. By modifying the permeability, let the formation be equivalent to the existence of small-scale fractures (Zhang et al. 2014) and prove that small fractures have the impact on the production rate through inversion simulation. The matrix area and fracture area are discretized by triangular element and line element, respectively. The pressure gradient on each coarse mesh can be obtained by solving the equations with known equivalent permeability:

$$\left( {\begin{array}{*{20}c} {\left\langle {\nabla p} \right\rangle_{x}^{x} } & {\left\langle {\nabla p} \right\rangle_{y}^{x} } & 0 & 0 \\ 0 & 0 & {\left\langle {\nabla p} \right\rangle_{x}^{x} } & {\left\langle {\nabla p} \right\rangle_{y}^{x} } \\ {\left\langle {\nabla p} \right\rangle_{x}^{y} } & {\left\langle {\nabla p} \right\rangle_{y}^{y} } & 0 & 0 \\ 0 & 0 & {\left\langle {\nabla p} \right\rangle_{x}^{y} } & {\left\langle {\nabla p} \right\rangle_{y}^{y} } \\ \end{array} } \right)\left( {\begin{array}{*{20}c} {k_{xx} } \\ {k_{xy} } \\ {k_{yx} } \\ {k_{yy} } \\ \end{array} } \right) = - \mu \left( {\begin{array}{*{20}c} {\left\langle u \right\rangle_{x}^{x} } \\ {\left\langle u \right\rangle_{y}^{x} } \\ {\left\langle u \right\rangle_{x}^{y} } \\ {\left\langle u \right\rangle_{y}^{y} } \\ \end{array} } \right)$$
(14)

where \(\left\langle {\nabla p} \right\rangle\) is the volumetric average of pressure gradient over the target area; \(\left\langle u \right\rangle\) is the volumetric average of velocity over the target area; \(\mu\) is viscosity; k is permeability; and subscripts x, y are the x, y directions, respectively.

Then, the pressure on each element can be obtained by solving the equations through the pressure of each node, and the properties of equivalent fractures can be obtained:

$$\begin{aligned} & {\mathbf{H}}_{\text{t}} = \sum\limits_{e} {{\mathbf{H}}_{{{\text{f}}i}}^{e} } + \sum\limits_{e} {{\mathbf{H}}_{\text{m}}^{e} } \\ & {\mathbf{p}}_{\text{t}} = \sum\limits_{e} {{\mathbf{p}}_{{{\text{f}}i}}^{e} } \cup \sum\limits_{e} {p_{\text{m}}^{e} } \\ & {\mathbf{H}}_{\text{t}} {\mathbf{p}}_{\text{t}} = 0 \\ \end{aligned}$$
(15)

where \({\mathbf{p}}_{{{\text{f}}i}}^{e}\) is the pressure array of fracture unit; \(p_{\text{m}}^{e}\) is the matrix unit pressure; \({\mathbf{H}}_{{{\text{f}}i}}^{e}\) is the stiffness matrix of fracture unit; and \({\mathbf{H}}_{\text{m}}^{e}\) is the stiffness matrix of formation matrix.

Although “Patterns A and B” have small-scale fracture groups, there is a connection between the parent fracture and the small fracture in model B, which leads to a difference in production rate between the two cases. One is a simple fracture model which only comprises one large-scale fracture, while the other is a complex fracture model which comprises one large-scale fracture and a number of small-scale fractures. Then, we simulate the two models by MRST and compare the WWPR and WOPR data, as shown in Fig. 8. The result reveals that the small-scale fractures also significantly contribute to the flow simulation. For example, the production rates are difference of nearly 10 percent at producer 1, producer 4 and producer 7 (Fig. 8). Thus, it is necessary to consider the impact of small-scale fractures in simulation and calibration processes.

Fig. 8
figure 8

Data difference between the simple and complex fracture models at producer 1, producer 4 and producer 7, respectively. First row shows the difference of well water production rate (WWPR) data; the second row shows the difference of well oil production rate (WOPR) data

The next application of the method to numerical experiment is synthetic models consisting of “Pattern A,” “Pattern B” fracture systems and matrix media. Following the model calibration flowchart (Fig. 9), one hundred prior complex fracture model realizations are pre-generated through the generation mechanism of the complex fracture model (Sect. 2). Based the prior model, the difference matrix \({\mathbf{C}}_{{\mathbf{M}}}\) can be generated which will restrict the calibrated parameters in the iteration process. Then, substitute the initial model into MRST and obtain the observed data. MRST uses SPSA algorithm to generate the gradient and update model variables by reducing the observation data misfit between the reference and prior models. Continue the iteration, substitute the updated complex fracture model into MRST and obtain observation data, until the data misfit matches the stopping criterion.

Fig. 9
figure 9

Model calibration flowchart

Figure 10a shows the reference model and its water saturation field from MRST; Fig. 10b–d shows the three typical model realizations of one hundred initial complex fracture model realizations and the corresponding calibrated (final) model with their water saturation fields, respectively. Besides, the WPR and OPR data misfit at each producer for one hundred realizations of this application is shown in Figs. 11 and 12, respectively, with a two-year calibration period. As shown in Figs. 11 and 12, almost data misfit of well water production rate (WWPR) and well oil production rate (WOPR) at each producer is fairly little and should be accepted. However, the data misfit of producers 2 and 6 is larger than other producers which may be affected by some initial stochastic models being fairly far from the reference model.

Fig. 10
figure 10

Geological initial and calibrated (final) complex fracture model comparing with the reference (true) model. a Reference (true) complex fracture model with its water saturation at final time step. bd Three of one hundred initial model realizations and corresponding calibrated (final) models with their water saturation fields

Fig. 11
figure 11

Simulated water production rate at each production well corresponding to the initial rate, reference (true) and calibrated (final) complex fracture models

Fig. 12
figure 12

Simulated oil production rate at each production well corresponding to the initial rate, reference (true) and calibrated (final) complex fracture models

Then, a quantitative analysis of the results was done. As above said, there are seven parameters required to be calibrated. Specifically, those seven parameters include the density parameters \(\lambda\) and \(\eta_{A}\) in “Pattern A” system, orientation parameter \(\beta\) in “Pattern B” system, the properties of large-scale fractures including the center coordinate, \((x_{o} ,\;y_{o} )\), size, \(L\), the orientation angle, \(\theta_{B}\). The well oil production rate (WOPR) and the well water production rate (WWPR) are chosen as the inversion indexes. The error percentage of 100 final models and the true model are shown in Fig. 13, and the mean square root error and its percentage of inversed parameters are shown in Fig. 14.

Fig. 13
figure 13

The error percentage of 100 final models and the true model

Fig. 14
figure 14

Mean square root error and its percentage of inversed parameters

These results demonstrate that it is feasible using this method to calibrate the integral complex fracture model. This method could be applied in large-scale field simulations because it transforms the complex inversion problem into calibration of parameters.

5 Summary

This method divided fracture networks into two parts which are “Pattern A” and “Pattern B,” respectively. After building two sub-models, we combine them together to form a complex fracture network model. This model not only contains small-scale natural fractures generating by Monte Carlo distribution function (“Pattern A”), but also includes cluster fractures which are composed of large-scale natural fractures and surrounding daughter fractures (“Pattern B”). This method provides better details about fracture model building than previous works. Furthermore, the built model is more closer to reality.

After building a complex fracture model, the selected parameters of this system are calibrated based on the Bayesian formulation. Specifically, those parameters are variables of distribution functions for building two sub-models to describe fracture properties, including the density parameters λ and \(\eta_{A}\) in the “Pattern A” system, the orientation parameter \(\beta\) in the “Pattern B” system, the properties of large-scale fractures including the center coordinate, \((x_{o} ,\;y_{o} )\), size, \(L\), the orientation angle, \(\theta_{B}\). Besides, the well oil production rate (WOPR) and well water production rate (WWPR) are chosen as the inversion indexes. Through simulation experiments, the Bayesian formulation has been verified to be satisfactory for calibrating the complex fracture model.

It should be noted that this paper not only builds a complex fracture model, but also calibrates the complex model based on the dynamic production data and the Bayesian formulation. It is a novelty in comparison with the previous works which only generated a fracture model.

However, there are some shortages of this calibration system remaining to be improved. Firstly, this method is only implemented on the 2-D model rather than the 3-D model, which focuses on theoretical feasibility but is lack in the practicability. Secondly, it applies to the simple fractured reservoirs. In other words, the big-scale fractures are sparse in reservoirs. When the number of big-scale fractures increases, the number of calibrated parameters increases at the same time; this method does not work very well on large-scale inversion problems under the circumstances.