Professional Documents
Culture Documents
3
Open Link Reference Manual
PIPESIM 2012.3 Open Link Reference Manual
This work contains the confidential and proprietary trade secrets of Schlumberger and may not be copied or stored in an
information retrieval system, transferred, used, distributed, translated or retransmitted in any form or by any means, electronic or
mechanical, in whole or in part, without the express written permission of the copyright owner.
“Schlumberger,” the Schlumberger logotype, and other words or symbols used to identify the products and services described
herein are trademarks, trade names or service marks of Schlumberger and its licensors, or the property of their respective owners.
These marks may not be copied, imitated or used, in whole or in part, without the express prior written permission of Schlumberger.
In addition, covers, page headers, custom graphics, icons, and other design elements may be service marks, trademarks, and/or
trade dress of Schlumberger, and may not be copied, imitated, or used, in whole or in part, without the express prior written
permission of Schlumberger. Other company, product, and service names are the properties of their respective owners.
The Microsoft® Office User Interface is subject to protection under U.S. and international intellectual property laws and is used by
Schlumberger Technology Corporation under license from Microsoft.
Security Notice
The software described herein is configured to operate with at least the minimum specifications set out by Schlumberger. You are
advised that such minimum specifications are merely recommendations and not intended to be limiting to configurations that may
be used to operate the software. Similarly, you are advised that the software should be operated in a secure environment
whether such software is operated across a network, on a single system and/or on a plurality of systems. It is up to you to
configure and maintain your networks and/or system(s) in a secure manner. If you have further questions as to recommendations
regarding recommended specifications or security, please feel free to contact your local Schlumberger representative.
Contents
Overview .................................................................................................................... 6
Modules and Interfaces ............................................................................................ 7
4
PIPESIM 2012.3 Open Link Reference Manual
5
PIPESIM 2012.3 Open Link 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 functions can be called from any of the following:
Supported Interfaces
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
6
PIPESIM 2012.3 Open Link 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.
7
PIPESIM 2012.3 Open Link Reference Manual
8
PIPESIM 2012.3 Open Link Reference Manual
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.
9
PIPESIM 2012.3 Open Link Reference Manual
1. Load the existing network model: ‘Small Network.bpn’, which is shipped with the PIPESIM installation
and normally located in:
‘C:\Program Files\Schlumberger\PIPESIM\Case Studies\Network Analysis\Small
Network\’
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’:
Dim NetModel As New NET32COMLib.INetModel
10
PIPESIM 2012.3 Open Link 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:
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.
HTU UTH
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’:
results.ReadPnsFile(“‘C:\Program Files\Schlumberger\PIPESIM\Case
Studies\Network Analysis\Small Network\Small Network.pns’”)
11
PIPESIM 2012.3 Open Link Reference Manual
3. Get the pressure and temperature at the sink ‘Sink_1’ (see model picture above)
Dim index as Long
Dim pressure as Double
Dim temperature as Double
index = results.GetNodeIndex(“Sink_1”)
pressure = results.GetNodeVariableValue (index, "Pressure")
temperature = results.GetNodeVariableValue (index, "Temperature ")
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.
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.
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%:
BlackOil.Watercut = 15
5. Set this BlackOil with a modified watercut and API back into the network:
NetModel.BlackOilDefault = BlackOil
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.
12
PIPESIM 2012.3 Open Link Reference Manual
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”.
NetModel. SetPropertyVal (“Choke”, “Well_1”, "Bean Size", 3.5,
"inches")
The above line sets bean size = 3.5 inches to “Choke” in “Well_1. ”.
1. Any changes made to a single branch or network model can be saved simply by calling the
SaveModel(…) function.
Dim bOK as Boolean
bOK = NetModel.SaveModel(“C:\MyOpenLinkModels\Network.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():
Dim Error as String
If bOK = False Then
NetModel.GetLastError Error
MsgBox errorStr
End If
13
PIPESIM 2012.3 Open Link Reference Manual
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.
14
PIPESIM 2012.3 Open Link Reference Manual
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:/OpenLink/template/template.bps
15
PIPESIM 2012.3 Open Link Reference Manual
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):
Index. (1,2)
(10,20)
Water Cut %
Temperature F (200,200)
PI mmscf/d/psi2 (1.5053E-08,1.7427E-7)
Perforation MD m (2104,2104)
16
PIPESIM 2012.3 Open Link Reference Manual
Tubing 1 MD m (2054,2052)
Tubing 1 ID (2.44,2.44)
17
PIPESIM 2012.3 Open Link Reference Manual
Preliminary steps
1. Enable Macros in your workbook.
2. Select the Menu tools – Sub Menu Macro – Security as shown below.
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.
18
PIPESIM 2012.3 Open Link Reference Manual
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
Icon.
Command Button
Icon.
19
PIPESIM 2012.3 Open Link Reference Manual
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”.
20
PIPESIM 2012.3 Open Link 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:
Private Sub CommandButton1_Click()
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.
1. We can activate the Open Link statements by clicking on the menu Tools, submenu References.
21
PIPESIM 2012.3 Open Link 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.
22
PIPESIM 2012.3 Open Link Reference Manual
23
PIPESIM 2012.3 Open Link Reference Manual
24
PIPESIM 2012.3 Open Link Reference Manual
25
PIPESIM 2012.3 Open Link Reference Manual
26
PIPESIM 2012.3 Open Link Reference Manual
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.
27
PIPESIM 2012.3 Open Link Reference Manual
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.
Private Sub CommandButton2_Click()
End Sub
At the end of the code, from the previous case study, the statements are visible.
28
PIPESIM 2012.3 Open Link Reference Manual
29
PIPESIM 2012.3 Open Link Reference Manual
30
PIPESIM 2012.3 Open Link Reference Manual
31
PIPESIM 2012.3 Open Link Reference Manual
. plt Files.
Plot of Man1_435
32
PIPESIM 2012.3 Open Link Reference Manual
Plot of Man2_436
33
PIPESIM 2012.3 Open Link Reference Manual
34
PIPESIM 2012.3 Open Link Reference Manual
ISingleBranchModel Interface
GetNameList (ObjectType As
T T
Returns in pNameArray an array of String with the names of
Long, pNameArray, Count As objects of the given type (ObjectType). The number of objects
Long) found is returned in Count. ObjectType can be any value of:
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
37 – Rod Pump
GetEquipmentInfo
T T
If ParentObject string is empty, the function is the same as
(EquipmentType As Long, TGetNameList (…)T. See TGetNameList (…) Tfor a map to
ParentType As Long, ParentObject EquipmentType options. Otherwise it returns in
35
PIPESIM 2012.3 Open Link Reference Manual
As String, EquipmentNames, EquipmentNames array of String with the names of child objects
Count As Long) of the given type (ObjectType) for specified ParentObject of
ParentType
GetHasArtificialLift (ObjectType
T T
Returns 0: no artificial lift
As Long, ObjectName As String, 1: gas lift injection
Lift As Long)
2: ESP
-1: Object not found
ObjectType must be Tubing type (16)
ObjectName the name of the tubing
GetStartBoundaryObject
T T
Returns the ObjectType (SeeT GetNameList (…)T) and its name of
(ObjectType As Long, ObjectName the upstream-most object in the single branch model. The
As String) upstream-most object in a branch is determined by the drawing
direction when a user initially creates the branch.
GetCountObjectsInProfile (Count
T T
Returns the number of objects in the single branch model
As Long)
GetObjectAtIndex (Index As Long,
T T
Returns the object's type and name at the specified zero-based
ObjectType As Long, ObjectName index. Index must between zero and the number returned by
As String) GetCountObjectsInProfile (…) minus 1.
GetLastError (ErrorStr As String)
T T
Returns the last error message produced by the interface.
GetIsModelRunning () As Boolean
T T
Returns Boolean value True if the simulation process is active
GetOperationInterface
T T Returns the operation object
(pIOperation As Object)
GetOperationType () As Long
T T
Returns Long value as the operation defined for the model. See
XDefined constants and stringsX
GetPropertyNames (ObjectName
T T
Returns in PropNames the list of properties defined for the object
As String, PropNames) as Long ObjectName. Returns the number of properties as function’s
return value
GetPropertyVal (ObjectName As
T T
For specified property (PropName) in the specified object
String, PropName As String, (ObjectName) function gets a property value in ’Value’ and the
pValue As Double, pUnitStr As units in UnitStr. Return value is True if the property was retrieved
String) As Boolean successfully, otherwise False. For implemented PropNames see
XDefined constants and stringsX.
GetPropertyValAtObjectIndex
T T
Gets a specified property value.
(ObjectName As String, PropName This function extends the functionality of TGetPropertyValT by
As String, pValue As Double, allowing you to retrieve a property from a specified
pUnitStr As String, SubObjectType sub-component within an object. A typical use of this is when for
As Long, Index As Long) As instance it is required to get a gas lift flowrate (PropName) from
Boolean the top (Index = 0) gas lift injection point (SubObjectType) in the
tubing ‘Tubing_1’ (ObjectName). For available options see
XDefined constants and stringsX
36
PIPESIM 2012.3 Open Link Reference Manual
GetPropertyStringAtObjectIndex
T T
The function is similar to TGetPropertyValAtObjectIndexT but for
(ObjectName As String, PropName properties defined as string
As String, pValue As String, Index
As Long) As Boolean
GetPropertyType (ObjectName As
T T Returns the property type:
String, PropName As String) As UNDEFINED -1
Long
REAL 0 (value in strict SI units)
INT 1
DOUBLE 2
STR 3
GetSensitivityInfo (ObjectType As
T T
Returns the list of variable names upon which a sensitivity
Long, ObjectName As String, analysis can be performed for the given object (defined by its
VariableNames, ItemReference) 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
T T
Requests the list of variable names and their measurements upon
(ObjectName As String, which a sensitivity analysis can be performed for the given object
VariableNames, StdQtyNames) As (defined by name). The return value holds number of the
Long variables
GetHorizCompWellbore
T T
Return the wellbore as a flowline object of a horizontal
(ObjectName As String, Wellbore, completion with label ObjectName. The method also returns a
As IFlowlineObj) As Boolean boolean to indicate if the return of wellbore is successful
WasSavedWithObsoletePackage
T
Return if the model was saved with specified obsolete flash
(ObsoletePackgeName As String) package (ObsoletePackgeName)
As Boolean ObsoletePackgeName: “SIS” for SIS flash package, “SPPTS” for
SIEP SPPTS flash package (not case sensitive); otherwise, return
false.
ReadDefaultPVTFile (PVTFilename
T
Return the file name (PVTFilename) and compositional data
As String, Composition As Object) (Composition) of the PVT file which is used as default fluid in the
As Boolean model.
The return value indicates if the PVT file reading is successful.
ReadBoundaryPVTFile
T
Return the file name (PVTFilename) and compositional data
(ObjectName As String, (Composition) of the PVT file which is used as local fluid in a
PVTFilename As String, boundary (ObjectName).
Composition As Object) As The return value indicates if the PVT file reading is successful.
Boolean
GetPVTFile (bstrPVTFilename As
T T
Gets the compositional file (.pvt) set in the fluidmodel of the
String) branch
Note: This gets the pvt file name even if the branch is not in pvt
mode.
37
PIPESIM 2012.3 Open Link Reference Manual
GetBoundaryProperties (Pressure
T T
Returns the boundary properties set in the model for the single
As Double, Temperature As branch. The branch must be a boundary object (Source, Sink,
Double, Fluidrate As Double, Production Well or Injection Well)
Fluidtype As Long) Pressures in psia
Temperatures in F
Fluidtype = 0 (liquid rate), Fluidrate in STB/D
Fluidtype = 1 (gas rate), Fluidrate in mmscf/d
Fluidtype = 2 (mass rate), Fluidrate in lb/s
SetOperationInterface
T T
pIOperation: The interface instance to an operation object.
(pIOperation As Unknown) This function assigns the given operation to the opened single
branch model
SetOperationType
T T
Sets the operation type for the single branch model.
(OperationType As Long) See Defined constants and strings
X X
SetPropertyVal (ObjectName As
T T
Sets the specified property (PropName) in the specified object
String, PropName As String, value (ObjectName) to the value given in Value in the given units
As Double, UnitStr As String) As (UnitStr). Function returns True if the property was set
Boolean successfully, otherwise False. Implemented PropNames:
see Defined constants and strings.
X X
SetPropertyStringAtObjectIndex
T T
As SetPropertyValAtObjectIndex (…) but for properties defined
T T
SetPVTFile (bstrPVTFilename As
T T
Sets the compositional mode to pvt and the compositional file
String) (.pvt) to be used as the main fluid in the simulations
SetUnitManager
T T Sets the Unit Manager object
(p_VarUnitManager)
SetBoundaryProperties (Pressure
T T
Sets the boundary properties set in the model for the single
As Double, Temperature As branch. The branch must be a boundary object (Source, Sink,
Double) Production Well or Injection Well)
Pressures in psia
Temperatures in F
38
PIPESIM 2012.3 Open Link Reference Manual
BlackOil As Object
T T
Gets/sets the Black Oil fluid definition object
Composition As Object
T T
Gets/sets the fluid composition object
FlowCorrelation As Object
T T
Gets/sets the Flow Correlation object
Fluid As FluidModel
T T
Gets/sets the FluidModel object (See IFlowlineObj
X
Interface)
X
FluidModelType As Long
T T
Gets/sets the fluid type (0: black oil, 1: compositional, 2:
PVT file, 3: MFL file)
GasLiftDesign As Object
T T
Gets/sets the Gas Lift Design object
GasLiftSystemProps As Object
T T
Gets/sets the Gas Lift System Properties object
ObjectProperties (ObjectName As
T T
Sets/returns a ProfileObject (See IObjectProperties
X
data
ProjectPath As String
T T
Sets full path name to the model file
FieldSurvey As Object
T T
Gets/sets the FieldSurvey object
ErosionCorrosion As Object
T T
Gets/sets the ErosionCorrosion object
Keywords As String
T T
Gets/sets the additional engine keywords
HeatTransferOptionsPipeBurialMethod
T
Gets/sets the flag value for heat transfer options pipe
As long 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
T
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
T
Gets/sets the value for heat transfer options U value
As double multiplier
EnableHydrateSubcoolingCalculation As
T
Gets/sets the flag value for heat transfer options hydrate
long subcooling calculation:
39
PIPESIM 2012.3 Open Link Reference Manual
0: disable
1: enable (set to this value if given value is not 0, or 1)
Note: Property is for compositional models only
ExportEngineFiles ()
T T
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
T T
In addition to ExportEngineFiles (), this function returns
T T
String) As String the full pathname to the exported file (.psm) and its
associated operation file (.inc)
ExportEngineFiles3 (nExpertMode As
T T
This function is similar to ExportEngineFiles function
T T
40
PIPESIM 2012.3 Open Link Reference Manual
RunSingleBranchModel (bRestart As
T T
Runs the currently opened model by calling the
Boolean) 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
T T
Similar to SetOperationInterface, it also accepts one or
T T
Boolean, EngSwitches As String, more switches to be passed to the simulation engine and
DynamicPlot As Boolean) turns dynamic plotting on/off.
RunSingleBranchModel3 (bRestart As
T T
Similar to SetOperationInterface2, it also allows using of
T T
41
PIPESIM 2012.3 Open Link Reference Manual
SingleBranchObj.GetCountObjectsInProfile count
'Write to the spreadsheet the list of objects in the single branch model
For indx = 0 To count - 1
SingleBranchObj.GetObjectAtIndex indx, objtype, objname
Cells(indx + 1, 1) = objname
Cells(indx + 1, 2) = objtype
Next
'Get Sensitivity Information for the tubing (type = 16) with identifier Tub_1
SingleBranchObj.GetSensitivityInfo 16, Tub_1, sensvarnames, objref
42
PIPESIM 2012.3 Open Link Reference Manual
IISingleBranchModel2 Interface
UFactorMultiplier As Double
T T
Gets/sets the u-factor multiplier for a single branch model
IObjectProperties Interface
Fluid As FluidModel
T T
Gets a FluidModel interface object (see description below)
GetLastError () As String
T T
Returns an error description
GetPropertyNames (PropNames) As
T T
Returns in PropNames the array of properties defined for
Long the object. Function’s return value is the number of
properties
GetValue (PropName As String,
T T
Gets the specified property (PropName) value in Value in the
pValue, pUnitStr As String, Index As given units (UnitStr). Return value is True if the property was
Long) As Boolean set successfully, otherwise False. Implemented
PropNames: see Defined constants and strings. Index is a
X X
43
PIPESIM 2012.3 Open Link Reference Manual
ITubing Interface
GetCountDownholeEquipment (Type
T T
Returns the number of items specified in the detailed tubing
As Long) As Long model of a given type of equipment
Type: any of
T T
16 – Tubing section
18 - Choke
22 - Centrifugal Pump
24 - Injection Point
25 - Separator
32 – SSSV
33 – Gas Lift Valve
36 – PCP
37 – Rod Pump
(See Object Type Identifiers)
X X
GetCountTubingSection () As Long
T T
Similar to GetCountDownholeEquipment, but specific to
T T
tubing sections
GetDeviationSurvey_SI (Type As
T T
Returns in a Variant the matrix of doubles defined as two
Long) As Variant 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
T T
16 – Tubing section
18 - Choke
22 - Centrifugal Pump
24 - Injection Point
25 - Separator
32 – SSSV
33 – Gas Lift Valve
36 – PCP
37 – Rod Pump
Index: the 0 based positional index of the item. Index = 0
refers to the top-most item closest to the wellhead.
GetDownholeEquipmentAtIndex
T T
Returns the equipment type, label and md (as function’s
44
PIPESIM 2012.3 Open Link Reference Manual
(Index As Long, Type As Long, label As return value) in strict SI units at a given Index.
String) As Double See GetDownholeEquipment for definition of Index
T T
GetGeothermalSurvey_SI (vbIsTVD
T T
Returns the geothermal survey in Variant matrix of doubles
As Boolean) As Variant 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,
T T
Similar to GetDownholeEquipment, but specific to tubing
T T
SetDeviationSurvey_SI (Type As
T T
Sets a deviation survey to a detailed tubing model.
Long, Survey) As Boolean See GetDeviationSurvey_SI for available types. Survey
T T
vbIsTVD.
RemedialCoiledTubingEnabled As
T T
Enables/disables Remedial Coiled Tubing option in
Boolean configuration
45
PIPESIM 2012.3 Open Link Reference Manual
AddDownholeEquipment (Type As
T T
Adds an equipment item to the detailed tubing
Long, md_SI As Double, label As Type: any of
String) As Long
22 - Centrifugal Pump
24 - Injection Point
25 - Separator
32 – SSSV
33 – Gas Lift Valve
36 – PCP
37 – Rod Pump
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,
T T
Adds a gas lift valve to the tubing object. Returns the
manuf As String, series As String, zero-based index corresponding to the valve position with
portName As String, portSize As index of the topmost valve equal to 0.
Double, mode As String, ptro As
Double, Ap As Double, Ab As Double,
nomOD As Double, cv As Double,
dpfo As Double) As Long
AddTubingSection (BottomMD_SI As
T T
Adds a section of tubing
Double, label As String) As Long 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 ()
T T
Removes all gas lift valves from the tubing
RemoveDownholeEquipment (Type
T T
Removes a piece of equipment of a given type and at the
As Long, Index As Long) given Index.
Type: any of
22 - Centrifugal Pump
24 - Injection Point
25 - Separator
32 – SSSV
33 – Gas Lift Valve
36 – PCP
37 – Rod Pump
Index: the 0 based positional index of the item. Index = 0
refers to the top-most item closest to the wellhead
46
PIPESIM 2012.3 Open Link Reference Manual
RemoveTubingSection (Index As
T T
Similar to RemoveDownholeEquipment but applicable to
T T
IVertCompObj Interface
SetMultipoint(value As Long) As
T
Set either multipoint=1 or isochronal=0 type of IPR data
Boolean T
table
SetIPRFluidType(Type As Long) As
T Set fluid type for IPR: type_liquid=0, type_gas=1
Boolean T
SetIPRTable_SI(QPPoints) As Boolean
T T
Sets the IPR table values. QPPoints is a 3-column array of
T
GetPSSRelPermTableData(WaterSat,
T
Returns the relative permeability table data for the vertical
RelPermOil, RelPermWater) As completion with pseudo steady state model. WaterSat,
Boolean T
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
T
47
PIPESIM 2012.3 Open Link Reference Manual
CalculateIPR() As Boolean
T T
DisplayDialog (p_VarUnitManager)
T T
Function invokes Vertical Completion configuration dialog
As Boolean and returns True if OK button was clicked, False otherwise.
Pass a Null variant as the argument’s value.
Fluid As FluidModel
T T
Gets a FluidModel interface object
Note: This is a get only property.
IFlowlineObj Interface
HeatTransfer As Object
T T
Gets/sets HeatTransfer object
AddProfileNode_SI (distance As
T T
Adds a node to the flowline detailed node description. All
Double, elevation As Double, values must be given in strict SI units.
ambientT As Double, uValue As
Double, label As String)
ClearDetailedProfile ()
T T
Deletes all nodes in the flowline detailed profile
UseDetailedProfile (UseDetailed As
T T
UseDetailed = True: instructs the flowline to use the detailed
Boolean) profile description.
UseDetailed = False: use the flowline’s simple description,
detailed nodes will be generated automatically.
DisplayDialog (p_VarUnitManager)
T T
Function invokes flowline configuration dialog and returns
As Boolean True if OK button was clicked, False otherwise. Pass a Null
variant as the argument’s value.
GetNodesCount () As Long
T T
Function returns a number of nodes defined in a detailed
profile
48
PIPESIM 2012.3 Open Link Reference Manual
49
PIPESIM 2012.3 Open Link Reference Manual
IHeatTransfer Interface
UValueType As Long
T T
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
T T
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
T T
Gets/sets an ambient fluid type. 0 for air and 1 for water.
String) calculatedT
GetPipeConductivity (dblVal as
T T
Returns pipe conductivity value and units string. Fails
Double, units as String) if UValueType is not calculated
T U U T
GetAmbientFluidVelosity (dblVal as
T T
Returns ambient fluid velocity value and units string. Fails
Double, units as String) if UValueType is not calculated
T U U T
GetGroundConductivity (dblVal as
T T
Returns ground conductivity value and units string. Fails
Double, units as String) if UValueType is not calculated
T U U T
GetCoatingData_SI (varData)
T T
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
T U U
calculatedT
String) calculatedT
SetPipeConductivity (dblVal as
T T
Sets pipe conductivity value in specified units. Fails
Double, units as String) if UValueType is not calculated
T U U T
SetAmbientFluidVelosity (dblVal as
T T
Sets ambient fluid velocity value in specified units. Fails
Double, units as String) if UValueType is not calculated
T U U T
50
PIPESIM 2012.3 Open Link Reference Manual
SetGroundConductivity (dblVal as
T T
Sets ground conductivity value in specified units. Fails
Double, units as String) if UValueType is not calculated
T U U T
SetCoatingData_SI (varData)
T T
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
T U U T
IFluid Interface
Composition As Object
T T
Accesses the ICompositional object (See ISinglePointCalib
object)
X
BlackOil As Object
T T
Accesses the IBlackOil object (Ref IBlackOil )
XTU UTX
FluidModelType As Long
T T
Retrieves the fluid model type: 0: BlackOil, 1: Compositional,
2 PVT File, 3 MFL File
OverrideValues As Boolean
T T
Sets/gets whether Wcut/GOR values are overridden from
the values defined in the fluid model.
WCutoverride_SI As Double
T T
Accesses the watercut override value
GORoverride_SI As Double
T T
Accesses the GOR override value
OGRoverride_SI As Double
T T
Accesses the OGR override value
LGRoverride_SI As Double
T T
Accesses the LGR override value
GLRoverride_SI As Double
T T
Accesses the GLR override value
GORoverride_Type As Integer
T T
Accesses which GOR type is being overridden (0=GLR,
1=GOR, 2=LGR, 3=OGR)
IsLocalFluid As Boolean
T T
Sets/gets whether the object is using a local fluid model
CompositionType As Long
T T
Sets/gets whether the local composition is a PVT file or a
defined PIPESIM composition or local MFL file
FluidName As String
T T
Sets/gets a fluid name
PVTFile As String Sets/gets a fluid pvt file. Note that the pvtfile is returned
even if the current mode is not a compositional pvt. You
need to use the properties FluidModelType and
CompositionType to set or check what is the active mode.
51
PIPESIM 2012.3 Open Link Reference Manual
DisplayDialog (p_VarUnitManager)
T T
Function invokes fluid configuration dialog and returns True
As Boolean if OK button was clicked, False otherwise. Pass a Null
variant as the argument’s value.
IProjectInfo Interface
Description As String
T T
Gets/sets string property
User As String
T T
Gets/sets string property
Job As String
T T
Gets/sets string property
Company As String
T T
Gets/sets string property
Manager As String
T T
Gets/sets string property
Remarks As String
T T
Gets/sets string property
Date As String
T T
Gets/sets string property
Field As String
T T
Gets/sets string property
WellNumber As String
T T
Gets/sets string property
Lease As String
T T
Gets/sets string property
Country As String
T T
Gets/sets string property
Address As String
T T
Gets/sets string property
Email As String
T T
Gets/sets string property
Phone As String
T T
Gets/sets string property
Fax As String
T T
Gets/sets string property
IErosionCorrosion Interface
CalculatePH As Long
T T
Gets/sets value for Actual pH property (1 – calculate value, 0
– use user-defined pH value)
CorrosionEfficiency As Double
T T
Gets/sets corrosion efficiency value
CorrosionModel As Long
T T
Gets/sets value for Corrosion Model property (0 – none, 1 –
use de Waard (1995) model )
ErosionEfficiency As Double
T T
Gets/sets erosion efficiency value
ErosionModel As Long
T T
Gets/sets value for Erosion Model property (0 – API 14e
model, 1- SALAMA (2000))
52
PIPESIM 2012.3 Open Link Reference Manual
ErosionRate_Eng As Double
T T
Gets/sets acceptable erosion rate value
ErosionVelocityConst As Double
T T
Gets/sets erosion velocity constant value
GeometryConstant As Double
T T
Gets/sets geometry constant value
SandGrainSize_Eng As Double
T T
Gets/sets sand grain size value
SandProdRatio As Double
T T
Gets/sets sand production ratio value
UserDefinedPH As Double
T T
Gets/sets user-defined pH value
SingleBranchObj.GetCountObjectsInProfile count
'Write to the spreadsheet the list of objects in the single branch model
For indx = 0 To count - 1
SingleBranchObj.GetObjectAtIndex indx, objtype, objname
Cells(indx + 1, 1) = objname
Cells(indx + 1, 2) = objtype
Next
'Get Sensitivity Information for the tubing (type = 16) with identifier Tub_1
SingleBranchObj.GetSensitivityInfo 16, Tub_1, sensvarnames, objref
53
PIPESIM 2012.3 Open Link Reference Manual
INetModel Interface
EquipmentNames, Count As Long) 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)
T T
Returns the last error message produced by the
interface
GetBoundaryProperties (ObjectName As
T T
Returns the boundary properties set in the model
String, Pressure As Double, Temperature As for object with identifier ObjectName. ObjectName
Double, Fluidrate As Double, Fluidtype As must be a boundary object (Source, Sink,
Long) Production Well or Injection Well)
Pressures in psia
54
PIPESIM 2012.3 Open Link Reference Manual
Temperatures in F
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
T T
Similar to GetBoundaryProperties except that this
T T
(ObjectName As String, Pressure As Double, function returns the properties in strict SI units.
Temperature As Double, Fluidrate As Double,
fluidtype As Long)
GetBoundaryBlackOil (ObjectName As String,
T T
Gets the BlackOil object used by the source with
BlackOil As Object) As Boolean identifier ObjectName. Only applicable for
BlackOil models. The function returns True in case
of success and False otherwise
GetBoundaryComposition (ObjectName As
T T
Gets the Compositional object used by the source
String, Composition As Object) As Boolean with identifier ObjectName. Only applicable for
compositional models, The function returns True in
case of success and False otherwise
GetBoundaryCompositionType (ObjectName
T T Returns the composition model location used by
As String, Type As Long) 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,
T T
Gets the PVT file used by the source with identifier
PVTFilename As String) As Boolean ObjectName. Only applicable for
Compositional/PVT models
GetBoundaryType (ObjectName As String,
T T
Returns the boundary condition type specified for
Type As Long, CurveOption As Long) 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
T T
Returns the number of objects in the single branch
String) As Long model defined for NetObjectName.
GetIsModelRunning () As Boolean
T T
Returns True if simulation is running
GetPropertyNames (ObjectName As String,
T T
Returns in PropNames the list of properties
ParentName As String, PropNames) As Long defined for the object ObjectName. If ObjectName
is defined at the single branch level then
ParentName must be the identifier for its parent
55
PIPESIM 2012.3 Open Link Reference Manual
GetPropertyValAtObjectIndex (ObjectName
T T
Gets a specified property value.
As String, ParentName As String, PropName As This function extends the functionality
String, pValue As Double, pUnitStr As String, of GetPropertyVal by allowing you to retrieve a
T T
GetPropertyStringAtObjectIndex (ObjectName
T T
The function is similar
As String, ParentName As String, PropName As to GetPropertyValAtObjectIndex (…) but for
T T
56
PIPESIM 2012.3 Open Link Reference Manual
GetNodeCooordinates(ObjectName As String,
T
Returns the array of coordinates for GUI element
pCoordArray) As BooleanT
with name in ObjectName parameter. Values are
T
GetConnectionInfo(pBranchArray,
T
Returns the array of all branch names, the array of
pSNodeArray, pENodeArray) As Boolean T
starting nodes and the array 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 String)
T
Returns the offline curve file name for the
As String
T
specified well name
GetCustomData(KeyName As String, pValue)
T
Returns a variant byte array of the custom data
As Boolean T
that has been stored against the supplied
KeyName string
GetCustomKeys(pKeyNameArray) As Boolean
T T
Returns an array of the KeyNames strings for which
custom data has been stored
GetFlowrateLimits_SI(ObjectName as String)
T
Returns a two-column array of Doubles for
As Variant T
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 limits has been
discontinued but the interface has not changed.
Therefore, the lower limits values returned are all
unset.
IsLocalFlowCorrelationUsed(ObjectName as
I
Returns True is a branch or well uses locally
String) As Boolean defined flow correlation and False otherwise
WasSavedWithObsoletePackage
T
Return if the model was saved with specified
(ObsoletePackgeName As String) As Boolean obsolete flash package (ObsoletePackgeName)
ObsoletePackgeName: “SIS” for SIS flash package,
“SPPTS” for SIEP SPPTS flash package (not case
sensitive); otherwise, return false.
ReadDefaultPVTFile (PVTFilename As String,
T
Return the file name (PVTFilename) and
Composition As Object) As Boolean compositional data (Composition) of the PVT file
which is used as default fluid in the model.
The return value indicates if the PVT file reading is
successful.
57
PIPESIM 2012.3 Open Link Reference Manual
SetBoundaryBlackOil (ObjectName
T T
Sets a BlackOil object to a given source. The function
As String, BlackOil As Object) As returns True in case of success and False otherwise
Boolean
SetBoundaryComposition
T T
Sets a compositional object to a source with identifier
(ObjectName As String, Composition ObjectName. Only applicable for compositional models. The
As Object) As Boolean function returns True in case of success and False otherwise
SetBoundaryCurveFile (ObjectName
T T
Sets the source boundary condition as defined by the curve
As String, CurveFileName As String) in file CurveFileName. The format of the file must be that of
As Boolean 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
T T
Sets the given value in the given units as fluidrate boundary
As String, Fluidtype As Long, value condition for source object ObjectName. Fluidtype can be
As Double, UnitStr As String) any of:
0 = liquid rate, 1 = gas rate, 2 = mass rate
SetBoundaryPressure (ObjectName
T T
Sets the given value in the given units as pressure boundary
As String, value As Double, UnitStr condition for source object ObjectName. The boundary
As String) pressure could be the pressure of a generic source in
network, or a generic source in a well branch, or a
completion (bottom most if multiple) in a well branch.
SetBoundaryPVTFile (ObjectName
T T
Sets a PVT file to a given source. PVTFilename must contain
As String, PVTFilename As String) As the full path to a PVT file
Boolean
SetBoundarySourcePQPoints
T T
Sets a number of pressure and flowrate pairs as a boundary
(ObjectName As String, PQPoints, condition to the referred ObjectName. PQPoints is a
fluidtype As Long, PressureUnits As 2-dimensional array of pressure/flowrate values. The object
String, FlowrateUnits As String) As must be of the type generic source. Number of data points
Boolean cannot exceed 30.
58
PIPESIM 2012.3 Open Link Reference Manual
SetBoundaryTemperature
T T
Sets the given value in the given units as temperature
(ObjectName As String, value As boundary condition for source object ObjectName. The
Double, UnitStr As String) boundary temperature could be the temperature of a
generic source in network, or a generic source in a well
branch, or a completion (bottom most if multiple) in a well
branch.
SetBoundaryType (ObjectName As
T T
Sets the type of boundary condition for source object
String, Type As Long, CurveOption ObjectName.
As Long) Type = 0 for pressure and flowrate boundary condition
Type = 1 for curve
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
T T
Sets the specified property (PropName) in the specified
String, ParentName As String, object (ObjectName) to the value given in Value in the
PropName As String, value As given units (UnitStr). Function returns True if the property
Double, UnitStr As String) As was set successfully, otherwise False. ParentName is the
Boolean object at the network level and should define ObjectName
in its single branch model. If properties 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
X
SetPropertyValAtObjectIndex
T T
This function extends the functionality of SetPropertyVal
(ObjectName As String, ParentName by allowing you to set a property to a specified
As String, PropName As String, value sub-component within an object. A typical use of this is
As Double, UnitStr As String, when for instance it is required to set a gas lift flowrate
SubObjectType As Long, Index As (PropName) through the top (Index = 0) gas lift injection
Long) As Boolean point (SubObjectType) in the tubing ‘Tubing_1’
(ObjectName) which is defined for Well_1 (ParentName).
For available options see Defined constants and strings.
X X
SetPropertyStringAtObjectIndex
T T
Similar to SetPropertyValAtObjectIndex (…) except that
(ObjectName As String, ParentName PropName is a string type property.
As String, PropName As String, value
As String, Index As Long) As Boolean
SetPVTFile (bstrPVTFilename As
T T
Sets the compositional mode to pvt and the compositional
String) file (.pvt) to be used as the main fluid in the simulations
SetSingleBranchModel
T T
Sets the underlying single branch model by way of its
(NetObjectName As String, filename associated .bps file to a network object.
As String) As Boolean
59
PIPESIM 2012.3 Open Link Reference Manual
SetCustomData(KeyName As String,
T
Stores a variant array of byte data against a KeyName
pValue) As Boolean T
string. This can be used to persist additional custom data,
and can later be retrieved by specifying the KeyName
SetFlowrateLimits_SI(ObjectName
T
Sets flowrate limits for specified branch passing a
as String, Limits) T
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.
BlackOilDefault As Object
T T
Gets/sets the default BlackOil model to/from a BlackOil
object
CompositionDefault As Object
T T
Gets/sets the default composition to/from a Composition
object
FlowCorrelation As Object
T T
Gets/sets the flow correlation properties to/from a
FlowCorrelation object
UseNetworkFlowCorrelationOption
T
Gets/sets the flag value to use network flow correlation
sControl As Long
T
options control (if = 1) or to use local branch options (if = 0)
FluidModelType As Long
T T
0: BlackOil, 1: Compositional, 2: PVT File, 3: MFL File
LocalFluid (ObjectName As String)
T T
Gets/sets the Fluid object for the specified object
As FluidModel (ObjectName)
ModelFileName As String
T T
Returns the file path of the current model
ModelBuilder As ModelBuilder
T T
Returns a ModelBuilder object - see ModelBuilder
X X
ProjectInfo As ProjectInfo
T T
Get the ProjectInfo object to access project specific data
ErosionCorrosion As Object
T T
Gets/sets the ErosionCorrosion object
UseNetErCorrSettings As Long
T T
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
T T
Gets/sets the network engine keywords to be added at
bottom of tnt file
TopKeywords As String
T T
Gets/sets the network engine keywords to be added on top
of tnt file
AppVersion As String
T T
Gets the version of PIPESIM
IsLocalFluidUsed (ObjectName As
T
Returns True if a specified branch or network source are set
String) As Boolean T
to use a locally defined fluid or if a production well is
multilayered.
60
PIPESIM 2012.3 Open Link Reference Manual
ExportEngineFiles ()
T T
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 ()
T T
Terminates the simulation process
OpenModel (bstrModelFileName As
T T
Opens the given network model. Filename must be a valid
String) 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.
61
PIPESIM 2012.3 Open Link Reference Manual
ModelBuilder object
SetNodeCoordinates (NodeName As
T T
Sets the node coordinates for node object NodeName to X, Y
String, X As Long, Y As Long) coordinates
TopLeftCoordinate_X As Long
T T
Sets/returns the top left X coordinate of the graphical
panel. SetNodeCoordinates values are passed in relation
T T
TopLeftCoordinate_Y As Long
T T
As above for the Y coordinate
BottomRightCoordinate_X As Long
T T
Returns the bottom right X coordinate of the graphical panel
(this is a read-only property)
BottomRightCoordinate_Y As Long
T T
As above for the Y coordinate
GetNodeCoordinates (NodeName
T T Gets the node X, Y coordinates for node object NodeName
As String, X As Long, Y As Long)
GetLastError () As String
T T
Returns the last error message produced by the object
IBlackOil object
API As Double
T T
API value
API_Type As Integer
T T
API type (0=API, 1=DOD)
ConingEnabled As Boolean
T T
True/False
ConingGasSG As Double
T T
Coning gas specific gravity
ConingRateType As Long
T T
0: liquid, 1: gas, 2: mass
ConingTable_SI As Variant
T T
A 3-column array with rate, gor/glr, wcut values, use strict SI
units
GasSG As Double
T T
Black oil specific gravity
GLR_SI As Double
T T
Gas/Liquid Ratio use strict SI units
62
PIPESIM 2012.3 Open Link Reference Manual
GOR_SI As Double
T T
Gas/Oil Ratio use strict SI units
GOR_Type As Integer
T T
(0=GLR, 1=GOR, 2=LGR, 3=OGR)
LGR_SI As Double
T T
Liquid/Gas Ratio use strict SI units
OGR_SI As Double
T T
Oil/Gas Ratio use strict SI units
SolutionGasCorrelation As Long
T T
0 = Lasater, 1 = Standing, 2 = Vazquez and Beggs, 3 = Glaso, 4
= Kartoatmodjo
Watercut As Double
T T
Water Cut
WaterSG As Double
T T
Water specific gravity
Name As String
T T
Name of the fluid
Comment As String
T T
String containing the text in the comments field
Calibration As Long
T T
Calibration type: 0 – no calibration, 1 – single point and 2 -
multipoint
SinglePointCalib As Object
T T
Single point calibration data object
MultiPointCalib As Object
T T
Multipoint calibration data object
Viscosity As Object
T T
String containing the text in the comments field
ThermalData As Object
T T
String containing the text in the comments field
Contaminants As Variant
T T
Array of Doubles for contaminant values in a following order:
CO2, H2S, N2, H2 and CO
WGR_Type As Integer
T T
(0=Watercut, 1=GWR, 2=WGR)
GWR_SI As Double
T T
Gas/Water Ratio use strict SI units
WGR_SI As Double
T T
Water/Gas Ratio use strict SI units
SetBubblePointCalibration
T T
Sets the bubble point data
(SatGas_SI As Double, Pressure_SI
As Double, Temperature_SI As
Double)
GetBubblePointCalibration
T T
Gets the bubble point data. Return value is a Saturation Gas
(Pressure_SI As Double, correlation : 0 for Lasater, 1 for Standing, 2 for Vazquez and
Temperature_SI As Double) As Beggs, 3 for Glaso, 4 for Kartoatmodjo, 5 for De Ghetto at al
Double or 6 for Petrosky-Farshad
63
PIPESIM 2012.3 Open Link Reference Manual
ISinglePointCalib object
GetCalibrationAtBubblePoint (Press
T T
Function gets calibration data at bubble point. The return
ure_SI As Double, Temperature_SI value is Saturation Gas correlation: 0 for Lasater, 1 for
As Double, SatGas_SI As Double) as Standing, 2 for Vazquez and Beggs, 3 for Glaso, 4 for
Long Kartoatmodjo, 5 for De Ghetto et al. or 6 for Petrosky-Farshad
GetCalibrationAboveBubblePoint (
T T
Function gets calibration data above bubble point. The
OFVF As Double, Density_SI as return value is density type: 0 for Density, 1 for OFVF or 3
Double, Compressibility_SI as for Compressibility
Double, Pressure_SI As Double,
Temperature_SI As Double) as Long
GetCalibrationBelowBubblePoint (O
T T
Function gets calibration data below bubble point. The
FVF As Double, Density_SI as return value is density type: 0 for Density or 1 for OFVF
Double, Pressure_SI As Double,
Temperature_SI As Double) as Long
GetLiveOilViscBelowBubblePoint (P
T T
Function gets live oil viscosity data below bubble point. The
ressure_SI As Double, return value is Live Oil Viscosity Correlation: 0 for Beggs &
Temperature_SI As Double, Robinson, 1 for Chew & Connally, 2 for Kartoatmodjo, 3 for
LiveOilVisc_SI) as Long Khan, 4 for De Ghetto et al., 5 for Hossain, 6 for Elsharkawyor
7 for Petrosky-Farshad
GetGasViscBelowBubblePoint (Pres
T T
Function gets gas viscosity data below bubble point. The
sure_SI As Double, Temperature_SI return value is gas viscosity.
As Double) as Double
GetGasZBelowBubblePoint (GasZ as
T T
Function gets gas Z data below bubble point. The return
Double, Pressure_SI As Double, value is gas Z correlation: 0 for Standing, 1 for Hall
Temperature_SI As Double) as Long Yarborough or 2 for Robinson et al.
SetCalibrationAtBubblePoint (SolGasCorr
T T
Function sets calibration data at bubble point. The
as Long, Pressure_SI As Double, acceptable values for Saturation Gas correlation are: 0
Temperature_SI As Double, SatGas_SI As for Lasater, 1 for Standing, 2 for Vazquez and Beggs, 3
Double) for Glaso, 4 for Kartoatmodjo, 5 for De Ghetto et al. or 6
for Petrosky-Farshad
SetCalibrationAboveBubblePoint (DensT
T T
Function sets calibration data above bubble point. The
ype as Long, OFVF As Double, Density_SI acceptable values for density type are: 0 for Density, 1
as Double, Compressibility_SI as Double, for OFVF or 3 for Compressibility
Pressure_SI As Double, Temperature_SI
As Double)
SetCalibrationBelowBubblePoint (DensT
T T
Function sets calibration data above bubble point. The
ype as Long, OFVF As Double, Density_SI acceptable values for density type are: 0 for Density or 1
as Double, Pressure_SI As Double, for OFVF
64
PIPESIM 2012.3 Open Link Reference Manual
Temperature_SI As Double)
SetLiveOilViscBelowBubblePoint (LiveOil
T T
Function sets live oil viscosity data below bubble point.
Corr as Long, Pressure_SI As Double, The acceptable values for Live Oil Viscosity Correlation
Temperature_SI As Double, are: 0 for Beggs & Robinson, 1 for Chew & Connally, 2
LiveOilVisc_SI) for Kartoatmodjo, 3 for Khan, 4 for De Ghetto et al., 5
for Hossain, 6 for Elsharkawyor 7 for Petrosky-Farshad
SetGasViscBelowBubblePoint (Pressure_
T T
Function sets gas viscosity data below bubble point.
SI As Double, Temperature_SI As Double,
GasVisc_SI as Double)
SetGasZBelowBubblePoint (GasZCorr as
T T
Function sets gas Z data below bubble point. The
Long, GasZ as Double, Pressure_SI As acceptable values for gas Z correlation are: 0 for
Double, Temperature_SI As Double) Standing, 1 for Hall Yarborough or 2 for Robinson et al.
IMultiPointCalib object
OFVF as Boolean
T T
True for Oil FVF or False for Oil Density
GetCalibUnits (UnitsArray)
T T
Function returns an array of Strings containing units for
Pressure, Solution Gas GOR, Oil Density, Oil Viscosity and Gas
Viscosity
GetCorrelations (CorrArray)
T T
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,
T T Function returns a calibration temperature and units.
Units as String)
GetCalibrationAtBubblePoint (Calib
T T
Function gets calibration data at bubble point as an array of
Data) 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 (C
T T
Function gets calibration data above bubble point as a
alibData) 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 (C
T T
Function gets calibration data below bubble point as a
alibData) 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
65
PIPESIM 2012.3 Open Link Reference Manual
66
PIPESIM 2012.3 Open Link Reference Manual
SetCalibUnits (UnitsArray)
T T
Function sets units for Pressure, Solution Gas GOR, Oil
Density, Oil Viscosity and Gas Viscosity supplied as an array of
Strings
SetCorrelations (CorrArray)
T T
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
T T
Function sets a calibration temperature in specified units.
Units as String)
SetCalibrationAtBubblePoint (Calib
T T
Function sets calibration data at bubble point passed as an
Data) 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 (C
T T
Function sets calibration data above bubble point passed as a
alibData) 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 (C
T T
Function sets calibration data below bubble point passed as a
alibData) 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
DeadOilCorr as Long
T T
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
T T
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
T T
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
67
PIPESIM 2012.3 Open Link Reference Manual
68
PIPESIM 2012.3 Open Link Reference Manual
IThermal object
EnthalpyCalculationMethod as Long
T
Enthalpy Calculation Method. Possible values are: 0 for 1983
Method, or 1 for 2009 Method.
SpecificLatentHeat_SI as Double T
Specific Latent Heat in SI unit (J/kg).
69
PIPESIM 2012.3 Open Link Reference Manual
ICompositional object
Name As String
T T
Name of the fluid
GetComment () As String
T T
Returns a string containing the text in the comments field
GetPackageType () As Long
T T
Returns the Compositional Package Type to use as long
integer according to the following formula:
1 = Multiflash, 101 = Eclipse 300, 102 = DBR, 103 = GERG, 104
= REFPROP V8
Note: For model saved with SIS flash, this method will return
101 as Eclipse 300 since SIS flash is obsolete.
For model saved with SPPTS flash, this method will return 1
as Multiflash since SPPTS flash is obsolete
GetComponentList (pVar As Object,
T T
Returns the current component names list.
pVar2As Object, pVar3As Object, pVar = list of component names
HydComp1 As Long, AquComp1 As
pVar2 = list of hydrocarbon names
Long) As Long
pVar3 = list of aqueous names
AquComp1 = number of aqueous components
HydComp1 = number of aqueous components.
Returns total number of components
GetLibraryComptBP (pVar)
T T
Returns the boiling points of the library components set
by SetLibraryComptCalculator.
T T
70
PIPESIM 2012.3 Open Link Reference Manual
GetLibraryComptPC (pVar)
T T
Returns the critical pressures of the library components set
by SetLibraryComptCalculator.
T T
conversion to mol is done and the moles are set in the model.
So any subsequent query on the molarlist will return the
values converted from mass For other units the value is
returned as is.
Return value is a size of the array.
GetMolarList (pVar) As Long
T T
pVar = list of molar flow rates as an array of Doubles with the
values corresponding to the component names returned
from GetComponentList.. The values are the mol values
T T
stored in the model even if they are not active (aqueous unit
not mol). They are NOT necessarily a conversion of the active
values in the model for aqueous components with units other
than model. See also getStrictMolarList
Return value is a size of the array.
GetMolWeightList (pVar) As Long
T T
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.
71
PIPESIM 2012.3 Open Link Reference Manual
72
PIPESIM 2012.3 Open Link Reference Manual
GetWatsonKFactorList (pVar) As
T T
pVar = list of Watson K factors as an array of doubles with the
Long values corresponding to the component names returned
from GetComponentList.
T T
SetPackageType (lPackageType As
T T
Sets the Compositional Package Type to use. The following
Long) values of lPackageType will set the package as described:
1 = Multiflash, 101 = Eclipse 300, 102 = DBR, 103 = GERG, 104
= REFPROP V8
Note: For any other input value, this method will return COM
error “E_INVALIDARG” for invalid parameter value.
SetComponentList (pVar, CompNum
T T
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
CompNum2 = number of aqueous components 2 . TPF FPT
1
TP PT Before any set methods are called in Icompositional Interface CreateNewComposition must be called
2
TP PT After all the set methods are called from Icompositional Interface UpdateComposition must be called
73
PIPESIM 2012.3 Open Link Reference Manual
74
PIPESIM 2012.3 Open Link Reference Manual
SetSpecificGravityList (pVar,
T T
pVar = list of specific gravities as an array of doubles with the
CompNum As Long) 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,
T T
pVar = list of critical pressures as an array of doubles with the
CompNum As Long) values corresponding to the component names set
in SetComponentList ensuring that the critical pressures of
T T
CreateNewComposition ()
T T
Blanks all compositional arrays and parameters in memory
UpdateComposition ()
T T
Updates all compositional arrays and parameters in memory
SetBlob (sBlob As String)
T T
Sets data for the required composition
sBlob = String containing compositional information 3 .TPF FPT
SaveAsPVTFile (PVTFilename As
T T
Save composition as a PVT file with specified name
String, bEngUnit As Bool) As Bool PVTFilename and unit. Return true if successful.
3
TP PT The compositional data is provided by the call to the Ipnscom Interface
75
PIPESIM 2012.3 Open Link Reference Manual
ICompositional2 object
Eos As Long
T T
Gets/Sets an equation of state (see Appendix for all allowed
options)
ViscosityModel As Long
T T
Gets/Sets a viscosity model (see Appendix for all allowed
options)
Bip As Long
T T
Gets/Sets a BIP set (see Appendix for all allowed options)
Emulsion As Long
T T
Gets/Sets an emulsion (see Appendix for all allowed options)
ThermalConductivity As Long
T T
Gets a thermal conductivity (0 = None)
SurfaceTension As Long
T T
Gets a surface tension (0 = None)
FlowCorrelations Interface
GetHorizontalCorrelationName ()
T T
Returns the horizontal correlation name. The returned string
76
PIPESIM 2012.3 Open Link Reference Manual
SetHorizontalCorrelation (sSource
T T
Set a horizontal correlation. For example, for the BJA
As String, sCorrelation As String) 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
T T Set a horizontal user correlation
As String, sCorrelation As String)
SetVerticalCorrelation (sSource As
T T
Set a vertical source and correlation. For example for the
String, sCorrelation As String) 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
T T
Set a vertical user correlation
String, sCorrelation As String)
SwapAngle As Double
T T
Vertical-Horizontal Correlation Swap Angle
HorizontalFrictionFactor As Double
T T
Horizontal Friction Factor
VerticalFrictionFactor As Double
T T
Vertical Friction Factor
VerticalHoldup As Double
T T
Vertical Holdup
HorizontalHoldup As Double
T T
Horizontal Holdup
SinglePhaseCorrelation As String
T T
Any of: Moody, AGA, Pan-A, Pan-B, HazWill, Weymouth,
77
PIPESIM 2012.3 Open Link Reference Manual
CULSMITH
SinglePhaseFactor As Double
T T
Single flow correlation coefficient (if applicable)
Note: See the PIPESIM help for the complete list of available vertical and horizontal flow correlations and
sources.
DisplayDialog ()
T T
Displays PIPESIM dialog for flow correlation (this method is
obsolete, use DisplayDialog2 instead).
DisplayDialog2 () As Boolean
T T
Displays PIPESIM dialog for flow correlation ().
Return value is True if data is changed and False otherwise
ICFlowCorrelations2 Interface
SetHorizontalCorrelation2
T T
Set method name (sCorrelation), friction factor (friction) and
(sCorrelation As String, friction as holdup factor (holdup) for the horizontal flow correlation
double, [in] holdup as double)
TSetVerticalCorrelation2 T
Set method name (sCorrelation), friction factor (friction) and
(sCorrelation As String, friction as holdup factor (holdup) for the vertical flow correlation
double, [in] holdup as double)
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
T T
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)
T T X X
for a list of operation IDs. Similarly, any operation interface can be set to the model by
calling SetOperationInterface (…) and SetOperationType (…).
T T T T
78
PIPESIM 2012.3 Open Link Reference Manual
Systems Analysis
BoundaryConds As IBoundaryProps
T T
Get/set property to access boundary conditions. See the
definition of IBoundaryProps Interface for its methods and
TX X T
properties
Engine As IEngineOptions
T T
Gets the IEngineOptions object to set simulation parameters
and run the operation. See IEngineOptions Interface for its
TX X T
sensitivity.
Returns the sensitivity object name for the specified index.
SensitivityVariable (indx As Long) As
T T
indx: the sensitivity box indx. Pass –1 for the X-axis variable,
String 0,1,2,…, (MaxSensitivityVars -1) for the corresponding
T T
sensitivity.
Returns the sensitivity variable name for the specified index
GetIsUnset () As Boolean
T T
Returns True if the operation’s data is all blank (unset)
GetLastError () As String
T T
Returns an error description after function call failure. Must
be called immediately after the call to the failed function.
79
PIPESIM 2012.3 Open Link Reference Manual
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
X X
Boolean) 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,
T T Similar to SetSensitivityData, but uses strict SI units
T T
ObjectStr As String, VarStr As String, indx: the sensitivity box indx. Pass –1 for the X axis variable,
Values_SI, vbActive As Boolean, 0,1,2, … , (MaxSensitivityVars -1) for the corresponding
T T
80
PIPESIM 2012.3 Open Link Reference Manual
WriteOperationFile () As Boolean
T T
Writes an ASCII file (modelname.inc) containing the
instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager,
T T
Displays the operations graphical interface. Pass a Null
CloseOK As Boolean) variant as the first argument. Returns True if dialog box was
closed OK, otherwise False.
BoundaryConds As IBoundaryProps
T T
Get/set property to access boundary conditions. See the
definition of ‘IBoundaryProps’ for its methods and properties
Engine As IEngineOptions
T T
Gets the IEngineOptions object to set simulation parameters
and run the operation. See ‘IEngineOptions’ for its methods
and properties
FixedInjectionDepths As Boolean
T T
Applicable to gas lifted systems, this property sets/gets
whether gas lift valves are installed in the tubing
EnableSurveyOpts As Boolean
T T
Gets/sets whether survey data is used for profile plotting
ProfileType As Long
T T
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
T T
indx: the sensitivity box indx. Pass –1 for the X-axis variable,
String 0,1,2, … , (MaxSensitivityVars -1) for the corresponding
T T
sensitivity.
Returns the sensitivity object name for the specified index.
81
PIPESIM 2012.3 Open Link Reference Manual
sensitivity.
Returns the sensitivity object name for the specified index.
GetIsUnset () As Boolean
T T
Returns true if the operation’s data is all blank (unset)
GetLastError () As String
T T
Returns an error description after function call failure. Must
be called immediately after the call to the failed function.
GetSensitivityData_SI (ObjectStr As
T T
Returns the sensitivity data specified for the operation.
String, VarStr As String, Values_SI, ObjectStr: the object name is returned here
QuantClass As String)
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.
X X
SetSensitivityData (ObjectStr As
T T
Sets the sensitivity information.
String, VarStr As String, ObjectStr: the object name
Values_DefEng)
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
T T
Same as SetSensitivityData method, but for strict SI units
T T
SetSurveyData_SI (SurveyName As
T T Associates field data to the operation. This data – pressure
String, SurveyDate As Date, and/or temperature profiles is then plotted along with the
Var_MD_Pres_Temp) 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.
82
PIPESIM 2012.3 Open Link Reference Manual
WriteOperationFile () As Boolean
T T
Writes an ASCII file (modelname.inc) containing the
instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager,
T T
Displays the operations graphical interface. Pass a Null
CloseOK As Boolean) variant as the first argument. Returns True if dialog box was
closed OK, otherwise False.
BoundaryConds As IBoundaryProps
T T
Get/set property to access boundary conditions.
See IBoundaryProps Interface for its methods and properties
X X
Engine As IEngineOptions
T T
Gets the IEngineOptions object to set simulation parameters
and run the operation. See IEngineOptions Interface for its
X XT T
GetIsUnset () As Boolean
T T
Returns true if the operation’s data is all blank (unset)
GetLastError () As String
T T
Returns an error description after function call failure. Must
be called immediately after the call to the failed function.
GetSelectedCorrelation
T
Function returns in EngineCodes the array of string for chosen
83
PIPESIM 2012.3 Open Link Reference Manual
SetSurveyData_SI (SurveyName As
T T
Associates field data to the operation. This data, pressure
String, SurveyDate As Date, and/or temperature profiles is then plotted along with the
Var_MD_Pres_Temp) 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
T T
Set or removes selection for the correlation specified by
String, engineCode As String, engineCode depending on IsSelected value
mainCode As String, IsVertical As IsVertical = True for vertical correlations, False for horizontal.
Boolean, IsSelected As Boolean)
SetLanguage (nlLanguageID As Long)
T T
Sets the user interface language
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
WriteOperationFile () As Boolean
T T
Writes an ASCII file (modelname.inc) containing the
instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager,
T T
Displays the operations graphical interface. Pass a Null
CloseOK As Boolean) variant as the first argument. Returns True if dialog box was
closed OK, otherwise False.
Data Matching
BoundaryConds As IBoundaryProps
T T
Get/set property to access boundary conditions.
84
PIPESIM 2012.3 Open Link Reference Manual
properties
Engine As IEngineOptions
T T
Gets the IEngineOptions object to set simulation parameters
and run the operation. See IEngineOptions Interface for their
X XT T
HorFlowFrictFactorRange As
T T
Gets/sets horizontal flow friction factor range object.
IFactorRange See IFactorRange Interface for its methods and properties
X X
HorFlowHoldupFactorRange As
T T
Gets/sets horizontal flow holdup factor range object.
IFactorRange See IFactorRange Interface for its methods and properties
X X
VerFlowFrictFactorRange As
T T
Gets/sets vertical flow friction factor range object.
IFactorRange See IFactorRange Interface for its methods and properties
X X
VerFlowHoldupFactorRange As
T T
Gets/sets vertical flow holdup factor range object.
IFactorRange See IFactorRange Interface for its methods and properties
X X
WeightingFactorPres As Double
T T
Gets/sets pressure RMS weight factor
WeightingFactorTemp As Double
T T
Gets/sets temperature RMS weight factor
EngineOutputListCount As Long
T T
Gets/sets count of resulting records of the Data Matching
operation
ModelHasMeasuredTempInFlowli
T
Gets/sets whether model has measured temperature data
ne As Boolean
T
(Survey data) in any flowlines, risers or tubings. You have to
set this property to true if model has the measured
temperature data
ModelHasMeasuredPresInFlowline
T
Gets/sets whether model has measured pressure data (Survey
s As Boolean
T
data) in any flowlines, risers or tubings. You have to set this
property to true if model has the measured pressure data
GetIsUnset () As Boolean
T T
Returns true if the operation’s data is all blank (unset)
GetLastError () As String
T T
Returns an error description after function call failure. Must be
called immediately after the call to the failed function.
85
PIPESIM 2012.3 Open Link Reference Manual
GetSelectedCorrelation
T
Function returns in EngineCodes the array of string for chosen
(IsVertical As Boolean,
T
vertical flow correlations if IsVertical is True and for horizontal
EngineCodes) correlations if IsVertical is False
EngineOutputListCountAs Long
T T
Function returns count of records that could be read by
GetEngineOutputItem function.
GetEngineOutputItem
T
Function returns correlation start values and results: used
(index as Long, HorFlowFrictFactor
T
methods (names of the horizontal and vertical correlation
as Double, HorFlowHoldupFactor as methods), calculated friction and holdup factors, u-value
Double, VerFlowFrictFactor as multiplier, pressure, temperature and RMS.
Double, VerFlowHoldupFactor as The results are optimized if optimized = true. If function set
double, UValueFactor as Double, optimized = false then function returns start values.
alphaname as string, betaname as
You should pass to index values in range 0..
String, optimized as Boolean,
EngineOutputListCount-1 otherwise you get an error “Invalid
pmatch as Double, tmatch as
argument” (VBA generate an exception “Invalid argument”,
Double) As Double
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.
VerFlowHoldupFactor = vertical flow holdup factor value.
UValueFactor = u-value multiplier.
alphaname = short name of used vertical correlation method.
betaname= short name 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.
SetSelectedCorrelation (helpStr As
T T
Set or removes selection for the correlation specified by
String, engineCode As String, engineCode depending on IsSelected value
mainCode As String, IsVertical As IsVertical = True for vertical correlations, False for horizontal.
Boolean, IsSelected As Boolean)
86
PIPESIM 2012.3 Open Link Reference Manual
WriteOperationFile () As Boolean
T T
Writes an ASCII file (modelname.inc) containing the
instructions to the simulation engine to run the operation.
DisplayDialog (p_VarUnitManager,
T T
Displays the operations graphical interface. Pass a Null
CloseOK As Boolean) variant as the first argument. Returns True if dialog box was
closed OK, otherwise False.
Nodal Analysis
CFactor As Double
T T
Sets a Constant C value
EngineSwitch As String
T T
Sets/gets extra command line arguments for the PIPESIM
engine
FetkovichExp As Double
T T
Sets a Fetkovich n exponent value
FixedInjectionDepths As Boolean
T T
Applicable to gas lifted systems, this property sets/gets
whether gas lift valves are installed in the tubing
FutureAOFP As Double
T T
Sets a future AOFP value
FutureIPR As Boolean
T T
Sets a flag whether to use Future IPR option (True by
default)
IncludeFilePath As String
T T
The full path name to the engine’s operation file
InflowCurveRangeLimit As Boolean
T T
Allow the inflow curves to extend to the AOFP (true)
InflowObject As String
T T
Returns/sets the inflow object name
InflowVariable As String
T T
Returns/sets the inflow variable name
MaxPressureForOutflow_SI As
T T
Maximum pressure for the outflow curves
Double
MaxRate_SI As Double
T T
The maximum fluid rate in strict SI units
87
PIPESIM 2012.3 Open Link Reference Manual
MaxRateFluidType As Long
T T
The maximum fluid rate type: 0: liquid, 1: gas, 2 mass
NumberInflowPoints As Long
T T
The number of points on each inflow curve
NumberOutflowPoints As Long
T T
The number of points on each outflow curve
OutflowCurveRangeLimit As Boolean
T T
Allow the outflow curves to extend to the supplied
maximum flowrate
OutflowObject As String
T T
Returns/sets the outflow object name
OutflowVariable As String
T T
Returns/sets the outflow variable name
OutletPressure_SI As Double
T T
Gets/sets the outlet pressure in strict SI units
PipesimEnginePath As String
T T
The full path to the PIPESIM engine
PlotToolPath As String
T T
The full path to the plotting tool (PSPlot)
PsmFilePath As String
T T
The full path to the model file (.psm file)
ReservoirPressure As Double
T T
Set a reservoir pressure. Used for future AOFP calculations
RunEngineMinimised As Long
T T
Runs the engine in a minimised window
RunPlotToolWithEngine As Long
T T
If True (1) shows the plotting tool (PSPlot) as the simulation
runs
GetIsEngineActive (p_bActive As
T T
Returns True (1) if the PIPESIM engine is running, otherwise
Long) False (0)
GetIsUnset GetIsUnset (pVar As
T T
Returns True (1) if the operation’s data is all blank (unset)
Long)
GetLastError (errorStr As String)
T T
Returns an error description after function call failure. Must
be called immediately after the call to the failed function.
GetSensitivityData_SI (InflowOutflow
T T Returns the sensitivity data specified for the operation.
As Long, ObjectStr As String, VarStr InflowOutflow: 0: inflow data, 1 outflow data
As String, Values_SI, QuantClass As ObjectStr: the object name is returned here
String) 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.
X X
88
PIPESIM 2012.3 Open Link Reference Manual
SetSensitivityData_SI (InflowOutflo
T T
Sets the sensitivity data specified for the operation.
w As Long, ObjectStr As String, VarStr InflowOutflow: 0: inflow data, 1 outflow data
As String, Values_SI, QuantClass As ObjectStr: the object name
String) VarStr: the sensitivity variable name
KillOperation ()
T T
Terminates the engine run
RunOperation ()
T T
Runs the simulation
WriteOperationFile (bOK As Boolean)
T T
Writes an ASCII file containing the instructions to the
simulation engine to run the operation.
DisplayDialog (p_VarUnitManager)
T T
Displays the operations graphical interface. Pass a NULL
variant as the first argument.
This method is obsolete. Use DisplayDialog2 method instead
T T
DisplayDialog2 (p_VarUnitManager,
T T
Displays the operations graphical interface. Pass a Null
bCloseOK As Boolean) variant as the first argument. Returns true if dialog box was
closed OK, otherwise false.
Wax Deposition
89
PIPESIM 2012.3 Open Link Reference Manual
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)
90
PIPESIM 2012.3 Open Link Reference Manual
91
PIPESIM 2012.3 Open Link Reference Manual
EngineSwitch As String Sets/gets extra command line arguments for the PIPESIM
engine
GasSG As Double Sets/gets gas specific gravity value
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)
92
PIPESIM 2012.3 Open Link Reference Manual
IBoundaryProps Interface
IBoundaryProps - Properties
OutletPressure_SI As Double
T T
Gets/sets the outlet pressure in strict SI units
InletPressure_SI As Double
T T
Gets/sets the inlet pressure in strict SI units
FluidRate_SI As Double
T T
Gets/sets the fluid rate in strict SI units
CalculatedVariable As Long
T T
Gets/sets the calculated variable:
0: Outlet Pressure
1: Inlet Pressure,
2: FluidRate
FluidType As Long
T T
Gets/sets the fluidrate type:
0: liquid
1: gas
2: mass
93
PIPESIM 2012.3 Open Link Reference Manual
IEngineOptions Interface
IEngineOptions - Properties
EngineSwitch As String
T T
Sets/gets extra command line arguments for the PIPESIM
engine
IncludeFilePath As String
T T
The full path name to the engine’s operation file
PipesimEnginePath As String
T T
The full path to the PIPESIM engine
PlotToolPath As String
T T
The full path to the plotting tool (PSPlot)
PsmFilePath As String
T T
The full path to the model file (.psm file)
RunEngineMinimised As Boolean
T T
Runs the engine in a minimised window
RunPlotToolWithEngine As Boolean
T T
If True shows the plotting tool (PSPlot) as the simulation
runs
GetIsEngineActive () As Boolean
T T
Returns True if the PIPESIM engine is running, otherwise
False
IEngineOptions - Operations
KillOperation ()
T T
Terminates the engine run
RunOperation ()
T T
Runs the simulation
IFactorRange Interface
IFactorRange - Properties
Min As Double
T T
Sets/gets minimal value for range object
Max As Double
T T
Sets/gets maximum value for range object
Enabled As Boolean
T T
Enable/disable range object
LowerEgge As String
T T
Lower edge for minimum and maximum values
UpperEgge As String
T T
Upper edge for maximum and minimum values
94
PIPESIM 2012.3 Open Link Reference Manual
Name
Supported Interfaces
GLWell interface: to model and perform diagnostics on a gas lift injected well
Dependency MAP
GetArrayEqCurvePressure(pVar)
T T
Returns in pVar an array of Doubles with the equilibrium
curve pressure at each valve depth
GetArrayGasRate(pVar)
T T
Returns in pVar an array of Doubles with the actual
throughputs for each valve. Uses Thornhill & Craver
equation
GetArrayInjectionPressure(pVar)
T T
Returns in pVar an array of Doubles with the injection
pressure at each valve depth
GetArrayInjectionTemperature(pVar)
T T
Returns in pVar an array of Doubles with the injection
temperature at each valve depth
GetArrayMaxGasRate(pVar)
T T
Returns in pVar an array of Doubles with the maximum
throughputs for each valve. Uses Thornhill & Craver
equation
GetArrayProductionPressure(pVar)
T T
Returns in pVar an array of Doubles with the production
pressure at each valve depth
GetArrayProductionTemperature(pVar)
T T
Returns in pVar an array of Doubles with the production
temperature at each valve depth
GetArrayValveClosePressure(pVar)
T T
Returns in pVar an array of Doubles with closing
pressures for each valve
GetArrayValveOpenPressure(pVar)
T T
Returns in pVar an array of Doubles with opening
pressures for each valve
95
PIPESIM 2012.3 Open Link Reference Manual
GetArrayValveStatus(pVar)
T T
Returns in pVar an array of Strings with the valve status:
such as “Throttling”, “Fully Open”.
GetEquilibriumCurve(pVar)
T T
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)
T T
Returns the last error message produced by GLD.
GetProductionPressureCurve(pVar, type
T T
Returns in pVar a 2-dimensional array of Doubles with
As Long) {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,
T
Returns in pVar a 2-dimensional array of doubles with
type As Long) T
{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
AddCalculatedPressureProfile (type As
T T
Type: 0 = MD; 1 = TVD
Long, pVar, pressUnits As String, lenUnits pVar: a two dimensional array containing Doubles
As String) {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
T T
96
PIPESIM 2012.3 Open Link Reference Manual
execution of PIPESIM.
AddGasLiftValve5 (type As Long, depth
T T Type: valve type Any of:
As Double, Ptro As Double, ptroUnits As 0 = IPO, 1 = PPO, 2 = IPS, 3 = PPS, 4 = Orifice, 5 = Dummy
String, Ap As Double, ApAb As Double,
depth [ft]: valve depth
PortSize As Double, NomOD As Double,
desc As String, Cd As Double, dpfo As ptro: test rack pressure
Double) 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,
T T Required if ProfileMode property is set to User Survey
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
97
PIPESIM 2012.3 Open Link Reference Manual
98
PIPESIM 2012.3 Open Link Reference Manual
SetTransferLinesParams3
T T
kickOffInjPressure: casing head pressure to start
(kickOffInjPressure As Double, unloading
kickOffPres_Units As String, kickOffPres_Units: the pressure units for the above
unloadingGrad As Double, parameter
unloadingGrad_Units As String,
unloadingGrad: the unloading gradient
injPresDrop As Double, injPresDrop_Units
As String, locatingDPAtValve As Double, unloadingGrad_Units: Any of psi/ft, bar/m, atm/m,
locatingDP_Units As String, kPa/m
TransferFactor As Double) 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 (kickOffInjPress
T T
The same as SetTransferLinesParams (…) with the added
T T
99
PIPESIM 2012.3 Open Link Reference Manual
SetTransferLinesParams5 (kickOffInjPress
T T
DisplayGasLiftDialog
T T
Pops up the GLD GUI
DisplayGasLiftDialog2 (JpgFilename As
T
Same as DisplayGasLiftDialog but it allows to pass Jpeg
T
Boolean)T
DisplayGasLiftDialog3 (JpgFilename As
T
Same as DisplayGasLiftDialog but it allows to pass file
T
String, p_VarUnitManager, filetype As name where plot will be stored change file type (filetype
Long, cx As Long, cy As Long, bCloseOK can take values 0 – jpeg, 1 – wmf, 2 - emf) and change
As Boolean) T
size of the plot (cx, cy) only for Jpeg file.
CreateJpgFile3 (JpgFilename As String,
T
Function runs the simulation and writes plot file. It
p_VarUnitManager, filetype As Long, cx allows to pass file name where plot will be stored
As Long, cy As Long, bOK As Boolean) T
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.
PressureProfileMode As Long
T T
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.
100
PIPESIM 2012.3 Open Link Reference Manual
CalculateEqCurveOnDisplay As Boolean
T T
If True the GLD module will calculate the equilibrium
curve just before displaying the GUI (when
calling DisplayGasLiftDialog ()). If an existing curve has
T T
IterationMode As Long
T T
Mode = 0 calculate flowrate {DEFAULT}
Mode = 1 calculate inlet pressure
This is applicable when PressureProfileMode = 2
T T
LiquidRate As Double
T T
The production liquid rate in bbl/d. Required
if PressureProfileMode = 3
T T
PipesimEnginePath As String
T T
bstrPath is the full path to a valid PIPESIM engine
This data is required if PressureProfileMode = 2
T T
PipesimIterationTolerance As Double
T T
Sets/gets the tolerance in % for the convergence of
PIPESIM iterations (default = 1 %)
ProductionPressureGradient As Double
T T
The pressure gradient in psi/ft. Required
if PressureProfileMode = 0
T T
PsmFilePath As String
T T
The full path to a valid psm file
This data is required if PressureProfileMode = 2
T T
ReservoirPressure As Double
T T
Gets/sets the static reservoir pressure
SetDisplayUnitSystem As Long
T T
System = 0 Engineering (DEFAULT), System = 1 SI
ShowAmbientTemperature As Long
T T
(default = 1)
ShowEquilibriumCurvePlot As Long
T T
(default = 1)
ShowEquilibriumCurvePlot As Long
T T
(default = 1)
ShowInjectionPressure As Long
T T
(default = 1)
ShowProductionPressurePlot As Long
T T
(default = 1)
ShowProductionTemperature As Long
T T
(default = 1)
ShowTransferLinesPlot As Long
T T
(default = 1)
ShowValveClosePressure As Long
T T
(default = 1)
ShowValveOpenPressure As Long
T T
(default = 1)
101
PIPESIM 2012.3 Open Link Reference Manual
Watercut As Double
T T
The watercut in %. Required if PressureProfileMode = 3
T T
WellName As String
T T
An optional well description
102
PIPESIM 2012.3 Open Link Reference Manual
obj.AddGasLiftValve5 IPO, 3000, 1950 , psig, 0.013, 0.0169, 0.1250, 1.5, Camco
R20 1/8 Port, 0.865, 800
obj.AddGasLiftValve5 IPO, 4000, 1960 , psig, 0.013, 0.0169, 0.1250, 1.5, Camco
R20 1/8 Port, 0.865, 800
obj.AddGasLiftValve5 IPO, 5000, 1980 , psig, 0.013, 0.0169, 0.1250, 1.5, Camco
R20 1/8 Port, 0.865, 800
obj.AddGasLiftValve5 IPO, 6000, 1990 , psig, 0.013, 0.0169, 0.1250, 1.5, Camco
R20 1/8 Port, 0.865, 800
obj.AddGasLiftValve5 IPO, 7000, 1995 , psig, 0.013, 0.0169, 0.1250, 1.5, Camco
R20 1/8 Port, 0.865, 800
IGLDesign Object
Double)
choke: valve choke
T
Cd: Cd value
T T
103
PIPESIM 2012.3 Open Link Reference Manual
GetCurrentSystem(pIValveSystem As
T Returns the recently calculated IGLValveSystem object
Object)T
GetCurrentValveSystemCount(Valve
T
Returns the count of recently calculated GL valves
Count As Long T
GetDesignBias() As IDesignBias
T T
Returns the IDesignBias object T T
GetDesignParams () As
T
Returns the IDesignParams object T T
IDesignParams T
Cd: Cd value
T T
GetIsUnset(bUnset As Boolean)
T T
Returns True is data is not set and False otherwise
GetProductionPressure(depth As
T
Returns the production pressure
Double) As Double T
GetProductionTemperature(depth
T
Returns the production temperature
As Double) As Double T
GetProjectData(ProjData)
T T
Returns the array of strings containing project data
GetValveSystemCount(ValveCount
T
Returns the count of installed GL valves
As Long) T
GetLastError(errorStr As String)
T T
Returns the last error message
SetCompletionParams(Params)
T T
Sets the completion type as String for report purposes.
String must be passed as Variant type
SetCurrentSystem(pIValveSystem As
T
Sets the IGLValveSystem object
Object)T
104
PIPESIM 2012.3 Open Link Reference Manual
SetFlowCorrsParams(Params)
T T
Sets the flow correlation as String for report purposes. String
must be passed as Variant type
SetFluidParameters(Params)
T T
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)
T
Sets the user interface language
As Boolean T
AddDeviationSurvey(pVar_MDvsTVD
T
Sets user-defined deviation survey
_Points)T
DisplayGasLiftDesign(p_VarUnitMan
T
Pops up the GLDesign GUI.
ager, bCloseOK As Boolean) T
DisplayResults(p_VarUnitManager)
T
Pops up the results of the GL design calculations
As Boolean T
PerformDesign() As Boolean
T T
Runs the engine to perform design
105
PIPESIM 2012.3 Open Link Reference Manual
AmbientTemperature As Double
T T
BottomHoleOffset As Double
T T
DesignInjectionPressure As Double
T T
DesignMethod As String
T T
Can be one of the following: API, IPO-Surface Close, Variable
Gradient, PPO Design
DesignMethod_ As Long
T T
0 for API or IPO-Surface Close,
1 for IPO-Pt Mai/Max,
2 for PPO Design
DesignSpacing As Long
T T
0 for new spacing,
1 for current spacing
EngineFilePath As String
T T
InjGasSpecificGravity As Double
T T
InjGasSurfaceTemperature As
T
Double T
InjPresDropBetweenValves As
T
Double T
InstallCurrentSystem As Boolean
T T
KickoffInjectionPressure As Double
T T
LocatingDPAtValveLocation As
T
Double T
MinimumValveInjDP As Double
T T
MinimumValveSpacing As Double
T T
OperatingProdPressure As Double
T T
PackerDepth As Double
T T
PlotToolPath As String
T T
ProductionPressureCurve As Integer
T T
Production Pressure Curve
0 for Production Pressure Model
1 for Equilibrium Curve
PsmFilePath As String
T T
Recommendations As String
T T
ReservoirDepth As Double
T T
ReservoirPressure As Double
T T
ReservoirTemperature As Double
T T
SurfaceOffset As Double
T T
SurfaceOffsetDP As Double
T T
106
PIPESIM 2012.3 Open Link Reference Manual
SurfaceOffsetType As Boolean
T T
TargetInjGasRate As Double
T T
TransferFactor As Double
T T
TubingName As String
T T
UnloadingGradient As Double
T T
UnloadingProdPressure As Double
T T
ValveLocation As Long
T T
Top Valve location
0 for liquid to surface,
1 for liquid not to surface
ValveManufacturer As String
T T
Valve manufacturer filter value
ValveMinPortSize As Double
T T
Valve min port size filter value
ValveSeries As String
T T
Valve series filter value
ValveType As String
T T
Valve type filter value
ValveNominalOD As Double
T T
Valve size filter value
ValveTemperature As String
T T
Can be one of the following: Production, Ambient, Injection
or Unloading
ValveTemperature_NonTop As Long
T T
Unloading temperature for non-top valve:
0 for Production
1 for Ambient
2 for Injection
3 for Unloading
ValveTemperature_Top As Long
T T
Unloading temperature for top valve:
0 for Production
1 for Ambient
2 for Injection
3 for Unloading
WellAbsorbs As Boolean
T T
IDesignParams Object
BracketingSpacing As Double
T T
BracketingTVD As Double
T T
DesignInjectionPressure As Double
T T
InjGasSpecificGravity As Double
T T
InjGasSurfaceTemperature As
T
107
PIPESIM 2012.3 Open Link Reference Manual
DoubleT
InletPressure As Double
T T
IsBracketingEnabled As Boolean
T T
IsPressureCondition As Boolean
T T
KickoffInjectionPressure As Double
T T
LiquidRate As Double
T T
MinimumValveInjDP As Double
T T
MinimumValveSpacing As Double
T T
MinUnloadingLiqRate As Double
T T
OperatingProdPressure As Double
T T
ReservoirPressure As Double
T T
TargetInjGasRate As Double
T T
UnloadingGradient As Double
T T
UnloadingProdPressure As Double
T T
UseAnnulusGasGradient As Boolean
T T
Specifies usage of static gradient if True and rigorous friction
and elevation DP otherwise
IDesignBias Object
IDesignBias - Properties
BottomOrifCD As Double
T T
Discharge coefficient for orifice
DeltaPtroBottomValve As Double
T T
InjPresDropBetweenValves As
T
DoubleT
IsCalculateInjPresDrop As Boolean
T T
IsPlaceIPOatBottom As Boolean
T T
IsPlaceOrificeatBottom As Boolean
T T
IsTransferFactorBetweenIPandPP As
T
Boolean T
LocatingDPAtValveLocation As
T
DoubleT
TransferFactor As Double
T T
108
PIPESIM 2012.3 Open Link Reference Manual
IGLValveSystem Object
GetGasLiftProps(InjPressure As
T
Returns the GL properties:
Double, MaxAvailableRate As Double, InjPressure – injection pressure
T
Boolean) T
InjTemp – surface injection temperature
T
GetIsUnset(bUnset As Boolean)
T T
Returns True is data is not set and False otherwise
GetLastError(errorStr As String)
T T
Returns the last error message
GetValveCount(lValveCnt As Long)
T T
Returns the count of installed GL valves
SetGasLiftProps(InjPressure As
T T Sets the GL properties:
Double, MaxAvailableRate As Double, InjPressure – injection pressure
T
SetLanguage(nlLanguageID As Long)
T
Sets the user interface language
As Boolean T
109
PIPESIM 2012.3 Open Link Reference Manual
gasrate As Double)
mode: valve type (IPO, PPO, IPS, PPS, Orifice or Dummy)
T
T T T T
nomOD : nominal OD
T T
Cd: Cd value
T T
gasrate
T T
ClearValveSystem()
T T
Removes all installed valves
T T
DisplayGLValveSystem(p_VarUnitMa
T Pops up the GL Valve System GUI
nager, bCloseOK As Boolean) T
BellowsArea(iValveIndx As Long) As
T
Gets bellows area for the valve specified by iValveIndx
T T
Double T
Manufacturer(iValveIndx As Long) As
T
(Read only property)
String
T
MeasuredDepth(iValveIndx As Long)
T
(Read only property)
As Double T
nomOD(iValveIndx As Long) As
T
(Read only property)
Double T
PortArea(iValveIndx As Long) As
T
(Read only property)
Double T
portname(iValveIndx As Long) As
T
(Read only property)
String
T
portsize(iValveIndx As Long) As
T
(Read only property)
Double T
110
PIPESIM 2012.3 Open Link Reference Manual
UseValveDetails As Boolean
T T
ValveCv(iValveIndx As Long) As
T
(Read only property)
Double T
ValveMode(iValveIndx As Long) As
T
(Read only property)
String
T
ValveModeType(iValveIndx As Long)
T (Read only property)
As Long T
Name
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
GetFileCreatorName() As String
T T
Returns the name of the simulator that has been used to
create the performance curves.
Parameters - None
Return Value - A string.
111
PIPESIM 2012.3 Open Link Reference Manual
GetNumberofVariables() As Long
T T
Returns the number of variables (data columns) in the
performance curve.
Parameters - None
Return Value - An integer.
GetUnitofVariable(VariableName As
T
Returns the unit of given the column variable name.
String) As String
T
112
PIPESIM 2012.3 Open Link Reference Manual
GetAllData()
T T
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
T T
Returns the last error message
OpenFile(FilePath As String) As
T
Opens the given performance curves file, and returns a
Boolean T
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
T T
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.
113
PIPESIM 2012.3 Open Link Reference Manual
if (success)
{
// Get the file creator's name
CreatorName = pPerCur->GetFileCreatorName();
114
PIPESIM 2012.3 Open Link Reference Manual
ist = sa1->rgsabound[0].lLbound;
// Get upper bound of vaData, should be equal to NoSets
ied = sa1->rgsabound[0].cElements;
for (i=ist; i<=ied; i++)
{
index = i;
SafeArrayGetElement(sa1, &index, &va1);
if (va1.vt != VT_EMPTY)
{
sa2 = va1.parray;
// Get lower bound of vatmp, should be zero
jst = sa2->rgsabound[0].lLbound;
// Get upper bound of vatmp, should be equal
// to number of data points per data set plus one (legend)
jed = sa2->rgsabound[0].cElements;
for (j=jst; j<=jed; j++)
{
index = j;
SafeArrayGetElement(sa2, &index, &va2);
}
}
}
}
115
PIPESIM 2012.3 Open Link Reference Manual
PerformCurve Object
GetAllVariables()
T T
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
T
Returns a String (as Variant) containing plotting attributes
As String)
T
for the specified variable
GetAxisBoundaries()
T T
Returns a Variant type containing two-dimensional array of
the low/upper boundaries for the plot variables.
116
PIPESIM 2012.3 Open Link Reference Manual
GetBubblePointData()
T T
Returns (as Variant type) the array of three doubles values
for saturation pressure, saturation temperature and
saturation GOR. (Black oil models only.)
GetColumnVariableDataAt(VarName
T
Returns a Variant type containing two-dimensional array of
As String)T
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()
T T
GetConeGasSG() As Double
T T
Returns a Double value (wrapped into Variant type) of cone
gas specific gravity
GetCreationDate()
T T
Returns a String value (wrapped into Variant type) of curve
file date/time stamp
GetCurrentModelUnitSettings()
T T
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
T T
Returns an index for X axis variable
GetDefaultYAxis() As Long
T T
Returns an index for Y axis variable
GetDynamicPlotFileName() As String
T T
Returns a curve file name (short form)
GetDynamicPlotLongFileName() As
T
Returns a curve file name (long form)
StringT
GetFileFormatStatus() As String
T T
Return a String New if curve file has new format, otherwise
return value is Old
GetLastError() As String
T T
Returns the last error message produced by the interface.
GetMultipleColumnsDataAt(Index)
T T
Returns data similar to GetAllVariables function but for
T
GetNoOfDataColumn() As Long
T T
Returns the total number of variables in curve file
GetNumberOfCases() As Long
T T
Returns the number of cases in curve file
GetPhysicalPropertyData()
T T
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() ()
T T
Returns (as Variant type) the array of 2 doubles values for
Well PI and static reservoir pressure
GetSimulatorName() As String
T T
Returns String with the simulator name
GetTitle() As String
T T
Returns String with the project description
117
PIPESIM 2012.3 Open Link Reference Manual
GetUnitDetailsAt(VariableName As
T
Returns (as Variant type) the array of 5 Variants containing
String) T
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
T
Returns String with the current units for the specified
As String) As String
T
variable
GetUnitType() As String
T T
Returns String ENG or S depending on unit system user
selected for the output files
GetUserName() As String
T T
Returns String with the user name form project properties
GetVarableNamesList()
T T
Returns (as Variant type) the array of Strings containing all
variables names from curve file
GetVariableDataAt(ColName As
T
Returns (as Variant type) the array of Doubles containing all
String) T
values for the specified variable
GetVariableDataAtCase(VarName As
T
Similar to GetVariableDataAt but returned values are for
T
GetVariableNameAt(Index As Long) As Returns String with the variable name at specified index
T
String
T
(1-based)
GetViscosityData()
T T
Returns (as Variant type) the array of 4 doubles values for
temperatures and viscosities
OpenFile(FilePath As String) As
T
Opens the given performance curves file, and returns a
Boolean T
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
T T
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
T T
Returns True if the curve file is open and False otherwise
118
PIPESIM 2012.3 Open Link Reference Manual
PNSReaderCOM
PNSREADER.DLL includes COM compatible interfaces that can be used to read output from the output file
T T
Supported Interfaces
IPNSCom, IPNSCom2, IPNSCom3: for network models and single branch operations.
Dependency MAP
ReadPnsFile
T T
Read a Net engine (.PNS) output file
Params BSTR FileName - Full path of net engine file (.PNS)
GetNodeCount
T T
Get total number of nodes; that is number of junctions + wells
+ source + sinks + internal + equipment
params (#) int *iNodeCount
GetBranchCount
T T
Get total number of branches (that is excluding wells which
engine treats as branch + source/sink)
params (#) int - *BranchCount
GetWellCount
T T
Get total number of wells; that is injection wells + production
wells
GetNodeData
T T
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,
T
Fill a supplied SAFEARRAY (blob) with node data for i'th
GetBranchInData
T T
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
119
PIPESIM 2012.3 Open Link Reference Manual
GetNodeName
T T
name of the i'th node in the array
params int iNode - index in array
(#) BSTR *sName - name of iNode'th element
GetNodeIndex
T T
index of the node in the array
params BSTR *sName - name of the node
(#) int iNode - index in array
GetNodeType
T T
Get Network node type
params int iNode - index in array
(#) BSTR* sName - Source, Sink, Well, Junction
GetBranchName
T T
name of the i'th branch in the array
params int iBranch - index in array
(#) BSTR *sName - name of iBranch'th element
GetBranchIndex
T T
index of the branch in the array
params BSTR *sName - name of the branch
(#) int iBranch - index in array
GetWellName
T T
name of the i'th well in the array
params int iWell - index in array
(#) BSTR *sName - name of iWell'th element
GetWellIndex
T T
index of the well in the array
params BSTR *sName - name of the well
(#) int iWell - index in array
120
PIPESIM 2012.3 Open Link Reference Manual
GetNodeVariableValue,
T T
Gets value of variable type for i'th element of array
GetBranchOutVariableValue,
T T
params int iNode/iBranch/iWell - index of element in the array
GetBranchInVariableValue
T T
(#) double *dValue - value requested. 6 - Baker Jardine COM
documentation
GetWellOutVariableValue
T T
PIPESIM
GetWellInVariableValue
T T
121
PIPESIM 2012.3 Open Link Reference Manual
GetNodeStrVariableValue,
T T
Gets value of variable type Gas Rate, glr etc. for named
GetBranchInStrVariableValue,
T T
element of array
Params BSTR sName - Object identifier (name) for example,
GetBranchOutStrVariableValue,
T
Well_1
GetWellInStrVariableValue,
(#) double *dValue - value requested
GetWellOutStrVariableValue
BSTR sType - GasRate, LiquidRate, MassRate, pressure,
Temperature, PressureResidual, RateResidual, GLR, LGR,
Water Cut, Max Pres, Comp Power, Choke DP
GetModelStatus
T T
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 '
GetBranchOutVariableValue2(iNode
T
This function works the way similar to
as Long, sType as String)
T
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).
122
PIPESIM 2012.3 Open Link Reference Manual
GetCaseVariableValue(iCase as int,
T
sPropName as String) T
GetBranchGlobalVariableValue(iBranch
T
These functions work the way similar to
as int, sPropName as string) GetBranchInVariableValue function and gets requested
GetSBranchGlobalVariableValue(iBranch value of variable type.
T
MaxPressure
BranchTemperatureDrop
GetBranchGlobalStrVariableValue
T
These functions work the way similar to
(sBranch as string, sType as string) GetBranchGlobalVariableValue function and gets
GetWellGlobalStrVariableValue (sWell
T
requested value of variable type.
as string, sType as string) sBranch or sWell is the object name.
sType parameter can have following values:
BranchPressureDrop
MaxPressure
BranchTemperatureDrop
GetBranchGlobalVariableStrValue
T
These functions work the way similar to
(iBranch as int, sType as string) as string GetBranchGlobalVariableValue function and gets
GetBranchGlobalStrVariableStrValue
T
requested value of string variable type.
(sBranch as string, sType as string) as iBranch is the branch index;
string sBranch is the branch name;
sType parameter can have following value(s):
FlowDirection
123
PIPESIM 2012.3 Open Link Reference Manual
BSTR ss = pPNS->GetModelStatus();
for ( int i = 0 ; i < iNumNodes; i++)
{
BSTR Name = pPNS->GetNodeName(i);
BSTR sNodeType= pPNS->GetNodeType( i );
dVal = pPNS->GetNodeVariableValue( i, Pressure);
if( dVal != Unset() ) // = -7777
{
dVal = pPNS->GetNodeVariableValue( i, Temperature);
dVal = pPNS->GetNodeVariableValue( i, MassRate);
dVal = pPNS->GetNodeVariableValue( i, LiquidRate);
dVal = pPNS->GetNodeVariableValue( i, GasRate);
dVal = pPNS->GetNodeVariableValue( i, GLR);
dVal = pPNS->GetNodeVariableValue( i, Water Cut);
}
int start = iNumNodes + 2;
// Branches
for ( int j = 0; j <= 1; j ++ )
{
for ( i = 0; i < iNumBranches; i++ )
{
BSTR sName = pPNS->GetBranchName( i );
if ( j != 1 )
{
dVal = pPNS->GetBranchInVariableValue( i, Pressure);
dVal2 = pPNS->GetBranchOutVariableValue( i, Pressure);
dVal = pPNS->GetBranchInVariableValue( i, Temperature);
dVal = pPNS->GetBranchInVariableValue( i, MassRate);
dVal = pPNS->GetBranchInVariableValue( i, LiquidRate);
dVal = pPNS->GetBranchInVariableValue( i, GasRate);
dVal = pPNS->GetBranchInVariableValue( i, GLR);
dVal = pPNS->GetBranchInVariableValue( i, Water Cut);
dVal = pPNS->GetBranchInVariableValue( i, Max Pres);
dVal = pPNS->GetBranchInVariableValue( i, Comp Power);
dVal = pPNS->GetBranchInVariableValue( i, Choke DP);
}
else
{
dVal = pPNS->GetBranchOutVariableValue( i, Pressure);
dVal2 = pPNS->GetBranchInVariableValue( i, Pressure);
dVal = pPNS->GetBranchOutVariableValue( i, Temperature);
dVal = pPNS->GetBranchOutVariableValue( i, MassRate);
dVal = pPNS->GetBranchOutVariableValue( i, LiquidRate);
dVal = pPNS->GetBranchOutVariableValue( i, GasRate);
dVal = pPNS->GetBranchOutVariableValue( i, GLR);
dVal = pPNS->GetBranchOutVariableValue( i, Water Cut);.
124
PIPESIM 2012.3 Open Link Reference Manual
filename = Range(MODELFILE)
pos = InStr(1, filename, .bpn, 1)
If (pos > 0) Then
filename = Left(filename, pos)
filename = filename + pns
End If
125
PIPESIM 2012.3 Open Link Reference Manual
If (PnsReader.ReadPnsFile(filename)) Then
Set r = Range(SOURCE_RANGE)
Dim col
col = 1
Set r1 = Range(OUTINJGAS_RANGE2)
r1.ClearContents
Set r2 = Range(OUTFLOWRATE_RANGE2)
r2.ClearContents
End If
126
PIPESIM 2012.3 Open Link Reference Manual
'--------------------------------------------------------
'Get the pressure profiles ------------------------------
plcfile = Range(MODELFILE)
tempfile = plcfile
Do
pos = InStr(1, tempfile, \, 1)
tempfile = Right(tempfile, Len(tempfile) - pos)
Loop While pos > 0
If (PltReaderObj.OpenWellFile(plcfile)) Then
Lower = LBound(distance(0), 1)
Upper = UBound(distance(0), 1)
r1.Cells(i + 1) = distance(0)(i)
Next
LowerO = LBound(distance(0), 1)
UpperO = UBound(distance(0), 1)
Next
PltReaderObj.CloseWellFile
127
PIPESIM 2012.3 Open Link Reference Manual
End If
End If
col = col + 1
Next
End If
End Sub
Name
Jones: To fit and visualise the IPR curve for a given number of data points according to the Jones' equation:
Dependency MAP
GetJonesAandBConstants ([out]
T T
a: the value of the A parameter in the Jones equation
double * a, [out] BSTR * a_unit, a_unit: the unit string for the A parameter
[out] double * b, [out] BSTR *
b: the value of the B parameter in the Jones equation
b_unit)
b_unit: the unit string for the B parameter
128
PIPESIM 2012.3 Open Link Reference Manual
AddFlowrateAndPwfPoint ([in]
T T
frate: flowrate value (double)
double frate, [in] BSTR frate_unit, frate_unit: unit string for the flowrate value. Any of:
[in] double pwf, [in] BSTR
STB/d, sm3/d for Liquid Rates OR: mmscf/d mscf/d, scf/d,
pwf_unit)
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.
AddFlowrateAndPwfData ([in]
T T
ftype: fluid type, type_liquid = 0, type_gas = 1
short ftype, [in] BSTR frate_unit, frate_unit: unit string for the flowrate value. Any of: STB/d,
[in] BSTR pwf_unit, [in] BSTR sm3/d for Liquid Rates OR: mmscf/d mscf/d, scf/d, mmsm3/d,
Legend, [in] VARIANT * vData, [in] msm3/d, sm3/d for gas rates
const unsigned long pType)
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)
T T
ftype: fluid type, type_liquid = 0, type_gas = 1
SetStaticPressure ([in] double
T T Pres: static pressure value
pres, [in] BSTR unitStr) UnitStr: units for the pressure value. Any of: psia psig, bara,
barg, atma, atmg, kPa a, kPa g, kg/cm2 a, kg/cm2 g
SetJonesAConstant ([in] double
T T
val: the A parameter in the Jones equation
val, [in] short unitSystem) 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
T T val: the B parameter in the Jones equation
val, [in] short unitSystem) 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
129
PIPESIM 2012.3 Open Link Reference Manual
DoCalculateConstants ()
T T
Calculates the A and B parameters based on the given data:
static reservoir pressure and {pwf, flowrate} points
ShowInflowPerformanceDlg ()
T T
Displays the IPR COM graphical interface
pws = 4000.0
pws_unit = 'psia'
JonesObj.SetStaticPressure pws, pws_unit
' Display graphical interface to show the fitted curve and calculated constants
130
PIPESIM 2012.3 Open Link Reference Manual
JonesObj.ShowInflowPerformanceDlg
Units Library
IUnitSystem Interface
Note: See Unit System for the available quantity names and unit strings.
X X
Convert
T T
Converts in_value to [out_value, out_unit] given the
[in] BSTR quantity_name, [in] in_value’s conversion factor and adder to convert it to its
double in_value, [in] double strict SI unit. Returns out_value in the given out_unit
factor_to_SI, [in] double
adder_to_SI, [in] BSTR out_unit,
[out, retval] double * out_value
Convert_SI
T T
Converts a given quantity in strict SI units to the given
[in] BSTR quantity name, [in] out_unit
double si_value, [in] BSTR out_unit,
[out, retval] double * out_value
ConvertAny
T T
Converts a quantity given as [in_value, in_units] to an
[in] BSTR quantity_name, [in] out_unit
double in_value, [in] BSTR in_unit,
[in] BSTR out_unit, [out, retval]
double * out_value
ConvertStrictSIToCurrentUnits
T T Converts a quantity given as [value] in strict SI to an out_unit
[in] BSTR quantity_name, [in] defined according to the units file imported
double value, [in] BSTR out_unit, using ImportUnitFile. By default it will be Eng units if no unit
T T
131
PIPESIM 2012.3 Open Link Reference Manual
bShowFileOptions, [in]
VARIANT_BOOL
bShowDeaultOptions, [out]
VARIANT * pVar
GetDefEngUnitString
T T
Returns the default engineering unit string for a given
[in] BSTR quantity name, [out, quantity.
retval] BSTR * unit string
GetDefSIUnitString
T T
Returns the default SI unit string for a given quantity.
[in] BSTR quantity_name, [out,
retval] BSTR * unit_string
GetLastError
T T
Returns an error description. This method should be called
[out, retval] BSTR * ErrorStr immediately after a function has returned an error code.
GetStrictSIUnitString
T T
Returns the strict SI unit string for a given quantity.
[in] BSTR quantity name, [out,
retval] BSTR * unit_string
GetUnitStrings
T T
Returns an array of unit strings defined for the given quantity.
[in] BSTR quantity name, [out]
VARIANT * pVar
GetUnknownValue
T T
Returns PIPESIM’s definition of ‘unset’ or ‘unknown’ value.
[out, retval] double *pVal
ImportUnitFile [in] BSTR filename
T T
Imports a saved units file (saved by default with a .unf
extension)
IReal Interface
UnitClass
T T
Gets/sets unit class name
string
SetRealValue
T T
Sets a Value in the specified unit string
[in] double Value, [in] BSTR Unit
GetRealVal
T T Returns a value in the units corresponding to pUnit
[out] double * pValue, [out] BSTR
* pUnit
SetSelectedUnit
T T
Selects the given unit string
[in] BSTR UnitStr, [out, retval]
VARIANT_BOOL
GetSelectedUnit
T T
Returns the selected unit string
[out, retval] BSTR * UnitStr
GetDefEngValue
T T
Returns the value in default engineering units
[out, retval] double * Val
GetStrictSIValue
T T
Returns the value in strict SI units
GetUserValue
T T
Returns the value in user selected units
SetStrictSIValue
T T
Sets a Value in strict SI units
132
PIPESIM 2012.3 Open Link Reference Manual
Reservoir Table
Name
RESTABLELib.IResTableOp: To output VFP tables for external reservoir simulators. The output files are
<filename>.VFP<PROD|INJ>.<BHP|TEMP>.<tabnum>.txt ,
Note: The Injection well or Temerature VFP table options are only available for ELICPSE simulator.
133
PIPESIM 2012.3 Open Link Reference Manual
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.
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
134
PIPESIM 2012.3 Open Link Reference Manual
Sub RunVFPBatch()
135
PIPESIM 2012.3 Open Link Reference Manual
136
PIPESIM 2012.3 Open Link Reference Manual
137
PIPESIM 2012.3 Open Link Reference Manual
Object Properties
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
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)
138
PIPESIM 2012.3 Open Link Reference Manual
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 C Constant C
BACKPRESSURE N Slope n
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
Enter only reservoir permeability or detailed user
PSEUDOSS ENTERPERM defined table (0 for user defined table, 1 for only
reservoir permeability)
PSEUDOSS DEFRADIUS Use Drainage radius (if set)
PSEUDOSS DRAINRADIUS Drainage radius
139
PIPESIM 2012.3 Open Link Reference Manual
140
PIPESIM 2012.3 Open Link Reference Manual
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
TRANSIENTIPR IPRBASIS Fluid type for the model (see Fluid Types)
TRANSIENTIPR USEPSEUDOPRES Use pseudo pressure method (for gas)
141
PIPESIM 2012.3 Open Link Reference Manual
142
PIPESIM 2012.3 Open Link Reference Manual
FCV properties
143
PIPESIM 2012.3 Open Link Reference Manual
144
PIPESIM 2012.3 Open Link Reference Manual
Common properties
145
PIPESIM 2012.3 Open Link Reference Manual
Choke properties
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)
146
PIPESIM 2012.3 Open Link Reference Manual
ESP properties
147
PIPESIM 2012.3 Open Link Reference Manual
PCP properties
148
PIPESIM 2012.3 Open Link Reference Manual
149
PIPESIM 2012.3 Open Link Reference Manual
Injector properties
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)
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
150
PIPESIM 2012.3 Open Link Reference Manual
151
PIPESIM 2012.3 Open Link Reference Manual
Pump properties
152
PIPESIM 2012.3 Open Link Reference Manual
153
PIPESIM 2012.3 Open Link Reference Manual
Separator properties
SEPARATOR MD Separator MD
EFFICIENCY Efficiency
TYPE Type (see Separator Types)
SSSV properties
154
PIPESIM 2012.3 Open Link Reference Manual
GLVALVE properties
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
155
PIPESIM 2012.3 Open Link Reference Manual
VERTICAL LENGTH the change in elevation between the start and the end
of the wellbore
HORIZONTAL LENGTH the horizontal distance covered by the complete
wellbore
HEIGHT UNDULATIONS An artificial factor that can be used to automatically
introduce some undulations into the wellbore. The
value entered is the total change in elevation for every
1,000 units
PIPE FLOWTYPE Flow type (see Pipe Flow Types)
PIPE ID Inner diameter
PIPE WT Wall thickness
PIPE ROUGHNESS Roughness
PIPE AMB TEMPERATURE Ambient temperature
156
PIPESIM 2012.3 Open Link Reference Manual
Generic Source
Artificial Lift
0 No artificial lift
1 Gas lift injection
2 ESP
Completion Options
0 None
1 Open hole
2 Perforated
3 Gravel packed and perforated
4 Open hole gravel pack
5 Frac pack
Engine Keywords
157
PIPESIM 2012.3 Open Link Reference Manual
0 Well PI
1 Vogel
2 Fetkovitch
3 Jones
4 BackPressure
5 PseudoSteadyState
6 Forchheimer
7 Hydraulic Fracture
8 Transient
0 Joshi (Oil)
1 Joshi (Gas)
2 Babu & Odeh (Oil)
3 Babu & Odeh (Gas)
4 Distributed PI
0 Distributed PI
1 Single Point PI
Fluid Types
0 Liquid Rate
1 Gas Rate
2 Mass Rate
158
PIPESIM 2012.3 Open Link Reference Manual
0 Tubing
1 Annular
2 Tubing+Annular
Rate Types
0 GLR
1 GOR
2 LGR
3 OGR
Separator Types
0 Liquid
1 Gas
2 Water
-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
159
PIPESIM 2012.3 Open Link Reference Manual
Equations of State
Viscosity Types
0 Pedersen
1 LBC
243 Aasberg-Petersen
541 NIST
BIP Sets
0 OilGas3
1 OilGas2
2 OilGas1
3 OilGas4
4 User BIPs
221 Eclipse 300 default
321 DBR default
421 GERG default
160
PIPESIM 2012.3 Open Link Reference Manual
Emulsion Types
-1 None
0 Molarity (Moles)
1 WGR (bbl/mmscf)
2 Volume Ratio
3 Mass (lb)
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 ft2 *. m2 ^!, acres, mi2, ha, km2
SURFACE
COMPRESS COMPRESSIBILITY 1/psia *,
COMPRESSIBILITY 1/bara ^,
1/Pa !
161
PIPESIM 2012.3 Open Link Reference Manual
162
PIPESIM 2012.3 Open Link Reference Manual
163
PIPESIM 2012.3 Open Link Reference Manual
(LIQ)
LIQRATERECIP STD VOLUME 1/STB/d, 1/sm3/d, 1/sm3/s
LIQUID RATE
(RECIPROCAL)
MASS MASS Lb *, Kg! ^
MASSRATE FLOWRATE MASS lb/s *,
BASIS lb/h, kg/s! ^, kg/h,
MOLARVOLUME SPECIFIC VOLUME ft3/mol *,
MOLE m3/mol! ^
OGR VOLUME PER STB/mmscf *,
LGR VOLUME (LGR) sm3/mmsm3 ^, sm3/msm3, sm3/1.E4sm3, m3/E3m3,
sm3/sm3!
PERMEABILITY PERMEABILITY Md *^,
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 PRESSURE psi/ft *,
PRESSUREGRADIENT GRADIENT bar/m ^, atm/m, kPa/m, kg/cm2,
Pa/m!
ROTVELOCITY FREQUENCY Hz *! ^
FREQUENCY Rpm,
SHOTS PER LENGTH Shots/ft *,
Shots/m! ^
SURFTENSION SURFACE TENSION Dyne/cm *,
SURFACETENSION N/m! ^
TEMPERATURE TEMPERATURE F *,
C! ^, K, R,
TIME TIME Hr *^,
Min, s!, days, years
U HEAT TRANSFER Btu/hr/ft2/F *,
HEATTRANSFERCOEFFICIE COEFFICIENT W/m2/K! ^
164
PIPESIM 2012.3 Open Link Reference Manual
NT
VELOCITY VELOCITY ft/s *,
m/s! ^
VISCOSITY VISCOSITY Cp *^
DYNAMIC Ns/m2 ! , lb/s/ft,
VOLFRAC VOLUME PER STD Bbl/mmscf *,
VOLUMEFRACTION VOLUME M3/mmsm3 ^, m3/sm3!
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.
165
PIPESIM 2012.3 Open Link 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
166
PIPESIM 2012.3 Open Link 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.
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 = Cells(11,4).value
If TmpAmb = then
Exit Sub
End If
This assigns the value located in the cell cells(11,4) to the Integer variables TempAmb.
Step 3:
PathTemplate = cells(8,1)
If PathTemplate = Then
Exit Sub
End If
Assign the template path specified by the user in the spreadsheet to the variable PathTemplate.
Step 4:
T
Path = Cells(9,1).Value
If Path = Then
Exit Sub
End If
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 = ActiveCell.Row
cases = Selection.Rows.Count
lastcase = 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.
167
PIPESIM 2012.3 Open Link Reference Manual
Loop Steps
Step 6:
For n = case1 to lastcase
This statement initiates a loop that will be executed from the value case1 to the value last case.
Step 7:
Obj.OpenModel PathTemplate
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.
168
PIPESIM 2012.3 Open Link Reference Manual
Step 8:
Bo.GasSg = Cells(n,5)
…
…
…
…
Obj.BlackOil =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.
169
PIPESIM 2012.3 Open Link Reference Manual
Step 9,10,11,12:
These statements fill the different GUI (Graphical User Interface) objects making up the
SingleBranchObject (that is the completion object, the tubing object, the choke object and the flow line
object).
Assigns the value 0.5 to the wall thickness of the tubing object of Template.bps.
Obj.SetPropertyVal name of the object(string), name of the field in the object(string), value to be
assigned to that field(double), Units to be used(string)
saves the model Template.bps under a new name in the folder specified in the string variable Path.
170