Intelligent inversion method and system for gas distribution of well drilling overflow shaft based on self-encoder
Through the method of combining the autoencoder and multiphase flow model with neural network, the problem of difficult to predict the gas distribution in the drilling wellbore is solved, real-time high-precision inversion of the gas distribution in the wellbore is achieved, and drilling safety and reliability of well pressing control are improved.
Patent Information
- Application Number
- CN202511080382.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-08-04
AI Technical Summary
The prior art cannot effectively predict the gas distribution in the drilling wellbore, resulting in failure of well pressure control, which can easily cause blowouts and other accidents. It depends on human guesswork or single-point measurement errors, so it is impossible to obtain the longitudinal gas distribution information along the wellbore.
The intelligent inversion method of gas distribution in the drilling overflow wellbore based on the autoencoder is used to construct a multi-phase flow transmission model and neural network, combined with the Monte Carlo sampling method, and realize high-precision simulation and inversion of gas distribution in the wellbore, and use multi-source data such as mud pool increment for real-time prediction.
Real-time rapid inversion of gas distribution in the wellbore is achieved, the reliability and safety of the well pressing scheme is improved, deployment costs are reduced, and it does not rely on additional monitoring devices, which are highly applicable and have high accuracy.
Smart Images

Figure CN120579401A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an intelligent inversion method and system for gas distribution in overflow wellbore from drilling based on an autoencoder, and belongs to the technical field of oil, gas and geothermal development drilling and completion engineering. Background Art
[0002] Oil and gas drilling, a crucial technological means of accessing underground energy, is inherently associated with high risks and technological challenges. When drilling thousands of meters deep, wellbore pressure control is a core technical component for ensuring operational safety. When the dynamic balance between formation pore pressure, drilling fluid column pressure, and formation fracture pressure is disrupted, formation fluids can invade the wellbore under the pressure differential, a phenomenon known as gas intrusion. Failure to monitor or control gas intrusion can easily lead to serious blowouts.
[0003] During a gas invasion, the gas content distribution within the wellbore is a key foundation for well-killing control parameter design. This data provides the necessary initial conditions for well-killing multiphase flow simulations and enables subsequent real-time analysis of well-killing multiphase flow. In engineering practice, this approach relies primarily on guesswork, providing only a rough estimate of parameters such as the gas rise position, without providing relevant information on gas distribution. This empirical approach has significant drawbacks: it can easily lead to pressure control failure, repeated well killing, secondary gas invasions or lost circulation, and ultimately serious drilling accidents such as blowouts.
[0004] In existing technologies, on the one hand, the gas content in the wellbore can be directly measured by installing a measuring sub in the downhole drill string. However, this method mainly obtains the gas content at a specific single-point depth, and cannot obtain the gas distribution profile and migration position along the vertical direction of the wellbore, and cannot provide key information for subsequent well control measures. In addition, it is affected by high temperature and high pressure downhole, signal transmission noise, etc., and the measurement error is large. On the other hand, the gas content of the drilling wellbore can be forward predicted through multiphase flow simulation methods under the premise of known formation pressure, permeability, overflow location and other information as boundary conditions. However, drilling overflow means that the formation information is uncertain, and forward prediction cannot be carried out. There are still no reports on methods that rely on multi-source logging data to perform real-time inversion of the wellbore gas content distribution.
[0005] Therefore, a method is needed to effectively predict the gas content distribution of drilling wellbore. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the present invention provides an intelligent inversion method for gas distribution in overflow wellbore during drilling based on an autoencoder; The present invention also provides an intelligent inversion system for gas distribution in overflow wellbore during drilling based on an autoencoder.
[0007] The purpose of the present invention is to construct a data set at the physical modeling level: a dynamic model of wellbore gas invasion is constructed based on multiphase flow transmission theory, and a fully implicit finite difference method is used for high-precision numerical solution. Key parameters such as formation gas production index and drilling fluid displacement are uniformly sampled to simulate the gas invasion evolution process under different formation conditions and drilling parameters, and a gas invasion data set is established. Subsequently, based on this gas invasion data set, a new gas invasion state prediction method based on an autoencoder is proposed. The state change of the annular gas content of the wellbore in the corresponding time period is predicted by the logging data such as mud pool increment, bottom hole pressure and temperature, casing top pressure, annular top pressure and temperature, and flow rate over a period of time. The distribution of the wellbore gas content can be efficiently inverted, and a two-dimensional visual spatiotemporal distribution map of the wellbore gas content can be generated, providing reliable information for the design of well pressure operation plans and improving the safety and reliability of well control.
[0008] The technical solution of the present invention is: The intelligent inversion method for gas distribution in overflow wellbore during drilling based on the autoencoder includes: Step 1: Accurately solve the wellbore multiphase flow parameters, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution; Step 2: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, the Monte Carlo sampling method was used to vary the following eight parameters: underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time. Uniform sampling was performed to construct a high-precision simulation data set. Step 3: Construct a neural network model for gas intrusion state inversion based on the autoencoder neural network; Step 4: training the neural network model for gas intrusion state inversion based on the autoencoder neural network constructed in step 3; Step 5: Deploy the constructed neural network model for gas invasion state inversion based on the autoencoder neural network. Based on the method in step 2, standardize the one-dimensional time series parameters in the monitoring data. Input 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 to obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters.
[0009] According to a preferred embodiment of the present invention, based on the principles of fluid mechanics, a multiphase flow physical model is established after formation overflow invades the wellbore during drilling overflow, which is used to accurately solve the wellbore multiphase flow parameters; the multiphase flow physical model includes a continuity equation, a momentum conservation equation, and an energy conservation equation, which respectively solve the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution; including: The continuity equation includes: The gas phase continuity equation is shown in formula (1): (1); Where: A is the annular space area, m 2 ; α g is the gas content in the wellbore; ρ g is the gas density, kg / m 3 ; v g is the gas flow velocity, m / s; t is time, s; z is the depth, m; k M is the solubility mass transfer coefficient of gas during multiphase flow; S int is the phase contact area, m 2 / m; w b is the content of dissolved gas in drilling fluid, kg / m 3 ; w g is the solubility of gas in drilling fluid, kg / m 3 ; q g is the invasion rate of formation fluid, kg / m; The continuity equation of the drilling fluid phase is shown in formula (2): (2); Where: α l is the volume fraction of drilling fluid in the wellbore; ρ l is the density of drilling fluid, kg / m 3 ; v l is the flow velocity of drilling fluid, m / s; The continuity equation of the dissolved gas phase is shown in Equation (3): (3); Where: x sol Indicates the mass fraction of dissolved gas, kg / kg; The momentum conservation equation is shown in formula (4): (4); Where: P is the flow pressure, Pa; d c is the annulus equivalent diameter, m; g is the acceleration due to gravity, m / s2 ; θ is the well inclination angle, rad; f is the friction coefficient; the subscript m represents the mixed fluid parameter consisting of overflow gas and drilling fluid; ρ m Is the density of the mixed fluid, kg / m 3 ; v m is the flow velocity of the mixed fluid, m / s; The energy conservation equation is shown in Equations (5) and (6): (5); (6); Where: C pg is the specific heat capacity of gas at constant pressure, C pl is the specific heat capacity of drilling fluid at constant pressure, J / (kg*℃); C J is the Joule-Thomson coefficient, °C / Pa; h e and h g is the enthalpy of gas per unit mass in the reservoir and at the bottom of the well, J / kg; T is the temperature of the annular fluid, °C; T f is the temperature of the drill pipe fluid, °C; T sr is 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 solution of gas in water, J / kg; At is the cross-sectional area of drill pipe, m 2 The continuity equation, momentum conservation equation, and energy conservation equation in the multiphase flow physics model are solved by numerical discretization and implicit difference method. The input and output parameters of the calculation are as follows: Input parameters include: drilling conditions, drilling fluid displacement and physical properties, wellbore structure, formation fluid invasion rate q g ; Drilling conditions include well depth z , drilling fluid flow rate v L , drilling fluid density ρ L , formation temperature gradient T t ; Different wellbore structures including annular cross-sectional area A , hydraulic diameterd c ; Output parameters include: gas content at different times in the wellbore α g , liquid holdup α L , gas velocity v g , liquid velocity v L , fluid pressure P and fluid temperature T The distribution along the well depth is called two-dimensional space-time series data; Two-dimensional space-time series data indirectly includes the following eight one-dimensional time series parameters: Mud pool increment - the integral of the difference in drilling fluid flow rates between the inlet and outlet over time, bottom hole pressure - the pressure at the bottom of the hole, bottom hole temperature - the temperature at the bottom of the hole, standpipe pressure - the pressure at the drilling fluid inlet, outlet liquid holdup - the fraction of drilling fluid volume at the surface, outlet pressure - the pressure of drilling fluid at the surface, outlet flow - the fraction of drilling fluid volume at the surface, outlet temperature - the fraction of drilling fluid volume at the surface.
[0010] Preferably, according to the present invention, in combination with the drilling conditions and geological conditions of a specific high-risk overflow 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 varied, uniform sampling is performed, and overflow simulation is performed to form a high-precision simulation data set; including: Single parameter value: drilling depth, overflow time; One-dimensional time series: mud pool increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, outlet temperature; Two-dimensional space-time series: wellbore gas fraction distribution; Perform standardization.
[0011] Preferably, according to the present invention, a neural network model for gas intrusion state inversion based on an autoencoder neural network is constructed; comprising: Step 3-1: Construct a symmetric convolutional autoencoder SCAE; Symmetric convolutional autoencoder SCAE includes encoder and decoder; Assume that the air intrusion state data input to SCAE is That is, a two-dimensional space-time sequence. The encoder compresses the downhole gas invasion state data into a low-dimensional potential space through multi-layer convolution operations to generate latent variables The decoder uses multiple layers of deconvolution to Reconstruct the decompressed gas intrusion data ; The specific definitions are as follows: (7); (8); (9); (10); Where: Indicates the total number of convolution or deconvolution layers, represents the convolution operation, is the activation function; encoder By stacking multiple layers of convolution, the spatial dimension is gradually reduced, and the data is finally compressed into a low-dimensional vector ; Denotes the deconvolution (transposed convolution) operation, decoder The data space dimension is gradually restored through the deconvolution layer, and the reconstructed data of the same size as the input is finally output. ; 、 Respectively represent Convolution and deconvolution operations of the layer; Indicates the The input of the convolution or deconvolution layer is also the output of the previous layer, that is, the The output of the layer convolution or deconvolution; 、 Indicates the Convolution kernel and bias parameters of layer convolution operation; 、 Indicates the Convolution kernel and bias parameters of layer deconvolution operation; Step 3-2: Construct a latent variable regression network LRN; The latent variable regression network LRN is a feedforward neural network combined with a multi-head self-attention mechanism to predict latent variables through well logging data. First, the original logging data is feature extracted through a feedforward neural network. Then, a multi-head attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the associated weights of different positions in the input. Then, residual connections and layer normalization are connected to alleviate the gradient disappearance and stabilize the training process. Finally, the output is a compressed variable that matches the dimension of the autoencoder's latent space. ; Further preferably, the specific implementation process of step 3-2 includes: A multi-head self-attention mechanism is introduced in the latent variable regression process to adaptively aggregate global information by dynamically calculating the association weights of different positions in the input. Well logging time series data First, multiple layers of fully connected layers are used to remove noise and extract features , and its calculation process is expressed as: (11); (12); Where, represents the total number of linear layers, Indicates the The input of the first linear layer is also the output of the previous layer, that is, the The output of the linear layer; 、 Indicates the The weight matrix and bias parameters of the linear layer; Indicates the Linear layer operation, Represents the entire feedforward network, i.e., the operation of multiple layers of fully connected layers; Finally, the multi-head self-attention module performs global dependency modeling and dynamic weight allocation; (13); (14); (15); (16); Where, Represents the operation of the multi-head self-attention mechanism, Representation layer normalization operation; Represents the latent variable results predicted by LRN; represents the number of attention heads, Representation layer normalization, Represents the output projection weight matrix, which linearly combines the output results of multiple attention heads and maps them back to the standard feature dimension to complete the final integration and dimensionality reduction of information; represents the attention output of a single attention head, Representation matrix concatenation; multi-head self-attention Will Projected onto Space, that is, query, key, and value space, 、 、 It is The trainable weight matrices corresponding to the attention heads are used to generate the Query, Key, and Value matrices respectively. The Query, Key, and Value matrices obtained by the attention head are 、 、 ; Represents the dimensions of the key and query vectors in each attention head.
[0012] Preferably, according to the present invention, the neural network model for gas intrusion state inversion based on the autoencoder neural network constructed in step 3 is trained; comprising: The samples in the dataset, i.e. the high-precision simulated dataset, are divided into training, validation and test datasets; The following method is used for model training: Step 4-1: Train the symmetric convolutional autoencoder SCAE; the SCAE training phase is unsupervised training, which minimizes the input of the real gas intrusion state data. Instead of reconstructing the output The mean square error of The key characteristics of the encoded data to ensure its information integrity are as follows: (17); Therefore, the reconstruction loss of the air intrusion state data during the SCAE training phase is for: (18); Step 4-2: Train the latent variable regression network LRN; the LRN training phase is supervised training, by minimizing the predicted latent variables The encoder output after SCAE stage training MSE, establish a reliable mapping from LRN input to latent space as follows: , (19); Therefore, the latent variable regression loss in the LRN training phase is for: (20); Preferably, according to the present invention, the eight one-dimensional time series parameters are measured by a measurement parameter deployment system; The measurement parameter deployment system includes: Mud pool, drilling fluid, mud pump input pipeline, mud pump, mud pump output pipeline, standpipe pressure gauge, drill pipe, rotary control head, wellhead spool, annulus, drill bit, formation, choke manifold input pipeline, choke manifold, choke manifold output pipeline, gas-liquid separator, exhaust pipeline, temperature sensor, first pressure sensor, discharge pipeline, second pressure sensor, mass flow meter; Driven by the mud pump, the drilling fluid in the mud pool flows sequentially through the mud pump input pipeline, the mud pump, and the mud pump output pipeline into the drill pipe. A standpipe pressure gauge is deployed at the connection between the mud pump output pipeline and the drill pipe to obtain real-time standpipe pressure during the drilling overflow process. The drilling fluid flows from top to bottom in the drill pipe, returns through the drill bit water hole and enters the wellbore annulus. When the formation fluid pressure is greater than the fluid pressure at the bottom of the well, the reservoir gas invades the wellbore from the formation under the action of the pressure difference. The invaded gas and drilling fluid flow from the annulus from bottom to top, through the rotary control head discharge pipeline and the choke manifold input pipeline, and then enter the choke manifold through the choke manifold output pipeline to flow into the gas-liquid separator for separation. The separated gas flows out from the exhaust pipeline, and the separated liquid flows out from the discharge pipeline. At the bottom of the well, a PWD is installed above the drill bit to measure bottomhole pressure and temperature in real time. A second pressure sensor and a mass flow meter are installed at the outlet of the drainage pipeline, and a temperature sensor and a first pressure sensor are installed at the outlet of the exhaust pipeline. These sensors measure outlet liquid holdup, outlet pressure, outlet flow, and outlet temperature, respectively. Furthermore, a mud pool level gauge is installed in the mud pool to measure the mud pool increment by observing the change in the mud pool level over time. Through the measurement parameter deployment system deployed above, eight one-dimensional time series are obtained: mud pool increment, bottomhole pressure, bottomhole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature.
[0013] The intelligent inversion method system for gas distribution in overflow wellbore during drilling based on autoencoder includes: 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, and the pressure and temperature distribution; The model building and training module is configured to: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, and using the Monte Carlo sampling method, vary the following eight parameters: underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time, perform uniform sampling, and construct a high-precision simulation data set; and construct a neural network model for gas invasion state inversion based on an autoencoder neural network. Train the constructed neural network model for gas intrusion state inversion based on the autoencoder neural network; 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 the one-dimensional time series parameters in the monitoring data; input the standardized time series parameters into the trained neural network model for gas invasion state inversion based on the autoencoder neural network, and obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters.
[0014] The beneficial effects of the present invention are: 1. By utilizing multi-source data such as mud pool increment and inlet and outlet flow rates, we can achieve real-time and rapid inversion of gas distribution in the wellbore during drilling overflow and control. This overcomes the difficulty of directly or indirectly measuring gas content and location in traditional control processes, and can provide important guidance for well killing plan formulation and well killing disposal. 2. The present invention is an intelligent inversion method for gas distribution in overflow wellbore during drilling based on an autoencoder. It does not change the existing drilling system structure and does not rely on adding new monitoring devices. Therefore, it is not affected by factors such as high temperature and high pressure in the formation and environmental noise. It has low deployment cost, strong applicability and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Schematic diagram of the two-dimensional space-time sequence of wellbore gas distribution; Figure 2 Schematic diagram of 8 one-dimensional time series parameters; Figure 3 This is the inversion map of drilling overflow gas distribution by the autoencoder (AE) neural network; Figure 4 This is the structural diagram of the drilling fluid circulation and parameter measurement system; Figure 5 This is a schematic diagram of the prediction effect of the model of the present invention on Case 1 where the overflow lasts for 30 minutes; Figure 6 This is a schematic diagram of the prediction effect of the model of the present invention on Case 2 where the overflow lasts for 30 minutes; Figure 7 This is a schematic diagram of the prediction effect of the model of the present invention on Case 3 where the overflow lasts for 30 minutes; Figure 8 This is a schematic diagram of the prediction effect of the model of the present invention on Case 4 where the overflow lasts for 30 minutes; Figure 9 This is a schematic diagram of the prediction effect of the model of the present invention on Case 5 where the overflow lasts for 30 minutes; Figure 10 This is a schematic diagram of the prediction effect of the model of the present invention on Case 6 where the overflow lasts for 30 minutes; Among them, 1: mud pool; 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 spool; 10: annulus; 11: drill bit; 12: formation; 13: throttle manifold input pipeline; 14: throttle manifold; 15: throttle manifold output pipeline; 16: gas-liquid separator; 17: exhaust pipeline; 18: temperature sensor; 19: first pressure sensor; 20: drainage pipeline; 21: second pressure sensor; 22: mass flow meter. DETAILED DESCRIPTION
[0016] The present invention will be further defined below with reference to the accompanying drawings and embodiments, but is not limited thereto.
[0017] Explanation of terms: PWD (Pressure While Drilling) is a real-time downhole pressure monitoring system installed near the drill bit in the drill string. It directly measures the annular pressure and the pressure inside the drill string through high-precision sensors, and transmits the data to the surface in real time using mud pulses or electromagnetic waves.
[0018] Example 1 The intelligent inversion method for gas distribution in overflow wellbore during drilling based on the autoencoder includes: Step 1: Accurately solve the wellbore multiphase flow parameters, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution; Step 2: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, using the Monte Carlo sampling method, the following eight parameters were varied: underpressure (the difference between formation pressure and bottomhole pressure), overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time. Uniform sampling was performed to construct a high-precision simulation data set. Step 3: Construct a neural network model for gas intrusion state inversion based on the autoencoder neural network; Step 4: training the neural network model for gas intrusion state inversion based on the autoencoder neural network constructed in step 3; Step 5: Deploy the constructed neural network model for gas intrusion state inversion based on the autoencoder neural network. Combined with actual overflow monitoring data, the one-dimensional time series parameters in the monitoring data are standardized using the method in Step 2. The standardized time series parameters are input into the neural network model for gas intrusion state inversion based on the autoencoder neural network trained in Step 4 to obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters. This enables real-time assessment of wellbore gas distribution.
[0019] Example 2 The difference between the intelligent inversion method for gas distribution in overflow wellbore during drilling based on an autoencoder and the method described in Example 1 is that: Based on the principles of fluid mechanics, a multiphase flow physical model is established after formation overflow invades the wellbore during drilling overflow, which is used to accurately solve the wellbore multiphase flow parameters. The multiphase flow physical model includes the continuity equation, momentum conservation equation, and energy conservation equation, which respectively solve the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution. It includes: During the construction of the physical model, it is necessary to consider the migration of invading fluids in the form of free gas and dissolved gas. The main physical control equations include but are not limited to the following forms: The continuity equation includes: The gas phase continuity equation is shown in formula (1): (1); Where: A is the annular space area, m 2 ; α g is the gas content in the wellbore; ρ g is the gas density, kg / m 3 ; v g is the gas flow velocity, m / s; t is time, s; z is the depth, m; k M is the solubility mass transfer coefficient of gas during multiphase flow; S int is the phase contact area, m 2 / m; w b is the content of dissolved gas in drilling fluid, obtained based on wellbore multiphase flow simulation, kg / m 3 ; w g is the solubility of gas in drilling fluid, kg / m 3 ; q g is the invasion rate of formation fluid, kg / m; The continuity equation of the drilling fluid phase is shown in formula (2): (2); Where: α l is the volume fraction of drilling fluid in the wellbore; ρ l is the density of drilling fluid, kg / m 3 ; v l is the flow velocity of drilling fluid, m / s; The continuity equation of the dissolved gas phase is shown in Equation (3): (3); Where: x sol Indicates the mass fraction of dissolved gas, kg / kg; The momentum conservation equation is shown in formula (4): (4); Where: P is the flow pressure, Pa; d c is the annulus equivalent diameter, m; g is the acceleration due to gravity, m / s 2 ; θ is the well inclination angle, rad; f is the friction coefficient; the subscript m represents the mixed fluid parameter consisting of overflow gas and drilling fluid; ρ m Is the density of the mixed fluid, kg / m 3 ; v m is the flow velocity of the mixed fluid, m / s; The energy conservation equation is shown in Equations (5) and (6): (5); (6); Where: C pg is the specific heat capacity of gas at constant pressure, C pl is the specific heat capacity of drilling fluid at constant pressure, J / (kg*℃); C J is the Joule-Thomson coefficient, °C / Pa; h e and h g is the enthalpy of gas per unit mass in the reservoir and at the bottom of the well, J / kg; T is the temperature of the annular fluid, °C; T f is the temperature of the drill pipe fluid, °C; T sr is 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 solution of gas in water, J / kg; At is the cross-sectional area of drill pipe, m 2 The continuity equation, momentum conservation equation, and energy conservation equation in the multiphase flow physics model are solved by numerical discretization and implicit difference method. The input and output parameters of the calculation are as follows: Input parameters include: drilling conditions, drilling fluid displacement and physical properties, wellbore structure, formation fluid invasion rate q g ; Drilling conditions include well depth z , drilling fluid flow rate v L , drilling fluid density ρ L , formation temperature gradient T t ; Different wellbore structures including annular cross-sectional area A , hydraulic diameter d c ; Output parameters include: gas content at different times in the wellbore α g , liquid holdup α L , gas velocity v g , liquid velocity v L , fluid pressure P and fluid temperature T The distribution along the well depth is called two-dimensional space-time series data; Two-dimensional space-time series data indirectly includes the following eight one-dimensional time series parameters: Mud pool increment—the time integral of the inlet and outlet drilling fluid flow rate difference; bottomhole pressure—the pressure at the bottomhole; bottomhole temperature—the temperature at the bottomhole; standpipe pressure—the pressure at the drilling fluid inlet; outlet liquid holdup—the volume fraction of the drilling fluid at the surface (well depth 0 m); outlet pressure—the drilling fluid pressure at the surface (well depth 0 m); outlet flow—the volume fraction of the drilling fluid at the surface (well depth 0 m); outlet temperature—the volume fraction of the drilling fluid at the surface (well depth 0 m). These eight one-dimensional time series parameters are all measurable in actual drilling operations and are obtained using the method in step 5.
[0020] The two-dimensional space-time sequence of wellbore gas distribution is as follows: Figure 1 As shown, the eight one-dimensional time series parameters are as follows Figure 2 shown.
[0021] The wellbore multiphase flow model in step 1 is discretized according to a certain time and space step size and solved iteratively. First, an initial pressure value is set for the pressure node to be solved, and this initial value is substituted into the equation group to obtain the relevant parameters; the pressure of the node to be solved is calculated using the flow model, and then the calculated pressure is compared with the initial value; when the absolute value of the difference between the two falls within the preset error tolerance range, When , the calculation of the node is determined to have converged, and the method can be used to advance to the next node; if the deviation exceeds the tolerance range, the initial pressure of the node needs to be reassigned and the above calculation steps are repeated until the convergence condition is met; The specific steps are as follows: (1) Input parameters; (2) At the start of calculation t=t 0 = 0, taking the wellhead as the starting point, calculate the pressure of each node , velocity and related fluid physical parameters; (3) Determine the time step Δ based on the bottom hole node velocity and the preset grid unit length t 0; (4) For the first time node t 1 =t 0 + Δ t 0 bottom well position, preset its pressure value , and calculate the gas solubility, velocity parameters and fluid physical properties at the bottom hole node based on the pressure value; (5) Preset the pressure value for the current node (1, 1), that is, assume that the pressure of the first time and the first space node is , calculate the gas solubility, velocity parameters and fluid physical properties at the node; (6) According to the mass conservation equation (continuity equation), the gas phase volume fraction at (1, 1) is set to The superficial velocity of the gas and liquid phase at that location can be calculated 、 , and then based on this flow rate, the gas phase volume fraction is obtained through the velocity equation ; (7) If ,but The setting is valid, otherwise it is necessary to make a new assumption and repeat from step (6); (8) The determined Substitute the relevant parameters into the momentum equation and calculate the pressure at (1, 1) ; (9) If ,but The setting is valid, otherwise it needs to be re-assumed Repeat steps (5)-(9) until the conditions are met; (10) The final pressure solution of the current node Set the known pressure of the next adjacent node and repeat the above calculation until all spatial nodes of the time layer are calculated. After the calculation of the spatial node sequence from the bottom of the well to the wellhead is completed, if the absolute value of the difference between the calculated wellhead pressure and the atmospheric pressure meets the accuracy requirements, then The setting is valid, otherwise it needs to be re-assumed Repeat steps (4)-(10) until the conditions are met;
[0022] So far t All spatial node parameters at time point 1 are calculated and verified, and these results become the next time layer ( t 2) The initial input of the calculation (initial conditions). By analogy, the calculation can be gradually advanced to t3, ..., t n Wait for subsequent time nodes to finally obtain all flow field parameters in the complete time and space domain.
[0023] For which It is expressed as the parameter value at the i-th time node and the j-th space node after the parameter is discretized. The parameter in the bracket is taken from a discrete parameter in the above formula. Assuming that there are n time nodes and m space nodes, 、 ; Indicates the result obtained by calculation based on the assumed value, and the validity needs to be judged.
[0024] The migration velocity, phase content, pressure and temperature distribution of gas and drilling fluid in the wellbore are 、 、 、 、 and .
[0025] Based on the drilling conditions and geological conditions of a specific high-risk overflow section, the Monte Carlo sampling method is used to change 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, for uniform sampling. Optionally, 5,000 samples are taken to generate 5,000 different drilling overflow simulation cases for overflow simulation to form a high-precision simulation data set; this includes: Each case consists of the following parameters: Single parameter value (measurable): drilling depth, overflow time; One-dimensional time series (measurable): mud pool increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, outlet temperature; Two-dimensional space-time series (needs to be inverted): wellbore gas fraction distribution; After sampling to obtain the exact eight values for each case, the overflow simulation was performed, combined with the drilling conditions and geological conditions of a specific high-risk overflow section, to obtain the following results ("single parameter value", "one-dimensional time series" and "two-dimensional space-time series"). The terms "measurable" and "need to be inverted" indicate that during the actual drilling process, the single parameter value and one-dimensional time series data can be obtained through measurement, while the two-dimensional space-time series data cannot be measured and requires model inversion.
[0026] Among them, the single parameter value and one-dimensional time series are the input data of the overflow gas distribution intelligent inversion model in step 3, and the two-dimensional space-time series is the output data.
[0027] Because the simulation time and depth of each case well data vary, standardization is performed. Eight time series parameters, including mud pool increment, bottomhole pressure, bottomhole temperature, inlet pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature, are taken at the same time interval. Preferably, the number of parameter points in the one-dimensional time series is 301. That is, time interval = overflow time / 300. For example, if the overflow time is 30 minutes, the time interval is 6 seconds.
[0028] Using the same method, the two-dimensional spatiotemporal series of wellbore gas content is constructed as a two-dimensional matrix of equal length. Considering the balance between prediction accuracy and timeliness, the dimension is set to 100 × 100, meaning that both the time domain (0 s - flooding time) and the spatial domain (0 m - well depth) are interpolated to 100 nodes.
[0029] Construct a neural network model for gas intrusion state inversion based on an autoencoder neural network; including: Based on the high-precision simulation data set constructed in step 2, the prediction result is the spatiotemporal distribution of the wellbore gas content, that is, a visualization image of the annular gas content in the wellbore over time, with an accuracy of 100*100. The horizontal axis of the image is the time step dimension, and the vertical axis is the space step dimension.
[0030] This paper models the spatiotemporal data of the time-varying gas fraction in the wellbore annulus as a single-channel image (with the horizontal axis representing the time step and the vertical axis representing the spatial depth). This image is then processed using a convolutional neural network (CNN). This method uses localized convolution kernels to collaboratively capture the coupled temporal and spatial characteristics, enabling efficient modeling of gas diffusion dynamics. Compared to traditional time series models such as LSTM, CNN avoids the error accumulation of step-by-step predictions through its graphical input, supports synchronized output across all time and space, and achieves more accurate predictions.
[0031] On the other hand, the significant difference in input and output dimensions for this gas intrusion state image task poses a significant challenge to traditional end-to-end deep learning models. Directly building an end-to-end high-dimensional mapping model can lead to high computational resource consumption during training, especially during backpropagation, where the high-dimensional spatial gradients can lead to model convergence difficulties.
[0032] The present invention adopts a phased modeling strategy to solve the above difficulties: first, the low-dimensional representation learning of the gas invasion state image is carried out through feature compression technology to construct the latent space mapping relationship; then a neural network is established to transform the well logging data into the low-dimensional representation space. This strategy decouples the original high-dimensional image prediction task into two sub-problems: feature compression and low-dimensional regression by decoupling the spatiotemporal features. The designed deep neural network model is as follows: Figure 3The architecture consists of two modules: a symmetric convolutional autoencoder (SCAE) and a latent variable regression network (LRN), which solve two sub-problems respectively. The SCAE compresses and reconstructs real gas invasion state data to learn an efficient low-dimensional feature representation of this data, namely the latent variables. The LRN is responsible for learning the mapping relationship between the logging and well data and the latent variables.
[0033] Step 3-1: Construct a symmetric convolutional autoencoder SCAE; The Symmetric Convolutional Autoencoder (SCAE) is based on a traditional autoencoder architecture and employs a mirror-symmetric encoder and decoder. The encoder consists of multiple layers of convolution, progressively compressing the spatial dimensions of the input data and extracting high-level features. The decoder, constructed through a corresponding number of layers of deconvolution, gradually recovers the spatial information and reconstructs the original input. Hyperparameters such as network depth, convolution kernel size, and stride length are strictly symmetrical between the encoder and decoder, ensuring structural consistency between the feature dimensionality reduction and data reconstruction processes.
[0034] Symmetric convolutional autoencoder SCAE includes encoder and decoder; Assume that the air intrusion state data input to SCAE is That is, a two-dimensional space-time sequence (the number of channels is 1) (height, width, number of channels). The encoder compresses the downhole gas invasion state data into a low-dimensional potential space through multi-layer convolution operations to generate latent variables The decoder uses multiple layers of deconvolution to Reconstruct the decompressed gas intrusion data ; The specific definitions are as follows: (7); (8); (9); (10); Where: Indicates the total number of convolution or deconvolution layers, represents the convolution operation, is the activation function; encoder By stacking multiple layers of convolution, the spatial dimension is gradually reduced, and the data is finally compressed into a low-dimensional vector ; Denotes the deconvolution (transposed convolution) operation, decoder The data space dimension is gradually restored through the deconvolution layer, and the reconstructed data of the same size as the input is finally output. ; 、 Respectively represent Convolution and deconvolution operations of the layer; Indicates the The input of the convolution or deconvolution layer is also the output of the previous layer, that is, the The output of the layer convolution or deconvolution; 、 Indicates the Convolution kernel and bias parameters of layer convolution operation; 、 Indicates the Convolution kernel and bias parameters of layer deconvolution operation; Step 3-2: Construct a latent variable regression network LRN; The latent variable regression network LRN is a feedforward neural network combined with a multi-head self-attention mechanism to predict latent variables through well logging data. First, the original logging data is feature extracted through a feedforward neural network. Then, a multi-head attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the associated weights of different positions in the input. Then, residual connections and layer normalization are connected to alleviate the gradient disappearance and stabilize the training process. Finally, the output is a compressed variable that matches the dimension of the autoencoder's latent space. ; The specific implementation process of step 3-2 includes: A multi-head self-attention mechanism is introduced in the latent variable regression process to adaptively aggregate global information by dynamically calculating the association weights of different positions in the input. Well logging time series data (The eight processed time series data obtained during the logging process include: mud pool increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature) First, noise is removed and features are extracted through multiple fully connected layers. , and its calculation process is expressed as: (11); (12); Where, represents the total number of linear layers, Indicates the The input of the first linear layer is also the output of the previous layer, that is, the The output of the linear layer; 、 Indicates the The weight matrix and bias parameters of the linear layer; Indicates the Linear layer operation, Represents the entire feedforward network, i.e., the operation of multiple layers of fully connected layers; Finally, the multi-head self-attention module performs global dependency modeling and dynamic weight allocation to improve the prediction of latent variables. Accuracy, so that the decoder generates higher quality gas intrusion status data: (13); (14); (15); (16); Where, Represents the operation of the multi-head self-attention mechanism, Representation layer normalization operation; Represents the latent variable results predicted by LRN; represents the number of attention heads, Representation layer normalization, Represents the output projection weight matrix, which linearly combines the output results of multiple attention heads and maps them back to the standard feature dimension to complete the final integration and dimensionality reduction of information; represents the attention output of a single attention head, Representation matrix concatenation; multi-head self-attention Will Projected onto Space, namely query (Query), key (Key), value (Value) space, 、 、 It is The trainable weight matrices corresponding to the attention heads are used to generate the Query, Key, and Value matrices respectively. The Query, Key, and Value matrices obtained by the attention head are 、 、 ; Represents the dimensions of the key and query vectors in each attention head.
[0035] The neural network model for gas intrusion state inversion based on the autoencoder neural network constructed in step 3 is trained; including: Before model training, the dataset—a high-precision simulated dataset—is divided into training, validation, and test datasets. The training dataset is used to calibrate the neural network model parameters. Model training uses forward propagation to calculate the model output, and then backpropagation to update the model parameters. This process is iterated multiple times until the model converges. The validation dataset uses an early stopping mechanism to dynamically control the training progress. This mechanism automatically terminates training and rolls back to the optimal weight state if it detects that the validation loss continues to show no improvement. This stops training before overfitting occurs and reduces wasted computation. The test dataset is used for the final blind test evaluation.
[0036] The following method was used for model training: Training also employed a two-stage approach: SCAE training and LRN training. Both stages employed the Adam optimizer and a variable learning rate strategy. If the validation loss did not improve further within 10 consecutive epochs, the current learning rate was multiplied by 0.1. This allowed the learning rate to dynamically adjust based on the model's training progress, avoiding convergence issues caused by excessively large or small learning rates. Additionally, an early stopping mechanism was implemented during the validation phase. If the validation loss did not reach the optimal value for 50 consecutive validation rounds, the model was deemed to be overfitting or convergence wasted, and training automatically terminated to avoid unnecessary waste of computing resources.
[0037] Step 4-1: Train the symmetric convolutional autoencoder SCAE; the SCAE training phase is unsupervised training, which minimizes the input of the real gas intrusion state data. Instead of reconstructing the output The mean square error (MSE) of the latent variable The key characteristics of the encoded data to ensure its information integrity are as follows: (17); Therefore, the reconstruction loss of the air intrusion state data during the SCAE training phase is for: (18); Step 4-2: Train the latent variable regression network LRN; the LRN training phase is supervised training, by minimizing the predicted latent variables The encoder output after SCAE stage training MSE, establish a reliable mapping from LRN input to latent space as follows: , (19); Therefore, the latent variable regression loss in the LRN training phase is for: (20); The present invention adopts the following methods to perform model prediction and evaluation.
[0038] Model prediction. After the model is trained in step 4-1, only the two core components of the LRN and SCAE decoders are retained, and the input data is transmitted through an end-to-end process. Directly mapped to target output , predict the result without relying on the encoder module. Its mathematical formalization is:
[0039] ; After the model is trained, its performance needs to be verified in the test set. The similarity of the visualization images of the annular gas content data that changes with time and space is evaluated mainly from two aspects: the error MSE at the pixel level and the error SSIM at the image feature level. In order to comprehensively evaluate the performance of the gas intrusion state prediction model, this study uses the mean squared error (MSE) and the structural similarity index (SSIM) as core evaluation indicators, quantifying the difference between the model output and the real data from the two dimensions of pixel-level numerical accuracy and spatial structure consistency. MSE is defined as the arithmetic mean of the mean squared error of each pixel point between the predicted image and the real image:
[0040] ; Where: and represent the true value and the predicted value respectively, is the total number of pixels in the image. This indicator directly reflects the prediction deviation of the gas intrusion intensity value, but is insensitive to spatial structure misalignment. Therefore, 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:
[0041] ; Where: 、 represent the image mean and standard deviation respectively, is the covariance, is a stable constant. When the SSIM value approaches 1, it indicates that the spatial morphology of the predicted image is highly consistent with the actual gas intrusion distribution.
[0042] The eight one-dimensional time series parameters are measured by the measurement parameter deployment system, such as Figure 4 As shown: The measurement parameter deployment system includes: Mud pool 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 spool 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, drainage pipeline 20, second pressure sensor 21, mass flow meter 22; Driven by the mud pump 4, the drilling fluid 2 in the mud pool 1 flows sequentially through the mud pump input pipeline 3, the mud pump 4, and the mud pump output pipeline 5 into the drill pipe 7. A standpipe pressure gauge 6 is deployed at the connection between the mud pump output pipeline 5 and the drill pipe 7 to obtain real-time standpipe pressure during the drilling overflow process. Drilling fluid 2 flows from top to bottom within drill pipe 7, returns through the water hole of drill bit 11 and enters wellbore annulus 10. When the fluid pressure in formation 12 is greater than the fluid pressure at the bottom of the well, reservoir gas invades the wellbore from formation 12 due to the pressure differential. The invaded gas and drilling fluid 2 flow from bottom to top through annulus 10, through the discharge pipeline of rotary control head 8, throttle manifold input pipeline 13, and into throttle manifold 14. Then, through throttle manifold output pipeline 15, they flow into gas-liquid separator 16 for separation. The separated gas flows out through exhaust pipeline 17, and the separated liquid phase flows out through liquid discharge pipeline 20. At the bottom of the well, a PWD is installed above the drill bit 11 to measure the bottomhole pressure and temperature in real time. A second pressure sensor 21 and a mass flow meter 22 are installed at the outlet of the drainage pipeline, and a temperature sensor 18 and a first pressure sensor 19 are installed at the outlet of the exhaust pipeline 17. These sensors measure the outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature, respectively. In addition, a mud pool level gauge is installed in the mud pool 1 to measure the mud pool increment by observing the change in the mud pool 1 liquid level over time. The measurement system deployed above generates eight one-dimensional time series: mud pool increment, bottomhole pressure, bottomhole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature. These time series parameters are then standardized using the method in step 2, with the initial time of the overflow as time 0. These standardized time series parameters are then substituted into the intelligent inversion model for overflow gas distribution trained using the method in step 4 to determine the current gas distribution within the wellbore.
[0043] For a well with a depth of 8570 meters, the method in step 3 is used to sample 1000 groups of parameters according to the range in Table 1. Then, based on the model established in step 1, the parameters of each group of samples are solved according to the solution method in step 2 and the results are processed into a data set.
[0044] Table 1 Sampling parameters;
[0045] The dataset is then divided into training, validation, and test sets in a ratio of 6:2:2. The model is trained and predicted using the method in step 4. In the two-stage training process, the early stopping mechanism is triggered after 326 epochs in the SCAE training phase, and the training loss decreases from the initial 4.51×10 −3 reduced to 3.33×10 −5 , the validation loss converges to 3.31×10 −5 The LRN training phase stalled due to validation loss at 295 epochs and was terminated using the early stopping mechanism. The training loss steadily decreased to 2.97×10 −1 , the verification loss is as low as 6.62×10 −1The mean square error (MSE) of the final trained model on the test set is 1.610×10 −4 , the structural similarity index (SSIM) index value is 0.957.
[0046] Figure 5 This is a schematic diagram of the prediction effect of the model of the present invention on Case 1 where the overflow lasts for 30 minutes; Figure 5 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. Figure 6 This is a schematic diagram of the prediction effect of the model of the present invention on Case 2 where the overflow lasts for 30 minutes; Figure 6 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. Figure 7 This is a schematic diagram of the prediction effect of the model of the present invention on Case 3 where the overflow lasts for 30 minutes; Figure 7 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. Figure 8 This is a schematic diagram of the prediction effect of the model of the present invention on Case 4 where the overflow lasts for 30 minutes; Figure 8 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. Figure 9 This is a schematic diagram of the prediction effect of the model of the present invention on Case 5 where the overflow lasts for 30 minutes; Figure 9 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. Figure 10 This is a schematic diagram of the prediction effect of the model of the present invention on Case 6 where the overflow lasts for 30 minutes; Figure 10 In the figure, a represents the actual gas content distribution, b represents the predicted gas content distribution, and c represents the comparison between the predicted gas invasion upper interface and the actual result. The red line represents the comparison between the predicted gas invasion upper interface and the actual result. During actual drilling, the gas distribution within the wellbore varies significantly at different times, influenced by factors such as drilling fluid flow rate and gas invasion rate. However, a careful comparison of the predictions generated by the model constructed in this paper with actual observations reveals that the model's predictions of gas migration interfaces and its understanding of the approximate distribution of gas within the wellbore are largely consistent with actual conditions. This result demonstrates the model's effectiveness and reliability in handling complex scenarios.
[0047] Example 3 The intelligent inversion method system for gas distribution in overflow wellbore during drilling based on autoencoder includes: 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, and the pressure and temperature distribution; The model building and training module is configured to: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, and using the Monte Carlo sampling method, vary the following eight parameters: underpressure (the difference between formation pressure and bottomhole pressure), overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time, performing uniform sampling to construct a high-precision simulation data set; and construct a neural network model for gas invasion state inversion based on an autoencoder neural network. Train the constructed neural network model for gas intrusion state inversion based on the autoencoder neural network; The intelligent inversion module is configured to deploy the constructed neural network model for gas inversion based on an autoencoder neural network, standardize the one-dimensional time series parameters in the monitoring data based on actual overflow monitoring data, and then input the standardized time series parameters into the trained neural network model for gas inversion based on an autoencoder neural network to obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters. This enables real-time assessment of wellbore gas distribution.
Claims
1. An intelligent inversion method for gas distribution in overflow wellbore during drilling based on an autoencoder, characterized in that: include: Step 1: Accurately solve the wellbore multiphase flow parameters, including the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution; Step 2: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, the Monte Carlo sampling method was used to vary the following eight parameters: underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time. Uniform sampling was performed to construct a high-precision simulation data set. Step 3: Construct a neural network model for gas intrusion state inversion based on the autoencoder neural network; Step 4: training the neural network model for gas intrusion state inversion based on the autoencoder neural network constructed in step 3; Step 5: Deploy the constructed neural network model for gas intrusion state inversion based on the autoencoder neural network, and standardize the one-dimensional time series parameters in the monitoring data based on the method in step 2; The standardized time series parameters are input into the neural network model for gas invasion state inversion based on the autoencoder neural network trained in step 4 to obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters.
2. The intelligent inversion method for gas distribution in overflow wellbore based on autoencoder drilling according to claim 1 is characterized in that: Based on the principles of fluid mechanics, a multiphase flow physical model is established after formation overflow invades the wellbore during drilling overflow, which is used to accurately solve the wellbore multiphase flow parameters. The multiphase flow physical model includes the continuity equation, momentum conservation equation, and energy conservation equation, which respectively solve the migration velocity of gas and drilling fluid in the wellbore, the content of each phase, and the pressure and temperature distribution. It includes: The continuity equation includes: The gas phase continuity equation is shown in formula (1): (1); Where: A is the annular space area, m 2 ; α g is the gas content in the wellbore; ρ g is the gas density, kg / m 3 ; v g is the gas flow velocity, m / s; t is time, s; z is the depth, m; k M is the solubility mass transfer coefficient of gas during multiphase flow; S int is the phase contact area, m 2 / m; w b is the content of dissolved gas in drilling fluid, kg / m 3 ; w g is the solubility of gas in drilling fluid, kg / m 3 ; q g is the invasion rate of formation fluid, kg / m; The continuity equation of the drilling fluid phase is shown in formula (2): (2); Where: α l is the volume fraction of drilling fluid in the wellbore; ρ l is the density of drilling fluid, kg / m 3 ; v l is the flow velocity of drilling fluid, m / s; The continuity equation of the dissolved gas phase is shown in Equation (3): (3); Where: x sol Indicates the mass fraction of dissolved gas, kg / kg; The momentum conservation equation is shown in formula (4): (4); Where: P is the flow pressure, Pa; d c is the annulus equivalent diameter, m; g is the acceleration due to gravity, m / s 2 ; θ is the well inclination angle, rad; f is the friction coefficient; the subscript m represents the mixed fluid parameter consisting of overflow gas and drilling fluid; ρ m Is the density of the mixed fluid, kg / m 3 ; v m is the flow velocity of the mixed fluid, m / s; The energy conservation equation is shown in Equations (5) and (6): (5); (6); Where: C pg is the specific heat capacity of gas at constant pressure, C pl is the specific heat capacity of drilling fluid at constant pressure, J / (kg*℃); C J is the Joule-Thomson coefficient, °C / Pa; h e and h g is the enthalpy of gas per unit mass in the reservoir and at the bottom of the well, J / kg; T is the temperature of the annular fluid, °C; T f is the temperature of the drill pipe fluid, °C; T sr is 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 solution of gas in water, J / kg; At is the cross-sectional area of drill pipe, m 2 The continuity equation, momentum conservation equation, and energy conservation equation in the multiphase flow physics model are solved by numerical discretization and implicit difference method. The input and output parameters of the calculation are as follows: Input parameters include: drilling conditions, drilling fluid displacement and physical properties, wellbore structure, formation fluid invasion rate q g ; Drilling conditions include well depth z , drilling fluid flow rate v L , drilling fluid density ρ L , formation temperature gradient T t ; Different wellbore structures including annular cross-sectional area A , hydraulic diameter d c ; Output parameters include: gas content at different times in the wellbore α g , liquid holdup α L , gas velocity v g , liquid velocity v L , fluid pressure P and fluid temperature T The distribution along the well depth is called two-dimensional space-time series data; Two-dimensional space-time series data indirectly includes the following eight one-dimensional time series parameters: Mud pool increment - the integral of the difference in drilling fluid flow rates between the inlet and outlet over time, bottom hole pressure - the pressure at the bottom of the hole, bottom hole temperature - the temperature at the bottom of the hole, standpipe pressure - the pressure at the drilling fluid inlet, outlet liquid holdup - the fraction of drilling fluid volume at the surface, outlet pressure - the pressure of drilling fluid at the surface, outlet flow - the fraction of drilling fluid volume at the surface, outlet temperature - the fraction of drilling fluid volume at the surface.
3. The intelligent inversion method for gas distribution in overflow wellbore based on autoencoder drilling according to claim 1 is characterized in that: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, and using 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, were varied to perform uniform sampling and overflow simulation, thus forming a high-precision simulation data set. This includes: Single parameter value: drilling depth, overflow time; One-dimensional time series: mud pool increment, bottom hole pressure, bottom hole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, outlet temperature; Two-dimensional space-time series: wellbore gas fraction distribution; Perform standardization.
4. The intelligent inversion method for gas distribution in overflow wellbore based on autoencoder drilling according to claim 1 is characterized in that: Construct a neural network model for gas intrusion state inversion based on an autoencoder neural network; including: Step 3-1: Construct a symmetric convolutional autoencoder SCAE; Symmetric convolutional autoencoder SCAE includes encoder and decoder; Assume that the air intrusion state data input to SCAE is That is, a two-dimensional space-time sequence. The encoder compresses the downhole gas invasion state data into a low-dimensional potential space through multi-layer convolution operations to generate latent variables The decoder uses multiple layers of deconvolution to Reconstruct the decompressed gas intrusion data ; The specific definitions are as follows: (7); (8); (9); (10); Where: Indicates the total number of convolution or deconvolution layers, represents the convolution operation, is the activation function; encoder By stacking multiple layers of convolution, the spatial dimension is gradually reduced, and the data is finally compressed into a low-dimensional vector ; Denotes the deconvolution (transposed convolution) operation, decoder The data space dimension is gradually restored through the deconvolution layer, and the reconstructed data of the same size as the input is finally output. ; 、 Respectively represent Convolution and deconvolution operations of the layer; Indicates the The input of the convolution or deconvolution layer is also the output of the previous layer, that is, the The output of the layer convolution or deconvolution; 、 Indicates the The convolution kernel and bias parameters of the layer convolution operation; 、 Indicates the Convolution kernel and bias parameters of layer deconvolution operation; Step 3-2: Construct a latent variable regression network LRN; The latent variable regression network LRN is a feedforward neural network combined with a multi-head self-attention mechanism to predict latent variables through well logging data. First, the original logging data is feature extracted through a feedforward neural network. Then, a multi-head attention mechanism is introduced to adaptively aggregate global information by dynamically calculating the associated weights of different positions in the input. Then, residual connections and layer normalization are connected to alleviate the gradient disappearance and stabilize the training process. Finally, the output is a compressed variable that matches the dimension of the autoencoder's latent space. .
5. The intelligent inversion method for gas distribution in overflow wellbore based on autoencoder drilling according to claim 4 is 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 adaptively aggregate global information by dynamically calculating the association weights of different positions in the input. Well logging time series data First, multiple layers of fully connected layers are used to remove noise and extract features , and its calculation process is expressed as: (11); (12); Where, represents the total number of linear layers, Indicates the The input of the first linear layer is also the output of the previous layer, that is, the The output of the linear layer; 、 Indicates the The weight matrix and bias parameters of the linear layer; Indicates the Linear layer operation, Represents the entire feedforward network, i.e., the operation of multiple layers of fully connected layers; Finally, the multi-head self-attention module performs global dependency modeling and dynamic weight allocation; (13); (14); (15); (16); Where, Represents the operation of the multi-head self-attention mechanism, Representation layer normalization operation; Represents the latent variable results predicted by LRN; represents the number of attention heads, Representation layer normalization, Represents the output projection weight matrix, which linearly combines the output results of multiple attention heads and maps them back to the standard feature dimension to complete the final integration and dimensionality reduction of information; represents the attention output of a single attention head, Representation matrix concatenation; multi-head self-attention Will Projected onto Space, that is, query, key, and value space, 、 、 It is The trainable weight matrices corresponding to the attention heads are used to generate the Query, Key, and Value matrices respectively. The Query, Key, and Value matrices obtained by the attention head are 、 、 ; Represents the dimensions of the key and query vectors in each attention head.
6. The method for intelligent inversion of gas distribution in overflow wellbore based on autoencoder drilling according to claim 1, characterized in that: The neural network model for gas intrusion 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 simulated dataset, are divided into training, validation and test datasets; The following method is used for model training: Step 4-1: Train the symmetric convolutional autoencoder SCAE; the SCAE training phase is unsupervised training, which minimizes the input of the real gas intrusion state data. Instead of reconstructing the output The mean square error of The key characteristics of the encoded data to ensure its information integrity are as follows: (17); Therefore, the reconstruction loss of the air intrusion state data during the SCAE training phase is for: (18); Step 4-2: Train the latent variable regression network LRN; the LRN training phase is supervised training, by minimizing the predicted latent variables The encoder output after SCAE stage training MSE, establish a reliable mapping from LRN input to latent space as follows: , (19); Therefore, the latent variable regression loss in the LRN training phase is for: (20)。 7. The method for intelligent inversion of gas distribution in overflow wellbore from drilling based on an autoencoder according to any one of claims 1 to 6, characterized in that: 8 one-dimensional time series parameters are measured through the measurement parameter deployment system; The measurement parameter deployment system includes: Mud pool, drilling fluid, mud pump input pipeline, mud pump, mud pump output pipeline, standpipe pressure gauge, drill pipe, rotary control head, wellhead spool, annulus, drill bit, formation, choke manifold input pipeline, choke manifold, choke manifold output pipeline, gas-liquid separator, exhaust pipeline, temperature sensor, first pressure sensor, discharge pipeline, second pressure sensor, mass flow meter; Driven by the mud pump, the drilling fluid in the mud pool flows sequentially through the mud pump input pipeline, the mud pump, and the mud pump output pipeline into the drill pipe. A standpipe pressure gauge is deployed at the connection between the mud pump output pipeline and the drill pipe to obtain real-time standpipe pressure during the drilling overflow process. The drilling fluid flows from top to bottom in the drill pipe, returns through the drill bit water hole and enters the wellbore annulus. When the formation fluid pressure is greater than the fluid pressure at the bottom of the well, the reservoir gas invades the wellbore from the formation under the action of the pressure difference. The invaded gas and drilling fluid flow from the annulus from bottom to top, through the rotary control head discharge pipeline and the choke manifold input pipeline, and then enter the choke manifold through the choke manifold output pipeline to flow into the gas-liquid separator for separation. The separated gas flows out from the exhaust pipeline, and the separated liquid flows out from the discharge pipeline. At the bottom of the well, a PWD is installed above the drill bit to measure bottomhole pressure and temperature in real time. A second pressure sensor and a mass flow meter are installed at the outlet of the drainage pipeline, and a temperature sensor and a first pressure sensor are installed at the outlet of the exhaust pipeline. These sensors measure outlet liquid holdup, outlet pressure, outlet flow, and outlet temperature, respectively. Furthermore, a mud pool level gauge is installed in the mud pool to measure the mud pool increment by observing the change in the mud pool level over time. Through the measurement parameter deployment system deployed above, eight one-dimensional time series are obtained: mud pool increment, bottomhole pressure, bottomhole temperature, standpipe pressure, outlet liquid holdup, outlet pressure, outlet flow rate, and outlet temperature.
8. An intelligent inversion method system for gas distribution in overflow wellbore during drilling based on an autoencoder, characterized in that: include: 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, and the pressure and temperature distribution; The model building and training module is configured to: Based on the drilling conditions and geological conditions of a specific high-risk overflow section, and using the Monte Carlo sampling method, vary the following eight parameters: underpressure value, overflow rate, surface drilling fluid density, surface drilling fluid flow rate, surface drilling fluid temperature, formation temperature gradient, drilling depth, and overflow time, perform uniform sampling, and construct a high-precision simulation data set; and construct a neural network model for gas invasion state inversion based on an autoencoder neural network. Train the constructed neural network model for gas intrusion state inversion based on the autoencoder neural network; The intelligent inversion module is configured to: deploy the constructed neural network model for gas intrusion state inversion based on the autoencoder 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 the autoencoder neural network to obtain the distribution data of the overflow gas in the wellbore during the time period of the current time series parameters.
Citation Information
Patent Citations
Inversion analysis method of while-drilling numerical-values of gas reservoir state parameters
CN108509703A
On-line monitoring method and equipment for multiple working conditions of well drilling, medium and product
CN118551322A
Gamma logging inversion method, system and equipment based on stratum position coding
CN118643870A
Multi-measuring-point multi-parameter drilling real-time inversion method, equipment, medium and product
CN118940006A
Well drilling overflow early recognition method based on self-supervised learning
CN120277398A
Cited By
Drilling fluid overflow real-time monitoring system and method
CN121118770A
Shaft multiphase flow model numerical solution and gas-liquid distribution state inversion method and system
CN121525524A
Numerical solution of wellbore multiphase flow model and gas-liquid distribution state inversion method and system
CN121525524B
Gas cut early-stage comprehensive monitoring and dynamic evolution grading early warning method in drilling process
CN122067387A
An ultra-deep well drilling gas invasion risk dynamic monitoring method, system, device and medium
CN122383311A