Computer-Aided Simulation Model for Natural Gas Pipeline Network

Jan 9, 2004 - This paper presents the development of a computer-aided simulation model ... network system, selecting the components of natural gas, pi...
1 downloads 0 Views 460KB Size
990

Ind. Eng. Chem. Res. 2004, 43, 990-1002

PROCESS DESIGN AND CONTROL Computer-Aided Simulation Model for Natural Gas Pipeline Network System Operations Panote Nimmanonda, Varanon Uraikul, Christine W. Chan, and Paitoon Tontiwachwuthikul* Faculty of Engineering, University of Regina, Regina, Saskatchewan, Canada S4S 0A2

This paper presents the development of a computer-aided simulation model for natural gas pipeline network system operations. The simulation model is a useful tool for simulating and analyzing the behavior of natural gas pipeline systems under different operating conditions. Historical data and knowledge of natural gas pipeline system operations are crucial information used in formulating the simulation model. This model incorporates the natural gas properties, energy balance, and mass balance that lay the foundation of knowledge for natural gas pipeline network systems. The user can employ the simulation model to create a natural gas pipeline network system, selecting the components of natural gas, pipe diameters, and compressor capacities for different seasons. Because the natural gas consumption rate continuously varies with time, the dynamic simulation model was built to display state variables of the natural gas pipeline system and to provide guidance to the users on how to operate the system properly. The simulation model was implemented on Flash (Macromedia) and supports use of the simulation model on the Internet. The model was tested and validated using the data from the St. Louis East system, which is a subsystem of the natural gas pipeline network system of SaskEnergy/Transgas Company. The model can efficiently simulate behaviors of the pipeline system with satisfactory validated results. 1. Introduction Natural gas is one of the most widely used sources of energy in North America, especially in Canada. Efficient operations of natural gas pipelines are important for ensuring gas transmission to customers. Construction of a natural gas pipeline network system can be difficult because of variations in customer consumption rates, which directly influence system properties such as the inline pressure and the volume of natural gas transmitted. These parameters also vary depending on the season. To better support the design of natural gas pipelines, constructing a model that can simulate the operational behaviors of the system is important. To construct a simulation model, historical and current observations collected on system behaviors are needed. Simulation models can provide predicted system behaviors based on a number of “what if” scenarios about the real-world system. Some relevant works that describe the use of simulation models in industrial processes include the following: Simulations have been applied to different disciplines, including engineering, social science, and business by Banks.2 A simulation model for the control of food freezing processes using a discrete dynamic technique with quantitative knowledge was proposed by Banoune and Depeyre.3 A basic steady-state and dynamic simulation model in which every plant * To whom correspondence should be addressed. Tel.: (306) 585-4160. Fax: (306) 585-4855. E-mail: [email protected].

component was represented according to a graphical modeling technique was applied to a power plant system by Lu.10 The main objective of this paper is to present the development of a computer-aided simulation model for natural gas pipeline network systems. Such a system can assist users in the design of a natural gas pipeline network system. The simulation model was designed to support the following tasks: (1) specifying the key components of a generic natural gas pipeline network system, (2) providing practical knowledge and a suitable mathematical model for the system, (3) helping users to construct a natural gas pipeline network system that models their real systems on the Internet, and (4) analyzing and predicting the behaviors of systems dynamically under changing conditions of operations. The model was implemented on Flash development software (Macromedia). Flash is an environment for designing and delivering low-bandwidth animations, presentations, and Web sites. It contains powerful multimedia capabilities and also offers scripting capabilities and server-side connectivity for creating interactive elements and Web applications. This paper is organized as follows: Section 2 presents an overview of the operations of a general natural gas pipeline network system, including the main components of the system and their characteristics. This section also explains how the characteristics of system components are formulated into a mathematical model. Section 3 describes the role of each component in the simulation model, including how the data are processed

10.1021/ie030268+ CCC: $27.50 © 2004 American Chemical Society Published on Web 01/09/2004

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 991

and the results generated. Section 4 describes a case study and how the graphical user interfaces are used. The data from the case study are integrated with the simulation model for testing. Section 5 discusses the results of the test, as well as their verification and validation. Finally, the conclusions and agenda for future work are given in section 6. 2. Natural Gas Pipeline Network System A natural gas pipeline system involves a set of operations and components that must be clearly understood before a simulation model can be built. 2.1. Natural Gas Operations. The tasks of natural gas operations involve monitoring parameters of the pipeline system, determining customer demand for natural gas, and adjusting operations to meet demand. The main task of the dispatcher is to regulate compressors to control the pressure of natural gas in the system. Effective operation of the compressor is not easy, as there are many factors to consider and many components in the pipeline system. 2.2. Main Components of Natural Gas Pipeline Network Systems. There are five main components in a natural gas pipeline network system: the natural gas, the pipeline network system, the compressor stations, the customers, and the ambient temperature of gas. Each can affect the condition of the natural gas pipeline system in different ways. (1) Natural gas is mainly utilized for heating in households and industries. It is customarily defined as a mixture of gases, including both hydrocarbons and non-hydrocarbons. All hydrocarbon gases are characterized by the general formula of CnH2n+2, and the nonhydrocarbon gases are nitrogen and carbon dioxide. The principal component in natural gas is methane (CH4), which does not condense to a liquid under any typical operating conditions. Normally, natural gas in a pipeline system contains 85-95% methane, along with varying small proportions of ethane, propane, and butane and a maximum of about 5% non-hydrocarbon components.15 If the composition in terms of percentages of the components should change, then the properties of the natural gas are also altered. (2) Pipeline network systems constitute an economical means of transporting fluid over long distances because they have low operating and capital costs, which decline further with larger volumes of throughput. Many factors are involved in the design of long-distance natural gas pipelines, including the type and diameter of pipes and the length of the pipelines. The type of pipe can affect the characteristics of natural gas operations. One of the main concerns is the roughness of the pipe, which directly affects the friction factor of a pipe. The fiction factor increases in proportion to the pipe’s roughness and is used to compute the magnitude of the pressure drop due to friction between the fluid and the surface of the pipe. The length of a pipeline is usually measured from one natural gas station to another, from a natural gas station to a customer area, or from one customer area to another. It is desirable for the pipe length to be minimized in order to reduce capital and operating costs. The diameter of a pipe can affect the volume of natural gas transmitted at a given natural gas velocity because pipes with larger diameters can transmit more natural gas than those with smaller ones. However, a pipe with a larger diameter also has a higher cost. Therefore, pipeline designers or engineers have to

consider these factors in optimizing the capital and operating costs. (3) Compressor stations contain compressors for increasing, maintaining, and decreasing pressure in the pipeline system. In general, the compressors can generate pressure to satisfy the demand of all customers in the pipeline system. (4) The type of customer is a key factor that affects the flow rate in the pipeline at a given time. Natural gas customers can be categorized into four types, i.e., residential, farming, commercial, and industrial, and each category of customers consumes natural gas at a different rate. For example, the demand of industrial customers is constant, whereas the demand of residential customers fluctuates during different periods of time in a day. Statistically, the maximum consumption occurs in the mornings and evenings because the customers utilize natural gas for cooking and heating in the mornings and for heating houses and buildings in the evenings. (5) Ambient temperature affects customer consumption of natural gas; that is, the consumption rate varies depending on the season. In winter, customers consume more natural gas than they do in summer. The consumption rate usually hits the highest level in winter and the lowest level in summer. Meanwhile, in fall and spring, the consumption rate is at a moderate level. 2.3. Natural Gas Properties. Natural gas properties are the basic considerations that provide the basis for calculating indicators of the state of a pipeline system such as the pressure and flow rate of the natural gas. Five natural gas properties are involved in the simulation model: molecular weight, gas gravity, compressibility factor, gas density, and viscosity. These properties are described as follows: Molecular Weight. Molecular weight can be determined using eq 1

Mg )

∑ yiMi

(1)

where Mg is the overall molecular weight of the natural gas, Mi is the molecular weight of each hydrocarbon or non-hydrocarbon component i, and yi is the mole fraction of each hydrocarbon or non-hydrocarbon component i. Gas Specific Gravity. In natural gas, specific gravity can be defined using eq 2

γg ) Mg/Ma

(2)

where γg is the gas specific gravity, Mg is the natural gas molecular weight, and Ma is the air molecular weight. Compressibility Factor. To obtain the compressibility factor, the pseudo-reduced temperature (Tr) and pressure (pr) must be first calculated using eqs 3 and 4, respectively

Tr ) T/Tc

(3)

pr ) p/pc

(4)

where Tr is a pseudo-reduced temperature and pr is a pseudo-reduced pressure; T and p are the operating temperature and pressure, respectively; Tc and pc are the critical temperature and pressure, respectively. To obtain the value of the critical temperature and pressure of a gas mixture, Key’s mixture rule can be applied to determine the pseudo-critical temperature

992

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

Table 1. Physical Constants for Typical Natural Gas Constituents

component

molecular weight (g/mol)

critical pressure (psia)

critical temperature (°R)

CH4 C2H6 C3H8 n-C4H10 i-C4H10 n-C5H12 i-C5H12 n-C6H14 n-C7H16 n-C8H18 n-C9H20 n-C10H22 N2 CO2 H2S O2 H2 H2O

16.043 30.070 44.097 58.124 58.124 72.151 72.151 86.178 100.205 114.232 128.259 142.286 28.013 44.010 34.076 31.999 2.016 18.015

667.8 707.8 616.3 550.7 529.1 488.6 490.4 436.9 396.8 360.6 332.0 304.0 493.0 1070.9 1306.0 737.1 188.2 3203.6

343.1 549.8 665.7 765.4 734.7 845.4 828.8 913.4 972.5 1023.9 1070.4 1111.8 227.3 547.6 672.4 278.6 59.9 1165.1

µ)

∑ yiTci ppc ) ∑ yipci

v ) µ/F

(5) (6)

(7)

(8)

where Mg is the molecular weight, p is the pressure, R is the gas constant, Z is the gas compressibility factor, and T is the temperature of the system. Viscosity. Two types of viscosity can be used to characterize natural gas behavior: dynamic and kinematic. The dynamic viscosity, a measure of a fluid’s resistance to flow, is defined as the ratio of the shear force per unit area to the local velocity gradient; this is represented by

F/A µ) dv/dL

]

where µ is the dynamic viscosity, M is the molecular weight, Fg is the gas density, and T is the temperature of the system. Kinematic viscosity is the ratio of the dynamic viscosity of a fluid to its density, i.e.

where A-D are correlation constants, Z is the compressibility factor, Tr is the pseudo-reduced temperature, and pr is the pseudo-reduced pressure. Gas Density. The density of natural gas Fg can be calculated as

Fg ) pMg/ZRT

[(

)

where Tpc and ppc are the pseudo-critical temperature and pressure, respectively; yi is the mole fraction of each hydrocarbon or non-hydrocarbon component i; Tci and pci are the critical temperature and pressure, respectively, of each component i. Table 1 provides the values of molecular weight, critical pressure, and critical temperature of the hydrocarbon and non-hydrocarbon components of natural gas.4 In practice, a Standing and Katz chart is used to illustrate the relationship between the values of pseudoreduced temperature Tr, pseudo-reduced pressure pr, and compressibility factor Z for sweet natural gas. However, to make the chart applicable for simulation programming, a straight line was introduced to fit the Standing and Katz chart in a general form as5

Z ) pr(ATr + B) + CTr + D

10-4(9.4 + 0.02M)T 1.5 986 exp 3.5 + + 209 + 19M + T T 0.01M Fg1.7+(197.2/T)+0.002M (10)

and pressure as follows

Tpc )

where µ is the dynamic viscosity, F is the flow rate, A is a unit area, v is the velocity gradient, and L is the length of the pipe. If temperature is involved, the equation for dynamic viscosity can be expressed as8

(9)

(11)

where v is the viscosity, µ is the dynamic viscosity, and F is the gas density. 2.4. Background on Gas Flow in Pipelines. The mathematical models used to design a natural gas transmission pipeline network system are based on algorithms derived from the principles of thermodynamics and fluid flow. They affect the characteristics of the natural gas flow that include system mass balance, system energy balance, and friction factor. System Mass Balance. The mass flow rate through the control volume does not vary with time. Therefore, the mass flow rate into the control volume must be equivalent to the mass flow rate out. This can be expressed as

min ) mout

at

dmcv ) 0

(12)

where dmcv is the system mass balance; mcv is the mass flow rate in a control volume; and min and mout are the mass flow rates entering and leaving the control volume, respectively. System Energy Balance. Weymouth developed a general equation for calculating the steady-state isothermal flow of a gas through a horizontal pipe, based on the concept of energy conservation

( )[

qsc ) 5.635 382 1

]

Tsc (p12 - p22)d5 psc γgZavTfL

0.5

(13)

where qsc is gas flow rate measured at standard conditions in thousands of standard cubic feet per day (Mscfd), psc is the pressure at standard conditions in pounds per square inch absolute (psia), Tsc is the temperature at standard conditions in Rankine, p1 is the upstream pressure in psia, p2 is the upstream pressure in psia, d is the diameter of the pipe in inches, γg is the gas gravity, T is the flow temperature in Rankine, Zav is the average gas compressibility factor, f is a friction factor, and L is the length of the pipe in feet. Reynolds Number and Friction Factor. The Reynolds number can be determined using the velocity, density, and viscosity of the fluid as well as the crosssectional area of the pipe.6 Equation 14 is used to calculate the Reynolds number

NRe ) 20qscγg/(µd)

(14)

where NRe is the Reynolds number, qsc is the gas flow

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 993

Figure 2. Patterns of natural gas consumption.

Figure 1. Relationship between compressor capacity per unit flow rate and compression ratio.

rate in Mscfd, γg is the gas gravity, µ is the dynamic viscosity in centipoise (cp), and d is the diameter of the pipe in inches. For gas flow in a smooth pipe, the friction factor depends mainly on the Reynolds number as follows

f ) 0.0056 + 0.5NRe-0.32

Figure 3. General curve of natural gas demand in a year.

(15)

where f is a friction factor and NRe is the Reynolds number. Equation 15 is applicable for the Reynolds numbers between 3000 and 1 000 000. 2.5. Compressor Characteristics. According to the experience of operators who have long been operating compressors, the compressor capacity can be described as a function of the flow rate and the compression ratio in a graph as shown in Figure 1. Thus, the ratio of the discharge and suction pressures of a compressor can be expressed in the following formulas

R ) (0.4/18)[(BHP/q) + 44.5] at 5 < (BHP/q) < 23 (16) R ) (0.4/12)[(BHP/q) + 22.0] at 23 < (BHP/q) < 35 (17) R ) (0.1/2)[(BHP/q) + 3.0]

at 35 < (BHP/q) < 37 (18)

where R is the compression ratio and q is the flow rate in millions of standard cubic feet per day (MMscfd). When the compression ratio R has been defined and one of the values of either the discharge pressure, pdischarge, or the suction pressure, psuction, is known, then the value can be computed with the following equation

R ) pdischarge/psuction

(19)

2.6 Customers’ Consumption Characteristics. Three major groups of natural gas consumers must be considered: industrial, dehydrator, and heat-sensitive.17 Each group exhibits a different pattern of natural gas consumption expressed as a relationship between time and pressure, as shown in Figure 2. Natural gas is mainly utilized for heating purposes. Hence, the ambient temperature is the main determinant in the natural gas consumption of customers.14 As a result, the natural gas demand is high in the winter and low in the summer. Figure 3 shows a graph of natural gas demand during a typical year from January to December.

If the consumption rate of each type of customer within one year is available, the total consumption rate of all customers in each season can be derived from the expression

TotalConsmp ) [%MC × (D/days + C/days + F/days)] + [(I/days) × %IC] (20) where TotalConsmp is the total consumption rate, %MC is the percentage of consumption compared to the maximum load according to seasons, D is the yearly consumption of residential customers, C is the yearly consumption of commercial customers, F is the yearly consumption of farming customers, I is the yearly consumption of industrial customers, %IC is the percentage consumption of industrial customers according to seasons, and days is the number of days of consumption in the year. 2.7. Schematic of Natural Gas Pipeline Network System. The basic features in a natural gas pipeline network include pipes connected to form a pipeline network and natural gas flowing in at one end and out at the other end. A pipeline network generally consists of compressor stations and customer areas. For longdistance delivery, compressor stations need to be located between the primary compressor stations and customer areas to the maintain pressure of the natural gas throughout the pipeline network. Pipelines that branch out from the main lines transmit natural gas to several customer areas, as illustrated in Figure 4. The fundamental components of the natural gas transmission pipeline consist of nodes and nodeconnecting elements. Nodes are the points where a pipe leg ends, where two or more node-connecting elements are joined, or where there is an injection or delivery of natural gas. Node-connecting elements include pipe legs, compressor stations, valves, and pressure and flow regulators. Figure 4 illustrates a loopless pipeline network system for natural gas transmission. A loopless pipeline network system contains nodes joined by one or more node-connecting elements with no closed loops. Such a system usually begins at the compressor station at node 1 and transmits natural gas from node 1 to node j, for j ) 2, 3, ..., n + 1. Between node 1 and node 2, there is a pipe leg 1. Therefore, for n + 1 nodes in total,

994

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

Figure 4. Schematic for the natural gas pipeline network system.

there are n pipe legs. At each node between node 1 and node n + 1, natural gas is delivered to each customer area. Mass balance and energy balance equations can be used to calculate the pressure and flow rate at each node. If one value among the node pressure, inlet pressure, or outlet pressure is given, the others can be calculated by a given set of pipe leg parameters and the flow rate into or out of the nodes. To determine the pressure at any node, eq 13 can be generalized as j-1

pj2 ) p12 -

kiqi2 ∑ i)1

(21)

where i ) 1, 2, 3, ..., n; j ) 2, 3, ..., n, n + 1; and pi is the pressure, qi is the flow rate; and ki is the correlation variable at node i. Meanwhile, the flow rate at a node can be computed using the mass balance equation applied from eq 12. By applying the mass balance equation with an analogy of Kirchhoff’s law for the flow of electricity in electrical networks, the sum of natural gas flows entering and leaving the pipeline system at any node is zero m

qi ) 0 ∑ i)1

(22)

where m is the number of node-connecting elements and qi is the flow rate of natural gas at each node i. qi assumes a positive value for flow into node i and a negative value for flow out of node i. 3. Conceptual Framework of a Computer-Aided Simulation Model for Natural Gas Pipeline Network Systems The components of the natural gas pipeline network and the relationships and properties of these components form the basis of the simulation model. The correspondence between the components of the pipeline system and the simulation model is shown in Table 2. To simulate a natural gas pipeline network system, the components throughout the system must be clarified. From Table 2, the main components, which together make up the system state, consist of the schematic of the system, the number of stations, the number of compressors at each station, the customers, the pipes, and the natural gas components. The entities in the simulation model are the compressors, the customers, the pipes, and the natural gas. Compressors have their own attributes, such as break horsepower (BHP) and compression ratio. Customers are the entities that determine the natural gas consumption rate of the system. Pipes have attributes of diameter and length.

Table 2. Correspondence between the Components of the Natural Gas Pipeline Network System and the Items in the Simulation Model simulation model

natural gas pipeline network system

system state

schematic of the system number of stations number of compressors at each station number of customer areas in the entire network number of pipes in the entire network natural gas components entities compressors, customers, pipes, natural gas attributes BHP, compression ratio, consumption rate, pipe diameter, pipe length percentage of each hydrocarbon and nonhydrocarbon component in natural gas state variables status of compressors (on, off), pressure, flow rate events turning compressors on/off or up/down, changing consumption rate activities deliver natural gas

The attributes of the natural gas are the percentages of hydrocarbon and non-hydrocarbon components in the natural gas. The pressure and flow rate at each customer location, which are the state variables, must be considered. These state variables can be changed by events during operation. The events can be (i) the actions of the dispatcher, such as turning a compressor on or off, or (ii) the change in the entities of the system itself, such as the consumption natural gas. In the actual operating system, the dispatcher monitors the state of the natural gas pipeline system from a computer screen. The pressure and flow rate are displayed and updated within a time interval. The discreteevent simulation approach is applied to build the natural gas pipeline network system because the changes of state variables occur within a time interval. Moreover, the simulation model can dynamically provide the state variables as effectively as a real-time monitoring system does. Figure 5 illustrates how the simulation model processes inputs and generates outputs. The simulation model is initialized when the user first inputs the parameters into the simulation model through the user interfaces. The input parameters include a schematic of the system, the number of stations, the number of compressors and the capacity of each compressor, number of customers and yearly consumption rate of each type of customer, the diameter and length of the pipes, the percentages of hydrocarbons and nonhydrocarbons componenets in the natural gas, and the range of pressure in the operations. Using these inputs, the simulation model starts to simulate all variables in the natural gas pipeline network system and provide outputs through the user interface. The main user interface illustrates the outputs on the selected schematic according to the number of stations, compressors, and customers, as specified by the user. The natural gas

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 995

Figure 5. Diagram of the processes in the simulation model for natural gas pipeline network systems.

properties and the state variables, pressure and flow rate, are simulated using all the equations discussed in section 2 and displayed on the screen. The natural gas properties, molecular weight, specific gravity, compressibility factor, density, and viscosity, can be determined using eqs 1-11. Equations 14 and 15 are applied to calculate the Reynolds number and friction factor, respectively. According to the season selected by the user, eq 20 is used to simulate the consumption rate of customers and represent the flow rate of the pipeline system. To calculate the pressures at the nodes in the pipeline, the energy and mass balance relationships, eqs 21 and 22, are applied in the simulation model. The system also generates recommendations on operation control to the dispatchers. Moreover, because of the possible changes in the consumption rates of the customers, the simulation model is designed to dynamically simulate the consumption rate every 15 s. The simulation model also allows the dispatcher to decide whether to turn on/off or increase/decrease the capacity of the compressors during operation. When a change in the compressor status occurs, the compression ratio is shifted to a new level, which is calculated using eqs 1618. Once the consumption rate or actions on compressors are changed, the state variables are automatically updated and displayed on the user interface. 4. Case Study of a Natural Gas Pipeline Network System 4.1. Background on the Case Study System. The natural gas pipeline network system used as a case study here is located in the St. Louis East area in

Figure 6. Schematic of the St. Louis East system.

Saskatchewan, Canada. The system consists of two compressor stations at St. Louis and Melfort. The system spans the region from the St. Louis station to the Melfort station and ends at the Nipawin and Hudson Bay customer areas. Natural gas is transmitted to 32 customer areas. Some areas consist of all four types of customers, including domestic, commercial, farming, and industrial. Others have only two or three types of customers. Although there are many customer areas, the dispatcher usually focuses on only the pressure at the end points of the pipeline system. The reason for this approach is that, if the pressure at the end points is adequately maintained, the entire pipeline system will have enough pressure. Therefore, the places where the pressure should be gauged are the remote customer areas farthest from the St. Louis and Melfort stations. The most remote customer areas from the St. Louis station before reaching the Melfort station are Melfort and St. Brieux. The most distant areas from the Melfort station are Nipawin and Hudson Bay, located at the end of the pipeline system. Figure 6 shows a

996

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

Figure 7. User interface for selecting a pipeline system pattern.

schematic of the natural gas pipeline network system in the St. Louis East area. At the St. Louis station, there are three compressor units, whose capacities are 600, 250, and 250 hp. At the Melfort station, there are two compressor units with a capacity of 600 hp each. In the winter at the St. Louis station, the 600-hp unit is operating, and the other two units of 250 hp each are on standby, whereas at Melfort, one unit is running, and the other is for backup. Conversely, in summer, one 250-hp compressor is operating, the other 250-hp unit is on standby, and the 600-hp compressors are idle. However, the situation might not be certain all the time. In a real system, there is a basic indicator that can help the dispatcher to control the compressors, namely, the range of operating pressure at the furthest customer areas. The operating pressure can range from the lowest pressure that is still considered sufficient for the system to continue operating to the highest pressure that will not damage the pipes. Generally, the dispatcher tries to maintain the pressure in the middle of the range. This range of operating pressure for the St. Louis East system is between 3100 and 6800 kPa. All pipes in the network system are installed underground. Between the St. Louis and Melfort stations, there are a couple of 6-in.-diameter pipes. Smaller pipes of 2- and 4-in. diameters are connected from the main pipe to the customer areas. The pipelines are connected to 14 customer areas with 9 connecting points. From the Melfort station to Nipawin and Hudson Bay, the main pipeline has a 6-in. diameter. When the main pipeline reaches the juncture at Tisdale, it separates into two branches. One branch delivers natural gas to Nipawin and the other to Hudson Bay. The branch to Nipawin contains a pair of 4-in.-diameter pipes with 8 connecting points from which small pipes spread out to 12 customer areas. The branch to Hudson Bay has a 6-in.-diameter pipe. A few connecting points are hooked up to this branch to service 6 customer areas. The natural gas in the system consists of 96.12% methane, 0.283% ethane, 0.042% propane, 0.01% isobutane, 0.009% n-butane, 0.002% isopentane, 0.001% n-pentane, 0.008% heptanes, 3.458% nitrogen, and 0.067% carbon dioxide. 4.2. Inputs and Outputs. The information on the natural gas pipeline network system at the St. Louis

East described in section 4.1 provided the basis for the inputs to the simulation model. 4.2.1. System Inputs. The main entities of natural gas pipeline network systems are stations, compressors, pipes, customers, ambient conditions, natural gas, and ranges of operation. These are represented in the user interfaces of the simulation model as follows: (1) The pipeline system schematic interface shows a set of pipeline system schematics on the operating space as portrayed in Figure 7. On this interface, there are six images representing schematics of the pipeline system. A rectangle represents a compressor station, and a circle represents the most remote customer area. On the left-hand side are three images of the pipeline network system consisting of only one compressor station with one, two, and three of the most remote customer areas. On the right-hand side are three images of the pipeline network system that has two compressor stations with one, two, and three of the furthest customer areas. The user can choose a schematic by clicking on the images. Focusing on the pipeline system in the St. Louis East area, the image pattern on the middle right-hand side with two compressor stations is selected. (2) The compressor stations interface as shown in Figure 8 allows the user to specify the names of the stations and the number of compressors in each station. (3) The compressors specification interface provides blank textboxes in which the user can indicate the capacity of each compressor in the pipeline system. Figure 9 shows the capacities of the compressors at two compressor stations of the St. Louis East pipeline system. (4) The customers and pipes detail interfaces provide a number of blank textboxes so that the user can identify (1) the name of endpoint customers as shown in Figure 10, (2) the length and diameter of pipes from one node to another, and (3) the yearly consumption rates of all customers in each area as illustrated in Figure 11. The consumption rates of four types of customers, i.e., domestic, commercial, industrial, and farming, are also displayed on this interface. (5) The natural gas components interface enables the user to input the percentages of hydrocarbon and nonhydrocarbon components in the natural gas. Figure 12

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 997

Figure 8. User interface for compressor stations.

Figure 9. User interface for setting compressor specifications.

Figure 10. User interface for input on end-point customers.

shows the percentages of the components in the natural gas of the St. Louis East area. (6) The set condition interface depicted in Figure 13 allows the user to specify the range of operation. The range of operation can be defined as a range of pressure levels at the furthest customer areas from the lowest level to the highest level. The lowest level indicates the

lowest pressure that can satisfy the demand of the customers, and the highest level indicates the highest pressure supported by the pipeline without causing damage to the entire pipeline system. Therefore, the appropriate operating pressure is within the range between the lowest and highest levels. The simulation model also provides options for operating in different

998

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

Figure 11. User interface for input on consumption rate.

Figure 12. User interface for input on percentages of natural gas components.

seasons. Thus, the user can simulate the behaviors of the natural gas pipeline system for winter, spring, summer, or fall. Through the input interfaces depicted in Figures 7-13, the user can change or modify input data. Once all input data have been specified, the simulation model is ready to perform its tasks and generate the system outputs. 4.2.2. System Outputs. Conceptually, the output user interfaces were designed to provide the outputs of the system state, natural gas properties, and operating advice. System states including the selected schematic, the names of stations and customers, the season of operation, the images of the compressors and control buttons, the status of each compressor, the horsepower at each station, the pressure and flow rate at each station, and the pressure at the furthest areas are shown in the display in Figure 14. Figure 14 shows the natural gas pipeline network at St. Louis East, on which images of blades represent the

compressors. The simulation model allows users to click on these images to change the status of each compressor while the model is running. By clicking on these images, the status of each compressor can be changed from on to off and vice versa. Also, users can either increase or decrease the capacity of each compressor by clicking on the “2” or “1” symbol located beside each compressor. The capacity of each compressor, shown on its image as a percentage, is changed by a rate equivalent to 10% of its full capacity each time the user clicks on the symbols. Every 15 s, the simulation model automatically outputs the state variables, pressure and flow rate at each station, and pressure at the furthest areas. Moreover, the natural gas properties such as the molecular weight, specific gravity, compressibility factor, density, and viscosity are simulated and displayed in the output user interface, as shown in Figure 15. The operating advice from the simulation model informs the user of the status of the pipeline system in

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 999

Figure 13. User interface for input on pressure range and season.

Figure 14. System state of the simulation model.

Figure 15. Natural gas properties panel.

terms of horsepower and pressure, as illustrated in Figure 16. While the simulation model is running, the total horsepower at each station is calculated using the ratio of horsepower and flow rate via eqs 16-18. The ratio ranges from 5 to 37; otherwise, the system variables cannot be determined. Furthermore, the simulation model calculates the pressure at the most remote areas and compares it to the range of operating pressures specified by the user. When the pressure is higher or lower than this range, the simulation model advises the user to decrease or increase the capacity of the compressors. 5. Verification and Test Results To ensure that the simulation model performs its tasks accurately and represents the behaviors of the real-world system, the model must be tested and verified.

5.1. System Verification. The aim of verification is to determine whether the system can properly receive inputs and correctly generate outputs. The verification process includes the following steps: (1) checking to ensure that the equations are accurate, (2) inspecting the logic of the simulation model for every user-issued action, and (3) monitoring the flow and logic of the presentation of the user interfaces Two main equations are important for the verification processes: one for the mass balance and one for the energy balance. To test the equations, a set of data from the real-world system was used and compared to the results provided by the simulation model. Then, the constraints from the real-world system were incorporated into the simulation model. The constraints are the initial pressure and consumption rate at each customer area. To test whether eqs 1-22 are correct, the pressure of each node from the initial node to the last node, which is the final or furthest customer areas, should be examined. The difference between the results provided by the simulation model and the actual operating data should not exceed the range of 0.1-0.5%. The pressure outputs after user modification of the compressor capacity was also examined closely. The inspection began with checking the responses of the simulation model to a user clicking on the compressor images on the output user interface. Each image was tested by changing the status of the compressors from on to off or off to on and varying the capacity of compressors. The changes in capacity in percentages were checked against the information in

1000 Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

Figure 16. Operating advice panel.

Figure 17. Comparison of pressure at the maximum flow rate.

Figure 1 for every action, as changes in capacity affect the compression ratios of the discharge and suction pressures. Finally, the user interfaces were verified by debugging the programming logic in the simulation model. Every page of the user interface was reviewed, and every button was tested to ensure that the simulation model could accurately provide responses to the user. 5.2. Test Results Compared to the Actual Operating Data. Validation involves comparing the results generated by the simulation model with the behavior of the real-world system. To validate this simulation model, two variables need to be analyzed: pressure and flow rate.. In the initial step of validation, the pressure and the flow rate could not be measured and tested at the same time because the two values are not constant during simulations. Hence, one of the values had to be kept constant. Such a condition existed when the simulation model was run at the maximum consumption rate because, at this point, there was no error in estimating the consumption rate when the customers were consuming natural gas at 100%. Therefore, the effects of a varying consumption rate are minimized to 0%. The pressure generated by the simulation model was compared to the pressure from the real-world system at every check point, including the stations and the furthest customer areas in the natural gas pipeline network.

Figure 18. Comparison of simulated and real flow rates.

Figure 17 shows the graph that compares the pressure generated by the simulation model and that of the real-world system at the maximum consumption rate. The difference between the measured and simulated values is between 0.3 and 3%. This is mainly due to leakage, which commonly occurs in pipeline systems. As a result, one can conclude that the simulation satisfactorily emulated the behavior of the real-world system at the maximum consumption rate. However, the simulation model needed to be tested under conditions of consumption rate dictated by ambient temperatures. Thus, the next step of validation was to ensure that the simulation model could generate the values of

Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004 1001

Figure 19. Comparison of simulated and real pressures.

flow rate and pressure corresponding to seasonal climate variations. In general, the flow rate represents the total customer consumption rate, which mainly depends on the season. The simulation model was tested for the flow rate in each season. Then, the simulated values were recorded and compared to the historical data. Figure 18 presents graphs comparing the simulated and historical values of the flow rate. The scattered diamond-shaped dots in the graph represent flow rate values measured from the real-world system, whereas the dotted rectangles rep-

resent flow rates calculated by the simulation model. It can be concluded from the graphs that the simulation model generated flow rate values within an acceptable range of the real-world historical data. The pressure values were investigated in the different seasons under the flow rates generated by the simulation model. Figure 19 shows a comparison of the actual and simulated data. The discrepancy between the two sets of values is within the range of 0.3-4%. Finally, the capacity values for each compressor were validated by changing the status of the compressor from

1002 Ind. Eng. Chem. Res., Vol. 43, No. 4, 2004

on to off and vice versa. The pressure value was also examined to investigate whether the system could generate the appropriate advice when the system state changed. For example, in winter, if the capacity of the compressors is higher than the normal operating capacity, the pressure at the endpoints can reach the highest level, which can damage the pipeline system. To prevent this from happening, the simulation program should provide advice to the user to decrease the capacity of the compressors. 6. Conclusions and Discussion A computer-aided simulation model for natural gas pipeline network system operations has been described in this study. The model was implemented in Flash, a Web-based environment from Macromedia. The major advantages of using the Web-based technique are platform independence, reusability, and accessibility. These advantages make the simulation model more reliable and more accessible for users. The model incorporated five fundamental elements upon which the construction of the natural gas pipeline network system is based: (1) key components in the pipeline system, including the natural gas, the pipeline network system, the compressor stations, the customers, and the ambient gas temperature; (2) natural properties of the gas, consisting of the molecular weight, gas gravity, compressibility factor, gas density, and viscosity; (3) gas flow equations, including the system mass balance, system energy balance, and friction factor; (4) compressor characteristics; and (5) customer consumption characteristics. The system queries the user on input for the five fundamental elements. On the basis of these inputs, the model simulates the pressure and flow rate at the customer locations and compressor stations. The simulated results from the model were tested and verified with the historical data from the St. Louis East natural gas pipeline network system. The model was able to generate satisfactory results. From this comparison, the seasons and temperature were found to have a major impact on customer demand for natural gas. Therefore, the model was tested by simulating the pipeline network system at temperatures corresponding to the seasonal variations. The difference between the simulated results and the historical operating data was between 0.3 and 4%, which is acceptable in practice. This difference is possibly due to the leakage that normally occurs in pipeline systems. A weakness of the computer-aided simulation model for the natural gas pipeline system operations is that it has limited applicability. Because it was built for the climate of Saskatchewan, Canada, and a specific set of customer consumption rates, its usefulness in other regions is limited. In fact, patterns of consumption might vary depending on climate at different locations. Therefore, to simulate a pipeline system at other locations, the patterns of gas consumption need to be closely investigated.

Acknowledgment We are grateful to SaskEnergy/Transgas for providing us with the data and support for completing this project. We are also grateful for the generous financial support of a Strategic Grant from the Natural Sciences and Engineering Research Council of Canada. Literature Cited (1) Banks, J.; Carson, J. S.; Nicol, D. M. Discrete-Event System Simulation; Prentice Hall: Upper Saddle River, NJ, 2000. (2) Banks, J. Handbook of Simulation; John Wiley & Sons: New York, 1998. (3) Banoune, S.; Depeyre, D. Dynamic Simulation and Real Time Expert System for Food Freezing Process Control. In Automatic Control of Food and Biological Process: Proceedings of the AcoFoP III Symposium, Paris, France, 25-26 October 1994; Bimbenet, J. J., Dumoulin, E., Trystram, G., Eds.; Elsevier Science Ltd.: Oxford, U.K., 1994; p 159. (4) Edmister, C. W.; Lee, I. R. Applied Hydrocarbon Thermodynamics; Butterworth-Heinemann: London, 1984. (5) Gopal, E. R. Specific Heats at Low Temperatures; Heywood Books: London, 1966. (6) Kumar, S. Gas Production Engineering; Gulf Publishing: Houston, TX, 1987. (7) Law, A. M.; Kelton, W. D. Simulation Modeling and Analysis; McGraw-Hill: New York, 2000. (8) Lee, C. K.; Sun, C. C.; Mei, C. C. Computation of Permeability and Dispersivities of Solute and Heat in Periodic Porous Media. Int. J. Heat Mass Transfer 1996, 39, 661. (9) Liu, L. Forecasting Residential Consumption of Natural Gas Using Monthly and Quarterly Time Series. Int. J. Forecasting 1991, 7, 3. (10) Lu, S. Dynamic Modelling and Simulation of Power Plant Systems. J. Power 1999, 213, 7. (11) Macromedia Flash 5: ActionScript Reference Guide; Macromedia: San Francisco, CA, 2000. (12) Macromedia Flash 5: Using Flash; Macromedia: San Francisco, CA, 2000. (13) Nimmanonda, P.; Uraikul, V.; Chan, W. C.; Tontiwachwuthikul, P. A Computer-Aided Model for Design of a Simulation System for the Natural Gas Pipeline Network System. In CCECE′02: Canadian Conference on Electrical and Computer Engineering; IEEE Press: New York, 2002; Vol. 1, p 1634. (14) Sailor, D. J.; Rosen, J. N.; Munoz, J. R. Natural Gas Consumption and Climate: A Comprehensive Set of Predictive State-Level Models for the United States. Energy 1998, 23, 91. (15) Tiratsoo, E. N. Natural Gas, 2nd ed.; Scientific Press Ltd.: Beaconsfield, U.K., 1972. (16) Turner, W. J.; Kwon, S.-J. P.; Maguire, P. A. Evaluation of a Gas Pipeline Simulation Program. Math. Comput. Modell. 1991, 15 (7), 1. (17) Uraikul, V.; Chan, W. C.; Tontiwachwuthikul, P. Development of an Expert System for Optimizing Natural Gas Pipeline Operations. Expert Syst. Appl. 2000, 18, 271. (18) Zhu, G.; Henson, M. A.; Megan, L. Dynamic Modeling and Linear Model Predictive Control of Gas Pipeline Networks. J. Process Control 2001, 11, 129.

Received for review March 31, 2003 Revised manuscript received November 5, 2003 Accepted November 19, 2003 IE030268+