A method for oil and gas field corrosion cluster analysis
By determining various service environment parameters and iteratively optimizing cluster centers, the subjective and cumbersome problems of corrosion classification in oil and gas fields are solved, enabling efficient and reliable cluster analysis and risk assessment of oil and gas field pipelines.
Patent Information
- Application Number
- CN202211340701.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-29
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-10-29
AI Technical Summary
Existing methods for classifying corrosion in oil and gas fields are subjective, lack real reliability, and involve cumbersome classification steps, making it difficult to effectively assess the future corrosion risks of oil pipelines and develop targeted control plans.
By determining various service environment parameters, an oil and gas field corrosion dataset is established, standardized, and the optimal number of cluster centers is determined. The cluster centers are then iteratively optimized to achieve cluster analysis of oil and gas field pipelines.
It provides accurate and reliable corrosion clustering analysis results, simplifies the classification process, can assess the corrosion risk of similar oil pipes, provides targeted control solutions, and improves the accuracy of corrosion prediction and management efficiency.
Smart Images

Figure CN115511007B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil and gas safety engineering technology, and specifically relates to a method for corrosion clustering analysis in oil and gas fields. Background Technology
[0002] Oil pipelines are susceptible to corrosion due to the influence of the external environment and internal media. The service environments of oil pipelines vary across different blocks in oil and gas fields, resulting in numerous influencing factors and exceptionally complex corrosion systems. Therefore, a systematic evaluation of corrosion conditions in oil and gas fields is necessary, along with cluster analysis of multiple oil pipelines within the field, to improve the management efficiency of corrosion prevention and control.
[0003] Currently, existing methods for classifying corrosion in oil and gas fields still have some problems to be solved: In existing technologies, the degree of corrosion is usually classified according to protection rating, appearance rating, and comprehensive rating. The classification basis is relatively subjective, and the classification results lack true reliability. Most methods for classifying corrosion of oil pipes are based on oil pipes that have already experienced accidents, analyzing the causes of corrosion failure and assessing the corrosion risks that oil pipes will face in the future. The classification steps are cumbersome and have little reference value for the formulation of existing oil pipe corrosion control schemes.
[0004] Therefore, it is necessary to comprehensively consider the characteristics of multiple corrosion factors in oil and gas fields to evaluate the corrosion situation, organize the corrosion data of oil and gas fields, establish an algorithm to cluster multiple oil pipes in oil and gas fields, and group oil pipes with the same or similar characteristics into one class. It is particularly important to propose an oil and gas field corrosion clustering analysis method with the above advantages. Summary of the Invention
[0005] The purpose of this invention is to provide a corrosion clustering analysis method for oil and gas fields to solve the corrosion control problem of oil pipelines with similar characteristics in oil and gas fields, and to achieve efficient management of corrosion prevention and control in oil and gas fields.
[0006] 1. A cluster analysis method for corrosion in oil and gas fields, characterized by comprising the following steps:
[0007] Step 1: Determine the evaluation indicators:
[0008] Organize service environment parameter set x K ;
[0009] Where: K is the number of service environment parameters, typically 1-8; x1 is temperature, °C; x2 is the partial pressure of H2S, MPa; x3 is the partial pressure of CO2, MPa; x4 is the partial pressure of Cl... - Concentration, g / L; x5 is liquid-to-gas ratio; x6 is pH value; x7 is flow rate, m / s; x8 is total mineralization, g / L;
[0010] Step 2: Establish an oil and gas field corrosion dataset:
[0011] Corrosion data of Z oil pipelines in an oil and gas field at m time points were collected and processed to obtain a data point set A1 under K service environment parameters. A2
[0012] Where: Z represents the number of oil pipelines studied in a certain oil and gas field; t j x is a point in time m; i A is one of the parameters in the service environment parameters; i For any service environment parameter x i The corresponding set of corrosion data points; For t j At time n, the oil pipeline is in a certain service environment parameter x i Corresponding corrosion data;
[0013] Step 3: Standardize the processing of oil and gas field corrosion data:
[0014] (a) Solve for each service environment parameter x of the oil and gas field using the following formula (1). i Corresponding corrosion data A i mean
[0015]
[0016] In the formula: For A i The mean;
[0017] (b) Solve for each service environment parameter x of the oil and gas field using formula (2). i Corresponding corrosion data A i Standard deviation σ i :
[0018]
[0019] In the formula: σ i For A i Standard deviation;
[0020] (c) Apply formula (3) to each service environment parameter x i The corresponding corrosion data point set A i After standardization, the standardized corrosion data point set A' is obtained. i :
[0021]
[0022] In the formula: A'i For A i Corresponding standardized corrosion data;
[0023] Step 4: Determine the optimal number of cluster centers S':
[0024] (a) Solve for the number of clusters P in the dataset using formula (4):
[0025]
[0026] In the formula: P represents all datasets A'1 to A' i The number of clusters;
[0027] (b) Based on all datasets A'1 to A' i The number of clusters P is used to plot scatter plots of different cluster numbers P in formula (5) to determine the function type:
[0028]
[0029] In the formula: S represents all possible datasets A'1 to A' i The number of clusters, 1 < S ≤ P, where S is an integer; f(S) is the function value corresponding to different numbers of clusters S; y is the dataset A' i The included standardized corrosion data points; C i Let S be the initial cluster center of the i-th cluster, 1 ≤ i ≤ S, where i is an integer, and can generally be randomly selected from the erosion data points; y j C ij For y and C i The corresponding value of the j-th service environment parameter, 1≤j≤α;
[0030] (c) Based on the scatter plot, solve for the inflection point S' of the function curve using formula (6):
[0031] f″(S')=0 (6)
[0032] In the formula: S' is the number of optimal cluster centers;
[0033] Step 5: Re-divide the clusters:
[0034] (a) The distance from each corrosion data sample point to the randomly selected S' cluster centers is calculated using formula (7). i The nearest distance mind(y,C) i Determine the minimum cluster center point minC. i :
[0035]
[0036] In the formula: mind(y,C) i( ) represents the minimum cluster center point minC from the corrosion data sample point y. i The closest distance; minC i mind(y,C) is the nearest distance i The minimum cluster center corresponding to )
[0037] (b) Based on step 5(a), assign the data points to the class center points minC with the smallest distance. i Within the cluster, the new cluster center C is calculated using formula (8). i 'Re-divide the clusters:'
[0038]
[0039] In the formula: C i ' represents the newly calculated cluster centers; y i For dataset A' i The non-y in j Repeated erosion data points;
[0040] Step 6: Determine the final clustering results for oil and gas field corrosion:
[0041] The change in the location of the S' cluster centers Δ is calculated using formula (9). i :
[0042] Δ i =|C i '-minC i | (9)
[0043] When Δ i When the value is greater than β, repeat steps 5(a) and (b) above to update the cluster centers;
[0044] When Δ i When the value is less than or equal to β, the system is considered to have reached a stationary state, the iteration ends, and the final clustering result is output.
[0045] In the formula: Δ i S' represents the position change between the i-th minimum cluster center and the i-th new cluster center, 1≤i≤S'; β is the threshold for allowed offset, typically 0.01-0.05.
[0046] The present invention has the following beneficial effects:
[0047] (1) This method of classifying corrosion in oil and gas fields takes into account a variety of corrosion influencing factors, takes the actual service environment of oil and gas field pipelines as a premise, determines evaluation indicators, and organizes and analyzes corrosion data, which can avoid the subjectivity of classification of corrosion pipelines.
[0048] (2) This oil and gas field corrosion classification method is based on standardized oil and gas field corrosion data. The algorithm is iterated to the optimal cluster center, which simplifies the classification steps of corroded oil pipes.
[0049] (3) This oil and gas field corrosion classification method can take into account the corrosion situation of oil and gas fields from multiple perspectives, provide real and reliable cluster analysis results, assess the corrosion risk of this type of oil pipe based on the corrosion situation of a certain type of oil pipe, and give a targeted corrosion control plan; in addition, the corrosion data of similar oil pipes can be applied to the corrosion prediction of this type of oil pipe, enrich the sample data, improve the prediction accuracy, and provide technical support for the efficient management of oil and gas fields. Attached Figure Description
[0050] Figure 1 This is a flowchart of corrosion cluster analysis in oil and gas fields;
[0051] Figure 2 This is the f(S) function curve corresponding to different cluster numbers for the oil pipeline in Case 1;
[0052] Figure 3 This is the f(S) function curve corresponding to different cluster numbers for the oil pipeline in Case 2; Detailed Implementation
[0053] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0054] Case 1:
[0055] Taking four oil pipes (No. 1, No. 2, No. 3, and No. 4) in the X oil and gas field as examples, corrosion cluster analysis is performed on the corroded oil pipes. Specific implementation steps:
[0056] Step 1: Determine the evaluation indicators:
[0057] K represents the number of service environment parameters (5 in total). The service environment parameter set is as follows: x1 is temperature (°C); x2 is the partial pressure of H2S (MPa); x3 is the partial pressure of CO2 (MPa); x4 is the partial pressure of Cl... - Concentration, g / L; x5 is flow rate, m / s;
[0058] Step 2: Establish an oil and gas field corrosion dataset:
[0059] Corrosion data for four oil pipelines in the X oil and gas field were collected monthly from December 2021 to May 2022. This data was then compiled into a set A1 (63.12, 63.12, 63.12, 63.12, 63.12, 63.12; 78.34, 78.34, 78.34, 78.34, 78.34; 43.56, 43.56, 43.56, 43.56, 43.56; 40.98, 4 0.98, 40.98, 40.98, 40.98, 40.98), A2 (0.21, 0.21, 0.20, 0.18, 0.19, 0.19; 0.24, 0.24, 0.19, 0.28, 0.29, 0.26; 0.26, 0.19, 0.20, 0.20, 0.26, 0.26; 0.18, 0.18, 0.19, 0.22, 0.23, 0.34), A3 (0.45, 0.46, 0.45, 0.48 , 0.53, 0.59; 0.87, 0.79, 0.78, 0.91, 0.79, 0.76; 0.56, 0.46, 0.58, 0.49, 0.68, 0.67; 0.36, 0.37, 0.39, 0 .39, 0.43, 0.47), A4 (1.23, 1.46, 1.56, 1.78, 2.03, 2.89; 2.14, 2.34, 2.56, 2.78, 2.90, 2.13; 6.01, 6.08, 8.03, 7.89, 7.09, 7.89; 8.90, 10.12, 9.80, 9.09, 8.78, 8.91), A5 (4.12, 4.12, 3.78, 3.10, 3.42, 3.89; 7.0 4, 7.67, 8.34, 8.34, 8.01, 7.67; 4.56, 4.51, 4.76, 4.09, 4.01, 5.56; 5.08, 5.17, 5.34, 5.46, 5.12, 5.34);
[0060] Step 3: Standardize the processing of oil and gas field corrosion data:
[0061] (a) The mean value of corrosion data A1 corresponding to the service environment parameter x1 of the oil and gas field is obtained by formula (1). Similarly, the mean of A2 can be obtained using formula (1). A3 mean A4 mean A5 mean
[0062] (b) The standard deviation of corrosion data A1 corresponding to the service environment parameter x1 of the oil and gas field is calculated by formula (2) σ1 = 1.54. Similarly, the standard deviation of corrosion data A2 σ2 = 0.18, the standard deviation of corrosion data A3 σ3 = 0.38, the standard deviation of corrosion data A4 σ4 = 1.74, and the standard deviation of corrosion data A5 σ5 = 1.13 are obtained by formula (2).
[0063] (c) The corrosion data point set A1 corresponding to the service environment parameter x1 is standardized using formula (3). The standardized corrosion data point set A'1 is: (4.30, 4.30, 4.30, 4.30, 4.30, 4.30; 14.18, 14.18, 14.18, 14.18, 14.18, 14.18; -8.40, -8.40, -8.40, -8.40, -8.40; -10.08, ... 10.08), Similarly, the standardized corrosion data point set A'2 (-0.06, -0.06, -0.11, -0.22, -0.17, -0.17; 0.11, 0.11, -0.17, 0.33, 0.39, 0.22; 0.22, -0.17, -0.11, -0.11, 0.22, 0.22; -0.22, -0.22, -0.17, 0, 0.06, 0.67) and A'3 (-0.07, -0.06, -0.07, -0.05, - 0.02, 0.01; 0.17, 0.13, 0.12, 0.20, 0.13, 0.11; -0.01, -0.06, 0.01, -0.05, 0.06, 0.06; -0.12, -0.11, -0.10, -0.10, -0.08, -0.06), A'4 (-3.50, -3.29, -3.20, -3.01, -2.79, -2.03; -2.69, -2.51, -2.32, -2.12, -2.02, -2.70; 0.73, 0.8 0, 2.52, 2.40, 1.69, 2.40; 3.29, 4.37, 4.09, 3.46, 3.19, 3.30), A'5 (-1.09, -1.09, -1.39, -1.99, -1.71, -1.29; 1.50 , 2.05, 2.65, 2.65, 2.35, 2.05; -0.70, -0.74, -0.52, -1.12, -1.19, 0.19; -0.24, -0.16, -0.01, 0.10, -0.20, -0.01);
[0064] Step 4: Determine the optimal number of cluster centers S':
[0065] (a) Solve for the number of clusters P = 4 in the dataset partitioning using formula (4);
[0066] (b) Based on all datasets A'1 to A' i The number of clusters is P = 4. Substitute the different numbers of clusters 1, 2, 3, and 4 into formula (5) to draw a scatter plot. The result is as follows: Figure 2 As shown:
[0067] (c) Based on the scatter plot, the inflection point of the function curve is 2 by formula (6). That is, when S takes 2, f″(S')=0, and the number of optimal cluster centers S' of the oil pipe is 2.
[0068] Step 5: Re-divide the clusters:
[0069] (a) Calculate the nearest distance mind(y,C) from each corrosion data sample point to the two cluster centers C1 = 0.20 and C2 = -0.17 using formula (7). i The minimum cluster centers were found to be minC1 = 0.56 and minC2 = -0.73.
[0070] (b) According to step 5(a), the data points are assigned to the clusters with the smallest distance between the cluster centers minC1 = 0.56 and minC2 = -0.73. The new cluster centers C1' = 0.60 and C2' = -0.74 are calculated using formula (8), and the clusters are reassigned.
[0071] Step 6: Determine the final clustering results for oil and gas field corrosion:
[0072] The position changes of the S' cluster centers are calculated using formula (9): Δ1 = 0.04 and Δ2 = 0.01. Since Δ i If the value is ≤0.05, it is considered to have reached a stable state, the iteration ends, and the final clustering result is output;
[0073] The four oil pipes were divided into two categories. Category 1: Oil pipes ① and ②, both with temperatures above 60℃, a pH2S / PCO2 ratio of approximately 2 / 5, a Cl- concentration of 2–3 g / L, and an average flow rate of 5 m / s. Category 2: Oil pipes ③ and ④, with temperatures around 40℃, a pH2S / PCO2 ratio of approximately 1 / 2, a Cl- concentration of 6–9 g / L, and a flow rate of 5 m / s.
[0074] Case 2:
[0075] Taking ten oil pipes (No. 1, No. 2, No. 3... No. 10) in the Y oil and gas field as examples, corrosion cluster analysis is performed on the corroded oil pipes. Specific implementation steps:
[0076] Step 1: Determine the evaluation indicators:
[0077] K represents the number of service environment parameters (8 in total). The service environment parameter set is as follows: x1 is temperature (°C); x2 is the partial pressure of H2S (MPa); x3 is the partial pressure of CO2 (MPa); x4 is the partial pressure of Cl... - Concentration, g / L; x5 is liquid-to-gas ratio; x6 is pH value; x7 is flow rate, m / s; x8 is total mineralization, g / L;
[0078] Step 2: Establish an oil and gas field corrosion dataset:
[0079] Corrosion data for 10 oil pipelines in the Y oil and gas field were collected monthly from June 2021 to March 2022. This data was then compiled into a set A1 (66.82, 66.82, 66.82, 66.82, 66.82, 66.82, 66.82, 66.82, 66.82; 58.71, 58.71, 58.71, 58.71, 58.71, 58.71, 58.71, 58.71; 66.23, 66.23, 66.23, 66.23, 66.23, 66.23, 66.23, 66.23, 66.23, 66.23; 70.19, 7 0.19, 70.19, 70.19, 70.19, 70.19, 70.19, 70.19, 70.19; 58.72, 58.72, 58.72, 58.72, 58.72, 58.72, 58.72, 58.72, 58.72; 52.59, 52.59, 52.59, 52.59, 52.59, 52.59, 52.59, 52.59, 52.59; 47.72, 47.72, 47.72, 47.72, 47.72, 47.72, 47.72, 47.72, 47.72; 56.71, 56.71, 56.71 56.71, 56.71, 56.71, 56.71, 56.71, 56.71; 42.72, 42.72, 42.72, 42.72, 42.72, 42.72, 42.72, 42.72, 42.72; 41.98, 41.98, 41.98, 41. 98, 41.98, 41.98, 41.98, 41.98, 41.98, 41.98), A2 (0.19, 0.14, 0.13, 0.14 , 0.14, 0.14, 0.14, 0.15, 0.16, 0.17; 0.27, 0.22, 0.16, 0.16, 0.18, 0.18, 0. 14, 0.14, 0.12, 0.11; 0.21, 0.22, 0.22, 0.21, 0.26, 0.28, 0.24, 0.25, 0.26, 0.24; 0.25, 0.29, 0.31, 0.31, 0.28, 0.18, 0.15, 0.14, 0.14, 0.13; 0.21, 0. 23, 0.20, 0.21, 0.20, 0.24, 0.27, 0.27, 0.27, 0.26; 0.21, 0.20, 0.20, 0.21, 0.20, 0.24, 0.27, 0.27, 0.27, 0.26; 0.20, 0.19, 0.18, 0.19, 0.19, 0.21, 0.22, 0.22, 0.21, 0.21; 0.20, 0.15, 0.14, 0.14, 0.15, 0.14, 0.14, 0.16, 0.17, 0.17; 0.20, 0.18, 0.16, 0.18, 0.18, 0.17, 0.20, 0.17, 0.15, 0.16; 0.27, 0.22 0.16, 0.16, 0.18, 0.18, 0.14, 0.14, 0.12, 0.11), A3(0.46, 0.71, 0.25, 0.33, 0.23, 0.44, 0.24, 0.17, 0.27, 0.25; 0.17, 0.27, 0.25, 0.19, 0.17, 0.17, 0 0.18, 0.23, 0.32, 0.22; 0.76, 0.58, 0.48, 0.49, 0.49, 0.48, 0.48, 0.44, 0.36, 0.33; 0.49, 0.48, 0.48, 0.44, 0.36, 0.33, 0.45, 0.32, 0.46, 0.35; 0.58 0.48, 0.49, 0.49, 0.48, 0.48, 0.44, 0.06, 0.33, 0.45; 0.49, 0.48, 0.50, 0.49, 0.48, 0.48, 0.44, 0.36, 0.33, 0.35; 0.36, 0.35, 0.37, 0.36, 0.35, 0.35 0.31, 0.23, 0.20, 0.22; 0.61, 0.60, 0.60, 0.56, 0.48, 0.45, 0.57, 0.44, 0.58, 0.47; 0.30, 0.36, 0.43, 0.44, 0.25, 0.49, 0.48, 0.40, 0.24, 0.34; 0.03 1、0.019、0.014、0.015、0.039、0.072、0.089、0.09、0.073、0.027)、A4(10. 21、10.11、9.72、9.62、9.47、9.67、9.6、9.7、9.65、9.62;6.16、6.06、5.95、6 12, 6.24, 6.09, 6.12, 6.01, 5.97, 5.98; 10.78, 10.84, 10.71, 10.49, 10.29, 10.05, 9.58, 10.55, 10.50, 11.12; 14.07, 14.43, 13.01, 11.96, 11.42, 12 .34, 12.13, 11.94, 11.85, 10.01; 3.15, 3.17, 2.66, 2.65, 3.14, 3.03, 3.04, 2.81, 2.84, 2.77; 2.89, 2.80, 2.79, 2.77, 3.28, 3.18, 3.18, 2.95, 2.97, 2.90; 2.77, 2.86, 2.92, 2.83, 2.91, 2.94, 2.80, 2.81, 3.02, 2.91; 8.72, 8.56, 9.09, 8.78, 8.99, 10.26, 10.49, 10.73, 10.51, 10.22; 5.63, 5.95, 5.28, 4 .96, 5.37, 5.31, 5.42, 6.03, 5.81, 5.90; 3.06, 3.21, 3.09, 2.77, 2.86, 2.92, 2.83, 2.91, 2.94, 2.80), A5(1.80E-05, 1.85E-05, 1.85E-05, 1.85E-05, 1 .85E-05、1.85E-05、1.85E-05、1.85E-05、1.74E-05、1.85E-05;2.20E-05、 2.08E-05、2.30E-05、2.30E-05、2.24E-05、2.24E-05、2.30E-05、2.30E-05 、2.30E-05、2.30E-05、3.60E-05、3.48E-05、3.70E-05、3.70E-05、3.64E-0 5、3.64E-05、3.70E-05、3.70E-05、3.70E-05、3.70E-05;1.80E-05、1.68E-0 5、1.90E-05、1.90E-05、1.84E-05、1.84E-05、1.90E-05、1.90E-05、1.90E- 05、1.90E-05、3.20E-05、3.08E-05、3.30E-05、3.30E-05、3.24E-05、3.24E -05、3.30E-05、3.30E-05、3.30E-05、3.30E-05;2.00E-05、1.88E-05、2.10 E-05、2.10E-05、2.04E-05、2.04E-05、2.10E-05、2.10E-05、2.10E-05、2.10 E-05;1.43E-05、1.42E-05、1.44E-05、1.44E-05、1.44E-05、1.44E-05、1.4 4E-05、1.44E-05、1.44E-05、1.44E-05;1.38E-05、1.37E-05、1.39E-05、1.3 9E-05、1.39E-05、1.39E-05、1.39E-05、1.39E-05、1.39E-05、1.39E-05;1. 47E-05、1.46E-05、1.48E-05、1.48E-05、1.48E-05、1.48E-05、1.48E-05、1.48E-05、1.48E-05、1.48E-05;1.59E-05、1.58E-05、1.60E-05、1.60E-05、1.60E-05、1.60E-05、1.60E-05、1.60E-05、1.60E-05、1.60E-04)、A6(4.50、4.60、5.00、6.00、6.00、6.00、5.50、5.00、5.50、6.00;5.50、6.00、5.38、4.54、4.24、4.26、6.00、8.57、6.00、6.50;6.50、7.45、6.50、5.65、6.00、6.75、7.00、7.25、6.75、7.00;6.00、6.75、7.00、7.25、6.75、7.00、7.50、6.50、6.50、7.00;7.04、6.93、7.45、6.50、5.65、6.00、6.75、7.00、7.25、7.00;6.50、6.50、7.45、6.50、5.65、6.00、6.75、7.00、7.25、6.75;7.16、6.50、5.14、5.17、5.36、6.00、6.75、7.00、7.50、6.75;7.68、7.43、7.00、7.50、5.50、4.85、5.07、6.00、7.14、7.00;5.01、5.65、6.02、6.16、7.00、7.50、6.38、5.36、5.10、6.00;5.07、5.13、6.50、8.40、9.42、9.47、9.00、8.00、8.99、7.18)、A7(5.50、6.00、5.38、4.54、4.24、4.26、6.00、8.57、6.00、4.50;5.65、6.00、6.75、7.00、7.25、6.75、7.00、7.50、6.50、6.50;8.91、6.88、6.34、6.53、7.82、7.31、6.89、8.57、7.71、6.51;5.68、5.63、5.69、5.71、6.00、6.54、6.96、6.50、6.50、6.09;6.50、7.00、6.51、6.50、7.56、8.34、7.50、5.95、5.17、6.50;7.00、6.51、6.50、7.56、8.34、7.50、5.95、5.17、6.50、8.76;6.50、7.00、6.50、7.00、7.00、6.50、9.00、7.00、6.50、7.00;5.93、7.68、7.43、7.00、7.50、5.50, 4.85, 5.07, 6.00, 7.14; 7.02, 6.27, 6.26, 6.33, 6.50, 6.94, 7.24, 6.50, 4.50, 6.78; 3.66, 5.01, 5.65, 6. 02, 6.16, 7.00, 7.50, 6.38, 5.36, 5.10), A8 (38.68, 41.34, 36.45, 36.27, 45.41, 44.32, 55.27, 40.36, 48.08, 33.65; 36.27, 45.41, 44.32, 55.27, 40.36, 48.08, 33.65, 52.64, 49.45, 38.78; 32.72, 32.17, 32.77, 33.00, 33.57, 31.42, 36.96, 39.44, 39.86, 38.03; 49.07, 47.67, 47.73, 43.89, 36.27, 33.07, 44.99, 32.35, 46.23, 3 9.14; 39.44, 39.86, 38.03, 37.91, 39.19, 34.97, 33.61, 13.84, 15.18, 31.77; 46.30, 42.72, 43.90, 42.77, 43.00, 43.57, 41.42, 46.96, 49.44, 32.98; 36.96, 39.44, 39.86, 11.23, 27.91, 10.70, 24.97, 18.16, 13.84, 15 .18; 25.17, 19.26, 17.47, 16.13, 15.59, 11.71, 7.62, 5.44, 4.89, 4.90; 11.23, 10.02, 11.24, 19.08, 16.78, 11.67, 12.34, 13.78, 12.35, 12.24; 48.07, 42.46, 39.74, 38.50, 35.08, 32.54, 38.30, 49.11, 55.05, 55.97);
[0080] Step 3: Standardize the processing of oil and gas field corrosion data:
[0081] (a) The mean value of corrosion data A1 corresponding to the service environment parameter x1 of the oil and gas field is obtained by formula (1). Similarly, the mean of A2 can be obtained using formula (1). A3 mean A4 mean A5 mean A6 mean A7 mean A8 mean
[0082] (b) The standard deviation of corrosion data A1 corresponding to the service environment parameter x1 of the oil and gas field is calculated by formula (2) as σ1 = 2.83. Similarly, the standard deviation of corrosion data A2 is calculated by formula (2) as σ2 = 0.17, the standard deviation of corrosion data A3 is calculated as σ3 = 0.36, the standard deviation of corrosion data A4 is calculated as σ4 = 1.79, the standard deviation of corrosion data A5 is calculated as σ5 = 0.0024, the standard deviation of corrosion data A6 is calculated as σ6 = 0.91, the standard deviation of corrosion data A7 is calculated as σ7 = 0.87, and the standard deviation of corrosion data A8 is calculated as σ8 = 3.35.
[0083] (c) The corrosion data point set A1 corresponding to the service environment parameter x1 is standardized using formula (3). The standardized corrosion data point set A'1 is: (3.74, 3.74, 3.74, 3.74, 3.74, 3.74, 3.74, 3.74, 3.74, 3.74; 0.87, 0.87, 0.87, 0.87, 0.87, 0.87, 0.87, 0.87, 0.87; 3.53, 3.53, 3.53, 3.53, 3.53, 3.53, 3.53, 3.53, 3.53, 3.53, 3.53; 4.93, ... 4.93; 0.88, 0.88, 0.88, 0.88, 0.88, 0.88, 0.88, 0.88, 0.88, 0.88; -1.29, -1.29, -1.29, -1.29, -1.29, -1.29, -1.29, -1.29, -1.29, -1.29; -3.01, -3 .01, -3.01, -3.01, -3.01, -3.01, -3.01, -3.01, -3.01; 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17; -4.78, -4.78, -4.78, -4.78 =-4.78,-4.78,-4.78,-4.78,-4.78;-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04,-5.04), Similarly, the standardized corrosion data point set A'2 (-0.02,-0.29,-0.34,-0.32,-0.30,-0.31,-0.31,-0.23,-0.17,-0.15;0.45,0.19,-0.16,-0.17,-0.07,-0.09,-0.29,-0.32,-0.44,-0.45;0.09,0 0.15, 0.20, 0.13, 0.43, 0.53, 0.35, 0.41, 0.42, 0.35; 0.34, 0.58, 0.71, 0.71, 0.53, 0.04, 0.24, 0.31, 0.32, 0.32; 0.11, 0.24, 0.06, 0.10, 0.04, 0.31, 0.47, 0.45, 0.46, 0.39; 0.09, 0.03, 0.06, 0.10, 0.04, 0.31, 0.47, 0.45, 0.46, 0.39; 0.07, 0.01, 0.07, 0.01, 0, 0.10, 0.19, 0.16, 0.11, 0.10; 0.03, -0.25、-0.29、-0.28、-0.26、-0.27、-0.27、-0.18、-0.12、-0.10;0.04、0.06、0.19、0.08、0.06、0.14、0.05、0.14、0.22、0.16;0.45、0.19、-0.16、-0.17、-0.07、-0.09、-0.29、-0.32、-0.44、-0.45)、A’3(0.28、0.98、0.31、-0.09、-0.36、0.23、-0.32、-0.53、-0.26、-0.30;-0.53、-0.26、-0.30、-0.47、-0.53、-0.52、-0.51、-0.35、-0.11、-0.38;1.10、0.61、0.34、0.37、0.36、0.32、0.33、0.22、0.01、-0.08;0.36、0.32、0.33、0.22、0.01、-0.08、0.25、-0.10、0.28、-0.02;0.61、0.34、0.37、0.36、0.32、0.33、0.22、-0.83、-0.08、0.25;0.35、0.34、0.40、0.36、0.32、0.33、0.22、0.01、-0.08、-0.02;-0.16、-0.01、0.18、0.23、-0.30、0.36、0.32、0.12、-0.34、-0.07;-0.91、-0.95、-0.96、-0.96、-0.89、-0.80、-0.75、-0.75、-0.80、-0.93;-0.01、-0.02、0.04、0.0019、-0.04、-0.04、-0.14、-0.35、-0.44、-0.38;0.70、0.66、0.66、0.55、0.34、0.25、0.58、0.23、0.62、0.31)、A’4(2.04、1.99、1.77、1.72、1.63、1.74、1.70、1.76、1.7、1.72;-0.22、-0.27、-0.34、-0.24、-0.17、-0.26、-0.24、-0.30、-0.32、-0.32;2.36、2.40、2.32、2.20、2.09、1.96、1.69、2.23、2.21、2.55;4.20、4.40、3.61、3.02、2.72、3.23、3.12、3.01、2.96、1.93;-1.90、-1.89、-2.17、-2.18、-1.91、-1.97、-1.96、-2.09、-2.07、-2.11;-2.04、-2.09、-2.10、-2.11、-1.83、-1.88、-1.88、-2.01、-2.00、-2.04;-2.11、-2.06、-2.03、-2.08、-2.03、-2.02、-2.09、-2.09、-1.97、-2.03;1.21、1.12、1.42、1.25、1.36、2.07、2.20、2.34、、2.21、2.05;-0.51、-0.34、-0.71、-0.89、-0.66、-0.69、-0.63、-0.29、-0.41、-0.36;-1.95、-1.87、-1.93、-2.11、-2.06、-2.03、-2.08、-2.03、-2.02-2.09)、A’5(-1.17E-03、-1.67E-03、-7.50E-04、-7.50E-04、-1.00E-03、-1.00E-03、-7.50E-04、-7.50E-04、-7.50E-04、-7.50E-04;5.00E-04、0、9.17E-04、9.17E-04、6.67E-04、6.67E-04、9.17E-04、9.17E-04、9.17E-04、9.17E-04;-1.17E-03、-1.42E-03、-9.58E-04、-9.58E-04、-1.08E-03、-1.08E-03、9.58E-04、-9.58E-04、-9.58E-04、-9.58E-04;6.33E-03、5.83E-03、6.75E-03、6.75E-03、6.50E-03、6.50E-03、6.75E-03、6.75E-03、6.75E-03、6.75E-03;4.67E-03、4.17E-03、5.08E-03、5.08E-03、4.83E-03、4.83E-03、5.08E-03、5.08E-03、5.08E-03、5.08E-03;-3.33E-04、-8.33E-04、8.33E-05、8.33E-05、-1.67E-04、-1.67E-04、8.33E-05、8.33E-05、8.33E-05、8.33E-05;-2.69E-03、-2.74E-03、-2.65E-03、-2.65E-03、-2.68E-03-2.68E-03、-2.65E-03、-2.65E-03、-2.65E-03、-2.65E-03;-2.90E-03、-2.95E-03、-2.86E-03、-2.86E-03、-2.88E-03、-2.88E-03、-2.86E-03、-2.86E-03、-2.86E-03、-2.86E-03;-2.53E-03、-2.58E-03、-2.48E-03、-2.48E-03、-2.51E-03、-2.51E-03、-2.48E-03、-2.48E-03、-2.48E-03、-2.48E-03;-2.03E-03、-2.08E-03、-1.98E-03、-1.98E-03、-2.01E-03、-2.01E-03、-1.98E-03、-1.98E-03、-1.98E-03、-1.98E-03)、A’6(-2.15、-2.04、-1.60、-0.51、-0.51、-0.51、-1.05、-1.60-1.05、-0.51;-1.05、-0.51、-1.19、-2.11、-2.44、-2.42、-0.51、2.32、-0.51、0.04;0.04、1.09、0.04、-0.89、-0.51、0.32、0.59、0.87、0.32、0.59;-0.51、0.32、0.59、0.87、0.32、0.59、1.14、0.04、0.04、0.59;0.64、0.52、1.09、0.04、-0.89、-0.51、0.32、0.59、0.87、0.59;0.04、0.04、1.09、0.04、-0.89、-0.51、0.32、0.59、0.87、0.32;0.77、0.04、-1.45-1.42、-1.21、-0.51、0.32、0.59、1.14、0.32;1.34、1.07、0.59、1.14、-1.05、-1.77、-1.53、-0.51、0.75、0.59;-1.59、-0.89、-0.48、-0.33、0.59、1.14、-0.09、-1.21、-1.49、-0.51;-1.53、-1.46、0.04、2.13、3.25、3.31、2.79、1.69、2.78、0.79)、A’7(-1.15、-0.57、-1.29、-2.25、-2.60、-2.57、-0.57、2.38、-0.57、-2.30;-0.98、-0.57、0.29、0.57、0.86、0.29、0.57、1.15、0、0;2.77、0.44、-0.18、0.03、1.52、0.93、0.45、2.38、1.39、0.01;-0.94、-1.00、-0.93、-0.91、-0.57、0.05、0.53、0.0, -0.47; 0, 0.57, 0.01, 0, 1.22, 2.11, 1.15, -0.63, -1.53, 0; 0.57, 0.01, 0, 1.22, 2.11, 1.15, -0.63, -1.53, 0, 2.60; 0, 0.57, 0, 0.57, 0, 0, 2.87, 0.57, 0, 0.57; -0.66, 1.36, 1.07, 0.57, 1.15, -1.15, -1.90, -1.64, -0.57, 0.74; 0.60, -0.26, -0.28, -0 .20, 0, 0.51, 0.85, 0, -2.30, 0.32; -3.26, -1.71, -0.98, -0.55, -0.39, 0.57, 1.15, -0.14, -1.31, -1.61), A'8 (1.63, 2.42, 0.9 6. 0.91, 3.64, 3.31, 6.58, 2.13, 4.43, 0.13; 0.91, 3.64, 3.31, 6.58, 2.13, 4.43, 0.13, 5.79, 4.84, 1.66; 4.43, 2.76, 1.94, 1.57 0.55, -0.21, 1.51, 4.74, 6.51, 6.79; -6.57, -6.93, -6.56, -4.22, -4.91, -6.44, -6.24, -5.81, -6.23, -6.27; -2.41, -4.17, -4.70, -5.10, -5.27, -6.42, -7.64, -8.30, -8.46, -8.46; 1.11, 1.85, 1.98, -6.57, -1.59, -6.73, -2.47, -4.50, -5.79, -5.39; 3. 90, 2.83, 3.19, 2.85, 2.92, 3.09, 2.44, 4.10, 4.84, -0.07; 1.85, 1.98, 1.43, 1.40, 1.78, 0.52, 0.11, -5.79, -5.39, -0.44; 4.73, 4.31, 4.33, 3.18, 0.91, -0.05, 3.51, -0.26, 3.88, 1.76; -0.15, -0.32, -0.14, -0.07, 0.10, -0.54, 1.11, 1.85, 1.98, 1.43);
[0084] Step 4: Determine the optimal number of cluster centers S':
[0085] (a) The number of clusters P = 7 for partitioning the dataset is calculated using formula (4);
[0086] (b) Based on all datasets A'1 to A' iThe number of clusters P = 7. Substitute the different numbers of clusters 1, 2, 3, 4, 5, 6, and 7 into formula (5) to draw a scatter plot. The result is as follows. Figure 3 As shown:
[0087] (c) Based on the scatter plot, the inflection point of the function curve is 3 by formula (6). That is, when S takes 3, f″(S')=0, and the optimal number of cluster centers S' is 3.
[0088] Step 5: Re-divide the clusters:
[0089] (a) Calculate the nearest distance (mind(y,C)) from each corrosion data sample point to the three cluster centers C1=0.53, C2=-0.89, and C3=0.22 using formula (7). i The minimum cluster centers were found to be minC1 = 0.66, minC2 = -0.62, and minC3 = 0.27.
[0090] (b) Based on step 5(a), the data points are assigned to the clusters with the smallest distances to the cluster centers minC1 = 0.66, minC2 = -0.62, and minC3 = 0.27. The new cluster centers C1' = 0.76, C2' = -0.53, and C2' = 0.36 are calculated using formula (8), and the clusters are reassigned.
[0091] Step 6: Determine the final clustering results for oil and gas field corrosion:
[0092] The changes in the cluster center positions Δ1 = 0.1, Δ2 = 0.11, and Δ3 = 0.09 are calculated using formula (9). Since Δ i If the value is greater than 0.05, then repeat steps 5(a) and (b) above to update the cluster centers:
[0093] Step 5(a) Calculate the nearest distance mind(y,C) from each corrosion data sample point to the three cluster centers C1=0.91, C2=-0.57, and C3=0.18 using formula (7). i The minimum cluster centers were found to be minC1 = 0.86, minC2 = -0.72, and minC3 = 0.17.
[0094] (b) Based on step 5(a), the data points are assigned to the clusters with the smallest distances to the cluster centers minC1 = 0.86, minC2 = -0.72, and minC3 = 0.17. The new cluster centers C1' = 0.85, C2' = -0.74, and C2' = 0.14 are calculated using formula (8), and the clusters are reassigned.
[0095] The changes in the cluster center positions Δ1 = 0.01, Δ2 = 0.02, and Δ3 = 0.03 are calculated using formula (9). Since 0.01 ≤ Δ i If the value is less than 0.05, the system is considered to have reached a stationary state, the iteration ends, and the final clustering result is output.
[0096] The 10 oil pipes were divided into three categories. Category 1: Oil pipes ①, ②, ③, and ④, all with temperatures above 60℃, a pH2S / PCO2 ratio of approximately 2 / 5, and Cl... - Concentration at 3-4 g / L, average flow rate 10 m / s; Category II: Oil pipes ⑤, ⑥, ⑨, and ⑩, temperature around 58℃, PH2S / PCO2 ratio approximately 2 / 3, Cl - Concentration 1-3 g / L, flow rate 2-3 m / s; Category 3: Oil pipes ⑦ and ⑧, average temperature 49℃, PH2S / PCO2 ratio approximately 3 / 2, Cl - Concentration below 1 g / L, flow rate 5–8 m / s.
[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A cluster analysis method for corrosion in oil and gas fields, characterized in that, Includes the following steps: Step 1: Determine the evaluation indicators: Organize service environment parameter set x K ; Where: K represents the number of service environment parameters; x1 is temperature, °C; x2 is the partial pressure of H2S, MPa; x3 is the partial pressure of CO2, MPa; x4 is the partial pressure of Cl... - Concentration, g / L; x5 is liquid-to-gas ratio; x6 is pH value; x7 is flow rate, m / s; x8 is total mineralization, g / L; Step 2: Establish an oil and gas field corrosion dataset: Corrosion data of Z oil pipelines at m time points within an oil and gas field were collected and organized to obtain a set of data points under K service environment parameters. Where: Z represents the number of oil pipelines studied in a certain oil and gas field; t j x is a point in time m; i A is one of the parameters in the service environment parameters; i For any service environment parameter x i The corresponding set of corrosion data points; For t j At time n, the oil pipeline is in a certain service environment parameter x i Corresponding corrosion data; Step 3: Standardize the processing of oil and gas field corrosion data: (a) Solve for each service environment parameter x of the oil and gas field using the following formula (1). i Corresponding corrosion data A i mean In the formula: For A i The mean; (b) Solve for each service environment parameter x of the oil and gas field using formula (2). i Corresponding corrosion data A i Standard deviation σ i : In the formula: σ i For A i Standard deviation; (c) Apply formula (3) to each service environment parameter x i The corresponding corrosion data point set A i After standardization, the standardized corrosion data point set A' is obtained. i : In the formula: A' i For A i Corresponding standardized corrosion data; Step 4: Determine the optimal number of cluster centers S': (a) Solve for the number of clusters P in the dataset using formula (4): In the formula: P represents all datasets A'1 to A' i The number of clusters; (b) Based on all datasets A'1 to A' i The number of clusters P is used to plot scatter plots of different cluster numbers P in formula (5) to determine the function type: In the formula: S represents all possible datasets A'1 to A' i The number of clusters, 1 < S ≤ P, where S is an integer; f(S) is the function value corresponding to different numbers of clusters S; y is the dataset A' i The included standardized corrosion data points; C i Let S be the initial cluster center of the i-th cluster, 1 ≤ i ≤ S, where i is an integer, and can generally be randomly selected from the erosion data points; y j C ij For y and C i The corresponding value of the j-th service environment parameter, 1≤j≤α; (c) Based on the scatter plot, solve for the inflection point S' of the function curve using formula (6): f″(S')=0 (6) In the formula: S' is the number of optimal cluster centers for the oil pipeline; Step 5: Re-divide the clusters: (a) The distance from each corrosion data sample point to the randomly selected S' cluster centers is calculated using formula (7). i The nearest distance mind(y,C) i Determine the minimum cluster center point minC. i : In the formula: mind(y,C) i ( ) represents the minimum cluster center point minC from the corrosion data sample point y. i The closest distance; minC i mind(y,C) is the nearest distance i The minimum cluster center corresponding to ) (b) Based on step 5(a), assign the data points to the class center points minC with the smallest distance. i Within the cluster, the new cluster center C is calculated using formula (8). i 'Re-divide the clusters:' In the formula: C i ' represents the newly calculated cluster centers; y i For dataset A' i The non-y in j Repeated erosion data points; Step 6: Determine the final clustering results for oil and gas field corrosion: The change in the location of the S' cluster centers Δ is calculated using formula (9). i : Δ i =|C i ’-minC i | (9) When Δ i When the value is greater than β, repeat steps 5(a) and (b) above to update the cluster centers; When Δ i When the value is less than or equal to β, the system is considered to have reached a stationary state, the iteration ends, and the final clustering result is output. In the formula: Δ i S' represents the position change between the i-th minimum cluster center and the i-th new cluster center, 1≤i≤S'; β is the threshold for allowed offset, ranging from 0.01 to 0.05.
Citation Information
Patent Citations
Natural gas pipeline corrosion defect typical characteristic extraction method
CN110486630A
Method and device for determining characteristic value of corrosion defect in gas pipeline
CN113393412A