Clustering analysis method for corrosion of CO2 flooding production well

Through the CO2 drive-out well corrosion cluster analysis method, the corrosion rate prediction error problem caused by failure to fully consider the characteristics of the wellbore service conditions in the existing technology is solved, and scientific wellbore classification management and efficient corrosion protection are achieved, which meets the accuracy requirements of oilfield corrosion protection projects.

CN119884849APending Publication Date: 2025-04-25PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311376574.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-23
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When predicting the corrosion rate of CO2 drive-out wells, the prior art fails to fully consider the service conditions of the wellbore, resulting in large errors in the predicted corrosion rate value and actual conditions, and lacks a scientific corrosion protection management plan.

Method used

The corrosion clustering analysis method of CO2 drive-out wells is adopted. By determining clustering characteristics, establishing feature databases, dimensionless data, and performing clustering analysis based on multi-dimensional distances, the optimal classification number is determined, the corrosion rate influence factor is constructed, the corrosion rate is predicted, and the classification results are optimized and managed.

Benefits of technology

The scientific classification management of CO2 drive-out wells has been realized, and the efficiency of corrosion protection management has been improved. The corrosion rate prediction value and the on-site monitoring value are more than 80%, meeting the accuracy requirements of oilfield corrosion protection projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884849A_ABST
    Figure CN119884849A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of oil and gas safety engineering, and provides a CO2 flooding production well corrosion clustering analysis method. The method comprises the following steps: firstly, determining environmental parameters influencing the corrosion rate of the CO2 flooding production well, establishing a clustering feature database, and carrying out dimensionless processing on clustering feature data; all the wells are clustered according to clustering characteristics based on multi-dimensional clustering, the optimal classification number of the CO2 flooding production wells is determined, and a corrosion classification result is obtained; constructing a corrosion rate influence factor; cO2 flooding production working condition corrosion rate prediction and production well corrosion classification optimization and management are completed. According to the method, various characteristics influencing the corrosion rate of the CO2 flooding production well are comprehensively considered, and on-site wells are classified; the corrosion rate influence factors are constructed, and the corrosion rate of the CO2 flooding production well is predicted; in addition, the corrosion rate prediction result is associated with field well classification, the field CO2 flooding production well corrosion protection management efficiency is improved, and the method has important guiding significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of oil and gas safety engineering and relates to a corrosion clustering analysis method for a CO2 drive production well. Background Art

[0002] At present, CO2 flooding oil production technology is an important development direction of the oil industry, whether from the aspects of emission reduction and storage or oil recovery and utilization. However, CO2 corrosion is very common in oil and gas pipelines and is one of the most serious corrosion problems. In the face of the problem of aggravated wellbore corrosion, it is necessary to effectively classify and manage oil and gas wells, and further predict the corrosion rate in order to achieve efficient corrosion protection for oil and gas wellbores and protect the integrity of the wellbore; therefore, corrosion control is a key technology for CO2 flooding.

[0003] There are three main types of CO2 corrosion rate prediction models commonly used at home and abroad, namely empirical prediction models, semi-empirical prediction models and mechanism prediction models. The empirical prediction model is represented by the Norsok M-506 model. This type of model takes less consideration of the corrosion mechanism and is mainly established based on the fitting of experimental data and field data; the famous semi-empirical prediction model is the DW series model. The semi-empirical model is a prediction model established by fitting experimental data and field data based on the consideration of process dynamics and medium transmission process; the classic mechanism prediction model is the Nesic model. The mechanism model uses kinetic formulas to solve the corrosion rate, has a clear physical meaning, and is less combined with field data.

[0004] Peng Long et al. proposed a CO2 corrosion rate prediction model based on a semi-empirical research model in "CO2 Corrosion Rate Prediction Model for Bohai Oilfield" (Petroleum Science Bulletin, December 2020, Vol. 5, No. 4: 531-540). Combined with the CO2 corrosion experiment under the production conditions of Youtian Century in Bohai, it takes into account temperature, CO2 partial pressure, flow rate, and corrosion product film, and introduces a CO2 corrosion rate correction factor. The model has a small relative error, is closer to the corrosion rate under actual conditions, and has high reliability; but it is only applicable to Bohai Oilfield and has limitations.

[0005] In "Prediction of Corrosion Rate of Oil Pipe Strings in CO2 Injection Oil Production Wells" (Journal of Southwest Petroleum University, April 2019, Vol. 41, No. 2), Zhang Zhi et al. studied the corrosion law of oil pipes in different stages of CO2 injection oil production wells in response to the corrosion phenomenon of oil pipes in CO2 injection oil production wells. Based on the principles of kinetics and the electrochemical corrosion theory of metals, the temperature and pressure distribution in the oil pipe was obtained by considering factors such as liquid production, water content, wellhead temperature, production pressure difference, and fluid flow rate in the oil and gas production process. The prediction method for the corrosion rate of oil pipes in CO2 oil production wells was studied, and the parameters that have a great influence on the corrosion rate of oil pipe strings in different production stages (gas injection stage and production stage) were given; however, this prediction method cannot give a specific corrosion type.

[0006] At present, there is still a lack of scientific management solutions for the corrosion protection of CO2 injection production wells in oil and gas fields. The service condition characteristics of CO2 injection production wells have not been comprehensively considered. Conventional corrosion rate predictions have not fully considered the corrosion environment factors of CO2 injection production wells, and the predicted corrosion rate has a large error with the actual situation. Therefore, it is necessary to classify CO2 injection production wells based on the actual statistical corrosion environment parameters on site, according to the parameter characteristics, and predict the corrosion rate of CO2 injection production wells at the same time. Compare the oilfield corrosion rate control indicators and combine the classification results, on the one hand, to provide a basis for the corrosion protection of CO2 injection production wells on site, and on the other hand, to improve the efficiency of corrosion management. Summary of the invention

[0007] In view of the problems existing in the prior art, the present invention provides a method for clustering analysis of corrosion of CO2 drive production wells. The method comprehensively considers various characteristics of CO2 drive production wells that affect the corrosion rate, classifies the on-site wells, constructs corrosion rate influencing factors based on experimental methods, and predicts the corrosion rate of CO2 drive production wells. In addition, the corrosion rate prediction results are linked to the on-site well classification, thereby improving the efficiency of on-site corrosion protection management of CO2 drive production wells and providing a reference for efficient corrosion protection of CO2 drive production wells.

[0008] The technical solution of the present invention is as follows:

[0009] A method for cluster analysis of corrosion in a CO2 flooding production well comprises the following steps:

[0010] (1) Determine clustering features;

[0011] (2) Establish a database of CO2 flooding well characteristics in oil and gas fields;

[0012] (3) Dimensionless transformation of cluster characteristic data of CO2 flooding production wells;

[0013] (4) Cluster analysis of all wells according to clustering characteristics based on multidimensional distance:

[0014] (5) Determine the optimal number of classifications for CO2 flooding production wells;

[0015] (6) Preliminary corrosion classification of CO2 flooding production wells;

[0016] (7) Construct the influencing factors of the corrosion rate of CO2 flooding production wells;

[0017] (8) Prediction of corrosion rate in CO2 flooding production conditions and optimization and management of production well corrosion classification.

[0018] Furthermore, in step (1), the service environment parameters that affect the corrosion rate of CO2 flooding production wells are used as clustering features, including 7 categories, specifically well depth, liquid production, CO2 partial pressure, calcium and magnesium ion concentrations, chloride ion concentrations, mineralization and water content; the calcium and magnesium ion concentration is the sum of the calcium ion concentration and the magnesium ion concentration.

[0019] Furthermore, the characteristic database establishment process is as follows: each cluster feature in step (1) is taken as a matrix, each matrix represents the cluster feature data of n wells, and one or more groups of detection data are obtained according to whether each cluster feature changes over time. After processing, they are recorded as one-dimensional vectors, and each cluster feature data X is obtained. i , which is the oil and gas field characteristic database.

[0020] Furthermore, for the n wells of the oil and gas field to be clustered, when the 7 feature data records in step (1) are complete, the number of matrices K in step (2) is 7; when some cluster feature data records in step (1) are incomplete or missing, the cluster feature is not considered, and the value of K is equal to the number of cluster features actually considered.

[0021] Furthermore, in step (2), the well depth feature does not change with time and is recorded as a one-dimensional feature vector; other clustering features change with time, and each well has one or more groups of detection data. After taking the average value of each well, it is recorded as a one-dimensional feature vector; the oil and gas field clustering feature database is as follows:

[0022] The well depth feature database is:

[0023] The CO2 partial pressure feature database is:

[0024] The liquid production characteristic database is:

[0025] The calcium and magnesium ion concentration characteristic database is:

[0026] The chloride ion concentration feature database is:

[0027] The mineralization characteristic database is:

[0028] The moisture content feature database is:

[0029] Where: is the depth characteristic data of the nth well, m; is the average CO2 partial pressure characteristic data of the nth well, MPa; is the average liquid production characteristic data of the nth well, t / d; is the average calcium and magnesium ion concentration characteristic data of the nth well, mg / L; is the characteristic data of the average chloride ion concentration of the nth well, mg / L; is the average mineralization characteristic data of the nth well, mg / L; is the water content of the nth well, %.

[0030] Furthermore, in step (3), the dimensionless processing process of the clustering feature data is specifically as follows:

[0031] First, calculate the dimensionless feature database matrix X' i , the dimensionless feature database matrix X' i It is calculated by calculating the characteristic data X of each cluster of oil and gas fields i The mean and standard deviation σ i , clustering feature database X by the following formula i After dimensionless processing, we can obtain:

[0032]

[0033] Where: E 1×n is a matrix with 1 row and n columns all set to 1;

[0034] Then determine the data vector A for each well n .

[0035] Furthermore, the dimensionless feature database matrix X' i as follows:

[0036] The dimensionless well depth database is:

[0037] The dimensionless CO2 partial pressure database is:

[0038] The dimensionless liquid production database is:

[0039] The dimensionless calcium and magnesium ion concentration database is:

[0040] The dimensionless chloride ion concentration database is:

[0041] The dimensionless mineralization database is:

[0042] The dimensionless moisture content database is:

[0043] Where: X' iFor X i The corresponding dimensionless characteristic data;

[0044] The data vector A for each well n :

[0045]

[0046] Where: A n is the characteristic data vector of the nth well; it means that each well contains K characteristic data, forming the K-dimensional coordinate of the vector.

[0047] Furthermore, the cluster analysis process in step (4) is as follows:

[0048] (a) P is an integer between 1 and 10, which means that all dimensionless data points are divided into P categories, each category is from A n A data vector is randomly selected as the initial cluster center C i , where i∈[1,P], calculate the data vector of each well to P cluster centers C i The multidimensional distance D(A n ,C i ), the data vector of each well is divided into the cluster center C with the closest multi-dimensional distance to it i The multi-dimensional distance is:

[0049]

[0050] Where: D(A n ,C i ) represents the data vector A of the nth well n and the i-th cluster center C i The multi-dimensional distance of cluster center C i It is also a row vector containing K features; A j Vector and C i The sum of the squares of the differences in the corresponding coordinates of the vectors;

[0051] (b) Calculate the sum of the data vectors included in each cluster and divide it by the number of data vectors. The resulting vector is the average value of the corresponding cluster and is recorded as the new cluster center C' i ;

[0052] (c) If there is a cluster center C' i Vector coordinates and initial cluster center C i If the vector coordinates are different, the clustering effect is not optimal, and we return to step 4(a) and use the cluster center C' in step 5(b) i As the initial cluster center C iRecalculate steps 4(a)(b)(c) in sequence;

[0053] If all cluster centers C' i Vector coordinates and initial cluster center C i The vector coordinates are the same, indicating that the cluster center will no longer change. Each data vector has been determined to be divided into a fixed cluster. The clustering is completed and the corresponding cluster center C is output. i , record the characteristic information of the wells included in each cluster, and execute step 4(d);

[0054] (d) After clustering is completed, all wells and corresponding data vectors have been divided into P categories, each category is a cluster, and each cluster has a cluster center C' i , calculate the square of the multi-dimensional distance between each well data vector and the cluster center of the cluster to which it belongs and add them up to get the clustering coefficient J:

[0055]

[0056] Where: J is the clustering coefficient, dimensionless; D(A n ,C i ) is the i-th cluster center C' i The data vector A contained in this cluster c Multi-dimensional distance;

[0057] (e) Whenever P changes (increases from 1 to 10 in steps of 1), execute steps 4 (a) to (d), obtain a clustering coefficient J, and draw the J curve; when P takes all integers from 1 to 10, execute step (5);

[0058] Furthermore, in step (5), the optimal number of classifications is determined by the elbow method based on the J curve obtained in step (4); that is, the P value corresponding to the inflection point of the J curve is the optimal number of clusters, indicating that the characteristics of all the wells counted are optimally divided into P categories.

[0059] Furthermore, in step (7), the corrosion rate factors include: flow velocity influencing factor g1 (x'3), water quality influencing factor g2 (x4, x5, x6) and water content influencing factor g3 (x7).

[0060] Furthermore, the flow velocity influencing factor g1(x'3) is calculated as follows:

[0061] The liquid production x3∈(0,2800) is converted into flow rate x'3∈(0,3.5), and the well depth x1 is converted into temperature x'1; the flow rate is changed under certain temperature x'1, CO2 partial pressure x2, calcium and magnesium ion concentration x4, chloride ion concentration x5, mineralization x6, and water content x7, and a (a≥3) flow rate values ​​are evenly spaced within the flow rate x'3∈(0,3.5) range for experiment, and a corrosion rate value f is obtained. 1i , where i = 1, 2...a; then the corrosion rate prediction value f1(x'3) under the influence of flow velocity is obtained based on nonlinear fitting, and further substituted into the following formula to obtain the flow velocity influence factor g1(x'3);

[0062]

[0063] Where: g1(x'3) is the flow velocity influencing factor, dimensionless; f1(x'3) is the predicted corrosion rate under the influence of flow velocity, mm / a; x2 is the CO2 partial pressure, MPa.

[0064] Furthermore, the calculation process of the water quality impact factor g2(x4,x5,x6) is as follows:

[0065] The liquid production x3∈(0,2800) is converted into the flow rate x'3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x'1; the water quality is changed under a certain temperature x'1, CO2 partial pressure x2, flow rate x'3, and water content x7, and an orthogonal design is used to determine b (b≥9) groups of experiments to obtain b corrosion rate values ​​f 2j , where j = 1, 2...b; then the corrosion rate prediction value f2(x4, x5, x6) under the influence of water quality is obtained based on nonlinear fitting, and further substituted into the following formula to obtain the water quality influence factor g2(x4, x5, x6);

[0066]

[0067] In the formula: g2(x4,x5,x6) is the water quality influencing factor, dimensionless; f2(x4,x5,x6) is the predicted corrosion rate under the influence of water quality, mm / a; x4 is the calcium and magnesium ion concentration, mg / L; x5 is the chloride ion concentration, mg / L; x6 is the mineralization, mg / L.

[0068] Furthermore, the calculation process of the moisture content influencing factor g3(x7) is as follows:

[0069] The liquid production x3∈(0,2800) is converted into the flow rate x'3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x'1; the water content is changed under certain temperature x'1, CO2 partial pressure x2, flow rate x'3, calcium and magnesium ion concentration x4, chloride ion concentration x5, and mineralization x6, and c (c≥6) water content values ​​are evenly spaced within the water content range x7∈(0,100) for experiment, and c corrosion rate values ​​f are obtained. 3k , where k = 1, 2...c; then the corrosion rate prediction value f3(x7) under the influence of moisture content is obtained based on nonlinear fitting, and further substituted into the following formula to obtain the moisture content influence factor g3(x7);

[0070]

[0071] Where: g3(x7) is the moisture content influencing factor, dimensionless; f3(x7) is the predicted corrosion rate under the influence of moisture content, mm / a; x7 is the moisture content, %.

[0072] Furthermore, the well depth parameter x1 is converted into the temperature parameter x'1 by the following formula:

[0073] x'1=g T x1+T0

[0074] Where: x'1 is temperature, °C; x1 is well depth, m; T0 is surface temperature, °C; g T is the geothermal gradient, °C / m;

[0075] Furthermore, the liquid production parameter x3 is converted into the flow rate parameter x'3 by the following formula:

[0076]

[0077] Where: x'3 is the flow rate, m / s; x3 is the liquid production, t / d; r is the tubing radius, m; ρ is the liquid density, kg / m 3 .

[0078] Furthermore, the corrosion rate of the CO2 flooding production condition is calculated by the following formula:

[0079]

[0080] Where: x'1 is temperature, °C; x'3 is flow rate, m / s.

[0081] Furthermore, the corrosion degree is divided into four levels according to the corrosion rate value:

[0082] Level 1: The corrosion degree is low; no additional anti-corrosion measures are required;

[0083] Level 2: The corrosion level is medium; monitoring needs to be strengthened;

[0084] Level 3: The corrosion level is high; it is necessary to strengthen monitoring and take corrosion protection measures;

[0085] Level 4: The corrosion level is serious; the remaining life is evaluated based on downhole corrosion detection data and finite element simulation, and the pipe replacement time is estimated.

[0086] Compared with the prior art, the present invention has the following beneficial effects:

[0087] The present invention discloses a method for classifying and predicting corrosion rates of CO2 drive production conditions. The method takes into account the actual service environment factors of CO2 drive production wells, classifies wells with similar environmental conditions and predicts their corrosion rates based on corrosion-related characteristic data, and the predicted corrosion rate values ​​match the on-site monitoring values ​​by more than 80%, thus meeting the accuracy requirements of oilfield corrosion protection projects. On the one hand, it can provide a scientific and reliable method for the classification management of on-site CO2 drive production wells, and on the other hand, after classification, combined with the corrosion rate prediction results, it can provide a reference for on-site corrosion control and corrosion prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] Figure 1 This is a flow chart of the corrosion classification and corrosion rate prediction method for CO2 flooding production conditions of the present invention;

[0089] Figure 2 Graph showing the J curve obtained by plotting the embodiment. DETAILED DESCRIPTION

[0090] The following non-limiting examples can enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. The following content is merely an exemplary description of the scope of the present invention, and those skilled in the art can make various changes and modifications to the present invention based on the disclosed content, which should also fall within the scope of the present invention.

[0091] The present invention is described in detail below with reference to the accompanying drawings and specific implementation examples.

[0092] Ten wells with corrosion monitoring function in Block M of X Oilfield where CO2 flooding is implemented are randomly selected as examples and numbered W1-W10 respectively. Cluster analysis is performed on the service environment parameters.

[0093] Specific implementation steps:

[0094] (1) Determine the service environment parameters that affect the corrosion rate of CO2 flooding production wells as clustering features

[0095] There are 7 service environment parameters that affect the corrosion rate of CO2 flooding production wells, including: well depth characteristics, m; liquid production characteristics, t / d; CO2 partial pressure characteristics, MPa; calcium and magnesium ion concentration characteristics, mg / L; chloride ion concentration characteristics, mg / L; mineralization characteristics, mg / L; water content characteristics, %;

[0096] The calcium and magnesium ion concentrations are the sum of the calcium ion concentration and the magnesium ion concentration.

[0097] (2) Establishing a database of CO2 flooding well characteristics in oil and gas fields

[0098] The well depth characteristic database is:

[0099] X1=[1500 1300 1190 1200 1500 1800 1200 1320 1800 1740];

[0100] The CO2 partial pressure feature database is:

[0101] X2=[0.5 5 4.6 3 0.1 0.8 2 3 2.5 3.8];

[0102] The liquid production characteristic database is:

[0103] X3=[15 29 28 16 12 17 13 16 18 19];

[0104] The calcium and magnesium ion concentration characteristic database is:

[0105] X4=[1840 2310 4540 2080 1780 9100 3590 5687 1026 2385];

[0106] The chloride ion concentration feature database is:

[0107] X5=[4349 3563 3022 655 1926 4238 3458 3959 4049 5319];

[0108] The mineralization characteristic database is:

[0109] X6=[12686.58981.78225.12986.936943.218829.4812218946.318461.511315.6];

[0110] The moisture content feature database is:

[0111] X7=[10 18 6 19 15 9 12 9 8 4].

[0112] (3) Dimensionless transformation of CO2 flooding production well characteristic data

[0113] (a) Calculate each feature data X i The mean

[0114]

[0115] (b) Calculate each feature data X i Standard deviation i :

[0116] σ1=237.87, σ2=1.48, σ3=5.47, σ4=31230, σ5=1259.486, σ6=3470, σ7=4.71;

[0117] (c) Calculate and obtain dimensionless feature database;

[0118] The dimensionless well depth database is:

[0119] X'1=[0.19 -0.65 -1.11 -1.07 0.19 1.45 -1.07 -0.56 1.45 1.19];

[0120] The dimensionless CO2 partial pressure database is:

[0121] X'2=[-1.43 1.61 1.34 0.25 -1.09 -1.22 -0.42 0.25 -0.08 0.80];

[0122] The dimensionless liquid production database is:

[0123] X'3=[-0.6 1.95 1.77 -0.42 -1.15 -0.23 -0.96 -0.42 -0.054 0.127];

[0124] The dimensionless calcium and magnesium ion concentration database is:

[0125] X'4=[-0.66 -0.51 0.19 -0.58 -0.68 2.23 -0.10 1.52 -0.9 -0.49];

[0126] The dimensionless chloride ion concentration database is:

[0127] X'5=[0.71 0.08 -0.34 -2.22 -1.21 0.62 0.003 0.40 0.47 1.48];

[0128] The dimensionless mineralization database is:

[0129] X'6=[0.93 -0.13 -0.64 -1.86 2.15 -0.17 -0.38 -0.14 -0.28 0.537];

[0130] The dimensionless moisture content database is:

[0131] X'7=[-0.21 1.4 -1.06 1.69 0.84 -0.42 0.21 -0.42 -0.63 -1.48];

[0132] Thus, 10 wells were determined, and the data vectors of each well were:

[0133] A1=[0.19 -1.43 -0.6 -0.66 0.71 0.93 -0.21];

[0134] A2=[-0.65 1.61 1.95 -0.51 0.08-0.13 1.4];

[0135] A3=[-1.11 1.34 1.77 0.19 -0.34 -0.64 -1.06];

[0136] A4=[-1.07 0.25 -0.42 -0.58 -2.22 -1.86 1.69];

[0137] A5=[0.19 -1.09 -1.15 -0.68 -1.21 2.15 0.84];

[0138] A6=[1.45 -1.22 -0.23 2.23 0.62 -0.17 -0.42];

[0139] A7=[-1.07 -0.42 -0.96 -0.10 0.003 -0.38 0.21];

[0140] A8=[-0.56 0.25 -0.42 1.52 0.40 -0.14 -0.42];

[0141] A9=[1.45 -0.08 -0.054 -0.9 0.47 -0.28 -0.63];

[0142] A 10 =[1.19 0.80 0.127 -0.49 1.48 0.537 -1.48].

[0143] (4) Clustering all wells by features based on multidimensional distance

[0144] The specific process of cluster analysis is as follows:

[0145] (a) P is an integer between 1 and 10, which means that all dimensionless data points are divided into P categories, each category is from A n A data vector is randomly selected as the initial cluster center C i , where i∈[1,P], calculate the data vector of each well to P cluster centers C i The multidimensional distance D(A n ,C i ), the data vector of each well is divided into the cluster center C with the closest multi-dimensional distance to it i The multi-dimensional distance is:

[0146]

[0147] Where: D(A n ,C i ) represents the data vector A of the nth well n and the i-th cluster center C i The multi-dimensional distance of cluster center C i It is also a row vector containing K features; A j Vector and C i The sum of the squares of the differences in the corresponding coordinates of the vectors;

[0148] (b) Calculate the sum of the data vectors included in each cluster and divide it by the number of data vectors. The resulting vector is the average value of the corresponding cluster and is recorded as the new cluster center C' i ;

[0149] (c) If there is a cluster center C' i Vector coordinates and initial cluster center C i If the vector coordinates are different, the clustering effect is not optimal, and we return to step 4(a) and use the cluster center C' in step 5(b) i As the initial cluster center C i Recalculate steps 4(a)(b)(c) in sequence;

[0150] If all cluster centers C' i Vector coordinates and initial cluster center C i The vector coordinates are the same, indicating that the cluster center will no longer change. Each data vector has been determined to be divided into a fixed cluster. The clustering is completed and the corresponding cluster center C is output. i , record the characteristic information of the wells included in each cluster, and execute step 4(d);

[0151] (d) After clustering is completed, all wells and corresponding data vectors have been divided into P categories, each category is a cluster, and each cluster has a cluster center C' i , calculate the square of the multi-dimensional distance between each well data vector and the cluster center of the cluster to which it belongs and add them up to get the clustering coefficient J:

[0152]

[0153] Where: J is the clustering coefficient, dimensionless; D(A n ,C i ) is the i-th cluster center C' i The data vector A contained in this cluster c Multi-dimensional distance;

[0154] (e) Whenever P changes (increases from 1 to 10 in steps of 1), execute steps 4(a)-(d) and obtain a clustering coefficient J; when P covers all integers from 1 to 10, execute step (5).

[0155] P is set from 1 to 10 (step 1), and the final result is obtained by iterating steps (a) to (e):

[0156] ①When P=1, the cluster center and J are:

[0157] C'1=[0.001 0.002 0.001 0.001 0 0.001 0.001]

[0158] J = 90.17;

[0159] ②When P=2, the cluster center and SSE are:

[0160] C'1=[0.41 -0.46 -0.47 0.13 0.35 0.38 -0.30]

[0161] C'2=[-0.94 1.07 1.10 -0.30 -0.82 -0.88 0.71]

[0162] SSE=71.32;

[0163] ③When P=3, the cluster center and SSE are:

[0164] C'1=[-0.13 -0.33 -0.65 -0.58 -0.74 -0.09 0.53]

[0165] C'2=[0.57 -0.40 -0.28 0.66 0.80 0.29 -0.64]

[0166] C'3=[-0.88 1.48 1.87 -0.16 -0.13 -0.39 0.22]

[0167] SSE = 59.1;

[0168] ④When P=4, the cluster center and SSE are:

[0169] C'1=[0.53 0.10 -0.30 -0.51 0.65 -0.04 -0.64]

[0170] C'2=[0.44 -0.49 -0.33 1.89 0.51 -0.17 -0.42]

[0171] C'3=[-0.94 1.07 1.10 -0.30 -0.82 -0.88 0.71]

[0172] C'4=[0.19 -1.26 -0.88 -0.67 -0.25 1.55 0.32]

[0173] SSE = 44.6;

[0174] ⑤When P=5, the cluster center and SSE are:

[0175] C'1=[0.36 -0.80 -0.42 1.04 0.58 0.20 -0.35]

[0176] C'2=[1.33 0.36 0.04 -0.71 0.98 0.13 -1.07]

[0177] C'3=[-0.44 -0.76 -1.06 -0.39 -0.61 0.89 0.53]

[0178] C'4=[-0.88 1.48 1.87 -0.16 -0.13 -0.39 0.22]

[0179] C'5=[-0.23 -0.23 -0.23 -0.23 -0.23 -0.23 -0.23]

[0180] SSE = 39.5;

[0181] ⑥When P=6, the cluster center and SSE are:

[0182] C'1=[-0.66 -0.06 -0.12 -0.19 -0.52 0.38 0.00]

[0183] C'2=[0.12 0.12 0.12 0.12 0.12 0.12 0.12]

[0184] C'3=[0.08 0.21 0.43 1.09 0.37 -0.15 0.22]

[0185] C'4=[0.11 0.11 0.11 0.11 0.11 0.11 0.11]

[0186] C'5=[-0.23 -0.23 -0.23 -0.23 -0.23 -0.23 -0.23]

[0187] C'6=[-0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25]

[0188] SSE=35.12;

[0189] ⑦When P=7, the cluster center and SSE are:

[0190] C'1=[1.33 0.36 0.04 -0.71 0.98 0.13 -1.07]

[0191] C'2=[-0.82 -0.08 -0.70 0.72 0.20 -0.27 -0.11]

[0192] C'3=[-0.01 -0.01 -0.01 -0.01 -0.01 -0.01 -0.01]

[0193] C'4=[0.11 0.11 0.11 0.11 0.11 0.11 0.11]

[0194] C'5=[-0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25]

[0195] C'6=[-0.88 1.48 1.87 -0.16 -0.13 -0.39 0.22]

[0196] C'7=[-0.23 -0.23 -0.23 -0.23 -0.23 -0.23 -0.23]

[0197] SSE=32.3;

[0198] ⑧When P=8, the cluster center and SSE are:

[0199] C'1=[0.12 0.12 0.12 0.12 0.12 0.12 0.12]

[0200] C'2=[-0.88 1.48 1.87 -0.16 -0.13 -0.39 0.22]

[0201] C'3=[0.44 -0.49 -0.33 1.89 0.51 -0.17 -0.42]

[0202] C'4=[0.11 0.11 0.11 0.11 0.11 0.11 0.11]

[0203] C'5=[-0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25]

[0204] C'6=[-0.21 -0.21 -0.21 -0.21 -0.21 -0.21 -0.21]

[0205] C'7=[-0.01 -0.01 -0.01 -0.01 -0.01 -0.01 -0.01]

[0206] C'8=[-0.23 -0.23 -0.23 -0.23 -0.23 -0.23 -0.23]

[0207] SSE=30.5;

[0208] ⑨When P=9, the cluster center and SSE are:

[0209] C'1=[-0.21 -0.21 -0.21 -0.21 -0.21 -0.21 -0.21]

[0210] C'2=[0.11 0.11 0.11 0.11 0.11 0.11 0.11]

[0211] C'3=[-0.01 -0.01 -0.01 -0.01 -0.01 -0.01 -0.01]

[0212] C'4=[0.31 0.31 0.31 0.31 0.31 0.31 0.31]

[0213] C'5=[0.12 0.12 0.12 0.12 0.12 0.12 0.12]

[0214] C'6=[-0.23 -0.23 -0.23 -0.23 -0.23 -0.23 -0.23]

[0215] C'7=[0.11 0.11 0.11 0.11 0.11 0.11 0.11]

[0216] C'8=[-0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25]

[0217] C'9=[0.44 -0.49 -0.33 1.89 0.51 -0.17 -0.42]

[0218] SSE = 28.39;

[0219] ⑩ When P=10, the 10 wells in this implementation method are divided into 10 categories, that is, each well is one category, and the cluster center is the data vector of each well itself, and there is no meaning of clustering.

[0220] (5) Determine the optimal number of classifications for CO2 flooding production wells;

[0221] In step (4), different clustering coefficients corresponding to different P values ​​are calculated, and the J curve is drawn as follows: Figure 2 , the horizontal axis is P, the vertical axis is the value of J. According to the elbow method, the P value corresponding to the inflection point of the J curve is the optimal number of clusters, indicating that the characteristics of all the wells counted are divided into P categories optimally; according to Figure 2 The optimal number of categories is determined to be P=4.

[0222] (6) Preliminary corrosion classification of CO2 flooding production wells

[0223] The four cluster centers C'1, C'2, C'3, C'4 corresponding to the optimal number of clusters P = 4 obtained from step (5), and the characteristic information of the wells contained in each cluster;

[0224] The first category includes: Well W3, Well W7, Well W9;

[0225] The second category is: Well W5;

[0226] The third category is: Well W2, Well W4, Well W6, Well W8;

[0227] The fourth category is: Well W1 and Well W10;

[0228] According to the service environment parameters of the 10 wells, they are divided into four categories in terms of corrosion protection. The wells included in each category have the same corrosion characteristics.

[0229] (7) Constructing the influencing factors of the corrosion rate of CO2 flooding production wells

[0230] Based on the corrosion weight loss test of the pipe in a high-temperature autoclave, the corrosion rate is obtained, and the influencing factors of the corrosion rate of the CO2 flooding production well are constructed; the corrosion rate influencing factors include: flow rate influencing factor g1 (x'3), water quality influencing factor g2 (x4, x5, x6) and water content influencing factor g3 (x7);

[0231] The experimental parameter types are consistent with the service environment parameter types described in step 1, a total of 7 types, namely well depth, liquid production, CO2 partial pressure, calcium and magnesium ion concentration, chloride ion concentration, mineralization, and water content;

[0232] The well depth parameter x1 is converted into the temperature parameter x'1 by the following formula:

[0233] x'1=g T x1+T0

[0234] Where: x'1 is temperature, °C; x1 is well depth, m; T0 is surface temperature, °C; g T is the geothermal gradient, °C / m;

[0235] The liquid production parameter x3 is converted into the flow rate parameter x'3 by the following formula:

[0236]

[0237] Where: x'3 is the flow rate, m / s; x3 is the liquid production, t / d; r is the tubing radius, m; ρ is the liquid density, kg / m3;

[0238] ① Calculate the flow velocity influencing factor:

[0239] The liquid production x3∈(0,2800) is converted into the flow rate x'3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x'1; the flow rate is changed under a certain temperature x'1, CO2 partial pressure x2, calcium and magnesium ion concentration x4, chloride ion concentration x5, mineralization x6, and water content x7, and 3 flow rate values ​​are evenly spaced within the flow rate x'3∈(0,3.5) range for experiments to obtain 3 corrosion rate values, and then the corrosion rate prediction value under the influence of flow rate is obtained based on nonlinear fitting, and the flow rate influence factor g1(x'3) is obtained;

[0240]

[0241] Where: g1(x'3) is the velocity influencing factor, dimensionless;

[0242] ②Calculate water quality impact factors

[0243] The water quality influencing factor considers three service environment parameters, including calcium and magnesium ion concentration x4, chloride ion concentration x5, and mineralization x6∈(0,120000); the liquid production x3∈(0,2800) is converted into flow rate x'3∈(0,3.5), and the well depth parameter x1 is converted into temperature parameter x'1; the water quality is changed under certain temperature x'1, CO2 partial pressure x2, flow rate x'3, and water content x7, and 9 groups of experiments are determined by orthogonal design to obtain 9 corrosion rate values; then the corrosion rate prediction value under the influence of water quality is obtained based on nonlinear fitting, and the water quality influencing factor g2(x4,x5,x6) is obtained;

[0244] g2(x4,x5,x6)=0.015+1.5×10 -5 x5-1.91×10 -5 x4+1.24×10 -8 x5x4+6.475×10 -10 (x6-x5-2000) 2 (0<x6<120000)

[0245] In the formula: g2(x4,x5,x6) is the water quality influencing factor, dimensionless; x4 is the concentration of calcium and magnesium ions, mg / L; x5 is the concentration of chloride ions, mg / L; x6 is the mineralization, mg / L;

[0246] ③ Calculate the factors affecting moisture content

[0247] The liquid production x3∈(0,2800) is converted into the flow rate x'3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x'1; the water content is changed under certain temperature x'1, CO2 partial pressure x2, flow rate x'3, calcium and magnesium ion concentration x4, chloride ion concentration x5, and salinity x6, and 6 water content values ​​are evenly spaced in the water content range x7∈(0,100) for experiment to obtain 6 corrosion rate values; then the corrosion rate prediction value under the influence of water content is obtained based on nonlinear fitting, and the water content influence factor g3(x7) is obtained;

[0248]

[0249] Where: g3(x7) is the moisture content influencing factor, dimensionless;

[0250] (8) Prediction of corrosion rate in CO2 flooding production conditions and optimization and management of production well corrosion classification

[0251] ①Prediction of corrosion rate in CO2 flooding production conditions:

[0252] Substitute the velocity influencing factor g1(x'3), water quality influencing factor g2(x4,x5,x6) and water content influencing factor g3(x7) obtained in step (7) into the following formula to obtain the corrosion rate prediction model for CO2 flooding production conditions:

[0253]

[0254] The corrosion rates of 10 wells in corrosive environments were calculated, which are:

[0255] Well W1: 0.01488mm / a, Well W2: 0.1436mm / a, Well W3: 0.0316mm / a, Well W4: 0.0274mm / a, Well W5: 0.014mm / a, Well W6: 0.1105mm / a, Well W7: 0.0299mm / a, Well W8: 0.1202mm / a, Well W9: 0.0193mm / a, Well W10: 0.03667mm / a;

[0256] ②CO2 flooding production well corrosion classification optimization and management:

[0257] In step (6), the preliminary corrosion classification results of CO2 flooding production wells were obtained. In each category, the corrosion degree can be divided into four levels:

[0258] The first category is:

[0259] ① Low corrosion level: Well W9;

[0260] ② Medium corrosion degree: Well W3 and Well W7;

[0261] ③High degree of corrosion: None;

[0262] ④Severe corrosion: None;

[0263] The second category is:

[0264] ① Low corrosion level: Well W5;

[0265] ② Medium corrosion degree: None;

[0266] ③High degree of corrosion: None;

[0267] ④Severe corrosion: None;

[0268] The third category is:

[0269] ①Low corrosion degree: None;

[0270] ② Medium corrosion degree: Well W4;

[0271] ③High degree of corrosion: Well W2, Well W6, Well W8;

[0272] ④Severe corrosion: None;

[0273] The fourth category is:

[0274] ① Low corrosion level: Well W1;

[0275] ② Medium corrosion degree: Well W10;

[0276] ③High degree of corrosion: None;

[0277] ④Severe corrosion: None;

[0278] According to the above classification:

[0279] When the corrosion level is low, no additional anti-corrosion measures are required for the well;

[0280] When the corrosion level is moderate, the well requires enhanced monitoring;

[0281] When the corrosion level is high, the well needs to be monitored more closely and corrosion protection measures should be taken, such as surface coating or injection of corrosion inhibitors;

[0282] When the corrosion level is severe, the remaining life is evaluated based on downhole corrosion detection data and finite element simulation to estimate the time for pipe replacement.

[0283] The above 10 wells are randomly selected from the M block of the X oilfield where CO2 flooding is implemented and have corrosion monitoring functions. The accuracy of the model is tested using the field corrosion monitoring data of the 10 sample wells. The field corrosion monitoring values ​​of the 10 wells are:

[0284] Well W1: 0.0174mm / a, Well W2: 0.126mm / a, Well W3: 0.039mm / a, Well W4: 0.0251mm / a, Well W5: 0.016mm / a, Well W6: 0.098mm / a, Well W7: 0.0274mm / a, Well W8: 0.105mm / a, Well W9: 0.021mm / a, Well W10: 0.038mm / a;

[0285] The errors of the predicted values ​​compared with the on-site monitoring values ​​are 14.48% for Well W1, 13.97% for Well W2, 18.97% for Well W3, 9.16% for Well W4, 12.50% for Well W5, 12.76% for Well W6, 9.12% for Well W7, 14.48% for Well W8, 8.10% for Well W9, and 3.5% for Well W10. The agreement rate between the predicted corrosion rate and the on-site monitoring value is over 80%, which meets the accuracy requirements of oilfield corrosion protection projects.

[0286] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions of the technical solution of the present invention by ordinary technicians in this field do not deviate from the essence and scope of the technical solution of the present invention.

Claims

1. A method for clustering analysis of corrosion in CO2 flooding production wells, characterized in that: The following steps are involved: (1) Determine clustering features; (2) Establish a database of CO2 flooding well characteristics in oil and gas fields; (3) Dimensionless transformation of cluster characteristic data of CO2 flooding production wells; (4) Cluster analysis of all wells according to clustering characteristics based on multidimensional distance: (5) Determine the optimal number of classifications for CO2 flooding production wells; (6) Preliminary corrosion classification of CO2 flooding production wells; (7) Construct the influencing factors of the corrosion rate of CO2 flooding production wells; (8) Prediction of corrosion rate in CO2 flooding production conditions and optimization and management of production well corrosion classification.

2. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 1, characterized in that: In step (1), the service environment parameters that affect the corrosion rate of CO2 flooding production wells are used as clustering features, including 7 categories, specifically well depth, liquid production, CO2 partial pressure, calcium and magnesium ion concentrations, chloride ion concentrations, mineralization and water content; the calcium and magnesium ion concentration is the sum of the calcium ion concentration and the magnesium ion concentration.

3. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 1, characterized in that: The characteristic database establishment process is as follows: each cluster feature in step (1) is taken as a matrix, each matrix represents the cluster feature data of n wells, and one or more groups of detection data are obtained according to whether each cluster feature changes over time. After processing, they are recorded as one-dimensional vectors, and each cluster feature data X is obtained. i , which is the oil and gas field characteristic database.

4. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 3, characterized in that: For the n wells of the oil and gas field to be clustered, when the 7 feature data records in step (1) are complete, the number of matrices K in step (2) is 7; when some cluster feature data records in step (1) are incomplete or missing, the cluster feature is not considered, and the value of K is equal to the number of cluster features actually considered.

5. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 3, characterized in that: In step (2), the well depth feature does not change with time and is recorded as a one-dimensional feature vector; other clustering features change with time, and each well has one or more groups of detection data. After taking the average value of each well, it is recorded as a one-dimensional feature vector; the oil and gas field clustering feature database is as follows: The well depth feature database is: The CO2 partial pressure feature database is: The liquid production characteristic database is: The calcium and magnesium ion concentration characteristic database is: The chloride ion concentration feature database is: The mineralization characteristic database is: The moisture content feature database is: Where: is the depth characteristic data of the nth well, m; is the average CO2 partial pressure characteristic data of the nth well, MPa; is the average liquid production characteristic data of the nth well, t / d; is the average calcium and magnesium ion concentration characteristic data of the nth well, mg / L; is the characteristic data of the average chloride ion concentration of the nth well, mg / L; is the average mineralization characteristic data of the nth well, mg / L; is the water content of the nth well, %.

6. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 1, characterized in that: In step (3), the dimensionless processing process of the clustering feature data is specifically as follows: First, calculate the dimensionless feature database matrix X′ i , the dimensionless feature database matrix X′ i It is calculated by calculating the characteristic data X of each cluster of oil and gas fields i The mean and standard deviation σ i , clustering feature database X by the following formula i After dimensionless processing, we can obtain: Where: E 1×n is a matrix with 1 row and n columns all set to 1; Then determine the data vector A for each well n .

7. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 6, characterized in that: The dimensionless feature database matrix X′ i as follows: The dimensionless well depth database is: The dimensionless CO2 partial pressure database is: The dimensionless liquid production database is: The dimensionless calcium and magnesium ion concentration database is: The dimensionless chloride ion concentration database is: The dimensionless mineralization database is: The dimensionless moisture content database is: Where: X′ i For X i The corresponding dimensionless characteristic data; The data vector A for each well n : Where: A n is the characteristic data vector of the nth well; it means that each well contains K characteristic data, forming the K-dimensional coordinate of the vector.

8. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 1, characterized in that: In step (4), all dimensionless data points are divided into P categories, and the clustering coefficients corresponding to different P values ​​are calculated to draw the J curve; in step (5), the J curve obtained in step (4) is used to determine the optimal number of categories using the elbow method.

9. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 1, characterized in that: In step (7), the corrosion rate factors include: flow velocity influence factor g1(′x3), water quality influence factor g2(x4, x5, x6) and water content influence factor g3(x7).

10. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 9, characterized in that: The calculation process of the flow velocity influence factor g1(x′3) is as follows: The liquid production x3∈(0,2800) is converted into flow rate x′3∈(0,3.5), and the well depth x1 is converted into temperature x′1; the flow rate is changed under certain temperature x′1, CO2 partial pressure x2, calcium and magnesium ion concentration x4, chloride ion concentration x5, mineralization x6, and water content x7, and a (a≥3) flow rate values ​​are evenly spaced within the flow rate x′3∈(0,3.5) range for experiment, and a corrosion rate value f is obtained. 1i , where i = 1, 2...a; then the corrosion rate prediction value f1(x′3) under the influence of flow velocity is obtained according to nonlinear fitting, and further substituted into the following formula to obtain the flow velocity influence factor g1(x′3); Where: g1(x′3) is the flow velocity influencing factor, dimensionless; f1(x′3) is the predicted corrosion rate under the influence of flow velocity, mm / a; x2 is the CO2 partial pressure, MPa.

11. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 9, characterized in that: The calculation process of the water quality impact factor g2(x4,x5,x6) is as follows: The liquid production x3∈(0,2800) is converted into the flow rate x′3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x′1; the water quality is changed under a certain temperature x′1, CO2 partial pressure x2, flow rate x′3, and water content x7, and an orthogonal design is used to determine b (b≥9) groups of experiments to obtain b corrosion rate values ​​f 2j , where j = 1, 2...b; then the corrosion rate prediction value f2(x4, x5, x6) under the influence of water quality is obtained based on nonlinear fitting, and further substituted into the following formula to obtain the water quality influence factor g2(x4, x5, x6); In the formula: g2(x4,x5,x6) is the water quality influencing factor, dimensionless; f2(x4,x5,x6) is the predicted corrosion rate under the influence of water quality, mm / a; x4 is the calcium and magnesium ion concentration, mg / L; x5 is the chloride ion concentration, mg / L; x6 is the mineralization, mg / L.

12. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 9, characterized in that: The calculation process of the moisture content influencing factor g3(x7) is as follows: The liquid production x3∈(0,2800) is converted into the flow rate x′3∈(0,3.5), and the well depth parameter x1 is converted into the temperature parameter x′1; the water content is changed under certain temperature x′1, CO2 partial pressure x2, flow rate x′3, calcium and magnesium ion concentration x4, chloride ion concentration x5, and mineralization x6, and c (c≥6) water content values ​​are evenly spaced within the water content range x7∈(0,100) for experiment, and c corrosion rate values ​​f are obtained. 3k , where k = 1, 2...c; then the corrosion rate prediction value f3(x7) under the influence of moisture content is obtained based on nonlinear fitting, and further substituted into the following formula to obtain the moisture content influence factor g3(x7); Where: g3(x7) is the moisture content influencing factor, dimensionless; f3(x7) is the predicted corrosion rate under the influence of moisture content, mm / a; x7 is the moisture content, %.

13. The method for clustering analysis of corrosion in CO2 flooding production wells according to any one of claims 10 to 12, characterized in that: The well depth parameter x1 is converted into the temperature parameter x′1 by the following formula: x′1=g T x1+T0 Where: x′1 is temperature, °C; x1 is well depth, m; T0 is surface temperature, °C; g T is the geothermal gradient, °C / m; The liquid production parameter x3 is converted into the flow rate parameter x′3 by the following formula: Where: x′3 is the flow rate, m / s; x3 is the liquid production, t / d; r is the tubing radius, m; ρ is the liquid density, kg / m3.

14. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 9, characterized in that: The corrosion rate of the CO2 flooding production condition is calculated by the following formula: Where: x'1 is temperature, ℃; x'3 is flow rate, m / s.

15. The method for clustering analysis of corrosion in CO2 flooding production wells according to claim 14, characterized in that: The corrosion degree is divided into four levels according to the corrosion rate value: Level 1: The corrosion degree is low; No additional antiseptic measures are required; Level 2: The corrosion level is medium; monitoring needs to be strengthened; Level 3: The corrosion level is high; it is necessary to strengthen monitoring and take corrosion protection measures; Level 4: The corrosion degree is serious; Based on downhole corrosion detection data and finite element simulation, the remaining life is evaluated and the pipe replacement time is estimated.