1 Introduction

Carbonate is the main oil and gas reservoir in the world. Statistics showed that carbonate stands for 48.66 % of total recoverable oil reserve and 45.26 % of total recoverable gas reserve [1]. There are also many carbonate reservoirs in China such as Tarim, Sichuan, and Erdos basin. As we know, carbonate has many types of the reservoir space including pores, dissolution vugs and fractures, etc. The pore structure of the carbonate reservoir is more complex than that of the conventional clastic reservoir and shows great heterogeneity for the effects of sedimentary, geologic, digenetic and epigenetic alteration, which contributes to great difficulty in pore structure evaluation and well logging analysis.

Many people conducted researches on the pore structure characterization for carbonate reservoir. Generally, the methods of the pore structure evaluation and classification of the carbonate reservoir can be summarized as geological, seismic, well logging and petrophysical ones, where the petrophysical method is the most direct and effective method, which also acts as the bridge of ‘core calibration well logging’. The nuclear magnetic resonance (NMR) core analysis is an important petrophysical method for the pore structure evaluation, which overcomes the drawback of the mercury injection capillary pressure analysis, since only limited scales of pore throat can be injected by mercury under fixed pressure. Furthermore, it overcomes the drawbacks of thin section and scanning electron microscopy since they are greatly affected by the heterogeneity of a sample. The NMR core analysis and NMR well logging are widely used for the carbonate reservoir characterization. Tan and Zhao [13] gave detailed NMR well logging responses of different pore structures for the carbonate reservoir. Yan et al. [16, 17] carried out NMR core experiments for the carbonate sample and proposed methods for the pore structure classification and the effectiveness of judgment by NMR. Lang et al. [7] presented a method for reservoir type discrimination by NMR imaging and NMR T 2 spectrum. Li et al. [8], Westphal et al. [4], and Rohilla and Hirasaki [12] also proposed ways of using NMR for the carbonate reservoir evaluation and pore space characterization.

NMR T 2 spectrum often shows multi-peak property with the effect of pore space types and theirs components. The authors propose an automatic pore structure classification technology based on the NMR T 2 spectrum of the carbonate reservoir. Featured parameters of the NMR T 2 spectrum were achieved by the spectrum decomposition using the PSO–GRG algorithm. The combinatory spectrum parameters were constructed, and the fuzzy clustering method and Fisher discrimination analysis were then proposed for the pore structure classification and discrimination automatically.

2 NMR T 2 Properties of Carbonate Samples

According to the basic principle of NMR, if the bulk relaxation and diffusion relaxation are omitted, the transverse relaxation time can be stated as:

$$ \frac{1}{{T_{2} }} = \rho \frac{S}{V}, $$
(1)

where T 2 is the transverse relaxation time (ms); ρ is the transverse bulk relaxation ratio (μm/ms); S is the pore surface area (cm2); V is the pore volume (cm3).

Since the specific surface area is the function of the pore radius for the regular distributed pore system, Eq. (1) can be expressed as:

$$ \frac{1}{{T_{2} }} = \rho \frac{{F_{\text{s}} }}{r}, $$
(2)

where F s is the pore shape factor having value of 3 for the sphere-like pore and 2 for the cylinder-like pore. It is known from Eq. (2) that the pore radius r is strongly related to the NMR transverse relaxation time T 2 and can be obtained by the appropriate transformation of regular distributed porous rock.

The NMR core analysis was conducted for carbonate of an oilfield from western China using a MARAN-II instrument. To enhance the SNR (signal-to-noise ratio) of echo trains, the sampling time is chosen as 30 and the echo number is chosen as 4,096. In order to determine the appropriate waiting time (T W) and echo time (T E), various parameters were chosen and compared (here 1, 2, 4 and 6 s were selected for T W and 0.1, 0.2, 0.6 and 1.2 ms were selected for T E). The SIRT algorithm was adopted as the inversion method to get the NMR T 2 spectrum based on measured data [15]. Figure 1 showed a ‘bimodal type’ NMR T 2 spectrum of carbonate rock under different T W and T E. It can be easily seen that the amplitude of the left-hand peak increases with the decrease in T E, whereas the amplitude of the right-hand peak stays stable. Moreover, the amplitude of the left-hand peak decreases with the increase in T W, whereas the amplitude of the right-hand peak stays stable. When T E is 0.1 ms and T W is 6 s, the NMR T 2 spectrum stays stable. From the experiment, we know that only the left-hand peak was affected by T W and T E, whereas the right-hand peak was affected slightly. The similar results were also found for the unimodal and triple-peak T 2 spectrum, etc. Based on these results, 0.1 ms and 6 s were chosen, respectively, for T E and T W with the aim to get standard NMR T 2 spectra of carbonate rocks.

Fig. 1
figure 1

NMR T 2 spectrum of carbonate rock under different T E and T W (fully saturated). a Experimental result under different T E, b experimental result under different T W

NMR T 2 spectra can be classified into four classes (unimodal, bimodal, triple- and four-peak) for all the carbonates of this area as shown in Fig. 2. Combining core photos, thin section and scanning electron microscopy, it can be easily seen that carbonate of the unimodal peak spectrum often corresponds to the pore space of the microfracture, where the main peak is distributed from 0.2 to 3 ms, the reservoir of this type has the weakest liquid production capacity. Carbonate of the bimodal spectrum often corresponds to the pore space of matrix pores, where the main peak is distributed from 2 to 60 ms, the reservoir of this type has weak liquid production capacity since the porosity and permeability often bear low values. Carbonate of the triple-peak spectrum often corresponds to pore spaces of matrix pores and dissolution vugs, where the main peak is distributed from 2 to 300 ms, the reservoir of this type has medium liquid production capacity. The NMR T 2 spectrum of carbonate of the four-peak type often corresponds to the pore space of a mixture of matrix pores, dissolution vugs and microfractures. The reservoir of this type has the higher value of porosity and permeability, thus resulting in the higher fluid production capacity.

Fig. 2
figure 2

Four types of the typical NMR T 2 spectrum of carbonate rock (fully saturated). a Unimodal type, b bimodal type, c triple-peak type, d four-peak type

It can be seen also that for the arbitrary type of NMR T 2 spectra, the shape of NMR T 2 spectrum is likely to be the Gaussian distribution when T 2 is in the log scale, which is the theoretical basis and foundation of the pore structure classification and discrimination quantitatively using the NMR T 2 spectrum.

3 T 2 Spectrum Decomposition Based on Multi-Gauss Function and PSO–GRG Algorithm

Section 2 demonstrated that the reservoir space could be depicted qualitatively based on the shape of the NMR T 2 spectrum, whereas well logging analysts need the automatic classification and discrimination methods for the fine formation evaluation using the NMR T 2 spectrum of the carbonate reservoir. By the ‘Gaussian function’ distributing property of every peak of the T 2 spectrum we can define the Gaussian function as:

$$ G(x,u,\sigma ) = \frac{1}{{\sigma \sqrt {2\pi } }}e^{{ - \frac{1}{2}\left( {\frac{{x\text{ - }u}}{\sigma }} \right)^{2} }}, $$
(3)

where u is the peak value, σ is the standard deviation, and x is the log scale of T 2 (x = log(T 2)).

For the total NMR T 2 spectrum, the objective function can be constructed as:

$$ \hbox{min} \sum\limits_{{x = x_{1} }}^{{x_{n} }} {(f(x)- a_{1} G(x,u_{1} ,\sigma_{1} ) - a_{2} G(x,u_{2} ,\sigma_{2} ) - a_{3} G(x,u_{3} ,\sigma_{3} ) - a_{4} G(x,u_{4} ,\sigma_{4} )^{2} }, $$
(4)

where u 1, σ 1, u 2, σ 2, u 3, σ 3, u 4, σ 4 are peak values and standard deviations of four peaks; a 1, a 2, a 3, a 4 are weights of four peaks. x i can be stated by log scaling:

$$ x_{i} \text{ } = \text{ }\log (T_{2\hbox{min} } )\text{ } + \text{ }\left( {(\log (T_{2\hbox{max} } )\text{ } - \text{ }\log (T_{2\hbox{min} } )} \right)\frac{i - 1}{n - 1}\text{ }(i\text{ } = \text{ }1,\text{ }2, \ldots ,n), $$
(5)

where T 2min and T 2max are minimal and maximal values of transverse relaxation time, respectively, n is the points number in the T 2 spectrum (here n is fixed as 128).

By normalizing the T 2 spectrum intensity, constraints of Eq. (4) can be expressed as:

$$ u_{i} \text{ } > \text{ }0\text{ }(i\text{ } = \text{ }1,\text{ }2,\text{ }3,\text{ }4), $$
(6)
$$ \sigma_{i} \text{ } > \text{ }0\text{ }(i\text{ } = \text{ }1,\text{ }2,\text{ }3,\text{ }4), $$
(7)
$$ a_{i} \text{ } \ge \text{ }0\text{ }(i\text{ } = \text{ }1,\text{ }2,\text{ }3,\text{ }4), $$
(8)
$$ \sum\limits_{i = 1}^{4} {a_{i} } \text{ } = \text{ }1. $$
(9)

From Eq. (4) we know that there are 12 unknown variables. Combining Eqs. (4), (6) and (9), the problem of the T 2 spectrum decomposition is transformed to solving the multi-variable non-linear optimization problems with constraints. Many algorithms are proposed to solving the problem including the reduced gradient method, sequential unconstrained minimization technique, barrier function technique and Lagrange multiplier technique, etc. Most of those optimal procedures mentioned above have a drawback that they can easily be stacked into the local minimum value thus solutions are not globally optimized. Hence, the particle swarm optimization algorithm (PSO) is introduced. PSO algorithm is a global optimization technique which originated from the simulations of the prey behavior of a bird flock. PSO shares many similarities with evolutionary computation techniques such as genetic algorithms. PSO has been found to be robust and fast in solving non-linear, non-differentiable, multi-modal problems. The system is initialized with a population of random solutions and searches for optima by updating generations and adopts fitness to evaluate the quality of solutions. For the problem of the NMR T 2 spectrum decomposition, the optimization model can be expressed as [6, 9]:

$$ f(x)\text{ } = \text{ }\sum\limits_{{x = x_{1} }}^{{x_{n} }} {(f(x) - a_{1} G(x,u_{1} ,\sigma_{1} )\text{ } - \text{ }a_{2} G(x,u_{2} ,\sigma_{2} )\text{ } - \text{ }a_{3} G(x,u_{3} ,\sigma_{3} )\text{ } - \text{ }a_{4} G(x,u_{4} ,\sigma_{4} )^{2} }, $$
(10)

where f(x) is the real function of a region S in the D-dimensional space, x is the variables and can be expressed as (x 1, x 2, …, x D )T.

Let the position of the i-th particle of the t-th hereditary algebra be x t i  = (x t i1 , x t i2 , …, x t iD )T and its speed is v t i  = (v t i1 , v t i2 , …, v t iD )T(assuming the population size is N) in the D-dimensional space. Each particle has a fitness value determined by an optimized function, and each particle knows its present position x t i and the best position (pbest) that it has so far found; this can be regarded as the flying experiences of the particle. In addition, each particle knows the best position (gbest) that the whole swarm has so far found; this can be regarded as the flying experiences of the particle’s companions. Each particle utilizes the following information to alter its present position: (1) its current position, (2) its current speed, (3) the distance between its current position and its best position, and (4) the distance between its best position and the best position of the whole swarm.

PSO is an optimization instrument based on iteration. For the k-th times of iteration, each particle alters in accordance with Eqs. (11) and (12) as follows [6, 9]:

$$ v_{i}^{t + 1} = w \cdot v_{i}^{t} \text{ } + \text{ }c_{1} r_{1}^{t} (p_{i}^{t} \text{ } - \text{ }x_{i}^{t} )\text{ } + \text{ }c_{2} r_{2}^{t} (p_{g}^{t} \text{ } - \text{ }x_{i}^{t} ), $$
(11)
$$ x_{i}^{t + 1} = x_{i}^{t} \text{ } + \text{ }v_{i}^{t + 1}, $$
(12)

where i = 1, 2, …, N; w is the inertia weight; t is the iteration time; c 1 and c 2 are learning factors (two positive constants); r 1 and r 2are random numbers in the interval of [0, 1]; p t i represents the component of the best position (pbest) of particle i in the t-th times of iteration; p t g represents the component of the best position (pbest) of particle swarm in the t-th times of iteration.

The influence that the last speed has on the current speed can be controlled by inertia weight. When w is 0 the flying speed of each particle is only influenced by the current position, the best position of each particle and the best position of total particle swarm, whereas not affected by flying speed. Particles with global best positions will keep stable and other particles will tend to the weighted center of best positions themselves and global best positions in this situation. Then, particle swarm will be globally converged in best positions [6, 9]:

$$ x_{i}^{t + 1} \text{ } = \text{ }x_{i}^{t} \text{ } + \text{ }c_{1} r_{1}^{t} (p_{i}^{t} \text{ } - \text{ }x_{i}^{t} )\text{ } + \text{ }c_{2} r_{2}^{t} (p_{g}^{t} \text{ } - \text{ }x_{i}^{t} ). $$
(13)

PSO is an intelligent algorithm and can obtain strong convergence in the beginning of the calculation procedure but it may easily fall into ‘inertia’ which leads to the premature convergence and the insufficient local searching ability. To handle this problem, the GRG algorithm is introduced simultaneously and proposed a new algorithm named ‘PSO–GRG’. GRG is suitable for non-linear optimal problem since it has advantages of fast convergence speed and high precision but is affected by initial searching direction greatly. Unsuitable initial value and searching directions may lead to local convergence and unfavorable solution.

To overcome shortcomings of the two algorithms, we first solved the problem using PSO to get an favorable solution, then used the solution as the initial value for the GRG algorithm. In the latter, a simple analysis of the GRG algorithm is introduced first and the proposed ‘PSO–GRG’ procedures are discussed.

The GRG algorithm is developed from the reduced gradient and becomes an effective method to solve non-linear optimal problems. By introducing slack variables, inequality constraints were transformed to equality constraints. The GRG algorithm can be expressed as [11, 14, 17, 18]:

$$ \begin{gathered} \hbox{min} F(X)\text{ }X \in R^{n} \hfill \\ {\text{s}} . {\text{t}} . { }H(X) = 0 \hfill \\ L \le X \le U\text{ }(L,U \in R^{n} ) \hfill \\ \end{gathered}, $$
(14)

where H(X) = [h 1(X), h 2(X),…, h m (X)]T; L = [l 1, l 2,…, l n ]T; U = [u 1, u 2,…, u n ]T.

X is subdivided into basic and non-basic variables (X = [X B, X N]T, where X B is the basic variables with m dimension and X N is non-basic variables with n−m dimension). With the definition of implicit function, X N can be expressed as M(X B) and the objective function can be expressed as [11, 14, 17, 18]:

$$ F(X)\text{ } = \text{ }F(X_{\text{B}} ,\text{ }M(X_{\text{B}} )). $$
(15)

The reduced gradient of the objective function can be expressed as [11, 14, 17, 18]:

$$ \nabla f(X_{N}^{k} ) = \left[ {\frac{{\partial f(X_{N}^{k} )}}{{\partial x_{m + 1}^{k} }},\text{ }\frac{{\partial f(X_{\text{N}}^{k} )}}{{\partial x_{m + 2}^{k} }}, \ldots ,\frac{{\partial f(X_{\text{N}}^{k} )}}{{\partial x_{n}^{k} }}} \right]^{T} \text{ } = \text{ }[r_{1} ,\text{ }r_{2} , \ldots ,\text{ }r_{n - m} ]^{T}. $$
(16)

X N can be iterated as follows if we define Sk = [s 1, s 1,…, s nm ]T:

$$ X_{\text{N}}^{k + 1} \text{ } = \text{ }X_{\text{N}}^{k} \text{ } + \text{ }aS^{k}, $$
(17)

where a is the slack parameter which has value larger than zero and smaller than 1.

Let \( Y_{0} = X_{\text{B}}^{k} \) and we can get such iteration scheme:

$$ Y^{c + 1} \text{ } = \text{ }Y^{c} \text{ } - \text{ }[\nabla_{\text{B}} H(Y_{0} ,\text{ }X_{\text{N}}^{k + 1} )]^{ - 1} H(Y^{c} ,\text{ }X_{\text{N}}^{k + 1} )\text{ }(c\text{ } = \text{ }1,\text{ }2, \ldots ,\text{ }P). $$
(18)

Iteration is stopped if H(Y c, \( X_{\text{N}}^{k + 1} \)) = 0 and Y c+1 is the optimal solution. In summary, the calculation steps of PSO–GRG can be stated as follows: (1) Given population size N, learning factors c 1 and c 2, inertia weight w and dimension of searching space D, the maximal iteration times m and the minimum fitness value f min; (2) calculating fitness value of every particle; (3) finding particle that satisfied the condition of the minimum fitness value as the initial solutions of GRG algorithm; (4) solving the objective function using GRG algorithm and getting weights, peak values and standard deviations of Gaussian functions; (5) making solutions to NMR transversal relaxation time (T 2 = 10x, where x is the peak value of every Gaussian function).

4 Pore Structure Classification and Discrimination Based on T 2 Spectrum Decomposition

After the T 2 spectrum decomposition by the PSO–GRG algorithm, featured parameters such as peak values, standard deviations and weights can be obtained, which are helpful for the quantitative pore structure characterization. Numerical results showed that for T 2 spectra with unimodal, bimodal and triple peaks, Eq. (4) can also get desired fitting results. By this method not only main peaks can be picked, but also weak peaks. Figure 3 shows the fitting results of a carbonate with the triple-peak distribution. It can be easily seen from Fig. 3a that the optimized spectrum is in accordance with the experiment spectrum, three main peaks were picked and one weak peak was also picked. Totally, the four peak values are 0.998, 3.965, 87.558 and 432.094 μs, standard deviations are 0.253, 0.285, 0.151 and 0.107, normalized weights are 0.003, 0.615, 0.323 and 0.059. Figure 3b shows the distribution of residual errors, the average relative error between optimized spectrum and experiment spectrum is 2.87 %.

Fig. 3
figure 3

Optimal solution of a triple-peak core. a Comparison between optimized and experiment spectrum, b the distribution of residual errors

One hundred and thirty six carbonate samples were tested for the NMR T 2 spectrum decomposition to obtain featured parameters. Since the peak value and the normalized weight are important for the pore structure characterization, while the standard deviation bears little relationship with the pore structure, the combinatory parameter ‘NP i ’ is defined (NP i  = T i α i , i = 1, 2, 3, 4) for the evaluation of the pore structure. The pore structure is divided into four classes based on knowledge of thin section, capillary pressure and production data, thus the fuzzy clustering method ([5, 10]) was adopted here to classify the pore structure into four classes using the combinatory parameters NP1, NP2, NP3 and NP4. The class of each sample is defined according to the maximum membership degree. Table 1 shows the distributions of four combinatory parameters, dominant pore space and liquid production capacity for every pore structure type. It is easily seen from the table that the combinatory parameters have favorable characterization ability in the pore structure evaluation. The pore space of the pore structure type I is mainly occupied by matrix pores, which has low values of NP1, NP2, NP3 and NP4. The pore space of the pore structure type II is mainly occupied by matrix pores and microfractures, which has high values of NP1 and NP2. The pore space of the pore structure type III is mainly occupied by matrix pores and dissolution vugs, which have high values of NP2 and NP3. The pore space of the pore structure type IV is more complex than previous three types, matrix pores, dissolution vugs and fractures were often co-existed in this type. The pore structure type IV has the highest values of NP3 and NP4 and high value of NP2. The liquid production capacity is increased from type I to type IV. Figure 4 shows featured thin section and scanning electron microscope of the four pore structure types. In summary, the pore structure type has a good correspondence with the thin section, scanning electron microscope, NMR response and the liquid production capacity.

Table 1 Micro pore structure parameters for different pore types
Fig. 4
figure 4

Typical photos of casting thin section and scanning electron microscope data of four types of the carbonate pore structure. a First type of the pore structure, b second type of the pore structure, c third type of the pore structure, d fourth type of the pore structure

In order to construct the automatic classification of the pore structure based on NMR T 2 spectrum decomposition parameters, carbonates with the maximum membership degree larger than 70 % were selected as the optimal samples. Samples were divided into two classes, one as the modeling data, and the other as the validation data. The Fisher discrimination analysis [2, 3] is used to establish discrimination functions for four pore structure types, which can be expressed as follows:

$$ F1\text{ } = \text{ }1.803{\text{NP}}_{1} \text{ } + \text{ }0.329{\text{NP}}_{2} \text{ } + \text{ }0.042{\text{NP}}_{3} \text{ } + \text{ }0.027{\text{NP}}_{4} \text{ } - \text{ }2.72,$$
(19)
$$ F2\text{ } = \text{ }4.897{\text{NP}}_{1} \text{ } + \text{ }0.644{\text{NP}}_{2} \text{ } + \text{ }0.124{\text{NP}}_{3} \text{ } + \text{ }0.588{\text{NP}}_{4} \text{ } - \text{ }8.526,$$
(20)
$$ F3\text{ } = \text{ }0.73{\text{NP}}_{1} + 0.203{\text{NP}}_{2} \text{ } + \text{ }0.169{\text{NP}}_{3} \text{ } + \text{ }0.098{\text{NP}}_{4} \text{ } - \text{ }5.325, $$
(21)
$$ F4\text{ } = \text{ }2.641{\text{NP}}_{1} \text{ } + \text{ }0.635NP_{2} \text{ } + \text{ }0.355{\text{NP}}_{3} \text{ } + \text{ }0.299{\text{NP}}_{4} \text{ } - \text{ }29.815. $$
(22)

Equations (19)–(22) are discrimination functions of the pore structure type I, II, III and IV. Modeling data and validation data were selected to test, each of them get desirable results (coincidence rate for modeling data and validation data was 93.8 and 85.5 %, respectively), which showed the accuracy of the Fisher discrimination analysis.

In combination of the fuzzy clustering method and Fisher discrimination analysis for the combinatory parameters (NP1, NP2, NP3 and NP4), pore structure types of carbonate rocks were characterized and discriminated automatically, which lay foundations for the carbonate reservoir characterization based on NMR well logging data.

Finally, the method proposed can be summarized as a flow chart to facilitate petrophysics and well logging analysis to handle their own data. It is easily seen from Fig. 5 that the method can be subdivided into six steps:

Fig. 5
figure 5

Flow chart for the pore structure classification and discrimination by the NMR T 2 spectrum decomposition

  1. 1.

    NMR transverse decay data acquisition using a core NMR instrument and carefully experiment parameters set such as waiting time, echo time, echo numbers and gain.

  2. 2.

    NMR T 2 inversion by decay data using the SIRT algorithm to get the NMR T 2 spectrum.

  3. 3.

    NMR T 2 spectrum decomposition by the PSO–GRG algorithm and combinatory parameters calculation.

  4. 4.

    Pore types definition by capillary pressure, thin section, scanning electron microscope and oil production data.

  5. 5.

    Pore types classification by the fuzzy clustering method using combinatory data from the NMR T 2 spectrum.

  6. 6.

    Pore structure discrimination function establishment based on the Fisher discrimination analysis by selected samples (where the membership degree is larger than 70 %).

5 Conclusions

The main objective of this paper was to present a quantitative evaluation method of the complex carbonate pore structure using NMR core analysis data. Based on the NMR T 2 spectrum decomposition technology with the aid of the PSO–GRG algorithm, featured parameters of pore structure were obtained, and then the fuzzy clustering method and Fisher discrimination analysis were applied to construct the pore structure type discrimination functions. Conclusions of this paper can be summarized as:

  1. 1.

    The pore space of the carbonate reservoir showed a great variety and had different NMR T 2 spectrum (lab core analysis) distributing property. With the multi-gauss objective function optimization and PSO–GRG algorithm, featured parameters such as peak values, normalized weights and standard deviations can be obtained accurately.

  2. 2.

    By carefully examining the featured parameters we found that peak values and normalized weights showed good correspondence with pore structure types. By multiplying peak value and normalized weight for every peak, four combinatory parameters were obtained which were useful for the pore structure characterization quantitatively. All the samples were divided into four classes in the combination core analysis and production data.

  3. 3.

    The fuzzy clustering method and Fisher discrimination analysis were effective means for the automatic pore structure classification and discrimination. Different pore structure types can be discriminated by different discrimination functions. The results showed a good correspondence with modeling and validation data.

  4. 4.

    The method we proposed is useful for the carbonate reservoir evaluation based on the NMR core analysis. However, NMR well logging data were not processed in this paper, which will be the subject of the future work.