A Smart Prediction Method for Wellbore Operating Status Based on a Hybrid Deep Learning Framework
The intelligent prediction method for wellbore operating status using a hybrid deep learning framework solves the complex problems of multiphase flow mechanism and heat transfer characteristics in the wellbore during CO2 geological storage, achieving high-precision prediction of wellbore status and improving safety assessment capabilities.
Patent Information
- Application Number
- CN202511223458.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing technologies are insufficient to effectively address the multiphase flow mechanism and heat transfer characteristics within the wellbore during CO2 geological storage, especially the complex phase evolution under dynamic temperature-pressure changes within the wellbore, which makes it difficult to predict potential engineering safety hazards.
A wellbore operating status intelligent prediction method based on a hybrid deep learning framework is adopted. By integrating a dual-sequence feature database with an improved dual attention mechanism and a time-fusion Transformer model, a transient temperature-pressure coupled mathematical model of the wellbore is constructed. The model is then optimized and trained through a composite loss function to achieve high-precision prediction of wellbore pressure, temperature distribution and phase behavior.
It achieves high-precision prediction of wellbore status in CO2 injection and leakage scenarios, provides a reliable safety assessment method, improves the ability to mine local detailed features and global dependencies of multidimensional time series data, and significantly improves prediction accuracy.
Smart Images

Figure CN120744400B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of petroleum engineering and oil and gas field development engineering, and specifically relates to an intelligent prediction method for wellbore operating status based on a hybrid deep learning framework. Background Technology
[0002] CO2 capture, utilization, and storage (CVS) technology is a key emission reduction technology for addressing global climate change. Injecting CO2 captured from industrial sources into deep saline aquifers for geological storage (GCS) has become one of the most promising emission reduction solutions. However, the long-term safety and stability of deep geological storage systems still face challenges, with the CO2 injection process and potential leakage risks being the most prominent. During injection or leakage, CO2 may undergo complex phase evolution due to dynamic changes in temperature and pressure conditions within the wellbore. This unsteady phase transition process significantly alters its rheological properties and transport mechanisms, potentially leading to a series of engineering safety hazards. Therefore, in-depth research into the multiphase flow mechanism and heat transfer characteristics of CO2 in the wellbore environment, and the accurate construction of multi-dimensional pressure and temperature profile prediction models based on well depth and time, will provide important theoretical support and technical assurance for risk assessment and safety management of CO2 geological storage projects.
[0003] Numerical simulation, as a precise and efficient research method, occupies a core position in the risk assessment system of CO2 geological storage projects, especially providing crucial support for the quantitative characterization of CO2 injection dynamics and leakage risks. Computational fluid dynamics-based numerical simulation methods can accurately characterize the phase transition behavior in the CO2 flow-heat transfer coupling process within the wellbore and its impact on the spatiotemporal evolution of the temperature and pressure fields. Compared to traditional analytical methods, while numerical simulation has limitations due to higher computational resource requirements, it possesses irreplaceable advantages in the refined description of complex physical processes such as multiphase flow coupling, phase transition dynamic responses, and thermodynamic non-equilibrium states. However, further breakthroughs are still needed in the accurate characterization of phase transition processes and the improvement of computational efficiency in existing numerical methods.
[0004] In the field of CO2 geological storage, data types exhibit significant diversity and complexity, encompassing a multimodal data system ranging from images, videos, and production time-series data to various engineering parameters. This multimodal nature presents significant challenges to data analysis and modeling, while also driving innovative applications of artificial intelligence in petroleum engineering. However, existing technologies primarily focus on multimodal data processing in reservoir and drilling areas, lacking systematic exploration of the potential correlation mechanisms between cross-modal data. Particularly in the CO2 geological storage scenario, wellbore pressure and temperature profiles exhibit unique dual-sequence characteristics: they display both spatial gradient distribution along well depth and dynamic evolution over time. This complex spatiotemporal coupling makes traditional prediction methods difficult to handle effectively. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes an intelligent prediction method for wellbore operating status based on a hybrid deep learning framework. By integrating an improved dual attention mechanism with a time-fusion Transformer model, it achieves high-precision prediction of the dynamic evolution of multiple parameters in the wellbore during CO2 geological storage. This intelligent prediction method can accurately reconstruct the transient changes in wellbore pressure, temperature distribution, and phase behavior under CO2 injection and leakage scenarios, providing a reliable technical means for the safety assessment of storage systems.
[0006] The technical solution of the present invention is as follows:
[0007] A method for intelligent prediction of wellbore operating status based on a hybrid deep learning framework includes the following steps:
[0008] Step 1: Establish a transient temperature-pressure coupled mathematical model for geological sealing wellbore and perform numerical solutions;
[0009] Step 2: Construct a dual-sequence feature database covering CO2 injection and leakage conditions;
[0010] Step 3: Use a parallel architecture to process dual sequence features and construct an improved dual attention network;
[0011] Step 4: Establish the hybrid deep learning framework DT-DANet by coupling an improved dual attention network and a temporal fusion Transformer;
[0012] Step 5: Use a composite loss function to perform co-optimization training on the hybrid deep learning framework. The output of the framework is the wellbore pressure profile, temperature profile and phase distribution at different time steps.
[0013] Furthermore, in step 1, the process of constructing the transient temperature-pressure coupled mathematical model of the geological storage wellbore is as follows: first, the mass conservation equation, momentum conservation equation, and energy conservation equation of the wellbore are constructed sequentially; then, the CO2 physical property parameter model is constructed.
[0014] The mass conservation equation is:
[0015] ;
[0016] In the formula, To control volume; This refers to the volume fraction of the gas phase. and These represent the densities of the gas phase and the liquid phase, respectively. and These represent the mass fractions of the gas phase and the liquid phase, respectively. and These are the velocities of the gas phase and the liquid phase, respectively. It is the cross-sectional area; For source and sink items; This is the current time step; axial depth;
[0017] The momentum conservation equation is:
[0018] ;
[0019] In the formula, For pressure; For mixed density; Mixing speed; A coefficient characterizing the degree of slip between the gas and liquid phases; The wellbore inclination angle; This refers to the wall shear stress. Let be the perimeter of the cross-sectional area; It is the acceleration due to gravity;
[0020] The energy conservation equation is:
[0021] ;
[0022] In the formula, The temperature of the fluid inside the wellbore; Radial length; The Joule-Thomson coefficient; Enthalpy; This represents the specific heat capacity of CO2 under constant pressure. For heat; For fluid velocity;
[0023] The CO2 physical property model includes thermophysical properties and flow properties; thermophysical properties include CO2 density, specific heat capacity and Joule-Thomson coefficient, and flow properties include CO2 viscosity and the thermal conductivity of various materials.
[0024] Furthermore, in step 1, a temperature-pressure dual iterative algorithm is used to solve the transient temperature-pressure coupled mathematical model. The specific process is as follows:
[0025] Based on the actual wellbore structure parameters and reservoir conditions of the geological sealing well under mining conditions, a wellbore grid is divided to construct a one-dimensional wellbore conceptual model.
[0026] In the first iteration, the parameters are initialized by assigning values to the initial pressure and temperature profiles; then, a CO2 physical property parameter model is established.
[0027] Starting from the second iteration, the pressure profile under the current iteration step is calculated based on the mass conservation equation by considering the temperature profile under the previous iteration step; further, the temperature profile under the current iteration step is calculated by coupling the energy conservation equation based on the pressure profile under the current iteration step and the heat transfer parameters under the previous iteration step; and the heat transfer parameters under the current iteration step are calculated based on the pressure profile, temperature profile, and flow rate extracted from the mesh under the current iteration step.
[0028] During the calculation process of each iteration step, a convergence judgment criterion is established. The calculation is checked by comparing the relative error between the results of two iterations to see if the preset convergence accuracy has been achieved. If the convergence condition is not met, the calculation parameters are adjusted and the iteration calculation is repeated. When the convergence condition is met, the pressure profile calculation result and temperature profile calculation result corresponding to the current time step are output and used as the initial condition for the next iteration step. The iteration step continues to advance the solution process until the entire transient temperature and pressure coupling calculation process of the wellbore is completed.
[0029] Further, the specific process of step 2 is as follows: In the CO2 injection scenario, using time step, injection pressure, injection temperature, injection rate, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters as input parameters, the wellbore pressure, temperature profile, and CO2 phase distribution at each time step are solved based on the wellbore transient temperature-pressure coupled mathematical model as the output response, thus establishing a dual-sequence feature database for CO2 injection conditions; In the CO2 leakage scenario, using time step, wellhead leakage pressure, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters as input parameters, the wellbore pressure profile, temperature profile, and CO2 phase distribution at each time step are solved based on the wellbore transient temperature-pressure coupled mathematical model as the output response, thus establishing a dual-sequence feature database for CO2 leakage conditions; The two databases are combined to construct a dual-sequence feature database covering both CO2 injection and leakage conditions.
[0030] Furthermore, in step 3, the improved dual attention network extracts local spatiotemporal features through two complementary attention mechanisms: a masked self-attention mechanism and a convolution-enhanced temporal pattern attention mechanism. Specifically, the masked self-attention mechanism extracts spatial distribution features along the wellbore depth, while the temporal pattern attention mechanism extracts local temporal features within the CO2 injection and leakage operation cycle.
[0031] The basic principle of masked self-attention mechanism is to control the direction of information flow through masking operations, while enhancing the information representation of depth position through relative position encoding; given an input sequence ,in Indicates the first Feature vectors at each wellbore depth location, mask matrix The design follows the principle of unidirectional information flow:
[0032] ;
[0033] In the formula, Index for wellbore depth location; The source depth location is defined by the following location encoding equation:
[0034] ;
[0035] ;
[0036] In the formula, For encoding functions; For encoding dimension index; This represents the total number of feature dimensions. A scaling factor used to control periodic changes between dimensions;
[0037] The specific working process of the temporal pattern attention mechanism is as follows: After preprocessing, a series of hidden state vectors are extracted from the temporal data at different runtimes, forming a hidden state matrix. Using a one-dimensional convolution kernel along the hidden state matrix Convolution operation is performed on the row vectors to obtain the time-series pattern matrix. The specific formula is as follows:
[0038] ;
[0039] In the formula, For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; The index number represents the receptive field width of the one-dimensional convolution kernel; The width of the receptive field of the one-dimensional convolution kernel; For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; For the first The filter of the nth filter Each weight; This is the current time step; Let be the total number of time steps; defining the scoring function as the sigmoid function, and using it as the activation function for attention weight calculation, then the expression for weight calculation is:
[0040] ;
[0041] ;
[0042] In the formula, For scoring functions; for The Row vectors; For transpose; For the current time step The hidden layer state; This is the weight matrix for autonomous learning; These are the normalized weight parameters; It is the sigmoid function;
[0043] Using weight matrix to apply time series pattern matrix Perform a weighted sum on each row to obtain the current time step. attention vector The formula is:
[0044] ;
[0045] In the formula, The total number of features of the input variables for the temporal pattern attention mechanism;
[0046] Subsequently, attention vector and hidden layer state After weighted linear mapping and superposition, the output value of the temporal pattern attention mechanism is obtained, as shown in the following formula:
[0047] ;
[0048] in, for The output value at that time; To predict the length of time; and These are the weight parameter matrices for the hidden layer state and the attention vector, respectively.
[0049] Furthermore, in step 4, the temporal fusion Transformer module uses the local spatiotemporal features extracted by the improved dual attention network as input, where the depth sequence information is encoded by a masked self-attention mechanism, and the time series pattern is represented by a temporal pattern attention mechanism. In terms of feature processing, the temporal fusion Transformer module adopts a differentiated encoding strategy: for static variables such as wellbore depth and formation attributes, its long-term impact features are extracted by a static covariate encoder; for dynamic variables such as injection temperature, pressure, and CO2 rate, feature selection is performed by a variable selection network, and its dynamic evolution process is modeled using a sequence-to-sequence architecture.
[0050] The hybrid deep learning framework DT-DANet employs a multi-stage training strategy: First, deep sequence data is processed through a masked self-attention mechanism to preserve the directional features of CO2 flow; simultaneously, time series data is encoded through a temporal pattern attention mechanism to accurately capture dynamic evolution patterns; subsequently, these local spatiotemporal features are input into a temporal fusion Transformer module, which models global dependencies through a variable selection network and a time-aware processing layer, and integrates historical and static feature information; finally, after nonlinear transformation through a gated residual network and a multi-head attention mechanism, the framework outputs a comprehensive prediction result including wellbore pressure profile, temperature profile, and CO2 phase distribution.
[0051] Furthermore, in step 5, the composite loss function consists of a main loss function and an auxiliary loss function;
[0052] The main loss formula is:
[0053] ;
[0054] ;
[0055] ;
[0056] In the formula, Main loss function; coefficients and These are different weighting factors; and These are the prediction errors for wellbore temperature and pressure, respectively. , The first Predicted and actual values of wellbore temperature; This represents the total number of wellbore temperatures. , The first The predicted and actual values of the pressure; This represents the total number of pressures.
[0057] The auxiliary loss functions include the temporal attention consistency loss function and the physical constraint loss function, and the formulas are as follows:
[0058] ;
[0059] ;
[0060] In the formula, Let the temporal attention consistency loss function be used. The physical constraint loss function; , These are the current time steps. Previous time step The temporal attention matrix; This represents the total time step. and It is used to penalize unrealistic gradients in wellbore pressure and temperature predictions, respectively; and These are the weight coefficients in different loss functions;
[0061] Composite loss function The formula is:
[0062] ;
[0063] The Adam optimizer combined with an adaptive learning rate scheduling strategy is used for model training optimization. The training optimization process adopts a two-stage adjustment strategy: in the initial warm-up stage, the learning rate is gradually increased to avoid parameter oscillations in the early stage of training; then, in the decay stage, the learning rate is dynamically adjusted to ensure that the model converges stably to the global optimum.
[0064] The beneficial technical effects of this invention are as follows: This invention addresses the dual-sequence characteristics of wellbore operation during CO2 geological storage by establishing a GCS (Gas-Coefficient of Performance) wellbore transient temperature-pressure coupling mathematical model that considers CO2 phase transition behavior, and constructing a dual-sequence feature database covering CO2 injection / leakage conditions. Based on a masked self-attention mechanism, depth sequence features of wellbore profile parameters are extracted. Simultaneously, a time-series pattern attention mechanism is combined to accurately capture the dynamic evolution of wellbore operation, achieving effective fusion of wellbore depth sequence and time-series features. The intelligent prediction method for GCS wellbore operation established in this invention, by integrating an improved dual-attention mechanism with a time-fusion Transformer architecture, achieves simultaneous mining of local detailed features and global dependencies in multi-dimensional time-series data. The multi-level deep learning parallel architecture design further enhances the model's ability to capture multi-scale sequence features, enabling it to accurately predict transient pressure propagation characteristics, dynamic evolution of the temperature field, and long-term system response. Attached Figure Description
[0065] Figure 1 This is a flowchart of the intelligent prediction method for wellbore operating status based on a hybrid deep learning framework, as described in this invention.
[0066] Figure 2 This is a flowchart of the solution process for the GCS wellbore transient temperature-pressure coupling mathematical model of the present invention.
[0067] Figure 3 This is a schematic diagram of the dual sequence features in the GCS wellbore of the present invention.
[0068] Figure 4 This is a comparison chart of the predicted and actual values of the wellbore pressure profile in an embodiment of the present invention.
[0069] Figure 5 This is a comparison chart of the predicted and actual values of the wellbore temperature profile in an embodiment of the present invention.
[0070] Figure 6 This is a comparison chart of the loss values of various loss functions in the CO2 injection scenario in an embodiment of the present invention.
[0071] Figure 7 This is a comparison chart of the loss values of various loss functions in a CO2 leakage scenario in an embodiment of the present invention.
[0072] Figure 8 This is a comparison diagram of the actual and predicted values of the wellbore pressure profile in the CO2 injection scenario of this invention; wherein, (a) is a schematic diagram of the actual value and (b) is a schematic diagram of the predicted value.
[0073] Figure 9 This is a schematic diagram illustrating the relative error between the predicted and actual values of the wellbore pressure profile in a CO2 injection scenario according to an embodiment of the present invention.
[0074] Figure 10 This is a comparison diagram of the actual and predicted values of the wellbore pressure profile in a CO2 leakage scenario according to an embodiment of the present invention; wherein, (c) is a schematic diagram of the actual value and (d) is a schematic diagram of the predicted value.
[0075] Figure 11 This is a schematic diagram illustrating the relative error between the predicted and actual values of the wellbore pressure profile in a CO2 leakage scenario according to an embodiment of the present invention.
[0076] Figure 12 This is a comparison diagram of the actual and predicted values of the wellbore temperature profile in the CO2 injection scenario of this invention; wherein, (e) is a schematic diagram of the actual value and (f) is a schematic diagram of the predicted value.
[0077] Figure 13 This is a schematic diagram illustrating the relative error between the predicted and actual values of the wellbore temperature profile in a CO2 injection scenario according to an embodiment of the present invention.
[0078] Figure 14 This is a comparison diagram of the actual and predicted values of the wellbore temperature profile in a CO2 leakage scenario according to an embodiment of the present invention; wherein, (g) is a schematic diagram of the actual value and (h) is a schematic diagram of the predicted value.
[0079] Figure 15 This is a schematic diagram illustrating the relative error between the predicted and actual values of the wellbore temperature profile in a CO2 leakage scenario according to an embodiment of the present invention.
[0080] Figure 16 This is a schematic diagram of the actual phase distribution of the wellbore in the CO2 injection scenario of this invention.
[0081] Figure 17 This is a schematic diagram of the predicted phase distribution of the wellbore in a CO2 injection scenario according to an embodiment of the present invention.
[0082] Figure 18 This is a schematic diagram of the actual phase distribution of the wellbore in a CO2 leakage scenario according to an embodiment of the present invention.
[0083] Figure 19 This is a schematic diagram of the predicted phase distribution of the wellbore in a CO2 leakage scenario according to an embodiment of the present invention. Detailed Implementation
[0084] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0085] This invention establishes a multiphase flow-heat transfer coupled mathematical model for geological sequestration (GCS) wellbores that considers CO2 phase change behavior, achieving accurate characterization of complex physical processes within the wellbore. Addressing the unique dual-sequence characteristics of wellbore parameters during CO2 geological sequestration, this invention establishes a dual-channel feature extraction architecture based on masked self-attention and temporal pattern attention mechanisms. Furthermore, by combining temporal fusion Transformer technology, it forms an intelligent prediction method for wellbore operating status based on a hybrid deep learning framework. This method effectively captures the dependencies between different depth sequences and time scales, significantly improving the prediction accuracy of complex multiphase flow-heat transfer phenomena during CO2 injection / leakage. Figure 1 As shown, the present invention includes the following steps:
[0086] Step 1: Establish a mathematical model of transient temperature-pressure coupling in the GCS wellbore and solve it numerically; to accurately predict and effectively control the wellbore state and phase behavior during CO2 injection and leakage, it is urgent to establish a reliable numerical simulation tool. Based on the physical characteristics of the heat-fluid coupling process and engineering practice, a corresponding mathematical model was established, and the following basic assumptions were proposed: (1) The quasi-steady-state assumption is used to deal with the heat transfer process in the wellbore, while considering the unsteady heat exchange at the wellbore-formation interface. The physical basis of this assumption lies in the difference in characteristic time scale between fluid flow and formation thermal response; (2) In order to accurately characterize the CO2 seepage temperature field, radial and axial heat conduction are considered in the wellbore, while only the radial heat transfer term is retained in the formation area, and the radiation heat transfer effect is reasonably ignored based on the low temperature condition; (3) In the initial state, the wellbore system and the surrounding formation are in thermal equilibrium, and the temperature values at each corresponding depth point along the vertical direction are equal; (4) The linear geothermal gradient is used to describe the initial formation temperature field distribution characteristics; (5) The influence of convective heat transfer and internal heat source of rock is ignored, and only the heat conduction mechanism is considered. These assumptions, while ensuring model accuracy, significantly improve computational efficiency and provide theoretical support for subsequent numerical solutions and engineering predictions.
[0087] The process of constructing the GCS wellbore transient temperature-pressure coupling mathematical model is as follows:
[0088] First, the mass conservation equation, momentum conservation equation, and energy conservation equation for the wellbore are constructed. The flow and heat transfer of CO2 inside the wellbore strictly follow the principle of mass conservation. For an infinitesimal control volume, the mass conservation equation can be expressed as:
[0089] (1);
[0090] In the formula, To control volume; This refers to the volume fraction of the gas phase. and These represent the densities of the gas phase and the liquid phase, respectively. and These represent the mass fractions of the gas phase and the liquid phase, respectively. and These are the velocities of the gas phase and the liquid phase, respectively. It is the cross-sectional area; For source and sink items; This is the current time step; This represents the axial depth.
[0091] In the momentum conservation equation, the pressure change of CO2 fluid per unit length along the wellbore is determined by the gravity gradient, frictional resistance, and acceleration gradient. The specific form of the momentum conservation equation is:
[0092] (2);
[0093] In the formula, For pressure; For mixed density; Mixing speed; A coefficient characterizing the degree of slip between the gas and liquid phases; The wellbore inclination angle; This is the wall shear stress, which is related to the wall roughness and the flow state. Let be the perimeter of the cross-sectional area; This is the acceleration due to gravity.
[0094] To accurately characterize the gas-liquid two-phase flow characteristics and interphase slip effect during the CO2 phase transition process, a drift flow model is used to describe the multiphase flow dynamics. This model effectively portrays the interphase slip phenomenon caused by differences in physical properties by equating the gas-liquid two-phase system to a quasi-single-phase fluid and introducing interphase relative velocity parameters. Specifically, the model quantifies the interphase velocity difference by defining two key parameters: profile factor and drift velocity. Based on the theoretical framework of the drift flow model, the gas phase velocity within the wellbore is... and liquid phase velocity It can be expressed as follows:
[0095] (3);
[0096] (4);
[0097] In the formula, This is the profile factor, used to calculate the effects of local gas saturation and velocity distribution across the pipe cross section; Drift speed; The characteristic density is given. By solving the above equations simultaneously, the phase velocities of the gaseous and liquid components in the CO2-saltwater mixture can be determined, thus allowing for an accurate solution to the mass conservation equation.
[0098] When constructing the wellbore energy conservation equation, a partitioned modeling method is adopted to accurately characterize the differentiated heat transfer mechanisms in the CO2 flow process. Based on the differences in heat transfer characteristics, the computational domain is divided into two characteristic regions: the first region covers the one-dimensional steady-state heat transfer process from the wellbore center to the outer boundary of the cement sheath. For the heat transfer behavior of each wellbore structural component (tubing, annulus, casing, and cement sheath) within this region, for an infinitesimal control volume, the process can be expressed as:
[0099] (5);
[0100] In the formula, For heat; Radial length; The total radius of the wellbore; The overall heat transfer coefficient; For fluid velocity; The temperature of the fluid inside the wellbore; This refers to the temperature at the interface between the cement sheath and the formation.
[0101] The second region involves an unsteady heat transfer process from the outer boundary of the cement sheath to the surrounding strata. For an infinitesimally small control volume, the heat transfer kinetics of this process can be expressed as:
[0102] (6);
[0103] In the formula, The thermal conductivity of the formation; Formation temperature; It is a dimensionless transient heat transfer function.
[0104] By coupling the physical processes of the two heat transfer regions mentioned above, a complete wellbore-formation thermal coupling mathematical model was constructed, as shown in formula (7). This model considers both radial heat transfer and axial temperature gradient, and can accurately characterize the temperature distribution characteristics of CO2 during its flow along the wellbore.
[0105] (7);
[0106] The flow and heat transfer of CO2 within the wellbore strictly follow the principle of energy conservation. For an infinitesimal control volume, the complete energy conservation equation can be expressed as:
[0107] (8);
[0108] In the formula, The Joule-Thomson coefficient; Enthalpy; Let be the specific heat capacity of CO2 under constant pressure. This energy conservation equation simultaneously considers the enthalpy change and the temperature change caused by the pressure gradient (Joule-Thomson effect), which is crucial for accurately predicting the temperature field distribution during CO2 flow in a wellbore.
[0109] During CO2 flow, the fluid within the wellbore undergoes complex phase change dynamics. Influenced by both geothermal temperature and pressure gradients, CO2 exhibits significant non-equilibrium phase change characteristics, resulting in drastic changes in its thermophysical properties, which profoundly affect the flow-heat transfer coupling process. Specifically, when CO2 migrates from a high-pressure reservoir to a low-pressure wellhead, if the system pressure crosses the phase equilibrium boundary, a flash phase change phenomenon will occur. This flash process is accompanied by latent heat absorption and rapid volume expansion. During this process, the Joule-Thomson effect of CO2 couples with the thermal effect of the latent heat of phase change, jointly determining the trend of fluid temperature change. Based on the Span-Wagner equation, the Joule-Thomson coefficient can be expressed as:
[0110] (9);
[0111] in, For temperature; This represents the molar volume of the gas.
[0112] In the critical region of CO2 phase transition, the Joule-Thomson effect and the latent heat of phase transition exhibit significant thermodynamic coupling, resulting in a strongly nonlinear temperature field. This coupling effect significantly alters key fluid properties such as viscosity and density, thereby affecting flow characteristics and heat transfer mechanisms within the wellbore. The energy conservation equation in this invention considers these coupled thermal effects and characterizes them uniformly through pressure gradient and temperature conduction terms.
[0113] Secondly, a CO2 property parameter model is constructed. Based on the transport characteristics of CO2 in the saline aquifer, its property parameters can be divided into thermophysical properties and flow properties. Thermophysical properties mainly include CO2 density, specific heat capacity, and Joule-Thomson coefficient, while flow properties mainly include CO2 viscosity and the thermal conductivity of various materials. For different operating conditions, this invention employs differentiated property calculation methods. In the pure CO2 injection condition, the Span-Wagner equation of state is used to calculate the property parameters. This equation, based on Helmholtz free energy, can accurately describe the key thermodynamic parameters of CO2 over a wide temperature and pressure range. During CO2 leakage, the mixing of CO2 and brine causes the fluid properties to deviate from the ideal state. Therefore, an improved PR equation of state is used to calculate the thermodynamic properties of the CO2-brine mixture. By combining mixing rules and binary interaction parameters, this method accurately represents the non-ideal characteristics of the mixture, especially the thermodynamic behavior near the critical point.
[0114] The transient temperature-pressure coupled mathematical model is a complex multiphysics problem, involving mass conservation equations, momentum conservation equations, and energy conservation equations. To obtain a high-precision numerical solution, a coupled temperature-pressure dual iterative algorithm is employed for solution. The specific implementation process is as follows: In the axial dimension, the wellbore is discretized into... Each computational unit employs the finite volume method to integrate the mass, momentum, and energy conservation equations within each unit, forming a system of nonlinear equations. The temperature and pressure fields are solved simultaneously using the Newton-Raphson iterative method, with CO2 physical properties updated in each iteration until convergence conditions are met. In the radial dimension, a multi-layer heat transfer model is established, including the tubing, annulus, casing, cement sheath, and formation. The overall heat transfer coefficient is derived by calculating the thermal resistance between adjacent layers and coupled to the energy conservation equations to update the temperature field distribution. The detailed solution process for the GCS wellbore transient temperature-pressure coupling mathematical model is as follows: Figure 2As shown, specifically: based on the established transient temperature-pressure coupled mathematical model, combined with the actual wellbore structure parameters and reservoir condition configuration (i.e., setting basic parameters) of the GCS well under mining conditions, a wellbore mesh is generated to construct a one-dimensional wellbore conceptual model. In the first iteration, parameter initialization is performed, assigning values to the initial pressure profile (the pressure distribution throughout the wellbore from the wellhead to the bottom) and temperature profile (the temperature distribution throughout the wellbore from the wellhead to the bottom). Secondly, a complete CO2 physical property parameter model is established, which can accurately describe the changes in the physical properties of CO2 under different temperature and pressure conditions. Starting from the second iteration, considering the temperature profile of the previous iteration, the pressure profile of the current iteration is calculated based on the mass conservation equation. Further, based on the pressure profile of the current iteration and the heat transfer parameters of the previous iteration, the temperature profile of the current iteration is calculated by coupling the energy conservation equation. Based on the pressure profile, temperature profile, and flow rate extracted from the mesh of the current iteration, the heat transfer parameters of the current iteration are calculated. During each iteration step, a strict convergence criterion is established. The relative error between two iterations is compared to verify whether the calculation has reached the preset convergence accuracy. If the convergence condition is not met, the calculation parameters are adjusted and the iteration is repeated to ensure the stability and accuracy of the numerical solution. When the convergence condition is met, the pressure profile and temperature profile calculation results corresponding to the current time step are output and used as the initial conditions for the next iteration step. The iteration process continues until the entire transient temperature and pressure coupling calculation process of the wellbore is completed.
[0115] Step 2: Construct a dual-sequence feature database covering CO2 injection and leakage conditions;
[0116] During CO2 injection and leakage, wellbore pressure, temperature profiles, and CO2 phase distribution exhibit significant multidimensional dynamic characteristics. These parameter fields are influenced by the combined effects of injection conditions, geothermal gradient, and pressure gradient, demonstrating clear spatiotemporal evolution patterns. Specifically: First, the wellbore and temperature profiles show typical depth dependence, with their gradients increasing above the critical depth before stabilizing and reaching dynamic equilibrium with the formation environment. Second, the phase transition process exhibits strong nonlinear characteristics, with its spatial distribution closely coupled to the temperature-pressure field. These distribution patterns indicate that a multi-scale characterization method considering both depth and time dimensions is necessary to accurately describe the dynamic evolution of wellbore thermodynamic parameters.
[0117] Therefore, this invention, based on the data characteristics of the two most representative scenarios in CO2 geological storage projects, constructs a dual-sequence feature database covering CO2 injection / leakage scenarios by dividing the data into CO2 injection and leakage scenarios. In the CO2 injection scenario, time step, injection pressure, injection temperature, injection rate, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters are used as input parameters. A high-precision wellbore transient temperature-pressure coupled mathematical model is used to solve for the wellbore pressure, temperature profile, and CO2 phase distribution at each time step, serving as the output response, thus establishing a dual-sequence feature database for CO2 injection scenarios. In the CO2 leakage scenario, time step, wellhead leakage pressure, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters are used as input parameters. A high-precision wellbore transient temperature-pressure coupled mathematical model is used to solve for the wellbore pressure, temperature profile, and CO2 phase distribution at each time step, serving as the output response, thus establishing a dual-sequence feature database for CO2 leakage scenarios. By combining the two databases mentioned above, a dual-sequence feature database covering CO2 injection and leakage conditions is constructed for the subsequent training process of the intelligent prediction method for GCS wellbore operating status.
[0118] Step 3: Extract spatial distribution features along the wellbore depth using a masked self-attention mechanism, dynamically analyze the wellbore state evolution law using a temporal pattern attention mechanism, and use a parallel architecture to process dual sequence features to construct an improved dual attention network;
[0119] To effectively capture wellbore depth sequence features, this invention proposes a depth sequence feature extraction method based on a mask self-attention mechanism. This method achieves efficient modeling of depth sequence data through a specialized mask matrix design and positional encoding scheme. The basic principle of the mask self-attention mechanism is to control the direction of information flow through mask operations, while simultaneously enhancing the representation of depth position information through relative positional encoding. Specifically, given an input sequence... ,in Indicates the first Feature vectors at each wellbore depth location, mask matrix The design follows the principle of unidirectional information flow:
[0120] (10);
[0121] In the formula, This is the wellbore depth index, i.e., the currently calculated depth position; This refers to the source depth location, i.e., the source depth location of the input information. This indicates that information transmission from the current depth location and locations above it is permitted. This design prevents information from being transmitted from deeper locations. It strictly adheres to the directional propagation characteristics of wellbore physics, minimizing spurious associations learned by the model that do not conform to physical laws, and effectively improving the stability and convergence efficiency of the training process. The specific location encoding equation is as follows:
[0122] (11);
[0123] (12);
[0124] In the formula, For encoding functions; For encoding dimension index; This represents the total number of feature dimensions. This is a scaling factor used to control periodic variations between dimensions. This coding mechanism accurately captures the relative relationships between different wellbore depths, effectively characterizing the continuous variation of wellbore state parameters along the depth sequence, thereby improving its predictive performance across different depth ranges.
[0125] The CO2 injection and leakage process exhibits strong multi-scale time dependence due to its multivariate temporal characteristics (including injection temperature, pressure, and injection rate), encompassing both short-term fluctuations in physical properties caused by local phase transitions and long-term stable trends. To address these characteristics, this invention develops a convolution-enhanced temporal pattern attention mechanism to extract local temporal features within the CO2 injection and leakage operation cycle. After preprocessing, time-series data from different operating times are used to extract a series of hidden state vectors, which form a hidden state matrix. To extract key temporal pattern features from this matrix, a one-dimensional convolution operation is used to convolve the hidden state matrix. A one-dimensional convolution kernel is used to convolve along the hidden state matrix... Convolution operation is performed on the row vectors to obtain the time-series pattern matrix. The specific formula is as follows:
[0126] (13);
[0127] In the formula, For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; The index number represents the receptive field width of the one-dimensional convolution kernel; The width of the receptive field of the one-dimensional convolution kernel; For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; For the first The filter of the nth filter Each weight; This is the current time step; Let be the total number of time steps. Furthermore, if the scoring function is defined as the sigmoid function and used as the activation function for attention weight calculation, then the weight calculation expressions are as follows:
[0128] (14);
[0129] (15);
[0130] In the formula, For scoring functions; for The Row vectors; For transpose; For the current time step The hidden layer state; This is the weight matrix for autonomous learning; These are the normalized weight parameters; The sigmoid function is used. The weight matrix is applied to the time series pattern matrix. Perform a weighted sum on each row to obtain the current time step. attention vector This vector comprehensively considers the influence of all row vectors on the current hidden layer state. Its calculation formula is:
[0131] (16);
[0132] In the formula, The total number of features is the input variable for the temporal pattern attention mechanism. Subsequently, the attention vector... and hidden layer state After weighted linear mapping and superposition, the output value of the temporal pattern attention mechanism is obtained, as shown in the following formula:
[0133] (17);
[0134] in, for The output value at that time; To predict the length of time; and These are the weight parameter matrices for the hidden layer state and the attention vector, respectively. The temporal pattern attention mechanism analyzes the correlation between historical state features and the current moment, and can dynamically adjust the weight distribution on the feature dimensions, thereby more comprehensively capturing the dynamic evolution patterns of temporal data.
[0135] By integrating these complementary attention mechanisms, this invention develops an improved dual attention network specifically designed for analyzing and processing transient pressure, temperature profiles, and CO2 phase distributions with dual-sequence characteristics in CO2 geological storage. This enhanced architecture effectively captures pressure... ,temperature ,flow The spatial dependence and temporal evolution patterns of CO2 physical properties in depth sequences provide a reliable theoretical analysis tool for the safety assessment and risk prediction of CO2 geological storage systems. Figure 3 This study presents GCS wellbore data with dual-sequence characteristics, effectively characterizing the coupling properties of depth and time series. , , , These are the pressure, temperature, flow rate, and CO2 physical properties of the first wellbore grid.
[0136] Step 4: Establish the hybrid deep learning framework DT-DANet by coupling an improved dual attention network and a temporal fusion Transformer to form an intelligent prediction method for GCS wellbore operating status. This invention develops a hybrid deep learning framework DT-DANet, which organically combines an improved dual attention network with a temporal fusion Transformer architecture to accurately predict the spatiotemporal distribution of wellbore pressure and temperature profiles during CO2 injection and leakage, and analyzes the evolution law of CO2 phase states. After processing deep sequence and time series data through masked self-attention mechanism and temporal pattern attention mechanism respectively, it is necessary to integrate and dimensionally align these local features to output wellbore pressure and temperature profiles at different time steps and predict CO2 phase state distribution. To this end, this invention designs a global feature extraction module based on the temporal fusion Transformer. Its main goal is to achieve comprehensive characterization and prediction of the wellbore parameter field at different time steps by using the local spatiotemporal features extracted by the deep fusion improved dual attention network module and the global dependencies captured by the temporal fusion Transformer module. The temporal fusion Transformer module uses local spatiotemporal features extracted by an improved dual attention network as input. Deep sequence information is encoded using a masked self-attention mechanism, while the time series pattern is represented by a temporal pattern attention mechanism. In feature processing, the temporal fusion Transformer module employs a differential encoding strategy: for static variables such as wellbore depth and formation properties, a static covariate encoder extracts their long-term impact features; for dynamic variables such as injection temperature, pressure, and CO2 rate, a variable selection network filters features and utilizes a sequence-to-sequence architecture to model their dynamic evolution. Specifically, the variable selection network selects relevant input variables for each time step, strengthening the key controlling factors for the prediction task and weakening or discarding irrelevant information, thereby optimizing the representation of input features and making the model more focused on accurate prediction of the target.
[0137] The DT-DANet hybrid deep learning framework is established by coupling an improved dual-attention network and a temporal fusion Transformer. This framework employs a multi-stage training strategy: First, deep sequence data (pressure profile, temperature profile) is processed through a masked self-attention mechanism to effectively preserve the directional characteristics of CO2 flow; simultaneously, time series data (injection pressure, temperature, and CO2 rate) is encoded through a temporal pattern attention mechanism to accurately capture its dynamic evolution. Subsequently, these local spatiotemporal features are input into the temporal fusion Transformer module, where a variable selection network and a time-aware processing layer model global dependencies and integrate historical and static feature information. Finally, after nonlinear transformation through a gated residual network and a multi-head attention mechanism, the framework outputs a comprehensive prediction result including wellbore pressure profile, temperature profile, and CO2 phase distribution. Specifically, the variable selection network performs feature selection, while the time-aware processing layer enhances the model's ability to extract information about time non-stationarity, the impact of time delay, and dynamic trends by explicitly encoding time intervals and periodic features.
[0138] Step 5: A composite loss function is used to co-optimize and train the hybrid deep learning framework. The framework outputs wellbore pressure profiles, temperature profiles, and phase distributions at different time steps, achieving accurate predictions of transient pressure propagation characteristics, dynamic evolution of the temperature field, and long-term system performance. The hybrid deep learning framework DT-DANet uses multiple loss functions for joint training. This process combines the main loss function for the prediction task with the auxiliary loss function for the constraints. This joint training process enhances the physical interpretability of the model while ensuring prediction accuracy. Specifically, the main loss term adopts the mean squared error form, rigorously quantifying the deviation between the predicted temperature and pressure field distributions and the numerical simulation results. Its mathematical expression is:
[0139] (18);
[0140] (19);
[0141] (20);
[0142] In the formula, Main loss function; coefficients and These are different weighting factors used to balance the relative importance of wellbore temperature and pressure prediction in CO2 injection and leakage processes; and These are the prediction errors for wellbore temperature and pressure, respectively. , The first Predicted and actual values of wellbore temperature; This represents the total number of wellbore temperatures. , The first The predicted and actual values of the pressure; This represents the total number of pressures.
[0143] To enhance the physical plausibility and interpretability of the model, several auxiliary loss functions were incorporated during training: Temporal Attention Consistency Loss ensures a smooth transition in attention distribution between adjacent time steps, preventing non-physical jumps in prediction results; Physical Constraint Loss penalizes unreasonable gradient changes in pressure and temperature predictions along the wellbore depth. These auxiliary loss functions are optimized in conjunction with the main loss term, forming a composite loss function.
[0144] (twenty one);
[0145] (twenty two);
[0146] (twenty three);
[0147] In the formula, Let the temporal attention consistency loss function be used. The physical constraint loss function; It is a composite loss function; , These are the current time steps. Previous time step The temporal attention matrix; This represents the total time step. and It is used to penalize unrealistic gradients in wellbore pressure and temperature predictions, respectively. and These are the weighting coefficients in different loss functions, used to balance the importance of different loss terms.
[0148] A model training optimization strategy employs the Adam optimizer combined with an adaptive learning rate scheduling approach. This training mechanism utilizes a two-stage adjustment strategy: in the initial warm-up phase, the learning rate is gradually increased to effectively avoid parameter oscillations in the early stages of training; subsequently, in the decay phase, the learning rate is dynamically adjusted to ensure the model stably converges to the global optimum. This comprehensive training strategy not only significantly improves the model's prediction accuracy for wellbore pressure and temperature profiles, but more importantly, ensures that the model output strictly follows the physical laws of CO2 flow and heat transfer processes, while maintaining the interpretability of the attention mechanism. Ultimately, it can be reliably generalized to various CO2 geological storage scenarios.
[0149] To demonstrate the feasibility and superiority of the present invention, the following embodiments are provided.
[0150] Taking a GCS well in an actual CO2 geological storage project as an example, a one-dimensional wellbore conceptual model was constructed to systematically simulate the CO2 injection process and potential wellbore leakage scenarios in a saline aquifer. The model was designed strictly based on the actual wellbore structure and reservoir geological conditions, and its key wellbore structure and reservoir condition configuration parameters are shown in Table 1.
[0151] Table 1 Wellbore Structure and Reservoir Condition Configuration Parameters
[0152] .
[0153] Based on the above data, the specific steps for predicting the operating status of a target GCS wellbore under CO2 injection and leakage scenarios using the method of this invention are as follows: Following the process in step 1, a transient temperature-pressure coupled mathematical model of the GCS wellbore considering CO2 phase change behavior is established. Based on the set wellbore structural parameters and reservoir condition configuration, a one-dimensional wellbore conceptual model is constructed for verification of the transient temperature-pressure coupled mathematical model. Figure 4 , Figure 5 These are comparison charts showing the predicted and actual values of wellbore pressure and temperature profiles, respectively. Figure 4 and Figure 5 It can be seen that the numerical calculation results (predicted values) and the mine test data (actual values) show good consistency. Specifically, the relative error range between the pressure profile predicted by the model and the actual measured values is 0.23%~1.18%, while the error of the temperature profile prediction is controlled within the range of 0.11%~0.78%. This verification result shows that the established mathematical model has excellent prediction accuracy, and the error between its calculation results and the field measured data fully meets the engineering accuracy requirements.
[0154] Following the process in step 2, a dual-sequence feature database covering CO2 injection / leakage scenarios is constructed. This embodiment conducts numerical simulations based on two of the most representative scenarios in actual CO2 geological storage projects. In the CO2 injection scenario simulation, the complete process of CO2 injection along the wellbore is simulated by setting different injection pressures, temperatures, and injection rates. The specific injection parameters are defined as follows: temperature variation range of -20℃ to 40℃, pressure variation of 5MPa to 30MPa, and injection rate variation of 5kg / s to 80kg / s. The wellbore configuration parameters mainly include wellbore depth, diameter, and surface roughness, which are predetermined during the wellbore design phase and remain constant throughout the operation. These parameter settings cover various situations that may be encountered in actual engineering applications, helping to comprehensively evaluate the model's predictive ability under different injection scenarios. Therefore, the input parameters in the CO2 injection scenario include: time step, injection pressure, injection temperature, injection rate, initial wellbore temperature distribution, initial wellbore pressure distribution, and wellbore configuration parameters. The output parameters include the pressure and temperature profiles along the wellbore and the axial distribution of CO2 phases within discrete time intervals. In the CO2 leakage simulation, leakage caused by valve failure is simulated by setting different wellhead leakage pressures (with constant pressure boundary conditions at the wellhead), specifically ranging from 1 MPa to 10 MPa. The input parameters for this scenario include the time step, wellhead leakage pressure, initial wellbore temperature distribution, initial wellbore pressure distribution, and wellbore configuration parameters. The corresponding output parameters are the pressure and temperature profiles within the wellbore and the axial distribution of the CO2 phase state during discrete time intervals during the leakage process. Considering the differences in input parameters between the two scenarios, a dedicated prediction model was developed for each scenario to ensure excellent performance under both typical operating conditions, significantly improving the reliability and practical value of engineering applications.
[0155] This embodiment generates 410 wellbore numerical simulation schemes for two typical operating conditions: CO2 injection and leakage. Of these, 300 schemes are used for model training, 80 schemes for hyperparameter optimization using a hybrid deep learning framework, and the remaining models are used to evaluate model generalization ability. Each simulation scheme has a full runtime of 2400 seconds: in the injection condition, the injection rate parameter is dynamically adjusted at 600-second intervals; in the leakage condition, a 400-second pre-injection phase and a 2000-second leakage process are set.
[0156] Following the process in step 3, a hybrid deep learning framework is established, and its topology is adjusted. This invention establishes the hybrid deep learning framework DT-DANet by coupling an improved dual attention network and a temporal fusion Transformer. This framework employs a hierarchical data processing flow, first extracting local spatiotemporal features [B, T] through an improved dual attention network. step [,Q, U], where B is the batch size and T is the batch size.step Let Q be the time step, Q be the number of discrete grid cells in the wellbore, and U be the dimension of the hidden layer features. These features are then input into the temporal fusion Transformer module for global feature extraction. In the feature processing stage, the framework employs a differentiated strategy to handle static and dynamic variables. Static variables (wellbore depth distribution and formation properties) are encoded into [B, Q, Hs] feature representations through a linear transformation layer, while dynamic variables (CO2 injection pressure, temperature, and rate) are evaluated using a gating mechanism to calculate importance scores [B, T, Hd], enabling dynamic selection of key parameters. Here, T is temperature, Hs is the hidden dimension of the static features, and Hd is the hidden dimension of the dynamic features. This design effectively balances the representation requirements of time-invariant and time-varying features. The temporal fusion Transformer module extracts complex dual-sequence features through multi-layer processing. The temporal processing layer combines positional encoding to capture temporal dependencies, and a multi-head attention mechanism processes features at different time scales in parallel, with each attention head focusing on transient responses and long-term evolution patterns, respectively. The feature transformation network establishes the interaction between static wellbore properties and dynamic injection parameters through a cross-attention mechanism. Ultimately, the framework interprets the importance of each input feature through layer analysis and outputs wellbore pressure and temperature profiles [B, T] via a prediction layer. step [Q, 2]. This end-to-end architecture not only preserves the fine structure of local features but also achieves effective modeling of global dependencies. A systematic hyperparameter optimization strategy significantly improves model performance, and differentiated configurations are implemented for the characteristics of CO2 injection and leakage scenarios. Table 2 details the specific hyperparameters of the hybrid deep learning framework. In terms of training settings, 250 and 200 training sub-generations are used for the injection and leakage scenarios, respectively, optimizing computational efficiency while ensuring convergence. The batch size used in the model is 64, and the dropout rates for injection and leakage scenarios are set to 0.4 and 0.5, respectively. In terms of architecture design, the GELU activation function with smooth gradient characteristics is selected, and the Adam optimizer (initial learning rate 0.0001) is used to ensure stable convergence. The number of attention heads for injection and leakage scenarios is set to 8 and 6, respectively, combined with a 256-dimensional hidden layer representation and a 128-dimensional positional encoding dimension, achieving full capture of dual-sequence features. The stacking of three temporal fusion Transformer modules forms a hierarchical feature extraction system. The entire training process is guided by a composite loss function. This sophisticated hyperparameter configuration scheme enables the model to exhibit excellent performance under different operating conditions.
[0157] Table 2 Hyperparameter Configuration of Hybrid Deep Learning Framework
[0158] .
[0159] Establish a smart prediction method for GCS wellbore operating status according to the process in step 4. Figure 6 and Figure 7 This paper presents a comparison of the loss values of various loss functions for the proposed method in CO2 injection and leakage scenarios throughout the training process, particularly the change in the composite loss function. Given that this method primarily predicts the wellbore axial temperature and pressure distribution at discrete time steps and subsequently derives the CO2 phase distribution, the loss functions for wellbore pressure and temperature are integrated to comprehensively evaluate training convergence. The visualization results show the composite loss function in the CO2 injection scenario. It stabilizes after 220 epochs and eventually converges to approximately 0.38; the composite loss function in the CO2 leakage scenario. After 165 epochs, the model gradually stabilized, eventually converging to approximately 0.17. This convergence not only confirms the completeness of the training process but also demonstrates the balance achieved between prediction accuracy and physical consistency. To verify the performance of the trained prediction method under different wellhead injection parameters and well configuration parameters, representative schemes were selected from a test set of CO2 injection and leakage scenarios. These schemes cover typical operating conditions such as dynamic injection strategy changes and extreme wellhead failures, aiming to rigorously test the model's adaptability and robustness under complex engineering conditions. Detailed parameter configurations under these two operating conditions are shown in Table 3.
[0160] Table 3 Detailed parameter configuration of the example scheme
[0161] .
[0162] Figure 8 A comparison chart of actual and predicted values of wellbore pressure profiles for CO2 injection scenarios; Figure 8 In the diagrams (a) and (b), the actual values and predicted values are shown respectively. Figure 9 A schematic diagram illustrating the relative error between predicted and actual values of wellbore pressure profiles in a CO2 injection scenario. Figure 10 A comparison chart showing the actual and predicted values of wellbore pressure profiles in a CO2 leak scenario. Figure 10 In the diagrams, (c) and (d) are the actual and predicted values, respectively. Figure 11This diagram illustrates the relative error between predicted and actual wellbore pressure profiles in a CO2 leakage scenario. For CO2 injection scenarios, despite increased input complexity due to dynamically changing injection parameters, the model robustly predicts wellbore pressure profiles. The average relative error of the prediction results at different time steps and depths is only 4.7%, and the error at all prediction points is controlled within 8%, fully demonstrating that the prediction method can accurately capture the temporal dynamics of injection parameter fluctuations and their impact on axial pressure distribution. For wellbore pressure profile prediction in leakage scenarios, the method maintains good prediction performance, with prediction errors consistently below 3%, averaging 1.7%. Even under extreme wellhead failure conditions, the prediction method accurately characterizes pressure distribution features and leakage dynamics, exhibiting excellent robustness under complex operating conditions. Furthermore, this prediction method performs exceptionally well in predicting axial temperature profiles. Figure 12 A comparison chart of actual and predicted values of wellbore temperature profiles in a CO2 injection scenario; Figure 12 In the diagram, (e) and (f) are schematic diagrams of the actual value and the predicted value, respectively. Figure 13 A schematic diagram illustrating the relative error between predicted and actual values of wellbore temperature profiles in a CO2 injection scenario. Figure 14 This is a comparison chart of the actual and predicted values of the wellbore temperature profile in a CO2 leak scenario. Figure 14 In the diagram, (g) and (h) represent the actual value and the predicted value, respectively. Figure 15 This diagram illustrates the relative error between predicted and actual wellbore temperature profiles in a CO2 leakage scenario. For the CO2 injection scenario, the model consistently maintains a relative error of less than 3% in the axial temperature profile, averaging 1.6%, accurately capturing the gradual cooling effect of low-temperature CO2 on the bottom hole temperature during dynamic injection. Notably, the model successfully reproduces the nonlinear evolution of cooling caused by changes in injection rate, demonstrating its analytical capability for complex thermodynamic processes. In the leakage scenario, the prediction error also remains below 4%, averaging 1.8%, accurately characterizing the sudden drop in wellhead temperature. This phenomenon stems from the synergistic effect of CO2 phase change endothermic reaction and the Joule-Thomson effect under leakage conditions, closely matching the wellhead freezing observed in the field. These results fully validate the accuracy and reliability of this method in predicting temperature profiles during CO2 injection and leakage.
[0163] Based on the wellbore pressure and temperature profiles predicted by this method, the CO2 phase distribution along the wellbore axis was calculated. Figure 16 and Figure 17 These are schematic diagrams showing the actual and predicted values of the phase distribution in the wellbore during a CO2 injection scenario. Figure 18 and Figure 19 These are schematic diagrams showing the actual and predicted values of the phase distribution in a wellbore during a CO2 leak scenario. Figure 17 and Figure 19The "Error" in the model represents the discrepancy between the actual and predicted phase distribution values in the wellbore. In the injection scenario, the phase prediction error mainly occurs during the fourth injection rate change phase. This is due to the significant difference between the third and fourth injection rates, which causes a partial deviation in the model's capture of trend changes. Notably, the error is concentrated in the critical region of the liquid-to-supercritical transition. However, thanks to the high-precision prediction of temperature and pressure fields, the overall phase distribution prediction shows near-perfect consistency with the actual values. In the leakage scenario, the model successfully reproduces the complex phase transition dynamics: within the initial 1500 seconds, CO2 in the wellhead region undergoes a brief transition from a supercritical state to a liquid state, followed by rapid vaporization into a gaseous state, extending downwards to a depth of 2500 meters. The prediction results are highly consistent with the actual data. Although there are slight differences in the width of the gas and liquid phase regions, the overall phase evolution pattern is completely consistent with the theoretical expectations considering the Joule-Thomson effect and the endothermic phase transition. These results fully validate the reliability and accuracy of the model in CO2 phase prediction.
[0164] To comprehensively evaluate the performance of this prediction method, a rigorous comparative analysis was conducted with typical machine learning and deep learning methods, primarily including XGBoost, Convolutional Neural Networks (CNN), and Long Short-Term Memory Networks (LSTM). To ensure the fairness of the comparison, all compared models employed the same parameter configuration and training strategy. The coefficient of determination (R²) was used. 2 The root mean square error (RMSE) and other metrics were used as evaluation indicators to quantitatively analyze the performance of each method in predicting wellbore pressure and temperature profiles. Table 4 comprehensively summarizes the comparative results of different methods in CO2 injection and leakage scenarios.
[0165] Table 4. Evaluation metrics of different deep learning methods for predicting wellbore operating status
[0166] .
[0167] Comparative analysis of the system shows that the DT-DANet of this invention has significant advantages in processing dual sequence data, and its R... 2Both the RMSE and DT-DANet metrics are superior to the comparison models, demonstrating excellent prediction accuracy. The traditional machine learning method XGBoost is the most limited due to its inability to effectively model dynamic sequence correlations. Among deep learning methods, CNNs exhibit good spatial feature extraction capabilities and can effectively analyze the distribution patterns of wellbore depth, but they are insufficient in capturing the continuity between adjacent depth points, leading to potential non-physical jumps in prediction results. While LSTMs perform excellently in time series modeling, their neglect of spatial constraints limits their performance in dual-sequence tasks. Notably, in CO2 leakage scenarios, due to the constant wellhead leakage pressure, depth sequence features become the dominant factor, allowing CNNs to better utilize their spatial processing capabilities and narrowing the performance gap between DT-DANet and LSTM. These comparative results fully validate the superiority and applicability of DT-DANet in predicting the state of CO2 geologically sealed wellbores. Instance applications demonstrate that this method achieves excellent performance in prediction tasks involving dual-sequence features of both depth and time dimensions. This method, relying on a unique attention mechanism and advanced global feature extraction capabilities, can accurately characterize the pressure, temperature, and CO2 phase distribution within the wellbore during complex CO2 injection and leakage processes. The contribution of this invention lies in providing a more accurate and efficient wellbore condition monitoring tool for CO2 geological storage. Its prediction results can directly support field engineers in conducting safety assessments and decision optimization, and have significant engineering application value.
[0168] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for intelligent prediction of wellbore operating status based on a hybrid deep learning framework, characterized in that, Includes the following steps: Step 1: Establish a transient temperature-pressure coupled mathematical model for geological sealing wellbore and perform numerical solutions; Step 2: Construct a dual-sequence feature database covering CO2 injection and leakage conditions; Step 3: Use a parallel architecture to process dual sequence features and construct an improved dual attention network; The improved dual attention network extracts local spatiotemporal features through two complementary attention mechanisms: masked self-attention and convolution-enhanced temporal pattern attention. The masked self-attention mechanism extracts spatial distribution features along the wellbore depth, while the temporal pattern attention mechanism extracts local temporal features within the CO2 injection and leakage operation cycle. The basic principle of masked self-attention mechanism is to control the direction of information flow through masking operations, while enhancing the information representation of depth position through relative position encoding; given an input sequence ,in Indicates the first Feature vectors at each wellbore depth location, mask matrix The design follows the principle of unidirectional information flow: ; In the formula, Index for wellbore depth location; The source depth location is defined by the following location encoding equation: ; ; In the formula, For encoding functions; For encoding dimension index; This represents the total number of feature dimensions. A scaling factor used to control periodic changes between dimensions; The specific working process of the temporal pattern attention mechanism is as follows: After preprocessing, a series of hidden state vectors are extracted from the temporal data at different runtimes, forming a hidden state matrix. Using a one-dimensional convolution kernel along the hidden state matrix Convolution operation is performed on the row vectors to obtain the time-series pattern matrix. The specific formula is as follows: ; In the formula, For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; The index number represents the receptive field width of the one-dimensional convolution kernel; The width of the receptive field of the one-dimensional convolution kernel; For the first The row vector passes through the first row vector The time-series pattern matrix elements extracted by each filter; For the first The filter of the first... Each weight; This is the current time step; Let be the total number of time steps; defining the scoring function as the sigmoid function, and using it as the activation function for attention weight calculation, then the expression for weight calculation is: ; ; In the formula, For scoring functions; for The Row vectors; For transpose; For the current time step The hidden layer state; This is the weight matrix for autonomous learning; These are the normalized weight parameters; It is the sigmoid function; Using weight matrix to apply time series pattern matrix Perform a weighted sum on each row to obtain the current time step. attention vector The formula is: ; In the formula, The total number of features of the input variables for the temporal pattern attention mechanism; Subsequently, attention vector and hidden layer state After weighted linear mapping and superposition, the output value of the temporal pattern attention mechanism is obtained, as shown in the following formula: ; in, for The output value at that time; To predict the length of time; and These are the weight parameter matrices for the hidden layer state and the attention vector, respectively; Step 4: Establish the hybrid deep learning framework DT-DANet by coupling an improved dual attention network and a temporal fusion Transformer; Step 5: Use a composite loss function to perform co-optimization training on the hybrid deep learning framework. The output of the framework is the wellbore pressure profile, temperature profile and phase distribution at different time steps.
2. The intelligent prediction method for wellbore operating status based on a hybrid deep learning framework according to claim 1, characterized in that, In step 1, the process of constructing the transient temperature-pressure coupled mathematical model of the geological storage wellbore is as follows: first, the mass conservation equation, momentum conservation equation, and energy conservation equation of the wellbore are constructed in sequence; then, the CO2 physical property parameter model is constructed. The mass conservation equation is: ; In the formula, To control volume; This refers to the volume fraction of the gas phase. and These represent the densities of the gas phase and the liquid phase, respectively. and These represent the mass fractions of the gas phase and the liquid phase, respectively. and These are the velocities of the gas phase and the liquid phase, respectively. It is the cross-sectional area; For source and sink items; This is the current time step; axial depth; The momentum conservation equation is: ; In the formula, For pressure; For mixed density; Mixing speed; A coefficient characterizing the degree of slip between the gas and liquid phases; The wellbore inclination angle; This refers to the wall shear stress. Let be the perimeter of the cross-sectional area; It is the acceleration due to gravity; The energy conservation equation is: ; In the formula, The temperature of the fluid inside the wellbore; Radial length; The Joule-Thomson coefficient; Enthalpy; This represents the specific heat capacity of CO2 under constant pressure. For heat; For fluid velocity; The CO2 physical property model includes thermophysical properties and flow properties; thermophysical properties include CO2 density, specific heat capacity and Joule-Thomson coefficient, and flow properties include CO2 viscosity and the thermal conductivity of various materials.
3. The intelligent prediction method for wellbore operating status based on a hybrid deep learning framework according to claim 2, characterized in that, In step 1, a temperature-pressure dual iterative algorithm is used to solve the transient temperature-pressure coupled mathematical model. The specific process is as follows: Based on the actual wellbore structure parameters and reservoir conditions of the geological sealing well under mining conditions, a wellbore grid is divided to construct a one-dimensional wellbore conceptual model. In the first iteration, the parameters are initialized by assigning values to the initial pressure and temperature profiles; then, a CO2 physical property parameter model is established. Starting from the second iteration, the pressure profile under the current iteration step is calculated based on the mass conservation equation by considering the temperature profile under the previous iteration step; further, the temperature profile under the current iteration step is calculated by coupling the energy conservation equation based on the pressure profile under the current iteration step and the heat transfer parameters under the previous iteration step; and the heat transfer parameters under the current iteration step are calculated based on the pressure profile, temperature profile, and flow rate extracted from the mesh under the current iteration step. During the calculation process of each iteration step, a convergence judgment criterion is established, and the calculation is checked to see if the preset convergence accuracy is achieved by comparing the relative error between the results of two iterations. If the convergence condition is not met, adjust the calculation parameters and return to perform the iterative calculation again; When the convergence condition is met, the pressure profile calculation result and temperature profile calculation result corresponding to the current time step are output and used as the initial condition for the next iteration step. The iteration step continues to advance the solution process until the entire transient temperature and pressure coupling calculation process of the wellbore is completed.
4. The intelligent prediction method for wellbore operating status based on a hybrid deep learning framework according to claim 1, characterized in that, The specific process of step 2 is as follows: In the CO2 injection scenario, using time step, injection pressure, injection temperature, injection rate, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters as input parameters, the wellbore pressure, temperature profile, and CO2 phase distribution at each time step are solved based on the wellbore transient temperature-pressure coupled mathematical model as the output response, thus establishing a dual-sequence feature database for CO2 injection conditions; In the CO2 leakage scenario, using time step, wellhead leakage pressure, initial wellbore temperature profile, initial wellbore pressure profile, and wellbore configuration parameters as input parameters, the wellbore pressure profile, temperature profile, and CO2 phase distribution at each time step are solved based on the wellbore transient temperature-pressure coupled mathematical model as the output response, thus establishing a dual-sequence feature database for CO2 leakage conditions; The two databases are combined to construct a dual-sequence feature database covering both CO2 injection and leakage conditions.
5. The intelligent prediction method for wellbore operating status based on a hybrid deep learning framework according to claim 1, characterized in that, In step 4, the temporal fusion Transformer module uses local spatiotemporal features extracted by an improved dual attention network as input. The depth sequence information is encoded by a masked self-attention mechanism, while the time series pattern is represented by a temporal pattern attention mechanism. In terms of feature processing, the temporal fusion Transformer module adopts a differentiated encoding strategy: for static variables such as wellbore depth and formation attributes, long-term impact features are extracted by a static covariate encoder; for dynamic variables such as injection temperature, pressure, and CO2 rate, feature selection is performed by a variable selection network, and the dynamic evolution process is modeled using a sequence-to-sequence architecture. The hybrid deep learning framework DT-DANet employs a multi-stage training strategy: First, deep sequence data is processed through a masked self-attention mechanism to preserve the directional features of CO2 flow; simultaneously, time series data is encoded through a temporal pattern attention mechanism to accurately capture dynamic evolution patterns; subsequently, these local spatiotemporal features are input into the temporal fusion Transformer module, which models global dependencies through a variable selection network and a time-aware processing layer, and integrates historical and static feature information. Finally, after nonlinear transformation using a gated residual network and a multi-head attention mechanism, the framework outputs a comprehensive prediction result that includes wellbore pressure profile, temperature profile, and CO2 phase distribution.
6. The intelligent prediction method for wellbore operating status based on a hybrid deep learning framework according to claim 1, characterized in that, In step 5, the composite loss function consists of a main loss function and an auxiliary loss function; The main loss formula is: ; ; ; In the formula, Main loss function; coefficients and These are different weighting factors; and These are the prediction errors for wellbore temperature and pressure, respectively. , The first Predicted and actual values of wellbore temperature; This represents the total number of wellbore temperatures. , The first The predicted and actual values of the pressure; This represents the total number of pressures. The auxiliary loss functions include the temporal attention consistency loss function and the physical constraint loss function, and the formulas are as follows: ; ; In the formula, Let the temporal attention consistency loss function be used. The physical constraint loss function; , These are the current time steps. Previous time step The temporal attention matrix; This represents the total time step. and It is used to penalize unrealistic gradients in wellbore pressure and temperature predictions, respectively; and These are the weight coefficients in different loss functions; Composite loss function The formula is: ; The Adam optimizer combined with an adaptive learning rate scheduling strategy is used to optimize model training. The training optimization process employs a two-stage adjustment strategy: in the initial warm-up phase, the learning rate is gradually increased to avoid parameter oscillations in the early stages of training; subsequently, in the decay phase, the learning rate is dynamically adjusted to ensure that the model converges stably to the global optimum.
Citation Information
Patent Citations
Intelligent prediction method for fracture pressure of compact conglomerate reservoir based on improved Transform architecture
CN119357718A
Double-flow circulation attention dynamic gesture recognition method based on motion guidance
CN120220253A