This disclosure relates to acid corrosion inhibitors.
In the petroleum industry, stimulation treatments with acid are an established method to increase well production rates by dissolving fines and/or removing formation damage. Either organic acids such as citric/acetic acids or mineral acids such as hydrochloric acid (HCl)/hydrofluoric acid (HF) are injected into the well at high concentrations. These treating acids are corrosive in nature.
An embodiment described herein provides a method. The method enables an acid corrosion inhibitor virtual laboratory. The method includes obtaining inputs comprising at least one of an acid concentration, exposure time, temperature, or any combinations thereof and predicting a success or failure of a predefined minimum inhibitor loading value. The method includes determining a minimum inhibitor loading value that is a successful corrosion inhibitor loading based on the inputs responsive to a failure of the predefined minimum inhibitor loading value.
Another embodiment described herein provides a system that includes at least one processor and at least one non-transitory storage media storing instructions that, when executed by the at least one processor, cause the at least one processor to perform operations. The operations include obtaining inputs comprising at least one of an acid concentration, exposure time, temperature, or any combinations thereof and predicting a success or failure of a predefined minimum inhibitor loading value. The operations include determining a minimum inhibitor loading value that is a successful corrosion inhibitor loading based on the inputs responsive to a failure of the predefined minimum inhibitor loading value.
Another embodiment described herein provides at least one non-transitory storage media storing instructions that, when executed by at least one processor, cause the at least one processor to perform operations. The operations include obtaining inputs comprising at least one of an acid concentration, exposure time, temperature, or any combinations thereof and predicting a success or failure of a predefined minimum inhibitor loading value. The operations include determining a minimum inhibitor loading value that is a successful corrosion inhibitor loading based on the inputs responsive to a failure of the predefined minimum inhibitor loading value.
Embodiments described herein provide an acid corrosion inhibitor virtual laboratory. In the absence of corrosion inhibitors, the generalized corrosion rate of the steel exposed to acid increases exponentially with acid concentration and temperature. This can be reduced to an acceptable level by adding appropriate concentrations of corrosion inhibitor products in order to protect and prolong the useful lifetime of steel exposed to acid which include coiled tubing (used for acid conveyance) and downhole well components (casing and tubulars). Generally, corrosion inhibitors demonstrate high efficiency in providing corrosion protection at temperatures below 150° C. Corrosion inhibitors are included in acid recipes, the first inhibitors used were arsenic acids but were replaced by organic corrosion inhibitors mainly due to the toxicity of arsenic acids and their harmful environmental impact.
There are various methods used to test the effectiveness of a corrosion inhibitor when used with an acid recipe. Explanation of two methods used to test a corrosion inhibitor performance is presented below. The tests include an autoclave test and an electrochemical analysis.
Generally, the autoclave test is used for testing corrosion inhibitor performance. It uses weight loss analysis as the basis for qualifying a corrosion inhibitor. Metal coupons representing field conditions (either a coiled tubing or a downhole completion pipe) are used in the autoclave. The preparation of test coupons is done carefully since it can result in different corrosion rates in the tests. The weights of the metal coupons are measured before and after the autoclave test to quantify the metal loss. The autoclave device subjects the metal coupons to pressures and temperatures simulating an acid treatment with the exact same acid recipe (including corrosion inhibitor) and exposure time planned for the field job. The weight loss after the test per surface area is calculated and it has to be lower than a pre-determined cutoff in order to qualify the corrosion inhibitor safe for field deployment. Conventionally, the acceptable weigh loss for coiled tubing pipes is 0.02 lb/ft2 and for downhole casing pipe is 0.05 lb/ft2. The metal loss of the analysis is affected by the acid volume/steel-area ratio.
Electrochemical analysis is used to test a corrosion inhibitor performance. In electrochemical analysis, electrochemical measurements are carried out using an electrode cell arrangement. The test utilizes a steel disc as an electrode which is once immersed in an acid solution without the inhibitor and in another test it is immersed in the acid solution with the corrosion inhibitor. This process includes building Tafel curves using the measurements of the test and then extrapolating the Tafel slope to obtain the corrosion potential. Finally corrosion rate and inhibitor efficiency can be calculated against pre-determined acceptable values.
Typically, petroleum production engineers rely on the autoclave tests to identify the appropriate corrosion inhibitor loading (in gallons per thousand gallons, gpt). Given that the cost of a corrosion inhibitor is high, practicing production engineers use a minimum corrosion inhibitor loading that satisfy the acceptable weight loss (0.02 lb/ft2 in coiled tubing or 0.05 lb/ft2 in casing pipe). To achieve this objective, engineers either need to conduct an autoclave test for each stimulation job or reference a past autoclave test with similar conditions (temperature, exposure time, acid strength, etc), which could overestimate the required corrosion inhibitor value. In the present techniques, an alternative methodology is presented to obtain the minimum acceptable corrosion inhibitor loading using a virtual laboratory developed via machine learning models.
In embodiments, the present techniques enable a machine learning virtual laboratory that simulates autoclave testing to provide an optimum loading for acid corrosion inhibitors used in stimulation jobs. Generally, the optimum loading for an acid corrosion inhibitor provides the lowest acceptable/safe chemical loading to lower the cost of the acid recipe. In embodiments, training data includes hundreds of past autoclave tests representing a wide range of conditions.
Hundreds of past autoclave tests have been collected representing a wide range of test conditions. Several machine learning models are trained on these test points and later used to predict the optimum corrosion inhibitor loading. A virtual laboratory is based on the best preforming machine learning model. The virtual laboratory provides guidance to field engineers on the right level of inhibitor concentration at the lowest incurred cost.
In examples, the machine learning training process is as follows. The process of actual laboratory autoclave testing involves testing with metal coupons that consist of different steel types with an acid recipe. The autoclave lab test measures the weight loss per unit area as a result. The testing conditions vary, and these conditions include: 1) Expected steel exposure time to acid; 2) Acid strength or concentration percentage; 3) Maximum expected downhole temperature; 4) Type of corrosion inhibitor used in the acid recipe; 5) Different corrosion inhibitor loadings; and 6) Steel type being used in the stimulation.
Several past laboratory tests are conducted representing wide range of the above listed conditions. The lab tests are divided into two datasets. One dataset is comprised of 80% of the complete autoclave tests and is provided as an input to the machine learning model for training. The remaining 20% is used a testing dataset. The testing dataset is used to verify the confidence of machine learning model predictions. Generally, the autoclave data set obtained via the lab tests for machine learning is selected for typical oil and water wells acid stimulation conditions. The selection mainly involves the temperature range, type of steel, and use of a corrosion inhibitor without an intensifier.
Several machine learning models 104 are used on the same datasets for training and testing purposes. The machine learning model that provides the highest confidence can be used by field engineers to design acid stimulation recipes, at acceptable corrosion metal loss and lowest cost. The model can be dynamic, with new tests uploaded to the model to continuously train and increase the prediction confidence. After a machine learning model with the highest confidence is selected, are the other remaining machine learning are executed again if new data is available.
In examples, the machine learning model is a dynamic machine learning model with periodic updates. The machine learning model is iteratively trained with additional training data. As the number of known scenarios increase, a prediction confidence in the machine learning model increases.
The initial data generated for training and testing included over 450 tests to be widely representative and make the model ready for industrial application. In embodiments, additional data feeds are used to fine-tune the machine learning models. In particular, weights of the machine learning models are updated for improvement or fine tuning of prediction capabilities. Thus, the model can be described as dynamic.
As a starting point for training the machine learning model, four training/testing scenarios are used. An input set for each scenario is illustrated in the table 108 of
Eight machine learning models 104 are trained and then tested for confidence. Each and every model is used with the four input scenarios. Accordingly, 32 machine learning models are developed for evaluation according to the present techniques. The eight machine models include K-nearest neighbor, gradient boosting classifier, logistic regression, support vector machine, linear support vector classifier, random forest classifier, decision tree, and neural network.
K-Nearest Neighbor is a supervised machine learning algorithm that can be used to solve both classification and regression problems. The algorithm assumes that similar things exist in close proximity. The gradient boosting classifier is a machine learning technique used for regression and classification. It produces a prediction model in the form of an ensemble of weak prediction models, typically decision trees.
Logistic regression is a machine learning algorithm that uses the logistic function also called as the sigmoid function for binary classification problems (problems with two class values). It is linear, however the predictions are transformed using a logistic function. A support vector machine (SVM) is a linear model for classification and regression problems. It can solve both linear and non-linear problems. In operation, the SVM creates a line or a hyperplane which separates the data into classes. The linear support vector classifier is similar to SVM but has more flexibility and can scale better to a large number of data points.
A random forest classifier is a supervised learning algorithm that builds an ensemble of decision trees and merges them together to get a more accurate and stable prediction. It can be used for both classification and regression problems. A decision tree algorithm is a supervised learning algorithm, and can be used to solve regression and classification problems. A decision tree creates a training model that can be used to predict a class or value of the target variable by learning simple decision rules inferred from training dataset. A neural network algorithm can be used for both classification and regression problems. The process of creating a neural network begins with the perceptron. The perceptron receives inputs, multiplies them by some weights, and then passes them into an activation function to produce an output.
To test the machine learning models 104, each respective model obtains inputs associated with each scenario, which are all data except for success/failure (1/0) labels used to predict if the weight loss test is a success or failure in terms of weight loss per unit area (lb/ft2). Two metrics are introduced to evaluate every model and input scenario, they are the confusion matrix and confidence score.
Where:
P1=Number of Tests predicted as a success by the machine learning model AND are successful in the autoclave lab test;
P2=Number of Tests predicted as a failure by the machine learning model AND that failed in the autoclave lab test;
P3=Number of Tests predicted as a failure by the machine learning model AND are successful in the autoclave lab test; and
P4=Number of Tests predicted as a success by the machine learning model AND that failed in the autoclave test.
It is intuitive to quantify the confidence (accuracy) of the machine learning model in the cases where the model has agreed with actual autoclave laboratory tests (datasets in P1 & P2 categories). The quantified confidence of the tested machine learning models has also included datasets in P3 category where the machine learning model predicted a failure, while the actual autoclave laboratory test is successful. The rationale behind adding the datasets of P3 category, is that the resulting model will increase the chemical loading (minor addition to cost) while the reliability of the steel coupon is still maintained within the acceptable metal loss range. Accordingly, the essence of performing the acid stimulation within safe and acceptable corrosion limits are still honored without loss of confidence.
A virtual laboratory enables classification on an acid corrosion inhibitor. In examples, the virtual laboratory includes the selected machine learning model linked to a processing engine to execute the virtual laboratory. In embodiments, the inputs are obtained by a user inputting the required well input data using a graphical user interface (GUI). In embodiments, the inputs are extracted from other data sources. In embodiments, the virtual laboratory outputs an optimum inhibitor loading in gallon per thousand gallons. The input data to the machine learning models is based on the selected scenario. For example, as illustrated in table 108 of
In operation, a trained machine learning model using process 500 begins with a predefined minimum loading value, in gallons per thousand gallons. The virtual laboratory using process 500 provides statistically significant inputs to the trained machine learning model, where the inputs are provided by the user according to the scenario to predict the virtual laboratory test success or failure output. The underlying computational iterations are dependent on the statistical significance of the input and output variables. To ensure that the input and output variables are statistically significant, the statistically significant inputs are generated according to the process 500. In embodiments, the virtual laboratory (e.g., virtual laboratory 110 of
In particular, at block 502A statistically significant inputs are generated by obtaining the exposure time data from actual laboratory tests. Each data point is plotted against its percentile value. At block 504A, the generated data points are modeled with the best-fit algebraic function (mostly polynomial) using linear regression. The best-fit model will have the maximum R2 value and the least average absolute error. At block 506A, the generated best-fit model is used to compute the cumulative distribution function and define P10, P25, P50, P75 and P90 values as illustrated in table 304 of
Next, temperature data is obtained from actual laboratory tests at block 502B and each data point is plotted against its percentile value. The generated data points are modeled with the best-fit algebraic function (mostly polynomial) using linear regression at block 504B. The best-fit model will have the maximum R2 value and the least average absolute error. The generated best-fit model is used to compute the Cumulative Distribution Function (CDF) and define P10, P25, P50, P75 and P90 values as illustrated in table 306 of
Next, for each acid concentration (typically 15% and 20%), at block 502C inhibitor loading datasets that correspond to possible combinations of exposure time and temperature ranges i.e. Di,j are defined. For example, D1,2 is an inhibitor loading dataset that is defined at an exposure time from P10 to P25 and a temperature from P25 to P50. For each Di,j, inhibitor loading data is collected and each data point is plotted against its percentile value. At block 504C the generated data points are modeled with the best-fit algebraic function (mostly polynomial) using linear regression. The best-fit model will have the maximum R2 value and the least average absolute error.
At block 506C, the generated best-fit model is used to compute the inhibitor loading cumulative distribution function (CDF). At block 508, a normality test is performed on a semi-log graph to determine whether the data is normally distributed or not.
At block 510, if the inhibitor loading CDF is normal, the optimal loading value is defined as follows. First, a minimum starting loading value is defined as P5. This value is input to the trained machine learning model all the way to P95, at an increment of 0.1 gallon per thousand gallons, to predict the virtual laboratory test success or failure events. If the machine learning model outcomes are “success,” the optimal loading value will be the minimum loading value. If some of the machine learning model outcomes are “failure,” the optimal loading value will be the maximum loading value corresponding to a “failure” outcome which will ensure a conservative optimal loading recommendation.
At block 512, if the inhibitor loading CDF is not normal (e.g., abnormal), the optimal loading values is defined as follows. First, a minimum starting loading value is defined as the mean value minus one standard deviation of the inhibitor loading data. The trained machine learning model is executed from this value all the way to the mean value plus one standard deviation of the inhibitor loading data, at an increment of 0.1 gallon per thousand gallons, to predict the virtual laboratory test success or failure events. If the machine learning model outcomes are “success,” the optimal loading value will be the minimum loading value. If some of the machine learning model outcomes are “failure,” the optimal loading value will be the maximum loading value corresponding to a “failure” outcome which will ensure a conservative optimal loading recommendation. Inhibitor loading datasets are iteratively defined and used to obtain a success/failure prediction for all possible combinations of acid concentration, exposure time and temperature.
At block 602 input data is obtained. The input data comprises at least one of an acid concentration, exposure time, temperature, or any combinations thereof.
At block 604, a success or failure of a predefined minimum inhibitor loading value is predicted. In examples, a success of the minimum inhibitor loading value is metal loss values of less than 0.2 lb/ft2 to be successful for all steel types. In examples, a failure of the minimum inhibitor loading value is a metal loss values that are equal to or more than 0.2 lb/ft2 to be a failure for all steel types. Generally, the success or failure is determined using the process 400 of
At block 606, a minimum inhibitor loading value that is a successful corrosion inhibitor loading is determined based on the inputs responsive to a failure of the predefined minimum inhibitor loading value.
The controller 702 includes a processor 704. The processor 704 may be a microprocessor, a multi-core processor, a multithreaded processor, an ultra-low-voltage processor, an embedded processor, or a virtual processor. In some embodiments, the processor 704 may be part of a system-on-a-chip (SoC) in which the processor 704 and the other components of the controller 702 are formed into a single integrated electronics package. In various embodiments, the processor 704 may include processors from Intel® Corporation of Santa Clara, Calif., from Advanced Micro Devices, Inc. (AMD) of Sunnyvale, Calif., or from ARM Holdings, LTD., Of Cambridge, England. Any number of other processors from other suppliers may also be used.
The processor 704 may communicate with other components of the controller 702 over a bus 706. The bus 706 may include any number of technologies, such as industry standard architecture (ISA), extended ISA (EISA), peripheral component interconnect (PCI), peripheral component interconnect extended (PCIx), PCI express (PCIe), or any number of other technologies. The bus 706 may be a proprietary bus, for example, used in an SoC based system. Other bus technologies may be used, in addition to, or instead of, the technologies above.
The bus 706 may couple the processor 704 to a memory 708. In some embodiments, such as in PLCs and other process control units, the memory 708 is integrated with a data store 710 used for long-term storage of programs and data. The memory 708 include any number of volatile and nonvolatile memory devices, such as volatile random-access memory (RAM), static random-access memory (SRAM), flash memory, and the like. In smaller devices, such as PLCs, the memory 708 may include registers associated with the processor itself. The data store 710 is used for the persistent storage of information, such as data, applications, operating systems, and so forth. The data store 710 may be a nonvolatile RAM, a solid-state disk drive, or a flash drive, among others. In some embodiments, the data store 710 will include a hard disk drive, such as a micro hard disk drive, a regular hard disk drive, or an array of hard disk drives, for example, associated with a DCS or a cloud server. In embodiments, the datastore includes the laboratory data such as exposure times 712, temperatures 714, and inhibitor loading 716. Best fit models 718 are also stored in the data store 714. The bus 706 couples the processor 704 to a machine learning models. In embodiments, the machine learning models 720 include several machine learning models trained on these test points (e.g., exposure times 712, temperature 714, and inhibitor loading 716) and later used to predict the optimum corrosion inhibitor loading. The predictions occur, for example, as described with respect to
The bus 706 couples the processor 704 to an input output interface 722. In input output interface may be coupled with one or more input output devices 724. The input output devices 724 may be, for example, a display, keyboard, mouse, and the like. The input output devices can be used to render a graphical user interface, where the user can input for processing by the virtual laboratory as discussed above.
Other implementations are also within the scope of the following claims.