Detailed Description
The present invention will be described in further detail with reference to the following embodiments and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present invention more apparent. The exemplary embodiments of the present invention and the descriptions thereof are used herein to explain the present invention, but are not intended to limit the invention.
As shown in fig. 1 to 11, the embodiment of the invention discloses a method for determining the position of a liquid inlet point by using a hydraulic fracturing water hammer signal, which comprises the following steps:
Firstly, performing fast Fourier transform on an original noisy time domain water hammer signal acquired by a hydraulic fracturing field wellhead, analyzing the frequency f 0 of a main peak of a frequency spectrum of the original noisy time domain water hammer signal, and adaptively setting the upper and lower cut-off frequencies f low and f high of a Gaussian band-pass filter by taking bandwidths adaptively selected from two sides of the main peak as references so as to match signal characteristics under different well conditions and improve subsequent analysis robustness;
filtering the time signal by adopting an alpha-trimmed filter, removing isolated peak noise, and keeping the effective high-frequency and low-frequency components of the water hammer signal at the same time, so as to provide a pure input signal for the next period extraction;
Extracting a period T of the water hammer signal from the time domain filtered signal by using an autocorrelation algorithm, extracting a sample point difference delta k between adjacent significant peaks by using a normalized autocorrelation function and combining a dynamic threshold value and a minimum peak distance, and calculating the period T=delta k/Fs of the water hammer signal according to the sample point difference delta k, and guiding subsequent operation parameter selection by using the period T;
step four, subtracting the average value from the whole output signal of the step two, removing the direct current component, and avoiding the influence of low-frequency leakage on the frequency domain and the cepstrum analysis precision;
step five, based on the period T calculated in the step three, the window length of short-time Fourier transform is adaptively determined, and the window function type (preferably kaiser windows), the overlapping length and the number of Fourier transform points are adaptively determined, so that each analysis window at least covers 2 water-hammer signal periods and retains the important period characteristics of the water-hammer signals;
Step six, calculating magnitude spectrum |S j | for each row S j of the matrix S, carrying out frequency domain filtering on the magnitude spectrum by adopting a Gaussian band-pass filter H (f) with upper and lower cut-off frequencies set in the step one, taking logarithm of the magnitude spectrum after filtering, carrying out inverse Fourier transform and taking the real part of the magnitude spectrum to obtain cepstrum vectors of each window, and splicing the cepstrum vectors of all windows in rows to form a two-dimensional cepstrum matrix C (i, j);
Step seven, summing the cepstrum matrix C (i, j) obtained in the step six according to the rows, selecting the row with the largest energy E i as the position (corresponding to the larger cepstrum positive peak) of the bridge plug signal, then multiplying the difference value by the sampling time interval delta tau and wave velocity v corresponding to the adjacent row index in the cepstrum by the difference value of the corresponding row index between the bridge plug and the liquid inlet point (corresponding to the smaller cepstrum negative peak), completing time-depth conversion, thereby determining the actual depth position of each liquid inlet point, and finally drawing a cepstrum cloud picture, so as to realize the visual display of the bridge plug and the liquid inlet point.
The method comprises the steps of firstly, performing fast Fourier transform on an original noisy time domain water hammer signal, normalizing and extracting a single-side amplitude spectrum, positioning a main peak frequency f 0 in the spectrum, and then respectively obtaining adaptive bandwidths at two sides of the main peak to determine upper and lower cut-off frequencies f low and f high of a Gaussian band-pass filter, so as to complete the determination of parameters of the adaptive Gaussian band-pass filter and prepare for the adaptive frequency domain filtering of a target frequency band in the subsequent step.
And step two, the alpha-trimmed filter is a nonlinear time domain filter, and the nonlinear filter is adopted to remove isolated peaks on the original noise-carrying signal in the time domain without losing the effective frequency component of the water hammer signal. and in each sliding window, the alpha-trimmed filter firstly eliminates the maximum value and the minimum value of the preset proportion (alpha), and then averages the rest samples to be used as output. By adjusting the alpha value, the noise removal depth and the signal fidelity can be flexibly balanced, the noise is degraded into an average filter when alpha is 0, and the noise is degraded into a median filter when alpha reaches the half window length, so that the peak can be removed, the effective high-frequency and low-frequency components of the signal can be well reserved, and clean time domain signal input is provided for the subsequent period extraction.
The autocorrelation algorithm in the third step is a time domain analysis method based on similarity calculation of different delay versions of signals, and the principle is as follows:
First, a normalized autocorrelation function is calculated for the time-domain filtered signal x [ n ]:
Where k is the number of delayed samples, n is the time index, R [ k ] is the normalized autocorrelation function value when delaying k samples, x [ n+k ] is the signal after delaying k samples, and R [0] is the autocorrelation value when delaying zero.
The non-negative delay portion of the autocorrelation function is then truncated to form vector R + [ k ], and a peak search function (e.g., the findpeaks function of MATLAB) is invoked to locate the first two significant peaks k 1 and k 2 on R + [ k ] with 0.5max (R +) as the dynamic threshold and the number of samples corresponding to the signal sampling frequency Fs as the minimum peak distance. Sample point difference delta k=k 2−k1 corresponding to the two peaks is divided by Fs to obtain period T:
wherein T is a signal period, Δk is a sample point difference corresponding to two peaks, and Fs is a signal sampling frequency.
Fig. 2 shows an autocorrelation function diagram and a signal period division schematic diagram of the autocorrelation algorithm of the present invention. The upper graph is an autocorrelation function graph (the horizontal axis is the number of delay samples, the vertical axis is the autocorrelation value), and the lower graph is a signal period division diagram divided according to an autocorrelation algorithm (the horizontal axis is the number of data points, and the vertical axis is the signal amplitude). The autocorrelation extraction method has stronger robustness to random noise and baseline drift, can accurately identify repeated water-hammer pulse periods in a complex noise environment, and the accurately extracted period T is an important basis for short-time Fourier transform parameter self-adaptive setting in the subsequent step five.
And step four, further executing an average value removing operation on the signal subjected to the time domain filtering in the step two. This operation eliminates the dc component or baseline drift by subtracting its average value from the signal sequence. Eliminating the direct current component helps to avoid strong low frequency leakage and false peaks in the subsequent short-time Fourier transform analysis, thereby improving the resolution and accuracy of the frequency domain analysis.
And step five, based on the water hammer signal period T extracted in the step three, adaptively setting all parameters of short-time Fourier transform. Specifically, firstly, determining a window length peak_distance according to an extracted water hammer signal period T, and adaptively setting three parameters of a window function win type, a window overlap length overlap and a Fourier transform point number nfft. The window length peak_distance is selected such that each window covers at least 2 periods and more. The window function win adopts kaiser windows, so that flexible trade-off between main lobe width and side lobe suppression can be realized, and the adjustable shape parameter beta enables side lobe leakage to be obviously reduced while the frequency resolution is highest, and the method is particularly effective to eliminate spectrum aliasing and spectrum leakage. The window overlap length overlap refers to the number of samples that overlap when two adjacent windows slide. Proper overlapping can ensure smooth transition between adjacent windows and avoid losing mutation information due to window segmentation. Fourier transform points nfft represent the transform points used in performing the discrete fourier transform on each window, i.e., performing the zero padding operation on the window. It may be equal to the window length, or may be an integer power greater than the next 2 of the window length or an integer power +1 greater than the next 2 of the window length, with zero padding enabling higher resolution frequency interpolation. Increasing nfft can increase the frequency domain sampling density, making the spectrum smoother and finer, but the corresponding computation increases. In the present invention, according to the experimental results, the integer power of the next 2 greater than the window length is generally taken. The parameter selection ensures enough frequency resolution and anti-aliasing capability, and also considers time domain continuity and calculation efficiency, thereby laying a solid foundation for the subsequent cepstrum matrix construction. In a specific implementation, parameters of short-time Fourier transform mainly comprise input signal data, signal sampling frequency Fs, window function win, window overlap length overlap and Fourier transform point number nfft, and three parameters, namely a frequency domain two-dimensional matrix S, a frequency axis f and a time axis t, are obtained by using the parameters to call a stft function of MATLAB for short-time Fourier transform, so that a foundation is provided for subsequent cepstrum denoising and matrix construction. Specifically:
the stft function that calls MATLAB using these parameters is as follows:
[S, f, t] = stft(data, Fs, ...
'Window', win, ...
'OverlapLength', overlap, ...
'FFTLength', nfft);
The construction mode of using the Gaussian band-pass filter in the sixth step is as follows:
First, defining a frequency coordinate f as:
Where L is the spectral length and Fs is the signal sampling frequency.
Wherein, σ kou is the standard deviation of the Gaussian low-pass filter, σ kou is the standard deviation of the Gaussian high-pass filter, and f low and f high are the upper and lower cut-off frequencies of the Gaussian band-pass filter obtained in the step one.
According to the standard deviation obtained in the above steps, a gaussian low pass filter H low (f) is constructed as follows:
The gaussian high pass filter H high (f) is constructed as:
where θ is a coefficient for adjusting the attenuation degree of the high-pass filter.
The final gaussian bandpass filter H (f) is the product of the gaussian low-pass filter H low (f) and the high-pass filter H high (f):
The cepstrum matrix construction process comprises the steps of calculating magnitude spectrum I S j I of each column S j of a matrix S, carrying out frequency domain filtering on the magnitude spectrum by adopting a Gaussian band-pass filter H (f) with upper and lower cut-off frequencies set in the first step, taking logarithm of the magnitude spectrum after filtering, carrying out inverse Fourier transform and taking a real part of the magnitude spectrum to obtain cepstrum vectors of each window, and splicing the cepstrum vectors of all windows according to columns to form a two-dimensional cepstrum matrix C (i, j), wherein the calculation formula is as follows:
Where row index i represents the time delay on the inverse frequency axis (quefrency), column index j represents the corresponding time window position of the original signal on the time axis, S j represents a certain column of the matrix S, H (f) represents a gaussian bandpass filter, real { is represented by taking the real part, i.e. retaining only the real part of the inverse fourier transform result, IFFT (% is represented by the inverse fourier transform operation, ln (% is) is represented by the natural logarithm operation.
In the seventh step, the positive peak of the cepstrum corresponding to the larger bridge plug and the negative peak of the cepstrum corresponding to the smaller liquid inlet point are based on the wave impedance theory, and according to the wave impedance theory, the medium impedance Z c in the pipeline can be simplified into:
Where ρ is the fluid density, c is the wave velocity, and A is the tube cross-sectional area. The reflection coefficient R at the interface is defined as:
wherein R refers to a reflection coefficient, which represents the change direction and amplitude of energy when the pressure wave is reflected at the medium interface, AndRepresenting the impedance of the medium on both sides of the interface.
When the medium impedance is defined byTo increase to(E.g. a sudden decrease in cross-sectional area at the bridge plug), R > 0, appears as a positive peak in the cepstrum matrix, and when the impedance is changed fromIs reduced to(E.g., an increase in cross-sectional area at the fracture or perforation), R < 0 corresponds to a negative peak in the cepstrum. FIG. 3 shows a cepstrum cloud of the bridge plug signal, since the dielectric impedance at the bridge plug location is determined byTo increase toAccording to the theory of wave impedance reflection, the reflection coefficient R > 0 here, therefore, appears as a significant positive peak in the cepstrum matrix. The positive peak clearly seen in the graph corresponds to the distribution position of the bridge plug signal on the quefrency axis, and the effectiveness of accurately identifying the bridge plug position by the cepstrum analysis method is verified. Fig. 4 shows a bridge plug and a cepstrum cloud of two liquid inlet point signals, wherein the bridge plug position shows positive peaks in the cepstrum due to positive reflection caused by increased impedance (sudden decrease of sectional area), and the two liquid inlet point positions show negative peaks in the cepstrum due to reduced impedance (increase of sectional area) caused by cracks or perforations, and the reflection coefficient R is less than 0. In the figure, positive and negative peaks show clear space separation on quefrency axes, so that the bridge plug and the liquid inlet point can be effectively distinguished in a cepstrum domain, and the actual physical distance can be further calculated through the time interval between peaks, so that the accurate positioning of the liquid inlet point is realized.
Specifically:
first, the cepstral matrices are summed row by row, and the total energy E (i) of the i th row is noted as:
wherein, C (i, j) is the value of the ith row and the jth column in the cepstrum matrix, and N is the column number.
By maximizing all E (i), the row index r b with the greatest energy is determined, corresponding to the position of the bridge reflection:
Wherein argmax (#) is the maximum operation.
The algorithm formula for calculating the relative distance between the bridge plug and the liquid inlet point is as follows:
Where z r is the actual depth corresponding to the feed point, q plug is the known bridge plug depth, Δτ is the sampling time interval, v is the propagation velocity of the pressure wave in the medium, r b is the row index of the bridge plug, and r is the row index of the feed point. The wave velocity v can be derived from the bridge plug position and the signal period T, and the calculation formula is as follows:
where v is the wave velocity, q plug is the known bridge plug depth, and T is the water hammer signal period.
And taking the time vector t as a horizontal axis and the depth vector z r as a vertical axis, and taking the corresponding matrix C (i, j) as a contour map to obtain the accurate mapping between each row and the actual depth on the cepstrum cloud picture. The cepstrum cloud pattern drawing mode used in the seventh step is realized by a contourf method of MATLAB.
For further explanation of the above technical solutions, a specific embodiment of the present invention is provided as a specific example 1 for explanation. The actual data used was from a horizontal well. The well target stratum is positioned in a stratum group, and the well has a well completion depth of 3523.53m (vertical depth)/5640.00 m (inclined depth). The original design fracturing total section length of the well is 1963m, the main section length is 90-98 m, the average section length is 93.5m, and the fracturing section length is 21 sections. In this example, the 15 th hydraulic fracturing water hammer signal is selected for analysis, and the initial bridge plug setting depth is 4512 m, and finally is adjusted to 4227 m. The following is a 15 th stage perforation and bridge plug position data table:
TABLE 1
Table 1 lists the detailed parameters of the 15 th stage fracturing stage for analysis in the examples of the present invention, including bridge plug position, top and bottom depths of each perforation layer, and the like. The final setting depth of the bridge plug is 4227 m, the length of the bridge plug is 87 m, and the bridge plug comprises 12 layers of perforation, and the number of the perforation ranges from 37 layers to 48 layers. Each layer of perforation length is 0.45 m, and the total perforation number is 84.
The original waveform diagram of the hydraulic fracturing water hammer signal collected in the 15 th section is shown in fig. 5. Firstly, performing fast Fourier transform on an original signal of a 15 th-section hydraulic fracturing water hammer signal acquired on site, analyzing and positioning a main peak in a frequency spectrum, and adaptively determining upper and lower cut-off frequencies f low and f high of a Gaussian band-pass filter according to the main peak. As shown in the spectrum distribution diagram of the water hammer signal in fig. 6, the main peak frequency of the signal spectrum is about 0.08 Hz, however, considering that the bridge signal is accompanied by high frequency signal, the upper and lower cut-off frequency f low of the gaussian band-pass filter actually selected in this example is 0.1 hz, and f high is 35 Hz. To reduce the operational burden of subsequent processing and reduce the influence of random noise in the pipeline, the water hammer signal segment with the strongest energy after the pump is stopped is further intercepted for analysis, as shown in fig. 7.
Then, the original noise signal is subjected to alpha-trimmed filtering in the time domain, isolated peak noise is removed, and meanwhile the effective components of the water hammer signal are reserved. The window length of the alpha-trimmed filter is set to be 7, 1 point of each extreme value at two ends is removed in each window, namely the removal proportion alpha is 2/7, and middle effective samples are reserved for averaging, so that the robustness to local noise is improved, and meanwhile, the real waveform change of signals is reserved to the greatest extent. Fig. 8 shows waveform change of the original signal and the time-domain filtered signal in a comparison manner, wherein the upper graph is an unfiltered original signal, the lower graph is a time-domain filtered signal, peak noise is obviously weakened, and the overall waveform of the signal is clearer.
After time domain filtering is completed, the signal is subjected to periodic feature extraction by adopting an autocorrelation algorithm so as to obtain the period T of the water hammer signal. A normalized autocorrelation function is first calculated for the time-domain filtered signal x [ n ] and the non-negative delay component is truncated to form a vector R + [ k ]. Next, with 0.5max (R +) as a dynamic threshold, with the number of samples corresponding to the signal sampling frequency Fs (200 Hz in this example) as a minimum peak distance, a peak search function (findpeaks function of MATLAB is selected) is called to locate the first two significant peaks k 1 and k 2 on R + [ k ], and a sample point difference Δk=k 2 − k1 corresponding to the two is calculated, and the signal period T is calculated by combining the known signal sampling frequency Fs:
In this example, the period T of the water hammer signal extracted based on the autocorrelation algorithm is 11.71 seconds. As shown in fig. 9, the upper graph shows a normalized autocorrelation function curve (the horizontal axis shows the number of delay samples, and the vertical axis shows the autocorrelation value) corresponding to the time-domain filtered signal. The circles mark the detected signal main peak positions, the dashed lines are the periodic demarcations defined by the main peak spacing, the lower graph maps the extracted periodic structure back to the original pressure signal (the horizontal axis is the number of data points and the vertical axis is the signal amplitude), the curves are the processed signal waveforms, the dashed lines mark the "theoretical" start/end positions of each period (from the autocorrelation averaging period) which are used to divide the analysis window without having to precisely align each peak or trough. In this way, the original signal can be divided into a plurality of complete periodic units, and stable periodic references are provided for subsequent short-time Fourier transform parameter setting and cepstrum analysis.
After the period extraction is completed, a de-averaging operation is performed on the time-filtered signal, i.e. its average value is subtracted from the whole signal sequence. Then, based on the aforementioned extracted period t≡11.71 seconds, first, the window length peak_distance is determined according to the extracted water hammer signal period T, and three parameters of the window function win type, the window overlap length overlap, and the fourier transform point number nfft are adaptively set. In this example, the number of sample points corresponding to the period of 11.71 seconds is about 2300 points, and the window length peak_distance is 7200 points so that each analysis window covers a plurality of water hammer periods. In this example, the window function win adopts kaiser windows, so that the best balance can be achieved in terms of eliminating frequency spectrum leakage and achieving good frequency resolution, and the adjustable shape parameter beta is set to 7, so that sidelobe leakage is obviously reduced while the frequency resolution is highest. While in order to preserve more accurate signal period components, the window overlap length is set close to the window length, with the corresponding sliding step size remaining between 64 and 512 points. The fourier transform points nfft are chosen to be greater than the next integer power of 2 of the window length.
After the parameters are set, performing short-time Fourier transform on the time domain signals by utilizing a stft function of MATLAB, thereby obtaining a frequency domain two-dimensional matrix S.
Subsequently, the magnitude spectrum |s j | is calculated for each column of the matrix S, and frequency domain denoising processing is performed using the foregoing adaptively set gaussian band-pass filter (upper and lower cut-off frequencies in this example are f low = 0.1 Hz,fhigh =35 Hz, respectively). Fig. 10 shows the response curve of the gaussian band-pass filter used. And taking the logarithm of each column of the magnitude spectrum after filtering, performing inverse Fourier transform, taking the real part as a cepstrum vector, and finally splicing all window cepstrum vectors according to the columns to construct a two-dimensional cepstrum matrix C (i, j).
After the cepstrum matrix is built, summing the cepstrum matrix according to the rows to obtain total energy E (i) corresponding to each row, and selecting an index of the row with the maximum energy as a bridge plug reflection position. In this example, the pressure wave velocity is calculated as
The difference between the index and the other negative peak position on quefrency axis is multiplied by the sampling time interval delta tau (0.005 s in this example) and the wave velocity v for time-depth conversion. Finally, the actual depth difference between the bridge plug and each liquid inlet point can be obtained, and the accurate positioning of the liquid inlet points is finished according to the actual depth difference. And finally, drawing a cepstrum cloud picture by adopting contourf drawing functions of MATLAB, and realizing visual display of bridge plugs and liquid inlet points.
As shown in fig. 11, the cepstrum cloud chart intuitively shows the distribution condition of the bridge plug and a plurality of liquid inlet points in the depth direction, the cepstrum positive peak position corresponding to the bridge plug corresponds to 4227 m after deep conversion with time, is consistent with the actual bridge plug setting depth in construction, and verifies the accuracy of the method. The 5 fluid feed points are located at depths 4208m, 4201m, 4175m, 4168m, 4157m, respectively, and correspond approximately to perforation locations. The bridge plug and the liquid inlet point signals in the cepstrum cloud picture are clear and distinguishable, the positive and negative peaks are obviously separated, no obvious artifact interference exists in the image, the cepstrum cloud picture has good interpretability and positioning accuracy, and the adaptability and engineering application value of the cepstrum cloud picture under the actual complex working condition of the well site are verified.
The technical means disclosed by the scheme of the invention is not limited to the technical means disclosed by the embodiment, and also comprises the technical scheme formed by any combination of the technical features. It should be noted that modifications and adaptations to the invention may occur to one skilled in the art without departing from the principles of the present invention and are intended to be within the scope of the present invention.