Application of Computer Based Simulation in Gas Network System
Application of Computer Based Simulation in Gas Network System
I would like to thank my family for their unselfish support, patience and
encouragement during the whole period of the research. I thank them all and
dedicate this thesis to them with all my love.
Last but not least, I would like to express my thanks to all other friends that
support and help me in this research. Thank you.
ABSTRACT
The existing gas network software is highly depending on the Breadth First
Search (BFS) and the Depth First Search (DFS) in performing gas network
computation of any topology. This is causing the other graph theory algorithms
remain least known to users. Apart from that, there are many numerical methods that
can be used in performing the gas pipeline network analysis. Thus, the hypothesis of
the method states that the Newton Gauss Elimination method is faster and more
accurate than the Newton Gauss Seidel method. The objectives of this research are
to determine the fastest graph theory algorithm , and to determine the fastest and the
most accurate numerical method, in the development of gas network computer
simulator. The developed computer simulator applies the Newton Nodal Method in
performing the network analysis. Object oriented approach was used in designing
the structure of the computer simulator. Two case studies and one extended case
study were performed. Case study 1 and 2 involve 5 nodes low pressure gas pipeline
network and 6 nodes medium pressure gas pipeline network respectively. The
extended case study 1 involves 7 nodes high pressure gas pipeline network. The
flow results from the computer simulator in the case study 1 and 2 were compared
with GaPIS version 2.3. While in the extended case study, two flow equations for
high pressure gas network system were compared for the accuracy. In conclusion,
the BFS is the fastest graph theory with 5.37 milliseconds for case study 1, 5.48
milliseconds for case study 2 and 5. 62 milliseconds for extended case study 1. The
Newton Gauss Elimination is the fastest numerical method with 34.86 milliseconds
for case study 1, 46.35 milliseconds for case study 2 and 50.26 milliseconds for
extended case study 1. The combination of BFS and Newton Gauss Elimination
gives the fastest speed, with 40.23 milliseconds in case study 1, 51.83 milliseconds in
case study 2 and 55.87 milliseconds in extended case study 1. The average
accurac ies of both numerical methods for case study 1, case study 2 and extended
case study 1 are 99.22%, 95.64% and 91.71% respectively.
ABSTRAK
Perisian komputer gas sekarang amat bergantung kepada Breadth First Search
(BFS) dan Depth First Search (DFS) untuk mewakili sistem rangkaian gas dalam
komputer. Ini menyebabkan teori graf yang lain kurang diketahui oleh pengguna. Di
samping itu, terdapat pelbagai kaedah berangka boleh digunakan dalam
menyelesaikan analisis rangkaian talian gas. Oleh itu, hipotesis tentang kaedah ini
menyatakan bahawa Newton Gauss Elimination adalah lebih cepat dan lebih jitu
daripada kaedah Newton Gauss Seidel. Objektif kajian ini adalah untuk menentukan
teori graf yang paling pantas, dan menentukan kaedah berangka yang paling pantas
dan paling jitu dalam membangunkan suatu perisian simulasi rangkaian gas. Perisian
simulasi ini mengaplikasikan kaedah Newton Nodal dalam menyelesaikan analisis
rangkaian. Pendekatan berorientasi objek telah digunakan dalam mereka struktur
utama perisian simulasi. Dua kajian kes dan satu kajian kes tambahan telah
dijalankan. Kajian kes 1 dan 2 masing-masing melibatkan 5 nod talian rangkaian gas
bertekanan rendah dan 6 nod talian rangkaian gas bertekanan sederhana. Kajian kes
tambahan 1 melibatkan 7 nod talian rangkaian gas bertekanan tinggi. Nilai aliran
daripada perisian simulasi bagi kajian kes 1 dan 2 dibandingkan dengan keputusan
daripada GaPIS versi 2.3. Manakala, untuk kajian kes tambahan, dua persamaan
aliran bagi rangkaian gas bertekanan tinggi telah dibandingkan untuk menilai
kejituannya. Pada kesimpulannya, BFS ialah teori graf yang terpantas, dengan 5.37
milisaat untuk kajian kes 1, 5.48 milisaat untuk kajian kes 2 dan 5.62 milisaat untuk
kajian kes tambahan 1. Newton Gauss Elimination ialah kaedah berangka yang
terpantas dengan 34.86 milisaat untuk kajian kes 1, 46.35 milisaat untuk kajian kes 2
and 50.26 milisaat untuk kajian kes tambahan 1. Penggabungan BFS dengan Netwon
Gauss Elimination memberikan kelajuan terpantas, dengan 40.23 milisaat bagi kajian
kes 1, 51.83 milisaat bagi kajian kes 2 and 55.87 milisaat bagi kajian kes tambahan 1.
Kejituan purata bagi kedua-dua kaedah berangka untuk kajian kes 1, kajian kes 2 dan
kajian kes tambahan 1 ialah 99.22%, 95.64 dan 91.71%.
TABLE OF CONTENTS
1 INTRODUCTION
1.1 Introduction 1
1.2 Problem Statement 2
1.3 Objectives 3
1.4 Scope of Study 3
2 LITERATURE REVIEW
2.1 Introduction 5
2.2 Gas Network 5
2.3 Object Oriented 6
2.3.1 Object 8
2.3.2 Message 9
2.3.3 Class 9
2.3.4 Domain 9
2.3.5 Object Oriented Decomposition 9
2.3.6 Notation 10
2.3.7 Object Oriented Development 11
2.3.7.1 Encapsulation 11
2.3.7.2 Inheritance and Reuse 11
2.3.7.3 Polymorphism 11
2.4 Graph Theory 11
2.4.1 Depth First Search 12
2.4.2 Breadth First Search 13
2.4.3 Spanning Tree Algorithm 13
2.4.4 Dijkstras Minimum Path Algorithms 15
2.4.5 Strongly Connected Components 16
2.4.6 Application of Graph Theory Algorithms In 16
Gas Network System
2.4.7 Basic Analysis of Graph Theory Algorithms 19
2.5 Network Analysis 20
2.6 Common Flow Equations 21
2.6.1 Selection of Flow Equations 22
2.6.2 Kirchhoffs First Law 25
2.6.3 Kirchhoffs Second Law 27
2.6.4 Newton Nodal Method 28
2.6.5 Newton Loop Method 32
2.6.6 Newton Nodal Method Versus Newton Loop 36
Method
2.7 Numerical Solution Of Linear Algebraic Equation 36
2.7.1 Gauss Elimination Method 37
2.7.2 Gauss Seidel Method 39
2.8 Commercial Software 40
3 METHODOLOGY
3.1 Introduction 42
3.2 Structural Design Method 43
3.5 Object Oriented Approach for Computer simulator 44
Design
3.4 Procedure 45
3.5 Computer Program Selection 46
3.6 Formulae and Methods Selection 46
3.7 Computer Simulator Development 47
3.7.1 Graphical User Interface(GUI) 47
3.8 Results Testing 48
3.9 Modification 49
3.10 Results 49
3.11 Process Flow Diagram for Computer Simulator 49
3.11.1 Graph/Drawing Type Selection 51
3.11.2 Draw the Graph/Drawing 51
3.11.3 Algorithms Selection 51
3.11.4 Graph Results 51
3.11.5 Data Input For Network System and Network 52
System Calculation
3.11.6 Calculation Results 53
REFERENCE 116
LIST OF TABLES
INTRODUCTION
1.1 Introduction
Natural gas is one of the most important energy sources used in the world,
besides oil and coal. Normally natural gas is supplied to users through natural gas
pipeline system. Many pipeline systems are built throughout the world, from the gas
reservoir to the end users, in order to support the highly increasing demand for
natural gas. In America alone, from 1996 to 1998, at least 78 pipeline construction
projects were completed adding approximately 11.7 billion cubic feet per day of
capacity [1]. Meanwhile in Malaysia, as in January 2004, network of gas pipeline
covering a total of 1,193.9 kilometres (831.7 kilometres completed) is constantly
expanding to reach a larger population [2 ].
Natural gas pipeline systems become very complex as years pass by. The
complexity of the gas pipeline systems makes people think ways to solve it. Program
development is one of the solutions. With the help of computer program, people can
gain information regarding the construction site and the pipeline chosen; design the
gas pipeline systems and performing the network analysis before the construction of
the actual pipeline systems.
This research is to develop a program that can help the users to design the
pipeline system and solve the network analysis. Besides that, users can also know
the pressure of certain point along the pipeline systems and load or flow rate of the
pipe leg.
1.2 Problem Statement
There are many numerical methods that can be used in solving the network
analysis. The commonly used numerical methods are Newton Gauss Elimination
method and Newton Gauss Seidel method. Thus, hypothesis of Newton Gauss
Elimination method is faster than and more accurate than Newton Gauss Seidel
method exists. This research helps users to understand both numerical methods and
to determine the fastest and more accurate numerical method on steady state gas
network system.
1.3 Objectives
The main objective of the research is to determine the fastest graph theory
algorithms selected based on the computation time obtained in the development of
gas network computer simulator.
In addition, the other objective of this research is to determine the fastest and
the most accurate numerical methods in the development of gas network computer
simulator. The numerical methods will be tested for their speed of execution
(computation time) and checked their accuracy based on the flow results obtained
from the computer simulator.
In this research, a computer simulator for gas pipeline network system will be
developed. This computer simulator can be used to simulate natural gas distribution
network systems.
After choosing the right computer program and the programming language,
studies of the existing software in the market will be done before the design of the
structure of the gas network program. Object oriented approach will be used in the
designing of the structure of the program.
Next, studies on different graph theory algorithms and numerical methods
will be done due to different graph theory algorithms and numerical methods will be
implemented into the computer simulator. There are five graph theory algorithms
that will be studied, which are Breadth First Search (BFS), Depth First Search (DFS),
Minimum Spanning Tree (MST), Strongly Connected Components (SCC) and
Dijkstras Minimum Path. Meanwhile, two numerical methods are studied, which
are the Newton Gauss Elimination method and the Newton Gauss Seidel method.
The final step is to study the way of performing the network analysis. In
performing the network analysis, Newton Nodal method in steady state condition and
several of flow equations will be used. A network is in a steady state when the
values of the quantities characterizing the flow of gas in the system are independent
of time and the system is described by a set of nonlinear algebraic equations [4]. In
steady state analysis, the pressure of the nodes and the flow rate in the pipes must
satisfy the flow equations and the value of load node and source node must fulfil the
two Kirchhoffs laws, which are the Kirchhoffs first law and Kirchhoffs second law
(see Chapter 2).
CHAPTER 2
LITERATURE REVIEW
2.1 Introduction
Gas distribution network can be classified in two different types namely tree
or loop [5, 6]. The concept of the tree and loop as mathematical entities was firstly
proposed by Kirchhoff in the connection with the definition of fundamental circuits
used in the analysis of electrical circuit [7]. The tree type pipeline system happens
where the pipeline system is not in the loop condition. While for the loop type
system, the pipeline system contains loops.
It is much easier to solve the calculations for the tree type system compare to
the loop type pipeline system. This is due to the looped nature, gas flow and
direction of each pipe cannot easily be calculated. By calculating the pressure drop
of the pipeline based on appropriate formulations can easily solve the calculations of
the tree type pipeline system. While for the loop type pipeline system, a trial and
error method is needed to solve the network calculation, with the help of specified
formulations and numerical methods.
There are about five main kinds of programming styles. Table 2.1 shows the
kinds of programming styles, as well as kinds of abstractions used [8].
Table 2.1: Main kinds of programming styles and kinds of abstractions used
Due to these reasons, object oriented approach is chosen for design the basic
structure of the simulator . B y using this approach, an architectural framework of the
simulator can be formed. In order to use this approach, firstly, one has to understand
the meaning of object oriented programming, object or iented analysis and object
oriented design.
The meanings of these three important phases of object oriented are as shown
as below [8, 10, and 11].
An object has state, behaviour, and identity; the structure and behaviour of
similar object are defined in their common class; the terms instance and object are
interchangeable. The state of an object encompasses all of the properties of the
object and the current values of each of the properties. The behaviour is how an
object acts and reacts, in term of its state changes and message passing. The identity
is that property of an object which distinguishes it from all objects [8]. Most objects
can be categorized into five categories [12] :
iv. Interactions. Objects that result from associations between other objects. For
example, connections of two pipes.
An object can only act as an actor, server or agent. An actor is object that can
operate upon other objects and never operated upon by other objects. A server is
object that can only operated upon by other objects. An agent is object that can both
operate upon other objects and operated upon by other objects [8].
2.3.2 Message
Message passing only happens when an object relates with other objects [13,
14]. There are two types of messages, which are the unidirectional message and
bidirectional message. Unidirectional message is only a one -way message while the
bidirectional message is a two-way message. Examples of unidirectional message
and bidirectional message are relationships between a general with a soldier and
relationships between husband and wife respectively.
2.3.3 Class
2.3.4 Domain
2.3.6 Notation
2.3.7.1 Encapsulation
The property of being a self -contained unit is called encapsulation [15]. With
encapsulation, data hiding can be accomplished. Data hiding is the highly valued
characteristic that an object can be used without the user knowing or caring how it
works internally [15].
2.3.7.3 Polymorphism
The procedure of Depth First Search for both directed graph and undirected
2) If there is an unexplored edge (branch) at the vertex at the head of the search
path leading to an unexplored vertex w, extend the search path to w, which
becomes its new head and repeat step (2).
4) If there are no further unexplored edges at the head of the search path, retract
the search path to the previous vertex by removing the current head of the
path and repeat step (2).
The Depth First Search method visits all the vertices. It always advances
from its last explored vertex, making the path drive deeper into the graph before it
explores closer region of the graph.
2.4.2 Breadth First Search (BFS)
The Breadth First Search method is like the Depth First Search Method.
Breadth First Search is a traversal through a graph that touches all the vertices
reachable from a particular vertex. However, unlike DFS method, BFS explores all
the neighbours of the particular vertex before proceeds to the neighbours of its
neighbours. This method is liked a wave of emanating from the stone drop into the
pool of water [22].
Step 1: Select any edge that is not a loop. Colour this edge blue and place both its
endpoints into an empty bucket.
Step 2: Select any uncoloured edge that is not a loop. (If no such edge exists, stop
the algorithm; no spanning tree exits.) One of four different situations must occur:
If item (i) occurs, colour the edge orange (not in the tree) and return to Step 2. If (ii)
occurs, colour the edge blue (in the tree) and assign the un-bucketed endpoint to the
same bucket as the other endpoint. If (iii) occurs, colour the edge blue and assign
both endpoints to an empty bucket. If (iv) occurs, colour the edge blue and combine
the contents of both buckets into one bucket, leaving the other bucket empty. Go to
Step 3.
Step 3: If all the vertices of the graph are in one bucket, stop the algorithm since the
blue edges form a spanning tree. Otherwise, return to Step 2.
(Note that each time a step of the algorithm is performed an edge is indelibly
coloured. If there are only a finite number of edges in the graph, then the algorithm
must stop after a finite number of steps)
If the algorithm does not terminate with a spanning tree, then no spanning tree exists
for the graph for the following reason: The algorithms will terminate with two sets
(buckets) of vertices that have no edge joining a member of one set to a member of
the other set. Otherwise, such an edge would have been coloured blue by the
algorithm and the tow buckets would have been merged together. Hence the
algorithm does what it is supposed to do, construct a spanning tree.
The minimum spanning tree algorithm examines the edges in order of
ascending weight (smallest first, largest last). If two or more edges have the same
weight, order them arbitrarily. This algorithm is used in to determine the total
weight, which represents cost, length and others of the links used is a minimum; and
all the points are connected together.
Dijkstras algorithm solves the shortest path problem for a directed graph
with nonnegative edge weights. For example, if the vertices of the graph represent
gas wells and edge weights represent distances between pairs of wells connected by a
pipeline, this algorithm can be used to find the shortest route between two gas wells.
Step 1: Initially all arcs and vertices are uncoloured [23]. Assign a number d(x) to
each vertex x to denote the length of the shortest path from s to x that uses only
coloured vertices as intermediate vertices. Initially, set d(s) = 0 and d(x) = 8 for all x
? s. Let y denote the last vertex to be coloured.
d ( x ) = min{ d ( x ), d ( y ) + a ( y , x )}
If d(x) = 8 for all uncoloured x, then stop because no path exists from s to any
uncoloured vertex. Otherwise, colour the uncoloured vertex x with the smallest
value of d(x). Also colour the arc directed into vertex x from a colo ured vertex that
determined the value of d(x) in the above minimization. Let y = x.
Step 3: If vertex t has been coloured stop because a shortest path from s to t has been
discovered. This path consists of the unique path of coloured arcs form s to t. If
vertex t has not been colo ured yet, repeat Step 2.
A graph is said to be strongly connected if for any two vertices xi and xj, there
is at least one path going to vertices xi and xj [21]. For a strongly connected graph,
vertex xj is reachable from vertex xi and vice versa for any xi and xj , the strong
component containing a given vertex xi is unique and xi will appear in the set of
vertices of one and only one strong component.
As stated, graph theory is very useful in order to represent the gas network
computation of any topology. Thus, graph theory can check the connectivity of the
gas network system.
3 6
5
2
Based on Figure 2.1, using Breadth First Search method, to reach node 5
1
from node 1, firstly all the neighbouring nodes of node 1, which4are node 2 and node
3
3 will be checked. After that node 2 will go to node 4 while node 3 will go to node 4
2
and node 5. Lastly the method stops due to the desired node is reached. This means
this graph is a connected graph.
For the same figure, now using the Depth First Search method, to reach node
5 from node 1, firstly node 1 will go to node 2 through edge 1. This is followed
respectively by the nodes, which are from node 2 to node 4 through edge 3, from
node 4 to node 3 through edge 4 and from node 3 to node 5 through edge 6. After all
the nodes are touched, the method stops. The graph now is also a connected graph.
Now, saying the graph shown in Figure 2.1 is changed to a weighted graph
like Figure 2.2 as shown in the following page.
3 7
3 5
1 9
4
2
6 Note:
2 Weight
Since all the vertices are in the bucket, the algorithm stops at edge (3, 5).
Edge (4, 5) is uncoloured. Four edges (1, 2), (1, 3), (2, 4) and (3, 5) form a minimum
spanning tree of the graph.
Using Dijkstras algorithm, the steps used in carrying out the analysis are
given as (from vertex 1 to vertex 5, so s=1; t=5):
i. Initially only vertex 1 is coloured, d(1) = 0, and d(x) = 8 for all x ? 1
ii. Set y = 1
As a result, d(2) = 2
Understanding the effects of different graph theory algorithms on the gas network
system is very important. By using graph theory algorithms, any graph in the gas
network system drawn can be proved whether the graph drawn is connected or not.
If the graph drawn is not connected, the algorithms will tell the defects to users.
After studying all the five graph theory algorithms, a basic analysis on all the
graph theory algorithms has been done. This basic analysis is done with the purpose
of helping the user to have a clear picture on all the five graph theory algorithms that
will be used in the development of gas network computer simulator. Table 2.3 is the
summary of analysis on graph theory algorithms based on the difference in the
methods used and their applications.
Algorithms Analysis
Method Application
BFS Uses a queue Used to find the shortest path in un-
weighted graph
DFS Uses a stack Used to find cycles, to produce
topological ordering or to determine
which nodes are reachable from a
given node
MST Examining the edge in the Used to obtain optimal solution and
order of ascending weight a minimum total cost in a graph
Dijkstras Used shortest path algorithm Used to find the shortest path from
Shortest the given node to the destination
Path node in weighted graph
SCC Uses DFS method Used to find the strong connected
components in directed graph
Natural gas network analysis is used to determine the amount of gas, flow
rate of the gas and the pressure used in a pipeline system. Besides that, it also can
used to determine the usage of gas by consumers especially during the peak times.
By making the network analysis, time of maintenance and failure of pipeline can be
measured. The effect of new load on the pipeline also can be predicted. Generally,
network analysis can be divided into three type, that are Network tracing, Network
routing and Network Allocation [24]. Network tracing is done in order to trace the
location of the particular pipeline in the system. Network routing is done in order to
find out the optimum path or the shortest path, which costs less for the system.
Network allocation is done in order to relocate all the pipelines into the main support.
Common flow equation can be expressed in a general form [4]. For any pipe
k, the pipe flow equation from node i to node j can be expressed as
[(Q n ) k ] = K k (Q nm1 ) k
For the medium and high pressure version of the flow equation
[(Qn ) k ] = K k (Qnm1 ) k = Pi P j = Pk
where Pi = pi2 , Pj = p 2j
The equations for low pressure and for medium and high pressures can be
rearranged:
1
[ pk ] = (Qn ) k = ( pk / K k ) 2 (2. 1)
1
[ Pk ] = (Qn ) k = (Pk / K k ) m 1 (2.2)
Equations (2.1) and (2.2) can be rearranged to the form as below after taking
account of the fact that a change of the flow direction of the gas stream may take
place in the network.
S ij ( p i p j ) 1
(Qn ) k = S ij ( )2 (2.3)
Kk
S ij ( p i p j ) 1
(Qn ) k = S ij ( ) m1 (2.4)
Kk
Flow equations are required to calculate the pressure drop in the gas network
system. There are many flow equations that can be used in gas industry. Majority of
them are developed based on the results of gas flow experiments. Thus, they are
only capable to a limited range of flow and pipe surface conditions Table 2.4 shows
the guidelines to the selection of a flow equation for the distribution system
calculation [25, 26].
. Six flow equations are mainly used in this research and applied into the
computer simulator. They are Laceys equation, Poles equation, Coxs equation,
Polyflo equation, Panhandle A equation and Weymouth equation [27, 28, 29, 30
and 31]. These equations are shown in Table 2.5. Laceys and Poles equation are
flow equations for low pressure network. Coxs and Polyflo equation are flow
equations for medium pressure network. Panhandle A and Weymouth equation are
flow equations for high pressure network. For Weymouth, length L and D is in
meter (m) and pressure P is in Pascal (Pa).
Coxs ( p1 p 2 ) D 5
2 2 L
Q = 1 .69 10 3 K = 206 .22527 10 3
SL D5
Polyflo ( p1 p 2 ) D 5
2 2 L
Q = 7.57 10 4 Tn K = 27.24
Pn fSLT E D 4.848
2
Panhandle A ( p1 p 2 ) D 5
2 2 L
Q = 7.57 10 4
Tn K = 18.43 2
Pn fSLTZ E D 4 .854
Weymouth ( p1 p 2 )
2 2 L
T
Q = 11854124 .6 n D 8 / 3 K = 2590000
Pn SLT D 16 / 3
Assumptions have been made for the six flow equations above. These
assumptions have been made in order to avoid confus ion to the users of this
computer simulator and to help users to understand the reasons of picking the six
flow equations above. Table 2.6 shows the limitation and assumptions made for the
six flow equations.
The fraction factor, f can be calculated using the equations given in the Table
2.6. There is no fraction factor for Coxs and Weymouth, because the value is
already inserted into the flow equations. In this research, the specific of gas is
assumed to be 0.589 and the compressibility factor, Z is assumed 0.95. These two
values are subjected to change, depend on the type of natural gas (natural gas
properties) and the type of pipe used. The temperature and pressure is assumed as
standard temperature and standard pressure, normally used by international gas users
in solving network analysis. The efficiency factor normally varies between 0.8 and 1
for most gas pipes [32]. The actual flow in a pipe will be 80% of the flow predicted
[4]. So, the efficiency factor, E in this research is assumed to be 0.8.
Table 2.6: Limitation and Assumption Made for the Six Flow Equations
= 11.98 E
f D
S = 0.589
T = 288K
Panhandle A >7 1 SQ
0 .073
= 14.94 E
f D
S = 0.589
Tn = T = 288K, Pn = 1.01325 bar
Z = 0.95, E = 0.8
Weymouth >7 S = 0.589
Tn = T = 288K, Pn = 101.325 kPa
Kirchhoffs first law states that the algebraic sum of the flows at any node is
zero [4]. This means that any load at any node is equal to the sum of the branch flows
into and out of the node.
Q1 + Q2 + Q3 ... + Qn = Load
Load Q = 0
Load = Q (2.5)
where Q1 + Q2 + Q3 ... + Qn = Q
Q = total flow in the branches, depend on the flow direction
Load = demand in the load nodes,
L = A1 Q (2.6)
The pressure drop in the branches can be related to the nodal pressures.
The nodal pressure drop equation can be expressed in matrix form:
P = - AT P (2.7)
Q = ' ( P) (2.8)
L = A1 [ ' ( A T P )] (2.10)
Kirchhoffs second law states that the pressure drop around any closed loop is
zero [4]. This means that there is no pressure drop around the loop since the closed
loop starts and finishes at the same node.
P1 + P2 + P3 ... + Pn = 0
PT = 0 (2.11)
where P1 + P2 + P3 ... + Pn = PT
BP = 0 (2.12)
P = (Q) . (2.13)
B[ (Q)] = 0 (2.14)
The set of nodal equations that describes a gas network is shown as below [4,
33] :
L = A1 [ ' ( A T P )] (2. 10)
= ' ( AT P)
f1 ( P1 , P2 ,...Pn 1 )
f ( P , P ,...P )
F (P1 ) = 2 1 2 n1
where F denotes a vector of functions.
........................
f n 1 ( P1 , P2 ,...Pn1 )
The errors F(P1 ) will tend to zero as the pressure approach their true values.
The Newton nodal method solves the set of equations (2.16) iteratively until the
nodal errors are less than a specified tolerance. The iterative scheme for correcting
the approximations to the nodal pressures is (see next page)
f 1 f 1 f1
P P L P
1 2 n1
f 2 f 2 f 2
L
J = P1 P2 Pn1 where f i stands for fi(P1). (2. 19)
M
f n1 f n1 L f n1
P1 P2 Pn1
L2 L3 L4
4 5
3
2 4
1 3
Figure 2.3: Graph of gas network system for Newton Nodal Method.
Assuming the flow equation is as shown as equation (2.4) and based on the
chart (2.1) (see above). Hence the nodal equations are:
( P1 P2 ) 1 / m1 (P P2 ) 1 / m1
f 2 = S 12 [ S12 ] + S 32 [S 32 3 ] L2
K1 K4
( P1 P3 ) 1 / m1 ( P P2 ) 1 / m1 ( P P4 ) 1 / m1
f 3 = S 13[ S 13 ] S 32 [ S 32 3 ] S 34 [S 34 3 ] L3
K2 K4 K5
( P1 P4 ) 1 / m1 (P P4 ) 1 / m1
f 4 = S 14 [ S14 ] + S 34 [S 34 3 ] L4 (2. 20)
K3 K5
The nodal Jacobi matrix is
f 2 f 2 f 2
P P3 P4
2
f f 3 f 3
J= 3
P2 P3 P4
f 4 f 4 f 4
P2 P3 P4
After differentiating equation (2. 20) with respect to P 2 and considering the
answer gained with equation (2.4), one new equation which is equation (2.21) is
formed as shown as the following.
Q1 Q Q
( + 4 ) 4 0
P1 P4 P4
1 Q4 Q2 Q4 Q5 Q5
J= ( + + ) (2. 21)
m1 P4 P2 P4 P5 P5
Q4 Q3 Q5
0 ( + )
P4 P3 P5
The corrections to the nodal pressures are computed from equation (2. 18).
Since the Jacobi matrix J is negative due to the (-1/m1) term in equation (2. 21), the
correction to the nodal pressure will be positive if the error at the node is positive,
and will be negative if the nodal error is negative.
2.6.5 Newton Loop Method
The set of loop equations that describes a gas network is shown as below [4].
B[ (Q )] = 0 (2.14)
Q = Q 0 + BT q (2. 22)
In the loop method, the iteration the left hand side of equation (2.14) will not
be zero. The branch flows are only approximations of their true values and the
pressure drops calculated from these flows will not summate to zero around each
loop. This introduces a loop error into each loop which is a function of all loop
flows and is denoted as f (q). There is a loop error for each loop and this set of errors
is represented by:
f 1 ( q1 , q 2 ,...q k )
f 2 ( q1 , q 2 ,...q k )
F (q ) =
........................
f k ( q1 , q 2 ,...q k )
After substituting from equation (2. 22) into equation (2. 23), equation (2. 24)
is formed.
The errors F(q) will tend to zero as the loop flow s approach their true values.
The Newton Loop method solves the set of equations (2.16) iteratively until the loop
errors are less than a specified tolerance.
The iterative scheme for correcting the approximations to the loop flow is
The correction to the loop flows are computed from the following equation:
Q4 Q5
3
2 4
qA qB
Q2
Q1 Q3
Figure 2.4: Graph of gas network system for Newton Loop Method.
Based on equation Pk = K k (Q nm1 ) k and chart (2.2) (see above), the loop
equations (2.28) are:
f B = S 2 K 2 [S 2 (Q 20 + q A + q B )] m1 S 3 K 3 [S 3 (Q30 q B )]m1 + S 5 K 5 [S 5 (Q 50 + q B )] m1
(2.29)
where Sk = +1, if Qk is positive,
Sk = -1, if Qk is negative,
f A f A
q q B
J =
A
f B f B
q q B
A
The differential equation for equation (2.28) with respect to qA is gained and
as shown as the following.
f A
= m1 K1 ( S1 Q1 ) m1 1 + m1 K 2 (S 2 Q2 ) m1 1 + m1 K 4 (S 4 Q4 ) m1 1
q A
The differential equation for equation (2.29) with respect to qB is gained and
as shown as the following.
f B
= m1 K 2 (S 2 Q2 ) m1 1 + m1 K 3 ( S 3 Q3 ) m1 1 + m1 K 5 ( S 5 Q5 ) m1 1
q B
The differential equation for equation (2.28) with respect to q B and the
differential equation for equation (2.29) with respect to q B are gained and as shown in
the following page.
f A f B
= = m1 K 2 (S 2 Q2 ) m1 1
q A q B
Since S k and Qk have the same sign for any pipe k, the term m1 K k ( S k Qk ) m1 1
m1 1
is always positive and can be written as m1 K k Qk . Hence
{K 1 Q1 m1 1 + K 2 Q2 m1 1
+ K 4 Q4
m1 1
} K 2 Q2
m1 1
J = m1
K 2 Q2 m1 1 {K 2 Q2
m1 1
+ K 3 Q3
m1 1
+ K 5 Q5 1 }
m 1
(2. 30)
The corrections to the loop pressures are computed from equation (2.26).
Since the Jacobi matrix J is positive, the correction to a loop flow will be negative if
the loop error is positive and will be positive if the loop error is negative.
Newton Nodal method and Newton Loop method have advantage and
disadvantage. The advantage of the nodal method is this method is suitable in
solving set of equations. Meanwhile the advantage of the loop method over the
nodal method is its good convergence characteristic. The disadvantage of the nodal
method is the poor convergence characteristic while the disadvantage of loop method
is the difficulty to define the loop in gas network.
Newtown Nodal Method will be implemented into the gas network simulator
as the basic method to solve the network analysis.
Numerical methods for solving systems of linear equations fall into two
general classes; they are the direct methods and the iterative methods. Direct
methods lead to an exact solution in a finite number of steps if a round off error is
not involved. Iterative method leads to an approximation that is acceptably close to
the exact solution by performing an infinite number of arithmetic operations.
2.7.1 Gauss Elimination Method
The first step is to eliminate one of the unknowns from the equations. This
step is called Forward elimination. The result of this elimination step is the forming
of one equation with one unknown. While the second step is solving the equation
directly and the result back substituted into one of the original equations to solve the
remaining unknown. The advantage of this method is it having a higher precision
and disadvantage is possible division by zero [34].
3 0 .1 0 .2 x1 7 .85
0.1 7 0.3 x2 = 19 .3
0 .3 0.2 10 x3 71 .4
0 .3 x1 0 .2 x2 + 10 x3 = 71 .4 (2. 34)
Use the Gauss elimination method to solve the equations (2.32) to (2.34) .
1) Forward elimination
The procedure is multiply equation (2. 32) by 0.1/3 and subtracts the result
from equation (2. 33) to get
Then multiply equation (2.32) by 0.3/3 and subtracts the result form equation
(2. 34) to eliminate x1. After these operations, the set of equations is
2) Back substitution
Finally, solve x1 by subtract equation (2. 41) and equation (2. 42) into
equation (2.38).
This method is the most generally used iterative methods. Assume the
equation (2.31) is given. If the diagonal elements are all nonzero, the first equation
can be solved for x1 , the second for x2 and the third for x3 to yield
b1 a12 x2 a13 x3
x1 = (2. 43)
a11
b2 a 21x1 a 23x3
x2 = (2. 44)
a 22
b3 a31x1 a32 x2
x3 = (2. 45)
a33
Now assume that x2 and x3 are zero. Subtract these zeros into equation (2.35)
to calculate new value of x1=b 1/a 11. Then subtract this new value of x1 along with the
previous guess of zero for x3 into equation (2. 44) to calculate new value of x2. This
process is repeated for equation (2. 45) to calculate new estimate for x3. After these
operations, return to equation (2. 43) and repeat the entire procedure until the solution
converges closely enough to the true values. Convergence can be checked using the
criterion a, i below [6, 35],
xi j xij 1
a, i = 100 %
xi j
for all i, where j and j-1 are the present and previous iterations.
METHODOLOGY
3.1 Introduction
To set up the basic structure of the computer simulator, one approach called
object oriented approach is used. After setting up the structure, the concept of graph
theory is used to check the connectivity of the pipeline system drawn in the computer
simulator. Network analysis is done after the pipeline system is drawn. Only one
method is studied in order to solve the gas network problems - the Newton Nodal
Method. This method for gas pipeline system is in steady state.
Dijkstras
. Jacobi Matrix
.
.
Newton Nodal
Based on Figure 3.1, the design for the computer simulator developed is too
complicated and looks confusing. The structural design for this research is very
large. So, the disadvanta ges of using the algorithms decomposition method for this
research are the computer simulator design is too large and much unorganized. More
time and efforts needed in order to develop the computer simulator, comparing if
using the object oriented approac h.
3.3 Object Oriented Approach for Computer simulator Design
Simulation
Figure 3.2: Overview of the basic structure of the computer simulator based on the
object-oriented concept.
COMPUTER
PROGRAM
SELECTION
FORMULAE
AND METHOD
SELECTION
COMPUTER SIMULATOR
DEVELOPMENT USING
OBJECT ORIENTED
APPROACH
(Graph Theory Algorithms,
Network Analysis)
RESULTS
TESTING
MODIFICATION
SUCCESS NO
RESULTS
YES
There are many computer compilers in the market, such as Borland C++
Builder, Delphi and so on, which can be used in writing the C++ programming
language. In this research, the computer compiler used in developing the computer
simulator is Microsoft Visual C++ 6.0.
The second segment is the selection of the formulation for the gas network
analysis. So, in this research, only one formulation is selected to do the network
analysis - Newton Nodal Method. In future, the Newton Loop Method will be
applied into the computer simulator. Thus, users can choose to use, either Newton
Nodal Method or Newton Loop Method, for the network analysis calculation.
The last segment is the selection of the numerical methods like Newton
Gauss Elimination and Newton Gauss Seidel methods in solving the network
analysis problems, especially the matrix equations. The root of equation will be
determined by convergence numerical methods.
3.7 Computer Simulator Development
After the formulas and methods selection, the next procedure is to implement
the studies, which have been done by the developer, into the computer simulator.
This procedure is called computer simulator development. Generally this computer
simulator development can be divided into two parts; so called the graphic part and
the logic part. Both parts have their own functions and they can interact with each
others. The graphic part is normally called graphical user interface. Its main
purpose is to reduce users complication in using the computer simulator. While the
logic part is part which dealing with the engine of the computer simulator.
It is built in order to simplify all the works needed in this simulation. In the
computer simulator developed, there are eight things should be observed.
1. Dialog Boxes
More than two dialog boxes are created for data inserting.
2. Drawing Sheet
The graph or pipeline system is drawn in this sheet. Graph theory algorithms can be
directly tested on the drawing sheet and coloured node or edge will be shown.
3. Menu
4. Push Buttons
There are about five push buttons for doing different task. When a button is clicked,
it will carry out the logic coded by the developer or programmer.
5. Radio Buttons
Like the push button, there are about ten radio buttons for doing different task. Most
of these buttons are involved in the graph classification, construction and graph
algorithms. When a button is clicked, it will carry out the logic coded by the
developer or programmer. The difference between the push button and the radio
button is normally there is one of the radio button is pre-selected.
6. Tool Boxes
The tool boxes work as a tool in helping the user besides choosing the radio buttons.
7. Result Boxes
The result boxes show the results of the graph theory algorithms and time of
execution.
8. List Boxes
Like the result boxes, the list boxes are used to display the results of network
analysis calculation in list. They are put inside a specific result box.
The purpose of doing this testing is to check for any error that may occur in
the computer simulator. A test plan with a variety of test cases will be done and the
test plan will be shown in the coming chapter. If there is no error in the computer
simulator, the results obtained from the simulation of the computer simulator may be
compared with the data s imulated from any commercial computer simulator
available in the market. Thus, the computer simulator can be published in the
market.
3.9 Modification
3.10 Results
This is the final result for the computer simulator. When arriving in this
stage, the computer simulator can be considered become perfect.
The process flow diagram for the computer simulator is shown in Figure 3.4.
This diagram is different than the diagram of developing the computer simulator.
The diagram shows and explains all the processes involved in the computer
simulator. Generally, the diagram can be separated into two segments. The first
segment is the drawing of graph or network system without network analysis or
simulation. The second segment is the drawing of graph with simulation.
The first segment involves the procedure to run the tests on graph theory
algorithms. It consists of drawing the graph or drawing, selecting of graph theory
algorithms, input the data that are the start point (node) or end point only for BFS
and Dijkstras Shortest Path algorithms, run the test on algorithms and obtain results.
The first segment is only suitable for undirected graph and directed graph without
performing the network analysis.
The second segment mainly involves the procedure to run the network
analysis on drawing or network system. It consists of drawing the graph or drawing,
selecting of graph theory algorithms, input the data that are the start point (node) or
end point only for BFS and Dijkstras Shortest Path algorithms, input data for the
network system (for network system calculation), run the test on algorithms, obtain
graph results, network system calculation and obtain the calculation results. The
second segment is only suitable for directed graph which needs to perform the
network analysis.
START
ALGORITHMS ALGORITHMS
SELECTION SELECTION
GRAPH GRAPH
RESULTS RESULTS
CALCULATION
RESULTS
END
User of this computer simulator needs to select the type of graph or drawing
(network system) prefer. The type of graph can be whether directed, undirected or
directed with simulation. If user choose graph without simulation, the computer
simulator will only run the graph theory algorithms.
After choosing the type of graph, user can draw the graph on the drawing area
in the computer simulator.
After the graph is done, the next stage is to select the graph theory
algorithms. There are five graph theory algorithms to choose. Details about the
graph theory algorithms are shown in Chapter 2. Figure 3.5 shows the process
occurs inside the Algorithms Selection. User can only select one of the graph theory
algorithms each time to obtain the graph results. If user selects BFS and Dijkstras
Minimum path (Yes path in Figure 3.5), user needs to select the start and end point
(start node and end node) at the graph drawn, before the results of the algorithm can
display. An error message will display if user doesnt do so. If user chooses
algorithms rather than the both algorithms stated above, whether is DFS, MST and
SCC, the results of the graph theory algorithms will directly display on the graph
results in the computer simulator
The graph results consist of all the results of the desired graph theory
algorithms and the computation time taken in calculating the algorithms. For graph
without simulation (uncheck or unclick the Simulation button, see Chapter 4,
section 4.4), the computer simulator will stop after all the calculation and all the
results have been displayed on the computer simulator. While for graph with
simulation, it will display all the results on the computer simulator and later proceeds
to the next stage, that is the network system calculation, or in other word, network
analysis.
3.11.5 Data Input For Network System and Network System Calculation
This stage is to perform the network analysis on the graph drawn. The results
will display after the calculation. However before that, all the data needed for the
calculation must be entered into the computer simulator.
User needs to enter the total node, the total branch, the total chord, tolerance,
properties, and methods and flow equation into the computer simulator. Otherwise,
errors will occur in the computer simulator and user needs to restart the computer
simulator.
If user fulfils all the required above, the process will go into the calculation of
K value process and the Initial Chord Flow Calculation process. To calc ulate the K
value, the formulas for the low, medium and high pressure gas network are as follow
(see Chapter 2 for details),
11 .7 10 3 L
Pole formula (low pressure), K =
D5
206 .2253 10 3 L
Coxs formula (medium pressure), K =
D5
25900 L
Weymouth formula (high pressure), K =
D16 / 3
To calculate the chord flow rate, equations (2.2) and (2.4) are needed.
After that, the data calculated will go to Formation of Jacobi Matrix process.
The Jacobi matrix formed depends on the size of the nodes. The matrix can be
formed using equation (2.12). The next process is Numerical Methods Calculation
process. In this process, there are two numerical methods in the computer simulator
and only one of them can be selected. Details about the two numerical methods are
as shown in Chapter 2.
Next, the calculation will proceed to New Branch Flow Calculation process
and New Chord Flow Calculation process. New flow rate for the branch and chord
will be calculated using equations (2.2) and (2.4). They are to calculate the new
branch flow rate and chord flow rate. The calculation will stop if the specified
tolerance (user input) is achieved. Otherwise, it will go back to the K value
Calculation process to recalculate the new K value using the formulas above and
continue all the processes above until the specified tolerance is achieved. The final
results of network system calculation will display after the specified tolerance is
achieved. Figure 3.6 show all the processes mentioned here.
The results of network system calculation are display here. They include
time of one iteration and total iteration, number of iteration, branch flow rate, and
chord flow rate and so on.
Choose
No
No
Yes
DFS
No
Yes
MST
No
Yes
SCC
No
Start/End Yes
Dijkstra Point
Selection
No
No
Calculation
Graph Results
Yes
Error
No
K value Calculation
Formation of Jacobi
Matrix
Numerical Methods
Calculation
No
Achieve
Tolerance?
Yes
Calculation Results
4.1 Introduction
The computer simulator developed can be used for network simulation for
steady state gas flow. The computer simulator uses the Newton Nodal Method in
order to do the network analysis. The computer simulator can be used to solve
piping problem and to check the connectivity of a graph drawn. To solve the piping
problem, firstly user is required to draw the piping system on the drawing sheet,
subsequently check the Simulate button and click at the system to enter the
necessary data. User can view the results obtained and the data entered in a special
results box. To check the connectivity of the piping system or the graph drawn, user
is required to choose the necessary information given on the main frame and click on
the Run button to simulate the graph theory algorithms. The results will be shown
on the same main frame with the time execution.
In order for the system to work properly, the following are the essential
information required:
(i) General Information
a) Demands
b) Elevations
c) Pressures
a) Compressible factor
b) Specific gravity
c) Temperature
a) Diameter
b) Length
a) Lacey
b) Pole
c) Polyflo
d) Coxs
e) Pandhandle
f) Weymouth
4.3 User Interface Features
These tools are very useful to the user because it can help user easily to draw
the pipeline system.
The Graph toolbar consists of tool buttons Node (Vertices) and Edge
(Branch).
By clicking this tool button, user can draw the node of the pipeline system.
The node drawn in the drawing sheet is a small black dot.
This tool button will not work if there is no node on the drawing sheet. At
least a node is needed (self-looping). User can draw edges which can connect many
nodes.
These toolbars consists of nine radio buttons and one check button. The radio
buttons are Directed, Undirected, Vertices, Edges, Breadth-First Shortest
Path Search, Depth-First Search, Strongly Connected Components, Minimum
Spanning Tree and Dijkstras Minimum Path buttons (see Chapter 2 for details).
Meanwhile, the check button is Simulation button. Each of them has their own
functions. Figure 4.3 shows the display of the Drawing and Algorithms Toolbars.
Only four buttons needed to do the graph theory algorithms. They are the
Clear Drawing button, the Clear All Edges button, the Run Algorithms button
and the Reset All button. The Clear Drawing button is used to clear all the
drawing drawn. The Clear All Edges button is used to clear all the edges drawn,
including the data input of the edge. By clicking the Run Algorithms button, the
computer simulator will run on the selected algorithm and the results will be shown
in the Results Display Column. The Reset All button is to reset all the results
calculated and displayed.
The Results Display Column is used to display the algorithms summary and
the computation time.
Dialog boxes are very useful in this software. There are three types of dialog
boxes involved in this software. One is the Information dialog box, second is the
Input dialog box and the third is the Results dialog box. Information dialog box
gives the required information to user. Input dialog box allow user to input the
necessary data into the simulation of the software. There are two types of input
dialog boxes. They are Input Data for Node and Input Data for Pipe. Results dialog
box shows the results of the calculation of the network problem.
After checking the Dijkstras Shortest Path algorithm or Breadth First Search
algorithms, if user forgets to specify the start and end (finish) vertices of the graph
drawn, this type of dialog boxes will display. The purpose of showing the dia log box
is to remind user to specify the start and end vertices. One of these dialog boxes is
shown in Figure 4.6. The sentences on the dialog box in Figure 4.6 say Dijkstras
Shortest Path Algorithm requires a Start Vertex and a Finish Vertex.
In this dialog box, user has to insert the data of the node number, pressure and
the flow rate of the specified node. Besides that, user has to specify whether the
node is a source node or a load node by clicking the radio button on the left hand side
of the dialog box. Figure 4.7 below shows the Input data for node dialog box.
For this dialog box, it contains data like the branch number, length,
equivalent length and diameter of the pipe drawn by user. User need to enter all the
data of the pipe. The graphical dialog box for data input on pipe for this software is
illustration in Figure 4.8 below.
Figure 4.8: Input Data Dialog Box for Pipe .
The Results Dialog box is used to show the calculation of the network
problem. Before viewing the results, user has to enter all the input data for the nodes
and branches involved. This also means user has to draw the network system on the
drawing sheet. By clicking the push button Simulation and selecting the radio
button Directed, user can enter to the Results Dialog box. Before running the
simulation, user need to enter some information required, such as the total of nodes,
branch, type of method, tolerance and so on. To run the simulation, user just need to
click the Calculate button. All the results will be displayed with the time of
execution. The Results Dialog box is shown in Figure 4.9.
Figure 4.9: Results Dialog Box.
(i) File
(a) New
Through this button, user can open a new file to draw a network
system and do the calculation of the network system.
(b) Open
Through this button, any saved file in Data File type can be opened.
(c) Save/Save As
It can help user to save the modified file in Graph File type.
(c) Print
(d) Exit
(ii) View
(a) Converter
Through this button, user can convert the temperature, mass, pressure
and length. The Converter is shown in the following page.
Figure 4.10: Converter.
Through this button, user can display the Results Dialog box.
However, to make the button works, user need to click the Push
button Simulation and select the Radio button Directed. Details
about the Results Dialog box are displayed in the above section.
User needs to know the simplest way of using the computer simulator. In
order to reduce the time consuming in using this computer simulator and avoid any
unwanted error occurs, user have to follow these steps in next page:
(i) For Network Simulation
Table 4.1: Hardware and Software Requirements for User and Developer.
5.1 Introduction
The developed gas network computer simulator is able to run five graph
theory algorithms and examine the effects of graph theory algorithms on gas network
system. Besides that, this computer simulator is able to run the Newton Nodal
Method for the network analysis. In this chapter, comparison on its accuracy and
speed can be done based on various different network configurations. The accuracy
test is compared with the simulated results obtained by using the commercially
software, GAPIS. The speed analysis is done on the various graph theory
algorithms, number of iteration and various numerical methods such as the Newton
Gauss Elimination and Newton Gauss Seidel method.
Two case studies and one extended case study have been performed in this
research. For each case study, different conditions have been used. The set
conditions are different pressure, length, diameter, flow rate and the arrangement of
the network system. Different flow equations are applied into these case studies. In
case study 1, the network is in low pressure, Poles (Laceys) equation is used. In
case study 2, Coxs equation is used since the network is in medium pressure. In
extended case study 1, the network is in high pressure and the Weymouth and
Panhandle A equation is used. The reason of using different conditions is to check
the capacity of the computer simulator developed. The computer simulator
developed must be able to perform network analysis in low, medium and high
pressure. Table 5.1 below shows these case studies properties.
The network is a simple low pressure network. The initial pressure of this
network is 30 mbar and the specific gravity of gas is 0.589. The input data and the
network schematic diagram are shown in Table 5.2 and Figure 5.1 respectively.
The network is a medium pressure network with the initial pressure of 1 bar
and the specific gravity of gas is 0.589. Coxs equation is used. The efficiency
factor , E is set to be 0.8. The input data and the network schematic diagram are
shown in Table 5.3 and Figure 5.2 respectively.
Table 5.3: Input Data for Study Case 2
This is the extended study of high pressure. The network is a high pressure
network. The initial pressure of 8 bars and the specific gravity of ga s are 0.589. The
efficiency factor is 0.8. The input data and the network schematic diagram are
shown in Table 5.4 and Figure 5.3 respectively. The flow results obtained from
Weymouth equation in the computer simulator are compared with the flow results of
Panhandle A equation in the computer simulator, during the accuracy test.
Table 5.4 : Input Data for Extended Case Study 1
The speed analysis is done on the all the case studies in order to determine the
fastest graph theory algorithms for gas network system and the fastest numerical
method for gas network system using the Newton Nodal Method. This analysis is
carried out using the five graph theory algorithms, on three different case studies.
There are two type of speed analysis carried out in this research. The first one is
speed analysis without the network analysis and the second one is speed analysis
with the network analysis.
5.3.1 Speed Test without Network Analysis
The speed analysis is done for gas networks system without performing the
network analysis. The purpose of undergoing this analysis is to determine the fastest
graph theory algorithm, before performing the network analysis and determine the
effect of graph theory algorithms on different gas network configuration. All the
results are recorded and tabled as shown in Table 5.5. For BFS and Dijkstras
Shortest Path Algorithms, the start and end nodes (points) must be defined before
running the algorithms. For case study 1, the start node is 1 and end node is 5. For
case study 2, the start node is 1 and the end node is 6 while for extended study case
study 1, the start node is 1 and the end node is 7.
Three bar graphs are plotted as shown in Figure 5.4 to Figure 5.6. From these
graphs, the fastest graph theory algorithm is Breadth First Search. The slowest graph
theory algorithm is Strongly Connected Component. BFS is the fastest because of
the method used. As stated in Chapter 2, BFS explores all the neighbouring nodes
before proceeds to their respective neighbouring nodes. For these three case studies,
using BFS, starting from node 1, it will go to node 2, node 3, node 4, node 5(case
study 1), node 6(case study 2) and node 7(extended study case study 1). Since all the
nodes are visited by node 1, it stops. The time taken is becoming shorter as the
ending node is directly connected to the starting node, node 1.
After comparing with three case studies, the effect of graph theory algorithms
on different network configuration is the computation time. The larger the network,
the time taken is longer. The reason is the number of nodes and branches increase.
Table 5.5: Speed Analysis Results without Network Analysis in Three Case
Studies.
Node 5
10.44
Branch 7
10
8
Computation Time(ms)
6.75
6
5.37 5.44 5.41
0
BFS DFS SCC MST Dijiktra's
Graph Theory Algorithms
Figure 5.4: Computation Time for Case Study 1 versus Graph Theory
Algorithms.
14
The number of:
Node 6
11.91
12 Branch 9
10
Computation Time(ms)
8
7.51
5.90
6
5.48 5.53
0
BFS DFS SCC MST Dijiktra's
Graph Theory Algorithms
Figure 5.5: Computation Time for Case Study 2 versus Graph Theory
Algorithms.
14
The number of:
12.80
Node 7
12 Branch 11
10
Computation Time(ms)
8 7.57
6 5.78 5.67
5.62
0
BFS DFS SCC MST Dijiktra's
Graph Theory Algorithms
Figure 5.6: Computation Time for Extended case study 1 versus Graph Theory
Algorithms.
5.3.2 Speed Analysis with Network Analysis
The speed analysis is also done for gas network system with network
analysis. The network analysis is using the Newton Nodal Method. Newton Gauss
Elimination Method and Newton Gauss Seidel Method are using numerical solutions
to solve Linear Algebraic Equation in the network analysis [5]. The purpose of
undergoing this speed analysis is to determine the fastest numerical method and the
fastest method in performing the network analysis. This speed analysis can be
divided into two sections. The first section is analysis on One Iteration T ime for the
three case studies with different numerical methods that are the Newton Gauss
Elimination and Gauss Seidel Method. The second analysis is analysis on Total
Iteration T ime for the three case studies with the Newton Gauss Elimination and
Gauss Seidel Method. All the results of the speed analysis for gas network system
with network analysis is tabled and shown in tables below.
Table 5.6: One Iteration Time for the Case Study 1 with Gauss Elimination and
Gauss Seidel Method
Table 5.6.1: Total Iteration Time for the Case Study 1 with Gauss Elimination
and Gauss Seidel Method
Table 5.7.1: Total Iteration Time for the Case Study 2 with Gauss Elimination
and Gauss Seidel Method
Table 5.8: One Iteration Time for the extended study case study 1 with Gauss
Elimination and Gauss Seidel Method
Based on the results obtained, three bar graphs have been plotted in order to
provide a clear picture of the analysis. Figure 5.7 shows the one iteration
computation time for case study 1 versus the Newton Gauss Elimination and Gauss
Seidel Method. Figure 5.8 shows t he total iteration computation time for case study
1 versus the Newton Gauss Elimination and Gauss Seidel Method. Figure 5.9 shows
the computation time for case study 1 versus the five graph theory algorithms and
two numerical methods.
Based on Figure 5.7 and Figure 5.8, Newton Gauss Elimination can provide
faster results than Newton Gauss Seidel Method in case study 1. For tolerance 0.1,
Newton Gauss Elimination is 1.81 milliseconds faster than Newton Gauss Seidel
Method in one iteration and 10.47 milliseconds in total iteration. For tolerance 0.01,
Newton Gauss Elimination is 2.28 milliseconds faster than Newton Gauss Seidel
Method in one iteration and 21.40 milliseconds in total iteration. While for tolerance
0.001, Newton Gauss Elimination is 3.45 milliseconds faster than Newton Gauss
Seidel Method in one iteration and 21.95 milliseconds in total iteration.
Meanwhile, Newton Gauss Seidel Method has a similarity with the technique
of simple fixed point iteration. Newton Gauss Seidel Method solves the unknowns
from the equations in the Jacobi Matrix, using initial guesses that assume one or
more the unknowns (n-1) are zero. For this case study, the number of unknowns, n is
4 because of 4 load nodes. So, 3 unknowns are initially assumed zero. The result of
the last unknown obtained is substituted into the equations in Jacobi Matrix, in order
to solving other unknowns. These calculation steps are repeated until the final
results are closely to the true values (depend on the tolerance inserted by user of the
computer simulator) and may sometimes rises up to 100. Due to the trial and error
method and these steps, the time taken to obtain a good result becomes longer. The
reuses of Jacobi matrix for Newton Gauss Seidel Method increases when all the old
equations in the Jacobi Matrix are frequently replaced by the new equations each
time the calculation steps are repeated, more than the reuses of Jacobi matrix for
Newton Gauss Elimination method. The reason is the total number of iteration for
Newton Gauss Elimination method is 7 times, comparing to the total number of
iteration for Newton Gauss Seidel method is 414 (see Figure 5.9). So, Newton Gauss
Seidel Method is slower than Newton Gauss Elimination at one iteration and total
iteration.
In order to obtain more accurate results, the tolerance must be smaller. Thus,
the time taken to obtain the result is longer. Because of this reason, the total iteration
time for tolerance 0.001 has been chosen to plot the graph in Figure 5.9.
As stated, BFS is the fastest graph theory algorithms while Newton Gauss
Elimination is the fastest numerical method from previous results. For Figure 5.9,
still BFS is the fastest graph theory algorithms while Newton Gauss Elimination is
the fastest numerical method. The fastest method in performing the analysis on
graph theory algorithms and numerical methods for case study 1 is the combination
of BFS and Newton Gauss Elimination with the total time 40.2328 milliseconds.
However, the combination of MST and Newton Gauss Elimination, and the
combination of Dijkstras Shortest Path Method and Newton Gauss Elimination also
are two good ways to obtain fast results for case study 1, with the time difference of
only 0.07 milliseconds and 0.03 milliseconds respectively, comparing with the time
of the combination of BFS and Newton Gauss Elimination. Both the combination of
MST with Newton Gauss Elimination and the combination of Dijkstras Shortest
Path with Newton Gauss Elimination can provide fast results because the case study
1 is an un-weighted graph/drawing. These two graph theory algorithms are suitable
for weighted graph.
One Iteration, 5 nodes
8.30
7.09
7
6.54
Tolerance
Computation Times (ms)
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.7: One Iteration Time for case study 1 v ersus the Newton Gauss
Elimination and Gauss Seidel Method.
Total Iteration, 5 nodes
60
56.81
54.69
50
40.05
40
Tolerance
34.86
Computation Times (ms)
33.30
0.1
29.59 0.01
30
0.001
20
10
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.8: Total Iteration Time for case study 1 versus the Newton Gauss
Elimination and Gauss Seidel Method.
Computation Time for Case Study 1 versus Graph Theory
Algorithms and Numerical Methods
80 Lege nd
Netwon Gauss
Seidel (0.001)
70
Newton Gauss
Elimination
(0.001)
60 Dijkstra's
Shortest Path
MST
50
Computation Time (msec)
SCC
40
56.81
DFS
56.81
56.81 56.81 56.81
30 BFS
34.86
34.86
34.86 34.86 34.86
Total Iteration:
20
Newton Gauss
Elimination
Method (0.001)
7
10
Newton Gauss
10.44 10.44 Seidel Method
6.75 6.75 (0.001)
5.37 5.37 5.44 5.44 5.41 5.41 414
0
Figure 5.9: Computation Time for case study 1 versus the Graph Theory
Algorithms and Numerical Methods.
5.3.4 Speed Test Analysis for Case Study 2
Based on the results obtained, like in case study 1, three bar graphs have been
plotted in order to provide a clear picture of t he analysis. Figure 5.10 shows the one
iteration computation time for case study 2 versus the Newton Gauss Elimination and
Gauss Seidel Method. Figure 5.11 shows the total iteration computation time for
case study 2 versus the Newton Gauss Elimination and Gauss Seidel Method. Figure
5.12 shows the computation time for case study 2 versus the five graph theory
algorithms and two numerical methods.
Based on the both graphs, still Newton Gauss Elimination can provide faster
results than Newton Gauss Seide l Method in case study 2, although different flow
equation is used. For tolerance 0.1, Newton Gauss Elimination is 1.96 milliseconds
faster than Newton Gauss Seidel Method in one iteration and 9.13 milliseconds for
total iteration. For tolerance 0.01, Newton Gauss Elimination is 2.22 milliseconds
faster than Newton Gauss Seidel Method in one iteration and 10.05 milliseconds in
total iteration. While for tolerance 0.001, Newton Gauss Elimination is 2.78
milliseconds faster than Newton Gauss Seidel Method in one iteration and 19.17
milliseconds in total iteration.
Like in case study 1, the main reason of Newton Gauss Elimination is faster
than Newton Gauss Seidel for both graphs is its short sequence of calculation.
Newton Gauss Elimination eliminates one of the unknowns from the equations in the
Jacobi Matrix and solves the equation directly. The result obtained is substituted into
the original equations in the Jacobi Matrix to solve the remaining unknown. The
calculation stops until the final results are closely to the true values.
Meanwhile, Newton Gauss Seidel Method solves the unknowns from the
equations in the Jacobi Matrix, using initial guesses that assume all the unknowns are
zero. For this case study, the number of unknowns, n is 5 because there are 5 load
nodes. So, the number of unknowns is 4. They are initially assumed zero. The last
unknown obtained is substituted into the equations in the Jacobi Matrix, in order to
solve other unknowns. These trial and error calculation steps a re repeated until the
final results are closely to the true values. The reuses of Jacobi matrix for Newton
Gauss Seidel Method increases when all the old equations in the Jacobi Matrix are
frequently replaced by the new equations each time the calculation steps are
repeated, more than the reuses of Jacobi matrix for Newton Gauss Elimination
method. The reason is the total number of iteration for Newton Gauss Elimination
method is 7 times, comparing to the total number of iteration for Newton Gauss
Seidel method is 377 (see Figure 5.9). So, the time taken to obtain a result becomes
longer.
From the graphs, the smaller the tolerance, the longer the time taken. To
obtain a more accurate result, the tolerance must be smaller. Consequently, the time
taken to obtain the result is longer.
Like case study 1, Figure 5.12 is the combination of Figure 5.5 and Figure
5.11 because the computation time results obtained for case study 2 are still the same
although many tests on the computation time have been carried out. The fastest
method in performing the analysis on graph theory algorithms and numerical
methods for case study 2 is the combination of BFS and Newton Gauss Elimination
with the total time 51.83 milliseconds, slightly slower than in case study 1. The
reason is the graph becomes larger.
10
9.31
9
8.63
8.28
Tolerance
7
6.53
6.32 6.41
6
Computation Times (ms)
0.1
0.01
5
0.001
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.10: One Iteration Time for case study 2 versus the Newton Gauss
Elimination and Gauss Seidel Method.
Total Iteration, 6 nodes
70
65.52
60
49.57
50
46.35
Tolerance
Computation Times (ms)
39.52
40
0.1
35.20 0.01
0.001
30
26.08
20
10
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.11: Total Iteration Time for case study 2 versus the Newton Gauss
Elimination and Gauss Seidel Method
Computation Time for Case Study 2 versus Graph Theory Algorithms and
Numerical Methods
90 Legend
Newton Gauss
Seidel Method
80 (0.001)
Newton Gauss
Elimination
(0.001)
70
Dijkstra's
Shortest Path
60 MST
Computation Time (msec)
50 SCC
65.52
DFS
40 65.52
65.52 65.52 65.52
46.35
BFS
30 46.35
46.35 46.35 46.35
Total Iteration:
20
Newton Gauss
Elimination
Method (0.001)
7
10
Newton Gauss
11.91 11.91 Seidel Method
7.51 7.51 (0.001)
5.48 5.48 5.90 5.90 5.53 5.53
377
0
Figure 5.12: Computation Time for case study 2 versus the Graph Theory
Algorithms and Numerical Methods.
5.3.5 Speed Test Analysis for Extended Case Study 1
Based on the results obtained, like in case study 1 and 2, three bar graphs
have been plotted in order to provide a clear picture of the analysis. Figure 5.13
shows the one iteration computation time for extended case study 1 versus the
Newton Gauss Elimination and Gauss Seidel Method. Figure 5.14 shows the total
iteration computation time for extended case study 1 versus the Newton Gauss
Elimination and Gauss Seidel Method. Figure 5.15 shows the computation time for
extended case study 1 versus the five graph theory algorithms and two numerical
methods.
Based on the both graphs, still Newton Gauss Elimination can provide faster
results than Newton Gauss Seidel Method in extended case study 1. For tolerance
0.1, Newton Gauss Elimination is 1.32 milliseconds faster than Newton Gauss Seidel
Method in one iteration and 9.37 milliseconds for total iteration. However, for
tolerance 0.01, Newton Gauss Elimination is 3.20 milliseconds faster than Newton
Gauss Seidel Method in one iteration and 6.4711 milliseconds in total iteration.
While for tolerance 0.001, Newton Gauss Elimination is 3.19 milliseconds faster
than Newton Gauss Seidel Method in one iteration and 22.09 milliseconds in total
iteration.
Like case study 1 and 2, the reason Newton Gauss Elimination is faster than
Newton Gauss Seidel Method is short sequence of calculation for Newton Gauss
Elimination.
For this case, there is a bit different of time between the tolerance 0.01 and
the tolerance 0.001 comparing with the other two case studies. For tolerance 0.001,
the time taken for both numerical methods in one iteration is faster than time taken
for tolerance 0.01 in one iteration. The reason for this incident happens is the
internal diameter and the length of network system inserted during the data input is
too small, causing the pressure drop becomes small. Thus, the results and time are
easily obtained since the tolerance is small.
Like case study 1 and 2, Fig ure 5.15 is the combination of Figure 5.6 and
Figure 5.14 because the computation time results obtained for extended case study 1
are still the same although many tests on the computation time have been carried out.
The fastest method in performing the analysis on graph theory algorithms and
numerical methods for extended case study 1 is the combination of BFS and Newton
Gauss Elimination with the total time 55.87 milliseconds, 4.04 milliseconds slower
than case study 2 and 15.64 milliseconds slower than case study 1. The reason is the
graph becomes larger than the graphs in case study 1 and case study 2.
12
11.05 10.96
10
8.96
8 7.85 7.77
7.63
Tolerance
Computation Times (ms)
0.1
0.01
6
0.001
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.13: One Iteration Time for extended study case study 1 versus the
Newton Gauss Elimination and Gauss Seidel Method
Total Iteration,7 nodes
80
72.35
70
60
50.70 Tolerance
50.26
50
Computation Times (ms)
44.23
0.1
0.01
40
0.001
34.82
30
25.45
20
10
0
Gauss Elimination Gauss Seidel
Numerical Methods
Figure 5.14: Total Iteration Time for extended study case study 1 versus the
Newton Gauss Elimination and Gauss Seidel Method.
Computation Time for Case Study 2 versus Graph Theory Algorithms and
Numerical Methods
90 Legend
Newton Gauss
Seidel Method
80 (0.001)
Newton Gauss
Elimination
(0.001)
70
Dijkstra's
Shortest Path
60 MST
Computation Time (msec)
50 SCC
72.35
72.35
72.35 72.35 72.35 DFS
40
50.26
50.26 BFS
30 50.26 50.26 50.26
20
10
12.80 12.80
7.57 7.57 5.78 5.78 5.67 5.67
5.62 5.62
0
Figure 5.15: Computation Time for Extended Case Study 1 versus the Graph
Theory Algorithms and Numerical Methods.
5.3.6 Discussion on Speed Test with Network Analysis
Generally, there are many factors that can influence in the calculation of
computation time for the speed test analysis with network analysis. These factors are
the flow equations used, the network arrangement (how the network is connected,
like one node to many nodes and so on) and network configuration (number of
nodes, branch and loop), graph theory algorithms used, numerical methods used, the
size of Jacobi Matrix and so on. However, for these three case studies, the factors
that have been focused and analysed in this research are the network configuration,
the size of Jacobi Matrix, graph theory algorithms used and the numerical methods
used. The computation time for the flow equations used in the computer simulator
and the network arrangement are not studied in this research, due to the objective of
this research.
For all the case studies, to obtain the fastest computation time in the computer
simulator, smaller network, smaller size of Jacobi Matrix, Breadth First Search and
Newton Gauss Elimination must be used. Smaller network means the number of
nodes, branch and the number of loop involved are small, like in case study 1. When
smaller network is used, the size of Jacobi Matrix formed is smaller because the size
of the matrix only depends on the number of node, especially the load nodes (if
Newton Nodal Method is used). Thus, the total computation times for the graph
theory algorithms and the numerical methods are faster. This is the situation happens
in case study 1, Figure 5.9, where the computation for case study 1 is fas ter than case
study 2, Figure 5.12.and extended case study 1, Figure 5.15.
Breadth First Search and Newton Gauss Elimination method are the fastest
graph theory algorithms and numerical methods in this research. The reason of
Breadth First Search is the fastest because of the start node (source node) are directly
connected to the end node (last load node). Different graph theory algorithms have
different computation time on different network configuration. This means that
Breadth First Search is fastest in case study 1 (network with 5 nodes), faster in case
study 2 (network with 6 nodes) and fast in extended case study 1(network with 7
nodes). Newton Gauss Elimination method is faster than Newton Gauss Seidel
method because of its short sequence of calculation
5.4 Accuracy Analysis for Gas Network System
The accuracy analysis is done on the two case studies in order to determine
how accuracy the flow rate results is, obtained from the computer simulator
developed, comparing with other commercial software, GaPIS in the market and to
determine the most accurate numerical methods. For extended case study 1, the flow
results obtained from the Weymouth equation is compared with the flow results
obtained from the Panhandle A equation, in the computer simulator.
In case study 1, using the tolerance of 0.001 for both Newton Gauss
Elimination and Newton Gauss Seidel Method, accuracy analysis on the flow is
done. From the results obtained in Table 5.9, the average accuracy results on the
flow rate for both numerical methods are 99.22%. Thus, the flow results obtained
from the computer simulator developed is very close to the flow results from the
commercial software, GaPIS. The reason is the same flow equation, w hich is the
Poles equation and the same numerical methods are used.
300
250
Flowrate(m3/hr)
200
150
100
50
0
1 2 3 4 5 6 7
Branch
GASNETWORKSYTEMV1 GaPIS
Figure 5.16: Newton Nodal Method (flow comparison case study 1 Newton
Gauss Elimination).
300
Flowrate(m3/hr)
250
200
150
100
50
0
1 2 3 4 5 6 7
Branch
GASNETWORKSYTEMV1 GaPIS
Figure 5.17: Newton Nodal Method (flow comparison case study 1 Newton
Gauss Seidel Method).
5.4.2 Accuracy Analysis for Case Study 2
In case study 2, the average accuracy results on the flow rate for both
numerical methods are 95.64%. Thus, the flow results obtained from the computer
simulator developed is close to the flow results from the commercial software ,
GaPIS. The reason is the same flow equation, which is the Coxs equation, and the
same numerical methods are used. Table 5.10 shows the accuracy test for case study
2.
Figure 5.18 shows the graph of flow comparison for Newton Gauss
Elimination. From the graph, like in case study 1, lines are plotted for the flow
results obtained from GaPIS and the computer simulator. The flow results obtained
from computer simulator are stil l in the same shape like the flow results from
GAPIS, but compare with case study 1; the shape is not that alike starting from
branch 6. This means the flow results obtained from the computer simulator is just
as good as the flow results obtained from GaP IS, but not more accurate than in case
study 1. This is due to different specific gravity of gas is used and different Coxs
coefficient is used in the computer simulator, comparing with GaPIS. The flow
result of branch 6 has significant different from the other flow results and the
accuracy of flow results from branch 6 to 9 (chords) are between 84 to 97%. The
cause of these phenomena is the flow results starting from branch 6, are affected by
the flow results starting from branch 1 to 5 (branches), when the chord flow
calculation process takes place (see Chapter 3, section 3.11.5). Slightly changes in
the flow results (comparing with GaPIS) starting from branch 1 to 5, will cause
different in the pressure drop (pressure drop become bigger). Thus, it will cause
major changes in the flow results from branch 6 to 9. Same things happen for
Newton Gauss Seidel Method. The flow results obtained from the computer
simulator is as good as the flow results obtained from GaPIS . The graph of flow
comparison for Newton Gauss Seidel Method is shown in Figure 5.19. Based on the
tables and graphs, both numerical methods provide flow results with same accuracy.
For this case study, the Coxs equation used in the computer simulator can
provide accurate flow results and suitable to be used in gas network system with
medium pressure.
Table 5.10: Accuracy Analysis in Case Study 2
300
Flowrate(m3/hr)
250
200
150
100
50
0
1 2 3 4 5 6 7 8 9
Branch
GASNETWORKSYTEMV1 GaPIS
Figure 5.18: Newton No dal Method (flow comparison case study 2 Newton
Gauss Elimination).
300
250
Flowrate(m3/hr)
200
150
100
50
0
1 2 3 4 5 6 7 8 9
Branch
GASNETWORKSYTEMV1 GaPIS
Figure 5.19: Newton Nodal Method (flow comparison case study 2 Newton
Gauss Seidel Method).
5.4.3 Accuracy Analysis for Extended Case Study 1
In extended study case study 1, the flow results obtained from the Weymouth
equation in the computer simulator are compared with the flow results obtained from
the Panhandle A equation in the computer simulator. The test is performed under
the tolerance of 0.001 for numerical methods, Newton Gauss Elimination and
Newton Gauss Seidel method. T he average accuracy results on the flow rate for both
numerical methods are 91.71%. Table 5.11 shows the accuracy test for extended
case study 1.
Figure 5.20 shows the graph of flow comparison for Newton Gauss
Elimination. From the graph, like in case study 1 and 2, two lines are plotted for the
flow results obtained from both flow equations in the computation simulator. If the
Panhandle A works as the control system, the Weymouth equation is in same shape
with Panhandle A equation. However, the flow results obtained from Weymouth
equation become far different, starting from branch 3. This difference in the result is
caused by the length input and the diameter input for that particular pipe is too small
for Weymouth equation to calculate. Same things also happen for Newton Gauss
Seidel Method. The graph of flow comparison for Newton Gauss Seidel Method is
shown in Figure 5. 21. Based on the tables and graphs, both numerical methods
provide flow results with same accuracy.
For this case study, the Weymouth equation can provide the flow results
almost as same as the flow results obtained from the Panhandle equation. Thus, the
computer simulator can provide good results for gas network system w ith high
pressure.
Table 5.11 : Accuracy Analysis in Extended Case Study 1
GASNETWORKSYSTEM
250
Flowrate(m3/hr) -
200
150
V1
100
50
0
1 2 3 4 5 6 7 8 9 10 11
Branch
Figure 5.20: Newton Nodal Method (flow comparison extended case study 1
Newton Gauss Elimination)
250
Flowrate(m3/hr) -
200
150
V1
100
50
0
1 2 3 4 5 6 7 8 9 10 11
Branch
Figure 5.21: Newton Nodal Method (flow comparison extended case study 1
Newton Gauss Seidel Method).
5.4.4 Discussion on the Accuracy Analysis
For the three case studies, based on the flow results, both numerical methods
provide flow results with same accuracy. This means Newton Gauss Elimination
method is as accurate as Newton Gauss Seidel method. Both numerical methods
have the same accuracy because of the same flow equation used and the most
importantly, the same mathematical concept used that is to find the solutions in these
case studies based on the same tolerance used, although the mathematical steps to
find the solutions are different. However, Newton Gauss Elimination method is
faster than Newton Gauss Seidel method in performing network analysis (already
explained in the previous sections). That is why users of this method prefer using it
than other numerical methods due to its speed and accuracy. Newton Elimination
method is one of the earliest methods for solving simultaneous equations; it remains
among the most important algorithms in use today and is the basic for linear equation
solving a many popular software packages [5].
In this research, the bigger initial pressure and the larger the network, the
accuracy of the flow results decreases. The reasons are different flow equations, and
different fraction factor used in the computer simulator. As the initial pressure used
become bigger, different flow equations are applied like Pole is only suitable for low
pressure distribution. The flow equations have different fraction factors. It is hard to
determine the fraction factors especially for high pressure network with high flow
rate. Thus the accuracy of the flow results decreases.
CHAPTER 6
6.1 Conclusion
Object oriented approach has been used in the development of the structure of
this computer simulator. Object oriented is suitable to develop Graphical User
Interface (GUI). The user interface is needed to develop a user friendly program.
This computer simulator has GUI, which will easily help users to navigate in this
computer simulator.
The computer simulator uses Newton Nodal Method in order to perform the
network analysis. The reason of choosing this method is it is a simple method that
suitable in solving set of equations, when comparing with Newton Loop method.
The method is used as the basic method to solve the network analysis. In future,
other methods such as the Newton Loop Method, Newton Loop-Nodal Method and
so on can be implemented into this computer simulator.
The flow equations used in this computer simulator are Poles (Lacey),
Polyflo, Coxs, Panhandle A and Weymouth. These flow equations selected have
their limitation like the pressure range. Assumptions have been made on these flow
equations so that they are suitable to be used in this computer simulator.
Graph theory algorithms are used to represent the gas network computation of
any topology, before performing the network analysis. The graph theory algorithms
have effect on gas network system, especially the network configuration. The effect
is the computation time. The larger the gas network system, this means more nodes
and branches involve, and the computation time taken is longer. From the results
obtained (speed test analysis), BFS is the fastest graph theory algorithms that are
5.37ms for case 1, 5.48 ms for case 2 and 5.62 ms for extended case study 1.
Lastly, this computer simulator is able to perform the network analysis for
low, medium and high pressure distribution network system. This computer
simulator can be used as a teaching aid in the gas reticulation course. Future
enhancement is needed in order to commercialize this computer simulator.
6.2 Reco mmendations
After referring to the result and conclusion obtained from the three case
studies, the following recommendations are given for future work.
4. To further develop the computer simulator with addition of some new flow
equations like Institute of Gas Technology (IGT) equation, Spitzglass
equation, and other methods such as the Newton Loop Method, Newton
Loop-Nodal Method and so on.
REFERENCE
11. Whitmire, S.A. Object Oriented Design Measurement. USA: John Wiley &
Son Inc . 1997
12. Shlaer, S. and Mellor, S.J. Object Lifecycles Modeling the World in States.
New Jersey: Prentice Hall, Inc. 1992
15. Liberty, J. SAMS Teach Yourself C++ in 21 Days. Fourth Edition. United
States: Sams Publishing. 2001
21. McHugh, J.A. Algorithmic Graph Theory. New Jersey, USA: Prentice Hall.
1990
22. Siek, J.G., Lee, L.Q., Lumsdaine, A. The Boost Graph Library: User Guide
and Reference Manual. USA: Addison Wesley Publishing, Company, Inc.
2001
23. Minieka, E. Optimization Algorithms for Networks and Gra ph. New York,
USA: Marcel Dekker. 1978
25. Wilson, G.G. Gas Distribution . First Edition. Chicago: IGT. 59-84. 1982.
26. Ohashi, T. Natural Gas Utilization for Industrial Users. Tokyo: Tokyo Gas
Co. Ltd. 1-390. 1990.
27. Abdel-Alim Hashem. Part Two: Steady State Flow of Gas through Pipes.
Oil and Gas Pipeline Design, Maintenance and Repair, 2000. PE 607: 1-71.
28. Dahl, H.J., Romo, F., Tomasgard, A. Optimisation Model for Rationing
Efficient Allocation of Capacity in a Natural Gas Transportation Network.
SINTEF Report, 2003. IAEE: 4-5.
29. Schroeder, D.W., Jr. A Tutorial on Pipe Flow Equations. Journal of Pipeline
Simulation Interest Group, 2001. 01(1): 1-18. .
30. Piggott, J., Kurschat, T., Revell, N. Taking the Rough with the Smooth a
new look at transmission factor formulae. Journal of Pipeline Simulation
Interest Group, 2002. 02(2): 2-21.
31. Menon, E. S., P.E. Gas Pipeline Hydraulic. Online Course. 2006
32. Aylmer, S. Interactive Gas Flow Analysis. PhD. Thesis. University of
Manchester: Institute of Science and Technology. 1980.
34. Ferziger, J.H. Numerical Methods for Engineering Application . New York:
Wiley. 1981
37. Bean, B.B. GASWorkS 9.0 Demonstration Guide. Colorado: User Guide
Version 9.0. 1997.
38. Hardee, R. Fluid Flow Software vs. Spreadsheets for Piping System Design
& Analysis. Engineered Software, Inc . PIPEFLO: White Paper. 2000.
42. Vetterling, W.T., Teukolsky, S.A., Press , W.H., Flannery, B.P. Numerical
Recipes Example Book (C++). Second Edition. USA: Cambridge
University Press. 2002
43. Perry, G. and Spencer, I. Visual C++ in 12 Easy Lessons. Indianapolis:
Sams Publishing. 1995
44. Deitel, H. M. and Deitel, P. J. C++ How to Program. New Jersey, USA:
Prentice Hall. 1997
47. Zulkefli Yaacob. Modelling and Simulation of Transient Gas Flow. PhD.
Thesis. University of Salford; 1996