Open Link Reference Manual
Open Link Reference Manual
Version 2011.1
PIPESIMVersion2011.1OpenLinkReferenceManual
Contents
Overview ....................................................................................................................... 7
Modules and Interfaces .............................................................................................. 8
Quick Start Tutorial .................................................................................................... 10
Case Study 1 Building a Well Model from Excel ...................................................... 15
Problem Outline ....................................................................................................... 15
Requirements .......................................................................................................... 15
Procedure ................................................................................................................ 15
Step by step tutorial ................................................................................................. 16
Case Study 2 - Nodal Analysis .................................................................................... 28
Problem Outline ....................................................................................................... 28
Requirements .......................................................................................................... 28
Procedure ................................................................................................................ 28
Step by Step Tutorial ............................................................................................... 29
Modules and Interfaces .............................................................................................. 35
ISingleBranchModel Interface ................................................................................... 36
IObjectProperties Interface....................................................................................... 43
ITubing Interface ..................................................................................................... 44
IVertCompObj Interface ........................................................................................... 47
IFlowlineObj Interface .............................................................................................. 48
IHeatTransfer Interface ............................................................................................ 49
IFluid Interface ........................................................................................................ 50
IProjectInfo Interface ............................................................................................... 51
IErosionCorrosion Interface ...................................................................................... 51
INetModel Interface ................................................................................................. 53
ModelBuilder object ................................................................................................. 60
IBlackOil object........................................................................................................ 60
ISinglePointCalib object ............................................................................................ 62
IMultiPointCalib object.............................................................................................. 63
IViscosityData object ................................................................................................ 65
IThermal object ....................................................................................................... 67
Page 3
PIPESIMVersion2011.1OpenLinkReferenceManual
ICompositional object............................................................................................... 68
ICompositional2 object ............................................................................................. 72
FlowCorrelations Interface ........................................................................................ 72
ICFlowCorrelations2 Interface ................................................................................... 74
Single Branch Operations ......................................................................................... 74
Systems Analysis ..................................................................................................... 74
Pressure and Temperature Profiles ............................................................................ 77
Flow Correlation Comparison .................................................................................... 79
Data Matching ......................................................................................................... 80
Nodal Analysis ......................................................................................................... 82
Wax Deposition ....................................................................................................... 85
Gas Lift Rate vs Casing Head Pressure ...................................................................... 86
Single Branch Operations: Supporting Interfaces ....................................................... 88
IBoundaryProps Interface ......................................................................................... 88
IEngineOptions Interface .......................................................................................... 89
IFactorRange Interface ............................................................................................ 89
Gas Lift Diagnostics COM Object ............................................................................... 90
GLWell Interface and Object ..................................................................................... 90
IGLDesign Object ..................................................................................................... 98
IDesignParams Object ............................................................................................ 102
IDesignBias Object ................................................................................................. 103
IGLValveSystem Object .......................................................................................... 104
Single Branch Output Reader COM .......................................................................... 106
PerformCurve Object .............................................................................................. 111
PNSReaderCOM ..................................................................................................... 114
Inflow Performance Calculator COM ........................................................................ 123
Units Library .......................................................................................................... 125
Reservoir Table...................................................................................................... 127
Defined constants and strings .................................................................................. 132
Object Type Identifiers ........................................................................................... 132
Object Properties ................................................................................................... 133
Tubing objects properties ...................................................................................... 140
Generic Source ...................................................................................................... 147
Page 4
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 5
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 6
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Overview
ThisguideexplainshowtouseOpenLinktointerfacewithPIPESIMfromexternalapplications.
AnoverviewofthefunctionalityofOpenLinkisprovided,alongwiththenecessaryinterfacefunctionsand
arguments.ThisallowsyoutoloadbothnetworkandsinglebranchPIPESIMmodels,querythem
(equipmentconfiguration,gasliftinjection,etc.),andperformsimulations.
Basic Functions
Thefunctionsdescribedinthisdocumentfallintothefollowingcategories;
GetfunctionsGettheresultsafterasimulationorqueryanitemforitscurrentdatavalue,suchas
obtainingthechokebeansize.
SetfunctionsSetavalvetobeusedinsubsequentsimulation,suchassettingthereservoirpressure.
OperationfunctionsPerformanoperationonamodel,suchasrunningasimulation.
Potential Usage
TheOpenLinkfunctionalitycanbeusedinthefollowingcases:
RunningPIPESIMinbatchmodewithanumberofscenarios.
Creatingcustomreports.
Importingproductiondatafromadatabaseandpopulatingthemodels.
RunningPIPESIMinconjunctionwithotherEngineeringapplications.Hyprotechhavealreadyusedthis
functionalitytolinkHysysandPIPESIM.
TheOpenLinkfunctionscanbecalledfromanyofthefollowing:
VBAmacro.ThiscouldbewritteninExcel,Access,etc.
VisualBasicprograms.
C++programs
Supported Interfaces
INetModel:fornetworkmodelsandnetworkoperations
ISingleBranchModel:forsinglebranchmodelsandoperations
Dependency MAP
OpenLinkcanbeusedtoaccessPIPESIMfunctionalityfromexternalprograms.Theprogramsthatcan
automatePIPESIMsimulationsarethosethataredefinedasautomationclientsaccordingtoMicrosoft
standards,andinthesameway,OpenLinkisanautomationserver.Typicalexamplesofautomationclients
includeVBA(VisualBasicforApplications)macros,whichcanbewrittenfromprogramssuchasExcelor
Access,C++andVisualBasic.OpenLinkprovidesthereforeanopenarchitecturewhereyoucontroland
Page 7
PIPESIMVersion2011.1OpenLinkReferenceManual
automatePIPESIMsimulationmodelsthroughcustomprogramsormacroswithouthavingtomanually
enterthedataorviewtheresultsusingthegraphicalinterface.Itisassumedyouarefamiliarwithboth
PIPESIMandthechosenprogramorprogramminglanguageinwhichtheautomationcodeistobewritten.
ThosenewtoVBAarerecommendedtocloselyfollowtheQuickStartTutorialandtheCaseStudies.
TheOpenLinkfunctionalityisdistributedwiththePIPESIMinstallationandisincludedinanumberoflibrary
files.
ThemainfileisNet32COM.DLL,whichnormallyresidesintheprogramsdirectoryandprovidesthe
frameworkandmainentrypointsintobothnetworksandsinglebranchsimulationmodels.
Net32COM.DLLmustbecopiedtothePIPESIMprogramsdirectoryandregistered.
ThereareotherfilesthatsupportNet32COM,forinstanceFluidModelCOM.DLLand
FlowCorrelationCOM,whichprovideaccesstopropertiesdefinedinthefluidmodelsandflow
correlationsrespectively.
Eachlibraryfile,inturn,definesatleastoneinterface,whichisalogicalentrypointintoawelldefined
areaoffunctionality.Eachinterfaceincludesanumberofpublicaccessfunctionsthatsetorgeta
specifiedpropertyorjustperformoperations(thatisrunasimulation).Asanexamplethe
FluidModelCOMlibrarydefinestwointerfaces:IBlackOil,forblackoilmodelsandICompositional,to
dealwithcompositionalmodels.IBlackOildefinespropertyfunctionssuchasAPI,WatercutorGasSG.
Thesepropertiescanbeset(assigned)toamodelpriortoasimulationrunortheycanbeget
(retrieved)andcopiedintoanExcelcell.
TheModulesandInterfacessectionliststhemodulesandinterfacesthatarepartofOpenLink.This
documentcontainsfurtherdetailsofthemodulesandinterfaces,togetherwithsomecodesamples.
Highlighteditemsrepresentinformationthatisnew,previouslyunpublishedoramendedfromtheprevious
PIPESIMrelease.Thepresentreferenceguideappliestothereleaseversion2010.
Interfaces
Remarks
Net32COM.DLL
INetModel
Networkmodelsandoperations
ISingleBranchModel
Singlebranchmodelsandoperations
IISingleBranchModel2
IObjectProperties
Genericequipmentproperties
TubingObj
Tubingspecificpropertiesandoperations
InjectorObj
Injectorspecificproperties
VertCompObj
Verticalcompletionspecificproperties
FlowlineObj
Flowlinespecificpropertiesandoperations
ErosionCorrosion
Erosionandcorrosionsettings
HeatTransfer
Heattransferproperties
IISystemsAnalysis
SystemsAnalysisoperation
IIPTProfile
Pressure/TempProfilesoperation
IICorrMatching
FlowCorrelationMatchingoperation
PSOpSystems.DLL
Page 8
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Module Name
Interfaces
Remarks
NodalOp.DLL
IINodalAnal
NodalAnalysisOperation
FluidModelCOM.DLL
IBlackOil
BlackOilmodelproperties
ICompositional
Compositionalmodelproperties
SinglePointCalib
BOsinglepointcalibrationproperties
MultiPointCalib
BOmultipointcalibrationproperties
ViscosityData
BOviscosityproperties
Thermal
BOthermalproperties
FlowCorrelationCOM.
DLL
CIFlowCorrelation
Verticalandhorizontalflowcorrelationproperties
UnitsCOM.DLL
IUnitSystem
Generalunitconversions
GLDiagn.DLL
GLWell
Gasliftedwellmodelfordiagnostics
WaxOp.DLL
IWaxOp
Waxdepositionoperation
DataMatching.DLL
IDataMatchingOp
Datamatchingoperation
QgiChpOp.dll.DLL
IPlotQgiVsChp
GasLiftRatevsCasingHeadPressureoperation
ICIFlowCorrelation2
Page 9
PIPESIMVersion2011.1OpenLinkReferenceManual
2. ScrolldownthelistofavailablereferencesuntilyoufindtheNet32COM1.0TypeLibrary.Checkthebox
totheleftofthereference.
3. NowdothesamefortheFluidModelCOM1.0TypeLibraryandforPNSReader1.0typelibrary.
4. ClickonOKtoclosetheReferenceswindow.
Page 10
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
1. Loadtheexistingnetworkmodel:SmallNetwork.bpn,whichisshippedwiththePIPESIMinstallation
andnormallylocatedin:
C:\Program Files\Schlumberger\PIPESIM\Case Studies\Network Analysis\Small
Network\
IfthemodelwereopenedfromthePIPESIMgraphicalinterfaceitwouldlooklikethepicturebelow:
2. UsingtheVisualBasiceditor(youcanquicklyopenitfromExcelusingtheshortcutAlt+F11)createa
variableofthetypeINetModeltoperformthebasicinteractionwiththenetworkmodel.Wewillcallit
NetModel:
Dim NetModel As New NET32COMLib.INetModel
3. Openthemodel:
4. Runthemodel(asynchronously):
Page 11
PIPESIMVersion2011.1OpenLinkReferenceManual
Thefirstargument,inthiscaseFalse,tellsthecalculationenginenottousearestartfileandthe
secondargumentBisanengineswitchthatinstructstheenginetoruninbatchmode.Formore
informationonenginecommandspleaserefertothePIPESIMhelp.
Whenexecutingthismacroyoushouldseethecalculationenginerunninginthebackground.This
processisrunasynchronouslywhichmeansthatthemacrowillcontinueitsexecutionwithoutwaiting
forthesimulationruntofinish.
Ifyouwantyourmacrotostopuntiltheengineterminatesinorderto,say,displayaresult,thenyou
canreplacethelineabovebythefollowingcode:
Thiscodewillrunthesimulationsynchronously.Itstartsthesimulationandthenwaitsuntilitis
finished.ItcheckseveryonesecondfortheenginestatusthroughacalltoGetIsModelRunning.When
GetIsModelRunningitreturnsFalseindicatingthatthesimulationrunisfinished,themacrocode
displaysamessagebox.
Getting results
Wewouldliketodisplaysomeresultsfromthesimulation.Thelibrarythatreadstheresultsfileis
PNSReaderandwemustcreateavariableofthetypePNSCominordertoextractdatafromthesimulation
output.ThepublicaccessfunctionsavailableinPNSReaderaredetailedinPNSReaderCOM.
1. CreateaPNSComvariable,letscallitresults:
Dim results As New PNSREADERLib.PNSCom
2. Readtheresultsfile.Thisfileislocatedinthesamedirectoryasthemodelfileandhasthesamefile
namebutwiththeextension.pns:
results.ReadPnsFile(C:\Program Files\Schlumberger\PIPESIM\Case
Studies\Network Analysis\Small Network\Small Network.pns)
Page 12
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
3. GetthepressureandtemperatureatthesinkSink_1(seemodelpictureabove)
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 ")
InthesamewayvariablessuchasLiquidRate,GasRate,MassRate,GLRorWaterCutcanbe
obtainedforSink_1oranyothernodeinthenetwork.
Changing BlackOil fluid parameters
Sofar,wehaveopened,runandobtainedresultsforanetworkmodelasitwasoriginallydefinedwithinthe
PIPESIMgraphicalinterface.Inthisstep,wewillchangesomeparameterstotheopenedmodel.Hereis
wherethetruepowerofOpenLinkstartstoshow,theExcelspreadsheetmaydefinearangeofvaluestobe
testedinthecontextofawhatifscenarioandmultiplesimulationjobsmaybesetuptocompareresults
forarangeofinputvaluesforoneormoreproperties.
1. CreateaBlackOilvariable:
Dim BlackOil As New FLUIDMODELCOMLib.IblackOil
2. GettheBlackOilmodelfromthenetwork
Set BlackOil = NetModel.BlackOilDefault
TheBlackOilvariablehasbeenfilledwiththevaluesdefinedintheblackoilmodelinNetModel.You
cancorroboratethisbyaddingawatchwiththeVBAdebuggingtoolandinspectingthedifferent
variablefields.
3. SetaWatercutvalueof15%:
BlackOil.Watercut = 15
4. SetanAPIvalueof27.5:
BlackOil.API = 27.5
5. SetthisBlackOilwithamodifiedwatercutandAPIbackintothenetwork:
NetModel.BlackOilDefault = BlackOil
6. Youcannowrerunthemodelwiththenewvalues,getthenewresults,displaytheminanExcelcellor
plot,etc.
Page 13
PIPESIMVersion2011.1OpenLinkReferenceManual
ThefollowingpieceofcodesetsanewvalueforthechokebeansizeinChokewhichisdefinedinthe
singlebranchmodelthatcorrespondstotheproductionwellWell_1.
NetModel. SetPropertyVal (Choke, Well_1,
"inches")
Theabovelinesetsbeansize=3.5inchestoChokeinWell_1..
Saving the changes
1. Anychangesmadetoasinglebranchornetworkmodelcanbesavedsimplybycallingthe
SaveModel()function.
Dim bOK as Boolean
bOK = NetModel.SaveModel(C:\MyOpenLinkModels\Network.bpn)
Theargumentisthefullpathtothefilewherethemodelwillbesaved.Itcanalsoberesavedtothe
originalmodelfile.
2. bOKwillbeTRUE(1)orFALSE(0)dependingonwhetherthesaveoperationsucceededornot.Aswith
allOpenLinkfunctioncallsthatreturnaTRUE/FALSEstate,aFALSEvalueindicatesthatsomekindof
errorconditionoccurredandanerrordescriptioncanbeobtainedbycallingGetLastError():
Dim Error as String
If bOK = False Then
NetModel.GetLastError Error
MsgBox errorStr
End If
Page 14
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Requirements
ItisassumedthatthereaderisfamiliarwiththebasicsofbuildingmodelsinPIPESIM.
NopriorknowledgeofVBA(VisualBasicForApplication)isrequired.VBAisaprogramminglanguagethatis
accessedfromMicrosoftExcel.VBAstatementscanbeusedtointeractwithMicrosoftApplications.These
statementscannotinteractwithPIPESIM.OpenLinkisthenamegiventoagroupofstatementsthatcanbe
usedinVBAtointeractwithPIPESIM.
Procedure
1. CreateaWellModelTemplate.(ThatisbuildawellmodelinPIPESIMbutdonotfillanyoftheobjects
thatmakeupthemodelwithvalues).Savethewellmodeltemplatewiththenametemplate.bps.
2. OrganizethewellsdataintabularforminExcel.
3. WritetheVBAroutinethatwillcreateaBpsfileforeachwellofthespreadsheet.(Theroutinewillmake
useofthemodeltemplate.bpsaswillbeshownfurtherdowninthetext).
4. RuntheroutineTheBpsarecreatedandstoredinadirectoryspecifiedintheroutine.
Page 15
PIPESIMVersion2011.1OpenLinkReferenceManual
1. OpenPIPESIMOpenanewwellperformanceanalysiswindowasshownbelow.
2. CreatethefollowingWellModelintheopenedwindow.
3. Savethemodelwiththesimplemodeldescriptionselectedinboththetubingobjectandtheflowline
object.
Thisisdonebydoubleclickingonboththeflowline_1andtubing_1object,selectingsimplemodelin
eachuserformandpressingonthebuttonOK.
4. Savethewellmodelunderthenametemplate.bpswiththefollowingpath:
D:/OpenLink/template/template.bps
Page 16
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
1. OpenExcel.
2. IntheOpenedworkbook,selectsheet1(thesheetshouldbeselectedbydefault).
3. CreatethefollowingtableinExcel(4Rows24Columns).
4. Startthetableatthecell$A$4andfinishatthecell$X$7.
5. Listofthe24columns(AtoXinorder)(Thevaluesaregivenforeachcolumn):
A: General Data:
Index.
(1,2)
Field.
(Field1,Field2)
WellNumber
(435,436)
GatheringStation
(Man1,Man2)
GasGravity(lbs/cu.ftgassc)/(lbs/cu.ftairsc).
(62,62)
OilAPI
(Field1,Field2)
GORscf/bbl
(800000,900000)
(10,20)
Water Cut %
C: Completion Data:
PwsPsia(Staticpressureofthereservoir).
(1800,3000)
TemperatureF
(200,200)
PImmscf/d/psi2
(1.5053E08,1.7427E7)
D: Tubing Data:
PerforationMDm
(2104,2104)
Page 17
PIPESIMVersion2011.1OpenLinkReferenceManual
PerforationTVDm
(2104,2102)
Tubing1MDm
(2054,2052)
Tubing1ID
(2.44,2.44)
Tubing2MD(CasingMD)
(2104,2104)
Tubing2ID(CasingTVD)
(5.5,5.5)
Flowlineelevation(m)
(0,0)
FlowlineID
(3,3)
FlowlineLengthkm
(4.305,1.212)
F:Choke Data:
ChokeSize1/64th.
(95,95)
G: Production Data:
GasRatemmscf/d
(0.041,1.39)
WellHeadPressurepsia
(195,250)
Pressureattheendoftheflowline.psia
(150,440)
6. Incell$A$8writethetemplatepath:D:/OpenLink/template/template.bps
7. Incell$A$9writethepathinwhichtheBpsfilesaretobestored:
D:/OpenLink/
8. Incell$D$11writethesurfacetemperature:90F.
9. SavethecurrentworkbookunderthenameOpenlink.xlswiththefollowingpath:
D:/OpenLink/Excel/Openlink.xls
Page 18
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Preliminary steps
1. EnableMacrosinyourworkbook.
2. SelecttheMenutoolsSubMenuMacroSecurityasshownbelow.
Thefollowinguserformshouldappear:
3. SelectMedium.HighdoesnotlettheuserrunanyunsignedMacros.
4. InsertaButtonintheworkbookthatwilllaunchtheroutine.
Page 19
PIPESIMVersion2011.1OpenLinkReferenceManual
First,displaytheControlToolboxToolbars.
5. TheninsertabuttoninthespreadsheetbyclickingontheCommandButtonIconintheControlToolbox;
andclickinganddraggingthebuttoninthespreadsheet.Thisisshownbelow:
DesignMode
Icon
CommandButton
Icon.
Page 20
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
ThedefaultnameofthebuttonisCommandButton1.
Note:ClickingontheCommandButtoniconactivatesthedesignmodethatallowsyoutoplacebuttons
andothertypesofcontrolsinthespreadsheet.Youwillneedtodeactivatethedesignmodemanually
whenyouwanttheroutineassociatedwiththebuttontobeexecutedwhenyouclickonit.
6. NextchangethenameofthebuttonbyrightclickingonthebuttonCommandButton1thefollowing
menushouldappear:
7. ClickonCommandButtonObjectSubmenuEdit.Youcannowchangethecaptionofthebutton
CommandButton1to:CreateWellModel.
Page 21
PIPESIMVersion2011.1OpenLinkReferenceManual
8. OpentheVBAEditorWindows.Asthedesignmodeisactivated,itispossibletoopentheVBAeditor
windowsbydoubleclickingonthebuttonCommandButton1.Thefollowingwindowshouldthen
appear:
Private Sub CommandButton1_Click()
End Sub
ThewindowthatcontainsthestatementsiscalledtheCodewindow.YouwriteVBAroutinesinthe
Codewindow.ThewordSubinthefirstlineindicatestothecomputerthatitisthebeginningofanew
routine.(Ineffect,severalroutinescanbewritteninthesameCodewindow).Theword
CommandButton1_Clickinthefirstlineindicatestothecomputerthattheroutinefollowingcanonlybe
executedbyclickingonthebuttonCommandButton_1.ThestatementEndSubindicatestothe
computerthatthisistheendoftheroutine.Anyroutinemustfinishwiththisstatement.
To Activate the Open Link statements Libraries
InordertobeabletowriteourroutineusingOpenLinkstatementsweneedtoindicatetothecomputer
thatwearegoingtousethosestatements.Weneedtoactivatethosestatementssothattheycanbe
understoodbyVBA.
1. WecanactivatetheOpenLinkstatementsbyclickingonthemenuTools,submenuReferences.
Page 22
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Youshouldnowseeadialogboxliketheonebelow:
2. ScrolldownthelistofavailablereferencesuntilyoufindtheFluidModelCOM1.0TypeLibrary.Check
theboxtotheleftofthereference.
3. NowdothesameforNet32COM1.0TypeLibraryandNODALOPLib.INodalAnal.
4. ClickonOKtoclosethereferencewindow.
EachofthethreelibraryactivatedisagroupofOpenLinkstatementsthatcanbeusedinVBAto
communicatewithPIPESIM.TheselibrarieswillbeavailablefromExcelafterhavinginstalledPIPESIM.
Theyneedtobeactivatedbeforetheycanbeusedwhileprogramming.
Note:Ifaroutineispassedfromonecomputertoanother,anditdoesnotworkonthereceiving
computer,itisbecausetheOpenLinkLibrarieshavenotbeenactivated.
Page 23
PIPESIMVersion2011.1OpenLinkReferenceManual
1. Writethefollowingroutine:
TheactualworkingsoftheroutinewillbeexplainedinCaseStudies.
Page 24
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 25
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 26
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
1. GobacktoExcelandselectthetwowellswiththemouse(byhighlightingthecorrespondingrows)you
willhavecreatedtwo.bpsfilescorrespondingtothetwowellsofthespreadsheet.ThedirectoryOpen
Linkwillcontainthetwo.bpsFiles(shownbelow).
Page 27
PIPESIMVersion2011.1OpenLinkReferenceManual
Requirements
ItisassumedthatthereaderisfamiliarwiththePIPESIMNodalAnalysisUserForm.
Procedure
YouwillwriteaVBAOpenLinkroutinethatusesthetablebuiltinthepreviouscasestudy.Theroutinefills
inaNodalAnalysisoperationinterfaceusingthestaticpressure,tubingIDandOutletPressurestoredin
ExcelandthenassignsthisNodalAnalysisoperationinterfacetotheWellModelscreatedinCasestudy1.
Eachofthemodelsisthenrun.ANodalAnalysisplot(systemplot_.plt)isproducedforeachwell.Youcan
thencheckonthegraphsifthestocktankflowratesattheoperationpointsareconsistentwiththe
productiondata.
Page 28
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
2. InsertasecondbuttonintheSpreadsheet.ThisisdoneusingthecontroltoolboxasinCaseStudy1.
ThedefaultnameofthebuttonwillbeCommandButton2.
3. OpentheVBAeditor.ThisisdoneasinCaseStudy1bydoubleclickingonthebuttonCommandButton2.
Thecodewrittenforthepreviouscasestudywillbevisible.
Private Sub CommandButton2_Click()
End Sub
Attheendofthecode,fromthepreviouscasestudy,thestatementsarevisible.
Page 29
PIPESIMVersion2011.1OpenLinkReferenceManual
1. Writetheroutine:
TheworkingsoftheroutineareexplainedinCaseStudies.
Page 30
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 31
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 32
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
1. GobacktoExcelandselectthetwowells(byhighlightingthecorrespondingrows).
2. PressthebuttonCommandButton_2.Thisrunsanodalanalysisonthetwo.bpsfilesproducedinCase
Study1.ThecontentsoffolderOpenLinkafterhavingruntheroutineisshownbelow:
.pltFiles.
3. Clickingonthe.pltfileswilldisplaythefollowinggraphs:
.
Plot of Man1_435
Page 33
PIPESIMVersion2011.1OpenLinkReferenceManual
Plot of Man2_436
Page 34
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
1. Valuesreturnedas7777mean'UNSET'orcouldnotcalculatedotomissingdataorhasnotbeen
calculated.
2. Forallmodulesandinterfaces,requiredmethodsareshowninRED,andconditionallyrequiredin
GREEN.
Page 35
PIPESIMVersion2011.1OpenLinkReferenceManual
ISingleBranchModel Interface
ISingleBranchModel object - Get Methods
ReturnsinpNameArrayanarrayofStringwiththenamesof
objectsofthegiventype(ObjectType).Thenumberofobjects
foundisreturnedinCount.ObjectTypecanbeanyvalueof:
GetNameList(ObjectTypeAs
Long,pNameArray,CountAs
Long)
1Fold
2Source
3Sink
4Junction
5Branch
6Text
7ProductionWell
8InjectionWell
9EndMark
10GenericSource
11VerticalCompletion
12HorizontalCompletion
13Flowline
14Riser
15Zerolengthconnector
16Tubing
17GenericNode
18Choke
19Compressor
20Expander
21HeatExchanger
22ESP
23MultiphaseBooster
24GasLift
25Separator
26Reporttool
27Adder/Multiplier
28NodalAnalysisPoint
29EngineKeywordTool
30Reinjector
31WellConnector
32SSSV
33GasLiftValve
34BlackBox
35CoilTubing
36PCP
GetEquipmentInfo
(EquipmentTypeAsLong,
ParentTypeAsLong,ParentObject
AsString,EquipmentNames,
IfParentObjectstringisempty,thefunctionisthesameas
TGetNameList()T.SeeTGetNameList()Tforamapto
EquipmentTypeoptions.Otherwiseitreturnsin
EquipmentNamesarrayofStringwiththenamesofchildobjects
Page 36
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
CountAsLong)
ofthegiventype(ObjectType)forspecifiedParentObjectof
ParentType
GetHasArtificialLift(ObjectType
AsLong,ObjectNameAsString,
LiftAsLong)
Returns0:noartificiallift
1:gasliftinjection
2:ESP
1:Objectnotfound
ObjectTypemustbeTubingtype(16)
ObjectNamethenameofthetubing
GetStartBoundaryObject
(ObjectTypeAsLong,ObjectName
AsString)
ReturnstheObjectType(SeeTGetNameList()T)anditsnameof
theupstreammostobjectinthesinglebranchmodel.The
upstreammostobjectinabranchisdeterminedbythedrawing
directionwhenauserinitiallycreatesthebranch.
GetCountObjectsInProfile(Count
AsLong)
Returnsthenumberofobjectsinthesinglebranchmodel
GetObjectAtIndex(IndexAsLong,
ObjectTypeAsLong,ObjectName
AsString)
Returnstheobject'stypeandnameatthespecifiedzerobased
index.Indexmustbetweenzeroandthenumberreturnedby
GetCountObjectsInProfile()minus1.
GetLastError(ErrorStrAsString)
Returnsthelasterrormessageproducedbytheinterface.
GetIsModelRunning()AsBoolean
ReturnsBooleanvalueTrueifthesimulationprocessisactive
GetOperationInterface
(pIOperationAsObject)
Returnstheoperationobject
GetOperationType()AsLong
ReturnsLongvalueastheoperationdefinedforthemodel.See
XDefinedconstantsandstringsX
GetPropertyNames(ObjectName
AsString,PropNames)asLong
ReturnsinPropNamesthelistofpropertiesdefinedfortheobject
ObjectName.Returnsthenumberofpropertiesasfunctions
returnvalue
GetPropertyVal(ObjectNameAs
String,PropNameAsString,
pValueAsDouble,pUnitStrAs
String)AsBoolean
Forspecifiedproperty(PropName)inthespecifiedobject
(ObjectName)functiongetsapropertyvalueinValueandthe
unitsinUnitStr.ReturnvalueisTrueifthepropertywasretrieved
successfully,otherwiseFalse.ForimplementedPropNamessee
XDefinedconstantsandstringsX.
GetPropertyValAtObjectIndex
(ObjectNameAsString,PropName
AsString,pValueAsDouble,
pUnitStrAsString,SubObjectType
AsLong,IndexAsLong)As
Boolean
Getsaspecifiedpropertyvalue.
ThisfunctionextendsthefunctionalityofTGetPropertyValTby
allowingyoutoretrieveapropertyfromaspecifiedsub
componentwithinanobject.Atypicaluseofthisiswhenfor
instanceitisrequiredtogetagasliftflowrate(PropName)from
thetop(Index=0)gasliftinjectionpoint(SubObjectType)inthe
tubingTubing_1(ObjectName).Foravailableoptionssee
XDefinedconstantsandstringsX
Page 37
PIPESIMVersion2011.1OpenLinkReferenceManual
GetPropertyStringAtObjectIndex ThefunctionissimilartoTGetPropertyValAtObjectIndexTbutfor
(ObjectNameAsString,PropName propertiesdefinedasstring
AsString,pValueAsString,Index
AsLong)AsBoolean
GetPropertyType(ObjectNameAs Returnsthepropertytype:
String,PropNameAsString)As
UNDEFINED1
Long
REAL0(valueinstrictSIunits)
INT
DOUBLE
STR
GetSensitivityInfo(ObjectTypeAs
Long,ObjectNameAsString,
VariableNames,ItemReference)
Returnsthelistofvariablenamesuponwhichasensitivity
analysiscanbeperformedforthegivenobject(definedbyits
typeandname).SeeTGetNameList()Tforobjecttypevalues.
ItemReferenceholdsadditionalbinaryinformationaboutthe
sensitivitythatisrequiredbysomeoperationmoduleinterfaces
(suchastheArtificialLiftCOMinterface)
GetSensitivityVariables
(ObjectNameAsString,
VariableNames,StdQtyNames)As
Long
Requeststhelistofvariablenamesandtheirmeasurementsupon
whichasensitivityanalysiscanbeperformedforthegivenobject
(definedbyname).Thereturnvalueholdsnumberofthe
variables
SetOperationInterface
(pIOperationAsUnknown)
pIOperation:Theinterfaceinstancetoanoperationobject.This
functionassignsthegivenoperationtotheopenedsingle
branchmodel
SetOperationType
(OperationTypeAsLong)
Setstheoperationtypeforthesinglebranchmodel.See
Definedconstantsandstrings
SetPropertyVal(ObjectNameAs
String,PropNameAsString,value
AsDouble,UnitStrAsString)As
Boolean
Setsthespecifiedproperty(PropName)inthespecifiedobject
(ObjectName)tothevaluegiveninValueinthegivenunits
(UnitStr).FunctionreturnsTrueifthepropertywasset
successfully,otherwiseFalse.ImplementedPropNames:see
Definedconstantsandstrings.
AsSetPropertyValAtObjectIndex()butforpropertiesdefined
SetPropertyStringAtObjectIndex
(ObjectNameAsString,PropName asstring
AsString,valueAsString,IndexAs
Long)AsBoolean
Page 38
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
SetPropertyValAtObjectIndex
(ObjectNameAsString,PropName
AsString,valueAsDouble,UnitStr
AsString,SubObjectTypeAsLong,
IndexAsLong)AsBoolean
ThisfunctionextendsthefunctionalityofSetPropertyValby
allowingyoutosetapropertytoaspecifiedsubcomponent
withinanobject.Atypicaluseofthisiswhenforinstanceitis
requiredtosetagasliftflowrate(PropName)throughthetop
(Index=0)gasliftinjectionpoint(SubObjectType)inthetubing
Tubing_1(ObjectName).ForavailableoptionsseeDefined
constantsandstrings.
SetPVTFile(bstrPVTFilenameAs
String)
Setsthecompositionalfile(.pvt)tobeusedasthemainfluidin
thesimulations
SetUnitManager
(p_VarUnitManager)
SetstheUnitManagerobject
BlackOilAsObject
Gets/setstheBlackOilfluiddefinitionobject
CompositionAsObject
Gets/setsthefluidcompositionobject
FlowCorrelationAsObject
Gets/setstheFlowCorrelationobject
FluidAsFluidModel
Gets/setstheFluidModelobject(SeeIFlowlineObj
Interface)
FluidModelTypeAsLong
Gets/setsthefluidtype(0:blackoil,1:compositional,2:
PVTfile,3:MFLfile)
GasLiftDesignAsObject
Gets/setstheGasLiftDesignobject
GasLiftSystemPropsAsObject
Gets/setstheGasLiftSystemPropertiesobject
ObjectProperties(ObjectNameAs
String)AsProfileObj
Sets/returnsaProfileObject(SeeIObjectProperties
Interface).DependingontheobjecttypeofObjectName
thisinterfacecanbesettothespecificobjecttype
interface.Forinstanceatubingobjectreturnsa
ProfileObject,whichcanbesettoaTubingObjobject.The
TubingObj(SeeITubingInterface)containspropertiesand
methodstodefineorobtaininformationfromadetailed
tubingobject.
ProjectInfoAsProjectInfo
ReturnstheProjectInfoobjecttoaccessprojectspecific
data
ProjectPathAsString
Setsfullpathnametothemodelfile
FieldSurveyAsObject
Gets/setstheFieldSurveyobject
ErosionCorrosionAsObject
Gets/setstheErosionCorrosionobject
KeywordsAsString
Gets/setstheadditionalenginekeywords
HeatTransferOptionsPipeBurialMethod
Aslong
Gets/setstheflagvalueforheattransferoptionspipe
burialmethod:
1983:1983method
2000:2000method(settothisvalueifgivenvalueisnot
Page 39
PIPESIMVersion2011.1OpenLinkReferenceManual
1983,2000,or2009)
2009:2009method
HeatTransferOptionsIFCMethodAslong Gets/setstheflagvalueforheattransferoptionsinside
filmcoefficientmethod:
1:Kaminsky
2:KreithSeparateReynoldsnumber(settothisvalueif
givenvalueisnot1,or2)
HeatTransferOptionsUValueMultiplier
Asdouble
EnableHydrateSubcoolingCalculationAs Gets/setstheflagvalueforheattransferoptionshydrate
subcoolingcalculation:
long
Gets/setsthevalueforheattransferoptionsUvalue
multiplier
0:disable
1:enable(settothisvalueifgivenvalueisnot0,or1)
Note:Propertyisforcompositionalmodelsonly
ISingleBranchModel object - Operations
ExportEngineFiles()
ThisfunctiongeneratesanASCIIfile(.psm)inthePIPESIM
enginekeywordlanguagethatcorrespondstotheopened
model.ThisfilecanthenbeusedwithPIPESIMexpert
mode.
ExportEngineFiles2(operationfileAs
String)AsString
InadditiontoExportEngineFiles(),thisfunctionreturns
thefullpathnametotheexportedfile(.psm)andits
associatedoperationfile(.inc)
ExportEngineFiles3(nExpertModeAs
Long)
ThisfunctionissimilartoExportEngineFilesfunctionbut
itallowstospecifytheformatforexportedfilesin
nExpertModeparameter:
0defaultformat,
1withexpertextensions
2forESPdesign
3sameasfor1butwarningisdisplayediffilesexist
KillSimulationProcess()
Terminatesthesimulationprocess
NewModel(bstrModelFileNameAs
String,ProfileTypesList,
ProfileNamesList)AsBoolean
CreatesanewPIPESIMmodel.bstrModelFileName:full
pathtothefilewherethenewmodelistobesaved.
ProfileTypesList:alistofobjecttypeidentifiers(integer
numbers)thatdescribetheobjectconnectivityinthe
modelseeDefinedconstantsandstringsforidsmap.
ProfileNamesList:alistofobjectnamesforeachoneof
theelementsofProfileTypesList.Thisvariantmaybe
emptyinwhichcasedefaultnameswillbeassigned.The
methodreturnsTrueifoperationwassuccessful,False
otherwise
Page 40
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
OpenModel(bstrModelFileNameAs
String)
Opensthegivensinglebranchmodel.Filenamemustbea
validPIPESIMsinglebranchmodelfile(.bps).
Thisfunctionmustbecalledfirstwhenusingthis
interface.
Note:Willreturnfalsealsoifthenumberofcomponent
inanycompositionorinthemodelingeneralismore
than50.
RunSingleBranchModel(bRestartAs
Boolean)
Runsthecurrentlyopenedmodelbycallingthe
calculationengineprogramasspecifiedinthePIPESIM
installation.IfbRestartisTruethesimulationwillloadany
previouslyrestartfiles(.rstfiles)asitsinitialconditions.
ReturnvalueisTrueforsuccessfulenginestart,False
otherwise.
RunSingleBranchModel2(bRestartAs
Boolean,EngSwitchesAsString,
DynamicPlotAsBoolean)
SimilartoSetOperationInterface,italsoacceptsoneor
moreswitchestobepassedtothesimulationengineand
turnsdynamicplottingon/off.
RunSingleBranchModel3(bRestartAs
Boolean,EngSwitchesAsString,
DynamicPlotAsBoolean,
ExpertExtensionsAsBoolean)
SimilartoSetOperationInterface2,italsoallowsusingof
theExpertextensions
SaveModel(bstrPathNameAsString)As
Boolean
Savesthecurrentlyopenedmodeltoafilegivenby
bstrPathName.FunctionreturnsTrueifmodelissaved,
otherwisethereturnvalueisFalse.
ValidateTubingConfiguration(MaxInjTV
DAsDouble)AsBoolean
Thisfunctionchecksthetubingconfigurationabovethe
injectionpointtoverifythatalldimensionsareproperly
set.Iffunctionfailstheerrormessageisavailableusing
theGetLastErrorfunction.
SetOutpoutUnits(nUnitsAsInteger)As
Boolean
Thisfunctionforcestheoutputtobewritteninspecified
units(0modelsdefaultunits,1Engunitsand2SI
units).
Page 41
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 42
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
IISingleBranchModel2Interface
IISingleBranchModel2 object - Properties
UFactorMultiplierAsDouble
Gets/setstheufactormultiplierforasinglebranchmodel
IObjectProperties Interface
ProfileObj object - Properties
FluidAsFluidModel
GetsaFluidModelinterfaceobject(seedescriptionbelow)
GetLastError()AsString
Returnsanerrordescription
GetPropertyNames(PropNames)As
Long
ReturnsinPropNamesthearrayofpropertiesdefinedfor
theobject.Functionsreturnvalueisthenumberof
properties
GetValue(PropNameAsString,
pValue,pUnitStrAsString,IndexAs
Long)AsBoolean
Getsthespecifiedproperty(PropName)valueinValueinthe
givenunits(UnitStr).ReturnvalueisTrueifthepropertywas
setsuccessfully,otherwiseFalse.ImplementedPropNames:
seeDefinedconstantsandstrings.Indexisareserved
argument,setitto1.
SetValue(PropNameAsString,value, Setsthespecifiedproperty(PropName)valueinValueinthe
givenunits(UnitStr).ReturnvalueisTrueifthepropertywas
UnitStrAsString,IndexAsLong)As
setsuccessfully,otherwiseFalse.ImplementedPropNames:
Boolean
seeDefinedconstantsandstrings.Indexisareserved
argument,setitto1.
Page 43
PIPESIMVersion2011.1OpenLinkReferenceManual
ITubing Interface
TubingObj Object - Get Methods
GetCountDownholeEquipment(Type Returnsthenumberofitemsspecifiedinthedetailedtubing
modelofagiventypeofequipment
AsLong)AsLong
Type:anyof
16Tubingsection
18Choke
22CentrifugalPump
24InjectionPoint
25Separator
32SSSV
33GasLiftValve
(SeeObjectTypeIdentifiers)
GetCountTubingSection()AsLong
SimilartoGetCountDownholeEquipment,butspecificto
tubingsections
GetDeviationSurvey_SI(TypeAs
Long)AsVariant
ReturnsinaVariantthematrixofdoublesdefinedastwo
columnsandavariablenumberofrows.Thevariableineach
columndependsintherequestedType.
Type:0=mdvs.tvd,1=mdvs.angle,2=tvdvs.angle
AllvaluesareinstrictSIunits
GetDownholeEquipment(TypeAs
Long,IndexAsLong,labelAsString)
AsDouble
Returnsthemd(asfunctionsreturnvalue)andthelabelofa
givenTypeofdownholeequipmentandatgivenIndex.
Type:anyof
16Tubingsection
18Choke
22CentrifugalPump
24InjectionPoint
25Separator
32SSSV
33GasLiftValve
Index:the0basedpositionalindexoftheitem.Index=0
referstothetopmostitemclosesttothewellhead.
Returnstheequipmenttype,labelandmd(asfunctions
GetDownholeEquipmentAtIndex
(IndexAsLong,TypeAsLong,labelAs returnvalue)instrictSIunitsatagivenIndex.See
GetDownholeEquipmentfordefinitionofIndex
String)AsDouble
Page 44
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetGeothermalSurvey_SI(vbIsTVD
AsBoolean)AsVariant
ReturnsthegeothermalsurveyinVariantmatrixofdoubles
definedasthreecolumnsandavariablenumberofrows.
ThecolumnsaredefinedasDepthvs.AmbientTemperature
vs.Uvalue.DepthisTVDifvbIsTVD=true,otherwiseMD
GetTubingSection(IndexAsLong,
labelAsString)AsDouble
SimilartoGetDownholeEquipment,butspecifictotubing
sections
GetMDatTVD_SI(tvdAsDouble)As
Double
Returnsthemdgiventhetvdbasedonthedeviationsurvey
GetTVDatMD_SI(mdAsDouble)As
Double
Returnsthetvdgiventhemdbasedonthedeviationsurvey
GetInputOK(infoAsString)As
Boolean
ValidatesthetubingdataandreturnsTrueifconfigurationis
correct,otherwisethefunctionreturnsFalseandinfo
containstheerrormessage
SetDeviationSurvey_SI(TypeAs
Long,Survey)AsBoolean
Setsadeviationsurveytoadetailedtubingmodel.
SetGeothermalSurvey_SI(vbIsTVD
AsBoolean,Survey)AsBoolean
Setsageothermalsurveytoadetailedtubingmodel.
SeeGetDeviationSurvey_SIforavailabletypes.Surveymust
beavariantmatrixofdoublevaluesspecifiedasatwo
columntablewithanynumberofrows(minimum2).
SeeGetGeothermalSurvey_SIfordefinitionofSurveyand
vbIsTVD.
InjectionPointFluid(IndexAsLong)
AsFluidModel
Gets/setstheFluidModelobjectfortheinjectionpointata
givenindex.Thisfunctionisonlyapplicablefor
compositionalmodels.SeeISinglePointCalibobject.
RemedialCoiledTubingEnabledAs
Boolean
Enables/disablesRemedialCoiledTubingoptionin
configuration
AddDownholeEquipment(TypeAs
Long,md_SIAsDouble,labelAs
String)AsLong
Addsanequipmentitemtothedetailedtubing
Type:anyof
22CentrifugalPump
24InjectionPoint
25Separator
32SSSV
33GasLiftValve
Page 45
PIPESIMVersion2011.1OpenLinkReferenceManual
label:theitemslabel
Functionreturnsthe0basedpositionalindexoftheadded
item.Index=0referstothetopmostitemclosesttothe
wellhead
AddGasLiftValve_SI(mdAsDouble,
manufAsString,seriesAsString,
portNameAsString,portSizeAs
Double,modeAsString,ptroAs
Double,ApAsDouble,AbAsDouble,
nomODAsDouble,cvAsDouble,
dpfoAsDouble)AsLong
Addsagasliftvalvetothetubingobject.Returnsthezero
basedindexcorrespondingtothevalvepositionwithindex
ofthetopmostvalveequalto0.
AddTubingSection(BottomMD_SIAs
Double,labelAsString)AsLong
Addsasectionoftubing
BottomMD_SI:thebottommdofthesectioninstrictSIunits
label:theitemslabel
Functionreturnsthe0basedpositionalindexoftheadded
section
ClearGasLiftValves()
Removesallgasliftvalvesfromthetubing
RemoveDownholeEquipment(Type
AsLong,IndexAsLong)
Removesapieceofequipmentofagiventypeandatthe
givenIndex.
Type:anyof
22CentrifugalPump
24InjectionPoint
25Separator
32SSSV
33GasLiftValve
Index:the0basedpositionalindexoftheitem.Index=0
referstothetopmostitemclosesttothewellhead
RemoveTubingSection(IndexAs
Long)
SimilartoRemoveDownholeEquipmentbutapplicableto
tubingsections
DisplayDialog(p_VarUnitManager,
fluidtypeAsInteger)AsBoolean
Functioninvokestubingconfigurationdialogandreturns
TrueifOKbuttonwasclicked,Falseotherwise.
p_VarUnitManagerisaUnitsManagerobjectandfluidtype
canbeoneofthefollowingvalues:
0:blackoil
1:composition
2:PVTfile
3:MFLfile
Page 46
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
IVertCompObj Interface
VertCompObj Object - Get Methods
GetInputOK(infoAsString)As
Boolean
ValidatestheflowlinedataandreturnsTrueifconfiguration
iscorrect,otherwisethefunctionreturnsFalseandinfo
containstheerrormessage
SetMultipoint(valueAsLong)As
Boolean
Seteithermultipoint=1orisochronal=0typeofIPRdata
table
SetIPRFluidType(TypeAsLong)As
Boolean
SetfluidtypeforIPR:type_liquid=0,type_gas=1
SetIPRTable_SI(QPPoints)AsBoolean SetstheIPRtablevalues.QPPointsisa3columnarrayof
Doubles,wherefirstcolumncontainsFlowratevalues,
secondcolumncontainsPwfvaluesandthethirdone
containsPwsvalues.AllvaluesareinstrictSIunits
GetConingTableData(IsUsedAs
Boolean,ConedGasSGAsDouble,
Flowrate,GOR,WCut)AsBoolean
Returnstheconingtabledatafortheverticalcompletion.
IsUsedisTRUEifitissetandFALSEotherwise,ConedGasSG
containsavalueforconedgasspecificgravity,Flowrate,
GORandWCutaretheonecolumnarraysofDoubles
containingflowrate,GORandwatercutvaluesrespectively.
AllvaluesareinEngunits
GetPSSRelPermTableData(WaterSat,
RelPermOil,RelPermWater)As
Boolean
Returnstherelativepermeabilitytabledataforthevertical
completionwithpseudosteadystatemodel.WaterSat,
RelPermOilandRelPermWateraretheonecolumnarraysof
Doublescontainingwatersatuation,relativepermeabilityfor
oilandrelativepermeabilityforwater,respectively.All
valuesareinEngunits
CalculateIPR()AsBoolean
DisplayDialog(p_VarUnitManager)
AsBoolean
FunctioninvokesVerticalCompletionconfigurationdialog
andreturnsTrueifOKbuttonwasclicked,Falseotherwise.
PassaNullvariantastheargumentsvalue.
Page 47
PIPESIMVersion2011.1OpenLinkReferenceManual
IFlowlineObj Interface
FlowlineObj Object - Properties
Gets/setsHeatTransferobject
HeatTransferAsObject
ValidatestheflowlinedataandreturnsTrueifconfiguration
iscorrect,otherwisethefunctionreturnsFalseandinfo
containstheerrormessage
GetInputOK(infoAsString)As
Boolean
AddProfileNode_SI(distanceAs
Double,elevationAsDouble,
ambientTAsDouble,uValueAs
Double,labelAsString)
Addsanodetotheflowlinedetailednodedescription.All
valuesmustbegiveninstrictSIunits.
ClearDetailedProfile()
Deletesallnodesintheflowlinedetailedprofile
UseDetailedProfile(UseDetailedAs
Boolean)
UseDetailed=True:instructstheflowlinetousethedetailed
profiledescription.
UseDetailed=False:usetheflowlinessimpledescription,
detailednodeswillbegeneratedautomatically.
DisplayDialog(p_VarUnitManager)
AsBoolean
Functioninvokesflowlineconfigurationdialogandreturns
TrueifOKbuttonwasclicked,Falseotherwise.PassaNull
variantastheargumentsvalue.
GetNodesCount()AsLong
Functionreturnsanumberofnodesdefinedinadetailed
profile
GetPipeOD(odasDouble,unitsas
String)
FunctioncalculatespipesODbasedoncoatingproperties
Page 48
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
IHeatTransfer Interface
HeatTransfer Object - Properties
UValueTypeAsLong
Gets/setsUValuetype.Possiblevaluesare0forcalculated,
1forinsulated,2forcoated,3forbareinair,4forbarein
waterand5foruserspecified
IsIFCIncludedAsBoolean
Gets/setsaBooleanvalueforinsidefilemcoefficient.Trueif
IFCisincludedinUValueandFalseifitiscalculated
separately.
AmbientFluidTypeAsLong
Gets/setsanambientfluidtype.0forairand1forwater.
GetUValue(uValasDouble,unitsas
String)
ReturnsUValueandunitsstring.FailsifUValueTypeissetto
calculated
GetPipeConductivity(dblValas
Double,unitsasString)
Returnspipeconductivityvalueandunitsstring.Failsif
UValueTypeisnotcalculated
GetAmbientFluidVelosity(dblValas
Double,unitsasString)
Returnsambientfluidvelocityvalueandunitsstring.Failsif
UValueTypeisnotcalculated
GetBurialDepth(dblValasDouble,
unitsasString)
Returnspipeburialdepthvalueandunitsstring.Failsif
UValueTypeisnotcalculated
GetGroundConductivity(dblValas
Double,unitsasString)
Returnsgroundconductivityvalueandunitsstring.Failsif
UValueTypeisnotcalculated
GetCoatingData_SI(varData)
Returnsapipecoatingdataarray.Firstcolumncontaints
layerspecificconductivityvaluesandasecondcolumn
containtslayerthicknesses.FailsifUValueTypeisnot
calculated
SetUValue(uValasDouble,unitsas
String)
SetsUValueinspecifiedunits.FailsifUValueTypeissetto
calculated
SetPipeConductivity(dblValas
Double,unitsasString)
Setspipeconductivityvalueinspecifiedunits.Failsif
UValueTypeisnotcalculated
SetAmbientFluidVelosity(dblValas
Double,unitsasString)
Setsambientfluidvelocityvalueinspecifiedunits.Failsif
UValueTypeisnotcalculated
SetBurialDepth(dblValasDouble,
unitsasString)
Setspipeburialdepthvalueinspecifiedunits.Failsif
UValueTypeisnotcalculated
Page 49
PIPESIMVersion2011.1OpenLinkReferenceManual
SetGroundConductivity(dblValas
Double,unitsasString)
Setsgroundconductivityvalueinspecifiedunits.Failsif
UValueTypeisnotcalculated
SetCoatingData_SI(varData)
Setsapipecoatingdata.Datahastobepassedasanarray
wherefirstcolumncontaintslayerspecificconductivity
valuesandasecondcolumncontaintslayerthicknesses.Fails
ifUValueTypeisnotcalculated
IFluid Interface
FluidModel Object - Properties
CompositionAsObject
AccessestheICompositionalobject(SeeISinglePointCalib
object)
BlackOilAsObject
AccessestheIBlackOilobject(RefIBlackOil)
FluidModelTypeAsLong
Retrievesthefluidmodeltype:0:BlackOil,1:Compositional,
2PVTFile,3MFLFile
OverrideValuesAsBoolean
Sets/getswhetherWcut/GORvaluesareoverriddenfrom
thevaluesdefinedinthefluidmodel.
WCutoverride_SIAsDouble
Accessesthewatercutoverridevalue
GORoverride_SIAsDouble
AccessestheGORoverridevalue
OGRoverride_SIAsDouble
AccessestheOGRoverridevalue
LGRoverride_SIAsDouble
AccessestheLGRoverridevalue
GLRoverride_SIAsDouble
AccessestheGLRoverridevalue
GORoverride_TypeAsInteger
AccesseswhichGORtypeisbeingoverridden(0=GLR,
1=GOR,2=LGR,3=OGR)
IsLocalFluidAsBoolean
Sets/getswhethertheobjectisusingalocalfluidmodel
CompositionTypeAsLong
Sets/getswhetherthelocalcompositionisaPVTfileora
definedPIPESIMcompositionorlocalMFLfile
FluidNameAsString
Sets/getsafluidname
GetInputOK(infoAsString)As
Boolean
ValidatesthefluidmodeldataandreturnsTrueif
configurationiscorrect,otherwisethefunctionreturnsFalse
andinfocontainstheerrormessage
Page 50
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
DisplayDialog(p_VarUnitManager)
AsBoolean
FunctioninvokesfluidconfigurationdialogandreturnsTrue
ifOKbuttonwasclicked,Falseotherwise.PassaNullvariant
astheargumentsvalue.
IProjectInfo Interface
ProjectInfo Object - Properties
DescriptionAsString
Gets/setsstringproperty
UserAsString
Gets/setsstringproperty
JobAsString
Gets/setsstringproperty
CompanyAsString
Gets/setsstringproperty
ManagerAsString
Gets/setsstringproperty
RemarksAsString
Gets/setsstringproperty
DateAsString
Gets/setsstringproperty
FieldAsString
Gets/setsstringproperty
WellNumberAsString
Gets/setsstringproperty
LeaseAsString
Gets/setsstringproperty
CountryAsString
Gets/setsstringproperty
AddressAsString
Gets/setsstringproperty
EmailAsString
Gets/setsstringproperty
PhoneAsString
Gets/setsstringproperty
FaxAsString
Gets/setsstringproperty
IErosionCorrosion Interface
ErosionCorrosion Object - Properties
CalculatePHAsLong
Gets/setsvalueforActualpHproperty(1calculatevalue,0
useuserdefinedpHvalue)
CorrosionEfficiencyAsDouble
Gets/setscorrosionefficiencyvalue
CorrosionModelAsLong
Gets/setsvalueforCorrosionModelproperty(0none,1
usedeWaard(1995)model)
ErosionEfficiencyAsDouble
Gets/setserosionefficiencyvalue
ErosionModelAsLong
Gets/setsvalueforErosionModelproperty(0API14e
model,1SALAMA(2000))
Page 51
PIPESIMVersion2011.1OpenLinkReferenceManual
ErosionRate_EngAsDouble
Gets/setsacceptableerosionratevalue
ErosionVelocityConstAsDouble
Gets/setserosionvelocityconstantvalue
GeometryConstantAsDouble
Gets/setsgeometryconstantvalue
SandGrainSize_EngAsDouble
Gets/setssandgrainsizevalue
SandProdRatioAsDouble
Gets/setssandproductionratiovalue
UserDefinedPHAsDouble
Gets/setsuserdefinedpHvalue
Files\Schlumberger\PIPESIM\Case Studies\Open
PIPESIMVersion2011.1OpenLinkReferenceManual
INetModel Interface
INetModel Interface - Get Methods
DoesCustomKeyExists(KeyNameas
String)asBoolean
Returnstrueifcustomdatahasbeenstoredagainstthe
KeyNamestring
GetNameList(ObjectTypeAsLong,
pNameArray,CountAsLong)
ReturnsinpNameArrayanarrayofStringwiththe
namesofobjectsofthegiventype(ObjectType).The
numberofobjectsfoundisreturnedinCount.
ObjectTypecanbeanyof:
1Folder
2Source
3Sink
4Junction
5Branch
6TextObject
7ProductionWell
8InjectionWell
GetHasArtificialLift(ObjectTypeAsLong,
ObjectNameAsString,LiftAsLong)
Returns:
0:noartificiallift
1:gasliftinjection
2:ESP
1:Objectnotfound
ObjectTypemustbeTubingtype(16)
ObjectNamethenameofthetubing
GetEquipmentInfo(EquipmentTypeAs
Long,ParentTypeAsLong,ParentObject
AsString,EquipmentNames,CountAs
Long)
ReturnsthenamesofequipmentoftypeEquipmentType
(SeeGetNameList()fortheISingleBranchobjectfor
availabletypes),whicharepartofthesinglebranch
modelofobjectParentObjectoftypeParentType.
ParentTypeshouldbeProductionWell(7),InjectionWell
(8),orBranch(5)
GetLastError(ErrorStrAsString)
Returnsthelasterrormessageproducedbythe
interface
GetBoundaryProperties(ObjectNameAs
String,PressureAsDouble,Temperature
AsDouble,FluidrateAsDouble,Fluidtype
AsLong)
Returnstheboundarypropertiessetinthemodelfor
objectwithidentifierObjectName.ObjectNamemustbe
aboundaryobject(Source,Sink,ProductionWellor
InjectionWell)
Pressuresinpsia
TemperaturesinF
Page 53
PIPESIMVersion2011.1OpenLinkReferenceManual
Fluidtype=0(liquidrate),FluidrateinSTB/D
Fluidtype=1(gasrate),Fluidrateinmmscf/d
Fluidtype=2(massrate),Fluidrateinlb/s
GetBoundaryProperties_SI
(ObjectNameAsString,PressureAs
Double,TemperatureAsDouble,
FluidrateAsDouble,fluidtypeAsLong)
SimilartoGetBoundaryPropertiesexceptthatthis
functionreturnsthepropertiesinstrictSIunits.
GetBoundaryBlackOil(ObjectNameAs
String,BlackOilAsObject)AsBoolean
GetstheBlackOilobjectusedbythesourcewith
identifierObjectName.OnlyapplicableforBlackOil
models.ThefunctionreturnsTrueincaseofsuccessand
Falseotherwise
GetBoundaryComposition(ObjectName
AsString,CompositionAsObject)As
Boolean
GetstheCompositionalobjectusedbythesourcewith
identifierObjectName.Onlyapplicableforcompositional
models,ThefunctionreturnsTrueincaseofsuccessand
Falseotherwise
GetBoundaryCompositionType
(ObjectNameAsString,TypeAsLong)
Returnsthecompositionmodellocationusedbythe
ObjectNamesourceobject:
0:objectisusingalocallydefinedcomposition
1:objectisusingalocallydefinedPVTfile
2:objectisusingthemodelsgloballydefined
compositionorPVTfile
3:objectisusingalocallydefinedMFLfile
GetBoundaryPVTFile(ObjectNameAs
String,PVTFilenameAsString)AsBoolean
GetsthePVTfileusedbythesourcewithidentifier
ObjectName.OnlyapplicableforCompositional/PVT
models
GetBoundaryType(ObjectNameAs
String,TypeAsLong,CurveOptionAs
Long)
Returnstheboundaryconditiontypespecifiedforthe
ObjectNamesource:
Type=0pressureand/orflowratespecified
Type=1PQcurvespecified
IfType=1thenCurveOptionreturns:
CurveOption=0createcurvewhenrequired
CurveOption=1createcurveateveryenginerun
CurveOption=2useaspecifiedPQcurvefile
GetCountObjectsInProfile
(NetObjectNameAsString)AsLong
Returnsthenumberofobjectsinthesinglebranch
modeldefinedforNetObjectName.
GetIsModelRunning()AsBoolean
ReturnsTrueifsimulationisrunning
GetPropertyNames(ObjectNameAs
String,ParentNameAsString,
PropNames)AsLong
ReturnsinPropNamesthelistofpropertiesdefinedfor
theobjectObjectName.IfObjectNameisdefinedatthe
singlebranchlevelthenParentNamemustbethe
identifierforitsparentNetworkobject.Returnvalueis
thenumberofproperties
Page 54
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetPropertyVal(ObjectNameAsString,
ParentNameAsString,PropNameAs
String,pValueAsDouble,pUnitStrAs
String)AsBoolean
Forspecifiedproperty(PropName)inthespecified
object(ObjectName)functiongetsapropertyvaluein
ValueandtheunitsinUnitStr.ReturnvalueisTrueifthe
propertywasretrievedsuccessfully,otherwiseFalse.
ParentNameistheobjectatthenetworkleveland
shoulddefineObjectNameinitssinglebranchmodel.To
getpropertiesofanobjectatnetworklevel,then
ObjectNameneedstobetheobjectnameatnetwork
levelandParentNameneedstobeempty.Implemented
PropNames:seeDefinedconstantsandstrings
GetPropertyValAtObjectIndex
(ObjectNameAsString,ParentNameAs
String,PropNameAsString,pValueAs
Double,pUnitStrAsString,
SubObjectTypeAsLong,IndexAsLong)
AsBoolean
Getsaspecifiedpropertyvalue.
GetPropertyStringAtObjectIndex
(ObjectNameAsString,ParentNameAs
String,PropNameAsString,pValueAs
String,IndexAsLong)AsBoolean
ThefunctionissimilartoGetPropertyValAtObjectIndex
()butforpropertiesdefinedasstring
GetSingleBranchModel(NetObjectName
AsString)AsISingleBranchModel
ReturnstheISingleBranchModelobjectforthe
NetObjectNamespecified
GetNamesInFolder(FolderNameAs
String,ObjectTypeAsLong,pNameArray,
CountAsLong)
ReturnsinpNameArrayanarrayofStringwiththe
namesofobjectsofthegiventype(ObjectType).The
numberofobjectsfoundisreturnedinCount.
Thisfunctionextendsthefunctionalityof
GetPropertyValbyallowingyoutoretrieveaproperty
fromaspecifiedsubcomponentwithinanobject.A
typicaluseofthisiswhenforinstanceitisrequiredto
getagasliftflowrate(PropName)fromthetop(Index=
0)gasliftinjectionpoint(SubObjectType)inthetubing
Tubing_1(ObjectName).ParentNameistheobjectat
thenetworklevelandshoulddefineObjectNameinits
singlebranchmodel.ForavailableoptionsseeDefined
constantsandstrings
AllallowedObjectTypevaluesaredescribedfor
GetNameListfunction
GetNodeCooordinates(ObjectNameAs
String,pCoordArray)AsBoolean
ReturnsthearrayofcoordinatesforGUIelementwith
nameinObjectNameparameter.Valuesarecentral
pointX,centralpointY,left,top,right,andbottom
GetConnectionInfo(pBranchArray,
pSNodeArray,pENodeArray)AsBoolean
Returnsthearrayofallbranchnames,thearrayof
startingnodesandthearrayofendingnodesforthose
branches.
Note:Thestartandendnodesaredeterminedbythe
branchgeometry(e.g.,forflowline,itisconsistentwith
thearrowicondirection)
GetBoundaryCurveFile(ObjectNameAs
String)AsString
Returnstheofflinecurvefilenameforthespecifiedwell
name
Page 55
PIPESIMVersion2011.1OpenLinkReferenceManual
GetCustomData(KeyNameAsString,
pValue)AsBoolean
Returnsavariantbytearrayofthecustomdatathathas
beenstoredagainstthesuppliedKeyNamestring
GetCustomKeys(pKeyNameArray)As
Boolean
ReturnsanarrayoftheKeyNamesstringsforwhich
customdatahasbeenstored
GetFlowrateLimits_SI(ObjectNameas
String)AsVariant
ReturnsatwocolumnarrayofDoublesforspecified
branch.Firstcolumncontainslowerlimitsformass
flowrate,liquidflowrate,waterflowrate,oilflowrate
andgasflowrate.Thesecondonecontainsupperlimits
forthesamerates.
Notethatthesupportoflowerlimitshasbeen
discontinuedbuttheinterfacehasnotchanged.
Therefore,thelowerlimitsvaluesreturnedareallunset.
IsLocalFlowCorrelationUsed(ObjectName ReturnsTrueisabranchorwelluseslocallydefinedflow
correlationandFalseotherwise
asString)AsBoolean
SetBoundaryBlackOil(ObjectName
AsString,BlackOilAsObject)As
Boolean
Setsacompositionalobjecttoasourcewithidentifier
SetBoundaryComposition
(ObjectNameAsString,Composition ObjectName.Onlyapplicableforcompositionalmodels.The
functionreturnsTrueincaseofsuccessandFalseotherwise
AsObject)AsBoolean
SetBoundaryCurveFile(ObjectName Setsthesourceboundaryconditionasdefinedbythecurve
AsString,CurveFileNameAsString) infileCurveFileName.Theformatofthefilemustbethatof
aplotfilerevisionCorlater.Onewaytogeneratea
AsBoolean
boundaryfileisusingtheWellPerformanceCurves
operationinPIPESIM.TheobjectidentifiedbyObjectName
mustbeaProductionWell.
SetBoundaryFluidrate(ObjectName
AsString,FluidtypeAsLong,value
AsDouble,UnitStrAsString)
SetsaBlackOilobjecttoagivensource.Thefunction
returnsTrueincaseofsuccessandFalseotherwise
Setsthegivenvalueinthegivenunitsasfluidrateboundary
conditionforsourceobjectObjectName.Fluidtypecanbe
anyof:
0=liquidrate,1=gasrate,2=massrate
SetBoundaryPressure(ObjectName
AsString,valueAsDouble,UnitStr
AsString)
Setsthegivenvalueinthegivenunitsaspressureboundary
conditionforsourceobjectObjectName.Theboundary
pressurecouldbethepressureofagenericsourcein
network,oragenericsourceinawellbranch,ora
completion(bottommostifmultiple)inawellbranch.
SetBoundaryPVTFile(ObjectName
AsString,PVTFilenameAsString)As
Boolean
SetsaPVTfiletoagivensource.PVTFilenamemustcontain
thefullpathtoaPVTfile
Page 56
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
SetBoundarySourcePQPoints
(ObjectNameAsString,PQPoints,
fluidtypeAsLong,PressureUnitsAs
String,FlowrateUnitsAsString)As
Boolean
Setsanumberofpressureandflowratepairsasaboundary
conditiontothereferredObjectName.PQPointsisa2
dimensionalarrayofpressure/flowratevalues.Theobject
mustbeofthetypegenericsource.Numberofdatapoints
cannotexceed30.
SetBoundaryTemperature
(ObjectNameAsString,valueAs
Double,UnitStrAsString)
Setsthegivenvalueinthegivenunitsastemperature
boundaryconditionforsourceobjectObjectName.The
boundarytemperaturecouldbethetemperatureofa
genericsourceinnetwork,oragenericsourceinawell
branch,oracompletion(bottommostifmultiple)inawell
branch.
SetBoundaryType(ObjectNameAs
String,TypeAsLong,CurveOption
AsLong)
Setsthetypeofboundaryconditionforsourceobject
ObjectName.
Type=0forpressureandflowrateboundarycondition
Type=1forcurve
IftheTypeiscurve(1)ANDthesourceobjectisa
ProductionWellthenCurveOptioncontrolshowthewells
offlinefileiscreatedorused:
CurveOption=0createautomaticallywhenrequired
CurveOption=1createautomaticallyeverytimeengineis
run
CurveOption=2usefile(SeeSetBoundaryCurveFile())
SetPropertyVal(ObjectNameAs
String,ParentNameAsString,
PropNameAsString,valueAs
Double,UnitStrAsString)As
Boolean
Setsthespecifiedproperty(PropName)inthespecified
object(ObjectName)tothevaluegiveninValueinthe
givenunits(UnitStr).FunctionreturnsTrueiftheproperty
wassetsuccessfully,otherwiseFalse.ParentNameisthe
objectatthenetworklevelandshoulddefineObjectName
initssinglebranchmodel.Ifpropertiesofanobjectat
networklevelneedstobeset,thenObjectNameneedsto
betheobjectnameatnetworklevelandParentName
needstobeempty.ImplementedPropNames:seeDefined
constantsandstrings.
SetPropertyValAtObjectIndex
(ObjectNameAsString,ParentName
AsString,PropNameAsString,value
AsDouble,UnitStrAsString,
SubObjectTypeAsLong,IndexAs
Long)AsBoolean
ThisfunctionextendsthefunctionalityofSetPropertyVal
byallowingyoutosetapropertytoaspecifiedsub
componentwithinanobject.Atypicaluseofthisiswhen
forinstanceitisrequiredtosetagasliftflowrate
(PropName)throughthetop(Index=0)gasliftinjection
point(SubObjectType)inthetubingTubing_1
(ObjectName)whichisdefinedforWell_1(ParentName).
ForavailableoptionsseeDefinedconstantsandstrings.
SimilartoSetPropertyValAtObjectIndex()exceptthat
SetPropertyStringAtObjectIndex
(ObjectNameAsString,ParentName PropNameisastringtypeproperty.
AsString,PropNameAsString,value
AsString,IndexAsLong)AsBoolean
Page 57
PIPESIMVersion2011.1OpenLinkReferenceManual
SetPVTFile(bstrPVTFilenameAs
String)
Setsthecompositionalfile(.pvt)tobeusedasthemain
fluidinthesimulations
SetSingleBranchModel
(NetObjectNameAsString,filename
AsString)AsBoolean
Setstheunderlyingsinglebranchmodelbywayofits
associated.bpsfiletoanetworkobject.
SetCustomData(KeyNameAsString,
pValue)AsBoolean
StoresavariantarrayofbytedataagainstaKeyName
string.Thiscanbeusedtopersistadditionalcustomdata,
andcanlaterberetrievedbyspecifyingtheKeyName
SetFlowrateLimits_SI(ObjectName
asString,Limits)
Setsflowratelimitsforspecifiedbranchpassingatwo
columnarrayofDoubles.Firstcolumncontainslowerlimits
formassflowrate,liquidflowrate,waterflowrate,oil
flowrateandgasflowrate.Thesecondonecontainsupper
limitsforthesamerates.
Note:Thesupportoflowerlimitshasbeendiscontinued
buttheinterfacehasnotchanged.Therefore,thelower
limitsvaluesprovidedarenotstored,norusedandwillbe
overriddenbythedefaultunsetvaluesforflowlimits.
BlackOilDefaultAsObject
Gets/setsthedefaultBlackOilmodelto/fromaBlackOil
object
CompositionDefaultAsObject
Gets/setsthedefaultcompositionto/fromaComposition
object
FlowCorrelationAsObject
Gets/setstheflowcorrelationpropertiesto/froma
FlowCorrelationobject
UseNetworkFlowCorrelationOption
sControlAsLong
Gets/setstheflagvaluetousenetworkflowcorrelation
optionscontrol(if=1)ortouselocalbranchoptions(if=0)
FluidModelTypeAsLong
0:BlackOil,1:Compositional,2:PVTFile,3:MFLFile
LocalFluid(ObjectNameAsString)
AsFluidModel
Gets/setstheFluidobjectforthespecifiedobject
(ObjectName)
ModelFileNameAsString
Returnsthefilepathofthecurrentmodel
ModelBuilderAsModelBuilder
ReturnsaModelBuilderobjectseeModelBuilder
ProjectInfoAsProjectInfo
GettheProjectInfoobjecttoaccessprojectspecificdata
ErosionCorrosionAsObject
Gets/setstheErosionCorrosionobject
UseNetErCorrSettingsAsLong
Gets/setstheflagvaluetousenetworkerosion&corrosion
settingsoverlocalbranchessettings(if=1)ortouselocal
settingsotherwise
BottomKeywordsAsString
Gets/setsthenetworkenginekeywordstobeaddedat
bottomoftntfile
TopKeywordsAsString
Gets/setsthenetworkenginekeywordstobeaddedontop
Page 58
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
oftntfile
AppVersionAsString
GetstheversionofPIPESIM
IsLocalFluidUsed(ObjectNameAs
String)AsBoolean
ReturnsTrueifaspecifiedbranchornetworksourceareset
tousealocalydefinedfluidorifaproductionwellis
multilayered.otherwiseapropertyissettoFalse(network
defaultfluidisused)
Note:Propertyisreadonly
HeatTransferOptionsPipeBurialMet
hodAslong
Gets/setstheflagvalueforheattransferoptionspipeburial
method:
1983:1983method
2000:2000method(settothisvalueifgivenvalueisnot
1983,2000,or2009)
2009:2009method
HeatTransferOptionsIFCMethodAs
long
Gets/setstheflagvalueforheattransferoptionsinsidefilm
coefficientmethod:
1:Kaminsky
2:KreithSeparateReynoldsnumber(settothisvalueifgiven
valueisnot1,or2)
HeatTransferOptionsUValueMultipl
ierAsdouble
Gets/setsthevalueforheattransferoptionsUvalue
multiplier
EnableHydrateSubcoolingCalculatio
nAslong
Gets/setstheflagvalueforheattransferoptionshydrate
subcoolingcalculation:
0:disable
1:enable(settothisvalueifgivenvalueisnot0,or1)
Note:Propertyisforcompositionalmodelsonly
UseNetworkHeatTransferOptions
Aslong
Gets/setstheflagvaluetousenetworkheattransferoptions
(if=1)ortouselocalbranchoptions(if=0)
ExportEngineFiles()
ThisfunctiongeneratesanASCIIfile(.tnt)andanumberof
ASCIIfiles(.pst)inthePIPESIMenginekeywordlanguagethat
isusedasinputbythecalculationengine.This.tntfilecan
thenbeusedwithPIPESIMexpertmode.
KillSimulationProcess()
Terminatesthesimulationprocess
OpenModel(bstrModelFileNameAs Opensthegivennetworkmodel.Filenamemustbeavalid
PIPESIMnetworkmodelfile(.bpn)
String)
Thisfunctionmustbecalledfirstwhenusingthisobject.
Note:Willreturnfalsealsoifthenumberofcomponentin
anycompositionorinthemodelingeneralismorethan50.
Page 59
PIPESIMVersion2011.1OpenLinkReferenceManual
RunNetwork(bRestartAsBoolean)
Runsthecurrentlyopenedmodelbycallingthecalculation
engineprogramasspecifiedinthePIPESIMinstallation.
IfbRestartisTruethesimulationwillloadanypreviously
restartfiles(.rstfiles)asitsinitialconditions.
RunNetwork2(bRestartAsBoolean, SimilartoRunNetworkandalsoacceptsoneormore
switchestobepassedtothesimulationengine.
EngSwitchesAsString)
SaveModel(bstrPathNameAs
String)AsBoolean
Savesthecurrentlyopenedmodeltoafilegivenby
bstrPathName
ResetLocalErCorrSettings()As
Boolean
Overridesalllocalerosionandcorrosionsettingswiththe
globalones
ModelBuilder object
SetNodeCoordinates(NodeNameAs SetsthenodecoordinatesfornodeobjectNodeNametoX,Y
coordinates
String,XAsLong,YAsLong)
TopLeftCoordinate_XAsLong
Sets/returnsthetopleftXcoordinateofthegraphicalpanel.
SetNodeCoordinatesvaluesarepassedinrelationto
TopLeftCoordinate_XandTopLeftCoordinate_Y
TopLeftCoordinate_YAsLong
AsabovefortheYcoordinate
BottomRightCoordinate_XAsLong
ReturnsthebottomrightXcoordinateofthegraphicalpanel
(thisisareadonlyproperty)
BottomRightCoordinate_YAsLong
AsabovefortheYcoordinate
GetNodeCoordinates(NodeName
AsString,XAsLong,YAsLong)
GetsthenodeX,YcoordinatesfornodeobjectNodeName
GetLastError()AsString
Returnsthelasterrormessageproducedbytheobject
IBlackOil object
IBlackOil object - Properties
APIAsDouble
APIvalue
API_TypeAsInteger
APItype(0=API,1=DOD)
ConingEnabledAsBoolean
True/False
ConingGasSGAsDouble
Coninggasspecificgravity
ConingRateTypeAsLong
0:liquid,1:gas,2:mass
ConingTable_SIAsVariant
A3columnarraywithrate,gor/glr,wcutvalues,usestrictSI
units
GasSGAsDouble
Blackoilspecificgravity
GLR_SIAsDouble
Gas/LiquidRatiousestrictSIunits
Page 60
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GOR_SIAsDouble
Gas/OilRatiousestrictSIunits
GOR_TypeAsInteger
(0=GLR,1=GOR,2=LGR,3=OGR)
LGR_SIAsDouble
Liquid/GasRatiousestrictSIunits
OGR_SIAsDouble
Oil/GasRatiousestrictSIunits
SolutionGasCorrelationAsLong
0=Lasater,1=Standing,2=VazquezandBeggs,3=Glaso,4
=Kartoatmodjo
WatercutAsDouble
WaterCut
WaterSGAsDouble
Waterspecificgravity
NameAsString
Nameofthefluid
CommentAsString
Stringcontainingthetextinthecommentsfield
CalibrationAsLong
Calibrationtype:0nocalibration,1singlepointand2
multipoint
SinglePointCalibAsObject
Singlepointcalibrationdataobject
MultiPointCalibAsObject
Multipointcalibrationdataobject
ViscosityAsObject
Stringcontainingthetextinthecommentsfield
ThermalDataAsObject
Stringcontainingthetextinthecommentsfield
ContaminantsAsVariant
ArrayofDoublesforcontaminantvaluesinafollowingorder:
CO2,H2S,N2,H2andCO
WGR_TypeAsInteger
(0=Watercut,1=GWR,2=WGR)
GWR_SIAsDouble
Gas/WaterRatiousestrictSIunits
WGR_SIAsDouble
Water/GasRatiousestrictSIunits
SetBubblePointCalibration
(SatGas_SIAsDouble,Pressure_SI
AsDouble,Temperature_SIAs
Double)
Setsthebubblepointdata
GetBubblePointCalibration
(Pressure_SIAsDouble,
Temperature_SIAsDouble)As
Double
Getsthebubblepointdata.ReturnvalueisaSaturationGas
correlation:0forLasater,1forStanding,2forVazquezand
Beggs,3forGlaso,4forKartoatmodjo,5forDeGhettoatal
or6forPetroskyFarshad
SetBlob(sBlobAsString)
Setsdatafortherequiredfluid
sBlob=Stringcontainingblackoilinformation
Page 61
PIPESIMVersion2011.1OpenLinkReferenceManual
ISinglePointCalib object
ISinglePointCalib object Get Methods
GetCalibrationAtBubblePoint
(Pressure_SIAsDouble,
Temperature_SIAsDouble,
SatGas_SIAsDouble)asLong
Functiongetscalibrationdataatbubblepoint.Thereturn
valueisSaturationGascorrelation:0forLasater,1for
Standing,2forVazquezandBeggs,3forGlaso,4for
Kartoatmodjo,5forDeGhettoetal.or6forPetroskyFarshad
GetCalibrationAboveBubblePoint
(OFVFAsDouble,Density_SIas
Double,Compressibility_SIas
Double,Pressure_SIAsDouble,
Temperature_SIAsDouble)asLong
Functiongetscalibrationdataabovebubblepoint.The
returnvalueisdensitytype:0forDensity,1forOFVFor3for
Compressibility
GetCalibrationBelowBubblePoint
(OFVFAsDouble,Density_SIas
Double,Pressure_SIAsDouble,
Temperature_SIAsDouble)asLong
Functiongetscalibrationdatabelowbubblepoint.The
returnvalueisdensitytype:0forDensityor1forOFVF
GetLiveOilViscBelowBubblePoint
(Pressure_SIAsDouble,
Temperature_SIAsDouble,
LiveOilVisc_SI)asLong
Functiongetsliveoilviscositydatabelowbubblepoint.The
returnvalueisLiveOilViscosityCorrelation:0forBeggs&
Robinson,1forChew&Connally,2forKartoatmodjo,3for
Khan,4forDeGhettoetal.,5forHossain,6forElsharkawyor
7forPetroskyFarshad
GetGasViscBelowBubblePoint
(Pressure_SIAsDouble,
Temperature_SIAsDouble)as
Double
Functiongetsgasviscositydatabelowbubblepoint.The
returnvalueisgasviscosity.
GetGasZBelowBubblePoint(GasZas FunctiongetsgasZdatabelowbubblepoint.Thereturn
valueisgasZcorrelation:0forStanding,1forHall
Double,Pressure_SIAsDouble,
Temperature_SIAsDouble)asLong Yarboroughor2forRobinsonetal.
SetCalibrationAtBubblePoint(SolGasCorr
asLong,Pressure_SIAsDouble,
Temperature_SIAsDouble,SatGas_SIAs
Double)
Functionsetscalibrationdataatbubblepoint.The
acceptablevaluesforSaturationGascorrelationare:0
forLasater,1forStanding,2forVazquezandBeggs,3
forGlaso,4forKartoatmodjo,5forDeGhettoetal.or6
forPetroskyFarshad
SetCalibrationAboveBubblePoint
(DensTypeasLong,OFVFAsDouble,
Density_SIasDouble,Compressibility_SI
asDouble,Pressure_SIAsDouble,
Temperature_SIAsDouble)
Functionsetscalibrationdataabovebubblepoint.The
acceptablevaluesfordensitytypeare:0forDensity,1
forOFVFor3forCompressibility
SetCalibrationBelowBubblePoint
(DensTypeasLong,OFVFAsDouble,
Functionsetscalibrationdataabovebubblepoint.The
acceptablevaluesfordensitytypeare:0forDensityor1
Page 62
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Density_SIasDouble,Pressure_SIAs
Double,Temperature_SIAsDouble)
forOFVF
SetLiveOilViscBelowBubblePoint
(LiveOilCorrasLong,Pressure_SIAs
Double,Temperature_SIAsDouble,
LiveOilVisc_SI)
Functionsetsliveoilviscositydatabelowbubblepoint.
TheacceptablevaluesforLiveOilViscosityCorrelation
are:0forBeggs&Robinson,1forChew&Connally,2
forKartoatmodjo,3forKhan,4forDeGhettoetal.,5
forHossain,6forElsharkawyor7forPetroskyFarshad
SetGasViscBelowBubblePoint
(Pressure_SIAsDouble,Temperature_SI
AsDouble,GasVisc_SIasDouble)
Functionsetsgasviscositydatabelowbubblepoint.
SetGasZBelowBubblePoint(GasZCorras
Long,GasZasDouble,Pressure_SIAs
Double,Temperature_SIAsDouble)
FunctionsetsgasZdatabelowbubblepoint.The
acceptablevaluesforgasZcorrelationare:0for
Standing,1forHallYarboroughor2forRobinsonetal.
IMultiPointCalib object
IMultiPointCalib object Properties
OFVFasBoolean
TrueforOilFVForFalseforOilDensity
GetCalibUnits(UnitsArray)
FunctionreturnsanarrayofStringscontainingunitsfor
Pressure,SolutionGasGOR,OilDensity,OilViscosityandGas
Viscosity
GetCorrelations(CorrArray)
FunctionreturnsanarrayofLongscontainingcorrelationsfor
SolutionGas,OFVF,OilViscosity,GasZfactorandGas
Viscosity.Availablevaluesforeachcorrelationarethesame
asforISinglePointCalibmethods
GetTemperature(ValueAsDouble,
UnitsasString)
Functionreturnsacalibrationtemperatureandunits.
GetCalibrationAtBubblePoint
(CalibData)
Functiongetscalibrationdataatbubblepointasanarrayof
Doubles.ItcontainsvaluesforPressure,SolutionGas,OFVF
orDensity,OilViscosity,GasZfactorandGasViscosity.All
valuesareinunitssuppliedbyGetCalibUnitsmethod
GetCalibrationAboveBubblePoint
(CalibData)
Functiongetscalibrationdataabovebubblepointasatwo
dimensionalarrayofDoubles.Eachrowcontainsvaluesfor
Pressure,SolutionGas,OFVForDensity,OilViscosity,GasZ
factorandGasViscosity.Allvaluesareinunitssuppliedby
GetCalibUnitsmethod
GetCalibrationBelowBubblePoint
(CalibData)
Functiongetscalibrationdatabelowbubblepointasatwo
dimensionalarrayofDoubles.Eachrowcontainsvaluesfor
Pressure,SolutionGas,OFVForDensity,OilViscosity,GasZ
Page 63
PIPESIMVersion2011.1OpenLinkReferenceManual
factorandGasViscosity.Allvaluesareinunitssuppliedby
GetCalibUnitsmethod
Page 64
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
SetCalibUnits(UnitsArray)
FunctionsetsunitsforPressure,SolutionGasGOR,Oil
Density,OilViscosityandGasViscositysuppliedasanarrayof
Strings
SetCorrelations(CorrArray)
FunctionsetscorrelationsforSolutionGas,OFVF,Oil
Viscosity,GasZfactorandGasViscositysuppliedasanarray
ofLongs.Availablevaluesforeachcorrelationarethesame
asforISinglePointCalibmethods
SetTemperature(ValueAsDouble
UnitsasString)
Functionsetsacalibrationtemperatureinspecifiedunits.
SetCalibrationAtBubblePoint
(CalibData)
Functionsetscalibrationdataatbubblepointpassedasan
arrayofDoubles.ItmustcontainvaluesforPressure,
SolutionGas,OFVForDensity,OilViscosity,GasZfactorand
GasViscosity.AllvaluesareinunitssuppliedbyGetCalibUnits
method
SetCalibrationAboveBubblePoint
(CalibData)
Functionsetscalibrationdataabovebubblepointpassedasa
twodimensionalarrayofDoubles.Eachrowmustcontain
valuesforPressure,SolutionGas,OFVForDensity,Oil
Viscosity,GasZfactorandGasViscosity.Allvaluesareinunits
suppliedbyGetCalibUnitsmethod
SetCalibrationBelowBubblePoint
(CalibData)
Functionsetscalibrationdatabelowbubblepointpassedasa
twodimensionalarrayofDoubles.Eachrowmustcontain
valuesforPressure,SolutionGas,OFVForDensity,Oil
Viscosity,GasZfactorandGasViscosity.Allvaluesareinunits
suppliedbyGetCalibUnitsmethod
IViscosityData object
IViscosityData object Properties
DeadOilCorrasLong
DeadOilViscositycorrelation.Possiblevaluesare:0forBeggs
&Robinson,1forGlaso,2forKartoatmodjo,3forDeGhetto
etal.,4forHossain,5forElsharkawy,6forPetroskyFarshad,
7foruserspecified2pointsor8forusersuppliedtable
LiveOilCorrasLong
LiveOilViscositycorrelation.Possiblevaluesare:0forBeggs
&Robinson,1forChew&Connally,2forKartoatmodjo,3for
Khan,4forDeGhettoetal.,5forHossain,6forElsharkawyor
7forPetroskyFarshad
EmulViscosityasLong
EmulsionViscosityMethod.Possiblevaluesare:0for
continuousphase,1forvolumeratio,2forPipesimOriginal
WoelflinLooseEmulsion,3forWoelflinLooseEmulsion,4for
Page 65
PIPESIMVersion2011.1OpenLinkReferenceManual
WoelflinMediumEmulsion,5forWoelflinTightEmulsion,6
forBrinkman,7forVandwithVandcoefficients,8forVand
withBarnea&Mizrahicoefficients,9forVandwithuser
suppliedcoefficients,10forRichardson,11forLeviton&
Leightonand12forusersuppliedtable
UndersaturatedOilViscosity.Possiblevaluesare:0for
Vasquez&Beggs,1forKouzel,2forKartoatmodjo,3forKhan,
4forDeGhettoetal.,5forHossain,6forElsharkawy,7for
Bergman&Sutton,8forPetroskyFarshador9fornone
UsatOilViscosityasLong
GetDOPoints(Temp1asDouble,
Temp2asDouble,TUnitsasString,
Visc1asDouble,Visc2asDouble,
VUnitsasString)
FunctionreturnstemperatureandviscosityvaluesforDead
Oilforuserspecified2pointDeadOilViscosityCorrelation
GetUserViscTable_SI(Table)
FunctionreturnsatwocolumnarrayofDoublescontaining
valuesforTemperatureandViscosityforusersuppliedtable
DeadOilViscosityCorrelation
GetUserEmulTable_SI(Typeas
Long,Table)
FunctionreturnsathreecolumnarrayofDoublescontaining
valuesforTemperature,ViscosityRatioandViscosityforuser
suppliedtableEmulsionViscosity.Typeequals0for
TemperatureViscosityRatiotableor1forTemperature
Viscositytable.
GetWCutCutoff(MethodasLong,
WCutAsDouble,UnitsasString)
Functionreturnsawatercutcutoffmethod(0foruser
definedor1forBrauner&Ullman)andacutoffvalueand
units.
GetEmulCoeffs(MethodasLong,
Coeff1asDouble,Coeff2asDouble)
Functionreturnsaemulsionviscositymethodanduser
suppliedcoefficientsifapplicable.Methodequals9forVand
withusersuppliedcoefficients,10forRichardsonor1forall
otherchosenmethods.
GetKouzelCoeffs(ParAasDouble,
ParBasDouble)
FunctionreturnsKouzelcoefficientsforUndersaturatedOil
Viscosity
SetDOPoints(Temp1asDouble,
Temp2asDouble,TUnitsasString,
Visc1asDouble,Visc2asDouble,
VUnitsasString)
FunctionsetstemperatureandviscosityvaluesforDeadOil
foruserspecified2pointDeadOilViscosityCorrelation
SetUserViscTable_SI(Table)
FunctionsetsausersuppliedtableforDeadOilViscosity
CorrelationpassingatwocolumnarrayofDoublescontaining
valuesforTemperatureandViscosity.
SetUserEmulTable_SI(TypeasLong, FunctionsetsausersuppliedtableforEmulsionViscosity
Page 66
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Table)
passingathreecolumnarrayofDoublescontainingvaluesfor
Temperature,ViscosityRatioandViscosityfor.Typeequals0
forTemperatureViscosityRatiotableor1forTemperature
Viscositytable.
SetWCutCutoff(MethodasLong,
WCutAsDouble,UnitsasString)
Functionsetsawatercutcutoffmethod(0foruserdefinedor
1forBrauner&Ullman)andacutoffvalueinspecifiedunits.
SetEmulCoeffs(MethodasLong,
Coeff1asDouble,Coeff2asDouble)
Functionsetsusersuppliedcoefficientsforcorresponding
emulsionviscositymethod.Methodmustbe9forVandwith
usersuppliedcoefficientsor10forRichardson.
SetKouzelCoeffs(ParAasDouble,
ParBasDouble)
FunctionsetsKouzelcoefficientsforUndersaturatedOil
Viscosity
IThermal object
IThermal object properties
EnthalpyCalculationMethodasLong EnthalpyCalculationMethod.Possiblevaluesare:0for1983
Method,or1for2009Method.
SpecificLatentHeat_SIasDouble
SpecificLatentHeatinSIunit(J/kg).
GetConductivity(Values,Unitsas
String)
Functionreturnsanarrayof3DoublescontainingGas,Oil
andWaterthermalconductivityvaluesandaunitsstring
GetEnthropy(Values,Unitsas
String)
Functionreturnsanarrayof3DoublescontainingGas,Oil
andWaterheatcapacityvaluesandaunitsstring
SetConductivity(Values,Unitsas
String)
SetEnthropy(Values,UnitsasString) FunctionsetsvaluesforGas,OilandWaterheatcapacities
passedasanarrayof3Doublesinspecifiedunits
FunctionsetsvaluesforGas,OilandWaterthermal
conductivitiespassedasanarrayof3Doublesinspecified
units
Page 67
PIPESIMVersion2011.1OpenLinkReferenceManual
ICompositional object
ICompositional object - Properties
Nameofthefluid
NameAsString
GetComment()AsString
Returnsastringcontainingthetextinthecommentsfield
GetPackageType()AsLong
ReturnstheCompositionalPackageTypetouseaslong
integeraccordingtothefollowingformula:
0=SISFlash,1=Multiflash,2=SPPTS,101=Eclipse300,102
=DBR,103=GERG,104=REFPROPV8
pVar=FalseiftheflashpackageisSISandBSTRholdsthe
deprecationmessageforSISflash.
GetInputOK(pBSTR,pVar)
pVar=TrueiftheflashpackageisnotSISandBSTRisempty.
GetComponentList
GetComponentList(pVart,pVar,
pVar2,HydComp1AsLong,
AquComp1AsLong)AsLong
Returnsthecurrentcomponentnameslist.
pVar=listofcomponentnamesasanarrayofstrings
pVar2=listofhydrocarbonnamesasanarrayofstrings
pVar3=listofaqueousnamesasanarrayofstrings
AquComp1=numberofaqueouscomponents
HydComp1=numberofaqueouscomponents.
Returnstotalnumberofcomponents
GetLibraryComptBP(pVar)
Returnstheboilingpointsofthelibrarycomponentssetby
SetLibraryComptCalculator.
pVar=listofboilingpointsasanarrayofdoubles.
GetLibraryComptMW(pVar)
Returnsthemolecularweightofthelibrarycomponentsset
bySetLibraryComptCalculator.
pVar=listofmolecularweightsasanarrayofdoubles.
GetLibraryComptOM(pVar)
Returnstheacentricfactorsofthelibrarycomponentssetby
SetLibraryComptCalculator.
pVar=listofacentricfactorsasanarrayofdoubles.
GetLibraryComptPC(pVar)
Returnsthecriticalpressuresofthelibrarycomponentsset
bySetLibraryComptCalculator.
pVar=listofcriticalpressuresasanarrayofdoubles.
GetLibraryComptSG(pVar)
Returnsthespecificgravitiesofthelibrarycomponentssetby
SetLibraryComptCalculator.
Page 68
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
pVar=listofspecificgravitiesasanarrayofdoubles.
GetLibraryComptTC(pVar)
Returnsthecriticaltemperaturesofthelibrarycomponents
setbySetLibraryComptCalculator.
pVar=listofcriticaltemperaturesasanarrayofdoubles.
GetLibraryList(pVar)AsLong
pVar=listofcomponentdescriptorsasanarrayofBooleans
withthevaluescorrespondingtothecomponentnames
returnedfromGetComponentList.
True=normalcomponent
False=userdefined(petroleumfraction)component.
Returnvalueisasizeofthearray.
GetMolarList(pVar)AsLong
pVar=listofmolarflowratesasanarrayofDoubleswiththe
valuescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
GetMolWeightList(pVar)AsLong
pVar=listofmolecularweightsasanarrayofdoubleswith
thevaluescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
GetBoilingPointList(pVar)AsLong
pVar=listofboilingpointsasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
GetSpecificGravityList(pVar)As
Long
pVar=listofspecificgravitiesasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
GetCriticalPressureList(pVar)As
Long
pVar=listofcriticalpressuresasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray
GetCriticalTemperatureList(pVar)
AsLong
pVar=listofcriticaltemperaturesasanarrayofdoubleswith
thevaluescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
GetAcentricFactorList(pVar)As
Long
pVar=listofacentricfactorsasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamesreturned
fromGetComponentList.
Returnvalueisasizeofthearray.
Page 69
PIPESIMVersion2011.1OpenLinkReferenceManual
SetComment(sCommentAsString)
Setsastringinthecommentsfieldofthecompositional
description 1 .
SetPackageType(lPackageTypeAs
Long)
SetstheCompositionalPackageTypetouse.Thefollowing
valuesoflPackageTypewillsetthepackageasdescribed:
0=SISFlash,1=Multiflash,2=SPPTS,101=Eclipse300,102
=DBR,103=GERG,104=REFPROPV8
SetComponentList(pVar,CompNum Setsthecomponentnameslist.
AsLong,pVar2,CompNum2As
pVar=listofhydrocarbonnamesasanarrayofstrings
Long)
pVar2=listofaqueousnamesasanarrayofstrings
CompNum=numberofhydrocarboncomponents
CompNum2=numberofaqueouscomponents 2 .
Note:Thetotalnumberofcomponentsislimitedto50.
Returnfalseifmorethan50componentsisprovided
SetMolarList(pVar,CompNumAs
Long)
pVar=listofmolarflowratesasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamessetin
SetComponentListensuringthatthemolarflowratesofthe
aqueouscomponentscomeafterthemolarflowratesofthe
hydrocarboncomponents.
CompNum=totalnumberofcomponents
SetLibraryList(pVar,CompNumAs
Long)
pVar=listofcomponentdescriptionsasanarrayofbools
withthevaluescorrespondingtothecomponentnamesset
inSetComponentListensuringthatthecomponent
descriptionsoftheaqueouscomponentscomeafterthe
componentdescriptionsofthehydrocarboncomponents.
CompNum=totalnumberofcomponents
SetLibraryComptCalculator(pVar,
CompNumAsLong)
pVar=listoflibrarycomponentnamesONLYasanarrayof
strings.
CompNum=numberofcomponentswithintheabovelist.
SetLibraryComptCalculatorsetsthelibrarycomponent
nameswithinthecompositionalmoduleandcalculatesthe
componentparameters.
1
2
Before any set methods are called in Icompositional Interface CreateNewComposition must be called
After all the set methods are called from Icompositional Interface UpdateComposition must be called
Page 70
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
SetMolwtList(pVar,CompNumAs
Long)
pVar=listofmolecularweightsasanarrayofdoubleswith
thevaluescorrespondingtothecomponentnamessetin
SetComponentListensuringthatthemolecularweightsofthe
aqueouscomponentscomeafterthemolecularweightsof
thehydrocarboncomponents.
CompNum=totalnumberofcomponents.
SetPvtFile(sFileAsString,
bIsPVOFileAsBOOL,iPVOUnitsAs
Int)
Callsthecompositionalpvtfilereadertoreadtheinputted
pvtfile.
sFile=pvt/ptt/pvofilename.
bIsPVOFile:Trueforfilenamewithpvoextension,andfalse
(default)otherwise.
iPVOUnits=pvofileunitsystem:0(default)formetric,1for
field.ThisvalueisignoredifbIsPVOFileisfalse.
SetBoilingPointList(pVar,
CompNumAsLong)
pVar=listofboilingpointsasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamessetin
SetComponentListensuringthattheboilingpointsofthe
aqueouscomponentscomeaftertheboilingpointsofthe
hydrocarboncomponents.
CompNum=totalnumberofcomponents
SetSpecificGravityList(pVar,
CompNumAsLong)
pVar=listofspecificgravitiesasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamessetin
SetComponentListensuringthatthespecificgravitiesofthe
aqueouscomponentscomeafterthespecificgravitiesofthe
hydrocarboncomponents.
CompNum=totalnumberofcomponents
SetCriticalPressureList(pVar,
CompNumAsLong)
pVar=listofcriticalpressuresasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamessetin
SetComponentListensuringthatthecriticalpressuresofthe
aqueouscomponentscomeafterthecriticalpressuresofthe
hydrocarboncomponents.
CompNum=totalnumberofcomponents
SetCriticalTemperatureList(pVar,
CompNumAsLong)
pVar=listofcriticaltemperaturesasanarrayofdoubleswith
thevaluescorrespondingtothecomponentnamessetin
SetComponentListensuringthatthecriticaltemperaturesof
theaqueouscomponentscomeafterthecritical
temperaturesofthehydrocarboncomponents.
CompNum=totalnumberofcomponents.
SetAcentricFactorList(pVar,
CompNumAsLong)
pVar=listofacentricfactorsasanarrayofdoubleswiththe
valuescorrespondingtothecomponentnamessetin
SetComponentListensuringthattheacentricfactorsofthe
aqueouscomponentscomeaftertheacentricfactorsofthe
hydrocarboncomponents.
CompNum=totalnumberofcomponents
Page 71
PIPESIMVersion2011.1OpenLinkReferenceManual
CreateNewComposition()
Blanksallcompositionalarraysandparametersinmemory
UpdateComposition()
Updatesallcompositionalarraysandparametersinmemory
SetBlob(sBlobAsString)
Setsdatafortherequiredcomposition
sBlob=Stringcontainingcompositionalinformation 3 .
ICompositional2 object
ICompositional2 object - Properties
EosAsLong
Gets/Setsanequationofstate(seeAppendixforallallowed
options)
ViscosityModelAsLong
Gets/Setsaviscositymodel(seeAppendixforallallowed
options)
BipAsLong
Gets/SetsaBIPset(seeAppendixforallallowedoptions)
EmulsionAsLong
Gets/Setsanemulsion(seeAppendixforallallowedoptions)
ThermalConductivityAsLong
Getsathermalconductivity(0=None)
SurfaceTensionAsLong
Getsasurfacetension(0=None)
FlowCorrelations Interface
CIFlowCorrelation object - Get Methods
GetHorizontalCorrelationName()
AsString
Returnsthehorizontalcorrelationname.Thereturnedstring
isauniquekeywordname.
GetHorizontalSourceName()As
String
Returnsthecorrelationssourcename(suchasbja,tulsa)
GetVerticalCorrelationName()As
String
Returnstheverticalcorrelationname.Thereturnedstringisa
uniquekeywordname(forexampleANSAR,BJA,BBR,BBOTD)
GetVerticalSourceName()AsString
Returnsthecorrelationssourcename(suchasbja,tulsa)
Page 72
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetSensitivityItems(VerticalCorrs
AsBoolean,Items)AsLong
Returnsthe4columnarray(helpstring,enginecode,main
codeandquantityclass)ofavailablesensitivityvariablesin
ItemsforVertical(ifVerticalCorrsisTrue)orHorizontal
(VerticalCorrsisFalse).Numberofitemsisafunctionsreturn
value
SetHorizontalCorrelation(sSource
AsString,sCorrelationAsString)
Setahorizontalcorrelation.Forexample,fortheBJA
correlationsourceitcanbeanyof:BBO,BBOTD,BBR,BBRTD,
BJA,DKAGAD,DKAGAF,DR,DRTD,LOCKMAR,LOCKMARTD,
MB,NOSLIP,OLIEMANS,XIAOorTU2P,andforTulsasourceit
canbeoneoffollowing:TBB,TDUKorTMB
sSourcecanbeBJA,TULSA
SetHorizUserCorrelation(sSource
AsString,sCorrelationAsString)
Setahorizontalusercorrelation
SetVerticalCorrelation(sSourceAs
String,sCorrelationAsString)
Setaverticalsourceandcorrelation.Forexampleforthe
Tulsacorrelationsourceitcanbeanyof:TBB,TDR,TGA,THB,
TMBorTORK,andforBJAsourceitcanbeoneoffollowing:
ANSARI,BBO,BBR,DR,GA,GRAYM,GRAYO,HBR,HBRDR,
MB,NOSLIP,ORKorTU2P.
sSourcecanbeBJA,TULSA
SetVertUserCorrelation(sSourceAs
String,sCorrelationAsString)
Setaverticalusercorrelation
SwapAngleAsDouble
VerticalHorizontalCorrelationSwapAngle
HorizontalFrictionFactorAsDouble
HorizontalFrictionFactor
VerticalFrictionFactorAsDouble
VerticalFrictionFactor
VerticalHoldupAsDouble
VerticalHoldup
HorizontalHoldupAsDouble
HorizontalHoldup
SinglePhaseCorrelationAsString
Anyof:Moody,AGA,PanA,PanB,HazWill,Weymouth,
CULSMITH
SinglePhaseFactorAsDouble
Singleflowcorrelationcoefficient(ifapplicable)
Note:SeethePIPESIMhelpforthecompletelistofavailableverticalandhorizontalflowcorrelationsand
sources.
Page 73
PIPESIMVersion2011.1OpenLinkReferenceManual
DisplayDialog()
DisplaysPIPESIMdialogforflowcorrelation(thismethodis
obsolete,useDisplayDialog2instead).
DisplayDialog2()AsBoolean
DisplaysPIPESIMdialogforflowcorrelation().
ReturnvalueisTrueifdataischangedandFalseotherwise
ICFlowCorrelations2 Interface
ICIFlowCorrelation2 object - Set Methods
SetHorizontalCorrelation2
(sCorrelationAsString,frictionas
double,[in]holdupasdouble)
Setmethodname(sCorrelation),frictionfactor(friction)and
holdupfactor(holdup)forthehorizontalflowcorrelation
SetVerticalCorrelation2
(sCorrelationAsString,frictionas
double,[in]holdupasdouble)
Setmethodname(sCorrelation),frictionfactor(friction)and
holdupfactor(holdup)fortheverticalflowcorrelation
Systems Analysis
ISystemsAnalysis Object - Properties
BoundaryCondsAsIBoundaryProps
Get/setpropertytoaccessboundaryconditions.Seethe
definitionofIBoundaryPropsInterfaceforitsmethodsand
properties
EngineAsIEngineOptions
GetstheIEngineOptionsobjecttosetsimulationparameters
andruntheoperation.SeeIEngineOptionsInterfaceforits
Page 74
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
methodsandproperties
FixedInjectionDepthsAsBoolean
Applicabletogasliftedsystems,thispropertysets/gets
whethergasliftvalvesareinstalledinthetubing
PermuteStepModeAsLong
Sets/getswhetherthesensitivityvaluesforthedifferent
variablesare
0:Permutedagainsteachotheror
1:ChangedinstepwithSensVar1or
2:ChangedinstepwithXaxis.
PermuteSensVarsAsBoolean
Sets/getswhetherthesensitivityvaluesforthedifferent
variablesarepermutedagainsteachotherorchangedinstep.
Thisisanobsoletepropertyandmaybehiddeninthefuture.
ThenewpropertyPermuteStepModemustbeusedinstead
ofthis(seeabove).ForthecompatibilityPermuteSensVars=
true/falsemeansthatPermuteStepMode=0/1.
MaxSensitivityVarsAsLong
Getsthemaxavailablenumberofthesensitivityvariables
allowedfortheoperation
SensitivityObject(indxAsLong)As
String
indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
sensitivity.
Returnsthesensitivityobjectnameforthespecifiedindex.
SensitivityVariable(indxAsLong)As indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
String
sensitivity.
Returnsthesensitivityvariablenameforthespecifiedindex
GetIsUnset()AsBoolean
ReturnsTrueiftheoperationsdataisallblank(unset)
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
GetSensitivityData_SI(indxAsLong, Returnsthesensitivitydataspecifiedfortheoperation.
ObjectStrAsString,VarStrAsString, Indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
Values_SI,QuantClassAsString)
0,1,2,,(MaxSensitivityVars1)forthecorresponding
sensitivity.
ObjectStr:theobjectnameisreturnedhere
VarStr:thesensitivityvariablenameisreturnedhere
Values_SI:anarrayofdoublevaluesinstrictSIunits
containingthelistofsensitivityvalues
QuantClass:theunitclassnamefortheselectedsensitivity
variable.SeeUnitSystemforalistofunitclasses
Page 75
PIPESIMVersion2011.1OpenLinkReferenceManual
SetSensitivityData(indxAsLong,
ObjectStrAsString,VarStrAsString,
Values_DefEng,vbActiveAs
Boolean)
Setsthesensitivityinformation.
Indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
sensitivity.
ObjectStr:theobjectname
VarStr:thesensitivityvariablename
Values_DefEng:anarrayofdoublevaluesindefault
engineeringunitscontainingthelistofsensitivityvalues
vbActive:setsthesensitivitygroupactive(True)orinactive
(False)
SetSensitivityData_SI(indxAsLong,
ObjectStrAsString,VarStrAsString,
Values_SI,vbActiveAsBoolean,
QuantClassAsString)
SimilartoSetSensitivityData,butusesstrictSIunits
indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
sensitivity.
ObjectStr:theobjectname
VarStr:thesensitivityvariablename
Values_DefEng:anarrayofdoublevaluesindefault
engineeringunitscontainingthelistofsensitivityvalues
vbActive:setsthesensitivitygroupactive(True)orinactive
(False)
QuantClass:measurementstring(forexampletemperature,
pressureetc.)
SetLanguage(nlLanguageIDAsLong) Setstheuserinterfacelanguage
AsBoolean
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
WriteOperationFile()AsBoolean
WritesanASCIIfile(modelname.inc)containingthe
instructionstothesimulationenginetoruntheoperation.
DisplayDialog(p_VarUnitManager,
CloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.ReturnsTrueifdialogboxwas
closedOK,otherwiseFalse.
Page 76
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
BoundaryCondsAsIBoundaryProps
Get/setpropertytoaccessboundaryconditions.Seethe
definitionofIBoundaryPropsforitsmethodsandproperties
EngineAsIEngineOptions
GetstheIEngineOptionsobjecttosetsimulationparameters
andruntheoperation.SeeIEngineOptionsforitsmethods
andproperties
FixedInjectionDepthsAsBoolean
Applicabletogasliftedsystems,thispropertysets/gets
whethergasliftvalvesareinstalledinthetubing
EnableSurveyOptsAsBoolean
Gets/setswhethersurveydataisusedforprofileplotting
ProfileTypeAsLong
ThedefaultprofiletobeplottedinitiallywithPSPlot:
0:Elevationvs.Pressure
1:Elevationvs.Temperature
2:Pressurevs.TotalDistance
3:Temperaturevs.TotalDistance
SensitivityObject(indxAsLong)As
String
indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
sensitivity.
Returnsthesensitivityobjectnameforthespecifiedindex.
SensitivityVariable(indxAsLong)As indx:thesensitivityboxindx.Pass1fortheXaxisvariable,
0,1,2,,(MaxSensitivityVars1)forthecorresponding
String
sensitivity.
Returnsthesensitivityobjectnameforthespecifiedindex.
GetIsUnset()AsBoolean
Returnstrueiftheoperationsdataisallblank(unset)
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
GetSensitivityData_SI(ObjectStrAs
String,VarStrAsString,Values_SI,
QuantClassAsString)
Returnsthesensitivitydataspecifiedfortheoperation.
ObjectStr:theobjectnameisreturnedhere
VarStr:thesensitivityvariablenameisreturnedhere
Values_SI:anarrayofdoublevaluesinstrictSIunits
containingthelistofsensitivityvalues
QuantClass:theunitclassnamefortheselectedsensitivity
variable.SeeUnitsLibraryforalistofunitclasses.
Page 77
PIPESIMVersion2011.1OpenLinkReferenceManual
SetSensitivityData(ObjectStrAs
String,VarStrAsString,
Values_DefEng)
Setsthesensitivityinformation.
ObjectStr:theobjectname
VarStr:thesensitivityvariablename
Values_DefEng:anarrayofdoublevaluesindefault
engineeringunitscontainingthelistofsensitivityvalues
SetSensitivityData_SI(ObjectStrAs
String,VarStrAsString,Values_SI,
QuantClassAsString)
SameasSetSensitivityDatamethod,butforstrictSIunits
ObjectStr:theobjectname
VarStr:thesensitivityvariablename
Values_SI:anarrayofdoublevaluesinstrictSIunits
containingthelistofsensitivityvalues
QuantClass:theunitclassnamefortheselectedsensitivity
variable.SeeUnitsLibraryforalistofunitclasses.
SetSurveyData_SI(SurveyNameAs
String,SurveyDateAsDate,
Var_MD_Pres_Temp)
Associatesfielddatatotheoperation.Thisdatapressure
and/ortemperatureprofilesisthenplottedalongwiththe
calculateddata.
SurveyName:anarbitrarygivenname(suchasthewellname)
SurveyDate:thesurveydate
Var_MD_Pres_Temp:athreecolumnmatrixcontaining
measureddepths,pressureandtemperaturevalues,inthat
order.UnitsinstrictSI.
SetLanguage(nlLanguageIDAsLong) Setstheuserinterfacelanguage
AsBoolean
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
WriteOperationFile()AsBoolean
WritesanASCIIfile(modelname.inc)containingthe
instructionstothesimulationenginetoruntheoperation.
DisplayDialog(p_VarUnitManager,
CloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.ReturnsTrueifdialogboxwas
closedOK,otherwiseFalse.
Page 78
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
BoundaryCondsAsIBoundaryProps
Get/setpropertytoaccessboundaryconditions.See
IBoundaryPropsInterfaceforitsmethodsandproperties
EngineAsIEngineOptions
GetstheIEngineOptionsobjecttosetsimulationparameters
andruntheoperation.SeeIEngineOptionsInterfaceforits
methodsandproperties
EnableSurveyOptsAsBoolean
Gets/setswhethersurveydataisusedforprofileplotting
ProfileTypeAsLong
ThedefaultprofiletobeplottedinitiallywithPSPlot:
0:Elevationvs.Pressure
1:Elevationvs.Temperature
2:Pressurevs.TotalDistance
3:Temperaturevs.TotalDistance
GetIsUnset()AsBoolean
Returnstrueiftheoperationsdataisallblank(unset)
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
FunctionreturnsinEngineCodesthearrayofstringforchosen
GetSelectedCorrelation
(IsVerticalAsBoolean,EngineCodes) verticalflowcorrelationsifIsVerticalisTrueandfor
horizontalcorrelationsifIsVerticalisFalse
SetSurveyData_SI(SurveyNameAs
String,SurveyDateAsDate,
Var_MD_Pres_Temp)
Associatesfielddatatotheoperation.Thisdata,pressure
and/ortemperatureprofilesisthenplottedalongwiththe
calculateddata.
SurveyName:anarbitrarygivenname(suchasthewellname)
SurveyDate:thesurveydate
Var_MD_Pres_Temp:athreecolumnmatrixcontaining
measureddepths,pressureandtemperaturevalues,inthat
order.UnitsinstrictSI
SetSelectedCorrelation(helpStrAs
String,engineCodeAsString,
mainCodeAsString,IsVerticalAs
Boolean,IsSelectedAsBoolean)
Setorremovesselectionforthecorrelationspecifiedby
engineCodedependingonIsSelectedvalue
IsVertical=Trueforverticalcorrelations,Falseforhorizontal.
Page 79
PIPESIMVersion2011.1OpenLinkReferenceManual
SetLanguage(nlLanguageIDAsLong) Setstheuserinterfacelanguage
AsBoolean
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
WriteOperationFile()AsBoolean
WritesanASCIIfile(modelname.inc)containingthe
instructionstothesimulationenginetoruntheoperation.
DisplayDialog(p_VarUnitManager,
CloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.ReturnsTrueifdialogboxwas
closedOK,otherwiseFalse.
Data Matching
IDataMatchingOp object - Properties
BoundaryCondsAsIBoundaryProps Get/setpropertytoaccessboundaryconditions.See
IBoundaryPropsInterfacefortheirmethodsandproperties
EngineAsIEngineOptions
GetstheIEngineOptionsobjecttosetsimulationparameters
andruntheoperation.SeeIEngineOptionsInterfacefortheir
methodsandproperties
EnableSurveyOptsAsBoolean
Gets/setswhethersurveydataisusedforprofileplotting
ProfileTypeAsLong
ThedefaultprofiletobeplottedinitiallywithPSPlot:
0:Elevationvs.Pressure
1:Elevationvs.Temperature
2:Pressurevs.TotalDistance
3:Temperaturevs.TotalDistance
ModelIsInjectionWellAsBoolean
Gets/setswhethermodelisaninjectionwell.Youhavetoset
thispropertytotrueifyoucreateanewIIDataMatchingOp
objectandanalyzeaninjectionwell
UValueFactorRangeAs
IFactorRange
Gets/setsuvaluemultiplierrangeobject.SeeIFactorRange
Interfaceforitsmethodsandproperties
HorFlowFrictFactorRangeAs
IFactorRange
Gets/setshorizontalflowfrictionfactorrangeobject.See
IFactorRangeInterfaceforitsmethodsandproperties
Page 80
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
HorFlowHoldupFactorRangeAs
IFactorRange
Gets/setshorizontalflowholdupfactorrangeobject.See
IFactorRangeInterfaceforitsmethodsandproperties
VerFlowFrictFactorRangeAs
IFactorRange
Gets/setsverticalflowfrictionfactorrangeobject.See
IFactorRangeInterfaceforitsmethodsandproperties
VerFlowHoldupFactorRangeAs
IFactorRange
Gets/setsverticalflowholdupfactorrangeobject.See
IFactorRangeInterfaceforitsmethodsandproperties
WeightingFactorPresAsDouble
Gets/setspressureRMSweightfactor
WeightingFactorTempAsDouble
Gets/setstemperatureRMSweightfactor
EngineOutputListCountAsLong
Gets/setscountofresultingrecordsoftheDataMatching
operation
ModelHasMeasuredTempInFlowli
neAsBoolean
Gets/setswhethermodelhasmeasuredtemperaturedata
(Surveydata)inanyflowlines,risersortubings.Youhaveto
setthispropertytotrueifmodelhasthemeasured
temperaturedata
ModelHasMeasuredPresInFlowline
sAsBoolean
Gets/setswhethermodelhasmeasuredpressuredata(Survey
data)inanyflowlines,risersortubings.Youhavetosetthis
propertytotrueifmodelhasthemeasuredpressuredata
GetIsUnset()AsBoolean
Returnstrueiftheoperationsdataisallblank(unset)
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Mustbe
calledimmediatelyafterthecalltothefailedfunction.
GetSelectedCorrelation
(IsVerticalAsBoolean,
EngineCodes)
FunctionreturnsinEngineCodesthearrayofstringforchosen
verticalflowcorrelationsifIsVerticalisTrueandforhorizontal
correlationsifIsVerticalisFalse
EngineOutputListCountAsLong
Functionreturnscountofrecordsthatcouldbereadby
GetEngineOutputItemfunction.
GetEngineOutputItem
(indexasLong,HorFlowFrictFactor
asDouble,HorFlowHoldupFactoras
Double,VerFlowFrictFactoras
Double,VerFlowHoldupFactoras
double,UValueFactorasDouble,
alphanameasstring,betanameas
String,optimizedasBoolean,
pmatchasDouble,tmatch as
Double)AsDouble
Functionreturnscorrelationstartvaluesandresults:used
methods(namesofthehorizontalandverticalcorrelation
methods),calculatedfrictionandholdupfactors,uvalue
multiplier,pressure,temperatureandRMS.
Theresultsareoptimizedifoptimized=true.Iffunctionset
optimized=falsethenfunctionreturnsstartvalues.
Youshouldpasstoindexvaluesinrange0..
EngineOutputListCount1otherwiseyougetanerrorInvalid
argument(VBAgenerateanexceptionInvalidargument,
thatcouldbecatchedbyONERRORGOTOoperator)
HorFlowFrictFactor=horizontalflowfrictionfactorvalue.
HorFlowHoldupFactor=horizontalflowholdupfactorvalue.
VerFlowFrictFactor=verticalflowfrictionfactorvalue.
Page 81
PIPESIMVersion2011.1OpenLinkReferenceManual
VerFlowHoldupFactor=verticalflowholdupfactorvalue.
UValueFactor=uvaluemultiplier.
alphaname=shortnameofusedverticalcorrelationmethod.
betaname=shortnameofusedhorizontalcorrelationmethod.
pmatch=pressurevalue(measuredinpsia).
tmatch=temperaturevalue(measuredinFahrenheits).
FunctionreturnsDoublevalue.ThisisRMSvalue.
IDataMatchingOp object - Set Methods
SetSelectedCorrelation(helpStrAs
String,engineCodeAsString,
mainCodeAsString,IsVerticalAs
Boolean,IsSelectedAsBoolean)
Setorremovesselectionforthecorrelationspecifiedby
engineCodedependingonIsSelectedvalue
IsVertical=Trueforverticalcorrelations,Falseforhorizontal.
SetLanguage(nlLanguageIDAsLong) Setstheuserinterfacelanguage
AsBoolean
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
WriteOperationFile()AsBoolean
WritesanASCIIfile(modelname.inc)containingthe
instructionstothesimulationenginetoruntheoperation.
DisplayDialog(p_VarUnitManager,
CloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.ReturnsTrueifdialogboxwas
closedOK,otherwiseFalse.
Nodal Analysis
INodalAnal Object - Properties
CFactorAsDouble
SetsaConstantCvalue
EngineSwitchAsString
Sets/getsextracommandlineargumentsforthePIPESIM
engine
Page 82
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
FetkovichExpAsDouble
SetsaFetkovichnexponentvalue
FixedInjectionDepthsAsBoolean
Applicabletogasliftedsystems,thispropertysets/gets
whethergasliftvalvesareinstalledinthetubing
FutureAOFPAsDouble
SetsafutureAOFPvalue
FutureIPRAsBoolean
SetsaflagwhethertouseFutureIPRoption(Trueby
default)
IncludeFilePathAsString
Thefullpathnametotheenginesoperationfile
InflowCurveRangeLimitAsBoolean
AllowtheinflowcurvestoextendtotheAOFP(true)
InflowObjectAsString
Returns/setstheinflowobjectname
InflowVariableAsString
Returns/setstheinflowvariablename
MaxPressureForOutflow_SIAs
Double
Maximumpressurefortheoutflowcurves
MaxRate_SIAsDouble
ThemaximumfluidrateinstrictSIunits
MaxRateFluidTypeAsLong
Themaximumfluidratetype:0:liquid,1:gas,2mass
NumberInflowPointsAsLong
Thenumberofpointsoneachinflowcurve
NumberOutflowPointsAsLong
Thenumberofpointsoneachoutflowcurve
OutflowCurveRangeLimitAsBoolean Allowtheoutflowcurvestoextendtothesupplied
maximumflowrate
OutflowObjectAsString
Returns/setstheoutflowobjectname
OutflowVariableAsString
Returns/setstheoutflowvariablename
OutletPressure_SIAsDouble
Gets/setstheoutletpressureinstrictSIunits
PipesimEnginePathAsString
ThefullpathtothePIPESIMengine
PlotToolPathAsString
Thefullpathtotheplottingtool(PSPlot)
PsmFilePathAsString
Thefullpathtothemodelfile(.psmfile)
ReservoirPressureAsDouble
Setareservoirpressure.UsedforfutureAOFPcalculations
RunEngineMinimisedAsLong
Runstheengineinaminimisedwindow
RunPlotToolWithEngineAsLong
IfTrue(1)showstheplottingtool(PSPlot)asthesimulation
runs
GetIsEngineActive(p_bActiveAs
Long)
ReturnsTrue(1)ifthePIPESIMengineisrunning,otherwise
False(0)
GetIsUnsetGetIsUnset(pVarAs
Long)
ReturnsTrue(1)iftheoperationsdataisallblank(unset)
GetLastError(errorStrAsString)
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
Page 83
PIPESIMVersion2011.1OpenLinkReferenceManual
GetSensitivityData_SI(InflowOutflow
AsLong,ObjectStrAsString,VarStr
AsString,Values_SI,QuantClassAs
String)
Returnsthesensitivitydataspecifiedfortheoperation.
InflowOutflow:0:inflowdata,1outflowdata
ObjectStr:theobjectnameisreturnedhere
VarStr:thesensitivityvariablenameisreturnedhere
Values_SI:anarrayofdoublevaluesinstrictSIunits
containingthelistofsensitivityvalues
QuantClass:theunitclassnamefortheselectedsensitivity
variable.SeeUnitSystem.
SetSensitivityData_SI
(InflowOutflowAsLong,ObjectStrAs
String,VarStrAsString,Values_SI,
QuantClassAsString)
Setsthesensitivitydataspecifiedfortheoperation.
InflowOutflow:0:inflowdata,1outflowdata
ObjectStr:theobjectname
VarStr:thesensitivityvariablename
Values_SI:anarrayofdoublevaluesinstrictSIunits
containingthelistofsensitivityvalues
QuantClass:theunitclassnamefortheselectedsensitivity
variable.SeeUnitSystem.
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
KillOperation()
Terminatestheenginerun
RunOperation()
Runsthesimulation
WriteOperationFile(bOKAsBoolean) WritesanASCIIfilecontainingtheinstructionstothe
simulationenginetoruntheoperation.
DisplayDialog(p_VarUnitManager)
Displaystheoperationsgraphicalinterface.PassaNULL
variantasthefirstargument.
Thismethodisobsolete.UseDisplayDialog2methodinstead
DisplayDialog2(p_VarUnitManager,
bCloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.Returnstrueifdialogboxwas
closedOK,otherwisefalse.
Page 84
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Wax Deposition
IWaxOp Object - Properties
RunEngineMinimisedAsBoolean
Runstheengineinaminimisedwindow
RunPlotToolWithEngineAsBoolean
IfTrue(1)showstheplottingtool(PSPlot)asthesimulation
runs
PsmFilePathAsString
Thefullpathtothemodelfile(.psmfile)
PlotToolPathAsString
Thefullpathtotheplottingtool(PSPlot)
IncludeFilePathAsString
Thefullpathnametotheenginesoperationfile
PipesimEnginePathAsString
ThefullpathtothePIPESIMengine
EngineSwitchAsString
Sets/getsextracommandlineargumentsforthePIPESIM
engine
WaxPropertiesAsVariant
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
GetIsUnset()AsBoolean
ReturnsTrue(1)iftheoperationsdataisallblank(unset)
GetIsEngineActive()AsBoolean
ReturnsTrue(1)ifthePIPESIMengineisrunning,otherwise
False(0)
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
Page 85
PIPESIMVersion2011.1OpenLinkReferenceManual
DisplayDialog(p_VarUnitManagerAs Displaystheoperationsgraphicalinterface.PassaNULL
variantasthefirstargument.
Variant)
Thismethodisobsolete.UseDisplayDialog2methodinstead
DisplayDialog2(p_VarUnitManager
AsVariant)AsBoolean
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.Returnstrueifdialogboxwas
closedOK,otherwisefalse.
RunOperation();
Runsthesimulation
KillOperation();
Terminatestheenginerun
WriteOperationFile()AsBoolean
WritesanASCIIfilecontainingtheinstructionstothe
simulationenginetoruntheoperation.
WaxMethodcanbeoneofthefollowingvalues:
WaxMethodAsInteger
0:Shell;
1:BP;
2:SchlumbergerDBR;
3:None
IWaxOp3 Object - Properties
ModelIsInjectionWellAsBoolean
Trueifthemodelisaninjectionwell,Flaseotherwise
RunEngineMinimisedAsBoolean
Runstheengineinaminimisedwindow
RunPlotToolWithEngineAsBoolean
IfTrue(1)showstheplottingtool(PSPlot)asthesimulation
runs
FilenameAsString
Themodelfilename(.psmfile)
PathnameAsString
Thepathtoamodelfile
DescriptionAsString
Adescriptionstring
PlotToolPathAsString
Thefullpathtotheplottingtool(PSPlot)
PipesimEnginePathAsString
ThefullpathtothePIPESIMengine
Page 86
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
EngineSwitchAsString
Sets/getsextracommandlineargumentsforthePIPESIM
engine
GasSGAsDouble
Sets/getsgasspecificgravityvalue
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
GetIsUnset()AsBoolean
ReturnsTrue(1)iftheoperationsdataisallblank(unset)
GetIsEngineActive()AsBoolean
ReturnsTrue(1)ifthePIPESIMengineisrunning,otherwise
False(0)
SetMinCHP(valueasDouble,unitStr
asString)
SetMaxCHP(valueasDouble,unitStr Methodsetsamaximumcasingheadpressure
asString)
SetStepCHP(valueasDouble,unitStr Methodsetsanincrementvalueforcasingheadpressure
asString)
SetPortDiameter(valueasDouble,
unitStrasString)
Methodsetsanorificediameter
SetCv(valueasDouble)
MethodsetsaCvvalueofthegasliftvalve
SetGLMaxRate(valueasDouble,
unitStrasString)
Methodsetsamaximumavailablegasrate
SetGLTemperature(valueasDouble, Methodsetsaliftgastemperatureatthecasinghead
unitStrasString)
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Methodsetsaminimumcasingheadpressure
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
Page 87
PIPESIMVersion2011.1OpenLinkReferenceManual
DisplayDialog()
Displaystheoperationsgraphicalinterface.
Thismethodisobsolete.UseDisplayDialog3methodinstead
DisplayDialog2(p_VarUnitManager
AsVariant)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.
Thismethodisobsolete.UseDisplayDialog3methodinstead
DisplayDialog3(p_VarUnitManager
AsVariant,bCloseOKAsBoolean)
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.Returnvalueistrueifdialogbox
wasclosedOK,otherwisefalse.
GenerateQgiVsChpPlot(bOkas
Long);
Runsthesimulation
GenerateQgiVsChpPlot2(p_VarUnit
ManagerAsVariant,bOkasLong);
Runsthesimulation.PassaNullvariantasthefirstargument.
KillOperation();
Terminatestheenginerun
WriteOperationFile(p_VarUnitMana
gerAsVariant,bOKAsBoolean)
WritesanASCIIfilecontainingtheinstructionstothe
simulationenginetoruntheoperation.PassaNullvariantas
thefirstargument.
Thismethodisobsolete.UseGenerateQgiVsChpPlot2
methodinstead
OutletPressure_SIAsDouble
Gets/setstheoutletpressureinstrictSIunits
InletPressure_SIAsDouble
Gets/setstheinletpressureinstrictSIunits
FluidRate_SIAsDouble
Gets/setsthefluidrateinstrictSIunits
CalculatedVariableAsLong
Gets/setsthecalculatedvariable:
0:OutletPressure
1:InletPressure,
2:FluidRate
FluidTypeAsLong
Gets/setsthefluidratetype:
0:liquid
1:gas
2:mass
Page 88
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
IEngineOptions Interface
IEngineOptions - Properties
EngineSwitchAsString
Sets/getsextracommandlineargumentsforthePIPESIM
engine
IncludeFilePathAsString
Thefullpathnametotheenginesoperationfile
PipesimEnginePathAsString
ThefullpathtothePIPESIMengine
PlotToolPathAsString
Thefullpathtotheplottingtool(PSPlot)
PsmFilePathAsString
Thefullpathtothemodelfile(.psmfile)
RunEngineMinimisedAsBoolean
Runstheengineinaminimisedwindow
RunPlotToolWithEngineAsBoolean
IfTrueshowstheplottingtool(PSPlot)asthesimulation
runs
GetIsEngineActive()AsBoolean
ReturnsTrueifthePIPESIMengineisrunning,otherwise
False
IEngineOptions - Operations
KillOperation()
Terminatestheenginerun
RunOperation()
Runsthesimulation
IFactorRange Interface
IFactorRange - Properties
MinAsDouble
Sets/getsminimalvalueforrangeobject
MaxAsDouble
Sets/getsmaximumvalueforrangeobject
EnabledAsBoolean
Enable/disablerangeobject
LowerEggeAsString
Loweredgeforminimumandmaximumvalues
UpperEggeAsString
Upperedgeformaximumandminimumvalues
Page 89
PIPESIMVersion2011.1OpenLinkReferenceManual
ThenameoftheCOMisGLDIAGN.DLL
Supported Interfaces
GLWellinterface:tomodelandperformdiagnosticsonagasliftinjectedwell
Dependency MAP
ListofDependencies:WELLCURVE.DLL,MFC42.DLL
GetArrayEqCurvePressure(pVar)
ReturnsinpVaranarrayofDoubleswiththeequilibrium
curvepressureateachvalvedepth
GetArrayGasRate(pVar)
ReturnsinpVaranarrayofDoubleswiththeactual
throughputsforeachvalve.UsesThornhill&Craver
equation
GetArrayInjectionPressure(pVar)
ReturnsinpVaranarrayofDoubleswiththeinjection
pressureateachvalvedepth
GetArrayInjectionTemperature(pVar)
ReturnsinpVaranarrayofDoubleswiththeinjection
temperatureateachvalvedepth
GetArrayMaxGasRate(pVar)
ReturnsinpVaranarrayofDoubleswiththemaximum
throughputsforeachvalve.UsesThornhill&Craver
equation
GetArrayProductionPressure(pVar)
ReturnsinpVaranarrayofDoubleswiththeproduction
pressureateachvalvedepth
GetArrayProductionTemperature(pVar)
ReturnsinpVaranarrayofDoubleswiththeproduction
temperatureateachvalvedepth
GetArrayValveClosePressure(pVar)
ReturnsinpVaranarrayofDoubleswithclosing
pressuresforeachvalve
GetArrayValveOpenPressure(pVar)
ReturnsinpVaranarrayofDoubleswithopening
pressuresforeachvalve
Page 90
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetArrayValveStatus(pVar)
ReturnsinpVaranarrayofStringswiththevalvestatus:
suchasThrottling,FullyOpen.
GetEquilibriumCurve(pVar)
ReturnsinpVara2dimensionalarrayofDoubleswith
{injectionTVD,equilibriumpressure}pairsin[ft,psia].
Thenumberofdatapointsisvariableandmatchthe
resultsfromtheplotfile.
GetLastError(sLastErrorAsString)
ReturnsthelasterrormessageproducedbyGLD.
GetProductionPressureCurve(pVar,type
AsLong)
ReturnsinpVara2dimensionalarrayofDoubleswith
{pressure,depth}pairsin[psia,ft].Thenumberofdata
pointsisvariableandmatchtheresultsfromtheplot
file.
Type:if0depthvaluesareMD,if1depthvaluesareTVD
GetProductionTemperatureCurve(pVar,
typeAsLong)
ReturnsinpVara2dimensionalarrayofdoubleswith
{temperature,depth}pairsin[F,ft].Thenumberofdata
pointsisvariableandmatchtheresultsfromtheplot
file.
Type:if0depthvaluesareMD,if1depthvaluesareTVD
AddCalculatedPressureProfile(typeAs
Long,pVar,pressUnitsAsString,lenUnits
AsString)
Type:0=MD;1=TVD
pVar:atwodimensionalarraycontainingDoubles
{depth,pressure}
pressUnits:pressureunitsforthevaluesinthearrays
lenUnits:unitsforthedepthvaluesinthearray.Anyof
ftmiles,m,km
Thismethodcanbeusedwhentheprofiletypeis
'Simulate'toenteranexistingsimulatedprofile.Usein
conjunctionwiththeproperty
CalculatePressureProfileOnDisplaytocontrolthe
executionofPIPESIM.
AddCalculateTempProfile(typeAsLong,
pVar,tempUnitsAsString,lenUnitsAs
String)
Type:0=MD;1=TVD
pVar:atwodimensionalarraycontainingDoubles
{depth,temperature}tempUnits:temperatureunitsfor
thevaluesinthearrayslenUnits:unitsforthedepth
valuesinthearray.Anyofftmiles,m,km.Thismethod
canbetoenteranexistingsimulatedtemperature
profile.Ifnotsuppliedthetemperatureprofilewillbe
calculatedinternallybytheDiagnosticsmodule.
Page 91
PIPESIMVersion2011.1OpenLinkReferenceManual
AddDeviationSurvey(pVar,TVDUnitsAs
String,MDUnitsAsString)
RequiredifProfileModepropertyissettoUserSurvey
ANDPressureSurveytypeisMD
pVar:atwodimensionalarraycontainingDoubles{TVD,
MD}
TVDUnits:unitsfortheTVDvaluesinthearray.Anyofft,
miles,m,km
MDUnits:unitsfortheMDvaluesinthearray.Anyofft,
miles,m,km
AddEquilibriumCurve(pVar,pressUnits
AsString,lenUnitsAsString)
pVar:atwodimensionalarraycontainingDoubles
{depth,pressure}
pressUnits:pressureunitsforthevaluesinthearrays
lenUnits:unitsforthedepthvaluesinthearray.Anyof
ft,miles,m,km
Thismethodcanbeusedtoenteranexistingequilibrium
curve.Useinconjunctionwiththeproperty
CalculateEqCurveOnDisplaytocontroltheexecutionof
PIPESIM.
AddGasLiftValve5(typeAsLong,depth
AsDouble,PtroAsDouble,ptroUnitsAs
String,ApAsDouble,ApAbAsDouble,
PortSizeAsDouble,NomODAsDouble,
descAsString,CdAsDouble,dpfoAs
Double)
Type:valvetypeAnyof:
0=IPO,1=PPO,2=IPS,3=PPS,4=Orifice,5=Dummy
depth[ft]:valvedepth
ptro:testrackpressure
ptrUnits:testrackpressureunits
Ap[in2]:portarea
ApAb:portarea/bellowsarea
PortSize[in]:portsize
NomOD[in]:nominalOD
Desc:valvename/model
Cd:CdvalueifCd=0GLDwillcalculateit
Dpfo[psi]:default=7777.IfdefaulttheVenezuelan
methodwillbeusedforgasthroughputcalculations,if
givenvaluenotequaldefaultvalue,NZmethodwillbe
used
AddPressureSurvey(typeAsLong,pVar,
pressUnitsAsString,lenUnitsAsString)
RequiredifProfileModepropertyissettoUserSurvey
Type:0=MD;1=TVD
pVar:atwodimensionalarraycontainingDoubles
{depth,pressure}
pressUnits:pressureunitsforthevaluesinthearrays
lenUnits:unitsforthedepthvaluesinthearray.Anyof
ft,miles,m,km
Page 92
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
AddTemperatureSurvey(typeAsLong,
pVar,tempUnitsAsString,lenUnitsAs
String)
Type:0=MD;1=TVD
pVar:atwodimensionalarraycontainingDoubles
{depth,temperature}
tempUnits:temperatureunitsforthevaluesinthe
arrays
lenUnits:unitsforthedepthvaluesinthearray.Anyof
ft,miles,m,km
SetApi
(apiAsDouble)
Optional,thisparametersarewrittentotheu2pfile
SetGLWellProperties2(gsgAsDouble,
resDepthAsDouble,chpAsDouble,
chpUnitsAsString,chtAsDouble,thtAs
Double,restAsDouble,surftAsDouble,
QgiAsDouble)
gsg:gasspecificgravity
resDepth:reservoirdepth[ft]
chp:injectionheadpressure
chpUnits:pressureunitsforthevalueenteredaschp.
Anyof:psiapsig,bara,barg,atma,atmg,kPaa,kPag,
kg/cm2a,kg/cm2g
cht:injectionheadtemperature[F]
tht:productionheadtemperature[F]
rest:reservoirtemperature[F]
surf:surfaceambienttemperature[F]
Qgi:measuredinjectiongasrate[mmscf/d]
SetHorizontalCorrelation(bsNameAs
String,HoldupFactorAsDouble,
FrictionFactorAsDouble)
Optional,thisparametersarewrittentotheu2pfile
SetIprTypeAndValue(IprTypeAsLong,
IprValueAsDouble)
Optional,theseparametersarewrittentotheu2pfile.
IprType=0forWELLPI,IprType=1forVOGEL
SetPressureUnits(unitStrAsString)
Callthisfunctiontospecifypressureunitstodisplayin
GLDoutput.Anyof:psiapsig,bara,barg,atma,atmg,
kPaa,kPag,kg/cm2a,
kg/cm2g
SetProductionPressureGradient(value
AsDouble,unitStrAsString)
RequiredifProfileModepropertyissettoConstant
Gradient
SetSinglePhaseCorrelation(bsNameAs
String,EfficiencyAsDouble)
Optional,thisparametersarewrittentotheu2pfile
Page 93
PIPESIMVersion2011.1OpenLinkReferenceManual
SetTransferLinesParams3
(kickOffInjPressureAsDouble,
kickOffPres_UnitsAsString,
unloadingGradAsDouble,
unloadingGrad_UnitsAsString,
injPresDropAsDouble,injPresDrop_Units
AsString,locatingDPAtValveAsDouble,
locatingDP_UnitsAsString,
TransferFactorAsDouble)
kickOffInjPressure:casingheadpressuretostart
unloading
kickOffPres_Units:thepressureunitsfortheabove
parameter
unloadingGrad:theunloadinggradient
unloadingGrad_Units:Anyofpsi/ft,bar/m,atm/m,
kPa/m
injPresDrop:pressuredropbetweenvalves
injPresDrop_Units:Anyof:psi,bar,atm,kPa,kg/cm2
locatingDPAtValve:Safetyfactornormallyusedforboth
injectionpressureoperatedandproductionpressure
operatedvalves.Thisisanoffsetfromtheinjection
pressurelinetothestartofthetransfer(unloading)line
ateachvalvelocation.Defaultvalueforinjection
pressureoperatedvalvesis50psi.anddefaultfor
productionpressureoperatedvalvesis100psi
Callthisfunctiontodisplaytransferlineplots
SetTransferLinesParams4
(kickOffInjPressureAsDouble,
kickOffPres_UnitsAsString,
unloadingGradAsDouble,
unloadingGrad_UnitsAsString,
injPresDropAsDouble,injPresDrop_Units
AsString,locatingDPAtValveAsDouble,
locatingDP_UnitsAsString,SurfaceOffset
AsDouble,BottomOffsetAsDouble,
BottomOffset_UnitsAsString)
ThesameasSetTransferLinesParams()withtheadded
designmodeparameters:
SurfaceOffset:percentageofthedifferencebetweenthe
operatingproduction(wellhead)pressureandthe
injectionpressure.Thepseudowellheadpressureisthen
theoperatingwellheadpressureplusthissurfaceoffset
value.UsedinVariableGradientmethodindesign
mode.
BottomOffset:Thebottomholeoffsetisapressure
differencevalue.Thepseudoflowingbottompressureis
thenthebottomholeinjectionpressureminusthe
bottomholeoffsetvalue.Thepseudoproduction
pressureusedfordesignisthenastraightlinedrawn
betweenthepseudowellheadpressureandthepseudo
bottomholepressure.UsedinVariableGradientmethod
indesignmode.
SetValveTemperatureFrom(longValveTempFrom)
Thisfunctionsetsthevalvetemperaturetobeequalto
:0:ProductionTemperature,1:AmbientTemperature,2:
InjectionTemperature.Onlyapplicableindesignmode
Page 94
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
SetTransferLinesParams5
(kickOffInjPressureAsDouble,
kickOffPres_UnitsAsString,
unloadingGradAsDouble,
unloadingGrad_UnitsAsString,
injPresDropAsDouble,injPresDrop_Units
AsString,locatingDPAtValveAsDouble,
locatingDP_UnitsAsString,
TransferFactorAsDouble,
vbIsTransferPinjPprodAsBoolean)
SetTubingHeadPressure(valueAs
Double,unitStrAsString)
RequiredifProfileModepropertyissettoConstant
GradientorVariableGradients
SetVerticalCorrelation(bsNameAs
String,HoldupFactorAsDouble,
FrictionFactorAsDouble,SwapAngleAs
Double)
Optional,thisparametersarewrittentotheu2pfile
DisplayGasLiftDialog
PopsuptheGLDGUI
DisplayGasLiftDialog2(JpgFilenameAs
String,p_VarUnitManager,bCloseOKAs
Boolean)
SameasDisplayGasLiftDialogbutitallowstopassJpeg
filenamewhereplotwillbestored
DisplayGasLiftDialog3(JpgFilenameAs
String,p_VarUnitManager,filetypeAs
Long,cxAsLong,cyAsLong,bCloseOK
AsBoolean)
SameasDisplayGasLiftDialogbutitallowstopassfile
namewhereplotwillbestoredchangefiletype(filetype
cantakevalues0jpeg,1wmf,2emf)andchange
sizeoftheplot(cx,cy)onlyforJpegfile.
CreateJpgFile3(JpgFilenameAsString,
p_VarUnitManager,filetypeAsLong,cx
AsLong,cyAsLong,bOKAsBoolean)
Functionrunsthesimulationandwritesplotfile.It
allowstopassfilenamewhereplotwillbestored
changefiletype(filetypecantakevalues0jpeg,1
wmf,2emf)andchangesizeoftheplot(cx,cy)onlyfor
Jpegfile.
PressureProfileModeAsLong
Mode=0ConstantGradient
Mode=1UserSurvey
Mode=2PIPESIMCalculated
Mode=3VariableGradients
Usethispropertytoset/getthepressureprofilemode.
Page 95
PIPESIMVersion2011.1OpenLinkReferenceManual
CalculateEqCurveOnDisplayAsBoolean
IfTruetheGLDmodulewillcalculatetheequilibrium
curvejustbeforedisplayingtheGUI(whencalling
DisplayGasLiftDialog()).Ifanexistingcurvehasbeen
enteredwiththemethodAddEquilibriumCurvethis
propertyshouldbesettofalsetoavoidrecalculation.
CalculatePressureProfileOnDisplayAs
Boolean
IfTrue(ANDtheprofiletypeis'Simulate')theGLD
modulewillcalculatethepressureprofilejustbefore
displayingtheGUI(whencallingDisplayGasLiftDialog()).
Ifanexistingprofilehasbeenenteredwiththemethod
AddCalculatedPressureProfilethispropertyshouldbe
settofalsetoavoidrecalculation.
DesignModeAsBoolean
Setsthemoduleindesignmode(True)otherwise
diagnosticsmode(False).DefaultisFalse
GorAsDouble
Thegorinscf/bbl.RequiredifPressureProfileMode=3
IterationModeAsLong
Mode=0calculateflowrate{DEFAULT}
Mode=1calculateinletpressure
ThisisapplicablewhenPressureProfileMode=2
LiquidRateAsDouble
Theproductionliquidrateinbbl/d.Requiredif
PressureProfileMode=3
PipesimEnginePathAsString
bstrPathisthefullpathtoavalidPIPESIMengine
ThisdataisrequiredifPressureProfileMode=2
PipesimIterationToleranceAsDouble
Sets/getsthetolerancein%fortheconvergenceof
PIPESIMiterations(default=1%)
ProductionPressureGradientAsDouble
Thepressuregradientinpsi/ft.Requiredif
PressureProfileMode=0
PsmFilePathAsString
Thefullpathtoavalidpsmfile
ThisdataisrequiredifPressureProfileMode=2
ReservoirPressureAsDouble
Gets/setsthestaticreservoirpressure
SetDisplayUnitSystemAsLong
System=0Engineering(DEFAULT),System=1SI
ShowAmbientTemperatureAsLong
(default=1)
ShowEquilibriumCurvePlotAsLong
(default=1)
ShowEquilibriumCurvePlotAsLong
(default=1)
ShowInjectionPressureAsLong
(default=1)
ShowProductionPressurePlotAsLong
(default=1)
ShowProductionTemperatureAsLong
(default=1)
ShowTransferLinesPlotAsLong
(default=1)
ShowValveClosePressureAsLong
(default=1)
ShowValveOpenPressureAsLong
(default=1)
Page 96
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
ValveTemperature(ValveIndxAsLong)
AsDouble
Setstovalveat0basedindexValveIndx(topvalveis
indx=0)thetemperaturegiveninval[F].Seealsothe
functionSetValveTemperatureFrom()
WatercutAsDouble
Thewatercutin%.RequiredifPressureProfileMode=3
WellNameAsString
Anoptionalwelldescription
Page 97
PIPESIMVersion2011.1OpenLinkReferenceManual
IGLDesign Object
IGLDesign Object - Get Methods
GetCurrentGLValve(indxAsLong,
manufAsString,seriesAsString,
portnameAsString,portsizeAs
Double,chokeAsDouble,modeAs
String,ptroAsDouble,ApAsDouble,
AbAsDouble,nomODAsDouble,Cd
AsDouble,tvdAsDouble,gasrateAs
Double)
Returnstherecentlycalculatedvalveparametersatthe
specifiedindex
manuf:manufacturername
series:seriesname
portname:
portsize:
choke:valvechoke
mode:valvetype(IPO,PPO,IPS,PPS,OrificeorDummy)
md[ft]:valvedepth
ptro:testrackpressure
Ap[in2]:portarea
Ab:portarea/bellowsarea
portsize[in]:portsize
nomOD[in]:nominalOD
Cd:Cdvalue
Page 98
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetCurrentSystem(pIValveSystemAs
Object)
ReturnstherecentlycalculatedIGLValveSystemobject
GetCurrentValveSystemCount(Valve
CountAsLong
ReturnsthecountofrecentlycalculatedGLvalves
GetDesignBias()AsIDesignBias
ReturnstheIDesignBiasobject
GetDesignParams()As
IDesignParams
ReturnstheIDesignParamsobject
GetGLValve(indxAsLong,manufAs
String,seriesAsString,portnameAs
String,portsizeAsDouble,chokeAs
Double,modeAsString,ptroAs
Double,ApAsDouble,AbAsDouble,
nomODAsDouble,CdAsDouble,md
AsDouble,gasrateAsDouble)
Returnstheinstalledvalveparametersatthespecifiedindex
manuf:manufacturername
series:seriesname
portname:
portsize:
choke:valvechoke
mode:valvetype(IPO,PPO,IPS,PPS,OrificeorDummy)
md[ft]:valvedepth
ptro:testrackpressure
Ap[in2]:portarea
Ab:portarea/bellowsarea
portsize[in]:portsize
nomOD[in]:nominalOD
Cd:Cdvalue
GetIsUnset(bUnsetAsBoolean)
ReturnsTrueisdataisnotsetandFalseotherwise
GetProductionPressure(depthAs
Double)AsDouble
Returnstheproductionpressure
GetProductionTemperature(depth
AsDouble)AsDouble
Returnstheproductiontemperature
GetProjectData(ProjData)
Returnsthearrayofstringscontainingprojectdata
GetValveSystemCount(ValveCount
AsLong)
ReturnsthecountofinstalledGLvalves
GetLastError(errorStrAsString)
Returnsthelasterrormessage
SetCompletionParams(Params)
SetsthecompletiontypeasStringforreportpurposes.
StringmustbepassedasVarianttype
SetCurrentSystem(pIValveSystemAs
Object)
SetstheIGLValveSystemobject
Page 99
PIPESIMVersion2011.1OpenLinkReferenceManual
SetFlowCorrsParams(Params)
SetstheflowcorrelationasStringforreportpurposes.String
mustbepassedasVarianttype
SetFluidParameters(Params)
SetstheflowcorrelationasStringforreportpurposes.String
mustbepassedasarraysof3Stringelements.Firstoneis
GOR/OGRvalue,thesecondisWCutvalueandthelastone
isApivalue.
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
SetstheProjectdata.Thedatamustbepassedasarrayof8
Strings.Thesestringsare:
SetProjectData(ProjData)
Projectname,
ProjectUser,
Jobname,
WorkOrder,
ClientName,
ManagerName,
CompanyName,
ModelSpecification
IGLDesign Object - Operations
AddDeviationSurvey(pVar_MDvsTVD
_Points)
Setsuserdefineddeviationsurvey
CheckInput(DescriptionAsString)As
Boolean
ValidatesthedesigndataandreturnsTrueifdataisok.
OtherwisethereturnvalueisFalseandDescriptioncontains
theerrormessage
DisplayGasLiftDesign(p_VarUnitMan
ager,bCloseOKAsBoolean)
PopsuptheGLDesignGUI.
DisplayResults(p_VarUnitManager)
AsBoolean
PopsuptheresultsoftheGLdesigncalculations
PerformDesign()AsBoolean
Runstheenginetoperformdesign
pVar:atwodimensionalarraycontainingDoubles{MD,
TVD}inStrict_SIunits
Page 100
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
AmbientTemperatureAsDouble
BottomHoleOffsetAsDouble
DesignInjectionPressureAsDouble
DesignMethodAsString
Canbeoneofthefollowing:API,IPOSurfaceClose,Variable
Gradient,PPODesign
DesignMethod_AsLong
0forAPIorIPOSurfaceClose,
1forIPOPtMai/Max,
2forPPODesign
DesignSpacingAsLong
0fornewspacing,
1forcurrentspacing
EngineFilePathAsString
InjGasSpecificGravityAsDouble
InjGasSurfaceTemperatureAs
Double
InjPresDropBetweenValvesAs
Double
InstallCurrentSystemAsBoolean
KickoffInjectionPressureAsDouble
LocatingDPAtValveLocationAs
Double
MinimumValveInjDPAsDouble
MinimumValveSpacingAsDouble
OperatingProdPressureAsDouble
PackerDepthAsDouble
PlotToolPathAsString
ProductionPressureCurveAsInteger
ProductionPressureCurve
0forProductionPressureModel
1forEquilibriumCurve
PsmFilePathAsString
RecommendationsAsString
ReservoirDepthAsDouble
ReservoirPressureAsDouble
ReservoirTemperatureAsDouble
SurfaceOffsetAsDouble
SurfaceOffsetDPAsDouble
Page 101
PIPESIMVersion2011.1OpenLinkReferenceManual
SurfaceOffsetTypeAsBoolean
TargetInjGasRateAsDouble
TransferFactorAsDouble
TubingNameAsString
UnloadingGradientAsDouble
UnloadingProdPressureAsDouble
ValveLocationAsLong
TopValvelocation
0forliquidtosurface,
1forliquidnottosurface
ValveManufacturerAsString
Valvemanufacturerfiltervalue
ValveMinPortSizeAsDouble
Valveminportsizefiltervalue
ValveSeriesAsString
Valveseriesfiltervalue
ValveTypeAsString
Valvetypefiltervalue
ValveNominalODAsDouble
Valvesizefiltervalue
ValveTemperatureAsString
Canbeoneofthefollowing:Production,Ambient,Injection
orUnloading
ValveTemperature_NonTopAsLong
Unloadingtemperaturefornontopvalve:
0forProduction
1forAmbient
2forInjection
3forUnloading
ValveTemperature_TopAsLong
Unloadingtemperaturefortopvalve:
0forProduction
1forAmbient
2forInjection
3forUnloading
WellAbsorbsAsBoolean
IDesignParams Object
IDesignParams Object - Properties
BracketingSpacingAsDouble
BracketingTVDAsDouble
DesignInjectionPressureAsDouble
InjGasSpecificGravityAsDouble
InjGasSurfaceTemperatureAs
Page 102
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Double
InletPressureAsDouble
IsBracketingEnabledAsBoolean
IsPressureConditionAsBoolean
KickoffInjectionPressureAsDouble
LiquidRateAsDouble
MinimumValveInjDPAsDouble
MinimumValveSpacingAsDouble
MinUnloadingLiqRateAsDouble
OperatingProdPressureAsDouble
ReservoirPressureAsDouble
TargetInjGasRateAsDouble
UnloadingGradientAsDouble
UnloadingProdPressureAsDouble
UseAnnulusGasGradientAsBoolean
SpecifiesusageofstaticgradientifTrueandrigorousfriction
andelevationDPotherwise
IDesignBias Object
IDesignBias - Properties
BottomOrifCDAsDouble
Dischargecoefficientfororifice
DeltaPtroBottomValveAsDouble
InjPresDropBetweenValvesAs
Double
IsCalculateInjPresDropAsBoolean
IsPlaceIPOatBottomAsBoolean
IsPlaceOrificeatBottomAsBoolean
IsTransferFactorBetweenIPandPPAs
Boolean
LocatingDPAtValveLocationAs
Double
TransferFactorAsDouble
Page 103
PIPESIMVersion2011.1OpenLinkReferenceManual
IGLValveSystem Object
IGLValveSystem Object - Get Methods
GetGasLiftProps(InjPressureAs
Double,MaxAvailableRateAsDouble,
InjTempAsDouble,GasSGAsDouble,
bstrPvtFileAsString,bIsBlackOilAs
Boolean)
ReturnstheGLproperties:
InjPressureinjectionpressure
MaxAvailableRategasrate
InjTempsurfaceinjectiontemperature
GasSGgasspecificgravity
bstrPvtFilePVTfilename(forcompositionalmodel)
bIsBlackOilTrueifblackoilmodeldeifned,Falseotherwise
GetIsUnset(bUnsetAsBoolean)
ReturnsTrueisdataisnotsetandFalseotherwise
GetLastError(errorStrAsString)
Returnsthelasterrormessage
GetValveCount(lValveCntAsLong)
ReturnsthecountofinstalledGLvalves
SetGasLiftProps(InjPressureAs
Double,MaxAvailableRateAsDouble,
InjTempAsDouble,GasSGAsDouble,
bstrPvtFileAsString,bIsBlackOilAs
Boolean)
SetstheGLproperties:
InjPressureinjectionpressure
MaxAvailableRategasrate
InjTempsurfaceinjectiontemperature
GasSGgasspecificgravity
bstrPvtFilePVTfilename(forcompositionalmodel)
bIsBlackOilTrueifblackoilmodeldeifned,Falseotherwise
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
Page 104
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
AddGLValve(manufAsString,series
AsString,portnameAsString,
portsizeAsDouble,chokeAsDouble,
modeAsString,ptroAsDouble,Ap
AsDouble,AbAsDouble,nomODAs
Double,CdAsDouble,tvdAsDouble,
gasrateAsDouble)
manuf:manufacturername
series:seriesname
portname:
portsize:
choke:valvechoke
mode:valvetype(IPO,PPO,IPS,PPS,OrificeorDummy)
ptro:testrackpressure
Ap:portarea
Ab:portarea/bellowsarea
nomOD:nominalOD
Cd:Cdvalue
tvd:valvedepth
gasrate
ClearValveSystem()
Removesallinstalledvalves
DisplayGLValveSystem(p_VarUnitMa
nager,bCloseOKAsBoolean)
PopsuptheGLValveSystemGUI
BellowsArea(iValveIndxAsLong)As
Double
GetsbellowsareaforthevalvespecifiedbyiValveIndx
(Readonlyproperty)
ChokeSize(iValveIndxAsLong)As
Double
(Readonlyproperty)
DPFO(iValveIndxAsLong)AsDouble
Manufacturer(iValveIndxAsLong)As
String
(Readonlyproperty)
MeasuredDepth(iValveIndxAsLong)
AsDouble
(Readonlyproperty)
nomOD(iValveIndxAsLong)As
Double
(Readonlyproperty)
PortArea(iValveIndxAsLong)As
Double
(Readonlyproperty)
portname(iValveIndxAsLong)As
String
(Readonlyproperty)
portsize(iValveIndxAsLong)As
Double
(Readonlyproperty)
ptro(iValveIndxAsLong)AsDouble
(Readonlyproperty)
Page 105
PIPESIMVersion2011.1OpenLinkReferenceManual
series(iValveIndxAsLong)AsString
(Readonlyproperty)
UseAnnulusGasGradientAsBoolean
UseValveDetailsAsBoolean
ValveCv(iValveIndxAsLong)As
Double
(Readonlyproperty)
ValveMode(iValveIndxAsLong)As
String
(Readonlyproperty)
ValveModeType(iValveIndxAsLong)
AsLong
(Readonlyproperty)
GetFileCreatorName()AsString
Returnsthenameofthesimulatorthathasbeenusedto
createtheperformancecurves.
ParametersNone
ReturnValueAstring.
Page 106
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetNumberofVariables()AsLong
Returnsthenumberofvariables(datacolumns)inthe
performancecurve.
ParametersNone
ReturnValueAninteger.
GetUnitofVariable(VariableNameAs
String)AsString
Returnstheunitofgiventhecolumnvariablename.
ParametersVariableNmeNameofthecolumnvariable
ReturnValueAstring.
GetDataofVariable(VariableNameAs
String)
Returnsthearrayofdataatthegivencolumnvariablename
intheperformancecurvesfile.
ParametersVariableNmeNameofthecolumnvariable
ReturnValueAvariant(asanarrayofvariants).The
numberofelementsinasubvariantisequaltothenumber
ofdatapointsbetweentwoNEWLINEkeywordsinthe
VarNamecolumnplusone(forlegends).
GetVariableName(IndexAsLong)As
String
Returnsthenameofcolumnvariablegiventhepositionof
thevariable.
ParametersIndexThepositionofthevariablenameinthe
columnvariablelist.
ReturnValueAstring.
GetMultipleVariablesData(Indexes)
Returnsthearrayofdataatthegivennumberofvariablesin
theperformancecurvesfile
ParametersIndexesIndexesisavariantthatcontainsan
arrayofintegers(indexesofthecolumnvariables)
ReturnValueAvariant(asanarrayofvariants).The
numberofvariantsinthemainarrayisequaltothenumber
ofelementsintheIndexesarray.
GetTitle()AsString
Returnsthetitleofthewellperformancecurvesfile.
ParametersNone
ReturnValueAstring.
GetNumberofDataSets()AsLong
Returnsthenumberofdatasets(=numberofNEWLINE
cards)intheperformancecurvesfile.
ParametersNone
ReturnValueAninteger.
GetVariableNamesList()
Returnsthelistofnamesofcolumnvariablesinthe
performancecurvesfile.
ParametersNone
ReturnValueAVariant.Thenumberofelementsinthe
Variantisequaltothenumberofcolumnsinthe
performancecurvesfile.
Page 107
PIPESIMVersion2011.1OpenLinkReferenceManual
GetAllData()
Returnstheentirecolumnvariablesdataintheperformance
curvesfile.
ParametersNone
ReturnValueAVariant(asanarrayofvariants).The
numberofVariantsinthearrayisequaltothenumberof
columnvariablesandthenumberofelements(numberof
doubletypevalues)inasubVariantisequaltothenumber
ofdatapointspercolumnvariableintheperformance
curvesfile.
GetLastError()AsString
Returnsthelasterrormessage
OpenFile(FilePathAsString)As
Boolean
Opensthegivenperformancecurvesfile,andreturnsa
Booleantype.Thisfunctionmustbecalledbeforeanyother
functions(methods)intheDLLarecalled.
ParametersFileNamethefullpath(includingthename)
oftheperformancecurvesfile.
ReturnValueTrueforsuccessfulopenorFalseforfailure
toopen.
CloseFile()AsBoolean
Closestheperformancecurvesfilethathasbeenpreviously
opened,andreturnsaBooleantype.Thisfunctionmustbe
calledafterfinishreadingthedataandbeforeopen
anotherfile.
ParametersNone
ReturnValueTrueforsuccessfulclosure,orFalsefor
failuretoclose.
Page 108
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 109
PIPESIMVersion2011.1OpenLinkReferenceManual
ist
//
ied
for
{
= sa1->rgsabound[0].lLbound;
Get upper bound of vaData, should be equal to NoSets
= sa1->rgsabound[0].cElements;
(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);
}
}
}
}
// Get variable list
vaVarList = pPerCur->GetVariableNamesList();
// Close the file
pPerCur->CloseFile();
}
// Destroy the pPerCur
pPerCur.Release();
// Close COM library
CoUninitialize();
}
Visual basic Sample Code
Option Explicit
Private wtst As New WELLCURVELib.ReadData
' create an object of the
performance curve reader
Private Sub Command1_Click()
Dim vtmp As Variant
Dim vData As Variant
Dim NoCol As Integer
Dim NoDataSets As Integer
Dim str As String
Dim ist As Integer
Dim ied As Integer
Dim i As Integer
' Open the file
If (wtst.OpenFile(d:\source\case1\well_11.plt)) Then
' Get the file creator's (simulator's) name
Page 110
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
str = wtst.GetFileCreatorName()
' Get number of variables listed in the file
NoCol = wtst.GetNumberofVariables()
' Get the variable list
vtmp = wtst.GetVariableNamesList()
If (Not IsEmpty(vtmp)) Then
ist = LBound(vtmp)
ied = UBound(vtmp)
For i = ist To ied
' Get individual variable names (method 1)
str = vtmp(i)
' Get individual variable names (method 2)
str = wtst.GetVariableName(i + 1)
' Get the data for above variable (str)
vData = wtst.GetDataofVariable(str)
Next i
End If
' Get number of data sets in the file (= number of NEWLINE keywords)
NoDataSets = wtst.GetNumberofDataSets()
' Get the title of performance curve
str = wtst.GetTitle()
' Get all variable data
vData = wtst.GetAllData()
' Get multiple variable data
' Create indexes array
ReDim vtmp(2)
vtmp(0) = 1
vtmp(1) = 4
vtmp(2) = 6
vData = wtst.GetMultipleVariablesData(vtmp)
' Close the file
wtst.CloseFile
End If
Set wtst = Nothing
End Sub
PerformCurve Object
PerformCurve Object - Get methods
GetAllVariables()
ReturnsaVarianttypecontainingmultidimensionalarrayof
allvaluesfromthecurvefile.Firstdimensionisanumberof
thevariables,seconddimensionisanumberofcasesand
thethirddimensioncontainsallvaluesfortheeachcase
plusthecasename.Allreturnedvaluesarewrappedinto
Variants
GetAttributeDetailsAt(VariableName
AsString)
ReturnsaString(asVariant)containingplottingattributes
forthespecifiedvariable
GetAxisBoundaries()
ReturnsaVarianttypecontainingtwodimensionalarrayof
thelow/upperboundariesfortheplotvariables.
Page 111
PIPESIMVersion2011.1OpenLinkReferenceManual
GetBubblePointData()
Returns(asVarianttype)thearrayofthreedoublesvalues
forsaturationpressure,saturationtemperatureand
saturationGOR.(Blackoilmodelsonly.)
GetColumnVariableDataAt(VarName
AsString)
ReturnsaVarianttypecontainingtwodimensionalarrayof
allvaluesforspecifiedvariable.Firstdimensionisanumber
ofcasesandtheseconddimensioncontainsallvaluesfor
theeachcaseplustwoextrastringsattheend;thefirstof
theseisthecasenameandthesecondcontainsformatting
detailsofthevariabledata.Allreturnedvaluesarewrapped
intoVariants
GetConcatenationData()
GetConeGasSG()AsDouble
ReturnsaDoublevalue(wrappedintoVarianttype)ofcone
gasspecificgravity
GetCreationDate()
ReturnsaStringvalue(wrappedintoVarianttype)ofcurve
filedate/timestamp
GetCurrentModelUnitSettings()
Returns(asVarianttype)thetwocolumnarrayofstrings
forallplottedvariables.Firstcolumncontainsvariables
measurementandasecondcolumncontainsvariables
units
GetDefaultXAxis()AsLong
ReturnsanindexforXaxisvariable
GetDefaultYAxis()AsLong
ReturnsanindexforYaxisvariable
GetDynamicPlotFileName()AsString
Returnsacurvefilename(shortform)
GetDynamicPlotLongFileName()As
String
Returnsacurvefilename(longform)
GetFileFormatStatus()AsString
ReturnaStringNewifcurvefilehasnewformat,otherwise
returnvalueisOld
GetLastError()AsString
Returnsthelasterrormessageproducedbytheinterface.
GetMultipleColumnsDataAt(Index)
ReturnsdatasimilartoGetAllVariablesfunctionbutfor
variablespassedinIndexarray
GetNoOfDataColumn()AsLong
Returnsthetotalnumberofvariablesincurvefile
GetNumberOfCases()AsLong
Returnsthenumberofcasesincurvefile
GetPhysicalPropertyData()
Returns(asVarianttype)thearrayof6doublesvaluesfor
API,productiongasspecificgravity,injectiongasspecific
gravity,waterspecificgravity,watercutandGOR.(Blackoil
modelsonly.)
GetProductionData()()
Returns(asVarianttype)thearrayof2doublesvaluesfor
WellPIandstaticreservoirpressure
GetSimulatorName()AsString
ReturnsStringwiththesimulatorname
GetTitle()AsString
ReturnsStringwiththeprojectdescription
Page 112
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetUnitDetailsAt(VariableNameAs
String)
Returns(asVarianttype)thearrayof5Variantscontaining
unitsinformationforthespecifiedvariable.Firstelementis
aStringwithmeasurementname,secondelementisa
Stringwithcurrentunits,thirdandforthelementsare
Doubleswithmultiplierandadderforconversionfrom
strictSIunitsandlastfifthelementisaStringwithstrictSI
units
GetUnitsOfVariableName(sVarName
AsString)AsString
ReturnsStringwiththecurrentunitsforthespecified
variable
GetUnitType()AsString
ReturnsStringENGorSdependingonunitsystemuser
selectedfortheoutputfiles
GetUserName()AsString
ReturnsStringwiththeusernameformprojectproperties
GetVarableNamesList()
Returns(asVarianttype)thearrayofStringscontainingall
variablesnamesfromcurvefile
GetVariableDataAt(ColNameAs
String)
Returns(asVarianttype)thearrayofDoublescontainingall
valuesforthespecifiedvariable
GetVariableDataAtCase(VarNameAs
String,CaseNoAsLong)
SimilartoGetVariableDataAtbutreturnedvaluesarefor
thespecifiedcaseonly(caseindexis1based)
GetVariableNameAt(IndexAsLong)As ReturnsStringwiththevariablenameatspecifiedindex(1
based)
String
GetViscosityData()
Returns(asVarianttype)thearrayof4doublesvaluesfor
temperaturesandviscosities
OpenFile(FilePathAsString)As
Boolean
Opensthegivenperformancecurvesfile,andreturnsa
Booleantype.Thisfunctionmustbecalledbeforeany
otherfunctions(methods)intheDLLarecalled.
ParametersFileNamethefullpath(includingthename)
oftheperformancecurvesfile.
ReturnValueTrueforsuccessfulopenorFalseforfailure
toopen.
CloseFile()AsBoolean
Closestheperformancecurvesfilethathasbeen
previouslyopened,andreturnsaBooleantype.This
functionmustbecalledafterfinishreadingthedataand
beforeopenanotherfile.
ParametersNone
ReturnValueTrueforsuccessfulclosure,orFalsefor
failuretoclose.
IsWellFileOpened()AsBoolean
ReturnsTrueifthecurvefileisopenandFalseotherwise
Page 113
PIPESIMVersion2011.1OpenLinkReferenceManual
PNSReaderCOM
PNSREADER.DLLincludesCOMcompatibleinterfacesthatcanbeusedtoreadoutputfromtheoutputfile
(PNS)generatedbythePIPESIMandPIPESIMNETengines.
Supported Interfaces
IPNSCom,IPNSCom2,IPNSCom3:fornetworkmodelsandsinglebranchoperations.
Dependency MAP
PNSREADER.DLLhasnoPIPESIMdependencies.ItcanbefoundintheSchlumberger\COMMON\ACTIVEX
folder.
IPNSCom Interface Operational methods
ReadPnsFile
ReadaNetengine(.PNS)outputfile
ParamsBSTRFileNameFullpathofnetenginefile(.PNS)
GetNodeCount
Gettotalnumberofnodes;thatisnumberofjunctions+wells
+source+sinks+internal+equipment
params(#)int*iNodeCount
GetBranchCount
Gettotalnumberofbranches(thatisexcludingwellswhich
enginetreatsasbranch+source/sink)
params(#)int*BranchCount
GetWellCount
Gettotalnumberofwells;thatisinjectionwells+production
wells
GetNodeData
FillasuppliedSAFEARRAY(blob)withnodedatafori'thnode,
dataformatfixedasname,type,grate,lrate,mrate,press,
temp,pressresid,rateresid,glr,lgr,wcut
paramsintiNodeindexofnodeinarray(#)VARIANT
*vNodeDataSAFEARRAYtoholddata
GetBranchOutData,
GetBranchInData
FillasuppliedSAFEARRAY(blob)withnodedatafori'th
branch,data
formatfixedasname,type,gretellrate,mrate,press,temp,
pressresid,
rateresid,glr,lgr,wcut
paramsintiNodeindexofnodeinarray
(#)VARIANT*vNodeDataSAFEARRAYtoholddata
Page 114
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetNodeName
nameofthei'thnodeinthearray
paramsintiNodeindexinarray
(#)BSTR*sNamenameofiNode'thelement
GetNodeIndex
indexofthenodeinthearray
paramsBSTR*sNamenameofthenode
(#)intiNodeindexinarray
GetNodeType
GetNetworknodetype
paramsintiNodeindexinarray
(#)BSTR*sNameSource,Sink,Well,Junction
GetBranchName
nameofthei'thbranchinthearray
paramsintiBranchindexinarray
(#)BSTR*sNamenameofiBranch'thelement
GetBranchIndex
indexofthebranchinthearray
paramsBSTR*sNamenameofthebranch
(#)intiBranchindexinarray
GetWellName
nameofthei'thwellinthearray
paramsintiWellindexinarray
(#)BSTR*sNamenameofiWell'thelement
GetWellIndex
indexofthewellinthearray
paramsBSTR*sNamenameofthewell
(#)intiWellindexinarray
Page 115
PIPESIMVersion2011.1OpenLinkReferenceManual
GetNodeVariableValue,
Getsvalueofvariabletypefori'thelementofarray
GetBranchOutVariableValue,
paramsintiNode/iBranch/iWellindexofelementinthearray
GetBranchInVariableValue
GetWellOutVariableValue
(#)double*dValuevaluerequested.6BakerJardineCOM
documentation
GetWellInVariableValue
PIPESIM
BSTRsType:Optionsfornonequipmentnodes,branch
inlet/outlet,andwellinlet/outlet:
Pressure
Temperature
StockTankMassFlowRate
StockTankLiquidVolumeFlowRate
StockTankGasVolumeFlowRate
FlowingLiquidVolumeFlowRate
FlowingGasVolumeFlowRate
StockTankGLR
StockTankWatercut
FlowingWatercut
Additionaloptionsforbranch/wellinlets:
NumberOfEquipment
MeanVelocity
LiquidVelocity
GasVelocity
ErosionVelocity
ErosionRatio
MaxMeanVelocity
MaxLiquidVelocity
MaxGasVelocity
MaxErosionVelocity
MaxErosionRatio
Optionsforequipmentnodes:
EquipmentPressureDrop
EquipmentPower(ifapplicable)
EquipmentTemperatureDrop
Page 116
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetNodeStrVariableValue,
GetBranchInStrVariableValue,
GetsvalueofvariabletypeGasRate,glretc.fornamed
elementofarray
GetBranchOutStrVariableValue,
GetWellInStrVariableValue,
GetWellOutStrVariableValue
GetModelStatus
ParamsBSTRsNameObjectidentifier(name)forexample,
Well_1
(#)double*dValuevaluerequested
BSTRsTypeGasRate,LiquidRate,MassRate,pressure,
Temperature,PressureResidual,RateResidual,GLR,LGR,
WaterCut,MaxPres,CompPower,ChokeDP
Getsconvergenceerrorinformationfromthe.PNSfile
Params(#)BSTRsNameConvergencestatusstringofthe
form'ModelfailedtoconvergeConvergenceerror=%4.3f
Materialbalanceerror=%4.3f'
GetBranchOutVariableValue2(iNode Thisfunctionworksthewaysimilarto
GetBranchOutVariableValuefunctionandgetsrequested
asLong,sTypeasString)
valueofvariabletype.
sTypeparametercanhavefollowingvalues:
LiquidRate,MassRate,Pressure,Temperature,
PressureResidual,RateResidual,GLR,LGR,WaterCut,Gas
Density,OilDensity,WaterDensity,MaxPres,CompPower,
ChokeDP,MeanVelocity,LiquidVelocity,GasVelocity,
ErosionVelocity,ErosionRatio,MaxMeanVelocity,Max
LiquidVelocity,MaxGasVelocity,MaxErosionVelocity,Max
ErosionRatio,GasVolumeRateStandard,OilVolumeRate
Standard,WaterVolumeRateStandard,GasMassRate
Standard,OilMassRateStandard,WaterMassRate
Standard,GasHoldupStandard,GasHoldupFlowing,Liquid
Holdup,OilHoldup,WaterHoldup,TotalPipelineVolume,
MaxHydrateSubCooling,MaxWaxSubCooling,Max
AsphalteneSubCooling,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.
Allthereturnedvariableshavedoubletypeexclude
Optimize_title(ithasBooleantype)andOptimize_title_type,
Variable_alpha,Variable_beta(theyhaveStringtype).
Page 117
PIPESIMVersion2011.1OpenLinkReferenceManual
GetCaseVariableValue(iCaseasint,
sPropNameasString)
GetBranchGlobalVariableValue(iBranch
asint,sPropNameasstring)
Thesefunctionsworkthewaysimilarto
GetBranchInVariableValuefunctionandgetsrequested
valueofvariabletype.
GetSBranchGlobalVariableValue(iBranch
sTypeparametercanhavefollowingvalues:
asint,sTypeasstring)
BranchPressureDrop
GetWellGlobalVariableValue(iWellas
int,sPropNameasstring)
MaxPressure
T
BranchTemperatureDrop
GetBranchGlobalStrVariableValue
(sBranchasstring,sTypeasstring)
GetWellGlobalStrVariableValue(sWell
asstring,sTypeasstring)
Thesefunctionsworkthewaysimilarto
GetBranchGlobalVariableValuefunctionandgets
requestedvalueofvariabletype.
sBranchorsWellistheobjectname.
sTypeparametercanhavefollowingvalues:
BranchPressureDrop
MaxPressure
BranchTemperatureDrop
PIPESIMVersion2011.1OpenLinkReferenceManual
i, Max Pres);
i, Comp Power);
i, Choke DP);
Pressure);
Temperature);
MassRate);
LiquidRate);
GasRate);
Page 119
PIPESIMVersion2011.1OpenLinkReferenceManual
TakenfromEXPORT.XLSOpenLinkCasestudy
Private Sub ShowResults()
Dim PnsReader As New PNSREADERLib.PNSCom
Dim filename
'clear output range
Set rv = Range(OUTVAL_RANGE)
rv.ClearContents
filename = Range(MODELFILE)
pos = InStr(1, filename, .bpn, 1)
If (pos > 0) Then
filename = Left(filename, pos)
filename = filename + pns
End If
Dim
Dim
Dim
Dim
nodeindex As Long
sourcename As Variant
value As Double
bOK
If (PnsReader.ReadPnsFile(filename)) Then
Set r = Range(SOURCE_RANGE)
Dim col
col = 1
Page 120
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Set r1 = Range(OUTINJGAS_RANGE2)
r1.ClearContents
Set r2 = Range(OUTFLOWRATE_RANGE2)
r2.ClearContents
For Each sourcename In r.Columns
nodeindex = PnsReader.GetNodeIndex(sourcename)
If (nodeindex <> -1) Then
value = PnsReader.GetNodeVariableValue(nodeindex, Pressure)
If (value <> -7777) Then
rv.Cells(1, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, Temperature)
rv.Cells(2, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, LiquidRate)
rv.Cells(3, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, GasRate)
rv.Cells(4, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, MassRate)
rv.Cells(5, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, GLR)
rv.Cells(6, col) = value
End If
If (value <> -7777) Then
value = PnsReader.GetNodeVariableValue(nodeindex, Water Cut)
rv.Cells(7, col) = value
End If
End If
'-------------------------------------------------------'Get the pressure profiles -----------------------------Dim
Dim
Dim
Dim
plcfile = Range(MODELFILE)
Page 121
PIPESIMVersion2011.1OpenLinkReferenceManual
tempfile = plcfile
Do
pos = InStr(1, tempfile, \, 1)
tempfile = Right(tempfile, Len(tempfile) - pos)
Loop While pos > 0
If (Len(tempfile) > 0) Then
plcfile = Left(plcfile, Len(plcfile) - Len(tempfile))
plcfile = plcfile + sourcename + .plc
If (PltReaderObj.OpenWellFile(plcfile)) Then
distance = PltReaderObj.GetColumnVariableDataAt(Total
Distance (ft))
Dim Lower, Upper, i
Lower = LBound(distance(0), 1)
Upper = UBound(distance(0), 1)
For i = Lower To Upper - 2
r1.Cells(i + 1) = distance(0)(i)
Next
pressure = PltReaderObj.GetColumnVariableDataAt(Pressure
(psia))
Dim LowerO, UpperO
Dim outter
LowerO = LBound(distance(0), 1)
UpperO = UBound(distance(0), 1)
For outter = LowerO To UpperO - 2
r2.Cells(outter + 1, col) = pressure(0)(outter)
Next
Set rtitle = Range(CASE1TITLE_RANGE)
rtitle.Cells(1, col) = pressure(0)(outter)
PltReaderObj.CloseWellFile
End If
End If
col = col + 1
Next
End If
EndSub
Page 122
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
ThenameoftheCOMmoduleisWellModelCOM.DLL.
Interfaces supported & Registration
SupportprovidedforanyCOMcompliantapplication
Supported COM Interfaces
Jones: TofitandvisualisetheIPRcurveforagivennumberofdatapointsaccordingtotheJones'equation:
PwsPwf=BQ+AQ^2
(Liquid)
Pws^2Pwf^2=BQ+AQ^2
(Gas)
Dependency MAP
ListofDependencies:Spr32x30.ocx,TeeChart.ocx,MFC42.DLL
COM Interface: Jones - Get Methods
a:thevalueoftheAparameterintheJonesequation
GetJonesAandBConstants([out]
double*a,[out]BSTR*a_unit,
[out]double*b,[out]BSTR*
b_unit)
a_unit:theunitstringfortheAparameter
b:thevalueoftheBparameterintheJonesequation
b_unit:theunitstringfortheBparameter
AddFlowrateAndPwfPoint([in]
doublefrate,[in]BSTRfrate_unit,
[in]doublepwf,[in]BSTR
pwf_unit)
frate:flowratevalue(double)
frate_unit:unitstringfortheflowratevalue.Anyof:
STB/d,sm3/dforLiquidRatesOR:mmscf/dmscf/d,scf/d,
mmsm3/d,msm3/d,sm3/dforgasrates
pwf:tubingflowingpressure(double)
pwf_unit:unitstringforthepwfvalue:Anyof:psiapsig,bara,
barg,atma,atmg,kPaa,kPag,kg/cm2a,kg/cm2g
Callthisfunctiononceforeachsurveypoint.
Page 123
PIPESIMVersion2011.1OpenLinkReferenceManual
AddFlowrateAndPwfData([in]
shortftype,[in]BSTRfrate_unit,
[in]BSTRpwf_unit,[in]BSTR
Legend,[in]VARIANT*vData,[in]
constunsignedlongpType)
ftype:fluidtype,type_liquid=0,type_gas=1
frate_unit:unitstringfortheflowratevalue.Anyof:STB/d,
sm3/dforLiquidRatesOR:mmscf/dmscf/d,scf/d,mmsm3/d,
msm3/d,sm3/dforgasrates
pwf_unit:unitstringforthepwfvalue:Anyof:psiapsig,bara,
barg,atma,atmg,kPaa,kPag,kg/cm2a,kg/cm2g
Legend:Legendtoshowonplot
vData:variantwhoseSAFEARRAYcontainsa2Darray(col[0]=
FlowRatedata,col[1]=Pwfdata)Line=0;Bar=1;HorizBar=2;
Area=3;Point=4
Usethisfunctiontocompareanobservedsetofpointswiththe
fittedcurve.
SetFluidType(/*[in]*/shortftype) ftype:fluidtype,type_liquid=0,type_gas=1
SetStaticPressure([in]double
pres,[in]BSTRunitStr)
Pres:staticpressurevalue
SetJonesAConstant([in]double
val,[in]shortunitSystem)
val:theAparameterintheJonesequation
UnitStr:unitsforthepressurevalue.Anyof:psiapsig,bara,
barg,atma,atmg,kPaa,kPag,kg/cm2a,kg/cm2g
unitSystem:0:valisindefaultEng:psi/(STB/d)^2(liq)or
(psi/mmscf/d)^2(gas)
1:valisdefaultSI:bar/(sm3/d)^2(liq)or(bar/mmsm3/d)^2
(gas)
SetthisvaluetocalculatetheBparametergivenAandone
surveypoint
SetJonesBConstant([in]double
val,[in]shortunitSystem)
val:theBparameterintheJonesequation
unitSystem:0:valisindefaultEng:psi/STB/d(liq)or
psi2/mmscf/d(gas)1:valisdefaultSI:bar/sm3/d(liq)or
bar2/mmsm3/d(gas).SetthisvaluetocalculatetheA
parametergivenBandonesurveypoint
SetJonesMeasuredAConstant([in] val:theAparameterintheJonesequation
doubleval,[in]shortunitSystem) unitSystem:0:valisindefaultEng:psi/(STB/d)^2(liq)or
(psi/mmscf/d)^2(gas)1:valisdefaultSI:bar/(sm3/d)^2(liq)or
(bar/mmsm3/d)^2(gas)Fordisplaypurposesonly.Setthis
valuetocompareameasuredpairofAandBvalueswiththe
calculatedones
SetJonesMeasuredBConstant([in] val:theBparameterintheJonesequation
doubleval,[in]shortunitSystem) unitSystem:0:valisindefaultEng:psi/STB/d(liq)or
psi2/mmscf/d(gas)1:valisdefaultSI:bar/sm3/d(liq)or
bar2/mmsm3/d(gas)
Fordisplaypurposesonly.Setthisvaluetocomparea
measuredpairofAandBvalueswiththecalculatedones
SetUnitSystem([in]long
unitSystem)
unitSystem:0:valueswillbedisplayedindefaultEngineering
units;1:SIunits
Page 124
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
DoCalculateConstants()
CalculatestheAandBparametersbasedonthegivendata:
staticreservoirpressureand{pwf,flowrate}points
ShowInflowPerformanceDlg()
DisplaystheIPRCOMgraphicalinterface
10.0,
28.0,
30.0,
25.0,
'mmscf/d',
'mmscf/d',
'mmscf/d',
'mmscf/d',
3600,
2400,
2100,
1600,
'psia'
'psia'
'psia'
'psia'
' Display graphical interface to show the fitted curve and calculated
constants
JonesObj.ShowInflowPerformanceDlg
Units Library
IUnitSystem Interface
Note:SeeUnitSystemfortheavailablequantitynamesandunitstrings.
Convert
[in]BSTRquantity_name,[in]
doublein_value,[in]double
factor_to_SI,[in]double
adder_to_SI,[in]BSTRout_unit,
[out,retval]double*out_value
Convertsin_valueto[out_value,out_unit]giventhe
in_valuesconversionfactorandaddertoconvertittoits
strictSIunit.Returnsout_valueinthegivenout_unit
Page 125
PIPESIMVersion2011.1OpenLinkReferenceManual
ConvertsagivenquantityinstrictSIunitstothegiven
Convert_SI
[in]BSTRquantityname,[in]double out_unit
si_value,[in]BSTRout_unit,[out,
retval]double*out_value
ConvertAny
[in]BSTRquantity_name,[in]
doublein_value,[in]BSTRin_unit,
[in]BSTRout_unit,[out,retval]
double*out_value
Convertsaquantitygivenas[in_value,in_units]toan
out_unit
ConvertStrictSIToCurrentUnits
[in]BSTRquantity_name,[in]
doublevalue,[in]BSTRout_unit,
[out,retval]double*out_value
Convertsaquantitygivenas[value]instrictSItoanout_unit
definedaccordingtotheunitsfileimportedusing
ImportUnitFile.BydefaultitwillbeEngunitsifnounitfile
hasbeenimported
ConvertToDefEng
[in]BSTRquantity_name,[in]
doublevalue,[in]BSTRvalue_unit,
[out]BSTR*eng_unit,[out,retval]
double*eng_value
Convertsaquantitygivenas[in_value,in_units]tothe
PIPESIMsdefaultengineeringunitforthatquantity.
Convertsaquantitygivenas[in_value,in_units]tothe
ConvertToDefSI
[in]BSTRquantity_name,[in]double PIPESIMsdefaultSIunitforthatquantity.Pleasenotethat
defaultSIisnotnecessarilyequaltostrictSI.
value,[in]BSTRvalue_unit,[out]
BSTR*si_unit,[out,retval]double*
si_value
Convertsaquantitygivenas[invalue,inunits]tothestrictSI
ConvertToStrictSI
[in]BSTRquantity_name,[in]double unitforthatquantity.PleasenotethatdefaultSIisnot
necessarilyequaltostrictSI
value,[in]BSTRvalue_unit,[out]
BSTR*si_unit,[out,retval]double
*si_value
DisplayUnitDialog
[in]VARIANT_BOOL
bShowFileOptions,[in]
VARIANT_BOOL
bShowDeaultOptions,[out]
VARIANT*pVar
Displaysthegraphicaluserinterfaceforunitsystemselection.
GetDefEngUnitString
[in]BSTRquantityname,[out,
retval]BSTR*unitstring
Returnsthedefaultengineeringunitstringforagiven
quantity.
GetDefSIUnitString
[in]BSTRquantity_name,[out,
retval]BSTR*unit_string
ReturnsthedefaultSIunitstringforagivenquantity.
GetLastError
[out,retval]BSTR*ErrorStr
Returnsanerrordescription.Thismethodshouldbecalled
immediatelyafterafunctionhasreturnedanerrorcode.
Page 126
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetStrictSIUnitString
[in]BSTRquantityname,[out,
retval]BSTR*unit_string
ReturnsthestrictSIunitstringforagivenquantity.
GetUnitStrings
[in]BSTRquantityname,[out]
VARIANT*pVar
Returnsanarrayofunitstringsdefinedforthegivenquantity.
GetUnknownValue
[out,retval]double*pVal
ReturnsPIPESIMsdefinitionofunsetorunknownvalue.
ImportUnitFile[in]BSTRfilename
Importsasavedunitsfile(savedbydefaultwitha.unf
extension)
IReal Interface
UnitClass
string
Gets/setsunitclassname
SetRealValue
[in]doubleValue,[in]BSTRUnit
SetsaValueinthespecifiedunitstring
ReturnsavalueintheunitscorrespondingtopUnit
GetRealVal
[out]double*pValue,[out]BSTR*
pUnit
SetSelectedUnit
[in]BSTRUnitStr,[out,retval]
VARIANT_BOOL
Selectsthegivenunitstring
GetSelectedUnit
[out,retval]BSTR*UnitStr
Returnstheselectedunitstring
GetDefEngValue
[out,retval]double*Val
Returnsthevalueindefaultengineeringunits
GetStrictSIValue
ReturnsthevalueinstrictSIunits
GetUserValue
Returnsthevalueinuserselectedunits
SetStrictSIValue
SetsaValueinstrictSIunits
Reservoir Table
Name
ThenameoftheCOMmoduleisResTable.DLL.
Interfaces supported & Registration
SupportprovidedforanyCOMcompliantapplication
Page 127
PIPESIMVersion2011.1OpenLinkReferenceManual
RESTABLELib.IResTableOp:
TooutputVFPtablesforexternalreservoirsimulators.Theoutputfilesare
<filename>.VFP<PROD|INJ>.<BHP|TEMP>.<tabnum>.txt,
where<filename>isthebasemodelname,
<PROD|INJ>indicatesProductionorInjectionwell,
<BHP|TEMP>indicatesBHPorTemperatureVFPtable,and
<tabnum>isthetablenumbertobeincludedinECLIPSEfile.
Note:TheInjectionwellorTemeratureVFPtableoptionsareonlyavailableforELICPSEsimulator.
IResTableOp Object - Properties
RunEngineMinimisedAsBoolean
Runstheengineinaminimisedwindow
RunPlotToolWithEngineAsBoolean
IfTrue(1)showstheplottingtool(PSPlot)asthesimulation
runs
PsmFilePathAsString
Thefullpathtothemodelfile(.psmfile)
PlotToolPathAsString
Thefullpathtotheplottingtool(PSPlot)
IncludeFilePathAsString
Thefullpathnametotheenginesoperationfile
PipesimEnginePathAsString
ThefullpathtothePIPESIMengine
EngineSwitchAsString
Sets/getsextracommandlineargumentsforthePIPESIM
engine
HasGasLiftInjectionAsBoolean
Trueforawellwithgasinjectionartificiallift
HasESPAsBoolean
TrueforawellwithESP
HasGasLiftInjectionAsBoolean
Trueforawellwithgasinjectionartificiallift
IsProducerModelAsBoolean
Trueforaproductionwell,Falseforaninjectionwell
IsFluidModelCompositionalAs
Boolean
Trueforawellwithgasinjectionartificiallift
FixedInjectionDepthsAsBoolean
Trueforawellwithfixedgasinjectiondepth
ModelIsInjectionWellAsBoolean
Trueforaninjectionwell
HasInjectorAsBoolean
IsBHPTableOnlyAsBoolean
IfTrue,onlygeneratepressureVFPtable.Otherwise,an
additionaltemperatureVFPtablewillbegenerated.Default
isTrue.
UserElevAsDouble
UserspecifiedelevationinVFPtable.Ifunspecified,a
defaultvalue,whichisthetotalelevationalchangefrominlet
tooutlet,willbewrittentotheVFPtable.
Page 128
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
GetLastError()AsString
Returnsanerrordescriptionafterfunctioncallfailure.Must
becalledimmediatelyafterthecalltothefailedfunction.
GetIsUnset()AsBoolean
ReturnsTrue(1)iftheoperationsdataisallblank(unset)
GetIsEngineActive()AsBoolean
ReturnsTrue(1)ifthePIPESIMengineisrunning,otherwise
False(0)
GetRawDataSize()AsLong
Returnsthesizeofrawdata
SetLanguage(nlLanguageIDAsLong)
AsBoolean
Setstheuserinterfacelanguage
AvailablevaluesfornlLanguageIDare:
0x0809English(UK)
0x0419Russian
0x080ASpanish(Mexican)
0x0416Portuguese(Brazilian)
0x0804Chinese(PRC)
FunctionreturnsTrueiflanguagewaschangedsuccessfully
andFalseotherwise
DisplayDialog(p_VarUnitManagerAs Displaystheoperationsgraphicalinterface.PassaNULL
variantasthefirstargument.
Variant)
Thismethodisobsolete.UseDisplayDialog2methodinstead
DisplayDialog2(p_VarUnitManager
AsVariant)AsBoolean
Displaystheoperationsgraphicalinterface.PassaNull
variantasthefirstargument.Returnstrueifdialogboxwas
closedOK,otherwisefalse.
RunOperation();
Runsthesimulation
KillOperation();
Terminatestheenginerun
WriteOperationFile()AsBoolean
WritesanASCIIfilecontainingtheinstructionstothe
simulationenginetoruntheoperation.
ReadRawData(pVarAsVarient)As
Boolean
SerializetheReservoirTabledatastructureintoabinaryfile
andthenreadsitintoamemoryblockpointedbypVar.
WriteRawData(varasVariant)As
Boolean
Writesabinaryfilecontainingtherawdatapointedbyvar
andthendeserializethedataintotheReservoirTabledata
structure.
Page 129
PIPESIMVersion2011.1OpenLinkReferenceManual
TakenfromOpenLinkVFPBatchRuns.XLSOpenLinkCasestudy
Sub RunVFPBatch()
'Dimension all variables
Dim NoOfWells As Integer, WellList() As Variant, WorkingDirectory As String,
FirstWell As Integer
Dim VfpSaveExists As String, MsgBoxYesNo As Long, n As Long, retval, TextEditor
As String
Dim PsimModObj As New NET32COMLib.ISingleBranchModel
Dim VfpModObj As New NET32COMLib.ISingleBranchModel
Dim ResTabObj As New RESTABLELib.IResTableOp
Dim ModelIsRunning As Boolean, NewHour As Integer, NewMinute As Integer,
NewSecond As Integer
Dim WaitTime As Date, VfpFileName As String
'Unprotect the sheet
ActiveSheet.Unprotect
'Get the well and sensitivity set names
Range("MessageBox") = "Checking input data"
Call ReadWellAndSenSetData(NoOfWells, WellList(), WorkingDirectory, FirstWell)
'Set the operation interface to each model and run it
For n = 1 To NoOfWells
'get the reservoir table object
Range("MessageBox") = "Opening sensitivity set " & WellList(n, 2)
VfpModObj.OpenModel (WorkingDirectory & "\" & WellList(n, 2) & ".bps")
VfpModObj.SetOperationType 5
VfpModObj.GetOperationInterface ResTabObj
'Set the operation interface
Range("MessageBox") = "Opening PIPESIM model " & WellList(n, 1)
PsimModObj.OpenModel (WorkingDirectory & "\" & WellList(n, 1))
PsimModObj.SetOperationType 5
PsimModObj.SetOperationInterface ResTabObj
'Kick off the model
Range("MessageBox") = "Generating VFP table for " & WellList(n, 1)
PsimModObj.RunSingleBranchModel2 False, "-B -v0", False
'Wait for it to finish
ModelIsRunning = PsimModObj.GetIsModelRunning
While ModelIsRunning = True
ModelIsRunning = PsimModObj.GetIsModelRunning
NewHour = Hour(Now())
NewMinute = Minute(Now())
NewSecond = Second(Now()) + 1
WaitTime = TimeSerial(NewHour, NewMinute, NewSecond)
Application.Wait WaitTime
Wend
'Save the model
Range("MessageBox") = "Saving " & WellList(n, 1)
PsimModObj.SaveModel (WorkingDirectory & "\" & WellList(n, 1))
Next n
'delete all the rubbish
Call ClearRubbish(WorkingDirectory)
'Merge vfp files
Page 130
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Page 131
PIPESIMVersion2011.1OpenLinkReferenceManual
Object Type
Description
n_FOLD
(networkfolder)
n_SOURCE
(networksource)
n_SINK
(networksink)
n_JUNC
(networkjunction)
n_BRANCH
(networkbranch)
n_TEXT
(textobject)
n_PRODWELL
(networkproductionwell)
n_INJWELL
(networkinjectionwell)
30
n_REINJECTOR
(networkreinjector)
31
n_WELLCONNECTOR
(networkwellconnector)
Object ID
Object Type
Description
10
n_PINTSOURCE
(singlebranchsource)
11
n_PINTVERTCOMP
(VerticalComp.)
12
n_PINTHORCOMP
(HorizontalComp.)
13
n_FLOWLINE
(Flowline)
14
n_RISER
(Riser)
15
n_CONNECTOR
(Zerolengthconnector)
16
n_TUBING
(Tubing)
17
n_NODE
(genericnode)
18
n_CHOKE
(choke)
19
n_COMPRESSOR
(compressor)
20
n_EXPANDER
(expander)
21
n_HEATX
(heatexchanger)
22
n_PUMP
(centrifugalpump)
23
n_BOOSTER
(multiphasebooster)
24
n_INJECTOR
(injectionpoint)
25
n_SEPARATOR
(separator)
26
n_REPORT
(reporttool)
27
n_ADDMULT
(adder/multiplier)
28
n_NAPOINT
(nodalanalysispoint)
Page 132
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Object ID
Object Type
Description
29
n_EKT
(enginekeywordtool)
32
n_SSSV
(SSSV,tubingsubcomponent)
33
n_GLValve
(GasLiftvalve,subcomponent)
34
n_BLACKBOX
(Genericequipmenttype)
Object Properties
Network objects properties
Property name
Description
BRANCHBLOCKTYPE
Branchblocktype:0fornone,1forforward,2for
reverse
WELLBLOCKTYPE
Wellblocktype:0fornone,1forforward,2forreverse
Description
PRESSURE
Staticreservoirpressure
TEMPERATURE
Reservoirtemperature
IPRTYPE
Completionmodeltype(seeIPRTypes(Vertical))
Description
WELLPIFLUIDTYPE
Fluidtypeforthemodel(seeFluidTypes)
WELLPIGASPI
GasPI
WELLPILIQPI
LiquidPI
WELLPINONLINEARCORRECTION
UseVogelbelowbubblepoint(forliquid)
Description
VOGELAOFP
AbsoluteOpenFlowPotential
VOGELN
Vogelcoefficient
Page 133
PIPESIMVersion2011.1OpenLinkReferenceManual
Description
FETKOVITCHAOFP
OpenFlowPotential
FETKOVITCHN
nexponent
Description
JONESFLUIDTYPE(seeFluidTypes)
Fluidtypeforthemodel(seeFluidTypes)
JONESGASA
A(turb)coefficientforGas
JONESGASB
B(lam)coefficientforGas
JONESLIQA
A(turb)coefficientforLiquid
JONESLIQB
B(lam)coefficientforLiquid
Description
BACKPRESSUREC
ConstantC
BACKPRESSUREN
Slopen
Description
PSEUDOSSIPRBASIS
Fluidtypeforthemodel(seeFluidTypes)
PSEUDOSSUSEPSEUDOPRES
Usepseudopressuremethod(forgas)
PSEUDOSSVOGEL
UseVogelbelowbubblepoint(forliquid)
PSEUDOSSTHICKNESS
Reservoirthickness
PSEUDOSSWELLBOREID
Wellborediameter
PSEUDOSSPERMEABILITY
Reservoirpermeability
PSEUDOSSENTERPERM
Enteronlyreservoirpermeabilityordetaileduser
definedtable(0foruserdefinedtable,1foronly
reservoirpermeability)
PSEUDOSSDEFRADIUS
UseDrainageradius(ifset)
PSEUDOSSDRAINRADIUS
Drainageradius
PSEUDOSSRESAREA
Reservoirarea
PSEUDOSSSHAPEFACTOR
Shapefactor
PSEUDOSSSKIN
Mechanicalskin
Page 134
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
PSEUDOSSRATESKINGAS
Ratedependentskinforgas
PSEUDOSSRATESKINLIQ
Ratedependentskinforliquid
PSEUDOSSCALCSKIN
CalculateMechanicalskin(ifset)
PSEUDOSSCALCRATESKIN
CalculateRatedependentskin(ifset)
PSEUDOSSCOMPOPTIONS
Completionoptionstype
PSEUDOSSDAMAGEDID
Damagedzonediameter
PSEUDOSSDAMAGEDPERM
Damagedzonepermeability
PSEUDOSSCOMPACTEDID
Compactedzonediameter
PSEUDOSSCOMPACTEDPERM
Compactedzonepermeability
PSEUDOSSGRAVELPERM
Gravelpackpermeability
PSEUDOSSGRAVELTUNNEL
Gravelpacktunnellength
PSEUDOSSGRAVELCASINGID
GravelpackcasingID
PSEUDOSSGRAVELSCREENSZ
Gravelpackscreendiameter
PSEUDOSSCOMPVERTPERM
Completionverticalpermeability
PSEUDOSSCOMPINTERVAL
Completionopeninterval
PSEUDOSSCOMPDEVIATION
Completiondeviation
PSEUDOSSPERFSKINMETHOD
Perforationskinmethod(0forMcLeod,1for
Karakas/Tariq)
PSEUDOSSPERFID
Perforationdiameter
PSEUDOSSPERFLENGTH
Depthofpenetration
PSEUDOSSPERFSHOTDENSITY
Perforationdensity
PSEUDOSSPERFPHASEANG
Phaseangle
PSEUDOSSFPSKINMETHOD
FracPackskinmethod(0forFractureproperties,1for
conductivity)
PSEUDOSSFPFRACHALFLEN
Fracturehalflength
PSEUDOSSFPFRACWIDTH
Fracturewidth
PSEUDOSSFPPROPPERM
Fractureproppantpermeability
PSEUDOSSFPCOND
FracPackconductivity
PSEUDOSSFPFACESKINCALC
IncludeFracFaceskin(ifset)
PSEUDOSSFPDAMAGEDEPTH
FracFaceDepthofdamage
PSEUDOSSFPDAMPERM
FracFaceDamagepermeability
PSEUDOSSFPCHOKESKINCALC
IncludeChokeFractureskin(ifset)
PSEUDOSSFPCHOKELENGTH
Chokelength
PSEUDOSSFPCHOKEPERM
Fracchokepermeability
PSEUDOSSDZSKINCALC
Includedamagedzoneskin(ifset)
Page 135
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
PSEUDOSSGPSKINCALC
Includegravelpackskin(ifset)
PSEUDOSSPFSKINCALC
Includeperforationskin(ifset)
PSEUDOSSPPDSKINCALC
Includepartialpenetration/deviationskin(ifset)
PSEUDOSSFPSKINCALC
IncludeFracPackskin(ifset)
Description
FORCHA
A(lam)coefficient
FORCHF
F(turb)coefficient
Description
HYDFRACTIPRBASIS
Fluidtypeforthemodel(seeFluidTypes)
HYDFRACTVOGEL
UseVogelbelowbubblepoint(forliquid)
HYDFRACTPERMEABILITY
Reservoirpermeability
HYDFRACTTHICKNESS
Reservoirthickness
HYDFRACTDRAINRADIUS
Drainageradius
HYDFRACTWELLBOREID
Wellborediameter
HYDFRACTFRACTLENGTH
Fracturehalflength
HYDFRACTFRACTPERM
Fracturepermeability
HYDFRACTFRACTWIDTH
Fracturewidth
HYDFRACTTRANSIENT
Usetransientparameters(ifset)
HYDFRACTTIME
Time
HYDFRACTPOROSITY
Porosity
HYDFRACTCOMPRESS
Totalcompressibility
Description
TRANSIENTIPRIPRBASIS
Fluidtypeforthemodel(seeFluidTypes)
TRANSIENTIPRUSEPSEUDOPRES
Usepseudopressuremethod(forgas)
TRANSIENTIPRVOGEL
UseVogelbelowbubblepoint(forliquid)
TRANSIENTIPRPERMEABILITY
Reservoirpermeability
TRANSIENTIPRTHICKNESS
Reservoirthickness
Page 136
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
TRANSIENTIPRDRAINRADIUS
Drainageradius
TRANSIENTIPRWELLBOREID
Wellborediameter
TRANSIENTIPRTIME
Time
TRANSIENTIPRPOROSITY
Porosity
TRANSIENTIPRCOMPRESS
Totalcompressibility
TRANSIENTIPRSKIN
Mechanicalskin
TRANSIENTIPRRATESKINGAS
Ratedependentskinforgas
TRANSIENTIPRRATESKINLIQ
Ratedependentskinforliquid
TRANSIENTIPRCALCSKIN
CalculateMechanicalskin(ifset)
TRANSIENTIPRCALCRATESKIN
CalculateRatedependentskin(ifset)
TRANSIENTIPRCOMPOPTIONS
Completionoptionstype
TRANSIENTIPRDAMAGEDID
Damagedzonediameter
TRANSIENTIPRDAMAGEDPERM
Damagedzonepermeability
TRANSIENTIPRCOMPACTEDID
Compactedzonediameter
TRANSIENTIPRCOMPACTEDPERM
Compactedzonepermeability
TRANSIENTIPRGRAVELPERM
Gravelpackpermeability
TRANSIENTIPRGRAVELTUNNEL
Gravelpacktunnellength
TRANSIENTIPRGRAVELCASINGID
GravelpackcasingID
TRANSIENTIPRGRAVELSCREENSZ
Gravelpackscreendiameter
TRANSIENTIPRCOMPDEVIATION
Completiondeviation
TRANSIENTIPRPERFSKINMETHOD
Perforationskinmethod(0forMcLeod,1for
Karakas/Tariq)
TRANSIENTIPRCOMPINTERVAL
Completionopeninterval
TRANSIENTIPRCOMPVERTPERM
Completionverticalpermeability
TRANSIENTIPRPERFID
Perforationdiameter
TRANSIENTIPRPERFLENGTH
Depthofpenetration
TRANSIENTIPRPERFSHOTDENSITY
Perforationdensity
TRANSIENTIPRPERFPHASEANG
Phaseangle
TRANSIENTIPRDZSKINCALC
Includedamagedzoneskin(ifset)
TRANSIENTIPRGPSKINCALC
Includegravelpackskin(ifset)
TRANSIENTIPRPFSKINCALC
Includeperforationskin(ifset)
TRANSIENTIPRPPDSKINCALC
Includepartialpenetration/deviationskin(ifset)
Page 137
PIPESIMVersion2011.1OpenLinkReferenceManual
FCV properties
Property name
Description
FCVVALVETYPE
FCVtype:0generic,1specific(manufactured)
FCVGENERICVALVETYPE
GenericFCVtype:0equivalentchokearea,1
maximumratethroughvalve
FCVCHOKEEQUATION
Gaschokeequation:0mechanistic
FCVEQCHOKEARIA
Equivalentchokearea
FCVMAXLIQRATE
Maximumliquidratethroughvalve
FCVMAXGASRATE
Maximumgasratethroughvalve
FCVLIQCOEFF
Liquidflowcoefficient
FCVGASCOEFF
Gasflowcoefficient
FCVPRESSDROP
Pressuredropratiofactor
FCVMANUFACTURER
FCVmanufacturer
FCVTYPE
FCVtype(munufacturersspecific)
FCVPARTNUMBER
FCVpartnumber
FCVVALVEPOSITION
Valvepostion
FCVVALVEPERSENTOPEN
Valvepercentopen
Description
PRESSURE
Staticreservoirpressure
TEMPERATURE
Reservoirtemperature
IPRTYPE
Completionmodeltype(0JoshiOil,1JoshiGas,2
Babu&OdehOil,3Babu&Odeh,4DistributedPI)
IPROPTION
IPRModel:0distributedPI,1singlepointPI
DAMAGEDDIAMETER
Damagedzonediameter
DAMAGEDPERMEABILITY
Damagedzonepermeability
COMPACTEDDIAMETER
Compactedzonediameter
COMPACTEDPERMEABILITY
Compactedzonepermeability
GRAVELPACKPERMEABILITY
Gravelpackpermeability
GRAVELPACKTUNNEL
Gravelpacktunnel
PERFORATIONDIAMETER
Perforationdiameter
PERFORATIONLENGTH
Perforationlength
PERFORATIONSHOTDENSITY
Perforationshotdensity
Page 138
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Description
DISTFLUIDTYPE
Fluidtype
DISTLIQPI
LiquidPI
DISTGASPI
GasPI
Description
JOSHIREXTN
JOSHITHICKNESS
Reservoirthickness
JOSHIPERMEABILITYX
Permeabilityinthexdirection
JOSHIPERMEABILITYY
Permeabilityintheydirection
JOSHIPERMEABILITYZ
Permeabilityinthezdirection
JOSHIECCENT
Wellboreeccentricity(theoffsetofthewellfromthe
centerofthepayzone)
JOSHILENGTH
Lengthofthehorizontalwell(completion)
JOSHIWELLBORERADIUS
Wellboreradius
JOSHISKIN
Mechanicalskinfactor
JOSHIVISCOSITY
Fluid viscosity
JOSHIOFVF
OilFormationVolumeFactor(oilwell)
JOSHIGASZ
Gascompressibilityfactor(gaswell)
JOSHICALCULATESKIN
Calculateskin:1fortrue,0forfalse
Description
BABUXDIM
BABUYDIM
BABUTHICKNESS
Reservoirthickness
BABUPERMEABILITYX
Permeabilityinthexdirection
BABUPERMEABILITYY
Permeabilityintheydirection
BABUPERMEABILITYZ
Permeabilityinthezdirection
BABUXWELL
xcoordinatesofthehorizontalwelltrajectory
BABUYWELL
ycoordinatesofthehorizontalwelltrajectory
BABUZWELL
zcoordinatesofthehorizontalwelltrajectory
Page 139
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
BABULENGTH
Lengthoftheperforationintotheformation
BABUWELLBORERADIUS
Wellboreradius
BABUSKIN
Mechanicalskinfactor
BABUVISCOSITY
Fluid viscosity
BABUOFVF
OilFormationVolumeFactor(oilwell)
BABUGASZ
Gascompressibilityfactor(gaswell)
BABUCALCULATESKIN
Calculateskin:1fortrue,0forfalse
Description
ACTIVATE
Maketubingactive
TUBINGMODEL
Tubingmodel(0:simple,1detailed)
LIFTTYPE
ArtificialLifttype(0:ESP,1:GasLift,2:PCP,3:NONE)
KICKOFFANGLE
KickOffangle
KICKOFFTVD
KickOffTVD
PERFSMD
PerforationMD
PERFSTEMPERATURE
ReservoirTemperature
PERFSTVD
PerforationTVD
SURFACETEMPERATURE
Surfacetemperature
SURFACETVD
SurfaceTVD
COILEDTUBMD
CoiledtubingbottomMD
COILEDTUBRATEOPTION
Coiledtubingrateoption(0forgasrate,1forGLR)
COILEDTUBRATE
Coiledtubinggasrate
COILEDTUBGLR
CoiledtubingGLR
COILEDTUBSPECIFICGRAVITY
Coiledtubingspecificgravity
COILEDTUBID
CoiledtubingID
COILEDTUBSURFACEPRESSURE
Coiledtubinggasratesurfacepressure
COILEDTUBOD
CoiledtubingOD
Page 140
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
(accessedbyGetPropertyValAtObjectIndex&SetPropertyValAtObjectIndexmethods)
Property name
Description
CHOKE
CHOKEMD
ChokeMD
BEANSIZE
Beansize
CRITICALPRESSURERATIO
Criticalpressureratio
CRITICALCORRELATION
Criticalcorrelation(0mechanistic,1Gilbert,2Ros,
3Achong,4Baxendell,5Ashford,6Poetbeck,7
Omana,8Pilehvari)
SUBCRITICALCORRELATION
Subcriticalcorrelation(0mechanistic,1API14b,2
Ashford)
CHOKETOLERANCE
Tolerance
CALCCRITICALPRESSURERATIO
Optiontocalculatecriticalpressureratio(1tocalculate,
0touseuserdefinedvalue)
UPSTREAMPIPEID
UpstreampipeID
CP/CV
Fluidheatcapacityratio(Cp/Cv)
DISCHARGECOEFFICIENT
Dischargecoefficient
YATCRITICALFLOW
Gasexpansionfactoratcriticalflow
BOTHPHASES
Flowcoefficientforbothphases
GASPHASE
Flowcoefficientforgasphase
LIQPHASE
Flowcoefficientforliquidphase
FLOWRATE
Optiontouseflowratetoidentifycriticalflow(whenset
to1)
PRESSURERATIO
Optiontouseflowratetoidentifycriticalflow(whenset
to1)
UPSTREAMVELOCITY
Optiontousesonicupstreamvelocitytoidentifycritical
flow(whensetto1)
DOWNSTREAMVELOCITY
Optiontousesonicdownstreamvelocitytoidentify
criticalflow(whensetto1)
ADJUSTSUBCRITICALCORR
Optiontoadjustsubcriticalcorrelationtomatch
flowrateprediction(whensetto1)
PRINTDETAILEDCALCULATIONS
Optiontoprintdetailedcalculationforchoke(0=not
cheched,1=checked)
Page 141
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
ESP
ESPMD
ESPMD(simpleprofile)
ESPSTAGES
Numberofstages(simpleprofile)
ESPSPEED
ESPspeed(simpleprofile)
ESPMANUFACTURER
Manufacturername(simpleprofile)
ESPMODEL
Modelname(simpleprofile)
ESPHEADFACTORorESPEFFICIENCY
ESPheadfactor(simpleprofile)
ESPVISCOSITYCORRECTION
ESPviscositycorrection:0or1(simpleprofile)
ESPGASSEPARATOR
Gasseparatorpresent(ifset)(simpleprofile)
ESPSEPEFFICIENCY
Separatorefficiency(simpleprofile)
ESPPOWER
ESPPower(simpleprofile)
ESPUSEPOWER
UseESPPower:0or1(simpleprofile)
ESPMDNODE
SameasESPMDbutfordetailedprofile
ESPSTAGESNODE
SameasESPSTAGESbutfordetailedprofile
ESPSPEEDNODE
SameasESPSPEEDbutfordetailedprofile
ESPMANUFACTURERNODE
SameasESPMANUFACTURERbutfordetailedprofile
ESPMODELNODE
SameasESPMODELbutfordetailedprofile
ESPHEADFACTORNODEor
SameasESPHEADFACTORbutfordetailedprofile
ESPEFFICIENCYNODE
ESPGASSEPARATORNODE
SameasESPGASSEPARATORbutfordetailedprofile
ESPSEPEFFICIENCYNODE
SameasESPSEPEFFICIENCYbutfordetailedprofile
ESPVISCOSITYCORRECTIONNODE
SameasESPVISCOSITYCORRECTIONbutfordetailed
profile
ESPPOWERNODE
SameasESPPOWERbutfordetailedprofile
ESPUSEPOWERNODE
SameasESPUSEPOWERbutfordetailedprofile
Propertyname
Description
PCP
PCPMD
PCPMD(simpleprofile)
PCPMANUFACTURER
Manufacturername(simpleprofile)
PCPMODEL
Modelname(simpleprofile)
PCPUSERDEFINED
Userdefined(1fortrue,0forfalse)(simpleprofile)
PCPDIAMETER
PCPdiameter(simpleprofile)
PCPTOPDRIVE
PCPtopdrive(simpleprofile)
PCPRODDIAMETER
PCProddiameter(simpleprofile)
PCPHEADFACTOR
PCPhearfactor(simpleprofile)
Page 142
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
PCPSPEED
PCPdesignspeed(simpleprofile)
PCPBASESPEED
PCPbasespeed(simpleprofile)
PCPGASSEPARATOR
UsePCPgasseparator(1fortrue,0forfalse)(simple
profile)
PCPVISCOSITYCORRECTION
UsePCPviscositycorrection(1fortrue,0forfalse)
(simpleprofile)
PCPNOMINALRATE
PCPnominalflowrate(simpleprofile)
PCPMDNODE
SameasPCPMDbutfordetailedprofile
PCPMANUFACTURERNODE
SameasPCPMANUFACTURERbutfordetailedprofile
PCPMODELNODE
SameasPCPMODELbutfordetailedprofile
PCPUSERDEFINENODE
SameasPCPUSERDEFINEbutfordetailedprofile
PCPDIAMETERNODE
SameasPCPDIAMETERbutfordetailedprofile
PCPTOPDRIVENODE
SameasPCPTOPDRIVEbutfordetailedprofile
PCPRODDIAMETERNODE
SameasPCPRODDIAMETERbutfordetailedprofile
PCPHEADFACTORNODE
SameasPCPHEADFACTORbutfordetailedprofile
PCPSPEEDNODE
SameasPCPSPEEDbutfordetailedprofile
PCPBASESPEEDNODE
SameasPCPBASESPEEDbutfordetailedprofile
PCPGASSEPARATORNODE
SameasPCPGASSEPARATORbutfordetailedprofile
PCPVISCOSITYCORRECTIONNODE
SameasPCPVISCOSITYCORRECTIONbutfordetailed
profile
PCPNOMINALRATENODE
SameasPCPNOMINALRATEbutfordetailedprofile
Property name
Description
INJECTOR
GASLIFTRATEOPTION
Gasliftrateoption(0forgasrate,1forGLR,2forGLR
incremental)(simpleprofile)
GASLIFTRATE
Gasliftgasrate(simpleprofile)
GASLIFTGLR
GaslifttubingGLR(simpleprofile)
GASLIFTINCREMENTALGLR
GaslifttubingGLRincremental(simpleprofile)
GASLIFTMD
GasliftMD(simpleprofile)
GASLIFTPORTDIAMETER
Gasliftportdiameter(simpleprofile)
GASLIFTPVTFILE
Compositionfilename(simpleprofile)
GASLIFTPVTTYPE
Compositiontype(0forlocalcomposition,1forlocal
PVT,2forglobalPVT,3forlocalMFL)(simpleprofile)
GASLIFTSPECIFICGRAVITY
Gasliftspecificgravity(simpleprofile)
GASLIFTSURFACEPRESSURE
Surfacepressure(simpleprofile)
Page 143
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
GASLIFTSURFACETEMPERATURE
Surfacetemperature(simpleprofile)
GASLIFTRATEOPTIONNODE
SameasGASLIFTRATEOPTIONbutfordetailedprofile
GASLIFTRATENODE
SameasGASLIFTRATEbutfordetailedprofile
GASLIFTGLRNODE
SameasGASLIFTGLRbutfordetailedprofile
GASLIFTINCREMENTALGLRNODE
SameasGASLIFTINCREMENTALGLRbutfordetailed
profile
GASLIFTMDNODE
SameasGASLIFTMDbutfordetailedprofile
GASLIFTPORTDIAMETERNODE
SameasGASLIFTPORTDIAMETERbutfordetailed
profile
GASLIFTPVTFILENODE
SameasGASLIFTPVTFILEbutfordetailedprofile
GASLIFTPVTTYPENODE
SameasGASLIFTPVTTYPEbutfordetailedprofile
GASLIFTSPECIFICGRAVITYNODE
SameasGASLIFTSPECIFICGRAVITYbutfordetailed
profile
GASLIFTSURFACEPRESSURENODE
SameasGASLIFTSURFACEPRESSUREbutfordetailed
profile
GASLIFTSURFACETEMPERATURENODE
SameasGASLIFTSURFACETEMPERATUREbutfor
detailedprofile
Property name
Description
MultiphaseBooster
BOOSTERTYPE
Type:
0forGeneric;
1forGenericTwinScrew;
2forTwinScrew;
3forVendorTwinScrew;
4forFramo1999
5forFramo2009
BOOSTERCOMPEFFICIENCY
Compressorefficiency(onlyforgenericmultiphase
booster)
BOOSTERHAXIALDRIVETYPE
Haxialdrivetype:(onlyforFramo1999)
0forhydraulicdrive
1forelectricoilcooleddrive
2forelectricaircooleddrive
BOOSTERHAXIALFLOWPARAMETER
Haxialflowparameter
BOOSTERHAXIALHEADPARAMETER
Haxialheadparameter
BOOSTERVENDORFILE
Vendorfilename(onlyforvendortwinscrew
multiphasebooster)
Page 144
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
BOOSTERVENDORSPEEDPCNT
Vendorspeedpercentage(onlyforvendortwinscrew
multiphasebooster)
BOOSTERTWINNOMINAL
NominalBooster(onlyfortwinscrewmultiphase
booster)
BOOSTERTWINSPEED
Seriesname
BOOSTERVISCOSITYCORRECTION
Speedpercentage(onlyfortwinscrewmultiphase
booster)
Property name
Description
Pump
PUMPDISCHARGEPRESSURE
Pumpdischargepressure
PUMPPRESSUREDIFFERENTIAL
Pumppressuredifferential
PUMPPRESSURERATIO
Pumppressureratio
PUMPPOWER
Pumppower
PUMPEFFICIENCY
Pumpefficiency
PUMPVISCOSITYCORRECTION
Pumpviscositycorrection:1fortrue,0forfalse
COMPRESSORDISCHARGEPRESSURE
Compressordischargepressure
COMPRESSORPRESSUREDIFFERENTIAL
Compressorpressuredifferential
COMPRESSORPRESSURERATIO
Compressorpressureratio
COMPRESSORPOWER
Compressorpower
COMPRESSOREFFICIENCY
Compressorefficiency
Property name
Description
SEPARATOR
SEPARATORMD
SeparatorMD
EFFICIENCY
Efficiency
TYPE
Type(seeSeparatorTypes)
Property name
Description
SSSV
SSSVMD
SSSVMD(simpleprofile)
SSSVID
SSSVID(simpleprofile)
SSSVMDNODE
SameasSSSVMDbutfordetailedprofile
SSSVIDNODE
SameasSSSVIDbutfordetailedprofile
Page 145
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
GLValve
VALVEMD
ValveMD
VALVEAB
ValveAb
VALVEAP
ValveAp
VALVECHOKESIZE
Chokesize
VALVECV
ValveCv
VALVEPORTSIZE
Portsize
VALVEPTRO
ValvePtro
VALVEMANUF
Manufacturername
VALVESERIES
Seriesname
VALVEPORTNAME
Portname
VALVETYPE
Valvetype
VALVEDPFO
ValveDpfo
Property name
Description
Flowline(Riser)
DETAILEDPROFILE
Describesaconfigurationmodeforaflowline/riser:0
forsimple,1fordetailed
VERTICALLENGTH
thehorizontaldistancecoveredbythecomplete
flowline/riser
HORIZONTALLENGTH
thechangeinelevationbetweenthestartandtheend
oftheflowline/riser
HEIGHTUNDULATIONS
Anartificialfactorthatcanbeusedtoautomatically
introducesomeundulationsintotheflowline.Thevalue
enteredisthetotalchangeinelevationforevery1,000
units
HORIZPOSNODE
Horizontalpositionofanodeindetailedprofile
VERTPOSNODE
Verticalpositionofanodeindetailedprofile
TEMPERATURENODE
Ambienttemperatureofanodeindetailedprofile
UVALUENODE
HeattransferUvalueofanodeindetailedprofile
MEASUREDTEMPNODE
Measuredtemperatureofanodeindetailedprofile
MEASUREDPRESNODE
Measuredpressureofanodeindetailedprofile
Property name
Description
Tubing(pipesection)
PIPEAMBTEMPERATURE
Pipeambienttemperature(simpleprofile)
Page 146
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Property name
Description
PIPEFLOWTYPE
Flowtype(seePipeFlowTypes)(simpleprofile)
PIPEID
PipeID(simpleprofile)
PIPEMD
PipeMD(simpleprofile)
PIPEOD
PipeOD(simpleprofile)
PIPEROUGHNESS
Piperoughness(simpleprofile)
PIPEWT
Pipewallthickness(simpleprofile)
PIPEAMBTEMPERATURENODE
SameasPIPEAMBTEMPERATURE
butfordetailedprofile
PIPEFLOWTYPENODE
SameasPIPEFLOWTYPEbutfordetailedprofile
PIPEIDNODE
SameasPIPEIDbutfordetailedprofile
PIPEMDNODE
SameasPIPEMDbutfordetailedprofile
PIPEODNODE
SameasPIPEODbutfordetailedprofile
PIPEROUGHNESSNODE
SameasPIPEROUGHNESSbutfordetailedprofile
PIPEWTNODE
SameasPIPEWTbutfordetailedprofile
Generic Source
Property name
Description
SOURCEPRESSURE
Genericsourcepressure
SOURCETEMPERATURE
Genericsourcetemperature
Description
SEPARATORPRESSURE
Separatorpressure
SEPARATOREFFICIENCY
Separatorefficiency
SEPARATORSTREAMTYPE
Separatorstreamtype:0forliquid,1forgas,2for
water.
SEPARATORFEEDBRANCH
Separatorfeedbranchname
SEPARATORREINJECTBRANCH
Separatorreinjectbranchname
Artificial Lift
Lift Value
Description
Noartificiallift
Gasliftinjection
Page 147
PIPESIMVersion2011.1OpenLinkReferenceManual
Lift Value
Description
ESP
Completion Options
Type Value
Description
None
Openhole
Perforated
Gravelpackedandperforated
Openholegravelpack
Fracpack
Page 148
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Description
WellPI
Vogel
Fetkovitch
Jones
BackPressure
PseudoSteadyState
Forchheimer
HydraulicFracture
Transient
Description
Joshi(Oil)
Joshi(Gas)
Babu&Odeh(Oil)
Babu&Odeh(Gas)
DistributedPI
Description
DistributedPI
SinglePointPI
Fluid Types
Type Value
Description
LiquidRate
GasRate
MassRate
Page 149
PIPESIMVersion2011.1OpenLinkReferenceManual
Description
Tubing
Annular
Tubing+Annular
Rate Types
Type Value
Description
GLR
GOR
LGR
OGR
Separator Types
Type Value
Description
Liquid
Gas
Water
Operation Name
NoOperation
SystemAnalysis
PressureandTempProfile
NodalAnalysis
InjectionGasVsCasingHeadPressure
HorizontalWellPerformance
ReservoirTables
ArtificialLift
FlowCorrelationProfileMatch
(Reserved)
WaxDeposition
10
WellPerformanceCurves
Page 150
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Operation Value
Operation Name
11
GasLiftDiagnostics
12
GasLiftDeepestInjectionPoint
13
GasLiftLiftGasResponse
14
GasLiftBracketing
Equations of State
Value
Description
PengRobinson(multiflash,DBR&Eclipse300)
SRK(multiflas,DBR&Eclipse300)
StandardPengRobinson(multiflash)
StandardSRK(multiflash)
BWRS(multiflash)
Smirk(SIEPSPPTS)
2ParamPengRobinson(SISflash)
3ParamPengRobinson(SISflash)
2ParamPRStandard(SISflash)
3ParamPRStandard(SISflash)
26
AssociationCPA(multiflash)
501
NIST(REFPROPV8)
Viscosity Types
Value
Description
Pedersen
LBC
243
AasbergPetersen
541
NIST
BIP Sets
Value
Description
OilGas3
OilGas2
OilGas1
OilGas4
Page 151
PIPESIMVersion2011.1OpenLinkReferenceManual
Value
Description
UserBIPs
SISFlashdefault
221
Eclipse300default
321
DBRdefault
521
NISTdefault
Emulsion Types
Value
Description
Settooilviscosity
VolumeRatio
Woelflin
None
Quantity Name
Class Name
ADIM
UNITLESS
ACFM*,
UNITLESS
AGASRATE
ft3/min,acm/s^,m3/s!,m3/min,bbl/min,bbl/d,
m3/d,
AREA
AREA
in2*,
mm2^,
m2!,acres
AREAL
AREAEARTH
SURFACE
ft2*.m2^!,acres,mi2,ha,km2
COMPRESS
COMPRESSIBILITY
1/psia*,
COMPRESSIBILITY
1/bara^,
1/Pa!
CONDUCTIVITY
THERMALCONDUCTIVITY
THERMAL
CONDUCTIVITY
DELTAP
PRESSURE(DELTA) Psi*,
PRESSUREDROP
Btu/hr/ft/F*,
W/m/K!^
Bar^,atm,kPa,kg/cm2,
Pa!
DELTAT
TEMPERATURE
(DELTA)
F*,
C!^,K,R,
Page 152
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Quantity Name
Class Name
DENSITY
DENSITYLIQUID
lb/ft3*,
kg/m3!^,
g/cc,
DISTGASPI
DISTRIBUTEDGASPI
DISTLIQPI
DISTRIBUTEDLIQPI
ENTHALPY
SPECIFIC
PRODUCTIVITY
INDEX(GASPER
LENGTH)
Mmscf/d/psi2/ft*,
SPECIFIC
PRODUCTIVITY
INDEX(LIQPER
LENGTH)
STB/d/psi/ft*,
mmsm3/d/bar2/m^,msm3/d/kPa2/m,
sm3/s/Pa2/m!
sm3/d/bar/m^,sm3/d/kPa/m,
sm3/s/Pa/m!
ENERGYPER
Btu/lb*,
MASS(ENTHALPY) J/g^,
J/kg!
ENTROPY
SPECIFICENTROPY Btu/lb/F*,
J/g/K^,
J/kg/K!
FLOWGLRATIO
STDVOLUMEPER
VOLUME(GLR)
scf/bbl*,sm3/m3^!
FRACTION
RATIO(%)
%*!^
fract.,
GASPI
SPECIFIC
PRODUCTIVITY
INDEX(GAS)
Mmscf/d/psi2*,
mmscf/d/kPa2,mmsm3/d/bar2^,msm3/d/kPa2,
1.E4sm3/d/MPa2,
m3/s/Pa2!
GASRATE
STDVOLUMEGAS
RATE
Mmscf/d*,
Mscf/d,scf/d,mmsm3/d^,msm3/d,sm3/d,
1.E3sm3/d,1.E4sm3/d,
sm3/s!
GASRATE(FLOWING)
FLOWRATE
VOLUMEBASIS
(GAS)
Mmcf/d*,
GASRATERECIP
STDVOLUMEGAS
RATE
(RECIPROCAL)
1/mmscf/d*,1/mscf/d,1/scf/d,1/mmsm3/d,
1/msm3/d,1/sm3/d,1/1.E3sm3/d,1/1.E4sm3/d,
1/sm3/s!
GOR
Scf/STB*,
GLR
VOLUMEPER
VOLUME(GLR)
HEAD
ENERGYPER
ftlbf/lbm*,
mcf/d,cf/d,mmm3/d^,mm3/d,m3/d,1.E3m3/d,
1.E4m3/d,m3/s!
sm3/sm3!^
Page 153
PIPESIMVersion2011.1OpenLinkReferenceManual
Quantity Name
Class Name
COMPRESSORHEAD
MASS(HEAD)
kJ/kg^,J/kg!
JONESGASA
(JONESAGAS)
(psi/mmscf/d)^2*,
(bar/mmsm3/d)^2^,
(Pa/sm3/s)^2!
(bar/msm3/d)^2
JONESGASB
(JONESBGAS)
psi2/mmscf/d*,
bar2/mmsm3/d^,
Pa2/sm3/s!
bar2/msm3/d
JONESLIQA
(JONESALIQ)
psi/(STB/d)^2*,
bar/(sm3/d)^2^,
Pa/(sm3/s)^2!
JONESLIQB
(JONESBLIQ)
psi/STB/d*,
bar/sm3/d^,
Pa/sm3/s!
LENGTH
DIAMETER,ID,OD,WT,
LENGTH(SHORT)
LENGTHL
LENGTH(LONG)
LIQPI
LIQRATE
LENGTH
SHORTRANGE
Inches*,
LENGTH
MIDRANGE
Ft*,
SPECIFIC
PRODUCTIVITY
INDEX(LIQ)
STB/d/psi*,
STDVOLUME
LIQUIDRATE
ft,miles,mm^,cm,m!,km,1/64in,
Miles,m!^,km,
STB/d/kPa,sm3/d/bar^,sm3/d/kPa,sm3/d/MPa,
sm3/s/Pa!
STB/d*,
sm3/d^,
sm3/s!
LIQRATE(FLOWING)
FLOWRATE
VOLUMEBASIS
(LIQ)
bbl/d*,
LIQRATERECIP
STDVOLUME
LIQUIDRATE
(RECIPROCAL)
1/STB/d,1/sm3/d,1/sm3/s
MASS
MASS
Lb*,Kg!^
MASSRATE
FLOWRATEMASS
BASIS
lb/s*,
SPECIFICVOLUME
ft3/mol*,
MOLARVOLUME
m3/d^,m3/s!
lb/h,kg/s!^,kg/h,
Page 154
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Quantity Name
Class Name
MOLE
m3/mol!^
STB/mmscf*,
LGR
VOLUMEPER
VOLUME(LGR)
PERMEABILITY
PERMEABILITY
OGR
sm3/mmsm3^,sm3/msm3,sm3/1.E4sm3,m3/E3m3,
sm3/sm3!
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,kPaa,kPag,MPaa,MPa
g,kg/cm2a,kg/cm2g,Paa!,Pag,
PRESSUREGRAD
PRESSUREGRADIENT
PRESSURE
GRADIENT
psi/ft*,
bar/m^,atm/m,kPa/m,kg/cm2,
Pa/m!
ROTVELOCITY
FREQUENCY
FREQUENCY
SHOTS
Hz*!^
Rpm,
PERLENGTH
Shots/ft*,
Shots/m!^
SURFTENSION
SURFACETENSION Dyne/cm*,
SURFACETENSION
TEMPERATURE
N/m!^
TEMPERATURE
F*,
C!^,K,R,
TIME
TIME
Hr*^,
Min,s!,days,years
U
HEATTRANSFERCOEFFICIE
NT
VELOCITY
HEATTRANSFER
COEFFICIENT
Btu/hr/ft2/F*,
VELOCITY
ft/s*,
W/m2/K!^
m/s!^
VISCOSITY
VOLFRAC
VOLUMEFRACTION
VISCOSITY
DYNAMIC
Cp*^
VOLUMEPERSTD
VOLUME
Bbl/mmscf*,
Ns/m2!,lb/s/ft,
M3/mmsm3^,m3/sm3!
Page 155
PIPESIMVersion2011.1OpenLinkReferenceManual
Quantity Name
Class Name
VOLUME
VOLUME(LIQUID)
ft3*,m3!^
VOLUMEGAS
VOLUME(GAS)
ft3*,m3!^
NOTE:Thekeyword_STRICTSIinplaceoftheunitnamewillsetorgetavalueinthestrictSIunit.
Page 156
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Case Studies
Detailed explanation of routine
TheOpenLinkfunctionalityisdistributedwiththePIPESIMinstallationandiscontainedinanumberof
libraryfiles.ThemainfileisNet32COM.DLL,whichnormallyresidesintheprogramsdirectoryandprovides
theframeworkandmainentrypointsintobothnetworkandsinglebranchsimulationmodels.Twoother
filesareFluidModelCOM.DLLandFlowCorrelationCOM.DLL,whichprovideaccesstopropertiesdefinedin
thefluidandflowcorrelationmodelsrespectively.
Pre-Loop Steps
Step 1
Page 157
PIPESIMVersion2011.1OpenLinkReferenceManual
ThesestatementsdefinethevariablesBoandObjasablackoilobjectandaSinglebranchmodelobject
respectively.
ASingleBranchModelObjectcorrespondstotheSingleBranchModelInterface.
Dim x, n, TempAmb, TempSurf as Integer
Thisstatementletthecomputerknowthatthevariablesx,n,TempAmb,TempSurfusedintheprogram
areinteger.(Itisgoodprogrammingpracticetodeclareallvariablesusedinaprogramatthebeginning
ofthelisting).
Step 2:
TempAmb = Cells(11,4).value
If TmpAmb = then
Exit Sub
End If
Thisassignsthevaluelocatedinthecellcells(11,4)totheIntegervariablesTempAmb.
Step 3:
PathTemplate = cells(8,1)
If PathTemplate = Then
Exit Sub
End If
AssignthetemplatepathspecifiedbytheuserinthespreadsheettothevariablePathTemplate.
Step 4:
Path = Cells(9,1).Value
If Path = Then
Exit Sub
End If
AssignthePathspecifiedbytheuserinthespreadsheettothevariablePath.
Thisisthepathwherethe.bpsfilesthattheroutinecreatesarestored.
Step 5:
case1 = ActiveCell.Row
cases = Selection.Rows.Count
lastcase = case1 + cases 1
Thisstatementallowsustoloopontheselectedrowsbyassigningtheindexofthetoprowtothe
variablecase1andtheindexofthelastrow1tothevariablelastcase.
Page 158
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Loop Steps
Step 6:
For n = case1 to lastcase
Thisstatementinitiatesaloopthatwillbeexecutedfromthevaluecase1tothevaluelastcase.
Step 7:
Obj.OpenModel PathTemplate
Thisstatementisequivalenttodoingthefollowingthings:FromthePIPESIMsinglebranchobject
interface(Reminder:ObjectObjisasinglebranchobject),gotothemenuFile,selectOpenModeland
openthemodelPathTemplate(whichisastringdefinedinthespreadsheet)
AlthoughthePIPESIMwindowsisnotvisibleafterthestatementisexecutedthemodelisopenedand
canbealtered.
Page 159
PIPESIMVersion2011.1OpenLinkReferenceManual
Step 8:
Bo.GasSg = Cells(n,5)
Obj.BlackOil =Bo
ThefirststatementassignstothegasstandardgravityfieldintheBlackOilinterfaceBothevalue
correspondingtothecells(n,5).Itisthecell(3,5)duringthefirstloopandthecell(4,5)inthesecond
loop.
Therearealsosomeconditionalstatements.Thefirstonestatesthatifthewatercutisabove95%then
thevalueintheblackoilobjectmustbe95.ThesecondonestatesthatiftheGORissuperiorto1000000
thenassignanOGRof0totheblackoilobjectinsteadoftheactualGORvalue.Thelaststatement
assignstothesinglebranchobjectObjtheblackoilpropertiesoftheBlackoilobjectBo.
Page 160
Schlumberger Private - Customer Use
PIPESIMVersion2011.1OpenLinkReferenceManual
Step 9,10,11,12:
ThesestatementsfillthedifferentGUI(GraphicalUserInterface)objectsmakingupthe
SingleBranchObject(thatisthecompletionobject,thetubingobject,thechokeobjectandtheflowline
object).
Forexamplethestatement:
Obj.SetPropertyVal Tubing_1, Pipe WT, 0.5, inches
Assignsthevalue0.5tothewallthicknessofthetubingobjectofTemplate.bps.
Themoregeneralstatementcouldbewrittenas:
Obj.SetPropertyValnameoftheobject(string),nameofthefieldintheobject(string),valuetobe
assignedtothatfield(double),Unitstobeused(string)
Step 13: Saving the Template with another name
Thestatement
Obj.SaveModel Path & Stationname & _ & Wellname & .bps
savesthemodelTemplate.bpsunderanewnameinthefolderspecifiedinthestringvariablePath.
Step 14: Restart Loop
ThestatementNextnindicatestoVisualBasicforApplicationtogobacktothestatementforn=case1
tolastcaseandtoredothecodeforadifferentvalueofn(thatisthenextwell).
Thiswillhappenuntiln=lastcase(lastselectedrow).
Page 161