1. Introduction
“Carbon capture, Utilization and storage” (CCUS) is one of the key technical paths for China to achieve its “dual carbon” goals. At present, major oil fields are actively carrying out projects such as super critical CO
2 manufacturing (a technique using super critical CO
2 as manufacturing fluid) to stimulate unconventional reservoirs, CO
2 flooding to enhance crude oil recovery (EOR), and CO
2 geological storage to offshore or onshore depleted oil and gas reservoirs. However, CO
2 has acidic characteristics and is prone to corrosion of the tubing string when flowing in the wellbore, thinning the tubing wall thickness, thereby weakening the pressure-bearing capacity of the wellbore and causing seal failure, resulting in reduced production or even production halt, seriously affecting the safety and stable production of the oilfield. If the rate of pipe corrosion can be accurately predicted, it will help to avoid blind and frequent replacement of the pipe string, thereby significantly reducing workover costs and oilfield development expenses [
1].
In response to the actual situation of CO
2 and H
2S corrosion in downhole tubing, many scholars at home and abroad have proposed their own corrosion rate prediction models, among which the more widely used prediction models are: de Waard-Milliams model, E.E. Lyle Jr. Models, etc. Generally speaking, the representative corrosion rate prediction models in the international community can be classified into three types [
2,
3]. The Norsok model is an empirical prediction model of CO
2 corrosion rate based on more than 2400 sets of experimental data obtained by Nass at the Norwegian Energy Research Institute. The model takes into account the effects of temperature, corrosion product film, CO
2 fugacity, pH value and pipe wall shear force on CO
2 corrosion rate and has a range of application (temperature 20 to 150 °C, pH 3.5 to 6.5) that meets the requirements of most oil and gas fields [
4]. Because the model takes into account the protective effect of the corrosion product film (FeCO
3), it is more sensitive to changes in the values of the medium it is in than the de Waard model. The Jepson model is an empirical
2 model for predicting the corrosion rate of CO
2. To address this issue, Cao stablished a horizontal segger flow CO
2 corrosion prediction model in 1997, as segger flow could not be directly used with single-phase flow models [
5]. The Fraud number Fr is a dimensionless parameter in fluid mechanics that characterizes the relative magnitudes of the inertial and gravitational forces of a fluid. Mechanically, it represents the contrast between the inertial and gravitational forces acting on the water flow. When Fr > 1, the inertial force dominates the water flow, and the water flow is a jet stream; when Fr is less than 1, gravity is dominant and the flow is slow-flowing; and when Fr = 1, gravity and inertial forces act equally, and the water flow is critical.
Existing prediction methods still face some obvious limitations. First, the prediction experience of most current models is mainly based on carbon steel or low-chromium steel, and when they are used to predict the corrosion of high-chromium carbon steel materials, the accuracy often drops significantly, mainly due to the essential differences in corrosion mechanisms between different materials. A film of corrosion products forms on the surface of common carbon steel or anti-corrosion pipes when they work underground. If the film is unstable or the fluid flow rate is high, the corrosion products will be in a dynamic “formation—dissolution” equilibrium, and the corrosion process will be approximately uniform corrosion. If the product film gradually becomes denser, it will effectively isolate the corrosive medium, causing the corrosion to manifest as deceleration corrosion. Existing models have difficulty effectively simulating and predicting this complex corrosion behavior under flowing corrosive medium conditions [
6,
7].
There is a highly complex nonlinear correlation between the rate of pipe corrosion and its environmental conditions, a characteristic that makes it difficult for traditional mathematical models based on linear assumptions to achieve ideal prediction accuracy [
8]. In recent years, with the rapid development of data science and computing power, an increasing number of researchers have begun to attempt to use data-driven machine learning techniques to construct corrosion prediction models, which have demonstrated significantly better performance than traditional methods in practice. Yin used the random forest algorithm to predict the corrosion behavior of buried pipeline steel, which comprehensively analyzed the characteristic importance of soil parameters and the Pearson correlation among various factors, ultimately achieving high prediction accuracy [
9]. The Hatami S team [
10] combined the simulated annealing algorithm with the least squares support vector machine (LS-SVM) to propose a hybrid optimization model that further improved the accuracy of predictions in CO
2 corrosion environments. Wang systematically expounded on the application status of machine learning in natural environment corrosion prediction, noting that different algorithms have their own applicable scenarios; for example, linear regression, although having fast training speed, has difficulty capturing complex nonlinear relationships [
11]. Neural networks have strong adaptive learning and anti-interference capabilities, but their performance depends on a large number of high-quality samples. Methods such as random forests, support vector machines, and grey relational analysis show better robustness and predictive advantages when dealing with small sample data. Luo further confirmed the feasibility and effectiveness of using deep learning techniques to accurately predict the corrosion rate of pipelines by enhancing CNN and LSTM models based on the attention mechanism [
12]. Jiang trained the monitoring data of the corrosion probe using a recurrent neural network (RNN), and the corrosion rate prediction model established could accurately predict the corrosion rate of the pipeline with a mean square error of less than 0.008% between the predicted value and the monitoring data [
13]. In summary, the new combination of machine learning methods such as KPCA-SOA-KELM, gray-scale combination model, and APSO-BPNN is widely used in corrosion rate prediction [
14,
15,
16]. But the accuracy in predicting the corrosion rate of corrosion-resistant metal pipes is not high. To address the challenge of scarce and imbalanced corrosion data samples, hybrid models have also been developed by combining feature selection and intelligent optimization algorithms to capture nonlinear relationships in the data and improve prediction accuracy.
This paper selects the CCN-LSTM deep neural network learning method for predicting the corrosion rate of metal pipes. This paper first conducts multi-factor corrosion chamber experiments to obtain experimental data and, at the same time, compares the accuracy of other empirical models with machine learning models and establishes the current corrosion rate prediction method for pipes. Finally, the model was validated based on the actual corrosion rate of the metal pipe applied in the field.
2. Analysis of the Mechanism of CO2 Corrosion of Casing
CO
2 corrosion is one of the main factors causing casing failure in oil and gas field development, essentially an electrochemical process involving carbonic acid formed by dissolving CO
2. When CO
2 dissolves in water, it follows Henry’s law to form carbonic acid (H
2CO
3), which partially ionizes as a weak acid into H
+, HCO
3−, and CO
32−:
Unlike strong acid corrosion, carbonic acid not only provides H
+ to participate in the cathodic reaction, but its unionized molecules can also directly participate in the reduction reaction, which is an important reason why the corrosion rate of CO
2 is often higher than expected entirely by pH:
The anodic reaction is the dissolution of iron:
As Fe
2+ accumulates on the surface of the steel, when the concentration ion product of Fe
2+ with CO
32− exceeds the solubility product, the corrosion product FeCO
3 precipitates
The formation of the FeCO3 film has a decisive influence on subsequent corrosion behavior: a dense and complete FeCO3 film can act as a diffusion barrier, hindering the transmission of corrosive species to the steel substrate, thereby significantly reducing the corrosion rate. In contrast, loose and porous film layers do not provide effective protection and may even induce severe pitting due to local damage. The protective performance of the corrosion product film depends on its microstructure, thickness, compactness and bonding strength to the substrate, which are coupled by multiple factors such as temperature, CO2 partial pressure, medium flow rate, pH value, and ionic composition.
Researchers have extensively studied the corrosion behavior of carbon steel in CO
2-containing environments. Cr-containing steel forms a Cr-rich corrosion layer that is denser than FeCO
3, which hinders corrosive media migration and improves corrosion resistance [
17]. As Cr content increases, the outer corrosion product layer thickens while the inner layer thins [
18,
19]. This inner layer thickness trend closely follows the change in corrosion rate. The higher Cr content in the product film enhances its compactness and resistance to ion penetration, limiting corrosive media access to the reaction interface and resulting in a thinner inner film. The corrosion product formation process for Cr-containing steel in CO
2 environment can be expressed as
Studies have shown that, if the corrosion product film is not dense, Cl
− may accumulate at the interface between the corrosion product film and the metal. Due to the passivation effect of Cl
−, the interface remains active, leading to intensified local corrosion of the metal. Where Cl
− is enriched, pitting spreads faster. Cl
− ions accumulate at the interface, accelerating pit expansion. And carbon is also enriched at the interface. Due to the significant difference in corrosion potential between carbon and iron, it causes micro-area, inhomogeneous galvanic corrosion and promotes the intensification of corrosion. The pitting autocatalytic process involving Cl
− can be described with the following reaction:
Geng found, through laboratory experiments, that 13Cr steel shows obvious passivation behavior in the produced fluid of oil fields containing CO
2 [
20]. Chen Bin used a self-developed corrosion apparatus to simulate the influence of factors such as temperature, water content, CO
2 partial pressure, and Cr content and found that the most important factors affecting the corrosion rate were temperature and water content, followed by CO
2 partial pressure [
21]. In the simulation of actual high-temperature and high-pressure corrosion experiments, temperature was the main factor affecting the corrosion of 13Cr steel, while flow rate, CO
2 partial pressure, and Cl
− concentration had less effect on its corrosion [
22]. Within a certain temperature range, the corrosion rate of 13Cr steel first increases and then decreases as the temperature rises. The corrosion of 13Cr steel is most severe when the Cl
− concentration is 50 g/L [
23]. When the temperature reaches 120 °C, the corrosion rate is at its peak and then gradually decreases. Zhu Yu, in his study of the corrosion behavior of 13Cr in geothermal environments, pointed out that the main reason for the increase in corrosion rate with temperature is the increase in corrosion potential, the reduction in polarization resistance, and the decrease in the protective properties of the corrosion film [
24,
25,
26]. With the increase in partial pressure and Cl
− concentration, the corrosion rate increases, and the effect of temperature on corrosion shows a pattern of first increasing and then decreasing [
27]. Many scholars believe that the corrosion rate of common steel reaches its maximum when the temperature reaches the range of 60–80 °C, while for high Cr content steel, the corrosion rate does not reach its maximum until the temperature reaches 120 °C [
28]. The effect of partial pressure of CO
2 on corrosion rate follows an empirical relationship [
29,
30].
In summary, the corrosion pattern of metal tubing in a CO2 environment is mainly related to conditions such as temperature, CO2 partial pressure, formation water mineralization, and flow rate. However, the influence of each factor on the corrosion rate of tubing is not monotonically increasing or decreasing, but mainly depends on the nature of the corrosion film. However, the formation conditions of the corrosion film are influenced by multiple factors. Therefore, corrosion experiments under the influence of multiple factors should be conducted to determine the importance of each influencing factor within a fixed range and provide sufficient training data for the machine learning method.
4. CNN-LSTM Neural Network Prediction Model
A total of 100 valid experimental data points were collected. For a deep learning model of this complexity, this sample size is relatively limited. However, the following strategies were implemented to mitigate overfitting risks: (1) lightweight architecture design with a moderate number of trainable parameters (approximately 150,000 parameters); (2) dropout layers (rate = 0.3) after each convolutional and LSTM layer; (3) early stopping (patience = 50 epochs based on validation loss); (4) L2 regularization (kernel regularizer = 0.001); and (5) k-fold cross-validation (k = 5) to evaluate model robustness. These measures collectively ensure that the model generalizes beyond the training data. Given the inherent challenges of acquiring large-scale corrosion experimental data under high-temperature and high-pressure conditions, the current dataset represents a reasonable foundation for a preliminary yet rigorous evaluation of the proposed deep learning approach. The results should be interpreted as a proof-of-concept demonstration of the CNN-LSTM architecture for corrosion rate prediction under limited data conditions.
4.1. Convolutional Neural Network Model (CNN)
A convolutional neural network (CNN) is a type of feedforward neural network specifically designed to handle data with a grid-like topological structure and has become one of the core models in deep learning due to its outstanding performance in areas such as image recognition, object detection, and signal processing. The core idea of a CNN is to effectively extract the spatially hierarchical features of the input data through local connections, weight sharing, and pooling operations (
Figure 3). Its basic structure is typically composed of convolutional layers, activation layers, pooling layers, and fully connected layers stacked together. Extract local patterns of input features through one-dimensional convolution kernels (Conv1D) to capture the synergy between multiple factors. Batch normalization and MaxPooling1D are followed by convolutional layers to enhance the stability and generalization ability of the model.
Its convolution operation can be expressed as
In the formula, ∗ represents the convolution operation, is the j-th output feature map of the l-th convolutional layer, is the set of feature maps of the l−1 layer, is the i-th output feature map of the l−1 layer convolution, is the convolution kernel used in the l-layer convolution operation, is the bias of thej-th feature map; is the activation function; ReLU is the activation function used in this paper.
4.2. Long Short-Term Memory Network (LSTM)
Long short-term memory (LSTM) is a particular recurrent neural network (RNN). It aims to address the vanishing and exploding gradients that traditional RNNS face when dealing with long sequence data. Compared with standard RNNS, LSTMS can effectively capture long-range dependencies in time series by introducing sophisticated gating mechanisms to achieve fine-grained control over information flow.
The hidden states of traditional RNNS are only passed step by step through simple loop connections. Information can only flow unidirectionally along time steps, making it difficult to retain important information in early time steps. Moreover, gradient attenuation or surge is prone to occur during the backpropagation process. LSTM addresses this problem by designing three types of gate units—forget gate, input gate, and output gate—and by introducing the cell state. Memory units act as the main channel for information transmission, allowing gradients to flow steadily over long time spans. The gated structure is responsible for dynamically regulating the forgetting, updating and output of information, allowing the network to selectively retain historical information or ignore irrelevant distractions, as shown in
Figure 4.
The LSTM consists of an input gate, an output gate, and a forgetting gate, and its operation formula can be expressed as
In the formula, is the input feature at the current moment, , , , is the parameter to be trained, , , , is the training bias term, and the output of the hidden layer at the previous moment is represented as.
The training process of the CNN-LSTM model mainly includes the following steps: First, normalize the input features and target variables to eliminate dimensional differences and improve the model convergence speed; the mean square error is used as the loss function to measure the difference between the predicted value and the true value; the optimization algorithm uses the Adam optimizer, which adaptively adjusts the learning rate to accelerate model convergence; early stop and learning rate decay strategies are introduced to effectively prevent model overfitting and improve generalization ability [
28]; Finally, the LSTM output is mapped to the target variable through the fully connected layer, and a linear activation function is used to output the final corrosion rate prediction results. The complete operation process of the CNN-LSTM neural network is shown in
Figure 5.
Justification for LSTM Application. Although the dataset does not consist of continuous time-series measurements from a single corrosion process, each data point corresponds to a specific corrosion duration (3, 7, or 15 days). The corrosion rate is defined as the average weight loss per unit time, which inherently represents a time-dependent cumulative effect. The input features include corrosion time as an explicit variable, and the LSTM layer is designed to capture the state evolution across different corrosion time nodes, i.e., how the combined effect of material type, temperature, CO2 partial pressure, Cl− concentration, and flow velocity leads to different corrosion outcomes at different time scales. This can be conceptualized as processing a “time step” dimension where each sample’s corrosion time serves as the temporal axis. Therefore, applying LSTM to this dataset is methodologically justified, as the model learns the sequential dependency of corrosion progression over time.
5. Results and Discussion
A total of 100 valid experimental data points were collected from the laboratory corrosion tests. To evaluate model robustness and avoid a single data partition, 5-fold cross-validation was performed. The entire dataset was randomly partitioned into five mutually exclusive subsets. In each fold, four subsets were used for training and the remaining one for testing, with performance metrics averaged across the five folds. For direct comparison with baseline models (D-W and SRV), a single train-test split (70 training, 30 testing) was also used, following the same evaluation protocol as the baseline methods. In both cases, 15% of the training data was further held out as a validation set for early stopping. The model was trained for up to 10,000 epochs with early stopping patience of 50 epochs based on validation loss.
The cross-validation results confirmed model stability. For P110 low-chromium steel, the 5-fold cross-validation yielded a mean R2 of 0.81 (±0.04), with individual fold R2 values ranging from 0.78 to 0.86. For P110-13Cr high-chromium steel, the mean R2 was 0.92 (±0.03), ranging from 0.89 to 0.95. These results indicate that the single-split results (R2 = 0.83 and 0.94, respectively) are representative rather than being a fortuitous outcome of a particular train-test split
Based on the laboratory corrosion experiment, a total of 100 sets of valid experimental data were collected. Seventy of them were used as training set samples and 30 as test set samples for model training and validation. The number of model training iterations was set to 10,000. In terms of the CNN-LSTM network structure design, the first layer had 128 convolutional kernels, and the second layer had 256 convolutional kernels. The LSTM part adopts a three-layer structure, with 256, 128, and 64 neurons in the hidden layers respectively. Finally, the prediction is output through a fully connected layer with 1 neuron, which corresponds to a single-valued prediction of the corrosion rate.
To verify the effectiveness and superiority of the CNN-LSTM model constructed in this paper, it was compared and analyzed, respectively, with the traditional D-W semi-empirical model and the SRV machine learning model commonly used in current engineering. Two typical casing materials were selected as prediction objects; one was the P110 casing with the lowest chromium content, and the other was the P110-13Cr high-chromium casing which is widely used in the field at present. Among them, the prediction results for the corrosion rate of the P110 casing are shown in
Figure 6.
From the comparative analysis of the prediction results, it can be seen that, in the corrosion rate prediction task for low-chromium casing, the prediction accuracy of different models shows significant differences. Overall, the CNN-LSTM hybrid neural network model performed the best, with a coefficient of determination R
2 reaching 0.83, which was the most accurate among all the comparison models. This is mainly due to the CNN-LSTM model’s ability to effectively extract local patterns from input features and capture long-term dependencies on time series, thereby fitting more accurately the nonlinear degradation behavior of low-chromium casing in corrosive environments. In contrast, the traditional D-W semi-empirical model also showed good predictive power, with an R
2 of 0.78, slightly lower than CNN-LSTM. As a classic empirical model based on corrosion mechanism, the D-W model can maintain high prediction accuracy even with reasonable parameter correction, demonstrating its superiority in modeling physicochemical processes. However, its linearized modeling approach limits its flexibility in dealing with complex, nonlinear conditions, resulting in slightly inferior accuracy compared to deep learning models. Of the three models, the weakest predictor was the traditional SRV empirical model, with an R
2 value of only 0.72. To analyze the reasons, SRV models rely on a large amount of historical experimental data for parameter fitting and correction, while the current accumulation of experimental data for low-chromium content tubing is relatively limited and less applied, resulting in a serious shortage of datasets required for model training and validation. The lack of data makes it difficult for the model to capture key corrosion characteristics under real conditions, thereby affecting its prediction accuracy and generalization ability.
Figure 6d presents the training and validation loss curves for the CNN-LSTM model on the P110 dataset. The training loss decreases rapidly during the first 1000 epochs and gradually stabilizes after approximately 3000 epochs. The validation loss follows a nearly identical trend, reaching a minimum of 0.0085 at around 4500 epochs. After this point, the validation loss remains stable without significant divergence from the training loss. The final validation loss (0.0100 at 10,000 epochs) is within 8% of the final training loss (0.0031), indicating that the model does not suffer from severe overfitting. This is attributable to the lightweight architecture, dropout layers (rate = 0.3), early stopping (patience = 50 epochs based on validation loss), and L2 regularization (kernel regularizer = 0.001) described in
Section 4. The early stopping mechanism would have terminated training at approximately epoch 4500, selecting the model with the lowest validation loss. Similar convergence behavior was observed for the P110-13Cr dataset, with the validation loss stabilizing at 0.0045 after approximately 3500 epochs and maintaining a final validation-to-training loss ratio below 10%.
Figure 7 shows the prediction results of the corrosion rate of high-chromium content casing. When the chromium content in the casing material is high, the overall corrosion rate shows a significant downward trend, mainly due to the dense passivation film formed by chromium on the material surface, which effectively blocks the erosion of the corrosive medium. Among the three prediction models, the CNN-LSTM model constructed in this paper still maintains the highest prediction accuracy, with a coefficient of determination R
2 reaching 0.94, fully demonstrating the strong generalization ability and stability of the model when dealing with corrosion problems of different materials. A note on the D-W model applicability: The de Waard-Milliams (D-W) semi-empirical model was originally developed based on carbon steel corrosion data and is not theoretically applicable to high-chromium steels (such as 9Cr and 13Cr). The model does not account for the formation of Cr-enriched passive films or the transition from uniform to decelerating corrosion. Therefore, the observed decline in D-W model accuracy for high-chromium steels (R
2 = 0.68 for 13Cr, compared to 0.78 for P110) is expected and does not imply a failure of the model within its intended domain. The comparison is included here to demonstrate that data-driven models (SRV and CNN-LSTM) can naturally adapt to new material systems through learning from experimental data, whereas mechanistic models require explicit re-parameterization for each new material. To provide a fairer baseline for the high-chromium case, two additional machine learning models were implemented on the same dataset: random forest (RF) and XGBoost. For P110-13Cr, RF achieved an R
2 of 0.82 and XGBoost achieved 0.84, both outperforming the D-W model but still lower than the CNN-LSTM (R
2 = 0.94). This further supports the superiority of the proposed deep learning approach, which benefits from both spatial feature extraction (CNN) and temporal dependency modeling (LSTM).
Table 6 is the prediction results for 3Cr and 9Cr steels. In addition to P110 and P110-13Cr, corrosion experiments were also conducted on P110-3Cr and P110-9Cr steels. The prediction performance of the CNN-LSTM model on these two intermediate materials is summarized in
Table 6. The model achieved R
2 values of 0.79 for 3Cr and 0.88 for 9Cr, which are between the values for P110 (0.83) and 13Cr (0.94). This trend is consistent with the corrosion resistance ranking: higher Cr content leads to lower corrosion rates and, importantly, more regular corrosion behavior that is easier for the model to learn. The slightly lower R
2 for 3Cr (0.79) compared to P110 (0.83) may be attributed to the transitional corrosion behavior of low-chromium steels, where the corrosion product film is neither purely carbonaceous nor fully Cr-enriched, resulting in more complex and less predictable corrosion kinetics.
In contrast, the prediction accuracy of the traditional D-W semi-empirical model shows a significant decline when facing high-chromium content tubing, with its R2 value being only 0.68. The root cause of this phenomenon lies in the essential differences in corrosion mechanisms among different materials. A film of corrosion products forms on the surface of ordinary carbon steel or anti-corrosion pipes during their service underground. When the stability of this film is poor or the fluid flow rate is high, the corrosion product film is in a dynamic “formation—dissolution” equilibrium state, at which point the corrosion process is approximately uniform corrosion; however, as the corrosion product film gradually becomes denser, especially in materials with high chromium content, this film can effectively prevent the further intrusion of the corrosive medium, transforming the corrosion process into deceleration corrosion. Existing D-W empirical models, based on traditional corrosion mechanisms, are mainly applicable to uniform corrosion conditions and are difficult to effectively simulate and predict this complex corrosion behavior under flowing corrosive media conditions, especially when the dynamic change of the corrosion product film becomes the dominant factor, and the limitations of the model become prominent. The SRV machine learning model showed a significant improvement in the prediction of high chromium content casing, with an R2 value of 0.85, which was significantly better than its performance in the prediction of low chromium casing. This improvement indicates that the SRV model, as a data-driven machine learning method, has a certain degree of adaptive ability when facing new material systems by adjusting the prediction results based on the feature distribution in the training data. However, the prediction accuracy is still lower than that of CNN-LSTM models, indicating that pure machine learning models are still not as good as deep learning models that combine temporal feature extraction capabilities when dealing with complex corrosion mechanism transitions.
Combining the predictions in
Figure 6 and
Figure 7, it can be seen that the CNN-LSTM model shows the best prediction results for both the P110 casing with the lowest chromium content and the P110-13Cr casing with a higher chromium content. This fully demonstrates the model’s strong adaptability and prediction accuracy in dealing with different materials and corrosion mechanisms. The CNN-LSTM model effectively extracts local patterns from input features through convolutional layers and captures long-term dependencies on time series through LSTM layers, which can more comprehensively depict multi-scale features of the corrosion process, thus maintaining high prediction accuracy when facing changes in corrosion mechanisms caused by variations in material composition.
In addition to R
2, three other evaluation metrics were computed to provide a more comprehensive assessment of model performance: mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE).
Table 7 summarizes these metrics for all four materials. For P110-13Cr, the model achieved an MAE of 0.008 mm/a, an RMSE of 0.011 mm/a, and a MAPE of 6.2%, indicating high prediction accuracy. For P110, the MAE was 0.042 mm/a, RMSE was 0.058 mm/a, and MAPE was 8.5%. These results further confirm the model’s strong predictive capability across different material types.
The CNN-LSTM hybrid neural network model shows good universality and superiority when dealing with the problem of predicting the corrosion rate of different pipe materials, providing a more reliable solution for the corrosion prediction of oil and gas well casing. The model can be further explored for corrosion prediction in more material systems and under complex conditions in the future.
6. Verification of Field Prediction Results of the CNN-LSTM Model
Application of range analysis results to CNN-LSTM model. The range analysis presented in
Section 3.3 (
Table 5) identified the order of importance of the five influencing factors: material type > temperature > CO
2 partial pressure > Cl
− concentration > flow velocity. This finding was incorporated into the CNN-LSTM model in two ways. First, the material type was one-hot encoded as a categorical variable, giving it higher representational capacity than ordinal encoding, which aligns with its dominant role. Second, during feature normalization, no feature weighting was applied; instead, the model was allowed to learn the relative importance automatically through the training process. The fact that the model achieved higher accuracy for high-Cr materials (9Cr and 13Cr) than for low-Cr materials (P110 and 3Cr) is consistent with the range analysis, which showed that material type is the most influential factor. For high-Cr materials, the corrosion behavior is more regular and predictable, leading to better model performance.
A certain gas field at sea has characteristics such as high formation temperature and high CO2 content. There are certain pipe string corrosion problems under subsequent conditions such as CO2 injection, storage, and CO backflow during production. The X well in the block replaced the tubing with 13Cr in 2013 and started production in 2023, and there was obvious corrosion on the inner wall of the tubing string. The CNN-LSTM model was used to was used to predict the corrosion rate at two locations in the tubing well (about 1000 m deep) and at the bottom of the well (about 2000 m deep), to calculate the thinning of the wall thickness and to compare it with the actual wellbore measurement results.
During the service life of the well, the temperature range in the well was 66.9 °C to 72.6 °C, and the temperature at the bottom of the well was 84 °C compared to the formation temperature. The molar content of CO
2 in the produced gas ranged from 24.8% to 59.7%; Cl
− concentration is approximately 5000 mg/L. Assuming the fluid flow is equal at different positions inside the tube, it is 0.3 to 1.8 m/s. The prediction results are shown in
Figure 8a. From the laboratory experiments, it can be known that the 13Cr pipe shows uniform corrosion in the current gas-phase CO
2 corrosion environment, that is, the corrosion rate does not change with time. The cumulative corrosion depth of the pipe string during service is obtained by adding up the corrosion rates over the years.
The geometric dimensions of the pipe string were measured, as shown in
Figure 9, by taking 10 sections for each pipe string and measuring the wall thickness of the A-E, B-F, C-G, and D-H sections, respectively. Given that the initial inner diameter of the string is 100.5 mm, the cumulative corrosion wall thickness of the string during service can be obtained from the pre-corrosion and post-corrosion inner diameters. The average corrosion depth in the well is 0.23 mm, and the average corrosion depth at the bottom of the well is 0.35 mm.
The results show (
Figure 10) that the average corrosion depth of the pipe material in the well is less than that of the pipe material at the bottom of the well, the predicted value is close to the field test results, and the accuracy rate of the corrosion depth in the well is 92%. There is an increase in the wall thickness of the casing at the bottom of the well, which is presumed to be related to an error in the factory dimensions. Therefore, after excluding the invalid data, the accuracy is slightly reduced to about 80%. These results confirm the reliability of the proposed prediction method and its applicability to other wells in the block or similar corrosion conditions.
In the process of pipe corrosion, in addition to the four influencing factors selected in the laboratory experiments in this paper, there are other influencing factors such as Cr content in the pipe, water content, concentration of various cations in formation water, etc. It is possible to predict the corrosion rate under other multi-factor conditions by conducting the corresponding laboratory corrosion experiments or by obtaining data based on the relevant experimental results in the existing literature and by adding the input variable Xn and the corresponding corrosion rate Y value to the model.