Intelligent inversion method and system for wellbore gas distribution of well overflow based on autoencoder

The intelligent inversion method combining autoencoder and multiphase flow model solves the problem of unpredictable gas distribution in drilling wellbore, realizes real-time high-precision inversion of gas distribution in wellbore, and improves well control safety and the reliability of well control scheme.

CN120579401BActive Publication Date: 2025-11-07CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511080382.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-11-07
Estimated Expiration
2045-08-04

AI Technical Summary

Technical Problem

Existing technologies cannot effectively predict the gas distribution inside the wellbore, leading to untimely gas intrusion monitoring or inappropriate control measures, which can easily cause serious accidents such as well blowouts. Furthermore, traditional measurement methods are greatly affected by downhole high temperature and pressure and signal noise, resulting in large errors.

Method used

The intelligent inversion method for wellbore gas distribution based on autoencoder achieves high-precision simulation and inversion of gas distribution within the wellbore by constructing a multiphase flow transport model and a neural network model, combined with Monte Carlo sampling method, and uses multi-source data such as mud pit increment for real-time prediction.

Benefits of technology

It enables real-time and rapid inversion of gas distribution within the wellbore during drilling overflow, providing reliable information for well control scheme design, improving well control safety and reliability, reducing deployment costs, and offering strong applicability while avoiding the errors and environmental impacts of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120579401B_ABST
    Figure CN120579401B_ABST
Patent Text Reader

Abstract

The present application relates to a drilling overflow wellbore gas distribution intelligent inversion method and system based on an autoencoder, and belongs to the technical field of oil and gas and geothermal development drilling and completion engineering. It comprises the following steps: step 1: accurately solving the multiphase flow parameters of the wellbore; step 2: combining the drilling conditions and geological conditions of a specific overflow high-risk well section, changing 8 parameters based on the Monte Carlo sampling method, and performing uniform sampling to form a high-precision simulation data set; step 3: constructing a neural network model for gas invasion state inversion based on an autoencoder neural network; step 4: training; step 5: standardizing the one-dimensional time series parameters in the monitoring data; inputting into the trained neural network model for gas invasion state inversion based on an autoencoder neural network to obtain the distribution data of the overflow gas in the wellbore within the time period of the current time series parameters. The present application realizes real-time and rapid inversion of the gas distribution in the wellbore during drilling overflow and control.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a drilling overflow wellbore gas distribution intelligent inversion method and system based on an autoencoder, and belongs to the technical field of oil and gas and geothermal development drilling and completion engineering. BACKGROUND

[0002] As an important technical means for humans to obtain underground energy, oil and gas drilling engineering has always been accompanied by high risks and high technical challenges. During the drilling of thousands of meters deep strata, wellbore pressure control is the core technical link to ensure safety. When the dynamic balance between the formation pore pressure, the drilling fluid column pressure and the formation fracture pressure is broken, the formation fluid will invade the wellbore under the action of pressure difference, which is called gas invasion. Once the monitoring is not timely or the control measures are not appropriate after gas invasion, it is easy to cause serious blowout disasters.

[0003] During gas invasion, the gas content distribution in the wellbore is the key basis for the design of well control parameters. This data provides the necessary initial conditions for well killing multiphase flow simulation, and realizes subsequent real-time simulation analysis of well killing multiphase flow. In engineering practice, it mainly relies on human guesswork and can only roughly judge parameters such as gas rising position, but cannot obtain related information about gas distribution. This experience-dependent method has obvious drawbacks: it is easy to cause pressure control failure, repeated well killing, induce secondary gas invasion or lost circulation, and then cause blowout and other serious drilling accidents.

[0004] In the prior art, on the one hand, the gas content in the wellbore can be directly measured by installing a measuring sub on the downhole drill string. However, this method mainly obtains the gas content at a specific single point depth, cannot obtain the gas distribution profile and migration position along the longitudinal direction of the wellbore, and cannot provide key information for subsequent well control disposal; and is affected by high temperature and high pressure downhole, signal transmission noise and other factors, with large measurement error. On the other hand, the drilling wellbore gas content can be obtained by forward prediction through multiphase flow simulation method under the premise of known stratum pressure, permeability, overflow position and other information as boundary conditions, but drilling overflow means that the stratum information is uncertain, and forward prediction cannot be carried out, and a method for real-time inversion of wellbore gas content distribution relying on multi-source logging data has not been reported.

[0005] Therefore, there is a need for an effective method for predicting the gas content distribution in the drilling wellbore. SUMMARY

[0006] In view of the deficiencies of the prior art, the present application provides a drilling overflow wellbore gas distribution intelligent inversion method based on an autoencoder;

[0007] The present application also provides a drilling overflow wellbore gas distribution intelligent inversion system based on an autoencoder.

[0008] The purpose of the application is to build a dataset at the physical modeling level: based on multiphase flow transmission theory, a wellbore gas invasion dynamic model is constructed, and a fully implicit finite difference method is used for high-precision numerical solution. The formation gas production index, drilling fluid displacement and other key parameters are uniformly sampled to simulate the gas invasion evolution process under different formation conditions and drilling parameters, and a gas invasion dataset is established. Then based on this gas invasion dataset, a new gas invasion state prediction method based on autoencoder is proposed, which can predict the annulus gas rate state change of the wellbore in the corresponding time period through a period of mud pit increment, bottom hole pressure and temperature, casing top pressure, annulus top pressure and temperature and flow rate and other logging data. The distribution of wellbore gas rate can be efficiently inverted, and a two-dimensional visual wellbore gas rate spatiotemporal distribution map can be generated, providing reliable information for the design of well killing operation scheme and improving the safety and reliability of well control.

[0009] The technical scheme of the application is:

[0010] The intelligent inversion method for drilling overflow wellbore gas distribution based on autoencoder includes:

[0011] Step 1: accurately solve the parameters of wellbore multiphase flow, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, the pressure and temperature distribution;

[0012] Step 2: combined with the drilling conditions and geological conditions of a specific overflow high-risk well section, based on the Monte Carlo sampling method, change the following 8 parameters including underpressure value, overflow rate, ground drilling fluid density, ground drilling fluid displacement, ground drilling fluid temperature, formation temperature gradient, drilling depth and overflow time, and perform uniform sampling to form a high-precision simulation dataset;

[0013] Step 3: build a neural network model for gas invasion state inversion based on autoencoder neural network;

[0014] Step 4: train the neural network model for gas invasion state inversion based on autoencoder neural network built in step 3;

[0015] Step 5: deploy the constructed neural network model for gas invasion state inversion based on autoencoder neural network, standardize the one-dimensional time series parameters in the monitoring data based on the method in step 2; input the standardized time series parameters into the neural network model for gas invasion state inversion based on autoencoder neural network trained in step 4 to obtain the distribution data of overflow gas in the wellbore in the time period of the current time series parameters.

[0016] According to the present application, a multiphase flow physical model of formation overflow invasion into wellbore during well overflow is established based on the principle of fluid mechanics, which is used for accurate solution of wellbore multiphase flow parameters; the multiphase flow physical model includes continuity equation, momentum conservation equation and energy conservation equation, which are respectively used for solution of gas and drilling fluid migration velocity, phase content, pressure and temperature distribution in wellbore; and the multiphase flow physical model includes:

[0017] The continuity equation includes:

[0018] The gas phase continuity equation is shown as formula (1):

[0019] (1);

[0020] In the formula: A is annular boundary area, m 2 ; α g is gas content in wellbore; p g is gas density, kg / m 3 ; v g is gas flow velocity, m / s; t is time, s; z is depth, m; k M is gas dissolution mass transfer coefficient during multiphase flow; S int is interfacial contact area, m 2 / m; w b is dissolved gas content in drilling fluid, kg / m 3 ; w g is gas solubility in drilling fluid, kg / m 3 ; q g is formation fluid invasion rate, kg / m;

[0021] The continuity equation of drilling fluid phase is shown as formula (2):

[0022] (2);

[0023] In the formula: α l is drilling fluid volume fraction in wellbore; p l is drilling fluid density, kg / m 3 ; v l is drilling fluid flow velocity, m / s;

[0024] Continuity equation for the dissolved gas phase, as shown in equation (3):

[0025] (3);

[0026] wherein: x sol is the mass fraction of the dissolved gas, kg / kg;

[0027] Momentum conservation equation, as shown in equation (4):

[0028] (4);

[0029] wherein: P is the flow pressure, Pa; d c is the equivalent diameter of the annulus, m; g is the gravitational acceleration, m / s 2 ; θ is the inclination angle of the well, rad; f is the friction coefficient; subscript m represents the mixed fluid parameter composed of overflow gas and drilling fluid; p m i.e. the density of the mixed fluid, kg / m 3 ; v m i.e. the flow velocity of the mixed fluid, m / s;

[0030] Energy conservation equation, as shown in equations (5) and (6):

[0031] (5);

[0032] (6);

[0033] wherein: C pg is the specific heat capacity of the gas at constant pressure, C pl is the specific heat capacity of the drilling fluid at constant pressure, J / (kg*℃); C J is the Joule-Thomson coefficient, ℃ / Pa; h e and h g is the enthalpy of the gas per unit mass at the reservoir and the bottom of the well, J / kg; T is the temperature of the annulus fluid, ℃; T f is the temperature of the drilling pipe fluid, ℃; T sris the formation temperature, °C; A' is the comprehensive heat transfer coefficient between the wellbore and the formation, W / (m*℃); B' is the comprehensive heat transfer coefficient between the drill pipe and the annulus, W / (m*℃); Δ H sol is the heat of dissolution of gas in water, J / kg; At is the cross-sectional area of the drill pipe, m 2 ; the continuity equation, the momentum conservation equation and the energy conservation equation in the multiphase flow physical model are solved by using implicit difference method after numerical discretization;

[0034] The input and output parameters of the calculation are as follows:

[0035] The input parameters include: drilling conditions, drilling fluid discharge and physical parameters, well structure, formation fluid invasion rate q g ; the drilling conditions include well depth z , drilling fluid flow rate v L , drilling fluid density p L , formation temperature gradient T t ; different well structures include annular cross-sectional area A , hydraulic diameter d c ;

[0036] The output parameters include: the distribution of gas holdup α g , liquid holdup α L , gas velocity v g , liquid velocity v L , fluid pressure P and fluid temperature T along the well depth, called two-dimensional space-time sequence data;

[0037] The two-dimensional space-time sequence data indirectly includes the following eight one-dimensional time sequence parameters:

[0038] mud pit increment-integral of the difference between the inlet and outlet drilling fluid flow rate with time, bottom hole pressure-pressure at the bottom hole position, bottom hole temperature-temperature at the bottom hole position, standpipe pressure-pressure at the drilling fluid inlet, outlet liquid holdup-volume fraction of the drilling fluid at the ground, outlet pressure-pressure of the drilling fluid at the ground, outlet flow rate-volume fraction of the drilling fluid at the ground, outlet temperature-volume fraction of the drilling fluid at the ground.

[0039] According to the application, preferably, in combination with the drilling conditions and geological conditions of a specific well overflow high-risk section, based on the Monte Carlo sampling method, eight parameters including underpressure value, overflow rate, ground drilling fluid density, ground drilling fluid displacement, ground drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time are changed to perform uniform sampling, overflow simulation, and high-precision simulation data set construction; including:

[0040] Single parameter value: drilling depth, overflow time;

[0041] One-dimensional time sequence: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature;

[0042] Two-dimensional space-time sequence: wellbore gas holdup distribution;

[0043] Standardization processing is performed.

[0044] According to the application, preferably, a neural network model for gas invasion state inversion based on a self-encoder neural network is constructed; including:

[0045] Step 3-1: constructing a symmetric convolutional autoencoder SCAE;

[0046] The symmetric convolutional autoencoder SCAE includes an encoder and a decoder;

[0047] Suppose that the gas invasion state data input into the SCAE is , which is a two-dimensional space-time sequence, the encoder compresses the downhole gas invasion state data to a low-dimensional latent space through multi-layer convolution operation to generate hidden variable ; the decoder reconstructs the decompressed gas invasion data from through multi-layer deconvolution; the specific definitions are as follows:

[0048] (7);

[0049] (8);

[0050] (9);

[0051] (10);

[0052] In the formula, represents the total number of convolution or deconvolution layers, represents the convolution operation, is an activation function; the encoder gradually reduces the spatial dimension by stacking multiple layers of convolution, and finally compresses the data into a low-dimensional vector . This represents the deconvolution (transposed convolution) operation, in the decoder. By gradually restoring the spatial dimensions of the data through deconvolution layers, the final output is reconstructed data of the same size as the input. ; , They represent the first Convolution and deconvolution operations on layers; Indicates the first The input to a convolutional or deconvolutional layer is also the output of the previous layer, i.e., the nth convolutional or deconvolutional layer. The output of a convolutional or deconvolutional layer; , Indicates the first Convolution kernels and bias parameters for layer convolution operations; , Indicates the first Convolution kernel and bias parameters for layer deconvolution operations;

[0053] Step 3-2: Construct a latent variable regression network (LRN);

[0054] Latent Variable Regression Network (LRN) is a feedforward neural network that incorporates a multi-head self-attention mechanism to predict latent variables using logging data. First, features are extracted from the raw logging data using a feedforward neural network. Then, a multi-head attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the correlation weights at different locations in the input. Next, residual connections and layer normalization are combined to alleviate gradient vanishing and stabilize the training process. Finally, a compressed variable matching the latent space dimension of the autoencoder is output. ;

[0055] A further preferred embodiment of step 3-2 includes the following specific implementation process:

[0056] In the process of latent variable regression, a multi-head self-attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the association weights at different positions in the input.

[0057] Well logging time series data First, noise is removed and features are extracted using multiple fully connected layers. The calculation process is expressed as follows:

[0058] (11);

[0059] (12);

[0060] In the formula, This represents the total number of linear layers. Indicates the first The input to a linear layer is also the output of the previous layer, i.e., the first linear layer. The output of the linear layer; , represents the output of the linear layer of the first layer, and the bias parameter of the linear layer of the first represents the output of the linear layer of the first layer operation, represents the operation of the entire feedforward network, that is, the operation of the multi-layer fully connected layer;

[0061] Finally, global dependency modeling and dynamic weight distribution are performed by the multi-head self-attention module;

[0062] (13);

[0063] (14);

[0064] (15);

[0065] (16);

[0066] wherein, represents the operation of the multi-head self-attention mechanism, represents the layer normalization operation; represents the hidden variable result predicted by the LRN; represents the number of heads of the attention head, represents the layer normalization, represents the output projection weight matrix, which linearly combines and maps the output results of multiple attention heads back to the standard feature dimension, completes the final integration and dimension reduction of information; represents the attention output of a single attention head, represents the splicing of matrices; multi-head self-attention projects to space, that is, query, key, and value space, , , is the trainable weight matrix corresponding to the first attention head, which is used to generate Query, Key and Value matrices respectively, and the first attention head obtains Query, Key and Value matrices, that is, , , ; represents the dimension of the key and query vector in each attention head.

[0067] According to the present application, the neural network model of the gas invasion state inversion based on the self-encoder neural network constructed in step 3 is preferably trained; comprising:

[0068] The samples in the dataset, i.e., the high-precision simulation dataset, are divided into training, validation and test datasets;

[0069] The following method is used for model training:

[0070] Step 4-1: training of the symmetric convolutional autoencoder SCAE; the SCAE training stage is unsupervised training, which minimizes the mean square error of the reconstructed output of the input real gas invasion state data and forces the latent variable to encode the key features of the data, ensuring its information integrity, as follows:

[0071] (17);

[0072] Therefore, the gas invasion state data reconstruction loss in the SCAE training stage is

[0073] (18);

[0074] Step 4-2: training of the latent variable regression network LRN; the LRN training stage is supervised training, which minimizes the MSE of the predicted latent variable and the encoder output in the SCAE stage after training to establish a reliable mapping of the LRN input to the latent space, as follows:

[0075] , (19);

[0076] Therefore, the latent variable regression loss in the LRN training stage is

[0077] (20);

[0078] According to the application, the eight one-dimensional time series parameters are obtained by measuring through a parameter measurement system.

[0079] The parameter measurement system comprises:

[0080] a mud pit, drilling fluid, a mud pump input pipeline, a mud pump, a mud pump output pipeline, a standpipe pressure gauge, a drill pipe, a rotary control head, a wellhead cross, an annulus, a drill bit, a formation, a choke manifold input pipeline, a choke manifold, a choke manifold output pipeline, a gas-liquid separator, a gas discharge pipeline, a temperature sensor, a first pressure sensor, a liquid discharge pipeline, a second pressure sensor, and a mass flow meter.

[0081] ​​​Under the driving action of the mud pump, the drilling fluid in the mud pit flows through the mud pump input pipeline, the mud pump, and the mud pump output pipeline into the drill pipe in turn; the standpipe pressure gauge is disposed at the connection between the mud pump output pipeline and the drill pipe to obtain the standpipe pressure in the drilling overflow process in real time;

[0082] The drilling fluid flows downward in the drill pipe, enters the wellbore annulus through the bit water hole, and then flows upward in the annulus; when the formation fluid pressure is greater than the fluid pressure at the bottom of the well, the reservoir gas invades the wellbore under the action of the pressure difference; the invaded gas and the drilling fluid flow upward in the annulus, flow into the choke manifold through the rotating control head discharge pipeline and the choke manifold input pipeline, and then flow into the gas-liquid separator through the choke manifold output pipeline for separation; the separated gas flows out through the gas discharge pipeline, and the separated liquid phase flows out through the liquid discharge pipeline;

[0083] At the bottom of the well, a PWD is installed above the drill bit to measure the bottom hole pressure and temperature in real time; a second pressure sensor and a mass flow meter are installed at the outlet of the liquid discharge pipeline, and a temperature sensor and a first pressure sensor are installed at the outlet of the gas discharge pipeline; the outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature are measured respectively; in addition, a mud pit level gauge is installed in the mud pit to measure the mud pit increment by the change of the mud pit level with time.

[0084] Through the above-mentioned measurement parameter deployment system, eight one-dimensional time series are obtained: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature.

[0085] The intelligent inversion method system for gas distribution in the wellbore during drilling overflow based on the autoencoder includes:

[0086] The wellbore multiphase flow parameter solving module is configured to accurately solve the wellbore multiphase flow parameters, including the migration velocity of the gas and the drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution;

[0087] The model construction and training module is configured to combine the drilling conditions and geological conditions of a specific overflow high-risk well section, change the following eight parameters including underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid displacement, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time, and perform uniform sampling to form a high-precision simulation data set based on the Monte Carlo sampling method; and a neural network model for gas invasion state inversion based on the autoencoder neural network is constructed.

[0088] The constructed neural network model for gas invasion state inversion based on the autoencoder neural network is trained.

[0089] The intelligent inversion module is configured to: deploy the constructed neural network model for gas invasion state inversion based on the autoencoder neural network, standardize one-dimensional time sequence parameters in the monitoring data; input the standardized time sequence parameters into the trained neural network model for gas invasion state inversion based on the autoencoder neural network, and obtain distribution data of overflow gas in the wellbore in a time period in which the current time sequence parameters are located.

[0090] The present application has the following beneficial effects:

[0091] 1. The present application realizes real-time and rapid inversion of gas distribution in the wellbore during the overflow control of the drilling well by using mud pit increment, inlet and outlet flow and other multi-source data, breaks through the difficulty that the gas content and position cannot be directly or indirectly measured in the traditional overflow control process, and can provide important guidance for well killing scheme formulation and well killing disposal.

[0092] 2. The present application is an intelligent inversion method for wellbore gas distribution of drilling overflow based on an autoencoder, which does not change the structure of the existing drilling system and does not depend on the addition of new monitoring devices, and therefore is not affected by factors such as high temperature and high pressure of the formation, environmental noise, has low deployment cost, strong applicability and high precision. BRIEF DESCRIPTION OF DRAWINGS

[0093] Figure 1 is a two-dimensional space-time sequence diagram for wellbore gas distribution;

[0094] Figure 2 is an eight one-dimensional time sequence parameter diagram;

[0095] Figure 3 is an autoencoder (AE) neural network drilling overflow gas distribution inversion diagram;

[0096] Figure 4 is a drilling fluid circulation and parameter measurement system structure diagram;

[0097] Figure 5 is a prediction effect diagram of case one of the present application model for overflow lasting for 30 minutes;

[0098] Figure 6 is a prediction effect diagram of case two of the present application model for overflow lasting for 30 minutes;

[0099] Figure 7 is a prediction effect diagram of case three of the present application model for overflow lasting for 30 minutes;

[0100] Figure 8 is a prediction effect diagram of case four of the present application model for overflow lasting for 30 minutes;

[0101] Figure 9 is a prediction effect diagram of case five of the present application model for overflow lasting for 30 minutes;

[0102] Figure 10 Figure 6 is a schematic diagram of the prediction effect of the model of the present application on the case of overflow lasting for 30 minutes;

[0103] 1: mud pit; 2: drilling fluid; 3: mud pump input pipeline; 4: mud pump; 5: mud pump output pipeline; 6: standpipe pressure gauge; 7: drill pipe; 8: rotary control head; 9: wellhead cross; 10: annulus; 11: drill bit; 12: formation; 13: choke manifold input pipeline; 14: choke manifold; 15: choke manifold output pipeline; 16: gas-liquid separator; 17: gas discharge pipeline; 18: temperature sensor; 19: first pressure sensor; 20: liquid discharge pipeline; 21: second pressure sensor; 22: mass flow meter. DETAILED DESCRIPTION

[0104] The present application is further limited by the following description and examples with reference to the drawings, but is not limited thereto.

[0105] Terminology:

[0106] PWD (Pressure While Drilling) is a real-time downhole pressure monitoring system installed near the drill bit of the drill string. It directly measures the annulus pressure and the pressure inside the drill string through high-precision sensors, and transmits data to the ground in real time through mud pulse or electromagnetic wave.

[0107] Example 1

[0108] The intelligent inversion method for drilling overflow wellbore gas distribution based on autoencoder includes:

[0109] Step 1: accurately solve the parameters of the wellbore multiphase flow, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, the pressure and temperature distribution;

[0110] Step 2: combined with the drilling conditions and geological conditions of a specific overflow high-risk well section, based on the Monte Carlo sampling method, change the following 8 parameters including underpressure value (difference between formation pressure and bottom hole pressure), overflow rate, surface drilling fluid density, surface drilling fluid displacement, surface drilling fluid temperature, formation temperature gradient, drilling depth, overflow time, and perform uniform sampling to form a high-precision simulation data set;

[0111] Step 3: build a neural network model for gas invasion state inversion based on autoencoder neural network;

[0112] Step 4: train the neural network model for gas invasion state inversion based on autoencoder neural network built in step 3;

[0113] Step 5: The constructed neural network model of the gas invasion state inversion based on the self-encoder neural network is deployed, combined with the actual overflow monitoring data, and based on the method in step 2, the one-dimensional time series parameters in the monitoring data are standardized; the standardized time series parameters are input into the neural network model of the gas invasion state inversion based on the self-encoder neural network trained in step 4, to obtain the distribution data of the overflow gas in the wellbore in the time period in which the current time series parameters are located. Real-time evaluation of the wellbore gas distribution is realized.

[0114] Example 2

[0115] The intelligent inversion method for drilling overflow wellbore gas distribution based on a self-encoder according to example 1, differs in that:

[0116] Based on the principle of fluid mechanics, a multiphase flow physical model of the formation overflow invading the wellbore during drilling overflow is established, which is used for accurate solution of the multiphase flow parameters in the wellbore; the multiphase flow physical model includes continuity equation, momentum conservation equation and energy conservation equation, which are used to solve the migration velocity, phase content, pressure and temperature distribution of gas and drilling fluid in the wellbore, respectively; including:

[0117] During the construction of the physical model, the invading fluid is considered to migrate in the form of free gas and dissolved gas, and the main physical control equation includes but is not limited to the following form:

[0118] The continuity equation includes:

[0119] The gas phase continuity equation is shown in formula (1):

[0120] (1);

[0121] In the formula: A is the annulus area, m 2 ; α g is the gas holdup in the wellbore; p g is the gas density, kg / m 3 ; v g is the gas flow velocity, m / s; t is the time, s; z is the depth, m; k M is the dissolution mass transfer coefficient of gas during multiphase flow; S int is the interfacial area, m 2 / m; w b is the content of dissolved gas in the drilling fluid, which is obtained according to the wellbore multiphase flow simulation, kg / m 3 ;w g is the solubility of gas in the drilling fluid, kg / m 3 ; q g is the invasion rate of the formation fluid, kg / m;

[0122] the continuity equation for the drilling fluid phase, as shown in equation (2):

[0123] (2)

[0124] where: α l is the volume fraction of the drilling fluid in the wellbore; p l is the density of the drilling fluid, kg / m 3 ; v l is the flow velocity of the drilling fluid, m / s;

[0125] the continuity equation for the dissolved gas phase, as shown in equation (3):

[0126] (3)

[0127] where: x sol represents the mass fraction of the dissolved gas, kg / kg;

[0128] the momentum conservation equation, as shown in equation (4):

[0129] (4)

[0130] where: P is the flow pressure, Pa; d c is the annular equivalent diameter, m; g is the gravitational acceleration, m / s 2 ; θ is the inclination angle, rad; f is the friction coefficient; subscript m represents the mixed fluid parameter composed of overflow gas and drilling fluid; p m i.e., the density of the mixed fluid, kg / m 3 ; v m i.e., the flow velocity of the mixed fluid, m / s;

[0131] the energy conservation equation, as shown in equations (5) and (6):

[0132] (5)

[0133] (6);

[0134] wherein: C pg Cpg is the gas specific heat at constant pressure, J / (kg*℃) ; C pl Cpfl is the drilling fluid specific heat at constant pressure, J / (kg*℃) ; C J J-T coefficient, ℃ / Pa; h e and h g Hg is the gas enthalpy per unit mass at the reservoir and the bottom hole, J / kg; T Tann is the temperature of the annular fluid, ℃; T f Tdf is the temperature of the drill pipe fluid, ℃; T sr Tg is the formation temperature, ℃; A' is the comprehensive heat exchange coefficient between the wellbore and the formation, W / (m*℃) ; B' is the comprehensive heat exchange coefficient between the drill pipe and the annulus, W / (m*℃) ; Δ H sol Hfg is the heat of dissolution of the gas in water, J / kg; At is the cross-sectional area of the drill pipe, m 2 The continuity equation, the momentum conservation equation and the energy conservation equation in the multiphase flow physical model are solved by using implicit difference method after numerical discretization.

[0135] The input and output parameters of the calculation are as follows:

[0136] The input parameters include drilling conditions, drilling fluid discharge and physical parameters, well structure, formation fluid invasion rate q g The drilling conditions include well depth z , drilling fluid flow rate v L , drilling fluid density p L , formation temperature gradient T t The different well structures include annular cross-sectional area A , hydraulic diameter d c ;

[0137] The output parameters include gas holdup at different times in the wellbore α g , liquid holdup α L , gas velocity v g , liquid velocity v L , fluid pressure P and fluid temperature TDistribution along the well depth, referred to as two-dimensional spatiotemporal sequence data;

[0138] The two-dimensional spatiotemporal sequence data indirectly includes the following eight one-dimensional time sequence parameters:

[0139] Mud pit increment - integral of the difference between the inlet and outlet drilling fluid flow rates over time, bottom hole pressure - pressure at the bottom hole location, bottom hole temperature - temperature at the bottom hole location, standpipe pressure - pressure at the drilling fluid inlet, outlet liquid holdup - drilling fluid volume fraction at the ground (0 m well depth), outlet pressure - drilling fluid pressure at the ground (0 m well depth), outlet flow rate - drilling fluid volume fraction at the ground (0 m well depth), outlet temperature - drilling fluid volume fraction at the ground (0 m well depth). The above eight one-dimensional time sequence parameters are all measurable parameters in actual drilling engineering, and are obtained by the method in step 5.

[0140] Wherein the two-dimensional spatiotemporal sequence of the wellbore gas distribution is as shown in Figure 1 , and the eight one-dimensional time sequence parameters are as shown in Figure 2 .

[0141] Discretize the wellbore multiphase flow model in step 1 according to a certain time and space step and perform iterative solution, first set an initial pressure value for the pressure node to be solved, substitute the initial value into the equation set to obtain the related parameters; use the flow model to calculate the pressure of the node to be solved, then compare the calculated pressure with the initial value; when the absolute value of the difference falls within the preset error tolerance range , it is determined that the node calculation converges, and the method can be used to proceed to the next node; if the deviation exceeds the tolerance range, the initial pressure value needs to be re-assigned for the node, and the calculation steps are repeated until the convergence condition is met;

[0142] The specific steps are as follows:

[0143] (1) Input parameters;

[0144] (2) At the calculation starting time t=t 0 = 0, take the wellhead as the starting point to calculate the pressure , velocity and related fluid property parameters of each node;

[0145] (3) According to the flow rate of the bottom hole node and the preset grid element length, determine the time step Δ t 0 ;

[0146] (4) For the bottom hole location of the first time node t 1 =t 0 + Δ t 0 , preset its pressure value and calculate the gas solubility, velocity parameter and fluid property parameter at the node based on the pressure value;

[0147] (5) Set the pressure value of the current node (1, 1) as the pressure of the first time and the first space node, i.e. , and calculate the gas solubility, velocity parameter and fluid property parameter at the node;

[0148] (6) According to the mass conservation (continuity equation), set the gas phase volume fraction at (1, 1) as , and calculate the apparent gas phase and liquid phase velocities at the node , , and then obtain the gas phase volume fraction at the node based on the velocity equation ;

[0149] (7) If , then is valid, otherwise, it needs to be re-assumed and repeated from step (6);

[0150] (8) Substitute the determined and related parameters into the momentum equation to calculate the pressure at (1, 1) ;

[0151] (9) If , then is valid, otherwise, it needs to be re-assumed and repeated from step (5) to step (9) until the condition is met;

[0152] (10) Set the final solved pressure of the current node as the known pressure of the next adjacent node, and repeat the above calculation until all space nodes in the time layer are calculated. After the calculation of the space node sequence from the bottom to the top of the well is completed, if the absolute value of the difference between the calculated wellhead pressure and the atmospheric pressure meets the accuracy requirement, then is valid, otherwise, it needs to be re-assumed and repeated from step (4) to step (10) until the condition is met;

[0153] At this point t , the calculation of all space nodes at time point 1 is completed and verified, and these results become the starting input (initial condition) for the calculation of the next time layer (time point 2). In this way, the calculation can be gradually advanced to t time points 3,..., and finally all flow field parameters in the entire time-space domain are obtained. t t n

[0154] For the time point ​​denotes the value of the parameter at the i th time node and the j th space node after discretization of the parameter, the parameters in the brackets are taken from some discretized parameter in the above formula, assuming n time nodes and m space nodes in total, so 、 ; denotes the result calculated by the assumed value, which needs to be judged for validity.

[0155] The migration velocity, phase content, pressure and temperature distribution of gas and drilling fluid in the wellbore are respectively 、 、 、 、 and .

[0156] In combination with the drilling conditions and geological conditions of a specific well section at high risk of overflow, based on the Monte Carlo sampling method, 8 parameters including underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid displacement, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time are changed for uniform sampling, optionally, 5000 times of sampling is performed to generate 5000 different drilling overflow simulation cases, overflow simulation is performed to form a high-precision simulation data set, including:

[0157] Each case is composed of the following parameters:

[0158] Single parameter value (measurable): drilling depth, overflow time;

[0159] One-dimensional time series (measurable): mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, outlet temperature;

[0160] Two-dimensional space-time sequence (needs to be obtained by inversion): wellbore gas holdup distribution;

[0161] After obtaining the exact 8 values of each case by sampling, in combination with the drilling conditions and geological conditions of a specific well section at high risk of overflow, the results (single parameter value, one-dimensional time series, and two-dimensional space-time sequence) are obtained after overflow simulation, wherein “measurable” and “needs to be obtained by inversion” indicate that in the actual drilling process, the data of single parameter value and one-dimensional time series can be obtained by measurement, while the data of two-dimensional space-time sequence cannot be measured and needs to be obtained by inversion after establishing a model.

[0162] Among them, the single parameter value and the one-dimensional time series are input data of the overflow gas distribution intelligent inversion model in step 3, and the two-dimensional space-time sequence is output data.

[0163] Since the simulation time and simulation well depth of each case well data are different, standardization processing is performed. Among them, 8 time series parameters such as mud pit increment, bottom hole pressure, bottom hole temperature, inlet pressure, outlet liquid holdup, outlet pressure, outlet flow rate and outlet temperature are valued at the same time interval. Preferably, the parameter points of one-dimensional time series are 301. That is, the time interval = overflow time / 300. For example, if the overflow time is 30 min, the time interval is 6 s.

[0164] By the same method, the two-dimensional space-time sequence of the wellbore gas holdup is an equal-length two-dimensional matrix. Considering the balance between the prediction accuracy and timeliness of the method, the dimension is set to 100*100, that is, the time domain (0s-overflow time) and the space domain (0m-well depth) are respectively interpolated to 100 nodes.

[0165] The neural network model for gas invasion state inversion based on the self-encoder neural network is constructed; including:

[0166] Based on the high-precision simulation data set constructed in step 2, the prediction result is the space-time distribution of the wellbore gas holdup, that is, the visualization image of the wellbore annular gas holdup changing with time, the accuracy is 100*100, and the horizontal axis of the image is the time step dimension and the vertical axis is the space step dimension.

[0167] The present application models the space-time data of the wellbore annular gas holdup changing with time as a single-channel image (horizontal axis is time step and vertical axis is space well depth), and processes it by using a convolutional neural network (CNN), which can capture the coupling characteristics of time and space through local convolution kernels, thereby realizing efficient modeling of the gas diffusion dynamics. Compared with traditional time series models such as LSTM, CNN avoids error accumulation through image input, supports full space-time synchronous output, and obtains more accurate prediction results.

[0168] On the other hand, the significant difference between the input and output dimensions of this gas invasion state image task poses a serious challenge to traditional end-to-end deep learning models. If an end-to-end high-dimensional mapping model is directly constructed, training may lead to large consumption of computing resources, especially in the reverse propagation process, and high-dimensional space gradient back propagation may easily lead to difficulty in model convergence.

[0169] The present application adopts a phased modeling strategy to solve the above difficulties: first, a feature compression technology is used to learn a low-dimensional representation of the gas invasion state image, and a latent space mapping relationship is constructed; then a neural network from logging data to a low-dimensional representation space is established. The strategy decouples the space-time features, and decomposes the original high-dimensional image prediction task into two sub-problems of feature compression and low-dimensional regression. The designed deep neural network model is as follows: Figure 3The architecture consists of two modules: symmetric convolutional autoencoder (SCAE) and latent variable regression network (LRN), which solve two sub-problems respectively. The SCAE learns the efficient low-dimensional feature representation of the real gas invasion state data, i.e., the latent variable, by compressing and reconstructing the data, and the LRN is responsible for learning the mapping relationship between the logging data and the latent variable.

[0170] Step 3-1: Constructing a symmetric convolutional autoencoder SCAE;

[0171] The symmetric convolutional autoencoder SCAE is based on the traditional autoencoder architecture, which adopts a mirror-symmetric encoder and decoder. The encoder is composed of multiple layers of convolution, which gradually compresses the spatial dimensions of the input data and extracts high-level features. The decoder is composed of corresponding layers of deconvolution, which gradually recovers the spatial information and reconstructs the original input. The network depth, convolution kernel size and step length of the encoder and decoder are strictly symmetrical, ensuring the structural consistency of the feature dimension reduction and data reconstruction process.

[0172] The symmetric convolutional autoencoder SCAE includes an encoder and a decoder;

[0173] Assuming that the gas invasion state data input into the SCAE is i.e., a two-dimensional spatiotemporal sequence (channel number is 1) (height, width, channel number), the encoder compresses the downhole gas invasion state data to a low-dimensional latent space through multiple layers of convolution operation, generating the latent variable The decoder then reconstructs the decompressed gas invasion data from through multiple layers of deconvolution. The specific definition is as follows:

[0174] (7);

[0175] (8);

[0176] (9);

[0177] (10);

[0178] In the formula: represents the total number of convolution or deconvolution layers, represents the convolution operation, is an activation function; the encoder reduces the spatial dimension step by step by stacking multiple layers of convolution, and finally compresses the data into a low-dimensional vector . represents the deconvolution (transpose convolution) operation, and the decoder recovers the data spatial dimension step by step through the deconvolution layer, and finally outputs the reconstructed data with the same size as the input . , denote the convolution and deconvolution operation of the i-th layer, respectively; denote the convolution and deconvolution operation of the i-th layer, respectively; denote the input of the i-th layer convolution or deconvolution, which is also the output of the previous layer, i.e. the output of the i-th layer convolution or deconvolution; denote the input of the i-th layer convolution or deconvolution, which is also the output of the previous layer, i.e. the output of the i-th layer convolution or deconvolution; denote the convolution kernel and bias parameters of the i-th layer convolution operation; denote the convolution kernel and bias parameters of the i-th layer convolution operation; denote the convolution kernel and bias parameters of the i-th layer deconvolution operation; denote the convolution kernel and bias parameters of the i-th layer deconvolution operation; denote the convolution kernel and bias parameters of the i-th layer deconvolution operation; Step 3-2: Constructing the latent variable regression network LRN;

[0179] The latent variable regression network LRN is a feedforward neural network combined with a multi-head self-attention mechanism, which is used to predict the latent variable from the logging data; first, the original logging data is feature extracted by the feedforward neural network; then, the multi-head attention mechanism is introduced to dynamically calculate the correlation weight of different positions in the input, and to adaptively aggregate the global information; then, the residual connection and layer normalization are connected to alleviate the gradient disappearance and stabilize the training process, and finally, the compressed variable

[0180] matching the dimension of the autoencoder latent space is outputted. The specific implementation process of step 3-2 includes:

[0181] In the latent variable regression process, the multi-head self-attention mechanism is introduced to dynamically calculate the correlation weight of different positions in the input, and to adaptively aggregate the global information.

[0182] Logging time series data The eight types of processed time series data obtained in the logging process include: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature. First, the noise is stripped and the features are extracted by multiple fully connected layers

[0183] , and the calculation process is represented as: (11);

[0184] (12);

[0185] (12);

[0186] wherein, denotes the total number of linear layers, denotes the input of the i-th linear layer, which is also the output of the previous layer, i.e. the output of the i-th linear layer; denotes the input of the i-th linear layer, which is also the output of the previous layer, i.e. the output of the i-th linear layer; denotes the input of the i-th linear layer, which is also the output of the previous layer, i.e. the output of the i-th linear layer; ,​ denotes the operation of the linear layer, the weight matrix and bias parameter of the linear layer; denotes the operation of the linear layer, denotes the operation of the entire feedforward network, i.e., the multi-layer fully connected layers;

[0187] Finally, global dependency modeling and dynamic weight distribution are performed by the multi-head self-attention module; the accuracy of the predicted hidden variable is improved, so that the decoder generates higher-quality gas invasion state data:

[0188] (13);

[0189] (14);

[0190] (15);

[0191] (16);

[0192] wherein, denotes the operation of the multi-head self-attention mechanism, denotes the layer normalization operation; denotes the hidden variable result predicted by the LRN; denotes the number of heads of the attention head, denotes the layer normalization, denotes the output projection weight matrix, which linearly combines and maps the output results of multiple attention heads back to the standard feature dimension, completes the final integration and dimension reduction of information; denotes the attention output of a single attention head, denotes the concatenation of matrices; multi-head self-attention projects to space, i.e., query (Query), key (Key), and value (Value) space, , , is the trainable weight matrix corresponding to the i-th attention head, which is used to generate Query, Key, and Value matrices, respectively; the Query, Key, and Value matrices obtained by the i-th attention head, i.e., , , , ; denotes the dimension of the key and query vector in each attention head.

[0193] ​training the neural network model of the gas invasion state inversion based on the self-encoder neural network constructed in step 3; comprising:

[0194] Before model training, the samples in the high-precision simulation data set are divided into training, validation and test data sets: the training data set is used for neural network model parameter calibration, the model training is calculated by forward propagation, and the model parameters are updated by back propagation. This process is iterated several times until the model converges. The validation data set dynamically controls the training process through the early stopping mechanism (Early Stopping) - this mechanism automatically terminates training when it detects that the validation loss has not improved continuously, and rolls back to the optimal weight state, so as to stop training before overfitting occurs, and reduce invalid calculations; the test data set is used for final blind evaluation.

[0195] The following method is used for model training: training also adopts a two-stage training method, SCAE training stage and LRN training stage. Both stages use Adam optimizer and variable learning rate strategy: when the validation loss has not been further improved for 10 consecutive epochs, the current learning rate is multiplied by 0.1 to adjust, so that the learning rate can change dynamically according to the training of the model, avoiding the convergence problem caused by too large or too small learning rate. In addition, the early stopping mechanism is set in the validation stage. When the validation loss has not reached the optimal value in the last 50 validation processes, it is determined that the model may have overfitting or convergence stagnation, at which time the training process will be automatically terminated to avoid unnecessary waste of computing resources.

[0196] Step 4-1: training of symmetric convolutional autoencoder SCAE; the SCAE training stage is unsupervised training, which minimizes the mean square error (MSE) of the reconstructed output of the input real gas invasion state data The hidden variable encodes the key features of the data to ensure its information integrity, as follows:

[0197] (17);

[0198] Therefore, the gas invasion state data reconstruction loss of the SCAE training stage is:

[0199] (18);

[0200] Step 4-2: training of hidden variable regression network LRN; the LRN training stage is supervised training, which minimizes the MSE of the predicted hidden variable and the encoder output in the SCAE stage after training , to establish a reliable mapping of LRN input to hidden space, as follows:​

[0201] , (19);

[0202] The hidden variable regression loss of the LRN training stage is:

[0203] (20);

[0204] The present application adopts the following method for model prediction and evaluation.

[0205] Model prediction. After the model is trained in step 4-1, only the two core components of the decoder of LRN and SCAE are retained, and the input data is directly mapped to the target output through an end-to-end process to predict the result without relying on the encoder module. Its mathematical formalization is expressed as:

[0206] ;

[0207] After the model is trained, the model performance needs to be verified in the test set. The evaluation of the visualization image of the annulus gas rate data changing with time and space mainly comes from two aspects, one is the pixel level error MSE, and the other is the image feature level error SSIM. In order to comprehensively evaluate the performance of the gas channeling state prediction model, the mean squared error (Mean Squared Error, MSE) and the structural similarity index (Structural Similarity Index, SSIM) are used as the core evaluation indexes, and the differences between the model output and the real data are quantified from two dimensions of pixel level numerical accuracy and spatial structure consistency. The MSE is defined as the arithmetic mean of the mean squared error of each pixel point of the predicted image and the real image:

[0208] ;

[0209] In the formula: and respectively represent the true value and the predicted value, is the total number of image pixels. This index directly reflects the prediction deviation of the gas channeling intensity value, but it is not sensitive to spatial structure displacement. Therefore, the SSIM is introduced to evaluate the global structural similarity of the image, which measures the spatial distribution consistency through the weighted product of brightness, contrast and structure:

[0210] ;

[0211] In the formula: , respectively represent the image mean and standard deviation, is the covariance,​ is the stability constant. When the SSIM value tends to 1, it indicates that the predicted image is highly consistent with the spatial form of the real gas invasion distribution.

[0212] 8 one-dimensional time series parameters are obtained by measuring parameter deployment system, as shown in the following table: Figure 4

[0213] The measuring parameter deployment system comprises:

[0214] mud pit 1, drilling fluid 2, mud pump input pipeline 3, mud pump 4, mud pump output pipeline 5, standpipe pressure gauge 6, drill pipe 7, rotary control head 8, wellhead cross 9, annulus 10, drill bit 11, formation 12, choke manifold input pipeline 13, choke manifold 14, choke manifold output pipeline 15, gas-liquid separator 16, exhaust pipeline 17, temperature sensor 18, first pressure sensor 19, liquid discharge pipeline 20, second pressure sensor 21, mass flow meter 22;

[0215] Under the driving action of the mud pump 4, the drilling fluid 2 in the mud pit 1 flows through the mud pump input pipeline 3, the mud pump 4, and the mud pump output pipeline 5 into the drill pipe 7 in turn; the standpipe pressure gauge 6 is disposed at the connection between the mud pump output pipeline 5 and the drill pipe 7, and real-time standpipe pressure during the drilling overflow process is obtained;

[0216] The drilling fluid 2 flows in the drill pipe 7 from top to bottom, enters the wellbore annulus 10 through the drill bit 11 water hole; when the formation 12 fluid pressure is greater than the bottom hole fluid pressure, the reservoir gas invades the wellbore from the formation 12 under the action of the pressure difference; the invaded gas and the drilling fluid 2 flow from bottom to top in the annulus 10, are discharged through the rotary control head 8 discharge pipeline, enter the choke manifold 14 through the choke manifold input pipeline 13, and then flow into the gas-liquid separator 16 through the choke manifold output pipeline 15 for separation; the separated gas flows out from the exhaust pipeline 17, and the separated liquid phase flows out from the liquid discharge pipeline 20;

[0217] At the bottom hole, the PWD is installed above the drill bit 11 to measure the bottom hole pressure and bottom hole temperature in real time; at the outlet of the liquid discharge pipeline, the second pressure sensor 21 and the mass flow meter 22 are installed, and at the outlet of the exhaust pipeline 17, the temperature sensor 18 and the first pressure sensor 19 are installed; the outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature are measured respectively; in addition, the mud pit liquid level meter is installed in the mud pit 1, and the mud pit increment is measured by the change of the mud pit 1 liquid level with time.

[0218] ​Through the above deployed measurement system, 8 one-dimensional time series are obtained: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature. Then, taking the initial moment of overflow occurrence as the 0 moment, the time series parameters are standardized based on the method in step 2. Then, the standardized time series parameters are substituted into the overflow gas distribution intelligent inversion model trained by the method in step 4 to obtain the distribution of the gas in the wellbore at the current moment.

[0219] A well with a depth of 8570 meters is predicted, and 1000 groups of parameter samples are sampled according to the ranges in Table 1 by the method in step 3. Then, based on the model established in step 1, each group of sampled parameters is solved according to the solving method in step 2, and the results are processed into a data set.

[0220] Table 1: Sampling parameter table

[0221]

[0222] Then, the data set is divided into a training set, a validation set, and a test set according to a ratio of 6:2:2, and the model is trained and predicted by the method in step 4. In the two-stage training process, after 326 epochs, the SCAE training stage triggers the early stopping mechanism, and the training loss decreases from the initial 4.51x10 −3 to 3.33x10 −5 , and the validation loss converges to 3.31x10 −5 . The LRN training stage is terminated due to the stagnation of the validation loss at 295 epochs according to the early stopping mechanism. The training loss steadily decreases to 2.97x10 −1 , and the validation loss is as low as 6.62x10 −1 . The mean square error (MSE) index value of the finally trained model on the test set is 1.610x10 −4 , and the structural similarity index (SSIM) index value is 0.957.

[0223] Figure 5 Fig. 1 is a prediction effect diagram of a case one of the model of the present application for overflow lasting for 30 minutes; Figure 5 wherein a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface with the real result; the red line represents the comparison of the predicted gas invasion upper interface with the real result; Figure 6 Fig. 2 is a prediction effect diagram of a case two of the model of the present application for overflow lasting for 30 minutes; Figure 6 wherein a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface with the real result; the red line represents the comparison of the predicted gas invasion upper interface with the real result; Figure 7Fig. 3 is a schematic diagram of the prediction effect of the model of the present application on case three of overflow lasting for 30 minutes; Figure 7 In the figure, a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface on the real result; the red line represents the comparison of the predicted gas invasion upper interface on the real result; Figure 8 Fig. 4 is a schematic diagram of the prediction effect of the model of the present application on case four of overflow lasting for 30 minutes; Figure 8 In the figure, a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface on the real result; the red line represents the comparison of the predicted gas invasion upper interface on the real result; Figure 9 Fig. 5 is a schematic diagram of the prediction effect of the model of the present application on case five of overflow lasting for 30 minutes; Figure 9 In the figure, a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface on the real result; the red line represents the comparison of the predicted gas invasion upper interface on the real result; Figure 10 Fig. 6 is a schematic diagram of the prediction effect of the model of the present application on case six of overflow lasting for 30 minutes; Figure 10 In the figure, a represents the real gas rate distribution, b represents the predicted gas rate distribution, and c represents the comparison of the predicted gas invasion upper interface on the real result; the red line represents the comparison of the predicted gas invasion upper interface on the real result;

[0224] In the actual drilling process, the gas distribution at different times in the wellbore shows great differences under the comprehensive influence of many factors such as drilling fluid displacement, gas invasion rate, etc. However, through detailed comparison of the prediction results obtained by the model constructed by the present application with the actual observation, it is found that the model is basically consistent with the actual situation in the prediction of the gas migration interface and the grasp of the general distribution of gas in the wellbore. This result verifies the effectiveness and reliability of the model in dealing with complex scenarios.

[0225] Example 3

[0226] The intelligent inversion method system for wellbore gas distribution based on the self-encoder drilling overflow comprises:

[0227] The wellbore multiphase flow parameter solving module is configured to accurately solve the wellbore multiphase flow parameters, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, the pressure and temperature distribution;

[0228] The model construction and training module is configured to: in combination with the drilling conditions and the geological conditions of a specific overflow high-risk well section, change the following 8 parameters including the underpressure value (the difference between the formation pressure and the bottom hole pressure), the overflow rate, the ground drilling fluid density, the ground drilling fluid displacement, the ground drilling fluid temperature, the formation temperature gradient, the drilling depth and the overflow time based on the Monte Carlo sampling method to perform uniform sampling and construct a high-precision simulation data set; and construct a neural network model of gas invasion state inversion based on a self-encoder neural network.

[0229] The constructed neural network model of gas invasion state inversion based on the self-encoder neural network is trained.

[0230] The intelligent inversion module is configured to: deploy the constructed neural network model of gas invasion state inversion based on the self-encoder neural network, normalize the one-dimensional time series parameters in the monitoring data in combination with the actual overflow monitoring data; input the normalized time series parameters into the trained neural network model of gas invasion state inversion based on the self-encoder neural network to obtain the distribution data of the overflow gas in the wellbore in the time period in which the current time series parameters are located. Real-time evaluation of the wellbore gas distribution is realized.

Claims

1. An intelligent inversion method for wellbore gas distribution during well overflow based on an autoencoder, characterized in that, Comprising: Step 1: accurately solving the wellbore multiphase flow parameters, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, the pressure and temperature distribution; Step 2: combining the drilling conditions and geological conditions of a specific overflow high-risk well section, based on the Monte Carlo sampling method, changing the following 8 parameters including underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid displacement, surface drilling fluid temperature, formation temperature gradient, drilling depth, overflow time, uniform sampling, and constructing a high-precision simulation data set; Step 3: constructing a neural network model for gas invasion state inversion based on an autoencoder neural network; Step 4: training the neural network model for gas invasion state inversion based on the autoencoder neural network constructed in step 3; Step 5: deploying the constructed neural network model for gas invasion state inversion based on the autoencoder neural network, standardizing the one-dimensional time series parameters in the monitoring data based on the method in step 2; inputting the standardized time series parameters into the neural network model for gas invasion state inversion based on the autoencoder neural network trained in step 4, and obtaining the distribution data of overflow gas in the wellbore in the time period of the current time series parameters; constructing a neural network model for gas invasion state inversion based on an autoencoder neural network; comprising: Step 3-1: constructing a symmetric convolutional autoencoder SCAE; The symmetric convolutional autoencoder SCAE includes an encoder and a decoder; Assume that the gas invasion state data input into the SCAE is That is, a two-dimensional space-time sequence. The encoder compresses the downhole gas invasion state data to a low-dimensional latent space by multi-layer convolution operation to generate hidden variables The decoder reconstructs the decompressed gas invasion data from z by multi-layer deconvolution The specific definitions are as follows: In the formula: l represents the total number of convolution or deconvolution layers, * represents the convolution operation, and σ(·) is an activation function; the encoder Encoder gradually reduces the spatial dimension by stacking multiple convolution layers, and finally compresses the data into a low-dimensional vector z; represents the deconvolution operation, and the decoder Decoder gradually recovers the spatial dimension of the data by deconvolution layers, and finally outputs reconstructed data with the same size as the input respectively represent the convolution and deconvolution operations of the lth layer; H (l-1) represents the input of the lth layer convolution or deconvolution, which is also the output of the previous layer, i.e., the output of the (l-1)th layer convolution or deconvolution; represents the convolution kernel and bias parameters of the lth layer convolution operation; represents the convolution kernel and bias parameters of the lth layer deconvolution operation; Step 3-2: constructing a latent variable regression network LRN; Latent Variable Regression Network (LRN) is a feedforward neural network that incorporates a multi-head self-attention mechanism to predict latent variables using well logging data. First, features are extracted from the raw logging data using a feedforward neural network. Then, a multi-head attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the correlation weights at different locations in the input. Next, residual connections and layer normalization are combined to alleviate gradient vanishing and stabilize the training process. Finally, a compressed variable matching the latent space dimension of the autoencoder is output. The input data of the neural network model for gas invasion state inversion based on the autoencoder neural network is a single parameter value and a one-dimensional time series, and the output data is a two-dimensional space-time sequence; The single parameter value includes: drilling depth, overflow time; The one-dimensional time series includes: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, outlet temperature; The two-dimensional space-time sequence includes: wellbore gas holdup distribution.

2. The self-encoder based drilling kick wellbore gas distribution intelligent inversion method of claim 1, wherein, Based on the principle of fluid mechanics, a multiphase flow physical model is established for the overflow invasion of the formation into the wellbore during drilling overflow, which is used to accurately solve the wellbore multiphase flow parameters; the multiphase flow physical model includes continuity equation, momentum conservation equation and energy conservation equation, which are used to solve the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, the pressure and temperature distribution; comprising: The continuity equation includes: The gas phase continuity equation is shown as formula (1): where: A is the annular cross-sectional area, m 2 ; a g is the gas fraction within the wellbore; p g is the gas density, kg / m 3 ; v g is the gas flow velocity, m / s; t is time, s; z is depth, m; k M is the gas solubility mass transfer coefficient during multiphase flow; S int is the interfacial contact area, m 2 / m; w b is the dissolved gas content in the drilling fluid, kg / m 3 ; w g is the solubility of the gas in the drilling fluid, kg / m 3 ; q g is the rate of formation fluid invasion, kg / m; The continuity equation of the drilling fluid phase is shown as formula (2): where: a l is the volume fraction of drilling fluid within the wellbore; p l is the density of the drilling fluid, kg / m 3 ; v l is the flow velocity of the drilling fluid, m / s; The continuity equation of the dissolved gas phase is shown as formula (3): where: x sol represents the mass fraction of dissolved gas, kg / kg; The momentum conservation equation is shown as formula (4): where p is the fluid pressure, Pa; d c is the annulus equivalent diameter, m; g is the gravitational acceleration, m / s 2 ; θ is the inclination angle, rad; f is the friction coefficient; subscript m indicates the parameter of the mixed fluid composed of overflow gas and drilling fluid; p m , i.e. the density of the mixed fluid, kg / m 3 ; v m , i.e. the flow velocity of the mixed fluid, m / s; The energy conservation equation is shown as formula (5) and (6): wherein: C pg is the specific heat capacity of the gas at constant pressure, J / (kg*℃) pl is the specific heat capacity of the drilling fluid at constant pressure, J / (kg*℃); C J is the Joule-Thomson coefficient, ℃ / Pa; h e and h g are the enthalpy of the gas per unit mass at the reservoir and at the bottom of the well, J / kg; T is the temperature of the annular fluid, ℃; T sr is the formation temperature, ℃; A' is the overall heat exchange coefficient between the wellbore and the formation, W / (m*℃); B' is the overall heat exchange coefficient between the drill pipe and the annulus, W / (m*℃); ΔH sol is the heat of dissolution of the gas in water, J / kg; At is the cross-sectional area of the drill pipe, m 2 ; The continuity equation, momentum conservation equation and energy conservation equation in the multiphase flow physical model are solved by numerical discretization and implicit difference method; The input and output parameters of the calculation are as follows: The input parameters include: drilling operation conditions, drilling fluid discharge and physical parameters, well structure, formation fluid invasion rate q g ; the drilling operation conditions include well depth z, flow velocity v l of the drilling fluid, density p l of the drilling fluid, formation temperature gradient T t ; different well structures include annular cross-sectional area A, annular equivalent diameter d c ; The output parameters include: gas fraction a at different times in the wellbore g , drilling fluid volume fraction a in the wellbore l , gas velocity v g , liquid velocity v L , the distribution of fluid pressure p and fluid temperature T along the well depth, called two-dimensional space-time sequence data; The two-dimensional space-time sequence data indirectly includes the following 8 one-dimensional time series parameters: Mud pit increment - integral of the difference in drilling fluid flow rate at the inlet and outlet over time, bottom hole pressure - pressure at the bottom hole location, bottom hole temperature - temperature at the bottom hole location, standpipe pressure - pressure at the drilling fluid inlet, outlet holdup - volume fraction of drilling fluid at the surface, outlet pressure - drilling fluid pressure at the surface, outlet flow rate - volume fraction of drilling fluid at the surface, outlet temperature - volume fraction of drilling fluid at the surface.

3. The self-encoder based drilling kick wellbore gas distribution intelligent inversion method of claim 1, wherein, In combination with the drilling conditions and geological conditions of a specific overflow high-risk well section, based on the Monte Carlo sampling method, eight parameters including underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid displacement, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time are changed to perform uniform sampling, overflow simulation, and high-precision simulation dataset construction; including: Single parameter value: drilling depth, overflow time; One-dimensional time series: mud pit increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet holdup, outlet pressure, outlet flow rate, outlet temperature; Two-dimensional space-time sequence: wellbore gas holdup distribution; Standardization processing is performed.

4. The self-encoder-based intelligent inversion method for drilling kick wellbore gas distribution according to claim 1, characterized in that, The specific implementation process of step 3-2 includes: A multi-head self-attention mechanism is introduced in the latent variable regression process to dynamically calculate the correlation weight of different positions in the input and adaptively aggregate global information; Logging time series data First, the noise is stripped and features F are extracted by a stack of fully connected layers, whose computation is represented as: f l (H (l-1) )=σ(W (l) H (l-1) +b (l) ) (12); where l denotes the total number of linear layers, H (l-1) denotes the input of the l-th linear layer, which is also the output of the previous layer, i.e., the output of the (l-1)-th linear layer; W (l) , b (l) denotes the weight matrix and bias parameter of the l-th linear layer; f l denotes the operation of the l-th linear layer, and MLP denotes the operation of the entire feedforward network, i.e., the multi-layer fully connected layers. Finally, the global dependence modeling and dynamic weight distribution are performed by the multi-head self-attention module; MHSA(Q, K, V) = Concat(Attention1,..., Attention h )W O (14); In the formula, MHSA represents the operation of multi-head self-attention mechanism, and LayerNorm represents the layer normalization operation. represents the hidden variable result predicted by LRN; h represents the number of heads of attention, W O represents an output projection weight matrix, linearly combines and maps the output results of multiple attention heads back to the standard feature dimension, and completes the final integration and dimension reduction of information; Attention i represents the attention output of a single attention head, and Concat represents the splicing of matrices; multi-head self-attention MHSA projects F into Q, K, and V spaces, i.e., query, key, and value spaces, is a trainable weight matrix corresponding to the i-th attention head, which is used to generate Query, Key and Value matrices respectively, and the Query, Key and Value matrices obtained by the i-th attention head are Q i , K i , V i ; d k represents the dimension of the key and query vector in each attention head.

5. The self-encoder-based intelligent inversion method for drilling kick wellbore gas distribution according to claim 1, wherein, The neural network model of the gas invasion state inversion based on the autoencoder neural network constructed in step 3 is trained; including: The samples in the dataset, i.e., the high-precision simulation dataset, are divided into training, validation, and test datasets; The following method is used for model training: Step 4-1: Training symmetric convolutional autoencoder SCAE; SCAE training phase is unsupervised training, by minimizing the mean square error of the input real gas invasion state data Y and its reconstruction output , forcing the latent variable z to encode the key features of the data, ensuring its information integrity, as follows: Therefore, the gas invasion state data reconstruction loss L of the SCAE training stage is recon is: Step 4-2: Train the latent variable regression network LRN; the LRN training phase is supervised training by minimizing the MSE of the predicted latent variable with the MSE of the encoder output z in the SCAE phase post-training, establishes a reliable mapping of the LRN input into the latent space, as follows: z = Encoder(Y) (19); Thus, the hidden variable regression loss L of the LRN training phase is reg is:

6. The intelligent inversion method for drilling overflow wellbore gas distribution based on autoencoder of any one of claims 1-5, wherein, Eight one-dimensional time series parameters are obtained by measuring through a measurement parameter deployment system; The measurement parameter deployment system includes: mud pit, drilling fluid, mud pump input pipeline, mud pump, mud pump output pipeline, standpipe pressure gauge, drill pipe, rotary control head, wellhead cross, annulus, drill bit, formation, choke manifold input pipeline, choke manifold, choke manifold output pipeline, gas-liquid separator, exhaust pipeline, temperature sensor, first pressure sensor, liquid discharge pipeline, second pressure sensor, mass flow meter; Under the driving action of the mud pump, the drilling fluid in the mud pit flows through the mud pump input pipeline, the mud pump, and the mud pump output pipeline into the drill pipe in turn; the standpipe pressure gauge is arranged at the connection between the mud pump output pipeline and the drill pipe to obtain the standpipe pressure in the drilling overflow process in real time; The drilling fluid flows downward in the drill pipe, enters the wellbore annulus through the drill bit water hole; when the formation fluid pressure is greater than the fluid pressure at the bottom hole, the reservoir gas invades the wellbore under the action of the pressure difference; the invaded gas and the drilling fluid flow upward from the annulus, enter the choke manifold through the rotary control head discharge pipeline and the choke manifold input pipeline, then flow into the gas-liquid separator through the choke manifold output pipeline for separation, the separated gas flows out from the exhaust pipeline, and the separated liquid phase flows out from the liquid discharge pipeline; A PWD is installed above the drill bit at the well bottom to measure the well bottom pressure and temperature in real time; a second pressure sensor and a mass flow meter are installed at the outlet of the discharge pipeline, and a temperature sensor and a first pressure sensor are installed at the outlet of the exhaust pipeline to measure the outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature, respectively; in addition, a mud pit level gauge is installed in the mud pit to measure the mud pit increment by the change of the mud pit level over time; Through the above measurement parameter deployment system, eight one-dimensional time series are obtained: mud pit increment, well bottom pressure, well bottom temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature.

7. An intelligent inversion method system for drilling overflow wellbore gas distribution based on autoencoder, characterized in that, The wellbore multiphase flow parameter solving module is configured to accurately solve the wellbore multiphase flow parameters, including the migration velocities of gas and drilling fluid, the phase contents, pressure, and temperature distribution in the wellbore; The model construction and training module is configured to combine the drilling conditions and geological conditions of a specific well section at risk of overflow, change the following eight parameters including underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid discharge, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time, and perform uniform sampling to form a high-precision simulation data set based on the Monte Carlo sampling method; and construct a neural network model for gas invasion state inversion based on a self-encoder neural network; The constructed neural network model for gas invasion state inversion based on a self-encoder neural network is trained. The intelligent inversion module is configured to deploy the constructed neural network model for gas invasion state inversion based on a self-encoder neural network, and standardize the one-dimensional time series parameters in the monitoring data; The standardized time series parameters are input into the trained neural network model for gas invasion state inversion based on a self-encoder neural network to obtain the distribution data of overflow gas in the wellbore in the time period in which the current time series parameters are located. The neural network model for gas invasion state inversion based on a self-encoder neural network is constructed; including: Step 3-1: constructing a symmetric convolutional autoencoder SCAE; The symmetric convolutional autoencoder SCAE includes an encoder and a decoder; Step 3-2: constructing a latent variable regression network LRN; Assume that the gas invasion state data input into the SCAE is That is, a two-dimensional space-time sequence. The encoder compresses the downhole gas invasion state data to a low-dimensional latent space by multi-layer convolution operation to generate hidden variables The decoder reconstructs the decompressed gas invasion data from z by multi-layer deconvolution The specific definitions are as follows: In the formula: l represents the total number of convolution or deconvolution layers, * represents the convolution operation, and σ(·) is an activation function; the encoder Encoder gradually reduces the spatial dimension by stacking multiple convolution layers, and finally compresses the data into a low-dimensional vector z; represents a deconvolution operation, and the decoder Decoder gradually recovers the spatial dimension of the data by a deconvolution layer, and finally outputs reconstructed data of the same size as the input respectively represent the convolution and deconvolution operations of the lth layer; H (l-1) represents the input of the lth layer convolution or deconvolution, which is also the output of the previous layer, i.e., the output of the (l-1)th layer convolution or deconvolution; represents the convolution kernel and bias parameters of the lth layer convolution operation; represents the convolution kernel and bias parameters of the lth layer deconvolution operation; The input data of the neural network model for gas invasion state inversion based on a self-encoder neural network is a single parameter value and a one-dimensional time series, and the output data is a two-dimensional space-time sequence; The LRN is a feedforward neural network combined with multi-head self-attention mechanism to predict latent variables from well logging data First, the original well logging data is extracted by a feedforward neural network; then, the multi-head attention mechanism is introduced to dynamically calculate the correlation weight of different positions in the input and adaptively aggregate global information; then, the residual connection and layer normalization are connected to alleviate the gradient disappearance and stabilize the training process; finally, the compressed variables matching the latent space dimension of the autoencoder are output The single parameter value includes: drilling depth and overflow time; The one-dimensional time series includes: mud pit increment, well bottom pressure, well bottom temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature; The two-dimensional space-time sequence includes: wellbore gas holdup distribution. ​

Citation Information

Patent Citations

  • Inversion analysis method of while-drilling numerical-values of gas reservoir state parameters

    CN108509703A

  • Well drilling overflow early recognition method based on self-supervised learning

    CN120277398A