Final Project PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

HADHRAMOUT UNIVERSITY

FACULTY OF ENGINEERING AND PETROLEUM


PETROLEUM ENGINEERING DEPARTMENT

DEVELOPMENT OF ARTIFICIAL INTELLIGENT MODEL TO IMPROVE


BOTTOM HOLE FLOWING PRESSURE CALCULATIONS

A PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF


THE REQUIREMENT FOR THE DEGREE OF BACHELOR OF
ENGINEERING IN PETROLEUM ENGINEERING

SUBMITTED BY
1. NOAMAN SAID ABDULLAH NAJI AL-HUTHAIFY
2. ESAM QAID MUSAED AL-SAFRI
3. HELMI KHALED AHMED MOHAMMED AL-ABRAT
4. GAMIL MOHAMMED NAJI HAMADI SILAN
5. KHALED AHMED MOHAMMED GHAWY
6. HASAN AMEEN QASEM HASAN
7. MUNYA RABEA SAEED BALKHAIR

SUPERVISOR
DR. ABDELRIGEEB ALI AL-GATHE

ALMUKALLA, YEMEN
SEPTEMBER 2071
‫جامعة حضرموت‬
‫كلية الهندسة والبترول‬
‫قسم الهندسة البترولية‬

‫تطوير نموذج ذكاء صناعي للتحسين من حسابات ضغط قاع البئر‬

‫بحث تكميلي مقدم لإليفاء بمطلوبات نيل‬


‫درجة البكالوريوس في الهندسة البترولية‬

‫إعداد‬

‫‪ -7‬نعمان سعيد عبدهللا ناجي الحذيفي‬


‫‪ -2‬عصام قايد مسعد الصفري‬
‫‪ -3‬حلمي خالد احمد محمد االبرط‬
‫‪ -4‬جميل محمد ناجي حمادي سيالن‬
‫‪ -5‬خالد احمد محمد غاوي‬
‫‪ -6‬حسن امين قاسم حسن‬
‫‪ -1‬منياء ربيع سعيد بلخير‬

‫إشراف‬
‫د ‪ /‬عبدالرقيب علي القاضي‬

‫المكال‪-‬اليمن‬
‫سبتمبر ‪7102‬‬
I

SUPERVISOR CERTIFICATE

I certify that project entitled “Development of Artificial Intelligent Model to Improve


Bottom Flowing Hole Pressure Calculations” has been under my supervision.

Supervisor Dr. Abdelrigeeb Ali Al-Gathe

Signature: …………………………
II

“We hereby declare that we have read this thesis and in our opinion this thesis is
sufficient in terms of scope and quality for the award of the degree of Bachelor of
engineering in petroleum engineering”

DR. SALEM MUBARAK BIN-GADEEM

Signature: ………………………..

DR. SALEM OBAID BAARIMAH

Signature: ………………………..

MR. DARGHAM ABDULAZIZ ALRAWI

Signature: ………………………..
III

DEDICATION

To our parents and our family who made this accomplishment possible.
IV

ACKNOWLEDGEMENTS

We bow our head before Allah almighty, the most beneficent and merciful, who
blessed us with health, loving parents, sincere teachers and caring friends.

We are indebted to an individual who help in various ways in the completion of


this project. His cheerful support and encouragement was greatly appreciated, who was
attendants with us step by step to prepare this project and make writing this project simple.

Special acknowledgements and extremely grateful are owed to:

DR. ABDELRIGEEB ALI AL-GATHE

Who give us a lot of his time and enrich us by scientific materials.


V

TABLE OF CONTENTS

SUPERVISOR CERTIFICATE .................................................................................I


DEDICATION .......................................................................................................... III
ACKNOWLEDGEMENTS ...................................................................................... IV
TABLE OF CONTENTS ........................................................................................... V
LIST OF TABLE..................................................................................................... VII
LIST OF FIGURES ...............................................................................................VIII
LIST OF ABBREVIATIONS................................................................................... IX
LIST OF SYMBOLS................................................................................................. XI
ABSTRACT ............................................................................................................ XIV
‫ ملخص‬.......................................................................................................................... XV
CHAPTER I INTRODUCTION ........................................................................... 1
1.1 INTRODUCTION ............................................................................ 1
1.2 STATEMENT OF PROBLEM ......................................................... 2
1.3 THE OBJECTIVES .......................................................................... 2
CHAPTER II BOTTOM HOLE FLOWING PRESSURE ............................... 3
2.1 INTRODUCTION............................................................................ 3
2.2 DETERMINATION OF BOTTOM HOLE FLOWING PRESSUR 3
2.3 MULTIPHASE FLOW CORRELATIONS ..................................... 3
2.3.1 Vertical Flow Correlations ...................................................... 3
2.3.2 Horizontal Flow Correlations ................................................. 4
2.3.3 Incline Flow Correlations ........................................................ 4
2.4 BEGGS AND BRILL CORRELATION ......................................... 4
2.5 BEGGS AND BRILL NOTED ........................................................ 5
2.6 PROCEDURE OF BEGGS AND BRILL CORELATION ............. 6
CHAPTER III THE NATURAL GAS COMPRESSIBILITY FACTOR ....... 11
3.1 INTRODUCTION ......................................................................... 11
3.2 METHODS OF DETERMINATION THE Z-FACTOR ............... 11
3.2.1 Indirect Method[6]................................................................ 11
3.2.2 Direct Method ....................................................................... 11
3.3 DRANCHUK -ABU-KASSEM’S METHOD 1975 ..................... 12
CHAPTER IV FUZZY LOGIC TOOLBOX ..................................................... 14
4.1 INTRODUCTION ........................................................................ 14
4.2 DEFINITION ............................................................................... 14
4.3 IMPORTANT OF FUZZY LOGIC .............................................. 15
4.4 FOUNDATION OF FUZZY LOGIC ........................................... 16
4.4.1 Fuzzy Sets ............................................................................ 16
VI

4.4.2 Membership Functions ........................................................ 16


4.5 MEMBERSHIP FUNCTIONS OF FUZZY LOGIC TOOLBOX 16
4.5.1 Piece-Wise Linear Functions ............................................... 16
4.5.2 The Gaussian And Bell Distribution Function .................... 17
4.5.3 The Sigmoid Curve.............................................................. 17
4.5.4 Quadratic and Cubic Polynomial Curves ............................ 18
4.6 FUZZY INFERENCE SYSTEMS ............................................... 18
4.6.1 Mamdani-Type Fuzzy Inference ........................................ 18
4.6.2 Sugeno-Type Fuzzy Inference ............................................ 19
4.7 BUILDING SYSTEMS WITH FUZZY LOGIC TOOLBOX ..... 20
4.8 TOOLBOX FUNCTION ANFIS ................................................ 22
4.9 FUZZY CLUSTERING .............................................................. 23
4.10 SUBTRACTIVE CLUSTERING ................................................ 23
CHAPTER V RESULT AND DISCUSSION ................................................. 25
5.1 THE NATURAL GAS COMPRESSIBILITY FACTOR .......... 25
5.1.1 Data Collection ................................................................. 25
5.1.2 Error Analysis ................................................................... 25
5.2 BOTTOM HOLE FLOWING PRESSURE .............................. 29
5.2.1 DATA DESCRIPTION ........................................................... 29
5.2.2 ERROR ANALYSIS .............................................................. 30
5.2.3 ANALYSIS OF 30 DATA POINT ................................... 35
CHAPTER VI CONCLUSIONS AND RECOMMENDATION .................. 36
6.1 CONCLUSIONS ...................................................................... 36
6.2 RECOMMENDATION ........................................................... 36
REFERENCES .......................................................................................................... 37
APPENDIX ................................................................................................................ 38
STATISTICAL AND GRAPHICAL ERROR ANALYSIS ........................................... 38
VII

LIST OF TABLE

Table 1.1 Show Constant a,b and c for each flow pattern ..……………………..……….8
Table 1.2 Show Constant d,e,f and g for each flow pattern …...…...……..……………. 8
Table 5.1 Statistical Error Analysis for DAK correlation and ANFIS model …......……26
Table 5.2 Range of input data for BHFP prediction….…..……………….…....……….30
Table 5.3 Statistical Analysis Results of DAK correlation and ANFIS for BHFP..........31
Table 5.4 Results of BHFP predicted by using both integrated techniques (ANFIS &
DAK)…...........................................................................................................................35
VIII

LIST OF FIGURES

Figure 4.1 Display Fuzzy Operation ……………..…………..….……………………. 16


Figure 4.2 Linear Functions …………...……………………….……..……..………...17
Figure 4.3 The Gaussian and Bell Distribution Function .………………………..…. 17
Figure 4.4 The Sigmoid Curve.…………………………………..….……..…...…...…18
Figure 4.5 Quadratic And Cubic Polynomial Curves ….…………..…………..………18
Figure 4.6 Fuzzy Inference System ...……………………..………………….………..21
Figure 4.7 Fuzzy Inference System Editor.………...…...……………….…...…..….....22
Figure 4.8 (ANFIS) Surface Viewer………………......…….…..………….…..….…. 23
Figure 5.1 Cross plot of Observed vs. Calculated Z for DAK correlation………….…. 26
Figure 5.2 Cross plot of Observed vs. Calculated Z for ANFIS model……….…….... 27
Figure 5.3 Comparisons of Correlation Factor for the Models……….…………......... 27
Figure 5.4 Comparisons of RMS for the models……..…………….……….…………..28
Figure 5.5 Comparisons of STD for the Models..…………….…….………...……… 28
Figure 5.6 Comparisons of AARE for the models…………………..…………….…..29
Figure 5.7 Cross plot of Observed vs. Calculated BHFP with DAK correlation……...32
Figure 5.8 Cross plot of Observed vs. Calculated BHFP with ANFIS model….........…32
Figure 5.9 Comparisons of Correlation Factor for the Models….…………………..…33
Figure 5.10 Comparisons of RMS for the Models…………………......………...……..33
Figure 5.11 Comparisons of STD for the Models………………. .…………..………...34
Figure 5.12 Comparisons of AARE for the Models…………………………………….34
IX

LIST OF ABBREVIATIONS

ANFIS Adaptive Neuro Fuzzy Inference System


GLR Gas-Liquid Ratio
GUIS Graphical User Interface System
GUI Graphical User Interface
FL Fuzzy Logic
AI Artificial Intelligence
FDCL Fuzzy Dependency And Command Language
MF Membership Function
TRIMF Triangular-Shaped Built-In Membership Function

TRAPMF Trapezoidal-Shaped Built-In Membership Function


GAUSSMF Gaussian Curve Built-In Membership Function
GAUSS2MF Gaussian Combination Membership Function

GBELLMF Generalized Bell-Shaped Built-In Membership Function


SIGMF Sigmoidally Shaped Built-In Membership Function
DSIGMF Built-In Membership Function Composed Of Difference
Between Two Sigmoidal Membership Functions
ZMF Z-Shaped Built-In Membership Function
PSIGMF Built-In Membership Function Composed Of Product Of
Two Sigmoidally Shaped Membership Function
PIMF Π-Shaped Built-In Membership Function
SMF S-Shaped Built-In Membership Function
FIS Fuzzy Inference System
GENFIS1 Generate Fuzzy Inference System Structure From Data
Using Grid Partition
GENFIS2 Generate Fuzzy Inference System Structure From Data
Using Subtractive Clustering
GENFIS3 Generate Fuzzy Inference System Structure From Data
Using FCM Clustering
ANFIS Adaptive Neuro-Fuzzy Inference System
FCM Fuzzy C-Means Clustering
DAK Dranchuk-Abu-Kassem method
X

Zmeas Natural gas compressibility factor measured


Zest Natural gas compressibility factor estimated
AARE Average Absolute Percent Relative Error
MAX Maximum Absolute Percent Relative Error
MIN Minimum Absolute Percent Relative Error
R The Correlation factor
STD Standard Deviation
RMS Root Mean Square
XI

LIST OF SYMBOLS

𝑔 Acceleration Of Gravity 𝑓𝑡/𝑠𝑒𝑐 2


𝑔𝑐 Conversion Constant Equal to 32.174 𝐼𝑏𝑚𝑓𝑡/𝐼𝑏𝑓𝑠𝑒𝑐 2
𝜌𝑚 Mixture Density 𝐼𝑏𝑚/𝑐𝑢 𝑓𝑡
𝑑 Pipe Internal Diameter 𝑓𝑡
𝑝 Initial Pressure 𝑃𝑠𝑖
𝐺𝑚 Total Mass Flux Rates 𝐼𝑏𝑚/𝑠𝑒𝑐 − 𝑠𝑞 𝑓𝑡
𝐺𝐿 Liquid Mass Flux Rates 𝐼𝑏𝑚/𝑠𝑒𝑐 − 𝑠𝑞 𝑓𝑡
𝐺𝑔 Gas Mass Flux Rates 𝐼𝑏𝑚/𝑠𝑒𝑐 − 𝑠𝑞 𝑓𝑡
∆𝑃 Pressure Drop 𝑃𝑠𝑖
∆𝑧 Depth Drop 𝑓𝑡
𝐻𝐿 Liquid Holdup 𝑛𝑜𝑛
𝜌𝑡𝑝 Two – Phase Density 𝐼𝑏𝑚/𝑐𝑢 𝑓𝑡
𝜌𝐿 Liquid Density 𝐼𝑏𝑚/𝑐𝑢 𝑓𝑡
𝑝̅ Average Pressure 𝑝𝑠𝑖
𝑃1 Downstream Or Upstream 2Pressure 𝑝𝑠𝑖
Rs Solubility Of Ratio 𝑠𝑐𝑓/𝑠𝑡𝑏
Bo Oil Formation Volume Factor 𝑏𝑏𝑙/𝑠𝑡𝑏

Bw Water Formation Volume Factor 𝑏𝑏𝑙/𝑠𝑡𝑏


μo Viscosity Of Oil 𝑐𝑝

μw Viscosity Of Water 𝑐𝑝

μg Viscosity Of Gas 𝑐𝑝

σo Oil Surface Tension 𝑑𝑦𝑛𝑒𝑠/𝑐𝑚

σw Water Surface Tension 𝑑𝑦𝑛𝑒𝑠/𝑐𝑚

𝑇̅ Average Temperature 𝑓

𝛾𝑜 Oil Specific Gravity 𝑛𝑜𝑛

𝐴𝑃𝐼 American Petroleum Institute 𝑛𝑜𝑛

𝜌𝑜 Density Of Oil 𝐼𝑏/𝑐𝑢 𝑓𝑡


XII

𝜌𝑤 Density Of Water 𝐼𝑏/𝑐𝑢 𝑓𝑡

𝛾𝑔 Specific Gravity Of Gas 𝑛𝑜𝑛

𝑞𝑔 Gas Flow Rate 𝑚𝑚𝑠𝑐𝑓/𝑑

𝑞𝑜 Oil Flow Rate 𝑠𝑡𝑏/𝑑

𝑞𝑤 Water Flow Rate 𝑠𝑡𝑏/𝑑

𝑞𝐿 Liquid Flow Rate 𝑠𝑡𝑏/𝑑

𝑉𝑠𝐿 Superficial Liquid Velocity 𝑓𝑡/𝑠𝑒𝑐

𝑉𝑠𝑔 Superficial Gas Velocity 𝑓𝑡/𝑠𝑒𝑐

𝑉𝑚 Superficial Mixture Velocity 𝑓𝑡/𝑠𝑒𝑐

𝐴𝑝 Pipe Cross Sectional Area 𝑓𝑡

ƛ No Slip Holdup 𝑛𝑜𝑛

𝑁𝐹𝑅 Froud Number 𝑛𝑜𝑛

𝜇𝐿 Liquid Viscosity 𝑐𝑝

𝜎𝐿 Liquid Surface Tension 𝑑𝑦𝑛𝑒𝑠/𝑐𝑚

𝜇𝑚 Mixture Viscosity 𝑐𝑝

𝑓𝑜 Oil Friction 𝑛𝑜𝑛

𝑓𝑤 Water Friction 𝑛𝑜𝑛

𝑁𝑅𝑒𝑛𝑠 Reynolds Number 𝑛𝑜𝑛

𝑁𝐿𝑉 Liquid Velocity Numbers 𝑛𝑜𝑛

𝜓 Liquid Holdup Inclination Correction Factor 𝑛𝑜𝑛

𝑓𝑛𝑠 No-Slip Friction Factor 𝑛𝑜𝑛

𝑓𝑡𝑝 Tow-Phase Friction Factor 𝑛𝑜𝑛

𝑇 Temperature 𝑅

𝑍 Gas Compressibility Factor 𝑛𝑜𝑛

𝑍𝐶 Critical Gas Compressibility Factor 𝑛𝑜𝑛

𝑇𝐶 Critical Temperature 𝑅
XIII

𝑇𝑃𝐶 The Pseudo Critical Temperature Of The Gas 𝑅


Mixture
𝑃𝐶 Critical Pressure 𝑝𝑠𝑖𝑎

𝑃𝑃𝐶 The Pseudo Critical Pressure Of The Gas 𝑝𝑠𝑖𝑎


Mixture
𝑇𝑃𝑟 The Pseudo Reduced Temperature 𝑛𝑜𝑛

𝑃𝑃𝑟 The Pseudo Reduced Pressure 𝑛𝑜𝑛

𝐸𝑖 Relative Deviation Of An Estimated Value 𝑁𝑜𝑛


From An Experimental Value
XIV

ABSTRACT

One of significant parameters affecting Bottom Hole Flowing Pressure (BHFP) is gas
compressibility (Z-factor). The BHFP calculation in incline multiphase flow is very
complicated due to the variation in gas and liquid flow rate that is function of pressure
and temperature variation. As pressure and temperature change a unquestionably Z-factor
changing. So that the project was divided into two parts.
In the first part, developed Adaptive Neuro Fuzzy inference system (ANFIS)
model to estimate gas compressibility factor in more accurate as well as Dranchuk-Abu-
Kassem (DAK) correlation by used total data point 7118 from Middle East. The results
show that the ANFIS model achieved the best one with correlation factor almost equal
one and Average Absolute Relative Error (AARE) around 0.26.
In the second part, the Beggs and Brill correlation was developed and integrated
with both previous model (ANFIS and DAK) to estimate BHFP for 194 data point from
Egypt fields.
Finally, can concluded that the performance of ANFIS model with Beggs and
Brill correlation is better than DAK correlation and more accurate.
‫‪XV‬‬

‫ملخص‬

‫عند حساب ضغط قاع البئر فأن معامل انضغاطية الغاز هو إحدى المتغيرات الهامه التي تؤثر عليه ‪ ،‬وإن الصعوبات‬
‫المصاحبة لحساب ضغط قاع البئر في التدفق متعدد االطوار تعود إلى اختالف التدفق بين الموائع والغازات وتزداد‬
‫تلك التعقيدات في االبار المائلة كما أن اختالف درجة الحرارة والضغط لها دور كبير في ذلك وأيضا لها دور وبال‬
‫شك في التأثير على حسابات انضغاطية الغاز‪ .‬ولذلك ستنقسم هذه الدراسه إلى جزئين ‪ ،‬في الجزء األول تم تطوير‬
‫نموذج للذكاء الصناعي لحساب انضغاطية الغاز بدقه أفضل مقارنة بمعادلة درانك أبو القاسم باستخدام ‪ 2077‬نقطه‪.‬‬
‫ومن خالل التحليل االحصائي للنتائج فإن نموذج الذكاء الصناعي هو األفضل وذلك بمعامل إنحراف معياري مقداره‬
‫واحد ومتوسط نسبة الخطأ المطلقة مقدارها ‪ . 1.70‬وفي الجزء الثاني قمنا بتطوير معادلة بيج وبريل وربطها مع‬
‫النموذجين السابقين (نموذج الذكاء الصناعي وعالقة درانك أبو القاسم) لحساب ضغط قاع البئر ل ‪ 091‬بئر‪ .‬ومن‬
‫خالل ماسبق نستنتج أن عالقة بيج وبريل تكون أفضل أداء وأعلى دقه مع نموذج الذكاء الصناعي منها مع عالقة‬
‫درانك أبو القاسم‪.‬‬
1

CHAPTER I

INTRODUCTION

1.1 INTRODUCTION

The determination of bottom-hole flowing pressure in incline multiphase flow is indeed


very complex problems and no completely satisfactory solution is available at the present
time. Bottom-hole flowing pressure is very important for petroleum engineers. It helps in
designing production facilities, determination of artificial lift requirements and in many
of other production engineering aspects such as avoiding producing a well below its
bubble point in sand-face to maintain completion stability around the wellbore.[0]

Several good correlations exist for predicting bottom-hole flowing pressure in


multiphase flow either in horizontal or vertical flow, but these correlations have not been
successful when applied to inclined flow [7]. Few correlations apply to the whole
spectrum of flow situations that may be encountered in oil and gas operations, namely
uphill, downhill, horizontal, inclined and vertical flow. The Beggs and Brill correlation
is one of the few published correlations capable of handling all these flow directions and
the best correlation for calculated BHFP in incline multiphase flow.[3]

Beggs and Brill correlation depended on accurate estimation of it's input variables,
The gas compressibility [Z factor] is one variable that have effect in Beggs and Brill
correlation, so that the fuzzy logic, which is one of the famous Artificial Intelligence
technique used to obtain result that is more accurate with save time and effort.
2

1.2 STATEMENT OF PROBLEM

The Z-factor is an important reservoir fluid property used in reservoir engineering


computation.
Persently, several correlations have been used to estimate Z-factor such as
Dranchuk-Abu-Kassem , the accuracy of these correlations has become inadequate for
estimation. Therefore, Artificial Intelligent technique used in order to increase this
accuracy.
In additional, the new AI correlations will be integrated with Beggs and Brill
correlation in order to estimate BHFP in more accurate.

1.3 THE OBJECTIVES

The Objectives of This Study were :


1. Developing Artificial Intelligent model to determine Z-factor.
2. Using Dranchuk-Abu-Kassem correlation to estimate Z-factor .
3. Developing Beggs and Brill correlation by using MATLAB program.
4. Calculations BHFP by using (DAK) Z-factor correlation and Artificial
Intelligent Z-factor model.
5. Data analysis will be used to determine the effect of two Z-factor correlation
on BHFP calculation.
3

CHAPTER II

BOTTOM HOLE FLOWING PRESSURE

2.1 INTRODUCTION

An accurate prediction of bottom hole flowing pressure in multiphase flow is required in


designing of million or billion dollars surface and subsurface facilities projects in
Petroleum industries. These projects include building of offshore Oil and Gas pipeline,
Oil and Gas field’s process plants , multiphase separators, oil and gas equipment's such
as tubing, completion equipment's. Therefore accuracy in prediction of BHFP has a lot of
importance and one of most primarily concerns in petroleum and chemical industries.
There are many correlations to determine the BHFP in vertical, horizontal, inclined
direction. Beggs and Brill multiphase flow correlation is one of the most widely used
multiphase flow correlation in the industry due to its applicability for horizontal, vertical
and inclined multiphase flow modeling[4].

2.2 DETERMINATION OF BOTTOM HOLE FLOWING PRESSURE

As we know the measuring of BHFP with a gage or another instrument is the most
accurate method comparing with calculation methods but it cost largely and take a lot of
time, so that the correlations and modeling methods is desirable, especially it is closer to
the correct values , and save a lot of cost and time.

2.3 MULTIPHASE FLOW CORRELATIONS

There are many correlations to determine the BHFP in vertical, horizontal, inclined and
directional :

2.3.1 Vertical Flow Correlations


1. Hagedron and Brown correlation.
2. Dun and Ros correlation.
3. Orkiszewski correlation.
4

4. Beggs and Brill correlation.

2.3.2 Horizontal Flow Correlations


1. Lockhart and Martinelli correlation.
2. Baker’s correlation.
3. Andrews correlation.
4. Dukler correlation.
5. Eaton correlation.
6. Beggs and Brill correlation.

2.3.3 Incline Flow Correlations


1. Flanigan correlation.
2. Ovid Baker's correlation.
3. Brigham ,Hoistein , and Huntington's correlation.
4. Bonnecaze, Erskine , and Greskovich correlation.
5. Singh and Grifflth correlation.
6. Beggs and Brill correlation.

2.4 BEGGS AND BRILL CORRELATION

For multiphase flow, many of the published correlations are applicable for "vertical flow"
only, while others apply for "horizontal flow" only. Few correlations apply to the whole
spectrum of flow situations that may be encountered in oil and gas operations, namely
uphill, downhill, horizontal, inclined and vertical flow. The Beggs and Brill (1973)
correlation, is one of the few published correlations capable of handling all these flow
directions. It was developed using 1" and 1-1/2" sections of pipe that could be inclined at
any angle from the horizontal. The Beggs and Brill multiphase correlation deals with both
the friction pressure loss and the hydrostatic pressure difference. First the appropriate
flow regime for the particular combination of gas and liquid rates (Segregated,
Intermittent or Distributed) is determined. The liquid holdup, and hence, the in-situ
density of the gas-liquid mixture is then calculated according to the appropriate flow
regime, to obtain the hydrostatic pressure difference. A two-phase friction factor is
calculated based on the “input” gas-liquid ratio and the Fanning friction factor. From this
the friction pressure loss is calculated using “input” gas-liquid mixture properties.
5

The Beggs and Brill correlation is developed for tubing strings in inclined wells
and pipelines for hilly terrain. This correlation resulted from experiments using air and
water as test fluids over a wide range of parameters. The performance of the correlation
is given below:
1. Tubing Size. For the range in which the experimental investigation was conducted (i.e.,
tubing sizes between 1 and 1.5 in.), the pressure losses are accurately estimated. Any
further increase in tubing size tends to result in an over prediction in the pressure loss.
2. Oil Gravity. A reasonably good performance is obtained over a broad spectrum of oil
gravities.
3. Gas-Liquid Ratio (GLR). In general, an over predicted pressure drop is obtained with
increasing GLR. The errors become especially large for GLR above 5000.
4. Water-Cut. The accuracy of the pressure profile predictions is generally good up to
about 10% water-cut.

2.5 BEGGS AND BRILL NOTED:

1. The inclination angles of a pipe in which two phase flow is occurring definitely affects
liquid holdup and pressure drop for most flow conditions.
2. In inclination two phase flow, liquid holdup reaches a maximum at an angle of
approximately equal +50o and a minimum at approximately -50o from horizontal. The
fact that holdup is approximately equal at angles of +90o and +20o explains why vertical
holdup correlations can be used with some degree of success for horizontal flow.
3. Pressure recovery in the downhill section of a two phase pipeline in hilly terrain can
definitely exist and should be considered in pipeline design.
4. The accuracy of a liquid holdup correlations for horizontal two-phase flow can be
improved by consideration of flow pattern .
6

2.6 PROCEDURE OF BEGGS AND BRILL CORELATION

A detailed procedure for calculation a pressure traverse in an inclined pipeline by the


method of beggs and brill are :

The pressure gradient equation is:

𝑔 𝑓𝑡𝑝 𝐺𝑚 𝑉𝑚
∆𝑧 ( 𝜌 sin 𝜃+ )
𝑔𝑐 𝑡𝑝 2𝑔𝑑
∆𝑃 = 𝜌𝑡𝑝 𝑉𝑚 𝑉𝑠𝑔 (2.1)
1−
𝑔𝑐 𝑃
Where:
𝜌𝑡𝑝 = 𝜌𝐿 𝐻𝐿 + 𝜌𝑔 (1 − 𝐻𝐿 )
since liquid hold up HL is function of inclination angle , profile of pipeline must be
available. The traverse is thus calculated in sections, a section cosisting of the length line
where the angle is constant.
1. Beginning with the know pressure P1, estimate a value for pressure drop (or pressure
gain, if flow is downhill), ∆p.
2. Calculate the average pressure in the interval:
∆𝑃
𝑃̅ =𝑃1 + (2.2)
2

If P1 is downstream pressure;
∆𝑃
𝑃̅ =𝑃1 − (2.3)
2

If P1 is upstream pressure;
3. From PVT analysis or appropriate correlation, calculate :Rs, Bo, Bw, μo, μw, μg, σo, σw,
and Zg at 𝑇̅ and 𝑃̅.
4. Calculate the specific gravity of the oil 𝛾𝑜
141.5
𝛾𝑜 = 131.5+𝐴𝑃𝐼 (2.4)

5. Calculate the liquid and gas densities at average conditions of pressure and
temperature:
1 𝑊𝑂𝑅
𝜌𝐿 = 𝜌𝑜 (1+𝑊𝑂𝑅) + 𝜌𝑤 (1+𝑊𝑂𝑅) = 𝜌𝑜 𝑓𝑜 + 𝜌𝑤 𝑓𝑤 (2.5)
(350 𝛾𝑜 +0.0764 𝑅𝑠 𝛾𝑔 )
𝜌𝑜 = (2.6)
5.615 𝐵𝑜
350 𝛾
𝜌𝑤 = 5.615 𝐵𝑤 (2.7)
𝑤

0.0764 𝛾𝑔 𝑃̅ (520)
𝜌𝑔 = (2.8)
(14.7)(𝑇̅ +460)𝑍𝑔
7

6. Calculate the in situ gas and liquid flow rates.

̅̅̅̅̅̅̅̅̅̅̅
3.27×10−7 𝑍𝑔 𝑞𝑜 (𝑅−𝑅𝑠 )(𝑇+460)
𝑞𝑔 = ̅
(2.9)
𝑃

𝑞𝐿 = 6.49 × 10−5 (𝑞𝑜 𝐵𝑜 + 𝑞𝑤 𝐵𝑤 ) (2.10)

7. Calculate the in situ superficial gas, liquid, and mixture velocities.


𝑞
𝑉𝑠𝐿 = 𝐿⁄𝐴 (2.11)
𝑝
𝑞𝑔
𝑉𝑠𝑔 = ⁄𝐴 (2.12)
𝑝

𝑉𝑚 = 𝑉𝑠𝐿 + 𝑉𝑠𝑔 (2.13)


8. Calculate the liquid, gas, and total mass flux rates.
𝐺𝐿 = 𝜌𝐿 𝑉𝑠𝐿 (2.14)
𝐺𝑔 = 𝜌𝑔 𝑉𝑠𝑔 (2.15)
𝐺𝑚 = 𝐺𝐿 + 𝐺𝑔 (2.16)
9. Calculate the input liquid content (no slip holdup).
𝑞𝐿
ƛ=𝑞 (2.17)
𝐿 +𝑞𝑔

10. Calculate the Froud number, NFR, the liquid viscosity, the mixture viscosity, μm and
the liquid surface tension, σL
𝑚 𝑉2
𝑁𝐹𝑅 = 𝑔𝑑 (2.18)

𝜇𝐿 = 𝜇𝑜 𝑓𝑜 + 𝜇𝑤 𝑓𝑤 (2.19)
𝜇𝑚 = ((𝜇𝐿 ƛ + 𝜇𝑔 (1 − ƛ ))(6.72 × 10−4 ) (2.20)
𝜎𝐿 = 𝜎𝑜 𝑓𝑜 + 𝜎𝑤 𝑓𝑤 (2.21)
11. Calculate the no slip Reynolds number and the liquid velocity number.
𝐺
𝑁𝑅𝑒𝑛𝑠 = 𝜇𝑚 (2.22)
𝑚

𝜌 0.25
𝑁𝐿𝑉 = 1.938 𝑉𝑠𝐿 (𝜎𝐿 ) (2.23)
𝐿

12. To determine the flow pattern which would exist if flow were horizontal, calculate
the correlation parameters, L1 ,L2, L3, and L4.
𝐿1 = 316 ƛ0.302 (2.24)
𝐿2 = 0.0009252 ƛ−2.4684 (2.25)
𝐿3 = 0.10 ƛ−1.4516 (2.26)
8

𝐿4 = 0.5 ƛ−6.738 (2.27)


13. Determine flow pattern using the following limits:
Segregated:
ƛ < 0.01 𝑎𝑛𝑑 𝑁𝐹𝑅 < 𝐿1
𝑜𝑟 ƛ ≥ 0.01 𝑎𝑛𝑑 𝑁𝐹𝑅 < 𝐿2
Intermittent:
0.01 0.4 𝑎𝑛𝑑 𝐿3 𝑁𝐹𝑅
𝑜𝑟 ƛ ≥ 0.4 𝑎𝑛𝑑 𝐿3 < 𝑁𝐹𝑅 < 𝐿4
Transition:
ƛ ≥ 0.01 𝑎𝑛𝑑 𝐿2 < 𝑁𝐹𝑅 ≤ 𝐿3
Distributed:
0.4 𝑎𝑛𝑑 𝑁𝐹𝑅 𝐿1
𝑜𝑟 ƛ ≥ 0.4 𝑎𝑛𝑑 𝑁𝐹𝑅 > 𝐿4
14. Calculate the horizontal holdup, HL (0)
𝑎ƛ𝑏
𝐻𝐿 (0) = 𝑁 𝑐 (2.28)
𝐹𝑅

Where a, b and c are determined for each flow pattern from Table 1.1
Table 1.1 show constant a, b and c for each flow pattern
Flow pattern a b c
Segregated 0.98 0.4846 0.0868
Intermittent 0.845 0.5351 0.0173
Distributed 1.065 0.5824 0.0609

15. Calculate the inclination correction factor coefficient.


𝑓 𝑔
𝐶 = (1 − ƛ) ln(𝑑ƛ𝑒 𝑁𝐿𝑁 𝑁𝐹𝑅 ) (2.29)

Where d,e,f and g are determined for each flow condition from Table 1.2

Table 1.2 show constant d, e, f and g for each flow pattern

Flow pattern d e f g

Segregated uphill 0.011 -3.768 3.539 -1.614

Intermittent uphill 2.96 0.305 -0.4473 0.0978


Distributed uphill No correction C= 0
All flow patterns
4.70 -0.3692 0.1244 -0.5056
downhill
9

16. Calculate the liquid holdup inclination correction factor.


𝜓 = 1 + 𝐶 [sin(1.8𝜃) − 0.333 𝑠𝑖𝑛3 (1.8𝜃)] (2.30)

17. Calculate the liquid holdup and two – phase density.


𝐻𝐿 (𝜃) = 𝐻𝐿 (0)𝜓 (2.31)

𝜌𝑡𝑝 = 𝜌𝐿 𝐻𝐿 + 𝜌𝑔 (1 − 𝐻𝐿 ) (2.32)

18. Calculate the friction factor ratio.


𝑓𝑡𝑝
= 𝑒𝑠 (2.33)
𝑓𝑛𝑠

Where
𝑆 = [ln(𝑦)]⁄{−0.0523 + 3.182 ln(𝑦) − 0.8725 [ln(𝑦)]2 + 0.01853 [ln(𝑦)]4 } (2.34)
and
ƛ
𝑦 = [𝐻 (2.35)
𝐿 (𝜃) ]2

S become unbounded at a point in interval 1< y <1.2 ; and for y in this interval, function
S is calculated from:
𝑆 = ln(2.2𝑦 − 1.2) (2.36)
19. Calculate the no slip friction factor
𝑓𝑛𝑠 = 1⁄[2 log(𝑁𝑅𝑒𝑛𝑠 ⁄(4.5223 log 𝑁𝑅𝑒𝑛𝑠 − 3.8215))]2 (2.37)

20. Calculate the tow – phase friction factor.


𝑓𝑡𝑝
𝑓𝑡𝑝 = 𝑓𝑛𝑠 𝑓 (2.38)
𝑛𝑠

21. Calculate pressure drop.


𝑔 𝑓𝑡𝑝 𝐺𝑚 𝑉𝑚
∆𝑧 ( 𝜌 sin 𝜃+ )
𝑔𝑐 𝑡𝑝 2𝑔𝑑
∆𝑃 = 𝜌𝑡𝑝 𝑉𝑚 𝑉𝑠𝑔 (2.39)
1−
𝑔𝑐 𝑃

22. If the pressure drop (or gain) estimated in step 1 and that calculated in step 21 are not
sufficiently close, use the value calculated in step 21 as the the new estimated ∆𝑃 and go
back to step 2. This procedure is repeated until the estimated and calculated values of ∆𝑃
agree. The pressure at z ± ∆z is then 𝑃1 ± ∆𝑃.If flow is downhill, the pressure can either
increase or decrease in the direction of flow, depending on the relative magnitude of the
hydrostatic and friction pressure gradients. If a negative a pressure gain in the flow
direction[3].
11

Prediction of pressure drop is quite difficult and complicated due to the complex
relationships between the various parameters involved. This parameters include pipe
diameter, compressibility of gas (Z-factor), fluid properties and the flow rate of each
phase. Another parameter, which adds to the difficulty is the flow patterns and their
transition boundaries inside the wellbore along with changing temperature and pressure
condition. Therefore, an accurate analytical solution for this problem is difficult or
impossible to achieve. The compressibility of gas (Z-factor) effect of pressure drop
prediction, so we will interest about it.
11

CHAPTER III

THE NATURAL GAS COMPRESSIBILITY FACTOR

3.1 INTRODUCTION

The gas compressibility factor (Z-factor) and also known as the compression factor or the
gas deviation factor is a correction factor which describes the deviation of a real gas from
ideal gas behavior. It is an important reservoir fluid property used in reservoir engineering
computations either directly or indirectly, so it comes into play for various engineering
purposes, which include calculating BHFP, gas in place, well flow rates, simulating the
gas volume, change analyzing reservoir pressure behavior and design of hydrocarbon-
handling systems[5]. In this chapter, will focus on the most correlation used to determine
Z-factor.

3.2 METHODS OF DETERMINATION THE Z-FACTOR

3.2.1 Indirect Method[6]


1. Experimental Determination.
2. Empirical Correlations Method (Standing-Katz Compressibility Factor Chart,1941).
3. Equation of state (EOS).

3.2.2 Direct Method


1. Hall-Yarborough’s Method (1973)[7].
2. Dranchuk-Purvis-Robinson Method (1974)[7].
3. Beggs and Brill Correlation[5].
4. Gopal Method (1977)[5].
5. Papay correlation (1985)[8].
6. Matthews,Roland and Katz.[5].
7. Hankinson-Thomas-Phillips Method (1969)[8].
12

3.3 DRANCHUK -ABU-KASSEM’S METHOD 1975

Many authors consider DAK correlation as the best correlation to calculate gas
compressibility factor. Therefore, our study try to use this model.
pMa p
ρ [ ] [ ]
ZRT ZT
ρr = ρ = pc Ma = pc (3.1)
c [ ] [ ]
Zc RTc Zc Tc

The critical gas compressibility factor Zc is approximately 0.27, which leads to the
following simplified expression for the reduced gas density as expressed in terms of the
reduced temperature Tr and reduced pressure pr:

0.27Ppr
ρpr = (3.2)
ZTpr

The authors proposed the following 11-constant equation of state for calculating the
reduced gas density:

𝑅
𝑓(𝜌𝑟 ) = (𝑅1 )𝜌𝑟 − 𝜌2 + (𝑅3 )𝜌𝑟2 − (𝑅4 )𝜌𝑟2 + (𝑅5 )(1 + 𝐴11 𝜌𝑟2 )𝜌𝑟2 exp[−𝐴11 𝜌𝑟2 ] + 1 = 0
𝑟

(3.3)
with the coefficients R1through R5 as defined by the following relations:
A2 A3 Ar At
R1 = A1 + + 3 + 4 + 5
Tpr Tpr Tpr Tpr
0.27𝑃𝑝𝑟
𝑅2 =
𝑇𝑝𝑟
𝐴7 𝐴8
𝑅3 = 𝐴6 + + 2
𝑇𝑝𝑟 𝑇𝑝𝑟

𝐴7 𝐴8
𝑅4 = 𝐴9 [ + 2]
𝑇𝑝𝑟 𝑇𝑝𝑟

A10
R5 = [ 3 ]
Tpr
13

The constants A1 through A11 were determined by fitting the equation, using nonlinear
regression models, to 1500 data points from the Standing and Katz Z-factor chart. The
coefficients have the following values:

A1=0.3265 A2=-1.07 A3=-0.5339 A4 =0.01569


A5 =-0.05165 A6=0.5475 A7=-0.7361 A8=0.1844
A9=0.1056 A10=0.6134 A11=0.721
Equation(3.3) can be solved for the reduced gas density ρr by applying the Newton-
Raphson iteration technique. The proposed correlation was reported to duplicate
compressibility factors from the Standing and Katz chart with an average absolute error
of 0.585% and is applicable over the ranges [7]:

0.2≤Ppr<30
1.0<Tpr≤3.0
Dranchuk-Abu-Kassem is almost the best correlation used in oil and gas calculations to
estimate Z-factor. In the next chapter, discuss the new Artificial Intelligent technique to
determine Z-factor in more accurate.
14

CHAPTER IV

FUZZY LOGIC TOOLBOX

4.1 INTRODUCTION

Fuzzy Logic Toolbox software is a collection of functions built on the MATLAB


technical computing environment. It provides tools for us to create and edit fuzzy
inference systems within the framework of MATLAB. can also integrate fuzzy systems
into simulations with Simulink Software. This toolbox relies heavily on Graphical User
Interface (GUI) tools to help us accomplish our work, although can work entirely from
the command line if we prefer. The toolbox provides three categories of tools:
1. Command line functions.
2. Graphical interactive tools.
3. Simulink blocks.

The first category of tools is made up of functions that can call from the command
line or from own applications. Many of these functions are MATLAB M-files, series of
MATLAB statements that implement specialized fuzzy logic algorithms.

Secondly, the toolbox provides a number of interactive tools that let us access
many of the functions through ( GUI).

The third category of tools is a set of blocks for use with Simulink. The most of
human reasoning and concept formation is linked to the use of fuzzy rules. By providing
a systematic framework for computing with fuzzy rules, the toolbox greatly amplifies the
power of human reasoning.

4.2 DEFINITION

Fuzzy logic has two different meanings. In a narrow sense, fuzzy logic (FL) is a logical
system, which is an extension of multivalued logic. A theory which relates to classes of
objects with unsharp boundaries in which membership is a matter of degree. Even in its
more narrow definition, fuzzy logic differs both in concept and substance from traditional
multivalued logical systems. In Fuzzy Logic Toolbox software, fuzzy logic should be
15

interpreted as FL, that is, Fuzzy Logic in its wide sense. Another basic concept in FL,
which plays a central role in most of its applications, is fuzzy rule. Although rule-based
systems have a long history of use in Artificial Intelligence (AI),a mechanism for dealing
with fuzzy consequents and fuzzy antecedents is provided by the calculus of fuzzy rules.
The calculus of fuzzy rules serves as a basis for what might be called the Fuzzy
Dependency and Command Language (FDCL). Although FDCL is not used explicitly in
the toolbox, it is effectively one of its principal constituents. In most of the applications
of fuzzy logic solution in reality, a translation of a human solution into FDCL.

can use Fuzzy Logic Toolbox software with MATLAB technical computing
software as a tool for solving problems with fuzzy logic. Fuzzy logic is a fascinating area
of research because it does a good job of trading off between significance and precision
something that humans have been managing for a very long time.

4.3 IMPORTANT OF FUZZY LOGIC

Here is a list of general observations about fuzzy logic:


1) Fuzzy logic is conceptually easy to understand where mathematical concepts behind
fuzzy reasoning are very simple.
2) Fuzzy logic is flexible to layer on more functionality without starting again from
scratch.
3) Fuzzy logic is tolerant of imprecise data.
4) Fuzzy logic can model nonlinear functions of arbitrary complexity.
5) Fuzzy logic can be built on top of the experience of experts.
6) Fuzzy logic can be blended with conventional control techniques.
7) Fuzzy logic is based on natural language.
16

Figure 4.1 Display fuzzy operation

4.4 FOUNDATION OF FUZZY LOGIC

4.4.1 Fuzzy Sets


Fuzzy logic starts with concept of a fuzzy set. A fuzzy set is a set without a crisp clearly
defined boundary. It can contain elements with only a partial degree of membership; for
example, the set of days of the week unquestionably includes Monday, Thursday, and
Saturday.

4.4.2 Membership Functions


A membership function (MF) is a curve that defines how each point in the input space is
mapped to a membership value (or degree of membership) between 0 and 1.The input
space is sometimes referred to as the universe of discourse, a fancy name for simple
concept.

4.5 MEMBERSHIP FUNCTIONS OF FUZZY LOGIC TOOLBOX

The toolbox includes 11 built-in membership function types. These 11 functions are built
from basic functions:

4.5.1 Piece-Wise Linear Functions


The simplest membership functions are formed using straight lines. Of these, the simplest
is the Triangular Membership Function (TRIMF). This function is nothing more than a
collection of three points forming a triangle. The Trapezoidal Membership Function
17

(TRAPMF) has a flat top and really is just a truncated triangle curve. These straight line
membership functions have the advantage of simplicity.

Figure 4.2 linear functions

4.5.2 The Gaussian And Bell Distribution Function


Gaussian distribution curve have two membership functions (GAUSSM ) are built on the
a simple Gaussian curve and a two-sided composite of two different Gaussian curves.
The two functions are GAUSSMF and GAUSS2MF.

The Generalized Bell Membership Function (GBELLMF) is specified by three


parameters and has the function name GBELLMF. The bell membership function has one
more parameter than the Gaussian membership function, so it can approach a non-fuzzy
set if the free parameter is tuned. Because of their smoothness and concise notation,
Gaussian and bell membership functions are popular methods for specifying fuzzy sets.
Both of these curves have the advantage of being smooth and nonzero at all points.

Figure 4.3 The Gaussian and Bell distribution function

4.5.3 The Sigmoid Curve


The sigmoidal membership function (SIGMF), which is either open left or right.
Asymmetric and closed (i.e. not open to the left or right) membership functions can be
synthesized using two sigmoidal functions, so in addition to the basic SIGMF. Also
have the difference between two sigmoidal functions, DSIGMF, and the product of
two sigmoidal functions PSIGMF.
18

Figure 4.4 The sigmoid curve

4.5.4 Quadratic and Cubic Polynomial Curves


Polynomial based curves account for several of the membership functions in the toolbox.
Three related membership functions are the Z, S, and curves, all named because of their
shape. The function ZMF is the asymmetrical polynomial curve open to the left, SMF is
the mirror-image function that opens to the right, and PIMF is zero on both extremes with
a rise in the middle.

Figure 4.5 Quadratic and cubic polynomial curves

4.6 FUZZY INFERENCE SYSTEMS

Fuzzy inference is the process of formulating the mapping from a given input to an output
using fuzzy logic. The mapping then provides a basis from which decisions can be made,
or patterns discerned. Can implement two types of fuzzy inference systems in the toolbox:

4.6.1 Mamdani-Type Fuzzy Inference


Mamdani’s fuzzy inference method is the most commonly seen fuzzy methodology.
Mamdani type inference, as defined for the toolbox, expects the output membership
functions to be fuzzy sets. After the aggregation process, there is a fuzzy set for each
output variable that needs defuzzification. It is possible, and in many cases much more
efficient, to use a single spike as the output membership function rather than a distributed
19

fuzzy set. This type of output is sometimes known as a singleton output membership
function, and it can be thought of as a predefuzzified fuzzy set. It enhances the efficiency
of the defuzzification process because it greatly simplifies the computation required by
the more general Mamdani method, which finds the centroid of a two-dimensional
function.Rather than integrating across the two-dimensional function to find the centroid,
use the weighted average of a few data points.
Advantages of the Mamdani Method:
 It is intuitive.
 It has widespread acceptance.
 It is well suited to human input.

4.6.2 Sugeno-Type Fuzzy Inference


The fuzzy inference process discussed so far is Mamdani’s fuzzy inference method, the
most common methodology. This section discusses the so-called Sugeno, or Takagi-
Sugeno-Kang, method of fuzzy inference. Introduced in 1985 , it is similar to the
Mamdani method in many respects. The first two parts of the fuzzy inference process,
fuzzifying the inputs and applying the fuzzy operator, are exactly the same. The main
difference between Mamdani and Sugeno is that the Sugeno output membership functions
are either linear or constant. A typical rule in a Sugeno fuzzy model has the form:
If Input 1 = x and Input 2 = y, then Output is z = ax + by + c.For a zero-order Sugeno
model, the output level z is a constant (a=b =0).The output level zi of each rule is weighted
by the firing strength wi of the rule. For example, for an AND rule with Input 1 = x and
Input 2 = y, the firing strength is wi = And Method (F 1(x ), F 2(y )).
Advantages of the Sugeno Method:
 It is computationally efficient.
 It works well with linear techniques.
 It works well with optimization and adaptive techniques.
 It has guaranteed continuity of the output surface.
 It is well suited to mathematical analysis.
21

4.7 BUILDING SYSTEMS WITH FUZZY LOGIC TOOLBOX

Fuzzy Logic Toolbox GUI Tools. In this section, the Fuzzy Logic Toolbox GUI tools
used to build a Fuzzy Inference System (FIS) Although We can build a FIS by working
strictly from the command line, it is much easier to build a system graphically. The Fuzzy
Logic Toolbox GUI does not support building FIS using data. If We want to use data for
building a FIS, use one of the following techniques:
1- Genfis1, genfis2, or genfis3 commands to generate a Sugeno-type FIS. Can then select
File > Import in the FIS Editor to import the FIS and perform fuzzy inference.
2- Neuro-adaptive learning techniques to model the FIS. Can use five primary GUI tools
for fuzzy inference systems:
 Fuzzy Inference System Editor.
 Membership Function Editor.
 Rule Editor.
 Rule Viewer.
 Surface Viewer.

These GUIS are dynamically linked, in that changes we make to the FIS using one
of them, can affect what We see on any of the other open GUIS. Can have any or all of
them open for any given system. In addition to these five primary GUIS, the toolbox
includes the graphical ANFIS Editor GUI, which is used for building and analyzing
Sugeno-type Adaptive Neuro-Fuzzy Inference Systems ANFIS.
21

FIS Editor

Membership
Rule Editor Function Editor

Fuzzy
Inference
System

Read-only
tools

Rule Viewer Surface Viewer

Figure 4.6 Fuzzy Inference System

The FIS Editor handles the high-level issues for the system. How many input and
output variables? What are their names? Fuzzy Logic Toolbox software does not limit
the number of inputs. However, the number of inputs may be limited by the available
memory of us machine. If the number of inputs is too large, or the number of membership
functions is too big, then it may also be difficult to analyze the FIS using the other GUI
tools.

The Membership Function Editor is used to define the shapes of all the
membership functions associated with each variable. The Rule Editor is for editing the
list of rules that defines the behavior of the system. The FIS Editor displays information
about a fuzzy inference system. To open the FIS Editor, type the following command at
the MATLAB prompt fuzzy.
Double-click an input variable
Menu commands for Saving, icon to open the Membership 22
opening, or editing a fuzzy Function editor.
system.

Double-click an output variable


Double-click the system diagram
icon to open the Membership
to open the Rull editor.
Function editor.

Figure 4.7 Fuzzy Inference System Editor

4.8 TOOLBOX FUNCTION ANFIS

The acronym ANFIS derives its name from adaptive neuro-fuzzy inference system. Using
a given input/output data set, the toolbox function ANFIS constructs FIS whose
membership function parameters are tuned (adjusted) using either a back propagation
algorithm alone or in combination with a least squares type of method. This adjustment
allows our fuzzy systems to learn from the data they are modeling.
23

Figure 4.8 (ANFIS) Surface Viewer

4.9 FUZZY CLUSTERING

Clustering of numerical data forms the basis of many classification and system modeling
algorithms. The purpose of clustering is to identify natural groupings of data from a large
data set to produce a concise representation of a system’s behavior. Fuzzy Logic Toolbox
tools allow you to find clusters in input-output training data. Can use the cluster
information to generate a Sugeno-type fuzzy inference system that best models the data
behavior using a minimum number of rules. The rules partition themselves according to
the fuzzy qualities associated with each of the data clusters. Use the command-line
function, genfis2 to automatically accomplish this type of FIS generation.

4.10 SUBTRACTIVE CLUSTERING

If we do not have a clear idea how many clusters there should be for a given set of data,
Subtractive clustering is a fast one-pass algorithm for estimating the number of clusters
and the cluster centers in a set of data. The cluster estimates, which are obtained from the
subclust function, can be used to initialize iterative optimization-based clustering
methods (FCM) and model identification methods (like ANFIS). The subclust function
24

finds the clusters by using the subtractive clustering method. The genfis2 function builds
upon the subclust function to provide a fast, one-pass method to take input-output training
data and generate a Sugeno-type fuzzy inference system that models the data behavior.[9]
25

CHAPTER V

RESULT AND DISCUSSION

In this chapter. First, estimate gas compressibility by using ANFIS model and DAK
correlation. Second calculate BHFP by Beggs and Brill correlation with previous two
model.

5.1 THE NATURAL GAS COMPRESSIBILITY FACTOR

First part, generate ANFIS model to calculate gas compressibility factor (Z-factor).

5.1.1 Data Collection


A total of 7118 data point were collected from Middle East fields. 6000 data point used
for training program and 1118 data point for test and this data used to predict the Z-factor.

5.1.2 Error Analysis


Error analysis is utilized to check the accuracy of the model and aid in visualizing the
performance of model by comparison the result of ANFIS model with DAK Correlation.

1- Statistical Analysis For ANFIS Model And DAK Correlation


The all statistical parameters analysis used in study of this research are for absolute
relative percent error. The parameters are maximum (MAX), minimum (MIN), average
(AARE), standard deviation (STD) and root mean square (RMS) and correlation factor
(R).

Summary of statistical comparisons for ANFIS model and DAK correlation


against the actual data is listed in Table 5.1
26

Table 5.1 Statistical Error Analysis for DAK correlation and ANFIS model

Type DAK ANFIS

Max % 80.5502 10.1191

Mini % 0.0028 0.00004

AARE % 6.7902 0.2636

STD 12.9053 0.7087

RMS 14.5779 0.7559

R 0.9741 1.0000

As it shown from Table 5.1 the ANFIS model achieved the highest correlation
factor (1.00) where DAK correlation (0.9741), and average absolute relative percent error
for ANFIS model (0.2636) and for DAK correlation (6.7902). From the last analysis it
can be concluded that ANFIS model is the best estimation of Z-factor.

2- Graphical Analysis

Graphical cross plots comparison between two method is given in Figure 5.1 and 5.2
which show cross plots between the estimated versus the actual (measured).

2.00
1.80
Estimated Z factor

1.60
1.40
1.20
1.00
0.80
0.60
0.40
0.20
0.00
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Measured Z factor

Figure 5.1 Cross plot of Observed vs. Calculated Z for ANFIS model
27

1.80
1.60
1.40
Estimated Z factor

1.20
1.00
0.80
0.60
0.40
0.20
0.00
0 0.5 1 1.5 2
Measured Z factor

Figure 5.2 Cross plot of Observed vs. Calculated Z for DAK correlation

As show in Figure 5.1 and 5.2 Confirm that ANFIS model is better than DAK
correlation.

Graphical comparison between two method is given in Figure 5.3 through


5.6 which show the correlation Factor R , average absolute relative percent error AARE,
root mean square RMS and standard deviation STD.

1.10 1.0000 0.9741


1.00
0.90
0.80
0.70
0.60
0.50
0.40
0.30
0.20
0.10
0.00
R
ANFIS DAK

Figure 5.3 Comparisons of Correlation Factor for the Models.


28

20.00
18.00
16.00 14.5779
14.00
12.00
10.00
8.00
6.00
4.00
2.00 0.7559
0.00
RMS
ANFIS DAK

Figure 5.4 Comparisons of RMS for the models

14.00 12.9053
12.00
10.00
8.00
6.00
4.00
2.00 0.7087
0.00
STD
ANFIS DAK

Figure 5.5 Comparisons of STD for the models


29

6.7902

6.00

5.00

4.00

3.00

2.00

1.00
0.2636
0.00
ANFIS AARE DAK

Figure 5.6 Comparisons of AARE for the models

As shown in Figure 5.3 through 5.6 the ANFIS model give us the highest correlation
factor (1.00) and the lowest average absolute relative percent error (0.2636) that's mean
ANFIS model is more accurate.

5.2 BOTTOM HOLE FLOWING PRESSURE

In second part of our project, developing Beggs and Brill correlation in MATLAB
program and integrated with ANFIS model and DAK correlation to calculate BHFP and
study the effect of Z-factor in BHFP calculation.

5.2.1 Data Description

A total of 194 data point were collected from Egypt fields and used for calculated BHFP
with (ANFIS) model and (DAK) Correlation. After running data in Beggs and Brill
model by both method, the ANFIS model successful to give the result for all 194 data
point whereas the DAK correlation just give result for 164 data point and fail to give
result for 30 data point.
31

Table 5.2 Range of input data for BHFP prediction.

Input MAX MIN


GOR (scf/stb) 9975 45
API 62.3362 13
GSp.G 0.95 0.57
ID (in) 9.625 1.992
Ts (F) 229.64 46
Tbh (F) 369.264 82
Qo (stb/d) 31000 44
Qg (scf/d) 55.47 0.019448
WC 0.701999 0
TVD (ft) 14344 999.235
Pwh (psi) 3790 20

5.2.2 Error Analysis

1- Statistical Analysis for ANFIS Model and DAK Correlation for


Calculate BHFP
The all statistical parameters analysis used in study of this research are for absolute
relative percent error. The parameters are maximum (MAX), minimum (MIN), average
(AARE), standard deviation (STD) and root mean square (RMS) and correlation factor
(R).

Summary of statistical analysis of ANFIS model and DAK correlation when


integrated with Beggs and Brill model to predict BHFP versus actual BHFP is listed in
Table 5.3.
31

Table 5.3 Statistical Analysis Results of DAK correlation and ANFIS for BHFP

DAK ANFIS

Max 441.7592 440.9617

Mini 0.0080 0.0078

AARE 17.3 16.9

STD 39.3 39.25

RMS 20.2 19.8

R 0.86 0.87

As it shown from table 5.3 the ANFIS model achieved the highest correlation factor (0.87)
where DAK correlation (0.86), and average absolute relative percent error for ANFIS
model (16.9) and for DAK correlation (17.3). From the last analysis, it can be concluded
that Beggs and Brill model is the best accuracy and performance when integrate with
ANFIS model.

2- Graphical Analysis
Graphical cross plots of Beggs and Brill model when integrated with ANFIS model and
DAK correlation to predict BHFP. Figure 5.7 and 5.8 which show cross plots between
the predicted versus the actual (measured) BHFP.
32

Predicted bottom hole flowing pressure


7000
6000
5000
4000
3000
2000
1000
0
0 1000 2000 3000 4000 5000 6000 7000
Measured BHFP

Figure 5.7 Cross plot of Observed vs. Calculated BHFP with DAK correlation
Predicted bottom hole flowing pressure

7000
6000
5000
4000
3000
2000
1000
0
0 2000 4000 6000 8000
Measured BHFP

Figure 5.8 Cross plot of Observed vs. Calculated BHFP with ANFIS model

Graphical comparison between models is given in Figure 5.9 through 5.12 which show
the correlation Factor R, average absolute relative error AARE, root mean square relative
error RMS and standard deviation STD of all models.
33

1.00
0.87 0.86
0.90
0.80
0.70
0.60
0.50
0.40
0.30
0.20
0.10
0.00
R
ANFIS DAK

Figure 5.9 Comparisons of Correlation Factor for the Models

19.8 20.2
20.00
18.00
16.00
14.00
12.00
10.00
8.00
6.00
4.00
2.00
0.00
RMS
ANFIS DAK

Figure 5.10 Comparisons of RMS for the Models


34

39.34
39.32
39.32
39.30
39.28
39.26 39.25
39.24
39.22
39.20
STD
ANFIS DAK

Figure 5.11 Comparisons of STD for the Models

16.9 17.3
16.00

11.00

6.00

1.00
AARE
ANFIS DAK

Figure 5.12 Comparisons of AARE for the Models

As shown in Figure 5.9 through 5.12 the Beggs and Brill model when integrated with
ANFIS model give us the highest correlation factor (0.87) and the lowest average absolute
relative percent error (16.9) than when integrated with DAK correlation, that's mean the
Beggs and Brill model is more accurate when integrate with ANFIS model.
35

5.2.3 ANALYSIS OF 30 DATA POINT

Table 5.4 illustrate the results of BHFP values for 30 data points generated by integrated
BHFP correlation with ANFIS model whereas the other integrated model with DAK is
failed. This result show also the ability of the first integrated model to predict the BHFP
values successfully.

Table 5.4 Results of BHFP predicted by using both integrated techniques (ANFIS and
DAK).
BHFP BHFP & BHFP &
No
(measure) (ANFIS) (DAK)
1 4703 3767 -
2 4437 3760 -
3 5253 3539 -
4 5535 3538 -
5 2558 4071 -
6 2704 4211 -
7 2423 3254 -
8 2195 3279 -
9 2282 3162 -
10 2453 3250 -
11 2616 3101 -
12 2192 3146 -
13 1950 2786 -
14 2131 3346 -
15 1946 2761 -
16 2129 3184 -
17 2354 3461 -
18 2218 3203 -
19 2029 3027 -
20 2488 3374 -
21 2308 3393 -
22 2246 3349 -
23 2326 3121 -
24 2477 3001 -
25 2378 3116 -
26 2200 3408 -
27 4554 4585 -
28 3850 4558 -
29 3556 4220 -
30 3956 4548 -

As show in Table 5.4 Beggs and Brill model is more performance when integrated with
ANFIS model.
36

CHAPTER VI

CONCLUSIONS AND RECOMMENDATION

6.1 CONCLUSIONS

Based on the results, the conclusions can be made as follows :


1- From the error analysis results, the ANFIS technique to estimate Z-factor
is better than DAK correlation.
2- The ANFIS model achieved the highest correlation factor almost equal
one and AARE equal 0.26 whereas the correlation factor of DAK is 0.974
and AARE equal 6.79.
3- Beggs and Brill correlation was developed by MATLAP program to
calculate BHFP and integrated with both ANFIS and DAK correlation.
4- The combination of ANFIS and Beggs & Brill techniques increased the
accuracy and ability of Beggs & Brill correlation to estimate BHFP.
5- For estimating the BHFP, the ANFIS Beggs & Brill model resulted in
correlation factor equal 0.87 and AARE equal 16.9.
6- Around of 7188 data points used for Z-factor and about 194 data sets for
BHFP calculation.

6.2 RECOMMENDATIONS

The recommendations are made as a possible extension of the present study as follows:
 Use the Artificial Intelligence Technique to estimate all PVT properties in Beggs
and Brill correlation to obtain more accurate BHFP.
 Developed Beggs and Brill correlation in MATLAP program to calculate
wellhead pressure (Pwh).
 Use Artificial Intelligence Technique to predicted flow pattern of Beggs and Brill
correlation to obtain more accurate BHFP.
37

REFERENCES

1. Ahmed Al-Shammari. "Accurate Prediction of Pressure Drop in Two-Phase


Vertical Flow System using Artificial intelligence". SPE 149035, May 2011.
2. H. Dale Beggs and James P. Brill. " A Study of Two-Phase Flow in Inclined Pipe"
SPE 4007 , Oct. 8-11, 1972.
3. BROWN, Kermit E. Technology of artificial lift methods. Volume 1. Inflow
performance, multiphase flow in pipes, the flowing well. 1977.
4. Muzammil Hussain Rammay, and Dr Sami Al-Nuaim. "Flow Regime Prediction
Using Fuzzy Logic and Modification in Beggs and Brill Multiphase Correlation"
IPTC-18267-MS, Qatar, 6-9 December 2015.
5. LEE, W. John; WATTENBARGER, Robert A. Gas reservoir engineering. 1996.
6. IKOKU, Chi U. Natural gas production engineering. Krieger Pub. Co.,, 1992.
7. AHMED, Tarek. Equations of state and PVT analysis. Elsevier, 2013.
8. AHMED, Tarek H. Hydrocarbon phase behavior. Gulf Pub Co, 1989.
9. ZADEH, Lotfi A., et al. Fuzzy logic toolbox user’s guide. Version, 1995,2:12-55.
38

APPENDIX

STATISTICAL AND GRAPHICAL ERROR ANALYSIS

1- Statistical Error Analysis


Error analysis is utilized to check the accuracy of the model. The statistical parameters
used in the present work are average absolute percent relative error, minimum and
maximum absolute percent error, standard deviation of error, and the correlation factor.
Equations for those parameters are given below.

a) Average Absolute Percent Relative Error (APRE)

It is measure of relative deviation from the experimental data, defined by:


1
𝐸𝑎 = 𝑛 ∑𝑁
𝑖=1|𝐸𝑖| (5.1)

(𝑍)𝑚𝑒𝑎𝑠 −(𝑍)𝑒𝑠𝑡
𝐸𝑖 = [ (𝑍)𝑚𝑒𝑎𝑠
] × 100 , 𝑖 = 1,2,3, … , 𝑛 (5.2)

(This will be considered as the main criterion in statistical error analysis throughout this
study).

b) Minimum Absolute Percent Relative Error

𝑛
𝐸𝑚𝑖𝑛 = 𝑚𝑖𝑛𝑖+1 |𝐸𝑖 | (5.3)

c) Maximum Absolute Percent Relative Error


𝑛
𝐸𝑚𝑎𝑥 = 𝑚𝑎𝑥𝑖+1 |𝐸𝑖 | (5.4)

d) Standard Deviation

It measures of dispersion and is expressed:

1 (𝑍𝑎𝑐𝑡 −𝑍𝑒𝑠𝑡 ) 2
STD =√[(𝑚−𝑛−1)] ∑𝑚
𝑖=1 [{ } 100] (5.5)
𝑍𝑎𝑐𝑡

Where;
(m-n-1) represents the degree of freedom in multiple-regression. A lower value of
standard deviation indicates a smaller degree of scatter.
39

e) The Correlation Factor

It represents the degree of success in reducing the standard deviation by regression


analysis, defined by:

∑𝑛
𝐼=1[(𝑍)𝑎𝑐𝑡 −(𝑍)𝑒𝑠𝑡 ]
R = √1 − ∑𝑛 ̅
(5.6)
𝐼=1(𝑍)𝑎𝑐𝑡 −𝑍

Where:

1 𝑛
𝑍̅ = ∑ [(∆𝑍)𝑎𝑐𝑡 ]𝐼
𝑛 𝐼=𝑛

Correlation Factor value range between 0 and 1. The closer value to 1 represents perfect
correlation whereas 0 indicates no correlation at all among the independent.

2- Graphical Error Analysis


Graphical tools aid in visualizing the performance and accuracy of a correlation or a
model. graphical analysis techniques are employed; those is cross plots.

a) Cross Plots
In this graphical based technique, all estimated values are plotted against the measured
values and thus a cross plot is formed. A 45° straight line between the estimated versus
actual data points is drawn on the cross plot, which denotes a perfect correlation line. The
tighter the cluster about the unity slope line, the better the agreement between the
experimental and the predicted results. Figures 5.1 and 5.2 present cross plots of the
natural gas compressibility factor versus the actual one for DAK correlation and the
developed ANFIS model. Investigation of these figures clearly shows that the developed
ANFIS model outperforms all correlations.

You might also like