Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PIPEPHASE 9.1 NETOPT Users Guide The software described in this guide is furnished under a written
agreement and may be used only in accordance with the terms and conditions of the license agreement under which you obtained it.. The technical documentation is being delivered to you AS IS and Invensys Systems, Inc. makes no warranty as to its accuracy or use. Any use of the technical documentation or the information contained therein is at the risk of the user. Documentation may include technical or other inaccuracies or typographical errors. Invensys Systems, Inc. reserves the right to make changes without prior notice.
Copyright Notice
2006 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, broadcasting, or by any information storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Trademarks
PIPEPHASE, NETOPT, and Invensys SIMSCI-ESSCOR are trademarks of Invensys plc, its subsidiaries and affiliates. TACITE is a trademark of Institut Franais du Petrole (IFP). OLGAS 1.1, OLGAS TWO-PHASE, and OLGAS THREE-PHASE are trademarks of SCANDPOWER A/S. Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, Windows 2003, and MS-DOS are trademarks of Microsoft Corporation. Compaq Visual Fortran is a trademark of Compaq Computer Corporation. Adobe, Acrobat, Exchange and Reader are trademarks of Adobe Systems, Inc. All other products may be trademarks of their respective owners. U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND The Software and accompanying written materials are provided with restricted rights. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data And Computer Software clause at DFARS 252.227-7013 or in subparagraphs (c) (1) and (2) of the Commercial Computer Software-Restricted Rights clause at 48 C.F.R. 52.227-19, as applicable. The Contractor/ Manufacturer is: Invensys Systems, Inc. (Invensys SIMSCI-ESSCOR) 26561 Rancho Parkway South, Suite 100, Lake Forest, CA 92630, USA. Printed in the United States of America, March 2006.
Contents
Introduction
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii About PIPEPHASE 9.1 NETOPT . . . . . . . . . . . . . . . . . . . . . . . . . vii Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii Reservoir Simulator Models . . . . . . . . . . . . . . . . . . . . . . . . . .viii About SIMSCI - ESSCOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii Where to find additional help . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix Online Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix
Chapter 2 Tutorial
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1 Building the Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3 Entering Optimization Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19 Specifying Print Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-26 Running the Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27 Viewing and Plotting Results. . . . . . . . . . . . . . . . . . . . . . . . . . . .2-28 Using the RAS to Plot Results . . . . . . . . . . . . . . . . . . . . . . . . . . .2-29 Including Operating Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-32 PIPEPHASE 9.1 NETOPT Users Guide iii
Chapter 4 Examples
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Example 1 - Optimization of an Offshore Pipeline System Design . . . 4-3 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
iv
Contents
Parallel Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7 Using the NETOPT Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7 Running the NETOPT-Eclipse Interface . . . . . . . . . . . . . . . . .5-8 NETOPT-ECLIPSE Integration . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
Introduction
About This Manual
The PIPEPHASE 9.1 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 Chapter 6 Getting Started Tutorial Input Reference Examples Reservoir Simulation Interface Module 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. Describes in detail the Reservoir Simulation Interface Module.
Accessing NETOPT Data Explains how to access NETOPT Data using the subroutines.
vii
For example, consider a system of wells producing under gaslift, where the amount of gas available for injection is limited. NETOPT 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, Input Reference, Table 3-2.
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.
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.
ix
Introduction
Chapter 1-1
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 1, PIPEPHASE 9.1 Users 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.
Link to Reservoir Simulator Models
NETOPTs Reservoir Interface allows you to link the network simulator to link to Reservoir Simulation models such as the Eclipse reservoir simulation model. This integrated solution provides greater simulation accuracy, potentially resulting in savings of millions of dollars over the lifetime of a 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
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
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
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
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...
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.
Links
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
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 Riser
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.
Process Equipment
Compressor Simple single or multistage gas compressor.
Chapter 1-6
Getting Started
Description
Rigorous single or multistage gas compressor with optional inlet pressure calculation. Uses a special sub-networking method. 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.
Chapter 1-7
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...
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. Selecting times Supply a series of times. NETOPT will carry out simulations at each of those times.
IPR
IPR
Chapter 1-8
Getting Started
To specify...
Downstream network changes At each time you may specify one or more changes to the network or conditions downstream of the well.
See...
IPR
See...
Tubing
IPR Reservoir
See...
Chapter 1-9
Tubing
Tubing
IPR Reservoir
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
See...
Chapter 1-10
Getting Started
Subsurface junctions
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
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.1 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
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
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.
2-2
Tutorial
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\PPHASE91\USER directory. Type in TUTORIAL in the File Name data entry field as shown in Figure 2-2. Then, click the Open button.
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 .
2-3
Select the Network model Simulation Type. Click the Next button.
2-4
Tutorial
2-5
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
2-6
Tutorial
Click the OK button to continue. The Fluid Property Data window will appear as shown in Figure 2-8.
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:
2-7
Component
Nitrogen Carbon dioxide Hydrogen sulfide
Mole %
1.11 0.88 0.24
Click the OK button. The Fluid Property Data window will appear as shown in Figure 2-11.
2-8
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.
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.
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
Use the drop-down list boxes to select a Simulation Type of Network Model and a Fluid Type of Gas.
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
2-10
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:
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.
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
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 J004, S002 to J004, followed by J004 to D003. The flow diagram should now show the structure shown in Figure 2-17.
2-12
Tutorial
The next step is to enter the data for each of the sources and sinks. To enter the data for the source S001:
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.
2-13
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.
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.
Double-click on the node D003. The window should appear as shown in Figure 2-19.
Tutorial
2-14
Value
900 psig 1200 MMft3/day
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.
Double-click on the link L001. This brings up the Link <L001> Device Data window as shown in Figure 2-20.
2-15
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
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
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%
Click the Save button on the toolbar, or select the File/Save menu option.
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.
2-19
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
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/ Calculator Name 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.
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.
2-21
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
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. 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).
2-22
Tutorial
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 Available 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.
Figure 2-28: Network Optimization Data Window
2-23
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
Limits
P>900 psi 0 psi<P<2475 psi 0 psi<P<2475 psi
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/Calculator/
External Name 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). 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.
2-24
Tutorial
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.
Click the OK button to return to the Network Optimization Data window shown in Figure 2-31.
2-25
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.
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
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.
2-26
Tutorial
Click OK to return to the main PIPEPHASE window. Select the File/Save menu option to save the simulation data entered so far.
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.
2-27
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.
Figure 2-33: Run Simulation and View Results Window
2-28
Tutorial
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.
2-29
First, find and launch the RAS program. The main PIPEPHASE RAS window appears as shown in Figure 2-35.
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-30
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.
Click the View button to view the plot shown in Figure 2-37.
2-31
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-32
Tutorial
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.
2-33
Click the OK button to return to the Network Optimization Objective Parameters window. Repeat for the Correlation Coefficient for the Compressor E003 Available 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
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-34
Tutorial
2-35
2-36
Tutorial
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.
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.
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
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.
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
3-4
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.1 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.
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
3-6 Optimization Input Reference
DIMENSION TEMP= C
SI
LENGTH
FT,
&
However, you may not embed any blanks within your keywords or data entries.
UNDERLINE
LIGHT
()
3-7
=<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
3-8
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
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. See Table 3-3 for details.
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=
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-9
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.
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
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-10
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. See Table 3-3.
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.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-11
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=
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-12
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.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-13
OBJEFUNCTION
ITER=10
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:
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-14
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
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-15
LUDSAVE OVERTIME
The following table shows types and variables for CONSTRAINT, DECISION, and OBJECTIVE statements.
a NETOPT variable
or
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.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-16
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.
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.
or
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
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.
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
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
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
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) TYPE REAL COMMON COBJE 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
REAL REAL
COBJE COVRT2
INTEGER COPTN
=3..Optimization NQTIM INTEGER COVRTIM NUMOBJ INTEGER COBJE IDXOBJ(J) IUOBJ(J) INCFLG(J) INTEGER COBJE INTEGER COBJE INTEGER CDECI
IKOVTM(J)
LOGICAL COBJE
IRAMP(J) IDISC(J)
TCURV(J)
CHAR*12 COBJE
3-21
CHANGE
Mandatory statement. On each CHANGE statement enter the changes to be made to one device and the times at which the changes are to be effected. More than one change statement may be used. If you do not want to change a device but simply want to examine the effect of declining reservoir conditions with an unchanging network, simply enter one CHANGE statement with a series of times. Mandatory entries: TIME = The times, in days, at which the parameter(s) on this CHANGE statement are to be changed. A maximum of 20 times may be used in any one CHANGE statement. Use multiple change statements to specify more time steps.
Optional Entries: NAME= Name of the device whose parameters are to be changed. This is the name that appears on the statement in the base case. To be used in timestepping, the node or device must be given a unique name in the base case.
3-22
VALUE() = v1,v2,...
or
FEED=C1,C2,...
NOCHECK SETCALC =
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-23
CONUPPER
Example:
TIMESTEPPING CHANGE TIME=10, 20, 30, NAME=PIP1, ID=4.0, 3.5, 3.0 CHANGE TIME=15, 20, 25, NAME=PIP2, ID(IN)=8.0, 7.0, 6.0 CHANGE TIME=20,30, NAME=HTR3, DP=2, 3, DUTY=12, 10
CASESTUDY
Introduces the category. Each new case is headed by a CASE statement and there are no limits on the number of cases which can be entered in a simulation input. Mandatory entries:None. Optional entries: None. Optional statement. Allows you to enter a description of the simulation. You are restricted to one DESCRIPTION statement per case study. The information on this statement is printed once at the start of the case study output. Mandatory entries: None. Optional entries:Text string of up to 60 characters. Example:
DESC Change pipeline id to 3 inches
DESCRIPTION
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-24
PARAMETER
VARIABLE=
Optional entries:
NETWORK GLOBAL Change to be made for all devices in network; used with = ALL Change to be made for all devices in the network that meet a specified criteria; used with = ALL and OLD = value (or FCOLD for flow code changes). Changes to be made for all devices in the specified link; used with = ALL The new value to which you want the parameter changed. The new flow code when the parameter you want to change is FCODE. The new feed composition when the parameter you want to change is source FEED. Normalize the feed composition for source feed changes. The old value of the parameter from which you want to change when using a conditional global change. The old value of the flow code when the global parameter you want to change is FCODE.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-25
CONUPPER
Examples Case 1. Global variable change for pipes in network to 10 inch I.D.
PARAMETER PIPE=ALL, GLOBAL, VARIABLE=ID, VALUE= 10
Case 2. Flow code changes for tubing in network using the BBM correlation to the OLGA correlation.
PARAMETER TUBI=NAME, GLOBAL, VARIABLE=FCODE, FCOLD=BBM, FCODE=OLGA
Table 3-3: Types and Variables for Constraint, Decision, and Objective Functions. Available as a Type <device> Associated Variables <property> PRES RATE(WT) RATE(WT,GAS) RATE(WT,LIQ) RATE(WT,OIL) RATE(WT,WATE) FRAC(GAS) ENTH(TOTA) TEMP QUAL SCOMP
1 2
Variable Description
Constraint Variable X X X X X X X X X
Change Variable X X
Objective Parameter1 X X X X X X X X X X
SOURCE Compositional
Pressure Total Weight Rate Gas Weight Rate Liquid Weight Rate Liquid Hydrocarbon Weight Rate Water Weight Rate Volumetric Gas Fraction Total Enthalpy Temperature Quality (single component) Source Composition
X X X
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-26
SOURCE Blackoil
Pressure Oil/Water LV Rate Oil LV Rate Water LV Rate Gas GV Rate Volumetric Gas Fraction Temperature Total Rate (oil basis) Oil Gravity Water Gravity Gas Gravity Gas/Oil Ratio Water Cut Pressure Gas GV Rate Condensate LV Rate Water LV Rate Volumetric Gas Fraction Temperature Total Rate (gas basis) Gas Gravity Condensate Gravity Water Gravity Condensate Gas Ratio Water Gas Ratio Pressure Temperature Quality Weight Rate Steam Rate Volumetric Gas Fraction Total Enthalpy
SOURCE Steam
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-27
SOURCE Gas
Pressure Gas Volume Rate Temperature Gas Gravity Pressure Liquid Volume Rate Temperature Liquid Gravity Pressure Total Weight Rate Gas Weight Rate Liquid Weight Rate Volumetric Gas Fraction Total Enthalpy Temperature Pressure Oil/Water LV Rate Oil LV Rate Water LV Rate Gas GV Rate Volumetric Gas Fraction Temperature Total Rate (oil basis) Pressure Gas GV Rate Condensate LV Rate Water LV Rate Volumetric Gas Fraction Temperature Total Rate (gas basis)
SOURCE Liquid
X X
SINK Compositional
X X X X X X X X X X X X X X X X X X X
X X
SINK Blackoil
X X
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-28
SINK Steam
Pressure Temperature Quality Weight Rate Steam Rate Volumetric Gas Fraction Total Enthalpy Pressure Gas Volume Rate Temperature Pressure Liquid Volume Rate Temperature Pressure Total Weight Rate Gas Weight Rate Liquid Weight Rate Volumetric Gas Fraction Total Enthalpy Temperature Pressure Oil/Water LV Rate Oil LV Rate Water LV Rate Gas GV Rate Volumetric Gas Fraction Temperature Total Rate (oil basis)
X X X X
JUNCTION Blackoil
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-29
Pressure Gas GV Rate Condensate LV Rate Water LV Rate Volumetric Gas Fraction Temperature Total Rate (gas basis) Pressure Temperature Quality Weight Rate Steam Rate Volumetric Gas Fraction Total Enthalpy Pressure Gas Volume Rate Temperature Pressure Liquid Volume Rate Temperature
JUNCTION Steam
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-30
PIPE
Pressure Drop U Value Length Elevation Change Inside Diameter Absolute Roughness Ambient Temperature Pipe Conductivity Pipe Thickness Pipe Buried Depth Soil Conductivity Insulation Conductivity Insulation Thickness Inside U Effective Outside U Flow Efficiency Flowrate Pressure Drop U Value Length Elevation Change Inside Diameter Absolute Roughness Flow Efficiency
X X X X X X X X X X X X X X X
X X X X X X X X X
RISER
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-31
TUBING
Pressure Drop U Value Measured Wireline Depth Scaled Tubing Depth True Vertical Depth Inside Diameter Absolute Roughness Temperature Gradient Flow Efficiency Flowrate Hydrate Formation Temperature3 Hydrate Formation T3 Hydrate Formation Pressure3 Hydrate Formation P3 Pressure Drop U Value Measured Wireline Depth True Vertical Depth Annulus Inner Diameter Tubing Outer Diameter Absolute Roughness Temperature Gradient Flow Efficiency
X X X X X X X X X X X X X X X X X X X X X X X X
ANNULUS
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-32
IPR Models: DPMA WABP ABAN FWMA GORM OPEN UPTIME Productivity Index Vogel PI DP QMAX VOGC VOGE DP COEF EXP DP CLAM CTUR DP DP Maximum Pressure Drop Well Abandonment Pressure Reservoir Abandonment Pressure Maximum Water Cut Maximum GOR Open Well (1 for open; 0 for closed) On-line Factor Productivity Index Pressure Drop Open Flow Potential Vogel Constant Vogel Exponent Pressure Drop Fetkovitch Constant Fetkovitch Exponent Pressure Drop Laminar Coefficient Turbulent Coefficient Pressure Drop Pressure Drop X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
Fetkovitch
LaminarInertialTurbulent Babu
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-33
COMPRESSO R
Required Power Outlet Pressure Rotary Speed Maximum Rotary Speed Set Power Maximum Power Set Outlet Pressure Maximum Pressure Efficiency Required Power Outlet Pressure Rotary Speed Maximum Rotary Speed Set Power Maximum Power Set Outlet Pressure Maximum Pressure Efficiency Required Power Outlet Pressure Set Power Maximum Power Set Outlet Pressure Maximum Pressure Efficiency Required Duty Outlet Temperature Set Duty Set Outlet Temperature Fixed Pressure Drop DP Correlation Coefficient DP Correlation Exponent
X X X X X X X
PUMP
X X X
X X X X X X X
ESP PUMP
X X X X X X X X X X X X X X
HEATER COOLER
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-34
COMPLETION Gravel
Pressure Drop Shot Density Perforation Diameter Tunnel Length Pressure Drop Shot Density Perforation Diameter Penetration Depth Rate Pressure Drop Inside Diameter Resistance Coefficient Gas Removal Rate Liquid Removal Rate Oil Removal Rate Water Removal Rate Set Gas Removal Rate Set Liquid Removal Rate Set Oil Removal Rate Set Water Removal Rate Pct Gas Removed Pct Liquid Removed Pct Oil Removed Pct Water Removed Set Gas Removal Rate Gas Removal Rate Pct Gas Removed
COMPLETION Open-hole
SEPARATOR Compositional
SEPARATOR Blackoil
1 2
X X X
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-35
Condensate Removal Rate Water Removal Rate Set Condensate Rate Set Water Rate Pct Condensate Removed Pct Water Removed Pressure Drop Set Flowrate Upstream Pressure Downstream Pressure Result Variable R(1) Result Variable R(2) Result Variable R(3) Result Variable R(4) Result Variable R(5) Result Variable R(6) Result Variable R(7) Result Variable R(8) Result Variable R(9) Result Variable R(10) Result Variable R(11) Result Variable R(12) Result Variable R(13) Result Variable R(14) Result Variable R(15) Result Variable R(16) Result Variable R(17) Result Variable R(18) Result Variable R(19) Result Variable R(20)
REGULATOR
X X X X X X X X X X X X X X X X X X X X X X X X
CALCULATOR
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
() keyword qualifiers underlined keywords are defaults values or entries for keywords are defaults in Petroleum units
3-36
Table 3-3: Types and Variables for Constraint, Decision, and Objective Functions. Available as a Type <device> Associated Variables <property> OBJE BEST TIME CUMP Variable Description Constraint Variable Change Variable Objective Parameter1 X X X X
Network Variables
1 2
The types of flowrates available in pipes, tubings, and regulators depend on the fluid type, e.g., RATE(WT,GAS), RATE (LV,WATE), etc. See the RATE variables associated with the SOURCE, SINK, and JUNCTION devices for details. Gas liquid, and water phase flowrates for compositional systems depend on the temperature and pressure and are reported at the outlet of the device. Rates are not available for devices in links with separators. For compositional systems only.
3-37
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:
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.
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
Compressor power Gas valve rate
4-2
Examples
Feature
Sink pressure Compressor pressure Calculator result
Example Number
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=9.504e+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
4-5
Output
(Optimizer Report)
OPTIMIZATION REPORT AT BEST POINT (Base Case)
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 NAME VARIABLE
UNITS ---------IN HP IN HP
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 NAME TYPE
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
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
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
, FLASH=NONE , * , SIMULATOR=SUMMARY , *
, OPTIMIZATION, *
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 MOVE SHADOW PRICE
UNITS
2.1158 2.0591
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
UNITS
.1885 -.1885
4-11
CONSTRAINT VARIABLES NAME TYPE LOWER CURRENT UPPER MOVE BOUND VALUE BOUND - - - - - SUM RESULT 1 .000E+00 3.0000 3.0000 -.444E-15 SHADOW PRICE 14.1077
UNITS
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
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
The NETOPT and Reservoir Simulator Communication Scheme Using the Open Interface
5-1
LIBOSIMOD.A
A single, linked, shared library/DLL that represents the interface link module. It contains the interface call to the Intermediate Communication Module (ICM). Additionally, it contains the Network Convergence Algorithm. A single, linked, shared library/DLL that represents the generic Intermediate Communication Module (ICM). It is call by DSIMOD to pass/retrieve messages through the message passing system. In this example, the message passing system is PVM for Eclipse 100 Reservoir Simulator.
ICMMOD.A
To link to other reservoir simulators and to use alternate convergence schemes, you need to modify LIBOSIMOD.A routines. If the message passing method need to be changed, you need to modify LIBICMMOD.A routines.
The interface link module consists of several routines that define the variables that are transferred to the reservoir and the convergence criteria at each time-step. A general overview of some of the important routines will be described below.
5-2 Reservoir Simulation Interface Module
OSCNVP
This routine is the main generic interface routine to NETOPT. It automatically chooses which reservoir simulator you want to link to. The default is Eclipse.
Note: The following Fortran source routines are sent with the package as examples. They were used in the integration of NETOPT and Eclipse. When linking to other reservoir simulators, these routines can be used again if desired. If changes need to be made, we recommend that you also change the names of routines. OSCNV0 The main executive routine in this module that sets up the sequence of calls to the ICM module and to NETOPT. This routine sets the convergence criteria and determines whether convergence has been reached. The decision tree for this routine is outlined above. This routine allows you to define and initialize all variables that are to be involved in the dialog with the reservoir simulator. This routine synchronizes the well names from the two simulators. The reservoir interface uses the well names as the criteria for deciding which wells are to be linked between the two simulators. For this reason, you must use the same name for your wells in NETOPT and in the reservoir simulator that you wish to be coupled. Note: There may be wells in the reservoir
OSINI0
OSSYNC
simulation that are not included as sources in NETOPT, and vice versa.
OSRES0 OSWCTL This routine calls the ICM module to initialize or run/ retrieve or set variables from the reservoir simulator. This routine is used to set any well controls that need to be passed over to NETOPT from the reservoir simulator. QMAX and shut-in flags are supported for individual wells. This routine calls OSWCTL, PPDATR, and XXXXPP to send/receive variables to/from NETOPT and solve the simulation with the updated variables. This routine is called to execute and solve the network (in NETOPT). These are reporting routines that can be customized to print intermediate results of the variables that are of importance during the simulation run for the interface module. This routine can be customized to print the final results for each converged time-step of the interface module.
OSNET0
OSOUT
5-3
PPDATR
This is the NETOPT routine that is used to update NETOPT and also retrieve from a NETOPT simulation the values of the variables that you would like to use. (These are the ones defined in the OSINI0 subroutine).
5-4
C ='CPQuery CPU and Elapsed time for reservoir (inactive) C =CNQuery convergence and Material balance errors (inactive) C =PVQuery PVT reservoir variables(inactive) C =RPQuery Reservoir parameters(inactive) C C ZPSETQ (input)CHARACTER*4=WSet well targets and limits C ZPTARG (input)CHARACTER*8= ORATLIM set target oil rate C =GRATLIM Set target gas rate C ZQITEM(MZARR) (input)CHARACTER*8=String indicating quantities C to be queried C ZWNAME(MXENOD)(input)CHARACTER*8=Well name common in C reservoir and network C ECWELL(MXENOD) CHARACTER*8=Well names from Reservoir C simulator (output) C OSTIME=RESERVOIR TIME(days) (output) C DOTARR(2)= Single Array of real numbers that goes with the message C (input) C DOTARR(1)maximum time step size (input) C DOTARR(2)In active C DOSARR(I,J) = Array of real data for each well I= well number, C J=quantity (input for Set and output for Query) OUTPUT (Query) ======= EQOIL(IWELL)= DOSARR(IWELL,1)Oil Rate EQWTR(IWELL) = DOSARR(IWELL,2).Water Rate EQGAS(IWELL) = DOSARR(IWELL,3)..Gas Rate EWBHP(IWELL,NITER) = DOSARR(IWELL,4)Bottom Hole pressure EAOIL(IWELL) = DOSARR(IWELL,5) .a constant for oil IPR EBOIL(IWELL) = DOSARR(IWELL,6) .b constant for oil IPR EAWTR(IWELL) = DOSARR(IWELL,7) .a constant for water IPR EBWTR(IWELL) = DOSARR(IWELL,8) .b constant for water IPR EAGAS(IWELL) = DOSARR(IWELL,9) .a constant for gas IPR EBGAS(IWELL) = DOSARR(IWELL,10) .b constant for gas IPR EIOIL(IWELL) = DOSARR(IWELL,11) .not used EIWTR(IWELL) = DOSARR(IWELL,12) .not used EIGAS(IWELL) = DOSARR(IWELL,13) .not used ECPOIL(IWELL) = DOSARR(IWELL,14) .not used ECPWTR(IWELL) = DOSARR(IWELL,15) .not used ECPGAS(IWELL) = DOSARR(IWELL,16) .not used ECIOIL(IWELL) = DOSARR(IWELL,17) .not used ECIWTR(IWELL) = DOSARR(IWELL,18) .not used ECIGAS(IWELL) = DOSARR(IWELL,19) .not used C INPUT (Set) ===== DOSARR(IWELL,3) = Oil rate at well IWELL DOSARR(IWELL,4) = Gas rate at well IWELL C C IOSARR(mxenod,miarr)=(integer data from reservoir simulator) C (not used) C IDRILL =Flag to indicate if the well has been drilled yet (input) =1 drilled =0 not drilled C NENODE=Number of wells common to both network and reservoir C simulator C NECWEL=Number of active wells in reservoir simulator C NQITEM=Number of items queried C NETIME=the number of the time step (output) C NWTITR=Number of Newton iterations (output) C IDXFLU=Fluid type =3 black oil =4 Condensate C KUECL1=Output unit number for messages
5-5
Time-step, starting and ending days of the step being solved, and last time-step. Flowrate for each phase: If the solution is blackoil or condensate, these rates will be Qoil, Qwater, and Qgas. (If the solution is compositional, the molar rates must be provided). Bottomhole pressure. An Inflow Performance Relationship (IPR). Time-steps for which you have requested a report (desirable, however currently inactive). Units being used (desirable, however currently inactive). For wells in the reservoir that are shut-in, zero flowrates are sent to NETOPT. Well-gathering center (junction) and field controls are handled by the reservoir simulator. If the reservoir simulator imposes any controls, these controls will be passed to NETOPT. Do not use any NETOPT well-control options that duplicate reservoir well controls.
Flowrates for each phase: If the fluid type is black oil, these rates will be standard volumetric rates in field or metric units. Time-step or time (in days) to run: NETOPT must be able to specify the time procedure for the reservoir simulator. The reservoir simulator may take time-step cuts while trying to reach the time specified.
Refer to the NETOPT-Eclipse Interface documentation and Open Eclipse documentation for further details and examples of Eclipse interface applications.
5-6
5-7
Install NETOPT and Eclipse on your UNIX server. See the NETOPT Installation Guide for information on installing NETOPT, and see the Eclipse documentation for information on installing Eclipse and setting up the open eclipse environment.
Note: You must have access to the NETOPT-Eclipse Interface
feature of NETOPT. The NETOPT-Eclipse Interface is secured separately from the main NETOPT program and requires its own security key. Contact your SIMSCI ESSCOR representative for more information if this interface is not available on your server.
Start Eclipse and create your Eclipse data files. Set up your PVM environment (see Open Eclipse manual). Start your PVM messaging interface by typing: @PVM This starts the PVM daemon. Start NETOPT. In the Network Calculation Methods window, check the Use Reservoir Interface check box to enable the Eclipse link (access this window by selecting the General/Calculation Methods menu option.) Create your NETOPT simulation.
Note: For data exchange, you must use the same name for wells that are common to NETOPT and Eclipse. NETOPT wells must have a fixed source pressure, estimated flowrate, and a PI model at the IPR. Note: Your main Eclipse data file must be located in the same directory as your NETOPT input file.
5-8
NETOPT will automatically spawn Eclipse. Eclipse will send rate bottomhole pressure (BHP) in-flow performance data for each well. NETOPT calculates the block pressure from the IPR data and the BHP. It then uses these data as boundary conditions for its simulation. NETOPT solves the network and checks if the predicted BHPs and flowrates match the reservoir predictions. This cycle is repeated until convergence is achieved within a predetermined, user-defined tolerance (default is 1 psi). NETOPT will then generate an output report that contains the results of the Eclipse and NETOPT run. This section of the NETOPT output contains well, rate, and pressure results for every time-step.
NETOPT-ECLIPSE Integration
The NETOPT-ECLIPSE integration model was designed to handle the following:
Gas, Condensate and Blackoil fluids Honor Eclipses well management logic Honor Eclipses well constraints. Conceptually, the NETOPT network solution defines an additional constraint over and above Eclipses estimated eight constraints. Each Eclipse constraint can be reduced to a maximum flow constraint. At a given time step, the most restrictive constraint (minimum of the maximum flow rate constraints) is active so it does not violate any of the remaining constraints.
The network may contain wells that are represented in the Eclipse reservoir(s) model, or they may be external to the Eclipse reservoir(s). These Eclipse external wells may be part of NETOPTs internal tank reservoir decline models (Internal Time stepping) or they may be an external source. Similarly, ECLIPSE may have wells that are external to NETOPT. The user can choose to not include the network effects of these wells. For example, water injection wells may be in the Eclipse model but not included in the network model. The history matching time can be specified by the user of NETOPT. Model integration will be bypassed during the history matching period. Integration will only occur in the predictive mode.
5-9
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)
6-1
6-2
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
6-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
6-4
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
12 16
6-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.
6-6
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
6-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
6-8
In principle, if the IPRs are insensitive to flow rate (implying that the well block IPR does not change significantly as a function of flow rate over a time step), the converged integrated solution can be guaranteed to be reached in one iteration. This assumes that the network solution algorithm and the reservoir.
Specify RESERVOIR in the CALC card Specify the RESERVOIR card and associated keywords. See manual documentation Make sure the common well(s) have the same name in Eclipse and in NETOPT Make sure the source temperatures are the same as the reservoir temperatures in Eclipse to get a consistent model.
Note: Standalone NETOPTs PBAL network method allows the flexibility of specifying either Pressure or Flow Rate at the network boundary nodes: Sources and Sinks.
The well must have a PI IPR model Activate QMAX logic for wells (optional)
The well may have reservoir constraints and network constraints. To honor the constraints, always activate the QMAX logic in the NETOPT model. To activate the QMAX logic for a well, specify QMAX for the specific link; insert a Regulator device where the choke will normally control the flow. Ensure you have at least one rate sensitive pressure loss device (e.g. a pipe) after the regulator in the link. It is advisable to set QMAX to a very large value so that QMAX logic does not get activated in the stand alone base case run. If the flow rates become too large and prevents solution of the base case, then set a QMAX which looks reasonable.
A-2
The well cannot flow in the production mode if the network does not have a solution in the feasible solution space. In other words, the well is too weak to flow. It should be shut down to be consistent with field practice. The network solution may indicate the flow is in the unstable flow region. In the field unstable flowing wells are shut down. The network fails to reach a solution due to mathematical instabilities caused by the previous two scenarios.
If the appropriate simulation options are selected, NETOPT can identify these weak wells using a special algorithm and shuts them down.
There are two methods currently implemented to activate the shutdown logic for weak wells:
1.Specify QMIN in the link statement or; 2.Use the WELLS option. In this option NETOPT identifies the minimum stable flow rate for the well and sets QMIN to this value automatically.
If the link flow goes below this value NETOPT will shut the well. These two methods are mutually exclusive with the second taking precedence over the first if both are specified. The advantage to the first method is that each well can have its own unique QMIN that is user-specified. The disadvantage is that you may not know what that value should be. The advantage of the second method is that it calculates the QMIN for you based on the stable flow criteria. Note that the stable flow value may be different for different multi-phase correlations. The disadvantages are:
There is no sufficient field data to evaluate the accuracy of the stable flow calculation for a given correlation. The WELLS option activates the QMIN logic for all the wells with source pressures fixed. It will take more time since the stable flow calculation must be done at every integrated model iteration.
When QMAX Logic is Inactive If QMAX logic is not activated at the common well(s), only the network driven flow constraint (if any) will be active and the resulting solution may violate some of the operational constraints that were set in ECLIPSE. Basically NETOPT will allow as much flow as hydraulically possible without choking.
PIPEPHASE 9.1 NETOPT Users Guide A-3
Modeling Chokes When running integrated models, chokes must be modeled with the REGULATORS & QMAX logic. The resulting network solution basically tells you what the choke inlet pressure and outlet pressure will be to honor the flow constraints. If no choking is necessary the pressure drop across the choke (Regulator) will be zero.
Note: Do not include the choke (statement) model in the
First try to figure out where the failure occurred: a) In ECLIPSE, b) In the NETWORK solver, or c) In the iterative Integrated-Solution convergence scheme.
If the failure is in ECLIPSE, try to interpret ECLIPSEs failure messages and see if any common sense changes to the Eclipse file may help in improving the stability of the solution procedure. If unsuccessful, call GEOQUEST for support. If the failure is in the network solution (NETOPT), you can try any of these options:
*Try to identify any obvious reasons for the non-convergence and make appropriate changes to the file *If the network convergence path looks unstable, use some of the damping options *If it looks like a few more iterations would have helped increase the number of iterations
Another popular solution used by reservoir simulation engineers is the restart file option. This option is very useful in saving time, overcoming convergence problems, and allowing manual intervention in the progress of the simulation. It gives the user the opportunity to modify manually the network or reservoir model and stabilize the model.
For example, DAMPING factors that are good at one time are bad at other times. Network changes may make the model not converge. Desired network changes cannot automatically be implemented. Under these circumstances, it may be advantageous to start a new run beginning at the last converged solution.
A-4
2.
3.
The NETOPT wells connected to the Eclipse model should have a fixed source pressure and estimated rate. This is a result of the iterative nature of the NETOPT-Eclipse link. At the first iteration, the fixed pressure value specified in the NETOPT simulation is used. In later iterations, the fixed pressure specification on the well acts as a flag that allows NETOPT to accept the pressure calculated in the Eclipse run as the new, fixed well source pressure. Each source (well) link must have an IPR device as the first device. The IPR model must be specified as productivity index, and the basis must be liquid or oil for a blackoil system or gas for a gas-condensate system.
Note: The current release does not support a compositional fluid type.
4.
5.
To have a maximum desired flowrate for a given well, the maximum flow rate, Qmax, must be specified for the source (well) link. If this Qmax cannot be satisfied, the well will be operated in pressure control.
Note: Qmax must be used with a regulator device. For
NETOPT to honor any Eclipse well controls, you must specify Qmax for the well link.
6.
The well controls in NETOPT can be activated for the integrated model. Since reservoir simulators have elaborate well
A-5
control logic, take caution when activating NETOPTs well control logic for the maximum watercut and GOR. 7. The pressure and rate solution for each well at each time-step of the coupled simulation is reported as part of the NETOPT output. This section of the NETOPT output is titled Eclipse Interface Report. The time-steps designated as report timesteps in the Eclipse data file will contain the NETOPT simulation report. Two output files and a log file are generated:
a.filename.out contains the surface and production network report created by NETOPT. b.filename.prt contains the detailed reservoir simulation report created by Eclipse. c. filename.log contains the iteration details for the coupled solution.
8.
Network reports are generated at times specified in the change statement. Reservoir reports are generated based on input in the Eclipse file. Both NETOPT and Eclipse should have consistent input units. If the reservoir simulation is in Field units, the NETOPT input units must be in Petroleum units. If the reservoir simulation is in Metric units, NETOPT input must be in Metric units.
9.
10. If you have an include statement within the Eclipse data file (filename.DATA) that points to another file, you must use the full path name of the included file, I.e., INCLUDE /usr/mydir/grid.grd/. 11. If any of the wells in the network are initially shut in or are scheduled to be drilled later, you should specify a value of -1 for the maximum acceptable water cut for each well (FWMAX) in the IPR data supplied for the base case. This will shut in those wells in the base case.
A-6
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 ix
L
Legend for description 3-7 3-2 Line sizing data category
H
Help, online ix
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 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 ix ix 3-8 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-28
P
Parameter
Index
I-2