DEVELOPMENT AND TESTING OF AN EXPERT SYSTEM FOR …
Transcript of DEVELOPMENT AND TESTING OF AN EXPERT SYSTEM FOR …
The Pennsylvania State University
The Graduate School
Department of Energy and Mineral Engineering
DEVELOPMENT AND TESTING OF AN EXPERT SYSTEM FOR
COALBED METHANE RESERVOIRS USING
ARTIFICIAL NEURAL NETWORKS
A Thesis in
Petroleum and Mineral Engineering
by
Karthik Srinivasan
© 2008 Karthik Srinivasan
Submitted in Partial Fulfillment
of the Requirements
for the Degree of
Master of Science
August 2008
The thesis of Karthik Srinivasan has been reviewed and approved* by the following:
Turgay Ertekin
Professor of Petroleum and Natural Gas Engineering
George E. Trimble Chair in Earth and Mineral Sciences
Graduate Program Chair in Petroleum and Mineral Engineering
Thesis Advisor
Luis Ayala
Assistant Professor of Petroleum & Natural Gas Engineering
Zuleima T. Karpyn
Assistant Professor of Petroleum & Natural Gas Engineering
*Signatures are on file in the Graduate School
iii
ABSTRACT
Reservoir simulators serve as excellent tools in predicting production performance of oil
and gas reservoirs at a good level of accuracy. However, during initial stages of exploitation, for
most of the reservoir properties and production parameters, there is a good level of
uncertainty. In such cases, Expert Systems offer a screening tool to achieve the purpose of a
simulator at a lower cost and reduced time. An expert system consists of a knowledge base and
set of algorithms that are capable of inferring facts based on existing knowledge and incoming
data. The level of accuracy of predictions from an expert system depends on the quality of data,
rules that define the problem at hand and human expertise.
Artificial neural networks are being used in a large number of reservoir engineering
applications such as performance optimization, reservoir characterization, field development
applications, well stimulation, formation evaluation and pressure transient analysis. The expert
system described in this work is a tool which can be used to predict the performance of a
coalbed methane reservoir just like any other numerical model. Starting with a simple model
where predictions are confined to coal seams of known reservoir parameters and varying
production parameters, a generalized model is developed. The developed expert system is
designed for universal applications and provides gas and water production profiles for a period
of about ten years as outputs.
In addition to this model, an inverse expert system, in which, for an expected
percentage recovery from a coal seam, optimum ranges of well design parameters that satisfy
the requirements of the producer are predicted. Conventional reservoir simulators may not
iv
provide the user with a list of suggestive design parameters that can help achieve a certain
desired production performance from a coal seam of known reservoir properties before it can
be put into production. This is achieved by the inverse model which otherwise can only be
accomplished by trial and error procedures.
Understanding the ability of the network to predict the output parameters is crucial in
such developments. As expected, the complexity of the network topology is bound to increase
with increased number of inputs and outputs. Due to inherently existing nonlinearities in
relationships between inputs and outputs, several modifications are required to institute a
sound combination of inputs that can improve predictions significantly. With an orderly and
improvised procedure, a robust expert system that can be used in optimizing the coal bed
methane production applications is developed and tested successfully.
v
TABLE OF CONTENTS
LIST OF FIGURES ……………………………………………………………………………………………………………………. viii
LIST OF TABLES ………………………………………………………………………………………………………………………… x
NOMENCLATURE …………………………………………………………………………………………………………………….. xi
ACKNOWLEDGEMENTS …………………………………………………………………………………………………………. xiii
CHAPTER 1 INTRODUCTION AND STATEMENT OF PROBLEM …………………………………………………… 1
1.1 Introduction …………………………………………………………………………………………………………… 1
1.2 Coalbed methane reservoirs ………………………………………………………………………………….. 3
1.3 Artificial neural networks ……………………………………………………………………………………….. 6
1.3.1 Feed‐forward back‐propagation neural networks …………………………………. 8
1.4 Expert System development – Statement of the problem ……………………………………… 9
CHAPTER 2 DATA GENERATION AND NETWORK TRAINING STRATEGY …………………………………… 12
2.1 Description of PSU COALCOMP reservoir model …………………………………………………… 12
2.1.1 Langmuir isotherm for multi‐component sorption formulation ……………… 12
2.2 Factors affecting production from a coalbed methane reservoir ………………………….. 15
2.2.1 Permeability ………………………………………………………………………………………….. 16
2.2.2 Porosity …………………………………………………………………………………………………. 17
2.2.3 Coal thickness ………………………………………………………………………………………… 17
2.2.4 Initial reservoir conditions ……………………………………………………………………… 19
2.2.5 Sorption parameters ……………………………………………………………………………… 20
2.2.5 Production design parameters ………………………………………………………………. 22
2.3 Training‐data generation ……………………………………………………………………………………… 23
vi
2.4 Network structure development ………………………………………………………………………….. 29
CHAPTER 3 STAGES OF DEVELOPMENT …………………………………………………………………………………. 32
3.1 ANN with varying well design parameters ………………………...…………………………………. 32
3.2 ANN with varying reservoir properties ………………...………………………………………………. 50
3.3 Generalized model with varying reservoir properties & design parameters ………… 61
3.4 Vertical and horizontal well models ……………………………………………………………………… 70
3.5 Multilayered well schemes …………………………………………………………………………………… 86
CHAPTER 4 DEVELOPMENT OF THE INVERSE MODEL …………………………………………………………… 92
4.1 Performance indicators ……………………………………………………………………………………….. 92
4.2 Study of effect of skin on percentage recovery in CBM wells ………………………………. 94
4.2.1 Study of effect of skin on percentage recovery in vertical wells ……………. 94
4.2.2 Study of effect of skin on percentage recovery in horizontal wells ………… 95
4.3 Percentage recovery based predictions ……………………………………………………………….. 96
CHAPTER 5 RESULTS AND DISCUSSION ..………………………………………………………………………………. 102
5.1 Results from Model with varying well design parameters (isotropic system)…..…. 102
5.2 Results from Model with varying well design parameters (anisotropic system)….. 104
5.3 Results from Model with varying reservoir properties ……………………………………….. 105
5.4 Results from an intermediate model in the developmental stage ..…………………….. 107
5.5 Results from the generalized model………………………………………………………….………… 110
5.6 Discussion of results ..……………………………………………………….………………………………… 117
CHAPTER 6 CONCLUSIONS …………………………………………………………………………………………………… 122
CHAPTER 7 REFERENCES ……………………………………………………………………………………………………… 125
vii
APPENDIX A – Source code: Generalized model algorithm ………………………………………………….. 129
APPENDIX B – Feed forward Back‐propagation algorithm …………………………………………………… 136
APPENDIX C – Sample data used in training the generalized model ……………………………………. 141
viii
LIST OF FIGURES
Figure 1‐1: US Coalbed Methane Production, 1989 – 2003 ……………………………………………………… 4
Figure 1‐2: Schematic of methane flow dynamics in coal seams ……………………………………………… 4
Figure 1‐3: Plan view of coal seam showing cleat structure and matrix blocks ………………………… 5
Figure 1‐4: Typical structure of a simple ANN ………………………………………………………………………….. 7
Figure 1‐5: A feed‐forward back‐propagation neural network …………………………………………………. 8
Figure 2‐1 A typical Langmuir isotherm curve ………………………………………………………………………… 12
Figure 2‐2: Effect of initial water saturation on gas production ……………………………………………… 19
Figure 2‐3: Effect of Langmuir volume constant on sorption characteristics ………………………….. 19
Figure 2‐4: Effect of Langmuir pressure constant on sorption characteristics ………………………… 19
Figure 2‐5: Input structure showing possible combinations …………………………………………………… 23
Figure 2‐6: Histograms showing distribution of input variables ……………………………………………… 26
Figure 3‐1: Sample output from Model I with fixed reservoir properties using Structure 1 ….... 33
Figure 3‐2: Sample output from Model I with fixed reservoir properties using Structure 2 ……. 36
Figure 3‐3: Sample output from Model I with fixed reservoir properties using Structure 3 ……. 39
Figure 3‐4: Sample output from Model I with fixed reservoir properties (anisotropic) …………… 43
Figure 3‐5: Sample output from Model II with fixed production design parameters using
structure 1 …………………………………………………………………………………………………..…………….. 52
Figure 3‐6: Sample output from Model II with fixed production design parameters using
structure 1 …………………………………………………………………………………………………..…………….. 55
Figure 3‐7: Effect of sand‐face pressure on gas production in CBM wells ……………………………… 65
ix
Figure 3‐8: Effect of well stimulation on gas production in CBM wells …………………………………… 66
Figure 3‐9: Effect of drainage area on gas production in CBM wells ………………………………………. 67
Figure 3‐10: Network structure of the generalized model ……………………………………………………… 68
Figure 3‐11: Sample output from the generalized model (horizontal wells) ..…………………………. 69
Figure 3‐12: Sample output from the generalized model (vertical wells) ..……………………………… 77
Figure 3‐13: Effect of 3D discretization on production in CBM wells ……………………………………… 85
Figure 3‐14: Sample output from multilayered well scheme model ………………………………………. 86
Figure 4‐1: Sample output from inverse model (vertical wells) ……………………………………………… 98
Figure 4‐2: Sample output from inverse model (horizontal wells)………………………………………….100
Figure 5‐1: Sample production profile predictions from Model with varying well design
parameters (isotropic system) …………………………………………………………………………………. 102
Figure 5‐2 Sample production profile predictions from Model with varying well design
parameters (anisotropic system) …………………………………..…………………………………………. 104
Figure 5‐3 Sample production profile predictions from Model with varying reservoir properties
…………………………………………………………………………………………………………………………………. 105
Figure 5‐4 Sample production profile predictions from an intermediate model in the
developmental stage ……………………………………………………..………………………………………… 107
Figure 5‐5 Sample production profile predictions from the final generalized model
(vertical wells) ……………………………………………………………………………………….…………………. 110
Figure 5‐6 Sample production profile predictions from the final generalized model (horizontal
wells) …………………….………………………………………………………………………………….……………… 113
x
LIST OF TABLES
Table 1‐1: Differences between CBM and conventional gas reservoirs …………………………………… 6
Table 2‐1: Ranges of reservoir properties used for training ANN …………………………………………… 14
Table 2‐2: Ranges of production design parameters used for training ANN …………………………… 15
Table 2‐3: Thicknesses of US coal seams ………………………………………………………………………………… 17
Table 2‐4: Sorption constants for different coal seams ………………………………………………………….. 21
Table 3‐1: Properties of reservoir I used for training Model I ………………………………………………… 32
Table 3‐2: Properties of reservoir II used for training Model II ………………………………………………. 42
Table 3‐3: Production parameters used for Model II ……………………………………………………………… 50
Table 3‐4: Initial parameters of interest in development of generalized model ……………………… 61
Table 4‐1: Effect of well stimulation on percentage gas recovery in vertical wells ………………… 93
Table 4‐2: Effect of well stimulation on percentage gas recovery in horizontal wells ……………. 94
Table 4‐3: Effect of sand‐face pressure on percentage gas recovery in vertical wells ……………. 95
Table 4‐4: Effect of sand‐face pressure on percentage gas recovery in horizontal wells ……….. 96
Table 5‐1: Network structure used for Model I ……………………………………………………………………. 102
Table 5‐2: Network structure used for Model II …………………………………………………………………… 103
Table 5‐3: Network structure used for Model III ………………………………………………………………….. 105
Table 5‐4: Network structure used for Model IV ………………………………………………………………….. 106
Table 5‐5: Network structure used for Model V …………………………………………………………………… 109
xi
NOMENCLATURE
Roman:
a Exponential function coefficient
A Reservoir drainage area acres
b Exponential function coefficient
c Exponential function coefficient
d Exponential function coefficient
h Coal seam thickness Feet
hn Hidden neurons
k Fracture absolute permeability mD
krg Relative permeability to gas phase
krw Relative permeability to water phase
pi Initial reservoir pressure psia
pL Langmuir Pressure constant psia
pwf Sand‐face pressure psia
q Gas production flow rate SCF/day
Sgcrit Critical gas saturation %
Swi Initial water saturation %
Swirr Irreducible water saturation %
xii
T Temperature F
t Time Days
VE Gas content of coal SCF/ton
VL Langmuir volume constant SCF/ton
Greek:
τ Sorption time constant days
ρ Density of coal g/cc
Φ Porosity %
Abbreviations:
ANN Artificial neural network
BP Back propagation
CBM Coalbed Methane
CFF Cascaded Feed‐forward network
xiii
ACKNOWLEDGMENTS
I would like to express my deepest thankfulness and appreciation to my thesis advisor,
Dr. Turgay Ertekin, for his guidance and assistance throughout the development of this thesis
without which this work would never have been completed. Acknowledgments are also
extended to members of the thesis committee, Dr. Luis Ayala and Dr. Zuleima Karpyn for their
interest in serving as committee members and for their time and comments in evaluating this
work.
I also would like to thank doctoral students Emre Artun and Claudia Parada for their
help at times of need and the Pennsylvania State University for providing financial assistance
throughout the course of this study.
I am indebted to my mother, Jayalakshmi and to my father, Srinivasan, for being the
endless source of support and encouragement. I dedicate this work to them.
1
CHAPTER 1
INTRODUCTION AND STATEMENT OF THE PROBLEM
1.1 Introduction
During initial stages of exploitation of oil and gas reservoirs, there is always a good level
of uncertainty in determination of reservoir parameters. In such cases, there is a need to
develop a screening tool that can predict production performance from reservoirs for several
possible combinations of reservoir properties and design parameters. By training an artificial
neural network with several physically possible combinations of these parameters, it is possible
to come up with a simple and cost effective tool that can mimic production from coalbed
methane reservoirs for a certain desired time of production.
Coalbed methane reservoirs are unconventional natural gas reservoirs which are of
dual-porosity and dual-permeability nature. Numerical models that can simulate production
scenarios from CBM reservoirs are different from those of conventional gas reservoirs in the
sense that gas transportation takes place through three stages namely desorption, diffusion
and advection (Darcy flow). Reservoir properties that need to be fed to a simulator include
sorption capacity, sorption pressure and sorption time constant in addition to other parameters
usually given as inputs to any other reservoir simulator.
This work outlines the use of neuro-simulation techniques to come up with a screening
tool to estimate production performances of CBM reservoirs for a production period of ten
years. Most of the parameters that play a significant role in impacting gas production from a
2
CBM reservoir are included as inputs in the process of development of the neural network
model. The model predicts complete production profiles of gas and water, expected cumulative
gas and water productions, time to achieve maximum production and peak flow rate as
outputs.
Inputs to the model can be grouped under two broad categories. Reservoir properties
include reservoir fracture permeability (x, y and z directions), formation thickness, density,
porosity (of fractures), initial reservoir pressure, initial water saturation, sorption capacity of
coal, sorption pressure, sorption time constant, irreducible water saturation, critical gas
saturation and Corey’s correlation parameters for relative permeability curves. Design
parameters include unit acreage, bottom-hole pressure in well, skin (if there is any), orientation
of the well (horizontal or vertical), length of the well (if horizontal) and shape of the well
drainage template. The final model has been categorized into two, one for horizontal wells and
a second one that works for vertical wells.
An inverse protocol to optimize production strategies for a certain CBM reservoir and
for a certain expected production performance has also been developed. This expert system
predicts optimum production parameters for a certain targeted percentage recovery from a
CBM reservoir whose properties are known within acceptable ranges of values. Numerical
models lack the capability to optimize these design parameters and require a trial and error
procedure to achieve the same. The two models together serve as excellent tools to obtain
physically valid optimum performance indicators and give an opportunity to the user to identify
the possibility of investments on production from potential CBM reservoirs.
3
Neuro-simulation methodologies applied in this work involve coupling together hard-
computing and soft-computing procedures. MATLAB programming language comes with an
Artificial Neural Network tool box containing in-built transfer functions, learning functions,
performance functions, weight and biases initialization functions and several other tools that
can be controlled using user-written codes. Data samples required to train, validate and test
the tool box are obtained using PSU COALCOMP, a three dimensional compositional CBM
reservoir simulator developed by Manik et al in 2002.
Starting with a simple model, variations in reservoir properties and design parameters
are slowly affected with gradually increasing complexity. A step by step procedure of
development of the model has been explained with assertions on technical difficulties in each
step. Due to the existing high degree of nonlinearities in the relationships between inputs and
outputs, several modifications were required to institute a sound combination of inputs that
can improve predictions significantly. With an orderly and improvised procedure, a robust
expert system that can be used in optimizing CBM production applications has been developed
and tested successfully.
1.2 Coalbed methane reservoirs
Coalbed methane reservoirs are unconventional resources of natural gas in which the source
rock and reservoir rock are the same. By the end of 2003, CBM constituted nearly 10% (1600
BCF) of the total natural gas production in the US (EIA, 2003) as indicated in Figure 1-1 below.
4
Gas production profiles and gas transport mechanisms in CBM reservoirs are different
from that of conventional reservoirs, because most of the gas is adsorbed into the coal matrix
and the volume of gas in free phase is usually very negligible. They are naturally fractured
reservoirs and most of the fracture spacing is usually filled with water in the beginning. There is
a need to dewater the system and bring down the pressure in the reservoir to facilitate gas
desorption. Hence gas transport takes place in three stages including desorption, diffusion and
advection (Darcy flow) (King, G. R. et al, 1983) as shown in Figure 1-2 below:
Figure 1-1: U.S. Coalbed Methane Production, 1989-2003 (Source: EIA)
Figure 1-2: Schematic of Methane flow dynamics in Coal seams (Remner, D., et al, 1986)
5
As water is removed from the system, pressure in the reservoir decreases. When
irreducible water saturation is reached, water production stops. Gas adsorbed on to the coal
matrix starts desorbing from the matrix to the micro pores. This is followed by flow of gas from
the micro pores to the macro pores and is characterized by diffusion. The natural fractures act
as channels for the gas to flow from coal to the surface. This flow is characterized by advection
(Darcy flow). Fractures in a coalbed reservoir are continuous in the horizontal direction and
discontinuous in the vertical direction. As a result, the permeability is usually heterogeneous in
nature. The continuous cleats are called the face cleats and the discontinuous ones are called
the butt cleats (King, G.R. et al, 1983). A typical structure of the coal matrix is illustrated in
Figure 1-3 below:
There are many factors that make CBM reservoirs unconventional. Table 1-1 lists the
differences in properties and characteristics between Coalbed and conventional natural gas
Figure 1-3: Plan view of coal seam showing cleat structures and matrix blocks (King, G.R. et al, 1983)
6
reservoirs. Gas in coalbeds is produced by chemical and physical processes during the last stage
in the development of coal where organic material is converted to methane.
S. No. CBM Conventional natural gas reservoirs
1 Source rock and reservoir rock are the
same
Gas flows from source rock to reservoir
rock towards the surface from which gas
is taken out
2 Gas flow is characterized by
desorption, diffusion and Darcy flow
Gas flow is characterized by Darcy flow
3 These reservoirs are naturally
fractured and fractures act as channels
for the gas to flow
These are not naturally fractured and
flow takes place through pores of
reservoir rock
4 Most of the gas is in adsorbed phase Most of the gas exists in free phase
5 Initial water saturation is usually very
high
Initial water saturation is usually low and
gas shows a production decline right
from the beginning
1.3 Artificial Neural Networks
Artificial neural networks are computational models that are developed on the principle
of functioning of the human biological nervous system. The capabilities and robustness of
artificial neural networks depend on its learning abilities and can applied to pattern recognition
problems, optimization techniques etc.
Table 1-1: Differences between CBM and conventional natural gas reservoirs
7
Artificial neural networks work on the hypothesis that intelligence is achieved by means
of interaction of large numbers of simple processing units called nodes (Jeirani, Z. et al 2005). A
multilayered neural network consists of three main parts - the input layer, output layer and the
hidden layer(s). The number of hidden layers and the number of nodes in each layer depends
on the problem at hand. If the number of nodes in the hidden layer(s) is too small than the
optimum one, the network may fail to converge to the minimum. On the other hand, if the
number of nodes is much higher when compared to the optimum one, over fitting may occur
that results in poor generalization capabilities (Jeirani, Z. et al 2005). Mathematically, in an
artificial neural network, a set of weights are found that generates outputs when a net is
presented within an input. This process is called learning and by altering the weight of links
between nodes, the learning abilities of such neural networks are improved (Mohaghegh et al.,
1994).
The most important characteristic of neural networks is their adaptability. By exposing
them to sufficient examples they can learn by adjusting the links and connections between
neurons. They can thus be programmed to train, store and recognize patterns to solve
optimization problems (Mohaghegh et al., 1996). Database that needs to be fed to a neural
network is usually categorized into three different groups – training, testing and validation sets.
Training sets are used to train the network by use of suitable transfer functions, learning
functions, performance functions and several other parameters. The testing data sets are used
to determine the ability of the network to predict outputs for inputs that the network has never
seen before. The validation data sets are similar to the testing data sets and are used to
8
establish the accuracy and reliability of the neural network. Having said all that, a typical
structure of a neural network looks like the one in Figure 1-4 below.
1.3.1 Feedforward Back propagation neural networks
Artificial neural networks can be broadly classified into two groups – Supervised
networks and Unsupervised networks. Unsupervised networks, also known as self organizing
networks are usually provided with input data for training and they learn without being shown
with the correct output (Aminian, K. et al 2005). One such example is the Kohonen network.
However, most applications in Petroleum engineering use supervised networks in which
pattern-identification and decision making abilities are acquired based on the patterns of inputs
and outputs they have learned. The most common of these is the back propagation neural
networks. In a feed forward neural network, flow of information is always from one layer to
another in the forward direction and no backward flow is allowed. The neurons in a layer get
input from the previous layer and feed their output to the next layer. Thus in feedforward
Figure 1-4: Typical structure of a simple ANN
9
networks, connections to the neurons in the same layer or previous layers are not permitted
(Yilmaz, S. et al 2001).
In a Back propagation neural network, the error between the network output and the
desired output is propagated through the network. Depending on the magnitude of this error,
the weights on the connections are adjusted and this process continues until the network
output reaches an acceptable value (Jeirani, Z. et al 2005). The ANN acquires learning abilities
through this training process and is then ready to simulate other outputs for inputs it has never
seen before (Bean, M. et al 2000). A simple structure of a feed-forward back-propagation
neural network is shown in Figure 1-5 below:
1.4 Expert System development – Statement of the problem
Reservoir simulators are effectively used in predicting production performances of oil
and gas reservoirs with a good level of accuracy. When a high level of uncertainty exist in the
knowledge of reservoir properties and production parameters before a reservoir enters active
exploration, expert systems can be effective as a screening tool by mimicking the performance
of a reservoir simulator at a lower cost, reduced personnel and machine time. An expert system
Figure 1-5: A feed forward Back propagation ANN (Saemi, M. et al 2007)
10
also known as a knowledge based system consists of a knowledge base and a set of algorithms
or rules that infer new facts from knowledge and incoming data. An expert system uses the
knowledge base of human expertise and the degree of problem solving ability of the expert
system depends on the quality of data provided and the rules obtained from the expert system
(Gharbi, R.B.C., et al 2005).
An expert system essentially consists of three main parts: A knowledge base, an
inference engine and a user interface. The knowledge base is the data base generated using
human expertise and usually involves gathering of data and putting them in a form easily
recognized by a computer. The expert system acquires an ability to develop answers by running
the knowledge base in an inference engine which is usually a computer program that processes
results from the rules and facts in the knowledge base(Gharbi, R.B.C., et al 2005).. The user
interface is the part that establishes communication between the user and the computer
program.
Expert systems are recently being used in a large of number of reservoir engineering
applications. Gharbi, R.B.C., et al uses expert systems to identify optimum conditions at current
oil prices to determine whether a certain Enhanced Oil Recovery technique is feasible or not.
Aminian, K., et al uses artificial neural networks to develop accurate reservoir descriptions by
utilizing available geophysical well log data and limited core data. Hari, D., et al uses neuro
simulation techniques to structure field development schemes in conjunction with numerical
reservoir simulation. Garrouch, A.A., et al uses expert system development strategies to screen
wells that could be drilled underbalanced and to aid in the preliminary selection of appropriate
11
underbalanced drilling fluids for a given range of well bore and reservoir conditions. Ertekin, T.,
et al uses a neural network approach to develop specialized inverse solution techniques for the
analysis of pressure transient data for the characterization of the transport and sorption
properties of coal seams.
The proposed expert system has been trained with the help of an extensive database
and has the capability of providing gas and water production profiles for a period of about ten
years for a given coalbed methane reservoir.
12
CHAPTER 2
DATA GENERATION AND NETWORK TRAINING STRATEGY
2.1 Description of PSU COALCOMP reservoir model
The PSU COALCOMP is a three dimensional, two phase, dual porosity, fully implicit,
compositional coalbed methane reservoir simulator developed by Manik, J., et al at the
Pennsylvania State University. The model couples together multi-component gas sorption
formulation and compositional fluid flow formulation in coalbed reservoirs. It uses the
Langmuir sorption constants and the molar solution Gas-Oil ratio to determine the equilibrium
ratios (K values). These values along with the free gas concentration are then used to determine
the mole fraction of the adsorbed gas phase and the adsorption capacity.
2.1.1 Langmuir Isotherm for multi-component sorption formulation
The most commonly used sorption isotherm equation is the Langmuir isotherm given by:
Sv and Sp are the Langmuir volume constants and the Langmuir pressure constants respectively. The
Langmuir volume constant is defined as the maximum capacity of the coal to adsorb gas. The Langmuir
pressure constant is defined as the pressure at which the gas content of the coal is equal to half the
Langmuir volume constant. A typical Langmuir isotherm looks like the one shown in Figure 2-1. As seen
from the curve, under conditions of equilibrium, the sorption capacity of coal increases with pressure
and reaches a certain maximum value. This is the Langmuir volume constant. From equation (1), when
Sp = p, Ve = Sv/2 and hence the definition of the Langmuir pressure constant is seen.
13
Applying the desorption concept to production of methane in a CBM reservoir,
assuming initial conditions as shown in Figure 2-1 (Initial pressure = 1600 psia, Initial gas
content = 300 SCF/ton) there will be no gas production in the reservoir until pressure in the
system reaches equilibrium. This time is characterized by production of water from the fracture
spacing. Once the critical desorption pressure is reached, gas begins to flow to the well.
Estimating the adsorption capacity of multi-component gases is more difficult than single
component studies, because multi-component sorption is not only a function of pressure and
temperature, but also a function of the gas composition.
The equilibrium pressure at which gas begins to flow is called the critical desorption
pressure. The PSU COALCOMP model uses the extended Langmuir isotherm equation which
does not take into account thermodynamic equilibrium between gas components in free and
adsorbed phases (Manik, J., et al 2002). The model calculates the partial adsorption capacity of
Figure 2-1: A typical Langmuir isotherm curve
14
gas components based on the partial pressures of gas components in the free gas mixture. In
the development of the compositional fluid flow model, water is assumed to be a single-
component phase and the gas phase is represented by a multi component mixture. The
sorption rate of the gas in the system is calculated using the non-equilibrium sorption rate
equation (2) proposed by King et al.
Where, Vei and Vai are the adsorption capacity and the amount of gas adsorbed for component i
respectively. The sorption time constant τ is related to the time lag due to the diffusion process
going on in the micro pores of the coal matrix (Manik, J., et al 2002).
As seen from the discussions above, the Langmuir pressure constant, Langmuir volume
constant and the sorption time constant are important parameters that control the gas
production rate and cumulative gas production. The amount of gas that can be produced from
a potential reservoir increases with increase in gas content (Sorption capacity). The sorption
time constant is a relative measure of how fast gas can be produced from the reservoir. The
higher the time constant, longer it takes to bring out the gas from the reservoir. The effect of
each of these parameters will be discussed in the following sections.
15
2.2 Factors affecting production from a Coalbed reservoir
It is necessary to prepare a list of parameters that significantly impact production in a
CBM reservoir. This section discusses the inputs that will be used to train the neural network
model and the effect each of these parameters on gas production from the reservoir. The
inputs have been classified into two categories – reservoir properties and production
parameters. The ranges of each of these inputs for which the neural network is capable of
obtaining outputs in its predictive mode are listed in Table 2-1 and 2-2.
S. No Reservoir Property Minimum value Maximum value
1 Permeability (x – direction) (in) 0.1 1000
2 Anisotropic ratio (kx : ky) 1 17
3 Thickness (feet) 5 40
4 Porosity (%) 1 10
5 Coal Density (g/cc) 1.2 2
6 Initial reservoir pressure (psia) 100 3500
7 Initial water saturation (%) 30 100
8 Sorption volume constant 100 800
9 Sorption pressure constant (psia) 15 2000
10 Sorption time constant (days) 15 900
11 Irreducible water saturation (%) 5 30
12 Critical gas saturation (%) 0 5
Table 2-1: Ranges of reservoir properties used for ANN
16
S. No Production design parameters Minimum value Maximum value
1 Sand face pressure (psia) 14.7 Pinitial/2
2 Skin -4 5
3 Length of well (if horizontal)
(feet)
250 1000
4 Reservoir acreage (acres) 20 100
2.2.1 Permeability
As discussed in the previous sections, CBM reservoirs are naturally fractured and the
coal matrix is characterized by continuous cleats in the x-direction and discontinuous cleats in
the y-direction. Hence, CBM reservoirs are usually heterogeneous in permeability. Based on
scenarios that have been studied so far, the ratio of the permeabilities may vary anywhere
between 1 and 17.
The permeability of a coal seam is obviously an important parameter in determining the
productivity of a coal seam. In CBM reservoirs, determination of permeability is complicated by
two-phase flow in the fractures. Hence, when well testing procedures are conducted on such
5 Well orientation Vertical/Horizontal
6 Reservoir drainage pattern Square/rectangular
Table 2-2: Ranges of production design parameters used for training ANN
Other Design parameters
17
reservoirs, either a series of water pump-in and fall-off tests are conducted upon completing
the well, in order to ensure a single phase system or conventional pressure buildup tests are
conducted and the two phase flow is accounted for, by use of pseudo pressure or multi-phase
potential analysis methods (Jochen, V., A., et al 1994). The matrix permeability is usually
negligible and the cleat spacing acts as the major channels for the gas to flow. The fracture
permeability is related to the cleat spacing which in turn depends on the coal rank, mineral
content, petro graphic composition and tectonic history (Levine, 1993).
2.2.2 Porosity
CBM reservoirs are dual porosity systems and are characterized by matrix porosity and
fracture porosity. The porosity of coal seams depends on the rank of coal being mined. The
micropore system is estimated to have pore diameters less than 2 nm. The macropore system is
established by the fracture network designated by the cleat system. The coal porosities usually
contribute significantly to swelling and shrinkage of coal during desorption processes.
When compared to conventional oil reservoirs, porosity of CBM reservoirs is low. In
literature, some of the porosities of commercially important basins that have been reported
include an estimation of 2.8% in the Oak Grove basin and 2.4% in the San Juan Basin. In this
study, the maximum and minimum values used to generate data samples for training are 10%
and 1% respectively.
2.2.3 Coal thickness
Thickness of coal seam is directly related to the total gas content. Table 2-3 lists the
18
Coalbed Name Thickness (feet)
Average Low High 1699 Wyodak 65.08 7.50 75.00
0036 Pittsburgh 6.00 1.67 9.00
0489 No. 9 5.17 2.00 6.42
0111 Coalburg 6.25 0.75 14.08
1697 Canyon 52.67 34.58 67.00
1569 Beulah-Zap 15.25 12.00 17.50
0151 Upper Elkhorn No. 3 4.25 1.00 12.50
0484 Herrin (Illinois No. 6) 5.92 3.83 8.00
1696 Anderson-Dietz 1-Dietz 2 73.83 55.00 80.00
0084 Lower Kittanning 4.08 1.00 7.83
1787 Roland 43.00 31.83 55.00
1808 Rosebud 21.83 18.00 23.00
0135 Hazard No. 4 4.92 1.00 11.50
0168 Lower Elkhorn 4.33 0.92 7.00
0103 Stockton-Lewiston 5.42 1.00 8.25
1753 Somerset B 14.50 8.50 20.00
1488 Fruitland No. 8 13.92 10.50 16.25
0071 Upper Freeport 4.50 1.67 7.00
0121 Winifrede 5.00 0.83 10.00
0344 Pocahontas No. 3 4.83 2.50 5.67
0176 Eagle 3.75 0.92 9.00
0480 No. 7 3.58 2.00 6.00
0280 Blue Creek 4.58 0.67 16.67
1750 Wadge 8.33 8.33 10.00
0080 Middle Kittanning 4.42 0.75 8.00
Major Coalbeds Average 36.58 0.67 80.00
U.S. Total 28.92 0.33 80
Table 2-3: Thicknesses of US coal seams (Energy Information Administration, 2006)
19
thicknesses of different coal seams obtained from the Energy Information Administration
annual Coal report (EIA, 2006). For the purpose of this study the minimum and maximum values
of thickness used to generate training data sets are 5 feet and 40 feet, respectively.
2.2.4 Initial reservoir conditions
The initial reservoir pressure is related to the maximum time of useful production from
the reservoir. Since the production flow rate is proportional to the difference between the
reservoir pressure and the bottom hole pressure and since all the production scenarios studied
in this work are at conditions of constant bottom hole pressure, the higher the initial reservoir
pressure, the higher is the gas production flow rate, especially during the initial flowing period.
The initial water saturation plays in important role in deciding on the production
economics. Most of the coal seams are usually filled with water in the fracture spacing and the
time it takes to dewater the system, before gas can start flowing is quite critical. The
percentage water saturation also affects the shape of the gas production profile curves as
indicated in Figure 2-2. For any two reservoirs with identical properties and different initial
water saturations, gas production shows a decline from the very beginning, if the initial water
saturation is in low ranges. However, if water saturation is high, gas production increases in the
beginning, reaches a peak and starts declining afterwards. For the purpose of this study, the
maximum and minimum values used for initial reservoir pressure are 3500 psia and 100 psia
respectively. For initial water saturation, the maximum and minimum values are 100% and 30%,
respectively.
20
2.2.5 Sorption parameters
The Langmuir sorption constant gives a measure of the amount of gas the coal seam can
hold. The height of the sorption curve increases as the Sorption capacity increases. This is
illustrated in Figure 2-3.
0
100
200
300
400
500
600
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Gas
Sto
rage
Cap
acit
y (S
CF/t
on)
Pressure (psia)
VL = 600 ; PL = 250
VL = 500 ; PL = 250
Figure 2-2: Effect of initial water saturation on gas production
Figure 2-3: Effect of Langmuir volume constant on sorption characteristics
Methane
Vol
ume
Time
Initial water saturation = 100 %
Initial water saturation = 30 %
21
The effect of sorption pressure constant on the sorption characteristics is opposite to that of
the volume constant and is illustrated in Figure 2-4. These parameters together will decide the
shape of the desorption curve and thus based on the initial reservoir conditions, different
combinations of the two constants lead to different production scenarios. A reservoir with high
potential for production should have a high value for the Langmuir volume constant and a
critical desorption pressure that is close the initial reservoir pressure.
The sorption time constant regulates the rate at which gas is transferred from the micro
pores to the macropores. The higher the value of time constant, the longer is the time taken for
the gas to desorb. The time constants of some of the major coal seams in the US are displayed
in Table 2-4.
0
50
100
150
200
250
300
350
400
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Gas
Sto
rage
Cap
acit
y (S
CF/t
on)
Pressure (psia)
VL = 400; PL = 200
VL = 400 ; PL = 250
Figure 2-4: Effect of Langmuir pressure constant on sorption characteristics
22
Coal Sorption time constant (days)
Fort Union <1
Fruitland <1
Pennsylvanian Age >80
Northern Appalachian 100 – 900
Central Appalachian 1 – 3
Warrior 3 - 5
2.2.6 Production Design Parameters
Apart from the reservoir properties that cannot be controlled by the producer, there
are certain engineering parameters that are under human control and can be suitably altered to
enhance production. Some of these parameters that are considered in this study include
sandface pressure, stimulation (skin), Well acreage, reservoir drainage pattern, length of the
well and well orientation.
Decisions on the sandface pressure depend on several factors such as the initial
reservoir pressure, expected rate of production from the reservoir and gas content of the coal
seam. The well may have been stimulated to improve communication between the well bore
and the fracture network. A positive skin factor indicates damage in the well due to factors such
as sand accumulation. Most of the initial efforts in this work have been conducted at conditions
of constant well spacing and well orientation as the level of nonlinearities affected on the
network due to their variations were observed to be highly significant. The ranges of variation
of these engineering parameters are listed in Table 2-2.
Table 2-4: Sorption time constants for different coal seams (Rogers, 1994)
23
2.3 Training-data generation
As discussed in the previous section, to develop the most generalized model possible,
we have a total of 18 variables (inputs). It was thought that starting with a complex system right
from the beginning may not address all the problems related to generalization capabilities and
improvements in robustness of the network. Numerical simulations should be run for each
network in the developmental stages and the number of data samples required for training
each network vary with increasing complexities. The outputs can be shown to the network in
various forms such as:
1. The production profile can be fit to an appropriate function of time and the coefficients
can be used to predict the outputs indirectly.
2. Production flow rates at different time periods can be extracted from the simulation
runs and fed to the network to predict the outputs directly.
The problem with employing the first method is that, the shape of the production curve
varies depending on the water saturation in the coal seam. It may not be possible to represent
the curve using a unique function in such cases. When using the second method, we see an
increase in complexity of the network due to relatively large number of flow rates that need to
be shown as outputs in order to predict a smooth curve. Figure 2-5 shows a simple structure of
the inputs to the network. Let us assume that the simplest (generalized) model covers the input
variables in their outer ranges only. It is then possible to come up with a total of 218
combinations of these parameters that can generate different simulation runs (production
scenarios). Obviously this is not what we are trying to achieve.
24
Kx
Porosity
Kx:Ky
Thickness
Pinitial
Swinitial
PL
VL
τ
Swirr
Sgcritical
Density
Pwf
Skin
Well orientation
Drainage pattern
Well length
Acreage
1000
10
17
40
3500
100
2000
800
900
25
10
2
Pinitial/2
5
Horizontal
Rectangle
Half the total length
100
0.1
1
1
5
100
30
15
100
15
5
0
1.2
14.7
-4
Vertical
Square
88
20
Figure 2-5: Input structure showing possible combinations of the input variables
25
Our aim is to develop simulation runs using some of the physically possible
combinations that can help define the problem effectively. By physically possible combinations,
we mean that all the input combinations cannot exist practically and a sound knowledge of the
importance of each of these variables is required to decide whether a certain combination will
lead to a scenario corresponding to potential recovery or not. Existing expert knowledge on
production history from CBM reservoirs around the globe will help to determine dependence of
one variable on the other. Similarly, to produce from a reservoir at a bottom-hole pressure
close to its initial pressure does not make sense. Based on such factors, different input
combinations can be arrived at, thus narrowing down the number of simulation runs to what is
just required.
From Figure 2-5, it is seen that the model may be required to encounter any physically
possible combination of the 18 variables between ranges as shown. A generalized model should
have necessary extrapolation capabilities that can predict results for any input vector in space
that is not part of the training data. One way of achieving this is to prepare combinations of
these variables that cover only their extremes (maximum and minimum values). In this way, we
make sure that the entire range is being covered effectively. One can then decide on the
remaining combinations based on factors such as number of samples available, most commonly
encountered combinations of parameters in actual-field-exploitation and average values of
variables in their respective ranges.
The number of simulation runs required to train a network is not a fixed number and
there are no well defined rules to describe these numbers. Hence, whenever an Artificial Neural
26
network model is developed, we start with a relatively small number of training samples and
increase this number based on improvements in predictions. Uniform distribution of these
input variables is also quite important. For example, training a network that has 80% of its
permeabilities less than 10 milliDarcies and the remaining between 10 and 1000 milliDarcies
may not give the model sufficient predictive capabilities. Hence, before training a network,
histograms of inputs are constructed to look into distribution patterns in order to make sure
that all the inputs in all the ranges were given a fair chance.
At the same time, we should also think about most commonly encountered values of
these parameters. For example, most of the coal seams are usually 100% saturated with water
and very few seams are filled with less than 90% water in the fracture spacing. It may be a good
idea to distribute such a variable based on seams with greater than 90% initial water saturation
and those with less than the former. All such complexities have been appropriately addressed
in this study with reference to each and every variable in the system. Figure 2-6 shows sample
histograms of distribution of inputs used in this model within their ranges as seen in tables 2-1
and 2-2.
27
Figure 2-6: Histograms showing distribution of input variables
28
Figure 2-6: Histograms showing distribution of input variables (continued)
29
2.4 Network Structure development
Once the simulation runs are completed, efficient predictive and generalizing abilities
depend on a number of factors. Again, there are no defined rules that can provide a certain
level of accuracy in predictions. There are a number of factors that the user can play with, in
modifying the performance of the neural network model. Some of these factors are discussed
in detail in this section.
Figure 2-6: Histograms showing distribution of input variables (continued)
30
The network architecture includes the type of network being used, number of hidden
layers, number of hidden neurons, transfer functions between layers of the network, weights
and biases initialization functions, performance functions, training functions and the stopping
criteria. Playing with all these parameters lead to different predictions and for the same
configuration, the results from different trainings may be different.
Feed-forward back-propagation networks are the most commonly used types of
networks used for generalization problems in reservoir engineering applications. A detailed
explanation of how these networks work is given in Appendix B. As the name indicates, feed-
forward back-propagation networks calculate the outputs in the forward direction and
propagate the error gradients in the backward direction. The number of hidden layers and
number of neurons in each of these hidden layers are crucial factors in training a network and
increasing the number of hidden layers usually does not improve the performance to a large
extent. In this study, more emphasis is laid on altering the number of hidden neurons with
structures containing 3 or less hidden layers. Coming up with a final architecture involves a
large number of trial and error procedures working on these parameters and finding the one
that predicts the best. Usually, to start with, a rough guess on the total number of hidden
neurons is given by
Number of hidden neurons = Total number of data samples + (Numinputs + Numoutputs)/2.
Transfer functions are functions on which the summation of products of weights and
inputs from the previous layer are applied to yield an output for the current layer.
The three most commonly used transfer functions in neural network applications are
31
i. Tansig – The tangent sigmoidal function
F(x) = [2 / (1 + e-2x)] - 1
ii. Logsig – The logarithmic sigmoidal function
F(x) = [1 / (1 + e-x)]
iii. Purelin – The pure linear function
F(x) = x
The main advantage of using these functions is that, the derivative of the each of these
functions can be expressed in terms of the function itself and thus makes it easier to calculate
the error gradients in the backward direction. In case of the pure linear function, the derivative
is equal to 1 and makes it even simpler.
Another very important parameter that controls the rate of convergence and ability of
the network to generalize is the training function. MATLAB* offers a variety of features on these
aspects and provides a list of functions that can be used for training. Different training functions
have different applications based on the type of problem under study. Most of the models in
this study use the trainscg (Scaled Conjugate Gradient Algorithm) function for training purposes
and have been proven very effective when compared to other functions available for use.
* MATLAB® is a high-level language and interactive environment that enables one to perform computationally
intensive tasks faster than with traditional programming languages (http://www.mathworks.com/).
32
CHAPTER 3
STAGES OF DEVELOPMENT
As mentioned in the previous chapter, several models were developed in this study
before finalizing a generalized model. Two main intermediate models apart from the
generalized model, whose results are shown in this chapter include,
1. A model with varying well design parameters (and fixed reservoir properties)
2. A model with varying reservoir properties (and fixed production parameters)
There are two important issues that need to be examined carefully in structuring a
network. The first problem is called undertraining which usually occurs, when at the end of the
training session, the network acquires poor pattern recognition capabilities. The second
problem is called overtraining which is usually seen in cases when the network begins to
memorize data. Using a relatively small number of hidden neurons may lead to undertraining.
On the other hand, if the number of hidden neurons is too high, the network starts memorizing
data. This is usually characterized by an increase in the testing error during training while the
training error keeps decreasing. The following sections discuss each of the models mentioned
above and the results from different network structures explaining how a satisfactory model is
achieved.
3.1 ANN with varying well design parameters
In this model (Model I), all the predictions are confined to a certain reservoir with fixed
properties and variations in well design parameters only. Two different cases were studied: A
33
system with isotropic permeability and another system with anisotropic permeability. As
mentioned before, two different ways of predicting the production profiles are also studied. For
the first reservoir, simulation runs are made with a total of 80 different combinations of
production parameters. To start with, the very first model was made to predict only five
outputs – Cumulative gas production at the end of 20 years, Cumulative water production at
the end of 20 years, maximum production flow rate achieved, time to reach peak flow rate and
the abandonment time (assuming an abandonment flow rate of 50 MSCF).
All the outputs were obtained for the same reservoir whose properties are listed in
Table 3-1. The first case is an isotropic system and the structure of the network (Structure 1)
composed of one hidden layer containing 10 neurons, using a tansigmoidal transfer function
applied on the hidden layer and a pure linear function on the output layer. A feed forward
network with the scaled conjugate gradient training function is used. A sample output obtained
from training the above network is shown in Figure 3-1.
Reservoir Property Value
Initial reservoir pressure (psia) 2000
Initial water saturation (%) 98
Reservoir thickness (feet) 15
Uniform top depth (feet) 1500
Isotropic reservoir permeability (mD) 25
Porosity (%) 3
Coal Density (g/cc) 1.45
Reservoir temperature (F) 100
Initial free gas concentration (%) 100
Table 3-1: Properties of reservoir I used for training model I
34
Sorption capacity (lb mole gas/lb coal) 0.00185
Sorption pressure (psia) 200
Sorption time constant (seconds) 40,000,000
Irreducible water saturation (%) 25
Critical gas saturation (%) 0
krw at Sw = 1 – Sgcritical 1
krg at Sg = 1 – Swirr 0.8
Table 3-1: Properties of reservoir I used for training model I (continued)
Figure 3-1a: Sample output from Model I with fixed reservoir properties using Structure 1
35
As can be seen from the results, the network does not have a complex architecture and
predictions are close to that achieved by the numerical model. As the next step, the capability
of the network was improved further by predicting the production profile along with the
outputs seen above. To achieve this, the production profiles (flow rates) from each of the
reservoirs were fit to an exponential function of time given by:
Figure 3-1-b: Sample output from Model I with fixed reservoir properties using Structure 1
36
The coefficients in each case were fed along with the other outputs and trained with the same
configuration as above except for the number of hidden neurons which was increased to 12
(Structure 2). It should be noted that these studies were conducted with production from
vertical wells in all the cases. As will be seen near the end of this chapter, the final generalized
model was categorized into two: one which works for horizontal wells and another which works
for vertical wells. This is due to the absence of impact of z direction permeability on vertical
wells and the absence of y direction permeability on horizontal wells in two dimensional
representations. A sample output along with function coefficients and some production profiles
predictions is shown in Figure 3-2.
The results indicate that, although most of the predictions are fine, there is room for
improvement in calculation of the the coefficients a and c. Also, accuracy of predictions of
Cumulative gas and water productions can be improved to a certain extent. It can be seen that
the values of gas cumulative production and the coefficients a and c are very high when
compared to the rest of the variables. To see an improvement in performance, 50 more
simulation runs were prepared. The cumulative gas production was shown to the network in
units of MMSCF while the coefficients were divided by a factor of 100 to bring down the ranges
of values in the outputs. The network configuration was kept the same and was trained
successfully (Structure 3). A sample output from this network is shown in Figure 3-3.
In this model, the inputs and outputs are always distributed normally between -1 and 1
in order to bring down the ranges of values for ease of training. There are so many other
37
network parameters that may have a significant impact on the results. In MATLAB, the training,
validation and testing errors are predicted simultaneously so that the user will be able to keep
track of the network’s progress. At the end of each epoch, the weights and biases are used to
predict outputs for the testing samples and the validation samples. It is necessary that the
Figure 3-2a: Sample output from Model I with fixed reservoir properties using Structure 2
38
testing and validation errors should not increase at any point of time, although the rate of
minimization of errors may not be the same as that of the training data sets.
In Figure 3-2, although most of the predictions for the coefficients a and c are close
to that of the actual values, some of them are significantly different from the expected values.
The new datasets being shown to the network consisted of many reservoirs with high acreage
and low sand face pressure as higher values for the coefficients correspond to higher
production flow rates. In neural network applications, when generalization capabilities do not
improve as expected, additional inputs and outputs in the form of functional links are usually
Figure 3-2b: Sample output from Model I with fixed reservoir properties using Structure 2
39
provided to enable better understanding of non linear relationships between the inputs and
outputs.
In this case, due to relatively simple structure of the network, use of functional links was
not necessary. However, it will be seen in the next model that use of functional links is a must,
as the complexity of the problem increases further. In the network with structure 3, the inputs
to the network are the bottom-hole pressure, skin factor, well drainage pattern and the
Figure 3-2c: Sample output from Model I with fixed reservoir properties using Structure 2
40
reservoir area. Length of the well does not come into picture as all the simulation runs were
made with vertical wells.
Figure 3-3a: Sample output from Model I with fixed reservoir properties using Structure 3
41
It can be seen from Figure 3-3 that the production profiles from Structure 3 match the
actual results more closely when compared to Structure 2. In most of the neural network
applications, before one could decide on increasing the number of data samples, different
configurations are usually applied to identify any possibilities for improvements in predictions.
Structure 2 was started with just one hidden layer and the number of neurons
was roughly chosen based on the number of inputs, number of outputs and number of data
samples available. Also, one needs to make sure that enough training data are available so that
the weights do not become applicable only to certain set of data samples that do not address
Figure 3-3b: Sample output from Model I with fixed reservoir properties using Structure 3
42
all the commonalities usually seen in CBM reservoirs. In this case, of the 80 data samples that
were available, 50 were used for training, 20 for validation and 10 for testing purposes.
Histograms of the inputs in the data samples are constructed to make sure that all ranges of
inputs are encountered in all the three categories.
Initially, a logarithmic transfer function was applied on the hidden layer. Although
predictions were reasonable, calculation of abandonment time in some of the cases were
negative. Use of hidden neurons greater than 16 only brought down the accuracy. As part of
Figure 3-3c: Sample output from Model I with fixed reservoir properties using Structure 3
43
the stopping criteria, the maximum number of epochs was increased to 2000 and the number
of epochs for which an increase in validation error is acceptable was set to 200 when the
default values did not seem to work. When a tansigmoidal transfer function was applied, the
network began to perform better for the same configuration.
In Structure 3, of the 130 samples that were available, 80 were used for training, 30 for
validation and 20 for testing purposes. When this network produced acceptable results, it was
decided to apply the same configuration to a different reservoir which had similar properties as
the previous one but anisotropic in permeability. These properties are listed in Table 3-2 below:
Reservoir Property Value
Initial reservoir pressure (psia) 2000
Initial water saturation (%) 98
Reservoir thickness (feet) 30
Uniform top depth (feet) 700
X- direction permeability (mD) 5
Y – direction permeability(mD) 1
Porosity (%) 2.5
Coal Density (g/cc) 1.35
Reservoir temperature (F) 100
Initial free gas concentration (%) 100
Sorption capacity (lb mole gas/lb coal) 0.000975
Sorption pressure (psia) 180
Sorption time constant (seconds) 40000000
Irreducible water saturation (%) 20
Critical gas saturation (%) 0
krw at Sw = 1 – Sgcritical 1
krg at Sg = 1 – Swirr 0.8
Table 3-2: Properties of reservoir II used for training model I
44
Unfortunately, in this case, the method of fitting the curves to a function and determining the
coefficients did not work. The second method involving determining gas flow rates at different
time periods and feeding them as outputs was tried. Although this increases the size of the
output matrix, it is a more efficient way to predict the flow rates as there is a very good
possibility that for a similar configuration, a network with any combination of reservoir
properties in the inputs may become capable of predicting the flow rates when a generalized
model is developed in the future. Since the initial water saturation affects the shape to a great
extent, it may not be possible to apply the curve fitting procedure and find a function that can
be applied to every reservoir in the training samples.
100 simulation runs were prepared of which 60 were used for training, 20 for validation
and 20 for testing purposes. The same configuration as used in the previous network was used
to train the network. A sample output from this network (Model II) is shown in Figure 3-4.
Figure 3-4a: Sample output from Model II with fixed reservoir properties (anisotropic system)
45
Based on trial and error procedures, the number of hidden neurons required to train
this network was found to be between 15 and 18. The variations in well drainage pattern in this
case were shown by including the uniform dimensions of the grid blocks in the x and y direction
as inputs. The number of grid blocks into which the reservoir should be discretized was decided
by preparing simulation runs with different uniform dimensions. The difference in results due
to change in number of blocks became negligible for a 17 x 17 X 1 selection of blocks. Hence, a
15 x 15 x1 dimension was used in all the cases. Thus, for a reservoir of certain acreage, the grid
size was decided by keeping the number of blocks in each direction fixed.
Figure 3-4b: Sample output from Model II with fixed reservoir properties (anisotropic system)
46
In this model, the network started to generate excellent results with just 100 simulation
runs available to run the model when compared to 130 runs in the previous case. It can be
realized that choice of input combinations is a very important parameter in making the network
provide satisfactory results. Three important factors should be kept in mind. First, the choice of
inputs should not be localized. If so, the predictions will be fine, but they may not represent a
much generalized system. As mentioned before, choice of inputs should cover all possible
values in all ranges to the best possible extent. Secondly, the data samples that are part of the
testing data must contain samples that are of similar nature as the data samples in the training
Figure 3-4c: Sample output from Model II with fixed reservoir properties (anisotropic system)
47
data sets. For example, if the testing data set contains permeabilities in all ranges under study
and if the training samples do not contain many values in the respective ranges, results of
interpolation may not be very satisfactory. This is related to studying distribution of the inputs
using histograms before training the network. Thirdly, as the number of outputs or rather the
size of the network increases, it may not be possible to expect as much accuracy of predictions
as seen in the previous structures. It should be understood that, artificial neural networks used
in this study are designed to serve only as screening tools to provide an estimate on potential
investments and obviously they cannot replace numerical models.
Figure 3-4d: Sample output from Model II with fixed reservoir properties (anisotropic system)
48
It can be noticed from the outputs that flow rates are calculated at some predefined
time periods. The first few flow rates are captured at time intervals within the first 2 years
while the remaining flow rates measured at nearly equally distributed time intervals. Because,
the time at which gas production peaks depends on several factors including the initial water
saturation, the critical gas saturation, irreducible water saturation, fracture permeability and
reservoir acreage. For any 2 reservoirs with similar properties, high initial water saturation is
very likely to give a longer water production profile. Similarly, a reservoir with low critical gas
saturation may start producing gas earlier than one with a higher value.
Figure 3-4e: Sample output from Model II with fixed reservoir properties (anisotropic system)
49
In this study, since all the simulation runs were prepared at conditions of high initial
water saturation (98%), time at which gas flow rate peaks depends mainly on the producing
sand face pressure and the reservoir acreage. In most CBM reservoirs, the peak is usually
achieved in the first 2 to 3 years of production (utmost) and hence the necessity to capture flow
rates during early periods arose. Flow rates captured at equally distributed time intervals
without identifying the peak may lead to predictions whose shapes are not even close to the
simulation results.
Figure 3-4f: Sample output from Model II with fixed reservoir properties (anisotropic system)
50
opertie
3.2 ANN with varying reservoir properties
The next intermediate model (Model III) that will be discussed in this chapter is one in
which the production parameters are kept fixed and variations in reservoir properties are
brought into consideration. The level of nonlinearities that will be affected into the system as a
result of this change in inputs was expected to be very high. Because these properties are not
under the control of the producer and the most significant parameters that affect production
come under this list. For example, even a slight difference in the adsorption capacity (Langmuir
volume constant) between two reservoirs may lead to significant differences in their production
Figure 3-4g: Sample output from Model II with fixed reservoir properties (anisotropic system)
51
profiles. The importance of each of these parameters was discussed in Chapter 2 and various
steps in development of this model have been discussed in this section.
Initially, 100 simulation runs were prepared with the production parameters kept at
constant values as shown in Table 3-3.
Production (design) parameter Value
Sand face pressure (psia) 14.7
Skin factor 0
Reservoir acreage (Acres) 40
Well orientation Vertical
Well drainage pattern square
Flow rates at 15 different time periods were measured and included as outputs along
with Cumulative gas production, Cumulative water production, Maximum gas production flow
rate and time to reach peak production. As mentioned before, as the complexity of the network
grows, it may not be possible to expect the same level of accuracy in all the cases. Of the 100
samples, 80 were used for training, 20 for validation and 20 for testing.
Several configurations were tried to come up with a robust network in this case. Initially,
only 5 parameters (Permeability, Initial reservoir pressure, Sorption capacity, Sorption pressure,
Sorption time) were varied keeping the other reservoir properties fixed. Because, the initial
water saturation was found to introduce significant nonlinearities into the system. Properties
like coal density, reservoir temperature, Correy’s correlation parameters have no big impact on
Table 3-3: Production parameters used for Model III
52
the production profile at all. They are included into the model mainly because, they are intrinsic
and naturally occurring part of the reservoir and are not decided upon by the producer. When
the model started working fine with variations in these properties alone, all the other variables
except initial water saturation were brought into the system. The network worked fine for the
same configuration showing that the effect of these variables isn’t really significant.
The most difficult part of improving the capabilities of this model was when the initial
water saturation was brought in. 100 simulation runs were initially prepared and tried with
different configurations. Several possibilities such as increasing the number of hidden layers,
number of hidden neurons, changing the transfer functions, performance functions etc were
tried. The best results that we could obtain corresponded to a configuration containing 2
hidden layers, a tansigmoidal transfer function applied on both the layers, with the first and
second hidden layer containing 20 neurons and 15 neurons respectively (Structure 1). An
average percentage accuracy of 95% with most of the outputs was considered acceptable. A
sample output from this configuration is shown in Figure 3-5.
As seen from the output, many of the flow rate predictions were below the acceptable
limits. Significant deviations in results from the actual results can be seen in many of the
outputs. In this network, 2 functional links were included as part of the inputs to improve
performance. These include the square root of the product of x and y direction permeabilities
and the initial gas content which is obtained by substituting the pressure term in the Langmuir
adsorption equation with the initial reservoir pressure. Although results were better than that
without these functional links, as a whole, the predictions were not completely acceptable.
53
Figure 3-5a: Sample output from Model III with fixed production parameters using Structure 1
Figure 3-5b: Sample output from Model III with fixed production parameters using Structure 1
54
Figure 3-5c: Sample output from Model III with fixed production parameters using Structure 1
Figure 3-5d: Sample output from Model III with fixed production parameters using Structure 1
55
The last two figures show a comparison between the actual and predicted results.
Many of the predictions lie outside the 45 degree line drawn from the origin. Even the
cumulative gas and water productions that gave excellent predictions in case of the previous
model had accuracies less than the expected 95% mark. Since most of the possible
configurations have been tried, it was decided to introduce more simulation runs to improve
generalization capabilities. 100 more training samples were generated increasing the number of
samples available to 200 of which, 160 were used for training, 20 for validation and 20 for
testing.
The best results were obtained for a configuration containing one hidden layer
with 60 neurons and a tansigmoidal function applied (Structure 2). Sample outputs from this
configuration are shown in Figure 3-6. This structure did not contain any functional links.
However, nearly 5 to 6 configurations were tried by including some functional links into the
system. Some of these are listed below.
1. Difference between initial reservoir pressure and the sand face pressure.
2. Square root of the Sorption time constant in seconds.
3. Gas content of coal at different pressures such as pi/2, pi/4, pi/8 etc.
4. The productivity index
5. Logarithm of the product of the Sorption Volume and Pressure constants.
Many of these variables may not make any sense in terms of equations that characterize fluid
flow in CBM reservoirs. However, it should be understood that the network is acquiring some
kind of a learning ability here that the kind of non linear relationships that the network predicts
56
Figure 3-6a: Sample output from Model III with fixed production parameters using Structure 2
Figure 3-6b: Sample output from Model III with fixed production parameters using Structure 2
57
between the inputs and the outputs are vaguely understood in term of the mathematical
equations and the physics behind it. The ultimate aim is to find an optimum value for the
weights and biases that gives the least error in predictions. Fortunately, in this structure, output
predictions were better without functional links than the one with them in the inputs.
Initially, when presence of water saturation affected the network’s abilities
drastically, a flag was used that categorizes the reservoirs into two – One with early peak
(usually occurs in systems with less than 70% saturation) and two with peaks observed after a
significant water production period. This did not help much in terms of betterment in
performance.
Figure 3-6c: Sample output from Model III with fixed production parameters using Structure 2
58
Working further on this, the ratio of the maximum production flow rate to the
time of peak production was predicted along with all the other outputs. This is roughly equal to
the slope of the decline curve assuming this to occur along a straight line. For systems with
early gas production with no peak, the time of peak production was assumed to be 1 day.
Predictions became better but were not satisfactory.
Extreme differences in ranges of values in the outputs were suspected to be a
possible cause and hence, before normalizing those for training, logarithm of all the output
values were taken to bring down the range. The sorption capacity (VL) was expressed in units of
Figure 3-6d: Sample output from Model III with fixed production parameters using Structure 2
59
SCF/ton instead of lb mole gas/ton of coal. The sorption time constant was expressed in days
instead of seconds. The ratio of the permeabilities in the x and y directions was included as an
input. Densities and reservoir temperatures were removed from the system as presence of
these variables had no effect on the predictions at all. A cross check was made to make sure
that all the reservoirs have a potential to produce for a certain period of time with additional
concentration on reservoirs with very low permeability and low sorption capacity, because such
reservoirs produce at rather low flow rates consistently for a longer period of time.
The number of hidden layers was brought down from 2 to 1 and the number of hidden
Figure 3-6e: Sample output from Model III with fixed production parameters using Structure 2
60
neurons was also increased to 60 (as compared to 45 in structure 1). In artificial neural
networks, everything works on a trial and error basis. After so many different attempts, a final
configuration (Structure 2) was arrived at for Model II. The next step in the development of the
expert system will be to develop a generalized model that combines the abilities of the two
intermediate models that have been discussed in this section so far.
Figure 3-6f: Sample output from Model III with fixed production parameters using Structure 2
61
3.3 Generalized model with varying reservoir properties and design parameters
The generalized model will work analogous to a numerical model that predicts
production profiles that can help forecast production from a potential reservoir, once the
properties of the reservoir have been identified and the producer decides on the operating
parameters. This model should also be able to predict flow rates of water, because, in deciding
on the economics involved in producing from a CBM reservoir, the time required to dewater
the system based on existing operating conditions is very important.
Considering all these expectations, the network will have a total of 14 input variables
and 43 different outputs. The outputs include gas and water flow rates calculated at different
time periods similar to, to build the generalized model directly is not possible. The water flow
rates were introduced into the system as a last step. Most of the intermediate models
developed during this process were aimed at predicting gas flow rates efficiently. Initially, 200
simulation runs were prepared with random (but physically possible) combinations of inputs.
This will give an indication on the weight of each parameter on the outputs. The following
discussion pertains to every step in the development of this model. Sample outputs obtained in
these steps will be shown in Chapter 5 in which results are discussed.
The nine parameters shown in Table 3-4 were chosen to build the very first model in this
process. A flag was used to distinguish between horizontal and vertical wells. The remaining
parameters were introduced in steps once each predecessor model starts working thereby
increasing the complexity gradually.
62
1. Fracture permeability (x direction)
2. Fracture permeability (y direction)
3. Fracture permeability (z direction)
4. Formation thickness
5. Initial reservoir pressure
6. Sorption volume
7. Sorption pressure
8. Sorption time
9. Length of well (if horizontal)
When the well orientation is horizontal, the well is usually placed along the y
direction, because the x-direction is assigned as the higher permeability direction. The necessity
to categorize the model into two based on orientation of the well was seen here in the first
model itself. In reservoir simulation, the gas flow rate through any block is proportional to the
square root of product of permeabilities in the directions perpendicular to the direction of flow
of fluid (only). Thinking along these lines, then, the effect of z direction permeability in vertical
wells and the effect of y direction permeability in horizontal wells do not come into
consideration.
The configuration that made this model working was very close to Structure 2 of
model II. The network contained a total of 400 simulation runs, of which 320 were used for
training, 40 for validation and 40 for testing. The next step is to bring in initial water saturation.
A summary of problems that arose in bringing in this parameter is given below:
1. The network failed to predict peak gas flow rate and time at which this occurs.
Table 3-4: Initial parameters of interest in development of generalized model
63
2. Severe oscillations were seen in some of the periodical flow rate predictions. It was not
even possible to smooth down the shape of the curve to follow a certain trend because
of these oscillations.
3. Careful observations indicated that gas flow rates predicted during time periods less
than 50 days and those around the peak were not satisfactory at all.
4. Most of these problems were observed with reservoirs in the testing samples that
included combinations with high fracture permeability (> 500 mD), high initial water
saturation and very low abandonment time.
A number of changes were implemented to overcome the aforementioned
difficulties. First, only five outputs (cumulative gas and water productions, peak gas flow rate,
time of occurrence of peak production) were predicted without predicting the gas production
profile. These predictions were quite precise which instilled a good level of confidence that this
model will work ultimately. Secondly, the model was classified into two components. In the first
model, flow rates measured at 10 equally distributed time intervals before the occurrence of
peak were fed as outputs, the network trained and the negative decline curve predicted. In the
second model, flow rates at 10 equally distributed time intervals after the peak were fed as
outputs. If the initial water saturation is very low so that the gas flow rate starts to decline right
from the beginning, there will be no entry for this reservoir in the first model. These predictions
were also observed to be very satisfactory.
As the next step, the two simple models above were put together into one. Several
functional links were included in the inputs. Some of the inputs are included in the outputs too,
64
so that the network apart from predicting those values as such will be forced to predict outputs
that have close relationships with these parameters. One main reason for oscillations in
predictions is insufficient number of epochs to which the network is trained. They could be
easily overcome by allowing the network to run for a longer period of time up to as many as
even 6000 epochs in some cases.
Cases when the network could not predict flow rates around the peak were too
difficult to resolve. It was not possible to determine if the difficulty was in measuring the trend
in production or in accurately predicting the peak attributes. In coalbeds of high fracture
permeability, the gas is produced so fast that the occurrence of the peak flow rate can be at
times as early as 20 or 30 days. On the other hand, for reservoirs with low porosity and fracture
permeability, gas is released at a slower rate, peak conditions may be seen at times as late as a
year or more. Moreover, these are not the only parameters that need to be considered.
The last problem could be solved by introducing more simulation runs with
concentration on reservoir systems that cover ranges which previously did not yield satisfactory
predictions. Another approach was to test on the outputs indirectly by feeding them to the
network in a different format. For example, the peak flow rate could be shown in MMSCF
instead of SCF. Similarly, the flow rates can be shown by dividing them with the corresponding
time at which they were measured and multiplying by the time again when plotting results. In
some cases the testing error keeps decreasing but with an oscillatory nature. This is not an
indication of overtraining, because the testing error still decreases that is what is expected
ultimately. To prevent the network from stopping training under such conditions, the
65
performance goal is reduced to a very low value of 10e-6 and the number of epochs for which
an increase in the validation/testing error is acceptable is increased to a high value.
The final configuration that made this model working had a total of 2 hidden layers
with 30 neurons and 26 neurons in the first and second hidden layers respectively. In the next
two intermediate models, porosity, coal density and Correy’s correlation parameters were
brought into the system. No significant variations in the network’s architecture were required
to account for the new complexities that were introduced by these variables.
Now that all the reservoir properties are in place, the next step is to bring in the
remaining production parameters. We are left with three important variables (sand face
pressure, well stimulation and reservoir acreage) each of which have significant impact on the
results. It will be a good idea to compare differences in predictions for any 2 reservoirs whose
properties and productions parameters are exactly the same with the exception of one which
may be one of the above three parameters. First, let us examine the impact of sand face
pressure graphically. Figure 3-7 shows difference in production profiles between 2 identical
reservoirs when produced at different bottom-hole pressures.
As we know, the gas production flow rate is directly proportional to the
difference between the reservoir pressure and the bottom-hole pressure. The lower the
bottom-hole pressure, the higher the gas flow rates. By increasing the bottom-hole pressure to
500 psia, the peak gas flow rate becomes less than half when compared to that with a bottom-
hole pressure of 200 psia.
66
Roughly speaking, within the same time frame, gas recovery is nearly doubled by
lowering the sand face pressure in the example above. Capturing completely different
variations in the flow rates for changes in just a single parameter in the system was observed to
be difficult. The final configuration that worked contained 4 hidden layers, with logsigmoidal
transfer function applied on all of the layers. The four layers contained 35, 15, 10 and 8 hidden
neurons in the first, second, third and forth hidden layers, respectively. A total of 800
simulation runs were required for a successful training.
Skin factor is the next parameter that will be considered. Whenever a well is put
into production, the goal is always to produce the reservoir as rapidly as possible, without
causing irreversible damages. Stimulation techniques have a definite effect on enhancing
production rates. Figure 3-8 shows changes caused by well stimulation in 2 reservoirs with
identical properties.
0
20000
40000
60000
80000
100000
120000
140000
160000
0 200 400 600 800 1000 1200 1400 1600 1800 2000
SCF/
day
Time (Days)
Pwf = 200 psia
Pwf = 500 psia
Figure 3-7: Graphical representation of effect of sand-face pressure on gas production in CBM wells
67
As evident from the above figure, the more the stimulation, the earlier the peak production
occurs. Also, gas is exploited faster in a stimulated well than one without any stimulation at all.
Skin can also be positive which is indicative of possible damage to the well. However inclusion
of skin factor into the system did not affect the network’s ability drastically. The reason for this
can be explained as follows. The major and significantly evident change that is being caused by
stimulating a well is an early peak production except for which, behavior of the positive decline-
curve is more or less the same. Also, in most of the CBM reservoirs, decline in gas production
begins in less than 3 years while we are examining the production profile for a period of ten
years. The final configuration in this case was very similar to the previous one except for the
number of neurons in the third and forth hidden layer which were changed to 12 and 10
respectively. Also an additional functional link given by the difference between the initial
reservoir pressure and the sand-face pressure was predicted along with the existing outputs in
the system.
0.00E+00
2.00E+04
4.00E+04
6.00E+04
8.00E+04
1.00E+05
1.20E+05
0 500 1000 1500 2000 2500 3000 3500 4000
SCF/
day
Time (days)
Skin = -3
Skin = 0
Figure 3-8: Graphical representation of effect of stimulation on gas production in CBM wells
68
At this stage of the development, the only variable remaining to be addressed is
the reservoir acreage. Figure 3-8 is a sample comparison of gas production profiles from two
reservoirs with similar properties but different drainage areas. The production curve is shifted
to the top right and the decline curves are more or less parallel to each other.
The final configuration contained 2 hidden layers, with a tansigmoidal function applied on each
of the hidden layers and the layers contained 65 neurons and 30 neurons respectively. The
performance function was changed from MSE (Mean squared error) to MSEREG (Mean squared
error with regularization) for the first time in this study. Training took rather a long period of
time (around 45 minutes to an hour) for satisfactory results as the rate of minimization of error
after conditions when performance reaches around 0.01 was very slow. The final architecture
of this network is shown in Figure 3-8.
0.00E+00
1.00E+04
2.00E+04
3.00E+04
4.00E+04
5.00E+04
6.00E+04
7.00E+04
8.00E+04
9.00E+04
0 500 1000 1500 2000
Acreage = 40 acres
Acreage = 60 acres
Figure 3-9: Graphical representation of effect of drainage area on gas production in CBM wells
69
Figure 3-10: Network Structure of the final generalized model
70
3.4 Vertical and Horizontal well Models
As mentioned earlier, the generalized model was tried on two different sets of
data samples, one that contained reservoir systems in which all runs were made with vertical
wells and another one in which all the runs were made with horizontal wells. Sample outputs
from the generalized model are shown in Figures 3-10 and Figure 3-11.
Figure 3-11a: Sample output (gas flow rates) from the final generalized model (Horizontal wells)
71
Figure 3-11b: Sample output (gas flow rates) from the final generalized model (Horizontal wells)
72
Figure 3-11c: Sample output (water flow rates) from the final generalized model (Horizontal wells)
73
Figure 3-11d: Sample output (water flow rates) from the final generalized model (Horizontal wells)
74
Figure 3-11e: Sample output (gas flow rates) from the final generalized model (Horizontal wells)
75
Figure 3-11f: Sample output (gas flow rates) from the final generalized model (Horizontal wells)
76
Figure 3-11g: Sample output (water flow rates) from the final generalized model (Horizontal wells)
77
Figure 3-11h: Sample output (water flow rates) from the final generalized model (Horizontal wells)
78
Figure 3-12a: Sample output (gas flow rates) from the final generalized model (Vertical wells)
79
Figure 3-12b: Sample output (gas flow rates) from the final generalized model (Vertical wells)
80
Figure 3-12c: Sample output (water flow rates) from the final generalized model (Vertical wells)
81
Figure 3-12d: Sample output (water flow rates) from the final generalized model (Vertical wells)
82
Figure 3-12e: Sample output (gas flow rates) from the final generalized model (Vertical wells)
83
Figure 3-12f: Sample output (water flow rates) from the final generalized model (Vertical wells)
84
Figure 3-12g: Sample output (gas flow rates) from the final generalized model (Vertical wells)
85
Figure 3-12h: Sample output (gas flow rates) from the final generalized model (Vertical wells)
86
3.5 Multilayered well schemes
Earlier the reason behind the lack of the model’s ability to combine vertical and
horizontal wells together was explained. All the reservoir systems implemented in this study are
considered to be two dimensional because thicknesses of coal seams on an average are
relatively small and the need to discretize the systems in the vertical direction does not arise.
However, this is applicable to vertical wells only. The aim of this particular study is to predict
gas production from horizontal wells laid parallel to each other in three dimensional systems.
Although this model is not part of the expert system, it is meant to establish capabilities of
neural networks in general applications when provided with sufficient data samples and an
appropriate configuration. Figure 3-11 shows difference in profiles caused by discretizing the
reservoir in the z direction making it a three dimensional study. The difference or error is
caused by the difference in depth gradients between the two layers. The greater the number of
layers in the z direction, the more accurate is the results.
0.00E+00
1.00E+04
2.00E+04
3.00E+04
4.00E+04
5.00E+04
6.00E+04
7.00E+04
8.00E+04
0 200 400 600 800 1000 1200 1400 1600
SCF/
day
Time (days)
3 D
2 D
Figure 3-13: Effect of three dimensional discretization on production in CBM reservoirs
87
A total of 800 simulation runs were prepared with the same reservoirs as seen in
the generalized model but with 2 layers in the z direction containing one horizontal well in each
layer. Gas flow rates at different times were collected as before; the network trained and
predictions are made. Sample outputs from this network are shown in Figure 3-12.
Figure 3-14a: Sample output from network to predict gas flow rates from multilayered well schemes
88
Figure 3-14b: Sample output from network to predict gas flow rates from multilayered well schemes
89
Figure 3-14c: Sample output from network to predict gas flow rates from multilayered well schemes
90
Figure 3-14d: Sample output from network to predict gas flow rates from multilayered well schemes
91
Figure 3-14e: Sample output from network to predict gas flow rates from multilayered well schemes
92
CHAPTER 4
DEVELOPMENT OF THE INVERSE MODEL
In reservoir engineering applications, developing a numerical model for a reservoir
involves significant cost and time. The determination of the optimum operating conditions
required to produce from a reservoir is not an easy task. With a novel approach using a
combination of expert knowledge and artificial neural networks, this can be achieved. The
inverse model presented in this chapter helps identifying the optimum value of sand face
pressure and well stimulation required to recover a specified percentage of gas from a coalbed
methane reservoir. The method is unique in the sense that it can be achieved using numerical
models by trial and error procedures only. By exposing an artificial neural network to a
sufficient number of patterns, it is possible to make the network identify optimum operating
conditions to achieve a certain targeted production performance.
4.1 Performance indicators
Now that we have described the problem to be solved at hand, it is necessary to come
up with various questions that the user can ask the neural network model based on the
producer’s requirements. The project design engineer may ask questions such as:
1. What are the conditions required to dewater 95% of the water in the system over a
period of time of two years?
2. What are the well conditions required to exploit 65% of the gas in the reservoir in 8
years?
93
3. What are the conditions such that gas flow rate reaches its peak value at the end of two
years?
Many similar questions may be framed. However, the type of input and output data that
needs to be obtained for each of these cases should guide the construction of input and output
layers. For example, to answer question 1, we can provide the time required to dewater 95%
water in the system in all the reservoirs by calculating the total water in place (which is usually
known to the producer) and adding the time to the outputs. Using multi-dimensional non-linear
interpolation techniques, the trained network should be able to answer this question
effectively. The importance of implementing expertise knowledge is also necessary. Two factors
should be kept in mind. The prediction from the model may be mathematically correct but may
not make any practical sense. Secondly, the solution that is being offered is not unique.
The question that we have tried to answer with the help of this model is: the
identification of the optimum operating conditions that can help in achieving a certain targeted
percentage gas recovery from a reservoir at the end of 5 years of production? Again, two
different models are investigated – one for horizontal and another for vertical wells. Inputs to
each of these models are the same as those in the forward-looking direct generalized model
with the exception that the percentage recovery of gas at the end of 10 years was added to
each reservoir as an additional input. The two outputs that are predicted include the sand face
pressure and the skin factor.
94
4.2 Study of the effect of skin on percentage recovery in vertical and horizontal wells
As shown in the previous sections, it is clear that the effect of stimulation (negative skin)
in producing from a reservoir is to shift the peak production rate to early times and to increase
the production rate. Therefore, the presence of skin in generating a variation in percentage
recoveries becomes more important especially during the first 5 to 6 years. For a coal seam
with low permeability and low porosity, such considerations become important. It is well
known that reservoirs with relatively high permeability are exploited so fast that the difference
in percentage recoveries at the end of 10 years caused by stimulation becomes negligible. A
study of these changes affected by well stimulation on some low permeable reservoirs is
presented in the following section.
4.2.1 Effects of skin on percentage recovery in vertical wells
A total of 14 scenarios, all with very low permeabilities (less than 5 mD) were studied
and differences in percentage recoveries were calculated for different skin factors and the
S.No kx
(mD) ky
(mD) H
(ft) Φ
(%) pi
(psia) Swi (%)
VL
PL (psia)
Τ (days)
pwf (psia)
S (old)
S (new)
%recovery (old)
%recovery(new)
1 5 5 35 2 3000 30 0.0005 800 100 300 -3 0 69.7501 69.1039 2 5 2.5 30 9 2300 70 0.001 300 600 500 -1 -3 22.5090 25.0088 3 1 1 24 5 3000 45 0.001 800 40 1000 0 -3 31.2141 33.5453 4 1 0.25 30 4 3500 90 0.0009 1500 100 200 0 -3 28.7661 40.4411 5 1 0.2 40 8 3000 85 0.001 1500 25 40 -3 0 12.0381 7.57567 6 5 1 20 1 3500 90 0.0006 250 400 100 -4 0 37.1389 30.1787 7 1 0.5 35 5 3200 60 0.001 2000 40 100 0 -3 46.1158 52.7945 8 1 0.5 35 7 3500 55 0.0009 2000 150 200 -4 0 74.9572 67.1615 9 5 1 35 2 3200 85 0.0008 1500 200 50 -4 0 83.0816 76.1254
10 1 0.5 40 8 3200 45 0.0007 1200 800 300 -4 0 61.5880 68.6981 11 1 1 32 5 3500 95 0.0007 800 120 20 0 -3 35.6510 45.2197 12 1 0.5 40 3 3000 40 0.001 450 100 500 -4 0 35.43352 30.09918 13 5 5 5 10 2500 30 0.0006 1800 15 20 0 -3 93.0854 94.6340 14 5 1.25 40 2 2000 75 0.0005 1600 700 200 -3 0 54.7725 46.5907
Table 4-1: Effect of well stimulation on percentage gas recovery in vertical wells
95
results are shown in Table 4-1. In Table 4-1, it can be seen that the maximum difference in
recoveries was close to 12% in reservoir 4, mainly because, the permeabilities were too low,
the gas content was high and the sorption time was also comparatively low. Gas was being
extracted at such a low rate that only 40% of the gas could be recovered at the end of 10 years
even with a negative skin of -3. In case of reservoir 1, with lateral permeabilities of 5 mD, there
is no difference at all in terms of percentage recoveries with and without stimulation. The
implication is that, even if predictions of skin from the inverse model are not exactly the same
as fed to the model, the results may still be applicable and need to be tested by introducing
them to the direct model and calculating the percentage recoveries.
4.2.1 Effects of skin on percentage recovery in horizontal wells
A similar study was made on horizontal wells as well. As we know, production from a
horizontal well under the same operating conditions when compared to a vertical well is usually
much higher and hence the effect of skin is expected to be less pronounced in this case. Similar
to the previous investigation, 15 different scenarios from reservoirs of low permeability are
studied and the results are tabulated in Table 4-2 below:
S.No kx
(mDky
(mDH (ft
Φ (%)
pi (psia)
Swi (%)
VL PL (psia)
Τ (days)
S(new)
S(old)
Pwf (psia)
%recovery (old)
%recovery(new)
1 1 1 24 5 3000 45 0.001 800 40 0 -3 1000 35.17 35.152 1 1 30 4 3500 90 0.0009 1500 100 0 -3 200 73.43 71.503 5 5 35 9 2000 85 0.001 2000 15 5 -3 300 71.15 69.154 1 1 40 8 3000 85 0.001 1500 25 -3 0 40 40.35 42.465 1 1 35 5 3200 60 0.001 2000 40 1 -3 100 75.89 74.506 5 5 40 6 2500 75 0.0007 400 700 2 -3 200 53.66 50.737 1 1 35 7 3500 55 0.0009 2000 150 2 -3 200 85.56 84.258 5 5 25 10 2000 40 0.0006 2000 50 2 -3 500 67.26 67.179 1 1 35 3 3500 70 0.0009 2000 50 -1 -3 100 92.66 92.68
10 5 5 35 9 2500 100 0.0005 800 300 -1 -3 60 83.57 82.6511 1 1 40 8 3200 45 0.0007 1200 800 0 -3 300 76.68 75.8212 1 1 32 5 3500 95 0.0007 800 120 2 -3 20 69.96 69.2813 1 1 40 1 3000 40 0.0007 2000 20 -1 -3 40 93.67 93.3414 5 5 32 4 2500 85 0.0004 2000 800 2 -3 40 79.21 77.6715 1 1 40 3 3000 40 0.001 450 100 -4 -3 500 42.51 42.25
Table 4-2: Effect of well stimulation on percentage gas recovery in horizontal wells
96
4.3 Percentage recovery based predictions
A sensitivity analysis of results due to changes in Sand-face pressure was also studied.
This is because, in the inverse model applications, the solution to the problem is not always
unique and just because the predictions of the model are not in accordance with the simulation
results, the solution cannot be discarded altogether. To explain this better, all the reservoirs
that were studied for effects of skin were analyzed to understand importance of sand-face
pressure in affecting the percentage recovery. The results as applied to vertical wells are
tabulated in Table 4-3.
S.No kx
(mD) ky
(mD) H
(ft) φ
(%) pi
(psia) Swi (%)
VL
PL (psia)
Τ (days)
pwf (psia) (old)
pwf (psia)(new) Skin
%recovery (old)
%recovery (new)
1 5 5 35 2 3000 30 0.0005 800 100 300 200 -3.000 69.75 76.95
2 5 2.5 30 9 2300 70 0.001 300 600 500 400 -1.000 22.51 23.92
3 1 1 24 5 3000 45 0.001 800 40 1000 800 0.000 31.21 34.96
4 1 0.25 30 4 3500 90 0.0009 1500 100 200 100 0.000 28.77 29.97
5 1 0.2 40 8 3000 85 0.001 1500 25 40 60 -3.000 12.04 11.97
6 5 1 20 1 3500 90 0.0006 250 400 100 80 -4.000 37.14 37.23
7 1 0.5 35 5 3200 60 0.001 2000 40 100 60 0.000 46.12 46.49
8 1 0.5 35 7 3500 55 0.0009 2000 150 200 100 -4.000 74.96 74.73
9 5 1 35 2 3200 85 0.0008 1500 200 50 100 -4.000 83.08 82.32
10 1 0.5 40 8 3200 45 0.0007 1200 800 300 200 -4.000 61.59 70.39
11 1 1 32 5 3500 95 0.0007 800 120 20 80 0.000 35.65 34.76
12 1 0.5 40 3 3000 40 0.001 450 100 500 350 -4.000 35.43 37.74
13 5 5 5 10 2500 30 0.0006 1800 15 20 100 0.000 93.09 90.71
14 5 1.25 40 2 2000 75 0.0005 1600 700 200 50 -3.000 54.77 54.79
The difference in percentage recoveries with changes in sand-face pressures by up to 20
– 25% indicate that the optimum value expected from the model should be unique. In
prediction of results from the inverse model, error percentages ranging from anywhere
between 0 to 25% (approximately) were considered acceptable. Here, in consideration of
Table 4-3: Effect of Sand-face pressure on percentage gas recovery in vertical wells
97
similar outcomes for horizontal wells, a similar analysis was made. The results are tabulated in
Table 4-4 below.
S.No kx
(mD) ky
(mD) H
(ft) φ
(%) pi
(psia) Swi (%)
VL
PL (psia)
Τ (days)
Pwf (psia) (old)
Pwf (psia)(new) Skin
%recovery (old)
%recovery (new)
1 1 1 24 5 3000 45 0.001 800 45 1000 900 0 35.15 38.38
2 1 0.25 30 4 3500 90 0.0009 1500 90 200 100 0 71.50 74.41
3 5 5 35 9 2000 85 0.001 2000 85 300 200 5 69.15 74.91
4 1 0.2 40 8 3000 85 0.001 1500 85 40 60 -3 42.46 42.47
5 1 0.5 35 5 3200 60 0.001 2000 60 100 80 1 74.50 74.76
6 5 0.71 40 6 2500 75 0.0007 400 75 200 140 2 50.73 53.47
7 1 0.5 35 7 3500 55 0.0009 2000 55 200 250 2 84.25 72.81
8 1 0.25 35 3 3500 70 0.0009 2000 70 100 60 -1 92.68 95.18
9 5 2.5 35 9 2500 100 0.0005 800 100 60 40 -1 82.65 83.91
10 1 0.5 40 8 3200 45 0.0007 1200 45 300 200 0 75.82 79.97
11 1 1 32 5 3500 95 0.0007 800 95 20 60 2 69.28 69.36
12 1 0.5 40 1 3000 40 0.0007 2000 40 40 20 -1 93.34 93.76
13 5 0.42 32 4 2500 85 0.0004 2000 85 40 80 2 77.67 77.64
In the case of horizontal wells, similar to the study made with skin factor, the effect is
less pronounced when compared to vertical wells. The same simulation runs conducted with
the forward looking model were used here to predict optimum sand-face pressure and skin
required to attain the desired percentage recovery of gas. Sample results from the network are
shown in Figure 4-1 and Figure 4-2 for vertical and horizontal wells, respectively. Here, in this
network, predictions are being made on factors when the weight is much higher on the
percentage recovery when compared to rest of the inputs. Functional links including ratio of
sand-face pressure to percentage recovery, sand-face pressure to permeability, sand-face
pressure to formation thickness and sand-face pressure to initial water saturation were
included in the outputs.
Table 4-4: Effect of Sand-face pressure on percentage gas recovery in horizontal wells
98
It should be emphasized here that the problem the network is trying to learn is primarily
a pattern-recognition and hence the performance of the model largely depends on the quality
of data used in training the network. For example, if there are two identical reservoirs, one with
a sand-face pressure of 400 psia yielding 65% recovery and another with a sand-face pressure
of 14.7 psia yielding 68% recovery at the end of 10 years, the there is a very good possibility
that the network may get confused, especially, if one of these reservoirs is in the training
sample and the other in the testing sample, the network tries to predict results that are close to
those of the training data. The best way to validate the predictions of the inverse model will be
to feed the estimated sand-face pressure and skin to the forward looking model to see if the
percentage recoveries agree with the expectations of the user. For obvious reasons, making
simulation runs with a positive skin in this case does not make any sense at all, as these are
wells that will be put into production soon and the extent of damage to the wells is known.
Figure 4-1: Sample results from inverse model as applied to vertical wells
99
Figure 4-1: Sample results from inverse model as applied to vertical wells (continued)
100
Figure 4-2: Sample results from inverse model as applied to horizontal wells
101
Figure 4-2: Sample results from inverse model as applied to horizontal wells (continued)
102
CHAPTER 5
RESULTS AND DISCUSSION
This chapter discusses some of the important results obtained at different stages in this
study starting from the most simplified model to the final generalized model. The idea behind
these discussions is to provide a compilation of the results thereby showing the stages of
development of this model in an orderly manner. The following models and their results have
been discussed in this chapter.
1. Model I with varying well design parameters and fixed reservoir properties with
isotropic permeability (using flow rate as an exponential function of time)
2. Model II with varying well design parameters and fixed reservoir properties with
anisotropic permeability (using flow rates measured at different time periods).
3. Model III with varying reservoir properties and fixed design parameters
4. Model IV – An intermediate step in the generalized model when initial water saturation
is introduced into the system.
5. Model V - Final generalized model.
5.1 Results from Model with varying well design parameters (isotropic system)
Sample training was made with Model I (structure 3: Chapter 3). The network’s
configuration is given in Table 5-1. Some of the production profiles obtained in this study are
shown in Figure 5-1.
103
Network Parameter Value
Number of data samples used 150
Number of inputs/outputs 5/9
Network type Cascaded-Feed-forward-Back-propagation network
Number of hidden layers 1
Transfer function used Tansig
Number of hidden neurons 12
Training function Scaled Conjugate gradient
Performance goal 0.00001
Acceptable Validation failures 50
Additional modifications to inputs/outputs Cumulative gas production – MMSCF Cumulative water production – MSTB
Coefficients were divided by a factor of 100
Table 5-1a: Network Structure used for Model with varying well design parameters (isotropic system)
Figure 5-1a: Sample production profile predictions from Model with varying well design parameters (isotropic system)
104
5.2 Results from Model with varying well design parameters (anisotropic system)
This model was used to train reservoir systems with varying well design parameters
and fixed reservoir properties similar to the Model II but was applied on a system with
anisotropic permeability. Network parameters are listed in Table 5-2 and sample predictions
are shown in Figure 5-2.
Network Parameter Value
Number of data samples used 100
Number of inputs/outputs 5/19
Network type Cascaded-Feed-forward-Back-propagation network
Number of hidden layers 1
Transfer function used Tansig
Number of hidden neurons 18
Training function Scaled Conjugate gradient
Performance goal 0.00001
Acceptable Validation failures 50
Additional modifications to inputs/outputs Cumulative gas production – MMSCF Cumulative water production – MSTB
Coefficients were divided by a factor of 100
Figure 5-1b: Sample production profile predictions from Model with varying well design parameters (isotropic system)
Table 5-2: Network Structure used for Model with varying well design parameters (anisotropic system)
105
5.3 Results from Model with varying reservoir properties
In this study, predictions are confined to reservoirs with fixed well design
parameters and variations are effected on reservoir properties only. The ranges of properties
applicable to this model have been discussed in chapters 2 and 3 already. Properties of the
network used in this case are tabulated in Table 5-3. Sample outputs obtained from running this
model are shown in Figure 5-3.
Figure 5-2: Sample production profile predictions from Model with varying well design parameters (anisotropic system)
106
Network Parameter Value
Number of data samples used 200
Number of inputs/outputs 7/16
Network type Cascaded-Feed-forward-Back-propagation network
Number of hidden layers 1
Transfer function used Tansig
Number of hidden neurons 60
Training function Scaled Conjugate gradient
Performance goal 0.00001
Acceptable Validation failures 200
Additional modifications to inputs/outputs Sorption volume in SCF/ton Sorption time in days
Functional links: Kx:Ky, √ (Kx*Ky), Initial gas content
Table 5-3: Network Structure used for Model with varying reservoir properties
Figure 5-3a: Sample production profile predictions from Model with varying reservoir properties
107
5.4 Results from an intermediate model in the developmental stage
One of the most challenging parts of development of the generalized model was the
time when initial water saturation was introduced as an input to the system.
Network Parameter Value
Number of data samples used 400
Number of inputs/outputs 8/21
Network type Cascaded-Feed-forward-Back-propagation network
Number of hidden layers 1
Transfer function used Tansig
Number of hidden neurons 45
Training function Scaled Conjugate gradient
Performance goal 0.0001
Acceptable Validation failures 200
Additional modifications to inputs/outputs Logarithm of inputs and outputs used in training
Figure 5-3b: Sample production profile predictions from Model with varying reservoir properties
Table 5-4: Network Structure used for intermediate model in the developmental stage
108
The level of nonlinearities caused by this change was huge and entailed several
trial and error measures to come up with a robust model. Properties of this network are listed
in Table 5-4. Sample predictions from this model are shown in Figure 5-4.
Figure 5-4: Sample production profile predictions from intermediate model in the developmental stage
109
Figure 5-4: Sample production profile predictions from intermediate model in the developmental stage
110
5.5 Results from the generalized model
This is the final generalized model where water production flow rates were also
predicted. The size of the output matrix was nearly doubled. As mentioned before, this model
was categorized into two – one for vertical wells and one for horizontal wells. Network
configuration for this model is given below in Table 5-5.
Network Parameter Value (Horizontal wells) Value (Vertical wells)
Number of data samples used 600 900
Number of inputs/outputs 15/43 14/43
Network type Cascaded-Feed-forward-Back-
propagation network
Cascaded-Feed-forward-Back-
propagation network
Number of hidden layers 2 2
Transfer function(s) used Tansig / Tansig Tansig / Tansig
Number of hidden neurons 55/25 65/20
Training function Scaled Conjugate gradient Scaled Conjugate gradient
Performance goal 0.0001 0.0001
Performance function MSEREG MSEREG
Learning function learngdm learngdm
Acceptable Validation failures 400 500
Additional modifications to inputs/outputs
Logarithm of inputs and outputs used in training
Logarithm of inputs and outputs used in training
Sample predictions from this model (gas and water flow rates) are shown in Figure 5-5 and
Figure 5-6 for vertical wells and horizontal wells respectively.
Table 5-5: Network Structure used for Final generalized model
111
Figure 5-5a: Sample production profile predictions from Final generalized model (vertical wells)
112
Figure 5-5b: Sample production profile predictions from Final generalized model (vertical wells)
113
Figure 5-5c: Sample production profile predictions from Final generalized model (vertical wells)
114
Figure 5-6a: Sample production profile predictions from Final generalized model (horizontal wells)
115
Figure 5-6b: Sample production profile predictions from Final generalized model (horizontal wells)
116
Figure 5-6c: Sample production profile predictions from Final generalized model (horizontal wells)
117
5.6 Discussion of results
In all the above models, arriving at the final model is purely based on trial and error
procedures and there is no hard and fast rule governing the nature of functioning of the
networks. It will be a good idea to focus on various parameters that affect a network’s
performance so that they can serve as guidelines for anyone to know what he should look for
when configuring a network.
Once simulation runs are prepared, the input and output values are always normalized
between -1 and 1 by default before training. The number of data samples that should be used
for training, testing and validation purposes are usually user dependent. Usually, 60% of the
data samples are used for training, 20% for validation and 20% for testing purposes. But,
depending on the number of samples available, this can always be changed. Also, to keep the
data samples used in testing and validation fixed is also left to the user as it depends on the
problem at hand. If the designer is trying to identify the most optimum configuration for a
certain network problem, he/she may prefer sticking to certain data samples so that it will be
easier to understand the change imposed on the outputs every time a network parameter is
changed.
However, in all the above models, every time the network is trained, the choice of data
samples for validation, training and testing is left to the program to choose them at random.
This is make sure that the network has much higher generalization capabilities that can handle
any combination of inputs in any range that are physically possible and show potential to
produce gas for an acceptable period of time.
118
The choice of number of hidden layers and hidden neurons has always been a challenge
with all the models. A rough estimate can be made based on the number of data samples
available, the number of inputs and outputs. However problems of undertraining and
overtraining are always present initially. In almost every model shown above, overtraining was
a common phenomenon in the stages of development. Either the number of hidden neurons
will be higher than required or the number of data samples is not sufficient. It is always a good
idea to try out a small number of hidden neurons, follow the trend in minimization of errors
and increase them as required.
Different methods are available to initialize weights and biases in a neural network.
Using matrices of zeros is not usually preferred and a random number generator function is
often used. MATLAB comes with Nguyen-Widrow layer initialization function (initnw) and the
by-weight-and-bias layer initialization function which can be used. In all the models above, a
non linear function of random numbers is used to obtain an initial guess on the weights and
biases for the network. Use of functions available with MATLAB did not really seem to improve
the performance to any acceptable extent.
In a feed forward back-propagation neural network, there is no connection between
layers other than the ones before and after them. In a cascaded feed forward back-propagation
neural network, the inputs to each layer come from all the layers before it. In this model, CFF
networks showed better performance when compared to ordinary BP neural networks. It is
important that testing and validation errors are reduced at rates which are not too slow. CF
networks helped achieve this synchronized trend in rate of reduction of errors.
119
Each network has its own parameters which may be suitably altered based on the
complexity of the problem. The performance-goal also known as the convergence criteria is the
minimum error the network is expected to reach and is checked at the end of each epoch. In
this study, these values are in the range of 0.0001 to 0.00001. The maximum number of epochs
allowed is always kept high, because MATLAB neural network toolbox offers features to stop
training at any point as desired by the user. The trend in the training, testing and validation
errors appear on screen when the network is trained which helps the user keep track of it. The
learning rate, minimum gradient, performance ratio etc are some other parameters that can be
used in an attempt to improve generalization capabilities.
Transfer functions are mathematical functions used to predict the outputs from layers
on which they are applied. Three most commonly used functions are Tansig, Logsig and Purelin.
In this model, many user-defined functions were tried. Performances did improve in many
cases, but a robust network could always be established by working on other parameters in the
system. Use of logsigmoidal transfer functions resulted in negative values for some of the
outputs predicted. These problems diminished to some extent after logarithmic values of inputs
and outputs were used in the network and almost all the models shown in this study use
tansigmoidal transfer functions.
Several functions are available to train the network. The most commonly used ones are
the scaled conjugate training algorithm, the Levenberg-Marquardt algorithm, Fletcher-Powell
conjugate gradient algorithm, the BFGS quasi-Newton algorithm and the Powelle-Beale
conjugate gradient algorithm. The most powerful of these is the trainlm function which usually
120
converges in a relatively small number of epochs. The big disadvantage in using this function is
that it occupies a lot of memory and takes time to converge. The scaled conjugate gradient
although not as powerful as trainlm has been used in all the models and successful results could
be obtained.
Performance functions are used to let the network know how it should calculate the
errors at the end of each epoch so that back-propagation can be done accordingly. The two
most common functions used in this study are MSE and MSEREG. Sometimes, overtraining
problems may not occur only due to the number of hidden neurons. The data samples as such
may not present a good quality of distribution in combinations. MSEREG function (Mean
Squared Error function with regularization) helps in such cases. It calculates error at the end of
each epoch as a function of the mean squared error as well as the mean squared weight and
bias values.
These are only parameters that may or may not have any impact on the performance of
the network. The most important of all the factors is the choice of inputs and outputs. One
needs to be aware of certain facts that will be highly influential in developing a robust
algorithm. Even combinations made of physically possible groups of reservoir properties and
design parameters may not sometimes work, because the network does not find a good match
on the weights and biases. In the direct model, the solution to the problem is unique and a
certain combination of inputs can result in a specific production profile only. When compared
to the inverse model, this provides confidence that a working model can definitely been
developed.
121
Knowledge on artificial neural networks alone does not help solving the problem at
hand. People with a good level of practical knowledge in CBM reservoirs can easily pin point
changes that can result in production from changes in any of the properties in a reservoir. A
neural network is being trained to acquire such capabilities by feeding with historical data.
Hence, anyone who develops this model should be aware of the significance of every part and
parcel of the system. Unconventional reservoirs behave differently in terms of mass transfer
and production and understanding technical aspects of such behavior is very crucial. Every
reservoir property has its own importance and should be well studied and this is what helps
one to decide whether a combination is physically possible or not. Producing from a reservoir at
certain operating conditions entails knowledge on deciding whether such a combination helps
producing gas efficiently or not. These were the reasons to develop models starting from I to V
that facilitate learning while you work.
122
CHAPTER 6
CONCLUSIONS
In this study, a screening tool that works using the neuro-simulation methodology to
predict performance from a Coalbed Methane reservoir has been developed and tested
successfully. A total of 900 reservoir systems each for horizontal and vertical wells were used
and trained using a cascaded feed-forward back-propagation neural network. With sufficient
knowledge on back-propagation algorithm and properties of CBM reservoirs, appropriate
network configurations were identified that could address most of the nonlinearities in the
system efficiently.
By providing this model with a large number of combinations expected on the
properties, reliable production forecasting can be obtained. Validity and reliability of this model
has been established by training the network several times and exposing them to samples it has
never seen before. Predictions were found to be very close to that of the simulation results.
Different methods to measure flow rates were identified and implemented in this study.
Flow rate as a function of time is shown to the final model as outputs and found to be efficient
than any other method that could be used. A user interface has been developed to enhance
practicability of the model.
The following important inferences could be made based on experience and various
procedures that were tried in various developmental phases of the model:
123
• The choice of number of hidden neurons is very crucial in developing a working model.
Overtraining and undertraining are possible and common problems that may result due
to choice of a wrong number of hidden layers.
• Input combinations chosen to run simulators should cover all ranges of values. At the
same time, all combinations should be physically possible and represent a potential gas
reservoir.
• Distribution of inputs using histograms should always be studied to make sure that
sufficient simulation runs are available to train the network.
• Instead of developing the final model directly, understanding simple models and
gradually increasing the complexity of the simple models by combining one or more of
them helps both understanding behavior of artificial neural networks as well as
application of the methodology to CBM reservoirs.
• Before deciding on increasing the number of simulation runs, different configurations
should always be tried to identify possibilities for any improvements in performance of
the network.
• Use of functional links is necessary to establish better understanding between inputs
and outputs. Sometimes, showing functions of inputs to the outputs helps in forcing the
network to learn better apart from the ease in predicting these functional links.
• Randomized choice of validation and testing data samples is necessary to establish
reliability of the network.
124
• The network should be trained more than once to make sure that prediction capabilities
of the model are not confined to a certain set of data samples that do not carry all the
commonalities in CBM reservoirs.
• In reservoirs with very high initial water saturation, predictions of peak flow rates were
always not precise.
• Finally, the capability of the model has been extended to predict water flow rates as the
time required to dewater a coalbed methane reservoir is very important in deciding on
the economics of gas production.
• It is desirable to train such a network with real field production data instead of data
from a simulator to promote practical use of such tools in reservoir engineering
applications.
125
CHAPTER 7
REFERENCES
• Aminian. K., Ameri. S., “Application of Artificial Neural Networks for reservoir
characterization with limited data”, Journal of Petroleum Science and Engineering, May
2005.
• Beaton. A., Langenberg. W., Pana. C., “Coalbed methane resources and reservoir
characteristics from the Alberta Plains, Canada”, International Journal of Coal Geology,
June 2005.
• Bodden III. W. R., Ehrlich. R., “Permeability of coals and characteristics of desorption
tests: Implications for Coalbed methane production”, International Journal of Coal
Geology, June 1997.
• Energy Information Administration (http://www/eia.doe.gov/), 2003.
• Ertekin. T., Dong. X., “In situ characterization of the transport and sorption
characteristics of coal seams from pressure transient data: An artificial neural network
approach”, Pennsylvania State University, University Park, U S A, 2003.
• Gaddy. D. E., “Coalbed methane production shows wide range of variability”, Oil and
Gas Journal, April 26, 1999.
• Garrouch. A. A., Lababidi. H. M. S., “Development of an expert system for
underbalanced drilling using fuzzy logic”, Journal of Petroleum Science and Engineering,
July 2001.
126
• Gharbi. R., “Application of an expert system to optimize reservoir performance”, Journal
of Petroleum Science and Engineering, May 2005.
• Gharbi. R. B. C., Mansoori .A.G., “An introduction to artificial intelligence applications in
petroleum exploration and production”, Journal of Petroleum Science and Engineering,
September 2005.
• Gorucu. F. B., Ertekin. T., “Optimization of Caron dioxide sequestration process design
parameters”, The Pennsylvania State University, University Park, 2005.
• Guo. X., Du. Z., Li. S., “Computer Modeling and Simulation of Coalbed Methane
Reservoir”, Society of Petroleum Engineers, SPE Paper No. 84815, Eastern Region/AAPG
Eastern Section joint meeting, September 2003.
• Hari. D., Ertekin. T., Grader. A. S., “Methods of neuro simulation for field development”,
Society of Petroleum Engineers, SPE Paper no. 39962, SPE Rocky Mountain Region Low
Permeability reservoirs Symposium, 1998.
• Jeirani. Z., Mohebbi. A., “Estimating the initial pressure, permeability and skin factor of
oil reservoirs using Artificial Neural Networks”, Journal of Petroleum Science and
Engineering, September 2005.
• Jochen. V. A., “Determining permeability in Coalbed methane reservoirs”, Society of
Petroleum Engineers, Paper No. 28584, SPE Annual Technical Conference, 1994.
• King. G. R., Ertekin. T., “Numerical Simulation of the transient behavior of Coal Seam
Degasification wells”, Society of Petroleum Engineers of AIME, 7TH SPE symposium on
Reservoir Simulation, 1983.
127
• Kolesar. J. E., Ertekin. T., Obut. S. T., “The unsteady state nature of sorption and
diffusion phenomena in the micropore structure of coal: Part I- Theory and
Mathematical Formulation”, SPE formation evaluation, Volume 5, Issue 1, 1990.
• Manik. J., Ertekin. T., “Development and validation of a compositional coalbed
simulator”, Journal of Canadian Petroleum Technology, April 2002.
• Manik. J., Ertekin. T., “Compositional Modeling of Enhanced Coalbed Methane
recovery”, The Pennsylvania State University, University Park, 1999.
• Mohaghegh. S. D., “A new methodology for the identification of best practices in the oil
and gas industry, using intelligent systems”, Journal of Petroleum Science and
Engineering, May 2005.
• Mohaghegh. S. D., Arefi. R., Ameri. S., Aminiad. K., Nutter. R., “Petroleum Reservoir
characterization with the aid of artificial neural networks”, Journal of Petroleum Science
and Engineering, May 1996.
• Mohaghegh. S. D., “Virtual Intelligence and its applications in Petroleum Engineering”,
Journal of Petroleum Technology, September 2000.
• Odusote. O., Ertekin. T., “Carbon dioxide sequestration in coal seams: A parametric
study and development of a practical prediction/screening tool using neuro simulation”,
SPE Annual Technical Conference, 2004.
• Ouahed. A. K. E., Tiab. D., Mazouzi. A., “Application of Artificial intelligence to
characterize naturally fractured zones in Hassi Messaoud Oil field, Algeria”, Journal of
Petroleum Science and Engineering, May 2005.
128
• Ramgulam. A., Ertekin. T., Flemings. P. B., “Utilization of artificial neural networks in the
optimization of history matching”, SPE Latin American and Caribbean Petroleum
Engineering conference, 2007.
• Remner. D. J., Ertekin. T., “Numerical Investigation of the competing effects of water
relative permeability and sorption characteristics of coal seams in methane drainage
processes”, The Pennsylvania State University, 1984.
• Saemi. M., Ahmadi. M., Varjani. A. Y., “Design of neural networks using genetic
algorithm for the permeability estimation of the reservoir”, Journal of Petroleum
Science and Engineering, March 2007.
• Simpson. D., “Producing coalbed methane at high rates at low pressures”, Society of
Petroleum Engineers, SPE Paper No. 84509, SPE Annual Technical Conference, October
2003.
• Soot. P. M., “Coalbed methane well production forecasting”, Society of Petroleum
Engineers, Paper No. 2435, Rocky Mountain Regional Meeting and Exhibition, May 21,
1992.
• Sung. W., Ertekin. T., “Development, testing and application of multi-well numerical coal
seam degasification simulator”, The Pennsylvania State University, 1987.
• Yilmaz. S., Demircioglu. C., Akin. S., Application of Artificial Neural Networks to optimum
bit selection”, Computers and Geosciences, June 2001.
• Zuber. M. D., “Production Characteristics and reservoir analysis of coalbed methane
reservoirs”, International Journal of Coal Geology, July 1998.
129
APPENDIX A
Source code: Generalized Model Algorithm
% Final Program - Most generalized one % Clear off all existing contents clear clc close all %Load matlab variable containing only inputs and outputs load inandoutdatawaterandgas1 %Create Transpose matrix for normalization output1 = log(output); input1 = log(input); % output1 = output; inputprog = input1'; outputprog = output1'; numtotal = 900; %Total number of datasets available in = inputprog; out = outputprog; numins = 14; %Total number of input elements numouts = 43; %Total number of output elements numtrain = 810;%Total number of training data sets numval = 45; % Total number of validation data sets numtest = 45; % Total number of testing data sets [inn,ps] = mapminmax(in,-1,1); %Normalizing input variables [outn,ts] = mapminmax(out,-1,1); %Normalizing output variables % % [traindata,valdata,testdata] = dividevec(inn,outn,0.05,0.05); %Categorizing data sets into training, validation and testing though not always preferred [traindata,valdata,testdata] = dividevec(inn,outn,0.05,0.05); %Categorizing data sets into training, validation and testing though not always preferred hncount = 3; % Number of hidden layers hn1 = 65; hn2 = 20; hn3 = 5; hn4 = 8; hn5 = 5; % hn4 = 8; %Create a new feed forward network net = newcf(minmax(inn), [hn1,hn2,numouts], {'tansig','tansig','purelin'},'trainscg','learngdm','msereg');
130
b1= zeros(hn1,1); b2 = zeros(hn2,1); b3 = zeros(numouts,1); w1 = zeros(hn1,numins); w2 = zeros(hn2,hn1); w3 = zeros(numouts,hn2); w1(:,:) = (2*rand(hn1,numins)-1)*0.3; w2(:,:) = (2*rand(hn2,hn1)-1)*0.3; w3(:,:) = (2*rand(numouts,hn2)-1)*0.3; b1(:,:) = 2*rand(hn1,1)-1; b2(:,:) = 2*rand(hn2,1)-1; b3(:,:) = 2*rand(numouts,1)-1; net.IW{1,1} = w1; net.LW{2,1} = w2; net.LW{3,2} = w3; net.b{1} = b1; net.b{2} = b2; net.b{3} = b3; %Set training parameters net.trainParam.goal = 0.0001; %Performance to be achieved net.trainParam.epochs = 20000; %Maximum number of epochs net.trainParam.show = 1; %Number of epochs to be shown on window % net.trainParam.mem_reduc = 200; net.trainParam.max_fail = 1000; % net.trainParam.min_grad = 1e-25; % net.trainParam.mu = 0.000; % net.trainParam.mu_dec = 0.1; % net.trainParam.mu_inc = 5; % net.performParam.ratio = 20/21; % net.trainParam.mu_max = 100; % net.trainParam.lr = 0.01; % net.trainParam.mc = 0.9; % net.trainParam.max_perf_inc = 1.02; %Start training the network % [net,tr] = train(net,traindata.P,traindata.T,[],[],valdata,testdata); % Please see train function syntax [net,tr] = train(net,traindata.P,traindata.T,[],[],valdata,testdata); % Please see train function syntax %Start simulating the network trainout = sim(net,traindata.P); valout = sim(net,valdata.P); testout = sim(net,testdata.P); %Denormalize the output obtained trainfinal = mapminmax('reverse',trainout,ts); valfinal = mapminmax('reverse',valout,ts); testfinal = mapminmax('reverse',testout,ts);
131
%Recollecting the original outputs traino = mapminmax('reverse',traindata.T,ts); valo = mapminmax('reverse',valdata.T,ts); testo = mapminmax('reverse',testdata.T,ts); %String labels for figure titles strlabel1 = {'qgascum(SCF)';'qwatercum(STB)'}; strlabel2 = {'flink1';'flink2'}; %Plotting all outputs %Plotting training errors traino = exp(traino); trainfinal = exp(trainfinal); testo = exp(testo); testfinal = exp(testfinal); for i = 1 : numouts traino(i,:) = exp(traino(i,:)); trainfinal(i,:) = exp(trainfinal(i,:)); testo(i,:) = exp(testo(i,:)); testfinal(i,:) = exp(testfinal(i,:)); end for i = 2 : 22 output(:,i) = output(:,i)*1000; end % Plotting training flow rates of gas ind = 1 : numtrain; for i = 2 : 11 CC = corrcoef(traino(i,:),trainfinal(i,:)); figure(2); subplot(5,2,i-1); plot(ind,traino(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,trainfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title(['| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end for i = 12 : 22 CC = corrcoef(traino(i,:),trainfinal(i,:)); figure(3); subplot(6,2,i-11); plot(ind,traino(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,trainfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title(['| R = ',num2str(CC(1,2))]);
132
xlabel('index'); legend('Actual','Network'); end %Plotting training flow rates of water ind = 1 : numtrain; for i = 23 : 32 CC = corrcoef(traino(i,:),trainfinal(i,:)); figure(4); subplot(5,2,i-22); plot(ind,traino(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,trainfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title(['| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end for i = 33 : 43 CC = corrcoef(traino(i,:),trainfinal(i,:)); figure(5); subplot(6,2,i-32); plot(ind,traino(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,trainfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title(['| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end for i = 2 : 22 for j = 1 : numtest testo(i,j) = testo(i,j) * 1000; testfinal(i,j) = testfinal(i,j)*1000; end end % ind = 1 : numtest; %Plotting testing flow rates of gas for i = 2 : 11 CC = corrcoef(testo(i,:),testfinal(i,:)); figure(6); subplot(5,2,i-1); plot(ind,testo(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,testfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title([num2str(timegas(1,i-1)),'days| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end
133
for i = 12 : 22 CC = corrcoef(testo(i,:),testfinal(i,:)); figure(7); subplot(6,2,i-11); plot(ind,testo(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,testfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title([num2str(timegas(1,i-1)),'days| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end %Plotting testing flow rates of water for i = 23 : 32 CC = corrcoef(testo(i,:),testfinal(i,:)); figure(8); subplot(5,2,i-22); plot(ind,testo(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,testfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title([num2str(timewater(1,i-22)),'days| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end for i = 33 : 43 CC = corrcoef(testo(i,:),testfinal(i,:)); figure(9); subplot(6,2,i-32); plot(ind,testo(i,:),'bo-','MarkerFaceColor','b'); hold on; plot(ind,testfinal(i,:),'r*--','Color',[1 0.5 0],'MarkerEdgeColor',[1 0.5 0],'MarkerFaceColor',[1 0.5 0]); title([num2str(timewater(1,i-22)),'days| R = ',num2str(CC(1,2))]); xlabel('index'); legend('Actual','Network'); end index = 0; for i = 1 : numtest index(i,1) = testdata.indices(i); % index(i,1) = 722 + i; end testo = testo'; testfinal = testfinal'; for i = 1 : numtest for j = 2 : 22 qactualgas(i,j-1) = output(index(i,1),j); qpredgas(i,j-1) = testfinal(i,j); end for k = 23 : 43 qactualwater(i,k-22) = output(index(i,1),k); qpredwater(i,k-22) = testfinal(i,k);
134
end end for i = 1 : numtest strtitle2 = ['Dataset ',num2str(index(i,1))]; createfigurewaterandgas(timegas(index(i,1),:),qactualgas(i,:),timegas(index(i,1),:),qpredgas(i,:),timewater(index(i,1),:),qactualwater(i,:),timewater(index(i,1),:),qpredwater(i,:),strtitle2); end for i = 2 : 11 figure(10) subplot(5,2,i-1); xmin1 = max(testo(i,:)); ymin1 = min(testo(i,:)); xmin2 = max(testfinal(i,:)); ymin2 = min(testfinal(i,:)); xmil = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ylim = [min([ymin1 ymin2]) max([xmin1 xmin2])]; xtemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ytemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; plot(testo(i,:),testfinal(i,:),'MarkerFaceColor',[0 0 0],'MarkerSize',8,'Marker','x','LineStyle','none'); CC = corrcoef(testo(i,:),testfinal(i,:)); str = [num2str(timegas(1,i-1)) 'days']; title(['% accuracy =', num2str(CC(1,2))]); text(min([ymin1 ymin2])*6/5, (max([xmin1 xmin2])) *7/8,str) hold on; plot(xtemp,ytemp,'Color','r','LineStyle','-'); end for i = 12 : 22 figure(11) subplot(6,2,i-11); xmin1 = max(testo(i,:)); ymin1 = min(testo(i,:)); xmin2 = max(testfinal(i,:)); ymin2 = min(testfinal(i,:)); xmil = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ylim = [min([ymin1 ymin2]) max([xmin1 xmin2])]; xtemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ytemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; plot(testo(i,:),testfinal(i,:),'MarkerFaceColor',[0 0 0],'MarkerSize',8,'Marker','x','LineStyle','none'); CC = corrcoef(testo(i,:),testfinal(i,:)); str = [num2str(timegas(1,i-1)) 'days']; title(['% accuracy =', num2str(CC(1,2))]); text(min([ymin1 ymin2])*6/5, (max([xmin1 xmin2])) *7/8,str) hold on; plot(xtemp,ytemp,'Color','r','LineStyle','-'); end for i = 23 : 32 figure(12) subplot(5,2,i-22); xmin1 = max(testo(i,:));
135
ymin1 = min(testo(i,:)); xmin2 = max(testfinal(i,:)); ymin2 = min(testfinal(i,:)); xmil = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ylim = [min([ymin1 ymin2]) max([xmin1 xmin2])]; xtemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ytemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; plot(testo(i,:),testfinal(i,:),'MarkerFaceColor',[0 0 0],'MarkerSize',8,'Marker','x','LineStyle','none'); CC = corrcoef(testo(i,:),testfinal(i,:)); str = [num2str(timewater(1,i-22)) 'days']; title(['% accuracy =', num2str(CC(1,2))]); text(min([ymin1 ymin2])*6/5, (max([xmin1 xmin2])) *7/8,str) hold on; plot(xtemp,ytemp,'Color','r','LineStyle','-'); end for i = 33 : 43 figure(13) subplot(6,2,i-32); xmin1 = max(testo(i,:)); ymin1 = min(testo(i,:)); xmin2 = max(testfinal(i,:)); ymin2 = min(testfinal(i,:)); xmil = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ylim = [min([ymin1 ymin2]) max([xmin1 xmin2])]; xtemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; ytemp = [min([ymin1 ymin2]) max([xmin1 xmin2])]; plot(testo(i,:),testfinal(i,:),'MarkerFaceColor',[0 0 0],'MarkerSize',8,'Marker','x','LineStyle','none'); CC = corrcoef(testo(i,:),testfinal(i,:)); str = [num2str(timewater(1,i-22)) 'days']; title(['% accuracy =', num2str(CC(1,2))]); text(min([ymin1 ymin2])*6/5, (max([xmin1 xmin2])) *7/8,str) hold on; plot(xtemp,ytemp,'Color','r','LineStyle','-'); end
136
APPENDIX B
Feed-forward Back-propagation algorithm
In the back-propagation algorithm, the output is calculated in the forward direction and the
error is propagated in the backward direction. A neural network that works on back propagation
consists of an input layer, one or more hidden layers and an output layer. The number of neurons in the
input layer is equal to the number of inputs. The number of neurons in the hidden layer(s) is decided
upon, by the user and the number of neurons in the output layer is simply equal to the number of
outputs. Each of the connections between each of the neurons in the network has a weight and is used
to calculate the net output from each layer. Consider a simple network given below:
As seen in the network, each of the neurons in a layer is connected to each of the neurons in the layers
before and after it. Before understanding how the outputs are calculated for each layer, let us see what
exactly happens with these data in a neural network. First the outputs from the input layer become the
inputs to the hidden layer. These outputs are then applied on a transfer function which then becomes
the output for the hidden layer. Again, these outputs are applied on a transfer function to become the
outputs for the output layer. The calculated output is then compared with the desired output and the
I1
I2
I3
H1
H2
O1
137
error determined. This error is propagated in the backward direction to determine the new weights
between the layers such that the error is reduced to a minimum. The newly calculated weights are then
applied to another data sample and the same procedure repeated to determine the new weights. The
output prediction and error propagation are continued till the Mean Squared error in all the data
samples are reduced to a certain minimum value as desired by the user. Let us now understand how this
error propagation is done.
The error propagation follows the generalized delta rule.
For any layer k, the error function is given by:
∑ --------------------------------------------------- (1)
Where, m is equal to the number of outputs, Tm is the desired output and Om is the predicted output.
The change in error with changes in weights is calculated for each layer. The idea is to modify the
weights in the direction of minimization of error for each of the data samples in the training data sets.
After passing the weights once through each layer in the network in the forward direction and after
calculating the errors, the rate of change of error with change in weights is determined for the last layer.
This gradient is given by,
------------------------------------------------------------- (2)
Where, Ek is the error of the layer under study, Oki is the output of the layer k for each hidden neuron i in
layer k and Wij is the weight between the neurons i and j.
By chain rule, our required derivative is the product of 2 derivatives as shown in (2). The first derivative
can be calculated by differentiation of the error in (1) with respect to output.
138
Hence, --------------------------- (3)
Thus the change in the output layer is given by (3). Now, the output of the hidden layer is the input to
the output layer. The summation is applied on the transfer function between the hidden layer and the
output layer to determine the predictive outputs. Defining the inputs to the output layer from the
hidden layer as netHj, where j refers to the hidden neuron, we can say that for a layer k,
∑ --------------------------------------------------- (4)
Where, i refers to the output neuron and j refers to the neurons in the previous layer.
----------------------------------------------------------------- (5)
Where, i refers to the neuron in the output layer.
Applying the general rule in (2) to the any layer k, we get,
------------------------------------------------------ (6)
From (4), the second derivative of (6) is given by,
-------------------------------------------------------------------- (7)
Using chain rule, the first derivative in (6) can be calculated as follows:
------------------------------------------------------- (8)
From (5),
---------------------------------------------------------- (9)
139
The value of the first derivative of (8) depends on which layer is being studied currently. Let us calculate
this derivative for two different cases, the output layer and the hidden layer.
For the output layer, since the error function is defined already, the derivative is simply given by (3).
Thus the change in the output layer for each output neuron j is given by,
-------------------------------------------------- (10)
Where, Tj is the desired output and Oj is the predicted output for each output neuron j. Here, the
negative sign in (3) diminishes as we are calculating the negative gradient of the error.
In case of the hidden layer, thinking on the same lines as that of the output layer, the outputs from the
first layer become inputs to the hidden layer. A transfer function is applied on each of the hidden
neuron values to determine the layer’s outputs. Referring to the inputs to the hidden layer as netIi, for
each hidden neuron i, the output from the hidden layer is given as,
------------------------------------------------------------------- (11)
Writing (8) for the hidden layer, we get,
-------------------------------------------------------- (12)
From (11), --------------------------------------------------- (13)
∑ -------------------------------------------------- (14)
Here, the change in the output layer is multiplied by the weights to calculate the change for the hidden
layer. The error is propagated backward and hence the name of the algorithm is seen. Thus, the change
in the outputs of the hidden layer is given by (14). Therefore,
140 ---------------------------------------------------------- (15)
After the negative gradients of the error in each layer are calculated, the weights are updated to
minimize error in prediction when applied to subsequent data samples.
Thus, the updates in weights for the hidden layer and the output layer are given by (16) and (17)
respectively.
& ------------------- (16)
& ---------------- (17)
After updating the weights, the new weights are applied to another data sample in the training data set
and the error measured. A cycle of completion of this process once through every data sample in
training is defined as an epoch. After an epoch, a stopping criterion is usually given which may be any
one of the following:
1. Maximum number of epochs is reached
2. Minimum error is achieved.
When stopping criterion is reached, the weights are applied to the testing data samples to
predict outputs for inputs that the network has never seen before. To avoid divergence in the direction
of minimization of errors, usually a fraction of the weight updates of the previous iteration are added to
the new weight changes so that the network can pass through the local minima. This is called the
momentum term. In (16) and (17), the term is called the learning rate which is usually a value
between 0 and 1 and can be modified based on the complexity of the problem under study and the
robustness of the network.
141
APPENDIX C
Sample data file used for training
INPUTS
Kx Ky h φ ρ Pi Swi VL PL T Pwf Well
length Nx Swirr 10 10 40 1 1.2 3500 98 758.8 20 15 50 7 15 25 5 5 35 2 1.3 3000 30 379.4 800 100 300 11 25 15 10 10 30 3 1.4 2500 50 607.04 1800 200 100 5 11 20 50 50 25 4 1.5 2000 70 531.16 1500 300 14.7 3 9 25
100 100 28 5 1.6 1500 80 75.88 600 50 100 9 19 10 250 250 5 6 1.7 1000 90 303.52 150 15 400 9 21 15 50 50 20 7 1.8 500 95 455.28 250 800 250 5 19 20
100 100 35 8 1.9 1500 100 75.88 1500 50 700 9 25 25 1000 1000 24 10 1.35 300 55 607.04 200 40 150 7 15 15
5 2.5 30 9 1.6 2300 70 758.8 300 600 300 11 25 20 10 5 40 8 1.5 800 90 303.52 1800 250 100 9 21 25 50 25 30 7 1.7 1500 95 607.04 800 300 500 7 19 25
100 50 25 6 1.9 2500 90 455.28 1500 150 500 3 9 10 250 125 25 5 2 500 99 455.28 500 400 200 5 11 25 10 5 35 4 1.2 1750 85 303.52 1750 300 500 9 21 20
700 350 20 3 1.35 100 75 682.92 1750 80 50 7 15 15 900 450 30 2 1.33 100 60 455.28 500 200 50 5 19 10 1000 500 32 1 1.5 200 55 758.8 100 50 100 5 15 20
1 1 24 5 1.7 3000 45 758.8 800 40 1000 7 25 25 10 3.3333 40 3 1.8 3500 50 151.76 1250 150 500 9 19 10 50 16.6667 15 1 1.9 1500 30 303.52 2000 500 300 7 15 15
100 33.3333 10 2 2 1200 40 379.4 1700 100 100 5 11 20 250 83.3333 20 6 1.2 200 90 758.8 150 250 50 9 19 25 500 166.666 35 4 1.4 200 100 682.92 200 50 100 9 21 25 700 233.333 10 9 1.6 150 95 758.8 300 250 80 11 25 20 900 300 8 8 1.8 200 85 531.16 800 100 100 7 15 10 1000 333.333 18 10 2 200 75 682.92 2000 800 100 9 25 15
10 10 40 2 1.3 3500 80 758.8 1000 50 500 5 19 10 1 0.25 30 4 1.5 3500 90 682.92 1500 100 200 7 15 15 50 12.5 12 6 1.7 1500 70 455.28 800 30 500 7 25 20
100 25 32 8 1.9 1400 60 379.4 1200 900 400 9 21 25 250 62.5 5 10 2 1000 40 758.8 250 45 300 7 19 20 500 125 15 1 1.8 300 30 531.16 2000 650 150 9 25 25 900 225 40 5 1.4 100 65 682.92 1000 500 50 3 9 25 1000 250 20 7 1.2 1200 75 758.8 900 100 400 5 11 15