Sie sind auf Seite 1von 105

SimSci-Esscor

PIPEPHASE 9.6 NETOPT

March 2013

All rights reserved. No part of this documentation shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Invensys Systems, Inc. No copyright or patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this documentation, the publisher and the author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. The information in this documentation is subject to change without notice and does not represent a commitment on the part of Invensys Systems, Inc. The software described in this documentation is furnished under a license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of these agreements. 2013 by Invensys Systems, Inc. All rights reserved. Invensys Systems, Inc. 26561 Rancho Parkway South Lake Forest, CA 92630 U.S.A. (949) 727-3200 http://www.simsci-esscor.com/ For comments or suggestions about the product documentation, send an e-mail message to ProductDocumentationComments@invensys.com. All terms mentioned in this documentation that are known to be trademarks or service marks have been appropriately capitalized. Invensys Systems, Inc. cannot attest to the accuracy of this information. Use of a term in this documentation should not be regarded as affecting the validity of any trademark or service mark. Invensys, Invensys logo, PIPEPHASE, INPLANT, and SimSci-Esscor are trademarks of Invensys plc, its subsidiaries and affiliates.

Contents
Introduction
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-vii About PIPEPHASE 9.6 NETOPT . . . . . . . . . . . . . . . . . . . . . . . 1-vii Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-viii About SIMSCI - ESSCOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-viii Where to find additional help . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-ix Online Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-ix Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-ix

Chapter 1 Getting Started


Installing PIPEPHASE 9.6 with NETOPT Module. . . . . . . . . . . .1-1 Starting PIPEPHASE 9.6 with NETOPT Module . . . . . . . . . . . . .1-1 Using NETOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2 NETOPT Flow Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5 Production Planning and Time-stepping . . . . . . . . . . . . . . . . . . . .1-7 Subsurface Networks and Multiple Completion Modeling . .1-9 Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-11

Chapter 2 Tutorial
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1 Building the Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3 Entering Optimization Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19 Specifying Print Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27 Running the Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-28 Viewing and Plotting Results. . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30 Using the RAS to Plot Results . . . . . . . . . . . . . . . . . . . . . . . . . . .2-32 Including Operating Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35

PIPEPHASE 9.6 NETOPT Users Guide

iii

Chapter 3 Optimization Input Reference


About This Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Categories of Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Order of Categories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Keywords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Commenting Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Default Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Units of Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Basis of Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Multiple Units of Measurement . . . . . . . . . . . . . . . . . . . . . . . 3-6 Continuing Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Layout of Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Legend for Input Statement Descriptions . . . . . . . . . . . . . . . . . . . 3-7 OPTIMIZATION Data Category of Input . . . . . . . . . . . . . . . . . . . 3-8 User-defined Optimization Constraints . . . . . . . . . . . . . . . . . . . . 3-16 Example 1: Using the Sink Pressure as a Constraint . . . . . . 3-17 User-added Objective Functions . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 Example: Objective Function is Electricity Generated. . . . . 3-19 Optimizing Over time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Time-stepping Data Category of Input . . . . . . . . . . . . . . . . . . . . 3-22 Case Study Data Category of Input . . . . . . . . . . . . . . . . . . . . . . . 3-22

Chapter 4 Examples
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Example 1 - Optimization of an Offshore Pipeline System Design 43 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 Simulation Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 Example 2 - Two Well Gas Lift Optimization. . . . . . . . . . . . . . . . 4-7 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 Simulation Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8

Chapter 5 Accessing NETOPT Data


PPDATR Subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Typical Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1

iv

Contents

Definition of ITYPE and Attribute Labels. . . . . . . . . . . . . . . . . . .5-2 Unit Class Definitions using KUOM. . . . . . . . . . . . . . . . . . . . . . .5-6 IPRSET Subroutine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7 NSFLAG Subroutine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8

PIPEPHASE 9.6 NETOPT Users Guide

vi

Contents

Introduction
About This Manual
The PIPEPHASE 9.6 NETOPT Users Guide provides an introduction to the NETOPT module and to the NETOPT Reservoir Simulation Interface. It describes how these programs work and includes a step-by-step tutorial to guide you through a NETOPT example optimization problem. Also covered in this guide is the NETOPT Optimization and Reservoir Interface keyword references. An outline of this guide is provided below.
Introduction Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Getting Started Tutorial Input Reference Examples Introduces the manual, the program, and SIMSCI. Explains how to use NETOPT. Provides a step-by-step tutorial for the optimization of an off-line pipeline design. Provides a description of the keywords for the Optimization Data Category. Provides examples when using NETOPT.

Accessing NETOPT Data Explains how to access NETOPT Data using the subroutines.

About PIPEPHASE 9.6 NETOPT


NETOPT is a network optimization module that is part of SIMSCIs Upstream Optimization Suite. This module is a powerful fluid-flow network optimizer which is used with PIPEPHASE to allow you to optimize network performance, by defining specific operating objectives while satisfying both physical and user-imposed constraints. For example, consider a system of wells producing under gaslift, where the amount of gas available for injection is limited. NETOPT
PIPEPHASE 9.6 NETOPT Users Guide vii

can determine the optimum gas injection rate for each well to maximize total oil production from all wells. NETOPT will help you design new systems, monitor current systems, and prevent or solve problems. NETOPT combines industry standard multiphase fluid flow simulation technology with the most comprehensive physical properties databank and thermodynamic capabilities available. By minimizing capital and operating costs during the decision stage, NETOPT can be used to validate your design strategy or help you devise others. For existing facilities, NETOPT can be used to locate bottlenecks and evaluate overall and localized system performance as a result of variable consumer demands. Field production and regulatory requirements can also be analyzed.

Optimization
NETOPT can optimize network problems of virtually any size. You can minimize or maximize any objective function or even tune your simulation to match field data while satisfying process constraints. NETOPT can be used to maximize the operating profit of a production field throughout the life of the field, resulting in savings of millions of dollars. A complete list of the process variables that may be used to formulate the objective functions, constraints, or decision variables is given in Chapter 3, Optimization Input Reference, Table 3-2.

About SIMSCI - ESSCOR


SimSci-Esscor, a business unit of Invensys Systems, Inc., is a leader in the development and deployment of industrial process simulation software and systems for a variety of industries, including oil and gas production, petroleum refining, petrochemical and chemical manufacturing, electrical power generation, mining, pulp and paper, and engineering and construction. Supporting more than 750 client companies in over 70 countries, SimSci-Esscor solutions enable clients to minimize capital requirements, optimize facility performance, and maximize return on investment. For more information, visit SimSci - Esscor Web site at http:// www.simsci-esscor.com.

viii

Introduction

Where to find additional help


Online Documentation
PIPEPHASE NETOPT online documentation is provided in the form of .PDF files that are most conveniently viewed using Adobe Acrobat Reader 5.0 or higher. Online manuals are stored in the Manuals directory and they remain on the DVD when you install the program. To access these files, open the PIPEPHASE ONLINE HELP.CHM file in the Bin directory and click the appropriate link to navigate to the corresponding PDF.

Online Help
PIPEPHASE NETOPT comes with online Help, a comprehensive online reference tool that accesses information quickly. In Help, commands, features, and data fields are explained in easy steps. Answers are available instantly, online, while you work. You can access the electronic contents for Help by selecting Help/Contents from the menu bar. Context-sensitive help is accessed using the F1 key or the Whats This? button by placing the cursor in the area in question.

PIPEPHASE 9.6 NETOPT Users Guide

ix

Introduction

Chapter 1 Getting Started


Installing PIPEPHASE 9.6 with NETOPT Module
Please refer to PIPEPHASE 9.6 Getting Started Guide on how to install NETOPT.
Note: Make sure that you are licensed to run NETOPT, before installation. If not, contact your local SIMSCI- ESSCOR representative to request a security key.

Starting PIPEPHASE 9.6 with NETOPT Module


If you do not see a PIPEPHASE 9.6 icon in a SIMSCI group window or in your Program Manager window, see the troubleshooting section in the PIPEPHASE Getting Started Guide. To start PIPEPHASE 9.6 NETOPT:

Double-click on the PIPEPHASE 9.6 icon.

The main PIPEPHASE w/NETOPT window appears.

PIPEPHASE 9.6 NETOPT Users Guide

Chapter 1-1

Figure 1-1: The PIPEPHASE w/NETOPT Main Window

You can now open a new simulation file (select File/New), open an existing file (select File/Open), or import a keyword file (select File/ Import Keyword File). Please refer to the Chapter 4, PIPEPHASE 9.6 Getting Started Guide for menu option and GUI interface descriptions.

Using NETOPT
Optimization

NETOPT can optimize network problems of virtually any size. You can minimize or maximize any objective function or even tune your simulation to match plant data, while satisfying process constraints. A NETOPT model can be optimized over time, resulting in efficient operation over the total lifetime of a plant or field.
Controlling Convergence of Networks

NETOPT solves networks iteratively. Whichever algorithm you use, NETOPT starts with an initial estimate of flowrates in all links and pressures at all nodes, It adjusts these values until it has reached a converged solution within a predefined tolerance. Because of the

Chapter 1-2

Getting Started

complex nature of some networks, NETOPT allows you to make adjustments to a large number of parameters that it uses during the solution procedure.
To specify...
Automatic PBAL has a choice of methods for generating initial generation of estimates. By default, PBAL generates flowrate Initial estimates estimates by considering the diameters of the first pipe in each link. An alternative method uses the frictional resistances of the pipes in each link. A third method solves the first iteration with MBAL before going into PBAL. Finally, if you have solved this network before and just changed some of the conditions, you may instruct the program to use your previous solution as its initial estimate. User-supplied You may also provide individual estimates for initial estimates junction pressures and link flowrates. Maximum and For any link, you may specify the maximum and minimum flows minimum flows that are to be allowed. Controlling convergence In some difficult networks, convergence of the base case can be improved by adjusting various convergence parameters: for example, damping, relaxation, internal tolerances, etc. Refer to Chapter 7, Technical Reference in the NETOPT Input Manual, for details.

See...

Network

Calculation Methods

Junction,

Link Data

Link Data Network


Calculation Methods

Direction of flow If you know the flow direction in all links, you can specify that NETOPT not try to reverse them from iteration to iteration. Solution tolerance Controlling optimization The network calculation converges when the error is within a given tolerance. You may optionally change this tolerance. You can adjust a number of optimization options: for example, the fractional change in the objective function or decision variables, damping, or error tolerances.

Network Network

Calculation Methods Calculation Methods Options

Optimization

Calculation time If NETOPT does not converge within a certain number of iterations, it will stop and report the results of the last iteration. You may reduce or increase the maximum number of iterations. To reduce calculation time in large compositional runs, you may control the number of fluid property evaluations that are performed in each link for the PBAL initialization procedure. Closed loops If you have inadvertently specified your network so that closed loops are formed, NETOPT will report these and, optionally, take remedial action.

Network

Calculation Options

Network

Convergence Data

PIPEPHASE 9.6 NETOPT Users Guide

Chapter 1-3

To specify...
Pipe segments Pipes, tubing, risers, and annuli are divided into segments for pressure drop and heat transfer calculations. You can change either the number of segments or the length of segments for greater calculational accuracy. Alternatively, you can select NETOPTs autosegmentation feature to automatically select the best segmentation options for your network. You may allow regulators (unidirectional check valves) to pass a small backward flow. Critical flow in chokes can cause difficulties for convergence algorithms. To help NETOPT solve such networks, you can allow or a linear broadening of the critical flow regime. You can prevent well flows from falling below the minimum required to transport fluid in a twophase system.

See...

Network

Segmentation Data

Check valves

Network Network

Calculation Methods Convergence Data

Critical flow in chokes

Wells

Network

Calculation Methods

Single links

A single link has one source, one sink, and no junctions. There are three variables:

The source flowrate (which is also the sink flowrate), The source pressure, and The sink pressure.

You must specify two of these, and NETOPT will calculate the third.
To specify...
Sources You must have only one source. Sinks Links If the source pressure and rate are known, a sink pressure and rate need not be defined. You do not need to specify the flowrate or pressure drop in a link; all you need to define are the pipes, fittings, and equipment. Enter the link device data in the sequence in which the fluid flows through them. You can have any combination of pipes, fittings, and process equipment items, in any order.

See...

Source Sink, Source Link Device Data

Networks

A network generally has more than one link and one or more junctions. The variables are the pressure and flowrate at each source and sink. You specify the values of the variables that are known,
Chapter 1-4 Getting Started

and NETOPT will calculate the unknowns. In order not to under- or over-specify the system, simple rules must be followed in constructing the problem:

You must specify a number of knowns equal to the total number of sources and sinks. You must specify at least one pressure. If any source or sink flowrate is an unknown, you must supply an estimate. If you do not know a pressure at a source, sink, or junction, you do not need to supply an estimate. You may specify estimates to speed up convergence.
See...

To specify...
Sources and You must have at least one source and at least one sinks sink. Junctions You must have a junction at the point where two or more links meet. If your network is complex, you may speed up the solution by supplying estimates for the junction pressures. You must supply a unique name for each link. If your network is complex, you may speed up the solution by supplying estimates for flowrates through each link. NETOPT can model preferential splitting at Tee junctions in pure distribution networks. These junctions can have only two outgoing and one incoming link.

Source, Sink Junction

Links

Link Device Data

Steam networks

Junction

Subnetworks NETOPT has a number of devices that invoke a special algorithm. You may specify the inlet conditions; NETOPT breaks the flowsheet at the inlet and solves the resulting subnetworks simultaneously so that the pressures match.

Mcompressor,
Mchoke Mregulator

NETOPT Flow Devices


A piping system is made up of links which join sources, sinks, and junctions. Each link consists of a series of flow devices: pipes, fittings, and process equipment and unit operations. Sources and sinks must be named. The devices in the link must be added in the order in which they appear in the link.

PIPEPHASE 9.6 NETOPT Users Guide

Chapter 1-5

The flow devices that NETOPT can handle are given in Table 1-6.
Table 1-1: Flow Devices and Equipment Available in NETOPT Device Flow Devices
Pipe Annulus Tubing Inflow Performance Relationship

Description - have length


Horizontal, vertical or inclined. May be surrounded by air, water, or soil; insulated or bare. Well annulus. Heat loss is simulated using an overall heat transfer coefficient and geothermal gradient. Well tubing. Heat loss is simulated using an overall heat transfer coefficient and geothermal gradient. Models the relationship between flowrate and reservoir pressure draw-down or pressure drop at the sand face in a well.

Equipment Devices
Completion

- have no length
Bottomhole completion, the interface between the reservoir and a well. There are two types of completion: gravel-packed and open-perforated.

Fittings
Bend Check valve Choke valve A standard mitred bend or non-standard bend with defined angle and radius. Device that allows flow in only one direction. Restricts fluid flow. MCHOKE, a variant of CHOKE, introduces a discontinuity into a network which is solved using a special sub-networking method. Reduction in diameter from larger to smaller pipe. Variable angle. Entrance into a pipe from a larger volume such as a vessel. Exit from a pipe to a larger volume such as a vessel. Increase in diameter from smaller to larger pipe. Variable angle. Flow restriction used in metering. Orifice meter. Orifice plate can use thick or thin calculation formulae. Tee piece. Flow may be straight on or through the branch. Any type of valve, e.g., gate, globe, angle, ball, butterfly, plug, cock. Venturi flow meter.

Contraction Entrance Exit Expansion Nozzle Orifice Tee Valve Venturimeter

Process Equipment
Compressor Multistage Compressor Simple single or multistage gas compressor. Rigorous single or multistage gas compressor with optional inlet pressure calculation. Uses a special sub-networking method.

Chapter 1-6

Getting Started

Table 1-1: Flow Devices and Equipment Available in NETOPT Device


Cooler DPDT Expander Gaslift Valve Heater Injection Pump Regulator

Description
Removes heat from a stream. Any device that changes pressure and/or temperature with flowrate. Steam expander. Well gaslift valve. Adds heat to a stream. Re-introduces a stream from a compositional separator back into a link. Single or multistage liquid pump. An electric submersible pump may be modeled. Means of fixing maximum pressure at any point in the structure. MREGULATOR, a variant of REGULATOR, introduces a discontinuity into a network which is solved using a special sub-networking method. Splits some or all of one of the fluid phases from a link.

Separator

Unit Operations
Hydrates Calculator Predicts the temperature/pressure regime under which hydrates are prone to form. A utility that allows you to compute results from flowsheet parameters. These results can then be used as optimizer constraints or objective parameters.

Production Planning and Time-stepping


Production planning involves the study of the time-dependent interactions between the producing formation(s) and all of the wells, gathering lines, and surface facilities in an oil or gas field. NETOPT supplies this capability through its Time-stepping feature. Typically, the study extends from a few years to the entire producing life of the field. For such extended periods, a quasisteady state approach provides an efficient representation of the time-dependency. Time-stepping carries out a series of steady-state NETOPT simulations automatically in the same run. Each simulation represents the conditions at a specific time-step in the operating history of the field.

PIPEPHASE 9.6 NETOPT Users Guide

Chapter 1-7

Wells and Well Grouping

Each of the well completion zones in a gathering network produces from a specific formation or reservoir. The decline in the reservoir pressure with time and the changes in the characteristics of the fluid produced are a function of the total fluid volume produced from the reservoir. For the purposes of these calculations, a well completion is associated with a reservoir group. A reservoir group includes all of the producing zones that contribute to its depletion.
Reservoir Depletion

The depletion of a reservoir over the life of a field is characterized by a decline in average reservoir pressure and changing fluid composition. For most reservoirs, the gas-oil ratio increases with time; for a reservoir with an active water drive, the produced water cut increases as the water table rises.
Facilities Planning

In a gathering system, changes to the operation of surface facilities directly affect the overall production. For example, adding compression facilities to an existing gas gathering network reduces the pressure at the upstream wells, which in turn increases the drawdown and results in improved production from the reservoir; an increase in the separator pressure will have the opposite effect. Time-stepping enables you to simulate changes to the facilities installation over time.
To specify...
Reservoir Groups You must name the reservoir GROUP and supply depletion data in one IPR device. Other IPR devices may access the same reservoir depletion data by using the same GROUP name.

See...

IPR IPR IPR IPR

Depletion Supply a curve of reservoir pressures against cumulative characteristics production. Gas and gas condensate fields Production decline rates for each IPR For a gas or gas condensate field you may supply the slope of the depletion curve as pressure decline rate per unit of production. The production decline characteristics for individual completion zones must be defined. Tabular data represent the decline in the flowing well pressure as a function of the production rate. The time-dependent parameter may be expressed in terms of reservoir pressure or cumulative production.

Fluid You may enter curves for water cut, gas-oil ratio (or compositional condensate-gas ratio for condensate wells), and water cut (or changes water-gas ratio for condensate wells) as functions of reservoir pressure or cumulative reservoir produced volume.

IPR

Chapter 1-8

Getting Started

To specify...
Selecting times Downstream network changes Supply a series of times. NETOPT will carry out simulations at each of those times. At each time you may specify one or more changes to the network or conditions downstream of the well.

See...

IPR IPR

Subsurface Networks and Multiple Completion Modeling


A Single Well

A single well can produce from one reservoir:


To specify:
A source to give the properties, flowrate, and conditions of the fluid. One IPR to define the interface to the reservoir. One tubing from the well to the surface. One node to continue into the rest of the network.

See...

Source IPR Tubing Junction, Sink

Figure 1-2: One Well, One Reservoir

Or a single well can produce from more than one reservoir:


To specify:
A source for each reservoir to give the properties, flowrates, and conditions of the fluids. An IPR for each reservoir to define the interfaces. A tubing between consecutive reservoirs. A tubing from the last reservoir to the surface. A node to continue into the rest of the network.

See...

Source IPR Tubing Tubing Junction, Sink

PIPEPHASE 9.6 NETOPT Users Guide

Chapter 1-9

Figure 1-3: One Well, More Than One Reservoir

More Than One Well

You may have more than one well in a NETOPT run. The wells may all use one reservoir. In this case, information for the reservoir data is entered in one IPR and accessed from other IPRs using the GROUP name.
Multiple Completions

In NETOPT you may model a multiple completion rigorously:


To specify:
A source for each completion to give the properties, flowrates, and conditions of the fluids. An IPR for each completion to define the interfaces. Tubing and junctions to form the network between completions. A tubing from the last completion to the surface. A node to continue into the rest of the network.

See...

Source IPR Tubing Tubing Junction, Sink

Chapter 1-10

Getting Started

Figure 1-4: Multiple IPRs

Alternatively, you may approximate these conditions by having NETOPT automatically generate a subsurface network:
To specify:
One IPR with physical dimensions such as length, inclination. A tubing from the IPR to the surface. A node to continue into the rest of the network.

See...

One source to give the properties, flowrates and conditions of the fluids. Source

IPR Tubing Junction,


Sink

Figure 1-5: One IPR, Automatic Multiple Completions

Case Studies
The Case Study option provides the facility to perform parametric studies and to print multiple problem solutions in a single computer run. Case studies are always performed after the base case problem has been solved. If the base case problem cannot be solved for any reason, then no case studies are performed. Each case study analysis is performed based on the cumulative changes to the flowsheet up to that time.
PIPEPHASE 9.6 NETOPT Users Guide Chapter 1-11

Case studies are an efficient means of obtaining solutions for multiple scenarios to a given problem and result in large savings in both computer time and cost. For problems requiring iterative solutions, the converged results of the last solution are used as the starting values for the next run. This can result in large computer time savings in runs involving large networks, where it typically takes several iterations to move from the initial pressure estimates to the final converged solution. There is no limit on the number of changes you can make per case study or on the total number of case studies that may be in a given run. The cumulative changes, up to a given case study run, may be erased and the original base case restored at any time. Since the case studies are performed sequentially in the order you input, it is best to make changes in an orderly manner, proceeding from high values to low values or low values to high values, but not in a random order. This enhances convergence and minimizes total computer time. See Chapter 4, Input Reference, Table 4-40 in the PIPEPHASE Keyword Manual.
Global Changes

You may change one parameter in the entire problem using a global command. You do this by supplying the type of parameter you want to change, its old value, and the new value. Only those specified parameters with that old value will then be changed. The items to which this type of change can be applied are identified in Table 4-50, Chapter 4, Input Reference of the PIPEPHASE Keyword Manual.
Individual Changes

Source, sink, and device parameters may be changed individually. You must specify a name for each source, sink, or device where a parameter change is desired.
To...
Add descriptive You can add one line of description for each case text study. Make changes You can change any of the parameters in Table 3-7, either globally or on individual flow elements. You can restore the base case at any time.

See...

Simulation
Changes Changes

Description

Case Study Case Study

Chapter 1-12

Getting Started

Chapter 2 Tutorial
Introduction
This chapter presents the step-by-step procedure required for the optimization of an off-line pipeline design. In the first part of this tutorial, you will look at the optimal design based only on capital cost considerations. Then, you will include the operating costs over the lifetime of the pipeline (10 years) and examine the effect the operating costs have on the overall design strategy.

Problem Description
In this simulation, a pipeline is designed to deliver gas at a rate of 1200 MMSCFD at a minimum pressure of 900 psi from two offshore fields. Table 2-1 and Table 2-2 provide additional process details including piping and compressor capital expenditures.
Table 2-1: Process Conditions Offshore Field A
Distance from processing plant, miles Wellhead pressure, psig 200 2000

Offshore Field B
Distance from field A, miles Wellhead pressure, psig 180 2000

Table 2-2: Pipeline and Compressor Capital Costs


Pipeline Cost/mile Compressor Cost/1000 hp $0.70MM/inch ID $4.66MM

PIPEPHASE 9.6 NETOPT Users Guide

2-1

The overall capital cost is the sum of the cost of purchasing and laying pipe and purchasing the compressors.
Pipe Costs (MM$) = Cost of Pipe from Field 1 + Cost of Pipe from Field 2 = 0.70*200*IDPipe 1 + 0.70*180*IDPipe 2 = 140*IDPipe 1 + 126*IDPipe 2 Compressor Cost (MM$) = 4.66E-3*wCompr 1 + 4.66E-3*wCompr 2

The overall capital cost is therefore a linear function of the ID of the two pipeline segments and compressor power:
Capital Cost =140*IDPipe 1 + 126*IDPipe 2 + 4.66E-3*wCompr 1 + 4.66E-3*wCompr 2

PIPEPHASE optimizes the design to minimize the overall capital costs by varying the pipe diameters and the sizes of the compressors at the two platforms. Apart from the delivery target, there are three additional design and operating constraints that must be taken into consideration:

Pipe sizes are available only in sizes 24"-40" with a maximum operating pressure of 2475 psi. Due to limited space on each platform, the maximum capacity of each compressor is 50000 hp. Both pipeline sections must be built as the capacity of the platform for field A is inadequate to meet the overall delivery requirement.

The overall network is shown in Figure 2-1.


Figure 2-1: Tutorial Problem

2-2

Tutorial

Building the Network


First, you must open a new project:

Select the New option from the File menu. The Create New Simulation window appears for laying down your process flowsheet. Next, you must supply a name for this new simulation. By default, this simulation will be created in the C:\SIMSCI\PPHASE9.6\USER directory. Type in TUTORIAL in the File Name data entry field as shown in Figure 2-2. Then, click the Open button.

Figure 2-2: Create New Simulation Window

Tip:By using the toolbar icons, you reduce the number of mouse actions required for a selection. For example, you can click the toolbar button to create a new simulation. PIPEPHASE will now automatically take you through Simulation Setup Wizard .

PIPEPHASE 9.6 NETOPT Users Guide

2-3

Figure 2-3: Welcome to Simulation Setup Wizard

Click the Next button.

Figure 2-4: Select Simulation Type

Select the Network model Simulation Type. Click the Next button.

2-4

Tutorial

Figure 2-5: Select Fluid Type

Select Gas as Fluid Type. Click the Next button.

Figure 2-6: Select Default Units of Measurement

Select Petroleum as Default Units of Measurement. Click the Next button.

PIPEPHASE 9.6 NETOPT Users Guide

2-5

Figure 2-7: Confirm the Selections

Confirm your selections. Click on Finish will appear as shown in Figure 2-8. Click Edit on the Fluid Property Data window. The Single Phase Gas PVT Data window will then appear. Enter a specific gravity of 0.69 in the Gas Gravity field and the following composition of contaminants:
Component
Nitrogen Carbon dioxide Hydrogen sulfide

Mole %
1.32 0.98 0.56

The completed window will appear as shown in Figure 2-9.

2-6

Tutorial

Figure 2-8: Fluid Property Data Window

Click the OK button to continue. The Fluid Property Data window will appear as shown in Figure 2-8.

Figure 2-9: Single Phase Gas PVT Data Window

To create a second property data set.


Click the New button. This brings up the Single Phase Gas PVT Data window with Set Number already set to 2. Enter a specific gravity of 0.701 in the Gas Gravity field and the following composition of contaminants:

PIPEPHASE 9.6 NETOPT Users Guide

2-7

Component
Nitrogen Carbon dioxide Hydrogen sulfide

Mole %
1.11 0.88 0.24

The completed window will appear as shown in Figure 2-10.


Figure 2-10: Single Phase Gas PVT Data Window

Click the OK button. The Fluid Property Data window will appear as shown in Figure 2-11.

Figure 2-11: Fluid Property Data

2-8

Click the OK button to continue.


Tutorial

This will bring up a Note Box as shown in Figure 2-12 that inform the users about the definition of the colors that are used in the GUI.
Figure 2-12: Note to give information about the colors used in the GUI.

Click the OK button to continue.

The next step is to enter the description of the problem, etc. go through data entry windows.

From the the toolbar select General/Simulation Description. This will bring up the Simulation Description window shown in Figure 2-13.

Figure 2-13: Simulation Description Window

To complete this data entry window: Enter the Project, Problem, User, Date, Site, and Description data entry fields and click the OK button.

From the the toolbar select General/Simulation Definition. This will bring up the Simulation Description window shown in Figure 2-14.
2-9

PIPEPHASE 9.6 NETOPT Users Guide

Use the drop-down list boxes to select a Simulation Type of Network Model and a Fluid Type of Gas.

Figure 2-14: Simulation Definition Window

Click the OK button to continue.

After leaving the Simulation Definition window, you will want to check Input Dimensions . From the the toolbar select General/Input Units of Measurement. This will bring up the Input Dimensions window shown in Figure 2-15.

For this problem, the flowrate basis will be Gas Volume units of MM ft3 /day. Use the Pipe Length drop-down list box to change the default units to miles (mi) as shown in Figure 2-15

Figure 2-15: Input Dimensions Window

2-10

Click the OK button to continue.


Tutorial

The next step is to begin entering the nodes _ sources, sinks, and junctions _ required for the problem. For this simulation, you will lay down two sources, one sink, and one junction, in that order. To select the nodes:

Click one of the node icons from the toolbar.


For the source node For the sink node For the junction

Move the cursor to the location on the main window where the node is to be located and click again. The node will appear in the main flowsheet area of the screen. Repeat this step for each of the nodes in the flowsheet until the entire system has been constructed as shown in Figure 2-16.

Note: If you have added the nodes in the stated order of

sources, sink, followed by the junction, the sources will be labeled S001 and S002, the sink, D001, and the junction, J001.
Figure 2-16: PIPEPHASE Main Window

PIPEPHASE 9.6 NETOPT Users Guide

2-11

Tip:For very large systems, multiple nodes may be placed by holding down the Shift key and clicking on each desired location for a given node.
Note: Once a node has been placed, it may be moved by

simply clicking on the node with the left mouse button, holding it down, and dragging the node to a new location. All of the source and sink nodes placed on the screen should be bordered in red indicating that user input is required for that node. After all of the nodes have been placed and named as shown in figure 2-16, the next step is to connect the nodes into a logical flow network. To connect two nodes:

Click on a source or junction (From node) with the left mouse button. A red square will appear on the node, and the border of the node will turn green to indicate that the node has been selected. Next, click inside the square with the left mouse button and, while holding the mouse button down, drag the cursor to another junction or sink (To node).

Once a square has been selected and the cursor begins to move, all of the connection squares in the available junction and sink nodes will turn blue indicating a valid location to which you can connect the link. For this simulation, you must connect S001 to J001, S002 to J001, followed by J001 to D001. The flow diagram should now show the structure shown in Figure 2-17.

2-12

Tutorial

Figure 2-17: Connected PIPEPHASE Simulation

The next step is to enter the data for each of the sources and sinks. To enter the data for the source S001:

Double-click on the node S001, and enter the following information:


Node Data
Pressure (fixed) Temperature Standard Flowrate (estimated)

Value
2000 psig 80 F 600 MMft3/day

Select the PVT Property Set as 1 in the Properties field. The window should appear as shown in Figure 2-18.

PIPEPHASE 9.6 NETOPT Users Guide

2-13

Figure 2-18: Completed Gas Source S001 Window

Click the OK button to return to the main window. The source is now bordered in blue, indicating that all required data have been entered.

To enter the data for the source S002:


Double-click on the node S002. The same window should appear as shown in Figure 2-18. Enter the following information:
Node Data
Pressure (fixed) Temperature Standard Flowrate (estimated)

Value
2000 psig 80 F 600 MMft3/day

Select the PVT Property Set as 2 in the Properties field. Click the OK button to return to the main window. The second source is now bordered in blue, indicating that all required data have been entered.

To enter the data for the sink D003:

Double-click on the node D003. The window should appear as shown in Figure 2-19.
Tutorial

2-14

Enter the following information:


Node Data
Pressure (estimated) Standard Flowrate (fixed)

Value
900 psig 1200 MMft3/day

Figure 2-19: Completed Sink D003 Window

Click the OK button to return to the main window. The sink is now bordered in blue, indicating that all required data have been entered. Lastly, you must enter the data for each of the links on the flowsheet. Lets start with link L001 between source S001 and junction J004.

To enter the data for this link:

Double-click on the link L001. This brings up the Link <L001> Device Data window as shown in Figure 2-20.

PIPEPHASE 9.6 NETOPT Users Guide

2-15

Figure 2-20: Link <L001> Device Data Window

Click the pipe button on the device palette to add this device to the link. This automatically brings up the Pipe data entry window. Enter the data given in Table 2-3 .

Table 2-3: Link <L001> Device Data Link L001 _ S001 to J004
PIPE E001 Length Nominal ID Schedule Thermal Calculations Heat Transfer 0.2 miles 8 inches 40 Pipe in Water; Ambient temperature: 45 F

The completed Pipe window for device E001 should appear as shown in Figure 2-21.

2-16

Tutorial

Figure 2-21: Complete Pipe Device E001 Window

Click the OK button to return to the Link <L001> Device Data window. Then click the OK button to return to the main window. Next, you must add devices to link L002 connecting source S002 and junction J004. Double-click on the link L002. This brings up the Link <L002> Device Data window. Click the pipe button on the device palette to add this device to the link. This automatically brings up the Pipe data entry window. Enter the data given in Table 2-4 for the pipe device E002 on link L002. The completed Pipe window for device E002 should appear the same as shown in Figure 2-21.

Table 2-4: Link <L002> Device Data Link L002 _ S002 to J004
PIPE E002 Length Actual ID Thermal Calculations Heat Transfer Compressor E003 Power Adiabatic Efficiency 20000 hp 80% 180 miles 24 inches Pipe in Water; Ambient temperature: 45 F

PIPEPHASE 9.6 NETOPT Users Guide

2-17

Click OK to return to the Link <L002> Device Data window. Next, you must add a compressor to this link by clicking the compressor button on the device palette. This automatically adds this new device after the currently selected device (i.e., the pipe E002) and brings up the Compressor data entry window for device E003. Enter the data given in Table 2-4 for the compressor device E003 on link L002. The completed Compressor window should appear as shown in Figure 2-22.

Tip:To copy or delete a device previously added to a link, highlight that device, then click on the COPY then PASTE or DELETE buttons on the left palette in the Link Device Data window.
Figure 2-22: Completed Compressor E003 Window

Click OK to return to the Link <002> Device Data window. Then, click OK again to return to the main window. Using the data given in Table 2-5 , repeat the above steps for link L003 connecting junction J004 to sink D003.The main window will now appear as shown in Figure 2-23.

Table 2-5: Link <L003> Device Data Link L003 _ J004 to D003
PIPE E004 Length Actual ID Thermal Calculations Heat Transfer Compressor E005 200 miles 35 inches Pipe in Water; Ambient temperature: 45 F

2-18

Tutorial

Table 2-5: Link <L003> Device Data Link L003 _ J004 to D003
Power Adiabatic Efficiency 25000 hp 80%

Figure 2-23: PIPEPHASE Main Window

Lets save the data entered so far.

Click the Save button on the toolbar, or select the File/Save menu option.

Entering Optimization Data


Now, you must define the design constraints, coefficients for the objective function, decision variables, and optimization parameters.

Click the Network Optimization Data button on the toolbar, or select the Special Features/Optimization Data menu option. This brings up the Network Optimization Data window. Check the Enable Network Optimization check box. In the Objective data entry field, select the Minimize Objective Function radio button as shown in Figure 2-24.

PIPEPHASE 9.6 NETOPT Users Guide

2-19

Figure 2-24: Network Optimization Window

Now, you must define the objective parameters by clicking on the Objective Parameters button to bring up the Network Optimization Objective Parameters window.

As discussed previously, the overall capital cost is a linear function of the ID of the two pipeline segments and compressor power:
Capital Cost = 140*IDPipe 1 + 126*IDPipe 2 + 4.66E-3*wCompr 1 +4.66E-3*wCompr 2

There are therefore four objective parameters for this optimization problem as shown in Table 2-6 .
Table 2-6: Objective Parameters Link
L003 L002 L003 L002

Description
Pipe E004 Inside Diameter, ID Pipe E002 Inside Diameter, ID Compressor E005 Power, w Compressor E003 Power, w

Coefficient in Objective Function


140 126 4.66E-3 4.66E-3

To enter the first objective parameter:

In the Network Optimization Objective Parameters window, click the Add button. This brings up the Define Objective Parameter window. Select the Link Name radio button in the Node/Device/ Simulation Data field. Select link L003 from the Link Name drop-down list box.
Tutorial

2-20

Select Pipe from the Device Type drop-down list box. By default, PIPEPHASE will display the correct device name, E004. Select Inside Diameter from the Parameter drop-down list box. Type in 140 in the Correlation Coefficient data entry field as shown in Figure 2-25.

Figure 2-25: Define Objective Parameter Window

Repeat for the other three objective parameters using the data in Table 2-6 .

Tip:For the Compressor objective parameters, select Set Power from the Parameters drop-down list box in the Define Objective Parameter window.

The completed Network Optimization Objective Parameters window is shown in Figure 2-26.

PIPEPHASE 9.6 NETOPT Users Guide

2-21

Figure 2-26: Network Optimization Objective Parameters Window

Click the OK button to return to the Network Optimization Data window. Next you must define the decision variables.

There are four decision variables for this optimization problem as shown in Table 2-7 below.
Table 2-7: Decision Variables Link
L003 L002 L002 L003

Description

Limits

Relative Perturbation
0.001 0.001

Pipe E004 Internal Diameter, ID 24<ID<48 Pipe E002 Internal Diameter, ID 24<ID<48 Compressor E003 Power, w Compressor E005 Power, w 0 hp<w<50000 hp 0 hp<w<50000 hp

To enter the first decision variable:

In the Network Optimization Data window, click the Add button. This brings up the Define Decision Variable window. Select the Link Name radio button in the Node/Device Name field. Select link L003 from the Link Name drop-down list box. Select Pipe from the Device Type drop-down list box. By default, PIPEPHASE will display the correct device name, E004. Select Inside Diameter from the Parameter drop-down list box. Click the Limits button. This brings up the Optimizer Variable Limits window as shown in Figure 2-27.
Tutorial

2-22

In the Variable Lower Limit field, enter a value of 24 for Mechanical Limit (Absolute Value). In the Variable Upper Limit field, enter a value of 48 for Mechanical Limit (Absolute Value).

Figure 2-27: Optimizer Variable Limits Window

Click the OK button to return to the Define Decision Variable window. Then, click the OK again to return to the Network Optimization Data window. Repeat for the other three decision variables using the data in Table 2-7 above.

Tip:For the Compressor decision variables, select Power from the Parameters drop-down list box in the Define Decision Variable window. The Network Optimization Data window should now appear as shown in Figure 2-28.

PIPEPHASE 9.6 NETOPT Users Guide

2-23

Figure 2-28: Network Optimization Data Window

Next you must define the constraints by clicking the Constraints button to bring up the Network Optimization Constraints window
Description
Pressure Compressor E003 Outlet Pressure, P Compressor E005 Outlet Pressure, P

Table 2-8: Constraints Node Name


Sink S001 Link L002 Link L003

Limits
P>900 psi 0 psi<P<2475 psi 0 psi<P<2475 psi

To enter the first constraint: 2-24

In the Network Optimization Constraints window, click the Add button. This brings up the Define Constraint window. Select the Node Type radio button in the Node/Device/Simulation Data field. Select Sink from the Node Type drop-down list box. By default, PIPEPHASE will display D003 as the Node Name. Select Pressure from the Parameter drop-down list box. Click the Limits button. This brings up the Optimizer Variable Limits window. In the Variable Lower Limit field, enter a value of 900 for Mechanical Limit (Absolute Value).
Tutorial

Click the OK button to return to the Define Constraint window. Then click OK again to return to the Network Optimization Data window. Repeat for the other two constraints using the data inTable 2-8 .

Tip:For the Compressor constraints, select Outlet Pressure from the Parameter drop-down list box in the Define Constraint window. The Network Optimization Constraints window should now appear as shown in Figure 2-29.
Figure 2-29: Network Optimization Constraints Window

Finally, you must specify the optimization options. Click OK to return to the Network Optimization Data window. On the Network Optimization Data window, click the Optimization Options button. This brings up the Optimization Options window. For this problem, you must increase the number of optimizer iterations from the default value of 10. In the Maximum Number of Optimizer Cycles field, select the Specified Number radio button and enter a value of 30 in the corresponding data entry field as shown in Figure 2-30.

PIPEPHASE 9.6 NETOPT Users Guide

2-25

Figure 2-30: Optimization Options Window

Click the OK button to return to the Network Optimization Data window shown in Figure 2-31.

Figure 2-31: Network Optimization Data Window

Then, click the OK button again to return to the main PIPEPHASE window. Select the File/Save menu option to save the simulation date entered so far.

2-26

Tutorial

Specifying Print Options


Before you can run the simulation, you must specify the print options for the output report and save the simulation.

Select the General/Print Options menu option from the main PIPEPHASE window. This brings up the Print Options window as shown in Figure 2-32.

Note: You must turn off the input reprint, select that all device

details be printed (the FULL option), and generate a database.


By Default, Ability to Generate Excel Database option is set to FULL. Select the NONE option from the Input Reprint drop-down list box. Select the FULL option from the Device Detail drop-down list box. The completed Print Options window should appear as shown in Figure 2-32.

Figure 2-32: Completed Print Options Window

Click OK to return to the main PIPEPHASE window. Select the File/Save menu option to save the simulation data entered so far.
2-27

PIPEPHASE 9.6 NETOPT Users Guide

Now you are ready to run your simulation.

Running the Simulation


If you are running on a UNIX server, you must first define your run remote settings.

Select the File/Remote Settings menu option to bring up the Run Remote Settings window. By default, the Run Calculations on Remote Computer check box is enabled. Select the appropriate option from the Local Operating System Version drop-down list box. Supply a Remote Machine Name, Remote User ID, and Remote User Directory for your remote host machine. Select TELNET or RSH for remote execution and supply the appropriate commands for running PIPEPHASE. Click the OK button on the Run Remote Settings window to return to the main PIPEPHASE window. Click the RUN button on the toolbar or select the File/Run menu option to run PIPEPHASE. This brings up the Run Simulation and View Results window. Click the Run button in the Run Simulation field.

The status of the simulation run is shown in the Run Status window, which may be scrolled and resized. If you have successfully entered all the data correctly, your Run Simulation and View Results window will appear as shown in Figure 2-33.

2-28

Tutorial

Figure 2-33: Run Simulation and View Results Window

PIPEPHASE 9.6 NETOPT Users Guide

2-29

Viewing and Plotting Results


To view the optimized results:

Select the Optimized Summary option from the Report dropdown list box, then click the View button to view the results of the optimization as shown in Figure 2-34.

Figure 2-34: Optimized Summary Report

Table 2-9 summarizes the optimal solution for this simulation.


Table 2-9: Optimized Solution Results
Minimum Capital Cost Pipe, E002 ID Pipe, E004 ID Compressor, E003 Power $7,796 MM 24 32.9474 18366.76 hP

2-30

Tutorial

Table 2-9: Optimized Solution Results


Compressor, E005 Power Source, S001 Flowrate Source, S002 Flowrate 15949.10 hP 570.6906 MMCFD 629.3094 MMCFD

PIPEPHASE 9.6 NETOPT Users Guide

2-31

Using the RAS to Plot Results


PIPEPHASE includes a powerful utility called the Results Access System (RAS) that allows you to plot the results of your optimization run.

First, find and launch the RAS program. The main PIPEPHASE RAS window appears as shown in Figure 2-35.

Figure 2-35: PIPEPHASE RAS Window

Next, select the File/New menu option. Select the TUTORIAL.RAS database file. Click Open. Click the View/Edit button beside the Plot Report drop-down list box to define your plot. This brings up the RAS Plot Options window. Click the Add button to bring up the RAS Plot Data Options window. Next you must plot the pressure along link L003 (from junction J004 to sink D003) for the base case and the optimized case. By default, the Initial Case option is selected in the Simulation drop-down list box.

Select L003 from the Link Name drop-down list box. Check the All Devices in the LInk check box.

2-32

Tutorial

By default, PIPEPHASE RAS will select Pressure as the State Variable to plot on the y-axis.

Click the Add Selection button to add this to the list of variables to plot. Repeat the above steps for link L003 for the Optimized Case. Click the Done button to return to the RAS Plot Options window. Fill in the Title, X-Axis Label, and Y-Axis Label fields as shown in Figure 2-36.

Figure 2-36: RAS Plot Options Window

Click the View button to view the plot shown in Figure 2-37.

Figure 2-37: RAS Plot

PIPEPHASE 9.6 NETOPT Users Guide

2-33

You can save this plot or export the data as a comma-delimited or tab-delimited ASCII file using the File menu options on the Plot window.

Select File/Close to close the Plot window. Click OK on the RAS Plot Options window to return to the main RAS window.

2-34

Tutorial

Including Operating Costs


The analysis done in the first half of this tutorial is based on capital expenditures alone. Over the lifetime of a pipeline, the operating costs, primarily in terms of fuel consumed in running the compressors, are significant. Table 2-10 shows the compressor operating costs.
Table 2-10: Compressor Operating Costs Compressor Cost/1000hp $0.4MM/year

Over the lifetime of the pipeline system (10 years), the total cost is therefore: Total = Operating Costs + Capital Cost Costs (MMD) = (4.0e-3*10*wCompr 1 + 4.0e-3*10*wCompr 2) + (140*IDPipe 1 + 126*IDPipe 2 + 4.66E-3*wCompr 1 + 4.66E-3*wCompr 2)

First, change the objective function to include these new costs and rerun the optimization.

Click the button on the toolbar or select the Special Features/ Netopt from menu option. This brings up the Network Optimization Data window. Click the Objective Parameters button to bring up the Network Optimization Objective Parameters window. Highlight the Compressor E005 Available Power parameter, then click the Edit button. Change the value of the Correlation Coefficient from 4.660e003 to 6.600e-004 as shown in Figure 2-38.

Figure 2-38: Define Objective Parameter Window

PIPEPHASE 9.6 NETOPT Users Guide

2-35

Click the OK button to return to the Network Optimization Objective Parameters window. Repeat for the Correlation Coefficient for the Compressor E003 Power parameter. Click the OK button until you return to the main PIPEPHASE window. Then run the modified problem by clicking the Run on the toolbar or on the File/Run menu option. Then click the Run button on the Run Simulation and View Results window. Select the Optimized Summary option from the Reports dropdown list box.

Table 2-11 compares the optimal solution for the modified problem to that of the original problem. The operating costs involved in running the pipeline system for 10 years based on the original solution are also included.
Table 2-11: Optimized Solution Results Run #2
Minimum Total Cost Capital Cost Operating Cost Pipe, E002 ID Pipe, E004 ID Compressor, E003 Power Compressor, E005 Power Source, S001 Flowrate Source, S002 Flowrate $7,964 MM $7,574 MM $389.9 MM 24 32.04 47,476 hP 50,000 hP 565.32 MMSCFD 634.67 MMSCFD

Run #1
$7,933.8 MM MM $7,796 MM $137.3 MM 24 32.9474 18366.76 HP 15949.10 HP 570.6906 MMCFD 629.3094 MMCFD

1 Operating cost = 47.476*0.4*10+50*0.4*10=$389 MM

The results of these two runs show that by taking the operating costs into consideration:

Smaller compressors on both sections of pipeline are needed. For an increased capital expenditure of $222MM in laying down slightly larger pipes on Link L003, operating costs over the lifetime of the pipeline are reduced nearly 65% from $389.9 MM to $137.3 MM.

2-36

Tutorial

Overall costs are reduced 0.3% from $7,964 MM to $7,933 MM.

PIPEPHASE 9.6 NETOPT Users Guide

2-37

2-38

Tutorial

Chapter 3 Optimization Input Reference


About This Chapter
This chapter contains information about the data that NETOPT needs to perform different types of simulation. These data are input in a free format style file and the file is divided into categories; for example, Component Data, Property Data, etc. This chapter explains the general rules for input, which categories are mandatory and which are optional. It defines all the terms in the input descriptions and the conventions throughout this chapter. Each data category, the statements contained in it and the keywords on each statement are then described. For an explanation of how the program uses this data, please refer to Chapter 2 and Chapter 5 of the PIPEPHASE Keyword Manual.

Categories of Input
The data required by NETOPT are the following program in two main categories: Optimization Data Category Define the objective function to be optimized, the decision variables and constraints, and optimization parameters.

Note: The only categories described in this Users Guide are the Optimization Data Category and the Reservoir Data Category. The other seven data categories can be found in the PIPEPHASE Keyword Manual.

PIPEPHASE 9.6 NETOPT Users Guide

3-1

Those categories which are mandatory and those which are optional depend on which fluid type you have:
Table 3-1: Categories of Input Fluid Type Mandatory Categories Non-compositional Compositional GENERAL, PVT, STRUCTURE, NETWORK GENERAL, COMPONENT, NETWORK, THERMODYNAMIC, STRUCTURE Optional Categories OPTIMIZATION PVT, UNIT OPERATIONS, OPTIMIZATION

There are four other categories which can be selectively overridden on the flow device and fitting statements in the Structure Data Category of input. Time-stepping Data Allows the simulation of the effect of reservoir pressure decline with cumulative production on the network performance, and device parameter changes with time. Change parameters and re-run. Determine pipe sizes in single-link calculations.

Case Study Line Sizing

Sensitivity (Nodal) Analysis Study overall performance in singlelink calculations as a function of one or two system parameters.

Order of Categories
The only restriction on order of data input is that the General Data Category must be first. However, it is always good practice to maintain a consistent order. The order of the categories above is recommended. See the PIPEPHASE Keyword Manual.

Keywords
NETOPTs primary mode for entering input is in the form of keyword-controlled, free format statements. The keyword entries on a statement are separated by commas. For example:
PIPE ID=1.25, LENGTH=25, ROUGHNESS=0.002

3-2

Optimization Input Reference

For ease of interpretation, each keyword is an engineering word. To make the input easier to enter, any keyword with more than four characters can be truncated to a minimum of four characters. Keywords with fewer than four characters may not be lengthened. For example: The keyword LENGTH may be written LENG. The keyword ROUGHNESS may be written ROUGH. The keyword ID cannot be written IDIA. Keywords can stand alone, indicating that they are acting as a switch, or they can be associated with a value or another keyword by the use of an equals sign (=). This value can be entered in integer, decimal, or scientific format. For example:
ENGLISH LENGTH=FT TEMP=50 PRES=2.0E2

English units set will be used. Units of length are feet. Temperature set to 50 units. Pressure is 200 units.

In the instructions presented in this chapter, the presence of an equals sign (=) after a keyword means that NETOPT expects a value or another keyword. In some cases, however, more than one data item is required. When this situation arises, the instructions will include the format for the data input. For example:
VISC=

Indicates that a single value of viscosity is required. Indicates that the program requires two data values with their associated temperatures

VISC=temp1,value1 / temp2,value2

Qualifiers
Many keywords can be qualified by entering a keyword in brackets (parentheses) after them. The most common use of a qualifier is for defining a unit of measurement to override the set of units declared globally in the General Data Category of input. Other qualifiers include the definition of estimates, maxima and minima, fluid type and basis of a composition or flowrate. Some qualifiers are optional and some are mandatory. You may use more than one qualifier for a keyword and the order in which they appear is not important.

PIPEPHASE 9.6 NETOPT Users Guide

3-3

The input instructions explain which qualifiers are available for each keyword. Examples are:
ID(IN)=12 PRES(BAR,ESTI)=2 POWER(MAX,KW)=17

Inside diameter is 12 inches. Estimated pressure is 2 bars absolute. Maximum power is 17 kilowatts.

Commenting Input
For clarity, you may add comments to your input. If a dollar sign ($) is placed in a statement, any text on that statement that appears after the $ is ignored by NETOPT. For example:
PRES(BAR)=3.54 $ Field data, taken 2315 10/16/94

Default Data
Many NETOPT data items are given default values. Therefore, if you do not explicitly specify such an item, the program will assign a value. These values, for example pipe thermal conductivity of 29 Btu/hr-ft-F, have been selected to be reasonable for normal engineering purposes. Most methods also have defaults associated with them. These defaults are for your convenience. They have not been selected specifically for your application and are not intended to replace engineering judgment. You should check that invalid output does not result through the inadvertent use of inappropriate defaults. The input instructions indicate the defaults that the program will use in the absence of user input. All the numerical defaults in the input instructions are expressed in terms of the units of measurement of the Petroleum set. When you specify a value or override a default in the General Data Category of input your value becomes the default for the entire simulation. You can then override your own default value later in the input. For example, to specify that all but one of your pipes are surrounded by air, you would have in the General Data Category of input:
DEFAULT AIR, VELOCITY=20

You would specify most of your pipes in this way:


PIPE ID=4, LENGTH=150

3-4

Optimization Input Reference

For the one pipe that is buried, the PIPE statement would look like this:
PIPE SOIL, ID=5, LENGTH=100, BDTOP(FT)=1

Units of Measurement
Many items of data that you input to NETOPT have a unit of measurement associated with them. Most have alternatives: for example, length can be measured in feet, meters, miles, or kilometers and temperature in F, C, R, or K. It is possible to specify the unit of measurement individually for every item of data. However, to avoid having to do this, you may define the units that are to be used for each quantity - temperature, duty, power etc. throughout the whole simulation input. This is done on the DIMENSION statement in the General Data Category of input. Individual data items may be expressed in different units by using qualifiers as described above. For convenience, NETOPT has four sets of units of measurement: Petroleum, English, Metric and SI. Each set has predefined units for each data item. You may select a set of units, globally override some of the predefined units and then override units for any individual data item. In this way, you have complete input flexibility. For example, if you wanted to use the SI predefined unit set but with pipe length in feet and short length (e.g., for pipe diameter) in inches, your General Data Category of input would contain the statement:
DIMENSION SI, LENGTH=FT,IN

If the inside diameter of one of your pipes is measured in millimeters, you would have in the Structure Data Category of input:
PIPE ID(MM)=25.4

Basis of Measurements
With some quantities for example flow and composition you can also choose a basis of measurement. The basis may be molar weight, liquid volume, or gas volume and you may use a qualifier to define it. If you also specify a dimensional unit for the quantity, the

PIPEPHASE 9.6 NETOPT Users Guide

3-5

unit must be appropriate to the basis. You cannot, for example, specify pounds per hour for a liquid volume flowrate. A valid example would be:
RATE(GV,CFM)=1.E-3

where the value specified, RATE keyword and the qualifiers GV and CFM combine to mean the gas volume rate has a value of 0.001 millions of standard cubic feet per minute. The input instructions explain which bases are allowed. If a basis is specified but no unit of measurement is entered, NETOPT will assume the unit to be the default appropriate to the basis which you defined.

Multiple Units of Measurement


Some input items, for example a curve of viscosity against temperature, have more than one unit of measurement. You can specify one or both units as qualifiers:
VISC(C,CP)=100,1.0/200,0.7

The order in which the qualifiers are entered is not important.

Continuing Statements
An input statement may be too long to fit on one line. In this case, it may be continued onto a second line or further by using the ampersand continuation character, &.
DIMENSION SI, LENGTH=FT, TEMP=C.

is the same as
DIMENSION SI, LENGTH=FT, & TEMP=C

Layout of Input
You may indent any line of input to make the data more readable and you may have any number of spaces between data entries. For example:
DIMENSION SI, LENGTH=FT, & TEMP=C

is equivalent to
DIMENSION TEMP= C SI , LENGTH = FT, &

3-6

Optimization Input Reference

However, you may not embed any blanks within your keywords or data entries.

Legend for Input Statement Descriptions


In this chapter, each data category is described. At the start of each data category, there is a full listing of statements with all of their associated keywords. Each statement and each keyword is then explained in detail. Throughout the input descriptions, the following conventions apply:
BOLD Bold capitals are used for keywords. For example: ENGLISH You must use this word exactly as it is printed (or truncate it to four or more characters). If a keyword has an equals sign (=) after it, you must enter a value or another keyword after it. If the keyword is underlined, this indicates that the keyword is the default. For example: PETROLEUM If you omit the entry or statement altogether, the program will use this keyword as the default. Light capitals are used for values, methods and entries. For example: INPUT=FULL If you omit the keyword and entry, the program will use the default. A number indicates a numerical default value. For example: LAMINAR=3000 If you omit the keyword and entry, the program will use this value as the default. or A number of alternative entries are separated by the word or. For example: {PETROLEUM or ENGLISH} You may select only one of the options contained within the { } brackets and separated by the word or. {} This symbol indicates that a statement, keyword, or group of keywords is/are optional. For example: {VELOCITY=value} Your input will work without this entry. There is usually a default invoked if an entry is omitted. Indicate that qualifiers are allowed. For example: ID()= Unless otherwise noted, qualifiers are units of measurement.

UNDERLINE

LIGHT

()

PIPEPHASE 9.6 NETOPT Users Guide

3-7

OPTIMIZATION Data Category of Input


The Optimization Data Category of Input allows you to define the objective function to be optimized, to specify the decision variables and constraints, and to supply the optimization parameters. Most of the keywords for the NETOPT optimization tool are provided in the Optimization Data Category of input and are described in the following table.
Table 3-2: Optimization Data Category of Input Statement Keywords OBJECTIVE <NODE1>=<nodeid>, VARIABLE2=<variable> or <DEVICE1>=<devid>, VARIABLE2 See page... 3-9

=<variable> or CALC =<calc uid>, {ON or OFF}, {COMPONENT=}, {COEFFICIENT=}, {TARGET, TCURVE=, CAPTIME=, INCREMENTAL, RAMP, DISCOUNT=, INTERPOLATE or STEPCHANGE}, LINK=<linkid,network> TCURVE=, TIME=, COEF= 3-11 3-11
1>=<nodeid>,

{OBJCURVE} DECISION

<NODE VARIABLE=<variable> or <DEVICE1>=<devid>, VARIABLE=<variable>, ALOWER(unit), AUPPER(unit), RLOWER, RUPPER, MLOWER(unit), MUPPER(unit), {ON or OFF}, {PERTURBATION}, {SCOMPONENT}, TIME=, LINK=<linkid,network> <NODE1>=<nodeid>, VARIABLE=<variable> or <DEVICE1>=<devid>, VARIABLE=<variable> or CALC=FUNCON1 or <calc name>, NAME=, ALOWER(unit), AUPPER(unit), RLOWER, RUPPER, MLOWER(unit), MUPPER(unit), {ON or OFF}, {TOLERANCE}, {COMPONENT}, LINK=<linkid,network>

CONSTRAINT

3-12

NODE and DEVICE are not the actual keywords, but would be replaced by the specific type of node or device, such as SOURCE or PIPE. The type of node or device is then followed by its name, for example, PIPE=PIP1.

OBJECTIVE VARIABLE not allowed for functions; the function return value is used.
3

Valid FUNCTION numbers are 1 through 9.

3-8

Optimization Input Reference

OPTIMIZATION Data Category of Input (continued)


Table 3-2: Optimization Data Category of Input (Continued) Statement Keywords OPTPARAMETER MAXIMIZE or MINIMIZE, GLOBAL OBJEFUNCTION=OBJFUN13, {ITER=10, SCALE or NOSCALE, DEFPERT=0.001, OBJTOL=0.005, VARTOL= 0.001, ERTOL=0.005, DAMP=10, DFACTOR=4, LUDSAVE, OVERTIME} See page... 3-13

NODE and DEVICE are not the actual keywords, but would be replaced by the specific type of node or device, such as SOURCE or PIPE. The type of node or device is then followed by its name, for example, PIPE=PIP1.

2 OBJECTIVE VARIABLE not allowed for functions; the function return value is used. 3

Valid FUNCTION numbers are 1 through 9.

OBJECTIVE

Mandatory statement. Defines the function to be optimized. One or more objective function variables may be defined. The objective function is calculated using the values of the objective function variables and their coefficients, or in a user-added subroutine. Mandatory entries: <NODE>=<nodeid> or <DEVICE>= <devid> or Type and name of node. Choices for NODE type are SOURCE, SINK, or JUNCTION. Type and name of device. Choices for DEVICE type are PIPE, TUBING, RISER, ANNULUS, CHOKE, PUMP, COMPRESSOR, COOLER, HEATER, CHECK, or COMPLETION. Specifies a Calculator that is used to define the Objective function. Classification of variable. Options depend on the type of device that is specified. Refer Table 4-55a, Chapter 4, Input Reference in PIPEPHASE 9.6 Keyword Manual for details.

CALC=<calc uid> VARIABLE=

Optional entries: ON or OFF ON is the default and signifies that the variable is to be included. OFF specifies that variable is to be excluded. Component ID if the particular variable is associated with a component. For noncompositional models with contaminants, component numbers 1, 2, and 3 refer to N2, CO2, and H2S respectively.

COMPONENT=

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

PIPEPHASE 9.6 NETOPT Users Guide

3-9

OPTIMIZATION Data Category of Input - OBJECTIVE (continued)


COEFFICIENT= Coefficient of variable in the objective function. By default, the objective function is a linear sum of the decision variable(s) times the coefficient for that variable. Target value of objective function. When this keyword is present, you must use MINIMIZE in the OPTPARAMETER statement. The objective function is calculated for all devices of identified type in the named link. For example, if the device type is pipe, and the variable type is ID, then the objective function is computed under the assumption that all pipes in link have the same ID. Network has the same function as link, but is valid for all devices in the network.

TARGET=

LINK=<linkid,network>

The following keywords may be used for optimization over time, i.e., if the OVERTIME keyword is used on the OPTPARAMETER statement. TCURVE= CAPTIME= INCREMENTAL Specifies the name of the time curve to be used for operating costs discounting. Specifies the time from the start of the simulation that the capital cost is incurred. By default, the capital cost incurred at time specified by CAPTIME is based on the new value of the objective variable at that time. If you want the cost to be based on the incremental increase in the value of the variable then use the INCREMENTAL keyword to indicate this. If the value decreases over the time step the capital cost incurred will be zero.

Note: For user-added over time objective

functions, you may interpret this INCREMENTAL flag in your own way. See the last section in this chapter on User-added Over time Objective Functions.
RAMP DISCOUNT INTERPOLATE or STEPCHANGE Uses a ramp change for time curves. Enables present value discounting for all operating and capital costs. INTERPOLATE is the default and specifies whether values are interpolated between time steps. STEPCHANGE calculates the value at each time step.

Example:
OBJECTIVE DEVICE=PMP4, VARI=PRES, TARG=40,ON

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

3-10

Optimization Input Reference

OPTIMIZATION Data Category of Input (continued)


OBJCURVE
Optional statement. Supplies the operating time curve to be used for optimization over time. Mandatory entries: TCURVE Name of the time curve. You can supply any name or use one of the DISCOUNT, OILPRICE, or GASPRICE curves supplied by default. Time in days. Cost associated coefficient for the time curve.

TIME= COEF=

DECISION

Mandatory Statement. Defines the set of variables which affect the computation of the objective functions, the constraints, and the partial derivatives of the objective function and the constraints. The keywords and their required order are as follows. Mandatory entries: <NODE>=<nodeid> or <DEVICE>= <devid> Type and name of node. Choices for NODE type are SOURCE, SINK, or JUNCTION. Type and name of device. Choices for DEVICE type are PIPE, TUBING, RISER, ANNULUS, CHOKE, PUMP, COMPRESSOR, COOLER, HEATER, CHECK, or COMPLETION. Classification of variable. Options depend on the type of device that is specified. Refer Table 4-55a, Chapter 4, Input Reference in PIPEPHASE 9.6 Keyword Manual for details.

VARIABLE=

Optional entries: LINK=<linkid,network> The objective function is calculated for all devices of identified type in the named link. For example, if the device type is pipe, and the variable type is ID, then the objective function is computed under the assumption that all pipes in link have the same ID. Network has the same function as link, but is valid for all devices in the network. Absolute lower bound of the variable. Absolute upper bound of the variable. Permitted lower bound of the relative change of the variable, in percent. Permitted upper bound of the relative change of the variable, in percent. Inviolable lower equipment limit. Inviolable upper equipment limit.

ALOWER(unit)= AUPPER(unit)= RLOWER= RUPPER= MLOWER(unit)= MUPPER(unit)= {} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

PIPEPHASE 9.6 NETOPT Users Guide

3-11

OPTIMIZATION Data Category of Input - DECISION (continued)


ON or OFF ON is the default and signifies that the variable is to be included. OFF specifies that variable is to be excluded. Individual fractional perturbation to be used when calculating derivatives by finite difference. Component ID if the particular variable is associated with a component. Specifies the time from the start of the simulation when the decision variable is included for optimization over time.

PERTURBATION= SCOMPONENT= TIME=

Example:
DECISION SOURCE=SOR1, VARI=TEMP, MLOWER=25, MUPPER=95,& ALOWER=.1, AUPPER=3, ON

CONSTRAINT

Optional Statement. Defines limits for calculated variables such as the pressure drop in a pipe. By default, the constraint limits will be used for each case study or time stepping simulation. These limits may be changed for different cases or time steps from the case study data or time stepping data sections. The keywords and their required order are as follows: Mandatory entries: <NODE>=<nodeid> or <DEVICE>= <devid> or Type and name of node. Choices for NODE type are SOURCE, SINK, or JUNCTION. Type and name of device. Choices for DEVICE type are PIPE, TUBING, RISER, ANNULUS, CHOKE, PUMP, COMPRESSOR, COOLER, HEATER, CHECK, or COMPLETION. Specifies the user-added subroutine (FUNCON1) or Calculator Name that is used to define the Constraint.

CALC=

Note: The user-added subroutine name must be FUNCON1.


NAME= VARIABLE= Specifies the name of the constraint used in the user-added subroutine FUNCON1. Classification of variable. Options depend on the type of device that is specified. Refer Table 4-55a, Chapter 4, Input Reference in PIPEPHASE 9.6 Keyword Manual for details.

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

3-12

Optimization Input Reference

OPTIMIZATION Data Category of Input - CONSTRAINT (continued)


LINK=<linkid,network> The objective function is calculated for all devices of identified type in the named link. For example, if the device type is pipe, and the variable type is ID, then the objective function is computed under the assumption that all pipes in link have the same ID. Network has the same function as link, but is valid for all devices in the network.

Optional entries: ALOWER(unit)= AUPPER(unit)= RLOWER= RUPPER= MLOWER(unit)= MUPPER(unit)= ON or OFF Absolute lower bound of the variable. Absolute upper bound of the variable. Permitted lower bound of the relative change of the variable, in percent. Permitted upper bound of the relative change of the variable, in percent. Inviolable lower equipment limit. Inviolable upper equipment limit. ON is the default and signifies that the variable is to be included. OFF specifies that variable is to be excluded. If negative, this is the relative variance on a fractional basis allowed in the constraint limit. If positive, this is the absolute variance allowed in the constraint limit. Component ID if the particular variable is associated with a component. For noncompositional models with contaminants, component numbers 1, 2, and 3 refer to N2, CO2, and H2S respectively.

TOLERANCE=

COMPONENT=

Example:
CONSTRAINT NAME=CONSVAR1, MLOWER=5, MUPPER=10

OPTPARAMETER

Describes the options for the optimization. Optional entries: MAXIMIZE or MINIMIZE Use one of these required keywords to define whether the optimization is to be maximized or minimized. Note that a negative value is minimized when its absolute value is maximized.

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

PIPEPHASE 9.6 NETOPT Users Guide

3-13

OPTIMIZATION Data Category of Input - OPTPARAMETER (continued)


GLOBAL Allows optimization problems and network problems to be solved simultaneously. By using this option, the network base case simulation is solved prior to starting the optimization simulation. The network solution matrix is added to the optimization problem specified by the user. Estimated source rates and pressures become optimization decision variables. Fixed sink rates, pressures and network pressure imbalances become optimization constraints. Tolerances for these constraints are set based on the PRESSURE and RATE keywords on the SOLUTION card (optimizer sets slightly tighter tolerance than user specification). In general, more optimization cycles, smaller objective tolerances and smaller perturbation of the decision variables are required for this method. Notice, this option does not support well shut-in or flow reversals. Specifies a subroutine interface that implements a user-added objective function. See User-added Objective Functions on page 43. Maximum number of iterations. Use 5-10 iterations for small optimization problems, 10-15 for mediumlarge problems. The default, if a value is not provided, is 10.

OBJEFUNCTION

ITER=10

Note: Using ITER=0 provides a good

summary of the base case (unoptimized) simulation.


SCALE or NOSCALE Use this entry to switch the automatic scaling feature on (SCALE) or off (NOSCALE). The default SCALE uses the variable bounds and the constraint limits to calculate the scaling factors.

Note: The NOSCALE option is very useful in dampening problems that are highly sensitive to variable changes.
DEFPERT=0.001 Use this keyword to supply the default fractional perturbation value used to calculate derivatives. The value 0.005 works well for pressures. The default of 0.001 works well for mass flowrates and qualities. The fractional perturbation value is related to the percentage change by the following formula:

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

3-14

Optimization Input Reference

OPTIMIZATION Data Category of Input - OPTPARAMETER (continued)


Xpert = Xbase + Max[DEFPERT, ABS(DEFPERT*Xbase)] where: Xpert = percentage change Xbase = initial (base) value For example, for Xbase=1000, DEFPERT=0.005, Xpert=1000 + 0.005x1000=1,005, i.e., a 1/2% change.

Note: If DEFPERT is too large (e.g., 0.15), this leads to coarse gradients. Too small values (e.g., 0.00001) result in noisy or incorrect gradients.
OBJTOL=0.005 This entry specifies the minimum fractional change in the objective function to continue optimization. The default value is 0.005. This entry is used to supply the minimum fractional change in the decision variables to continue optimization. The default value is 0.001.

VARTOL=0.001

Note: For large problems with noisy gradients, increasing the value of VARTOL while keeping the value of OBJTOL constant may result in improved convergence.
ERTOL=-0.005 Use this keyword to provide the fractional error tolerance for the constraints. For example, if the current constraint is between 1000 and 2000, an error tolerance of -0.01 will result in an acceptable range of 990 and 2020. A positive value of ERTOL means that the deviation from the bounds of the constraint is absolute, while a negative value results in a fractional deviation. The default is -0.005 (0.5% deviation). This is the number of damped iterations, i.e., the optimization algorithm will make smaller changes in the variables for this set number of iterations. This approach results in higher stability and improved convergence for problems involving loops, and when base case simulations are difficult to solve. The default number of damped iterations is 10.

DAMP=10

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

PIPEPHASE 9.6 NETOPT Users Guide

3-15

OPTIMIZATION Data Category of Input - OPTPARAMETER (continued)


DFACTOR=4 This entry is used to supply the denominator of the fractional change in variables for damped iterations. For example, a value of DFACT=10 results in a 1/ 10th move in the value of the variables. Specifies LU (lower/upper) matrix factorization in the derivative calculation to speed up calculations. Enables optimization over time.

LUDSAVE OVERTIME

Note: This keyword must be supplied if

the optimization over time feature is used.


Example:
OPTPAR MAXI, SCALE, OBJT=0.01, DFACT=1

The following table shows types and variables for CONSTRAINT, DECISION, and OBJECTIVE statements.

User-defined Optimization Constraints


User-added subroutines may be used to define constraints or to define objective functions. Constraints are imposed limits on the problem which may be defined either in terms of:

a NETOPT variable

or

a function of NETOPT variables

If a constraint is to be defined as a function of NETOPT variables, then the functional relationship must be defined via one or more user-added subroutines or by using the Calculator unit.

{} entries are optional = requires values or entries

() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units

3-16

Optimization Input Reference

To implement the user-added subroutines, you must interface with the subroutine FUNCON1(NAME,VALUE) found in the file FUNCON1.F. NAME is the name of the external constraint, while VALUE is the value of the constraint.
Note: You may directly enter a value for the constraint, i.e., an entry for VALUE, in the subroutine FUNCON1, or you may supply other subroutines in files UADD1.F through UADD5.F to compute the constraint.

Any new routines must be compiled and a new NETOPT executable generated.

Example 1: Using the Sink Pressure as a Constraint


The FUNCON1 subroutine is written to extract the sink pressure using PDTS and return it as VALUE. The calling sequence is: CALL FUNCON1(CONS1,VALUE) where CONS1 = the external variable constraint name supplied using the NAME keyword. The constraint is the pressure at sink SNK. Calls are made to external subroutines PADATI and GETDAT to retrieve data from the network. These useful subroutines, supplied with this release, are SIMSCI PDTS routines documented in the PRO/II Data Transfer System Manual. Contact your SIMSCI-ESSCOR representative for more information. The subroutine could be written as follows:
C NETOPT-FUNCON1 C SUBROUTINE FUNCON1(NAME, VALUE) C C USER SUBROUTINE: COMPUTE EXTERNAL CONSTRAINTS FOR OPTIMIZATION C C INPUT DATA C C NAME - NAME OF EXTERNAL CONSTRAINT C C OUTPUT DATA C C VALUE - VALUE OF EXTERNAL CONSTRAINT C C C COMMON DECLARATIONS C INCLUDE PRECIS.CMN C C C LOCAL DECLARATIONS C CHARACTER*4 NAME

PIPEPHASE 9.6 NETOPT Users Guide

3-17

C C C CODE BEGINS HERE C C C USER ADDED VARIABLE IS PRESSURE AT SINK=SNK AS EXTRACTED USING PDTS C VALUE = 0.0 IF (NAME .EQ. UN01) THEN CALL PADATI(Calc,NumberOfResults,C001,NUMRES,KC,IRCODE) IF (IRCODE.EQ.0) 1 CALL GETDAT(Calc,ResultVector,C001,1,RVEC,NUMRES,IDUM1, 1 IDUM2,IRCODE) IF (IRCODE.EQ.0) VALUE = RVEC ENDIF C C CODE ENDS HERE C RETURN END

Note: The files containing the relevant common blocks are included with your installation. Please refer to these files for an explanation of the common block variables.

User-added Objective Functions


Objective functions may be defined either in terms of:

a constant times a NETOPT variable

or

a function of NETOPT variables

If an objective function is to be defined as a function of NETOPT variables, then the functional relationship must be defined via one or more user-added subroutines or by using a Calculator unit. To implement the user-added subroutines, you must interface with the subroutine FUNOBJ1(IMODE,NUMBOBJ,VPOBJE,VPTARG,VPCOEF,F) found in the file FUNOBJ1.F. IMODE, NUMBOBJ, VPOBJE, VPTARG, and VPCOEF are input variables passed to the routine from the simulation. IMODE is the runmode flag. IMODE equals 2 for parameter tuning and 3 for optimization. VPOBJE, VPTARG,

3-18

Optimization Input Reference

and VPCOEF are the input vectors of the objective variables, targets, and coefficients that are used to compute the output objective function, F.
Note: You may compute all of the terms in the objective function

in the subroutine FUNOBJ1, or you may utilize other subroutines you have written. Any new routines must be compiled and a new NETOPT executable generated. The name of your external subroutine must not correspond to the name of an existing NETOPT internal subroutine. Therefore, for safetys sake, you should use the names UADD1.F through UADD5.F.
Note: Up to 9 different over time optimization objective

functions can be incorporated in NETOPT. Only one may be used per problem run. FUNOBJ1 refers to the first, FUNOBJ2 refers to the second, and so on, up to FUNOBJ9. You may select which objective function should be used via the OBJFUNCTION keyword on the OPTPARAMETER statement. Any new routines must be compiled and a new NETOPT executable generated.

Example: Objective Function is Electricity Generated


The FUNOBJ1 and UADD1 subroutines are written to compute the generated electricity at source 4. The calling sequence is:
CALL FUNOBJ1(IMODE,NUMBOBJ,VPOBJE,VPTARG,VPCOEF,F)

where VPOBJE(1) = mass flowrate at source 4 VPOBJE(2) = enthalpy at source 4 The unit efficiency is a function of the mass flowrate and the enthalpy and is calculated in the subroutine UADD1. The subroutine FUNOBJ1 could be written as follows:
SUBROUTINE FUNOBJ1(IMODE,NUMBOBJ,VPOBJE,VPTARG,VPCOEF,F) C This subroutine is used to set up the C objective function for the optimization run. C C Common Declarations C INCLUDE ../../cmns/precis.cmn INCLUDE ../../cmns/kcons.cmn INCLUDE ../../cmns/param.cmn INCLUDE ../../cmns/cobje.cmn INCLUDE ../../cmns/cobje1.cmn C

PIPEPHASE 9.6 NETOPT Users Guide

3-19

Local Declarations REAL VPOBJE(NMAXO) C C C Calculation of objective function begins here C X1=VPOBJE(1) X2=VPOBJE(2) CALL UADD1(X1,X2,ELEC) F=ELEC RETURN END

Optimizing Over time


To implement the user-added subroutines when optimizing over time, you must interface with the subroutine FNTOBJ1(VPOBJ,OBJF,DELTAT) found in the file FNTOBJ1.F. VPOBJ(I,J) is an input vector of NETOPT variables which is used to compute the objective function. The NETOPT variables contained in VPOBJ are determined by the variables you define on the OBJECTIVE statement.
Note: The over time objective function cannot be defined by the Calculator unit.

The first variable you declare for the first time step becomes VPOBJ(1, 1), the second variable you declare for the first time step becomes VPOBJ(2, 1), the first variable you declare for the second time step becomes VPOBJ(1, 2), etc. OBJF is the value of the objective function, while DELTAT(J) is the Jth time step size in days.
Note: You may compute all of the terms in the objective function

in the subroutine FNTOBJ1, or you may utilize other subroutines you have written. Any new routines must be compiled and a new NETOPT executable generated. The name of your external subroutine must not correspond to the name of an existing NETOPT internal subroutine. Therefore, for safety sake, you should use the names UADD1.F through UADD5.F.
Note: Up to 9 different over time optimization objective

functions can be incorporated in NETOPT. Only one may be used per problem run. FNTOBJ1 refers to the first, FNTOBJ2 refers to the second, and so on, up to FNTOBJ9. You may select which objective function should be used via the OBJFUNCTION keyword on the OPTPARAMETER statement.

3-20

Optimization Input Reference

Other common block input variables are used to apply time discount factors to objective variables, supply time curves or objective variable coefficients, or specify the time when capital costs are incurred. These input variables are shown below:
VARIABLE CAPTIM(J) COEFFO(J) TIMES(JT) IMODE TYPE REAL REAL REAL COMMON COBJE COBJE COVRT2 DESCRIPTION Time when Capital cost is incurred (days) User specified Constant Coefficient of the objective variable TIME in days for jth time step Runmode flag.. =1..Simulation =2..Parameter estimation optimization Number of time steps in the problem Number of objective variables in the problem Input unit index of the objective variable Input unit of the objective variable =1 use incremental change in the objective variable over time for the Objective function calculation Flag to indicate if over time objective variable or not = .TRUE. yes = .FALSE. no Flag to indicate if the curve is to be applied as a Ramp function Flag to indicate if the TIME DISCOUNT factor is to be applied on the Jth objective variable Name of Time curve to be applied to calculate time dependent Objective variable Coeff

INTEGER COPTN

=3..Optimization INTEGER COVRTIM NQTIM NUMOBJ INTEGER COBJE IDXOBJ(J) IUOBJ(J) INCFLG(J) INTEGER COBJE INTEGER COBJE INTEGER CDECI

IKOVTM(J)

LOGICAL COBJE

IRAMP(J) IDISC(J)

LOGICAL COBJE LOGICAL COBJE

TCURV(J)

CHAR*12 COBJE

PIPEPHASE 9.6 NETOPT Users Guide

3-21

Time-stepping Data Category of Input


Please refer Chapter 4, Input Reference in PIPEPHASE 9.6 Keyword Manual.

Case Study Data Category of Input


Please refer Chapter 4, Input Reference in PIPEPHASE 9.6 Keyword Manual.

3-22

Optimization Input Reference

Chapter 4 Examples
Overview
This chapter contains examples of the use of NETOPT and illustrates many of the features of the program. It is not possible to include every program option in the examples and a list of the features which appear in each example is given in an easy-to-read tabular format in Table 4-1 . This is where to look if you are looking for an example which contains a specific feature. The chapter then details the example simulations. Each example is comprised of four sections:

Problem Description - This section outlines the goals of the sim-

ulation, as well as presenting some of the important problem parameters.

Simulation Techniques - This section describes how the example is translated into the NETOPT input data. Input Data - The full keyword input data file is listed in this sec-

tion.

Output - For clarity, the full output reports are not presented

here. Instead, the link and node summaries are shown along with selected reports which are particularly relevant to the simulation goals given in the Problem Description.

PIPEPHASE 9.6 NETOPT Users Guide

4-1

Table 4-1: Features Used in Example Simulations Statement Feature Example Number 1 General Data Category of Input
Pipeline Well CALCULATION Network PVT generation Blackoil Gas SEGMENT PRINT Horizontal and vertical Optimization

1 2

Methods Data Category of Input


SOLUTION Pbalance method

PVT Data Category of Input


SET Gravity Contaminants Specific heat LIFTGAS Gravity

Structure Data Category of Input


SOURCE SINK Set number, pressure/rate, temperature Rate estimate Fixed pressure PIPE Length/ID Heat transfer parameters TUBING Length, depth Detailed heat transfer GAS LIFT VALVE Rate

Unit Operation Data Category of Input


CALCULATOR Results calculated

Optimization Data Category of Input


OBJECTIVE Maximization Minimization DECISION Pipe ID

Compressor power Gas valve rate

4-2

Examples

Table 4-1: Features Used in Example Simulations Statement


CONSTRAINT

Feature
Sink pressure Compressor pressure Calculator result

Example Number

OPTPARAMETER Number of iterations Tolerances

Example 1 - Optimization of an Offshore Pipeline System Design


Problem Description
In this simulation, a pipeline is designed to deliver gas at a rate of 1200 MM SCF/D at a minimum pressure of 900 psia from two offshore fields. The first field is 200 miles offshore and the second is an additional 180 miles further offshore. For both platforms, the average well-head pressure of the produced gas is 2000 psia. You are required to optimize the design to minimize the total costs involved in constructing the system and operating it over a 10 year period. The major capital costs involved are for laying pipe ($0.7MM/inch ID per mile of pipe) and installing compressor capacity ($0.66MM per 1000 hp). The cost of operating the pipeline is approximately $0.4MM/year per 1000 hp.
Figure 4-1: Pipeline System

PIPEPHASE 9.6 NETOPT Users Guide

4-3

Simulation Techniques
A single phase gas optimization calculation is used. Two PVT data sets one for each source are defined with different specific gravity and contaminant levels. The overall objective function is:
Total Cost (Capital+Operating Cost) = 140*IDPipe 1 + 126*IDPipe 2 + 4.66E-3*wCompr 1 + 4.66E-3*wCompr 2

There are four decision variables for this optimization problem the internal diameters of both pipes (24- 40 range) and the power for both compressors (0 - 50000 hp). There are three constraints for this optimization problem the sink pressure (P > 900 psia), and the outlet pressures of the compressors (0 psia < P < 2475 psia).

Input Data
$ General Data Section $ TITLE PROBLEM=TUTORIAL, USER=SIMSCI, DATE=12/06/96, * SITE=SIMS $ DESCRIPTION Tutorial problem $ DIMENSION RATE(GV)=CFD $ CALCULATION NETWORK, Gas, OPTIMIZATION, * PRANDTL $ DEFAULT IDPIPE=4.026, IDTUBING=4.026, IDRISER=4.026, * IDANNULUS=6.065 $ PRINT INPUT=NONE, DEVICE=FULL, FLASH=NONE, * DATABASE=FULL, SIMULATOR=PART $ SEGMENT AUTO=ON, DLHORIZ(FT)=2000, DLVERT(FT)=500 $ $ Network Data Section $ NETWORK DATA $ SOLUTION PBALANCE, FLOWAL=2 $ TOLERANCE PRESSURE=0.01 $ $ PVT Data Section $ PVT PROPERTY DATA $ SET SETNO=1, GRAV(SPGR)=0.69, CPRATIO=1.3, * CONT=1.32, 0.98, 0.56 SET SETNO=2, GRAV(SPGR)=0.701, CPRATIO=1.3, * CONT=1.11, 0.88, 0.24 $ $ Structure Data Section $ STRUCTURE DATA $ SOURCE NAME=S001, IDNAME=S001, PRIORITY=0, * SETNO=1, PRES=2000, TEMP=80, * RATE(ESTI)=600, XCORD=52, YCORD=-241 $

4-4

Examples

SOURCE NAME=S002, IDNAME=S002, PRIORITY=0, * SETNO=2, PRES=2000, TEMP=80, * RATE(ESTI)=600, XCORD=0, YCORD=249 $ SINK NAME=D003, IDNAME=D003, PRES(ESTI)=900, * RATE=1200, XCORD=500, YCORD=-363 $ JUNCTION NAME=J004, IDNAME=J004, XCORD=279, * YCORD=-95 $ LINK NAME=L001, FROM=S001, TO=J004, * IDNAME=L001, IDFROM=S001, IDTO=J004, * PRINT PIPE NAME=E001, LENGTH=1056, NOMD=8, * SCHED= 40, WATER, TAMB=45 $ LINK NAME=L002, FROM=S002, TO=J004, * IDNAME=L002, IDFROM=S002, IDTO=J004, * PRINT PIPE NAME=E002, LENGTH=6504e+005, ID=24, * WATER, TAMB=45 COMPRESSOR NAME=E003, POWER=20000, EFF=80 $ LINK NAME=L003, FROM=J004, TO=D003, * IDNAME=L003, IDFROM=J004, IDTO=D003, * PRINT PIPE NAME=E004, LENGTH=1.056e+006, ID=35, * WATER, TAMB=45 COMPRESSOR NAME=E005, POWER=25000, EFF=80 $ $ OPTIMIZATION Data Section $ OPTIMIZATION DATA OBJECTIVE PIPE=E004, VARIABLE=ID, COEF=140 OBJECTIVE COMPRESSOR=E005, VARIABLE=POWE, COEF=4.660e-003 OBJECTIVE COMPRESSOR=E003, VARIABLE=POWE, COEF=4.660e-003 OBJECTIVE PIPE=E002, VARIABLE=ID, COEF=126 DECISION PIPE=E004, VARIABLE=ID, PERTURB=5.000e-003, * MLOWER=24, MUPPER=48 DECISION COMPRESSOR=E003, VARIABLE=POWE, PERTURB=1.000e-003, * MLOWER=0, MUPPER=50000 DECISION PIPE=E002, VARIABLE=ID, PERTURB=5.000e-003, * MLOWER=24, MUPPER=48 DECISION COMPRESSOR=E005, VARIABLE=POWE, PERTURB=1.000e-003, * MLOWER=0, MUPPER=50000 CONSTRAINT SINK=D003, VARIABLE=PRES, MLOWER=900 CONSTRAINT COMPRESSOR=E003, VARIABLE=CPRE, MLOWER=0, * MUPPER=2475 CONSTRAINT COMPRESSOR=E005, VARIABLE=CPRE, MLOWER=0, * MUPPER=2475 OPTPARAMETER MINIMIZE, ITER=30, SCALE, * DAMP=5, OBJTOL=1.000e-004, VARTOL=1.000e-003, * ERTOL=-0.01, DEFPERT=0.04 $ $ End of OPTIMIZATION Data Section $ $ End of keyword file... $ END

PIPEPHASE 9.6 NETOPT Users Guide

4-5

Output
(Optimizer Report)
OPTIMIZATION REPORT AT BEST POINT DECISION VARIABLES -----------------LOWER CURRENT UPPER MOVE SHADOW BOUND VALUE BOUND PRICE ---- ------------ --------- --------- --------- --------- --------E004 PIPE ID 24.0000 32.9474 48.0000 -2.0526 0.000E+00 E003 SET POWER 0.000E+00 18366.76 50000.00 -1633.24 0.000E+00 E002 PIPE ID 24.0000 24.0000 48.0000 0.000E+00 -48.7187 E005 SET POWER 0.000E+00 15949.10 50000.00 -9050.90 0.000E+00 CONSTRAINT VARIABLES -------------------LOWER CURRENT UPPER MOVE SHADOW BOUND VALUE BOUND PRICE UNITS ---- ------------ --------- --------- --------- --------- --------- ---------D003 PRESSURE 900.00 899.87 5985.30 -923.03 -0.2911 PSIG E003 OUTLET PRES 0.000E+00 1746.17 2475.00 -5.3257 0.000E+00 PSIG E005 OUTLET PRES 0.000E+00 899.87 2475.00 -923.03 0.000E+00 PSIG OBJECTIVE VARIABLES ------------------NAME TYPE VALUE UNITS ---- ------------ --------- ---------E004 PIPE ID 32.9474 IN E005 SET POWER 15949.10 HP E003 SET POWER 18366.76 HP E002 PIPE ID 24.0000 IN OBJECTIVE FUNCTION -----------------CURRENT VALUE OF OBJECTIVE FUNCTION = CHANGE FROM VALUE AT START = 7796.55 -337.15 NAME TYPE NAME VARIABLE UNITS ---------IN HP IN HP (Base Case)

The results show that the total costs of building and operating the pipeline over a 10 year period is $7,796.55 MM (including $159.9 MM in total operating costs).

4-6

Examples

Example 2 - Two Well Gas Lift Optimization


Problem Description
A 1500 ft, 4-inch flowline connects two wells to a separator operating at 250 psig. Gas lift is applied to both wells. For a single well on gas lift, the increased back-pressure from the injection gas affects other wells that share a common flowline. If any of the other wells are also on gas lift, it in turn contributes to an overall increase in back pressure. As such, a single-well gas lift analysis performed in isolation will over-predict production. The actual optimal injection rate will be influenced by the interacting wells, and will be lower than that predicted by single-well analysis. An additional optimization problem relates to the availability of injection gas. Typically, due to existing installed compressor capacity, the gas available for injection is inadequate to meet the needs of all the wells in the field. This limitation becomes more severe with time, as the field depletes, and more and more wells require increasing amounts of injection gas. The associated allocation problem is therefore to determine the amount of gas to allocate to each of the wells under of gas lift in order to maximize the total production rate from the field. You must first perform an initial analysis to determine the maximum production from the two wells (based on unlimited gas). In a second analysis you must determine the optimal gas allocation between the two wells (based on the available gas being limited to 3 MMSCFD).
Figure 4-2: Two Well Gas Lift Optimization

PIPEPHASE 9.6 NETOPT Users Guide

4-7

Simulation Techniques
A blackoil optimization calculation is used. In this problem, the reservoir temperature is 180 deg F, and the produced oil is of 30 deg API. The gas gravity (air =1) in the well is 0.75, while the lift gas gravity is 0.8. The Productivity Index (PI) IPR device model is used to model the relationship between the flowrate of oil from each well and the well pressure drop. The overall objective function is the flowrate of oil to sink D002. There are two decision variables the rate of lift gas for both wells. For the first analysis, there is no constraint on the lift gas. For the second analysis, there is a constraint on the lift gas rate. In this analysis, a calculator unit is used to determine the total lift gas to both wells and this result, R(1), is constrained to an upper limit of 3 MMSCFD.

Input Data
(Unlimited Injection Gas)
TITLE DATE=10/28/96 $ DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION $ DIMENSION RATE(LV)=BPD $ PRINT INPUT=NONE , DEVICE=NONE , FLASH=NONE , * CONNECT=NONE , DATABASE=FULL , SIMULATOR=SUMMARY , * OPTIMIZER=FULL $ CALCULATION NETWORK, BLACKOIL , OPTIMIZATION, * PRANDTL $ DEFAULT NOMD=4, SCHE= 40, NOMT=4, * SCHT=TB01, IDRISER=4.026, IDANNULUS=6.065 $ SEGMENT AUTO=ON, DLHORIZ(FT)=2000, DLVERT(FT)=500 $ $ Network Data Section $ NETWORK DATA $ SOLUTION PBALANCE, FLOWAL=2, MAXITER=30 $ $ PVT Data Section $ PVT PROPERTY DATA $ SET SETNO=1, GRAV(OIL,API)=30, GRAV(GAS,SPGR)=0.75, * GRAV(WATER,SPGR)=1.002 LIFTGAS GRAV(GAS,SPGR)=0.8 $ $ OPTIMIZATION Data Section $ OPTIMIZATION DATA OBJECTIVE SINK=D002, VARIABLE=RATE(LV,OIL), COEF=1 DECISION GLVALVE=E011, VARIABLE=RATE, MLOWER=0.5, * MUPPER=5

4-8

Examples

DECISION GLVALVE=E010, VARIABLE=RATE, MLOWER=0.5, * MUPPER=5 OPTPARAMETER MAXIMIZE, ITER=15, SCALE, * OBJTOL=1.000e-004, VARTOL=.005, DEFPERT=0.05 $ $ End of OPTIMIZATION Data Section $ $ Structure Data Section $ STRUCTURE DATA $ SOURCE NAME=S001, SETNO=1, PRES=2499, * TEMP=180, RATE(ESTI)=6000, GOR=108, * WCUT=0, XCORD=-92, YCORD=495 $ SOURCE NAME=S005, SETNO=1, PRES=2505, * TEMP=181, RATE(ESTI)=6000, GOR=102, * WCUT=10.5, XCORD=468, YCORD=524 $ SINK NAME=D002, PRES=250, RATE(ESTI)=10000, * XCORD=1267, YCORD=35 $ JUNCTION NAME=J003, XCORD=284, YCORD=68 $ LINK NAME=L001, FROM=S001, TO=J003 IPR NAME=E012, TYPE=PI, * IVAL=BASIS, 3, * RVAL=PI, 25.5 TUBING NAME=E001, LENGTH=8010, DEPTH=8010, * U=1 GLVALVE NAME=E011, RATE=1.5 TUBING NAME=E009, LENGTH=6810, DEPTH=6810, * U=1 PIPE NAME=E003, LENGTH=231, U=1 $ LINK NAME=L002, FROM=S005, TO=J003 IPR NAME=E013, TYPE=PI, * IVAL=BASIS, 3, * RVAL=PI, 22.1 TUBING NAME=E004, LENGTH=8111, DEPTH=8111, * U=1 GLVALVE NAME=E010, RATE=1.5 TUBING NAME=E008, LENGTH=6445, DEPTH=6445, * U=1 PIPE NAME=E006, LENGTH=103, U=1 $ LINK NAME=L003, FROM=J003, TO=D002 PIPE NAME=E007, LENGTH=1500, U=1 $ $ END

(Limited Injection Gas)


TITLE DATE=10/28/96 $ DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION $ DIMENSION RATE(LV)=BPD $ PRINT INPUT=NONE , DEVICE=NONE CONNECT=NONE , DATABASE=FULL OPTIMIZER=FULL $ CALCULATION NETWORK, BLACKOIL PRANDTL $ DEFAULT NOMD=4, SCHE= 40, NOMT=4, *

, FLASH=NONE , * , SIMULATOR=SUMMARY , * , OPTIMIZATION, *

PIPEPHASE 9.6 NETOPT Users Guide

4-9

SCHT=TB01, IDRISER=4.026, IDANNULUS=6.065 $ SEGMENT AUTO=ON, DLHORIZ(FT)=2000, DLVERT(FT)=500 $ $ Network Data Section $ NETWORK DATA $ SOLUTION PBALANCE, FLOWAL=2 $ $ PVT Data Section $ PVT PROPERTY DATA $ SET SETNO=1, GRAV(OIL,API)=30, GRAV(GAS,SPGR)=0.75, * GRAV(WATER,SPGR)=1.002 LIFTGAS GRAV(GAS,SPGR)=0.8 $ $ OPTIMIZATION Data Section $ OPTIMIZATION DATA OBJECTIVE SINK=D002, VARIABLE=RATE(LV,OIL), COEF=1 DECISION GLVALVE=E011, VARIABLE=RATE, MLOWER=0.5, * MUPPER=5 DECISION GLVALVE=E010, VARIABLE=RATE, MLOWER=0.5, * MUPPER=5 CONSTRAINT CALC=SUM, VARIABLE=R(1), MLOWER=0, * MUPPER=3 OPTPARAMETER MAXIMIZE, ITER=15, SCALE, * OBJTOL=1.000e-004, VARTOL=1.000e-004, DEFPERT=0.05 $ $ End of OPTIMIZATION Data Section $ $ Structure Data Section $ STRUCTURE DATA $ SOURCE NAME=S001, SETNO=1, PRES=2499, * TEMP=180, RATE(ESTI)=6000, GOR=108, * WCUT=0, XCORD=-90, YCORD=487 $ SOURCE NAME=S005, SETNO=1, PRES=2505, * TEMP=181, RATE(ESTI)=6000, GOR=102, * WCUT=10.5, XCORD=468, YCORD=524 $ SINK NAME=D002, PRES=250, RATE(ESTI)=10000, * XCORD=1267, YCORD=35 $ JUNCTION NAME=J003, XCORD=284, YCORD=68 $ LINK NAME=L001, FROM=S001, TO=J003 IPR NAME=E012, TYPE=PI, * IVAL=BASIS, 3, * RVAL=PI, 25.5 TUBING NAME=E001, LENGTH=8010, DEPTH=8010, * U=1 GLVALVE NAME=E011, RATE=1.5 TUBING NAME=E009, LENGTH=6810, DEPTH=6810, * U=1 PIPE NAME=E003, LENGTH=231, U=1 $ LINK NAME=L002, FROM=S005, TO=J003 IPR NAME=E013, TYPE=PI, * IVAL=BASIS, 3, * RVAL=PI, 22.1 TUBING NAME=E004, LENGTH=8111, DEPTH=8111, * U=1 GLVALVE NAME=E010, RATE=1.5 TUBING NAME=E008, LENGTH=6445, DEPTH=6445, * U=1 PIPE NAME=E006, LENGTH=103, U=1 $

4-10

Examples

LINK NAME=L003, FROM=J003, TO=D002 PIPE NAME=E007, LENGTH=1500, U=1 $ $ UNIT OPERATION Data Section $ UNIT OPERATION DATA $ CALCULATOR UID=SUM DIMENSION P(2), C(1), R(1), * IS(1), IX(1), V(1) RESULT 1,R1 DEFINE P(1) AS GLVA=E011, RATE DEFINE P(2) AS GLVA=E010, RATE PROCEDURE $PROCFILE=SUM $ enter code here ... R1=p(1)+p(2) RETURN $ END

Output
(Unlimited Injection Gas)
OPTIMIZATION REPORT AT BEST POINT DECISION VARIABLES NAME VARIABLE LOWER CURRENT UPPER BOUND VALUE BOUND - - - - - E011 GV RATE .5000 3.6158 5.0000 E010 GV RATE .5000 3.5591 5.0000 CONSTRAINT VARIABLES NO CONSTRAINT VARIABLES OBJECTIVE VARIABLES NAME TYPE VALUE UNITS - D002 BO OIL RATE 7340.64 SBPD OBJECTIVE FUNCTION CURRENT VALUE OF OBJECTIVE FUNCTION = CHANGE FROM VALUE AT START = 7340.6429 950.0822 MOVE 2.1158 2.0591 SHADOW PRICE UNITS

-.0160 MM SCF/D .000E+00 MM SCF/D

(Limited Injection Gas)


OPTIMIZATION REPORT AT BEST POINT DECISION VARIABLES NAME VARIABLE LOWER CURRENT UPPER BOUND VALUE BOUND - - - - - E011 GV RATE .5000 1.6885 5.0000 E010 GV RATE .5000 1.3115 5.0000 MOVE .1885 -.1885 SHADOW PRICE UNITS

.000E+00 MM SCF/D -.0355 MM SCF/D

PIPEPHASE 9.6 NETOPT Users Guide

4-11

CONSTRAINT VARIABLES NAME TYPE LOWER CURRENT UPPER MOVE BOUND VALUE BOUND - - - - - SUM RESULT 1 .000E+00 3.0000 3.0000 -.444E-15 OBJECTIVE VARIABLES NAME TYPE VALUE UNITS - D002 BO OIL RATE 6404.20 SBPD OBJECTIVE FUNCTION CURRENT VALUE OF OBJECTIVE FUNCTION = CHANGE FROM VALUE AT START = 6404.2001 13.639377 SHADOW PRICE 14.1077 UNITS

For unlimited injection gas, NETOPT determines the optimal solution to be 4120 BOPD and 3215 BOPD for wells A and B respectively (for a total of 7335 BOPD), at corresponding gas injection rates of 3.616 MMSCFD and 3.559 MMSCFD. When the available injection gas is limited to 3.0 MMSCFD, the optimal allocation rates are 1.689 MMSCFD and 1.311 MMSCFD for wells A and B respectively, with corresponding production rates of 3789 BOPD and 2613 BOP, for a total of 6402 BOPD.

4-12

Examples

Chapter 5 Accessing NETOPT Data


There are currently three classes of subroutines used to transfer data to and from NETOPT. The call statements and subroutine arguments for these routines are documented in the following sections.

PPDATR Subroutine
Typical Syntax
SUBROUTINE PPDATR(IFLAG, ITYPE, ATTRIB, ITEM, IDITEM, NAMCMP, RBUFF, IBUFF, KUOM, IUOM, IRCODE, JLINK)

The PPDATR subroutine is used to move NETOPT data into or out of the network simulator according to the type/attribute/item requested. The output string(s) are placed in the buffer. Be sure the buffer is adequate to store the output returns size and count retrieved.
Table 6-1: Variables In Argument List
NAME IFLAG ITYPE ATTRIB ITEM KUOM TYPE Integer Integer Character Character Integer I/O I I I I I 1 for get 2 for put Type of node or device (i.e. 2 for pipe) Attribute type (string - i.e. "pipe ID") Item identifier (string - i.e. "pipe1") Flag for UOM base desired (luint - lualt)

PIPEPHASE 9.6 NETOPT Users Guide

5-1

Definition of ITYPE and Attribute Labels


The variable ITYPE identifies the node or device type. The attribute label defines the variable to be accessed. The variables that can be sent to NETOPT are limited to those listed in Table 6-1.
Table 6-2: Definition of ITYPE and Attribute Labels ITYPE Description Attribute Label
Source, Sink, 1 and Junction RATE(M) RATE(WT) RATE(LV) RATE(GV) TEMPERATURE PRESSURE GOR WATER CUT CGR WGR QUALITY BO OIL RATEBO GAS RATEBO H2O RATEBO LIQ RATE GAS VISC OIL VISC WAT VISC OIL GRAVITY GAS GRAVITY WATER GRAVITY COND GRAVITY GAS FRACTION LIQ FRACTION GAS MW OIL MW WAT MW TOTAL ENTH CND OIL RATE CND GAS RATE CND H2O RATE CND LIQ RATE STEAM RATE OIL RATE CMP GAS RATE CMP H2O RATE CMP LIQ RATE CMP COMP(M) FEED(M) COMP(WT) Molar rate Weight rate Liquid volumetric rate Gas volumetric rate Temperature Pressure Gas-oil ratio Water cut Condensate gas ratio Water gas ratio Quality Blackoil oil rate Blackoil gas rate Blackoil water rate Blackoil liquid rate Gas viscosity Oil viscosity Water viscosity Oil gravity Gas gravity Water gravity Condensate gravity Gas fraction Liquid fraction Gas molecular weight Oil molecular weight Water molecular weight Total enthalpy Condensate oil rate Condensate gas rate Condensate water rate Condensate liquid rate Steam rate Oil rate for compositional model Gas rate for compositional model Water rate for compositional model Liquid rate for compositional model Molar composition Molar feed rate Weight composition

5-2

Accessing NETOPT Data

Table 6-2: Definition of ITYPE and Attribute Labels (Continued) ITYPE Description Attribute Label
FEED(WT) Pipes 2 PIPE ID BURIAL DEPTH PIPE THICKNS INS THICKNS U PIPE PIPE LENGTH PIPE COND H INSIDE H OUTSIDE H INS COND FLOWEFF AMBIENT TEMP ROUGHNESS PIPE ELEV SOIL COND PIPE DP OIL FLOWRATE GAS FLOWRATE WAT FLOWRATE TOT FLOWRATE T HYDRATE DT HYDRATE P HYDRATE DP HYDRATE FLOW CODE TUBE ID U TUBE TVD(TO TOP) TVD (DEPTH) MWD (TO TOP) MWD (LENGTH) FLOW EFF ROUGHNESS GEO TGRAD FLOW AREA BTM HOLE P TUBING DP OIL FLOWRATE GAS FLOWRATE WAT FLOWRATE TOT FLOWRATE T HYDRATE DT HYDRATE P HYDRATE Weight feed rate Pipe inside diameter Burial depth Pipe thickness Insulation thickness U Value Pipe length Pipe conductivity Inside H Effective outside H Inside conductivity Flow efficiency Ambient temperature Absolute roughness Pipe elevation Soil conductivity Pressure drop Oil flowrate Gas flowrate Water flowrate Total flowrate Hydrate formation temperature * Hydrate formation DT * Hydrate formation pressure * Hydrate formation DP * Flow code Tube inside diameter U Value True vertical drop (to top) True vertical drop (depth) Measured wireline depth (length) Measured wireline depth (length) Flow efficiency Absolute roughness Geothermal temperature gradient Flow area Bottom hole pressure Pressure drop Oil flowrate Gas flowrate Water flowrate Total flowrate Hydrate formation temperature * Hydrate formation DT * Hydrate formation pressure *

Tubing

PIPEPHASE 9.6 NETOPT Users Guide

5-3

Table 6-2: Definition of ITYPE and Attribute Labels (Continued) ITYPE Description Attribute Label
DP HYDRATE FLOW CODE Riser 4 RISER ID U RISER RISER LENGTH RISER ELEV FLOW EFF ROUGHNESS FLOW AREA RISER DP FLOW CODE ANNULUS ID U ANNULUS TVD (DEPTH) MWD (LENGTH) FLOW EFF ROUGHNESS GEO TGRAD FLOW AREA BTM HOLE P ANNULUS DP FLOW CODE CHOKE ID COEFF CHOKE DP CHK POUTLET CHK PSUCTION CHK RATE(M) CHK RATE (WT) CHK RATE (LV) CHK RATE (GV) CHK OIL RATE CHK GAS RATE CHK H2O RATE CHK LIQ RATE SET POWER SET PRESSURE MAX POWER MAX PRESSURE STAGES MEAS DEPTH VERT DEPTH PUMP EFF RPM Hydrate formation DP * Flow code Riser inside diameter U value Riser length Riser elevation Flow efficiency Absolute roughness Flow area Pressure drop Flow code Annulus inside diameter U value True vertical depth Measured wireline depth Flow efficiency Absolute roughness Geothermal temperature gradient Flow area Bottom hole pressure Pressure drop Flowcode Choke inside diameter Coefficient Pressure drop Outlet pressure Suction pressure Molar rate Weight rate Liquid volumetric rate Gas volumetric rate Oil rate Gas rate Water rate Liquid rate Set power Set Pressure Maximum power Maximum pressure Number of stages Measured depth Vertical depth Pump efficiency Revolutions per minute (RPM)

Annulus

Choke

Pump

5-4

Accessing NETOPT Data

Table 6-2: Definition of ITYPE and Attribute Labels (Continued) ITYPE Description Attribute Label
MAX RPM PUMP DP REQ POWER OUTLET PRES Compressor 8 SET POWER SET PRESSURE MAX POWER MAX PRESSURE STAGES MEAS DEPTH VERT DEPTH COMPR EFF RPM MAX RPM COMPR DP REQ POWER OUTLET PRES SET DUTY SET TEMP OUT COOLER DP COEF EXPONENT REQ DUTY OUTLET TEMP SET DUTY SET TEMP OUT HEATER DP COEF EXPONENT REQ DUTY OUTLET TEMP GV RATE DISSOLVE REG PRESSURE REG DP REG PSUCTION REG RATE(M) REG RATE(WT) REG RATE(LV) REG RATE(GV) REG OIL RATE REG GAS RATE REG H20 RATE REG LIQ RATE Maximum RPM Pressure drop Required power Outlet pressure Set power Set Pressure Maximum power Maximum pressure Number of stages Measured depth Vertical depth Pump efficiency Revolutions per minute (RPM) Maximum RPM Pressure drop Required power Outlet pressure Set duty Set outlet temperature Pressure drop Coefficient Exponent Required duty Outlet temperature Set duty Set outlet temperature Pressure drop Coefficient Exponent Required duty Outlet temperature Gas volumetric rate Dissolved gas rate Pressure Pressure drop Suction Pressure Molar rate Weight rate Liquid volumetric rate Gas volumetric rate Oil rate Gas rate Water rate Liquid rate

Cooler

Heater

10

Gas Lift Valve Regulator

12 16

PIPEPHASE 9.6 NETOPT Users Guide

5-5

Table 6-2: Definition of ITYPE and Attribute Labels (Continued) ITYPE Description Attribute Label
Separator 18 SET GAS RATE SET LIQ RATE SET OIL RATE SET H2O RATE GAS PERCENT LIQ PERCENT OIL PERCENT H20 PERCENT GAS RATE LIQ RATE OIL RATE H20 RATE TUNNEL LNGTH PERF DIS HOT DENSITY THICKNESS PENE LENGTH COMPL DP Set gas rate Set liquid rate Set oil rate Set water rate Gas percent Liquid percent Oil percent Water percent Gas rate Liquid rate Oil rate Water rate Tunnel length Perforation diameter Shot density Thickness Penetration depth Length Pressure Drop

Completions

19

IPR Devices

20

Any label specified by the model. You may user you own user-added label or refer to the NETOPT Keyword Manual for a list of the available models.

* For compositional systems only.

Unit Class Definitions using KUOM


A list of the unit classes, with corresponding variable, is provided below.
Table 6-3: KUOM Class Definitions
UNIT CLASS 1 2 3 4 5 6 7 8 9 10 11 12 13 VARIABLE Molar rate Weight rate Standard liquid volume rate Standard gas volume rate Actual liquid volume rate Actual gas volume rate Temperature Temperature change Pressure Pressure change Length (coarse) Length (fine) Density/Gravity (liquid only)

5-6

Accessing NETOPT Data

Table 6-3: KUOM Class Definitions


UNIT CLASS 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 VARIABLE Duty Thermal conductivity Viscosity Specific heat Heat transfer coefficient Work Roughness Differential head Permeability Gas-oil ratio Liquid-gas ratio Formation volume factor Productivity index Heating value Fekovich parameter Fraction Percent Inverse pressure Inverse length Phase angle Geothermal gradient Vapor gravity Area Productivity index (compositional) Productivity index (gas condensate) Velocity Standard liquid volumetric units Standard gas volumetric units Actual volumetric units Actual volumetric units (gas) Pressure gradient Surface tension

IPRSET Subroutine
Typical Syntax
SUBROUTINE IPRSET(KECLND,NAMES,VALUE,OLDVAL, NVAL,IERR)

The IPRSET subroutine sets RVAL parameters for the Inflow Performance Reservoir (IPR). IPRSET is called to set the IPR PI value in NETOPT equal to the value in the reservoir. It is also called to set the IPR parameter FWMAX when wells need to be shut off or on in

PIPEPHASE 9.6 NETOPT Users Guide

5-7

the NETOPT simulation. This depends on the reservoir simulator flowrate value of the well.
Table 6-4: IPRSET Input/Output Definitions
NAME INPUT: KECLND NAMES VALUE NVAR OUTPUT: IERR Description Well name from reservoir simulator (4 characters) Label names of variables IPR parameters in the same order as the NAMES Number of IPR parameters Error flag =1 first device is not an IPR device =2 could not find the link =3 could not find the node =4 could not find all label matches

NSFLAG Subroutine
Typical Syntax
SUBROUTINE NSFLAG(IFLAG,KOPTPR,KOITER, KKITER,KICASE, JJCONV)

This routine is always called before the NETOPT network simulation run and after the run by the OSCNV0 routine. NSFLAG is used to reset the convergence flags before the call to solve the network, and to get the status of these flags after the call is complete.
IFLAG =1 =2 for GET for PUT

5-8

Accessing NETOPT Data

Index
B
Basis measurement 3-5

I
Input categories comments continuing statements defaults keyword qualifiers keywords layout optimization data category units of measurement 3-1 3-4 3-6 3-4 3-3 3-2 3-6 3-8 3-5

C
Case study data category Categories of input case study data line sizing data optimization optimization data sensitivity analysis data time-stepping data Comments CONSTRAINT Continuing statements 3-2 3-1 3-2 3-2 3-1 3-8 3-2 3-2 3-4 3-12 3-6

K
Keyword input continuing statements conventions keywords layout qualifiers units of measurement Keywords optimization data 3-4 3-6 3-7 3-2 3-6 3-3 3-5 3-8

D
DECISION Decision variables Default data Documentation 3-11 3-11 3-4 1-ix

L
Legend for description 3-7 3-2 Line sizing data category

H
Help, online 1-ix

PIPEPHASE 9.6 NETOPT Users Guide

I-1

M
Measurement basis 3-5

optimization

3-13

Q
Qualifiers 3-3

N R
Nodal analysis data category 3-2 Reservoir Simulator Models 1-viii

O
OBJECTIVE Objective function Online documentation help OPTIMIZATION Optimization constraint data category decision variables keywords objective function options over time parameters variable list OPTPARAMETER 3-9 3-9 1-ix 1-ix 3-8 1-viii 3-12 3-1 3-11 3-8 3-9 3-13 3-11, 3-16 3-13 3-16 3-13

S
Sensitivity analysis data category 3-2

T
text comments Time-stepping data category 3-4 3-2

U
Units of measurement basis of measurement mulitiple dimensional units 3-5 3-5 3-6

V
Variable list for optimization Viewing and Plotting Results 3-16 2-30

P
Parameter

Index

I-2

Invensys Systems, Inc. 26561 Rancho Parkway South Lake Forest, CA 92630 United States of America http://iom.invensys.com

Global Customer Support Inside U.S.: 1-866-746-6477 Outside U.S.: 1-508-549-2424 or contact your local Invensys Representative. Email: iom.support@invensys.com Website: http://support.ips.invensys.com

Das könnte Ihnen auch gefallen