+ All Categories
Home > Documents > SOFT COMPUTING METHOD FOR PREDICTION OF CO 2 CORROSION IN FLOW LINES...

SOFT COMPUTING METHOD FOR PREDICTION OF CO 2 CORROSION IN FLOW LINES...

Date post: 10-Dec-2016
Category:
Upload: mansoor
View: 217 times
Download: 4 times
Share this document with a friend
18
This article was downloaded by: [University of Toronto Libraries] On: 10 May 2013, At: 03:53 Publisher: Taylor & Francis Informa Ltd Registered in England and Wales Registered Number: 1072954 Registered office: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK Chemical Engineering Communications Publication details, including instructions for authors and subscription information: http://www.tandfonline.com/loi/gcec20 SOFT COMPUTING METHOD FOR PREDICTION OF CO 2 CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH Ali Chamkalani a , Milad Arabloo Nareh'ei b , Reza Chamkalani c , Mohammad Hadi Zargari a , Mohammad Reza Dehestani-Ardakani a & Mansoor Farzam a a Department of Petroleum Engineering, Petroleum University of Technology, Ahwaz, Iran b Department of Chemical and Petroleum Engineering, Sharif University of Technology, Tehran, Iran c Department of Mechanical Engineering, Bu Ali Sina University, Hamedan, Iran Published online: 04 Feb 2013. To cite this article: Ali Chamkalani , Milad Arabloo Nareh'ei , Reza Chamkalani , Mohammad Hadi Zargari , Mohammad Reza Dehestani-Ardakani & Mansoor Farzam (2013): SOFT COMPUTING METHOD FOR PREDICTION OF CO 2 CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH, Chemical Engineering Communications, 200:6, 731-747 To link to this article: http://dx.doi.org/10.1080/00986445.2012.717311 PLEASE SCROLL DOWN FOR ARTICLE Full terms and conditions of use: http://www.tandfonline.com/page/terms-and-conditions This article may be used for research, teaching, and private study purposes. Any substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing, systematic supply, or distribution in any form to anyone is expressly forbidden. The publisher does not give any warranty express or implied or make any representation that the contents will be complete or accurate or up to date. The accuracy of any instructions, formulae, and drug doses should be independently verified with primary sources. The publisher shall not be liable for any loss, actions, claims, proceedings, demand, or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of this material.
Transcript
Page 1: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

This article was downloaded by: [University of Toronto Libraries]On: 10 May 2013, At: 03:53Publisher: Taylor & FrancisInforma Ltd Registered in England and Wales Registered Number: 1072954 Registeredoffice: Mortimer House, 37-41 Mortimer Street, London W1T 3JH, UK

Chemical Engineering CommunicationsPublication details, including instructions for authors andsubscription information:http://www.tandfonline.com/loi/gcec20

SOFT COMPUTING METHOD FORPREDICTION OF CO2 CORROSION IN FLOWLINES BASED ON NEURAL NETWORKAPPROACHAli Chamkalani a , Milad Arabloo Nareh'ei b , Reza Chamkalani c ,Mohammad Hadi Zargari a , Mohammad Reza Dehestani-Ardakani a &Mansoor Farzam aa Department of Petroleum Engineering, Petroleum University ofTechnology, Ahwaz, Iranb Department of Chemical and Petroleum Engineering, SharifUniversity of Technology, Tehran, Iranc Department of Mechanical Engineering, Bu Ali Sina University,Hamedan, IranPublished online: 04 Feb 2013.

To cite this article: Ali Chamkalani , Milad Arabloo Nareh'ei , Reza Chamkalani , Mohammad HadiZargari , Mohammad Reza Dehestani-Ardakani & Mansoor Farzam (2013): SOFT COMPUTING METHODFOR PREDICTION OF CO2 CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH,Chemical Engineering Communications, 200:6, 731-747

To link to this article: http://dx.doi.org/10.1080/00986445.2012.717311

PLEASE SCROLL DOWN FOR ARTICLE

Full terms and conditions of use: http://www.tandfonline.com/page/terms-and-conditions

This article may be used for research, teaching, and private study purposes. Anysubstantial or systematic reproduction, redistribution, reselling, loan, sub-licensing,systematic supply, or distribution in any form to anyone is expressly forbidden.

The publisher does not give any warranty express or implied or make any representationthat the contents will be complete or accurate or up to date. The accuracy of anyinstructions, formulae, and drug doses should be independently verified with primarysources. The publisher shall not be liable for any loss, actions, claims, proceedings,demand, or costs or damages whatsoever or howsoever caused arising directly orindirectly in connection with or arising out of the use of this material.

Page 2: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Soft Computing Method for Prediction of CO2

Corrosion in Flow Lines Based on NeuralNetwork Approach

ALI CHAMKALANI,1 MILAD ARABLOO NAREH’EI,2

REZA CHAMKALANI,3 MOHAMMAD HADIZARGARI,1 MOHAMMAD REZADEHESTANI-ARDAKANI,1 ANDMANSOOR FARZAM1

1Department of Petroleum Engineering, Petroleum University ofTechnology, Ahwaz, Iran2Department of Chemical and Petroleum Engineering, Sharif Universityof Technology, Tehran, Iran3Department of Mechanical Engineering, Bu Ali Sina University,Hamedan, Iran

An important aspect of corrosion prediction for oil=gas wells and pipelines is to obtaina realistic estimate of the corrosion rate. Corrosion rate prediction involves develop-ing a predictive model that utilizes commonly available operational parameters, exist-ing lab=field data, and theoretical models to obtain realistic assessments of corrosionrates. This study presents a new model to predict corrosion rates by using artificialneural network (ANN) systems. The values of pH, velocity, temperature, and partialpressure of the CO2 are input variables of the network and the rate of corrosion hasbeen set as the network output. Among the 718 data sets, 503 of the data were imple-mented to find the best ANN structure, and 108 of the data that were not used in thedevelopment of the model were used to examine the reliability of this method. Stat-istical error analysis was used to evaluate the performance and the accuracy of theANN system for predicting the rate of corrosion. It is shown that the predictionsof this method are in acceptable agreement with experimental data, indicating thecapability of the ANN for prediction of CO2 corrosion rate in production flow lines.

Keywords Artificial neural network; CO2 corrosion; Partial pressure; pH;Sensitivity analysis; Temperature; Velocity

Introduction

CO2 corrosion is a significant problem in oil and gas production and transportationsystems. Modeling for CO2 corrosion has contributed a great deal to understandingand mitigating corrosion problems (Waard and Lotz, 1993; Gunaltun, 1996; Jepsonet al., 1997; Zhang et al., 1997; Halvorsen and Sontvedt, 1999; Anderko and Young,1999; Bonis and Crolet, 2000; High et al., 2000; Nordsveen et al., 2003; Song et al.,2005; Nesic, 2005).

Address correspondence to Ali Chamkalani, Department of Petroleum Engineering,Petroleum University of Technology, P. O. Box 63431, Ahwaz, Iran. E-mail: [email protected]

Chem. Eng. Comm., 200:731–747, 2013Copyright # Taylor & Francis Group, LLCISSN: 0098-6445 print=1563-5201 onlineDOI: 10.1080/00986445.2012.717311

731

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 3: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

There are several approaches utilized in developing corrosion prediction modelsin the literature: mechanistic, empirical, and hybrid. Mechanistic models providemathematical formulation of the chemical and electrochemical phenomena of cor-rosion using mass, energy, and charge balances (Pots, 1995). Empirical models arederived from development of equations based on experimental data with appropriatestatistical analysis (Sangita and Srinivasan, 2000). Hybrid models are a combinationof both of mechanistic and empirical models (Waard and Lotz, 1995). Empirical, oreven hybrid models, lack the ability to provide insight into the root cause ofcorrosion. Such models also lack the ability to confidently extrapolate predictionsoutside the calibration domain. These models work best on laboratory conditionsand limited field conditions. Models based solely on direct field data are developedin such a fashion that the variables and weights used are adjusted to fit the existingdata to a high level of accuracy. Such models fit equations to give positive resultsagainst existing available data. However, they are unable to provide the user withdeep insight into the root cause behind the problem. These models have the inherentdrawback that any extensions of the model to include new phenomena cannot bedone with ease and are at times not possible at all without recoding.

Theoretical Background

Carbon Dioxide/Acetic Acid Corrosion

The basic CO2 corrosion reactions have been well understood and accepted through-out the work done in the past (Nesic et al., 2003; Fang et al., 2006; Nafday, 2004).Carbon dioxide corrosion is a complicated process in which a number of chemicalreactions, electrochemical reactions, and transport processes occur simultaneously(Nesic et al., 2003).

Chemical ReactionsCarbon dioxide is often present in oil and gas pipelines. Various chemical reactionstake place in the water phase due to the presence of carbon dioxide. These reactionshave to be taken into consideration in order to get the accurate concentrations ofcorrosive species for further calculation.

CO2 is soluble in water:

CO2ðgÞ , CO2ðwÞ ð1Þ

Hydration of aqueous CO2 produces a weak acid, known as carbonic acid,H2CO3:

CO2ðwÞ þH2O , H2CO3 ð2Þ

Carbonic acid can then partially dissociate in two steps to form bicarbonate andcarbonate ions:

H2CO3 , Hþ þHCO�3 ð3Þ

HCO�3 , Hþ þ CO2�

3 ð4Þ

732 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 4: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Homogeneous dissociation reactions (3) and (4) proceed much faster than theother simultaneously occurring processes in the system. CO2 dissolution reaction(1) and particularly CO2 hydration reaction (2) have been known to be much slower(rate controlling) and could lead to local nonequilibrium in the solution.

In some environments organic acids, particularly low molecular weight organicacids, are found primarily in the water phase and can lead to corrosion of mild steel.Acetic acid (HAc), which is the most prevalent type of organic acid found in brines,can be treated as a representative of other types of organic acids, as similar corro-siveness was found for all types of low molecular weight organic acids.

HAc is a weak acid that is rather volatile—a property that makes it a major con-cern in top-of-line corrosion (TLC). It partially dissociates in the water phase to giveaway Hþ and Ac�, as indicated by reaction (5). However it is stronger than H2CO3,and therefore serves as the main source of Hþwhen similar concentrations of the twoacids are encountered.

HAc , Hþ þ Ac� ð5Þ

In the temperature range of interest (20�–100�C), HAc is mainly found in theaqueous phase, and therefore corrosion caused by HAc is not strongly affected bythe presence of HAc vapors (other than in the case of TLC). This is different fromCO2 corrosion where gaseous CO2 controls the amount of H2CO3 in the aqueousphase and therefore determines the rate of CO2 corrosion.

Another important chemical reaction that needs special attention is the forma-tion of iron carbonate in the circumstance where concentrations of ferrous ionand carbonate ion exceed the solubility limit of iron carbonate, as indicated by:

Fe2þ þ CO2�3 , FeCO3ðsÞ ð6Þ

This reaction is a heterogeneous one as nucleation of solid iron carbonate occurspreferably on the steel surface or inside the pores of the present film.

The precipitation of FeCO3(s) often plays a significant role in the corrosionprocess because the FeCO3(s) layer may increase the mass transfer resistance forthe corrosive species as well as reduce the available steel surface exposed to thecorrosive solution. In fact, in many cases, the CO2 corrosion rate is largely controlledby the presence of the FeCO3(s) layer.

Electrochemical ReactionsFor CO2 corrosion, several electrochemical reactions have been identified as contri-butors to overall corrosion rate of mild steel.

Dissolution of iron is the dominant anodic reaction. This reaction proceeds via amultistep mechanism that is mildly affected by pH and CO2 concentration. In therange of typical CO2 corrosion, e.g., pH> 4, the dependency of pH tends to dimin-ish. Therefore, for practical purposes, this reaction can be treated as pH independentfor CO2 corrosion. At the corrosion potential (and up to 200mV above), thisreaction is under charge transfer control and therefore the electrochemical behaviorcan be described using Tafel’s law.

Fe ! Fe2þ þ 2e ð7Þ

Prediction of CO2 Corrosion Based on ANN 733

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 5: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Hydrogen ion, Hþ, reduction is one of the main cathodic processes:

2Hþ þ 2e� ! H2 ð8Þ

This reaction is limited by how fast the Hþcan be transported from the bulk solutionto the steel surface through the mass transfer layer (including the liquid boundarylayer and the FeCO3(s) layer if it exists). Higher corrosion rates are often experimen-tally observed for CO2 systems compared to strong acid solutions (such as HCl) at thesame pH. However, for a practical CO2 system where pH> 4, the limiting flux of thisreaction would be small due to the relatively low concentration of Hþ. This suggeststhat CO2 also plays certain role in Hþ reduction. This can be explained by the factthat the homogeneous dissociation of H2CO3 provides an additional reservoir forHþions, which then absorb on the steel surface and get reduced according to reaction(8). Apparently, any rapid consumption of Hþcan be readily replenished by reactions(3) and (4). Thus, for pH> 4 the presence of CO2 leads to a much higher corrosionrate than would be found in a solution of a strong acid at the same pH.

In the vicinity of the steel surface, another electrochemical reaction can takeplace as well: H2CO3 adsorbs at the steel surface and is directly reduced accordingto reaction (9). This is referred to as ‘‘direct reduction of carbonic acid’’ (Dugstad,1995). In fact, this reaction is just an alternative pathway for the same cathodic reac-tion—hydrogen evolution as addition of reaction (3) and (8) leads to reaction (9).The distinction is only in the pathway, i.e., in the sequence of reactions.

2H2CO3 þ 2e� ! H2 þ 2HCO�3 ð9Þ

The rate of this additional hydrogen evolution due to the presence of CO2 is mainlycontrolled by the slow CO2 hydration step (2) and is a strong function of H2CO3

concentration, which directly depends on partial pressure of CO2.Although oxygen is not a common corrosive specie in oil and gas pipeline

systems, it can invade the system by inappropriate operation or incompletede-oxygenation of water chemical solutions injected into the system. Oxygen cancontribute to the corrosion process by the oxygen reduction reaction, which islimited by transport of oxygen through the mass transfer layer, as:

O2 þ 2H2Oþ 4e� ! 4OH� ð10Þ

Acetic acid is known to be one of the species that attacks mild steel. Studies haveshown that it is the undissociated (‘‘free’’) HAc and not the acetate ion Ac� thatis responsible for corrosion. The presence of organic acids is a major corrosion con-cern, particularly at lower pH and high temperature, as more HAc would be gener-ated under these conditions according to reaction (5). Being a weak, i.e., partiallydissociated acid, HAc provides an additional source of Hþ, which then adsorbs atthe steel surface and reduces according to the cathodic reaction (8). Following thesame reasoning as for H2CO3, it is also possible that the HAc molecule itself isadsorbed at the steel surface and gets reduced, which is often referred to as the‘‘direct HAc reduction’’ pathway:

2HAcþ 2e� ! H2 þ 2Ac� ð11Þ

734 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 6: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Another possible pathway for hydrogen evolution is direct reduction of water:

2H2Oþ 2e� ! H2 þ 2OH� ð12Þ

Compared to the cathodic reactions described above, this pathway is very slow andoften can be neglected in practical CO2 corrosion environments. However, underpeculiar conditions, such as very low partial pressure of CO2 (PCO2

<< 0.1 bar) andhigh pH (pH> 6), this reaction may become significant and contribute to the overallcorrosion process. Therefore, even if rarely relevant, this reaction has been includedin the model for completeness.

TransportDue to electrochemical reactions, certain species are produced or consumed on thesteel surface. Concentration gradients are therefore established between bulk sol-ution and steel surface, which lead to molecular diffusion. In addition, pipelinesare often subject to turbulent flow. Turbulent eddies can usually penetrate intothe boundary layer and greatly enhance the transport of species. Compared to somefast electrochemical reactions, such as hydrogen evolution (8), mass transfer of Hþ

proceeds much slower and therefore the rates of the overall reaction will be limitedby transport, i.e., how fast the species can move through the mass transfer layer andany solid corrosion product layer. It is therefore essential to incorporate the trans-port phenomenon into the model in order to give an accurate description of the over-all corrosion process. The effect of mass transport can be readily captured by usingthe concept of mass transfer coefficients.

Parameters Affecting CO2 Corrosion

There are many complicated environmental parameters affecting general CO2 cor-rosion, such as partial pressure of carbon dioxide, temperature, flow velocity, pH,and the formation of the corrosion product scale. These effects will be discussedin the following sections.

The Effect of CO2 Partial PressureWhen there is no corrosion film formed on the metal surface during the corrosionprocess, an increase of CO2 partial pressure will cause an increase of corrosion rate(Nesic et al., 2003). However, when the corrosion environment is film formationfavorable, an increased CO2 partial pressure may be helpful to the film formation.

The Effect of TemperatureTemperature affects the corrosion rate of steels in several ways. Temperature accel-erates the chemical reaction in the bulk solution and the electrochemical reactions atthe metal surface by increasing reaction rates. Temperatures also can speed up themass transfer process by decreasing the viscosity of the solution. So if there are noprotective films formed (especially at low pH), an increase of temperature willincrease the general CO2 corrosion rate. However, at higher pH, the increasingtemperature will also accelerate the kinetics of precipitation and aid protective filmformation. Normally the corrosion rate reaches a maximum with increasing tem-perature at around 70�–90�C (Dugstad, 1995).

Prediction of CO2 Corrosion Based on ANN 735

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 7: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

The Effect of FlowHigher flow velocity usually means high turbulence and effective mixing in the solution.Increased turbulent flow accelerates the corrosion species both toward and away fromthe metal surface. This may result in an increase of corrosion rate when mass transferis the rate-controlling factor and no corrosion film forms at the metal surface. If thecorrosion reaction appears to be under activation control, there is no significant effectof liquid flow velocity on CO2 corrosion. On the other hand, at higher flow velocity, lessprotective corrosion film will form at the metal surface (Nesic and Lee, 2002).

The Effect of pHThe pH is a measure of the acidity or alkalinity of a solution. It has been proved thatchanging the pH of the corrosion environment will significantly change the corrosionrate, i.e., the lower the pH, the higher the corrosion rate. The major reaction duringthe CO2 corrosion process includes CO2 dissolution and hydration to form carbonicacid. So at lower pH (<4) the hydrogen reduction is the dominant cathodic reaction,while direct reduction of carbonic acid becomes important at higher pH (>4) (Fang,2006; Nafday, 2004).

Artificial Neural Network (ANN)

The development of soft computing technology has recently received considerableattention in the oil and gas industry for solving difficult and complex problems becauseof its applicability and ease of computation (Zargari et al, 2012; Jahanandish et al.,2011). Among these soft computing methods, the use of artificial neural networks(ANN) in petroleum engineering can be track back almost two decades. ANN model-ing is a parallel processing technique inspired by the desire to emulate human learningactivity (Hagen et al., 2002). It is a highly self-organized, self-adapted, and self-trainableapproximator, with high associative memory and strong nonlinear mapping ability aswell. An ANNmodel can simulate complex, nonlinear problems by employing a differ-ent number of nonlinear processing elements, i.e., the nodes or neurons (Wang, 1998).The learning capability is achieved through its architecture, structured as a network ofinterconnected nonlinear computational units called ‘‘neurons,’’ organized in multiplelayers. The network learns by adjusting the connection weights using a gradient-descenttechnique based onminimization of squared network errors, obtained in comparison ofnetwork interpretation of training input patterns and known training output.

Adopting p groups of test data as the training samples, the input vectors ofa certain group of samples are pH, velocity, temperature, and PCO2

(CO2 pressure)and the output of the ANN model is corrosion rate of CO2. A two-layer (one hiddenlayer plus an output layer) LM feeding forward network (Levenberg-Marquardtalgorithm) with the node numbers (4,5,1) is set up in this study (Figure 1); the hyper-bolic TANSIG function is applied for the input and hidden layers, and the lineartransfer PURELIN function has been used in the output layer. The Tansig(n) func-tion is mathematically equivalent to Tanh(n).

TansigðnÞ ¼ 2

1þ expð�2� nÞ � 1 ð13Þ

PurelinðnÞ ¼ n ð14Þ

736 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 8: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

In multilayer neural networks or multilayer perceptrons (MLP) the outputs usinga logistic activation function can be expressed as

f ¼ purlinefw2� ½tansigðwl� xþ b1Þ� þ b2g ð15Þ

where w1 denotes the first layer weight matrix, w2 represents the second layer weightmatrix, b1 the first layer bias vector, b2 the second layer bias vector, and x the inputsvector. The input vector can be augmented with a dummy node representing the biasinput. This dummy input of 1 is multiplied by a weight corresponding to the biasvalue. Thus a more compact matrix representation is obtained as follows:

f ¼ purline W2� 1tansigðW1� XÞ

� �� �ð16Þ

And according to Equations (13) and (14) and equivalency of Tansig(n) with Tan-ha(n), Equation (16) can be as:

f ¼ W2� 1TanhaðW1� XÞ

� �� ��������� ð17Þ

where

X ¼ 1 x1 x2 x3 x4½ �T ð18Þ

W1 ¼

b11;1 w11;1 w11;2 w11;3 w11;4b12;1 w12;2 w12;2 w12;3 w12;4b13;1 w13;1 w13;2 w13;3 w13;4b14;1 w14;1 w14;2 w14;3 w14;4b15;1 w15;1 w15;2 w15;3 w15;4

266664

377775 ð19Þ

W2 ¼ b2 w21;1 w21;2 w21;3 w21;4 w21;5� �

ð20Þ

Various networks are trained by minimization of an appropriate error functiondefined with respect to the training set. Performance of the networks is thencompared by evaluating the error function using the training validation set, and

Figure 1. The ANNmodel for CO2 corrosion rate prediction. (Figure provided in color online.)

Prediction of CO2 Corrosion Based on ANN 737

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 9: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

the network having the smallest error with respect to the training validation set isselected (Niculescu, 2003).

Finally, a group of data including 718 input=output data points was adopted, inwhich the application randomly divides the input vectors and target vectors intothree sets: 70% are used for training, 15% are used to validate that the network isgeneralizing and to stop training before overfitting, and the last 15% are used asa completely independent test of network generalization.

Data Assembly

The experimental database of Dugstad et al. (1995) was used for training and testingof the ANN. It covers a broad range of experimental conditions: temperatureT¼ 20�–90�C, pipe flow velocity V¼ 0.1–13m=s, pH¼ 3.5–7, CO2 partial pressurePCO2

¼ 0.3–26 bar, and ferrous ion concentration Fe2þ¼ 50 ppm. The corrosion ratewas measured on flat diagonally mounted St52 steel coupons using a radioactive mea-suring technique in the experiments, which lasted from a few days to a few weeks.Long duration experiments were needed to obtain stable corrosion rates due to thegrowth of iron carbide films. Most of the experiments were conducted under con-ditions where protective films did not form, however, in some of the high-temperatureexperiments precipitation of iron carbonate scales may have occurred.

Results and Discussions

As a part of our study, we attempted to find an optimal performance ANN modelfor prediction of the rate of corrosion. During the training procedure, the inputsand desired data are repeatedly presented to the network. As the network learnsmore and more, the error tends to approach zero. For each step, R value and meansquared error (MSE) as ways to demonstrate error and accuracy of the model are

Figure 2. Behavior of some of data used as ANN inputs. (Figure provided in color online.)

738 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 10: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

proposed. The lower MSE is and the more it approaches zero and R approaches one,the more efficient the model is for prediction. The schematic of the proposed modelis shown in Figure 1, whose inputs are pH, velocity, partial pressure of CO2, and

Table I. Statistical indicators for considering the performance andprecision of the ANN model

R2 ARE AARE SD MSE

0.990 �0.02667 0.09392 0.21709 0.90577

Figure 4. The performance of training=validation=testing as three stages of modeling. (Figureprovided in color online.)

Figure 3. The structure of ANN for prediction of CO2 corrosion rate; weights, biases, andtransfer functions are presented. (Figure provided in color online.)

Prediction of CO2 Corrosion Based on ANN 739

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 11: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

temperature, and inputs have been obtained experimentally and for different andvariable conditions of inputs. Some of data used for this work are plotted in Figure 2.

According to Equations (17)–(20) and inputs for ANN, the formula for predic-tion of corrosion rate can be modified as:

Inputs ¼ 1 PH T V PCO2½ �T ð21Þ

Corrosion Rate ¼ W2� 1TanhaðW1� InputsÞ

� �� ��������� ð22Þ

Table II. Ranges of the data used for contracting the model

Min Max

pH 2.0 6.0Velocity (m=s) 0.1 90.0Temperature (�C) 3.0 90.0PCO2

(bar) 0.3 5.0Corrosion rate (mm=year) 1.8 50.0

Table III. Values of MSE and R2 for ANN modeling stages

MSE R2

Training 0.815 0.996Validation 0.988 0.993Testing 0.123 0.993

Figure 5. ANN predicted data plotted vs. observed data. R2 shows the ANN’s high accuracy.(Figure provided in color online.)

740 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 12: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

W1 ¼

8:1631 �5:7069 6:1101 2:7606 �0:8429�2:4354 4:6536 �10:2828 1:3412 �9:1276�0:0867 �0:5152 �0:5112 0:0714 �0:991710:4168 10:2812 �3:8873 0:9198 �0:368410:1160 �6:0337 6:2938 1:8650 17:8667

266664

377775 ð23Þ

W2 ¼ �0:9035 5:0575 � 0:1481 � 0:7408 0:3277 � 4:7107½ � ð24Þ

The values for w1, w2, b1, and b2 are presented in Appendix I. The graphical struc-tural of ANN prediction for inputs and outputs is shown in Figure 3. For surveyingANN precision and accuracy and considering its performance, some statisticalindicators were applied; the results are shown in Table I.

Table IV. Comparison of ANN predicted corrosion rates with experimental valuesat different conditions

Velocity(m/s)

Temperature(�C) pH

Pco2

(bar)ANN

(mm/yr)Experimental

(mm/yr)Absolute relative

error (%)

10.8 20.0 5.0 2.0 4.60 4.55 1.153.12 90.0 5.0 2.0 6.14 6.04 1.73

13.00 40.0 3.8 1.4 12.44 12.43 0.1010.80 90.0 5.0 2.0 13.08 13.24 1.2311.01 90.0 5.0 2.0 13.51 13.51 0.021.63 60.0 5.0 2.0 8.83 8.20 7.672.21 60.0 5.0 2.0 10.40 10.00 4.038.40 60.0 5.0 2.0 20.49 20.41 0.438.62 60.0 5.0 2.0 20.63 20.49 0.67

57.22 31.0 5.0 2.5 12.89 12.88 0.1410.30 60.0 5.0 2.0 21.49 21.62 0.583.10 60.0 5.0 3.4 24.00 24.04 0.15

82.30 13.0 5.0 2.5 18.61 18.50 0.628.50 40.0 3.5 1.4 14.76 14.89 0.893.10 60.0 5.0 0.9 7.51 7.48 0.383.10 60.0 5.0 0.9 7.45 7.46 0.158.50 60.0 5.0 4.6 43.98 44.03 0.12

13.00 60.0 5.0 4.4 45.38 45.31 0.1782.30 13.0 5.0 2.5 18.61 18.50 0.628.50 40.0 5.2 1.4 4.47 4.57 2.113.10 40.0 5.1 1.4 5.48 5.43 1.00

13.00 60.0 5.0 1.0 14.40 14.51 0.7013.00 40.0 4.0 1.4 10.29 10.16 1.238.50 40.0 3.6 1.4 14.31 14.25 0.403.10 60.0 5.0 4.0 29.50 29.38 0.42

13.00 60.0 5.0 4.9 48.27 48.25 0.0482.30 13.0 5.0 2.5 18.61 18.50 0.6244.70 13.0 5.0 2.5 13.30 13.48 1.303.94 90.0 5.0 2.0 6.45 6.76 4.48

Prediction of CO2 Corrosion Based on ANN 741

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 13: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Determination of epochs and termination criteria are of crucial importance. InFigure 4 MSE is plotted versus number of epochs and training stops when validationerror increases. The training stopped after 43 iterations because the validation errorincreased. The formulas used for performance determination, statistical indicators,are given in Appendix II.

Table II summarizes the input=output variables of the model and also theirdomains. The data sets used are in a wide range of operating conditions and are suit-able for developing a comprehensive model. The final values of MSE and R2 for thetraining, validation, and testing stages are shown in Table III. Values of statisticalindicators show that the neural network predicted the corrosion rate with high accu-racy and is almost exact. The modeled network can be used to predict the corrosionrate for several inputs and has been made with inputs for different conditions. Ascatter plot of experimental values for corrosion rate against the ANN modelpredictions is shown in Figure 5. Almost all data lie on a 45� line, which confirmsthe accuracy of the proposed ANN model. Table IV provides a generalization ofthe proposed ANN model by comparing some of the ANN predicted values withexperimental values for varying input conditions.

We also performed a sensitivity analysis as a method for extracting the cause andeffect relationship between the inputs and outputs of the network. As we know, when-ever the pressure increases the corrosion rate increases; Figure 6 follows such a trendand the straight relation between Pco2 and corrosion rate. Figure 7 represents theoverall reduction of corrosion rate by pH. The data taken from Dugstad et al.(1995) also confirm that the more pH increases, the more the corrosion rate decreases.A general increase in CO2 corrosion rate is expected with increasing temperatureup to 60�–80�C, followed by reduction at higher temperature, which occurs due toprotective iron carbonate film precipitation. This trend is captured by ANN, whichFigure 8 shows at 60�C when the corrosion rate decreased. It is known that higher

Figure 6. Sensitivity analysis of the model with respect to partial pressure of CO2 while otherparameters are held constant. (Figure provided in color online.)

742 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 14: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

velocity typically leads to higher CO2 corrosion rate; however, in some instances thedependence can be reversed by the presence of iron carbonate films, which are knownto accelerate corrosion. Their removal at high velocity can lead to reduction in thecorrosion rate. While this is noticed at low temperatures, at high temperatures it isnot the case, as precipitated iron carbonate might hold the iron carbide in place. Thisbehavior is clearly shown by experiments and the ANN model in Figure 9.

Figure 8. Sensitivity analysis of the model with respect to temperature while other parametersare held constant. (Figure provided in color online.)

Figure 7. Sensitivity analysis of the model with respect to pH while other parameters are heldconstant. (Figure provided in color online.)

Prediction of CO2 Corrosion Based on ANN 743

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 15: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Conclusion

In this study, ANN as a new predictive tool was applied for prediction of corrosionrate using measurable flow properties (pH, temperature, velocity, partial pressure ofCO2) as outputs. For obtaining the optimum ANN with the lowest MSE and R-valuein prediction performance, several ANNs with different numbers of neurons in thehidden layer were analyzed, and then the best neural network structure with corre-sponding weights and biases was obtained. The data set used in this study representsa wide range of input values and the obtained structural neural networks can besuccessfully applied for prediction of the rate of corrosion because of the notableperformance of obtained ANNs. Also, for verifying the model behavior sensitivityanalysis was performed. As the final conclusion, the neural network analysis adaptedfor this system was able to recognize the behavior of the system. It was shown thatsuch a model was able to capture practically all of the trends noticed in the experi-mental data with acceptable accuracy. The neural network could be used by a cor-rosion engineer as long as he or she understands the limitations and the conditionsunder it will be applied are within the ones used for training and testing the ANN.

References

Anderko, A., and Young, R. D. (1999). Simulation of CO2=H2S corrosion using thermo-dynamic and electrochemical models, paper 31 presented at Corrosion/99, NACEInternational, Houston, Tex.

Bonis, M. R., and Crolet, J. L. (2000). Basics of the prediction of the risks of CO2 corrosion in oiland gas wells, paper 466 presented at Corrosion/89, NACE International, Houston, Tex.

Dugstad, A. (1995). The importance of Fe(CO)3 supersaturation on the CO2 corrosion ofcarbon steel, paper no. 14 presented at Corrosion=92, NACE, Houston, Tex.

Dugstad, A., Lunde, L., and Videm, K. (1995). Parametric study of CO2 corrosion of carbonsteel, paper no. 14 presented at Corrosion=94, NACE, Houston, Tex.

Figure 9. Sensitivity analysis of the model with respect to velocity while other parameters areheld constant. (Figure provided in color online.)

744 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 16: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Fang, H., Nesic, S., Brown, B., and Wang, S. (2006). General CO2 corrosion in high salinitybrines, paper no. 372 presented at Corrosion/06, NACE International, Houston, Tex.

Gunaltun, Y. (1996). Combining research and field data for corrosion rate prediction, paper27 presented at Corrosion/96, NACE International, Houston, Tex.

Hagen,M. T.,Demuth, H. B., andBeale,M. (2002).Neural NetworkDesign, PWS, Boston,Mass.Halvorsen, A. M. K., and Sontvedt, T. (1999). CO2 corrosion model for carbon steel including

a wall shear stress model for multiphase flow and limits for production rate to avoid mesaattack, paper 42 presented at Corrosion/99, NACE International, Houston, Tex.

High, M. S., Wagner, J., and Natarajan, S. (2000). Mechanistic modeling of mass transferin the laminar sublayer in downhole systems, paper 62 presented at Corrosion/2000,NACE International, Houston, Tex.

Jahanandish, I., Salimifard, B., and Jalalifar,H. (2011). Predicting bottomhole pressure in verticalmultiphase flowing wells using artificial neural networks, J. Pet. Sci. Eng., 75(3–4), 336–342.

Jepson, W. P., Kang, C., Gopal, M., and Stitzel, S. (1997). Model for sweet corrosionin horizontal multiphase slug flow, paper 11 presented at Corrosion/97, NACEInternational, Houston, Tex.

Nafday, O. A. (2004). Film formation and CO2 corrosion in the presence of acetic acid, PhDdiss., Ohio University.

Nesic, S. (2005). Key Issues Related to Modeling of Internal Corrosion of Oil and GasPipelines—A Review, ICMT Technical Report, Institute of Corrosion and MultiphaseTechnologies, Ohio University.

Nesic, S., and Lee, K. J. (2002). The mechanistic model of iron carbonate film growth andthe effect on CO2 corrosion of mild steel, paper 237 presented at Corrosion/02, NACEInternational, Houston, Tex.

Nesic, S., Postlethwaite, J., and Olsen, S. (2003). An electrochemical model for prediction ofcorrosion of mild steel in aqueous carbon dioxide solutions, paper 280 presented at Cor-rosion/03, NACE International, Houston, Tex.

Niculescu, S. P. (2003). Artificial neural networks and genetic algorithms in QSAR, J. Mol.Struct., Theochem., 622, 71–83.

Nordsveen, M., Nesic, S., Nyborg, R., and Stangeland, A. (2003). A mechanistic model forcarbon dioxide corrosion in the presence of protective iron carbonate films—Part 1:Theory and verification, Corrosion, 59(5), 443–456.

Pots, B. F. M. (1995). Mechanistic models for the prediction of CO2 corrosion rates undermulti-phase flow conditions, paper 137 presented at Corrosion/95, NACE International,Houston, Tex.

Sangita, K. A., and Srinivasan, S. (2000). An analytical model to experimentally emulate floweffects in multiphase CO2=H2S systems, paper 58 presented at Corrosion/2000, NACEInternational, Houston, Tex.

Song, F. M., Kirk, D. W., and Cormack, D. E. (2005). A comprehensive model for predictingCO2 corrosion in oil and gas systems, paper 180 presented at Corrosion/05, NACEInternational, Houston, Tex.

Waard, C. de, and Lotz, U. (1993). Prediction of CO2 corrosion of carbon steel, paper 69presented at Corrosion/93, NACE International, Houston, Tex.

Waard, C. de, and Lotz, U. (1995). Influence of liquid flow velocity on CO2 corrosion: A semi-empirical model, paper 128 presented at Corrosion/95, NACE International, Houston, Tex.

Wang, S. T. (1998). Fuzzy System, Fuzzy Neural Network, and Application Programming,Shanghai Scientific and Technical Literature Publishing Co., Shanghai.

Zargari, H., Nareh̀ei, M. A., and Ghayyem, M. A. (2012). Application of adaptive neuro-fuzzy inference system (ANFIS) in prediction of hydrate formation temperature, EnergySources, Part A., DOI: 10.1080=15567036.2011.586981

Zhang, R., Gopal, M., and Jepson, W. P. (1997). Development of a mechanistic modelfor predicting corrosion rate in multiphase oil=water=gas flows, paper 601 presented atCorrosion/97, NACE International, Houston, Tex.

Prediction of CO2 Corrosion Based on ANN 745

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 17: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Appendix I: The values for w1, w2, b1, and b2

w1 ¼

�5:7069 6:1101 2:7606 �0:84294:6536 �10:2828 1:3412 �9:1276�0:5152 �0:5112 0:0714 �0:991710:2812 �3:8873 0:9198 �0:3684�6:0337 6:2938 1:8650 17:8667

266664

377775

b1 ¼

8:1631�2:4354�0:086710:416810:1160

266664

377775

w2 ¼ 5:0575 � 0:1481 � 0:7408 0:3277 � 4:7107½ �

b2 ¼ �0:9035½ �

Appendix II: The Formulas Used for Performance Determination

For evaluation of proposed models, statistical indicators usually applied to analyzemodels are expressed as:

R2 ¼ 1�Pn

i¼1 ðyiobserved � yicalculatedÞ2

Pni¼1 ðyiobserved � �yyÞ2

Average Relative Error:

ARE ¼ 1

n

Xni¼1

yicalculated � yiobservedyiobserved

� �i

Average Absolute Relative Error:

AARE ¼ 1

n

Xni¼1

yicalculated � yiobservedyiobserved

��������i

Standard Deviation:

SD ¼

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1

n� 1

� �Xni¼1

yicalculated � yiobservedyiobserved

� �2

i

vuut

746 A. Chamkalani et al.

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013

Page 18: SOFT COMPUTING METHOD FOR PREDICTION OF CO               2               CORROSION IN FLOW LINES BASED ON NEURAL NETWORK APPROACH

Mean Square Error:

MSE ¼Pn

i¼1 ðyiobserved � yicalculated Þ2

n

where yiobserved is the actual value, yicalculated is the predicted value of y, and �yy is the meanof the data values as in the above formulas.

Prediction of CO2 Corrosion Based on ANN 747

Dow

nloa

ded

by [

Uni

vers

ity o

f T

oron

to L

ibra

ries

] at

03:

53 1

0 M

ay 2

013


Recommended