PIPESIM* production system analysis software Version 2011.1
Open Link Reference Manual
Copyright 2011 Schlumberger. All rights reserved. No part of this this manual manual may be reproduced, reproduced, stored stored in a retrieval system, system, or translated translated in any any form or by any means, means, electronic electronic or mechanical, including photocopying and recording, without the prior written permission of Schlumberger Information Solutions, 5599 San Felipe, Suite 1700, Houston, TX 77056-2722, USA. Use of this product is governed by the License Agreement. Schlumberger makes no warranties, express, implied, or statutory, with respect to the product described herein and disclaims without limitation any warranties of merchantability or fitness for a particular purpose. Schlumberger reserves the right to revise the information in this manual at any time without notice.
Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
Contents Overview ..................... .............................................. ................................................. ................................................ ................................................. ......................... 7 Modules and Interfaces .............................................................................................. 8 Quick Start Tutorial .................................................................................................... 10 Case Study 1 – Building a Well Model from Excel ..................................... ................. 15 Problem Outline Outlin e ................. .................................. ................................... ................................... .................................. .................................. ................. 15 Requirements .......................................................................................................... 15 Procedure ................................................................................................................ 15 Step by step tutorial ................................................................................................. 16 Case Study 2 - Nodal Analysis ...................... .............................................. ............................................... ...................................... ............... 28 Problem Outline Outlin e ................. .................................. ................................... ................................... .................................. .................................. ................. 28 Requirements .......................................................................................................... 28 Procedure ................................................................................................................ 28 Step by Step Tutorial ............................................................................................... 29 Modules and Interfaces ...................... .............................................. ............................................... ............................................... .......................... 35 ISingleBranchModel Interface ................................................................................... 36 IObjectProper IObjec tProperties ties Interface Interfa ce ................. .................................. .................................. ................................... ................................... ................... 43 ITubing ITubin g Interface ............... ................................ ................................... ................................... .................................. .................................. ................. 44 IVertCompObj Interface ........................................................................................... 47 IFlowlineObj IFlowli neObj Interface Interfa ce ................. ................................... ................................... .................................. ................................... ......................... ....... 48 IHeatTransfer IHeatTr ansfer Interface Inter face ................ ................................. .................................. ................................... ................................... ........................ ....... 49 IFluid Interface Interfa ce ............... ................................ ................................... ................................... .................................. .................................. .................... ... 50 IProjectInfo IProje ctInfo Interface Inter face ............... ................................. ................................... .................................. ................................... ............................ .......... 51 IErosionCorrosion Interface ...................................................................................... 51 INetModel INetMod el Interface ................. .................................. ................................... ................................... .................................. ............................ ........... 53 ModelBuilder object ................................................................................................. 60 IBlackOill object .................. IBlackOi ................................... .................................. ................................... ................................... .................................. ................. 60 ISinglePointCa ISingle PointCalib lib object ............... ................................ ................................... ................................... .................................. ......................... ........ 62 IMultiPointCal IMultiP ointCalib ib object ................. .................................. ................................... ................................... .................................. ......................... ........ 63 IViscosityData IViscos ityData object ................ ................................. ................................... ................................... .................................. ............................ ........... 65 IThermal ITherm al object ................. .................................. .................................. .................................. ................................... ................................... ................. 67
Page 3
PIPESIM Version 2011.1 OpenLink Reference Manual
ICompositional object ............................................................................................... 68 ICompositional2 object ............................................................................................. 72 FlowCorrelations Interface ........................................................................................ 72 ICFlowCorrelations2 Interface ................................................................................... 74 Single Branch Operations ......................................................................................... 74 Systems Analysis ..................................................................................................... 74 Pressure and Temperature Profiles ............................................................................ 77 Flow Correlation Comparison .................................................................................... 79 Data Matching ......................................................................................................... 80 Nodal Analysis ......................................................................................................... 82 Wax Deposition ....................................................................................................... 85 Gas Lift Rate vs Casing Head Pressure ...................................................................... 86 Single Branch Operations: Supporting Interfaces ....................................................... 88 IBoundaryProps Interface ......................................................................................... 88 IEngineOptions Interface .......................................................................................... 89 IFactorRange Interface ............................................................................................ 89 Gas Lift Diagnostics COM Object ............................................................................... 90 GLWell Interface and Object ..................................................................................... 90 IGLDesign Object ..................................................................................................... 98 IDesignParams Object ............................................................................................ 102 IDesignBias Object ................................................................................................. 103 IGLValveSystem Object .......................................................................................... 104 Single Branch Output Reader COM .......................................................................... 106 PerformCurve Object .............................................................................................. 111 PNSReaderCOM ..................................................................................................... 114 Inflow Performance Calculator COM ........................................................................ 123 Units Library .......................................................................................................... 125 Reservoir Table ...................................................................................................... 127 Defined constants and strings .................................................................................. 132 Object Type Identifiers ........................................................................................... 132 Object Properties ................................................................................................... 133 Tubing object’s properties ...................................................................................... 140 Generic Source ...................................................................................................... 147
Page 4 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Network Separator (reinjector) ............................................................................... 147 Artificial Lift ........................................................................................................... 147 Completion Options ................................................................................................ 148 IPR Types (Vertical) ............................................................................................... 149 IPR Types (Horizontal) ........................................................................................... 149 IPR Options (Horizontal) ......................................................................................... 149 Fluid Types ............................................................................................................ 149 Pipe Flow Types ..................................................................................................... 150 Rate Types ............................................................................................................ 150 Separator Types .................................................................................................... 150 Single Branch Operations ....................................................................................... 150 Equations of State ................................................................................................. 151 Viscosity Types ...................................................................................................... 151 BIP Sets ................................................................................................................ 151 Emulsion Types ..................................................................................................... 152 Case Studies ............................................................................................................. 157 Detailed explanation of routine ............................................................................... 157
Page 5
PIPESIM Version 2011.1 OpenLink Reference Manual
Page 6 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Overview This guide explains how to use Open Link to interface with PIPESIM from external applications. An overview of the functionality of Open Link is provided, along with the necessary interface functions and arguments. This allows you to load both network and single branch PIPESIM models, query them (equipment configuration, gas lift injection, etc.), and perform simulations.
Basic Functions
The functions described in this document fall into the following categories; •
• •
Get functions ‐ Get the results after a simulation or query an item for its current data value, such as obtaining the choke bean size. Set functions ‐ Set a valve to be used in subsequent simulation, such as setting the reservoir pressure. Operation functions ‐ Perform an operation on a model, such as running a simulation.
Potential Usage
The Open Link functionality can be used in the following cases: • • • •
Running PIPESIM in batch mode with a number of scenarios. Creating custom reports. Importing production data from a database and populating the models. Running PIPESIM in‐conjunction with other Engineering applications. Hyprotech have already used this functionality to link Hysys and PIPESIM.
Utilizing Open Link
The Open Link functions can be called from any of the following: • • •
VBA macro. This could be written in Excel, Access, etc. Visual Basic programs. C++ programs
Supported Interfaces • •
INetModel: for network models and network operations ISingleBranchModel: for single branch models and operations
Dependency MAP
Open Link can be used to access PIPESIM functionality from external programs. The programs that can automate PIPESIM simulations are those that are defined as automation clients according to Microsoft standards, and in the same way, Open Link is an automation server. Typical examples of automation clients include VBA (Visual Basic for Applications) macros, which can be written from programs such as Excel or Access, C++ and Visual Basic. Open Link provides therefore an open architecture where you control and Page 7
PIPESIM Version 2011.1 OpenLink Reference Manual
automate PIPESIM simulation models through custom programs or macros without having to manually enter the data or view the results using the graphical interface. It is assumed you are familiar with both PIPESIM and the chosen program or programming language in which the automation code is to be written. Those new to VBA are recommended to closely follow the Quick Start Tutorial and the Case Studies. The Open Link functionality is distributed with the PIPESIM installation and is included in a number of library files. •
•
•
The main file is Net32COM.DLL, which normally resides in the programs directory and provides the framework and main entry points into both networks and single branch simulation models. Net32COM.DLL must be copied to the PIPESIM programs directory and registered. There are other files that support Net32COM, for instance FluidModelCOM.DLL and FlowCorrelationCOM, which provide access to properties defined in the fluid models and flow correlations respectively. Each library file, in turn, defines at least one interface, which is a logical entry point into a well‐defined area of functionality. Each interface includes a number of public access functions that ‘set’ or ‘get’ a specified property or just perform operations (that is run a simulation). As an example the FluidModelCOM library defines two interfaces: IBlackOil, for black oil models and ICompositional, to deal with compositional models. IBlackOil defines property functions such as API, Watercut or GasSG. These properties can be ‘set’ (assigned) to a model prior to a simulation run or they can be ‘get’ (retrieved) and copied into an Excel cell.
The Modules and Interfaces section lists the modules and interfaces that are part of Open Link. This document contains further details of the modules and interfaces, together with some code samples. Highlighted items represent information that is new, previously unpublished or amended from the previous PIPESIM release. The present reference guide applies to the release version 2010.
Modules and Interfaces Module Name
Interfaces
Remarks
Net32COM.DLL
INetModel
Network models and operations
ISingleBranchModel
Single branch models and operations
IISingleBranchModel2
PSOpSystems.DLL
IObjectProperties
Generic equipment properties
TubingObj
Tubing specific properties and operations
InjectorObj
Injector specific properties
VertCompObj
Vertical completion specific properties
FlowlineObj
Flowline specific properties and operations
ErosionCorrosion
Erosion and corrosion settings
HeatTransfer
Heat transfer properties
IISystemsAnalysis
Systems Analysis operation
IIPTProfile
Pressure/Temp Profiles operation
IICorrMatching
Flow Correlation Matching operation
Page 8 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Module Name
Interfaces
Remarks
NodalOp.DLL
IINodalAnal
Nodal Analysis Operation
FluidModelCOM.DLL
IBlackOil
Black Oil model properties
ICompositional
Compositional model properties
SinglePointCalib
BO single point calibration properties
MultiPointCalib
BO multipoint calibration properties
ViscosityData
BO viscosity properties
Thermal
BO thermal properties
FlowCorrelationCOM. DLL
CIFlowCorrelation
Vertical and horizontal flow correlation properties
UnitsCOM.DLL
IUnitSystem
General unit conversions
GLDiagn.DLL
GLWell
Gas lifted well model for diagnostics
WaxOp.DLL
IWaxOp
Wax deposition operation
DataMatching.DLL
IDataMatchingOp
Data matching operation
QgiChpOp.dll.DLL
IPlotQgiVsChp
Gas Lift Rate vs Casing Head Pressure operation
ICIFlowCorrelation2
Page 9
PIPESIM Version 2011.1 OpenLink Reference Manual
Quick Start Tutorial This quick start guide shows macro code written in VBA using Microsoft Excel. Even though each language implements its own particular syntax, the basic logic to write an Open Link code or macro will be identical. A number of case studies along with VBA code using Excel are provided under the ..\Case Studies\Open Link directory. 1. Before you start ‐ you must let VBA know about the Open Link interfaces. To do this, click on Tools | References… from the main menu in the VBA window. You should now see a dialog box like this:
2. Scroll down the list of available references until you find the Net32COM 1.0 Type Library. Check the box to the left of the reference. 3. Now do the same for the FluidModelCOM 1.0 Type Library and for PNSReader 1.0 type library. 4. Click on OK to close the References window.
Page 10 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Loading and running an existing model
1. Load the existing network model: ‘Small Network.bpn’ , which is shipped with the PIPESIM installation and normally located in: ‘ C: \ Pr ogr am Fi l es\ Schl umber ger \ PI PESI M\ Case St udi es\ Net wor k Anal ysi s\ Smal l Net wor k\ ’
If the model were opened from the PIPESIM graphical interface it would look like the picture below:
2. Using the VisualBasic editor (you can quickly open it from Excel using the shortcut Alt+F11) create a variable of the type INetModel to perform the basic interaction with the network model. We will call it ‘NetModel’: Di m Net Model As New NET32COMLi b. I Net Model
3. Open the model: Net Model . OpenModel “‘ C: \ Progr am Fi l es\ Schl umber ger \ PI PESI M\ Case St udi es\ Net wor k Anal ysi s\ Smal l Net wor k\ Smal l Net work. bpn’ ”
4. Run the model (asynchronously): Net Model . RunNet wor k2 Fal se, " - B"
Page 11
PIPESIM Version 2011.1 OpenLink Reference Manual
The first argument, in this case ‘False’, tells the calculation engine not to use a restart file and the second argument ‘‐B’ is an engine switch that instructs the engine to run in batch mode. For more information on engine commands please refer to the PIPESIM help. When executing this macro you should see the calculation engine running in the background. This process is run asynchronously which means that the macro will continue its execution without waiting for the simulation run to finish. •
If you want your macro to stop until the engine terminates in order to, say, display a result, then you can replace the line above by the following code: Net Model . RunNet wor k2 Fal se, " - B" bRunni ng = Net Model . Get I sModel Runni ng Whi l e bRunni ng = Tr ue bRunni ng = Net Model . Get I sModel Runni ng newHour = Hour ( Now( ) ) newMi nut e = Mi nut e( Now( ) ) newSecond = Second( Now( ) ) + 1 wai t Ti me = Ti meSer i al ( newHour , newMi nut e, newSecond) Appl i cat i on. Wai t wai t Ti me Wend MsgBox " Fi ni shed. . . "
This code will run the simulation synchronously. It starts the simulation and then waits until it is finished. It checks every one second for the engine status through a call to ‘GetIsModelRunning. When ‘GetIsModelRunning’ it returns ‘False’ indicating that the simulation run is finished, the macro code displays a message box.
Getting results
We would like to display some results from the simulation. The library that reads the results file is PNSReader and we must create a variable of the type PNSCom in order to extract data from the simulation output. The public access functions available in PNSReader are detailed in PNSReaderCOM. 1. Create a PNSCom variable, let’s call it ‘results’: Di m r esul t s As New PNSREADERLi b. PNSCom
2. Read the results file. This file is located in the same directory as the model file and has the same file name but with the extension ‘.pns’: r esul t s. ReadPnsFi l e( “‘ C: \ Pr ogr am Fi l es\ Schl umber ger \ PI PESI M\ Case St udi es\ Net wor k Anal ysi s\ Smal l Net wor k\ Smal l Net work. pns’ ”)
Page 12 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
3. Get the pressure and temperature at the sink ‘Sink_1’ (see model picture above) Di m i ndex as Long Di m pr essur e as Doubl e Di m t emper at ur e as Doubl e i ndex = r esul t s. Get NodeI ndex( “Si nk_1”) pr essur e = r esul t s. Get NodeVar i abl eVal ue ( i ndex, " Pr essur e" ) t emper at ur e = r esul t s. Get NodeVar i abl eVal ue ( i ndex, " Temper at ur e " )
In the same way variables such as “LiquidRate”, “GasRate”, “MassRate”, “GLR” or “WaterCut” can be obtained for Sink_1 or any other node in the network.
Changing BlackOil fluid parameters
So far, we have opened, run and obtained results for a network model as it was originally defined within the PIPESIM graphical interface. In this step, we will change some parameters to the opened model. Here is where the true power of Open Link starts to show, the Excel spreadsheet may define a range of values to be tested in the context of a ‘what if’ scenario and multiple simulation jobs may be set up to compare results for a range of input values for one or more properties. 1. Create a BlackOil variable: Di m Bl ackOi l As New FLUI DMODELCOMLi b. I bl ackOi l
2. Get the BlackOil model from the network Set Bl ackOi l = Net Model . Bl ackOi l Def aul t
The BlackOil variable has been ‘filled’ with the values defined in the blackoil model in NetModel. You can corroborate this by adding a watch with the VBA debugging tool and inspecting the different variable fields. 3. Set a Watercut value of 15%: Bl ackOi l . Wat er cut = 15
4. Set an API value of 27.5: Bl ackOi l . API = 27. 5
5. Set this BlackOil with a modified watercut and API back into the network: Net Model . Bl ackOi l Def aul t = Bl ackOi l
6. You can now re‐run the model with the new values, get the new results, display them in an Excel cell or plot, etc.
Page 13
PIPESIM Version 2011.1 OpenLink Reference Manual
Changing a choke property
The following piece of code sets a new value for the choke bean size in “Choke” which is defined in the single branch model that corresponds to the production well “Well_1”. Net Model . Set Pr oper t yVal ( “Choke”, “Wel l _1”, "i nches")
" Bean Si ze", 3. 5,
The above line sets bean size = 3.5 inches to “Choke” in “Well_1. ”.
Saving the changes
1. Any changes made to a single branch or network model can be saved simply by calling the SaveModel (…) function. Di m bOK as Bool ean bOK = Net Model . SaveModel ( “C: \ MyOpenLi nkModel s\ Net wor k. bpn”)
The argument is the full path to the file where the model will be saved. It can also be re‐saved to the original model file. 2. bOK will be TRUE (1) or FALSE (0) depending on whether the save operation succeeded or not. As with all Open Link function calls that return a TRUE/FALSE state, a FALSE value indicates that some kind of error condition occurred and an error description can be obtained by calling GetLastError(): Di m Er r or as St r i ng I f bOK = Fal se Then Net Model . Get Last Er r or Er r or MsgBox er r or St r End I f
Page 14 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Case Study 1 – Building a Well Model from Excel Problem Outline It is often desired to build PIPESIM well models from a corporate database. The problem can be solved by: 1.
Pasting the wells data in excel.
2.
Using a VBA routine containing Open Link statements to automate the Bps files creation.
This case study illustrates the resolution of such a problem.
Requirements It is assumed that the reader is familiar with the basics of building models in PIPESIM. No prior knowledge of VBA (Visual Basic For Application) is required. VBA is a programming language that is accessed from Microsoft Excel. VBA statements can be used to interact with Microsoft Applications. These statements cannot interact with PIPESIM. Open Link is the name given to a group of statements that can be used in VBA to interact with PIPESIM.
Procedure 1. Create a Well Model Template. (That is build a well model in PIPESIM but do not fill any of the objects that make up the model with values). Save the well model template with the name template.bps. 2. Organize the wells data in tabular form in Excel. 3. Write the VBA routine that will create a Bps file for each well of the spreadsheet. (The routine will make use of the model template.bps as will be shown further down in the text). 4. Run the routine – The Bps are created and stored in a directory specified in the routine.
Page 15
PIPESIM Version 2011.1 OpenLink Reference Manual
Step by step tutorial To Create a Well Model Template
1. Open PIPESIM – Open a new well performance analysis window as shown below.
2. Create the following Well Model in the opened window. 3. Save the model with the simple model description selected in both the tubing object and the flow line object. This is done by double‐clicking on both the flowline_1 and tubing_1 object, selecting simple model in each user form and pressing on the button OK.
4. Save the well model under the name template.bps with the following path: D: / OpenLi nk/ t empl at e/ t empl at e. bps Page 16 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
To Create a table of wells data in Excel (2 vertical gas wells)
1. Open Excel. 2. In the Opened workbook, select sheet 1 (the sheet should be selected by default). 3. Create the following table in Excel (4 Rows – 24 Columns).
4. Start the table at the cell $A$4 and finish at the cell $X$7. 5. List of the 24 columns (A to X in order) (The values are given for each column): A: General Data:
Index.
(1,2)
Field.
(Field1, Field2)
Well Number
(435,436)
Gathering Station
(Man1,Man2)
B: Black Oil Data:
Gas Gravity (lbs/cu.ft gas sc) /(lbs/cu.ft air sc).
(62,62)
Oil API
(Field1, Field2)
GOR scf/bbl
(800000,900000) (10,20)
Water Cut % C: Completion Data:
Pws Psia (Static pressure of the reservoir).
(1800,3000)
Temperature F
(200,200)
PI mmscf/d/psi2
(1.5053E‐08,1.7427E‐7)
D: Tubing Data:
Perforation MD m
(2104,2104)
Page 17
PIPESIM Version 2011.1 OpenLink Reference Manual
Perforation TVD m
(2104,2102)
Tubing 1 MD m
(2054,2052)
Tubing 1 ID
(2.44,2.44)
Tubing 2 MD (Casing MD)
(2104,2104)
Tubing 2 ID (Casing TVD)
(5.5,5.5)
E: Flow line Data:
Flow line elevation (m)
(0,0)
Flow line ID “
(3,3)
Flow line Length km
(4.305,1.212)
F:Choke Data:
Choke Size 1/64th”.
(95,95)
G: Production Data:
Gas Rate mmscf/d
(0.041,1.39)
Well Head Pressure psia
(195,250)
Pressure at the end of the flow line. psia
(150,440)
6. In cell $A$8 write the template path: D:/OpenLink/template/template.bps 7. In cell $A$9 write the path in which the Bps files are to be stored: D: / OpenLi nk/
8. In cell $D$11 write the surface temperature: 90 F. 9. Save the current workbook under the name Openlink.xls with the following path: D: / OpenLi nk/ Excel / Openl i nk. xl s
Page 18 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Preliminary steps
1. Enable Macros in your workbook. 2. Select the Menu tools – Sub Menu Macro – Security as shown below.
The following user form should appear:
3. Select Medium. High does not let the user run any unsigned Macros. 4. Insert a Button in the workbook that will launch the routine.
Page 19
PIPESIM Version 2011.1 OpenLink Reference Manual
First, display the Control Toolbox Toolbars.
5. Then insert a button in the spreadsheet by clicking on the Command Button Icon in the Control Toolbox; and clicking and dragging the button in the spreadsheet. This is shown below:
Design Mode
Command Button Icon.
Page 20 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
The default name of the button is CommandButton1. Note: Clicking on the Command Button icon activates the design mode that allows you to place buttons and other types of controls in the spreadsheet. You will need to deactivate the design mode manually when you want the routine associated with the button to be executed when you click on it. 6. Next change the name of the button by right‐clicking on the button CommandButton1 the following menu should appear:
7. Click on CommandButton Object Submenu Edit. You can now change the caption of the button CommandButton1 to: “Create Well Model”.
Page 21
PIPESIM Version 2011.1 OpenLink Reference Manual
8. Open the VBA Editor Windows. As the design mode is activated, it is possible to open the VBA editor windows by double‐clicking on the button CommandButton1. The following window should then appear: Pr i vat e Sub CommandBut t on1_Cl i ck( ) End Sub
The window that contains the statements is called the Code window. You write VBA routines in the Code window. The word Sub in the first line indicates to the computer that it is the beginning of a new routine. (In effect, several routines can be written in the same Code window). The word CommandButton1_Click in the first line indicates to the computer that the routine following can only be executed by clicking on the button CommandButton_1. The statement End Sub indicates to the computer that this is the end of the routine. Any routine must finish with this statement. To Activate the Open Link statements Libraries
In order to be able to write our routine using Open Link statements we need to indicate to the computer that we are going to use those statements. We need to activate those statements so that they can be understood by VBA. 1.
We can activate the Open Link statements by clicking on the menu Tools, submenu References.
Page 22 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
You should now see a dialog box like the one below:
2. Scroll down the list of available references until you find the FluidModelCOM 1.0 Type Library. Check the box to the left of the reference. 3. Now do the same for Net32COM 1.0 Type Library and NODALOPLib.INodalAnal. 4. Click on OK to close the reference window. Each of the three library activated is a group of Open Link statements that can be used in VBA to communicate with PIPESIM. These libraries will be available from Excel after having installed PIPESIM. They need to be activated before they can be used while programming. Note: If a routine is passed from one computer to another, and it does not work on the receiving computer, it is because the Open Link Libraries have not been activated.
Page 23
PIPESIM Version 2011.1 OpenLink Reference Manual
To write the VBA routine using Open Link Statements
1. Write the following routine: The actual workings of the routine will be explained in Case Studies.
Page 24 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Page 25
PIPESIM Version 2011.1 OpenLink Reference Manual
Page 26 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
To Run the routine
1. Go back to Excel and select the two wells with the mouse (by highlighting the corresponding rows) you will have created two .bps files corresponding to the two wells of the spreadsheet. The directory Open Link will contain the two .bps Files (shown below).
Page 27
PIPESIM Version 2011.1 OpenLink Reference Manual
Case Study 2 - Nodal Analysis Problem Outline It is required to see if our production data is consistent with what the model predicts the flow rate should be. We will run a nodal analysis on each of the wells. The boundary conditions of the problem are the reservoir static pressure and the outlet pressure of the model (i.e. the downstream end of the flow line). The Stock tank gas flow rate at the operation point will be compared to the Gas flow rate given in the production data.
Requirements It is assumed that the reader is familiar with the PIPESIM Nodal Analysis User Form.
Procedure You will write a VBA‐Open Link routine that uses the table built in the previous case study. The routine fills in a Nodal Analysis operation interface using the static pressure, tubing ID and Outlet Pressure stored in Excel and then assigns this Nodal Analysis operation interface to the Well Models created in Case study 1. Each of the models is then run. A Nodal Analysis plot (system plot_.plt) is produced for each well. You can then check on the graphs if the stock tank flow rates at the operation points are consistent with the production data.
Page 28 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Step by Step Tutorial 1.
Open the Excel File (OpenLink.xls) D: / OpenLi nk/ Excel / Openl i nk. xl s
2. Insert a second button in the Spreadsheet. This is done using the control toolbox as in Case Study 1. The default name of the button will be CommandButton2.
3. Open the VBA editor. This is done as in Case Study 1 by double clicking on the button CommandButton2. The code written for the previous case study will be visible. Pr i vat e Sub CommandBut t on2_Cl i ck( ) End Sub
At the end of the code, from the previous case study, the statements are visible.
Page 29
PIPESIM Version 2011.1 OpenLink Reference Manual
To Write the VBA routine using Open Link statements
1. Write the routine: The workings of the routine are explained in Case Studies.
Page 30 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Page 31
PIPESIM Version 2011.1 OpenLink Reference Manual
Page 32 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
To Run the routine
1. Go back to Excel and select the two wells (by highlighting the corresponding rows). 2. Press the button CommandButton_2. This runs a nodal analysis on the two .bps files produced in Case Study 1. The contents of folder Open Link after having run the routine is shown below:
. plt Files.
3. Clicking on the .plt files will display the following graphs:
. Plot of Man1_435
Page 33
PIPESIM Version 2011.1 OpenLink Reference Manual
Plot of Man2_436
Page 34 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Modules and Interfaces 1. Values returned as ‐7777 mean 'UNSET' or could not calculate do to missing data or has not been calculated. 2. For all modules and interfaces, required methods are shown in RED, and conditionally required in GREEN.
Page 35
PIPESIM Version 2011.1 OpenLink Reference Manual
ISingleBranchModel Interface ISingleBranchModel object - Get Methods •
Returns in pNameArray an array of String with the names of objects of the given type (ObjectType). The number of objects found is returned in Count. ObjectType can be any value of:
GetNameList (ObjectType As Long, pNameArray, Count As Long)
1 – Fold 2 – Source 3 – Sink 4 – Junction 5 – Branch 6 – Text 7 – Production Well 8 – Injection Well 9 – End Mark 10 ‐ Generic Source 11 ‐ Vertical Completion 12 ‐ Horizontal Completion 13 – Flowline 14 – Riser 15 ‐ Zero length connector 16 – Tubing 17 ‐ Generic Node 18 – Choke 19 – Compressor 20 – Expander 21 ‐ Heat Exchanger 22 – ESP 23 ‐ Multiphase Booster 24 – Gas Lift 25 – Separator 26 ‐ Report tool 27 ‐ Adder/Multiplier 28 ‐ Nodal Analysis Point 29 ‐ Engine Keyword Tool 30 – Reinjector 31 – Well Connector 32 – SSSV 33 – Gas Lift Valve 34 – Black Box 35 – Coil Tubing 36 – PCP •
GetEquipmentInfo (EquipmentType As Long, ParentType As Long, ParentObject As String, EquipmentNames,
If ParentObject string is empty, the function is the same as TGetNameList (…)T. See TGetNameList (…) Tfor a map to EquipmentType options. Otherwise it returns in EquipmentNames array of String with the names of child objects
Page 36 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
Count As Long)
of the given type (ObjectType) for specified ParentObject of ParentType
GetHasArtificialLift (ObjectType As Long, ObjectName As String, Lift As Long)
Returns 0: no artificial lift 1: gas lift injection 2: ESP
‐1: Object not found ObjectType must be Tubing type (16) ObjectName the name of the tubing GetStartBoundaryObject (ObjectType As Long, ObjectName As String)
Returns the ObjectType (SeeT GetNameList (…)T) and its name of the upstream‐most object in the single branch model. The upstream‐most object in a branch is determined by the drawing direction when a user initially creates the branch.
GetCountObjectsInProfile (Count As Long)
Returns the number of objects in the single branch model
GetObjectAtIndex (Index As Long, ObjectType As Long, ObjectName As String)
Returns the object's type and name at the specified zero‐based index. Index must between zero and the number returned by GetCountObjectsInProfile (…) minus 1.
•
GetLastError (ErrorStr As String)
Returns the last error message produced by the interface.
•
GetIsModelRunning () As Boolean
Returns Boolean value True if the simulation process is active
GetOperationInterface (pIOperation As Object)
Returns the operation object
GetOperationType () As Long
Returns Long value as the operation defined for the model. See XDefined constants and stringsX
GetPropertyNames (ObjectName As String, PropNames) as Long
Returns in PropNames the list of properties defined for the object ObjectName. Returns the number of properties as function’s return value
GetPropertyVal (ObjectName As String, PropName As String, pValue As Double, pUnitStr As String) As Boolean
For specified property (PropName) in the specified object (ObjectName) function gets a property value in ’Value’ and the units in UnitStr. Return value is True if the property was retrieved successfully, otherwise False. For implemented PropNames see XDefined constants and stringsX.
GetPropertyValAtObjectIndex (ObjectName As String, PropName As String, pValue As Double, pUnitStr As String, SubObjectType As Long, Index As Long) As Boolean
Gets a specified property value.
•
•
•
•
•
•
•
•
This function extends the functionality of TGetPropertyValT by allowing you to retrieve a property from a specified sub‐ component within an object. A typical use of this is when for instance it is required to get a gas lift flowrate (PropName) from the top (Index = 0) gas lift injection point (SubObjectType) in the tubing ‘Tubing_1’ (ObjectName). For available options see XDefined constants and stringsX
Page 37
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
GetPropertyStringAtObjectIndex (ObjectName As String, PropName As String, pValue As String, Index As Long) As Boolean
The function is similar to TGetPropertyValAtObjectIndexT but for properties defined as string
GetPropertyType (ObjectName As String, PropName As String) As Long
Returns the property type: UNDEFINED
‐1
REAL
0 (value in strict SI units)
INT
1
DOUBLE
2
STR
3
GetSensitivityInfo (ObjectType As Long, ObjectName As String, VariableNames, ItemReference)
Returns the list of variable names upon which a sensitivity analysis can be performed for the given object (defined by its type and name). See TGetNameList ()T for object type values. ItemReference holds additional binary information about the sensitivity that is required by some operation module interfaces (such as the Artificial Lift COM interface)
GetSensitivityVariables (ObjectName As String, VariableNames, StdQtyNames) As Long
Requests the list of variable names and their measurements upon which a sensitivity analysis can be performed for the given object (defined by name). The return value holds number of the variables
ISingleBranchModel object - Set Methods •
•
•
•
SetOperationInterface (pIOperation As Unknown)
pIOperation: The interface instance to an operation object. This function assigns the given operation to the opened single branch model
SetOperationType (OperationType As Long)
Sets the operation type for the single branch model. See Defined constants and strings
SetPropertyVal (ObjectName As String, PropName As String, value As Double, UnitStr As String) As Boolean
Sets the specified property (PropName) in the specified object (ObjectName) to the value given in Value in the given units (UnitStr ). Function returns True if the property was set successfully, otherwise False. Implemented PropNames: see Defined constants and strings.
SetPropertyStringAtObjectIndex (ObjectName As String, PropName As String, value As String, Index As Long) As Boolean
As SetPropertyValAtObjectIndex (…) but for properties defined as string
Page 38 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
SetPropertyValAtObjectIndex (ObjectName As String, PropName As String, value As Double, UnitStr As String, SubObjectType As Long, Index As Long) As Boolean
This function extends the functionality of SetPropertyVal by allowing you to set a property to a specified sub‐component within an object. A typical use of this is when for instance it is required to set a gas lift flowrate (PropName) through the top (Index = 0) gas lift injection point (SubObjectType) in the tubing ‘Tubing_1’ (ObjectName). For available options see Defined constants and strings.
SetPVTFile (bstrPVTFilename As String)
Sets the compositional file (.pvt) to be used as the main fluid in the simulations
SetUnitManager (p_VarUnitManager)
Sets the Unit Manager object
ISingleBranchModel object - Properties •
BlackOil As Object
Gets/sets the Black Oil fluid definition object
•
Composition As Object
Gets/sets the fluid composition object
•
FlowCorrelation As Object
Gets/sets the Flow Correlation object
•
Fluid As FluidModel
Gets/sets the FluidModel object (See IFlowlineObj Interface)
•
FluidModelType As Long
Gets/sets the fluid type (0: black oil, 1: compositional, 2: PVT file, 3: MFL file)
•
GasLiftDesign As Object
Gets/sets the Gas Lift Design object
•
GasLiftSystemProps As Object
Gets/sets the Gas Lift System Properties object
ObjectProperties (ObjectName As String) As ProfileObj
Sets/returns a ProfileObject (See IObjectProperties Interface). Depending on the object type of ObjectName this interface can be set to the specific object type interface. For instance a tubing object returns a ProfileObject , which can be set to a TubingObj object. The TubingObj (See ITubing Interface) contains properties and methods to define or obtain information from a detailed tubing object.
•
ProjectInfo As ProjectInfo
Returns the ProjectInfo object to access project specific data
•
ProjectPath As String
Sets full path name to the model file
•
FieldSurvey As Object
Gets/sets the FieldSurvey object
•
ErosionCorrosion As Object
Gets/sets the ErosionCorrosion object
•
Keywords As String
Gets/sets the additional engine keywords
HeatTransferOptionsPipeBurialMethod As long
Gets/sets the flag value for heat transfer options pipe burial method:
•
•
1983: 1983 method 2000: 2000 method (set to this value if given value is not
Page 39
PIPESIM Version 2011.1 OpenLink Reference Manual
1983, 2000, or 2009) 2009: 2009 method •
HeatTransferOptionsIFCMethod As long
Gets/sets the flag value for heat transfer options inside film coefficient method: 1: Kaminsky 2: Kreith Separate Reynolds number (set to this value if given value is not 1, or 2)
•
•
HeatTransferOptionsUValueMultiplier As double
Gets/sets the value for heat transfer options U value multiplier
EnableHydrateSubcoolingCalculation As long
Gets/sets the flag value for heat transfer options hydrate subcooling calculation: 0: disable 1: enable (set to this value if given value is not 0, or 1) Note: Property is for compositional models only
ISingleBranchModel object - Operations •
•
•
ExportEngineFiles ()
This function generates an ASCII file (.psm) in the PIPESIM engine keyword language that corresponds to the opened model. This file can then be used with PIPESIM expert mode.
ExportEngineFiles2 (operationfile As String) As String
In addition to ExportEngineFiles (), this function returns the full pathname to the exported file (.psm) and its associated operation file (.inc)
ExportEngineFiles3 (nExpertMode As Long)
This function is similar to ExportEngineFiles function but it allows to specify the format for exported files in nExpertMode parameter: 0 – default format, 1 – with expert extensions 2 – for ESP design 3 – same as for 1 but warning is displayed if files exist
•
•
KillSimulationProcess ()
Terminates the simulation process
NewModel (bstrModelFileName As String, ProfileTypesList, ProfileNamesList) As Boolean
Creates a new PIPESIM model. bstrModelFileName: full path to the file where the new model is to be saved. ProfileTypesList : a list of object type identifiers (integer numbers) that describe the object connectivity in the model – see Defined constants and strings for ids map. ProfileNamesList : a list of object names for each one of the elements of ProfileTypesList . This variant may be empty in which case default names will be assigned. The method returns True if operation was successful, False otherwise
Page 40 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
OpenModel (bstrModelFileName As String)
Opens the given single branch model. Filename must be a valid PIPESIM single branch model file (.bps). This function must be called first when using this interface. Note: Will return false also if the number of component in any composition or in the model in general is more than 50.
•
•
•
•
•
•
RunSingleBranchModel (bRestart As Boolean)
Runs the currently opened model by calling the calculation engine program as specified in the PIPESIM installation. If bRestart is True the simulation will load any previously restart files (.rst files) as its initial conditions. Return value is True for successful engine start, False otherwise.
RunSingleBranchModel2 (bRestart As Boolean, EngSwitches As String, DynamicPlot As Boolean)
Similar to SetOperationInterface, it also accepts one or more switches to be passed to the simulation engine and turns dynamic plotting on/off.
RunSingleBranchModel3 (bRestart As Boolean, EngSwitches As String, DynamicPlot As Boolean, ExpertExtensions As Boolean)
Similar to SetOperationInterface2, it also allows using of the Expert extensions
SaveModel (bstrPathName As String) As Boolean
Saves the currently opened model to a file given by bstrPathName. Function returns True if model is saved, otherwise the return value is False.
ValidateTubingConfiguration(MaxInjTV D As Double) As Boolean
This function checks the tubing configuration above the injection point to verify that all dimensions are properly set. If function fails the error message is available using the GetLastError function.
SetOutpoutUnits(nUnits As Integer) As Boolean
This function forces the output to be written in specified units (0 – model’s default units, 1 – Eng units and 2 – SI units).
Page 41
PIPESIM Version 2011.1 OpenLink Reference Manual
ISingleBranchModel object – Examples VBA Sample Code
Di Di Di Di
m Si ngl eBr anchObj As New NET32COMLi b. I Si ngl eBr anchModel m equi pnames As Var i ant m sensvar names As Var i ant m obj r ef As Var i ant
Di m count As Long ' Open t he model Si ngl eBr anchObj . OpenModel “C: \ Progr am Fi l es\ Schl umber ger \ Pi pesi m\ Case St udi es\ Open Li nk\ Gas Li f t Per f ormance. bps” ' Expor t Ps m f i l e Di m Expor t Fi l e As St r i ng Di m Oper at i onFi l e As St r i ng Expor t Fi l e = Si ngl eBr anchObj . Expor t Engi neFi l es2( Oper ati onFi l e) ' Get obj ect i nf or mat i on Di m count As Long Di m obj t ype As Long Di m obj name As St r i ng Si ngl eBr anchObj . Get Count Obj ect sI nProf i l e count ' Wr i t e t o the spr eadsheet t he l i st of obj ect s i n t he si ngl e br anch model For i ndx = 0 To count - 1 Si ngl eBr anchObj . Get Obj ect At I ndex i ndx, obj t ype, obj name Cel l s( i ndx + 1, 1) = obj name Cel l s( i ndx + 1, 2) = obj t ype Next ' Get Sensi t i vi t y I nf or mat i on f or t he t ubi ng ( t ype = 16) wi t h i dent i f i er Tub_1 Si ngl eBr anchObj . Get Sensi t i vi t yI nf o 16, Tub_1, sensvar names, obj r ef ' Wr i t e t he l i st of sensi t i vi t y var i abl es t o t he spr eadsheet Di m name As Var i ant For Each name I n sensvar names r . Cel l s( i , 1) = name i =i +1 Next
Page 42 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IISingleBranchModel2 Interface
IISingleBranchModel2 object - Properties •
UFactorMultiplier As Double
Gets/sets the u‐factor multiplier for a single branch model
VBA Sample Code
Di m Si ngl eBr anchObj As New NET32COMLi b. I Si ngl eBr anchModel Di m Si ngl eBr anchObj Lnk As NET32COMLi b. I I Si ngl eBr anchModel 2 Si ngl eBr anchObj . OpenModel “C: \ Progr am Fi l es\ Schl umber ger \ Pi pesi m\ Case St udi es\ Wel l Desi gn and Per f or mance\ Fl ow Cor r el at i on Mat ch. bps” Set Si ngl eBr anchObj Lnk = Si ngl eBr anchObj Di m st r val ue As St r i ng st r val ue = "Pr evi ous U- Fact or mul t i pl i er val ue f or t he model " + CSt r ( Si ngl eBr anchObj Lnk. UFact or Mul t i pl i er ) MsgBox st r val ue ' set new u- f act or mul pl i er val ue f or t he model Si ngl eBr anchObj Lnk. UFact or Mul t i pl i er = 2
IObjectProperties Interface ProfileObj object - Properties •
Fluid As FluidModel
Gets a FluidModel interface object (see description below)
ProfileObj object - Get Methods •
•
•
GetLastError () As String
Returns an error description
GetPropertyNames (PropNames) As Long
Returns in PropNames the array of properties defined for the object. Function’s return value is the number of properties
GetValue (PropName As String, pValue, pUnitStr As String, Index As Long) As Boolean
Gets the specified property (PropName) value in Value in the given units (UnitStr ). Return value is True if the property was set successfully, otherwise False. Implemented PropNames: see Defined constants and strings. Index is a reserved argument, set it to ‘–1’.
ProfileObj object - Set Methods •
SetValue (PropName As String, value, UnitStr As String, Index As Long) As Boolean
Sets the specified property (PropName) value in Value in the given units (UnitStr ). Return value is True if the property was set successfully, otherwise False. Implemented PropNames: see Defined constants and strings. Index is a reserved argument, set it to ‘–1’.
Page 43
PIPESIM Version 2011.1 OpenLink Reference Manual
ITubing Interface TubingObj Object - Get Methods •
GetCountDownholeEquipment (Type As Long) As Long
Returns the number of items specified in the detailed tubing model of a given type of equipment Type: any of
16 – Tubing section 18 ‐ Choke 22 ‐ Centrifugal Pump 24 ‐ Injection Point 25 ‐ Separator 32 – SSSV 33 – Gas Lift Valve (See Object Type Identifiers) •
•
GetCountTubingSection () As Long
Similar to GetCountDownholeEquipment, but specific to tubing sections
GetDeviationSurvey_SI (Type As Long) As Variant
Returns in a Variant the matrix of doubles defined as two columns and a variable number of rows. The variable in each column depends in the requested Type. Type: 0 = md vs. tvd, 1 = md vs. angle, 2 = tvd vs. angle
All values are in strict SI units •
GetDownholeEquipment (Type As Long, Index As Long, label As String) As Double
Returns the md (as function’s return value) and the label of a given Type of downhole equipment and at given Index. Type: any of
16 – Tubing section 18 ‐ Choke 22 ‐ Centrifugal Pump 24 ‐ Injection Point 25 ‐ Separator 32 – SSSV 33 – Gas Lift Valve Index: the 0 based positional index of the item. Index = 0 refers to the top‐most item closest to the wellhead. •
GetDownholeEquipmentAtIndex (Index As Long, Type As Long, label As String) As Double
Returns the equipment type, label and md (as function’s return value) in strict SI units at a given Index. See GetDownholeEquipment for definition of Index
Page 44 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
•
GetGeothermalSurvey_SI (vbIsTVD As Boolean) As Variant
Returns the geothermal survey in Variant matrix of doubles defined as three columns and a variable number of rows. The columns are defined as Depth vs. Ambient Temperature vs. U value. Depth is TVD if vbIsTVD = true, otherwise MD
GetTubingSection (Index As Long, label As String) As Double
Similar to GetDownholeEquipment, but specific to tubing sections
GetMDatTVD_SI (tvd As Double) As Double
Returns the md given the tvd based on the deviation survey
GetTVDatMD_SI (md As Double) As Double
Returns the tvd given the md based on the deviation survey
GetInputOK (info As String) As Boolean
Validates the tubing data and returns True if configuration is correct, otherwise the function returns False and info contains the error message
TubingObj Object -Set Methods •
•
SetDeviationSurvey_SI (Type As Long, Survey) As Boolean
Sets a deviation survey to a detailed tubing model.
SetGeothermalSurvey_SI (vbIsTVD As Boolean, Survey) As Boolean
Sets a geothermal survey to a detailed tubing model.
See GetDeviationSurvey_SI for available types. Survey must be a variant matrix of double values specified as a two‐ column table with any number of rows (minimum 2). See GetGeothermalSurvey_SI for definition of Survey and vbIsTVD.
TubingObj Object -Properties •
•
InjectionPointFluid (Index As Long) As FluidModel
Gets/sets the FluidModel object for the injection point at a given index. This function is only applicable for compositional models. See ISinglePointCalib object.
RemedialCoiledTubingEnabled As Boolean
Enables/disables Remedial Coiled Tubing option in configuration
TubingObj Object - Operations •
AddDownholeEquipment (Type As Long, md_SI As Double, label As String) As Long
Adds an equipment item to the detailed tubing Type: any of
22 ‐ Centrifugal Pump 24 ‐ Injection Point 25 ‐ Separator 32 – SSSV 33 – Gas Lift Valve
Page 45
PIPESIM Version 2011.1 OpenLink Reference Manual
label : the item’s label
Function returns the 0 based positional index of the added item. Index = 0 refers to the top‐most item closest to the wellhead •
•
AddGasLiftValve_SI (md As Double, manuf As String, series As String, portName As String, portSize As Double, mode As String, ptro As Double, Ap As Double, Ab As Double, nomOD As Double, cv As Double, dpfo As Double) As Long
Adds a gas lift valve to the tubing object. Returns the zero‐ based index corresponding to the valve position with index of the topmost valve equal to 0.
AddTubingSection (BottomMD_SI As Double, label As String) As Long
Adds a section of tubing BottomMD_SI: the bottom md of the section in strict SI units label : the item’s label
Function returns the 0 based positional index of the added section •
•
ClearGasLiftValves ()
Removes all gas lift valves from the tubing
RemoveDownholeEquipment (Type As Long, Index As Long)
Removes a piece of equipment of a given type and at the given Index. Type: any of
22 ‐ Centrifugal Pump 24 ‐ Injection Point 25 ‐ Separator 32 – SSSV 33 – Gas Lift Valve Index : the 0 based positional index of the item. Index = 0 refers to the top‐most item closest to the wellhead •
•
RemoveTubingSection (Index As Long)
Similar to RemoveDownholeEquipment but applicable to tubing sections
DisplayDialog (p_VarUnitManager, fluidtype As Integer) As Boolean
Function invokes tubing configuration dialog and returns True if OK button was clicked, False otherwise. p_VarUnitManager is a Units Manager object and fluidtype can be one of the following values: 0: black oil 1: composition 2: PVT file 3: MFL file
Page 46 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IVertCompObj Interface VertCompObj Object - Get Methods •
GetInputOK (info As String) As Boolean
Validates the flowline data and returns True if configuration is correct, otherwise the function returns False and info contains the error message
VertCompObj Object - Set Methods •
•
•
•
•
SetMultipoint(value As Long) As Boolean
Set either multipoint=1 or isochronal=0 type of IPR data table
SetIPRFluidType(Type As Long) As Boolean
Set fluid type for IPR: type_liquid=0, type_gas=1
SetIPRTable_SI(QPPoints) As Boolean
Sets the IPR table values. QPPoints is a 3‐column array of Doubles, where first column contains Flowrate values, second column contains Pwf values and the third one contains Pws values. All values are in strict SI units
GetConingTableData(IsUsed As Boolean, ConedGasSG As Double, Flowrate, GOR, WCut) As Boolean
Returns the coning table data for the vertical completion. IsUsed is TRUE if it is set and FALSE otherwise, ConedGasSG contains a value for coned gas specific gravity, Flowrate, GOR and WCut are the one‐column arrays of Doubles containing flowrate, GOR and watercut values respectively. All values are in Eng units
GetPSSRelPermTableData(WaterSat, RelPermOil, RelPermWater) As Boolean
Returns the relative permeability table data for the vertical completion with pseudo steady state model. WaterSat, RelPermOil and RelPermWater are the one‐column arrays of Doubles containing water satuation, relative permeability for oil and relative permeability for water, respectively. All values are in Eng units
VertCompObj Object - Oper ations •
•
CalculateIPR() As Boolean DisplayDialog (p_VarUnitManager) As Boolean
Function invokes Vertical Completion configuration dialog and returns True if OK button was clicked, False otherwise. Pass a Null variant as the argument’s value.
Page 47
PIPESIM Version 2011.1 OpenLink Reference Manual
IFlowlineObj Interface FlowlineObj Object - Properties •
Gets/sets HeatTransfer object
HeatTransfer As Object
FlowlineObj Object - Get Methods •
Validates the flowline data and returns True if configuration is correct, otherwise the function returns False and info contains the error message
GetInputOK (info As String) As Boolean
FlowlineObj Object - Operations •
•
•
AddProfileNode_SI (distance As Double, elevation As Double, ambientT As Double, uValue As Double, label As String)
Adds a node to the flowline detailed node description. All values must be given in strict SI units.
ClearDetailedProfile ()
Deletes all nodes in the flowline detailed profile
UseDetailedProfile (UseDetailed As Boolean)
UseDetailed = True: instructs the flowline to use the detailed profile description. UseDetailed = False: use the flowline’s simple description, detailed nodes will be generated automatically.
•
•
•
DisplayDialog (p_VarUnitManager) As Boolean
Function invokes flowline configuration dialog and returns True if OK button was clicked, False otherwise. Pass a Null variant as the argument’s value.
GetNodesCount () As Long
Function returns a number of nodes defined in a detailed profile
GetPipeOD (od as Double, units as String)
Function calculates pipe’s OD based on coating properties
Page 48 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IHeatTransfer Interface HeatTransfer Object - Properties •
UValueType As Long
Gets/sets U Value type. Possible values are 0 for calculated, 1 for insulated, 2 for coated, 3 for bare in air, 4 for bare in water and 5 for user‐specified
•
IsIFCIncluded As Boolean
Gets/sets a Boolean value for inside filem coefficient. True if IFC is included in U Value and False if it is calculated separately.
•
AmbientFluidType As Long
Gets/sets an ambient fluid type. 0 for air and 1 for water.
HeatTransfer Object - Get Methods •
•
•
•
•
•
GetUValue (uVal as Double, units as String)
Returns U Value and units string. Fails if UValueType is set to calculated
GetPipeConductivity (dblVal as Double, units as String)
Returns pipe conductivity value and units string. Fails if UValueType is not calculated
GetAmbientFluidVelosity (dblVal as Double, units as String)
Returns ambient fluid velocity value and units string. Fails if UValueType is not calculated
GetBurialDepth (dblVal as Double, units as String)
Returns pipe burial depth value and units string. Fails if UValueType is not calculated
GetGroundConductivity (dblVal as Double, units as String)
Returns ground conductivity value and units string. Fails if UValueType is not calculated
GetCoatingData_SI (varData)
Returns a pipe coating data array. First column containts layer‐specific conductivity values and a second column containts layer thicknesses. Fails if UValueType is not calculated
HeatTransfer Object - Set Methods •
•
•
•
SetUValue (uVal as Double, units as String)
Sets U Value in specified units. Fails if UValueType is set to calculated
SetPipeConductivity (dblVal as Double, units as String)
Sets pipe conductivity value in specified units. Fails if UValueType is not calculated
SetAmbientFluidVelosity (dblVal as Double, units as String)
Sets ambient fluid velocity value in specified units. Fails if UValueType is not calculated
SetBurialDepth (dblVal as Double, units as String)
Sets pipe burial depth value in specified units. Fails if UValueType is not calculated
Page 49
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
SetGroundConductivity (dblVal as Double, units as String)
Sets ground conductivity value in specified units. Fails if UValueType is not calculated
SetCoatingData_SI (varData)
Sets a pipe coating data. Data has to be passed as an array where first column containts layer‐specific conductivity values and a second column containts layer thicknesses. Fails if UValueType is not calculated
IFluid Interface FluidModel Object - Properties •
Composition As Object
Accesses the ICompositional object (See ISinglePointCalib object)
•
BlackOil As Object
Accesses the IBlackOil object (Ref IBlackOil )
•
FluidModelType As Long
Retrieves the fluid model type: 0: BlackOil, 1: Compositional, 2 PVT File, 3 MFL File
•
OverrideValues As Boolean
Sets/gets whether Wcut/GOR values are overridden from the values defined in the fluid model.
•
WCutoverride_SI As Double
Accesses the watercut override value
•
GORoverride_SI As Double
Accesses the GOR override value
•
OGRoverride_SI As Double
Accesses the OGR override value
•
LGRoverride_SI As Double
Accesses the LGR override value
•
GLRoverride_SI As Double
Accesses the GLR override value
•
GORoverride_Type As Integer
Accesses which GOR type is being overridden (0=GLR, 1=GOR, 2=LGR, 3=OGR)
•
IsLocalFluid As Boolean
Sets/gets whether the object is using a local fluid model
•
CompositionType As Long
Sets/gets whether the local composition is a PVT file or a defined PIPESIM composition or local MFL file
•
FluidName As String
Sets/gets a fluid name
FluidModel Object - Get Methods •
GetInputOK (info As String) As Boolean
Validates the fluid model data and returns True if configuration is correct, otherwise the function returns False and info contains the error message
Page 50 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
FluidModel Object - Operations •
DisplayDialog (p_VarUnitManager) As Boolean
Function invokes fluid configuration dialog and returns True if OK button was clicked, False otherwise. Pass a Null variant as the argument’s value.
IProjectInfo Interface ProjectInfo Object - Properties •
Description As String
Gets/sets string property
•
User As String
Gets/sets string property
•
Job As String
Gets/sets string property
•
Company As String
Gets/sets string property
•
Manager As String
Gets/sets string property
•
Remarks As String
Gets/sets string property
•
Date As String
Gets/sets string property
•
Field As String
Gets/sets string property
•
WellNumber As String
Gets/sets string property
•
Lease As String
Gets/sets string property
•
Country As String
Gets/sets string property
•
Address As String
Gets/sets string property
•
Email As String
Gets/sets string property
•
Phone As String
Gets/sets string property
•
Fax As String
Gets/sets string property
IErosionCorrosion Interface ErosionCorrosion Object - Properties •
CalculatePH As Long
Gets/sets value for Actual pH property (1 – calculate value, 0 – use user‐defined pH value)
•
CorrosionEfficiency As Double
Gets/sets corrosion efficiency value
•
CorrosionModel As Long
Gets/sets value for Corrosion Model property (0 – none, 1 – use de Waard (1995) model )
•
ErosionEfficiency As Double
Gets/sets erosion efficiency value
•
ErosionModel As Long
Gets/sets value for Erosion Model property (0 – API 14e model, 1‐ SALAMA (2000))
Page 51
PIPESIM Version 2011.1 OpenLink Reference Manual
•
ErosionRate_Eng As Double
Gets/sets acceptable erosion rate value
•
ErosionVelocityConst As Double
Gets/sets erosion velocity constant value
•
GeometryConstant As Double
Gets/sets geometry constant value
•
SandGrainSize_Eng As Double
Gets/sets sand grain size value
•
SandProdRatio As Double
Gets/sets sand production ratio value
•
UserDefinedPH As Double
Gets/sets user‐defined pH value
ProjectInfo Object Example VBA Sample Code
Di Di Di Di
m Si ngl eBr anchObj As New NET32COMLi b. I Si ngl eBr anchModel m equi pnames As Var i ant m sensvar names As Var i ant m obj r ef As Var i ant
Di m count As Long ' Open t he model Si ngl eBr anchObj . OpenModel “C: \ Progr am Fi l es\ Schl umberger \ PI PESI M\ Case Li nk\ Gas Li f t Per f or mance. bps”
Studi es\
Open
' Expor t Ps m f i l e Di m Expor t Fi l e As St r i ng Di m Oper at i onFi l e As St r i ng Expor t Fi l e = Si ngl eBr anchObj . Expor t Engi neFi l es2( Oper ati onFi l e) ' Get obj ect i nf or mat i on Di m count As Long Di m obj t ype As Long Di m obj name As St r i ng Si ngl eBr anchObj . Get Count Obj ect sI nProf i l e count ' Wr i t e t o the spr eadsheet t he l i st of obj ect s i n t he si ngl e br anch model For i ndx = 0 To count - 1 Si ngl eBr anchObj . Get Obj ect At I ndex i ndx, obj t ype, obj name Cel l s( i ndx + 1, 1) = obj name Cel l s( i ndx + 1, 2) = obj t ype Next ' Get Sensi t i vi t y I nf or mat i on f or t he t ubi ng ( t ype = 16) wi t h i dent i f i er Tub_1 Si ngl eBr anchObj . Get Sensi t i vi t yI nf o 16, Tub_1, sensvar names, obj r ef ' Wr i t e t he l i st of sensi t i vi t y var i abl es t o t he spr eadsheet Di m name As Var i ant For Each name I n sensvar names r . Cel l s( i , 1) = name i =i +1 Next Page 52 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
INetModel Interface INetModel Interface - Get Methods •
•
DoesCustomKeyExists (KeyName as String) as Boolean
Returns true if custom data has been stored against the KeyName string
GetNameList (ObjectType As Long, pNameArray, Count As Long)
Returns in pNameArray an array of String with the names of objects of the given type (ObjectType). The number of objects found is returned in Count. ObjectType can be any of:
1 ‐ Folder 2 ‐ Source 3 ‐ Sink 4 ‐ Junction 5 ‐ Branch 6 ‐ Text Object 7 ‐ Production Well 8 – Injection Well •
GetHasArtificialLift (ObjectType As Long, ObjectName As String, Lift As Long)
Returns: 0: no artificial lift 1: gas lift injection 2: ESP
‐1: Object not found ObjectType must be Tubing type (16) ObjectName the name of the tubing •
•
•
GetEquipmentInfo (EquipmentType As Long, ParentType As Long, ParentObject As String, EquipmentNames, Count As Long)
Returns the names of equipment of type EquipmentType (See GetNameList () for the ISingleBranch object for available types), which are part of the single branch model of object ParentObject of type ParentType. ParentType should be ProductionWell (7), InjectionWell (8), or Branch (5)
GetLastError (ErrorStr As String)
Returns the last error message produced by the interface
GetBoundaryProperties (ObjectName As String, Pressure As Double, Temperature As Double, Fluidrate As Double, Fluidtype As Long)
Returns the boundary properties set in the model for object with identifier ObjectName. ObjectName must be a boundary object (Source, Sink, Production Well or Injection Well) Pressures in psia Temperatures in F
Page 53
PIPESIM Version 2011.1 OpenLink Reference Manual
Fluidtype = 0 (liquid rate), Fluidrate in STB/D Fluidtype = 1 (gas rate), Fluidrate in mmscf/d Fluidtype = 2 (mass rate), Fluidrate in lb/s •
•
•
•
GetBoundaryProperties_SI (ObjectName As String, Pressure As Double, Temperature As Double, Fluidrate As Double, fluidtype As Long)
Similar to GetBoundaryProperties except that this function returns the properties in strict SI units.
GetBoundaryBlackOil (ObjectName As String, BlackOil As Object) As Boolean
Gets the BlackOil object used by the source with identifier ObjectName. Only applicable for BlackOil models. The function returns True in case of success and False otherwise
GetBoundaryComposition (ObjectName As String, Composition As Object) As Boolean
Gets the Compositional object used by the source with identifier ObjectName. Only applicable for compositional models, The function returns True in case of success and False otherwise
GetBoundaryCompositionType (ObjectName As String, Type As Long)
Returns the composition model location used by the ObjectName source object: 0: object is using a locally defined composition 1: object is using a locally defined PVT file 2: object is using the models globally defined composition or PVT file 3: object is using a locally defined MFL file
•
•
GetBoundaryPVTFile (ObjectName As String, PVTFilename As String) As Boolean
Gets the PVT file used by the source with identifier ObjectName. Only applicable for Compositional/PVT models
GetBoundaryType (ObjectName As String, Type As Long, CurveOption As Long)
Returns the boundary condition type specified for the ObjectName source: Type = 0 pressure and/or flowrate specified Type = 1 PQ curve specified
If Type = 1 then CurveOption returns: CurveOption = 0 create curve when required CurveOption = 1 create curve at every engine run CurveOption = 2 use a specified PQ curve file •
•
•
GetCountObjectsInProfile (NetObjectName As String) As Long
Returns the number of objects in the single branch model defined for NetObjectName.
GetIsModelRunning () As Boolean
Returns True if simulation is running
GetPropertyNames (ObjectName As String, ParentName As String, PropNames) As Long
Returns in PropNames the list of properties defined for the object ObjectName. If ObjectName is defined at the single branch level then ParentName must be the identifier for its parent Network object. Return value is the number of properties
Page 54 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
•
•
•
•
GetPropertyVal (ObjectName As String, ParentName As String, PropName As String, pValue As Double, pUnitStr As String) As Boolean
For specified property (PropName) in the specified object (ObjectName) function gets a property value in Value and the units in UnitStr . Return value is True if the if the property was retrieved successfully, otherwise False. ParentName is the object at the network level and should define ObjectName in its single branch model. To get properties of an of an object at network level, then ObjectName needs to be the object name at network level and ParentName needs to be empty. Implemented PropNames: see Defined constants and strings
GetPropertyValAtObjectIndex (ObjectName As String, ParentName As String, PropName As String, pValue As Double, pUnitStr As String, SubObjectType As Long, Index As Long) As Boolean
Gets a specified property value. This function extends the functionality of GetPropertyVal by allowing you to retrieve a property from a specified sub‐component within an object. A typical use of this of this is when for instance it is required to Index = get a gas lift flowrate (PropName) from the top (Index = 0) gas lift injection point (SubObjectType) in the tubing ‘Tubing_1’ (ObjectName). ParentName is the object at the network level and should define ObjectName in its single branch model. For available options see Defined constants and strings
GetPropertyStringAtObjectIndex (ObjectName As String, ParentName As String, PropName As String, pValue As String, Index As Long) As Boolean
The function is similar to GetPropertyValAtObjectIndex (…) but for properties defined as string
GetSingleBranchModel (NetObjectName As String) As ISingleBranchModel
Returns the ISingleBranchModel object for the NetObjectName specified
GetNamesInFolder(FolderName GetNamesInFolder(FolderName As String, ObjectType As Long, pNameArray, Count As Long) Long)
Returns in pNameArray an array of String of String with the names of objects of objects of the of the given type (ObjectType). The number of objects of objects found is returned in Count. All allowed ObjectType values are described for GetNameList function
•
•
GetNodeCooordinates(ObjectName As GetNodeCooordinates(ObjectName String, pCoordArray) As Boolean
Returns the array of coordinates of coordinates for GUI element with name in ObjectName parameter. Values are central point X, central point Y, left, top, right, and bottom
GetConnectionInfo(pBranchArray, GetConnectionInfo(pBranchArray, pSNodeArray, pENodeArray) As Boolean
Returns the array of all of all branch names, the array of starting nodes and the array of ending of ending nodes for those branches. Note: The start and end nodes are determined by the branch geometry (e.g., for flowline, it is consistent with the arrow icon direction)
•
GetBoundaryCurveFile(ObjectName As GetBoundaryCurveFile(ObjectName String) As String
Returns the offline curve file name for the specified well name
Page 55
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
•
•
GetCustomData(KeyName GetCustomData(KeyName As String, pValue) As Boolean
Returns a variant byte array of the of the custom data that has been stored against the supplied KeyName string
GetCustomKeys(pKeyNameArray GetCustomKeys(pKeyNameArray)) As Boolean
Returns an array of the of the KeyNames strings for which custom data has been stored
GetFlowrateLimits_SI(ObjectName GetFlowrateLimits_SI(ObjectName as String) String) As Variant
Returns a two‐column array of Doubles of Doubles for specified branch. First column contains lower limits for mass flowrate, liquid flowrate, water flowrate, oil flowrate and gas flowrate. The second one contains upper limits for the same rates. Note that the support of lower of lower limits has been discontinued but the interface has not changed. Therefore, the lower limits values returned are all unset.
•
IsLocalFlowCorrelationUsed(ObjectName IsLocalFlowCorrelationUsed(ObjectName as String) String) As Boolean
Returns True is a branch or well uses locally defined flow correlation and False otherwise
INetModel Interface - Set Methods •
•
•
•
SetBoundaryBlackOil (ObjectName As String, BlackOil As Object) As Boolean
Sets a BlackOil object to a given source. The function returns True in case of success of success and False otherwise
SetBoundaryComposition (ObjectName As String, Composition As Object) As Boolean
Sets a compositional object to a source with identifier ObjectName. Only applicable for compositional models. The function returns True in case of success of success and False otherwise
SetBoundaryCurveFile (ObjectName As String, CurveFileName As String) As Boolean
Sets the source boundary condition as defined by the curve in file CurveFileName. The format of the of the file must be that of a plot file revision C or later. One way to generate a boundary file is using the Well Performance Curves operation in PIPESIM. The object identified by ObjectName must be a Production Well.
SetBoundaryFluidrate (ObjectName As String, Fluidtype As Long, value As Double, UnitStr As String)
Sets the given value in the given units as fluidrate boundary condition for source object ObjectName. Fluidtype can be any of: 0 = liquid rate, 1 = gas rate, 2 = mass rate
•
•
SetBoundaryPressure (ObjectName As String, value As Double, UnitStr As String)
Sets the given value in the given units as pressure boundary condition for source object ObjectName. The boundary pressure could be the pressure of a of a generic source in network, or a generic source in a well branch, or a completion (bottom most if multiple) if multiple) in a well branch.
SetBoundaryPVTFile (ObjectName As String, PVTFilename As String) As Boolean
Sets a PVT file to a given source. PVTFilename must contain the full path to a PVT file
Page 56 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
•
•
SetBoundarySourcePQPoints (ObjectName As String, PQPoints, fluidtype As Long, PressureUnits As String, FlowrateUnits As String) As Boolean
Sets a number of pressure of pressure and flowrate pairs as a boundary condition to the referred ObjectName. PQPoints is a 2‐ dimensional array of pressure/flowrate of pressure/flowrate values. The object must be of the of the type generic source. Number of data of data points cannot exceed 30.
SetBoundaryTemperature (ObjectName As String, value As Double, UnitStr As String)
Sets the given value in the given units as temperature boundary condition for source object ObjectName. The boundary temperature could be the temperature of a of a generic source in network, or a generic source in a well branch, or a completion (bottom most if multiple) if multiple) in a well branch.
SetBoundaryType (ObjectName As String, Type As Long, CurveOption As Long)
Sets the type of boundary of boundary condition for source object ObjectName. Type = 0 for pressure and flowrate boundary condition Type = 1 for curve
If the If the Type is curve (1) AND the source object is a Production Well then CurveOption controls how the wells‐ offline file is created or used: CurveOption = 0 create automatically when required CurveOption = 1 create automatically every time engine is run CurveOption = 2 use file (See SetBoundaryCurveFile (…)) (…)) •
•
•
SetPropertyVal (ObjectName As String, ParentName As String, PropName As String, value As Double, UnitStr As String) As Boolean
Sets the specified property (PropName) in the specified object (ObjectName) to the value given in Value in the given units (UnitStr ). ). Function returns True if the if the property was set successfully, otherwise False. ParentName is the object at the network level and should define ObjectName in its single branch model. If properties If properties of an of an object at network level needs to be set, then ObjectName needs to be the object name at network level and ParentName needs to be empty. Implemented PropNames: see Defined constants and strings.
SetPropertyValAtObjectIndex (ObjectName As String, ParentName As String, PropName As String, value As Double, UnitStr As String, SubObjectType As Long, Index As Long) As Boolean
This function extends the functionality of SetPropertyVal of SetPropertyVal by allowing you to set a property to a specified sub‐ component within an object. A typical use of this of this is when for instance it is required to set a gas lift flowrate Index = 0) gas lift injection (PropName) through the top (Index = point (SubObjectType) in the tubing ‘Tubing_1’ (ObjectName) which is defined for Well_1 (ParentName). For available options see Defined constants and strings.
SetPropertyStringAtObjectIndex (ObjectName As String, ParentName As String, PropName As String, value As String, Index As Long) As Boolean
Similar to SetPropertyValAtObjectIndex (…) except that PropName is a string type property.
Page 57
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
SetPVTFile (bstrPVTFilename As String)
Sets the compositional file (.pvt) to be used as the main fluid in the simulations
SetSingleBranchModel (NetObjectName As String, filename As String) As Boolean
Sets the underlying single branch model by way of its associated .bps file to a network object.
SetCustomData(KeyName As String, pValue) As Boolean
Stores a variant array of byte data against a KeyName string. This can be used to persist additional custom data, and can later be retrieved by specifying the KeyName
SetFlowrateLimits_SI(ObjectName as String, Limits)
Sets flowrate limits for specified branch passing a two‐ column array of Doubles. First column contains lower limits for mass flowrate, liquid flowrate, water flowrate, oil flowrate and gas flowrate. The second one contains upper limits for the same rates. Note: The support of lower limits has been discontinued but the interface has not changed. Therefore, the lower limits values provided are not stored, nor used and will be overridden by the default unset values for flow limits.
INetModel Interface - Properties •
BlackOilDefault As Object
Gets/sets the default BlackOil model to/from a BlackOil object
•
CompositionDefault As Object
Gets/sets the default composition to/from a Composition object
•
FlowCorrelation As Object
Gets/sets the flow correlation properties to/from a FlowCorrelation object
UseNetworkFlowCorrelationOption sControl As Long
Gets/sets the flag value to use network flow correlation options control (if = 1) or to use local branch options (if = 0)
FluidModelType As Long
0: BlackOil, 1: Compositional, 2: PVT File, 3: MFL File
LocalFluid (ObjectName As String) As FluidModel
Gets/sets the Fluid object for the specified object (ObjectName)
•
ModelFileName As String
Returns the file path of the current model
•
ModelBuilder As ModelBuilder
Returns a ModelBuilder object ‐ see ModelBuilder
•
ProjectInfo As ProjectInfo
Get the ProjectInfo object to access project specific data
•
ErosionCorrosion As Object
Gets/sets the ErosionCorrosion object
•
UseNetErCorrSettings As Long
Gets/sets the flag value to use network erosion & corrosion settings over local branches settings (if = 1) or to use local settings otherwise
•
BottomKeywords As String
Gets/sets the network engine keywords to be added at bottom of tnt file
•
TopKeywords As String
Gets/sets the network engine keywords to be added on top
•
•
•
Page 58 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
of tnt file •
•
AppVersion As String
Gets the version of PIPESIM
IsLocalFluidUsed (ObjectName As String) As Boolean
Returns True if a specified branch or network source are set to use a localy defined fluid or if a production well is multilayered. otherwise a property is set to False (network default fluid is used) ‐ Note: Property is read‐only
•
HeatTransferOptionsPipeBurialMet hod As long
Gets/sets the flag value for heat transfer options pipe burial method: 1983: 1983 method 2000: 2000 method (set to this value if given value is not 1983, 2000, or 2009) 2009: 2009 method
•
HeatTransferOptionsIFCMethod As long
Gets/sets the flag value for heat transfer options inside film coefficient method: 1: Kaminsky 2: Kreith Separate Reynolds number (set to this value if given value is not 1, or 2)
•
•
HeatTransferOptionsUValueMultipl ier As double
Gets/sets the value for heat transfer options U value multiplier
EnableHydrateSubcoolingCalculatio n As long
Gets/sets the flag value for heat transfer options hydrate subcooling calculation: 0: disable 1: enable (set to this value if given value is not 0, or 1) Note: Property is for compositional models only
•
UseNetworkHeatTransferOptions As long
Gets/sets the flag value to use network heat transfer options (if = 1) or to use local branch options (if = 0)
INetModel Interface - Operations •
ExportEngineFiles ()
This function generates an ASCII file ( .tnt) and a number of ASCII files (.pst) in the PIPESIM engine keyword language that is used as input by the calculation engine. This .tnt file can then be used with PIPESIM expert mode.
•
KillSimulationProcess ()
Terminates the simulation process
OpenModel (bstrModelFileName As String)
Opens the given network model. Filename must be a valid PIPESIM network model file (.bpn)
•
This function must be called first when using this object. Note: Will return false also if the number of component in any composition or in the model in general is more than 50.
Page 59
PIPESIM Version 2011.1 OpenLink Reference Manual
•
RunNetwork (bRestart As Boolean)
Runs the currently opened model by calling the calculation engine program as specified in the PIPESIM installation. If bRestart is True the simulation will load any previously restart files (.rst files) as its initial conditions.
•
•
•
RunNetwork2 (bRestart As Boolean, EngSwitches As String)
Similar to RunNetwork and also accepts one or more switches to be passed to the simulation engine.
SaveModel (bstrPathName As String) As Boolean
Saves the currently opened model to a file given by bstrPathName
ResetLocalErCorrSettings() As Boolean
Overrides all local erosion and corrosion settings with the global ones
ModelBuilder object SetNodeCoordinates (NodeName As String, X As Long, Y As Long)
Sets the node coordinates for node object NodeName to X, Y coordinates
•
TopLeftCoordinate_X As Long
Sets/returns the top left X coordinate of the graphical panel. SetNodeCoordinates values are passed in relation to TopLeftCoordinate_X and TopLeftCoordinate_Y
•
TopLeftCoordinate_Y As Long
As above for the Y coordinate
•
BottomRightCoordinate_X As Long
Returns the bottom right X coordinate of the graphical panel (this is a read‐only property)
•
BottomRightCoordinate_Y As Long
As above for the Y coordinate
GetNodeCoordinates (NodeName As String, X As Long, Y As Long)
Gets the node X, Y coordinates for node object NodeName
GetLastError () As String
Returns the last error message produced by the object
•
•
•
IBlackOil object IBlackOil object - Properties •
API As Double
API value
•
API_Type As Integer
API type (0=API, 1=DOD)
•
ConingEnabled As Boolean
True/False
•
ConingGasSG As Double
Coning gas specific gravity
•
ConingRateType As Long
0: liquid, 1: gas, 2: mass
•
ConingTable_SI As Variant
A 3‐column array with rate, gor/glr, wcut values, use strict SI units
•
GasSG As Double
Black oil specific gravity
•
GLR_SI As Double
Gas/Liquid Ratio use strict SI units
Page 60 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GOR_SI As Double
Gas/Oil Ratio use strict SI units
•
GOR_Type As Integer
(0=GLR, 1=GOR, 2=LGR, 3=OGR)
•
LGR_SI As Double
Liquid/Gas Ratio use strict SI units
•
OGR_SI As Double
Oil/Gas Ratio use strict SI units
•
SolutionGasCorrelation As Long
0 = Lasater, 1 = Standing, 2 = Vazquez and Beggs, 3 = Glaso, 4 = Kartoatmodjo
•
Watercut As Double
Water Cut
•
WaterSG As Double
Water specific gravity
•
Name As String
Name of the fluid
•
Comment As String
String containing the text in the comments field
•
Calibration As Long
Calibration type: 0 – no calibration, 1 – single point and 2 ‐ multipoint
•
SinglePointCalib As Object
Single point calibration data object
•
MultiPointCalib As Object
Multipoint calibration data object
•
Viscosity As Object
String containing the text in the comments field
•
ThermalData As Object
String containing the text in the comments field
•
Contaminants As Variant
Array of Doubles for contaminant values in a following order: CO2, H2S, N2, H2 and CO
•
WGR_Type As Integer
(0=Watercut, 1=GWR, 2=WGR)
•
GWR_SI As Double
Gas/Water Ratio use strict SI units
•
WGR_SI As Double
Water/Gas Ratio use strict SI units
IBlackOil object - Methods •
•
SetBubblePointCalibration (SatGas_SI As Double, Pressure_SI As Double, Temperature_SI As Double)
Sets the bubble point data
GetBubblePointCalibration (Pressure_SI As Double, Temperature_SI As Double) As Double
Gets the bubble point data. Return value is a Saturation Gas correlation : 0 for Lasater, 1 for Standing, 2 for Vazquez and Beggs, 3 for Glaso, 4 for Kartoatmodjo, 5 for De Ghetto at al or 6 for Petrosky‐Farshad
IBlackOil object - Operations •
SetBlob (sBlob As String)
Sets data for the required fluid sBlob = String containing black oil information
Page 61
PIPESIM Version 2011.1 OpenLink Reference Manual
ISinglePointCalib object ISinglePointCalib object – Get Methods •
•
•
•
•
•
GetCalibrationAtBubblePoint (Pressure_SI As Double, Temperature_SI As Double, SatGas_SI As Double) as Long
Function gets calibration data at bubble point. The return value is Saturation Gas correlation: 0 for Lasater, 1 for Standing, 2 for Vazquez and Beggs, 3 for Glaso, 4 for Kartoatmodjo, 5 for De Ghetto et al. or 6 for Petrosky‐Farshad
GetCalibrationAboveBubblePoint (OFVF As Double, Density_SI as Double, Compressibility_SI as Double, Pressure_SI As Double, Temperature_SI As Double) as Long
Function gets calibration data above bubble point. The return value is density type: 0 for Density, 1 for OFVF or 3 for Compressibility
GetCalibrationBelowBubblePoint (OFVF As Double, Density_SI as Double, Pressure_SI As Double, Temperature_SI As Double) as Long
Function gets calibration data below bubble point. The return value is density type: 0 for Density or 1 for OFVF
GetLiveOilViscBelowBubblePoint (Pressure_SI As Double, Temperature_SI As Double, LiveOilVisc_SI) as Long
Function gets live oil viscosity data below bubble point. The return value is Live Oil Viscosity Correlation: 0 for Beggs & Robinson, 1 for Chew & Connally, 2 for Kartoatmodjo, 3 for Khan, 4 for De Ghetto et al., 5 for Hossain, 6 for Elsharkawyor 7 for Petrosky‐Farshad
GetGasViscBelowBubblePoint (Pressure_SI As Double, Temperature_SI As Double) as Double
Function gets gas viscosity data below bubble point. The return value is gas viscosity.
GetGasZBelowBubblePoint (GasZ as Double, Pressure_SI As Double, Temperature_SI As Double) as Long
Function gets gas Z data below bubble point. The return value is gas Z correlation: 0 for Standing, 1 for Hall Yarborough or 2 for Robinson et al.
ISinglePointCalib object – Set Methods •
•
•
SetCalibrationAtBubblePoint (SolGasCorr as Long, Pressure_SI As Double, Temperature_SI As Double, SatGas_SI As Double)
Function sets calibration data at bubble point. The acceptable values for Saturation Gas correlation are: 0 for Lasater, 1 for Standing, 2 for Vazquez and Beggs, 3 for Glaso, 4 for Kartoatmodjo, 5 for De Ghetto et al. or 6 for Petrosky‐Farshad
SetCalibrationAboveBubblePoint (DensType as Long, OFVF As Double, Density_SI as Double, Compressibility_SI as Double, Pressure_SI As Double, Temperature_SI As Double)
Function sets calibration data above bubble point. The acceptable values for density type are: 0 for Density, 1 for OFVF or 3 for Compressibility
SetCalibrationBelowBubblePoint (DensType as Long, OFVF As Double,
Function sets calibration data above bubble point. The acceptable values for density type are: 0 for Density or 1
Page 62 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
Density_SI as Double, Pressure_SI As Double, Temperature_SI As Double)
for OFVF
SetLiveOilViscBelowBubblePoint (LiveOilCorr as Long, Pressure_SI As Double, Temperature_SI As Double, LiveOilVisc_SI)
Function sets live oil viscosity data below bubble point. The acceptable values for Live Oil Viscosity Correlation are: 0 for Beggs & Robinson, 1 for Chew & Connally, 2 for Kartoatmodjo, 3 for Khan, 4 for De Ghetto et al., 5 for Hossain, 6 for Elsharkawyor 7 for Petrosky‐Farshad
SetGasViscBelowBubblePoint (Pressure_SI As Double, Temperature_SI As Double, GasVisc_SI as Double)
Function sets gas viscosity data below bubble point.
SetGasZBelowBubblePoint (GasZCorr as Long, GasZ as Double, Pressure_SI As Double, Temperature_SI As Double)
Function sets gas Z data below bubble point. The acceptable values for gas Z correlation are: 0 for Standing, 1 for Hall Yarborough or 2 for Robinson et al.
IMultiPointCalib object IMultiPointCalib object – Properties •
OFVF as Boolean
True for Oil FVF or False for Oil Density
IMultiPointCalib object – Get Methods •
GetCalibUnits (UnitsArray)
Function returns an array of Strings containing units for Pressure, Solution Gas GOR, Oil Density, Oil Viscosity and Gas Viscosity
•
GetCorrelations (CorrArray)
Function returns an array of Longs containing correlations for Solution Gas, OFVF, Oil Viscosity, Gas Z factor and Gas Viscosity. Available values for each correlation are the same as for ISinglePointCalib methods
GetTemperature (Value As Double, Units as String)
Function returns a calibration temperature and units.
GetCalibrationAtBubblePoint (CalibData)
Function gets calibration data at bubble point as an array of Doubles. It contains values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
GetCalibrationAboveBubblePoint (CalibData)
Function gets calibration data above bubble point as a two‐ dimensional array of Doubles. Each row contains values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
GetCalibrationBelowBubblePoint (CalibData)
Function gets calibration data below bubble point as a two‐ dimensional array of Doubles. Each row contains values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z
•
•
•
•
Page 63
PIPESIM Version 2011.1 OpenLink Reference Manual
factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
Page 64 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IMultiPointCalib object – Set Methods •
SetCalibUnits (UnitsArray)
Function sets units for Pressure, Solution Gas GOR, Oil Density, Oil Viscosity and Gas Viscosity supplied as an array of Strings
•
SetCorrelations (CorrArray)
Function sets correlations for Solution Gas, OFVF, Oil Viscosity, Gas Z factor and Gas Viscosity supplied as an array of Longs. Available values for each correlation are the same as for ISinglePointCalib methods
SetTemperature (Value As Double Units as String)
Function sets a calibration temperature in specified units.
SetCalibrationAtBubblePoint (CalibData)
Function sets calibration data at bubble point passed as an array of Doubles. It must contain values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
SetCalibrationAboveBubblePoint (CalibData)
Function sets calibration data above bubble point passed as a two‐dimensional array of Doubles. Each row must contain values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
SetCalibrationBelowBubblePoint (CalibData)
Function sets calibration data below bubble point passed as a two‐dimensional array of Doubles. Each row must contain values for Pressure, Solution Gas, OFVF or Density, Oil Viscosity, Gas Z factor and Gas Viscosity. All values are in units supplied by GetCalibUnits method
•
•
•
•
IViscosityData object IViscosityData object – Properties •
DeadOilCorr as Long
Dead Oil Viscosity correlation. Possible values are: 0 for Beggs & Robinson, 1 for Glaso, 2 for Kartoatmodjo, 3 for De Ghetto et al., 4 for Hossain, 5 for Elsharkawy, 6 for Petrosky‐Farshad, 7 for user –specified 2 points or 8 for user‐supplied table
•
LiveOilCorr as Long
Live Oil Viscosity correlation. Possible values are: 0 for Beggs & Robinson, 1 for Chew & Connally, 2 for Kartoatmodjo, 3 for Khan, 4 for De Ghetto et al., 5 for Hossain, 6 for Elsharkawyor 7 for Petrosky‐Farshad
•
EmulViscosity as Long
Emulsion Viscosity Method. Possible values are: 0 for continuous phase, 1 for volume ratio, 2 for Pipesim Original Woelflin Loose Emulsion, 3 for Woelflin Loose Emulsion, 4 for
Page 65
PIPESIM Version 2011.1 OpenLink Reference Manual
Woelflin Medium Emulsion, 5 for Woelflin Tight Emulsion, 6 for Brinkman, 7 for Vand with Vand coefficients, 8 for Vand with Barnea & Mizrahi coefficients, 9 for Vand with user‐ supplied coefficients, 10 for Richardson, 11 for Leviton & Leighton and 12 for user‐supplied table •
Undersaturated Oil Viscosity. Possible values are: 0 for Vasquez &Beggs, 1 for Kouzel, 2 for Kartoatmodjo, 3 for Khan, 4 for De Ghetto et al., 5 for Hossain, 6 for Elsharkawy, 7 for Bergman & Sutton, 8 for Petrosky‐Farshad or 9 for none
UsatOilViscosity as Long
IViscosityData object – Get Methods •
•
•
•
•
•
GetDOPoints (Temp1 as Double, Temp2 as Double, TUnits as String, Visc1 as Double, Visc2 as Double, VUnits as String)
Function returns temperature and viscosity values for Dead Oil for user‐specified 2‐point Dead Oil Viscosity Correlation
GetUserViscTable_SI (Table)
Function returns a two‐column array of Doubles containing values for Temperature and Viscosity for user‐supplied table Dead Oil Viscosity Correlation
GetUserEmulTable_SI (Type as Long, Table)
Function returns a three‐column array of Doubles containing values for Temperature, Viscosity Ratio and Viscosity for user‐ supplied table Emulsion Viscosity. Type equals 0 for Temperature‐Viscosity Ratio table or 1 for Temperature‐ Viscosity table.
GetWCutCutoff (Method as Long, WCut As Double, Units as String)
Function returns a watercut cutoff method (0 for user‐ defined or 1for Brauner & Ullman) and a cutoff value and units .
GetEmulCoeffs (Method as Long, Coeff1 as Double, Coeff2 as Double)
Function returns a emulsion viscosity method and user‐ supplied coefficients if applicable. Method equals 9 for Vand with user‐supplied coefficients, 10 for Richardson or ‐1 for all other chosen methods.
GetKouzelCoeffs (ParA as Double, ParB as Double)
Function returns Kouzel coefficients for Undersaturated Oil Viscosity
IViscosityData object – Set Methods
SetDOPoints (Temp1 as Double, Temp2 as Double, TUnits as String, Visc1 as Double, Visc2 as Double, VUnits as String)
Function sets temperature and viscosity values for Dead Oil for user‐specified 2‐point Dead Oil Viscosity Correlation
•
SetUserViscTable_SI (Table)
Function sets a user‐supplied table for Dead Oil Viscosity Correlation passing a two‐column array of Doubles containing values for Temperature and Viscosity.
•
SetUserEmulTable_SI (Type as Long,
Function sets a user‐supplied table for Emulsion Viscosity
•
Page 66 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
Table)
passing a three‐column array of Doubles containing values for Temperature, Viscosity Ratio and Viscosity for. Type equals 0 for Temperature‐Viscosity Ratio table or 1 for Temperature‐ Viscosity table.
SetWCutCutoff (Method as Long, WCut As Double, Units as String)
Function sets a watercut cutoff method (0 for user‐defined or 1for Brauner & Ullman) and a cutoff value in specified units.
SetEmulCoeffs (Method as Long, Coeff1 as Double, Coeff2 as Double)
Function sets user‐supplied coefficients for corresponding emulsion viscosity method. Method must be 9 for Vand with user‐supplied coefficients or 10 for Richardson.
SetKouzelCoeffs (ParA as Double, ParB as Double)
Function sets Kouzel coefficients for Undersaturated Oil Viscosity
IThermal object IThermal object – properties •
EnthalpyCalculationMethod as Long
Enthalpy Calculation Method. Possible values are: 0 for 1983 Method, or 1 for 2009 Method.
•
SpecificLatentHeat_SI as Double
Specific Latent Heat in SI unit (J/kg).
IThermal object – Get Methods •
•
GetConductivity (Values, Units as String)
Function returns an array of 3 Doubles containing Gas, Oil and Water thermal conductivity values and a units string
GetEnthropy (Values, Units as String)
Function returns an array of 3 Doubles containing Gas, Oil and Water heat capacity values and a units string
ISinglePointCalib object – Set Methods •
•
SetConductivity (Values, Units as String)
Function sets values for Gas, Oil and Water thermal conductivities passed as an array of 3 Doubles in specified units
SetEnthropy (Values, Units as String)
Function sets values for Gas, Oil and Water heat capacities passed as an array of 3 Doubles in specified units
Page 67
PIPESIM Version 2011.1 OpenLink Reference Manual
ICompositional object ICompositional object - Properties •
Name of the fluid
Name As String
ICompositional object - Get Methods •
GetComment () As String
Returns a string containing the text in the comments field
•
GetPackageType () As Long
Returns the Compositional Package Type to use as long integer according to the following formula: 0 = SIS Flash, 1 = Multiflash, 2 = SPPTS, 101 = Eclipse 300, 102 = DBR, 103 = GERG, 104 = REFPROP V8
•
pVar = False if the flash package is SIS and BSTR holds the deprecation message for SIS flash.
GetInputOK (pBSTR, pVar)
pVar = True if the flash package is not SIS and BSTR is empty. •
GetComponentList GetComponentList (pVart, pVar, pVar2, HydComp1 As Long, AquComp1 As Long) As Long
Returns the current component names list. pVar = list of component names as an array of strings pVar2 = list of hydrocarbon names as an array of strings pVar3 = list of aqueous names as an array of strings AquComp1 = number of aqueous components HydComp1 = number of aqueous components.
Returns total number of components •
GetLibraryComptBP (pVar)
Returns the boiling points of the library components set by SetLibraryComptCalculator. pVar = list of boiling points as an array of doubles.
•
GetLibraryComptMW (pVar)
Returns the molecular weight of the library components set by SetLibraryComptCalculator. pVar = list of molecular weights as an array of doubles.
•
GetLibraryComptOM (pVar)
Returns the acentric factors of the library components set by SetLibraryComptCalculator. pVar = list of acentric factors as an array of doubles.
•
GetLibraryComptPC (pVar)
Returns the critical pressures of the library components set by SetLibraryComptCalculator. pVar = list of critical pressures as an array of doubles.
•
GetLibraryComptSG (pVar)
Returns the specific gravities of the library components set by SetLibraryComptCalculator.
Page 68 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
pVar = list of specific gravities as an array of doubles. •
GetLibraryComptTC (pVar)
Returns the critical temperatures of the library components set by SetLibraryComptCalculator. pVar = list of critical temperatures as an array of doubles.
•
GetLibraryList (pVar) As Long
pVar = list of component descriptors as an array of Booleans with the values corresponding to the component names returned from GetComponentList.
True = normal component False = user defined (petroleum fraction) component. Return value is a size of the array. •
GetMolarList (pVar) As Long
pVar = list of molar flow rates as an array of Doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array. •
GetMolWeightList (pVar) As Long
pVar = list of molecular weights as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array. •
GetBoilingPointList (pVar) As Long
pVar = list of boiling points as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array. •
GetSpecificGravityList (pVar) As Long
pVar = list of specific gravities as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array. •
GetCriticalPressureList (pVar) As Long
pVar = list of critical pressures as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array •
GetCriticalTemperatureList (pVar) As Long
pVar = list of critical temperatures as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array. •
GetAcentricFactorList (pVar) As Long
pVar = list of acentric factors as an array of doubles with the values corresponding to the component names returned from GetComponentList.
Return value is a size of the array.
Page 69
PIPESIM Version 2011.1 OpenLink Reference Manual
IComposition al object - Set Methods •
•
SetComment (sComment As String)
Sets a string in the comments field of the compositional description 1 .
SetPackageType (lPackageType As Long)
Sets the Compositional Package Type to use. The following values of lPackageType will set the package as described: 0 = SIS Flash, 1 = Multiflash, 2 = SPPTS, 101 = Eclipse 300, 102 = DBR, 103 = GERG, 104 = REFPROP V8
•
SetComponentList (pVar, CompNum Sets the component names list. As Long, pVar2, CompNum2 As pVar = list of hydrocarbon names as an array of strings Long) pVar2 = list of aqueous names as an array of strings CompNum = number of hydrocarbon components 2
CompNum2 = number of aqueous components .
Note: The total number of components is limited to 50. Return false if more than 50 components is provided •
SetMolarList (pVar, CompNum As Long)
pVar = list of molar flow rates as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the molar flow rates of the aqueous components come after the molar flow rates of the hydrocarbon components. CompNum = total number of components
•
SetLibraryList (pVar, CompNum As Long)
pVar = list of component descriptions as an array of bools with the values corresponding to the component names set in SetComponentList ensuring that the component descriptions of the aqueous components come after the component descriptions of the hydrocarbon components. CompNum = total number of components
•
SetLibraryComptCalculator (pVar, CompNum As Long)
pVar = list of library component names ONLY as an array of strings. CompNum = number of components within the above list.
SetLibraryComptCalculator sets the library component names within the compositional module and calculates the component parameters.
1 2
Before any set methods are called in Icompositional Interface CreateNewComposition must be called After all the set methods are called from Icompositional Interface UpdateComposition must be called
Page 70 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
SetMolwtList (pVar, CompNum As Long)
pVar = list of molecular weights as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the molecular weights of the aqueous components come after the molecular weights of the hydrocarbon components. CompNum = total number of components.
•
SetPvtFile (sFile As String, bIsPVOFile As BOOL, iPVOUnits As Int)
Calls the compositional pvt file reader to read the inputted pvt file. sFile = pvt / ptt/ pvo file name. bIsPVOFile: True for file name with pvo extension, and false (default) otherwise. iPVOUnits = pvo file unit system: 0 (default) for metric, 1 for field. This value is ignored if bIsPVOFile is false.
•
SetBoilingPointList (pVar, CompNum As Long)
pVar = list of boiling points as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the boiling points of the aqueous components come after the boiling points of the hydrocarbon components. CompNum = total number of components
•
SetSpecificGravityList (pVar, CompNum As Long)
pVar = list of specific gravities as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the specific gravities of the aqueous components come after the specific gravities of the hydrocarbon components. CompNum = total number of components
•
SetCriticalPressureList (pVar, CompNum As Long)
pVar = list of critical pressures as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the critical pressures of the aqueous components come after the critical pressures of the hydrocarbon components. CompNum = total number of components
•
SetCriticalTemperatureList (pVar, CompNum As Long)
pVar = list of critical temperatures as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the critical temperatures of the aqueous components come after the critical temperatures of the hydrocarbon components. CompNum = total number of components.
•
SetAcentricFactorList (pVar, CompNum As Long)
pVar = list of acentric factors as an array of doubles with the values corresponding to the component names set in SetComponentList ensuring that the acentric factors of the aqueous components come after the acentric factors of the hydrocarbon components. CompNum = total number of components
Page 71
PIPESIM Version 2011.1 OpenLink Reference Manual
ICompositional object - Operations •
CreateNewComposition ()
Blanks all compositional arrays and parameters in memory
•
UpdateComposition ()
Updates all compositional arrays and parameters in memory
•
SetBlob (sBlob As String)
Sets data for the required composition sBlob = String containing compositional information 3 .
ICompositional2 object ICompositional2 object - Properties •
Eos As Long
Gets/Sets an equation of state (see Appendix for all allowed options)
•
ViscosityModel As Long
Gets/Sets a viscosity model (see Appendix for all allowed options)
•
Bip As Long
Gets/Sets a BIP set (see Appendix for all allowed options)
•
Emulsion As Long
Gets/Sets an emulsion (see Appendix for all allowed options)
•
ThermalConductivity As Long
Gets a thermal conductivity (0 = None)
•
SurfaceTension As Long
Gets a surface tension (0 = None)
FlowCorrelations Interface CIFlowCorrelation object - Get Methods •
•
•
•
3
GetHorizontalCorrelationName () As String
Returns the horizontal correlation name. The returned string is a unique keyword name.
GetHorizontalSourceName () As String
Returns the correlation’s source name (such as bja, tulsa)
GetVerticalCorrelationName () As String
Returns the vertical correlation name. The returned string is a unique keyword name (for example ANSAR, BJA, BBR, BBOTD)
GetVerticalSourceName () As String
Returns the correlation’s source name (such as bja, tulsa)
The compositional data is provided by the call to the Ipnscom Interface
Page 72 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetSensitivityItems (VerticalCorrs As Boolean, Items) As Long
Returns the 4‐column array (help string, engine code, main code and quantity class) of available sensitivity variables in Items for Vertical (if VerticalCorrs is True) or Horizontal (VerticalCorrs is False). Number of items is a function’s return value
CIFlowCorrelation object - Set Methods •
SetHorizontalCorrelation (sSource As String, sCorrelation As String)
Set a horizontal correlation. For example, for the BJA correlation source it can be any of: BBO, BBOTD, BBR, BBRTD, BJA, DKAGAD, DKAGAF, DR, DRTD, LOCKMAR, LOCKMARTD, MB, NOSLIP, OLIEMANS, XIAO or TU2P, and for Tulsa source it can be one of following: TBB, TDUK or TMB sSource can be BJA, TULSA
•
•
SetHorizUserCorrelation (sSource As String, sCorrelation As String)
Set a horizontal user correlation
SetVerticalCorrelation (sSource As String, sCorrelation As String)
Set a vertical source and correlation. For example for the Tulsa correlation source it can be any of: TBB, TDR, TGA, THB, TMB or TORK, and for BJA source it can be one of following: ANSARI, BBO, BBR, DR, GA, GRAYM, GRAYO, HBR, HBRDR, MB, NOSLIP, ORK or TU2P. sSource can be BJA, TULSA
•
SetVertUserCorrelation (sSource As String, sCorrelation As String)
Set a vertical user correlation
CIFlowCorrelation object - Properties •
SwapAngle As Double
Vertical‐Horizontal Correlation Swap Angle
•
HorizontalFrictionFactor As Double
Horizontal Friction Factor
•
VerticalFrictionFactor As Double
Vertical Friction Factor
•
VerticalHoldup As Double
Vertical Holdup
•
HorizontalHoldup As Double
Horizontal Holdup
•
SinglePhaseCorrelation As String
Any of: Moody, AGA, Pan‐A, Pan‐B, HazWill, Weymouth, CULSMITH
•
SinglePhaseFactor As Double
Single flow correlation coefficient (if applicable)
Note: See the PIPESIM help for the complete list of available vertical and horizontal flow correlations and sources.
Page 73
PIPESIM Version 2011.1 OpenLink Reference Manual
CIFlowCorrelation object - Operations •
DisplayDialog ()
Displays PIPESIM dialog for flow correlation (this method is obsolete, use DisplayDialog2 instead).
•
DisplayDialog2 () As Boolean
Displays PIPESIM dialog for flow correlation (). Return value is True if data is changed and False otherwise
ICFlowCorrelations2 Interface ICIFlowCorrelation2 object - Set Methods •
•
SetHorizontalCorrelation2 (sCorrelation As String, friction as double, [in] holdup as double)
Set method name (sCorrelation), friction factor ( friction) and holdup factor (holdup) for the horizontal flow correlation
SetVerticalCorrelation2 (sCorrelation As String, friction as double, [in] holdup as double)
Set method name (sCorrelation), friction factor ( friction) and holdup factor (holdup) for the vertical flow correlation
Single Branch Operations Single Branch operations in PIPESIM are defined as ActiveX interfaces that can be accessed from any model. Systems Analysis, Pressure and Temperature Profiles and Flow Correlation Comprarison are housed in PSOpSystems.DLL and its ActiveX interfaces are: ISystemsAnalysis, IIPTProfile and IICorrMatching respectively. A Nodal Analysis operation interface resides in NodalOp.DLL and can be created by defining an object of the type IINodalAnal. A Data Matching operation interface resides in DataMatching.DLL and can be created by defining an object of the type IIDataMatching. The operation’s ActiveX interface already defined in a single branch PIPESIM model is accessed by calling the GetOperationInterface function for an ISingleBranchModel object. The argument returned after a call to this function will be a COM interface of the type corresponding to the selected operation in the PIPESIM model. A call to GetOperationType () will returned the selected operation. See (Single Branch Operations) for a list of operation IDs. Similarly, any operation interface can be set to the model by calling SetOperationInterface (…) and SetOperationType (…).
Systems Analysis ISystemsAnalys is Object - Properties •
BoundaryConds As IBoundaryProps
Get/set property to access boundary conditions. See the definition of IBoundaryProps Interface for its methods and properties
•
Engine As IEngineOptions
Gets the IEngineOptions object to set simulation parameters and run the operation. See IEngineOptions Interface for its
Page 74 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
methods and properties •
FixedInjectionDepths As Boolean
Applicable to gas lifted systems, this property sets/gets whether gas lift valves are installed in the tubing
•
PermuteStepMode As Long
Sets/gets whether the sensitivity values for the different variables are 0: Permuted against each other or 1: Changed in step with Sens Var 1 or 2: Changed in step with X‐axis.
•
PermuteSensVars As Boolean
Sets/gets whether the sensitivity values for the different variables are permuted against each other or changed in step. This is an obsolete property and may be hidden in the future. The new property “PermuteStepMode” must be used instead of this (see above). For the compatibility PermuteSensVars = true/false means that PermuteStepMode = 0/1.
•
•
MaxSensitivityVars As Long
Gets the max available number of the sensitivity variables allowed for the operation
SensitivityObject (indx As Long) As String
indx : the sensitivity box indx. Pass –1 for the X‐axis variable, 0,1,2,…, (MaxSensitivityVars ‐1) for the corresponding sensitivity.
Returns the sensitivity object name for the specified index. •
SensitivityVariable (indx As Long) As String
indx : the sensitivity box indx. Pass –1 for the X‐axis variable, 0,1,2,…, (MaxSensitivityVars ‐1) for the corresponding sensitivity.
Returns the sensitivity variable name for the specified index
ISystemsAnalysis Object - Get Methods •
GetIsUnset () As Boolean
Returns True if the operation’s data is all blank (unset)
•
GetLastError () As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
GetSensitivityData_SI (indx As Long, ObjectStr As String, VarStr As String, Values_SI, QuantClass As String)
Returns the sensitivity data specified for the operation.
•
Indx : the sensitivity box indx. Pass –1 for the X‐axis variable, 0,1,2, … , (MaxSensitivityVars ‐1) for the corresponding sensitivity. ObjectStr : the object name is returned here VarStr : the sensitivity variable name is returned here Values_SI: an array of double values in strict SI units containing the list of sensitivity values QuantClass: the unit class name for the selected sensitivity variable. See Unit System for a list of unit classes
Page 75
PIPESIM Version 2011.1 OpenLink Reference Manual
ISystemsAnal ysis Object - Set Methods •
SetSensitivityData (indx As Long, ObjectStr As String, VarStr As String, Values_DefEng, vbActive As Boolean)
Sets the sensitivity information. Indx: the sensitivity box indx. Pass –1 for the X axis variable, 0,1,2, … , (MaxSensitivityVars ‐1) for the corresponding sensitivity. ObjectStr : the object name VarStr : the sensitivity variable name Values_DefEng: an array of double values in default engineering units containing the list of sensitivity values vbActive: sets the sensitivity group active (True) or inactive (False)
•
SetSensitivityData_SI (indx As Long, ObjectStr As String, VarStr As String, Values_SI, vbActive As Boolean, QuantClass As String)
Similar to SetSensitivityData, but uses strict SI units indx : the sensitivity box indx. Pass –1 for the X axis variable, 0,1,2, … , (MaxSensitivityVars ‐1) for the corresponding sensitivity. ObjectStr : the object name VarStr : the sensitivity variable name Values_DefEng: an array of double values in default engineering units containing the list of sensitivity values vbActive: sets the sensitivity group active (True) or inactive (False) QuantClass: measurement string (for example temperature, pressure etc.)
•
SetLanguage (nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
ISystemsAnalysis Object - Operations •
•
WriteOperationFile () As Boolean
Writes an ASCII file (modelname.inc) containing the instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager, CloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns True if dialog box was closed OK, otherwise False.
Page 76 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Pressure and Temperature Profiles IPTProfile Object - Properties •
BoundaryConds As IBoundaryProps
Get/set property to access boundary conditions. See the definition of ‘IBoundaryProps’ for its methods and properties
•
Engine As IEngineOptions
Gets the IEngineOptions object to set simulation parameters and run the operation. See ‘IEngineOptions’ for its methods and properties
•
FixedInjectionDepths As Boolean
Applicable to gas lifted systems, this property sets/gets whether gas lift valves are installed in the tubing
•
EnableSurveyOpts As Boolean
Gets/sets whether survey data is used for profile plotting
•
ProfileType As Long
The default profile to be plotted initially with PSPlot: 0: Elevation vs. Pressure 1: Elevation vs. Temperature 2: Pressure vs. Total Distance 3: Temperature vs. Total Distance
•
SensitivityObject (indx As Long) As String
indx : the sensitivity box indx. Pass –1 for the X‐axis variable, 0,1,2, … , (MaxSensitivityVars ‐1) for the corresponding sensitivity.
Returns the sensitivity object name for the specified index. •
SensitivityVariable (indx As Long) As String
indx : the sensitivity box indx. Pass –1 for the X‐axis variable, 0,1,2, … , (MaxSensitivityVars ‐1) for the corresponding sensitivity.
Returns the sensitivity object name for the specified index.
IPTProfile Object - Get Methods •
GetIsUnset () As Boolean
Returns true if the operation’s data is all blank (unset)
•
GetLastError () As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
GetSensitivityData_SI (ObjectStr As String, VarStr As String, Values_SI, QuantClass As String)
Returns the sensitivity data specified for the operation.
•
ObjectStr : the object name is returned here VarStr : the sensitivity variable name is returned here Values_SI: an array of double values in strict SI units containing the list of sensitivity values QuantClass: the unit class name for the selected sensitivity variable. See Units Library for a list of unit classes.
Page 77
PIPESIM Version 2011.1 OpenLink Reference Manual
IPTProfile Object - Set Methods •
SetSensitivityData (ObjectStr As String, VarStr As String, Values_DefEng)
Sets the sensitivity information. ObjectStr : the object name VarStr : the sensitivity variable name Values_DefEng: an array of double values in default engineering units containing the list of sensitivity values
•
SetSensitivityData_SI (ObjectStr As String, VarStr As String, Values_SI, QuantClass As String)
Same as SetSensitivityData method, but for strict SI units ObjectStr : the object name VarStr : the sensitivity variable name Values_SI: an array of double values in strict SI units containing the list of sensitivity values QuantClass: the unit class name for the selected sensitivity variable. See Units Library for a list of unit classes.
•
SetSurveyData_SI (SurveyName As String, SurveyDate As Date, Var_MD_Pres_Temp)
Associates field data to the operation. This data – pressure and/or temperature profiles is then plotted along with the calculated data. SurveyName: an arbitrary given name (such as the well name) SurveyDate: the survey date Var_MD_Pres_Temp: a three‐column matrix containing measured depths, pressure and temperature values, in that order. Units in strict SI.
•
SetLanguage (nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
IPTProfile Object - Operations •
•
WriteOperationFile () As Boolean
Writes an ASCII file (modelname.inc) containing the instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager, CloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns True if dialog box was closed OK, otherwise False.
Page 78 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Flow Correlation Comparison ICorrMatching object - Properties •
BoundaryConds As IBoundaryProps
Get/set property to access boundary conditions. See IBoundaryProps Interface for its methods and properties
•
Engine As IEngineOptions
Gets the IEngineOptions object to set simulation parameters and run the operation. See IEngineOptions Interface for its methods and properties
•
EnableSurveyOpts As Boolean
Gets/sets whether survey data is used for profile plotting
•
ProfileType As Long
The default profile to be plotted initially with PSPlot: 0: Elevation vs. Pressure 1: Elevation vs. Temperature 2: Pressure vs. Total Distance 3: Temperature vs. Total Distance
ICorrMatching object - Get Methods •
GetIsUnset () As Boolean
Returns true if the operation’s data is all blank (unset)
•
GetLastError () As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
GetSelectedCorrelation (IsVertical As Boolean, EngineCodes)
Function returns in EngineCodes the array of string for chosen vertical flow correlations if IsVertical is True and for horizontal correlations if IsVertical is False
•
ICorrMatching object - Set Methods •
SetSurveyData_SI (SurveyName As String, SurveyDate As Date, Var_MD_Pres_Temp)
Associates field data to the operation. This data, pressure and/or temperature profiles is then plotted along with the calculated data. SurveyName: an arbitrary given name (such as the well name) SurveyDate: the survey date Var_MD_Pres_Temp: a three‐column matrix containing measured depths, pressure and temperature values, in that order. Units in strict SI
•
SetSelectedCorrelation (helpStr As String, engineCode As String, mainCode As String, IsVertical As Boolean, IsSelected As Boolean)
Set or removes selection for the correlation specified by engineCode depending on IsSelected value IsVertical = True for vertical correlations, False for horizontal.
Page 79
PIPESIM Version 2011.1 OpenLink Reference Manual
•
Sets the user interface language
SetLanguage (nlLanguageID As Long) As Boolean
Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
ICorrMatching object - Operations •
•
WriteOperationFile () As Boolean
Writes an ASCII file (modelname.inc) containing the instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager, CloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns True if dialog box was closed OK, otherwise False.
Data Matching IDataMatchingOp object - Properties •
BoundaryConds As IBoundaryProps
Get/set property to access boundary conditions. See IBoundaryProps Interface for their methods and properties
•
Engine As IEngineOptions
Gets the IEngineOptions object to set simulation parameters and run the operation. See IEngineOptions Interface for their methods and properties
•
EnableSurveyOpts As Boolean
Gets/sets whether survey data is used for profile plotting
•
ProfileType As Long
The default profile to be plotted initially with PSPlot: 0: Elevation vs. Pressure 1: Elevation vs. Temperature 2: Pressure vs. Total Distance 3: Temperature vs. Total Distance
•
•
•
ModelIsInjectionWell As Boolean
Gets/sets whether model is an injection well. You have to set this property to true if you create a new IIDataMatchingOp object and analyze an injection well
UValueFactorRange As IFactorRange
Gets/sets u‐value multiplier range object. See IFactorRange Interface for its methods and properties
HorFlowFrictFactorRange As IFactorRange
Gets/sets horizontal flow friction factor range object. See IFactorRange Interface for its methods and properties
Page 80 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
HorFlowHoldupFactorRange As IFactorRange
Gets/sets horizontal flow holdup factor range object. See IFactorRange Interface for its methods and properties
VerFlowFrictFactorRange As IFactorRange
Gets/sets vertical flow friction factor range object. See IFactorRange Interface for its methods and properties
VerFlowHoldupFactorRange As IFactorRange
Gets/sets vertical flow holdup factor range object. See IFactorRange Interface for its methods and properties
•
WeightingFactorPres As Double
Gets/sets pressure RMS weight factor
•
WeightingFactorTemp As Double
Gets/sets temperature RMS weight factor
•
EngineOutputListCount As Long
Gets/sets count of resulting records of the Data Matching operation
ModelHasMeasuredTempInFlowli ne As Boolean
Gets/sets whether model has measured temperature data (Survey data) in any flowlines, risers or tubings. You have to set this property to true if model has the measured temperature data
ModelHasMeasuredPresInFlowline s As Boolean
Gets/sets whether model has measured pressure data (Survey data) in any flowlines, risers or tubings. You have to set this property to true if model has the measured pressure data
•
•
•
•
•
IDataMatchingOp object - Get Methods •
GetIsUnset () As Boolean
Returns true if the operation’s data is all blank (unset)
•
GetLastError () As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
GetSelectedCorrelation (IsVertical As Boolean, EngineCodes)
Function returns in EngineCodes the array of string for chosen vertical flow correlations if IsVertical is True and for horizontal correlations if IsVertical is False
EngineOutputListCountAs Long
Function returns count of records that could be read by GetEngineOutputItem function.
GetEngineOutputItem (index as Long, HorFlowFrictFactor as Double, HorFlowHoldupFactor as Double, VerFlowFrictFactor as Double, VerFlowHoldupFactor as double, UValueFactor as Double, alphaname as string, betaname as String, optimized as Boolean, pmatch as Double, tmatch as Double) As Double
Function returns correlation start values and results: used methods (names of the horizontal and vertical correlation methods), calculated friction and holdup factors, u‐value multiplier, pressure, temperature and RMS.
•
•
•
The results are optimized if optimized = true. If function set optimized = false then function returns start values. You should pass to index values in range 0.. EngineOutputListCount ‐1 otherwise you get an error “Invalid argument” (VBA generate an exception “Invalid argument”, that could be catched by ON ERROR GOTO operator) HorFlowFrictFactor = horizontal flow friction factor value. HorFlowHoldupFactor = horizontal flow holdup factor value. VerFlowFrictFactor = vertical flow friction factor value.
Page 81
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
VerFlowHoldupFactor = vertical flow holdup factor value. UValueFactor = u‐value multiplier. alphaname = short name of used of used vertical correlation method. betaname= short name of used of used horizontal correlation method. pmatch= pressure value (measured in psia). tmatch= temperature value (measured in Fahrenheit’s).
Function returns Double value. This is RMS value.
IDataMatchingOp IDataMatchingOp object - Set Methods •
•
SetSelectedCorrelation (helpStr As String, engineCode As String, mainCode As String, IsVertical As Boolean, IsSelected As Boolean)
Set or removes selection for the correlation specified by engineCode depending on IsSelected value
SetLanguage (nlLanguageID As Long) As Boolean
Sets the user interface language
IsVertical = True for vertical correlations, False for horizontal.
Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language if language was changed successfully and False otherwise
IIDataMatchingOp IIDataMatchingOp object - Operations •
•
WriteOperationFile () As Boolean
Writes an ASCII file (modelname.inc) containing the instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager, CloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns True if dialog if dialog box was closed OK, otherwise False.
Nodal Analysis INodalAnal Object - Properties •
CFactor As Double
Sets a Constant C value
•
EngineSwitch As String
Sets/gets extra command line arguments for the PIPESIM engine
Page 82 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
FetkovichExp As Double
Sets a Fetkovich n exponent value
•
FixedInjectionDepths As Boolean
Applicable to gas lifted systems, this property sets/gets whether gas lift valves are installed in the tubing
•
FutureAOFP As Double
Sets a future AOFP value
•
FutureIPR As Boolean
Sets a flag whether to use Future IPR option (True by default)
•
IncludeFilePath As String
The full path name to the engine’s operation file
•
InflowCurveRangeLimit As Boolean
Allow the inflow curves to extend to the AOFP (true)
•
InflowObject As String
Returns/sets the inflow object name
•
InflowVariable As String
Returns/sets the inflow variable name
MaxPressureForOutflow _SI As Double
Maximum pressure for the outflow curves
•
MaxRate_SI As Double
The maximum fluid rate in strict SI units
•
MaxRateFluidType As Long
The maximum fluid rate type: 0: liquid, 1: gas, 2 mass
•
NumberInflowPoints As Long
The number of points of points on each inflow curve
•
NumberOutflowPoints As Long
The number of points of points on each outflow curve
•
OutflowCurveRangeLimit As Boolean
Allow the outflow curves to extend to the supplied maximum flowrate
•
OutflowObject As String
Returns/sets the outflow object name
•
OutflowVariable As String
Returns/sets the outflow variable name
•
OutletPressure_SI As Double
Gets/sets the outlet pressure in strict SI units
•
PipesimEnginePath As String
The full path to the PIPESIM engine
•
PlotToolPath As String
The full path to the plotting tool (PSPlot)
•
PsmFilePath As String
The full path to the model file (.psm file)
•
ReservoirPressure As Double
Set a reservoir pressure. Used for future AOFP calculations
•
RunEngineMinimised As Long
Runs the engine in a minimised window
•
RunPlotToolWithEngine As Long
If True If True (1) shows the plotting tool (PSPlot) as the simulation runs
•
INodalAnal Object - Get Methods •
•
•
GetIsEngineActive (p_bActive As Long)
Returns True (1) if the if the PIPESIM engine is running, otherwise False (0)
GetIsUnset GetIsUnset (pVar As Long)
Returns True (1) if the if the operation’s data is all blank (unset)
GetLastError (errorStr As String)
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
Page 83
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
GetSensitivityData_SI (InflowOutflow As Long, ObjectStr As String, VarStr As String, Values_SI, QuantClass As String)
Returns the sensitivity data specified for the operation. InflowOutflow: 0: inflow data, 1 outflow data ObjectStr : the object name is returned here VarStr : the sensitivity variable name is returned here of double values in strict SI units Values_SI: an array of double containing the list of sensitivity of sensitivity values QuantClass: the unit class name for the selected sensitivity Unit System System. variable. See Unit
INodalAnal Object - Set Methods •
SetSensitivityData_SI (InflowOutflow As Long, ObjectStr As String, VarStr As String, Values_SI, QuantClass As String)
Sets the sensitivity data specified for the operation. InflowOutflow: 0: inflow data, 1 outflow data ObjectStr: the object name VarStr: the sensitivity variable name Values_SI: an array of double of double values in strict SI units containing the list of sensitivity of sensitivity values QuantClass: the unit class name for the selected sensitivity Unit System System. variable. See Unit
•
SetLanguage (nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language if language was changed successfully and False otherwise
INodalAnal Object - Operations •
KillOperation ()
Terminates the engine run
•
RunOperation ()
Runs the simulation
•
WriteOperationFile (bOK As Boolean)
Writes an ASCII file containing the instructions to the simulation engine to run the operation.
•
DisplayDialog (p_VarUnitManager)
Displays the operations graphical interface. Pass a NULL variant as the first argument. This method is obsolete. Use DisplayDialog2 method instead
•
DisplayDialog2 (p_VarUnitManager, bCloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns true if dialog if dialog box was closed OK, otherwise false.
Page 84 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Wax Deposition IWaxOp Object - Properties •
RunEngineMinimised As Boolean
Runs the engine in a minimised window
•
RunPlotToolWithEngine As Boolean
If True (1) shows the plotting tool (PSPlot) as the simulation runs
•
PsmFilePath As String
The full path to the model file (.psm file)
•
PlotToolPath As String
The full path to the plotting tool (PSPlot)
•
IncludeFilePath As String
The full path name to the engine’s operation file
•
PipesimEnginePath As String
The full path to the PIPESIM engine
•
EngineSwitch As String
Sets/gets extra command line arguments for the PIPESIM engine
•
WaxProperties As Variant
IWaxOp Object - Get Methods •
GetLastError() As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
•
GetIsUnset() As Boolean
Returns True (1) if the operation’s data is all blank (unset)
•
GetIsEngineActive() As Boolean
Returns True (1) if the PIPESIM engine is running, otherwise False (0)
IWaxOp Object - Set Methods •
SetLanguage(nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
Page 85
PIPESIM Version 2011.1 OpenLink Reference Manual
IWaxOp Object - Operations •
DisplayDialog(p_VarUnitManager As Variant)
Displays the operations graphical interface. Pass a NULL variant as the first argument. This method is obsolete. Use DisplayDialog2 method instead
DisplayDialog2(p_VarUnitManager As Variant) As Boolean
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns true if dialog box was closed OK, otherwise false.
•
RunOperation();
Runs the simulation
•
KillOperation();
Terminates the engine run
•
WriteOperationFile() As Boolean
Writes an ASCII file containing the instructions to the simulation engine to run the operation.
•
IWaxOp2 Object - Properties •
WaxMethod can be one of the following values:
WaxMethod As Integer
0: Shell; 1: BP; 2: Schlumberger DBR; 3: None
IWaxOp3 Object - Properties •
ModelIsInjectionWell As Boolean
True if the model is an injection well, Flase otherwise
Gas Lift Rate vs Casing Head Pressure IPlotQgiVsChp Object - Properties •
RunEngineMinimised As Boolean
Runs the engine in a minimised window
•
RunPlotToolWithEngine As Boolean
If True (1) shows the plotting tool (PSPlot) as the simulation runs
•
Filename As String
The model file name (.psm file)
•
Pathname As String
The path to a model file
•
Description As String
A description string
•
PlotToolPath As String
The full path to the plotting tool (PSPlot)
•
PipesimEnginePath As String
The full path to the PIPESIM engine
Page 86 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
EngineSwitch As String
Sets/gets extra command line arguments for the PIPESIM engine
•
GasSG As Double
Sets/gets gas specific gravity value
IPlotQgiVsChp Object - Get Methods •
GetLastError() As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
•
GetIsUnset() As Boolean
Returns True (1) if the operation’s data is all blank (unset)
•
GetIsEngineActive() As Boolean
Returns True (1) if the PIPESIM engine is running, otherwise False (0)
IPlotQgiVsChp Object - Set Methods •
•
•
•
•
•
•
•
SetMinCHP(value as Double, unitStr as String)
Method sets a minimum casing head pressure
SetMaxCHP(value as Double, unitStr as String)
Method sets a maximum casing head pressure
SetStepCHP(value as Double, unitStr as String)
Method sets an increment value for casing head pressure
SetPortDiameter(value as Double, unitStr as String)
Method sets an orifice diameter
SetCv(value as Double)
Method sets a Cv value of the gas lift valve
SetGLMaxRate(value as Double, unitStr as String)
Method sets a maximum available gas rate
SetGLTemperature(value as Double, unitStr as String)
Method sets a lift gas temperature at the casing head
SetLanguage(nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
Page 87
PIPESIM Version 2011.1 OpenLink Reference Manual
IPlotQgiVsChp Object - Operations •
•
•
•
•
•
•
DisplayDialog()
Displays the operations graphical interface. This method is obsolete. Use DisplayDialog3 method instead
DisplayDialog2(p_VarUnitManager As Variant)
Displays the operations graphical interface. Pass a Null variant as the first argument. This method is obsolete. Use DisplayDialog3 method instead
DisplayDialog3(p_VarUnitManager As Variant, bCloseOK As Boolean)
Displays the operations graphical interface. Pass a Null variant as the first argument. Return value is true if dialog box was closed OK, otherwise false.
GenerateQgiVsChpPlot(bOk as Long);
Runs the simulation
GenerateQgiVsChpPlot2(p_VarUnit Manager As Variant, bOk as Long);
Runs the simulation. Pass a Null variant as the first argument.
KillOperation();
Terminates the engine run
WriteOperationFile(p_VarUnitMana ger As Variant, bOK As Boolean)
Writes an ASCII file containing the instructions to the simulation engine to run the operation. Pass a Null variant as the first argument.
This method is obsolete. Use GenerateQgiVsChpPlot2 method instead
Single Branch Operations: Supporting Interfaces IBoundaryProps Interface IBoundaryProps - Properties •
OutletPressure_SI As Double
Gets/sets the outlet pressure in strict SI units
•
InletPressure_SI As Double
Gets/sets the inlet pressure in strict SI units
•
FluidRate_SI As Double
Gets/sets the fluid rate in strict SI units
•
CalculatedVariable As Long
Gets/sets the calculated variable: 0: Outlet Pressure 1: Inlet Pressure, 2: FluidRate
•
FluidType As Long
Gets/sets the fluidrate type: 0: liquid 1: gas 2: mass
Page 88 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IEngineOptions Interface IEngineOptions - Properties •
EngineSwitch As String
Sets/gets extra command line arguments for the PIPESIM engine
•
IncludeFilePath As String
The full path name to the engine’s operation file
•
PipesimEnginePath As String
The full path to the PIPESIM engine
•
PlotToolPath As String
The full path to the plotting tool (PSPlot)
•
PsmFilePath As String
The full path to the model file (.psm file)
•
RunEngineMinimised As Boolean
Runs the engine in a minimised window
•
RunPlotToolWithEngine As Boolean
If True shows the plotting tool (PSPlot) as the simulation runs
IEngineOptions - Get Methods •
GetIsEngineActive () As Boolean
Returns True if the PIPESIM engine is running, otherwise False
IEngineOptions - Operations •
KillOperation ()
Terminates the engine run
•
RunOperation ()
Runs the simulation
IFactorRange Interface IFactorRange - Properties •
Min As Double
Sets/gets minimal value for range object
•
Max As Double
Sets/gets maximum value for range object
•
Enabled As Boolean
Enable/disable range object
•
LowerEgge As String
Lower edge for minimum and maximum values
•
UpperEgge As String
Upper edge for maximum and minimum values
Page 89
PIPESIM Version 2011.1 OpenLink Reference Manual
Gas Lift Diagnostics COM Object Name
The name of the COM is GLDIAGN.DLL
Supported Interfaces
GLWell interface: to model and perform diagnostics on a gas lift injected well
Dependency MAP
List of Dependencies: WELLCURVE.DLL, MFC42.DLL
GLWell Interface and Object The GetArrayXXX functions return a one‐dimensional array. The number of components in the array is equal to the number of valves defined in the well (see the 'AddGasLiftValve5' method). The first component in the array (index = 0) corresponds to the top valve.
GLWell Object - Get Methods •
GetArrayEqCurvePressure(pVar)
Returns in pVar an array of Doubles with the equilibrium curve pressure at each valve depth
•
GetArrayGasRate(pVar)
Returns in pVar an array of Doubles with the actual throughputs for each valve. Uses Thornhill & Craver equation
•
GetArrayInjectionPressure(pVar)
Returns in pVar an array of Doubles with the injection pressure at each valve depth
•
GetArrayInjectionTemperature(pVar)
Returns in pVar an array of Doubles with the injection temperature at each valve depth
•
GetArrayMaxGasRate(pVar)
Returns in pVar an array of Doubles with the maximum throughputs for each valve. Uses Thornhill & Craver equation
•
GetArrayProductionPressure(pVar)
Returns in pVar an array of Doubles with the production pressure at each valve depth
•
GetArrayProductionTemperature(pVar)
Returns in pVar an array of Doubles with the production temperature at each valve depth
•
GetArrayValveClosePressure(pVar)
Returns in pVar an array of Doubles with closing pressures for each valve
•
GetArrayValveOpenPressure(pVar)
Returns in pVar an array of Doubles with opening pressures for each valve
Page 90 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetArrayValveStatus(pVar)
Returns in pVar an array of Strings with the valve status: such as “Throttling”, “Fully Open”.
•
GetEquilibriumCurve(pVar)
Returns in pVar a 2‐dimensional array of Doubles with {injection TVD, equilibrium pressure} pairs in [ft, psia]. The number of data points is variable and match the results from the plot file.
•
GetLastError(sLastError As String)
Returns the last error message produced by GLD.
GetProductionPressureCurve(pVar, type As Long)
Returns in pVar a 2‐dimensional array of Doubles with {pressure, depth} pairs in [psia, ft]. The number of data points is variable and match the results from the plot file.
•
Type: if 0 depth values are MD, if 1 depth values are TVD •
GetProductionTemperatureCurve (pVar, type As Long)
Returns in pVar a 2‐dimensional array of doubles with {temperature, depth} pairs in [F, ft]. The number of data points is variable and match the results from the plot file. Type: if 0 depth values are MD, if 1 depth values are TVD
GLWell Object - Set Methods •
AddCalculatedPressureProfile (type As Long, pVar, pressUnits As String, lenUnits As String)
Type: 0 = MD; 1 = TVD pVar : a two dimensional array containing Doubles {depth, pressure} pressUnits: pressure units for the values in the arrays
lenUnits: units for the depth values in the array. Any of ft miles, m, km This method can be used when the profile type is 'Simulate' to enter an existing simulated profile. Use in conjunction with the property CalculatePressureProfileOnDisplay to control the execution of PIPESIM. •
AddCalculateTempProfile (type As Long, pVar, tempUnits As String, lenUnits As String)
Type: 0 = MD; 1 = TVD pVar : a two dimensional array containing Doubles {depth, temperature} tempUnits: temperature units for the values in the arrays lenUnits: units for the depth values in the array. Any of ft miles, m, km. This method can be to enter an existing simulated temperature profile. If not supplied the temperature profile will be calculated internally by the Diagnostics module.
Page 91
PIPESIM Version 2011.1 OpenLink Reference Manual
•
AddDeviationSurvey (pVar, TVDUnits As String, MDUnits As String)
Required if ProfileMode property is set to User Survey AND Pressure Survey type is MD pVar : a two dimensional array containing Doubles {TVD, MD} TVDUnits: units for the TVD values in the array. Any of ft, miles, m, km MDUnits: units for the MD values in the array. Any of ft, miles, m, km
•
AddEquilibriumCurve (pVar, pressUnits As String, lenUnits As String)
pVar : a two dimensional array containing Doubles {depth, pressure} pressUnits: pressure units for the values in the arrays
lenUnits: units for the depth values in the array. Any of ft, miles, m, km This method can be used to enter an existing equilibrium curve. Use in conjunction with the property CalculateEqCurveOnDisplay to control the execution of PIPESIM. •
AddGasLiftValve5 (type As Long, depth As Double, Ptro As Double, ptroUnits As String, Ap As Double, ApAb As Double, PortSize As Double, NomOD As Double, desc As String, Cd As Double, dpfo As Double)
Type: valve type Any of: 0 = IPO, 1 = PPO, 2 = IPS, 3 = PPS, 4 = Orifice, 5 = Dummy depth [ft]: valve depth ptro: test rack pressure ptrUnits: test rack pressure units Ap[in2]: port area
ApAb: port area/bellows area PortSize [in]: port size NomOD [in]: nominal OD Desc: valve name/model Cd : Cd value if Cd = 0 GLD will calculate it Dpfo [psi]: default = ‐7777. If default the Venezuelan method will be used for gas throughput calculations, if given value not equal default value, NZ method will be used •
AddPressureSurvey (type As Long, pVar, pressUnits As String, lenUnits As String)
Required if ProfileMode property is set to User Survey Type: 0 = MD; 1 = TVD pVar : a two dimensional array containing Doubles {depth, pressure} pressUnits: pressure units for the values in the arrays lenUnits: units for the depth values in the array. Any of ft, miles, m, km
Page 92 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
AddTemperatureSurvey (type As Long, pVar, tempUnits As String, lenUnits As String)
Type: 0 = MD; 1 = TVD pVar : a two dimensional array containing Doubles {depth, temperature} tempUnits: temperature units for the values in the arrays lenUnits: units for the depth values in the array. Any of ft, miles, m, km
•
•
SetApi (api As Double)
Optional, this parameters are written to the u2p file
SetGLWellProperties2 (gsg As Double, resDepth As Double, chp As Double, chpUnits As String, cht As Double, tht As Double, rest As Double, surft As Double, Qgi As Double)
gsg: gas specific gravity resDepth: reservoir depth [ft] chp: injection head pressure chpUnits: pressure units for the value entered as chp. Any of: psia psig, bara, barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g cht : injection head temperature [F] tht : production head temperature [F] rest : reservoir temperature [F] surf : surface ambient temperature [F] Qgi : measured injection gas rate [mmscf/d]
•
•
•
•
•
SetHorizontalCorrelation (bsName As String, HoldupFactor As Double, FrictionFactor As Double)
Optional, this parameters are written to the u2p file
SetIprTypeAndValue (IprType As Long, IprValue As Double)
Optional, these parameters are written to the u2p file. IprType = 0 for WELLPI, IprType = 1 for VOGEL
SetPressureUnits (unitStr As String)
Call this function to specify pressure units to display in GLD output. Any of: psia psig, bara, barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g
SetProductionPressureGradient (value As Double, unitStr As String)
Required if ProfileMode property is set to Constant Gradient
SetSinglePhaseCorrelation (bsName As String, Efficiency As Double)
Optional, this parameters are written to the u2p file
Page 93
PIPESIM Version 2011.1 OpenLink Reference Manual
•
SetTransferLinesParams3 (kickOffInjPressure As Double, kickOffPres_Units As String, unloadingGrad As Double, unloadingGrad_Units As String, injPresDrop As Double, injPresDrop_Units As String, locatingDPAtValve As Double, locatingDP_Units As String, TransferFactor As Double)
kickOffInjPressure: casing head pressure to start unloading kickOffPres _Units: the pressure units for the above parameter unloadingGrad : the unloading gradient unloadingGrad_Units: Any of psi/ft, bar/m, atm/m, kPa/m injPresDrop: pressure drop between valves injPresDrop_Units: Any of: psi, bar ,atm, kPa, kg/cm2 locatingDPAtValve: Safety factor normally used for both injection pressure operated and production pressure operated valves. This is an offset from the injection pressure line to the start of the transfer (unloading) line at each valve location. Default value for injection pressure operated valves is 50 psi. and default for production pressure operated valves is 100 psi
Call this function to display transfer line plots •
SetTransferLinesParams4 (kickOffInjPressure As Double, kickOffPres_Units As String, unloadingGrad As Double, unloadingGrad_Units As String, injPresDrop As Double, injPresDrop_Units As String, locatingDPAtValve As Double, locatingDP_Units As String, SurfaceOffset As Double, BottomOffset As Double, BottomOffset_Units As String)
The same as SetTransferLinesParams (…) with the added design mode parameters: SurfaceOffset : percentage of the difference between the operating production (wellhead) pressure and the injection pressure. The pseudo wellhead pressure is then the operating wellhead pressure plus this surface offset value. Used in Variable Gradient method in design mode. BottomOffset : The bottom hole offset is a pressure difference value. The pseudo flowing bottom pressure is then the bottom hole injection pressure minus the bottom hole offset value. The pseudo production pressure used for design is then a straight line drawn between the pseudo wellhead pressure and the pseudo bottom hole pressure. Used in Variable Gradient method in design mode.
SetValveTemperatureFrom (long ValveTempFrom) This function sets the valve temperature to be equal to :0: Production Temperature, 1: Ambient Temperature, 2: Injection Temperature. Only applicable in design mode
Page 94 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
SetTransferLinesParams5 (kickOffInjPressure As Double, kickOffPres_Units As String, unloadingGrad As Double, unloadingGrad_Units As String, injPresDrop As Double, injPresDrop_Units As String, locatingDPAtValve As Double, locatingDP_Units As String, TransferFactor As Double, vbIsTransferPinjPprod As Boolean) SetTubingHeadPressure (value As Double, unitStr As String)
Required if ProfileMode property is set to Constant Gradient or Variable Gradients
SetVerticalCorrelation (bsName As String, HoldupFactor As Double, FrictionFactor As Double, SwapAngle As Double)
Optional, this parameters are written to the u2p file
GLWell Object - Operations •
•
•
•
DisplayGasLiftDialog
Pops up the GLD GUI
DisplayGasLiftDialog2 (JpgFilename As String, p_VarUnitManager, bCloseOK As Boolean)
Same as DisplayGasLiftDialog but it allows to pass Jpeg file name where plot will be stored
DisplayGasLiftDialog3 (JpgFilename As String, p_VarUnitManager, filetype As Long, cx As Long, cy As Long, bCloseOK As Boolean)
Same as DisplayGasLiftDialog but it allows to pass file name where plot will be stored change file type ( filetype can take values 0 – jpeg, 1 – wmf, 2 ‐ emf) and change size of the plot (cx , cy ) only for Jpeg file.
CreateJpgFile3 (JpgFilename As String, p_VarUnitManager, filetype As Long, cx As Long, cy As Long, bOK As Boolean)
Function runs the simulation and writes plot file. It allows to pass file name where plot will be stored change file type ( filetype can take values 0 – jpeg, 1 – wmf, 2 ‐ emf) and change size of the plot (cx , cy ) only for Jpeg file.
GLWell Object - Properties •
PressureProfileMode As Long
Mode = 0 Constant Gradient Mode = 1 User Survey Mode = 2 PIPESIM Calculated Mode = 3 Variable Gradients
Use this property to set/get the pressure profile mode.
Page 95
PIPESIM Version 2011.1 OpenLink Reference Manual
CalculateEqCurveOnDisplay As Boolean
If True the GLD module will calculate the equilibrium curve just before displaying the GUI (when calling DisplayGasLiftDialog ()). If an existing curve has been entered with the method AddEquilibriumCurve this property should be set to false to avoid recalculation.
CalculatePressureProfileOnDisplay As Boolean
If True (AND the profile type is 'Simulate') the GLD module will calculate the pressure profile just before displaying the GUI (when calling DisplayGasLiftDialog ()). If an existing profile has been entered with the method AddCalculatedPressureProfile this property should be set to false to avoid recalculation.
•
DesignMode As Boolean
Sets the module in design mode (True) otherwise diagnostics mode (False). Default is False
•
Gor As Double
The gor in scf/bbl. Required if PressureProfileMode = 3
•
IterationMode As Long
Mode = 0 calculate flowrate {DEFAULT}
•
•
Mode = 1 calculate inlet pressure
This is applicable when PressureProfileMode = 2 •
LiquidRate As Double
The production liquid rate in bbl/d. Required if PressureProfileMode = 3
•
PipesimEnginePath As String
bstrPath is the full path to a valid PIPESIM engine
This data is required if PressureProfileMode = 2 •
PipesimIterationTolerance As Double
Sets/gets the tolerance in % for the convergence of PIPESIM iterations (default = 1 %)
•
ProductionPressureGradient As Double
The pressure gradient in psi/ft. Required if PressureProfileMode = 0
•
PsmFilePath As String
The full path to a valid psm file This data is required if PressureProfileMode = 2
•
ReservoirPressure As Double
Gets/sets the static reservoir pressure
•
SetDisplayUnitSystem As Long
System = 0 Engineering (DEFAULT), System = 1 SI
•
ShowAmbientTemperature As Long
(default = 1)
•
ShowEquilibriumCurvePlot As Long
(default = 1)
•
ShowEquilibriumCurvePlot As Long
(default = 1)
•
ShowInjectionPressure As Long
(default = 1)
•
ShowProductionPressurePlot As Long
(default = 1)
•
ShowProductionTemperature As Long
(default = 1)
•
ShowTransferLinesPlot As Long
(default = 1)
•
ShowValveClosePressure As Long
(default = 1)
•
ShowValveOpenPressure As Long
(default = 1)
Page 96 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
ValveTemperature (ValveIndx As Long) As Double
Sets to valve at 0‐based index ValveIndx (top valve is indx = 0) the temperature given in val [F]. See also the function SetValveTemperatureFrom (…)
•
Watercut As Double
The watercut in %. Required if PressureProfileMode = 3
•
WellName As String
An optional well description
•
GLWell Object Example VBA Sample Code
' Cr eat e an i nst ance of t he GLWel l i nt er f ace Di m obj As GLDI AGNOSTI CSLi b. GLWel l Set obj = New GLWel l ' Di spl ay al l var i abl es usi ng SI def aul t uni t s obj . Set Di spl ayUni t Syst em = 1 ' Set t he pr essur e uni t s t o be ' bar g' obj . Set Pr essur eUni t s bar g ' Assi gn a name t o t he wel l obj . Wel l Name = Wel l _ 123 ' Set t he wel l pr oper t i es gsg = 0. 64 ' gas speci f i c gr avi t y r es_dept h = 8000 ' r eser voi r dept h = 8000 f t ch_p = 1400 ' i nj ect i on pr essur e 1400 psi a ch_t = 70 ' i nj ect i on t emper at ur e 200 F t ub_t = 120 ' t ubi ng head t emper at ur e 120 F r es_t = 220 ' r eser voi r t emper at ur e 220 F amb_t = 70 ' sur f ace ambi ent t emp 70 F t ub_head_pr es = 180 ' t ubi ng head pr essur e 180 psi a mqgi = 2 ' measur ed i nj ect i on gas r at e 2 mmscf / d obj . Set GLWel l Pr oper t i es2 gsg, r es_dept h, ch_p, psi a, ch_t , t ub_t , r es_t , amb_t , mqgi obj . Set Tubi ngHeadPressure t ub_head_pr es, psi a ' Set t he pr essur e pr of i l e type to Var i abl e Gr adi ent s obj . Pr essur eProf i l eMode = 3 ' ' ' ' ' ' ' ' ' ' '
Add 4 val ves val ves: t ype : I PO, PPO, I PS, PPS, ORI F, DUM dept h i n f t t est r ack pr essur e t est r ack pr essur e uni t s por t ar ea por t ar ea over bel l ows ar ea nomi nal por t si ze nomi nal ext er nal di amet er des cr i pt i on Cd val ue ( def aul t 0. 865)
Page 97
PIPESIM Version 2011.1 OpenLink Reference Manual
' Del t a P f ul l y open obj . AddGasLi f t Val ve5 I PO, 3000, 1950 , psi g, 0. 013, 0. 0169, 0. 1250, 1. 5, Camco R20 1/ 8 Por t , 0. 865, 800 obj . AddGasLi f t Val ve5 I PO, 4000, 1960 , psi g, 0. 013, 0. 0169, 0. 1250, 1. 5, Camco R20 1/ 8 Por t , 0. 865, 800 obj . AddGasLi f t Val ve5 I PO, 5000, 1980 , psi g, 0. 013, 0. 0169, 0. 1250, 1. 5, Camco R20 1/ 8 Por t , 0. 865, 800 obj . AddGasLi f t Val ve5 I PO, 6000, 1990 , psi g, 0. 013, 0. 0169, 0. 1250, 1. 5, Camco R20 1/ 8 Por t , 0. 865, 800 obj . AddGasLi f t Val ve5 I PO, 7000, 1995 , psi g, 0. 013, 0. 0169, 0. 1250, 1. 5, Camco R20 1/ 8 Por t , 0. 865, 800 ' Di spl ay the gr aphi cal i nt er f ace obj . Di spl ayGasLi f t Di al og ' Get t he st at us of each of t he val ves Di m vt est As Var i ant obj . Get Ar r ayVal veSt atus vt est
IGLDesign Object IGLDesign Object - Get Methods •
GetCurrentGLValve (indx As Long, manuf As String, series As String, portname As String, portsize As Double, choke As Double, mode As String, ptro As Double, Ap As Double, Ab As Double, nomOD As Double, Cd As Double, tvd As Double, gasrate As Double)
Returns the recently calculated valve parameters at the specified index manuf: manufacturer name series: series name portname: portsize: choke: valve choke mode: valve type (IPO, PPO, IPS, PPS, Orifice or Dummy) md [ft]: valve depth ptro: test rack pressure Ap [in2]: port area Ab: port area/bellows area portsize [in]: port size nomOD [in]: nominal OD Cd : Cd value
Page 98 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
•
GetCurrentSystem(pIValveSystem As Object)
Returns the recently calculated IGLValveSystem object
GetCurrentValveSystemCount(Valve Count As Long
Returns the count of recently calculated GL valves
GetDesignBias() As IDesignBias
Returns the IDesignBias object
GetDesignParams () As IDesignParams
Returns the IDesignParams object
GetGLValve (indx As Long, manuf As String, series As String, portname As String, portsize As Double, choke As Double, mode As String, ptro As Double, Ap As Double, Ab As Double, nomOD As Double, Cd As Double, md As Double, gasrate As Double)
Returns the installed valve parameters at the specified index manuf : manufacturer name series: series name portname: portsize: choke: valve choke mode: valve type (IPO, PPO, IPS, PPS, Orifice or Dummy) md [ft]: valve depth ptro: test rack pressure Ap [in2]: port area Ab: port area/bellows area portsize [in]: port size nomOD [in]: nominal OD Cd : Cd value
•
•
•
•
•
•
GetIsUnset(bUnset As Boolean)
Returns True is data is not set and False otherwise
GetProductionPressure(depth As Double) As Double
Returns the production pressure
GetProductionTemperature(depth As Double) As Double
Returns the production temperature
GetProjectData(ProjData)
Returns the array of strings containing project data
GetValveSystemCount(ValveCount As Long)
Returns the count of installed GL valves
GetLastError(errorStr As String)
Returns the last error message
IGLDesign Object - Set Methods •
•
SetCompletionParams(Params)
Sets the completion type as String for report purposes. String must be passed as Variant type
SetCurrentSystem(pIValveSystem As Object)
Sets the IGLValveSystem object
Page 99
PIPESIM Version 2011.1 OpenLink Reference Manual
•
SetFlowCorrsParams(Params)
Sets the flow correlation as String for report purposes. String must be passed as Variant type
•
SetFluidParameters(Params)
Sets the flow correlation as String for report purposes. String must be passed as arrays of 3 String elements. First one is GOR/OGR value, the second is WCut value and the last one is Api value.
SetLanguage(nlLanguageID As Long) As Boolean
Sets the user interface language
•
Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
•
Sets the Project data. The data must be passed as array of 8 Strings. These strings are:
SetProjectData(ProjData)
Project name, Project User, Job name, Work Order, Client Name, Manager Name, Company Name, Model Specification
IGLDesign Object - Operations •
•
•
•
•
AddDeviationSurvey(pVar_MDvsTVD _Points)
Sets user‐defined deviation survey pVar : a two dimensional array containing Doubles { MD , TVD} in Strict_SI units
CheckInput(Description As String) As Boolean
Validates the design data and returns True if data is ok. Otherwise the return value is False and Description contains the error message
DisplayGasLiftDesign(p_VarUnitMan ager, bCloseOK As Boolean)
Pops up the GLDesign GUI.
DisplayResults(p_VarUnitManager) As Boolean
Pops up the results of the GL design calculations
PerformDesign() As Boolean
Runs the engine to perform design
Page 100 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IGLDesign Object - Properties •
AmbientTemperature As Double
•
BottomHoleOffset As Double
•
DesignInjectionPressure As Double
•
DesignMethod As String
Can be one of the following: API, IPO‐Surface Close, Variable Gradient , PPO Design
•
DesignMethod_ As Long
0 for API or IPO‐Surface Close, 1 for IPO‐Pt Mai/Max , 2 for PPO Design
•
DesignSpacing As Long
0 for new spacing, 1 for current spacing
•
EngineFilePath As String
•
InjGasSpecificGravity As Double
•
•
InjGasSurfaceTemperature As Double InjPresDropBetweenValves As Double
•
InstallCurrentSystem As Boolean
•
KickoffInjectionPressure As Double
•
LocatingDPAtValveLocation As Double
•
MinimumValveInjDP As Double
•
MinimumValveSpacing As Double
•
OperatingProdPressure As Double
•
PackerDepth As Double
•
PlotToolPath As String
•
ProductionPressureCurve As Integer
Production Pressure Curve 0 for Production Pressure Model 1 for Equilibrium Curve
•
PsmFilePath As String
•
Recommendations As String
•
ReservoirDepth As Double
•
ReservoirPressure As Double
•
ReservoirTemperature As Double
•
SurfaceOffset As Double
•
SurfaceOffsetDP As Double
Page 101
PIPESIM Version 2011.1 OpenLink Reference Manual
•
SurfaceOffsetType As Boolean
•
TargetInjGasRate As Double
•
TransferFactor As Double
•
TubingName As String
•
UnloadingGradient As Double
•
UnloadingProdPressure As Double
•
ValveLocation As Long
Top Valve location 0 for liquid to surface, 1 for liquid not to surface
•
ValveManufacturer As String
Valve manufacturer filter value
•
ValveMinPortSize As Double
Valve min port size filter value
•
ValveSeries As String
Valve series filter value
•
ValveType As String
Valve type filter value
•
ValveNominalOD As Double
Valve size filter value
•
ValveTemperature As String
Can be one of the following: Production, Ambient , Injection or Unloading
•
ValveTemperature_NonTop As Long
Unloading temperature for non‐top valve: 0 for Production 1 for Ambient 2 for Injection 3 for Unloading
•
ValveTemperature_Top As Long
Unloading temperature for top valve: 0 for Production 1 for Ambient 2 for Injection 3 for Unloading
•
WellAbsorbs As Boolean
IDesignParams Object IDesignParams Object - Properties •
BracketingSpacing As Double
•
BracketingTVD As Double
•
DesignInjectionPressure As Double
•
InjGasSpecificGravity As Double
•
InjGasSurfaceTemperature As
Page 102 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Double •
InletPressure As Double
•
IsBracketingEnabled As Boolean
•
IsPressureCondition As Boolean
•
KickoffInjectionPressure As Double
•
LiquidRate As Double
•
MinimumValveInjDP As Double
•
MinimumValveSpacing As Double
•
MinUnloadingLiqRate As Double
•
OperatingProdPressure As Double
•
ReservoirPressure As Double
•
TargetInjGasRate As Double
•
UnloadingGradient As Double
•
UnloadingProdPressure As Double
•
UseAnnulusGasGradient As Boolean
Specifies usage of static gradient if True and rigorous friction and elevation DP otherwise
IDesignBias Object IDesignBias - Properties •
BottomOrifCD As Double
•
DeltaPtroBottomValve As Double
•
InjPresDropBetweenValves As Double
•
IsCalculateInjPresDrop As Boolean
•
IsPlaceIPOatBottom As Boolean
•
IsPlaceOrificeatBottom As Boolean
•
•
•
Discharge coefficient for orifice
IsTransferFactorBetweenIPandPP As Boolean LocatingDPAtValveLocation As Double TransferFactor As Double
Page 103
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
IGLValveSystem Object IGLValveSystem Object - Get Methods •
GetGasLiftProps(InjPressure GetGasLiftProps(InjPressure As Double, MaxAvailableRate As Double, InjTemp As Double, GasSG As Double, bstrPvtFile As String, bIsBlackOil As Boolean)
Returns the GL properties: InjPressure – injection pressure MaxAvailableRate – gas rate InjTemp – surface injection temperature
GasSG – GasSG – gas specific gravity bstrPvtFile – PVT file name (for compositional model) bIsBlackOil – – True if black if black oil model deifned, False otherwise •
GetIsUnset(bUnset GetIsUnset(bUnset As Boolean)
Returns True is data is not set and False otherwise
•
GetLastError(errorStr GetLastError(errorStr As String)
Returns the last error message
•
GetValveCount(lValveCnt GetValveCount(lValveCnt As Long)
Returns the count of installed GL valves
IGLValveSystem Object - Set Methods •
SetGasLiftProps(InjPressure SetGasLiftProps(InjPressure As Double, MaxAvailableRate As Double, InjTemp As Double, GasSG As Double, bstrPvtFile As String, bIsBlackOil As Boolean)
Sets the GL properties: InjPressure – injection pressure MaxAvailableRate – gas rate InjTemp – surface injection temperature GasSG – gas specific gravity bstrPvtFile – PVT file name (for compositional model) bIsBlackOil – – True if black if black oil model deifned, False otherwise
•
SetLanguage(nlLanguageID SetLanguage(nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language if language was changed successfully and False otherwise
Page 104 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
IGLValveSystem Object - Operations •
AddGLValve(manuf AddGLValve(manuf As As String, series As String, portname As String, portsize As Double, choke As Double, mode As String, ptro As Double, Ap As Double, Ab As Double, nomOD As Double, Cd As Double, tvd As Double, gasrate As Double)
manuf : manufacturer name series: series name portname: portsize: choke: valve choke mode: valve type (IPO, PPO, IPS, PPS, Orifice or Dummy) ptro: test rack pressure Ap: port area Ab: port area/bellows area nomOD : nominal OD Cd : Cd value tvd : valve depth gasrate
•
•
ClearValveSystem() ClearValveSystem()
Removes all installed valves
DisplayGLValveSystem(p_VarUnitMa DisplayGLValveSystem(p_VarUnitMa nager, bCloseOK As Boolean)
Pops up the GL Valve System GUI
IGLValveSystem Object - Properties •
•
•
•
•
•
•
•
•
•
BellowsArea(iValveIndx BellowsArea(iValveIndx As Long) As Double ChokeSize(iValveIndx ChokeSize(iValveIndx As Long) As Double
Gets bellows area for the valve specified by iValveIndx (Read only property) (Read only property)
DPFO(iValveIndx DPFO(iValveIndx As Long) As Double Manufacturer(iValveIndx Manufacturer(iValveIndx As Long) As String
(Read only property)
MeasuredDepth(iValveIndx MeasuredDepth(iValveIndx As Long) As Double
(Read only property)
nomOD(iValveIndx nomOD(iValveIndx As Long) As Double
(Read only property)
PortArea(iValveIndx PortArea(iValveIndx As Long) As Double
(Read only property)
portname(iValveIndx portname(iValveIndx As Long) As String
(Read only property)
portsize(iValveIndx portsize(iValveIndx As Long) As Double
(Read only property)
ptro(iValveIndx ptro(iValveIndx As Long) As Double
(Read only property)
Page 105
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
•
series(iValveIndx series(iValveIndx As Long) As String
•
UseAnnulusGasGradient As Boolean
•
UseValveDetails As Boolean Boolean
•
•
•
(Read only property)
ValveCv(iValveIndx ValveCv(iValveIndx As Long) As Double
(Read only property)
ValveMode(iValveIndx ValveMode(iValveIndx As Long) As String
(Read only property)
ValveModeType(iValveIndx ValveModeType(iValveIndx As Long) As Long
(Read only property)
Single Branch Output Reader COM An ATL COM DLL has been developed to read data from a performance curves file. Name
The name of the of the COM is WELLCURVE.DLL. WELLCURVE.DLL. Interfaces supported & supported & Registering
The COM is support on C++ and Visual basic Register the COM by using REGSVR32.EXE. For C++ usage: Include the following paragraph in the stdafx.h header file:
#import wellcurve.dll no_namespace For Visual basic usage: Include the COM object in your project, select Projects ‐> References, then WELLCURVELib 1.0 type library. 1. COM diagram 2. Dependency map 3. COM methods
ReadData Object - Get methods •
GetFileCreatorName() As String
Returns the name of the of the simulator that has been used to create the performance curves. Parameters ‐ None Return Value ‐ A string.
Page 106 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetNumberofVariables() As Long
Returns the number of variables (data columns) in the performance curve. Parameters ‐ None Return Value ‐ An integer.
•
GetUnitofVariable(VariableName As String) As String
Returns the unit of given the column variable name. Parameters ‐ VariableNme ‐ Name of the column variable Return Value ‐A string.
•
GetDataofVariable(VariableName As String)
Returns the array of data at the given column variable name in the performance curves file. Parameters ‐ VariableNme ‐Name of the column variable Return Value ‐ A variant (as an array of variants). The number of elements in a sub variant is equal to the number of data points between two NEWLINE keywords in the VarName column plus one (for legends).
•
GetVariableName(Index As Long) As String
Returns the name of column variable given the position of the variable. Parameters ‐ Index ‐ The position of the variable name in the column variable list. Return Value ‐ A string.
•
GetMultipleVariablesData(Indexes)
Returns the array of data at the given number of variables in the performance curves file Parameters ‐ Indexes ‐ Indexes is a variant that contains an array of integers (indexes of the column variables) Return Value ‐ A variant (as an array of variants). The number of variants in the main array is equal to the number of elements in the Indexes array.
•
GetTitle() As String
Returns the title of the well performance curves file. Parameters ‐ None Return Value ‐ A string.
•
GetNumberofDataSets() As Long
Returns the number of data sets (= number of NEWLINE cards) in the performance curves file. Parameters ‐ None Return Value ‐ An integer.
•
GetVariableNamesList()
Returns the list of names of column variables in the performance curves file. Parameters ‐ None Return Value ‐ A Variant. The number of elements in the Variant is equal to the number of columns in the performance curves file.
Page 107
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetAllData()
Returns the entire column variables data in the performance curves file. Parameters ‐ None Return Value ‐ A Variant (as an array of variants). The number of Variants in the array is equal to the number of column variables and the number of elements (number of double type values) in a sub Variant is equal to the number of data points per column variable in the performance curves file.
•
GetLastError() As String
Returns the last error message
ReadData Object - Operations •
OpenFile(FilePath As String) As Boolean
Opens the given performance curves file, and returns a Boolean type. This function must be called before any other functions (methods) in the DLL are called. Parameters ‐ FileName ‐the full path (including the name) of the performance curves file. Return Value ‐ True for successful open or False for failure to open.
•
CloseFile() As Boolean
Closes the performance curves file that has been previously opened, and returns a Boolean type. This function must be called after finish reading the data and before open another file. Parameters ‐ None Return Value ‐ True for successful closure, or False for failure to close.
Page 108 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
ReadData Object Examples Visual C++ Sample Code
voi d CPer f or mCur ve: : OnRun( ) { _bst r _t Cr eat or Name; / / Fi l e cr eat or ' s name _bst r _t Var Name; / / Col umn name i nt NoVar s; / / Number of dat a col umns i n t he f i l e i nt NoSet s; / / Number of dat a set s per col umn _var i ant _t vaDat a; / / Dat a i n a col umn _var i ant _t vaVar Li st ; / / Col umn names l i st i nt i st , i ed; / / l ower and upper bound of a var i ant i nt j st , j ed; / / l ower and upper bound of a var i ant i nt i , j ; / / Count er s SAFEARRAY *sa1, *s a2; / / Support i ng var i abl es _var i ant _t va1, va2; / / Suppor t i ng var i abl es l ong i ndex; / / Suppor t i ng var i abl e / / I ni t i al i z e t he COM l i br ar y CoI ni t i al i z e( NUL L) ; / / Def i ne a poi nt er t o ReadDat a COM obj ect I ReadDat aPt r pPer Cur ; / / Cr eat e an i nst ance of ReadDat a i f ( pPer Cur . Cr eateI nst ance( _uui dof ( ReadDat a) ) ! = S_OK) { Af xMessageBox( Per f or mance cur ve ReadDat a component not f ound) ; r et ur n; } / / Open t he per f ormance cur ve f i l e BOOL success = pPer Cur - >OpenFi l e( D: \ \ SOURCE\ \ CASE1\ \ WELL_11. PLT) ; i f ( s uc ces s ) { / / Get t he f i l e cr eat or ' s name Cr eat or Name = pPer Cur - >Get Fi l eCr eat or Name( ) ; / / Get number of var i abl es ( col umns) i n t he f i l e NoVar s = pPer Cur - >Get Number of Var i abl es( ) ; / / Get number of dat a set s i n a col umn NoSet s = pPer Cur - >Get Number of Dat aSet s( ) ; / / Get name of t he f i r st col umn ( = Col umn number 1 NOT 0) Var Name = pPer Cur - >Get Var i abl eName( 1) ; / / Get dat a f or t he above var i abl e ( col umn) vaDat a = pPer Cur - >Get Dat aof Var i abl e( Var Name) ; / / How t o get dat a out of vaDat a i f ( vaDat a. vt ! = VT_EMPTY) { sa1 = vaDat a. par r ay; / / Get l ower bound of vaDat a, shoul d be zer o
Page 109
PIPESIM Version 2011.1 OpenLink Reference Manual
i st // i ed f or {
= sa1- >r gsabound[ 0] . l Lbound; Get upper bound of vaDat a, shoul d be equal t o NoSet s = sa1- >r gsabound[ 0] . cEl ement s; ( i =i st ; i <=i ed; i ++) i ndex = i ; Saf eAr r ayGet El ement ( sa1, &i ndex, &va1) ; i f ( va1. vt ! = VT_EMPTY) { sa2 = va1. par r ay; / / Get l ower bound of vat mp, shoul d be zer o j st = s a2- >r gsabound[ 0] . l Lbound; / / Get upper bound of vat mp, shoul d be equal / / t o number of dat a poi nt s per dat a set pl us one
( l egend) j ed = s a2- >r gsabound[ 0] . cEl ement s; f or ( j =j st ; j <=j ed; j ++) { i ndex = j ; Saf eAr r ayGet El ement ( sa2, &i ndex, &va2) ; } } } } / / Get v ar i abl e l i s t vaVarLi st = pPer Cur - >Get Var i abl eNamesLi st ( ) ; / / Cl os e t he f i l e pPer Cur - >Cl oseFi l e( ) ; } / / Dest r oy t he pPer Cur pPer Cur . Rel ease( ) ; / / Cl os e COM l i br ar y CoUni ni t i al i z e( ) ;
}
Visual basic Sample Code
Opt i on Expl i ci t Pr i vat e wt st As New WELLCURVELi b. ReadDat a
' create an object of the
performance curve reader
Pr i vat e Sub Command1_Cl i ck( ) Di m vt mp As Var i ant Di m vDat a As Var i ant Di m NoCol As I nt eger Di m NoDat aSet s As I nt eger Di m st r As St r i ng Di m i st As I nt eger Di m i ed As I nt eger Di m i As I nt eger ' Open t he f i l e I f ( wt st . OpenFi l e( d: \ sour ce\ case1\ wel l _11. pl t ) ) Then ' Get t he f i l e creat or ' s ( si mul at or ' s) name Page 110 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
st r = wt st . Get Fi l eCr eat orName( ) ' Get number of var i abl es l i st ed i n t he f i l e NoCol = wt st . Get Number of Var i abl es( ) ' Get t he var i abl e l i s t vt mp = wt st . Get Var i abl eNamesLi st ( ) I f ( Not I sEmpt y( vt mp) ) Then i st = LBound( vt mp) i ed = UBound( vt mp) For i = i st To i ed ' Get individual variable names (method 1)
st r = vtmp( i ) ' Get individual variable names (method 2)
st r = wt st . Get Var i abl eName( i + 1) ' Get the data for above variable (str)
vDat a = wt st . Get Dat aof Vari abl e( st r ) Next i End I f ' Get number of data sets in the file (= number of NEWLINE keywords)
NoDat aSet s = wt st . Get Number of Dat aSet s( ) ' Get t he t i t l e of per f or mance cur ve s t r = wt s t . Get Ti t l e( ) ' Get al l var i abl e dat a vDat a = wt st . Get Al l Dat a( ) ' Get multiple variable data ' Create indexes array
ReDi m vt mp( 2) vt mp( 0) = 1 vt mp( 1) = 4 vt mp( 2) = 6 vDat a = wt st . Get Mul t i pl eVar i abl esDat a( vt mp) ' Cl os e t he f i l e wt s t . Cl os eFi l e End I f Set wt st = Not hi ng End Sub
PerformCurve Object PerformCurve Object - Get methods •
•
•
GetAllVariables()
Returns a Variant type containing multidimensional array of all values from the curve file. First dimension is a number of the variables, second dimension is a number of cases and the third dimension contains all values for the each case plus the case name. All returned values are wrapped into Variants
GetAttributeDetailsAt(VariableName As String)
Returns a String (as Variant) containing plotting attributes for the specified variable
GetAxisBoundaries()
Returns a Variant type containing two‐dimensional array of the low/upper boundaries for the plot variables.
Page 111
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
GetBubblePointData()
Returns (as Variant type) the array of three doubles values for saturation pressure, saturation temperature and saturation GOR. (Black oil models only.)
GetColumnVariableDataAt(VarName As String)
Returns a Variant type containing two‐dimensional array of all values for specified variable. First dimension is a number of cases and the second dimension contains all values for the each case plus two extra strings at the end; the first of these is the case name and the second contains formatting details of the variable data. All returned values are wrapped into Variants
•
GetConcatenationData()
•
GetConeGasSG() As Double
Returns a Double value (wrapped into Variant type) of cone gas specific gravity
•
GetCreationDate()
Returns a String value (wrapped into Variant type) of curve file date/time stamp
•
GetCurrentModelUnitSettings()
Returns (as Variant type) the two‐column array of strings for all plotted variables. First column contains variable’s measurement and a second column contains variable’s units
•
GetDefaultXAxis() As Long
Returns an index for X axis variable
•
GetDefaultYAxis() As Long
Returns an index for Y axis variable
•
GetDynamicPlotFileName() As String
Returns a curve file name (short form)
GetDynamicPlotLongFileName() As String
Returns a curve file name (long form)
•
GetFileFormatStatus() As String
Return a String New if curve file has new format, otherwise return value is Old
•
GetLastError() As String
Returns the last error message produced by the interface.
•
GetMultipleColumnsDataAt(Index)
Returns data similar to GetAllVariables function but for variables passed in Index array
•
GetNoOfDataColumn() As Long
Returns the total number of variables in curve file
•
GetNumberOfCases() As Long
Returns the number of cases in curve file
•
GetPhysicalPropertyData()
Returns (as Variant type) the array of 6 doubles values for API, production gas specific gravity, injection gas specific gravity, water specific gravity, watercut and GOR. (Black oil models only.)
•
GetProductionData() ()
Returns (as Variant type) the array of 2 doubles values for Well PI and static reservoir pressure
•
GetSimulatorName() As String
Returns String with the simulator name
•
GetTitle() As String
Returns String with the project description
•
Page 112 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
GetUnitDetailsAt(VariableName As String)
Returns (as Variant type) the array of 5 Variants containing units information for the specified variable. First element is a String with measurement name, second element is a String with current units, third and forth elements are Doubles with multiplier and adder for conversion from strict SI units and last fifth element is a String with strict SI units
GetUnitsOfVariableName(sVarName As String) As String
Returns String with the current units for the specified variable
•
GetUnitType() As String
Returns String ENG or S depending on unit system user selected for the output files
•
GetUserName() As String
Returns String with the user name form project properties
•
GetVarableNamesList()
Returns (as Variant type) the array of Strings containing all variables names from curve file
GetVariableDataAt(ColName As String)
Returns (as Variant type) the array of Doubles containing all values for the specified variable
GetVariableDataAtCase(VarName As String, CaseNo As Long)
Similar to GetVariableDataAt but returned values are for the specified case only (case index is 1‐based)
GetVariableNameAt(Index As Long) As String
Returns String with the variable name at specified index (1‐ based)
GetViscosityData()
Returns (as Variant type) the array of 4 doubles values for temperatures and viscosities
•
•
•
•
•
•
PerformCurve Object - Operations •
OpenFile(FilePath As String) As Boolean
Opens the given performance curves file, and returns a Boolean type. This function must be called before any other functions (methods) in the DLL are called. Parameters ‐ FileName ‐the full path (including the name) of the performance curves file. Return Value ‐ True for successful open or False for failure to open.
•
CloseFile() As Boolean
Closes the performance curves file that has been previously opened, and returns a Boolean type. This function must be called after finish reading the data and before open another file. Parameters ‐ None Return Value ‐ True for successful closure, or False for failure to close.
•
IsWellFileOpened() As Boolean
Returns True if the curve file is open and False otherwise
Page 113
PIPESIM Version 2011.1 OpenLink Reference Manual
PNSReaderCOM PNSREADER.DLL includes COM compatible interfaces that can be used to read output from the output file (PNS) generated by the PIPESIM and PIPESIM‐NET engines. Supported Interfaces
IPNSCom, IPNSCom2, IPNSCom3: for network models and single branch operations.
Dependency MAP
PNSREADER.DLL has no PIPESIM dependencies. It can be found in the Schlumberger\ COMMON\ACTIVEX folder.
IPNSCom Interface – Operational methods •
ReadPnsFile
Read a Net engine (.PNS) output file Params BSTR FileName ‐ Full path of net engine file (.PNS)
IPNSComPtr Interface - Get Methods •
GetNodeCount
Get total number of nodes; that is number of junctions + wells + source + sinks + internal + equipment params (#) int *iNodeCount
•
GetBranchCount
Get total number of branches (that is excluding wells which engine treats as branch + source/sink) params (#) int ‐ *BranchCount
•
GetWellCount
Get total number of wells; that is injection wells + production wells
•
GetNodeData
Fill a supplied SAFEARRAY (blob) with node data for i'th node, data format fixed as ‐ name, type, g rate, l rate, m rate, press, temp , press resid, rate resid, glr, lgr, wcut params int iNode ‐ index of node in array (#) VARIANT *vNodeData SAFEARRAY to hold data
•
GetBranchOutData,
•
GetBranchInData
Fill a supplied SAFEARRAY (blob) with node data for i'th branch, data format fixed as ‐ name, type, g retell rate, m rate, press, temp , press resid, rate resid, glr, lgr, wcut params int iNode ‐ index of node in array (#) VARIANT *vNodeData SAFEARRAY to hold data
Page 114 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetNodeName
name of the i'th node in the array params int iNode ‐ index in array (#) BSTR *sName ‐ name of iNode'th element
•
GetNodeIndex
index of the node in the array params BSTR *sName ‐ name of the node (#) int iNode ‐ index in array
•
GetNodeType
Get Network node type params int iNode ‐ index in array (#) BSTR* sName ‐ Source, Sink, Well, Junction
•
GetBranchName
name of the i'th branch in the array params int iBranch ‐ index in array (#) BSTR *sName ‐ name of iBranch'th element
•
GetBranchIndex
index of the branch in the array params BSTR *sName ‐ name of the branch (#) int iBranch ‐ index in array
•
GetWellName
name of the i'th well in the array params int iWell ‐ index in array (#) BSTR *sName ‐ name of iWell'th element
•
GetWellIndex
index of the well in the array params BSTR *sName ‐ name of the well (#) int iWell ‐ index in array
Page 115
PIPESIM Version 2011.1 OpenLink Reference Manual
•
GetNodeVariableValue,
Gets value of variable type for i'th element of array
•
GetBranchOutVariableValue,
params int iNode/iBranch/iWell ‐ index of element in the array
•
GetBranchInVariableValue
•
GetWellOutVariableValue
(#) double *dValue ‐ value requested. 6 ‐ Baker Jardine COM documentation
•
GetWellInVariableValue
PIPESIM BSTR sType: Options for non‐equipment nodes, branch inlet/outlet, and well inlet/outlet: Pressure Temperature StockTankMassFlowRate StockTankLiquidVolumeFlowRate StockTankGasVolumeFlowRate FlowingLiquidVolumeFlowRate FlowingGasVolumeFlowRate StockTankGLR StockTankWatercut FlowingWatercut Additional options for branch/well inlets: NumberOfEquipment MeanVelocity LiquidVelocity GasVelocity ErosionVelocity ErosionRatio MaxMeanVelocity MaxLiquidVelocity MaxGasVelocity MaxErosionVelocity MaxErosionRatio Options for equipment nodes: EquipmentPressureDrop EquipmentPower (if applicable) EquipmentTemperatureDrop
Page 116 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
T
T
T
GetNodeStrVariableValue, GetBranchInStrVariableValue, GetBranchOutStrVariableValue,
•
GetWellInStrVariableValue,
•
GetWellOutStrVariableValue
•
GetModelStatus
Gets value of variable type Gas Rate, glr etc. for named element of array Params BSTR sName ‐ Object identifier (name) for example, Well_1 (#) double *dValue ‐ value requested BSTR sType ‐ GasRate, LiquidRate, MassRate, pressure, Temperature, PressureResidual, RateResidual, GLR, LGR, Water Cut, Max Pres, Comp Power, Choke DP Gets convergence error information from the .PNS file Params (#) BSTR sName ‐ Convergence status string of the form 'Model failed to converge Convergence error = %4.3f Material balance error = %4.3f '
IPNSCom2 Interface - Get Methods •
GetBranchOutVariableValue2(iNode as Long, sType as String)
This function works the way similar to GetBranchOutVariableValue function and gets requested value of variable type. sType parameter can have following values:
LiquidRate, MassRate, Pressure, Temperature, PressureResidual, RateResidual, GLR, LGR, Water Cut, Gas Density, Oil Density, Water Density, Max Pres, Comp Power, Choke DP, Mean Velocity, Liquid Velocity, Gas Velocity, Erosion Velocity, Erosion Ratio, Max Mean Velocity, Max Liquid Velocity, Max Gas Velocity, Max Erosion Velocity, Max Erosion Ratio, Gas Volume Rate Standard, Oil Volume Rate Standard, Water Volume Rate Standard, Gas Mass Rate Standard, Oil Mass Rate Standard, Water Mass Rate Standard, Gas Holdup Standard, Gas Holdup Flowing, Liquid Holdup, Oil Holdup, Water Holdup, Total Pipeline Volume, Max Hydrate Sub‐Cooling, Max Wax Sub‐Cooling, Max Asphaltene Sub‐Cooling, Variable_opt01, Variable_opt02, Variable_opt03, Variable_opt04, Variable_opt05, Variable_alpha, Variable_beta, Optimize_title, Optimize_title_type, Optimize_pmatch, Optimize_tmatch, Optimize_rms. All the returned variables have double type exclude Optimize_title (it has Boolean type) and Optimize_title_type, Variable_alpha, Variable_beta (they have String type).
Page 117
PIPESIM Version 2011.1 OpenLink Reference Manual
IPNSCom3 Interface - Get Methods •
•
•
•
GetCaseVariableValue(iCase as int, sPropName as String) GetBranchGlobalVariableValue(iBranch as int, sPropName as string) T
GetSBranchGlobalVariableValue(iBranch as int, sType as string)
These functions work the way similar to GetBranchInVariableValue function and gets requested value of variable type.
T
GetWellGlobalVariableValue(iWell as int, sPropName as string) T
sType parameter can have following values:
BranchPressureDrop MaxPressure BranchTemperatureDrop
•
•
GetBranchGlobalStrVariableValue (sBranch as string, sType as string) T
GetWellGlobalStrVariableValue (sWell as string, sType as string)
These functions work the way similar to GetBranchGlobalVariableValue function and gets requested value of variable type.
T
sBranch or sWell is the object name. sType parameter can have following values:
BranchPressureDrop MaxPressure BranchTemperatureDrop
IPNSComPtr Interface Examples C++ Sample Code
CMyObj : : ReadPnsFunc( ) { CSt r i ng sNodeType; CoI ni t i al i z e( NUL L) ; I PNSComPt r pPNS; i f ( pPNS. Cr eat eI nst ance( _uui dof ( PNSCom) ) ! = S_OK) { Af xMessageBox( PNS r eader component not f ound) ; r et ur n; } pPNS- >ReadPnsFi l e( ( LPCTSTR) case1. pns ) ; i NumNodes = pPNS- >Get NodeCount ( ) ; i NumBr anches = pPNS- >Get Br anchCount ( ) ; i NumWel l s = pPNS- >Get Wel l Count ( ) ; BSTR ss = pPNS- >Get Model St at us( ) ; f or ( i nt i = 0 ; i < i NumNodes; i ++) { BSTR Name = pPNS- >Get NodeName( i ) ; BSTR sNodeType= pPNS- >Get NodeType( i ) ; dVal = pPNS- >Get NodeVar i abl eVal ue( i , Pr essur e) ; i f ( dVal ! = Unset ( ) ) / / = - 7777 { dVal = pPNS- >Get NodeVar i abl eVal ue( i , Temper at ur e) ; dVal = pPNS- >Get NodeVar i abl eVal ue( i , MassRat e) ; Page 118 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
dVal = pPNS- >Get NodeVari abl eVal ue( i , Li qui dRat e) ; dVal = pPNS- >Get NodeVar i abl eVal ue( i , GasRat e) ; dVal = pPNS- >Get NodeVar i abl eVal ue( i , GLR) ; dVal = pPNS- >Get NodeVar i abl eVal ue( i , Wat er Cut ) ; } i nt st ar t = i NumNodes + 2; / / Br anches f or ( i nt j = 0; j <= 1; j ++ ) { f or ( i = 0; i < i NumBr anches; i ++ ) { BSTR sName = pPNS- >Get Br anchName( i ) ; i f ( j != 1 ) { dVal = pPNS- >Get Br anchI nVari abl eVal ue( i , Pr essur e) ; dVal 2 = pPNS- >Get Br anchOut Var i abl eVal ue( i , Pr essur e) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , Temper at ur e) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , MassRat e) ; dVal = pPNS- >Get Br anchI nVari abl eVal ue( i , Li qui dRat e) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , GasRat e) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , GLR) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , Wat er Cut ) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , Max Pr es) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , Comp Power ) ; dVal = pPNS- >Get Br anchI nVar i abl eVal ue( i , Choke DP) ; } el se { dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , Pr essur e) ; dVal 2 = pPNS- >Get Br anchI nVari abl eVal ue( i , Pr essur e) ; dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , Temper at ur e) ; dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , MassRat e) ; dVal = pPNS- >Get Br anchOut Vari abl eVal ue( i , Li qui dRat e) ; dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , GasRat e) ; dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , GLR) ; dVal = pPNS- >Get Br anchOut Var i abl eVal ue( i , Wat er Cut ) ; . dVal = pPNS- >Get Br anchOut Var i abl eVal ue( dVal = pPNS- >Get Br anchOut Var i abl eVal ue( dVal = pPNS- >Get Br anchOut Var i abl eVal ue( } st art ++; } } / / Wel l s f or ( j = 0; j <= 1; j ++ ) { f or ( i = 0; i < i NumWel l s; i ++ ) { BSTR sName = pPNS- >Get Wel l Name( i ) ; i f ( j != 1 ) { dVal = pPNS- >Get Wel l I nVar i abl eVal ue( i , dVal = pPNS- >Get Wel l I nVar i abl eVal ue( i , dVal = pPNS- >Get Wel l I nVar i abl eVal ue( i , dVal = pPNS- >Get Wel l I nVar i abl eVal ue( i , dVal = pPNS- >Get Wel l I nVar i abl eVal ue( i ,
i , Max Pr es) ; i , Comp Power ) ; i , Choke DP) ;
Pressure) ; Temper at ur e) ; MassRat e) ; Li qui dRat e) ; GasRat e) ;
Page 119
PIPESIM Version 2011.1 OpenLink Reference Manual
dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l } el se { dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l dVal = pPNS- >Get Wel l } st art ++; } } pPNS. Rel ease( ) ; CoUni ni t i al i z e( ) ; }
I nVar i I nVar i I nVar i I nVar i I nVar i
abl abl abl abl abl
Out Var i Out Var i Out Var i Out Var i Out Var i Out Var i Out Var i Out Var i Out Var i Out Var i
eVal ue( eVal ue( eVal ue( eVal ue( eVal ue(
abl abl abl abl abl abl abl abl abl abl
eVal ue( eVal ue( eVal ue( eVal ue( eVal ue( eVal ue( eVal ue( eVal ue( eVal ue( eVal ue(
i i i i i
, , , , ,
i i i i i i i i i i
GLR) ; Wat er Cut ) ; Max Pr es) ; Comp Power ) ; Choke DP) ;
, , , , , , , , , ,
Pressure) ; Temper at ur e) ; MassRat e) ; Li qui dRat e) ; GasRat e) ; GLR) ; Wat er Cut ) ; Max Pr es) ; Comp Power ) ; Choke DP) ;
VBA Sample Code
Taken from EXPORT.XLS Open Link Case study Pr i vat e Sub ShowResul t s( ) Di m PnsReader As New PNSREADERLi b. PNSCom Di m f i l ename ' cl ear out put r ange Set r v = Range( OUTVAL_ RANGE) r v. Cl ear Cont ent s f i l ename = Range( MODELFI LE) pos = I nSt r ( 1, f i l ename, . bpn, 1) I f ( pos > 0) Then f i l ename = Lef t ( f i l ename, pos) f i l ename = f i l ename + pns End I f Di Di Di Di
m nodei ndex As Long m sour cename As Var i ant m val ue As Doubl e m bOK
I f ( PnsReader . ReadPnsFi l e( f i l ename) ) Then Set r = Range( SOURCE_RANGE) Di m col col = 1
Page 120 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Set r 1 = Range( OUTI NJ GAS_RANGE2) r 1. Cl earCont ent s Set r 2 = Range( OUTFLOWRATE_ RANGE2) r 2. Cl earCont ent s For Each sour cename I n r . Col umns nodei ndex = PnsReader . Get NodeI ndex( sour cename) I f ( nodei ndex <> - 1) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, Pr essur e) I f ( val ue <> - 7777) Then r v. Cel l s( 1, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, Temper at ur e) r v. Cel l s( 2, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, Li qui dRat e) r v. Cel l s( 3, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, GasRat e) r v. Cel l s( 4, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, MassRat e) r v. Cel l s( 5, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, GLR) r v. Cel l s( 6, col ) = val ue End I f I f ( val ue <> - 7777) Then val ue = PnsReader . Get NodeVar i abl eVal ue( nodei ndex, Wat er Cut ) r v. Cel l s( 7, col ) = val ue End I f End I f '-------------------------------------------------------' Get t he pr essur e pr of i l es - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Di Di Di Di
m Pl t Reader Obj As New WELLCURVELi b. Per f or mCur ve m pl cf i l e, t empf i l e m di st ance m pr essur e
pl cf i l e = Range( MODELFI LE)
Page 121
PIPESIM Version 2011.1 OpenLink Reference Manual
t empf i l e = pl cf i l e Do pos = I nSt r ( 1, t empf i l e, \ , 1) t empf i l e = Ri ght ( t empf i l e, Len( t empf i l e) - pos) Loop Whi l e pos > 0 I f ( Len( t empf i l e) > 0) Then pl cf i l e = Lef t ( pl c f i l e, Len( pl cf i l e) - Len( t empf i l e) ) pl cf i l e = pl cf i l e + sour cename + . pl c I f ( Pl t Reader Obj . OpenWel l Fi l e( pl cf i l e) ) Then di st ance = Pl t Reader Obj . Get Col umnVar i abl eDat aAt ( Tot al Di s t a nc e ( f t ) ) Di m Lower , Upper , i Lower = LBound( di st ance( 0) , 1) Upper = UBound( di st ance( 0) , 1) For i = Lower To Upper - 2 r 1. Cel l s ( i + 1) = di s t a nc e( 0) ( i ) Next pr essur e = Pl t Reader Obj . Get Col umnVar i abl eDat aAt ( Pr essur e ( ps i a) ) Di m Lower O, Upper O Di m out t er Lower O = LBound( di st ance( 0) , 1) Upper O = UBound( di st ance( 0) , 1) For out t er = Lower O To Upper O - 2 r 2. Cel l s( out t er + 1, col ) = pr essur e( 0) ( out t er ) Next Set r t i t l e = Range( CASE1TI TLE_RANGE) r t i t l e. Cel l s ( 1, col ) = pr es sur e( 0) ( out t er ) Pl t Reader Obj . Cl oseWel l Fi l e End I f End I f col = col + 1 Next End I f End Sub
Page 122 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Inflow Performance Calculator COM Name
The name of the COM module is WellModelCOM.DLL.
Interfaces supported & Registration
Support provided for any COM compliant application
Supported COM Interfaces
Jones: To fit and visualise the IPR curve for a given number of data points according to the Jones' equation: Pws ‐ Pwf
= BQ + AQ^2
Pws^2 ‐ Pwf^2 = BQ + AQ^2
(Liquid) (Gas)
Dependency MAP
List of Dependencies: Spr32x30.ocx, TeeChart.ocx, MFC42.DLL
COM Interface: Jones - Get Methods •
a: the value of the A parameter in the Jones equation
GetJonesAandBConstants ([out] double * a, [out] BSTR * a_unit, [out] double * b, [out] BSTR * b_unit)
a_unit: the unit string for the A parameter b: the value of the B parameter in the Jones equation b_unit: the unit string for the B parameter
COM Interface: Jones - Set Methods •
AddFlowrateAndPwfPoint ([in] double frate, [in] BSTR frate_unit, [in] double pwf, [in] BSTR pwf_unit)
frate: flowrate value (double) frate_unit : unit string for the flowrate value. Any of:
STB/d, sm3/d for Liquid Rates OR: mmscf/d mscf/d, scf/d, mmsm3/d, msm3/d, sm3/d for gas rates pwf : tubing flowing pressure (double) pwf_unit : unit string for the pwf value: Any of: psia psig, bara, barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g
Call this function once for each survey point.
Page 123
PIPESIM Version 2011.1 OpenLink Reference Manual
•
AddFlowrateAndPwfData ([in] short ftype, [in] BSTR frate_unit, [in] BSTR pwf_unit, [in] BSTR Legend, [in] VARIANT * vData, [in] const unsigned long pType)
ftype: fluid type, type_liquid = 0, type_gas = 1 frate_unit : unit string for the flowrate value. Any of: STB/d, sm3/d for Liquid Rates OR: mmscf/d mscf/d, scf/d, mmsm3/d, msm3/d, sm3/d for gas rates pwf_unit : unit string for the pwf value: Any of: psia psig, bara, barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g Legend : Legend to show on plot vData: variant whose SAFEARRAY contains a 2D array (col[0] = FlowRate data, col[1] = Pwf data) Line = 0; Bar = 1; HorizBar = 2; Area = 3; Point = 4
Use this function to compare an observed set of points with the fitted curve. •
•
•
SetFluidType (/*[in]*/ short ftype)
ftype: fluid type, type_liquid = 0, type_gas = 1
SetStaticPressure ([in] double pres, [in] BSTR unitStr)
Pres: static pressure value
SetJonesAConstant ([in] double val, [in] short unitSystem)
val: the A parameter in the Jones equation
UnitStr : units for the pressure value. Any of: psia psig, bara, barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g
unitSystem: 0: val is in default Eng : psi/(STB/d)^2 (liq) or (psi/mmscf/d)^2 (gas) 1: val is default SI: bar/(sm3/d)^2 (liq) or (bar/mmsm3/d)^2 (gas)
Set this value to calculate the B parameter given A and one survey point •
•
•
SetJonesBConstant ([in] double val, [in] short unitSystem)
val: the B parameter in the Jones equation
SetJonesMeasuredAConstant ([in] double val, [in] short unitSystem)
val: the A parameter in the Jones equation
SetJonesMeasuredBConstant ([in] double val, [in] short unitSystem)
val : the B parameter in the Jones equation
unitSystem: 0: val is in default Eng: psi/STB/d (liq) or psi2/mmscf/d (gas) 1: val is default SI: bar/sm3/d (liq) or bar2/mmsm3/d (gas). Set this value to calculate the A parameter given B and one survey point
unitSystem: 0: val is in default Eng: psi/(STB/d)^2 (liq) or (psi/mmscf/d)^2 (gas) 1: val is default SI: bar/(sm3/d)^2 (liq) or (bar/mmsm3/d)^2 (gas) For display purposes only. Set this value to compare a measured pair of A and B values with the calculated ones
unitSystem: 0: val is in default Eng: psi/STB/d (liq) or psi2/mmscf/d (gas) 1: val is default SI: bar/sm3/d (liq) or bar2/mmsm3/d (gas) For display purposes only. Set this value to compare a measured pair of A and B values with the calculated ones
•
SetUnitSystem ([in] long unitSystem)
unitSystem: 0: values will be displayed in default Engineering units; 1: SI units
Page 124 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
COM Interface: Jones - Operations •
DoCalculateConstants ()
Calculates the A and B parameters based on the given data: static reservoir pressure and {pwf, flowrate} points
•
ShowInflowPerformanceDlg ()
Displays the IPR COM graphical interface
COM Interface: Jones Example VBA Sample Code
' Cr eat e an i nst ance of t he J ones COM i nt er f ace Di m J onesObj As WELLMODELCOMLi b. J ones Set J onesObj = New J ones ' Set st at i c pr essur e as 4000 psi a ' l egal pr essur e uni t s: psi a psi g bar a bar g at ma at mg kPa a kPa g kg/ cm2 kg/ cm2 g pws = 4000. 0 pws_uni t = ' psi a' J onesObj . Set St at i cPr ess ur e pws, pws_uni t ' Set t he f l ui d t ype: 0 f or l i qui d 1 f or Gas J onesObj . Set Fl ui dType 1 ' Gas ' l egal l i qui dRat e uni t s : STB/ d sm3/ d ' l egal gasRat e uni t s mmscf / d mscf / d, scf / d, mmsm3/ d msm3/ d, sm3/ d, ' J J J J
Add 4 dat a poi nt s onesObj . AddFl owr at eAndPwf Poi nt onesObj . AddFl owr at eAndPwf Poi nt onesObj . AddFl owr at eAndPwf Poi nt onesObj . AddFl owr at eAndPwf Poi nt
10. 0, 28. 0, 30. 0, 25. 0,
' ' ' '
mmsc f / d' , mmsc f / d' , mmsc f / d' , mmsc f / d' ,
3600, 2400, 2100, 1600,
' ' ' '
psi psi psi psi
a' a' a' a'
' Di spl ay gr aphi cal i nt er f ace t o show t he f i t t ed cur ve and cal cul at ed const ant s J onesObj . ShowI nf l owPer f or manceDl g
Units Library IUnitSystem Interface
Note: See Unit System for the available quantity names and unit strings. •
Convert [in] BSTR quantity_name, [in] double in_value, [in] double factor_to_SI, [in] double adder_to_SI, [in] BSTR out_unit, [out, retval] double * out_value
Converts in_value to [out_value, out_unit] given the in_value’s conversion factor and adder to convert it to its strict SI unit. Returns out_value in the given out_unit
Page 125
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
•
•
•
•
•
•
Convert_SI [in] BSTR quantity name, [in] double si_value, [in] BSTR out_unit, [out, retval] double * out_value
Converts a given quantity in strict SI units to the given out_unit
ConvertAny [in] BSTR quantity_name, [in] double in_value, [in] BSTR in_unit, [in] BSTR out_unit, [out, retval] double * out_value
Converts a quantity given as [in_value, in_units] to an out_unit
ConvertStrictSIToCurrentUnits [in] BSTR quantity_name, [in] double value, [in] BSTR out_unit, [out, retval] double * out_value
Converts a quantity given as [value] in strict SI to an out_unit defined according to the units file imported using ImportUnitFile. By default it will be Eng units if no unit file has been imported
ConvertToDefEng [in] BSTR quantity_name, [in] double value, [in] BSTR value_unit, [out] BSTR *eng_unit, [out, retval] double *eng_value
Converts a quantity given as [in_value, in_units] to the PIPESIM’s default engineering unit for that quantity.
ConvertToDefSI [in] BSTR quantity_name, [in] double value, [in] BSTR value_unit, [out] BSTR *si_unit, [out, retval] double * si_value
Converts a quantity given as [in_value, in_units] to the PIPESIM’s default SI unit for that quantity. Please note that default SI is not necessarily equal to strict SI.
ConvertToStrictSI [in] BSTR quantity_name, [in] double value, [in] BSTR value_unit, [out] BSTR *si_unit, [out, retval] double *si_value
Converts a quantity given as [in value, in units] to the strict SI unit for that quantity. Please note that default SI is not necessarily equal to strict SI
DisplayUnitDialog [in] VARIANT_BOOL bShowFileOptions, [in] VARIANT_BOOL bShowDeaultOptions, [out] VARIANT * pVar
Displays the graphical user interface for unit system selection.
GetDefEngUnitString [in] BSTR quantity name, [out, retval] BSTR * unit string
Returns the default engineering unit string for a given quantity.
GetDefSIUnitString [in] BSTR quantity_name, [out, retval] BSTR * unit_string
Returns the default SI unit string for a given quantity.
GetLastError [out, retval] BSTR * ErrorStr
Returns an error description. This method should be called immediately after a function has returned an error code.
Page 126 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
•
•
•
•
GetStrictSIUnitString [in] BSTR quantity name, [out, retval] BSTR * unit_string
Returns the strict SI unit string for a given quantity.
GetUnitStrings [in] BSTR quantity name, [out] VARIANT * pVar
Returns an array of unit strings defined for the given quantity.
GetUnknownValue [out, retval] double *pVal
Returns PIPESIM’s definition of ‘unset’ or ‘unknown’ value.
ImportUnitFile [in] BSTR filename
Imports a saved units file (saved by default with a .unf extension)
IReal Interface
UnitClass string
Gets/sets unit class name
SetRealValue [in] double Value, [in] BSTR Unit
Sets a Value in the specified unit string
GetRealVal [out] double * pValue, [out] BSTR * pUnit
Returns a value in the units corresponding to pUnit
SetSelectedUnit [in] BSTR UnitStr, [out, retval] VARIANT_BOOL
Selects the given unit string
GetSelectedUnit [out, retval] BSTR * UnitStr
Returns the selected unit string
GetDefEngValue [out, retval] double * Val
Returns the value in default engineering units
•
GetStrictSIValue
Returns the value in strict SI units
•
GetUserValue
Returns the value in user selected units
•
SetStrictSIValue
Sets a Value in strict SI units
•
•
•
•
•
•
Reservoir Table Name
The name of the COM module is ResTable.DLL.
Interfaces supported & Registration
Support provided for any COM compliant application
Page 127
PIPESIM Version 2011.1 OpenLink Reference Manual
Supported COM Interfaces
RESTABLELib.IResTableOp:
To output VFP tables for external reservoir simulators. The output files are
. VFP. . . t xt , where is the base model name, indicates Production or Injection well, indicates BHP or Temperature VFP table, and is the table number to be included in ECLIPSE file. Note: The Injection well or Temerature VFP table options are only available for ELICPSE simulator.
IResTableOp Object - Properties •
RunEngineMinimised As Boolean
Runs the engine in a minimised window
•
RunPlotToolWithEngine As Boolean
If True (1) shows the plotting tool (PSPlot) as the simulation runs
•
PsmFilePath As String
The full path to the model file (.psm file)
•
PlotToolPath As String
The full path to the plotting tool (PSPlot)
•
IncludeFilePath As String
The full path name to the engine’s operation file
•
PipesimEnginePath As String
The full path to the PIPESIM engine
•
EngineSwitch As String
Sets/gets extra command line arguments for the PIPESIM engine
•
HasGasLiftInjection As Boolean
True for a well with gas injection artificial lift
•
HasESP As Boolean
True for a well with ESP
•
HasGasLiftInjection As Boolean
True for a well with gas injection artificial lift
•
IsProducerModel As Boolean
True for a production well, False for an injection well
IsFluidModelCompositional As Boolean
True for a well with gas injection artificial lift
•
FixedInjectionDepths As Boolean
True for a well with fixed gas injection depth
•
ModelIsInjectionWell As Boolean
True for an injection well
•
HasInjector As Boolean
•
IsBHPTableOnly As Boolean
If True, only generate pressure VFP table. Otherwise, an additional temperature VFP table will be generated. Default is True.
•
UserElev As Double
User specified elevation in VFP table. If unspecified, a default value, which is the total elevational change from inlet to outlet, will be written to the VFP table.
•
Page 128 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IResTableOp Object - Get Methods •
GetLastError() As String
Returns an error description after function call failure. Must be called immediately after the call to the failed function.
•
GetIsUnset() As Boolean
Returns True (1) if the operation’s data is all blank (unset)
•
GetIsEngineActive() As Boolean
Returns True (1) if the PIPESIM engine is running, otherwise False (0)
•
GetRawDataSize() As Long
Returns the size of raw data
IResTableOp Object - Set Methods •
SetLanguage(nlLanguageID As Long) As Boolean
Sets the user interface language Available values for nlLanguageID are: 0x0809 English (UK) 0x0419 Russian 0x080A Spanish (Mexican) 0x0416 Portuguese (Brazilian) 0x0804 Chinese (PRC) Function returns True if language was changed successfully and False otherwise
IResTableOp Object - Operations •
DisplayDialog(p_VarUnitManager As Variant)
Displays the operations graphical interface. Pass a NULL variant as the first argument. This method is obsolete. Use DisplayDialog2 method instead
DisplayDialog2(p_VarUnitManager As Variant) As Boolean
Displays the operations graphical interface. Pass a Null variant as the first argument. Returns true if dialog box was closed OK, otherwise false.
•
RunOperation();
Runs the simulation
•
KillOperation();
Terminates the engine run
•
WriteOperationFile() As Boolean
Writes an ASCII file containing the instructions to the simulation engine to run the operation.
ReadRawData(pVar As Varient) As Boolean
Serialize the Reservoir Table data structure into a binary file and then reads it into a memory block pointed by pVar.
WriteRawData(var as Variant) As Boolean
Writes a binary file containing the raw data pointed by var and then deserialize the data into the Reservoir Table data structure.
•
•
•
Page 129
PIPESIM Version 2011.1 OpenLink Reference Manual
VBA Sample Code
Taken from “Open Link VFP Batch Runs.XLS” Open Link Case study Sub RunVFPBat ch( ) 'Dimension all variables
Di m NoOf Wel l s As I nt eger , Wel l Li st ( ) As Var i ant , Wor ki ngDi r ect or y As St r i ng, Fi r st Wel l As I nt eger Di m Vf pSaveExi st s As St r i ng, MsgBoxYesNo As Long, n As Long, r et val , Text Edi t or As St r i ng Di m Psi mModObj As New NET32COMLi b. I Si ngl eBr anchModel Di m Vf pModObj As New NET32COMLi b. I Si ngl eBr anchModel Di m ResTabObj As New RESTABLELi b. I ResTabl eOp Di m Model I sRunni ng As Bool ean, NewHour As I nt eger , NewMi nut e As I nt eger , NewSecond As I nt eger Di m Wai t Ti me As Dat e, Vf pFi l eName As St r i ng 'Unprotect the sheet
Act i veSheet . Unpr ot ect 'Get the well and sensitivity set names
Range( " MessageBox") = " Checki ng i nput dat a" Cal l ReadWel l AndSenSet Dat a( NoOf Wel l s, Wel l Li st ( ) , Wor ki ngDi r ect or y, Fi r st Wel l ) 'Set the operation interface to each model and run it
For n = 1 To NoOf Wel l s 'get the reservoir table object
Range( " MessageBox" ) = " Openi ng sensi t i vi t y set " & Wel l Li st ( n, 2) Vf pModObj . OpenModel ( Worki ngDi r ect or y & " \ " & Wel l Li st ( n, 2) & " . bps" ) Vf pModObj . Set Oper at i onType 5 Vf pModObj . Get Oper at i onI nt er f ace ResTabObj 'Set the operation interface
Range( " MessageBox" ) = " Openi ng PI PESI M model " & Wel l Li st ( n, 1) Psi mModObj . OpenModel ( Wor ki ngDi r ect or y & " \ " & Wel l Li st ( n, 1) ) Psi mModObj . Set Oper at i onType 5 Psi mModObj . Set Oper at i onI nt er f ace ResTabObj 'Kick off the model
Range( " MessageBox" ) = " Gener at i ng VFP t abl e f or " & Wel l Li st ( n, 1) Psi mModObj . RunSi ngl eBr anchModel 2 Fal se, " - B - v0" , Fal se 'Wait for it to finish
Model I sRunni ng = Psi mModObj . Get I sModel Runni ng Whi l e Model I sRunni ng = Tr ue Model I sRunni ng = Psi mModObj . Get I sModel Runni ng NewHour = Hour ( Now( ) ) NewMi nut e = Mi nut e( Now( ) ) NewSecond = Second( Now( ) ) + 1 Wai t Ti me = Ti meSer i al ( NewHour , NewMi nut e, NewSecond) Appl i cat i on. Wai t Wai t Ti me Wend 'Save the model
Range( " MessageBox" ) = " Savi ng " & Wel l Li st ( n, 1) Psi mModObj . SaveModel ( Worki ngDi r ect ory & " \ " & Wel l Li st ( n, 1) ) Next n 'delete all the rubbish
Cal l Cl ear Rubbi sh( Worki ngDi r ect or y) 'Merge vfp files
Page 130 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Range( " MessageBox" ) = " Mer gi ng vf p f i l es" Cal l Mer geVf pTabl es( Wel l Li st ( ) , NoOf Wel l s, Fi r st Wel l , Wor ki ngDi r ect or y, Vf pFi l eName) Range( " MessageBox") = " " MsgBoxYesNo = MsgBox( " VFP Bat ch r un compl et ed successf ul l y. Do you want t o vi ew ' " & Vf pFi l eName & " ' now ?" , vbYesNo, " Bat ch VFP") I f MsgBoxYesNo = 6 Then Text Edi t or = Range( " Text Edi t or " ) r et val = Shel l ( Text Edi t or & " " & Worki ngDi r ect ory & " \ " & Vf pFi l eName, vbMaxi mi zedFocus) End I f 'Protect the sheet
Act i veSheet . Pr ot ect End Sub
Page 131
PIPESIM Version 2011.1 OpenLink Reference Manual
Defined constants and strings Object Type Identifiers Object ID
Object Type
Description
1
n_FOLD
(network folder)
2
n_SOURCE
(network source)
3
n_SINK
(network sink)
4
n_JUNC
(network junction)
5
n_BRANCH
(network branch)
6
n_TEXT
(text object)
7
n_PRODWELL
(network production well)
8
n_INJWELL
(network injection well)
30
n_REINJECTOR
(network reinjector)
31
n_WELLCONNECTOR
(network well connector)
Object ID
Object Type
Description
10
n_PINTSOURCE
(single branch source)
11
n_PINTVERTCOMP
(Vertical Comp.)
12
n_PINTHORCOMP
(Horizontal Comp.)
13
n_FLOWLINE
(Flowline)
14
n_RISER
(Riser)
15
n_CONNECTOR
(Zero length connector)
16
n_TUBING
(Tubing)
17
n_NODE
(generic node)
18
n_CHOKE
(choke)
19
n_COMPRESSOR
(compressor)
20
n_EXPANDER
(expander)
21
n_HEATX
(heat exchanger)
22
n_PUMP
(centrifugal pump)
23
n_BOOSTER
(multiphase booster)
24
n_INJECTOR
(injection point)
25
n_SEPARATOR
(separator)
26
n_REPORT
(report tool)
27
n_ADDMULT
(adder/multiplier)
28
n_NAPOINT
(nodal analysis point)
Page 132 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Object ID
Object Type
Description
29
n_EKT
(engine keyword tool)
32
n_SSSV
(SSSV, tubing sub‐component)
33
n_GLValve
(Gas Lift valve, subcomponent)
34
n_BLACKBOX
(Generic equipment type)
Object Properties Network object’s properties Property name
Description
BRANCH BLOCK TYPE
Branch block type: 0 for none, 1 for forward, 2 for reverse
WELL BLOCK TYPE
Well block type: 0 for none, 1 for forward, 2 for reverse
Vertical Completi on object’s properti es Common properties Property name
Description
PRESSURE
Static reservoir pressure
TEMPERATURE
Reservoir temperature
IPRTYPE
Completion model type (see IPR Types (Vertical))
Well PI specif i c properties Property name
Description
WELLPI FLUIDTYPE
Fluid type for the model (see Fluid Types)
WELLPI GASPI
Gas PI
WELLPI LIQPI
Liquid PI
WELLPI NONLINEARCORRECTION
Use Vogel below bubble point (for liquid)
Vogel’ s Equa tion specif ic properties Property name
Description
VOGEL AOFP
Absolute Open Flow Potential
VOGEL N
Vogel coefficient
Page 133
PIPESIM Version 2011.1 OpenLink Reference Manual
Fetkovitch’s Equation specific properties Property name
Description
FETKOVITCH AOFP
Open Flow Potential
FETKOVITCH N
n exponent
Jones’s Equation specific properties Property name
Description
JONES FLUIDTYPE (see Fluid Types)
Fluid type for the model (see Fluid Types)
JONES GASA
A (turb) coefficient for Gas
JONES GASB
B (lam) coefficient for Gas
JONES LIQA
A (turb) coefficient for Liquid
JONES LIQB
B (lam) coefficient for Liquid
BackPressure Equation specific properties Property name
Description
BACKPRESSURE C
Constant C
BACKPRESSURE N
Slope n
Pseudo Steady State specific properties Property name
Description
PSEUDOSS IPRBASIS
Fluid type for the model (see Fluid Types)
PSEUDOSS USEPSEUDOPRES
Use pseudo pressure method (for gas)
PSEUDOSS VOGEL
Use Vogel below bubble point (for liquid)
PSEUDOSS THICKNESS
Reservoir thickness
PSEUDOSS WELLBOREID
Wellbore diameter
PSEUDOSS PERMEABILITY
Reservoir permeability
PSEUDOSS ENTERPERM
Enter only reservoir permeability or detailed user defined table (0 for user defined table, 1 for only reservoir permeability)
PSEUDOSS DEFRADIUS
Use Drainage radius (if set)
PSEUDOSS DRAINRADIUS
Drainage radius
PSEUDOSS RESAREA
Reservoir area
PSEUDOSS SHAPEFACTOR
Shape factor
PSEUDOSS SKIN
Mechanical skin
Page 134 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
PSEUDOSS RATESKIN GAS
Rate dependent skin for gas
PSEUDOSS RATESKIN LIQ
Rate dependent skin for liquid
PSEUDOSS CALCSKIN
Calculate Mechanical skin (if set)
PSEUDOSS CALCRATESKIN
Calculate Rate dependent skin (if set)
PSEUDOSS COMPOPTIONS
Completion options type
PSEUDOSS DAMAGEDID
Damaged zone diameter
PSEUDOSS DAMAGEDPERM
Damaged zone permeability
PSEUDOSS COMPACTEDID
Compacted zone diameter
PSEUDOSS COMPACTEDPERM
Compacted zone permeability
PSEUDOSS GRAVELPERM
Gravel pack permeability
PSEUDOSS GRAVELTUNNEL
Gravel pack tunnel length
PSEUDOSS GRAVELCASINGID
Gravel pack casing ID
PSEUDOSS GRAVELSCREENSZ
Gravel pack screen diameter
PSEUDOSS COMPVERTPERM
Completion vertical permeability
PSEUDOSS COMPINTERVAL
Completion open interval
PSEUDOSS COMPDEVIATION
Completion deviation
PSEUDOSS PERFSKINMETHOD
Perforation skin method (0 for McLeod, 1 for Karakas/Tariq)
PSEUDOSS PERFID
Perforation diameter
PSEUDOSS PERFLENGTH
Depth of penetration
PSEUDOSS PERFSHOTDENSITY
Perforation density
PSEUDOSS PERFPHASEANG
Phase angle
PSEUDOSS FPSKINMETHOD
FracPack skin method (0 for Fracture properties, 1 for conductivity)
PSEUDOSS FPFRACHALFLEN
Fracture half length
PSEUDOSS FPFRACWIDTH
Fracture width
PSEUDOSS FPPROPPERM
Fracture proppant permeability
PSEUDOSS FPCOND
FracPack conductivity
PSEUDOSS FPFACESKINCALC
Include Frac Face skin (if set)
PSEUDOSS FPDAMAGEDEPTH
Frac Face Depth of damage
PSEUDOSS FPDAMPERM
Frac Face Damage permeability
PSEUDOSS FPCHOKESKINCALC
Include Choke Fracture skin (if set)
PSEUDOSS FPCHOKELENGTH
Choke length
PSEUDOSS FPCHOKEPERM
Frac choke permeability
PSEUDOSS DZSKINCALC
Include damaged zone skin (if set)
Page 135
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
PSEUDOSS GPSKINCALC
Include gravel pack skin (if set)
PSEUDOSS PFSKINCALC
Include perforation skin (if set)
PSEUDOSS PPDSKINCALC
Include partial penetration/deviation skin (if set)
PSEUDOSS FPSKINCALC
Include FracPack skin (if set)
Forchheimer’s Equation specific properties Property name
Description
FORCH A
A (lam) coefficient
FORCH F
F (turb) coefficient
Hydraulic Fracture specific properties Property name
Description
HYDFRACT IPRBASIS
Fluid type for the model (see Fluid Types)
HYDFRACT VOGEL
Use Vogel below bubble point (for liquid)
HYDFRACT PERMEABILITY
Reservoir permeability
HYDFRACT THICKNESS
Reservoir thickness
HYDFRACT DRAINRADIUS
Drainage radius
HYDFRACT WELLBOREID
Wellbore diameter
HYDFRACT FRACTLENGTH
Fracture half length
HYDFRACT FRACTPERM
Fracture permeability
HYDFRACT FRACTWIDTH
Fracture width
HYDFRACT TRANSIENT
Use transient parameters (if set)
HYDFRACT TIME
Time
HYDFRACT POROSITY
Porosity
HYDFRACT COMPRESS
Total compressibility
Transient specific properties Property name
Description
TRANSIENTIPR IPRBASIS
Fluid type for the model (see Fluid Types)
TRANSIENTIPR USEPSEUDOPRES
Use pseudo pressure method (for gas)
TRANSIENTIPR VOGEL
Use Vogel below bubble point (for liquid)
TRANSIENTIPR PERMEABILITY
Reservoir permeability
TRANSIENTIPR THICKNESS
Reservoir thickness
Page 136 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
TRANSIENTIPR DRAINRADIUS
Drainage radius
TRANSIENTIPR WELLBOREID
Wellbore diameter
TRANSIENTIPR TIME
Time
TRANSIENTIPR POROSITY
Porosity
TRANSIENTIPR COMPRESS
Total compressibility
TRANSIENTIPR SKIN
Mechanical skin
TRANSIENTIPR RATESKIN GAS
Rate dependent skin for gas
TRANSIENTIPR RATESKIN LIQ
Rate dependent skin for liquid
TRANSIENTIPR CALCSKIN
Calculate Mechanical skin (if set)
TRANSIENTIPR CALCRATESKIN
Calculate Rate dependent skin (if set)
TRANSIENTIPR COMPOPTIONS
Completion options type
TRANSIENTIPR DAMAGEDID
Damaged zone diameter
TRANSIENTIPR DAMAGEDPERM
Damaged zone permeability
TRANSIENTIPR COMPACTEDID
Compacted zone diameter
TRANSIENTIPR COMPACTEDPERM
Compacted zone permeability
TRANSIENTIPR GRAVELPERM
Gravel pack permeability
TRANSIENTIPR GRAVELTUNNEL
Gravel pack tunnel length
TRANSIENTIPR GRAVELCASINGID
Gravel pack casing ID
TRANSIENTIPR GRAVELSCREENSZ
Gravel pack screen diameter
TRANSIENTIPR COMPDEVIATION
Completion deviation
TRANSIENTIPR PERFSKINMETHOD
Perforation skin method (0 for McLeod, 1 for Karakas/Tariq)
TRANSIENTIPR COMPINTERVAL
Completion open interval
TRANSIENTIPR COMPVERTPERM
Completion vertical permeability
TRANSIENTIPR PERFID
Perforation diameter
TRANSIENTIPR PERFLENGTH
Depth of penetration
TRANSIENTIPR PERFSHOTDENSITY
Perforation density
TRANSIENTIPR PERFPHASEANG
Phase angle
TRANSIENTIPR DZSKINCALC
Include damaged zone skin (if set)
TRANSIENTIPR GPSKINCALC
Include gravel pack skin (if set)
TRANSIENTIPR PFSKINCALC
Include perforation skin (if set)
TRANSIENTIPR PPDSKINCALC
Include partial penetration/deviation skin (if set)
Page 137
PIPESIM Version 2011.1 OpenLink Reference Manual
FCV properties Property name
Description
FCV VALVETYPE
FCV type: 0 –generic, 1‐specific (manufactured)
FCV GENERICVALVETYPE
Generic FCV type: 0 – equivalent choke area, 1 – maximum rate through valve
FCV CHOKEEQUATION
Gas choke equation: 0 – mechanistic
FCV EQCHOKEARIA
Equivalent choke area
FCV MAXLIQRATE
Maximum liquid rate through valve
FCV MAXGASRATE
Maximum gas rate through valve
FCV LIQCOEFF
Liquid flow coefficient
FCV GASCOEFF
Gas flow coefficient
FCV PRESSDROP
Pressure drop ratio factor
FCV MANUFACTURER
FCV manufacturer
FCV TYPE
FCV type (munufacturer’s specific)
FCV PARTNUMBER
FCV partnumber
FCV VALVEPOSITION
Valve postion
FCV VALVEPERSENTOPEN
Valve percent open
Horizontal Completion object’s properties Common properties Property name
Description
PRESSURE
Static reservoir pressure
TEMPERATURE
Reservoir temperature
IPRTYPE
Completion model type (0 – Joshi Oil, 1 – Joshi Gas, 2 – Babu & Odeh Oil, 3 – Babu & Odeh, 4 – Distributed PI)
IPROPTION
IPR Model: 0 – distributed PI, 1 – single point PI
DAMAGED DIAMETER
Damaged zone diameter
DAMAGED PERMEABILITY
Damaged zone permeability
COMPACTED DIAMETER
Compacted zone diameter
COMPACTED PERMEABILITY
Compacted zone permeability
GRAVEL PACK PERMEABILITY
Gravel pack permeability
GRAVEL PACK TUNNEL
Gravel pack tunnel
PERFORATION DIAMETER
Perforation diameter
PERFORATION LENGTH
Perforation length
PERFORATION SHOT DENSITY
Perforation shot density
Page 138 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Distributed PI specific properties Property name
Description
DIST FLUIDTYPE
Fluid type
DIST LIQPI
Liquid PI
DIST GASPI
Gas PI
SS Oil/Gas (Joshi) specific properties Property name
Description
JOSHI REXTN
External boundary radius of the drainage area
JOSHI THICKNESS
Reservoir thickness
JOSHI PERMEABILITYX
Permeability in the x‐direction
JOSHI PERMEABILITYY
Permeability in the y‐direction
JOSHI PERMEABILITYZ
Permeability in the z‐direction
JOSHI ECCENT
Well bore eccentricity (the offset of the well from the center of the pay zone)
JOSHI LENGTH
Length of the horizontal well (completion)
JOSHI WELLBORERADIUS
Wellbore radius
JOSHI SKIN
Mechanical skin factor
JOSHI VISCOSITY
Fluid viscosity
JOSHI OFVF
Oil Formation Volume Factor (oil well)
JOSHI GASZ
Gas compressibility factor (gas well)
JOSHI CALCULATE SKIN
Calculate skin: 1 for true, 0 for false
PSS Oil (Babu & Odeh) specific properties Property name
Description
BABU XDIM
Drainage width perpendicular to the well
BABU YDIM
Drainage width parallel to the well
BABU THICKNESS
Reservoir thickness
BABU PERMEABILITYX
Permeability in the x‐direction
BABU PERMEABILITYY
Permeability in the y‐direction
BABU PERMEABILITYZ
Permeability in the z‐direction
BABU XWELL
x‐coordinates of the horizontal well trajectory
BABU YWELL
y‐coordinates of the horizontal well trajectory
BABU ZWELL
z‐coordinates of the horizontal well trajectory
Page 139
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
BABU LENGTH
Length of the perforation into the formation
BABU WELLBORERADIUS
Wellbore radius
BABU SKIN
Mechanical skin factor
BABU VISCOSITY
Fluid viscosity
BABU OFVF
Oil Formation Volume Factor (oil well)
BABU GASZ
Gas compressibility factor (gas well)
BABU CALCULATE SKIN
Calculate skin: 1 for true, 0 for false
Tubing object’s properties Common properties Property name
Description
ACTIVATE
Make tubing active
TUBING MODEL
Tubing model (0: simple, 1 detailed)
LIFT TYPE
Artificial Lift type (0: ESP, 1: Gas Lift, 2: PCP, 3: NONE)
KICKOFF ANGLE
Kick Off angle
KICKOFF TVD
Kick Off TVD
PERFS MD
Perforation MD
PERFS TEMPERATURE
Reservoir Temperature
PERFS TVD
Perforation TVD
SURFACE TEMPERATURE
Surface temperature
SURFACE TVD
Surface TVD
COILED TUB MD
Coiled tubing bottom MD
COILED TUB RATE OPTION
Coiled tubing rate option (0 for gas rate, 1 for GLR)
COILED TUB RATE
Coiled tubing gas rate
COILED TUB GLR
Coiled tubing GLR
COILED TUB SPECIFIC GRAVITY
Coiled tubing specific gravity
COILED TUB ID
Coiled tubing ID
COILED TUB SURFACE PRESSURE
Coiled tubing gas rate surface pressure
COILED TUB OD
Coiled tubing OD
Page 140 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Tubing sub-object properties
(accessed by GetPropertyValAtObjectIndex& SetPropertyValAtObjectIndex methods) Property name
Description
CHOKE CHOKE MD
Choke MD
BEAN SIZE
Bean size
CRITICAL PRESSURE RATIO
Critical pressure ratio
CRITICAL CORRELATION
Critical correlation (0 ‐ mechanistic, 1 ‐ Gilbert, 2 – Ros, 3 – Achong, 4 – Baxendell, 5 – Ashford, 6 – Poetbeck, 7 – Omana, 8 ‐ Pilehvari)
SUBCRITICAL CORRELATION
Sub‐critical correlation (0 ‐ mechanistic, 1 ‐ API14b, 2 ‐ Ashford)
CHOKE TOLERANCE
Tolerance
CALC CRITICAL PRESSURE RATIO
Option to calculate critical pressure ratio (1 to calculate, 0 to use user‐defined value)
UPSTREAM PIPE ID
Upstream pipe ID
CP/CV
Fluid heat capacity ratio (Cp/Cv)
DISCHARGE COEFFICIENT
Discharge coefficient
Y AT CRITICAL FLOW
Gas expansion factor at critical flow
BOTH PHASES
Flow coefficient for both phases
GAS PHASE
Flow coefficient for gas phase
LIQ PHASE
Flow coefficient for liquid phase
FLOW RATE
Option to use flowrate to identify critical flow (when set to 1)
PRESSURE RATIO
Option to use flowrate to identify critical flow (when set to 1)
UPSTREAM VELOCITY
Option to use sonic upstream velocity to identify critical flow (when set to 1)
DOWNSTREAM VELOCITY
Option to use sonic downstream velocity to identify critical flow (when set to 1)
ADJUST SUB‐CRITICAL CORR
Option to adjust sub‐critical correlation to match flowrate prediction (when set to 1)
PRINT DETAILED CALCULATIONS
Option to print detailed calculation for choke (0=not cheched, 1=checked)
Page 141
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
ESP ESP MD
ESP MD (simple profile)
ESP STAGES
Number of stages (simple profile)
ESP SPEED
ESP speed (simple profile)
ESP MANUFACTURER
Manufacturer name (simple profile)
ESP MODEL
Model name (simple profile)
ESP HEAD FACTOR or ESP EFFICIENCY
ESP head factor (simple profile)
ESP VISCOSITY CORRECTION
ESP viscosity correction: 0 or 1 (simple profile)
ESP GASSEPARATOR
Gas separator present (if set) (simple profile)
ESP SEPEFFICIENCY
Separator efficiency (simple profile)
ESP POWER
ESP Power (simple profile)
ESP USE POWER
Use ESP Power: 0 or 1 (simple profile)
ESP MD NODE
Same as ESP MD but for detailed profile
ESP STAGES NODE
Same as ESP STAGES but for detailed profile
ESP SPEED NODE
Same as ESP SPEED but for detailed profile
ESP MANUFACTURER NODE
Same as ESP MANUFACTURER but for detailed profile
ESP MODEL NODE
Same as ESP MODEL but for detailed profile
ESP HEAD FACTOR NODE or
Same as ESP HEAD FACTOR but for detailed profile
ESP EFFICIENCY NODE ESP GASSEPARATOR NODE
Same as ESP GASSEPARATOR but for detailed profile
ESP SEPEFFICIENCY NODE
Same as ESP SEPEFFICIENCY but for detailed profile
ESP VISCOSITY CORRECTION NODE
Same as ESP VISCOSITY CORRECTION but for detailed profile
ESP POWER NODE
Same as ESP POWER but for detailed profile
ESP USE POWER NODE
Same as ESP USE POWER but for detailed profile
Property name
Description
PCP PCP MD
PCP MD (simple profile)
PCP MANUFACTURER
Manufacturer name (simple profile)
PCP MODEL
Model name (simple profile)
PCP USER DEFINED
User defined (1 for true, 0 for false) (simple profile)
PCP DIAMETER
PCP diameter (simple profile)
PCP TOP DRIVE
PCP top drive (simple profile)
PCP ROD DIAMETER
PCP rod diameter (simple profile)
PCP HEAD FACTOR
PCP hear factor (simple profile)
Page 142 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
Property name
Description
PCP SPEED
PCP design speed (simple profile)
PCP BASE SPEED
PCP base speed (simple profile)
PCP GASSEPARATOR
Use PCP gas separator (1 for true, 0 for false) (simple profile)
PCP VISCOSITY CORRECTION
Use PCP viscosity correction (1 for true, 0 for false) (simple profile)
PCP NOMINAL RATE
PCP nominal flowrate (simple profile)
PCP MD NODE
Same as PCP MD but for detailed profile
PCP MANUFACTURER NODE
Same as PCP MANUFACTURER but for detailed profile
PCP MODEL NODE
Same as PCP MODEL but for detailed profile
PCP USER DEFINE NODE
Same as PCP USER DEFINE but for detailed profile
PCP DIAMETER NODE
Same as PCP DIAMETER but for detailed profile
PCP TOP DRIVE NODE
Same as PCP TOP DRIVE but for detailed profile
PCP ROD DIAMETER NODE
Same as PCP ROD DIAMETER but for detailed profile
PCP HEAD FACTOR NODE
Same as PCP HEAD FACTOR but for detailed profile
PCP SPEED NODE
Same as PCP SPEED but for detailed profile
PCP BASE SPEED NODE
Same as PCP BASE SPEED but for detailed profile
PCP GASSEPARATOR NODE
Same as PCP GASSEPARATOR but for detailed profile
PCP VISCOSITY CORRECTION NODE
Same as PCP VISCOSITY CORRECTION but for detailed profile
PCP NOMINAL RATE NODE
Same as PCP NOMINAL RATE but for detailed profile
Property name
Description
INJECTOR GAS LIFT RATE OPTION
Gas lift rate option (0 for gas rate, 1 for GLR, 2 for GLR incremental) (simple profile)
GAS LIFT RATE
Gas lift gas rate (simple profile)
GAS LIFT GLR
Gas lift tubing GLR (simple profile)
GAS LIFT INCREMENTAL GLR
Gas lift tubing GLR incremental (simple profile)
GAS LIFT MD
Gas lift MD (simple profile)
GAS LIFT PORT DIAMETER
Gas lift port diameter (simple profile)
GAS LIFT PVTFILE
Composition file name (simple profile)
GAS LIFT PVTTYPE
Composition type (0 for local composition, 1 for local PVT, 2 for global PVT, 3 for local MFL) (simple profile)
GAS LIFT SPECIFIC GRAVITY
Gas lift specific gravity (simple profile)
GAS LIFT SURFACE PRESSURE
Surface pressure (simple profile)
Page 143
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
Property name
Description
GAS LIFT SURFACE TEMPERATURE
Surface temperature (simple profile)
GAS LIFT RATE OPTION NODE
Same as GAS LIFT RATE OPTION but for detailed profile
GAS LIFT RATE NODE
Same as GAS LIFT RATE but for detailed profile
GAS LIFT GLR NODE
Same as GAS LIFT GLR but for detailed profile
GAS LIFT INCREMENTAL GLR NODE
Same as GAS LIFT INCREMENTAL GLR but for detailed profile
GAS LIFT MD NODE
Same as GAS LIFT MD but for detailed profile
GAS LIFT PORT DIAMETER NODE
Same as GAS LIFT PORT DIAMETER but for detailed profile
GAS LIFT PVTFILE NODE
Same as GAS LIFT PVTFILE but for detailed profile
GAS LIFT PVTTYPE NODE
Same as GAS LIFT PVTTYPE but for detailed profile
GAS LIFT SPECIFIC GRAVITY NODE
Same as GAS LIFT SPECIFIC GRAVITY but for detailed profile
GAS LIFT SURFACE PRESSURE NODE
Same as GAS LIFT SURFACE PRESSURE but for detailed profile
GAS LIFT SURFACE TEMPERATURE NODE
Same as GAS LIFT SURFACE TEMPERATURE but for detailed profile
Property name
Description
Multiphase Booster BOOSTER TYPE
Type: 0 for Generic; 1 for Generic Twin Screw; 2 for Twin Screw; 3 for Vendor Twin Screw; 4 for Framo 1999 5 for Framo 2009
BOOSTER COMP EFFICIENCY
Compressor efficiency (only for generic multiphase booster)
BOOSTER HAXIAL DRIVE TYPE
Haxial drive type: (only for Framo 1999) 0 for hydraulic drive 1 for electric oil cooled drive 2 for electric air cooled drive
BOOSTER HAXIAL FLOW PARAMETER
Haxial flow parameter
BOOSTER HAXIAL HEAD PARAMETER
Haxial head parameter
BOOSTER VENDOR FILE
Vendor file name (only for vendor twin screw multiphase booster)
Page 144 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference OpenLink Reference Manual
Property name
Description
BOOSTER VENDOR SPEED PCNT
Vendor speed percentage (only for vendor twin screw multiphase booster)
BOOSTER TWIN NOMINAL
Nominal Booster (only for twin screw multiphase booster)
BOOSTER TWIN SPEED
Series name
BOOSTER VISCOSITY CORRECTION
Speed percentage (only for twin screw multiphase booster)
Property name
Description
Pump PUMP DISCHARGE PRESSURE
Pump discharge pressure
PUMP PRESSURE DIFFERENTIAL
Pump pressure differential
PUMP PRESSURE RATIO
Pump pressure ratio
PUMP POWER
Pump power
PUMP EFFICIENCY
Pump efficiency
PUMP VISCOSITY CORRECTION
Pump viscosity correction: 1 for true, 0 for false
COMPRESSOR DISCHARGE PRESSURE
Compressor discharge pressure
COMPRESSOR PRESSURE DIFFERENTIAL
Compressor pressure differential
COMPRESSOR PRESSURE RATIO
Compressor pressure ratio
COMPRESSOR POWER
Compressor power
COMPRESSOR EFFICIENCY
Compressor efficiency
Property name
Description
SEPARATOR SEPARATOR MD
Separator MD
EFFICIENCY
Efficiency
TYPE
Type (see Separator Types)
Property name
Description
SSSV SSSV MD
SSSV MD (simple profile)
SSSV ID
SSSV ID (simple profile)
SSSV MD NODE
Same as SSSV MD but for detailed profile
SSSV ID NODE
Same as SSSV ID but for detailed profile
Page 145
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
GLValve VALVE MD
Valve MD
VALVE AB
Valve Ab
VALVE AP
Valve Ap
VALVE CHOKESIZE
Choke size
VALVE CV
Valve Cv
VALVE PORTSIZE
Port size
VALVE PTRO
Valve Ptro
VALVE MANUF
Manufacturer name
VALVE SERIES
Series name
VALVE PORTNAME
Port name
VALVE TYPE
Valve type
VALVE DPFO
Valve Dpfo
Property name
Description
Flowline (Riser) DETAILED PROFILE
Describes a configuration mode for a flowline/riser: 0 for simple, 1 for detailed
VERTICAL LENGTH
the horizontal distance covered by the complete flowline/riser
HORIZONTAL LENGTH
the change in elevation between the start and the end of the flowline/riser
HEIGHT UNDULATIONS
An artificial factor that can be used to automatically introduce some undulations into the flowline. The value entered is the total change in elevation for every 1,000 units
HORIZ POS NODE
Horizontal position of a node in detailed profile
VERT POS NODE
Vertical position of a node in detailed profile
TEMPERATURE NODE
Ambient temperature of a node in detailed profile
UVALUE NODE
Heat transfer U value of a node in detailed profile
MEASURED TEMP NODE
Measured temperature of a node in detailed profile
MEASURED PRES NODE
Measured pressure of a node in detailed profile
Property name
Description
Tubing (pipe section) PIPE AMB TEMPERATURE
Pipe ambient temperature (simple profile)
Page 146 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Property name
Description
PIPE FLOWTYPE
Flow type (see Pipe Flow Types) (simple profile)
PIPE ID
Pipe ID (simple profile)
PIPE MD
Pipe MD (simple profile)
PIPE OD
Pipe OD (simple profile)
PIPE ROUGHNESS
Pipe roughness (simple profile)
PIPE WT
Pipe wall thickness (simple profile)
PIPE AMB TEMPERATURE NODE
Same as PIPE AMB TEMPERATURE but for detailed profile
PIPE FLOWTYPE NODE
Same as PIPE FLOWTYPE but for detailed profile
PIPE ID NODE
Same as PIPE ID but for detailed profile
PIPE MD NODE
Same as PIPE MD but for detailed profile
PIPE OD NODE
Same as PIPE OD but for detailed profile
PIPE ROUGHNESS NODE
Same as PIPE ROUGHNESS but for detailed profile
PIPE WT NODE
Same as PIPE WT but for detailed profile
Generic Source Property name
Description
SOURCE PRESSURE
Generic source pressure
SOURCE TEMPERATURE
Generic source temperature
Network Separator (reinjector) Property name
Description
SEPARATOR PRESSURE
Separator pressure
SEPARATOR EFFICIENCY
Separator efficiency
SEPARATOR STREAM TYPE
Separator stream type: 0 for liquid, 1 for gas, 2 for water.
SEPARATOR FEED BRANCH
Separator feed branch name
SEPARATOR REINJECT BRANCH
Separator reinject branch name
Artificial Lift Lift Value
Description
0
No artificial lift
1
Gas lift injection
Page 147
PIPESIM Version 2011.1 OpenLink Reference Manual
Lift Value
Description
2
ESP
Completion Options Type Value
Description
0
None
1
Open hole
2
Perforated
3
Gravel packed and perforated
4
Open hole gravel pack
5
Frac pack
Page 148 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
IPR Types (Vertical) Type Value
Description
0
Well PI
1
Vogel
2
Fetkovitch
3
Jones
4
BackPressure
5
PseudoSteadyState
6
Forchheimer
7
Hydraulic Fracture
8
Transient
IPR Types (Horizontal) Type Value
Description
0
Joshi (Oil)
1
Joshi (Gas)
2
Babu & Odeh (Oil)
3
Babu & Odeh (Gas)
4
Distributed PI
IPR Options (Horizontal) Type Value
Description
0
Distributed PI
1
Single Point PI
Fluid Types Type Value
Description
0
Liquid Rate
1
Gas Rate
2
Mass Rate
Page 149
PIPESIM Version 2011.1 OpenLink Reference Manual
Pipe Flow Types Type Value
Description
0
Tubing
1
Annular
2
Tubing+Annular
Rate Types Type Value
Description
0
GLR
1
GOR
2
LGR
3
OGR
Separator Types Type Value
Description
0
Liquid
1
Gas
2
Water
Single Branch Operations Operation Value
Operation Name
‐1
No Operation
0
System Analysis
1
Pressure and Temp Profile
2
Nodal Analysis
3
Injection Gas Vs Casing Head Pressure
4
Horizontal Well Performance
5
Reservoir Tables
6
Artificial Lift
7
Flow Correlation Profile Match
8
(Reserved)
9
Wax Deposition
10
Well Performance Curves
Page 150 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Operation Value
Operation Name
11
Gas Lift ‐ Diagnostics
12
Gas Lift ‐ Deepest Injection Point
13
Gas Lift ‐ Lift Gas Response
14
Gas Lift – Bracketing
Equations of State Value
Description
0
Peng‐Robinson (multiflash, DBR & Eclipse 300)
1
SRK (multiflas, DBR & Eclipse 300)
2
Standard Peng‐Robinson (multiflash)
3
Standard SRK (multiflash)
4
BWRS (multiflash)
5
Smirk (SIEP SPPTS)
6
2 Param Peng‐Robinson (SIS flash)
7
3 Param Peng‐Robinson (SIS flash)
8
2 Param PR Standard (SIS flash)
9
3 Param PR Standard (SIS flash)
26
Association CPA (multiflash)
501
NIST (REFPROP V8)
Viscosity Types Value
Description
0
Pedersen
1
LBC
243
Aasberg‐Petersen
541
NIST
BIP Sets Value
Description
0
OilGas3
1
OilGas2
2
OilGas1
3
OilGas4
Page 151
PIPESIM Version 2011.1 OpenLink Reference Manual
Value
Description
4
User BIPs
5
SIS Flash default
221
Eclipse 300 default
321
DBR default
521
NIST default
Emulsion Types Value
Description
0
Set to oil viscosity
1
Volume Ratio
2
Woelflin
3
None
Quantity Name
Class Name
Defined Unit Names (* def.Engineering, ^ def.SI, ! strict SI)
ADIM
UNITLESS
UNITLESS AGASRATE
ACFM *, ft3/min, acm/s ^, m3/s!, m3/min, bbl/min, bbl/d, m3/d ,
AREA
AREA
in2 *, mm2 ^, m2 ! , acres
AREAL
AREA EARTH SURFACE
ft2 *. m2 ^!, acres, mi2, ha, km2
COMPRESS
COMPRESSIBILITY
1/psia *,
COMPRESSIBILITY
1/bara ^, 1/Pa !
CONDUCTIVITY
Btu/hr/ft/F *,
THERMALCONDUCTIVITY
THERMAL CONDUCTIVITY
DELTAP
PRESSURE (DELTA)
Psi *,
PRESSUREDROP
W/m/K !^ Bar ^, atm, kPa, kg/cm2, Pa!
DELTAT
TEMPERATURE (DELTA)
F *, C! ^, K, R,
Page 152 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Quantity Name
Class Name
Defined Unit Names (* def.Engineering, ^ def.SI, ! strict SI)
DENSITY
DENSITY LIQUID
lb/ft3 *, kg/m3! ^, g/cc,
DISTGASPI DISTRIBUTEDGASPI
DISTLIQPI DISTRIBUTEDLIQPI
ENTHALPY
SPECIFIC PRODUCTIVITY INDEX (GAS PER LENGTH)
Mmscf/d/psi2/ft *,
SPECIFIC PRODUCTIVITY INDEX (LIQ PER LENGTH)
STB/d/psi/ft *,
ENERGY PER MASS (ENTHALPY)
Btu/lb *,
mmsm3/d/bar2/m ^, msm3/d/kPa2/m, sm3/s/Pa2/m!
sm3/d/bar/m ^, sm3/d/kPa/m, sm3/s/Pa/m!
J/g ^, J/kg!
ENTROPY
SPECIFIC ENTROPY
Btu/lb/F *, J/g/K ^, J/kg/K!
FLOWGLRATIO
STD VOLUME PER VOLUME (GLR)
scf/bbl *, sm3/m3 ^!
FRACTION
RATIO (%)
% *! ^ fract.,
GASPI
SPECIFIC PRODUCTIVITY INDEX (GAS)
Mmscf/d/psi2 *, mmscf/d/kPa2, mmsm3/d/bar2 ^, msm3/d/kPa2, 1.E4sm3/d/MPa2, m3/s/Pa2!
GASRATE
STD VOLUME GAS RATE
Mmscf/d *, Mscf/d, scf/d, mmsm3/d ^, msm3/d, sm3/d, 1.E3sm3/d, 1.E4sm3/d, sm3/s!
GASRATE(FLOWING)
FLOW RATE VOLUME BASIS (GAS)
Mmcf/d *,
GASRATERECIP
STD VOLUME GAS RATE (RECIPROCAL)
1/mmscf/d *, 1/mscf/d, 1/scf/d, 1/mmsm3/d, 1/msm3/d, 1/sm3/d, 1/1.E3sm3/d, 1/1.E4sm3/d, 1/sm3/s!
GOR
Scf/STB *,
GLR
VOLUME PER VOLUME (GLR)
HEAD
ENERGY PER
ft‐lbf/lbm *,
mcf/d, cf/d, mmm3/d ^, mm3/d, m3/d, 1.E3m3/d, 1.E4m3/d, m3/s!
sm3/sm3! ^
Page 153
PIPESIM Version 2011.1 OpenLink Reference Manual
Quantity Name
Class Name
Defined Unit Names (* def.Engineering, ^ def.SI, ! strict SI)
COMPRESSORHEAD
MASS (HEAD)
kJ/kg ^, J/kg!
JONESGASA
(JONES A GAS)
(psi/mmscf/d)^2 *, (bar/mmsm3/d)^2 ^, (Pa/sm3/s)^2! (bar/msm3/d)^2
JONESGASB
(JONES B GAS)
psi2/mmscf/d *, bar2/mmsm3/d ^, Pa2/sm3/s! bar2/msm3/d
JONESLIQA
(JONES A LIQ)
psi/(STB/d)^2 *, bar/(sm3/d)^2 ^, Pa/(sm3/s)^2!
JONESLIQB
(JONES B LIQ)
psi/STB/d *, bar/sm3/d ^, Pa/sm3/s!
LENGTH DIAMETER, ID, OD, WT, LENGTH(SHORT) LENGTHL LENGTH(LONG) LIQPI
LIQRATE
LENGTH SHORTRANGE
Inches *,
LENGTH MIDRANGE
Ft *,
SPECIFIC PRODUCTIVITY INDEX (LIQ)
STB/d/psi *,
STD VOLUME LIQUID RATE
STB/d *,
ft, miles, mm ^, cm, m!, km, 1/64in,
Miles, m! ^, km, STB/d/kPa, sm3/d/bar ^, sm3/d/kPa, sm3/d/MPa, sm3/s/Pa! sm3/d ^, sm3/s!
LIQRATE(FLOWING)
FLOWRATE VOLUME BASIS (LIQ)
bbl/d *,
LIQRATERECIP
STD VOLUME LIQUID RATE (RECIPROCAL)
1/STB/d, 1/sm3/d, 1/sm3/s
MASS
MASS
Lb *, Kg! ^
MASSRATE
FLOWRATE MASS BASIS
lb/s *,
SPECIFIC VOLUME
ft3/mol *,
MOLARVOLUME
m3/d ^, m3/s!
lb/h, kg/s! ^, kg/h,
Page 154 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Quantity Name
Class Name
Defined Unit Names (* def.Engineering, ^ def.SI, ! strict SI)
MOLE
m3/mol! ^ STB/mmscf *,
LGR
VOLUME PER VOLUME (LGR)
PERMEABILITY
PERMEABILITY
Md *^,
OGR
sm3/mmsm3 ^, sm3/msm3, sm3/1.E4sm3, m3/E3m3, sm3/sm3! Darcy, nm2, M2 !
POWER
POWER
Hp *, KW ^, Btu/s, kcal/s, Btu/h, kcal/h, W!
PRESSURE
PRESSURE
Psia *, Psig, bara ^, barg, atma, atmg, kPa a, kPa g, MPa a, MPa g, kg/cm2 a, kg/cm2 g, Pa a!, Pa g,
PRESSUREGRAD PRESSUREGRADIENT
PRESSURE GRADIENT
psi/ft *, bar/m ^, atm/m, kPa/m, kg/cm2, Pa/m!
ROTVELOCITY
FREQUENCY
FREQUENCY SHOTS
Hz *! ^ Rpm,
PER LENGTH
Shots/ft *, Shots/m! ^
SURFTENSION
SURFACE TENSION
SURFACETENSION TEMPERATURE
Dyne/cm *, N/m! ^
TEMPERATURE
F *, C! ^, K, R,
TIME
TIME
Hr *^, Min, s!, days, years
U HEATTRANSFERCOEFFICIE NT VELOCITY
HEAT TRANSFER COEFFICIENT
Btu/hr/ft2/F *,
VELOCITY
ft/s *,
W/m2/K! ^
m/s! ^ VISCOSITY VOLFRAC VOLUMEFRACTION
VISCOSITY DYNAMIC
Cp *^
VOLUME PER STD VOLUME
Bbl/mmscf *,
Ns/m2 ! , lb/s/ft, M3/mmsm3 ^, m3/sm3!
Page 155
PIPESIM Version 2011.1 OpenLink Reference Manual
Quantity Name
Class Name
Defined Unit Names (* def.Engineering, ^ def.SI, ! strict SI)
VOLUME
VOLUME (LIQUID)
ft3 *, m3! ^
VOLUME GAS
VOLUME (GAS)
ft3 *, m3! ^
NOTE: The keyword _STRICTSI in place of the unit name will set or get a value in the strict SI unit.
Page 156 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Case Studies Detailed explanation of routine The Open Link functionality is distributed with the PIPESIM installation and is contained in a number of library files. The main file is Net32COM.DLL, which normally resides in the programs directory and provides the framework and main entry points into both network and single branch simulation models. Two other files are FluidModelCOM.DLL and FlowCorrelationCOM.DLL, which provide access to properties defined in the fluid and flow correlation models respectively.
Pre-Loop Steps Step 1
Di m Bo as New FLUI DMODELCOMLi b. I bl ackOi l Di m Obj as New NET32COMLi b. I si ngl eBr anchModel
Page 157
PIPESIM Version 2011.1 OpenLink Reference Manual
These statements define the variables Bo and Obj as a black oil object and a Single branch model object respectively. A Single Branch Model Object corresponds to the Single Branch Model Interface. Di m x, n, TempAmb, TempSur f as I nt eger
This statement let the computer know that the variables x ,n, TempAmb, TempSurf used in the program are integer. (It is good programming practice to declare all variables used in a program at the beginning of the listing). Step 2:
TempAmb = Cel l s( 11, 4) . val ue I f TmpAmb = t hen Exi t Sub End I f
This assigns the value located in the cell cells(11,4) to the Integer variables TempAmb. Step 3:
Pat hTempl at e = cel l s( 8, 1) I f Pat hTempl at e = Then Exi t Sub End I f
Assign the template path specified by the user in the spreadsheet to the variable PathTemplate. Step 4:
Pat h = Cel l s( 9, 1) . Val ue I f Pat h = Then Exi t Sub End I f
Assign the Path specified by the user in the spreadsheet to the variable Path. This is the path where the .bps files that the routine creates are stored. Step 5:
case1 = Act i veCel l . Row cases = Sel ect i on. Rows. Count l ast case = case1 + cases – 1
This statement allows us to loop on the selected rows by assigning the index of the top row to the variable case1 and the index of the last row – 1 to the variable lastcase.
Page 158 Schlumberger Private - Customer Use
PIPESIM Version 2011.1 OpenLink Reference Manual
Loop Steps Step 6:
For n = case1 t o l ast case
This statement initiates a loop that will be executed from the value case1 to the value last case. Step 7:
Obj . OpenModel Pat hTempl at e
This statement is equivalent to doing the following things: From the PIPESIM singlebranch object interface (Reminder: Object Obj is a single branch object), go to the menu File, select Open Model and open the model PathTemplate (which is a string defined in the spreadsheet) Although the PIPESIM windows is not visible after the statement is executed the model is opened and can be altered.
Page 159
PIPESIM Version 2011.1 OpenLink Reference Manual
Step 8:
Bo. GasSg = Cel l s( n, 5) … … … … Obj . Bl ackOi l =Bo
The first statement assigns to the gas standard gravity field in the BlackOil interface Bo the value corresponding to the cells (n,5). It is the cell (3,5) during the first loop and the cell (4,5) in the second loop. There are also some conditional statements. The first one states that if the water cut is above 95% then the value in the blackoil object must be 95. The second one states that if the GOR is superior to 1000000 then assign an OGR of 0 to the blackoil object instead of the actual GOR value. The last statement assigns to the single branch object Obj the black oil properties of the Blackoil object Bo.
Page 160 Schlumberger Private - Customer Use