Introduction

Wettability is one of the fundamental parameters governing multiphase flow through porous media. Reservoir rock wettability significantly influences transport characteristics, such as irreducible saturation, relative permeability, and capillary pressure. There are various laboratory techniques for extracting meaningful wettability information from rock core plugs, such as the U.S. Bureau of Mines (USBM) test and the Amott–Harvey test. Not only are these techniques costly and time-consuming, but they also only grant information on a small scale. Moreover, these techniques require core samples to be retrieved from boreholes and analyzed in the laboratory. Therefore, the development of a technique for evaluating in situ wettability is essential. Among the most ambitious efforts to develop such a technique is nuclear magnetic resonance (NMR). Inherently responsive to the strength of fluid–rock interactions, NMR measurements provide a viable framework for determining in situ wettability. This paper attempted to determine the downhole wettability of an oil well running through two carbonate reservoirs based on the NMR relaxation property. NMR relaxation is highly sensitive to the wetting state of rock through the influence of surface relaxivity.

The state-of-the-art NMR technique has emerged over the last few decades as a relatively simple and powerful tool for characterizing reservoir rock wettability. Wettability affects the three main NMR parameters, namely longitudinal relaxation time \(\left( {T_{1} } \right)\), transverse relaxation time \(\left( {T_{2} } \right)\), and diffusivity \(\left( D \right)\). Generally, the NMR-based methods proposed in the literature to quantify downhole wettability include T2 spectrum (or T2 shift), restricted diffusion (or \(D - T_{2}\) map), and \(\frac{{T_{1} }}{{T_{2} }}\) ratio. In the T2 spectrum method, a forward model is first constructed based on different parameters that affect T2. The forward model is then inverted with a numerical method to determine the wettability and saturation functions (Al-Muthana et al. 2016; Cheng et al. 2017; Dick et al. 2019; Looyestijn & Hofman, 2006; Sauerer et al. 2019). Extracting the reliable and quantitative wettability information from T2 spectrum measurements requires a few extra pieces of information. This information is available only from the laboratory. The downhole application of this method is usually qualitative. In the restricted diffusion method, diffusivity is first measured accurately for all relaxation times. Then, the location of water and oil is determined visually on the \(D - T_{2}\) map. Finally, by fitting the restricted diffusion lines to the fluid signals, the wettability type is determined (Liang et al. 2019a, b; Minh et al. 2015; Wang et al. 2019). Using the ratio between the two relaxation parameters T1 and T2 \(\left( {\frac{{T_{1} }}{{T_{2} }}} \right)\) is a well-established method for determining downhole wettability (Katika et al. 2016; Korb et al. 2018; Valori et al. 2017). Despite being strongly correlated with the industry wettability index, this method has some disadvantages, including time-consuming measurements of T1 relative to T2, and achieving only a single point on the T1 polarization curve compared to multiple points on the T2 decay for each scan.

Given the limitations of the NMR-based methods presented for determining downhole wettability, this study intended to develop a rigorous method based on the correlation between T2 and NMR porosity \(\left( {\phi_{\rm NMR} } \right)\). Variation in correlation coefficient between T2 and \(\phi_{\rm NMR}\) was assumed to be associated with wettability. Wavelet transform, as an information processing technique, was utilized to exhibit the variation and substantiate this hypothesis. Recently, wavelet analysis has contributed remarkably to researchers in the broad field of earth science, such as geophysics, petroleum engineering, and geology. In geophysical studies, wavelet transforms have been applied to furnish high-resolution information (Grasseau et al. 2019; Yue et al. 2019) and to detect fault systems (Saadatinejad & Sarkarinejad, 2011; Xu & Sun, 2014). Outstanding results of using the wavelet transform have been reported in reservoir and geology studies by Awotunde and Horne (2013), Rezapour et al. (2019), Heidary and Fouladi Hossein Abad (2020), and Azamipour et al. (2020). Several investigations have corroborated the advantage of wavelet transform in denoising NMR log data (Ge et al. 2015; Heidary et al. 2019; Wu et al. 2012; Xie et al. 2014).

This study intended to determine the in situ wettability of reservoir rocks based on the discrete wavelet transform (DWT) of NMR log data. Generally, the steps involved in this work are as follows: provide a correlation function to calculate the correlation coefficient between T2 and \(\phi_{\rm NMR}\) at each depth; apply the DWT to the correlation coefficients to remove the shale effect, if any, decompose the modified correlation coefficients to extract its details, and establish a relationship between details and Amott–Harvey wettability index.

Materials and Methods

This study focused on determining the in situ wettability of an oil well running through two argillaceous limestone reservoirs (A and B). These reservoirs are located in the northwest of the Persian Gulf. In both reservoirs, the NMR and conventional logs were recorded. The special core analysis test and the Amott–Harvey wettability test were conducted for reservoir A. For reservoir B, there was a limited wettability test. Tables 1 and 2 display the results of the Amott–Harvey wettability test in reservoirs A and B, respectively. Figure 1a and b shows the gamma-ray (GR) log in reservoirs A and B, respectively. Figures 2 and 3 show the \(\phi_{\rm NMR}\) and T2 logs for reservoirs A and B, respectively. The procedure used to determine the in situ wettability of reservoir rocks through wavelet analysis of NMR log data is as follows.

  1. 1.

    The correlation coefficient between T2 and \(\phi_{\rm NMR}\) was computed at each depth using an appropriate correlation function, thereby achieving a correlation coefficient log.

  2. 2.

    The DWT was employed to remove the shale effect, if any, from the correlation coefficient log. The resulting log was referred to as a decorrelated coefficient log.

  3. 3.

    The DWT was re-employed to decompose the decorrelated coefficient log in reservoir A and extract its detail coefficients.

  4. 4.

    The relationship between detail coefficients and the Amott–Harvey wettability index was investigated for reservoir A. The result obtained was then extended to reservoir B.

Table 1 Amott–Harvey wettability test indices for reservoir A
Table 2 Amott–Harvey wettability test indices for reservoir B
Figure 1
figure 1

GR log: a reservoir A; b reservoir B

Figure 2
figure 2

Logs in reservoir A: a \(\phi_{\rm NMR}\); b T2

Figure 3
figure 3

Logs in reservoir B: a \(\phi_{\rm NMR}\); b T2

Characterizing Wettability with Nuclear Magnetic Resonance

Nuclear magnetic resonance (NMR) refers to the response of atomic nuclei to magnetic fields. The first step in making an NMR measurement is to align, or polarize, nuclear spin axes with a static magnetic field. The second step in the NMR measurement cycle is to tip the magnetization from the longitudinal direction to a transverse plane. This tipping is performed by applying an oscillating magnetic field perpendicular to the static magnetic field. The properties of the pore space and the fluids inside are associated with transverse magnetization, which is an exponential decay process. In a uniform magnetic field, the transverse magnetization at time t, M(t), is given by Coates et al. (1999):

$$M\left( t \right) = M_{0} \exp \left( { - \frac{t}{{T_{2} }}} \right),$$
(1)

where M0 is the total initial magnetization at time t = 0; it is calibrated to give porosity \(\left( {\phi_{\rm NMR} } \right)\). NMR measurements are affected by wettability because the pore surface promotes the relaxation rate of the wetting fluid. When a nonwetting phase becomes partially wetting, T2 decreases dramatically because of the surface relaxation mechanism coming into play. Put differently, T2 in the porous medium is dominated by the surface relaxation rate. The rate of surface relaxation is proportional to pore size (Dunn et al. 2002). Accordingly, the correlation between T2 and \(\phi_{\rm NMR}\) can be used as a diagnostic parameter to distinguish wettability types. The calculation of the correlation coefficient between \(T_{2}\) and \(\phi_{\rm NMR}\) at each depth entails providing an appropriate correlation function. The linear correlation coefficient (R) between T2 and \(\phi_{\rm NMR}\) is calculated as (Hayter, 2012):

$$R = \frac{{\mathop \sum \nolimits_{z = 1}^{n} \left( {T_{2} \left( z \right) - \overline{{T_{2} }} } \right)\left( {\phi_{\rm NMR} \left( z \right) - \overline{{\phi_{\rm NMR} }} } \right)}}{{\sqrt {\mathop \sum \nolimits_{z = 1}^{n} \left( {T_{2} \left( z \right) - \overline{{T_{2} }} } \right)^{2} \left( {\phi_{\rm NMR} \left( z \right) - \overline{{\phi_{\rm NMR} }} } \right)^{2} } }},$$
(2)

where \(\overline{{T_{2} }}\) and \(\overline{{\phi_{\rm NMR} }}\) are the averages of T2 and \(\phi_{\rm NMR}\), respectively.

Discrete Wavelet Transform

The discrete wavelet transform (DWT) is applied to extract features and obtain information from any given signal. The practical design of the DWT is rooted in the multiresolution analysis (MRA), which entails decomposing the function space into a coarse approximation space. Assuming that \(\left\{ {V_{j} } \right\}_{{j \in {\text{\rm Z}}}}\) is a MRA of \(L^{2} \left( R \right)\), the subspaces \(V_{j}\) are nested in the following manner (Jansen & Oonincx, 2005):

$$V_{j} \subset V_{j + 1} \quad {\text{and}}\quad V_{j + 1} = V_{j} \otimes W_{j} ,$$
(3)

where j denotes the level (or scale) of decomposition, and the subspace \(W_{j}\) is the orthogonal complement of \(V_{j}\) in \(V_{j + 1}\). The subspaces \(V_{j}\) and \(W_{j}\) can be generated through dilations (j) and translations (k) of the scaling \(\phi \left( t \right)\) and wavelet \(\psi \left( t \right)\) functions, thus:

$$V_{j} = \overline{{span\left\{ {\phi_{j.k} \left( t \right)} \right\}}} ,\quad {\text{where}}\quad \phi_{j.k} \left( t \right) = 2^{\frac{j}{2}} \phi \left( {2^{j} t - k} \right)$$
(4)
$$W_{j} = \overline{{span\left\{ {\psi_{j.k} \left( t \right)} \right\}}} ,\quad {\text{where}}\quad \psi_{j.k} \left( t \right) = 2^{\frac{j}{2}} \psi \left( {2^{j} t - k} \right)$$
(5)

Repeating recursively the decomposition of \(V_{j}\) into the direct sum of a sequence of wavelet spaces yields:

$$V_{j} = V_{0} \mathop {\mathop \oplus \limits^{j - 1} }\limits_{l = 0} W_{l}$$
(6)

As a result, any function \(f\left( t \right) \in L^{2} \left( R \right)\) can be expanded as:

$$f\left( t \right) = \mathop \sum \limits_{{k \in {\rm Z}}} c_{j.k} \phi_{j.k} \left( t \right) + \mathop \sum \limits_{j \ge 0} \mathop \sum \limits_{{k \in {\rm Z}}} d_{j.k} \psi_{j.k} \left( t \right),$$
(7)

where \(c_{j.k}\) is coarse (approximation) coefficients and \(d_{j.k}\) is wavelet (detail) coefficients. The coarse and wavelet coefficients are calculated as:

$$c_{j \cdot k} = f\left( t \right) \cdot \phi_{k} \left( t \right), \quad d_{j \cdot k} = f\left( t \right) \cdot \psi_{j \cdot k} \left( t \right).$$
(8)

Results and Discussion

Correlation Coefficient Log

In the oil reservoirs under study, T2 exhibited a linear correlation with \(\phi_{\rm NMR}\). The values of \(R\) between T2 and \(\phi_{\rm NMR}\) in reservoirs A and B were 0.68 and 0.79, respectively. Accordingly, the correlation coefficient between T2 and \(\phi_{\rm NMR}\) can be calculated at each depth using Eq. 2. For this purpose, an interval equal to the core sample length, 40 cm, was first selected from the reservoir top. The correlation coefficients between the values of T2 and \(\phi_{\rm NMR}\) located in the interval were then calculated, referred to as \(R_{\rm corr}\). In the next step, the interval was moved forward by the depth sampling rate, and \(R_{\rm corr}\) was recalculated. This process continued until the interval reached the bottom of the reservoir.

Removing Shale Information

T2 and \(\phi_{\rm NMR}\) were correlated negatively with GR. The scatter plot of \(\phi_{\rm NMR}\) and T2 vs. GR indicates that \(\phi_{\rm NMR}\) and T2 decreased linearly with increasing GR. Figure 4a and b, for example, depicts this behavior in reservoir B. Table 3 shows the values of \(R\) between \(\phi_{\rm NMR}\) and GR \(\left( {R_{{\phi_{\rm NMR} ,GR}} } \right)\) and between T2 and GR \(\left( {R_{{T_{2} ,GR}} } \right)\) in the target reservoirs.

Figure 4
figure 4

Increasing GR in reservoir B with linear decline of \(\phi_{\rm NMR}\) (top) and T2 (bottom)

Table 3 Values of \(R_{{\phi_{\rm NMR} ,GR}}\) and \(R_{{T_{2} ,GR}}\) in the target reservoirs

In this study, wettability was assumed to be associated with variation in \(R_{\rm corr}\). The shale content, if any, was excluded from \(R_{\rm corr}\) to obtain a pure correlation coefficient. Put differently, \(R_{\rm corr}\) must be decorrelated with GR. The correlation coefficient between \(R_{\rm corr}\) and GR was calculated using Eq. 2 for reservoirs A and B. The values of R for reservoirs A and B were − 0.32 and 0.07, respectively. The values of \(R \approx 0\) in reservoir B demonstrate that \(R_{\rm corr}\) is uncorrelated with GR. Thus, removing the shale content from \(R_{\rm corr}\) in reservoir A was essential to derive a pure correlation coefficient. The following steps were performed to remove the shale information from \(R_{\rm corr}\)

  1. 1.

    The \(R_{\rm corr}\) log was decomposed up to the maximum decomposition level (level 9). The detail coefficients at each level, \(\left( {D_{1} ,D_{2} , \ldots ,D_{9} } \right)\), were extracted. \(D_{i} \left( n \right) = \left( {d_{1} , d_{2} \ldots d_{n} } \right)\) are the detail coefficients at level i, where \(i = 1, \ldots , 9\).

  2. 2.

    The detail coefficients from levels 1 to 9, \(D_{1}\) to \(D_{9}\), were subtracted from the \(R_{\rm corr}\) log, \(\left( {R_{\rm corr} - D_{1} ,R_{\rm corr} - D_{2} , \ldots ,R_{\rm corr} - D_{9} { }} \right)\). The resulting logs,\({ }R_{\rm corr} - D_{{\text{i}}}\), were referred to as the modified \(R_{\rm corr}\) logs.

  3. 3.

    The correlation coefficient between each of the modified \(R_{\rm corr}\) logs and GR log was calculated.

  4. (4)

    The modified \(R_{\rm corr}\) log resulting in a minimum value of \(R\) was selected and referred to as the decorrelated coefficient \(\left( {R_{\rm decorr} } \right)\) log.

.

Figure 5 shows the values of R between the modified \(R_{\rm corr}\) and GR vs. decomposition level. The value of \(R\) between the modified \(R_{\rm corr}\) and GR becomes zero by removing \(D_{9}\) from the \(R_{\rm corr}\) log. Hence, the shale information is at level 9 of the \(R_{\rm corr}\) log. Figure 6a and b demonstrates the values of \(R_{\rm corr}\) and \(R_{\rm decorr}\) vs. depth in reservoirs A and B, respectively.

Figure 5
figure 5

Values of \(R\) between the modified \(R_{\rm corr}\) and GR vs. level in reservoir A

Figure 6
figure 6

Values of \(R_{\rm corr}\) and \(R_{\rm decorr}\) vs. depth: a reservoir A; b reservoir B

Wettability in Reservoir A

The DWT was employed to extract the variations of \(R_{\rm decorr}\) in reservoir A. To this end, the \(R_{\rm decorr}\) log was decomposed to a level where coarse coefficients became equal. In this case, the \(R_{\rm decorr}\) log is written as the sum of a decomposition constant \(\left( {R_{\rm decorr}^{c} } \right)\) and detail coefficients \(\left( {\Delta R_{\rm decorr} } \right)\):

$$R_{\rm decorr} \left( n \right) = R_{\rm decorr}^{c} + \Delta R_{\rm decorr} \left( n \right)$$
(9)

\(\Delta R_{\rm decorr} \left( n \right)\) represents the variation in \(R_{\rm decorr}\) at each depth. The value of \(\Delta R_{\rm decorr}\) is dependent on the type of discrete wavelet applied. Table 4 exhibits the \(\Delta R_{\rm decorr}\) value obtained from the decomposition of the \(R_{\rm decorr}\) log with different discrete wavelets. The depth range of \(\Delta R_{\rm decorr}\) corresponds to that of the core sample. Table 5 shows the sum of the absolute difference between the corresponding \(\Delta R_{\rm decorr}\) and \(I_{W - O}\) values, \(\sum \left| {\Delta R_{\rm decorr} - I_{W - O} } \right|\), for each discrete wavelet. The rbio2.2 wavelet yielded the lowest value of \(\sum \left| {\Delta R_{\rm decorr} - I_{W - O} } \right|\). Accordingly, the \(\Delta R_{\rm decorr}\) values obtained from the decomposition of the \(R_{\rm decorr}\) log with rbio2.2 closely matched the \({\text{I}}_{W - O}\) values. The negative and positive values of \(\Delta R_{\rm decorr}\) correspond to oil-wet rock and water-wet rock, respectively. Figure 7 shows the plot of \(\Delta R_{\rm decorr}\) and \(I_{W - O}\) vs. core sample number. Figure 8 demonstrates the wettability \(\left( {\Delta R_{\rm decorr} } \right)\) log. Figure 9 illustrates the distribution of \(\Delta R_{\rm decorr}\) values. According to the histogram, 60% of the \(\Delta R_{\rm decorr}\) values were negative. Consequently, reservoir A is mainly oil-wet.

Table 4 Value of \(\Delta R_{\rm decorr}\) obtained from decomposing the \(R_{\rm decorr}\) log with various wavelets
Table 5 Sum of absolute difference between \(\Delta R_{\rm decorr}\) and \({\text{I}}_{W - O}\) for each discrete wavelet
Figure 7
figure 7

Reservoir A: plot of \(\Delta R_{\rm decorr}\) and \(I_{W - O}\) vs. core sample number. The superimposed image shows the linear relationship between \(\Delta R_{\rm decorr}\) and \(I_{W - O}\) with regression coefficient of 0.96

Figure 8
figure 8

Reservoir A: wettability \(\left( {\Delta R_{\rm decorr} } \right)\) vs. depth

Figure 9
figure 9

Reservoir A: distribution of \(\Delta R_{\rm decorr}\) values

Wettability in Reservoir B

In reservoir B, \(R_{\rm corr}\) was uncorrelated with GR. The DWT was used to decompose the \(R_{\rm corr}\) log. A suitable wavelet was required to obtain the \(R_{\rm corr}\) variations representing the reservoir rock wettability. There was a limited wettability test in this reservoir to ascertain the appropriate wavelet for extraction of the \(R_{\rm corr}\) variations \(\left( {\Delta R_{\rm corr} } \right)\). Therefore, the intensity of wettability cannot be determined. The results obtained from the application of different discrete wavelets in reservoir A indicated that the \(\Delta R_{\rm decorr}\) sign did not change (Table 4). Accordingly, the type of wettability can be determined with any discrete wavelet. The rbio2.2 wavelet was chosen to extract \(\Delta R_{\rm corr}\) in reservoir B. Figure 10 demonstrates the \(\Delta R_{\rm corr}\) log. Figure 11 illustrates the distribution of \(\Delta R_{\rm corr}\) values. The percentage of negative values (53.15%) was slightly higher than that of positive values (46.85%). Accordingly, reservoir B is slightly oil-wet. This result was derived using the hypothetical rbio2.2 wavelet. By adopting the suitable wavelet, the correct range and frequency of \(\Delta R_{\rm corr}\) were obtained.

Figure 10
figure 10

Reservoir B: wettability \(\left( {\Delta R_{\rm corr} } \right)\) vs. depth

Figure 11
figure 11

Reservoir B: distribution of \(\Delta R_{\rm corr}\) values

In this study, an interval equivalent to the length of the core sample was defined to calculate the \(R_{\rm corr}\) value at each depth. The \(\Delta R_{\rm decorr}\) and \(\Delta R_{\rm corr}\) value vs. depth in reservoirs A and B indicated the in situ wettability, respectively. As the interval increased, \(\Delta R_{\rm decorr}\) (or \(\Delta R_{\rm corr}\)) represented the wettability in the larger depth range.

Conclusions

This research introduced a novel approach for characterizing the in situ wettability of two carbonate reservoirs based on NMR log data and wavelet transform. In this regard, the correlation coefficient between \(T_{2}\) and \(\phi_{\rm NMR}\) was first calculated at each depth. The DWT was then applied to remove the shale content from the correlation coefficient log. The resulting log was referred to as the decorrelated coefficient log. Finally, the DWT was used to extract the detail coefficients from the decorrelated coefficient log. The detail coefficients were strictly consistent with the results of the wettability test. The main findings of this investigation were as follows.

  1. 1.

    The positive and negative detail coefficients obtained from decomposing the decorrelated coefficient log corresponded to water-wet and oil-wet rocks, respectively.

  2. 2.

    There is only a particular wavelet in each reservoir that can accurately yield the wettability log. A sufficient number of laboratory tests have to be implemented to ascertain such a wavelet.