IATMI 10-010

Embed Size (px)

DESCRIPTION

IATMI

Citation preview

  • IATMI 10-010

    User Friendly Simulator for Determining The Optimum Pipe Diameter in a Complex Gas Pipeline Network

    Lala Septem Riza1,2, Kuntjoro Adji Sidarto2, 3, Febi Haryadi2

    1Program Studi Ilmu Komputer, Universitas Pendidikan Indonesia 2RC - OPPINET, Institut Teknologi Bandung

    3Department Matematika, Institut Teknologi Bandung

    ABSTRACT Now days, natural gas plays an important role as a source of clean energy. The addition of gas consumption generally will require the new design and construction of gas pipelines. In this regard, the pipe diameter optimization process by considering the technical specifications is a must. Using the obtained optimum gas pipelines diameter, the investment cost and gas operations can be minimized. At this research, the user friendly simulator for obtaining optimum gas pipelines diameter had been developed. The simulator was developed based on assuming the gas flow in a steady state, pipe networks are modeled into a nonlinear equation system from gas flow equations in the pipe. This model system solved by Genetic Algorithm to obtain the optimum gas pipelines diameter with an investment cost of the pipe system as an objective function and specification of pressure on a node as a constraint. The optimization process is optimization of pipe specifications which available on the market (ANSI / ASME) with 64 kinds of diameter with range from 3 to 16 inch. At the end of the paper, a case study the optimization of gas pipe diameter in the region X is presented. From these case studies can be concluded that the Genetic Algorithm can determine the optimum pipe diameter which gives the lowest investment costs while still consistent to the technical specifications that have been determined.

    Keywords: Genetic Algorithm, optimization of gas pipe diameter.

    1. INTRODUCTION

    Currently, natural gas plays an important role in providing clean energy for the community. With the increasing gas demand, network development required a new gas pipeline to meet the needs of consumers and to connect the dots of new customers. To perform the design and construction or expansion of gas distribution pipelines, pipe diameter optimization process must be done to minimize the

    investment cost. On the other hand, the gas company also has a responsibility to meet the needs of consumers with gas to the pressure and flow rates that have been agreed in the contract. Therefore, the optimization is an optimization performed with specific limitations for pressure and flow rate that has been agreed in the contract. This study focused on determining optimum pipe diameter and pressure distribution which gives the pipes minimum investment cost, and also perform economics calculations model (consisting of investment costs, coating costs, installation costs and operational costs of pipes). Optimization pipe diameter must also consider the balance of the pressure distribution on the pipeline. Gas distribution pipeline network is modeled as the pipes that connect some point the gas supplier to the consumer points assuming the gas flow in a steady state. The system model which used to represent the gas distribution system is a method of balancing the gas flow in the pipe. Stoner [1] was the first time using this model for large networks. Stoner proposed steady state model written from the substituted gas correlation into the flow balance model, thus the nonlinear equation system is obtained. Then the nonlinear equation system will be solved by Genetic Algorithm [2], [3]. Diameter optimization with Genetic Algorithm based on the specifications of pipe which is available on the market and the allowed pressure distribution (ANSI / ASME [4]). After getting the optimum pipe diameter, the economic model i.e. investment costs, coating costs, installation costs, and operational pipe costs will be calculated.

    2. METHODOLOGY

    The problems solved step by step follows the flowchart below.

  • IATMI 10-010

    As shown in the picture above, there are three main parts i.e. the Genetic Algorithm application to obtain the optimum pipe diameter, the calculation of economic models, and the application of Newton's method for calculating the pressure distribution. This paper is focused on explaining the application of Genetic Algorithm and cost calculation, while Newton's method for calculating the pressure distribution has been discussed in the previous paper [5].

    2.1 Model Formulation

    The system model used to represent the gas distribution system is the flow balance method, i.e. the volume of gas flowing into the system must be equal to the volume of gas that came out of the system. Gas

    flow correlation used in this study is the Panhandle A correlation. A pipe connecting node i and node j has a length Lij (mile) and inside diameter Dij (inch). Pipeline system is assumed in constant conditions or steady-state with the gas temperature T, specific gravity G, and pipe efficiency E. The flow from i to j is expressed as a positive flow. Gas flow rate has units of MMSCFD and gas pressure has units of psia. For horizontal flow, the Panhandle A correlation is given by [6], [7]:

    (1)

    with Qij is the flow rate of gas in the pipe which connecting nodes i and j. Pi and Pj are the pressure at node i and node j, respectively. C is a constant correlation. To simplify the problem, it is assumed that all segments of the pipe work in conditions of T = 60, G = 0.6 and E = 0.92. Thus Panhandle A correlation can be simplified to:

    (2)

    with K = 8.2634*10-4. Flow balancing model is built by applying the analogy of Kirchhoff's law in electricity, so for a point m, the continuity equation obtained as follows[4]:

    (3)

    the index of Q shows connectedness while the + / - indicates direction of flow. While fm is a nonlinear equation at nodes m and represents the flow imbalance at some point, so it is zero if the system is in a state of balance. If the gas pipeline has a 10 point must be connected by pipeline segment then 10 nonlinear equations will be obtained. As mentioned earlier, the optimization process carried out to obtain the minimum investment with prescribed constrain of pressure. Investment formula is as follows.

    (4)

    With the cost of investment CIPij pipe, outside diameter ODij, tij is the wall thickness of the pipe between nodes i and j, and Cpipe is pipe cost per ton. Total cost of investment in the whole system of pipes is as follows.

    (5)

    Figure 1. Step-by-step for solving the problem .

  • IATMI 10-010

    Figure 2. Flowchart of Genetic Algorithm .

    Lij is the length of the pipe between nodes i and j which already known. In addition, another economies models calculated by the following formula. Total of coating cost:

    (6)

    Ccoat is coating cost per mile. Total of installation cost:

    (7)

    Cinst is installation cost per inch per mile. Total of operational cost, assumed 4% of total of investment cost and total of coating cost.

    (8)

    So, to minimize the total of pipe investment cost in steady state condition, nonlinear optimization problem below has to be solved. Minimize

    (9)

    subject to

    (10)

    2.2 Computation Methods

    Genetic Algorithm (AG) is a random search algorithm based on natural selection and genetics mechanisms. AG developed by John Holland at the University of Michigan in 1975. AG working in a set of candidate solutions called population. Each candidate solution is called an individual in the population. Usually, the individual is represented by a binary string. Any individual or string is mapped in a fitness value that represents the individual's level of performance. Each individual in the population will be subject to an operation to improve his fitness value. The operation is the selection or reproduction, crossover or cross-breeding, and mutation. Genetic Algorithm can be described as flowchart below.

    The basic steps in a Genetic Algorithm are [8]: 1. Generate randomly an initial population of

    chromosomes. 2. Calculate the fitness, defined according to

    some specified criteria, of all the members of the population and select individuals for the reproduction process. The fittest are given a greater probability of reproducing in proportion to the value of their fitness.

    3. Apply the genetic operators of crossover and mutation to the selected individuals to create new individuals and thus a new generation. Crossover exchanges some of the bits (genes) of the two chromosomes, whereas mutation inverts any bit(s) of the chromosome depending on a probability of mutation. Thus a 0 may be changed to a 1 or vice versa.

    Then again step 2 is followed until the condition for ending the algorithm is reached. In this research, the properties of genetic algorithm is as follow a) Representation of the population

    It is known that the desired solution is the optimum diameter and pressure distribution. In population, the solutions are arranged like binary code in a matrix as follows.

    bit_varp and bit_vard are the number of bits which represent the pressure and diameter index,

    Figure 3. Binary representation for the pressure and diameter in Population

  • IATMI 10-010

    respectively. Press is the number of nodes that will be determined pressure, and Dia is the number of pipe segments which will be optimized in diameter. The binary representation of diameter represents diameter specifications which available on the market (ANSI / ASME) with a diameter range from 3 to 16 inch (64 kinds of diameter).

    b) Operator selection, crossover, and mutation. Operator selection, crossover, and mutation performed for each part of the pressure and diameter. This operator is based on any probability value.

    c) Fitness function. Fitness function is formulated as follows.

    min ( ) ( )F x f x=

    (11)

    with f is a nonlinear equation of continuity that has been defined previously (Eq. (3) and (4) for each node).

    AG is used to estimate the solution of the equation system from which f (x) = 0, so the best fitness value is when F = 0.

    After the best individual which has the lowest fitness in step c has been gotten, the total cost will be calculated. Then, the result is sorted in ascending order. The lowest of total cost will be saved as the best individual on population for the next iteration. This process will be conducted until the maximum generation.

    The last process of computation is the Newtons method. This method is used to the last checking whether the result had been gotten from genetic algorithm convergent and balanced perfectly. The detail of the process could be found in the previous paper [5].

    2.3 Analysis and Design of the Simulator

    Development of simulation software is done with object-oriented concept and the Unified Modeling Language (UML) as a modeling tool. From the results obtained by the analysis conducted, functional requirements of the simulator as follows:

    1. Simulator must be able to calculate and display the pressure distribution on node.

    2. Simulator must be able to calculate and display the optimum diameter on pipeline.

    3. Simulator must be able to calculate the optimum cost(in $).

    By using UML diagrams, the three functional requirements above can be described simply as the use case diagram in Figure 4.

    Figure 4. Use Case Diagram

  • IATMI 10-010

    The results on the phase analysis model used in design was to determine the conceptual class diagram which is then translated into program code. The conceptual class diagram of this simulator can be seen in Figure 5.

    Class diagram showing the rules and responsibilities of the entities that determine the behavior of the system. During the design phase, class diagrams play a role in capturing the structure of all the classes that form the architecture of the system built. All classes that contained at this stage is a short description of the set of objects that have the responsibility, relationships, operations / methods, attributes and semantics that are implemented in software.

    2.4 User Interface The user interface is designed in such a way that is easy to use by the user. Main screen interface as in Figure 6. Panel or the type of object that can be used in this software as shown in Figure 7. The type of input / feedback given by users, namely: Main Input data (see Figure 8). Data input at each inlet, junction and outlet (see

    Figure 9). Data input on the pipe / link (see Figure 10). Database of diameter (see Figure 11). Interface for reporting (see Figure 12).

    At each input data is provided several alternative units / unit and users can also choose the equation of gas flow in pipes, such as Panhandle A, Panhandle B, and Weymouth.

    After entering all necessary data, the software will issue the results with 2 types that is in the graphical display (to show the direction of gas flow) and in the table (for displaying the distribution of pressure, flow rate in each segment of pipe, the optimum diameter and optimum cost (see Figure 13 and 14) .

    Figure 5. The Conceptual Class Diagram

    Figure 8. Main Interface of Simulator

    Figure 9. Interface for Inputing of Node Properties

  • IATMI 10-010

    2.5 Step of Using Software

    Here are the steps in using the simulator: 1. Preparation Phase. In this stage, the user prepares the necessary data to perform simulations. The data is - Pressure on the inlet nodes. - Flow rate at the outlet nodes. - Pipe length - Network schematic - Unit cost data

    2. Stage of entering data. In this stage, the user interacts with software. Here are the steps in this stage: - Run the simulator - Describe the model of the network in accordance with case studies. The network model is built by using the icon that has been provided that icon inlet, outlet, junction and links. - Enter data. The user clicks on the pointer icon and then clicking on the object for which data will be entered. - Customization of the database of the diameter. The user can change the diameter of the database used by going to the "data view" and then to the submenu "diameter input." - Enter the cost data. - Save the data. - Press the run icon to run it.

    3. Phase display the results. After waiting a while, the simulator will display the results. The simulation results can be viewed by clicking the "report". Users can save the report in Excel format.

    Figure 10. Interface for Inputing of Link Properties

    Figure 11. Interface of Diameter Database

    Figure 12. Interface for Reporting

  • IATMI 10-010

    3. CASE STUDY In this paper, a developed model tested in the case of the X region with a network schematically as shown below[9].

    Node S1 is the point of suppliers, while nodes D1, D2, D3, D4, D5, D6, D7, D8, D9, D10 are the point of demand, and nodes J01, J02, J1, J2, J4, J6, J7 are the points of junction. Pressure data and flow rate can be seen in the table below. The optimum size of the pipe diameter at each segment in the network will be determined, also the pressures at junction J01, J6, J7, J1, J4, J02, J2 and 10 will be determined. The pressures on the other nodes have been determined (according to the contract). Pressure data and flow rate at each node can be seen in the following table.

    Table 1. Data inputs for pressure and flow rate on the network

    No. Node Pressure

    (psia) Flow Rate (MMscfd)

    1 S1 255 45.882 2 J01 Unknown 0 3 D7 247 -1.235 4 J6 Unknown 0 5 D8 240 -0.832 6 J7 Unknown 0 7 D9 221 -2.369 8 D10 196 -16.209 9 J1 Unknown 0 10 J4 Unknown 0 11 D5 250 -1.644 12 D6 245 -1.273 13 J02 Unknown 0 14 D1 245 -6.284

    15 J2 Unknown 0 16 D2 228 -8.502 17 D3 225 -3.542 18 D4 230 -3.994

    While the data of pipe length at each segment is as follows.

    Table 2. Length of each segment of data on the network pipe

    From node To node Distance (mile) S1 J01 1.0501 J01 D7 0.1242 J01 J6 1.6606 J6 D8 0.15152 J6 J7 2.3306 J7 D9 0.3126 J7 D10 4.7249 S1 J1 0.57778 J1 J4 1.3823 J4 D5 0.28243 J4 D6 4.5863 J1 J02 0.65143 J02 D1 0.1242 J02 J2 2.3176 J2 D2 0.1242 J2 D4 1.1177 J2 D3 0.5589

    Data inputs for economics factor are as follows. - Pipe cost = US$ 2500/ton - Coating cost = US$ 10/meter - Installation

    cost = US$ 20/inch/meter

    While input for Genetic Algorithm is as follows. Population = 50 Persen_crossover = 90% Persen_mutation = 1% Max_generation = 3.000.

    From the simulation results obtained as follows.

    Figure 13. Schematic of gas distribution pipeline

  • IATMI 10-010

    Table 3. Result of pressure distribution No. Node Pressure (psia) 1 J01 246.6 2 J6 234.2 3 J7 219.3 4 J1 249.6 5 J4 248.5 6 J02 244.2 7 J2 234.3

    Table 4. Result of the optimum pipe diameter at each segment

    From Node To Node

    Inside Diameter

    (inch) Wall

    Thickness (inch)

    S1 J01 7.9 0.344 J01 D7 6,065 0.28 J01 J6 7.9 0.344 J6 D8 4.062 0.219 J6 J7 8.125 0.25 J7 D9 6.249 0.188 J7 D10 8.125 0.25 S1 J1 8.249 0.188 J1 J4 6.065 0.28 J4 D5 6.001 0.312 J4 D6 4.062 0.219 J1 J02 8.125 0.25 J02 D1 6.187 0.219 J02 J2 8.249 0.188 J2 D2 4.124 0.188 J2 D4 6.065 0.28 J2 D3 4.124 0.188

    From the optimum diameter above, the economies cost obtained as follows.

    Table 5. Result of the economies cost

    No. Item of cost Cost (US$) 1 Investment 2,965,132.42 2 Coating 396,032.68 3 Installation 5,733,666.24 4 Operation 1,344,466.04

    Total cost 10,439,297.38

    After getting the result of diamater optimization using genetic algorithm, to get more satisfying, we should check using balancing3 system software to calculate pressure distribution on each node. Balancing system software what we have is using combination between genetic algorithm and newtons method [5]. After that, we should compare between the pressure given by user as input data on each demands and the result of balancing system software. We should run again if the result of comparation isnt good enough. The result of pressure diameter of this case study is as follow.

    Table 6. Result of the pressure distribution

    No Node Name Pressure Rate

    (Psia) (MMscfd) 1 J01 246.569 0 2 J6 234.162 0 3 J7 219.309 0 4 J1 249.578 0 5 J02 244.221 0 6 J2 234.324 0 7 J4 248.506 0 8 S1 255 45.884 9 D10 193.628 -16.209

    10 D9 219.147 -2.369 11 D8 234.076 -0.832 12 D7 246.549 -1.235 13 D6 243.064 -1.273 14 D5 248.426 -1.644 15 D1 243.851 -6.284 16 D3 229.99 -3.542 17 D4 232.661 -3.994 18 D2 229.439 -8.502

    The main interface of the software which has been resulted based on the model is as follow.

  • IATMI 10-010

    Figure 2. The main interface of the optimization software

    4. CONCLUSION Simple Genetic Algorithm can be helpful in finding an optimal inside diameter. The optimal inside diameter gives a minimum cost by considering the technical specifications (the pressure given by user). To give more satisfying result, the optimal inside diameter should be checked by software for calculating pressure distribution (balancing system software).

    5. ACKNOWLEDGMENTS Our thanks to RC-OPPINETITB Team for everything to make the research could be done.

    6. REFERENCES [1]. Stoner, M.A. 1969. Steady-State Analysis of Gas

    Production, Transmission and Distribution System. paper SPE 2554 presented at the SPE

    44th Annual Fall Meeting, Denver, Colo. (Sept. 28-Oct. 1, 1969).

    [2]. Goldberg D.E.. 1989. Genetic Algorithm. Addison-Wesley Publ. Co., Inc.

    [3]. Sidarto K.A., Saiman dan N. Rohani. 2004. Menentukan Akar Sistem Persamaan Tak Linier dengan Memanfaatkan Algoritma Genetika yang Dilengkapi Clearing Procedure dari Petrowski. In Proceedings of Konferensi Nasional Matematika XII (Denpasar, Bali, 23-27 Juli, 2004).

    [4]. American Petroleum Institute. 1980. API Specification for Line Pipe. American Petroleum Institute. Washington, D.C.

    [5] Sidarto, K. A., Mucharam, L., Riza, L.S., Mubassiran, Rohani, N., Soplan, S. 2005. Implementation of Genetic Algorithm to Improve Convergente of Newtons Method in Predicting Pressure Distribution in Complex Gas Pipeline Network Sistem Case Study: Off-take Station ST-WLHR Indonesia. In Proceedings of Seminar nasional soft computing, intelligent sistems and information technology/SIIT (28-29 July 2005).

    [6]. Flanigan O. 1972. Constrained Derivatives in Natural Gas Pipeline System Optimization. Journal of Petroleum Technology (May 1972), pp. 549 556.

    [7]. Ikoku C.U. 1984. Natural Gas Production Engineering. John Wiley & Sons, New York.

    [8]. Agarwal V. Solving Transcendental Equations Using Genetic Algorithm. http://www.geocities.com/mumukshu/gatrans.html

    [9]. Sidarto K.A., Riza L.S., Widita C.K., Haryadi F.(2010). Gas Distribution Network Optimization with Genetic Algorithm., ICSIIT, Bali.