OpenServer Complete

Download as pdf or txt
Download as pdf or txt
You are on page 1of 526

Petroleum Experts

User Manual

IPM
OpenServer
June 2018
OpenServer
Communication Protocols to use IPM tools using external commands
by Petroleum Experts Limited

OpenServer is designed to provide an Open Architecture for all the Petroleum Experts IPM
products. This will allow the programs to be directly accessed and be driven by other third party
programs.

Applications for OpenServer are in Connections to:


• Third Party Reservoir Simulator.
• Process Simulators.
• Economics Packages.
• Data Base.
• Field Control System.
• In House and Proprietary Applications.

Specifically, the OpenServer allows other programs (such as Excel or


programs written in Visual Basic) to access public functions in Petroleum
Experts programs. An external program, in an automated procedure,
can then access the Petroleum Experts products.

As of IPM 7.0 OpenServer is a separately licenced product.


3

Copyright Notice
The copyright in this manual and the associated computer program are the property of Petroleum Experts
Ltd. All rights reserved. Both, this manual and the computer program have been provided pursuant to a
Licence Agreement containing restriction of use.

No part of this manual may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated
into any language, in any form or by any means, electronic, mechanical, magnetic, optical or otherwise, or
disclose to third parties without prior written consent from Petroleum Experts Ltd., Petex House, 10 Logie
Mill, Edinburgh, EH7 4HG, Scotland, UK.

© Petroleum Experts Ltd. All rights reserved.

IPM Suite, GAP, PROSPER, MBAL, PVTP, REVEAL, RESOLVE, IFM and OpenServer are trademarks of
Petroleum Experts Ltd.

Microsoft (Windows), Windows (2000) and Windows (XP) are registered trademarks of the Microsoft
Corporation

The software described in this manual is furnished under a licence agreement. The software may be used or
copied only in accordance with the terms of the agreement. It is against the law to copy the software on any
medium except as specifically allowed in the license agreement. No part of this documentation may be
reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying,
recording, or information storage and retrieval systems for any purpose other than the purchaser's personal
use, unless express written consent has been given by Petroleum Experts Limited.

Address:

Petroleum Experts Limited


Petex House
10 Logie Mill
Edinburgh, Scotland
EH7 4HG

Tel : (44 131) 474 7030


Fax : (44 131) 474 7031

email: [email protected]
Internet: www.petex.com

© 1990-2018 Petroleum Experts Limited


I OpenServer

Table of Contents
0

Part 1 Technical Overview 2


1 Basic Functions
................................................................................................................................... 4
2 Calling...................................................................................................................................
Public Functions 5

Part 2 Support 8

Part 3 Using OpenServer 10


1 Tag Strings
................................................................................................................................... 10
2 Automation
................................................................................................................................... 11
Exam ple Macro
.......................................................................................................................................................... 11
Macro Fram ew..........................................................................................................................................................
ork 14
DoCm d .......................................................................................................................................................... 15
DoSet Sub Com..........................................................................................................................................................
m and 16
DoCom m andAsync
.......................................................................................................................................................... 16
DoGet Sub Com..........................................................................................................................................................
m and 17
3 Batch ...................................................................................................................................
File 18
Running a Batch
..........................................................................................................................................................
File 18
Form atting Com
..........................................................................................................................................................
m ands 20
DoCom m and .......................................................................................................................................................... 20
SetValue .......................................................................................................................................................... 21
GetValue and ..........................................................................................................................................................
GetValPrint 21
4 Arrays...................................................................................................................................
and List Variables 22
Special Array ..........................................................................................................................................................
Operations 23
COUNT ......................................................................................................................................................... 23
NDIM ......................................................................................................................................................... 23
DIMSIZE ......................................................................................................................................................... 23
RESET ......................................................................................................................................................... 24
SORT ......................................................................................................................................................... 24
ADD ......................................................................................................................................................... 24
DELETE ......................................................................................................................................................... 25
INSERT ......................................................................................................................................................... 25
5 Multiple
...................................................................................................................................
Values for Arrays 25
Multiple DoGet
..........................................................................................................................................................
Values 25
Multiple DoSet..........................................................................................................................................................
Values 26
Using More than
..........................................................................................................................................................
One Multiple Array 27
6 Wild Cards
................................................................................................................................... 28
7 Units ................................................................................................................................... 29
8 Regional
...................................................................................................................................
Settings 31
9 Start/Shutdown
...................................................................................................................................
Commands 32

Part 4 GAP and OpenServer 35


1 Introduction
...................................................................................................................................
and Variable Lists 35

June, 2018
Contents II

Ctrl + Right m ouse


..........................................................................................................................................................
click 36
Help Ctrl + Left ..........................................................................................................................................................
m ouse click 37
Execute OpenServer
..........................................................................................................................................................
Statem ent 38
Specific Units ..........................................................................................................................................................
Handling Com m ands 40
Literal Constants.......................................................................................................................................................... 41
Date Handling..........................................................................................................................................................
w ithin GAP 42
Variables at Top ..........................................................................................................................................................
Level 43
Variables at MOD ..........................................................................................................................................................
Level 45
Model Options......................................................................................................................................................... 45
Solver Setup and.........................................................................................................................................
Calculation Log 51
Prediction Setup ......................................................................................................................................... 54
Model Equipment
.........................................................................................................................................................
List 57
Variables at Node..........................................................................................................................................................
Level 58
General fields
.........................................................................................................................................................
found in nodes of any type 58
Equipment .........................................................................................................................................................
Icon Position 60
Fields specific
.........................................................................................................................................................
to tanks 61
Fields Specific
.........................................................................................................................................................
to Wells 63
Fields specific to .........................................................................................................................................
all w ell models 63
Fields specific to .........................................................................................................................................
w ells modelled using VLP/IPR intersection 66
Fields specific to w ells modeled using Performance Curves /
Interpolated Performance .........................................................................................................................................
Curves 71
Fields specific to .........................................................................................................................................
Stand-Alone Inflow s 73
Fields specific to .........................................................................................................................................
Stand-Alone Outflow s 74
Fields specific to .........................................................................................................................................
transient w ell models 74
Equipment Control.........................................................................................................................................
Section 76
PROSPER Online .........................................................................................................................................
Well Models 78
Relative Permeabilities .........................................................................................................................................
for Wells and Inflow s 79
Fields specific
.........................................................................................................................................................
to pipelines 80
Pipeline Model Selection ......................................................................................................................................... 80
GAP Internal Correlation .........................................................................................................................................
Pipeline Models 80
GAP Lift Curves Pipeline .........................................................................................................................................
Models 84
PROSPER Online .........................................................................................................................................
Pipeline Models 86
Transient Pipeline......................................................................................................................................... 86
Fields specific
.........................................................................................................................................................
to joints 87
Fields specific
.........................................................................................................................................................
to pump/compressor nodes 88
Fields Common to.........................................................................................................................................
Pumps and Compressors 88
Fields Specific to.........................................................................................................................................
Compressors 89
Fields specific
.........................................................................................................................................................
to separator / injection manifold nodes 90
Com position Records
.......................................................................................................................................................... 91
Compositional.........................................................................................................................................................
Model Setup 91
Fluid Composition
.........................................................................................................................................................
Setup - Wells 91
Fluid Composition
.........................................................................................................................................................
Results 93
Enabling / Disabling
..........................................................................................................................................................
Options 94
Scheduling .......................................................................................................................................................... 95
Schedule Count
......................................................................................................................................................... 96
Date ......................................................................................................................................................... 96
Event type......................................................................................................................................................... 96
Constraint .........................................................................................................................................................
Type 97
Constraint .........................................................................................................................................................
Value 98
Schedule Reset
......................................................................................................................................................... 98
Apply Schedule
.........................................................................................................................................................
To 99
Constraints .......................................................................................................................................................... 99
Constraint .........................................................................................................................................................
Level and Type 99
Binding Constraints
......................................................................................................................................................... 101

OpenServer User's Manual June, 2018

II
III OpenServer

Constraints.........................................................................................................................................................
and Potential Calculations 102
Obtaining the..........................................................................................................................................................
Results 103
Solver Results
......................................................................................................................................................... 103
Prediction.........................................................................................................................................................
Results 105
Total System
.........................................................................................................................................................
Results 106
Snapshot.........................................................................................................................................................
Results 107
SubFlow Sheets.......................................................................................................................................................... 107
2 GAP ...................................................................................................................................
OpenServer Functions 107
GAP OpenServer
..........................................................................................................................................................
Functions Overview 109
CALCFLOWASSURANCE
.......................................................................................................................................................... 116
CALCGRADIENT(..........................................................................................................................................................
) 117
CALCCOMPDP ..........................................................................................................................................................
(com p) / CALCPUMPDP (pum p) 117
CALCPIPEDP(pipe)
.......................................................................................................................................................... 119
COPYITEM( EquipDest,
..........................................................................................................................................................
EquipSrc ) 120
DELITEM (node)
.......................................................................................................................................................... 120
ISMEMBEROFGROUP(Group)
.......................................................................................................................................................... 121
LINKITEMS ( equip1,
..........................................................................................................................................................
equip2, linklabel ) 121
NEWFILE( ) .......................................................................................................................................................... 121
NEWITEM( type,
..........................................................................................................................................................
label, iposcode, equip, m odel ) 122
Working w.........................................................................................................................................................
ith Flow sheets 123
OPENFILE( filenam
..........................................................................................................................................................
e) 123
PCCALC (equip,
..........................................................................................................................................................
PcCurve) 124
PCGMAX (equip,
..........................................................................................................................................................
PcCurve) 125
PCGSOLV (equip,
..........................................................................................................................................................
PcCurve) 125
PCPSOLV (equip,
..........................................................................................................................................................
PcCurve) 126
PREDDOSTEP..........................................................................................................................................................
(optim ise, potential) 127
PREDDOSOLVER ..........................................................................................................................................................
(tim estepsize, optim ise, potential, m odel) 129
PREDEND(dorest,
..........................................................................................................................................................
optim ise, potential) 129
PREDINIT (ignore
..........................................................................................................................................................
internal tim estep, ignore internal scheduling) 130
PURGEALLRESULTS
..........................................................................................................................................................
(m odel) 131
PURGEPREDLOG ..........................................................................................................................................................
(m odel) 131
PURGEPREDRESULTS
..........................................................................................................................................................
(m odel) 132
PURGEPREDSNAPSHOT
..........................................................................................................................................................
(m odel) 132
PURGESOLVERLOG
..........................................................................................................................................................
(m odel) 132
PURGESOLVERRESULTS
..........................................................................................................................................................
(m odel) 132
REFITPC(w ell)
.......................................................................................................................................................... 133
RESETSOLVERINPUTS
..........................................................................................................................................................
() 133
SAVEFILE( filenam
..........................................................................................................................................................
e) 133
SHUTDOWN (save)
.......................................................................................................................................................... 134
SOLVENETWORK()
.......................................................................................................................................................... 134
TPD.CALC() .......................................................................................................................................................... 135
TRANSFERPROSPERIPR
..........................................................................................................................................................
(w ell, layernum ber, PVTMethod) 136
UNLINKITEMS..........................................................................................................................................................
(equip1, equip2) 137
VALIDATE (solverorpred)
.......................................................................................................................................................... 137
VLPIMPORT (equip,
..........................................................................................................................................................
filenam e) 138
VLPIPRPCGEN ..........................................................................................................................................................
(w ell, autow hp) 138
WELLCALC (w ..........................................................................................................................................................
ell) 139
MOD[i].CopyControls
..........................................................................................................................................................
(from , to, SkipFNAs) 140
MOD[i].ResetControls
..........................................................................................................................................................
(colum n) 141
MOD[i].RESETSCHEDULE
..........................................................................................................................................................
(type, equiptype) 141
MOD[i].VALIDATE
..........................................................................................................................................................
(solverorpred) 141
GROUPS .......................................................................................................................................................... 142
EQUIP[i].ADDTOGROUP
..........................................................................................................................................................
(group) 143
EQUIP[i].BYPASS
..........................................................................................................................................................
() 143

June, 2018
Contents IV

EQUIP[i].DISABLE
..........................................................................................................................................................
() 143
EQUIP[i].ENABLE
..........................................................................................................................................................
() 144
EQUIP[i].ISMEMBEROFGROUP(group)
.......................................................................................................................................................... 144
EQUIP[i].ISCONNECTEDTO(equip)
.......................................................................................................................................................... 144
EQUIP[i].ISRELATEDTO(equip)
.......................................................................................................................................................... 145
EQUIP[i].MASK..........................................................................................................................................................
() 145
EQUIP[i].REMOVEALLGROUPMEMBERSHIPS
..........................................................................................................................................................
() 146
EQUIP[i].REMOVEFROMGROUP
..........................................................................................................................................................
(group) 146
EQUIP[i].UNBYPASS
..........................................................................................................................................................
() 146
EQUIP[i].UNMASK
..........................................................................................................................................................
() 146
EQUIP[i].VALIDATE
..........................................................................................................................................................
(solverorpred) 146
TANK[i].CalcDCTankCurPres(CurProd)
.......................................................................................................................................................... 147
PIPE[i].DOMATCH
..........................................................................................................................................................
() 147
IPR[i].CONINGMATCH
..........................................................................................................................................................
() 148
IPR[i].DISABLE
..........................................................................................................................................................
() 148
IPR[i].ENABLE..........................................................................................................................................................
() 148
IPR[i].IPRMATCH
..........................................................................................................................................................
() 148
IPR[i].MASK ()
.......................................................................................................................................................... 149
IPR[i].UNMASK..........................................................................................................................................................
() 149
IPR[i].COMPOSITION.IMPORTPRPFILE("FilePath")
.......................................................................................................................................................... 149
3 GAP ...................................................................................................................................
Internal Script 149

Part 5 MBAL and OpenServer 153


1 Overview
................................................................................................................................... 153
2 Finding
...................................................................................................................................
a Variable Text String 153
3 Date ...................................................................................................................................
Handling Within MBAL 154
4 Commands
................................................................................................................................... 155
General .......................................................................................................................................................... 155
Material Balance
..........................................................................................................................................................
Com m ands 156
Monte Carlo .......................................................................................................................................................... 157
1D Model .......................................................................................................................................................... 157
Decline Curve.......................................................................................................................................................... 158
Multi-Layer .......................................................................................................................................................... 158
Production Allocation
.......................................................................................................................................................... 158
Tight Gas .......................................................................................................................................................... 158
PVT .......................................................................................................................................................... 159
5 OpenServer
...................................................................................................................................
Code Examples 161
DoGet, DoSet..........................................................................................................................................................
and DoCm d Exam ple 161
List Variables
.......................................................................................................................................................... 162
Material Balance
..........................................................................................................................................................
Step-by-Step Prediction 163
Production Allocation
..........................................................................................................................................................
Step-by-Step Prediction 165
6 Direct...................................................................................................................................
Access OPENSERVER 166
Overview .......................................................................................................................................................... 166
Sum m ary .......................................................................................................................................................... 167
High Level Exam
..........................................................................................................................................................
ple 168
Low Level Exam
..........................................................................................................................................................
ple 176
Datablock Variable
..........................................................................................................................................................
Nam es 191
7 Variable
...................................................................................................................................
Text Strings 194
1D Model .......................................................................................................................................................... 195
Monte Carlo .......................................................................................................................................................... 196
Decline Curve
.......................................................................................................................................................... 197

OpenServer User's Manual June, 2018

IV
V OpenServer

Multi-Layer Tool
.......................................................................................................................................................... 198
PVT .......................................................................................................................................................... 199
Material Balance
.......................................................................................................................................................... 203
Production Allocation
.......................................................................................................................................................... 211
Tight Gas .......................................................................................................................................................... 212
Relative Perm..........................................................................................................................................................
eability Curves 213

Part 6 PROSPER and OpenServer 216


1 Overview
................................................................................................................................... 216
2 General
...................................................................................................................................
Comments 216
Getting the strings
..........................................................................................................................................................
through Ctrl+Right Click 217
List of variables
..........................................................................................................................................................
in PROSPER file 217
Evaluate OpenServer
..........................................................................................................................................................
Statem ent Section 223
Setting the Units
..........................................................................................................................................................
and Validation Lim its 224
Counting num ..........................................................................................................................................................
ber of entry data points or calculated results 226
3 Preferences
................................................................................................................................... 227
iType .......................................................................................................................................................... 228
iPref .......................................................................................................................................................... 228
sValue .......................................................................................................................................................... 232
Exam ples .......................................................................................................................................................... 232
4 Options
...................................................................................................................................
Summary Data 233
5 PVT Data
...................................................................................................................................
Section 236
INPUT - Input..........................................................................................................................................................
Data 237
MATCH - PVT..........................................................................................................................................................
Match Data 238
TABLE - Setting
..........................................................................................................................................................
data to the PVT Lookup Tables 240
CORREL – Correlation
..........................................................................................................................................................
Matching Param eters 241
Black Oil -.........................................................................................................................................................
Oil 241
Black Oil -.........................................................................................................................................................
Gas 242
Black Oil -.........................................................................................................................................................
Retrograde Condensate 243
CALC - Calculation
..........................................................................................................................................................
Results 244
EOS - Equation..........................................................................................................................................................
of State Data 245
DLL - External..........................................................................................................................................................
PVT DLL Data 249
EMULSION - Em ..........................................................................................................................................................
ulsion Data 249
VISC - Viscosity
..........................................................................................................................................................
Data 250
HYD - Hydrates..........................................................................................................................................................
Form ation Data 250
6 INPUT
...................................................................................................................................
Data Section 250
IPR Data .......................................................................................................................................................... 251
Overview......................................................................................................................................................... 251
Single Branch
.........................................................................................................................................................
Data 251
Common Parameters ......................................................................................................................................... 251
Model Selection .........................................................................................................................................
and PVT Screen 252
Test/PI Entered Models ......................................................................................................................................... 253
MultiRate Models......................................................................................................................................... 254
Darcy-based Models ......................................................................................................................................... 256
External Entry Model .........................................................................................................................................
Parameters 257
Multi-layer (no friction
.........................................................................................................................................
dP loss) Table 257
Horizontal Well w .........................................................................................................................................
ith dP Friction Loss Table, Including Coning Screen 258
Multi-layer w ith dP .........................................................................................................................................
Friction Loss Table 259
Skin Aide Model.........................................................................................................................................
Parameters 261
Tw o-term Model.........................................................................................................................................
Parameters 263
Fracture Model ......................................................................................................................................... 264

June, 2018
Contents VI

SPOT ......................................................................................................................................... 264


Mechanical Skin.........................................................................................................................................
Parameters 268
Deviation Skin-Specific .........................................................................................................................................
Parameters 269
Gravel Pack-Specific .........................................................................................................................................
Parameters 270
Relative Permeability .........................................................................................................................................
Screen 271
Gas Coning Parameters .........................................................................................................................................
for Oil 271
Multi-lateral
.........................................................................................................................................................
Well Data 272
Netw ork items ......................................................................................................................................... 273
Branch, Layer and .........................................................................................................................................
Segment Details 278
Calculation Control .........................................................................................................................................
Data 279
Visualisation Data ......................................................................................................................................... 279
Multilateral Results ......................................................................................................................................... 280
Equipm ent Data .......................................................................................................................................................... 280
Overview......................................................................................................................................................... 281
DEVN – Deviation
.........................................................................................................................................................
Survey Equipment 281
SURF – Surface
.........................................................................................................................................................
Equipment 282
TURF – Surface
.........................................................................................................................................................
Equipment (Enthalpy Balance) 282
ENV – Surface
.........................................................................................................................................................
Environment Data (Enthalpy Balance / Rough Approx.) 283
DOWN – Dow .........................................................................................................................................................
n Hole Equipment 283
TOWN – Dow .........................................................................................................................................................
n Hole Equipment (Enthalpy Balance) 284
GEO – Geothermal
.........................................................................................................................................................
Gradient 285
TEMP – Flow .........................................................................................................................................................
ing Temperature Survey 285
SHC – Fluid .........................................................................................................................................................
Properties – Average Heat Capacities 286
DRILL – Drilling
.........................................................................................................................................................
Data (Enthalpy Balance) 286
LITHO – Lithology
.........................................................................................................................................................
(Enthalpy Balance) 287
DB – Databases
.........................................................................................................................................................
(Enthalpy Balance) 287
GAUGE –.........................................................................................................................................................
Gauge Details 288
Artificial Lift ..........................................................................................................................................................
Data Section 289
Gas Lift (Continuous)
......................................................................................................................................................... 289
Electircal .........................................................................................................................................................
Submersible Pump 290
Hydraulic .........................................................................................................................................................
Drive Dow nhole Pump 290
Progressive .........................................................................................................................................................
Cavity Pump 291
Coil Tubing .........................................................................................................................................................
Gas Lift 291
Jet Pump ......................................................................................................................................................... 292
Multiphase .........................................................................................................................................................
Pump 292
Sucker Rod .........................................................................................................................................................
Pump 293
Gas Lift (Intermittent)
......................................................................................................................................................... 293
7 Calculation
...................................................................................................................................
Input Data 294
Sensitivity Variables
..........................................................................................................................................................
and Indexes 295
INF - Inflow Sensitivity
..........................................................................................................................................................
Calculations 299
SYS - System..........................................................................................................................................................
Sensitivity Calculations 301
GRD - Gradient..........................................................................................................................................................
Sensitivity Calculations 303
VLP - VLP Sensitivity
..........................................................................................................................................................
Calculations 305
CHK - Choke ..........................................................................................................................................................
Perform ance 307
QLG - QuickLook
..........................................................................................................................................................
– GasLift 308
QLE - QuickLook
..........................................................................................................................................................
– ESP 310
QLH - QuickLook
..........................................................................................................................................................
– HSP 311
TCC - Tubing..........................................................................................................................................................
Correlation Com parison 312
PCC - Pipeline..........................................................................................................................................................
Correlation Com parison 313
GMT - Gradient..........................................................................................................................................................
Matching 314
VMT - VLP Matching
.......................................................................................................................................................... 315
PMT - PipeLine..........................................................................................................................................................
Matching 317
GEN - Generate..........................................................................................................................................................
For GAP 318
WHP - BHP from..........................................................................................................................................................
WHP 319

OpenServer User's Manual June, 2018

VI
VII OpenServer

GDT - Gradient
..........................................................................................................................................................
Test Data 320
PLD - Plot Details
.......................................................................................................................................................... 321
COR - Flow Correlation
..........................................................................................................................................................
Data 323
THR - Correlation
..........................................................................................................................................................
Threshold Data 324
8 Artificial
...................................................................................................................................
Lift Design Input Data 324
GasLift Design
.......................................................................................................................................................... 325
Electical Subm
..........................................................................................................................................................
ersible Pum p Design 329
Hydraulic Drive
..........................................................................................................................................................
Dow nhole Pum p Design 333
Progressive ..........................................................................................................................................................
Cavity Pum p Design 334
Jet Pum p Design
.......................................................................................................................................................... 335
Sucker Rod Pum
..........................................................................................................................................................
p Design 336
9 Calculation
...................................................................................................................................
Results 337
INF - Inflow Sensitivity
..........................................................................................................................................................
Calculations 338
SYS - System..........................................................................................................................................................
Sensitivity Calculations 339
GRD - Gradient ..........................................................................................................................................................
Sensitivity Calculations 343
GRD - Flow.........................................................................................................................................................
Regime Number 345
VLP - VLP Sensitivity
..........................................................................................................................................................
Calculations 349
VLP Export......................................................................................................................................................... 350
QLG - QuickLook..........................................................................................................................................................
– GasLift 351
QLE - QuickLook..........................................................................................................................................................
– ESP 356
QLH - QuickLook..........................................................................................................................................................
– HSP 359
TCC - Tubing..........................................................................................................................................................
Correlation Com parison 363
PCC - Pipeline ..........................................................................................................................................................
Correlation Com parison 366
GMT - Gradient ..........................................................................................................................................................
Matching 370
GEN - Generate ..........................................................................................................................................................
For GAP 374
SPD - Sensitivity
..........................................................................................................................................................
PvD 376
GLN - Gas Lift ..........................................................................................................................................................
Design (New Well) 380
GLE - Gas Lift..........................................................................................................................................................
Design (Existing Well) 383
GLI - Gas Lift..........................................................................................................................................................
Design (Interm ittent) 386
ESP - ESP Design
.......................................................................................................................................................... 387
HSP - HSP Design
.......................................................................................................................................................... 389
10 Commands
................................................................................................................................... 391
11 Functions
................................................................................................................................... 401
12 Code...................................................................................................................................
Samples 403

Part 7 PVTP and OpenServer 415


1 OverView
................................................................................................................................... 415
2 Finding
...................................................................................................................................
a Variable Test String 415
3 File and
...................................................................................................................................
Streams 416
4 BLACKOIL
................................................................................................................................... 417
5 OPTIONS
................................................................................................................................... 418
6 STREAMBASE
................................................................................................................................... 421
7 STREAMRUN
................................................................................................................................... 424
8 CALCUL
................................................................................................................................... 427
9 Carrying
...................................................................................................................................
out Calculations and Obtaining Results 442
Analysis .......................................................................................................................................................... 445
Flash Calculation
.......................................................................................................................................................... 447
Sm all Separator
..........................................................................................................................................................
Calculation 448

June, 2018
Contents VIII

Saturation Pressure
..........................................................................................................................................................
at Reference Conditions 449
Recom bination
..........................................................................................................................................................
Calculation 449
Allocate: Blending
..........................................................................................................................................................
to a Target GOR 450

Part 8 REVEAL and OpenServer 453


1 Overview
................................................................................................................................... 453
2 Commands
................................................................................................................................... 453
3 Script...................................................................................................................................
Data 454
4 Results
...................................................................................................................................
Data 455
5 Runtime
...................................................................................................................................
Data 456

Part 9 RESOLVE and OpenServer 463


1 Overview
................................................................................................................................... 463
2 Commands
................................................................................................................................... 464
3 Top Level
...................................................................................................................................
Variables 465
Module variables
.......................................................................................................................................................... 467
Module Optimisation
.........................................................................................................................................................
variables 469
SrcSnk variables
......................................................................................................................................................... 471
Driver variables
.......................................................................................................................................................... 472
ModLink variables
.......................................................................................................................................................... 473
Schedule variables
.......................................................................................................................................................... 473
Event Driven..........................................................................................................................................................
Sheduling variables 474
Scenario Manager
..........................................................................................................................................................
Variables 476
Connection variables
.......................................................................................................................................................... 476
Properties variables
.......................................................................................................................................................... 477
Optim iser param
..........................................................................................................................................................
eter variables 478
Optim iser schedule
..........................................................................................................................................................
variables 479
4 Sample
...................................................................................................................................
macros 480

Part 10 OpenServer Examples 483


1 OpenServer
...................................................................................................................................
VBA Template 483
2 GAP ...................................................................................................................................
Examples 483
Basic Code Structure
.......................................................................................................................................................... 483
Exam ple 1 – GAP
..........................................................................................................................................................
Open Server Exam ple A 486
Exam ple 2 – GAP
..........................................................................................................................................................
Open Server Exam ple B 489
Exam ple 3 – GAP
..........................................................................................................................................................
Open Server Exam ple C 500
Exam ple 4 – GAP
..........................................................................................................................................................
Open Server Exam ple D 500
3 MBAL...................................................................................................................................
Examples 502
Step-by-Step..........................................................................................................................................................
Material Balance Prediction Exam ples 503
4 Step-by-Step
...................................................................................................................................
Production Allocation Examples 504
5 Direct...................................................................................................................................
Access Examples 504
6 PROSPER
...................................................................................................................................
Example 504

OpenServer User's Manual June, 2018

VIII
Chapter

1
Technical Overview 2

1 Technical Overview

OpenServer is a powerful utility that allows other programs (such as Excel, programs
written in Visual Basic) to access public functions in IPM to automate data input and
model calculations.

Specifically, OpenServer allows other programs such as Excel or programs written in


Visual Basic, to access public functions in the IPM Suite of tools. An external program,
in an automated procedure, can then access the IPM Suite of tools.

OpenServer can be used to run the IPM Suite of tools in conjunction with other software
applications and exchange data between them. For example, a Visual Basic program
or batch file could be used to successively initialise all IPRs in GAP from MBAL
simulations then retrieve all current IPR data.

OpenServer provides seamless data transfer to and from the PETEX tools to other
applications and database utilities. Also, the client program can use any technique to
access the values in the database, e.g. ODBC, DAO, SQL and then transfer them with
OpenServer to IPM.

Being able to automate data transfer, automate calculations and automatically


interrogate existing IPM model inputs provides a basis to develop streamline work-flows
that serves to free up valuable engineering time.

The following OpenServer uses is not an exhaustive list, and illustrates some
OpenServer possibilities:

Batch Runs
Consider a situation where a prediction calculation in MBAL has been set up and it is of
interest to check the final recovery for a range of OOIP values.

A spreadsheet in Excel can be created that lists all the OOIP's to be used in the
prediction.

A VBA macro can be written within Excel which:-


- Gets the first OOIP value from the spreadsheet and sets it in the MBAL tank
- Runs a production prediction
- Queries the final recovery from the production results and writes into the
spreadsheet.
- Repeat for the next OOIP, etc.

Custom Reporting
Although PETEX products provide a variety of report formats, it is possible that specific
reporting structures are required. A VBA macro within Excel can be written to query the

© 1990-2018 Petroleum Experts Limited


3 OpenServer

required values from a PETEX product and then written in the required format to the
spreadsheet.

Data Import/Export
The OpenServer can be used for transferring data to or from a database and PETEX
programs. The client program can use any technique to access the values in the
database (e.g. ODBC, DAO, and SQL) and then transfer them with OpenServer.
For example, production data may be stored in an Access database, a VBA macro can
be written in Access to query the data from the database and then use OpenServer to
set the data in MBAL for instance.

An example is available in the installed MBAL examples – OPENSERV.MDB.

Enhanced Prediction Runs in GAP


Using OpenServer with GAP provides the ability to control field development strategies
during the prediction by performing a task such as well drilling and completing from
using OpenServer to dynamically monitor an overall facilities rate constraint. This
means that wells will now be drilled and completed based on the overall model
response, rather than driving well drilling scheduling from a scheduled date perspective.

Please see the GAP OpenServer Example D.GAR file that also contains the completed
drilling queue macro.

Running PETEX programs with other engineering software applications


OpenServer can be used to run the PETEX programs in conjunction with other software
applications and exchange data between them.
For example, a visual basic program or batch file could be used to successively:
- Run a process simulator to calculate a feed separator pressure
- Set the separator pressure in GAP
- Optimise the production system in GAP
- Pass the GAP rates onto the process simulator
- Run the process simulator, etc.

It is important to note that dynamic links to industry standards process and numerical
reservoir simulators are now available through RESOLVE.

OpenServer User's Manual


Technical Overview 4

1.1 Basic Functions


There are a number of public functions that have been made available. However the
three most important functions are as follows.

DoGet
This function allows an external program to query a data value in a PETEX
program. It should be possible to obtain the value of any data item that can
normally be viewed using the user interface of the PETEX programs. Each data
item is defined by a unique text string.

Example:
The example syntax for DoGet function is as follows:

variable = DoGet ("tag_string")

The function retrieves the required parameter and set the variable equal to its
value. The parameter is defined by the tag string specified in the quotation marks,
which is unique for each data value in IPM programs.

DoSet
This function allows an external program to change a data value in a PETEX
program. It should be possible to change the value of any data item that can
normally be viewed using the user interface of the PETEX programs. It should be
possible to build a data set from scratch using the DoSet function.

However, it is recommended that the user interface is still used to build parts of a
data set which do not require any automation. This will allow the normal quality
checking to take place which is a very important aspect of the model building
process.

Example:
The example syntax for DoSet function is as follows:

DoSet ("tag_string"), variable

The function set the value of required parameter equal to variable. Again the tag
string defined in the quotation marks corresponds to a particular input parameter
in IPM program.

DoCmd
This function allows calculations to be performed in a PETEX program.

Only a subset of calculations available via the normal user interface of the PETEX
products are available using the OpenServer.
In particular, the DoCmd function supports those calculations which are applicable
to automated use e.g. a GAP prediction.

© 1990-2018 Petroleum Experts Limited


5 OpenServer

However it generally does not support those calculations that require the user
interface for correct use e.g. MBAL graphical matching.

Example:
The example syntax

DoCmd ("tag_string")

Function executes calculations in PETEX application. Each calculation type is


defined by a unique tag string.

Different syntaxes can be used in certain cases to replace the command.


These different syntaxes can be:
- DoCmd (used to perform a PROSPER calculation)
- DoGAPFunc (used to perform a GAP calculation)
- DoSlowCmd (Used to run time consuming calculations; see note below)

NOTE:
Unfortunately, VBA was designed for use with simple functions that take only a few
seconds. If a function is called that takes more than one minute to complete, a
timeout error in Excel may occur depending on operating system, Excel version,
setup etc. This is where the DoSlowCmd would be required to replace the
DoCmd sub function.

The DoSlowCmd will also be required if the license server has high traffic where
the speed of communication from the local PC to obtain a license has been
reduced.

The code for these commands has already been setup in the OpenServer template
provided with the software installation.

This OpenServer template is called OpenServer Template.xls and can be found at the
following location:

C:\Program Files\Petroleum Experts\IPM 8.0\Samples\openserver\Template\

The OpenServer template can be used as a starting point when building an Excel
based OpenServer utility. Also, the variety of OpenServer example files that have
been constructed for each IPM tool can also be modified to meet individual needs.

1.2 Calling Public Functions


There are two methods of calling public functions.

The following sections summarizes how to call the functions, syntax examples are also
provided.

OpenServer User's Manual


Technical Overview 6

Automation
The OpenServer is an Automation server. This means that the public functions can be
called from any program that can act as an Automation client.

There are many programs that can act as an Automation client and can therefore be
used to call the public functions in the PETEX programs.

These include:
– Any VBA macro. These macros are available in Excel, Access and many other
Microsoft products.

– Visual Basic programs can be written to act as an Automation client and


therefore call the public functions.

– C++ programs can also be written to act as an Automation client and therefore
call the public functions.

Many other products can act as Automation clients and will be illustrated in their
individual documentation.

Batch File
To avoid dependence on Automation, it is also possible to call the public functions in
the PETEX programs using a simple batch file.

The functions required are typed into a text file.


A program is supplied by Petroleum Experts (PXBATCH) which will interpret the text
file and call the functions in the PETEX programs.
It also writes the output of the DoGet function to another text file which can be viewed
afterwards.

© 1990-2018 Petroleum Experts Limited


Chapter

2
Support 8

2 Support

The main strength of the OpenServer is that users are now free to develop their own
applications which utilise the public functions within PETEX products. However this does
mean that a user of the OpenServer will require more computing knowledge than the
rest of the PETEX programs. This is particularly the case where a user writes a client
application in VBA or Visual Basic. The user is expected to have (or be trained in) the
requisite computing skills to write these client applications.
Petroleum Experts will not be able to undertake to train users in these
computing skills.

The boundary of the PETEX products and the user’s applications needs to be defined
with respect to support provided by Petroleum Experts of the OpenServer feature.

Firstly, as with normal support, a maintenance agreement between the user and
Petroleum Experts must be in place.

Petroleum Experts will not be able to undertake development of VBA macros,


batch files or other OpenServer clients for a particular user. The strength of the
feature is to allow the user to implement these client applications without any further
input by Petroleum Experts.

Similarly Petroleum Experts will be unable to assist in fixing bugs in users VBA macros,
batch files or any other OpenServer client.

Petroleum Experts will undertake to support any user who can demonstrate
(through a simple fragment of a batch file or VBA macro etc) that a public
function call to a PETEX product fails to work correctly.

© 1990-2018 Petroleum Experts Limited


Chapter

3
Using OpenServer 10

3 Using OpenServer

This chapter describes in detail how to access the public function in PETEX programs.

The Tag Strings section describes how each data item is defined in the PETEX
programs using a variable text string.

The Automation section describes how to call the public functions using Automation.
We first describe the framework needed to use the OpenServer, then each function is
described in detail.

The Batch File section describes how to call the public functions using a batch file
system. We describe the framework and then describe each function in detail.
This section does not deal with specific issues relating to particular products e.g. GAP
or MBAL.

To use the public function for a particular PETEX program, the tools must be installed on
the local hard disk with access to a valid security authentication e.g. security key or
HARDLOCK.

When the public functions are being called (either using Automation or a batch file), the
appropriate PETEX product must be running. However, it does not need to be visible on
the screen (i.e. it can be minimised). Commands are available to start each of the
programs. Alternatively one can start the programs manually before running a macro/
batch file.

3.1 Tag Strings

Tag strings describe each data item in the PETEX programs. It is a string of characters
which is broken into a number of subnames separated by full stops. As one moves from
left to right along the string, the definition of the variable becomes more detailed.

The tag string of any data item in MBAL always begins with the subname "MBAL".
Similarly, any data item from GAP, PVTP, REVEAL, RESOLVE or PROSPER will begin
with the subname “GAP”, “PVTP”, “REVEAL”, "RESOLVE" or “PROSPER”
respectively.

The rest of the string depends on the section of the program. There may be several
subnames if the data item is part of a complex hierarchy.
For example, for the start time in the material balance prediction we may have

MBAL.MB.PRED.STARTTIME

For this tag string:

© 1990-2018 Petroleum Experts Limited


11 OpenServer

– MBAL – From the MBAL program


– MB – In the material balance tool
– PRED – In the prediction section
– STARTTIME – Start time

All tag strings are case insensitive (i.e. it does not matter if lower or upper case
characters are used).

For specific details of the tag strings for each PETEX program, refer to the program
specific sections below.

It is also possible to capture the OpenServer string details directly from the given IPM
tool using a Ctrl + Right-Click keyboard and mouse work-flow.

Please note, it is not possible to capture an OpenServer string using the above
keyboard and mouse work-flow for a calculation button. For a list of IPM OpenServer
command strings, please review the corresponding OpenServer command reference
information.

3.2 Automation

This section describes how to access the public functions using Automation. This is a
Microsoft Windows standard (formally known as OLE Automation). This method
requires software which can act as an Automation client to call the public functions.
Probably the most commonly used example of such an Automation client that is used in
the engineering industry is the VBA macro language within Excel. We will therefore
demonstrate how the public functions are called by such macros – the same rules should
extend to other Automation clients.

Rather than describing the functions in isolation, an example of an Excel VBA macro is
presented that uses all the available public functions. Each function within this example
will be described including macro error handling.

It is important to note that the OpenServer template already contains the necessary
macro communication error handling already built in.

3.2.1 Example Macro


This example performs a simple set of operations in the MBAL program.
These include:
– Open the OIL.MBI file
– Change the original oil in place to a new value
– Run a prediction

OpenServer User's Manual


Using OpenServer 12

– Get the first oil rate and display it in the Excel spreadsheet.

This macro is available in the installed MBAL examples, OPENSERV.XLS, located in


the directory

C:\Program Files\Petroleum Experts\IPM 8\Samples\openserver\MBAL\

The macro is split into a number of subroutines and functions:


– The main subroutine is called DoAll().
– There are five other subroutines and functions which allow calls to be made to
the PETEX public functions.

Option Explicit
Dim Server As Object
Dim AppName As String

Sub DoAll()
Connect 'Establishes Excel communication
link to IPM
AppName = "MBAL"
DoSlowCmd "MBAL.OPENFILE=C:\PETEX\SAMPLES\OIL.MBI"
'See below for an alternative "file open" approach
DoSet "MBAL.MB.TANK.OOIP", "250.0" 'Set the tank
OOIP value
DoSlowCmd "MBAL.MB.RUNPREDICTION" Run the
prediction
Range("C11") = DoGet("MBAL.MB.TRES[2][0]
[0].OILRATE") 'retrieve the first oil rate
Disconnect 'Closes the server object connection to
IPM
MsgBox "Macro completed"
End Sub

NOTE: Alternative File Open Approach


If the MBAL file name was placed at a certain cell reference in Excel, then the following
File | Open approach could be used:

DoSlowCmd "MBAL.OpenFile(""" + Range("E12") + """)"

OpenServer Template Error Handling Code


The following code is part of the OpenServer template and manages error handling
between the application and macro:

Sub DoCmd(Cmd)
Dim lErr As Long
lErr = Server.DoCommand(Cmd)

© 1990-2018 Petroleum Experts Limited


13 OpenServer

If lErr > 0 Then


MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Sub

Sub DoSet(Sv, Val)


Dim lErr As Long
lErr = Server.SetValue(Sv, Val)
lErr = Server.GetLastError(AppName)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Sub

Function DoGet(Gv As String) As String


Dim lErr As Long
DoGet = Server.GetValue(Gv)
lErr = Server.GetLastError(AppName)
If lErr > 0 Then
MsgBox Server. GetErrorDescription(AppName)
Set Server = Nothing
End
End If
End Function

Sub DoSlowCmd(Cmd)
Dim StartTime As Single
Dim EndTime As Single
Dim CurrentTime As Single
Dim lErr As Long
Dim bLoop As Boolean

lErr = Server.DoCommandAsync(Cmd)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
While Server.IsBusy(AppName) > 0
StartTime = Timer
EndTime = StartTime + 2
Do
CurrentTime = Timer
DoEvents

OpenServer User's Manual


Using OpenServer 14

bLoop = True
Rem Check first for the case where we have
Rem gone over midnight and the number of
Rem seconds will go back to zero
If CurrentTime < StartTime Then
bLoop = False
Rem Now check for the 2 second pause
finishing
ElseIf CurrentTime > EndTime Then
bLoop = False
End If
Loop While bLoop
Wend

lErr = Server.GetLastError(AppName)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Sub

Function DoGAPFunc(Gv As String) As String


AppName = “GAP”
DoSlowCmd Gv
DoGAPFunc = DoGet("GAP.LASTCMDRET")
End Function

3.2.2 Macro Framework


The Basic Functions in the 'Technical Overview' section listed three main sub-
commands that OpenServer uses to set data, perform calculations and retrieve results
to an Excel based VB macro.

The template OpenServer macro spreadsheet can be used to develop a macro for any
one of the IPM suite of tools.

There are only a few lines of code that need to be in an Excel macro to use
OpenServer. Before using any of the public functions, an object must be declared to
establish the communication link from the VB macro with the PETEX programs:

Dim Server As Object

Next, the object will be connected to the OpenServer using the line:

© 1990-2018 Petroleum Experts Limited


15 OpenServer

Set Server = CreateObject("PX32.OpenServer.1")

Alternatively, the above line can be replaced by the Connect function that has been
implemented in the OpenServer template.
The line then simply becomes:

Connect

Once the server is connected, the Server object can be used to call any number of
functions from any or all of the PETEX programs, i.e.,

Server.DoCommand(Command1)
Server.DoCommand(Command2)
Server.GetValue(Var1)

Once the public functions in the macro have completed, the server object connection can
be closed using:

Set Server = Nothing

This line can be replaced by the 'Disconnect' function that has been implemented in the
OpenServer template.
The line then simply becomes:

Disconnect

These can be seen in the DoAll() subroutine above.

3.2.3 DoCmd

The DoCmd function is used to perform calculations and other functions such as file
opening and saving in the PETEX programs.

Only a subset of the commands available using the user interface are available. The
commands that are not supported are those that require some graphical interaction
such as graphical history matching in MBAL.

In the above example, DoCmd is used twice. The first time it is used to open the
Oil.MBI data file.

The second time it is used for running a prediction. The text string after the DoCmd
statement describes the command to be performed.

The text string always starts with the name of the program in which the calculation is to
be done. The rest of the text string describes the command – check the following
sections describing each PETEX program for a list of possible calculations.

OpenServer User's Manual


Using OpenServer 16

There is no output to the PXR file for this command. If there is any error, a message will
be written to PXBATCH.LOG.

Note that the abbreviation dc can be used in the batch file instead of DoCmd.

NOTE:
As previously mentioned, VBA was designed for use with simple functions that take only
a few seconds. If a function is called that takes more than one minute to complete, a
timeout error in Excel may occur depending on operating system, Excel version, setup
etc. If this happens, the DoSlowCmd should be used instead of the DoCmd.
3.2.4 DoSet Sub Command
The DoSet command is used to set the value of a data item. It should be possible to
change most of the values that can normally be accessed via the user interface. Each
variable is identified by the unique text string that can be captured using a Ctrl + Right-
Mouse Click keyboard and mouse action.

In the above example, the DoSet function is used in the DoAll() subroutine to change the
value of the initial oil in place to 250.0. The variable to be changed is determined by the
first input text string. The new value for the variable is passed in the second input text
string.

This function expects the value to be in the units currently displayed in the user interface.
It is the responsibility of the user writing the macro to ensure that the second text string
contains a valid number if the data item is numerical.

Unlike the DoCmd public function, the DoSet function does not return an error number.
As can be seen in the example macro subroutine DoSet(), the GetLastError() public
function must be called to check if any error occurred. This will return zero if the last
public function call was successful or an error number if not.

It is recommended that the DoSet() macro subroutine shown in the example


macro and provided in the OpenServer Template.xls file is used for all
applications as it already has error handling built in.

Please also see the main on-line help of PROSPER, as it contains a listing of
OpenServer variables and commands.

3.2.5 DoCommandAsync

This function is a variation of the DoCmd function. It is nearly always used in conjunction
with the IsBusy() function.

When a VBA macro is run, it executes and completes each line before moving onto the
next line. So when the DoCmd function is called for a long prediction, it may take
several minutes (or even hours) before the VBA can move onto the next line in the

© 1990-2018 Petroleum Experts Limited


17 OpenServer

macro.

Unfortunately, VBA was designed for use with simple functions that take only a few
seconds. If a function is called that takes more than one minute to complete, a timeout
error in Excel may occur depending on operating system, Excel version, setup etc..

The DoCommandAsync functions to be called that take a long time to complete


without any risk of timeouts. When a DoCommandAsync is called, the OpenServer
starts the calculation in the PETEX program but lets the VBA carry immediately on to the
next line in the macro. This avoids the timeout error in Excel.

Unfortunately it introduces another problem. What if the next line in the macro was a call
to the GetValue function to get the results of the calculation? The macro is likely to try to
get the calculated value before the calculation is finished! So the VBA still needs some
way of knowing when the calculation has finished.

Therefore it is usually necessary to append some VBA code after a call to


DoCommandAsync which loops until the calculation is finished. The inserted code
uses another function called IsBusy() to check if the calculation is finished.

This VBA code to do this is in the macro subroutine DoSlowCmd() in the example
macro. The code loops round until the IsBusy() function returns a value greater than
zero. The only input argument is the name of the PETEX program in which the calculation
was called. Within the loop the code will wait 2 seconds before looping again. It also
calls the VBA function, DoEvents, which will allow other windows program to work whilst
the VBA is waiting for the calculation to finish.

It is recommended that the DoSlowCmd macro subroutine shown in the


example macro and provided in the OpenServer Template.xls file is used for all
applications as it already has error handling built in as well as the code to wait
for the function to finish.

3.2.6 DoGet Sub Command


The DoGet function is used to get the value of a data item or result. It should be possible
to query most of the values that can normally be accessed via the user interface. Each
variable is identified by a unique text string.

In the above example, the DoGet function is used in the DoAll() subroutine to get the
value of the first oil rate in the prediction tank results. The variable to be retrieved is
determined by the input text string. The return value of the function call is another text
string containing the value of the data item. If the value is numerical data, the return text
string will contain the formatted number and avoids having different functions for different
data types. The value will be returned in the units currently displayed in the user
interface.

As with the DoSet function, the GetLastError function must be used to check for errors
in the SetValue function. Note that in the macro subroutine DoGet, we use a different

OpenServer User's Manual


Using OpenServer 18

function to get the actual error message using GetLastErrorMessage. This function
returns the error message corresponding to the last public function call for the
application specified by the input argument. If the last public function call was
successful, it will return a blank error message.

It is recommended that the DoGet macro subroutine shown in the example


macro and provided in the OpenServer Template.xls file is used for all
applications as it already has error handling built in.

3.3 Batch File

This section describes how to access the public functions using a batch file. Each
command is typed into an ASCII file. A program is supplied by Petroleum Experts
which reads this ASCII file and calls the public functions in the PETEX programs and
writes the output to another ASCII file.

3.3.1 Running a Batch File

The first step to calling the public functions from the batch file is to create the batch file
itself. This is a simple ASCII file which can be created using NOTEPAD.EXE.

The only point to note is that when the batch file is saved it should have the file extension
PXB e.g. TEST.PXB.

Each public function to be called should be listed on a separate line.


Comment lines can be entered by starting the line with a # character

Example:
# This is my first batch file
# 1st January 2009

The details of how to list the public functions are shown in the following sections.

Once the batch file has been created and the functions listed in the file, we can run the
batch file:

Steps:
1. Run the latest version of the PETEX program that is going to be used e.g. MBAL
and GAP
2. Copy the file PXBATCH.EXE into the same directory as the PXB batch file
(this file can be found in the latest installation of the PETEX DVD (C:\Program
Files\Petroleum Experts\IPM 9)
3. Run the PXBATCH program with the PXB file name as an argument vai the
DOS Prompt utility

© 1990-2018 Petroleum Experts Limited


19 OpenServer

For example, if the batch file is called TEST.PXB, in the DOS prompt type: PXBATCH
–b TEST then Enter to run the batch file

PXBATCH will call each public function in turn and two files will be created by
PXBATCH. The first is called PXBATCH.LOG and will contain any error messages
from the batch run so it is important to examine the file after every batch run to check for
errors.

The second file will have the same file stem as the batch file but will have the extension
PXR.

In the above case, the second output file will be called TEST.PXR. This file will contain
any output from the public functions.

An example batch will be presented which shows calls to all the public functions in the
PETEX products. Then each function used in the example batch file will be described in
turn.

The example batch file is as follows (this file is available in the installed MBAL
examples, MBALTEST.PXB):

# Example batch file


PRINT Example batch file output
PRINT
docommand MBAL.OpenFile("C:\PETEX\SAMPLES\OIL.MBI")
setvalue MBAL.MB.TANK.OOIP 250.0
docommand MBAL.MB.RUNPREDICTION
getvalprint MBAL.MB.TANK.OOIP
PRINT "First oil rate ="
PRINTTAB
PRINTTAB
getvalue MBAL.MB.TRES[2][0][0].OILRATE
PRINT " bbls/day"
PRINT
PRINT End of example batch file output

The output PXR file from the above batch file is as follows:

250 ! MBAL.MB.TANK.OOIP
First oil rate = 16516.8 bbls/day
End of example batch file output

OpenServer User's Manual


Using OpenServer 20

3.3.2 Formatting Commands


There are two commands, PRINT and PRINTTAB that can be used to format and write
text to the output PXR file.

The PRINT statement can be used in two ways:


– If some text is appended to the PRINT statement, the text will be printed out to
the PXR file. If desired the text might be enclosed in quotations.
– If the PRINT command is used without any text, it will move the output onto the
next line in the PXR file.

For example, consider the last three lines of the example batch file.
The first of these PRINT statements prints the text “ bbls/day”. The second PRINT
statement moves the next output onto the next line. The third PRINT statement displays
the text “End of example batch file output” on the next line of the PXR file. Note that if the
second PRINT statement was not included, the output PXR file would look like:

…..bbls/dayEnd of example batch file output

The second formatting command is PRINTTAB. This command simply writes a tab
character to the PXR file.

3.3.3 DoCommand

The DoCmd function is used to perform calculations and other functions such as file
opening and saving in the PETEX programs.

Only a subset of the commands available using the user interface are available. The
commands that are not supported are those that require some graphical interaction
such as graphical history matching in MBAL.

In the above example, DoCmd is used twice. The first time it is used to open the
Oil.MBI data file.

The second time it is used for running a prediction. The text string after the DoCmd
statement describes the command to be performed.

The text string always starts with the name of the program in which the calculation is to
be done. The rest of the text string describes the command – check the following
sections describing each PETEX program for a list of possible calculations.

There is no output to the PXR file for this command. If there is any error, a message will
be written to PXBATCH.LOG.

Note that the abbreviation dc can be used in the batch file instead of DoCmd.

© 1990-2018 Petroleum Experts Limited


21 OpenServer

NOTE:
As previously mentioned, VBA was designed for use with simple functions that take only
a few seconds. If a function is called that takes more than one minute to complete, a
timeout error in Excel may occur depending on operating system, Excel version, setup
etc. If this happens, the DoSlowCmd should be used instead of the DoCmd.
3.3.4 SetValue
This function is used to set the value of a data item. It should be possible to change most
of the values that can normally be accessed via the user interface.
In the example we use SetValue once to change the original oil in place to 250.0. The
first text string after SetValue defines the variable to be changed. The second text string
defines the new value of the variable. This function expects the value to be in the units
currently displayed in the user interface.

There is no output to the PXR file for this command. If there is any error, a message will
be written to PXBATCH.LOG.

Note that the abbreviation sv can be used in the batch file instead of SetValue.

3.3.5 GetValue and GetValPrint


These two functions are both used to get the value of a data item and print it to the PXR
output file. The only difference between the two functions is the format of the output to the
PXR file.

GetValPrint is used once in the example batch file to get the value of the original oil in
place – this is to verify that the preceding SetValue worked correctly. The text string
after GetValPrint defines the variable to be written to the output PXR file. If the function
works correctly, the variable is written to the PXR file followed by the variable text string,
separated by an exclamation mark. It also moves the output onto the next line so any
further Print functions will start on the next line. This format can be seen in the example
PXR file above.

GetValue is also used once in the example batch file to output the first oil rate in the
prediction tank results. The function is called as for GetValPrint. The only difference is
that this function simply writes the value of the variable to the output PXR file without any
formatting. This means that other Print commands will be needed to format the output –
as shown in the example batch file.

Note that the abbreviation gvp can be used in the batch file instead of GetValPrint. The
abbreviation gv can be used instead of GetValue.

OpenServer User's Manual


Using OpenServer 22

3.4 Arrays and List Variables


Many of the variables in the programs have single values, such as a single reservoir
pressure in PROSPER. However some of the variables are arrays such as a multi-tank
system in MBAL. For this case, an index in the tag string must be specified.

Arrays in the programs can be variable or of a fixed size.

Example:
For example, if we have three tanks in an MBAL model then we access the OOIP of the
first tank using the following tag string:

MBAL.MB.TANK[0].OOIP

Note that the index is zero based. By this, we mean that the 1st item has an index of 0,
the 2nd item will then have an index of 1, etc.

In some cases, one can identify an item in an array using the label of the item rather than
an index. For example if the label of the 1st tank is Lower05, the OOIP can be
accessed using the following tag string:

MBAL.MB.TANK[{Lower05}].OOIP

One must place {} brackets around the label so the program will not interpret the label as
a numerical index.

NOTE:
The label is the only part of a tag string which is case sensitive.

If there is only one item in the list, then the index is optional. For example, if there is only
one tank, the following tag string can be used:

MBAL.MB.TANK.OOIP

There are also some variables that are arrays with two or more dimensions. These
variables will require two or more indices in the tag string.

For example, consider the prediction results for the material balance tool in MBAL.
These have three indices where the first index indicates the result type, the second index
is the tank and the third index is the row.

A tag string for a result may look like:

MBAL.MB[0].TRES[0][0][3].GASSAT

© 1990-2018 Petroleum Experts Limited


23 OpenServer

3.4.1 Special Array Operations

This section describes a number of special features that can only be used with arrays.

3.4.1.1 COUNT
The COUNT feature returns the number of items that exist in an array. This feature only
works for arrays that have a variable size.

For example, the number of tanks in an MBAL model can be found using the command:

Range("C11") = DoGet("MBAL.MB.TANK.COUNT")

This command can also be used in multi-dimensional arrays to count the number of tank
prediction results for instance using the command:

Range("C11") = DoGet("MBAL.MB.TRES[2][3].COUNT")

3.4.1.2 NDIM
The NDIM feature can only be used for fixed length arrays. It is used to find the number
of dimensions in the array.

Consider a variable which is a three-dimensional array (this is not an actual variable).


An item in the array may be accessed as follows:

Range("C11") = DoGet("MBAL.MB.TANK.PV[1][5][9]")

One can find the number of dimensions by calling the following function:

Range("C11") = DoGet("MBAL.MB.TANK.PV.NDIM")

This function will return the value 3.

3.4.1.3 DIMSIZE
The DIMSIZE feature can only be used for fixed length arrays. It is used to find the fixed
number of items for a given dimension of the array.

Consider a variable which is a three-dimensional array (this is not an actual variable).


Now, this array has 3 items in the 1st dimension, 8 in the 2nd dimension and 20 in the
3rd dimension. So the maximum indices we can access would be (remembering that
the indices are zero based):

Range("C11") = DoGet("MBAL.MB.TANK.PV[2][7][19]")

OpenServer User's Manual


Using OpenServer 24

One can find the fixed number of items in the second dimensions by calling the following
function:

Range("C11") = DoGet("MBAL.MB.TANK.PV.DIMSIZE[1]")

This function will return the value 8.

Similarly, DIMSIZE[0] will return 3 and DIMSIZE[2] will return 20.

3.4.1.4 RESET
The RESET feature can only be used for arrays with a variable number of items. It is
used to delete all the items in the array and thus reduce the number of items in the array
to zero.

For example, to delete all the items in the tank production history for an MBAL model,
use the command:

DoSet "MBAL.MB.TANK.PRODHIST.RESET", ""

3.4.1.5 SORT
The SORT feature can only be used for arrays with a variable number of items. It is
used to sort all the items in the array in order. The method of sorting is the same as
used in the corresponding dialog of the program.

For example, the tank production history for an MBAL model is sorted by the date of
each item in the array.

To sort the production history, use the command:

DoSet "MBAL.MB.TANK.PRODHIST.SORT", ""

3.4.1.6 ADD
The ADD feature can only be used for arrays with a variable number of items. It is used
to add a new item to the end of an array.

For example, to add two rows to an empty table of tank production history for an MBAL
model, use the commands:

DoSet "MBAL.MB.TANK.PRODHIST.ADD", ""


DoSet "MBAL.MB.TANK.PRODHIST[0].TIME", "01/01/2009"
DoSet "MBAL.MB.TANK.PRODHIST[0].PRESS", "6980.0"

© 1990-2018 Petroleum Experts Limited


25 OpenServer

DoSet "MBAL.MB.TANK.PRODHIST[0].CUMGAS", "0.0"


DoSet "MBAL.MB.TANK.PRODHIST.ADD", ""
DoSet "MBAL.MB.TANK.PRODHIST[1].TIME", "01/02/2009"
DoSet "MBAL.MB.TANK.PRODHIST[1].PRESS", "6589.0"
DoSet "MBAL.MB.TANK.PRODHIST[1].CUMGAS", "12.8"

3.4.1.7 DELETE
The DELETE feature can only be used for arrays with a variable number of items. It is
used to delete a particular item in the list and it will reduce the number of items in the list
by one.

For example, the following command will delete the 4th row in the production history
table of an MBAL model:

DoSet "MBAL.MB.TANK.PRODHIST[3].DELETE", ""

3.4.1.8 INSERT
The INSERT feature can only be used for arrays with a variable number of items and it
is used to insert a new item at a particular position in the list. All the items at and above
the position to insert will be moved up one position in the list, so the new item can be
inserted.

For example, the following command will insert a new row in the production history table
of an MBAL model. The new row will become the 7th row:

DoSet "MBAL.MB.TANK.PRODHIST[6].INSERT", ""


DoSet "MBAL.MB.TANK.PRODHIST[6].TIME", "10/01/2000"
DoSet "MBAL.MB.TANK.PRODHIST[6].PRESS", "2700.0"
DoSet "MBAL.MB.TANK.PRODHIST[6].CUMOIL", "4.0"
DoSet "MBAL.MB.TANK.PRODHIST[6].CUMGAS", "4000.0"

3.5 Multiple Values for Arrays

This section describes how the DoSet / DoGet functions are used to retrieve and set
more than one item in an array.

3.5.1 Multiple DoGet Values

Consider a situation where one wishes to extract tank pressures from a 5-tank MBAL

OpenServer User's Manual


Using OpenServer 26

model.

The following fragment of VBA code could be used:

Range("C1") = DoGet("MBAL.MB.TANK[0].PRESS")
Range("C2") = DoGet("MBAL.MB.TANK[1].PRESS")
Range("C3") = DoGet("MBAL.MB.TANK[2].PRESS")
Range("C4") = DoGet("MBAL.MB.TANK[3].PRESS")
Range("C5") = DoGet("MBAL.MB.TANK[4].PRESS")

A quicker method is to get all the pressures in one DoGet call, and there are two
options to achieve the objective:
– Get the pressures for all the available tanks:

Range("C1") = DoGet("MBAL.MB.TANK[$].PRESS")

– Get the pressures for tank index zero through to tank index four:

Range("C1") = DoGet("MBAL.MB.TANK[0,1,2,3,4].PRESS")

The above example using multiple DoGet calls will return all the tank pressures in the
model.

The values will be returned in a single text variable separated by the ‘|’ character. Note,
the "|" character will also occur at the end of the string. For example:

5132.0|4893.0|4598.3|4882.0|4976.6|

There are several other variations which can be used to extract data from multiple tanks
using the following syntax:
– Return the pressure for tank 0,1,2 and 4:

Range("C1") = DoGet("MBAL.MB.TANK[0:2,4].PRESS")

– Return the pressure for tank 1 and 3:

Range("C1") = DoGet("MBAL.MB.TANK[1,3].PRESS")

3.5.2 Multiple DoSet Values


The DoSet function can use multiple tag names in a similar manner to the DoGet
function as previously described. All the different forms of the variable tag names used
by the DoGet can be used for the DoSet function.

For the DoSet function, a text variable is passed to the function which contains a list of
the values to set, separated by the ‘|’ character. For example, the following string can be
used to set multiple OOIP's in a multi-tank system to tank 1, 4 and 5:

© 1990-2018 Petroleum Experts Limited


27 OpenServer

DoSet "MBAL.MB.TANK[1,4,5].OOIP", "250.0|129.0|349.0"

The above command will set the OOIP of tank index 1 to 250.0, tank index 4 to 129.0
and tank index 5 to 349.0.

There is an extra feature available with the DoSet function, where all tanks specified in
the indices array [1,4,5] can have the same OOIP assigned using the following DoSet
command:

DoSet "MBAL.MB.TANK[1,4,5].OOIP", "250.0"

The above technique can be used to set many items in a list to the same value.

3.5.3 Using More than One Multiple Array


The examples shown so far allow more than one index of a particular array to be
accessed. However, we can also access multiple indices of more than one array at a
time.

Consider the tag name for accessing the production data for an MBAL tank:

MBAL.MB.TANK[2].PRODHIST[4].CUMOIL

This tag identifies the Np for the 4th index of the production history table for the 2nd index
tank.

We have already seen how we could access more than one production history record or
more than one tank e.g.:

MBAL.MB.TANK[2].PRODHIST[3:7].CUMOIL
MBAL.MB.TANK[$].PRODHIST[4].CUMOIL

However we can also have multiple indices for both the production history records and
the tank in the same tag name.
For example:
DoSet "MBAL.MB.TANK[1,2].PRODHIST[4:6]", "11.2|14.5|16.3|5.2|6.1|7.5"

The above command sets indices 4, 5 and 6 of the production history for both tanks 1
and 2. The data in the values to set is ordered such that the index to the right varies
first.

In other words the order is:

MBAL.MB.TANK[1].PRODHIST[4].CUMOIL
MBAL.MB.TANK[1].PRODHIST[5].CUMOIL

OpenServer User's Manual


Using OpenServer 28

MBAL.MB.TANK[1].PRODHIST[6].CUMOIL
MBAL.MB.TANK[2].PRODHIST[4].CUMOIL
MBAL.MB.TANK[2].PRODHIST[5].CUMOIL
MBAL.MB.TANK[2].PRODHIST[6].CUMOIL

As before, this method will work equally well for the DoGet function.

The example shown above has two arrays. However, it is possible to use multiple
indices for any number of arrays in a tag string e.g. :

MBAL.MB.WELL[1:3].IPR[4,7].CONEMATCH[$][3,5:8].PRESS

3.6 Wild Cards


Wild Cards can be used to utilised OpenServer strings on multiple items at once and to
perform specifc useful tasks.

Dollar Sign ($)


The dollar sign ($) refers to all the index values.

For example:
“GAP.MOD[0].WELL[$].MASK()” would mask all the wells.

Underscore (_)
Underscore (_) refers to the last value.

“GAP.MOD[{PROD}].WELL[{W1}].PREDRES[_].CUMWAT”, refers to the last value in


the prediction.

Similarly, “PROSPER.SIN.EQP.Devn.Data[_].Md”, refers to the last value in the


measured depth in the deviation survey.

@ Sign and *
@ Sign and * {@Character*} will match equipment starting by the characters specified.

For example:
“GAP.MOD[0].WELL[{@Res1*}].MASK()”

This would mask all the wells start with the label ‘Res1’. This could be utilised when there
are multiple reservoirs being modelled.

@ Sign and ?
The @Letter? Will match any equipment with a starting with the letter(s) specified, which
are of length = specified string + one character.

For example:

© 1990-2018 Petroleum Experts Limited


29 OpenServer

DoGet (“GAP.MOD[0].WELL[{@Well?}].Label”)

Will extract the label of all wells which begin with ‘Well’ and have (only) one character
after this string.

Well1|Well!|WellA

@ Sign and #
The @Digit? Will match any equipment with a starting with the characters(s) specified,
which are of length = specified string + one number (i.e. digit).

For example:
“GAP.MOD[0].WELL[{@Well#}].Label”

Will extract the label of all wells which begin with well and have (only) one number after
this string.

Well1|Well2|Well3

@ Sign and !
The @AlphaCharacter! Will match any equipment with a starting with the
alphacharacters(s) specified, which are of length = specified string + one alpha
character (e.g. ,#?!).

For example:
“GAP.MOD[0].WELL[{@Well!}].Label”

Will extract the label of all wells which begin with well and have (only) one alpha
character after this string.

Well£|Well?|Well.

3.7 Units
Units are handled the same way in all the IPM programs.

Use of Units in OpenServer


By default, when a variable is accessed from the OpenServer using the DoGet function,
the value returned is in the same units as defined for the current model.

Example:
If a GAP model has degrees Celcius selected for the surface temperature variable
of pipes, and the value entered for pipe ‘pipe3’ is 10 degrees C, then performing

DoGet (“GAP.MOD[0].PIPE[{pipe3}].TMPSUR”)

will return 10.

OpenServer User's Manual


Using OpenServer 30

Similarly, when a DoSet function is used, the value passed to the function is interpreted
as being in the current unit displayed in the interface.

The units variable is using can be queried using the UNITNAME(tag) function. This
function will return the units label currently in use for that variable.

Example:
The command

DoGet (“GAP.UNITNAME(MOD[0].PIPE[{pipe3}].TMPSUR)”)

would return the string “degrees C”.

The same information can be obtained by appending UNITNAME to a tag:

“GAP.MOD[0].PIPE[{pipe3}].TMPSUR.UNITNAME”

Retrieving Variables in Field Units


Variables are normally stored internally in the programs in field units. To access a
variable in field units, not the currently selected unit, use the RAWVAL(tag) function.

Example:
The command

DoGet (“GAP.RAWVAL(GAP.MOD[0].PIPE[{pipe3}].TMPSUR)”)

would return 50, since field units for temperature are degrees F.

The same information can be obtained by appending RAWVAL to a tag:

"GAP.MOD[0].PIPE[{pipe3}].TMPSUR.RAWVAL"

Similarly, if the RAWVAL modifier is used for a tag name with a DoSet function, the
OpenServer will interpret the passed value as being in Oil Field units.

Unit Conversion
The automatic conversion of variable values from field units to user selected units can
be switched off completely if desired. This is accomplished by setting the global
variable DOUNITCONV, which is 1 by default, to zero. E.g.:

DoSet "PROSPER.DOUNITCONV”, “0”

Setting the above flag means all subsequent DoGet and DoSet calls will use Oilfield
units. Note that unit conversion can be switched on again by setting the DOUNITCONV
variable back to 1.

Units System
The currently selected units system can be set using the SETUNITSYS() function.

© 1990-2018 Petroleum Experts Limited


31 OpenServer

Example:
Performing the command

DoCmd (“MBAL.SETUNITSYS(""Norwegian S.I."")”)

will set the input and output units to the Norwegian S.I. system for the current MBAL
model.

Use of Units Validation Ranges in OpenServer:


There are also methods to get and set the minimum and maximum validation ranges as
defined in the units system dialog.

To get the minimum value of variable, add UNITMIN to the end of the tag name:

Range("C1") = DoGet("MBAL.MB.TANK[0].PRESS.UNITMIN")

Similarly, the maximum validation range of a unit value can be obtained by appending
the tag with UNITMAX.

Minimum and maximum values of a variable with the same tag can be changed by using
the DoSet function.

Example:
Performing the command

DoSet MBAL.MB.TANK[0].PRESS.UNITMAX”, “15000.0”

will set the maximum pressure validation value to 15000.

3.8 Regional Settings


Parameters exchanged with IPM applications can use Regional Settings defined on the
computer. This options become available starting from IPM 5 onwards.

This is controlled by REGIONMETHOD keyword. The full syntax is as follows:

DoSet ("MBAL.REGIONMETHOD"), value

The value can take three states:


0 - will make all functions ignore the regional setting for the computer. All the
returned parameters will use "English (Great Britain)" culture setting.
1 - will make all functions use the regional setting of the computer
-1 - will revert to default (pre IPM 5) behaviour. This option is retained for
backwards compatibility as some users had already built logic into their
applications to handle the regional settings behaviour.

The above syntax is shown for MBAL. Other IPM programs can be started using the

OpenServer User's Manual


Using OpenServer 32

same syntax by replacing “GAP” with the appropriate program name i.e., MBAL, PVTp,
PROSPER, REVEAL and RESOLVE.
The tag for regional setting should be set each time the application is started. It is not
stored on the computer.

NOTE:
It is possible that the application will not use regional setting in full, but the values
exchanged via OpenServer will.

For example, in PROSPER the decimal symbol is always dot (.) regardless of the
regional setting. This means that any real number input in the program should have a dot
as decimal symbol.
However, if regional setting of the computer has decimal symbol as comma (,) and
OpenServer is setup to use this regional setting, then the returned parameter will also
have comma as a decimal symbol.

3.9 Start/Shutdown Commands


To use the OpenServer to communicate with a particular IPM program, the IPM
program must be running.

The program can be started manually e.g. using the Start menu.

Alternatively there are two special commands that can be used to start an IPM program
and to shut down an IPM program.

To start an IPM program, use the command:

DoCmd "GAP.START()"

This will start the GAP program that was last installed on the working PC.

Other IPM programs can be started using the same syntax by replacing “GAP” with the
appropriate program name i.e., MBAL, PVTp, PROSPER, REVEAL and RESOLVE.

To start an IPM program installed in a particular directory, use the command:

DoCmd “GAP.START(“C:\PETEXPROGS”)”

This will start the GAP program that has been installed in the directory C:
\PETEXPROGS.

Another method to start a particular program is to use the commands specific to


programming language in use. For example VIsual Basic can run any executable file
using Shell() command.

Example:

© 1990-2018 Petroleum Experts Limited


33 OpenServer

To start GAP, the command line will be

Shell (“C:\Program Files\Petroleum Experts\IPM 8\GAP.exe”)

It is also possible to start a given IPM program with the users own timeout period. This
is particularly useful if the IPM executable and licenses are located on a network where it
takes a long period of time to access them. In such cases, the classic timeout period
might be too short.

To start an IPM program with this timeout option, use the command:

DoCmd "GAP.STARTASYNC()"

It will be possible to check whether the program is ready to use by using the following
command:

DoGet "GAP.ISREADY"

This will return


0 : if the program is not ready
1 : if the program is ready
2 : if the program has not yet started or has been unable to find a license.

The ISREADY command can also be used with the other applications of IPM.

To shut down an IPM program, use the command:

DoCmd “GAP.SHUTDOWN”

This will shutdown the GAP program. It will close the program without asking if the
current data is to be saved, thus it is necessary to make sure the appropriate command
has been used to save the data file prior to using the SHUTDOWN command. Other
IPM programs can be shut down using the same syntax by replacing “GAP” with the
appropriate program name (MBAL, PVTP, PROSPER, REVEAL, RESOLVE).

OpenServer User's Manual


Chapter

4
35 OpenServer

4 GAP and OpenServer


4.1 Introduction and Variable Lists
OpenServer provides GAP with a completely open architecture that enables access to
modify and control any data item within a given GAP model from any client application
capable of supporting Automation. OpenServer functionality with GAP provides
complete freedom with regard to importing, exporting or reporting data to and from
virtually any data source.

OpenServer also provides the added ability to execute field development decisions
during a GAP prediction from dynamically monitoring results at any level of a given
production system. For example, well drilling schedules can be developed from using
OpenServer to monitor an overall plant capacity, then perform drilling and completion
tasks to open new wells to maintain a given plant capacity.

GAP has also made a set of OpenServer commands available, which in addition to
providing a ‘batch’ mode of working, can also be used to interface GAP to other
applications such as process simulators, external optimisers or reservoir simulators.

GAP has also been given a new prediction mode, the step-by-step mode, which allows
users, via OpenServer, to customise GAP prediction runs.

This section lists the variables available to the OpenServer from GAP. Most variables
in GAP are accessed using a tag string consisting of several levels (sections), each
level identifying a record (structure).

All variables from GAP begin with the string “GAP”. This is to allow OpenServer to
differentiate between the different Petroleum Experts products, and the remaining part
of the string identifies the OpenServer variable.

Example:
If we wish to access the surface temperature of the pipe with label ‘pipe3’ in the currently
loaded GAP model, we would use the string

GAP.MOD[0].PIPE[{pipe3}].TMPSUR.

The first section of the string is “GAP”, which identifies the Petroleum Experts product
taken into account. This level is further defined as Top Level.
The next section is “MOD[0]”, which identifies the currently loaded GAP model. This level
is further defined as MOD Level.
The next section is “PIPE[{pipe3}]”, which identifies the pipe element with label “pipe3”.
This level is further defined as Node Level.
The final section is “TMPSUR”, the name of the field in the pipe record that contains the

OpenServer User's Manual


GAP and OpenServer 36

surface temperature.

Depending of the type of variable to access, all these OpenServer string sections or
only part of them will be used in specific string.

It is important to notice that all the elements of an OpenServer string expressed in-
between brackets and curly brackets are case sensitive. All the other elements of the
OpenServer strings are not case sensitive.

4.1.1 Ctrl + Right mouse click


Most GAP dialogues and fields support the “Ctrl+Right click” feature, or by simply right
clicking in the given variable field. This feature enables to automatically obtain the
OpenServer string related to a certain variable.

To get the OpenServer tag of a variable, hold the Control key down and right click on
the variable field (or simply right click in the variable field). GAP display an information
box containing the OpenServer tag of the variable related to the field with, in some
cases, a list of possible keywords (see literal constants below) and the current value of
this variable.

For example, if we consider the previous example, and want to access the surface
temperature of the pipe with the ‘pipe3’ label, the following screen will be displayed,
specifying the access string previously described.

© 1990-2018 Petroleum Experts Limited


37 OpenServer

The OpenServer variable accessed through this screen can be directly copied on the
clipboard by clicking on the “Copy” button in the screen. The OpenServer variable can
then be directly pasted into the macro code for instance.

4.1.2 Help Ctrl + Left mouse click


Most GAP dialogues with a ‘Help’ button support the “Ctrl+Left click” feature, by simply
holding Ctrl and left clicking the help button. This prompts GAP to display all OpenServer
strings for the underlying interfaces.

For example, if we consider the interface for a well and we hold the control key down
whilst left clicking the help button, the following screen will be displayed:

Double clicking on any of the items in this list will bring up the corresponding
OpenServer string and variable.

OpenServer User's Manual


GAP and OpenServer 38

4.1.3 Execute OpenServer Statement


This option is available from the main GAP menu bar, using the following path: Edit |
Execute OpenServer Statement.
The following screen is then displayed and allows monitoring of specific data from
OpenServer commands.

© 1990-2018 Petroleum Experts Limited


39 OpenServer

A particular string can be entered by hand or copied from the clipboard. Then, the
“Evaluate” button will do the requested operation of:
- DoGet (i.e. obtain the current value of the variable considered)
- DoSet (i.e. set the value of the variable considered)
- DoCommand (i.e. execute a GAP calculation for instance).

Global Element Changes using OpenServer


This can be used for instance to change the value of a specific variable for all the wells
of a system simultaneously. To act on all elements of a specific type (i.e. all the wells, all
the pipelines, etc…), it is possible to replace the label of the element by a $ sign.

Where all elements are to be redefined at the same time using the wildcard to unique
values, this can be achieved by entering the values in GAP element index order
delimited by a | (vertical line/pole). Please note the maximum number of characters
which can be entered to the Value input section is 1023.

Example:
The string

GAP.MOD[{PROD}].WELL[$].IPR[0].PI

will link to the productivity indexes of all the wells of the system, and can be used to
change the productivity indexes of all the wells of the system in one operation.

Selected Items Only


Using the select feature in GAP (blue arrow from the main tool bar) enables specific
elements to be manually selected and doing so will place a blue circle around the
selected element.

OpenServer User's Manual


GAP and OpenServer 40

Example:
Selecting several wells, then executing the following OpenServer statement

GAP.MOD[{PROD}].WELL[$].IPR[0].PI

only the selected well PI's will be changed.

4.1.4 Specific Units Handling Commands


The Unit System in GAP can either be changed directly through Units section or
through Preferences (File| Preferences).

To specify input and output Units for the opened GAP model the following commands
can be used:

DoSet ("GAP.InputUnitSystem", "OilField")


DoSet ("GAP.InputUnitSystem", 0)
DoSet ("GAP.OutputUnitSystem", "OilField")
DoSet ("GAP.OutputUnitSystem", 0)

The argument can either be specified as a string or as a number; the following options
are available:
0 = "OilField"
1 = "NorwegianSI"
2 = "CanadianSI"
3 = "GermanSI"
4 = "FrenchSI"
5 = "LatinSI"

Preferences option allows the user to specify the DEFAULT input and output the Unit
System which will be used as a reference. If in this case the GAP file is opened or
reloaded it will be automatically converted into the specified DEFAULT Unit System.

The following OpenServer commands are available:

DoSet ("GAP.Preferences.DefaultInputUnitSystem", "OilField")


DoSet ("GAP.Preferences.DefaultOutputUnitSystem", "OilField”)

Example:

© 1990-2018 Petroleum Experts Limited


41 OpenServer

The following example of code will define default Units System and reloads the GAP file,
to ensure that the file is successfully converted into the units specified:

‘set default Unit System


DoSet ("GAP.Preferences.DefaultInputUnitSystem", "CanadianSI")
DoSet ("GAP.Preferences.DefaultOutputUnitSystem", "CanadianSI”)
DoSet ("GAP.Preferences.AlwaysUseDefaultUnitSystems", 1)
‘reload GAP file
DoGAPFunc ("GAP.OPENFILE(""file_path"")")

4.1.5 Literal Constants


In previous releases (i.e. previous to GAP version 5.0), variables such as the
WELLTYPE were defined using numerical indexes (0 - Oil naturally flowing, 1 –
Gaslifted, 2 – ESP lifted, etc…).

The use of numerical indexes has two main drawbacks:


They make the OpenServer script code more difficult to read. One has to remember
what well types 0, 1, 2, 3, ...n correspond to.

The GAP internal values for these variables may have to change in the future, making
existing scripts incompatible.

Since version 5.0, GAP uses keywords rather than numerical indexes to represent such
variables.

For instance, the well type is now defined as OilProducerNoLift for a naturally flowing oil
well, OilProducerGL for a gas lifted oil well, OilProducerESP for an ESP lifted oil well,
etc.

If we use the “Ctrl + Right Click” option in order to obtain the OpenServer access string
defining the well type from the GAP well Summary screen, the screen obtained displays
the access string as well as the literal constants available for each variable.

OpenServer User's Manual


GAP and OpenServer 42

This means that DoGet (“GAP.MOD[{PROD}].WELL[{welllabel}].WELLTYPE”) will return


“OilProducerNoLift” instead of 0. This may make some existing scripts created before
the GAP version 5.0 incompatible with this release of GAP.

The DoSet command supports both literal and numerical constants. We highly
recommend to use literal constants instead of numerical constants.

To eliminate the short term incompatibility issue of existing scripts when considering a
DoGet command, a new OpenServer variable called OpenServerUseKeywords has
been added. It allows the script to switch on or off the use of literal constants (see
OpenServerUseKeywords below). The default value for this variable is 1 which means
that GAP will use literal constants whenever possible.

It is highly recommended that new OpenServer scripts use literal constants, and that
existing scripts are upgraded as soon as possible. This will hugely reduce the amount of
maintenance required on these scripts in the future.

In the following descriptions, the variables using literal constants will be marked
by an asterisk *.
4.1.6 Date Handling within GAP
By default, the dates in GAP are refered to using a numerical constant format, with the
reference being 01/01/1900, which corresponds to day 1 and a value of 1 for the date
numerical constant.

As soon as a DATE OpenServer keyword is used, it will refer to that type of numerical
format.

If the suffix DATESTR is added after the suffix DATE, i.e. DATE.DATESTR, then the
date will be converted automatically from a numerical format to a day/month/year format,

© 1990-2018 Petroleum Experts Limited


43 OpenServer

or month/day/year, depending on the regional settings of the machine.

If the suffix DATETIMESTR is added after the suffix date, then the date will be
converted automatically from a numerical format to a day/month/year hrs/min/sec format.

If the suffix TIMESTR is added after the suffix date, then the date will be converted
automatically from a numerical format to a hrs/min/sec format.

NOTE:
In some cases when the date is retrieved from GAP into the Excel spreadsheet using
DATE keyword, and then internal Excel conversion is used to translate it from numerical
into dd/mm/yyyy format day and month numbers can be flipped with erroneous date in
result. To avoid this CDate() VBA command can be used for date conversion.
4.1.7 Variables at Top Level

Variable Name Description


EnableNetworkValidation Works with a DoSet structure, as illustrated below:

DoSet "GAP.EnableNetworkValidation", 0

This variable can be set to either 0 or 1:


0 = the validation process of GAP will be deactivated.
1 = the validation process of GAP is activated. This is
the default setup.

The purpose of this variable is to enable speeding up


OpenServer routines by avoiding the validation process of
the GAP network.

This is to be used with caution as for instance if the


validation process is deactivated and one of the nodes is
masked, the elements upstream of the masked node will
not be considered in the calculation but will not be masked
either. This can lead to erroneous answers when using
OpenServer routines that check the status of some of the
nodes in the network.
FNA Contains the floating point value used by GAP to indicate
the variable value is undefined.
When a DoGet function returns FNA, the variable targeted
by the DoGet function is not defined.
FNAT A test value which should be used to test whether a variable
is defined or not.
A variable is defined if the variable value < FNAT
LASTCMDRET Contains the returned value of last command.
LASTERROR Contains the error code of the last error.

OpenServer User's Manual


GAP and OpenServer 44

MOD[i] Defines the GAP model to be considered.


If the GAP model loaded is a single file, use MOD[0].
If the GAP model loaded has associated injection systems,
one can use MOD[{PROD}] or MOD[0] for the production
system, MOD[{WINJ}] or MOD[1] for the water injection
system, and MOD[{GINJ}] or MOD[2] for the gas injection
system.
PREDCURDATE OBSOLETE:
Contains current prediction step date when running a
prediction.
This variable contains the date at the start of the timestep,
before any calculations have been done.
This variable is kept for backward compatibility only and
should therefore not be used in any new scripts.
PREDCURSTEPDATE Contains the step date at the end of the current prediction
step, after the calculation has been done.
It therefore corresponds to the date of the beginning of the
next time-step.
Example: A = DoGet (“GAP.PREDCURSTEPDATE”)
PREDPREVSTEPDATE Contains the step date at the beginning of the previous
prediction step, before any calculation is done.
Example: A = DoGet (“GAP.PREDPREVSTEPDATE”)
PREDCURSTEPNO Contains the current prediction time-step number.
PREDSTEPLENGTH Contains current prediction step duration when running a
prediction.
Example: b = DoGet (“GAP.PREDSTEPLENGTH”)
OpenServerUseKeywords Switches on and off the use of literal constants (see Literal
Constants paragraph above).
The values characterizing this variable are defined as
follows:
0 = use numerical indexes
1 = use literal constant (default value)
Example: DoSet("GAP.OpenServerUseKeywords"), 0
The command will switch off the use of literal constants and
keep only the use of numerical indexes.
Alternatively, this OpenServer variable can be set when the
program starts by creating and setting the
KEY_CURRENT_USER\Software\Petroleum Experts\GAP
\OpenServer\UseKeywords word value to 0 or 1
OpenServerCaseSensitive Makes GAP OpenServer statement case sensitive for
OpenServer tag labels i.e. for labels between { …}.
The values returned for this variable are defined as follow:
0 = not case sensitive (default value)
1 = case sensitive

© 1990-2018 Petroleum Experts Limited


45 OpenServer

Alternatively, this OpenServer variable can be set when the


program starts by creating and setting the
KEY_CURRENT_USER\Software\Petroleum Experts\GAP
\OpenServer\CaseSensitive dword value to 0 or 1

4.1.8 Variables at MOD Level


All of the data contained in the currently loaded GAP model (or models, if associated
injection systems are present) is accessed through the MOD variable. This variable
requires an index i.e., MOD[0], MOD[1], MOD[2] or MOD[3] to select the particular
model.

Alternatively it is possible to access the network via its name. The table provides the list
of indexes and corresponding keywords for all the networks modelled in GAP:

Index Literal Constant Network Type


0 {PROD} Production Network
1 {WINJ} Water Injection Network
2 {GINJ} Gas Injection Network
3 {GLINJ} GasLift Injection Network

The use of literal constants is highly recommended (see Literal_Constants).

Example:
The following ways are possible to change the network type depending on whether
indexes or literal constants are used:

DoSet ("GAP.MOD[{PROD}].SysType"), "GasInjection"

DoSet ("GAP.MOD[0].SysType"), 2

Since GAP can have four models, i.e., a production model and three associated
injection models, the fields of the variables at MOD level will be divided in three
categories:
- Model Options
- Solver and Prediction Setup
- System Constraints Setup
- Model Equipment List

4.1.8.1 Model Options

Variable Name Description

OpenServer User's Manual


GAP and OpenServer 46

ActualLayout.UseIPRdP Contains the IPR dP shift status in the Actual/Production


Validation section.
The values characterising this variable are defined as
follows:
0 = No IPR dP shift is taken into account
1 = The IPR dP shift facility is activated.
ASSOCFLAG Describes the type of GAP model considered.
The values characterising this variable are defined as
follows:
0 = No associated models
1 = Associated water injection model
2 = Associated gas injection model
3 = Associated water and gas injection models
Example:
GAP.MOD[{PROD}].ASSOCFLAG
The string will link to the index characterising the type of
field model considered.
BGCORR Contains the gas process correction factor. Can be used to
reconcile surface rates as calculated by GAP Black Oil
process versus surface rates as calculated by some other
process.
BOCORR Contains the oil process correction factor. Can be used to
reconcile surface rates as calculated by GAPs Black Oil
process versus surface rates as calculated by some other
process.
COMPMODE * Contains the system settings regarding fluid composition:
NONE = The system does not take into account any
fluid composition, at the exception of H2S, CO2 and
N2 impurities.
TRACKING = The system is set to track the fluid
composition at each system node.
FULL = The system is a fully compositional system.
BOLumpDelump = The system is set to track the fluid
composition at each system node and can be set to
use a lumped composition or full composition. Black
oil correlations are used for all pressure loss
calculations.
CORRNAME[i] * Enables to determine the flow correlation associated with
each correlation index.
Example:
DoGet(“GAP.MOD[{PROD}].CORRNAME[1]”)
The command will return the Beggs and Brill flow
correlation name.
It is highly recommended to use literal constants to set and
retrieve multiphase flow correlation data.

© 1990-2018 Petroleum Experts Limited


47 OpenServer

Currency Refers to the currency used for revenue calculations.


CurrShort Refers to the label os the currency used for revenue
calculations.
DefaultGasLiftFluidID Contains the FluidList index of the default fluid used for gas
lifting purposes.
DefaultTaxRegimeID Contains the Tax Regime list index of the default tax
regime setup used for optimisation calculations.
DefaultWatInjFluidID Contains the FluidList index of the default fluid used for
water injection purposes.
EmulsionCorrectionList[i].L Contains the label of the emulsion correction model
abel considered.
The index refers to the row index of the emulsion model
considered in the emulsion correction list.
EmulsionCorrectionList[i]. Contains the value of the first match parameter used in the
MatchParam[0] emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the second match parameter used in
MatchParam[1] the emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the third match parameter used in the
MatchParam[2] emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the fourth match parameter used in
MatchParam[3] the emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the fifth match parameter used in the
MatchParam[4] emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the maximum left water cut used to
WctMax1 match the emulsion viscosity model.
EmulsionCorrectionList[i]. Contains the value of the maximum rigth water cut used to
WctMax2 match the emulsion viscosity model.
ExtraMultiplier Contains the multiplier used to convert from the default
currency (i.e. US Dollars) to the currency chosen for
revenue calculations.
FILENAME Contains the file name of the model and its corresponding
path.
FlashOptions.EoS * Contains the type of equation of state model used to
characterise the fluids in the model.
Two equation of state models are available using the
following literal constants:
PR = Peng Robinson
SRK = Soave Redlich Kwong
FlashOptions.OPTMODE * Contains the type of optimisation mode used to
characterize the fluid.
Three optimisation mode are available using the following
literal constants:
LOW = Low optimisation mode

OpenServer User's Manual


GAP and OpenServer 48

MEDIUM = Medium optimisation mode


OFF = No optimisation mode
FlashOptions.SEPCALCM Refers to the type of separator calculation used in the
ODE * model.
Three type of separator calculations are available, using
the following literal constants:
NOSEPTRAIN = The model will not be using a
specific separator train
SEPTRAIN = The model will be using a specific
separator train
KVALUES = The model will be using K values
PATHTOSURFACE = the model will be using the
path to surface object
FlashOptions.SEPPRES[i] Refers to the set of separator pressures used when the
model selected uses a specific separator train.
Up to ten values of separator pressures can be entered,
using the index following the main string name.
FlashOptions.SEPTEMP[i] Refers to the set of separator temperatures used when the
model selected uses a specific separator train.
Up to ten values of separator temperatures can be entered,
using the index following the main string name.
FlashOptions.PTS.NUM_P Returns the number of path to surface objects defined
TS_OBJ
FlashOptions.PTS[i].LABE Returns the label of the i path to surface object
L
FlashOptions.PTS[i].IS_V Validation flag for the i path to surface object
ALID 1 - valid
0 - invalid
FlashOptions.PTS[i].IS_V Validation flag for the i path to surface object when criteria
ALID_OILGAS is oil and gas outlets ONLY
1 - valid
0 - invalid
FlashOptions.PTS[i].PRO For the path to surface object i, accesses the pressure of
CESSDATA.SEPARATO separator j.
R[j].PRESSURE
FlashOptions.PTS[i]..PRO For the path to surface object i, accesses the temperature
CESSDATA.SEPARATO of separator j.
R[j].TEMPERATURE
FlashOptions.PTS[i]..PRO For the path to surface object i, accesses the pressure of
CESSDATA.CHILLER[J]. chiller j.
PRESSURE
FlashOptions.PTS[i]..PRO For the path to surface object i, accesses the temperature
CESSDATA.CHILLER[j].T of chiller j.
EMPERATURE

© 1990-2018 Petroleum Experts Limited


49 OpenServer

FlashOptions.VOLUMESH Refers to the use of volume shift for fluid characterization


IFTMODE purposes. Two status are available using the following
numerical constants:
0 = The fluid has not been characterized using volume
shift
1 = The fluid has been characterized using volume
shift
FluidList[i].CGR Refers to the CGR of the ith fluid of the fluid list.
FluidList[i].GasGravity Refers to the gas gravity of the ith fluid of the fluid list.
FluidList[i].GOR Refers to the GOR of the ith fluid of the fluid list.
FluidList[i].Label Contains the label of the injection fluid considered.
The index refers to the row index of the fluid considered in
the fluid list.
FluidList[i].OilGravity Refers to the oil gravity of the ith fluid of the fluid list.
FluidList[i].PctCO2 Refers to the CO2 content of the ith fluid of the fluid list.
FluidList[i].PctH2S Refers to the H2S content of the ith fluid of the fluid list.
FluidList[i].PctN2 Refers to the N2 content of the ith fluid of the fluid list.
FluidList[i].Type * Contains the type of fluid considered.
Four type of fluids are available using the following literal
constants:
OIL
GAS
WATER
OTHER
FluidList[i].Watsal Refers to the water salinity of the ith fluid of the fluid list.
FluidList[i].WCT Refers to the water cut of the ith fluid of the fluid list.
FluidList[i].WGR Refers to the WGR of the ith fluid of the fluid list.
GasRevenueMode * Refers to the type of gas revenue considered for
production optimisation purposes.
Two types of gas revenue can be taken into account using
the following literal constants:
VOLUME
GROSSHEATINGVALUE
GINJNAME Contains the file name of the associated gas injection
system.
ISDIRTY Enables to determine if the model has been modified since
its last saved version.
The values characterising this variable are defined as
follows:
0 = The model has not been modified since its last
version.

OpenServer User's Manual


GAP and OpenServer 50

1 = The model has been modified since its last


version.
OptMethod Contains the type of optimisation method used in the
model.
The numerical indexes characterising this variable are
defined as follows:
0 = Production
1 = Revenue
2 = Oil Rate Only
3 = Gas Rate Only
4 = Water Rate Only
Predict Contains the prediction method used in the model.
(previously ISPANDT) The values characterising this variable are defined as
follows:
0 = Only the pressure drops are calculated in the
system pipelines
1 = Both pressure drops and temperature are
calculated in the system pipelines
PredMode * Contains the status of the model in terms of prediction:
OFF = The prediction mode of GAP is not activated.
ON = The prediction mode of GAP is activated.
SYSLOG Contains the text comments linked to the system. These
comments will be displayed in GAP in the Options|System
Summary screen.
SYSTITLE Contains the system title. This title will be displayed in GAP
in the Options|System Summary screen.
SYSTYPE * Contains the type of system considered.
Three type of systems are listed using the following literal
constants:
– Production
– WaterInjection
– GasInjection
– GasLIftInjection
Example:
DoSet ("GAP.MOD[{PROD}].SysType"),
"gasliftinjection"
The command would set the method to be able to construct
a gas lift injection network, etc.
TaxRegimeList[i].CostDilu Refers to the cost of diluent in the ith tax regime of the tax
ent regime list.
TaxRegimeList[i].CostInjG Refers to the cost of injected gas in the ith tax regime of the
as tax regime list.
TaxRegimeList[i].CostPow Refers to the cost of power in the ith tax regime of the tax
er regime list.

© 1990-2018 Petroleum Experts Limited


51 OpenServer

TaxRegimeList[i].CostPow Refers to the cost of power fluid in the ith tax regime of the
erFluid tax regime list.
TaxRegimeList[i].CostWat Refers to the cost of water processing in the ith tax regime
er of the tax regime list.
TaxRegimeList[i].Name Contains the name of the tax regime considered.
The index refers to the row index of the tax regime
considered in the tax regime list.
TaxRegimeList[i].Revenue Refers to the gas price in the ith tax regime of the tax
Gas regime list.
TaxRegimeList[i].Revenue Refers to the oil price in the ith tax regime of the tax regime
Oil list.
WINJNAME Contains the filename of the associated water injection
system.

4.1.8.1.1 Solver Setup and Calculation Log

Variable Name Description


GASAV[i] Array [10] of gaslift injection gas available
amounts.
Enables to set up to 10 different amounts of gas
lift injection gas available in the system when
using the Solve Network calculation.
Example:
DoSet(“GAP.MOD[{PROD}].GASAV[0]”), 1
The command will fix the first value of gas lift
injection gas available in the system to 1
MMSCF/d.
NumSensitivity Returns the number of values of separator
(previously NALLOCED) pressures or gas lift gas available allocated and
used in the model as sensitivity variables.
If there is no gas lifted wells in the model, it will
return the number of separator pressure
sensitivities considered.
If there are gas lifted wells in the system, it will
return the number of gas lift gas injection rates
sensitivities considered.
SolverCalculatePotential Enables to select whether to calculate or not the
model potential when solving the network:
0 = The model potential is not calculated
1 = The model potential is calculated
SolverOptimiseMode Enables to select whether the solver calculation to
perform is to be optimised or not:

OpenServer User's Manual


GAP and OpenServer 52

OptOff = The solver will be run without


optimisation
OptAllCnst = The solver run will be
optimised and will respect all the model
constraints
OptPotCnst = The solver run will be
optimised and will respect only the potential
constraints
SolverStatus Returns the status of the last solver run.
This values characterising this variable are as
follows:
0 = the last solver run did not experience
any error
#0 = the last solver run did experience an
error.
SolverStatusText Returns a text string describing the last solver run
error.

SolverStatusList[i] variables All these OpenServer variables refer to solver


status and results.
The index i refers to the index of the sensitivity
case considered. The values of this index range
from 0 to 9, depending on the number of
sensitivity cases considered.
These OpenServer variables are not available
using the Ctrl + Rigth Click option.
SolverStatusList.count Returns the number of sensitivity cases used
during the solver run.
SolverStatusList[i].CPUTime Returns the CPU time used by the solver to run
the case considered. Expressed in seconds.
SolverStatusList[i].ElapsedTime Returns the total time used by the solver to run the
case considered. Expressed in milliseconds.
SolverStatusList[i].LastError Returns the last error associated with the ith
sensitivity case of the solver.
SolverStatusList[i].MaxMassBalanc Returns the maximum mass balance difference
eDiff associated with the ith sensitivity case of the
solver.
SolverStatusList[i].MaxPressureBal Returns the maximum pressure balance
anceDiff difference associated with the ith sensitivity case
of the solver.
SolverStatusList[i].NumIteration Returns the number of iterations associated with
the ith sensitivity case of the solver.
SolverStatusList[i].OptNumIteration Returns the number of optimisation iterations
associated with the ith sensitivity case of the

© 1990-2018 Petroleum Experts Limited


53 OpenServer

solver optimiser.
SolverStatusList[i].OptBestGuess Returns the optimiser best guess associated with
the ith sensitivity case of the solver.
SolverStatusList[i].Status Returns the status of the last solver run for the ith
solver sensitivity.
The values characterising this variable are as
follows:
0 = the last solver run did not experience
any error
#0 = the last solver run did experience an
error.
SolverStatusList[i].StatusText Returns a text string describing the last solver run
error for the ith solver sensitivity case.
SolverStatusList[i].ViolatedConstrai Returns the number of constraints violated during
nt.count the ith solver run.
SolverStatusList[i].ViolatedConstrai Returns the type of equipment to which the jth
nt[j].EquipType violated constraint message of the ith solver run
refers to.
SolverStatusList[i].ViolatedConstrai Returns the ID of the system equipment to which
nt[j].EquipUniqueID the jth violated constraint message of the ith
solver run refers to.
SolverStatusList[i].ViolatedConstrai Returns the label of the system equipment to
nt[j].EquipLabel which the jth violated constraint message of the ith
solver run refers to.
SolverStatusList[i].ViolatedConstrai Returns the binding status of the jth violated
nt[j].Binding constraint message of the ith solver run:
0 = constraint is not binding
1 = the constraint is binding.
SolverStatusList[i].ViolatedConstrai Returns the calculated value of the jth violated
nt[j].CalcValue constraint message of the ith solver run.
SolverStatusList[i].ViolatedConstrai Returns the constraint value of the jth violated
nt[j].CnstValue constraint message of the ith solver run.
SolverStatusList[i].ViolatedConstrai Returns the description of the type of the jth
nt[j].CnstDesc constraint (e.g. Max Water Rate) violated in the ith
solver run.
SolverStatusList[i].ViolatedConstrai Returns the text message of the solver log related
nt[j].msg to the jth violated constraint message of the ith
solver run.

OpenServer User's Manual


GAP and OpenServer 54

4.1.8.1.2 Prediction Setup

Variable Name Description


DCQSCHEDULE[i].DATE Contains the ith date of the DCQ schedule in a
numerical constant format.
This date is expressed in days and time and the
reference used is the 01/01/1900 (i.e. correspond to
day 1).
DCQSCHEDULE[i].DATE.D Contains the ith date of the DCQ schedule in a day/
ATESTR month/year format.
DCQSCHEDULE[i].DATE.D Contains the ith date of the DCQ schedule in a day/
ATETIMESTR month/year hrs/min/sec format.
DCQSCHEDULE[i].DATE.TI Contains the ith time of the DCQ schedule in a hrs/min/
MESTR sec format.
DCQSCHEDULE[i].val Contains the value of the DCQ schedule at the ith date.
DCQSCHEDULE[i].useswing Enables to select whether swing factors have to be used
in the DCQ driven production prediction or not.
The values associated to this variable are the following:
0 = Swing factors are not used
1 = Swing factors are used
PredCalculatePotential Enables to select whether to calculate or not the model
potential during the prediction.
The values associated to this variable are the following:
0 = The model potential is not calculated
1 = The model potential is calculated
PREDINFO.PERIOD Contains the length of the prediction period in days.
Example:
DoSet(“GAP.MOD[0].PREDINFO.PERIOD), 1000
The command will set a prediction period of 1000 days
starting from the prediction start date specified.
PREDINFO.START Contains the prediction starting date in a numerical
constant format.
This date is expressed in days and time and the
reference used is the 01/01/1900 00:00:00.
Example:
DoSet(“GAP.MOD[{PROD}].PREDINFO.START”),
36525
The command sets the prediction starting date to the
01/01/2000 00:00:00.
PREDINFO.START.DATEST Contains the prediction starting date in a day/month/
R year format.
PREDINFO.START.DATETIM Contains the prediction starting date in a day/month/
ESTR year hrs/min/sec format.

© 1990-2018 Petroleum Experts Limited


55 OpenServer

PREDINFO.START.TIMESTR Contains the prediction starting date in a day/month/


year hrs/min/sec format.
PREDINFO.END Contains the prediction ending date in a numerical date
format.
This date is expressed in days and the reference used
is the 01/01/1900 (i.e. correspond to day 1).
PREDINFO.STEPUNIT * Contains the prediction timestep length unit.
Four units are used using the following literal constants,
followed by their corresponding numerical constants:
0 = DAYS
1 = WEEKS
2 = MONTHS
3 = YEARS
PREDINFO.END.DATESTR Contains the prediction ending date in a day/month/year
format.
PREDINFO.END.DATETIME Contains the prediction ending date in a day/month/year
STR hrs/min/sec format.
PREDINFO.END.TIMESTR Contains the prediction ending date in a day/month/year
hrs/min/sec format.
PredictionOptimiseMode Enables to select whether the prediction calculation to
perform is to be optimised or not.
The values associated to this variable are the following:
OptOff = The prediction will be run without
optimisation.
OptAllCnst = The prediction run will be optimised
and will respect all the model constraints.
OptPotCnst = The prediction run will be optimised
and will respect only the potential constraints.
PREDRESTART * Enables to select whether the production prediction to
run is based on a previous run or not.
The literal constants associated to this string are as
follows:
NO
YES
Example:
DoSet "GAP.MOD[{PROD}].PREDRESTART",
"yes"
PREDINFORESTART.END Contains the prediction restart end date in a numerical
date format.
Example:
DoSet "GAP.MOD
[{PROD}].PREDINFORESTART.Start",
CStr(DateValue("DATE"))
PREDINFORESTART.PERIO Contains the length of the prediction restart period in

OpenServer User's Manual


GAP and OpenServer 56

D days.
PREDINFORESTART.STAR Contains the prediction restart date in a numerical date
T format.
PREDINFORESTART.STEP Contains the prediction restart timestep length.
PREDINFORESTART.STEP Contains the prediction restart timestep length unit.
UNIT
GAP.PREDRESTART Performs the restart prediction calculation
NOTE:
To perform a restart prediction, replace GAP.PREDINIT
with GAP.PREDRESTART
Example:
NumSteps =
DoGAPFunc("GAP.PREDRESTART()")

PredTimeStep[i] variables The following OpenServer variables refer to solver and


optimiser status and results during a prediction run.
The index i refers to the prediction step index or date (in
between curly brackets) considered.
The first timestep is always referred as using the index
0.
NOTE: These variables are accessible after prediction
run has accomplished, therefore the name or number of
prediction runs should also be specified in the tag
string.
Example: To obtain variable for ith time step of Last
Prediction Run following command can be used:
DoGet("GAP.MOD[{PROD}].PREDRES[{Last
Prediction Run}].PredTimeStep[i].variable")
PredTimeStep[i].SolverStatus Returns the status of the last solver run associated with
.Status the i+1th prediction time-step:
0 = the last solver run did not experience any error
#0 = the last solver run did experience an error.
PredTimeStep[i].SolverStatus Returns a text string describing the last solver run error
.StatusText associated with the i+1th prediction time-step.
PredTimeStep[i].SolverStatus Returns the last error associated with the i+1th
.LastError prediction time-step.
PredTimeStep[i].SolverStatus Returns the maximum flow balance difference
.MaxFlowBalanceDiff associated with the i+1th prediction time-step.
PredTimeStep[i].SolverStatus Returns the maximum pressure balance difference
.MaxPressureBalanceDiff associated with the i+1th prediction timestep.
PredTimeStep[i].SolverStatus Returns the number of iterations associated with the i
.NumIteration +1th prediction time-step.

© 1990-2018 Petroleum Experts Limited


57 OpenServer

PredTimeStep[i].SolverStatus Returns the number of optimisation iterations


.OptNumIteration associated with the i+1th prediction time-step..
PredTimeStep[i].SolverStatus Returns the optimiser best guess associated with the i
.OptBestGuess +1th prediction time-step.

For more information on macro code structure to perform a prediction, please see
Basic_Code_Structure.
4.1.8.2 Model Equipment List
As described previously, OpenServer strings at the MOD level enable to define the
overall model and calculation procedures setup.
In order to access the parameters related to one specific element of the model i.e., a
well, reservoir, etc., it will be necessary to specify the element using an element tag at
the MOD level.

The MOD variable contains the ‘node lists’, i.e. the lists of wells, tanks etc., that are
defined in the GAP model. Each list contains nodes of the same type, such as TANK,
WELL, PIPE and so on. The EQUIP list contains all the elements defined in the GAP
model regardless of their type

The name of the list taken into account as well as either the numerical index (i.e.
TANK[3]) or the element label of the element considered (i.e. TANK[{T1}]) needs to be
added to the MOD section of the string to be able to access the element. This will
enable to pass from the MOD level to the NODE level of the OpenServer string.
The element lists used in GAP are defined as follows:

Variable Name Description


EQUIP[i] The list of equipment nodes.
Can be accessed by index i.e. [3] or label ie [{w1}]
Example:
GAP.MOD[0].EQUIP[{w1}]
The string will enable to access the well w1 in the model
TANK[i] The list of tank nodes.
WELL[i] The list of well nodes.
PUMP[i] The list of pump nodes.
COMP[i] The list of compressor nodes.
PIPE[i] The list of pipe nodes.
INFLOW[i] The list of inflow nodes.
GROUP[i] The list of group nodes.
JOINT[i] The list of joint nodes.
SEP[i] The list of separator, water injection manifold or gas injection
manifold nodes.
SOURCE[i] The list of source nodes.

OpenServer User's Manual


GAP and OpenServer 58

SINK[i] The list of sink nodes.


VALVE[i] The list of check or gate valve nodes.
INLSEP[i] The list of inline separator nodes.
INLINJ[i] The list of inline injection nodes.
INLCHK[i] The list of inline choke nodes.
INLGEN[i] The list of inline programmable nodes.
EquipAddDel[“x”] EquipAddDel[] takes a string index describing the node type such as
"WELL", "JOINT", ... or "EQUIP". The elements of this array are
incremented each time a node of the corresponding type is added or
deleted from the model.
Example: EquipAddDel["EQUIP"] is incremented each time any
node is added or deleted from the model.
Some scripts are ‘caching’ the number of nodes of a given type and
their respective labels in memory to speed up the execution of the
script. By checking of the values of this array, a script will be able to
detect if nodes have been added to or deleted from the model since
the information was last cached.

4.1.9 Variables at Node Level


The node lists used at the MOD level enables to specify a certain element of the model.
At the Node level, the following keywords are used to access the different node
variables.

The Scheduling and Constrainst OpenServer access strings will be described as


separate sections (Scheduling and Constraints_and_Potential_Calculations).

4.1.9.1 General fields found in nodes of any type

Variable Name Description


COMMENT Refers to the comment field of the node.
COUNT Contains the number of nodes of the same type present in the GAP
model.
ISBYPASSED Contains the status of the node relative to node bypass as set by the
user. Read-Only variable.
If the value returned is:
0 = the node is not bypassed
1 = the node is bypassed
ISDISABLED Contains the status of the node relative to node disabling as set by
the user. Read-Only variable.
If the value returned is:

© 1990-2018 Petroleum Experts Limited


59 OpenServer

0 = the node is not disabled


1 = the node is disabled
ISMASKED Contains the status of the node relative to node masking as set by
the user. Read-Only variable.
If the value returned is:
0 = the node is not masked
1 = the node is masked
NOTE: If a node is not masked by the user but greyed-out by the
software: ISMASKED will return 0 and MASKFLAG will be #0.
LABEL Contains the short tag allocated to the node.
This is the label which can be used to index the node from the list.
MASKFLAG Contains the activation status of the node. Read-Only variable.
If the value returned is:
0 = the node is included in the system.
#0 = the node is not included in the system.
Example:
GAP.MOD[0].WELL[{n1}].MASKFLAG
The string returns the mask flag for n1 well.
NOTE: Mask Flag status can be captured for any element directly
via the element SUMMARY screen using a right-click mouse action
in the Mask dialogue box.
NAME Contains the long tag allocated to the node.
PREDRES[i].var Contains the prediction results for the node.
– The index refers to the time-step considered. It can be
described using time-step number (i.e. [3]) or the time-step
date (i.e. [{01/01/2000}])
– ‘var’ is the column internal name and refers to the node
variable considered.
Example: The string
GAP.MOD[0].WELL[{W1}].PREDRES[{01/01/2000}].Qoil
will enable to access the predicted oil rate of the well W1 at
01/01/2000.
SolverResults[i].v Contains the allocation results for the node.
ar The index is the solver run number and refers to the ith gas lift
injection gas quantity if considering a gas lift system or to the ith
separator pressure if not.
‘var’ is the column internal name and refers to the node variable
considered.
Example: The string
GAP.MOD[0].WELL[{W1}].SolverResults[0].Qoil
command will enable to access the oil rate allocated by the solver to
the well W1 for the first separator pressure value considered.
TYPE Contains the type of node considered when referring to the overall
EQUIP list. Read-Only variable.

OpenServer User's Manual


GAP and OpenServer 60

The keyword values are:


WELL, PIPE, TANK, SEP, PUMP, COMP, JOINT, SOURCE, SINK,
VALVE, INLSEP, INLCHK, INLINJ, INLGEN, GROUP, INFLOW.
Example: The string
GAP.MOD[0].EQUIP[1].TYPE
will enable to specify the type of the second node of the overall
equipment list. If it is a well, it will return WELL for instance.
TYPENUM Contains a number referring to the type of node considered when
considering the overall EQUIP list.
UniqueID Contains an READ-ONLY identifier which will be unique for each
node and will never change, whatever modifications are done to the
system.
The value of this unique ID can be used similarly to the node index
number to define the node in any OpenServer string.
EndA This tag is applied to inline elements, pumps and compressors (all
elements that are placed in between two joints). This allows to
determine the name of the joint upstream the element itself.
Example: The string
GAP.Mod[0].Pump[0].EndA
will give the name of the joint upstream the pump
EndB This tag is applied to inline elements, pumps and compressors (all
elements that are placed in between two joints). This allows to
determine the name of the joint downstream the element itself
PARENT Excluding reservoir tanks, this tag applies to all elements. It extracts
the label of downstream joint. Note: if multiple flow paths exist from a
element, this string will extract the downstream joint of the first
connection.

4.1.9.2 Equipment Icon Position


It is possible to adjust positions of equipment icons on the screen in GAP. The following
syntax is used:

to control horizontal position

GAP.MOD[{PROD}].<equipmenttype>[{<equipmentname>}].Bound.Left

to control vertical position

GAP.MOD[{PROD}].<equipmenttype>[{<equipmentname>}].Bound.Top

The centre of coordinate system is set in the middle of the screen. As such it is possible
to use both positive and negative coordinates. The values of coordinates are not limited.

NOTE:

© 1990-2018 Petroleum Experts Limited


61 OpenServer

The coordinate system is not fixed. Every time the screen is normalised (View|
Normalise Equipment Icon Position) the view is adjusted such that the entire network
can fit in the window. This is done by placing boundary icons at the edge of the screen.
In this case the coordinate system centre changes. Therefore when setting up the
network layout via OpenServer all the icons should be adjusted at once, then the screen
can be normalised..

Example:
To set the well icon position 1000 coordinate units to the right of the centre the following
syntax can be used

DoSet("GAP.MOD[0].WELL[{Well1}].BOUND.LEFT"), 1000

4.1.9.3 Fields specific to tanks


All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].TANK[j]

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section) and the index j refers to the name or numerical index of the
element considered (i.e. refers to the Model Equipement List, see
Model_Equipment_List).

Variable Name Description


FILE Contains the name and path of the MBAL data file
associated to the tank.
MAINSUBTANK.File When considering a multiple tank model, this will return the
path of the MBAL file corresponding to this tank model.
MBINUMTANKSINFILE This will return the number of tanks included in the model
considered.
It will return 1 for a single tank model and a value higher
than 1 for a multiple tank model.
IsMainTank Identifies if the tank in question is the 'main tank.'
0 = is not the 'main tank'
1 = is the 'main tank'

Context: A single MBAL tank in a model is its own special


piece of equipment and will return 1. Multi-tank models are
different. Multi-tanks are modelled as 'sub-tanks' in an
invisible pseudo tank. This is due to the fact that they can
be connected through transmissibilities and the mass
balance will have to be performed over the whole multi-
tank system.
IsMultiTankMainPseudoTa Identifies if the tank in question is the invisible pseudo

OpenServer User's Manual


GAP and OpenServer 62

nk tank (applicable to multi-tank models).


0 = is not the 'invisible pseudo tank'
1 = is the 'invisible pseudo tank'
MainSubTank Identifies the ID of the invisible pseudo tank for any sub-
tank (applicable to multi-tank models).
Model Contains the type of tank model used to model the
reservoir.
The values returned can be:
0 = Material Balance model
1 = Decline Curves
PRODDATA.COUNT Number of production data points entered (decline curve
tanks).
PRODDATA[i][j] Refers to the production data array [20][2] (decline curve
tanks).
The following numerical indexes are used:
i = Refers to the input row considered
j = Refers to the input parameter considered (0 for
reservoir pressure, 1 for cumulative production)
TANKID Contains the name of the MBAL tank.
TANKTYPE * Refers to the type of tank considered.
The keyword values used are:
OIL
GAS
CONDENSATE
TCURGASPROD Contains the current cumulative gas production (decline
curve tank).
TCUROILPROD Contains the current cumulative oil production (decline
curve tank).
TCURRESPRED Returns the Current Pressure for the tank based on the
current Oil/Gas Production. (Decline Curve Tanks)
TINJGASFIX Refers to the fixed gas injection rate associated to the
reservoir.
TINJGWR Contains the injected Gas to Water ratio used to maintain
a reservoir target pressure.
TINJWATFIX Refers to the fixed water injection rate associated to the
reservoir.
TMAXGAS Contains the maximum gas injection constraint (apply to
tank in injection system).
TMAXLIQ Contains the maximum liquid injection constraint
(applicable to tank in injection system).
TRECYCGAS Contains the required fraction of gas recycling.
TRECYCGASPMFIX Contains the amount of sales gas to subtract from
production before recycling.

© 1990-2018 Petroleum Experts Limited


63 OpenServer

TRECYCWAT Contains the required fraction of water recycling.


TTARGPRES Contains the target pressure associated with the tank.
TVOIDREPGAS Contains the fraction of gas voidage replacement
required.
TVOIDREPWAT Contains the fraction of water voidage replacement
required.
SubTankNumber Refers to the Index of the tank in the MBAL data file (apply
to multi-tank models).
PRODHISTORYSTART.DA Start of production history for the tank
TESTR
PRODHISTORYEND.DAT End of production history for the tank
ESTR

Example:
To access the MBAL tank ID of a node with label t1, one could use the command

DoGet(“GAP.MOD[0].TANK[{t1}].TANKID”)

or equivalently

DoGet(“GAP.MOD[0].EQUIP[{t1}].MBALNUM”)

NOTE:
These OpenServer variables are also available for both groups preceded by the
following OpenServer string structure:

GAP.MOD[i].GROUP[j]

and group members preceded by the following OpenServer string structure:

GAP.MOD[i].GROUP[j].MEMBER[k].

4.1.9.4 Fields Specific to Wells

This sections describes OpenServer variables specific to well models in GAP.

4.1.9.4.1 Fields specific to all well models

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].WELL[j]

OpenServer User's Manual


GAP and OpenServer 64

Where the index i refers to the type of model considered at the MOD level i.e., MOD[i]
section and the index j refers to the name or numerical index of the well considered.

Variable Name Description


Well Summary Section
File Contains the name and path of the PROSPER file associated
with the well considered.
PowerFluidMode * Contains the type of power fluid system used (i.e. Oil Producer
well with diluent injection).
The following keywords are used:
ClosedLoop
Commingled
TypeWell * Contains the type of well considered.
The following keywords are used:
CBMProducerESP
CBMProducerPCP
CondensateProducer
GasInjector
GasProducer
OilProducerDILUENT
OilProducerDILUENTGAS
OilProducerESP
OilProducerGL
OilProducerHSP
OilProducerJETPUMP
OilProducerNoLift
OilProducerPCP
OilProducerSRP
WaterInjector
WaterProducer
WellModel Contains the type of well model used. The following numerical
indexes are used:
0 = VLP/IPR Intersection
1 = Performance Curve
2 = PC interpolation
3 = Outflow Only VLP
4 = Outflow Only PROSPER
RateType * Sets the rate type of well model used. The following numerical
indexes are used:
0 = Use Volumes
1 = Use Mass

Downtime Section
DOWNTIME Contains the downtime value associated with the well

© 1990-2018 Petroleum Experts Limited


65 OpenServer

considered.

dP Control Section
AlqControl * Contains the status of the artificial lift control parameter.
The following keywords are used:
CALCULATED = The artificial lift system is controlled by
the optimiser
FIXEDVALUE = The artificial lift system is not controlled
by the optimiser.
AlqValue Contains the value of the artificial lift parameter used or
calculated from allocation result.
Depending of the type of artificial lift consider, this parameter
will refer to:
– Power Fluid Rate (Diluent Injection Well, HSP Lifted
Well, Jet Pump Lifted Well)
– ESP Frequency (ESP Lifted Well)
– Pump Speed (PCP Lifted Well)
AlqValueMax Contains the maximum value the artificial lift parameter can take
when controlled by the optimiser.
The type of artificial lift parameters considered are listed in the
AlqValue row.
! Does not include gas lifted systems (see MAXQINJ).
AlqValueMin Contains the minimum value the artifial lift parameter can take
when controlled by the optimiser.
The type of artificial lift parameters considered are listed in the
AlqValue row.
! Does not work in gas lifted system (see MINQINJ).
DPControl * Contains the status of the wellhead choke control.
The following keywords are used:
CALCULATED = The wellhead choke (i.e. and therefore
the corresponding pressure drop) is controlled by the GAP
optimiser accordingly to the constraints set on the model.
FIXEDVALUE = A fixed dP is applied at the wellhead.
NONE = The wellhead choke cannot be controlled by the
optimiser.
DPControlValue Contains the value of the wellhead choke generated pressure
drop or the value of the chosen fixed pressure drop at the
wellhead.
InjectedFluidLabel Contains the label of the injection fluid considered.
MAXQINJ Contains the maximum gas lift gas available.
MeasuredAlq Contains the amount of gas lift gas injected in the system.
MINQINJ Contains the minimum gas lift gas available.
PowerFluidMode* Refers to the type of power fluid circulation mode used.
The following keywords are used:

OpenServer User's Manual


GAP and OpenServer 66

Commingled
ClosedLoop

4.1.9.4.2 Fields specific to wells modelled using VLP/IPR intersection


Variable Name Description

IPR Section
CurEditLayer Contains the numerical index of the layer considered.
Will return 0 for the first layer, 1 for the second layer and so
on.
IPR[i] Contains the array of the IPR record.
If located before a specific parameter, this string refers to
the value of this specific parameter for the ith IPR description
considered.
Example:
DoGet(“GAP.MOD[0].Well[{Well 1}].IPR[0].ResPres”)
The command will return the reservoir pressure associated
with the oth layer of the well 1.
IPR[i].BrkGasCon Contains the Gas Oil Contact depth at breakthrough
IPR[i].BrkGasSat Contains the Gas Saturation at breakthrough
IPR[i].BrkPerfTop Contains the top depth of the perforated interval
IPR[i].BrkPerfBot Contains the bottom depth of the perforated interval
IPR[i].BrkWatCon Contains the Water Oil Contact depth at breakthrough
IPR[i].BrkWatSat Contains the Water Saturation at breakthrough
IPR[i].C Contains the C factor value used for gas wells IPRs
IPR[i].CGR Contains the CGR of the layer fluid
IPR[i].CORRRELPERM Contains the status of the shift relative permeabilities to
breakthrough facility.
The following numerical indexes are used:
0 = The option is not activated
1 = The option is activated
IPR[i].DarcyCoeff Contains the Darcy coefficient value for gas wells IPRs
IPR[i].DISABLE() Used together with a DoCmd structure, will disable the ith
layer of the well. See IPR[i].MASK()
IPR[i].ENABLE() Used together with a DoCmd structure, will enable the ith
layer of the well
IPR[i].GasGravity Contains the gas specific gravity for the layer fluid
IPR[i].GOR Contains the current GOR of the layer fluid
IPR[i].IPRType * Contains the type of IPR model used to characterize the
inflow performance of the well.

© 1990-2018 Petroleum Experts Limited


67 OpenServer

The following keywords are used:


Lookup = P vs. rate table is used to define the well IPR
PI = Productivity index is used to define the well IPR (oil
wells only)
Cn = C and n relationship is used to define the well IPR
(gas wells only)
Forcheimer = Forcheimer relationship is used to define
the well IPR (gas wells only)
Forcheimer Pseudo = Forcheimer Pseudo Pressure
(gas wells only)
IPR[i].ISLAYERVALID Check the validity of the IPR dataset.
The following numerical indexes are used:
0 = The IPR dataset considered is not valid
1 = The IPR dataset considered is valid
IPR[i].Label Contains the label of IPR considered
IPR[i].LayerType * Contains the type of layer considered. The following
keywords are used:
CONDENSATE
GAS
OIL
IPR[i].MASK() Used together with a DoCmd structure, will mask the ith layer
of the well.
Example:
DoCmd(“GAP.MOD[0].Well[{Well 1}].IPR[0].MASK()”)
The command will mask the 0th layer production until
otherwise specified by the end user or the scheduling
IPR[i].MASKFLAG() Contains the status of layer considered.
The following numerical indexes are used:
0 = The IPR considered is included in the system
#0 = The IPR considered is not included in the system
IPR[i].MGasRate[j] Contains an array (i.e. 20 values maximum) of gas rates
used for IPR matching
IPR[i].MGOR Contains the layer test GOR (with PI correction for mobility
activated and Vogel correction for GOR options activated)
IPR[i].MLiqRate[j] Contains an array (i.e. 20 values maximum) of oil rates used
for IPR matching
IPR[i].MNUMPOINTS Contains the number of IPR match point used
IPR[i].MPB Contains the layer test bubble point pressure
IPR[i].MPRES[j] Contains an array (i.e. 20 values maximum) of pressures
used for IPR matching
IPR[i].MResPres Contains the layer test pressure (with PI correction for
mobility activated)
IPR[i].MWCT Contains the layer test water cut (with PI correction for
mobility activated)

OpenServer User's Manual


GAP and OpenServer 68

IPR[i].MWGR Contains the layer test WGR (with PI correction for mobility
activated)
IPR[i].N Contains the N value used for gas wells IPRs
IPR[i].NonDarcyCoeff Contains the non-Darcy coefficient used for gas IPRs
IPR[i].OffsetPressure Contains the value of the IPR offset pressure if any
IPR[i].OilGravity Contains the oil specific gravity for the layer fluid
IPR[i].PctCO2 Contains the CO2 mole percentage for the layer fluid
IPR[i].PctH2S Contains the H2S mole percentage for the layer fluid
IPR[i].PctN2 Contains the N2 mole percentage for the layer fluid
IPR[i].PERMCORRN Contains the value of the permeability compaction correction
exponent
IPR[i].PI Contains the Productivity Index value of the layer considered
IPR[i].PICorrRelPerm Contains the status of the PI correction for mobility.
The following numerical indexes are used:
0 = The PI correction for mobility is not activated
1 = The PI correction for mobility is activated
IPR[i].PRODDATA[i][j] Contains an array of production data values. Used only when
the MBAL tank is modeled using decline curve.
The following numerical indexes are used:
i = Refers to the input row considered
j = Refers to the parameters considered (i.e 0 for
cumulative production, 1 for GOR / CGR and 2 for
Water Cut / WGR)
IPR[i].ProdDataInterpolati Refers to the type of interpolation used in the model when
onMode* using a decline curve MBAL tank. The following keywords
are used:
CumProd = Interpolate on Cumulative Production
ResPres = Interpolate on Reservoir Pressure
IPR[i].RELPERM1.EXGA Contains the gas relative permeability exponent value
S described in the Rel Perm1 relative permeability dataset.
NOTE: In all similar variables described below, if
RELPERM2 is used, then it will refer to the Rel Perm 2
relative permeability dataset.
NOTE: In previous versions, the string RELPERM.EXGAS
was used. In terms of backward compatibility, this type of
string will refer to the Rel Perm 1 relative permeability
dataset
IPR[i].RELPERM1.EXOIL Contains the oil relative permeability exponent value
described in the Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.EXW Contains the water relative permeability exponent value
AT described in the Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.SGR Contains the gas residual saturation value described in the
Rel Perm1 relative permeability dataset

© 1990-2018 Petroleum Experts Limited


69 OpenServer

IPR[i].RELPERM1.SOR Contains the oil residual saturation value described in the


Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.SWC Contains the water residual saturation value described in the
Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.XKGE Contains the relative permeability to gas endpoint described
in the Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.XKOE Contains the relative permeability to oil endpoint described
in the Rel Perm1 relative permeability dataset
IPR[i].RELPERM1.XKW Contains the relative permeability to water endpoint
E described in the Rel Perm1 relative permeability dataset
IPR[i].RelPermType1 Refers to the set of relative permeabilities used in the layer
considered.
The following numerical indexes are used:
0 = From Tank Model
1 = From RelPerm1 set of relative permeabilities
2 = From RelPerm2 set of relative permeabilities
IPR[i].RelPermType2 Refers to the set of relative permeabilities used in the layer
considered for mobility correction.
The following numerical indexes are used:
0 = From Tank Model
1 = From RelPerm1 set of relative permeabilities
2 = From RelPerm2 set of relative permeabilities
IPR[i].ResPres Contains the current Reservoir Pressure of the layer
considered
IPR[i].ResTemp Contains the Reservoir Temperature of the layer considered
IPR[i].Tank Enables to determine the tank connected to the layer
considered.
Example:
DoGet(“GAP.MOD[0].Well[{Well 1}].IPR[0].Tank”)
The command will return a 8 number digit which is an internal
index for the node considered.
If a .Label is added at the end of the string
GAP.MOD[0].Well[{Well 1}].IPR[0].Tank.Label
it will return the label of the tank considered
IPR[i].TCURPROD Contains the current reservoir cumulative production when
using a decline curve MBAL model
IPR[i].TCURGASPROD Contains the current reservoir cumulative gas production
when using a decline curve MBAL model
IPR[i].UNMASK() Used together with a DoCmd structure, will unmask the ith
layer of the well
IPR[i].UseOffsetPressure Contains the status of the use offset pressure option.
The following numerical indexes are used:
0 = The offset IPR pressure option is not activated.
1 = The offset IPR pressure option is activated

OpenServer User's Manual


GAP and OpenServer 70

IPR[i].UseTankImpurities Relates to the impurities dataset (i.e. Mole percentages of


H2S, CO2, H2S and water salinity) considered.
The following numerical indexes are used:
0 = The impurities dataset used is the one defined in
the IPR section
1 = The impurities dataset used is the one defined in
the tank PVT
IPR[i].VogelCorrection Contains the status of the Vogel Correction for GOR option.
The following numerical indexes are used:
0 = The Vogel correction option is activated
1 = The Vogel correction option is not activated
IPR[i].WaterCut Contains the current water cut of the layer considered
IPR[i].WaterSalinity Contains the water salinity of the layer considered
IPR[i].WGR Contains the WGR of the layer fluid
IPR[i].XFLOWIIPI Contains the layer crossflow injectivity index

VLP Section
AllowLeftVLPIPRIntersect Contains the status of the the type of VLP intersection.
ion The following indexes are used:
0 = Left Hand side VLP/IPR intersection is not
considered
1 = Left Hand side VLP/IPR intersection is considered
ForceVLPIPRIntersection Contains the status of the the type of intersection
considered.
The following indexes are used:
0 = Left Hand side VLP/IPR intersection is not
considered
1 = Left Hand side VLP/IPR intersection is forced
SafeVLPIPRIntersection Contains the status of the the type of intersection
considered.
The following indexes are used:
0 = The safe VLP/IPR intersection routine is not
activated
1 = The safe VLP/IPR intersection routine is activated
TurnOffIfUnstable Contains the status of the the type of intersection
considered.
The following indexes are used:
0 = The Turn off well if unstable VLP/IPR intersection
routine is not activated
1 = The Turn off well if unstable VLP/IPR intersection
routine is activated adn the well will be switched off if a
negative VLP slope is detected intersecting the IPR
VLPFile Contains the name and path of the VLP file used to describe
the outflow performance of the well

© 1990-2018 Petroleum Experts Limited


71 OpenServer

Coning Section
CMNUMPOINTS Contains the number of coning match points considered
CVALID Contains the status of the coning input data set.
The following numerical indexes are used:
0 = The dataset required for coning calculation is not
valid
1 = The dataset required for coning calculation is valid
IPR[i].TConeData.Anisotr Contains the reservoir vertical anisotropy value
opy
IPR[i].TConeData.EXP Contains the value of the coning model exponent
IPR[i].TConeData.F2 Contains the value of the coning model F2 parameter
IPR[i].TConeData.F3 Contains the value of the coning model F3 parameter
IPR[i].TConeData.GOC Contains the depth of the tank GOC
IPR[i].TConeData.Match Contains the Liquid Rates corresponding to the ith test
QL[i] measurement used in the coning calculation
IPR[i].TConeData.Match Contains the GOR corresponding to the ith test
GOR[i] measurement used in the coning calculation
IPR[i].TConeData.TestG Contains the depth of the GOC at the test prevailing date
OC
IPR[i].TConeData.TestPr Contains the reservoir pressure at the test prevailing date
es
IPR[i].TConeData.TestW Contains the water cut at the test prevailing date
C
IPR[i].TConeData.Perme Contains the reservoir permeability value
ability
TConeData.LayerEnable Contains the status of the coning calculation in the layer
d considered.
The following numerical indexes are used:
0 = The coning calculation is not activated
1 = The coning calculation is activated

Example:
To access the file name of the VLP File associated with a well labelled w1, one could
use the string “GAP.MOD[0].WELL[{w1}].VLPFILE”, or, equivalently,
“GAP.MOD[0].EQUIP[{w1}].VLPFILE”.

4.1.9.4.3 Fields specific to wells modeled using Performance Curves / Interpolated


Performance Curves
Variable Name Description

Well Summary Section

OpenServer User's Manual


GAP and OpenServer 72

GenType Refers to the origin of the PC considered.


The following numerical indexes are used:
0 = The PC are generated from PROSPER
1 = The PC are generated from a VLP / IPR model

From PROSPER
PC Data Section
IType Refers to the parameter used to describe the amount of gas
considered for each PC dataset.
The following numerical indexes are used:
0 = Gas Lift Gas Injection Rate
1 = Gas Liquid Ratio
MANIPRES[i] Contains the manifold pressure at which the ith set of PC data refers
to.
PCDATA[i][j][k] Contains the different parameters of the PC dataset.
The first index [i] refers to the dataset row and is only valid if more than
one dataset has been entered at one specific manifold pressure, as it
can be the case with gas lifted wells for instance.

The second index [j] refers to the parameter considered. The following
numerical indexes are used:
0 = Either Oil Rate or Liquid Rate depending of the PC Type
choice.
1 = Water Cut
2 = GOR
3 = Flowing Bottom Hole Pressure
4 = Oil Gravity or Condensate Gravity
5 = Gas Gravity
6 = Gas Lift Gas Injected or Gas Liquid Ratio depending of the
IType choice
7 = Temperature
8 = H2S mol. percentage
9 = CO2 mol. percentage
10 = N2 mol. percentage
11 = Gas Rate
12 = Water to Gas Ratio
13 = Water Salinity
14 = Condensate to Gas Ratio

The third index [k] refers to the dataset considered. Up to 5 PC


datasets taken at 5 different manifold pressures can be entered for
naturally flowing wells and 3 for gas lifted wells.
PType Refers to the type of rate considered when describing an oil producer
PC data:
The following numerical indexes are used:
0 = Liquid Rates

© 1990-2018 Petroleum Experts Limited


73 OpenServer

1 = Oil Rates

From VLP/IPR
Coning Section
Similar to the VLP/IPR Well model

IPR Section
Similar to the VLP/IPR Well model

PC Data Section
Similar to the From PROSPER PC Well model

VLP Section
Similar to the VLP/IPR Well model

4.1.9.4.4 Fields specific to Stand-Alone Inflows

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].INFLOW[j]

Where the index i refers to the type of model i.e., refers to the Variables at MOD level,
MOD[i] section) and the index j refers to the name or numerical index of the element.

Variable Name Description

Well Summary Section


Inflow Model Refers to the type of inflow model used.
The following numerical indexes are used:
0 = GAP Internal Model
IsInjector Refers to the type of inflow considered: Injector
IsProducer Refers to the type of inflow considered: Producer

Coning Section
Similar to the VLP/IPR Well model

Downtime Section
Similar to the VLP/IPR Well model

IPR Section
Similar to the VLP/IPR Well model
RateType Sets the rate type of the inflow model used.

OpenServer User's Manual


GAP and OpenServer 74

The following numerical indexes are used:


0 = Use Volumes
1 = Use Mass

4.1.9.4.5 Fields specific to Stand-Alone Outflows

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].WELL[j]

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section) and the index j refers to the name or numerical index of the
well considered.

Variable Name Description

Outflow VLP Model


Well Summary Section
Similar to the VLP/IPR Well model

VLP Section
Similar to the VLP/IPR Well model

Outflow PROSPER Model


PROSPER Data Section
See PROSPER_Online_Models
RateType Sets the rate type of well model used.
The following numerical indexes are used:
0 = Use Volumes
1 = Use Mass

4.1.9.4.6 Fields specific to transient well models


All the following variables will need to be preceded by the following OpenServer string
structure (unless it is stated that the section is similar to the VLP/IPR model):

GAP.MOD[i].WELL[j].TransientDesc

Where the index i refers to the type of model considered at the MOD level i.e., MOD[i]
section and the index j refers to the name or numerical index of the well considered.

Variable Name Description

© 1990-2018 Petroleum Experts Limited


75 OpenServer

Well Summary Section


Similar to VLP/IPR model

IPR Section
Similar to VLP/IPR model

VLP Section
Similar to VLP/IPR model

Coning Section
Similar to VLP/IPR model

Constraints Section
Similar to VLP/IPR model

Downtime Section
Similar to VLP/IPR model

Coning Section
Similar to VLP/IPR model

Schedule Section
Similar to VLP/IPR model

Description Section
Desc[i].Type Contains the pipe section j type code.
The following codes are used:
0 - Choke
1 - Coated
2 - Fitting
3 - Flexible
4 - Pipe
5 - TransientFitting
Desc[i].Length Contains the length of segment i
Desc[i].TVD Contains the TVD/elevation change of segment i
Desc[i].ID Contains the tubing ID of segment i
Desc[i].Roughness Contains the roughness of segment i
Desc[i].MaxStepLength Contains the max step length of segment i (when specifying
this per segment)
Desc[i].Tubing Contains the tubing OD of segment i
Desc[i].CasingID Contains the casing ID of segment i

OpenServer User's Manual


GAP and OpenServer 76

PipeRateMult Contains the rate multiplier


STEPCH Contains the calculation step length (when specifying for the
whole well)
FlowType Contains the description of the flowing conduit
0 - Tubing
1 - Annular
PIPECORR Contains the flow correlation/model
Matching.AVALS[i][0] Contains the gravity match parameter of correlation/model i
Matching.AVALS[i][1] Contains the friction match parameter of correlation/model i

Environment Section
TMPSUR Contains the temperature of the surroundings
HTCSUR Contains the heat transfer coefficient of the surroundings
CPO Contains the specific heat capacity of oil
CPG Contains the specific heat capacity of gas
CPW Contains the specific heat capacity of water

Simulation Section
TransientSim.Initialisation Contains the initialisation method of the transient simulation
Method 0 - ReservoirFluid
1 - Static
2 - Steady State
3 - UserSpecified
TransientSim.BoundaryC Contains the calculated boundary condition
alculated 0 - UPSTREAM
1 - DOWNSTREAM
TransientSim.UpstreamP Contains the pressure of the upstream boundary
ressure
TransientSim.Downstrea Contains the pressure of the downstream boundary
mPressure
TransientSim.UpstreamFl Contains the specified upstream fluid
uid
TransientSim.Downstrea Contains the specified downstream fluid
mFluid
TransientSim.LiquidLevel Contains the liquid level
4.1.9.4.7 Equipment Control Section
(i.e. Previously Actual and Production Validation sections)

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].WELL[j]

© 1990-2018 Petroleum Experts Limited


77 OpenServer

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section) and the index j refers to the name or numerical index of the
well considered.

Variable Name Description

Equipment Control Section


DPControlMeasured Contains the measured value (i.e. test value) of the well control
parameter (i.e. pressure drop through the wellhead choke or gas
lift gas injection rate for instance).
DPControlValue Contains the current value (i.e. used by the solver during non-
optimised runs) of the well control parameter (i.e. pressure drop
through the wellhead choke or gas lift gas injection rate for
instance).
DPControlOptimised Contains the value of the well control parameter (i.e. pressure
drop through the wellhead choke or gas lift gas injection rate for
instance) obtained after an optimised run.

Model Validation Section


EstimatedCGR Contains the estimated CGR.
EstimatedFBHP Contains the estimated flowing bottom hole pressure.
EstimatedGOR Contains the estimated GOR.
Depending on the type of well considered this keyword will refer
to:
- Total GOR (For oil wells)
- Separator GOR (For retrograde condensate wells)
EstimatedLiqRate Contains the estimated rate.
Depending on the type of well considered and the type of rate
selected, this keyword will refer to:
- Oil Rate (For oil wells)
- Liquid Rate (For oil wells)
- Water Rate (For water wells)
- Gas Rate (For gas and retrograde condensate wells)
EstimatedWC Contains the estimated WC.
EstimatedWGR Contains the estimated WGR.
IPRPresOffset Contains the IPR pressure offset (i.e. IPR pressure shift) used in
the well considered.
LiqRateError Contains the difference between estimated and measured rate.
The rate it is described in the EstimatedLiqRate keyword.
MeasuredAlq Contains the artificial lift associated variable value.
Depending on the type of well considered this keyword will refer
to:
- ESP Frequency (For ESP lifted wells)

OpenServer User's Manual


GAP and OpenServer 78

- Gas Lift Gas Injection Rate (For gas lifted wells)


- Power Fluid Rate (For HSP / Jet Pump lifted wells)
- Diluent Injection Rate (For Diluent Injected wells)
- Motor RPM (For PCP lifted wells).
MeasuredCGR Contains the measured CGR.
MeasuredGOR Contains the measured GOR.
The variable it refers to is described in the EstimatedGOR
keyword.
MeasuredPres Contains the measured manifold pressure.
MeasuredRate Contains the measured rate.
The rate it refers is described in the EstimatedLiqRate keyword.
MeasuredResP Contains the measured reservoir pressure.
MeasuredWC Contains the measured water cut.
MeasuredWGR Contains the measured WGR.
4.1.9.4.8 PROSPER Online Well Models

When using the PROSPER Online option for wells in GAP, the PROSPER variables
available through OpenServer within PROSPER will also be available from GAP.

The strings used for these variables are similar to the strings used within PROSPER,
replacing the PROSPER prefix by a GAP.MOD[i].WELL[j].PrpData prefix.

The general string structure for accessing PROSPER Online variables through GAP
OpenServer will therefore be the following:

GAP.MOD[i].WELL[j].PrpData.k

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the well
considered (i.e. refers to the Model Equipement List) and the index k refers to the
PROSPER OpenServer string associated with the parameter considered.

Example:
To access the solution GOR input within the PROSPER Online section of a well labeled
Well1, the following string can be used:

GAP.MOD[0].WELL[{Well1}].PrpData.PVT.Input.Solgor

As described previously, this string is exactly similar to the one that is used to refer to
the solution GOR in a PROSPER model i.e., PROSPER.PVT.Input.Solgor, except that the
PROSPER prefix has been replaced by the GAP prefix.

NOTE:
Please note that GAP.MOD[i].EQUIP[j].PrpData prefix is used to read/write the data for

© 1990-2018 Petroleum Experts Limited


79 OpenServer

PROSPER Online models. It is not possible to carry out the calculations with this
command.

4.1.9.4.9 Relative Permeabilities for Wells and Inflows

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].WELL[j].IPR[k]

Where the index i refers to the type of model considered at the MOD level i.e., MOD[i]
section and the index j refers to the name or numerical index of the well considered.

The following codes may be used to get the information about the Relative Permeability
Curves for Fractional Flow information when the option is set to USE REL PERM 1 or
USE REL PERM 2.

i = 1:2 the value of i in the below mentioned strings varies


from 1 to 2. i = 1 denotes the data for REL PERM 1
and i=2 denotes the data for REL PERM 2.
FRACFLOWi.RESSAT.Krw Residual Saturation for water
FRACFLOWi.ENDPOINT.Krw End Point Relative Permeability for Water
FRACFLOWi.EXPON.Krw Corey Exponent for Water
FRACFLOWi.RESSAT.Kro Residual Saturation for Oil
FRACFLOWi.ENDPOINT.Kro End Point Relative Permeability for Oil
FRACFLOWi.EXPON.Kro Corey Exponent for Oil
FRACFLOWi.RESSAT.Krg Residual Saturation for Gas
FRACFLOWi.ENDPOINT.Krg End Point Relative Permeability for Gas
FRACFLOWi.EXPON.Krg Corey Exponent for Gas

Example:
The following code may be used to extract the Residual Saturation of Water for USE
REL PERM 1 option that is defined for IPR Layer 0 for Well W1 to cell (10,2)

Cells(10, 2) =
DoGet("GAP.MOD[{PROD}].WELL[{W1}].IPR[0].FRACFLOW1.RESSAT.Krw")

The following codes may be used to get the information about the Relative Permeability
Curves for Fractional Flow information when the option is set to FROM TABLE 1 or
FROM TABLE 2.

i = 1:2 the value of i in the below mentioned strings varies

OpenServer User's Manual


GAP and OpenServer 80

from 1 to 2. i = 1 denotes the data for TABLE 1


and i=2 denotes the data for TABLE 2.
j = 0:99 the value of j in the below mentioned strings varies
from 0 to 99 to represent the data point number
FRACFLOWi.FFTABLE[j].TIME Time
FRACFLOWi.FFTABLE[j].WATCU Water Cut
T
FRACFLOWi.FFTABLE[j].GOR GOR
FRACFLOWi.FFTABLE[j].PRESS Pressure
FRACFLOWi.FFTABLE[j].CUMOI Cumulative Production
L

Example:
The following code may be used to extract the Water Cut for data point number 1 set in
TABLE 1 option that is defined for IPR Layer 0 for Well W1 to cell (10,3)

Cells(10, 3) =
Doget("GAP.MOD[{PROD}].WELL[{Well1}].IPR[0].FRACFLOW1.FFTABLE[0].W
ATCUT")
4.1.9.5 Fields specific to pipelines
All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].PIPE[j]

Where the index i refers to the type of model considered such as production, injection,
etc., and the index j refers to the name or numerical index of the element considered.

4.1.9.5.1 Pipeline Model Selection


Variable Name Description
PipeModel Refers to the type of pipeline model used.
Determined using the following values:
0 = GAP Internal Correlations
1 = Lift Curves
2 = PROSPER online

4.1.9.5.2 GAP Internal Correlation Pipeline Models

Variable Name Description

© 1990-2018 Petroleum Experts Limited


81 OpenServer

Pipeline Environment Description


CPG Contains the pipe Gas Heat capacity.
CPO Contains the pipe Oil Heat capacity.
CPW Contains the pipe Water Heat capacity.
HTCSUR Contains the pipe Overall Heat Transfer Coefficient.
TMPSUR Contains the Surface Temperature.

Pipeline Data Description


Desc[j].Type[j] Contains the pipe section j type code.
The following codes are used:
1 = Line Pipe
2 = Choke
3 = Coated
4 = Flexible
5 = Fitting
6 = User
Desc[j].DEPTH[j] Contains the pipe section j depth (Enthalpy balance only).
Desc[j].ID[j] Contains the pipe section j ID.
Desc[j].INSUL[j] Contains the pipe section j insulation type code (Enthalpy
balance only).
Desc[j].KValue Contains the K value associated to the pipe section (User
pipe Type only)
Desc[j].LENGTH[j] Contains the pipe section j length.
Desc[j].OD[j] Contains the pipe section j OD (Enthalpy balance only).
Desc[j].Roughness[j] Contains the pipe section j roughness.
Desc[j].Thickness[j] Contains the pipe section j thickness (Enthalpy balance only).
Desc[j].TVD[j] Contains the pipe section j True Vertical Depth.
Desc.RESET, 1 Removes all the data from pipeline description table. The
string is used under the DoSet() statement.
Example:
DoSet
”GAP.MOD[{PROD}].Pipe[{pipe01}].Desc.Reset”, 1
PipeDescInputFormat Defines the format of the pipeline depth.
The following codes are used:
0 = TVD
1 = Elevation Change
Example:
DoSet ”GAP.MOD[{PROD}].PipeDescInputFormat”, 0
NOTE: The command changes pipeline description for ALL
pipelines in the network.
The 'Elevation Change' option is implemented for reporting
purposes and pipeline depth in GAP file is stored in TVD

OpenServer User's Manual


GAP and OpenServer 82

format. Hence, the values input into pipeline description table


through OpenServer code should always be in TVD format.
EmptyPipe Enables to determine the pipeline status.
The following values can be returned:
0 = The pipe is a pipe linking two joints and having
pipeline data associated
1 = The pipe is empty (i.e. either it is linking a joint and
an element and is therefore a pseudo-pipe, either it is
linking two joints but has no corresponding pipeline
data entered).
ENDA Enables to determine the node connected to the inlet end of
the pipe.
Example:
DoGet(“GAP.MOD[0].Pipe[1].ENDA”)
The command will return a 8 number digit which is an internal
index for the node considered. If a .Label is added at the end
of the string
GAP.MOD[0].Pipe[1].ENDA.Label
it will return the label of the considered node.
ENDB Enables to determine the node connected to the outlet end of
the pipe.
PIPERATEMULT Contains the pipeline rate multiplier value.
PIPESTEPCH Contains the 'Maximum Step Length' used by the
correlations.
PseudoPipe Enables to determine the pipeline status.
The following values can be returned:
0 = The pipe is a normal pipe (i.e. it is linking two joints)
1 = The pipe is a pseudopipe (i.e. it is linking a joint
and an element such as a well for instance, and has no
data associated)

Correlations and Matching Procedure


PIPECORR * Contains the type of flow correlation used for pressure drop
calculations in the pipeline
PIPE.Matching.AVALS[i] Contains the matching parameters related to the correlation
[j] selected.
The first index refers to the flow correlation selected (i.e. 1 will
indicate that the matching parameters returned corresponds
to the Beggs and Brill flow correlation).
The second index refers to the matching parameters itself:
0 = The matching parameter considered is the gravity
multiplier for the selected correlation.
1 = The matching parameter considered is the friction
multiplier for the selected correlation.
2 = Standard Deviation.

© 1990-2018 Petroleum Experts Limited


83 OpenServer

Pipe.Matching.DATA[i]. Contains the status of a specific set of measured data used


Disabled to match the flow correlation.
The index relates to the set of data considered.
The following values can be returned:
0 = The dataset considered is enabled
1 = The dataset considered is disabled
Pipe.Matching.DATA[i].v Contains the value of the pipe measured data used to match
ar the flow correlation.
The index relates to the set of data selected. Up to 10 sets of
measured data can be entered for the same pipeline section.
The ‘var’ section relates to the variable to consider. The
following variable names are used when proceeding to a
pipeline matching calculation:
InPres = Upstream pressure
OutPres = Downstream pressure
InTemp = Upstream temperature
Qliq = Liquid rate
Qoil = Oil rate
Qgas = Gas rate (gas and condensate systems only)
Qginj = Gas lift gas injection rate
WCT = Water Cut
GOR = Gas Oil Ratio
OilGravity = Oil gravity
GasGravity = Gas gravity
CGR = Condensate to Gas ratio (gas and condensate
systems only)
WGR = Water to Gas ratio (gas and condensate
systems only)
RateType Contains the type of rate used to input the measured data.
The following numerical indexes are used:
0 = Liquid Rate
1 = Oil Rate
SubType Contains the type of pipeline used for matching purposes.
The following numerical indexes are used:
0 = Oil
1 = Oil + Gas Lift Gas
3 = Dry Gas
4 = Retrograde Condensate
5 = Water
FlowType Flow Type:
ANNULAR
TUBING

Pipeline Constraints Setup


MAXCFACTOR Contains the maximum C factor constraint applied on the

OpenServer User's Manual


GAP and OpenServer 84

pipe.
MAXPRESSURE Contains the maximum pressure constraint applied on the
pipe.
MAXVELOCITY Contains the maximum velocity constraint applied on the
pipe.

4.1.9.5.3 GAP Lift Curves Pipeline Models

GAP Description
UnderModel Contains the sub-model used when using the GAP Lift
curve modelling facilities for pipelines.
The different sub-models are described using the following
numerical indexes:
0 = External
1 = GAP Internal Correlations
2 = PROSPER Online
3 = PROSPER file

External Model
Lift Curves
VLPFile Contains the name and path of the file used to describe
the pipeline lift performance curves.

Pipeline Constraints Setup


Similar to the GAP internal correlations pipeline model.

GAP Internal Correlations


Lift Curves
VLPFile Contains the name and path of the file used to describe
the pipeline lift performance curves.
GenData.SensVarValue[i] Refers to the sensitivity variables used in order to generate
[j] the pipeline lift curves.
The first index refers to the parameter considered.
The following numerical indexes are used:
0 = Liquid Rate
1 = Upstream Pressure
2 = GOR (oil systems) or CGR (gas systems)
3 = Water Cut (oil systems) or WGR (gas systems)
4 = Inj.GLR (gas lifted systems)
The second index refers to the row number of the
sensitivity variables considered. Up to 20 values can be
used for the rates, up to 10 for the other parameters.

© 1990-2018 Petroleum Experts Limited


85 OpenServer

GenData.Temp Contains the fluid temperature in the pipe section


considered.
GenData.OilGravity Contains the oil gravity in the pipe section considered.
GenData.GasGravity Contains the gas gravity in the pipe section considered.
GenData.WaterSalinity Contains the water salinity in the pipe section considered.
GenData.PctH2S Contains the fluid H2S mole percentage in the pipe
section considered.
GenData.PctCO2 Contains the fluid CO2 mole percentage in the pipe
section considered.
GenData.PctN2 Contains the fluid N2 mole percentage in the pipe section
considered.

Pipeline Environment Description


Pipeline Data Description
Correlations and Matching Procedure
Pipeline Constraints Setup
Similar to the GAP internal correlations pipeline model.

PROSPER Online
Lift Curves
Similar to the GAP 'Lift Curves' / 'Externa'l model.

PROSPER Data
Refer to PROSPER Online Section

Pipeline Constraints Setup


Similar to the GAP 'Internal Correlations' model.

PROSPER File
PROSPER File
File Contains the name and path of the PROSPER file used to
describe the pipeline section.

Lift Curves
Similar to the GAP 'Lift Curves' / GAP 'Internal
Correlations' model

Pipeline Constraints Setup


Similar to the GAP 'Internal Correlations' model.

OpenServer User's Manual


GAP and OpenServer 86

4.1.9.5.4 PROSPER Online Pipeline Models

When using the PROSPER Online option for pipelines in GAP, the PROSPER variables
available through OpenServer within PROSPER will also be available from GAP.

The strings used for these variables are similar to the strings used within PROSPER,
replacing the PROSPER prefix by a GAP.MOD[i].PIPE[j] prefix.

The general string structure for accessing PROSPER Online variables through GAP
OpenServer will therefore be the following:

GAP.MOD[i].PIPE[j].k

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the
pipeline considered (i.e. refers to the 'Model Equipement' list) and the index k refers to
the PROSPER OpenServer string associated with the parameter considered.

Example:
To access the overall heat transfer coefficient of a pipeline modeled with GAP Internal
Correlations with labelled 'p1' the following string can be used

GAP.MOD[{PROD}].PIPE[{p1}].SIN.EQP.Surf.Htc

This string is similar to the one for wells setups as PROSPER Online, the only difference
is the 'no PrpData' prefix is required

NOTE:
Again the access strings with GAP.MOD[i].PIPE[j] prefix is used to read/write the data
for PROSPER Online pipeline models. It is not possible to carry out the calculations with
this command.
4.1.9.5.5 Transient Pipeline

Simulation Section
TransientSim.Initialisation Contains the initialisation method of the transient simulation
Method 0 - ReservoirFluid
1 - Static
2 - Steady State
3 - UserSpecified
TransientSim.BoundaryC Contains the calculated boundary condition
alculated 0 - UPSTREAM
1 - DOWNSTREAM
TransientSim.UpstreamP Contains the pressure of the upstream boundary

© 1990-2018 Petroleum Experts Limited


87 OpenServer

ressure
TransientSim.Downstrea Contains the pressure of the downstream boundary
mPressure
TransientSim.UpstreamFl Contains the specified upstream fluid
uid
TransientSim.Downstrea Contains the specified downstream fluid
mFluid
TransientSim.LiquidLevel Contains the liquid level
4.1.9.6 Fields specific to joints

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].JOINT [j]

Where the index i refers to the type of model considered at the MOD level i.e., MOD[i]
and the index j refers to the name or numerical index of the element considered i.e.,
EQUIP[i] section.

Variable Name Description


MAXPCO2 Contains the maximum mole percentage of CO2 constraint applied
on the joint.
MAXPH2S Contains the maximum mole percentage of H2S constraint applied
on the joint.
MAXPN2 Contains the maximum mole percentage of N2 constraint applied on
the joint.
MAXQGAS Contains the maximum gas rate constraint applied on the joint.
MAXQLIQ Contains the maximum liquid rate constraint applied on the joint.
MAXQOIL Contains the maximum oil rate constraint applied on the joint.
MAXQWAT Contains the maximum water rate constraint applied on the joint.
MAXSOG Contains the maximum oil specific gravity constraint applied on the
joint.
MINQGAS Contains the minimum gas rate constraint applied on the joint.
MINQLIQ Contains the minimum liquid rate constraint applied on the joint.
ABMAXPWF Contains the maximum flowing pressure constraint applied on the
node.

Example:
To access the maximum gas rate constraint applied on the node N1, one could use the
string

GAP.MOD[0].JOINT[{N1}].MAXQGAS.

OpenServer User's Manual


GAP and OpenServer 88

4.1.9.7 Fields specific to pump/compressor nodes


All the following variables will need to be preceded by the following OpenServer string
structure depending on what type of equipment is being considered:

GAP.MOD[i].PUMP[j] for a pump


GAP.MOD[i].COMP[j] for a compressor

Where the index i refers to the type of model considered at the MOD level i.e., MOD[i]
section and the index j refers to the name or numerical index of the element
considered i.e., EQUIP[i] section.

4.1.9.7.1 Fields Common to Pumps and Compressors

Variable Name Description


ACTSPEED Contains the Actual speed (or frequency) of the pump/compressor
for use with affinity laws or if speed/frequency is a sensitivity
variable.
CalcData[i][j] Enables to specify the data used to calculate the pump /
compressor performance using the Input | Calculate Performance
screen.
The i index enables to specify which row is selected, the j index
enables to specify which column is selected.
See the MDRateType variable below to know how to specify the
data entry format.
DESSPEED Contains the Design speed (or frequency) of the pump/compressor
for use with affinity laws or if speed/frequency is a sensitivity
variable.
DPControl * Refers to the type pressure control used to drive the pump/
compressor.
The following status are available:
FIXED VALUE = the pressure drop through the pump/
compressor is fixed by the user.
CALCULATED = the pressure drop through the pump/
compressor can be modified by the GAP optimiser to obtain
the optimum performance of the system.
MAXSPEED Contains the pump/compressor maximum speed limit.
MDRateType Enables to specify in which format the data for the Input | Calculate
Performance screen is specified.
The following options are available:
0 = Liquid Rate, WCT, GOR
1 = Oil Rate, WCT, GOR

© 1990-2018 Petroleum Experts Limited


89 OpenServer

2 = Gas Rate, WGR, CGR


3 = Oil, Water and Gas rates
4 = Water rate
MINSPEED Contains the pump/compressor minimum speed limit.
NumStage Contains the number of stages considered for the pump/
compressor.
OPTSPEED Returns the pump/compressor optimum calculated speed.
StageData[i].Use Contains the status of the internal separation for the pump/
Sep compressor.
The index refers to the stage considered:
0 = Before compression process
1 = After compression process
The following indexes are describing the separation status:
0 = No Internal Separation
1 = Existing Internal Separation capacity
StageData[i].Sep Contains the fraction of fluid removed by the internal separation
Data[j] process if any.
The index refers to the stage considered:
0 = Before compression process
1 = After compression process
The following indexes are describing the fluid phases considered:
0 = Percentage of Water removed.
1 = Percentage of Oil removed.
2 = Percentage of Gas removed.
UseAff Contains the use affinity laws facility status.
The following numerical indexes are used:
0 = Do not use affinity laws.
1 = Use affinity laws to scale the element performance for
speed/frequency.
INJTEMP Contains the injection (inlet) temperature - only for injection systems.

4.1.9.7.2 Fields Specific to Compressors

Variable Name Description


SubType * Refers to the type of compressor model used.
The three types of compressor models available are:
PerfCurve = Performance Curve Model
FixedPower = Fixed Power Model
FixedDp = Fixed Pressure Drop Model
Reciprocating
ACTSPEED Contains the Actual speed (or frequency) of the pump/
compressor for use with affinity laws or if speed/frequency is a
sensitivity variable.

OpenServer User's Manual


GAP and OpenServer 90

DELTAP Contains the value of the pressure drop across the compressor
(Fixed Pressure Drop Model).
PEff Contains the compressor overall efficiency (Fixed Power
Model).
PolyEff Contains the compressor polytropic efficiency.
PPower Contains the value of the horsepower by stage developed by the
compressor (Fixed Power Model).
StageData[i].UseCoo Refers to the status of the cooling process for the compressor.
l The index refers to the stage considered:
0 = Before compression process
1 = After compression process
The following indexes are describing the separation status:
0 = No Cooling
1 = A Cooling process exists
StageData[i].CoolDat Contains the description of the cooling process if any.
a[j] The index refers to the stage considered:
0 = Before compression process
1 = After compression process
The following indexes are describing the fluid phases
considered:
0 = Cooler Temperature.
1 = Cooler Efficiency.
UsePoly Contains the use polytropic head facility status.
The following numerical indexes are used:
0 = Do not use the polytropic head facility. Assumes the
head in the performance data used is based on an
isentropic cycle.
1 = Do use the polytropic head facility. Assumes the head
in the performance data used is based on a polytropic
cycle.

Example:
To access the design speed of a node with label c1, one could use the string

GAP.MOD[0].COMP[{c1}].DESSPEED.

4.1.9.8 Fields specific to separator / injection manifold nodes

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].SEP[j]

Where the index i refers to the type of model considered (i.e. refers to the Variables at

© 1990-2018 Petroleum Experts Limited


91 OpenServer

MOD level, MOD[i] section) and the index j refers to the name or numerical index of the
element considered (i.e. refers to the Model Equipement List, EQUIP[i] section).

Variable Description
Name
SubType * Contains the type of separation node considered:
The following keywords are used:
GASINJMAN = Gas Injection Manifold
PRODSEP = Production Separator
WATINJMAN = Water Injection Manifold
InjFluidLabel Contains the fluid label that refers to the type of fluid used for injection
purposes. The properties of these fluids can be found under the
FluidListSection string.
SolverPres[j] Contains an array of pressures to be used in allocation calculations. Up
to 10 pressure values can be entered.
If the system is gaslifted, only one pressure value can be assigned to the
separator, and therefore only [0] is used.
Temperature Contains the temperature of the injected fluid.

Example:
To set the manifold pressure used for the Solve Network calculation to 200 psig for
instance, the following command will be used:

DoSet(“GAP.MOD[0].SEP[{Sep1}].SolverPres[0]”), 200

4.1.10 Composition Records


4.1.10.1Compositional Model Setup
The type of compositional model and associated calculations can be setup in the
Options / System Options / Method section.
The COMPMODE string can be used directly at the MOD level to setup directly these
options via OpenServer.

When either the Compositional Tracking, Fully Compositional or Black Oil Lumping
Delumping Calculation options are selected, the EOS model used in GAP needs to be
setup, as well as emulsion models if needed (see Model_Options).

4.1.10.2Fluid Composition Setup - Wells

The fluid composition will be defined in the wells using a composition table including up
to 30 components and their characteristics.
The following strings can be used at the IPR level to define the fluid composition for each
well and eventually each layer in multilayer wells.

OpenServer User's Manual


GAP and OpenServer 92

Defining the composition will follow a similar procedure should the model use
Compositional Tracking, Fully Compositional or Black Oil Lumping Delumping
Calculation.

All the following variables will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].WELL[j].IPR[k].Composition

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the well
considered (i.e. refers to the Model Equipement List, EQUIP[i] section) and the index k
refers to the layer considered in case of multilayer wells.

In case the composition considered does not refer to a well fluid composition but to a
specific fluid from the GAP fluid list, the OpenServer strings associated to this fluid list
are defined in the section 3.2.6.1, the following string will then been used:

GAP.MOD[i].FluidList[j].Composition

Variable Description
Name
In every variable described below, the indes [i] refers to the row of
the composition table considered. Each component described in
the fluid composition table will have a specific table row assigned
using the NAME string described below.
BICOEFF[i][j] Refers to the binary interaction coefficients used.
The first index refers to the composition table row index of the first
component considered.
The second index refers to the composition table row index of the
second component considered.
MOLEPCT[i] Array [30] of mole percentages.
MW[i] Array [30] of molecular weights.
NAME[i] Array [30] of component names.
Valid values for this variable could be for instance:
- N2
- CO2
- NC4
- PS-1 ; PS-2 ; PS-3 for the pseudo-components considered.
NUMCOMP Contains the total number of components used to describe the fluid
composition in the well layer considered.
OMEGA[i] Array [30] of accentric factors (i.e. Ù factors).
OMEGAA[i] Array [30] of Omega A factors.
OMEGAB[i] Array [30] of Omega B factors.
PARACHOR[i] Array [30] of parachors.

© 1990-2018 Petroleum Experts Limited


93 OpenServer

PCRIT[i] Array [30] of critical pressures.


SPGRAV[i] Array [30] of specific gravities.
TBOIL[i] Array [30] of boiling points.
TCRIT[i] Array [30] of critical temperatures.
VCRIT[i] Array [30] of critical volume.
VSHFT[i] Array [30] of volume shifts.

Example:
To access the mole percentage of the first component of the input composition for the
first layer of a well labeled w1, the string would be

GAP.MOD[0].WELL[{w1}].IPR[0].Composition.MOLEPCT[0].

4.1.10.3Fluid Composition Results


Whether the compositional tracking, fully compositional or black oil lumping delumping
calculation option is chosen, the fluid composition will be defined in every system node
using a composition table similar to the one used to define the fluid composition and
described previously.

The strings used to obtain these results are similar to the one described above, at the
exception that the type of calculation considered should be specified in the OpenServer
string as described below.

Obtaining Solver Composition Results


To obtain the results from the Solver Calculation, the following type of string can be
used:

GAP.MOD[i].EQUIP[j].SolverResults[k].Composition.NAME[l]

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the node
considered (i.e. refers to the Model Equipement List, EQUIP[i] section) and the index k
refers to the solver sensitivity considered.
The index l refers to the row index or the component name of the component
considered.

Obtaining Prediction Composition Results


To obtain the results from the Prediction Calculation, the following type of string can be
used:

GAP.MOD[i].EQUIP[j].PREDRES[{01/01/2000}].Composition.NAME[k]

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the node
considered (i.e. refers to the Model Equipement List, EQUIP[i] section) and the index k

OpenServer User's Manual


GAP and OpenServer 94

refers to the row index of the component considered.

Example:
To access the mole percentage of the first component of the solver result composition
for a node labeled N1, the string to use would be

GAP.MOD[0].NODE[{N1}].SolverResults[0].Composition.MOLEPCT[0].

The above string is exactly the same when using the Black Oil Lumping Delumping
compositional calculation option.
4.1.11 Enabling / Disabling Options
This section provides various OpenServer Commands for 'Enabling' or 'Disabling'
various elements in GAP.

Function Name Description


DoCmd Will disable the 'System Validation' flag
"GAP.MOD[{PROD}].SetDisableSystem (under Options tab of GAP)
Validation()"
DoCmd Will enable the 'System Validation' flag
"GAP.MOD[{PROD}].ClearDisableSyste (under Options tab of GAP)
mValidation()"
DoGet Will check whether the 'System Validation'
GAP.MOD[{PROD}].IsDisableSystemVali flag is enabled or disabled.
dation"

DoCmd Will disable the 'Automatic Masking' flag


"GAP.MOD[{PROD}].SetDisableAutomat (under Options tab of GAP)
icMasking()"
DoCmd Will enable the 'Automatic Masking' flag
"GAP.MOD[{PROD}].ClearDisableAutom (under Options tab of GAP)
aticMasking()"
DoGet Will check whether the 'Automatic Masking'
("GAP.MOD[{PROD}].IsDisableAutomati flag is enabled or disabled.
cMasking")

DoCmd Will disable the 'Label Validation' flag (under


"GAP.MOD[{PROD}].SetDisableLabelVa the 'Options' tab in GAP)
lidation()"
DoCmd Will enable the 'Label Validation' flag (under
"GAP.MOD[{PROD}].ClearDisableLabel the 'Options' tab in GAP)
Validation()"
DoGet Will check whether the 'Label Validation' flag
("GAP.MOD[{PROD}].IsDisableLabelVali is enabled or disabled.

© 1990-2018 Petroleum Experts Limited


95 OpenServer

dation")

DoCmd Will disable the PROSPER 'Well Type


"GAP.MOD[{PROD}].SetDisablePrpGap Validation' flag (under the 'Options' tab in
WellTypeValidation()" GAP)
DoCmd Will enable the PROSPER 'Well Type
"GAP.MOD[{PROD}].ClearDisablePrpGa Validation' flag (under the 'Options' tab in
pWellTypeValidation()" GAP)
DoGet Will check whether the PROSPER 'Well Type
("GAP.MOD[{PROD}].IsDisablePrpGap Validation' flag is enabled or disabled.
WellTypeValidation"

DoCmd Will disable the 'Disable Prediction Script'


"GAP.MOD[{PROD}].SetDisablePredScr flag (under the 'Predictions' tab in GAP)
ipt()"
DoCmd Will enable the 'Disable Prediction Script'
"GAP.MOD[{PROD}].ClearDisablePredS flag (under the 'Predictions' tab in GAP)
cript()"
DoGet Will check whether the 'Disable Prediction
("GAP.MOD[{PROD}].IsDisableDisableP Script' flag is enabled or disabled.
redScript")

DoCmd Will disable the 'Prediction Script' double


"GAP.MOD[{PROD}].SetEnablePredScri quotes flag (under the 'Predictions' tab in
ptDoubleQuotes()" GAP)
DoCmd Will enable the 'Prediction Script' double
"GAP.MOD[{PROD}].ClearEnablePredS quotes flag (under the 'Predictions' tab in
criptDoubleQuotes()" GAP)
DoGet Will check whether the 'Prediction Script'
("GAP.MOD[{PROD}].IsEnablePredScrip double quotes flag is enabled or disabled.
tDoubleQuotes")

4.1.12 Scheduling
The user can setup the schedule for any model element for the prediction run.

All the schedule events will need to be preceded by the following OpenServer string
structure:

GAP.MOD[i].EQUIP[j].SCHEDULE[k]

If the schedule event refers to the entire system, i.e., production network or associated
injection network for instance, the following OpenServer string structure can be used:

OpenServer User's Manual


GAP and OpenServer 96

GAP.MOD[i].SCHEDULE[k]

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the
network element considered (i.e. refers to the Model Equipement List, EQUIP[i] section)
and the index k refers to the row of the schedule event considered in the schedule event
list.

For each record in the schedule, the following fields are considered:

- Date
- Event type
- Constraint type (or OpenServer variable)
- Constraint value

4.1.12.1Schedule Count

The total number of schedule rows assigned to an element can be derived using the
following string:

GAP.MOD[i].EQUIP[j].SCHEDULE.COUNT

4.1.12.2Date
The variable string for the date in the ith model, jth equipment and kth record in the
schedule is the following:

GAP.MOD[i].EQUIP[j].SCHEDULE[k].DATE

The above string refers to the date of the scheduled event as a number, and not as a
day/month/year format date.

To refer to the date as a day/month/year format, the following string can be used:

GAP.MOD[i].EQUIP[j].SCHEDULE[k].DATE.DATESTR

4.1.12.3Event type
The variable string for the event type in the ith model and jth record in the schedule is:

GAP.MOD[i].EQUIP[j].SCHEDULE[k].TYPE

The existing types of event and their availability, depends of the type of element

© 1990-2018 Petroleum Experts Limited


97 OpenServer

considered.

A list of associated keywords are described below:

Event Type Associated Keyword


Bypass BYPASS_ON
Change constraints CONSTRAINT_CHANGE
Change Diameter CHK_SIZECHNG
Change Downtime DOWNTIME_CHANGE
Change Fixed Rate RATE_CHANGE
Fixed rate (Gas) TANK_FIXGAS
Fixed rate (Gas) - off TANK_OFF_FIXGAS
Fixed rate (Wat) TANK_FIXWAT
Fixed rate (Wat) - off TANK_OFF_FIXWAT
Gas recycling TANK_RECYCGAS_PC
Gas recycling - off TANK_OFF_RECYCGAS_PC
Gas recycling (Prd – Amount) TANK_RECYCGAS_FIX
Gas recycling (Prd – Amount) - off TANK_OFF_RECYCGAS_FIX
Mask MASK
Pressure target TANK_TARGPRES
Pressure target - off TANK_OFF_TARGPRES
Start well WELL_ON
Stop well WELL_OFF
Stop well, no X-flow WELL_OFF_NO_CROSS
Unbypass BYPASS_OFF
Unmask UNMASK
Voidage Replacement (Gas) TANK_VOIDGAS
Voidage Replacement (Gas) - off TANK_OFF_VOIDGAS
Voidage Replacement (Wat) TANK_VOIDWAT
Voidage Replacement (Wat) - off TANK_OFF_VOIDWAT
Water recycling TANK_RECYCWAT_PC
Water recycling - off TANK_OFF_RECYCWAT_PC

4.1.12.4Constraint Type

When the event type considered refers to modification of a model constraint it is also
required to define the type of constraint that needs to be modified (e.g. Maximum Liquid
Rate).

OpenServer User's Manual


GAP and OpenServer 98

The string referring to the type of constraint in the ith model and kth record in the schedule
is:

GAP.MOD[i]. EQUIP[j].SCHEDULE[k].LPAR[0]

For the list of constraints please refer to Constraint_Level_and_Type .

4.1.12.5Constraint Value
When the event type considered refers to the setup of a model parameter value or the
modification of one of the model constraints, the following string will be used:

GAP.MOD[i]. EQUIP[j].SCHEDULE[k].CVAL[0]

When retrieving a value of a scheduled element, the previous string will return both value
and the unit in which it is expressed.

Example:
To setup the maximum liquid constraint to 5000 STB/d on the 01/01/2005 in a well
labeled W1, the following set of strings will be used:

DoSet “GAP.MOD[0]. EQUIP[{W1}].SCHEDULE[0].DATE.DATESTR”,


“01/01/2005”
DoSet “GAP.MOD[0]. EQUIP[{W1}].SCHEDULE[0].LPAR[0]”, “MAXQLIQ”
DoSet “GAP.MOD[0]. EQUIP[{W1}].SCHEDULE[0].CVAL[0]”, 5000

4.1.12.6Schedule Reset
The existing GAP schedule can be reset, either at the production system level,
associated injection system level or at the element level using the following strings:

- At system level:
GAP.MOD[i].SCHEDULE.RESET

- At equipment level:
GAP.MOD[i].EQUIP[j].SCHEDULE.RESET

Both of the above string structures should be used with DoSet command.

Example:
DoSet (GAP.MOD[{PROD}].SCHEDULE.RESET”), 1

DoSet (GAP.MOD[{PROD}].EQUIP[{Separator}].SCHEDULE.RESET”), 1

© 1990-2018 Petroleum Experts Limited


99 OpenServer

4.1.12.7Apply Schedule To
The OpenServer commands to access the "Apply Schedule To" section are :

DoCmd ("GAP.APPLYSCHEDULETO({20/04/2012})")

DoCmd ("GAP.CLEARAPPLIEDSCHEDULE()")

4.1.13 Constraints
4.1.13.1Constraint Level and Type

The following listed constraints are available within GAP.

The availability of these constraints on the system element considered (such as a well,
joint, separator, etc.) will depend on the nature of the element.

The string defining the constraint type should always be preceded by a prefix describing
the system level and element on which this constraint should be applied:

MOD Level Constraints (System Constraints)


The constraint name should be preceded with the following OpenServer string
structure:

GAP.MOD[{PROD}]

Example:
To set the value of the maximum gas rate constraint applied to the system to
1000MMSCF/d, the following string could be used:

DoSet (“GAP.MOD[0].MAXQGAS”),1000

NODE Level Constraints


The constraint name should be preceded with the following OpenServer string structure

GAP.MOD[{PROD}].NODETYPE

Example: To set the value of the maximum gas rate constraint applied to the well
“WELL 1” to 100MMSCF/d, the following string could be used:

DoSet (“GAP.MOD[0].WELL[{WELL 1}].MAXQGAS”),100

Abandonment Constraints
The well abandonment constraints can be set for each well layer independently using the
following structure:

GAP.MOD[0].WELL[{WELL 1}].IPR[i].ABMAXGOR

OpenServer User's Manual


GAP and OpenServer 100

The constraint list is as follows:

Variable Name Description

Well Abandonment Constraints Type


ABMAXGOR Contains the well maximum GOR before abandonment
ABMAXWC Contains the well maximum WC before abandonment
ABMAXWGR Contains the well maximum WGR before abandonment
ABMINGAS Contains the well minimum gas rate before abandonment
ABMINLIQ Contains the well minimum liquid rate before
abandonment

General Constraints Type


AlqValueMax Contains the maximum well artificial lift parameter:
- For ESP lifted wells: refers to the ESP frequency
- For PCP lifted wells: refers to the pump speed
- For HSP lifted wells: refers to the power fluid rate
- For Jet Pump lifted wells: refers to the power fluid
rate
- For Diluent Injection wells: refers to the diluent
injection rate
AlqValueMin Contains the minimum well artificial lift parameter (see
above)

ESPFreqMax Contains the maximum ESP frequency


ESPFreqMin Contains the minimum ESP frequency
MAXCFACTOR Contains the maximum C factor (pipeline only)
MAXDRWDWN Contains the well maximum applied drawdown
MAXGINJ Contains the maximum gas injection rate
MAXGROSSHEATING Contains the maximum gross heating value
MAXPCO2 Contains the maximum mole percentage of CO2
MAXPH2S Contains the maximum mole percentage of H2S
MAXPN2 Contains the maximum mole percentage of N2
MAXPOW Contains the maximum power
MAXPOWERFLUID Contains the maximum power fluid rate, at separator or
node level only.
MAXPRESSURE Contains the line maximum pressure (pipeline only)
MAXPWF Contains the maximum flowing bottom hole pressure
MAXQGAS Contains the maximum gas rate
MAXQLIQ Contains the maximum liquid rate
MAXQOIL Contains the maximum oil rate

© 1990-2018 Petroleum Experts Limited


101 OpenServer

MAXQTOTGAS Contains the maximum total gas rate


MAXQWAT Contains the maximum water rate
MAXSOG Contains the maximum gas specific gravity
MAXSPECGROSSHEATIN Contains the maximum specific gross heating value
G
MAXVELOCITY Contains the maximum fluid velocity (pipeline only)

MINGINJ Contains the minimum gas injection rate


MINGINJNC Contains the minimum no-close gas injection rate
MINPWF Contains the minimum flowing bottom hole pressure
MINQGAS Contains the minimum gas rate
MINQLIQ Contains the minimum liquid rate

MotPowMax Contains the maximum motor power


MotPowMin Contains the minimum motor power

OPTWEIGTH Contains the well optimisation weigth


PCPSpeedMax Contains the maximum PCP speed
PCPSpeedMin Contains the minimum PCP speed
PumpRateConstraint[i][j] Contains an array of minimum and maximum pump rate
as a factor of the pump control parameter.
Valid for ESP lifted, PCP lifted, HSP lifted and Jet Pump
lifted wells only.
The following numerical indexes are used:
- i = 0:2 Defines the colum index
0 = Refers to the Pump control parameter
column. (See the AlqValueMax constraint for
pump control parameter list)
1 = Refers to the Minimum Pump Rate
Column
2 = Refers to the Maximum Pump Rate
Column
- j = 0:19 Defines the row index
SHUTINPRI Contains the well shut in priority factor

4.1.13.2Binding Constraints
Some of the constraints described above can be setup to be either binding or unbinding
constraints.

To access the binding section of each constraint, the constraint original OpenServer
string should be followed by the BINDING keyword.

OpenServer User's Manual


GAP and OpenServer 102

The following numerical indexes are used to define the status of the constraint regarding
to the binding option:
0 = the constraint is set to non-binding
1 = the constraint is set to binding

Example: To access the binding status of the well “WELL 1” maximum liquid constraint,
the following string can be used:

DoGet (“GAP.MOD[0].WELL[{WELL 1}].MAXQLIQBINDING”)

4.1.13.3Constraints and Potential Calculations


By definition, the potential calculation enables to calculate the system potential, i.e.,
calculating the system production without taking into account any imposed constraints.

However, it is possible to tune the potential status of each constraint to maintain a


binding status during the potential calculation.

To access the potential section of each constraint, the constraint original OS string
should be followed by the POTENTIAL keyword, except for the specific constraints
listed below.

The following numerical indexes are used to define the status of the constraint regarding
to the potential calculation:
0 : the constraint is not kept active during the potential calculation
1 : the constraint is kept active during the potential calculation

By default, GAP will keep the constraints that cannot physically be neglected, such as
the separator handling capacities for instance.

Example: To keep the liquid constraint of the well “WELL 1” active during the potential
calculation, the following string can be used:

DoSet (“GAP.MOD[0].WELL[{WELL 1}].MAXQLIQPOTENTIAL”),1

Variable Name Description


ABMAXPWFPOTENTIAL Contains the maximum flowing bottom hole pressure
constraint potential status
MAXGLPOTENTIAL Contains the maximum gas injection constraint
potential status
MINGLNCPOTENTIAL Contains the minimum no close gas injection
constraint potential status
MINGLPOTENTIAL Contains the minimum gas injection constraint
potential status

© 1990-2018 Petroleum Experts Limited


103 OpenServer

MXDRWDWNPOTENTIAL Contains the maximum drawdown constraint potential


status

OtherConstraintPotential[i] Contains the potential status of the following


constraints, depending of the i index value:
0 = Maximum pump control parameter
1 = Minimum pump control parameter (See the
AlqValueMax constraint for pump control
parameter list)
2 = Minimum motor power
3 = Maximum motor power

4.1.14 Obtaining the Results


4.1.14.1Solver Results

All the Solver results can be obtained for each node and element in the network using
the following string:

GAP.MOD[i].EQUIP[j].SolverResults[k].l

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the
network element considered (i.e. refers to the Model Equipement List, EQUIP[i] section)
and the index k refers to the index of the Solve Network sensitivity case considered.
l refers to the model parameter considered.

The following keywords are used:

Parameter Keyword Description


CO2 Mol percentage of CO2 in the fluid considered
H2S Mol percentage of H2S in the fluid considered
N2 Mol percentage of N2 in the fluid considered

CGR Produced CGR


Drawdown Well drawdown
FBHP Well flowing bottom hole pressure
GOR Produced GOR
GrossHeatingValue Gross heating value of the fluid stream considered
HCMassRate Hydrocarbon mass rate produced
HCMoleRate Hydrocarbon molar rate produced
NetHeatingValue Net heating value of the fluid stream produced

OpenServer User's Manual


GAP and OpenServer 104

PControlResult Optimum pressure drop calculated


Pres Pressure at the system node considered
Qgas Produced gas rate
Qliq Produced liquid rate
Qoil Produced oil rate
Qwat Produced water rate
ResPres Reservoir pressure
SGG Specific gas gravity produced
SpecGrossHeatingValue Specific gross heating value of the fluid considered
SpecNetHeatingValue Specific net heating value of the fluid stream considered
SOG Specific oil gravity produced
Temp Flowing temperature at the system node considered
TotMassRate Total mass rate produced
WCT Produced water cut
WGR Produced water to gas ratio
WSAL Water salinity produced

Pipeline Status Flags


IsBottleNecked Returns 0 if the pipe is not bottlenecking, 1 if it is.
IsReversedFlow Returns 0 if the pipe is not in reverse flow, 1 if it is.
IsUnstable Returns 0 if the pipe is in stable flow, 1 if it is not.

Well Status Flags


IsChokedByOptimiser Returns 0 if the well is not choked by the optimiser, 1 if it is.
IsUnstable Returns 0 if the well is in stable flow, 1 if it is not.

If the element considered is a well, the following string can be used to access the solver
results for a specific layer:

© 1990-2018 Petroleum Experts Limited


105 OpenServer

GAP.MOD[i].WELL[j].IPR[k].SolverResults[l].m

Example:
To retrieve the oil rate produced at the node labeled Manifold, the following string can be
used:

GAP.MOD[0].EQUIP[{Manifold}].SolverResults[0].Qoil

In case the compositional tracking or full composition calculation options are used, the
composition related solver results can be obtained as defined in
Fluid_Composition_Results.

4.1.14.2Prediction Results

All the Production Prediction results can be obtained for each node / element in the
network using the following string:

GAP.MOD[i].EQUIP[j].PREDRES[k].l

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the
network element considered (i.e. refers to the Model Equipment List, EQUIP[i] section)
and the index k refers to the date of the prediction time-step considered.
l refers to the model parameter considered.

The integer k in the above mentioned command will vary from 0 to one less than the
number of prediction results. The command to check the number of prediction results is

GAP.MOD[i].EQUIP[j].PREDRES.DATES.COUNT

Similar keywords to the one used for the Solver results are used for prediction results,
except for the following parameters:

Parameter Keyword Description


AVGGASRATE Average gas rate produced
AVGLIQRATE Average liquid rate produced
AVGOILRATE Average oil rate produced
AVGWATRATE Average water rate produced
DATES[i] Refers to the date of the ith prediction time-step.
Will refer to the date using an integer format.
DATES[i].DATESTR Refers to the date of the ith prediction time-step.
Will refer to the date using a day/month/year format.
DATES[i].DATETIMEST Refers to the date of the ith prediction time-step.
R Will refer to the date using a day/month/year hrs/min/sec

OpenServer User's Manual


GAP and OpenServer 106

format.
DATES[i].TIMESTR Refers to the date of the ith prediction time-step.
Will refer to the date using a day/month/year hrs/min/sec
format.
DOWNTIME Well downtime
GASRATE Instantaneous gas rate
LIQRATE Instantaneous liquid rate
OILRATE Instantaneous oil rate
PWF Bottom hole flowing pressure
REVENUE Revenue generated up to the node considered
WATRATE Instantaneous water rate

If the element considered is a well, the following string can be used to access the solver
results for a specific layer:

GAP.MOD[i].WELL[j].LAYERPREDRES[k][l].m

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to the name or numerical index of the well
considered (i.e. refers to the Model Equipment List, EQUIP[i] section), the index k refers
to the layer considered (i.e. it can either be the layer numerical index or the layer name
expressed between {}) and the index l refers to the prediction time-step considered.

The index m refers to the model parameter considered. The keywords used here are
similar to those used for the Production Prediction results.

Example:
To retrieve the average oil rate produced by the layer labeled Oil of the well labeled
Well1 on the 01/01/2000, the following string can be used:

GAP.MOD[0].WELL[{Well1}].LAYERPREDRES[{Oil}]
[{01/01/2000}].AVGOILRATE

4.1.14.3Total System Results


The Solve Network total system results can be obtained directly from the MOD level
using the following string structure:

GAP.MOD[i].SystemTotal[j].k

Where the index i refers to the type of model considered (i.e. refers to the Variables at
MOD level, MOD[i] section), the index j refers to solver sensitivity case considered and
the index k refers to the model parameter considered. The keywords used for the model
parameters are similar to the one described for the Solve Network results.

© 1990-2018 Petroleum Experts Limited


107 OpenServer

4.1.14.4Snapshot Results
The following table summarizes the OpenServer commands to re-load snapshot data:

OpenServer string Description


GAP.PREDSNAPSHOT.TIME.COUNT Returns the number of snapshots saved
during prediction run
GAP.PREDSNAPSHOT.LOAD(snapshot_n Loads the snapshot that corresponds to
umber) the specified number starting from 0
GAP.PREDSNAPSHOT.LOAD(“snapshot_ Loads the snapshot that corresponds to
date”) the specified date
GAP.PREDSNAPSHOT.UNLOAD() Unloads the snapshot and return to the
initial system settings

Please see Section 2.9.2.4 of the GAP User Guide for information on how to save
prediction snapshot data.
4.1.15 SubFlowSheets
GAP offers the possibility of organizing the system into different flow sheets, this option
is useful when organizing large models.

It is possible to use the OpenServer functionality to retrieve and modify variables being
located in the flow sheets.

The following syntax can be used to access the number of wells located in the flow sheet
with the index i:

GAP.MOD[{PROD}].FLOWSHEET[i].WELL.COUNT

The following syntax can be used to access the label of the well j located in the flow
sheet i:

GAP.MOD[{PROD}].FLOWSHEET[i].WELL[j].LABEL

Adding the FLOWSHEET[index] or FLOWSHEET[{name of the flow sheet}] structure to


the OpenServer string identifies which flow sheet the given variable is located

The above is valid for any variable and any equipment element.

4.2 GAP OpenServer Functions


This section describes the functions available to the OpenServer from GAP.

All functions in GAP have the form: function_name (function_arguments)

OpenServer User's Manual


GAP and OpenServer 108

Even if a function does not require any arguments, the brackets are still required.

The recommended way to execute these functions from Visual Basic is to use the
DoGAPFunc subroutine as shown below.
This subroutine works properly with any GAP function, and correctly deals with the case
where a function takes an appreciable amount of time to execute. Some functions may
return a value.

The GAP functions can be applied at four different levels:


- Functions applicable at the Network or Top level
The function action will be applied to the entire GAP network considered i.e.,
the production, gas and water injection systems.

In the DoGAPFunc subroutine, the function name and arguments will be


preceded by a GAP prefix.

Example:
The function PREDINIT() in GAP is a network level function and performs prediction
initialization and returns the number of time-steps to be performed during the prediction.

The code to call this in Visual Basic would be:

NSTEPS = DoGAPFunc( “GAP.PREDINIT()” )

Upon execution, NSTEPS would be set to the number of prediction time-steps.


NSTEPS must also be declared in the macro as an Integer.

- Functions applicable at the Model level


The function action will be applied to one of the models included in the GAP
network considered i.e., the production, gas and water injection systems. In
the DoGAPFunc subroutine, the function name and arguments will be
preceded by a GAP.MOD[i] prefix, where the i index relates to the GAP
model considered and is either expressed using the model numerical index
or using the model label between the braces{}.

- Functions applicable at the Node level


The function action will be applied to one of the node of one of the models
included in the GAP network considered i.e., the production, gas and water
injection systems. In the DoGAPFunc subroutine, the function name and
arguments will be preceded by a GAP.MOD[i].EQUIP[j] prefix, where the i
index relates to the GAP model considered and the j index refers to the node
considered.

- Functions applicable at the IPR level


The function action will be applied to one of the well IPR in the GAP network
considered. In the DoGAPFunc subroutine, the function name and arguments

© 1990-2018 Petroleum Experts Limited


109 OpenServer

will be preceded by a GAP.MOD[i].EQUIP[j].IPR[k] prefix, where the i index


relates to the GAP model considered, the j index refers to the node
considered and the k index refers to the layer considered.

Sample Macros:
Please also review the prediction set-up sample code in the provided "GAP Prediction
Template.xls" located in: C:/Program Files/Petroleum Experts/IPM 8/Samples/
OpenServer/Template/.

Please also review the GAP OpenServer examples. The files are in the form of *.GAR
files (archived GAP files). To open a GAR file, from the main menu of GAP select File |
Archive | Extract. Included in the GAR file is the macro that is used to run the
predictions and the code structure can be used as a reference to develop custom
macros, and to be modified to suit individual needs.
4.2.1 GAP OpenServer Functions Overview
The following table summarized the GAP OpenServer functions available, the
arguments associated and their main purpose.

Remark: Non compulsory function arguments will be individualized using a blue font
colour.

Function Name Description

Network Level Functions


CALCFLOWASSURANCE() Performs a gradient calculation in a section
of pipeline based on prediction results
CALCGRADIENT() Performs a gradient calculation based on
prediction results. Can be used for wells or
pipeline
CALCCOMPDP (comp) Calculates the outlet conditions of the
compressor given the inlet conditions.
CALCPIPEDP (pipe) Calculates the dP in the pipe given the
upstream flowing conditions.
CALCPUMPDP (pump) Calculates the outlet conditions of the pump
given the inlet conditions.
COPYITEM (EquipDest,EquipSrc) Copies data from a source node to a
destination node.
DELITEM (equip) Deletes a specified node from the system.
ISMEMBEROFGROUP(group) Enables to check if the node considered is
member of a specific group.
LINKITEMS (equip1, equip2, linklabel) Creates a link between two specified nodes.
NEWFILE () Clears any currently loaded GAP file.
NEWITEM (type, label, iposcode, equip, Creates a new node in the system specified.

OpenServer User's Manual


GAP and OpenServer 110

model)
OPENFILE (filename) Opens the GAP file specified.
PCCALC (equip, PcCurve) Allows access to well modelled using PC
curve option.
PCGMAX (equip, PcCurve) Calculates the maximum gas lift gas for a
particular performance curve at a specified
manifold pressure.
PCGSOLV (equip, PcCurve) Calculates the gas lift gas required to meet a
particular target value for a particular
performance curve at a specified manifold
pressure.
PCPSOLV (equip, PcCurve) Calculates the manifold pressure required to
meet a particular target value for a particular
performance curve.
PREDDOSTEP (optimise, potential) Performs a production prediction time-step.
PREDDOSOLVER (timestepsize, Performs a solve network in prediction
optimise, potential, model) mode.
PREDEND (dorest, optimise, potential) Stops a production prediction calculation.
PREDINIT (ignore internal timesteps, Performs production prediction initialisation.
ignore internal scheduling)
PURGEALLRESULTS (model) Deletes all the solver and prediction results
of the GAP model considered.
PURGEPREDLOG (model) Deletes the prediction calculation log.
PURGEPREDRESULTS (model) Deletes all the prediction results of the GAP
model considered.
PURGEPREDSNAPSHOT (model) Deletes the prediction snapshots.
PURGESOLVERLOG (model) Deletes the solve network calculation log
PURGESOLVERRESULTS (model) Deletes all the solve network results of the
GAP model considered.
REFITPC (well) Calculates a set of performance curve for the
specified well based on the PC curve input
data.
RESETSOLVERINPUTS () Resets any previously entered solve network
input data (i.e. separator pressure, injection
manifold pressure, gas lift gas available…).
SAVEFILE (filename) Saves the currently loaded GAP modle to the
file specified.
SHUTDOWN (save) Closes GAP.
SOLVENETWORK (optimise, model, Perfoms a solver calculation within GAP.
potential)
START () See Start and Shutdown section
STARTASYNC () See Start and Shutdown section
TPD.Calc() Performs a VLP calculation based on the

© 1990-2018 Petroleum Experts Limited


111 OpenServer

results of a solve network

TRANSFERPROSPERIPR (well/inflow, Transfers the IPR from PROSPER to the well


layer number, PVTMethod) node
Example:
GAP
.TRANSFERPROSPERIPR(MOD[0].WELL[{
W1}],0,0)
or
GAP.TRANSFERPROSPERIPR(MOD[
0].INFLOW[{layer1}],0,0)
UNLINKITEMS (equip1, equip2) Deletes the link between the two node
specified.
VALIDATE (solverorpred) Validates all the network input dataset.
VLPIMPORT (equip, filename) Imports the specified VLP file into the
corresponding node.
VLPIPRINTERSECT (well) Calculates the VLP/IPR intersection for the
well specified.
VLPIPRPCGEN (well, autowhp) Generates performance curve data from the
VLP/IPR data.
WELLCALC(well) Calculates the well performance given
specific flowing conditions. Used to validate
the model performance.

Specific Snapshot Commands


PREDSNAPSHOT.TIME.COUNT Returns the number of snapshots saved
during prediction run.
Example:
DoGet
("GAP.PREDSNAPSHOT.TIME.COUNT")
PREDSNAPSHOT.TIME[snapshot_numb Returns date for snapshot of the specified
er] number (if exist). The date is returned in
general format i.e. in days since
01/01/1990.
Example:
DoGet
("GAP.PREDSNAPSHOT.TIME[X]")
If snapshot number X corresponds to
01/01/2010 the value of 40179 will be
returned.
PREDSNAPSHOT.TIME[snapshot_numb Returns date for snapshot of the specified
er].DateStr number (if exist). The date is returned as a
string in DD/MM/YYYY format.
Example:
DoGet

OpenServer User's Manual


GAP and OpenServer 112

("GAP.PREDSNAPSHOT.TIME[X].DateStr")
If snapshot number X corresponds to
01/01/2010 the string "01/01/2010" will be
returned.
PREDSNAPSHOT.TIME[number1 : Returns dates for all the snapshots in the
number2] specified number interval in the format of the
string separated by "|" symbol. Dates are
returned in general format.
Example:
DoGet
("GAP.PREDSNAPSHOT.TIME[0:3]")
If snapshots 0-3 corresponds to dates
01/01/2010, 01/02/2010, 01/03/2010,
01/04/2010 the following string will be
returned "40179|40210|40238|40269|".
PREDSNAPSHOT.TIME[number1 : Returns dates for all the snapshots in the
number2].DateStr specified number interval in the format of the
string separated by "|" symbol. Dates are
returned in DD/MM/YYYY format. For
snapshots 0-3 in this case the following
string will be returned "01/01/2010|
01/02/2010|01/03/2010|01/04/2010|"
PREDSNAPSHOT.LOAD(snapshot_num Loads the snapshot that corresponds to the
ber) specified number (if exist) onto the screen.
Example:
DoCmd
("GAP.PREDSNAPSHOT.LOAD(X)")
PREDSNAPSHOT.LOAD(snapshot_date Loads the snapshot that corresponds to the
) specified date (if exist) onto the screen. The
date should be specified in DD/MM/YYYY
format in curly brackets.
Example:
DoCmd
("GAP.PREDSNAPSHOT.LOAD({01/01/201
0})")
PREDSNAPSHOT.LOAD("Original") Unloads prediction snapshot and returns
original system settings that were specified
before the predictions run.
Example:
DoCmd
("GAP.PREDSNAPSHOT.LOAD("Original")
")
PREDSNAPSHOT.UNLOAD() Unloads prediction snapshot and returns
original system settings that were specified
before the predictions run.
Example:

© 1990-2018 Petroleum Experts Limited


113 OpenServer

DoCmd
("GAP.PREDSNAPSHOT.UNLOAD()")

Model Level Functions


MOD[i].CopyControls(from, to, Copy any column of the equipment control
SkipFNAs) screen into another column of this screen.
MOD[i].ResetControls(column) Resets any column of the equipment control
screen.
MOD[i].RESETSCHEDULE (type, Resets any scheduling associated with the
equiptype) element specified.
MOD[i]..VALIDATE (solverorpred) Validates the specified model input dataset.

Node Level Functions


GROUP[i].ADDMEMBER (equip) Adds the equipment specified to the group
considered
GROUP[i].REMOVEALLMEMBERS () Removes all the members from the group
considered.
GROUP[i].REMOVEMEMBER (equip) Removes the equipment specified from the
group considered
EQUIP[i].ADDTOGROUP (group) Adds the node considered to the group
specified.
EQUIP[i].BYPASS () Bypasses the node considered.
EQUIP[i].DISABLE () Disables the node considered.
EQUIP[i].ENABLE () Enables the node considered.
EQUIP[i].ISMEMBEROFGROUP(group) Checks if the equipment considered is a
member of the group specified.
EQUIP[i].ISCONNECTEDTO(equip) Checks if the equipment is connected to
another equipment
EQUIP[i].ISRELATEDTO(equip) Checks if the equipment is related to another
equipment
EQUIP[i].MASK () Masks the node considered.
EQUIP[i].REMOVEALLGROUPMEMBER Deletes all the existing group memberships.
SHIPS ()
EQUIP[i].REMOVEFROMGROUP Removes the node considered from the
(group) group specified.
EQUIP[i].UNBYPASS () Unbypasses the node considered.
EQUIP[i].UNMASK () Unmasks the node considered.
EQUIP[i].VALIDATE () Validates the node considered.
TANK[i].CalcDCTankCurPres(CurProd) Calculates the Current Pressure for the tank
based on the Current Production specified.
This is for Decline Curve Tanks only.

Schedule Event Groups


GAP.MOD[{PROD}].EVENTGROUPLIST[ To get or set the state of this deferment, use

OpenServer User's Manual


GAP and OpenServer 114

the following commands or variables:


DoCmd
("GAP.MOD[{PROD}].EVENTGROUPLIST[{
NAME}].Enable()")
DoCmd
("GAP.MOD[{PROD}].EVENTGROUPLIST[{
{NAME}].Disable()
NAME}].Disable()")

NOTE: IT IS NOT POSSIBLE TO


CHANGE A GIVEN SET OF EVENT
GROUPS DURING A GIVEN
PREDICTION FORECAST

Pipe Environment Parameters

Pipeline Correlation Matching


Calculation (DoCmd)
GAP.MOD[{PROD}].PIPE[0].DOMATCH( Matches the available pipeline test to
) selected correlations

IPR Level Functions


IPR[i].CONINGMATCH () Matches the available coning data in the
selected IPR.
IPR[i].DISABLE () Disables the selected IPR.
IPR[i].ENABLE () Enables the selected IPR.
IPR[i].IPRMATCH () Matches the available IPR dataset.
IPR[i].MASK () Masks the specified IPR.
IPR[i].UNMASK () Unmasks the specified IPR.
IPR[i].COMPOSITION.IMPORTPRPFILE( Imports a *.prp file into the IPR layer of a
"FilePath") compositional GAP model.

PVT Level Functions


FLASHOPTIONS.PTS.ADD("ptsname") Adds a path to surface object definition
FLASHOPTIONS.PTS[i].REMOVE Removes the i path to surface object. All the
indices of the path to surface after the one
being removed are going to change:
recommended to use strings.
FLASHOPTIONS.PTS[i].IMPORT("filena Imports a *.prc file to the i path to surface
me") object
FLASHOPTIONS.PTS[i].EXPORT("filena Exports the i path to surface to a *.prc file
me")
FLASHOPTIONS.PTS[i].RENAME("newn Renames the i path to surface object
ame")

© 1990-2018 Petroleum Experts Limited


115 OpenServer

FLASHOPTIONS.PTS[i].ADDEQUIPME Adds equipment to the i path to surface


NT(equip, label, coordinates) object.
Arguments
equip - Separator, Joint, Chiller
label - label of equipment
coordinates - xy coordinates of
equipment (from 0 to 1)

Example:
DoCmd
"GAP.MOD[{PROD}].FLASHOPTIONS.PTS[
0].ADDEQUIPMENT(""Separator"",
""sep1"", 0.33,0.5)"
FLASHOPTIONS.PTS[i].ADDCONNECTI Adds a connection between two pieces of
ON(equip1, label1, output1, equip2, equipment for the i path to surface
label2, input2) Arguments
equip1 - Separator, Joint, Chiller,
Source, Export
label1 - label of equipment
output1 - Liquid, Vapour, Output
equip2 - Same as equip1
label2 - label of equipment
input2 - Liquid, Vapour, Input

Example:
DoCmd
"GAP.MOD[{PROD}].FLASHOPTIONS.PTS[
{osPTS}].ADDCONNECTION(""Source"",
""Source"", ""Output"", ""Separator"",
""sep1"", ""Input"")"
FLASHOPTIONS.PTS[i].REMOVEEQUIP Removes equipment from the i path to
MENT(equip, label) surface object.
Arguments
equip - Separator, Joint, Chiller
label - label of equipment
FLASHOPTIONS.PTS[i].REMOVECONN Removes a connection between two pieces
ECTION(equip1, label1, output1, equip2, of equipment in the i path to surface object.
label2, input2) For argument definitions see adding a
connection above.
FLASHOPTIONS.PTS[i].UPDATEVALID Updates the validation flags used in the
ATION interface. To be used when you build a path
to surface object from the OpenServer

Remark: All the arguments referring to a system node or element and referred as tag in
the following descriptions will be expressed using the following syntax:

OpenServer User's Manual


GAP and OpenServer 116

MOD[i].EQUIP[j]

Where the index i refers to the index or label (between {}) of the model considered and
the index j refers to the index or label (between {}) of the well considered.

Remark 2: Some of the functions include calculation processes that require the input of
associated variables. The variables associated with the functions can be setup using
the classic DoSet syntax.

These calculation processes will as well output results through output associated
variables. The value of these can be retrieved using a classic DoSet/DoGet syntax:

DoSet “GAP.MOD[i].EQUIP[j].k”, value


variable = DoGet “GAP.MOD[i].EQUIP[j].k”

Where the index i refers to the index or label (between {}) of the model considered, the
index j refers to the index or label (between {}) of the node considered and the index k
refers to the GAP function associated variable considered. The value refers to the value
of this associated variable.

4.2.2 CALCFLOWASSURANCE

ARGUMENTS
none

DESCRIPTION and FUNCTION RETURN


This function calculates the outlet conditions of a pipe given the inlet conditions
calculated during a prediction or network solve. This is the same calculation that is
performed by pressing the "Flow Assurance" button in the GAP results section.
If the calculation succeeds, the function returns 0.

The calculation must be performed for every timestep where the results are required.
GAP will only store one set of results per item of equipment therefore it is not possible to
extract the results for multiple timesteps. The results are also not saved with the file.

EXAMPLE
An example of its use in a system with a pipe labeled ‘pipe1’, where the objective is to
perform the calculation for the first step of the prediction and the first solver result would
be:

DoGAPFunc("GAP.MOD[{PROD}].PIPE[{pipe1}].PREDRES[0].CALCFLOWASSURA
NCE()")

DoGAPFunc("GAP.MOD[{PROD}].PIPE[{Pipe1}].SolverResults[0].CALCFLOWASSU
RANCE()")

© 1990-2018 Petroleum Experts Limited


117 OpenServer

4.2.3 CALCGRADIENT( )

ARGUMENTS
none

DESCRIPTION and FUNCTION RETURN


This function calculates the outlet conditions of an outflow only - PROSPER well, given
the inlet conditions calculated during a prediction or network solve. This is the same
calculation that is performed by pressing the "Gradient" button in the GAP results
section.
If the calculation succeeds, the function returns 0.

The calculation must be performed for every timestep where the results are required.
GAP will only store one set of results per item of equipment therefore it is not possible to
extract the results for multiple timesteps. The results are also not saved with the file.

This function can also be used for pipelines in place of the CALCFLOWASSURANCE()
function.

EXAMPLE
An example of its use in a system with a well labeled ‘well1’, where the objective is to
perform the calculation for the results of a solve network would be:

DoGAPFunc("GAP.MOD[{PROD}].WELL[{well1}].SOLVERRESULTS[0].CALCGRADI
ENT()")
4.2.4 CALCCOMPDP (comp) / CALCPUMPDP (pump)

ARGUMENTS
comp / pump – Refers to the compressor / pump tag.

DESCRIPTION and FUNCTION RETURN


This function calculates the outlet conditions of the pump given the inlet conditions
specified in a set of global variables, as described below.
If the calculation succeeds, the function returns 0.
If it fails, the function returns a negative number.

ASSOCIATED VARIABLES
Input Data
Variable Description
CPDH2S Mole percentage of H2S.
CPDCO2 Mole percentage of CO2.
CPDN2 Mole percentage of N2.

CPDGG Gas gravity.


CPDINPRES Inlet pressure.

OpenServer User's Manual


GAP and OpenServer 118

CPDINTEMP Inlet temperature.


CPDOG Oil gravity.
CPDQGAS Inlet gas rate expressed at standard conditions.
CPDQOIL Inlet oil rate expressed at standard conditions.
CPDQWAT Inlet water rate expressed at standard conditions.
CPDWSAL Water Salinity.

Output Data
Variable Description
CPDEFF Compressor / Pump Efficiency.
CPDFLUIDPWR Power to fluid.
CPDGFRC Gas fraction (pumps).
CPDHEAD Compressor / Pump head.
CPDINGRATE Inlet rate (compressors).
CPDINLRATE Average throughput rate (pumps).
CPDLFRC Liquid fraction (compressors).
CPDOUTPRES Outlet pressure.
CPDOUTTEMP Outlet temperature.
CPDPOWREQ Total power required.

Intermediate Stage Data

Stage results are given in an array described below.


In GAP, a stage consists of a cooler (compressors only), a separator and finally the
pump or compressor unit. Cooling and separation can be set up after the final pump or
compressor unit, and the results of these are found in the CPDSTGRES[n] array, where
n is the number of stages

Variable Description
CPDSTGRES[0][j] Pressure at inlet of stage j.
CPDSTGRES[1][j] Temperature at inlet of stage j.
CPDSTGRES[2][j] Temperature at outlet of cooler stage j
(compressor).
CPDSTGRES[3][j] Oil rate at inlet of stage j.
CPDSTGRES[4][j] Gas rate at inlet of stage j.
CPDSTGRES[5][j] Water rate at inlet of stage j.
CPDSTGRES[6][j] Average throughput rate (pumps), Inlet throughput
rate (compressors).
CPDSTGRES[7][j] Head generated by stage j.
CPDSTGRES[8][j] Power required by stage j.
CPDSTGRES[9][j] Efficiency of stage j.
CPDSTGRES[10][j] Gas fraction (pumps) Liquid fraction
(compressors).

© 1990-2018 Petroleum Experts Limited


119 OpenServer

CPDSTGRES[11][j] Oil rate after separation for stage j.


CPDSTGRES[12][j] Gas rate after separation for stage j.
CPDSTGRES[13][j] Water rate after separation for stage j.

4.2.5 CALCPIPEDP(pipe)

ARGUMENTS
Pipe – Refers to the pipe tag.

DESCRIPTION and FUNCTION RETURN


This function calculates the pressure drop in the pipe given the upstream conditions
specified in a set of global variables described below.

If the calculation succeeds, the function returns 0. If it fails, the function returns a negative
number.

ASSOCIATED VARIABLES

Input Data
Variable Description
PIPH2S Mole percentage of H2S.
PIPCO2 Mole percentage of CO2.
PIPN2 Mole percentage of N2.

PIPGG Gas gravity.


PIPGOR GOR.
PIPGIN Injected gas rate.
PIPOG Oil gravity.
PIPP1 Upstream pressure.
PIPQL Liquid rate expressed at standard conditions.
PIPT1 Upstream temperature.
PIPWCT Water cut.
PIPWSAL Water salinity.

Output Data
Variable Description
PIPP2 Calculated downstream pressure.
PIPT2 Calculated downstream temperature.

OpenServer User's Manual


GAP and OpenServer 120

EXAMPLE
The associated variables require a syntax as shown in the following examples:

cells(1,1) = DoGet ("GAP.PIPH2S(MOD[i].PIPE[j])")

DoSet ("GAP.PIPGOR(MOD[0].PIPE[{P1}])"), cells (2,1)

where the index i refers to the index or label (between {}) of the model considered, the
index j refers to the index or label (between {}) of the equipment considered.

4.2.6 COPYITEM( EquipDest, EquipSrc )

ARGUMENTS

EquipDest – Refers to the tag of the destination node


EquipSrc – Refers to the tag of the source node

DESCRIPTION and FUNCTION RETURN


This function copies data from a source node to a destination node. This is only allowed
between nodes of the same type.
The function, if successful, returns the index of EquipDest in the EQUIP list.

The function can only be used if the destination equipment already exists in the network.
To create a new equipment, the 'NEWITEM' command must be used (see section
5.2.9).

EXAMPLE
An example of its use in a system with a well labeled ‘w1’, the contents of which we wish
to copy to a well labeled ‘newwell’, would be:

CPYIND =
DoGAPFunc(“GAP.COPYITEM(MOD[0].WELL[{newwell}], MOD[0].WELL[{w1}])”)

4.2.7 DELITEM (node)

ARGUMENTS
node – Refers to the tag of the node to be deleted

DESCRIPTION
This function deletes the specified node from the system.

EXAMPLE

© 1990-2018 Petroleum Experts Limited


121 OpenServer

An example of its use in a system with a well labeled ‘w1’ would be

DoGAPFunc (“GAP.DELITEM(MOD[0].WELL[{w1}])”)

4.2.8 ISMEMBEROFGROUP(Group)
ARGUMENTS
Group - Refers to the OpenServer string defining the group considered.

DESCRIPTION
This function enables to check if a specific element of the GAP network belongs to the
group considered.
The function will return 0 if the element consider does not belong to the group
considered, and 1 if the element considered belongs to the group considered.

EXAMPLE
The example below will enable to check whether the well W1 belongs to the group
Group1:

DoCmd
("GAP.MOD[{PROD}].WELL[{W1}].ISMEMBEROFGROUP(MOD[{PROD}].GROUP[{Gr
oup1}])
4.2.9 LINKITEMS ( equip1, equip2, linklabel )

ARGUMENTS
equip1 – Refers to the tag of the first node considered
equip 2 – Refers to the tag of the second node considered
linklabel (optional) – Refers to the label associated to the link created (if applicable).
Needs to be specified in between quotes.

DESCRIPTION
This function links two items within a GAP model.
If the two items are a joint and another joint, or a joint and a separator, then a pipe node
will be created in order to link them, and in these cases the optional label linklabel, if
supplied, will be used as the pipe label.

EXAMPLE
For instance, the following command will create a link between the joint J1 and the
separator Sep1

DoCmd ("GAP.LINKITEMS(MOD[0].JOINT[{J1}],MOD[0].SEP[{Sep1}])")

4.2.10 NEWFILE( )

ARGUMENTS

OpenServer User's Manual


GAP and OpenServer 122

None

DESCRIPTION
This function clears any currently loaded GAP model.
Care should be taken with this function, since no check is made of whether the currently
loaded model has changed and requires saving.

EXAMPLE
DoGAPFunc ("GAP.NEWFILE()")

4.2.11 NEWITEM( type, label, iposcode, equip, model )

ARGUMENTS
type – A string specifying the type of node to be created.
The string will be one of "WELL", "PIPE", "TANK", "SEP", "PUMP", "COMP", "JOINT",
"SOURCE", "SINK", "VALVE", "INLSEP", "INLCHK", "INLINJ", "INLGEN", "GROUP",
"INFLOW".

label – A string giving the label of the new node. The string should be specified in
between quotes.

iposcode (optional) – A string giving the direction a node will be displaced relative to the
reference node.
The string will be one of “RIGHT”, “LEFT”, “ABOVE” or “BELOW”.
The default value is set to “RIGHT”.

equip (optional) – The tag of a node in the system to use as the reference node.
The reference node is used to calculate the position of the new node.
The default value is set to “NULL”.

model (optional) – The tag of the system in which the new item is to be created.
The default value is set to MOD[0].

DESCRIPTION
This function creates a new node in the system specified. Nodes will always be
positioned such that they do not intersect each other.

EXAMPLE
To create a new well labeled “Well1” in the currently loaded production system located at
the right of the Separator node, the following syntax could be used –

DoGAPFunc “GAP.NEWITEM (""WELL"", ""Well1"", ""RIGHT"",


MOD[0].EQUIP[{Separator}])”

© 1990-2018 Petroleum Experts Limited


123 OpenServer

4.2.11.1Working with Flowsheets


The followig instructions can be used to create and define a Flowsheet in GAP using
OpenServer:

GENERAL SYNTAX
DoCmd "GAP.NEWITEM( type, label, [iPosCode=RIGHT], [node=NULL],
[model=MOD[0]], [flowsheet=MOD[0].FLOWSHEET[{xxx}]] )"

ARGUMENTS
type - A string specifying the type of node to be created:
The string will be one of the "EQUIP", "WELL", "PIPE", "TANK", "SEP", "PUMP",
"COMP", "JOINT", "SOURCE", "SINK", "VALVE", "INLSEP", "INLCHK", "INLINJ",
"INLGEN", "COMPLETION", "GROUP", "INFLOW", "FLOWSHEET"

FLOWSHEET EXAMPLE:
Create a Flowsheet in the main GAP model:
DoCmd "GAP.NEWITEM( "FLOWSHEET", "FlowS1", RIGHT, NULL, MOD[0])"
Create a joint in the flowsheet:
DoCmd "GAP.NEWITEM( "JOINT", "Port1", RIGHT, null, MOD[0],
MOD[0].FLOWSHEET[{FlowS1}])"

To define a joint as a flowsheet port:


DoCmd "GAP.MOD[{PROD}].JOINT[{Port1}].SetFlowsheetPort()"

To turn a port back to a normal joint:


DoCmd "GAP.MOD[{PROD}].JOINT[{Port1}].ClearFlowsheetPort()"

The following flag can be used to determine whther a joint is a flowsheet port:
DoGet "GAP.MOD[{PROD}].JOINT[{Port1}].IsFlowsheetPort()"

4.2.12 OPENFILE( filename )

ARGUMENTS
filename – Refers to the fully qualified (i.e. path included) file name to open.

DESCRIPTION
This function opens the GAP file specified. It should be used with caution since the file
will replace the currently loaded file, whether or not the currently loaded file needs
saving.

EXAMPLE
To open a GAP file labelled “Simple.GAP” and located in the folder “Simple_Model” in
the C: drive, the following syntax can be used –

OpenServer User's Manual


GAP and OpenServer 124

DoGAPFunc (“GAP.OPENFILE ("”C:/Simple_Model/Simple.GAP”")”)

Alternatively, an Excel spreadsheet located file can be opened using the following
syntax:

DoCmd ("GAP.OPENFILE(""" + Range("a4") + """)")

4.2.13 PCCALC (equip, PcCurve)

ARGUMENTS
equip – Refers to the tag of the node considered, other than a tank node.
PcCurve – Specifies which type of performance curve is to be used.
Can be specified using one of the following keywords:

"QOIL", "QGAS", "QLIQ", "OG", "GG", "FBHP", "TEMP", "H2S", "CO2", "N2", "WSAL",
"GIBACK", “OPTFUN”.

DESCRIPTION and FUNCTION RETURN


GAP builds performance curves for nodes in the system.
This function allows access to these curves. The input conditions are set up in global
variables described in the following section, then the function is called to calculate the
answer.
The function returns 0 if the calculation has been successful, and a negative number if
not.

Input Data

Variable Description
PCCGASINJ In a gas lifted system, specifies the gas injected.
PCCMANIPRES The manifold pressure.

Output Data
Variable Description
PCCANS The calculated quantity.
PCCDANSDG In a gas lifted system, the derivative of the calculated
quantity with respect to gas injected.

The Input and Output Data parameters are global variables, and hence do not require
the equipment to be identified when using these variables. An Example for this is given
below.

EXAMPLE
An example of its use with a gas lifted well labeled ‘w1’ would be

'Set up the input variables in the well considered

© 1990-2018 Petroleum Experts Limited


125 OpenServer

DoSet “GAP.PCCMANIPRES” , 500


DoSet “GAP.PCCGASINJ”, 1

'Perform the calculation


DoGAPFunc “GAP.PCCALC(MOD[0].WELL[{w1}],””QLIQ””)”

'Obtain the output values


ANS = DoGet(“GAP.PCCANS”)
DER = DoGet(“GAP.PCCDANSDG”)

4.2.14 PCGMAX (equip, PcCurve)

ARGUMENTS
equip – Refers to the tag of the node considered, other than a tank node.

PcCurve – Specifies which type of performance curve is to be used.


Can be specified using one of the following keywords:

"QOIL", "QGAS", "QLIQ", "OG", "GG", "FBHP", "TEMP", "H2S", "CO2", "N2", "WSAL",
"GIBACK", “OPTFUN”.

DESCRIPTION and FUNCTION RETURN


This function is used in a gaslifted system to calculate the maximum gaslift for a
particular performance curve at a specified manifold pressure.
The input conditions are set up in global variables (see below), then the function is called
to calculate the answer.
The function returns 0 if successful, and a negative number if not.

Input Data
Variable Description
PCOPTMANIPRES The manifold pressure.

Output Data
Variable Description
PCOPTGINJ The calculated optimum gas injection.
PCOPTVAL The calculated quantity at optimum gas injection.

The Input and Output Data parameters are global variables, and hence do not require
the equipment to be identified when using these variables. An Example for this is given
for the PCCALC command.
4.2.15 PCGSOLV (equip, PcCurve)

ARGUMENTS

OpenServer User's Manual


GAP and OpenServer 126

equip – Refers to the tag of the node considered, other than a tank node.

PcCurve – Specifies which type of performance curve is to be used.


Can be specified using one of the following keywords:

"QOIL", "QGAS", "QLIQ", "OG", "GG", "FBHP", "TEMP", "H2S", "CO2", "N2", "WSAL",
"GIBACK", “OPTFUN”.

DESCRIPTION and FUNCTION RETURN


This function is used in a gas lifted system to calculate the gas lift required to meet a
target value for a particular performance curve at a specified manifold pressure.

The input conditions are set up in global variables (see below), then the function is called
to calculate the answer.
The function returns 0 if successful, and a negative number if not.

ASSOCIATED VARIABLES

Input Data
Variable Description
PCSOLVMANIPRES The manifold pressure.
PCSOLVTARGVAL The target quantity.

Output Data
Variable Description
PCSOLVGASINJ The calculated gas injection required. The value in
this variable on input is used as a starting value.

The Input and Output Data parameters are global variables, and hence do not require
the equipment to be identified when using these variables. An Example for this is given
for the PCCALC command.

4.2.16 PCPSOLV (equip, PcCurve)

ARGUMENTS
equip – Refers to the tag of the node considered, other than a tank node.

PcCurve – Specifies which type of performance curve is to be used.


Can be specified using one of the following keywords:

"QOIL", "QGAS", "QLIQ", "OG", "GG", "FBHP", "TEMP", "H2S", "CO2", "N2", "WSAL",
"GIBACK", “OPTFUN”.

DESCRIPTION and FUNCTION RETURN


This function is used to calculate the manifold pressure required to meet a target value
for a particular performance curve (in gaslifted systems, at a specified gas injection).

© 1990-2018 Petroleum Experts Limited


127 OpenServer

The input conditions are set up in global variables (see below), then the function is called
to calculate the answer.
The function returns 0 if successful, and a negative number if not.

Input Data
Variable Description
PCSOLVGASINJ The gas injection. In a non gaslifted node, this
value is ignored.
PCSOLVTARGVAL The target quantity.

Output Data
Variable Description
PCSOLVMANIPRES The calculated manifold pressure. On input, the value
in this variable is used as a starting value.

The Input and Output Data parameters are global variables, and hence do not require
the equipment to be identified when using these variables. An Example for this is given
for the PCCALC command.
4.2.17 PREDDOSTEP (optimise, potential)
ARGUMENTS
optimise (optional) – Refers to the status of the optimiser when the prediction timestep
is performed.
The following options are available:
-1 – GAP uses the optimisation mode and potential calculation settings saved in
the file
0 – No Optimisation
1 – Optimise and Honour Constraints
2 – Optimise, potential constraints only
3 – Optimise with rules
The default value is set to optimise and honour constraints.

potential (optional) – Refers to the status of the network potential calculation. Would only
be used when "Optimise and Honour Constraints" method is selected.
The following options are available:
0 – No potential calculation
1 – Potential calculation
The default value is set to no potential calculation.

DESCRIPTION
This function, together with PREDINIT() and PREDEND(), allows step by step
predictions to be performed.

PREDINIT() performs all the setup required for a prediction run, i.e. the MBAL tanks are
loaded, the well models are initialized, etc. and PREDEND() is called to end the
prediction run. For details regarding these functions, see their associated sections.

OpenServer User's Manual


GAP and OpenServer 128

PREDDOSTEP() is called once for each timestep in the prediction run.

The function performs two main tasks.

Firstly, it totals up the production and injection volumes from the previous timestep and
uses these to calculate the tank pressures for the current time-step.

Secondly, it calculates the network performance using a solve network calculation along
with the current tank pressures and flowing conditions. It then obtain the production rates
for the wells included in the system.

It then calculates the ideal injection required, based on voidage replacement conditions,
etc. If associated injection systems are present, these ideal injection requirements are
used as constraints, and the injection systems are built and allocated to obtain the actual
injection volumes.

When each PREDDOSTEP() call is finished, GAP is left in a state where it can respond
to any set of OpenServer commands. This allows a large amount of flexibility, since
virtually any action can be performed at each timestep. This can range from customised
scheduling through to running GAP in conjunction with a facilities simulator at each
timestep.

EXAMPLE
The following example performs the prediction set up in the GAP file, and on the time-
step 01/03/1980 alters the PI of the first layer of well ‘w1’ to 15. At the end of the
prediction run it saves the GAP file.

'Set up prediction
NSTEPS = DoGAPFunc “GAP.PREDINIT()”
For i = 1 To NSTEPS
'Do production prediction step
RVAL = DoGAPFunc “GAP.PREDDOSTEP()”
'Check return code – should be 1 if step OK
If (RVAL <> 1) Then
Exit For
End If
If (DoGet ("GAP.PREDCURDATE.DATESTR") = "01/03/1980") Then
DoSet "GAP.MOD[0].WELL[{w1}].IPR[0].PI", 15
End If
Next
DoGAPFunc “GAP.PREDEND()”
DoGAPFunc “GAP.SAVEFILE( “”C:\SAMPLES\PREDRUN1.GAP”” )”

© 1990-2018 Petroleum Experts Limited


129 OpenServer

4.2.18 PREDDOSOLVER (timestepsize, optimise, potential, model)

ARGUMENTS
Timestepsize – Should always be set to 0

optimise (optional) – Refers to the status of the optimiser when the prediction timestep
is performed.
The following options are available:
-1 – GAP uses the optimisation mode and potential calculation settings saved in
the file
0 – No Optimisation
1 – Optimise and Honour Constraints
2 – Optimise, No constraints
3 – Optimise with rules
The default value is set to optimise and honour constraints.

potential (optional) – Refers to the status of the network potential calculation.


The following options are available:
0 – No potential calculation
1 – Potential calculation
The default value is set to no potential calculation.

model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The default considers the production system.

DESCRIPTION
This function performs a solve network calculation in predictive mode without moving
forward of one prediction step.
It enables to run solve network sensitivities at a specific point during the prediction.

4.2.19 PREDEND(dorest, optimise, potential)

ARGUMENTS
dorest (optional) – Refers to the time-step at which the prediction run ends.
The following options are available:
0 – The prediction forecast is ended as soon as the the function is called.
1 – The prediction forecast is ended at the end of the defined prediction
schedule.
The default value is set to 1.

optimise (optional) – Refers to the status of the optimiser when the prediction time-step
is performed.
The following options are available:
-1 – GAP uses the optimisation mode and potential calculation settings saved in
the file

OpenServer User's Manual


GAP and OpenServer 130

0 – No Optimisation
1 – Optimise and Honour Constraints
2 – Optimise, No constraints
3 – Optimise with rules
The default value is set to optimise and honour constraints.

potential (optional) – Refers to the status of the network potential calculation.


The following options are available:
0 – No potential calculation
1 – Potential calculation
The default value is set to no potential calculation.

DESCRIPTION
This functions ends the prediction run.
See discussion of PREDDOSTEP(), in the previous section.

4.2.20 PREDINIT (ignore internal timestep, ignore internal scheduling)

ARGUMENTS
ignore internal timestep (optional) – Specifies whether the GAP internal timesteps are
ignored or not (mainly used when the GAP / RESOLVE coupling is used).
The following values are possible:
0 – Do not ignore internal timesteps
1 – Ignore internal timesteps
The default value is set to 0.

Ignore internal scheduling (optional) - Enables to specify whether the GAP internal scheduling
events are ignored or not (i.e. mainly used when the GAP / RESOLVE coupling is used).
The following values are possible:
0 – Do not ignore internal scheduling events
1 – Ignore internal scheduling events
The default value is set to 0.

DESCRIPTION
This functions establishes all the setup required for a prediction run, i.e. the MBAL tanks
are loaded, the well models are initialised, etc.
This process leads to the calculation of the number of timestep required in the prediction
run.

EXAMPLE
NumSteps = DoGAPFunc("GAP.PREDINIT()")

The command initialises the GAP prediction and returns the total number of prediction
steps

© 1990-2018 Petroleum Experts Limited


131 OpenServer

NOTE
Using of the command will initialise the prediction and define the number of steps
required to perform the prediction. The number of step is defined according to
Prediction Start, Prediction End and Step Size.

The prediction is run through the loop on a step by step basis. In this case GAP is driven
by external application and completes the full number of prediction steps; the 'System
Abandonment Constraints' will be ignored.

The full prediction run will be accomplished even if macro exits the loop and executes
the GAP.PREDEND() command.

4.2.21 PURGEALLRESULTS (model)

ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considered by default is the production system.

DESCRIPTION
This function purges all results saved in the model currently considered.

4.2.22 PURGEPREDLOG (model)

ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considered by default is the production system.

DESCRIPTION
This function purges the prediction log of the model currently considered.

OpenServer User's Manual


GAP and OpenServer 132

4.2.23 PURGEPREDRESULTS (model)


ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considerered by default is the production system.

DESCRIPTION
This function purges the prediction results saved in the model currently considered.

4.2.24 PURGEPREDSNAPSHOT (model)

ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considered by default is the production system.

DESCRIPTION
This function purges the prediction snapshots saved in the model currently considered.

4.2.25 PURGESOLVERLOG (model)

ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considered by default is the production system.

DESCRIPTION
This function purges the solver log of the model currently considered.

4.2.26 PURGESOLVERRESULTS (model)

ARGUMENTS
model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The model considered by default is the production system.

DESCRIPTION
This function purges the solver results saved in the model currently considered.

© 1990-2018 Petroleum Experts Limited


133 OpenServer

4.2.27 REFITPC(well)

ARGUMENTS
well – Refers to the tag of the well considered in the currently loaded model.

DESCRIPTION
This function calculates a set of performance curves for the well based on the input
performance curve data.

EXAMPLE
To do a refit on a well with the name "well2" the following syntax can be used:

DoCmd("GAP.REFITPC(GAP.MOD[{PROD}].WELL[{WELL2}])")

4.2.28 RESETSOLVERINPUTS ()

ARGUMENTS
None

DESCRIPTION
This function resets any previously entered solver inout data (i.e. separator pressure,
injection manifold pressure, gas lift gas available).

4.2.29 SAVEFILE( filename )

ARGUMENTS
filename – Refers to the fully qualified (i.e. path included) file name to open.

DESCRIPTION
This function saves the currently loaded GAP model to the file specified.
It should be used with caution since the file will overwrite a file of the same name if it
exists.

EXAMPLE
To save a GAP file labelled “Simple.gap” and located in the folder “Simple_Model” in
the C:\ drive, the following syntax can be used

DoGAPFunc "GAP.SAVEFILE (""C:\Simple_Model\Simple.gap"")"

OpenServer User's Manual


GAP and OpenServer 134

4.2.30 SHUTDOWN (save)

ARGUMENTS
save – Enables to specify whether the file needs to be saved before closing down GAP
or not.
The following values are possible:
0 – Do not save the GAP file
1 – Automatically save the GAP file if it has been modified.
The default value is 1.

DESCRIPTION
This function closes down GAP.

4.2.31 SOLVENETWORK()

ARGUMENTS
optimise (optional) – Refers to the status of the solver when the calculation is performed.
The following options are available:
-1 – GAP uses the optimisation mode and potential calculation settings saved in
the file
0 – No Optimisation
1 – Optimise and Honour Constraints
2 – Optimise with potential constraints
3 – Use Rule Based Solver to honour constraints
The default value is set to optimise and honour constraints.

model (optional) – Refers to the tag of the model considered (i.e. production / water
injection / gas injection).
The default considers the production system.

potential (optional) – Refers to the status of the network potential calculation as an


additional calculation.
The following options are available:
0 – No potential calculation
1 – Potential calculation
The default value is set to no potential calculation.

associated gas lift network (optional) - Refers to the inclusion of the gas lift gas network
for gas lifted fields.
The following options are available:
0 - Do not include gas lift gas network
1 - Include gas lift gas network
The default value is set to do not include gas lift gas network.

DESCRIPTION

© 1990-2018 Petroleum Experts Limited


135 OpenServer

This function performs a solver calculation within GAP.

EXAMPLE
This example assumes a naturally flowing system with two separators labeled ‘s1’ and
‘s2’ is loaded in GAP

'Reset any previously set allocate pressures


DoGAPFunc “GAP.RESETALLOCINPUTS()”

'Set separators to desired allocate pressures


DoSet “GAP.MOD[0].SEP[{s1}].SOLVERPRES[0]”, 200
DoSet “GAP.MOD[0].SEP[{s2}].SOLVERPRES[0]”, 300

'Set up constraints
DoSet “GAP.MOD[0].MAXGAS”, 50
DoSet “GAP.MOD[0].SEP[{s1}].MAXQWAT”, 12000

'Perform Allocation
DoGAPFunc “GAP.SOLVENETWORK(1, MOD[0])”

'Get results
QOILS1 = DoGet(“GAP.MOD[0].SEP[{s1}].SOLVERRESULTS[0].Qoil”)
QWATS2 = DoGet(“GAP.MOD[0].SEP[{s2}].SOLVERRESULTS[0].Qwat”)

4.2.32 TPD.CALC()
ARGUMENTS
None.

DESCRIPTION
This function performs the same calculation as the VLP calculation screen for a well in
GAP (see figure below)

EXAMPLE
The following may be used to input the flowing conditions for the VLP, perform the VLP
calculation and retrieve the results for an oil well.

OpenServer User's Manual


GAP and OpenServer 136

'Set input data for VLP Calc – this will overwrite the network solver results
DoSet "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.SensVarCalcValue[0]", Liquid
Rate
DoSet "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.SensVarCalcValue[1]", WCT
DoSet "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.SensVarCalcValue[2]", GOR
DoSet "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.SensVarCalcValue[3]", WHP

'Perform VLP Calculation


DoCmd "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.Calc()"

'Get VLP Results


FBHP = DoGet("GAP.MOD[{PROD}].WELL[{Well1A}].TPD.CalcVarResult[0]")

Note - The Openserver strings returned for the table in the ‘VLP calculation’ dialog are
NOT the same as the ones that are used in this function so the user cannot simply ‘ctrl
+right-click’ on the above dialog and use these.

BEST PRACTICE
If OpenServer is to be used to perform TPD calculations using this function, care needs
to be taken to enter the variables in the correct order (i.e. the integer that the variables,
SensVarCalcValue[i], are defined with can depend on which sensitivity variables are
used when the lift curves are generated).

The order/integer the variables are to be defined with can be obtained visually (i.e.
inspecting the VLP calculation dialogue starting from 0 for the farthest left variable), or
by extracting the order with OpenServer. To extract the order with OpenServer, the
TPD.SensVarTag[$] string can be used:

DoGet ("DoSet "GAP.MOD[{PROD}].WELL[{Well1A}].TPD.SensVarTag[$]")


= "LIQ_RATE|WATER_CUT|GOR|FIRST_NODE_PRESSURE|"

Here LIQ_RATE is the integer of 0, WATER_CUT is 1, GOR is 2, etc...

4.2.33 TRANSFERPROSPERIPR (well, layernumber, PVTMethod)


ARGUMENTS
well/inflow – Refers to the tag of the well or inflow node considered.

layer number (optional) – For multilayered wells, the number of the well layer to update.
The valid values for this argument range from 0 to n-1.
The default is set to 0 – first layer.

PVTMethod (optional) – Refers to the set of PVT data used during the IPR transfer.
The following options are available:

© 1990-2018 Petroleum Experts Limited


137 OpenServer

0 – Follow PROSPER File


1 – Black Oil
2 – Compositional
The default value of this flag is set to 0.

DESCRIPTION
This function transfers the IPR from PROSPER for the well node.
This is equivalent to the ‘Transfer Well IPR from PROSPER’ menu option

EXAMPLE
The following syntax can be used to transfer to the GAP system the PROSPER defined
IPR of the well labeled “Well1” –

DoGAPFunc “GAP.TRANSFERPROSPERIPR (MOD[0].WELL[{W1}])”

4.2.34 UNLINKITEMS (equip1, equip2)


ARGUMENTS
equip1 – Refers to the tag of the first node considered.
equip2 (optional) – Refers to the tag of the first node considered.

DESCRIPTION
This function deletes the link between the first node and second node (if one exists). If
only the first node is specified, then the link between that node and its parent node is
deleted.

EXAMPLE
To break the link between a well W1 and a joint J1, the following code can be used.

DoGAPFunc ("GAP.UNLINKITEMS (MOD[0].JOINT[{J1}],MOD[0].WELL[{W1}])")

4.2.35 VALIDATE (solverorpred)


ARGUMENTS
solverorpred (optional) – Enables to specify which input data needs to be validated.
The following options are available:
0 – The input data needed for solver calculation is validated.
1 – The input data needed for prediction calculations is validated.
2 – The input data needed for both solver and prediction calculation is validated.
The default value used is 2.

DESCRIPTION
This functions validates all the input data needed for both solver and prediction
calculations, at network level.
The function returns 0 if all the model considered are valid, and a value # 0 if it is not the

OpenServer User's Manual


GAP and OpenServer 138

case.

4.2.36 VLPIMPORT (equip, filename)

ARGUMENTS
equip – Refers to the tag of the node considered. Here the type of node considered
could be wells, outflows, pump or compressors.

Filename – Refers to the the fully qualified (i.e. path included) TPD file name to open.

DESCRIPTION and FUNCTION RETURN


This function imports the specified file into the node, which should be a well or a pump
node.
If successful, it returns 1. If the function fails, it returns 0.

EXAMPLE
The following syntax can be used to import the lift curves .TPD file in the well labeled
“W1” from the location C:\TEST

DoGAPFunc “GAP.VLPIMPORT (MOD[0].WELL[{W1}], ""C:\TEST\Well1.tpd"")”

4.2.37 VLPIPRPCGEN (well, autowhp)


ARGUMENTS
well – Refers to the tag of the well considered.

autowhp (optional) – A flag to indicate whether to use automatic wellhead pressure


selection (0 – don’t use, 1 – use,).
The default is 1 – use.

DESCRIPTION
This function generates performance curve data from the VLP and IPR data in the well
node.
The automatic wellhead pressure selection option does not apply to gaslifted wells.

EXAMPLE
For example the following code may be used to calculate the Performance Curve for
Well labelled "W2" where the Manifold Pressures used are defined by the user.

For i = 0 To 19
DoSet ("GAP.MOD[{PROD}].WELL[{W2}].MANIPRES[" + CStr(i) + "]"),
Cells(36 + i, 4)
Next i

DoGAPFunc ("GAP.VLPIPRPCGEN(MOD[0].WELL[{W2}],0)")

© 1990-2018 Petroleum Experts Limited


139 OpenServer

For i = 0 To 19
Cells(36+i, 6) = DoGet("GAP.MOD[{PROD}].WELL[{W2}].PCDATA[0][0]
["+ CStr(i)+"]")
Cells(36+i, 7) = DoGet("GAP.MOD[{PROD}].WELL[{W2}].PCDATA[0][1]
["+ CStr(i)+"]")
Cells(36+i, 8) = DoGet("GAP.MOD[{PROD}].WELL[{W2}].PCDATA[0][2]
["+ CStr(i)+"]")
Next i
4.2.38 WELLCALC (well)
ARGUMENTS
well – Refers to the well tag in the currently loaded model.
The structure used to define this argument will be as follow: MOD[i].WELL[j]
Where the index i refers to the index or label of the model considered and the
index j refers to the index or label (i.e. between {}) of the well considered.

DESCRIPTION
This function performs the same calculation than the GAP 'Model Validation' screen.

The WELLCALC(well) command performs the same task as the PACALC(well)


command and the ACTUALCALC(well) command. Thus all these three commands will
perform the VLP/IPR GAP Model Validation calculation.

The following example shows the use of the WELLCALC(well) option.

ASSOCIATED VARIABLES
The function operates on the 'Model Validation' variables in the well.

EXAMPLE
An example of its use with a gaslifted well labelled ‘w1’ would be –

DoSet "(GAP.MOD[0].WELL[{W1}].MeasuredLiqRate"), 1000


DoSet "(GAP.MOD[0].WELL[{W1}].MeasuredAlq"), 2.1
DoSet "(GAP.MOD[0].WELL[{W1}].MeasuredPres"), 200
DoSet "(GAP.MOD[0].WELL[{W1}].MeasuredGOR"), 650
DoSet "(GAP.MOD[0].WELL[{W1}].MeasuredWC"), 42

DoGAPFunc "(GAP.WELLCALC(MOD[0].WELL[{W1}])")

QLIQEST = DoGet("(GAP.MOD[0].WELL[{W1}].EstimatedLiqRate"))
QGOREST = DoGet("(GAP.MOD[0].WELL[{W1}].EstimatedGOR"))
QWCEST = DoGet("(GAP.MOD[0].WELL[{W1}].EstimatedWC"))

The syntax for the PACALC and the ACTUALCALC commands is as shown in the
following lines.

DoCmd ("GAP.WELLCALC(MOD[{PROD}].WELL[{W1}])")

OpenServer User's Manual


GAP and OpenServer 140

DoCmd ("GAP.PACALC(MOD[{PROD}].WELL[{W1}])")
DoCmd ("GAP.ACTUALCALC(MOD[{PROD}].WELL[{W1}])")

Model Validation using IPR dP Shift:


When the model validation is run via the OpenServer command WELLCALC, the IPR
shift tickbox in the well model validation screen is ignored; by default the calculation will
be performed with the DP shift. Instead the WELLCALC command accepts an extra
argument (1 or 0), which determines whether or not the IPR shift is applied (a value of 1
applied the shift). In the OpenServer manual the second argument is not documented.

Examples:

WELLCALC(GAP.MOD[{PROD}].WELL[{Well2}],0) – performs model validation without


dP shift.

WELLCALC(GAP.MOD[{PROD}].WELL[{Well2}],1) – performed model validation with


dP shift.

4.2.39 MOD[i].CopyControls (from, to, SkipFNAs)


ARGUMENTS
From – Enables to specify which column is considered as the source column.
The following keywords are used:
“MEASURED” – Refers to the measured data column
“ACTUAL” – Refers to the column containing the current data used by the solver
"OPTIMISED" - Refers to the column containing the data determined after an
optimised solver run.
"RULEBASED" - Refers to the column containing the data determined after an
RBNS solver run.
“MINIMUM” – Refers to the minimum value column.
“MAXIMUM” – Refers to the maximum value column.

To – Enables to specify in which column the source column is to be copied. The same
keywords that the from argument keywords are used.

SkipFNAs (optional) – Enables to avoid copying the empty zones. In order to use this
function, an argument value of 1 should be introduced.

DESCRIPTION
This function copies a chosen column of the Equipment control screen into a specified
column in the same screen.

© 1990-2018 Petroleum Experts Limited


141 OpenServer

An example will be to copy the Optimised column in the Actual column after a
satisfactory optimised solver run for instance to use the optimised values obtained as
default values for the next runs.

4.2.40 MOD[i].ResetControls (column)


ARGUMENTS
column – Enables to specify which column is to be deleted.
The following keywords are used:
“MEASURED” – Refers to the measured data column
“ACTUAL” – Refers to the column containing the current data used by the solver
"OPTIMISED" - Refers to the column containing the data determined after an
optimised solver run.
"RULEBASED" - Refers to the column containing the data determined after an
RBNS solver run.
“MINIMUM” – Refers to the minimum value column.
“MAXIMUM” – Refers to the maximum value column.

DESCRIPTION
This function resets to zero the values of a specific column in the Equipment control
screen.

4.2.41 MOD[i].RESETSCHEDULE (type, equiptype)


ARGUMENTS
type (optional) – Refers to the type of scheduled element to reset.
The following keywords are used:
“EVENT”– Refers to all the schedule events (i.e. change constraints, start and
stop wells, etc…)
“DCQ” – Refers to all the DCQ scheduling events

equiptype (optional) – Refers to the type of equipment (i.e. “WELL”, “JOINT”, etc…) in
which the scheduling needs to be reset.

If the optional keywords are not used, the entire network schedule will be reset.

DESCRIPTION
This function resets any scheduling data associated with the network elements
specified.

4.2.42 MOD[i].VALIDATE (solverorpred)


ARGUMENTS
solverorpred (optional) – Enables to specify which input data needs to be validated.

OpenServer User's Manual


GAP and OpenServer 142

The following options are available:


0 – The input data needed for solver calculation is validated.
1 – The input data needed for prediction calculations is validated.
2 – The input data needed for both solver and prediction calculation is validated.
The default value used is 2.

DESCRIPTION
This functions validates all the input data needed for both solver and prediction
calculations, at model level.
The function returns 0 if all the model considered are valid, and a value # 0 if it is not the
case.

4.2.43 GROUPS

The following list of commands would be used to access the group variable via
OpenServer

Command Description
"equip" refers to the tag of the equipment
GROUP[i].ADDMEMBER (equip) and the function adds the node specified to
the given group
GROUP[i].REMOVEALLMEMBERS () This function removes all the members from
the given group
Use this command to remove a given piece
GROUP[i].REMOVEMEMBER (equip) of equipment from the group where: "equip"
refers to the tag of the given piece of
equipment that will be removed
EQUIP[i].ADDTOGROUP (group) This function adds the node considered to
the given group

Variables Description
GAP.MOD. Counts the number of connected elements
[{PROD}].GROUP[{GROUP1}].member.cou to a given group
nt
Returns the label of a given member where
GAP.MOD. 'i' corresponds to the given member index
[{PROD}].GROUP[{GROUP1}].member[ returned using the"GAP.MOD.
i].label [{PROD}].GROUP[{GROUP1}].member.cou
nt" string
GAP.MOD. Returns the "type" of equipment for the
[{PROD}].GROUP[{GROUP1}].member[ given group member index 'i'
i].type
GAP.MOD. Returns the sequential index of the piece of
[{PROD}].GROUP[{GROUP1}].member[ equipment when it was added to the given
i].Index GAP model

© 1990-2018 Petroleum Experts Limited


143 OpenServer

GAP.MOD.[{PROD}].EQUIP[i].label Returns the label of the equipment based


on the specified model index (i) value

4.2.44 EQUIP[i].ADDTOGROUP (group)


ARGUMENTS
equip – Refers to the tag of the group considered.

DESCRIPTION
This functions adds the node considered to the group specified.

4.2.45 EQUIP[i].BYPASS ()
ARGUMENTS
None.

DESCRIPTION
This function bypasses the node considered.

EXAMPLE
To bypass a compressor called Compr1, the following command can be used:

DoGAPFunc ("GAP.MOD[{PROD}].COMP[{Compr1}].bypass()")

4.2.46 EQUIP[i].DISABLE ()
ARGUMENTS
None

DESCRIPTION
This function disables the node considered.

See node.ENABLE for enabling nodes.

EXAMPLE
If the well w1 is to be disabled, the function call will be:

DoGAPFunc ("GAP.MOD[0].WELL[{w1}].DISABLE()")

OpenServer User's Manual


GAP and OpenServer 144

4.2.47 EQUIP[i].ENABLE ()
ARGUMENTS
None

DESCRIPTION
This function enables the node considered.
See node.DISABLE for disabling nodes.

EXAMPLE
If well w1 is to be enabled, the function call is:

DoGAPFunc ("GAP.MOD[0].WELL[{w1}].ENABLE()")

4.2.48 EQUIP[i].ISMEMBEROFGROUP(group)
ARGUMENTS
Group – Refers to the tag of the group considered.
(e.g. GAP.MOD[{PROD}].GROUP[{Group1}] for instance).

DESCRIPTION
This function checks if the equipment considered is included in the group specified.

ASSOCIATED VARIABLES
The function returns the following variables:
- 0 if the equipment considered does not belong to the group specified.
- 1 if the equipment considered does belong to the group specified.

4.2.49 EQUIP[i].ISCONNECTEDTO(equip)
ARGUMENTS
Equipment – Refers to the tag of the equipment verified for connection.
(e.g. GAP.MOD[{PROD}].JOINT[{J1}] for instance).

DESCRIPTION
This function checks if the equipment considered is directly connected to another
equipment, i.e. if equipment unit defined as an argument is located just after the master
equipment. For example, the joint located just after the well is considered as connected
to that well; however, the well is not connected to a separator located further
downstream (i.e. linked via set of pipelines).

ASSOCIATED VARIABLES
The function returns the following variables:
- 0 if the equipment considered is not connected to the equipment in the
argument.
- 1 if the equipment considered is connected to the equipment in the argument.

© 1990-2018 Petroleum Experts Limited


145 OpenServer

EXAMPLE
To verify whether the joint J1 is located just after the well W1 the following command will
be used:

DoGAPFunc
("GAP.MOD[0].WELL[{W1}].ISCONNECTEDTO(MOD[0].JOINT[{J1}])")

4.2.50 EQUIP[i].ISRELATEDTO(equip)
ARGUMENTS
Equipment – Refers to the tag of the equipment verified for connection.
(e.g. GAP.MOD[{PROD}].JOINT[{J1}] for instance).

DESCRIPTION
This function checks if the equipment considered is linked to another equipment, i.e. if
equipment unit defined as an argument is located within the same network as the
master equipment. For example, the well is related to a separator to which it is flowing. It
is also considered related to any equipment unit in this network. If equipment is not
linked to another equipment in any way, then is is considered as not related.

ASSOCIATED VARIABLES
The function returns the following variables:
- 0 if the equipment considered is not related to the equipment in the argument.
- 1 if the equipment considered is related to the equipment in the argument.

EXAMPLE
To verify whether the well W1 is flowing to the separator Sep1 the following command
will be used:

DoGAPFunc
("GAP.MOD[0].WELL[{W1}].ISRELATEDTO(MOD[0].SEP[{Sep1}])")

4.2.51 EQUIP[i].MASK ()
ARGUMENTS
None

DESCRIPTION
This function masks the node considered.
See node.UNMASK for unmasking nodes.

EXAMPLES
If well w1 is to be masked, the function call is:

DoGAPFunc ("GAP.MOD[0].WELL[{w1}].MASK()")

OpenServer User's Manual


GAP and OpenServer 146

4.2.52 EQUIP[i].REMOVEALLGROUPMEMBERSHIPS ()
ARGUMENTS
None

DESCRIPTION
This function removes all the exiting group links of the considered node.

4.2.53 EQUIP[i].REMOVEFROMGROUP (group)


ARGUMENTS
group – Refers to the tag of the group considered.

DESCRIPTION
This functions removes the node considered of the group specified.

4.2.54 EQUIP[i].UNBYPASS ()
ARGUMENTS
None

DESCRIPTION
This functions un-bypasses the node considered.
See node.BYPASS for bypassing nodes.

4.2.55 EQUIP[i].UNMASK ()
ARGUMENTS
None

DESCRIPTION
This function unmasks the node considered.
See node.MASK for masking nodes.

EXAMPLE
If well w1 is to be unmasked, the function call is:

DoGAPFunc ("GAP.MOD[0].WELL[{w1}].UNMASK()")

4.2.56 EQUIP[i].VALIDATE (solverorpred)


ARGUMENTS
solverorpred (optional) – Enables to specify which input data needs to be validated.
The following options are available:

© 1990-2018 Petroleum Experts Limited


147 OpenServer

0 – The input data needed for solver calculation is validated.


1 – The input data needed for prediction calculations is validated.
2 – The input data needed for both solver and prediction calculation is validated.
The default value used is 2.

DESCRIPTION
This functions validates all the input data needed for both solver and prediction
calculations, at node level.
The function returns 0 if the model considered is valid, and a value # 0 if it is not the
case.

4.2.57 TANK[i].CalcDCTankCurPres(CurProd)
ARGUMENTS
None

DESCRIPTION
Calculates the Current Pressure for the tank based on the Current Production specified.
This is for Decline Curve Tanks only. The CURPROD must be replaced by the value of
the Current Production for which the calculations need to be performed.

EXAMPLE
The following command will perform the calculation for the calculation for the Current
Reservoir Pressure based upon the value of the Current Production specified in the
string. in the above example the calculation is being performed to determine the
pressure when the cumulative production is 1.22501 units.

DoCmd ("GAP.MOD[{PROD}].TANK[{T1}].CalcDCTankCurPres(1.22501)")

This command can be used in combination with

DoGet ("GAP.MOD[{PROD}].TANK[{T1}].TCURRESPRED")

to obtain the Current Pressure.

4.2.58 PIPE[i].DOMATCH ()
ARGUMENTS
None

DESCRIPTION
This function matches the available pipeline test data.

OpenServer User's Manual


GAP and OpenServer 148

4.2.59 IPR[i].CONINGMATCH ()
ARGUMENTS
None

DESCRIPTION
This function matches the available coning data in the selected IPR.

4.2.60 IPR[i].DISABLE ()
ARGUMENTS
None

DESCRIPTION
This function disables the ipr considered.
See ipr.ENABLE for enabling nodes.

EXAMPLE
To disable the Layer 1 of well W1 the following code can be used.

DoCmd ("GAP.MOD[0].WELL[{W1}].IPR[0].DISABLE()")

4.2.61 IPR[i].ENABLE ()
ARGUMENTS
None

DESCRIPTION
This function enables the ipr considered.
See ipr.DISABLE for disabling nodes.

EXAMPLE
To disable the Layer 2 of well W1 the following code can be used.

DoCmd ("GAP.MOD[0].WELL[{W1}].IPR[1].ENABLE()")

4.2.62 IPR[i].IPRMATCH ()
ARGUMENTS
None

© 1990-2018 Petroleum Experts Limited


149 OpenServer

DESCRIPTION
This function matches the available ipr dataset.

4.2.63 IPR[i].MASK ()
ARGUMENTS
None

DESCRIPTION
This function masks the ipr considered.

4.2.64 IPR[i].UNMASK ()
ARGUMENTS
None

DESCRIPTION
This function unmasks the ipr considered.

4.2.65 IPR[i].COMPOSITION.IMPORTPRPFILE("FilePath")
ARGUMENTS
File Path of the *.prp file to be imported into the IPR layer.

DESCRIPTION
This function imports a composition (*.prp file) into the IPR layer of a compositional GAP
model. The function is designed to import a new composition into an IPR layer which
already has a composition defined and will not work if the existing data entry is blank.

EXAMPLE
To import a *prp file into layer 0 of well1 from the file path, "C:\Program Files (x86)
\Petroleum Experts\IPM 10\Samples\prosper\Test.prp":

DoCmd
(GAP.MOD[{PROD}].WELL[{Well1}].IPR[0].Composition.importprpfile("C:\Test.prp"))

4.3 GAP Internal Script


While it is possible to control GAP models externally using Visula Basic applications, an
internal GAP scripting procedures are also available.

The script actions can be included at different levels within the prediction process.

OpenServer User's Manual


GAP and OpenServer 150

Following subroutines are available:


PredProlog - subroutine that is executed once at the start of the prediction run
PredEpilog - subroutine that is executed once at the end of the prediction run
PredStepProlog - subroutine that is executed at the start of every prediction
step
PredStepEpilog - subroutine that is executed at the end of every prediction step
PredStepSolverProlog - subroutine that is executed at the start of every solver
iteration
PredStepSolverEpilog - subroutine that is executed at the end of every solver
iteration

GAP WORKFLOW AND INTERNAL SCRIPT SUBROUTINES

The workflow below illustrates the succession of actions that GAP follows during a
prediction process, and illustrates at which stage the different sections of the GAP
internal scripting are taken into account.

Build systems ()

For (each system)


Script.DoPredProlog (system)

Run tank history simulation to start of prediction ()

For (each prediction timestep)


{
do
{
redo = false
For (each system)
Script.DoPredStepProlog (system)

Apply schedule for the current timestep ()

Refresh IPRs from tank ()

Apply abandonment constraints ()

Refit performance curves (for PC wells only)

For (each system)


{
Script.DoPredStepSolverProlog (system)

Solve Network ()

Script.DoPredStepSolverEpilog (system)

© 1990-2018 Petroleum Experts Limited


151 OpenServer

If (system = production) then Set injection rate constraints of


injection systems ()

For (each system)


Script.DoPredStepEpilog (system)
} while (redo = true)

Run tank model timestep ()

Save prediction step results ()

If (requested) Save prediction step snapshot ()


}

For (each system)


Script.DoPredEpilog (system)

Destroy systems ()

For more information using GAP script, please see Section 2.12 of the GAP User
Guide.

OpenServer User's Manual


Chapter

5
153 OpenServer

5 MBAL and OpenServer

5.1 Overview
This section describes OpenServer commands and variables for MBAL.

As with all of the IPM tools, the easiest way to obtain any OpenServer tag is by holding
Ctrl and Right-Clicking the data entry in question.

For reference, all available variables are listed in the Variable Text String section of
the guide. A tool description is also provided, however, it is recommended to use the
above Ctrl + Right-Click keyboard and mouse action to capture the required variable
OpenServer tag.

It is important to note that it is not possible to obtain the OpenServer tag for a
calculation button by holding Ctrl and Right-Clicking. A list of all corresponding
DoCmd functions are listed in the Command section of this guide.

Use of the DoSet and DoGet functions for variables which can take a value from a pre-
defined list e.g. oil, water or gas will also be discussed and Unit handling using the
DoSet and DoGet calls.

5.2 Finding a Variable Text String


MBAL (and all IPM tools) has a very quick and easy method for finding the text string for
a particular variable.

First start the MBAL program. Open the sample file OIL.MBI. Open the tank dialog by
selecting Input | Tank Data.

Suppose the objective is to find the OpenServer variable string for the porosity. This
can be achieved by holding Ctrl and Right-Clicking the porosity input, as shown below.

OpenServer User's Manual


MBAL and OpenServer 154

This dialog displays the text string for the porosity variable. This can be used in the
GetValue and SetValue functions. The Copy button can be used to copy the text string
to the clipboard so it can then be pasted into the VBA macro or batch file.

5.3 Date Handling Within MBAL


By default, MBAL uses dates in DD/MM/YYYY format. This date can however be
modified using OpenServer.

To modify the date format of the tank / well history, the following OpenServer string is
used:
MBAL.DATEUNITINPUT
To modify the date format of the prediction results the following OpenServer string is
used:
MBAL.DATEUNITOUTPUT

Both of the above are implemented with integer values as per the below table

0 Days
1 Weeks
2 Month
3 Year

© 1990-2018 Petroleum Experts Limited


155 OpenServer

4 Date (DD/MM/YYYY)
5 Date/Time (DD/MM/YYYY 00:00:00)
6 Hour
7 Minute
8 Seconds

To modify the reference date set in the Options of MBAL, the following OpenServer
string can be used:
MBAL.MB[0].REFDATE

NOTE: When the date is retrieved from MBAL into the Excel spreadsheet using TIME
keyword, Excel uses its internal conversion to translate the date. This sometimes leadS
to erroneous date representation in Excel; more specifically day and month numbers
can be flipped (MM/DD/YYYY would be seen in Excel). To avoid this CDate() VBA
command can be used for date conversion prior to passing the data to Excel.

5.4 Commands
This section describes the possible calculations and other functions that can be called
in MBAL using the DoCmd function. The following are a list of those functions and the
text strings used to call them.

Any commands beginning with MBAL.MB can only be used if the material balance tool
is selected, where the 'MB' portion of the string indicates the material balance tool is
being used.

5.4.1 General
MBAL.ChangeTool=MB Change to the material balance tool
MBAL.ChangeTool=MC Change to the Monte Carlo tool
MBAL.ChangeTool=DC Change to the decline curve tool
MBAL.ChangeTool=1D Change to the 1D tool
MBAL.ChangeTool=ML Change to the multi-layer tool
MBAL.ChangeTool=TG Change to the tight gas model
MBAL.OpenFile Open an MBAL file
Example:
DoCmd ("MBAL.OpenFile(C:\Test\Oil.MBI") for a
macro based file path
DoCmd ("MBAL.OPENFILE=" + Range("a3")) for a
spreadsheet based file path, and:
DoCmd ("MBAL.OPENFILE(""" + Range("a3") +

OpenServer User's Manual


MBAL and OpenServer 156

""")") for a spreadsheet based file path


MBAL.SaveFile("FilePath" Saves an MBAL file
)
MBAL.NewFile Resets all the input data and is equivalent to the menu
item File New

5.4.2 Material Balance Commands


MBAL.MB.RunPrediction
Runs a material balance prediction

MBAL.MB.RunSimulation
Runs a material balance history simulation

MBAL.MB.SavePred=<New stream name>


MBAL.MB.SavePred(“PredCopy1”)
Both commands copy the current prediction stream to the specified stream name e.g.:-
MBAL.MB.SavePred=No breakthrus
Note that because the ‘=’ character is used in the command, it can not be used in the
stream name itself.

MBAL.MB.SaveHist=<New stream name>


MBAL.MB.SaveHist(“HistCopy1”)
Both commands copy the current history simulation stream to the specified stream
name e.g:-
MBAL.MB.SavePred=First Match
Note that because the ‘=’ character is used in the command, it can not be used in the
stream name itself.

MBAL.MB.IMPORTTPD(<well text string>,”<TPD file name>”)


Imports the specified TPD file into the specified well e.g.:-
MBAL.MB.IMPORTTPD(MBAL.MB.PREDWELL[0],”C:\OIL1.TPD”)

MBAL.MB.IMPORTMBV(<well text string>,”<MBV file name>”)


Imports the specified MBV file into the specified well e.g.:-
MBAL.MB.IMPORTMBV(MBAL.MB.PREDWELL[0],”C:\OIL1.MBV”)

MBAL.MB.ALLOCTANKPRESSRATE(<tank text string>)


Calculates the tank production history pressure and rate from the entered well
production history. Equivalent to using the 'Calc' button on the tank production history
input dialogue e.g.:-
MBAL.MB.ALLOCTANKPRESSRATE(MBAL.MB.TANK[1])

MBAL.MB.ALLOCTANKRATEONLY(<tank text string>)


Calculates the tank production history rate only from the entered well production history.
Equivalent to using the 'Calc Rate' button on the tank production history input dialogue

© 1990-2018 Petroleum Experts Limited


157 OpenServer

e.g.:-
MBAL.MB.ALLOCTANKRATEONLY(MBAL.MB.TANK[1])

MBAL.MB.RESETREGRESSTANKHIST(<tank text string>)


Resets the inputs to the history matching regression for the specified tank. It will reset
the start values for each regression parameter to the current stored value. This is
equivalent to selecting the 'Reset' button in the regression input dialogue. e.g.:-
MBAL.MB.RESETREGRESSTANKHIST(MBAL.MB.TANK[{TankLabel}])

MBAL.MB.REGRESSTANKHIST(<tank text string>)


Performs the history matching regression for the for the specified tank. e.g.:-
MBAL.MB.REGRESSTANKHIST(MBAL.MB.TANK[1])

There are several commands that can be used to build models from scratch. Their use
is demonstrated in the sample spreadsheet BUILD MODEL.XLS.

MBAL.MB.VALIDATE
It is possible to create new tanks, wells etc using the OpenServer. It is also possible to
populate the tank, well etc with the various items of data. However normally the object
will be marked as invalid (shown as red on the MBAL interface) until the user enters the
appropriate dialogue. This function will automatically validate all of the objects in the
material balance tool without having to enter each of the dialogues.

MBAL.MB.LINKITEMS(<object 1 text string>, <object 2 text string>)


This command will link the two specified objects. Depending on the type of objects
being connected, the command may also create intermediate objects e.g. if two tanks
and connected then a transmissibility will also be created. An example command is:-
MBAL.MB.LINKITEMS(MBAL.MB.TANK[1],MBAL.MB.PREDWELL[2])

MBAL.MB.BREAKLINK(<object 1 text string>, <object 2 text string>)


This command will break the link between two specified objects. An example command
is:-
MBAL.MB.BREAKLINK(MBAL.MB.TANK[1],MBAL.MB.LEAK[2])

See also the section below on Material_Balance_Step-by-Step_Prediction

5.4.3 Monte Carlo


MBAL.MC.Calculate
Runs a Monte-Carlo calculation.

5.4.4 1D Model
MBAL.1D.RunSimulation :
Runs a 1D model simulation.

OpenServer User's Manual


MBAL and OpenServer 158

5.4.5 Decline Curve


MBAL.DC.RunPrediction
Runs a decline curve simulation.

5.4.6 Multi-Layer
MBAL.ML.Calculate
Runs a multi-layer calculation.

MBAL.ML.Validate
Performs a validation for the data entered.

5.4.7 Production Allocation


MBAL.PA.RUNALLOCATION
Runs a allocation calculation.

MBAL.PA.SavePred=<New stream name>


MBAL.PA.SavePred(“AllocCopy1”)
Both commands copy the current prediction stream to the specified stream name e.g.:-
MBAL.PA.SavePred=Case 1
Note that because the ‘=’ character is used in the command, it can not be used in the
stream name itself.

See also the section below on Production Allocation Step-by-Step Prediction.

5.4.8 Tight Gas


MBAL.TG.RunPrediction
Runs a tight gas prediction

© 1990-2018 Petroleum Experts Limited


159 OpenServer

5.4.9 PVT
All the PVT commands can be used for any tool that has a PVT description i.e., MB,
MC, etc. The commands below are shown for the material balance tool. The strings can
be used for the MC or ML, etc., tools by simply replacing the MB with the corresponding
tool name designation i.e., MC, etc.

MBAL.MB.PVT.INPUT.CALCULATE
Performs a PVT calculation of fluid properties.

MBAL.MB.PVT.INPUT.MATCHCURRENT
Performs a PVT match calculation on the current correlation only.

MBAL.MB.PVT.INPUT.MATCHALL
Performs a PVT match calculation on all the correlations.

MBAL.MB.PVT.INPUT.MATCHCURRENT(OIL)
Performs a PVT match calculation on the current correlation only for the oil part of
a generalised material balance dataset.

MBAL.MB.PVT.INPUT.MATCHCURRENT(CON)
Performs a PVT match calculation on the current correlation only for the
condensate part of a generalised material balance dataset.

MBAL.MB.PVT.INPUT.MATCHALL(OIL)
Performs a PVT match calculation on all the correlations for the oil part of a
generalised material balance dataset.

MBAL.MB.PVT.INPUT.MATCHALL(CON)
Performs a PVT match calculation on all the correlations for the condensate part
of a generalised material balance dataset.

MBAL.MB.PVT.INPUT.IMPORT(”<PVT file name>”)


Imports a PVT file into the PVT dataset if general material balance fluid option
not used. An example command is:-
MBAL.MB.PVT.INPUT[1].IMPORT(“C:\DOCS\OILWELL.PVT”)

MBAL.MB.PVT.INPUT.IMPORT(OIL,”<PVT file name>”)


Imports a PVT file into the oil part of the PVT dataset if general material balance fluid
option used.

MBAL.MB.PVT.INPUT.IMPORT(CON,”<PVT file name>”)


Imports a PVT file into the gas/condensate part of the PVT dataset if general material
balance fluid option used.

OpenServer User's Manual


MBAL and OpenServer 160

MBAL.MB[0].PVT.SETUP.PTS.ADD("ptsname")
Adds a path to surface object definition

MBAL.MB[0].PVT.SETUP.PTS[i].REMOVE
Removes the i path to surface object. All the indices of the path to surface after
the one being removed are going to change: recommended to use strings.

MBAL.MB[0].PVT.SETUP.PTS[i].IMPORT("filename")
Imports a *.prc file to the i path to surface object

MBAL.MB[0].PVT.SETUP.PTS[i].EXPORT("filename")
Exports the i path to surface to a *.prc file

MBAL.MB[0].PVT.SETUP.PTS[i].RENAME("newname")
Renames the i path to surface object

MBAL.MB[0].PVT.SETUP.PTS[i].ADDEQUIPMENT(equip, label, coordinates)


Adds equipment to the i path to surface object.
Arguments
equip - Separator, Joint, Chiller
label - label of equipment
coordinates - xy coordinates of equipment (from 0 to 1)

MBAL.MB[0].PVT.SETUP.PTS[i].ADDCONNECTION(equip1, label1, output1, equip2,


label2, input2)
Adds a connection between two pieces of equipment for the i path to surface
Arguments
equip1 - Separator, Joint, Chiller, Source, Export
label1 - label of equipment
output1 - Liquid, Vapour, Output
equip2 - Same as equip1
label2 - label of equipment
input2 - Liquid, Vapour, Input

MBAL.MB[0].PVT.SETUP.PTS[i].REMOVEEQUIPMENT(equip, label)
Removes equipment from the i path to surface object.
Arguments
equip - Separator, Joint, Chiller
label - label of equipment

© 1990-2018 Petroleum Experts Limited


161 OpenServer

MBAL.MB[0].PVT.SETUP.PTS[i].REMOVECONNECTION(equip1, label1, output1,


equip2, label2, input2)
Removes a connection between two pieces of equipment in the i path to surface
object. For argument definitions see adding a connection above.

MBAL.MB[0].PVT.SETUP.PTS[i].UPDATEVALIDATION
Updates the validation flags used in the interface. To be used when you build a
path to surface object from the OpenServer

All of the PVT commands act on a PVT dataset. In the case of MC and ML and MB with
single tank there is only ever one dataset. But for multi-tank MB we can have more than
one dataset. In this case the above commands can be modified to perform the
command on different datasets e.g.

MBAL.MB.PVT.INPUT[1].CALCULATE will calculate the index 1 dataset and

MBAL.MB.PVT.INPUT[{LOWER}].CALCULATE will calculate the dataset called


LOWER.

5.5 OpenServer Code Examples


The following section provides some of the OpenServer macro examples for MBAL.

5.5.1 DoGet, DoSet and DoCmd Example


The following OpenServer code example will open an existing MBAL file located in the
IPM samples directory, set the OOIP to a new value, perform the prediction and extract
the date and oil rate results.

The OpenServer strings were obtained by holding Ctrl and Right-Clicking the
appropriate dialogues as mentioned previously.

The code will be written in the OpenServer template Excel file located in: C:\Program
Files\Petroleum Experts\IPM XX\Samples\openserver\Template\OpenServer
Template.xls.

NOTE: MBAL must already be opened since the code does not specifically initialises
an instance of MBAL.

Macro Code
Sub Macro() 'Macro name

Dim PredFinished As Integer, iRow As Integer, iCount As Integer 'Declare

OpenServer User's Manual


MBAL and OpenServer 162

variables

Connect 'Establishes the link between Excel and MBAL

DoCmd ("MBAL.OPENFILE(C:\Program Files\Petroleum Experts\IPM 8


\Samples\MBAL\Reference Examples\oil.mbi)") 'Opens the MBAL file stated in the file
path

DoSet ("MBAL.MB[0].TANK[{Tank-1}].OOIP"), 220 'Sets the tank OOIP value to


220MMstb. Alternatively, a cell reference could given to pass a value directly from Excel
to MBAL

DoCmd ("MBAL.TG.RunPrediction") 'Runs the prediction

i = 0 'i = 0 is required to capture the first prediction date i.e., MBAL first index =
0

iCount = DoGet("MBAL.MB[0].TRES[{Prediction}][{Prediction}].COUNT")
'counts the number of prediction steps and eliminates the need to have prior knowledge
of the number of prediction steps

Do 'do loop

Cells(5 + i, 3) = DoGet("MBAL.MB[0].TRES[{Prediction}][{Prediction}][" &


CStr(i) & "].TIME") 'Retrieves the date each step
Cells(5 + i, 4) = DoGet("MBAL.MB[0].TRES[{Prediction}][{Prediction}][" &
CStr(i) & "].OILRATE") 'Retrieves oil rate each step

i=i+1
Loop While (i < iCount) 'Performs the loop to extract the results while the
prediction advances

Disconnect 'Disconnects the Excel communication

MsgBox "Macro completed"

End Sub

5.5.2 List Variables


Consider a variable that is normally selected in the user interface using a combo box,
list box, tick box or radio buttons rather than typing in a number.

The variable can only take a value from a pre-defined list e.g. oil, water, gas,
condensate.

If it is desired to change the value of this type of variable using DoSet, a predefined text
string must be passed as the Value argument.

© 1990-2018 Petroleum Experts Limited


163 OpenServer

For example, if the fluid type is to be changed to either "OIL", "GAS", "CON" or “WAT”.
The list of possible values are listed for each variable below or can be found using the
Ctrl + Right Click technique described above.

The following example illustrates the use of the DoSet function:

Dim Server As Object


Dim Value As String
Dim PorVar As String
Sub DoOpenServer
Set Server = CreateObject("PX32.OpenServer.1")
Value = “CON”
PorVar = “MBAL.MB.TANK[{S-TANK}].TYPE”
SetValue(PorVar,Value)
Set Server = Nothing
End Sub

Similarly, the DoGet function will return the text string corresponding to the given
variable.

5.5.3 Material Balance Step-by-Step Prediction


This section describes how OpenServer can be used to run a material balance
prediction step-by-step. This allows certain parts of the model to be changed during the
prediction, if necessary in response to various calculated variables.

The simplest client code in VBA to preform a step by step prediction will look like:

Server.DoCommand(“MBAL.MB.STARTPRED”)
Do
Server.DoCommand(“MBAL.MB.NEXTSTEPPRED”)
PredFinished = Server.GetValue("MBAL.MB.PREDFINISHED")
CurrentTime = Server.GetValue("MBAL.MB.CURRENTPREDTIME ")
Loop While (PredFinished = False )
Server.DoCommand(“MBAL.MB.ENDPRED”)

The STARTPRED command will initialize the prediction. Then call the
NEXTSTEPPRED command a number of times to do the next prediction step. Each
time the function is called, the latest value of the internal variable
MBAL.MB.PREDFINISHED will indicate if the prediction is finished.

The internal variable specified by MBAL.MB.CURRENTPREDTIME indicates how far


the prediction has progressed. Once the prediction has finished, call the ENDPRED
command to terminate the prediction.

Data Change During Prediction

OpenServer User's Manual


MBAL and OpenServer 164

It is possible to change some of the input data to the prediction between calls of the
NEXTSTEPPRED command. But be aware that it is only possible to change a sub-set
of the input data. In general we have endeavored to allow users to change data which is
likely to be altered in the real world situations. As an obvious case, we can not change
the OOIP of a tank in the middle of the prediction. However it is certainly possible that a
well is worked over during its life so it should be possible to change the PI.

The data which can not be changed includes:


All PVT input data
Most tank data except relative permeability curves

The data which can be changed includes:


Tank relative permeability curves
Prediction production and constraints
Most prediction well data
Well schedule

If in doubt, the simplest solution is to try changing the data and check if it effects the
results.

NOTE
Note also that any changes to data will only have any effect on the remaining part of the
prediction. This is also true of time based input data such as the drilling schedule. For
example, if a prediction was performed to 2020 and then a new well added starting in
2010, it will have no effect on the prediction results up to 2020.

At any point in the prediction, it is possible to calculate the performance of the wells in
the drilling schedule at the current tank conditions. Before calling the command
NEXTSTEPPRED, the MBAL.MB.CALCWELLS command may be called any
number of times. The results from this calculation are stored in the last row of the well
results.

WARNING:
The rates in the well results are instantaneous rates for one well. This means that if it is
desired to examine field rates, then they must be calculated using the number of wells in
the drilling schedule. Additionally, any imposed downtimes and well start and end times
must also be considered if it is desired to calculate cumulative rates from the well
results.

If the well schedule is changed during a prediction, do NOT delete rows in the table. If it
is desired to stop the entry in the well schedule contributing to the prediction then
change the end date or set the downtime factor to 100%.

A number of examples have been included with the installed samples. These show
details of the above features and show how some simple extensions to the standard
material balance prediction can be implemented. See the following section for a list of
these examples.

© 1990-2018 Petroleum Experts Limited


165 OpenServer

5.5.4 Production Allocation Step-by-Step Prediction


This section describes how OpenServer can be used to run a step-by-step production
allocation. Performing the allocation using a step-by-step approach enables certain
parts of the model to the changed during the prediction.

The simplest client code in VBA to preform a step by step prediction will look like:

Server.DoCommand(“MBAL.PA.STARTALLOC”)
Do
Server.DoCommand(“MBAL.PA.NEXTSTEPALLOC”)
AllocFinished = Server.GetValue("MBAL.PA.ALLOCFINISHED")
CurrentTime= Server.GetValue("MBAL.PA.CURRENTALLOCTIME")
Loop While (AllocFinished = False )
Server.DoCommand(“MBAL.PA.ENDALLOC”)

The STARTALLOC command will initialize the prediction. Then call the
NEXTSTEPALLOC command a number of times to do the next allocation step. Each
time the function is called, retrieve the latest value of the internal variable
MBAL.PA.ALLOCFINISHED which will indicate if the prediction is finished.

The internal variable specified by MBAL.PA.CURRENTALLOCTIME indicates how far


the prediction has progressed. Once the prediction has finished, call the ENDALLOC
command to terminate the prediction.

Data Change During Allocation


It is possible to change some of the input data to the allocation between calls of the
NEXTSTEPALLOC command. But be aware that it is only possible to change a sub-
set of the input data. In general we have endeavored to allow users to change data
which is likely to be altered in the real world situations. As an obvious case, we can not
change the oil gravity in the middle of the allocation. However it is certainly possible that
a well is worked over during its life so it should be possible to change the PI.

The data which can not be changed includes:


All PVT input data
Most tank data except relative permeability curves

The data which can be changed includes:


Tank relative permeability curves
Most well data

If in doubt, the simplest solution is to try changing the data and check if it effects the
results.

OpenServer User's Manual


MBAL and OpenServer 166

NOTE
Note also that any changes to the data will only have any effect on the remaining part of
the allocation. This is also true of time based input data such as the layer production
schedule. For example, if an allocation was performed to 2020 and then a new layer is
added at 2010, the new layer will have no impact on the allocation results up to 2020.

A number of examples have been included with the installed samples and show details
of the above features and show how to implement simple extensions to the standard
production allocation.

5.6 Direct Access OPENSERVER

5.6.1 Overview

A material balance model is made up of several objects. These include tanks, wells and
inflows. There are also some control data such as manifold pressure, time steps etc.
The production prediction method in MBAL uses these objects plus the control data to
perform its calculations using the same set of smaller calculations.

For each prediction time step, and for each well the following parameters are
considered:
- Calculate the GOR, WCT, CGR, WGR for each layer given the current
saturations and relative permeabilities.
- Calculate the PVT for each layer
- Calculate the well performance given production constraints and common
manifold pressure
- Remove the well production from the appropriate tanks
- Calculate the pressure at the end of the time step

The MBAL prediction covers most situations commonly addressed by engineers.


However there are situations where a user may wish to run the prediction in a different
manner. For example they may be a requirement to have different manifold pressures.
Alternatively, it may be desired to use customised well performance calculations to
calculate well rates and still use MBAL to calculate the inflows GOR, WCT, etc.

In these situations it is now possible to write customised predictions since direct access
to the objects and low-level calculations has been provided. Macros can be written that
create the objects and call the low-level calculations in whatever form the user requires
to perform a specific type of prediction. The macro can also provide the control data
used to define manifold pressure, time steps etc.

Since we are working at a much lower level in the calculations, the commands given to
access to the temporary calculation variables as well as the input variables can be read
and change the cumulative rates in the tanks as well as being able to change the relative

© 1990-2018 Petroleum Experts Limited


167 OpenServer

permeabilities.

There are two levels of functions: The lower level functions provide the highest level of
flexibility and the higher level functions collect a number of lower level functions into a
single function to perform a common task.

High and low level functions can be called together in the same macro. So the higher
level functions can be used for the majority of the prediction macro and low level
functions can be called if any specialist behaviour is required.

Unlike the other uses of OpenServer, these functions do not operate on the data shown
in the MBAL interface. One still needs to run MBAL to use the functions, and the data
loaded by these function are not visible anywhere in the interface. Any data loaded in
MBAL whilst running a macro using these functions is unaffected by the macro.

We supply two example macros which are described in detail in the following sections
and recommend reviewing the code structures prior to writing a custom macro.

5.6.2 Summary

All commands and data tags used for the Direct Access OpenServer start with the
following prefix
MBAL.RL

The low-level commands work slightly differently from the standard OpenServer
commands. The commands are split into a number of sections with different sub-tags for
each command. and include:

GETDATA – general data


RESCALC – tank data and calculations
WELLDATA – well/IPR data and calculations
IPRVLPCALC – IPR/VLP intersection calculations
RELPERMIPR – relative permeability curves for layers/IPRs
RELPERMTANK – relative permeability curves for tanks

Many of the commands need large amounts of data to be passed to MBAL. For
example the WELLDATA command, used to read all the IPR data, needs to pass more
than 10 variables. To pass this data, there is a data block associated with each
command. One of the items in the data block is a command ID which determines which
command is to be called. The data block can be accessed using the normal DoGet and
DoSet commands.

For example, consider the situation where we wish to update a tank with new cumulative
rates. The first step is to read the current conditions and to do this we set the command
ID and tank number in the data block associated with the RESCALC command and

OpenServer User's Manual


MBAL and OpenServer 168

then call the command to read the data into the data block as per the following:

iCommand = 8 'Get tank data command


DoSet "MBAL.RL.SMBRESDATA.COMMANDID", iCommand
DoSet "MBAL.RL.SMBRESDATA.TANKNUM", iTankNo
DoCmd "MBAL.RL.RESCALC"

All the tank data will be in the SMBRESDATA data block and now the cumulative rates
in the data block can be changed. To write the data back to the tank, we now load the
Write Tank Data command ID into the data block and call the RESCALC command as
per the following:

iCommand = 9 'Set tank data command


DoSet "MBAL.RL.SMBRESDATA.COMMANDID", iCommand
DoSet "MBAL.RL.SMBRESDATA.TANKNUM", iTankNo
DoSet "MBAL.RL.SMBRESDATA.CUMGAS", CUMGAS
DoSet "MBAL.RL.SMBRESDATA.CUMOIL", CUMOIL
DoSet "MBAL.RL.SMBRESDATA.CUMWAT", CUMWAT
DoCmd "MBAL.RL.RESCALC"

Note that there are many other data items belonging to the tank which are retrieved and
set by the two DoCmd calls in the SMBRESDATA data block. If we are doing a Get
and Set a pair as above, we only need to set the items we want to change as the other
values in the data block will still be the same as from the read command.

5.6.3 High Level Example


The following example illustrates usage of the required functions to use to develop a
Direct Access OpenServer macro starting with high level functions:

This example is a VBA macro in an Excel spreadsheet called DA1.XLS is installed with
the program in the samples directory.

The purpose of the macro is to run a prediction similar to the standard macro except that
it uses different manifold pressures for each well.
The first command MBAL.RL.ALLREST should be called at the start of all macros as it
deletes any objects that might not have been cleaned up when running a previous
macro.

DoCmd "MBAL.RL.ALLRESET"

The next step is to create and initialize the data objects i.e., tanks, wells, layers and the
connections between them. In most cases, the simplest way to do this is to read the

© 1990-2018 Petroleum Experts Limited


169 OpenServer

objects from an existing *.MBI file. Low level functions do exist, which allow the objects
to be created without reference to a *. MBI file, and the MBAL interface is obviously the
most convenient way to set up the objects.

The MBAL.RL.INITIALISE function will read the objects from the *.MBI file specified in
the command tag and create objects matching those in the file and connect them
together as in the given *.MBI file. All the objects are now initialized and ready for
calculations to be performed. MBAL will then run the history simulation up to the time
specified in the ENDHISTORY data item, and if a value of -1 is used then MBAL will
automatically run the history to the end of the production history in the tanks.

The USESUBSTEP data item must be set to indicate if sub-steps should be used in the
history simulation, and if the value is set to zero, MBAL will only calculate at the times
specified in the production history. Alternatively, if the value is set to one, then MBAL
will also calculate sub-steps between the entered times.

After the INITIALISE function, we read and store the handle that MBAL gave to the file
we just read in a VBA variable. This is needed in various commands used later in the
macro.

Range("F12") = "Opening file and initialising the


model"
DoSet " M B A L .RL.SMBDATA.USESUBSTEPS", 0
dEndHistory = -1
DoSet " M B A L .RL.SMBDATA.ENDHISTORY", dEndHistory
FilePath = Environ("IPM_Samples")
FilePath = FilePath & "\mbal\Material Balance Examples
\Reference Example\\SIMPLE2.MBI"
DoCmd "MBAL.RL.INITIALISE(""" + FilePath + """)"
iMBIHandle = DoGet(" M B A L .RL.SMBDATA.HANDLE")

In the last command we asked MBAL to run the history simulation to the end of the tanks
production history, but we do not know what that time was and therefore where to start
the prediction. So the next code fragment gets the data of the 1st tank in the
corresponding *.MBI file - the CUMTIM variable from the data block will indicate the
start of the prediction. We can simply use the 1st tank as the value that will be the same
for all of the tanks. We have to set the *.MBI file handle stored above, and the command
ID=8 to get the tank data. Also, set the tank number to zero to indicate that we want the
data from the 1st tank. After calling the RESCALC function, store the CUMTIM
variable in the dEndHistory VBA variable.

DoSet " M B A L .RL.SMBRESDATA.HANDLE", iMBIHandle

OpenServer User's Manual


MBAL and OpenServer 170

iCommand = 8 'Get tank data command


DoSet " M B A L .RL.SMBRESDATA.COMMANDID", iCommand
DoSet " M B A L .RL.SMBRESDATA.TANKNUM", 0
DoCmd " M B A L .RL.RESCALC"
dEndHistory = DoGet(" M B A L .RL.SMBRESDATA.CUMTIM")

The macro defined the WellName() VBA variable at the top of the macro which lists the
names of the wells in the MBI file.

WellName(0) = "OilWell"
WellName(1) = "GasLift"
WellName(2) = "WatInj"
WellName(3) = "GasWell"

The next section of the code finds the well model handle of the corresponding well object
in MBAL for each of the wells in the VBA WellName() variable. It saves the well model
handles in the VBA variable iWellModel() in the same order as the WellName() variable.
If the macro is to do any special manipulation of wells such as using a particular WHP
for WELLA-3, etc., then the calling macro has to know the handle of each well.

The first stage is to get the number of wells loaded in MBAL and set the Command ID=4
to get the number of well models. After calling the WELLDATA command, we can then
get the number of well models from the INTDATA variable in the data block.

The next step is to loop round each well model in MBAL and find the name of each well.
When we find the matching name, we store the well handle. To find the name, we load
the stored MBI file handle in the MBIHANDLE variable, and use the command ID=10 to
get the well model name and the HANDLE variable with the MBI well model handle.
After the WELLDATA command the WELLNAME variable contains the name.

DoSet " M B A L .RL.SMBWELLDATA.COMMANDID", 4 'Get well


model count
DoCmd " M B A L .RL.WELLDATA"
iNumWellModels = DoGet(" M B A L .RL.SMBWELLDATA.INTDATA")
For i = 0 To iNumWells - 1
For j = 0 To iNumWellModels - 1
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.COMMANDID", 10
'Get well name of model
DoSet " M B A L .RL.SMBWELLDATA.HANDLE", j
DoCmd " M B A L .RL.WELLDATA"
If (WellName(i) =
DoGet(" M B A L .RL.SMBWELLDATA.WELLNAME")) Then
iWellModel(i) = j
End If

© 1990-2018 Petroleum Experts Limited


171 OpenServer

Next j
Next i

By default, the well model is created assuming there is one instance of the well model.
This next fragment shows how to model more than one well being drilled of the same
type:
- Load the MBI handle as usual
- Load 2nd well model handle in the HANDLE variable as we wish to modify the
Gas Lift well
- Load the number of wells to drill in NUMWELL
- Load –1 in the variable IPRNUM (this indicates that the command is not specific
to a particular layer)

The following code example illustrates the above:

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(1)
DoSet " M B A L .RL.SMBWELLDATA.NUMWELL", 2
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 13 'Set number of wells
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

The next sub-section shows how to set a downtime factor for the 1st well, the Oil Well. A
downtime of zero means that the well is always producing, where a downtime of 1.0
means that the well is never producing. The method is much the same as for setting the
number of wells.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(0)
DoSet " M B A L .RL.SMBWELLDATA.DOWNTIME", 0.2
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 12 'Set downtime command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

This next section shows how to set a start and end time for a well model. This code
fragment also shows an important point concerning the use of times. In the Direct
Access OpenServer, times are in internal units which are the number of days since
1900. Obviously these are not very convenient units, and if calendar dates i.e.,
01/01/1994 aare being used a command to convert calendar dates to internal times
(and back again) is provided. To do this set the DATE variable to the calendar date
required, then call the DATETOTIME command. The answer can then be retrieved
from the TIME variable. To do the reverse calculation use the command
TIMETODATE.

OpenServer User's Manual


MBAL and OpenServer 172

We first convert the two calendar dates required to internal times, and then set the
STARTTIME and ENDTIME variables to these two internal time values. We set the
HANDLE to the well model handle for the third well (Gas Well) and finally set the
Command ID=14 to set the start and end times.

DoSet " M B A L .RL.DATE", "31/01/1990"


DoCmd " M B A L .RL.DATETOTIME"
dStartTime = DoGet(" M B A L .RL.TIME")
DoSet " M B A L .RL.DATE", "02/03/1990"
DoCmd " M B A L .RL.DATETOTIME"
dEndTime = DoGet(" M B A L .RL.TIME")
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(3)
DoSet " M B A L .RL.SMBWELLDATA.STARTTIME", dStartTime
DoSet " M B A L .RL.SMBWELLDATA.ENDTIME", dEndTime
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 14 'Set start and end time command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

We have now completed the initialization and are ready to go into the prediction loop.
The rest of the source code listings are within the main prediction loop which does a
time step for each time through the loop.

The first fragment from within the loop is used to update the layers to the current tank
conditions. The UPDATELAYERS command only needs the well model handle. The
command will loop through each layer in the specifed well model and for each layer it will
update the PVT properties from the tank calculated at the current pressure. It then
calculates the WCT, GOR, CGR, and WGR for each layer from the relative
permeabilities and breakthroughs.

NOTE: This command must be called, or the initial tank conditions will always
be used! No command ID is needed.

For iWellNo = 0 To iNumWellModels - 1


DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoCmd " M B A L .RL.UPDATELAYERS"
Next iWellNo

The next section is used to calculate the performance of the wells using the IPR/VLP
intersection calculation. In this macro we apply a different FWHP for each well. Much of
this part of the macro is repeated for each well so only a relevant fragment for the gas lift
well is shown.

The first step is to set the well model handle. The next variable to set (TOL) is used to

© 1990-2018 Petroleum Experts Limited


173 OpenServer

control if intersections are allowed on the negative slope section of the lift curve. The
normal situation is where they are not allowed in which case use 0.0. If negative VLP
intersections are allowed, the value will be set to a large value i.e., a value of -1e10 will
allow any size of negative slope solution.

We then set the extrapolation flag. This specifies whether the lift curves should be
extrapolated beyond the upper and lower values of the sensitivity variables. In general,
the lift curves should be calculated over all the expected ranges of sensitivity variables.
However limited extrapolation will broaden the range of the lift curves.

NOTE: VLP extrapolation is undesirable as unpredictable behaviour may


occur. It is always recommended to regenerate the VLP if lift curve
extrapolation has been reported in the well results Status column.

The next step is setting the sensitivity variables for the lift curves, and the required
variables will depend on the well type and include:

GLRINJ – Gas lift injected for gas lift wells


FREQ – Frequency for ESPs
WHP – Well head pressure

The next step is to call the command IPRVLPCALC. No command ID is needed.

The results of the calculation are the total rate, GOR, WCT etc., which can be retrieved
from the data block.

Note that the total rate is liquid rate for oil or water wells and gas rate for gas or
condensate wells.

DoSet " M B A L .RL.SMBIPRVLPCALC.HANDLE",


iWellModel(iWellNo)
DoSet " M B A L .RL.SMBIPRVLPCALC.TOL", 0#
DoSet " M B A L .RL.SMBIPRVLPCALC.EXTRAP", 1#
If (iWellNo = 1) Then
GLRInj = 240#
DoSet " M B A L .RL.SMBIPRVLPCALC.GLRINJ", GLRInj
DoSet " M B A L .RL.SMBIPRVLPCALC.WHP", fWHP(iWellNo)
DoCmd " M B A L .RL.IPRVLPCALC"
iErrorCode = DoGet(" M B A L .RL.SMBERRORDATA.CODE")
Range("F" + CStr(17 + iStep)) = fWHP(iWellNo)
Range("G" + CStr(17 + iStep)) = GLRInj
If (iErrorCode = 120) Then
Range("H" + CStr(17 + iStep)) = NoSolutionStr
Range("I" + CStr(17 + iStep)) = NoSolutionStr
Range("J" + CStr(17 + iStep)) = NoSolutionStr
Else

OpenServer User's Manual


MBAL and OpenServer 174

Range("H" + CStr(17 + iStep)) =


DoGet(" M B A L .RL.SMBIPRVLPCALC.QTOT")
Range("I" + CStr(17 + iStep)) =
DoGet(" M B A L .RL.SMBIPRVLPCALC.GOR")
Range("J" + CStr(17 + iStep)) =
DoGet(" M B A L .RL.SMBIPRVLPCALC.WC")
End If
Else

This fragment also shows the use of special error codes. The commands already use
the standard OpenServer error handling, such as asking for data for a tank handle that
does not exist. However, there are also some less serious errors that should not halt the
macro but that may require special processing. An example of this is if no solution point
could be found for an IPRVLPCALC command. These error codes are stored in the
SMBERRORDATA data block as shown above.

The next step is to calculate the individual layer rates and FBHP pressure for the total
rate found by the IPRVLPCALC command. This is done for each well with the following
code:-

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.QTOT", Qtot
DoCmd " M B A L .RL.CALCLAYERRATES"

The next code fragment shows how the fluid properties can be queried for the well given
the different rates and properties of each layer.

Load the IPRNUM variable with –1 that will indicate the well properties will be queried.

If IPRNUM is set to a particular layer, then the command retrieves the values for that
layer only.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 22 ' Read IPR data command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"
API = DoGet(" M B A L .RL.SMBWELLDATA.OILAPI")
SOLGOR = DoGet(" M B A L .RL.SMBWELLDATA.SOLGOR")
GRVGAS = DoGet(" M B A L .RL.SMBWELLDATA.GRVGAS")
WATSAL = DoGet(" M B A L .RL.SMBWELLDATA.WATSAL")

At the end of the initialization process we set various attributes of the wells to mimic a
well schedule. For example, we set a start and end time for the Gas Well, a downtime

© 1990-2018 Petroleum Experts Limited


175 OpenServer

factor for the Oil Well and the number of gas lift wells was set to two. The next command
is used to factor the well and layer rates to take these into account.

Set the well model as usual and the IPRNUM to –1 to indicate all layers should be
factored. If start and end times have been used on the well, then also set the
STEPSTARTTIME and STEPENDTIME variables with the times of the start and end
of the step. If well multipliers, downtime factors or start and end times have not been set
then there is no need to call this command.

DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1


DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.STEPSTARTTIME", CUMTIM -
DELTIM
DoSet " M B A L .RL.SMBWELLDATA.STEPENDTIME", CUMTIM
iCommand = 36 ' Correct rates for well schedule command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

Now that we have the correct layer rates we must calculate how much oil, water and gas
is taken out of each tank for this time step. Load the well handle and the DELTIM
variable with the length of the time step. MBAL will loop through each layer in the well
and update the attached tank with the layer rate*DELTIM. Remember that MBAL knows
which layer is attached to which tank.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.DELTIM", DELTIM
DoCmd " M B A L .RL.CUMLAYERRATES"

The final command for each time step is to perform the material balance for all the tanks
in the MBI file. This will calculate the new tank conditions at the end of the time step,
including pressure and saturations.

We now need to set the MBI handle, and if more than one MBI file is loaded, then this
command must be called more than once. Set the CUMTIM variable to the time at the
end of the time step. Set the USESUBSTEP flag to one if it is desired to split the step
into a number of sub-steps, otherwise leave the value at zero.

DoSet " M B A L .RL.SMBRESDATA.HANDLE", iMBIHandle


DoSet " M B A L .RL.SMBRESDATA.CUMTIM", CUMTIM
DoSet " M B A L .RL.SMBRESDATA.USESUBSTEP", 0
DoCmd " M B A L .RL.DOSTEP"

There are two commands that are called just before completing the macro. The first
command saves the tank conditions in an MBR file. This file can be read by MBAL.

OpenServer User's Manual


MBAL and OpenServer 176

The second is called to delete all the data created in the macro, ready for another
prediction to be performed.

DoCmd " M B A L .RL.SAVEFILE(""" + Range("B13") + """)"


DoCmd " M B A L .RL.ALLRESET"

5.6.4 Low Level Example


We now look at an example with the low level functions. This example is a VBA macro
in an Excel spreadsheet. The file is called DA2.XLS, and is installed with the program
in the samples directory.

The purpose of the macro is to run a prediction similar to the standard macro except that
it uses different manifold pressures for each well.

Some of the parts of the code are the same as the high level example. However, the
explanation is repeated for clarity.

The first command M B A L .RL.ALLRESET should be called at the start of all macros.
As the name suggests, it deletes any objects that might not have been cleaned up when
running a previous macro.

DoCmd " M B A L .RL.ALLRESET"

We now load an MBI file. This will read the tanks from the MBAL file and create
corresponding tank models for each tank in the file, and also reads the wells and layers
from the file but it does NOT create the corresponding well and layer models which is
done later in the macro.

NOTE: We store the MBI file handle created by the OPENFILE command.

FilePath = Environ("IPM_Samples")
FilePath = FilePath & "\mbal\Material Balance Examples
\Reference Examples\detailed2.mbi"
DoCmd "MBAL.RL.OPENFILE=" + FilePath
iMBIHandle = DoGet(" M B A L .RL.SMBDATA.HANDLE")

The next section reads the number of tanks read from the file. Load the MBI file handle
and command ID=11. The number of tanks is returned in the INTDATA variable. Now
loop round the tanks and get the name of the tank. Load the tank index and the
command ID=5. The name is returned in the STRING variable.

DoSet " M B A L .RL.SMBDATA.HANDLE", iMBIHandle


iCommand = 11 ' Get number of tanks command
DoSet " M B A L .RL.SMBDATA.COMMAND", iCommand
DoCmd " M B A L .RL.GETDATA"

© 1990-2018 Petroleum Experts Limited


177 OpenServer

iNumTanks = DoGet(" M B A L .RL.SMBDATA.INTDATA")


For i = 0 To iNumTanks - 1
DoSet " M B A L .RL.SMBDATA.TANKNUM", i
iCommand = 5 ' Get tank name command
DoSet " M B A L .RL.SMBDATA.COMMAND", iCommand
DoCmd " M B A L .RL.GETDATA"
szTankNames(i) = DoGet(" M B A L .RL.SMBDATA.STRING")
Next I

We now have to initialize the tanks to the end of the production history, however, each
tank may have production history data up to different dates. In this case we have
decided to run the simulation up to the earliest end of history data of all the tanks. So we
next query the end of the tank history and use the earliest date. As with the tank names,
load the tank index and the command ID=8. The end of the history for the tank is
returned in DOUBLEDATA.

Range("F12") = "Initialising tanks to end of history"


dEndHistory = 1E+20
For i = 0 To iNumTanks - 1
DoSet " M B A L .RL.SMBDATA.HANDLE", iMBIHandle
iCommand = 8 ' Get end of tank history command
DoSet " M B A L .RL.SMBDATA.COMMAND", iCommand
DoSet " M B A L .RL.SMBDATA.TANKNUM", i
DoCmd " M B A L .RL.GETDATA"
dTemp = DoGet(" M B A L .RL.SMBDATA.DOUBLEDATA")
If dTemp < dEndHistory Then
dEndHistory = dTemp
End If
Next I

Now that we have the date to run the history to, we can initialize the tanks which is done
in two steps. The command ID=0 will initialize the model and the command ID=1 will run
the history simulation to the specified date. We load the USESUBSTEP flag to indicate
if the simulation should only calculate at the entered production history points or if it
should also use sub-steps between the entered points.

DoSet "MBAL.RL.SMBRESDATA.HANDLE", iMBIHandle


DoSet "MBAL.RL.SMBRESDATA.USESUBSTEP", 0
iCommand = 0 ' Reset prediction command
DoSet "MBAL.RL.SMBRESDATA.COMMAND", iCommand
DoCmd "MBAL.RL.RESCALC"
DoSet "MBAL.RL.SMBRESDATA.HANDLE", iMBIHandle
iCommand = 1 ' Initialise prediction to end of history
DoSet "MBAL.RL.SMBRESDATA.COMMAND", iCommand
DoSet "MBAL.RL.SMBRESDATA.CUMTIM", dEndHistory

OpenServer User's Manual


MBAL and OpenServer 178

DoCmd "MBAL.RL.RESCALC"

The next stage in the initialization is to create the well models. It is possible to create
well models from scratch, however, it is significantly easier to create the well models
from wells read in directly from the MBAL file which is the method illustrated in the
macro.

There are no commands to find the number of wells in the MBI file. Instead we use an
iteration method where we loop through the indices for the MBI file wells until we get an
error code indicating that we have read all the wells. The principal for layers within each
well is the same, after successfully reading a well or layer, we create an equivalent well
or layer model.

The first step is to set the MBI file handle and tank number.

DoSet "MBAL.RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


iTankNo = 0
DoSet "MBAL.RL.SMBWELLDATA.TANKNUM", iTankNo
iWellNo = 0
iWellFound = 1
iNumWellModels = 0

Now start looping through the wells read in the MBI file handle. The loop will stop when
there are no more wells to read.

Set the HANDLE variable to the next well in the MBI file to read. The well index starts at
zero and is incremented by one at the end of the loop. Also, set the IPRNUM to zero to
read the first layer in the well. If the well index does not exist in the file the command will
return an error code of 214. For this case, set the flag to stop the loop, otherwise no well
and layer data is read into the SMBWELLDATA data block.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellNo
iIPRNo = 0
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
iCommand = 9 ' Get well data command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"
iErrorCode = DoGet(" M B A L .RL.SMBERRORDATA.CODE")
If (iErrorCode = 214) Then ' Well not found
iWellFound = 0
Else

At the top of the macro, we defined a VBA variable WellNames() in which the name of
the wells were stored which we expect to find in the MBI file.

The next fragment checks which well we have just read from MBAL by comparing with

© 1990-2018 Petroleum Experts Limited


179 OpenServer

the WELLNAME variable which has just been read.

WellName = DoGet("MBAL.RL.SMBWELLDATA.WELLNAME")
For i = 0 To iNumWells - 1
If (WellNames(i) = WellName) Then
iWellIndex = i
End If
Next I

We now create a well model from the data read from the MBI file. Load the command
ID=1. The other data required in the SMBWELLDATA data block will have been setup
by the last call to the get well data command. After creating the well model, we read
back the handle of the well model and store it in the iWellModel() VBA variable.
iCommand = 1 ' Create a well command
DoSet "MBAL.RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet "MBAL.RL.SMBWELLDATA.COMMAND", iCommand
DoCmd "MBAL.RL.WELLDATA"
iWellModel(iWellIndex) =
DoGet("MBAL.RL.SMBWELLDATA.HANDLE")
iNumWellModels = iNumWellModels + 1

The next stage is to create the layers for this well. We use the same principal of reading
through the layer indices until we get an error message warning that no more layers are
left.
iIprFound = 1
iIPRNo = 0
Do

Call the command to read the well from the MBI file again. This time we are interested
in the layer data so we set the IPRNUM to read the next layer (starting at layer zero).

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",


iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellNo
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
iCommand = 9 ' Get well data command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND",
iCommand
DoCmd " M B A L .RL.WELLDATA"

Check if a layer was found. If we have got to the end of the layer list we get an error
code=216. Otherwise the command will have successfully loaded the next layer data
into the SMBWELLDATA data block.

OpenServer User's Manual


MBAL and OpenServer 180

iErrorCode = DoGet(" M B A L .RL.SMBERRORDATA.CODE")


If (iErrorCode = 216) Then ' IPR not found
iIprFound = 0
Else

Before creating the layer model, we have to find the index of the tank to which the layer
is connected. Now the last command will return the name of the connected tank in the
TANKNAME variable. Just after reading the tanks from the MBI file we read and stored
the names of the tank in the szTankNames VBA variable for each tank index. So by
searching through the szTankNames list we can find the index of the connected tank.
szTankName =
DoGet("MBAL.RL.SMBWELLDATA.TANKNAME")
For i = 0 To iNumTanks - 1
If (szTankName = szTankNames(i)) Then
DoSet "MBAL.RL.SMBWELLDATA.TANKNUM", i
End If
Next I

Finally we call the command to create an IPR/layer model and connect it to the well
model. The data used to initialize the IPR model is taken from the SMBWELLDATA
data block. This is the same data that was loaded with the layer data by the last
command, so we are simply transferring it from the layer in the MBI file to the layer
model just created.

DoSet "MBAL.RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet "MBAL.RL.SMBWELLDATA.HANDLE",
iWellModel(iWellIndex)
DoSet "MBAL.RL.SMBWELLDATA.IPRNUM",
iIPRNo
iCommand = 35 ' Add an IPR command
DoSet "MBAL.RL.SMBWELLDATA.COMMAND",
iCommand
DoCmd "MBAL.RL.WELLDATA"
End If
iIPRNo = iIPRNo + 1
Loop While (iIprFound)
End If
iWellNo = iWellNo + 1
Loop While (iWellFound)

We have now created the tank, well and layer/IPR models that mirror the objects in the
MBI file.

By default, the well model is created assuming there is one instance of the well model.
This next fragment shows how it is possible to model more than one well being drilled of

© 1990-2018 Petroleum Experts Limited


181 OpenServer

the same type. Load the MBI handle as usual. Load 2nd well model handle in the
HANDLE variable as we wish to modify the Gas Lift well. Load the number of wells to
drill in NUMWELL. Load –1 in the variable IPRNUM, as this indicates that the
command is not specific to a particular layer.

DoSet "MBAL.RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet "MBAL.RL.SMBWELLDATA.HANDLE", iWellModel(1)
DoSet "MBAL.RL.SMBWELLDATA.NUMWELL", 2
DoSet "MBAL.RL.SMBWELLDATA.IPRNUM", -1
iCommand = 13 ' Set number of wells
DoSet "MBAL.RL.SMBWELLDATA.COMMAND", iCommand
DoCmd "MBAL.RL.WELLDATA"

The next sub-section shows how to set a downtime factor for the 1st well, the Oil Well. A
downtime of zero means that the well is always producing. A downtime of 1.0 means
that the well is never producing, and the method is much the same as for setting the
number of wells.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(0)
DoSet " M B A L .RL.SMBWELLDATA.DOWNTIME", 0.2
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 12 ' Set downtime command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

This next section shows how to set a start and end time for a well model. This code
fragment also shows an important point concerning the use of times. In the Direct
Access OpenServer, times are in internal units which are the number of days since
1900. Obviously these are not very convenient units, and if calendar dates e.g.
01/01/1994 are being used, we provide a command to convert calendar dates to
internal times (and back again). To do this set the DATE variable to the calender date
required, then call the DATETOTIME command. The answer can then be retrieved from
the TIME variable. To do the reverse calculation ,use the command TIMETODATE.

We first convert the two calendar dates required to internal times, and then set the
STARTTIME and ENDTIME variables to these two internal time values. We set the
HANDLE to the well model handle for the third well (Gas Well), and finally set the
Command ID=14 to set the start and end times.

DoSet " M B A L .RL.DATE", "31/01/1990"


DoCmd " M B A L .RL.DATETOTIME"
dStartTime = DoGet(" M B A L .RL.TIME")
DoSet " M B A L .RL.DATE", "02/03/1990"
DoCmd " M B A L .RL.DATETOTIME"
dEndTime = DoGet(" M B A L .RL.TIME")

OpenServer User's Manual


MBAL and OpenServer 182

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle


DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(3)
DoSet " M B A L .RL.SMBWELLDATA.STARTTIME", dStartTime
DoSet " M B A L .RL.SMBWELLDATA.ENDTIME", dEndTime
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1
iCommand = 14 ' Set start and end time command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

We have now completed the initialization and are ready to go into the prediction loop.
The rest of the source code listings are within the main prediction loop which does a
time step for each time through the loop.

The first code fragment from within the loop is used to display the current time on the
sheet. It shows how to convert an internal time (in number of days since 1900) to a
calendar date, note that it will use the current international date settings on the
PC.

DoSet " M B A L .RL.TIME", CUMTIM


DoCmd " M B A L .RL.TIMETODATE"
Range("B" + CStr(16 + iStep)) =
DoGet(" M B A L .RL.DATE")

The first main task in the prediction step is to initialize the layers to the current tank
conditions. First, update the PVT properties with those calculated in the tanks at the
current pressure. Then calculate the breakthroughs i.e., GOR, WCT, CGR, and WGR,
etc., using the current fluid properties and saturations.

We can update the PVT properties with a single command for each well. Load the MBI
file handle, the well model index and set the layer number to –1 to indicate all layers
should be recalculated. If a specific layer number is specified, then only that layer is
calculated.

iIPRNo = -1
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
iCommand = 23 ' Update PVT from tank command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

In this example we calculate the GOR, etc., layer by layer. This is partly as
demonstration, but also because we wish to read the pressure of each layer. We again
use the technique of iterating through the layers until we get an error message that no

© 1990-2018 Petroleum Experts Limited


183 OpenServer

more layers are available. First set up the IPR number to the next layer and call the
command with command ID=6 to calculate the breakthroughs. If the layer/IPR index is
not valid, an error code=216 will be reported.

iIPRNo = 0
iIprFound = 1
Do
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
iCommand = 6 ' Calculate breakthroughs
command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND",
iCommand
DoCmd " M B A L .RL.WELLDATA"
iErrorCode =
DoGet(" M B A L .RL.SMBERRORDATA.CODE")
If (iErrorCode = 216) Then ' IPR not found
iIprFound = 0
Else

As with the PVT calculations above, we could have done this in one step by using a
layer number of –1. The layer index was valid so it has calculated the breakthroughs
successfully. We next perform a layer read command which reads all the current IPR
data into the SMBWELLDATA data object. In this case, we only read back the current
connected tank pressure and display it on the sheet.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",


iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM",
iIPRNo
iCommand = 22 ' Read IPR data command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND",
iCommand
DoCmd " M B A L .RL.WELLDATA"
If
(DoGet(" M B A L .RL.SMBWELLDATA.TANKNUM") = 0) Then
Range("G" + CStr(16 + iStep)) =
DoGet(" M B A L .RL.SMBWELLDATA.RESPRESS")
Else
Range("H" + CStr(16 + iStep)) =

OpenServer User's Manual


MBAL and OpenServer 184

DoGet(" M B A L .RL.SMBWELLDATA.RESPRESS")
End If
End If
iIPRNo = iIPRNo + 1
Loop While (iIprFound)

The next section is used to calculate the performance of the wells using the IPR/VLP
intersection calculation. In this macro we apply a different FWHP for each well. Much of
this part of the macro is repeated for each well so only a relevant fragment for the gas lift
well is shown.

The first step is to set the well model handle. The next variable to set (TOL) is used to
control if intersections are allowed on the negative slope section of the lift curve. The
normal situation is where they are not allowed in which case use 0.0. To allow large
negative lift curve intersections, apply a large negative value. To allow any size of
negative slope, use a value of -1e10.

The next step is setting the sensitivity variables for the lift curves and will depend on the
type of well being specified, such as:

GLRINJ – Gas lift injected for gas lift wells


FREQ – Frequency for ESPs
WHP – Well head pressure

The next step is to call the command IPRVLPCALC. No command ID is needed. The
results of the calculation are the total rate, GOR, WCT, etc., which can be retrieved from
the data block. Note that the total rate is liquid rate for oil or water wells and gas rate for
gas or condensate wells. If an error code=120 is returned then no solution was found.

DoSet " M B A L .RL.SMBIPRVLPCALC.HANDLE",


iWellModel(iWellNo)
DoSet " M B A L .RL.SMBIPRVLPCALC.TOL", 0#
If (iWellNo = 1) Then
GLRInj = 240#
DoSet " M B A L .RL.SMBIPRVLPCALC.GLRINJ", GLRInj
DoSet " M B A L .RL.SMBIPRVLPCALC.WHP", fWHP(iWellNo)
DoCmd " M B A L .RL.IPRVLPCALC"
iErrorCode = DoGet(" M B A L .RL.SMBERRORDATA.CODE")
Range("F" + CStr(17 + iStep)) = fWHP(iWellNo)
Range("G" + CStr(17 + iStep)) = GLRInj
If (iErrorCode = 120) Then
Range("H" + CStr(17 + iStep)) = NoSolutionStr
Range("I" + CStr(17 + iStep)) = NoSolutionStr
Range("J" + CStr(17 + iStep)) = NoSolutionStr
Else
Range("H" + CStr(17 + iStep)) =

© 1990-2018 Petroleum Experts Limited


185 OpenServer

DoGet(" M B A L .RL.SMBIPRVLPCALC.QTOT")
Range("I" + CStr(17 + iStep)) =
DoGet(" M B A L .RL.SMBIPRVLPCALC.GOR")
Range("J" + CStr(17 + iStep)) =
DoGet(" M B A L .RL.SMBIPRVLPCALC.WC")
End If
Else

Now we transform the well rates into cumulative rates taken out of each tank. This is
done for each well in turn.

First we calculate the FBHP for the well using the following steps:
- Set the well model index and MBI file handle as usual
- Set the IPR number to –1 as the calculation is for the well rather than an
individual layer
- Set the command ID=27 to calculate the FBHP
- After the command is called, we can retrieve the calculated FBHP from the
FBHP variable in the SMBWELLDATA data block.

iIPRNo = -1
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE", iWellModel(iWellNo)
iCommand = 27 ' Calculate FBHP command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoSet " M B A L .RL.SMBWELLDATA.QTOT", Qtot
DoCmd " M B A L .RL.WELLDATA"
FBHP = DoGet(" M B A L .RL.SMBWELLDATA.FBHP")

Now we have the bottom hole pressure, we can calculate the corresponding individual
layer rates. This command can be performed on individual layers if desired, however in
this macro, we calculate all the layers at once by setting the IPR number to –1.

The input FBHP is taken from the FBHP variable in the SMBWELLDATA data block.
For this macro, this variable was set up by the last command shown above so we do not
actually need to set it up again, however, it is shown again for clarity. The individual
phase rates are calculated by this command given the total rate and the GOR, WCT, etc.

iIPRNo = -1
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
DoSet " M B A L .RL.SMBWELLDATA.FBHP", FBHP
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
iCommand = 26 ' Calculate rates from FBHP

OpenServer User's Manual


MBAL and OpenServer 186

command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

At the end of the initialization process we set various attributes of the wells to mimic a
well schedule. For example, we set a start and end time for the Gas Well, a downtime
factor for the Oil Well and the number of gas lift wells was set to two. The next
commands are used to factor the well and layer rates to take these into account.

Set the well model as usual and the IPRNUM to –1 to indicate all layers should be
factored. If start and end times have been imposed on the well, the STEPSTARTTIME
and STEPENDTIME variables with the times of the start and end of the step must also
be set. If well multipliers, downtime factors or start and end times for a well have not bee
set there is no need to call this command.

iIPRNo = -1
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.STEPSTARTTIME",
CUMTIM - DELTIM
DoSet " M B A L .RL.SMBWELLDATA.STEPENDTIME", CUMTIM
iCommand = 36 ' Correct rates for well schedule
command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"

At this point, we show how to read the PVT data for the total well fluid given the different
rates and fluid properties in each layer. As done previously, we set the MBI file handle
and the well model index. Since we want the well fluid properties, we set the IPR
number to –1.

If fluid properties for an individual layer are required then set a particular index in the IPR
number. There is no special command to get the fluid properties as the standard read
IPR data command will calculate and return the fluid properties for the well. After calling
the read IPR, the required values are loaded in the SMBWELLDATA data block. See
the following section (Datablock Variable Names) for a list of all the fluid properties that
can be read.

DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",


iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", -1

© 1990-2018 Petroleum Experts Limited


187 OpenServer

iCommand = 22 ' Read IPR data command


DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"
API = DoGet(" M B A L .RL.SMBWELLDATA.OILAPI")
SOLGOR = DoGet(" M B A L .RL.SMBWELLDATA.SOLGOR")
GRVGAS = DoGet(" M B A L .RL.SMBWELLDATA.GRVGAS")
WATSAL = DoGet(" M B A L .RL.SMBWELLDATA.WATSAL")

The next step is to read the calculated rates from the layers and use them to update the
total cumulative rates removed from the tank at the end of the time step. This will then
allow us to calculate the pressure at the end of the step. As done previously, we use the
technique of reading each layer in turn until we get an error message that there are no
more layers.

iIPRNo = 0
iIprFound = 1
Do
DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE",
iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
DoSet " M B A L .RL.SMBWELLDATA.IPRNUM", iIPRNo
iCommand = 22 ' Read IPR data command
DoSet " M B A L .RL.SMBWELLDATA.COMMAND",
iCommand
DoCmd " M B A L .RL.WELLDATA"
iErrorCode =
DoGet(" M B A L .RL.SMBERRORDATA.CODE")
If (iErrorCode = 216) Then ' IPR not found
iIprFound = 0
Else

The SMBWELLDATA block should now have the rates read from the layer. Note that
the rates are in the units of STB/day and scf/day for oil/water and gas respectively. If any
correction was made for downtimes, number of wells and start and end times then these
effects will be factored into these rates. We also query the tank index of the tank to
which the layer is connected and the handle of the MBI file that the connected tank
belongs. If all the tanks are in one MBI file (as recommended), then this handle will
always be zero.

Qtot =
DoGet(" M B A L .RL.SMBWELLDATA.QTOT")
Qo = DoGet(" M B A L .RL.SMBWELLDATA.QO")
Qg = DoGet(" M B A L .RL.SMBWELLDATA.QG")
Qw = DoGet(" M B A L .RL.SMBWELLDATA.QW")

OpenServer User's Manual


MBAL and OpenServer 188

iTankNo =
DoGet(" M B A L .RL.SMBWELLDATA.TANKNUM")
iMBIHandleOfTank =
DoGet(" M B A L .RL.SMBWELLDATA.MBIHANDLE")

We now want to update the cumulative rate in the tanks. The first step is to read the
data currently in the connected tank, then set the tank number and MBI file handle from
the last step and the command ID=8 to read the tank data. Note that we use the
SMBRESDATA data block for tank commands.

iCommand = 8 ' Get tank prediction data


command
DoSet " M B A L .RL.SMBRESDATA.COMMANDID",
iCommand
DoSet " M B A L .RL.SMBRESDATA.TANKNUM",
iTankNo
DoSet " M B A L .RL.SMBRESDATA.HANDLE",
iMBIHandleOfTank
DoCmd " M B A L .RL.RESCALC"

Now we read back the current cumulative rates for each phase (plus injected phases).
These are the cumulative rates to the beginning of the time step including any production
history. Calculate the delta cumulative rates for this time step. Note that the cumulative
rates are in units of MMSTB or MMscf, hence the division by 1.0e6 and then add them to
the current cumulative rates to give the cumulative rates to the end of the time step.

It is important to check for injectors at this point as the well rates are passed
back as Qw regardless if it is a producer or injector.

CUMOIL =
DoGet(" M B A L .RL.SMBRESDATA.CUMOIL")
CUMGAS =
DoGet(" M B A L .RL.SMBRESDATA.CUMGAS")
CUMWAT =
DoGet(" M B A L .RL.SMBRESDATA.CUMWAT")
CUMGASINJ =
DoGet(" M B A L .RL.SMBRESDATA.CUMGIN")
CUMWATINJ =
DoGet(" M B A L .RL.SMBRESDATA.CUMWIN")
If (iWellNo = 2) Then
CUMWATINJ = CUMWATINJ + DELTIM * (Qw
/ 1000000#)
Else
CUMOIL = CUMOIL + DELTIM * (Qo /
1000000#)

© 1990-2018 Petroleum Experts Limited


189 OpenServer

CUMGAS = CUMGAS + DELTIM * (Qg /


1000000#)
CUMWAT = CUMWAT + DELTIM * (Qw /
1000000#)
End If

Finally, set the new cumulative rates back into the tank. There are other data items
written back to the tank which we do not update, however, they will have been set by the
read tank command above.

DoSet " M B A L .RL.SMBRESDATA.HANDLE",


iMBIHandleOfTank
iCommand = 9 ' Set tank prediction data
command
DoSet " M B A L .RL.SMBRESDATA.COMMANDID",
iCommand
DoSet " M B A L .RL.SMBRESDATA.TANKNUM",
iTankNo
DoSet " M B A L .RL.SMBRESDATA.CUMGIN",
CUMGASINJ
DoSet " M B A L .RL.SMBRESDATA.CUMWIN",
CUMWATINJ
DoSet " M B A L .RL.SMBRESDATA.CUMGAS",
CUMGAS
DoSet " M B A L .RL.SMBRESDATA.CUMOIL",
CUMOIL
DoSet " M B A L .RL.SMBRESDATA.CUMWAT",
CUMWAT
DoCmd " M B A L .RL.RESCALC”
End If
iIPRNo = iIPRNo + 1
Loop While (iIprFound)

We have now transferred the required data from the wells to the tanks and are now
ready to perform the material balance calculations to find the pressure and saturations
at the end of the time step.

The first step is to setup the calculation control variables for each tank. We must read
the data from the tank, modify the required data in the SMBRESDATA data block and
then write it back and set the CUMTIM variable to the end of the time step. The
USESUBSTEP variable indicates if substeps should be used over the time step and
this will increase accuracy, particularly if large aquifers are used.

Set the MODE to zero which should always be used for material balance, then set the
PRESSURE variable to 1.0e38 to indicate that the pressure at the start of the step
should be taken from the end of the last step and should always be used. Finally, set the

OpenServer User's Manual


MBAL and OpenServer 190

injected gas gravity flag to –1 to indicate that the injection gas gravity should be taken
from the tank PVT model.

For i = 0 To iNumTanks - 1
' First do a read data
DoSet " M B A L .RL.SMBRESDATA.HANDLE", iMBIHandle
iCommand = 8 ' Set tank prediction data command
DoSet " M B A L .RL.SMBRESDATA.COMMAND", iCommand
DoSet " M B A L .RL.SMBRESDATA.TANKNUM", i
DoCmd " M B A L .RL.RESCALC"
DoSet " M B A L .RL.SMBRESDATA.HANDLE", iMBIHandle
iCommand = 9 ' Set tank prediction data command
DoSet " M B A L .RL.SMBRESDATA.COMMANDID", iCommand
DoSet " M B A L .RL.SMBRESDATA.TANKNUM", i
DoSet " M B A L .RL.SMBRESDATA.CUMTIM", CUMTIM
DoSet " M B A L .RL.SMBRESDATA.USESUBSTEP", 0
DoSet " M B A L .RL.SMBRESDATA.MODE", 0
DoSet " M B A L .RL.SMBRESDATA.PRESSURE", 1E+38 '
Use the value already stored
DoSet " M B A L .RL.SMBRESDATA.INJGASGRAV", -1# '
indicates not used
DoCmd " M B A L .RL.RESCALC"
Next I

Now we can calculate the actual material balance. The commands for this works on all
the tanks in the MBI file at once as we need to solve all tanks simultaneously to
understand if there is any communication between the tanks. Load the MBI file handle
and set the command ID=2 to perform the material balance. Then call the RESCALC
command again with command ID=4 which is used to confirm that we wish to keep the
results from this step as we are not going to repeat the step.

DoSet " M B A L .RL.SMBRESDATA.HANDLE", iMBIHandle


iCommand = 2 ' Set tank compute command
DoSet " M B A L .RL.SMBRESDATA.COMMAND", iCommand
DoSet " M B A L .RL.SMBRESDATA.USESUBSTEP", 0
DoCmd " M B A L .RL.RESCALC"
iCommand = 4 ' Set keep results command
DoSet " M B A L .RL.SMBRESDATA.COMMAND", iCommand
DoCmd " M B A L .RL.RESCALC"

This completes all the code within a prediction time step. Before finishing the macro,
we save the tank results in a file and then clean up the data.

The following line saves the tank results over time in an MBR file which can be read in
MBAL. This is the same file as is written by GAP.

© 1990-2018 Petroleum Experts Limited


191 OpenServer

FilePath_s = Environ("IPM_Samples")
FilePath_s = FilePath_s & "\mbal\Material Balance
Examples\Reference Examples\detailed2res.mbr"
DoCmd "MBAL.RL.SAVEFILE=" + FilePath_s

Finally clean up the data that we created in the macro. First delete the well models and
their associated layer models, this does not delete the tanks. We then use the RESET
command with the MBI file handle appended to the command tag.

For iWellNo = 0 To iNumWellModels - 1


DoSet " M B A L .RL.SMBWELLDATA.MBIHANDLE", iMBIHandle
DoSet " M B A L .RL.SMBWELLDATA.HANDLE",
iWellModel(iWellNo)
iCommand = 0 ' Destroy the well model
DoSet " M B A L .RL.SMBWELLDATA.COMMAND", iCommand
DoCmd " M B A L .RL.WELLDATA"
Next iWellNo
DoCmd " M B A L .RL.RESET=" + CStr(iMBIHandle)

5.6.5 Datablock Variable Names


This section lists all the variables used in the data blocks.

Variable name Description


SMBDATA
HANDLE MBI file handle
INTDATA meaning dependant on command
DOUBLEDATA meaning dependant on command
HANDLE2 meaning dependant on command
TANKNUM tank number
COMMANDID command ID of function
STRING meaning dependant on command
ENDHISTORY Time to run the history simulation
USESUBSTEP flag to indicate if substeps should be used for history simulation/
S prediction

SMBWELLDATA
DOWNTIME Well downtime
NUMWELL Number of wells
STARTTIME Start time
ENDTIME End time
STEPSTARTTIM Start of timestep
E

OpenServer User's Manual


MBAL and OpenServer 192

STEPENDTIME End of timestep


QW Water rate
QO Oil rate
QG Gas rate
QTOT total rate (liquid for oil/water wells and gas for gas/condensate
wells)
HANDLE Handle of the well model
COMMANDID Command ID
MBIHANDLE Handle of the MB Ifile
IPRNUM Layer number(use-1tosignifytotalwellproperties)
TANKNUM Connected tank index
WELLTYPE Well type
INJECTOR Injector flag
WELLNAME Well name
TANKNAME Connected tank name
WATERCUT Watercut
GOR Produced GOR
CGR Produced CGR
USERELPERM Use relative permeability flag
IPRTYPE IPR type:
0 - Straight line PI
20 - Forcheimer
21 - C&N
22 - Forcheimer pseudo pressure
PI(0) Productivity index
DARCY Darcy coefficient from Forcheimer
NONDARCY Non Darcy coefficient from Forcheimer
C C coefficient from C&N
N n coefficient from C&N
PERFTOP Depth of top of perforations
PERFBOTTOM Depth of bottom of perforations
IPRDPSHIFT IPR dP Shift
PERMCORR Permeability correction
F2 F2 gas coning tuning factor
F3 F3 gas coning tuning factor
EXPONENT Exponent gas coning tuning factor
CROSSFLOWII Cross flow injectivity index
USECONING Use coning flag
RESTEMP Reservoir temperature
RESPRESS Reservoir pressure
FBHP Flowing bottom hole pressure
SOLGOR Initial Rs
RS Current solution GOR
OILAPI Oil API
GRVGAS Gas gravity

© 1990-2018 Petroleum Experts Limited


193 OpenServer

WATSAL Water salinity


GRVOIL Oil gravity
PB Bubble point
FACTOZ Z Factor
GASCGR CGR from gas PVT model
PCH2S H2S impurity
PCCO2 CO2 impurity
PCN2 N2 impurity
PDEWIS Dew point
GASVIS Gas viscosity
OILVIS Oil viscosity
WATVIS Water viscosity
FVFGAS Bg
FVFOIL Bo
FVFWAT Bw
GASDEN Gas density
OILDEN Oil density
WATDEN Water density

SMBRESDATA
HANDLE MBI file handle
COMMANDID Command ID
USESUBSTEP Flag to indicate if calculation step size should be used
CUMTIM Time simulation/prediction has been run to
CUMAQU Cumulative aquifer well production
CUMCAP Cumulative gas cap production
CUMGAS Cumulative gas production
CUMGIN Cumulative gas injection
CUMOIL Cumulative oil production
CUMWAT Cumulative water production
CUMWIN Cumulative water injection
CUMWIX Cumulative water influx from aquifer
PERM Permeability (for gas coning only)
ANISOTROPY Anisotropy (for gas coning only)
PRESSURE pressure
FLUID Fluid type
SOLGOR Initial Rs
RS Current solution GOR
OILAPI Oil API
GRVGAS Gas gravity
WATSAL Water salinity
GRVOIL Oil gravity
PB Bubble point
FACTOZ Z Factor

OpenServer User's Manual


MBAL and OpenServer 194

GASCGR CGR from gas PVT model


PCH2S H2S impurity
PCCO2 CO2 impurity
PCN2 N2 impurity
PDEWIS Dew point
GASVIS Gas viscosity
OILVIS Oil viscosity
WATVIS Water viscosity
FVFGAS Bg
FVFOIL Bo
FVFWAT Bw
GASDEN Gas density
OILDEN Oil density
WATDEN Water density
SATGAS gas saturation
SATOIL oil saturation
SATWAT water saturation

SMBIPRVLPCALC
HANDLE Well handle
TOL Defines how large a negative slope of the lift curve is allowed in
solutions
WHP Wellhead pressure
GLRINJ Gas lift to liquid ratio
FREQ ESP frequency
QTOT Total rate (liquid for oil/water, gas for gas/condensate)
GOR Produced GOR
CGR Produced CGR
WC Produced Wc
WGR Produced WGR

5.7 Variable Text Strings


In most cases, the simplest way to find a variable text string is to use the quick method
of CTRL-Right mouse click as described above. However for reference purposes this
section lists all the variable text strings.

ALL variable text strings in the MBAL program start with “MBAL” The next part of the
text string defines the section of the program to which the variable belongs. This will
make the first part of the text string:

MBAL.1D – 1D model
MBAL.MC – Monte Carlo
MBAL.DC – Decline curve
MBAL.PVT – PVT or composition input

© 1990-2018 Petroleum Experts Limited


195 OpenServer

MBAL.MB – Material Balance


MBAL.ML – Multilayer Model
MBAL.TG – Tight Gas Model

The rest of the string depends on the exact variable. The following lists the sub-names
to add for each variable. The variables are listed grouped into each of the above
sections.

Within each group, the variables are ordered into function groups e.g. tanks, constraints
etc.

There is a separate section for relative permeabilities as they are used by more than
one tool.

Each sub-name is indented from its parent. So as an example, the string for the tank
porosity from the following list will be:

MB
TANK
PRESSURE
POROSITY
would be MBAL.MB.TANK.POROSITY.

5.7.1 1D Model
All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.1D

COMPANY Company Name


FIELD Field Name
LOCATION Location
PLATFORM Platform
ANALYST Analyst
INJFLUID Injected fluid-one of{GAS,WATER}
WATINJ Water injection rate
GASINJ Gas injection rate
WATFVF Water FVF
GASFVF Gas FVF
OILFVF Oil FVF
WATDEN Water density
GASDEN Gas density
OILDEN Oil density
LENGTH Length
WIDTH Width

OpenServer User's Manual


MBAL and OpenServer 196

THICKNESS Thickness
STARTINJ Time of start of injection
CONTACT Oil/Gas/Water contact
CUTOFFWC Water cut cut-off
CUTOFFGOR GOR cut-off
POR Porosity
CONWAT Connate water
CUTOFFGOR GOR cut-off
NUMCELLS Number of cells
RELPERM Relative permeability curves
(See Relative Permeability section below)
RESULT[i]. Results table
TIME Time
etc.

5.7.2 Monte Carlo


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.MC

COMPANY Company Name - string


FIELD Field Name - string
LOCATION Location - string
PLATFORM Platform - string
ANALYST Analyst - string
TEMP Reservoir temperature
PRESS Reservoir pressure
NUMCASES Number of cases
STEPS Histogramme Steps
METHOD Method - one of { BULK, AREA }
DIST[I]. Distributions
NOTE that indices cannot be used for this collection,
data must be placed within quotes
Example: MC.DIST[{POR}].TYPE
TYPE The following types are possible { FIXED, UNIFORM,
TRIANGLE, NORMAL, LOGNORMAL }
MIN Minimum
MAX Maximum
MODE Mode
AVE Average
STDDEV Standard deviation

© 1990-2018 Petroleum Experts Limited


197 OpenServer

OIP. Summary of results for oil


MEAN Mean reward
STDDEV Standard deviation
90PROB 90% probabillity
50PROB 50% probabillity
10PROB 10% probabillity
GIP. Summary of results for gas
MEAN Mean reward
STDDEV Standard deviation
90PROB 90% probabillity
50PROB 50% probabillity
10PROB 10% probabillity
RESULT[i]. Results
OIP Oil in place
etc.

5.7.3 Decline Curve


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.DC

COMPANY Company Name - string


FIELD Field Name - string
LOCATION Location - string
PLATFORM Platform - string
ANALYST Analyst - string
ABANRATE Abandonment Rate
PREDSTART Prediction Start
PREDEND Prediction End
MODE One of { BY_TANK, BY_WELL } - string
FLUID_TYPE One of { OIL, GAS, COND } - string
RESULT[I][J] I index is the stream number or the stream name (i.e.
*consol* or well name) could be used. Second index J is
the record in the table.
WELL[I]. Well
NAME Well Name - string
DESCRIPT Description - string
SELECTED One of { YES, NO } - string
PRODSTART Production Start
ABANRATE Abandonment Rate
EXPONENT Exponent

OpenServer User's Manual


MBAL and OpenServer 198

DECLINE Decline type - one of { HYPERBOLIC, HARMONIC,


EXPONENTIAL } - string
PRODHIST[I]. Production history
TIME time
RATE oil or gas rate depending on fluid type
DECRATES[I]. Decline Rates
TIME time
INIT_RATE Initial rate - oil or gas rate depending on fluid type
DECLINE Rate decline

5.7.4 Multi-Layer Tool


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.ML

COMPANY Company Name - string


FIELD Field Name - string
LOCATION Location - string
PLATFORM Platform - string
ANALYST Analyst - string
INJFLUID One of { GAS, WATER } - string
CALCTYPE One of { Buckley, Stiles, Commun, Simple } - string
PRESSURE Pressure
TEMPERATURE Temperature
DIPANGLE Dip Angle
WIDTH Width
WATERRATE Water Rate
GASRATE Gas Rate
CUTOFFWC Cut-off Water Rate
CUTOFFGOR Cut-off GOR
CONWATER Connate Water
LAYER[I]. Input Layers
THICK Thickness
POR Porosity
PERM Permeability
GASBRKSAT Gas breakthrough saturation
WATBRKSAT Water breakthrough saturation
RELPERM Relative permeability curves
(See relative perm section below)
RES[ ][ ][ ]. Calculation results - see end of section (*) for more
information

© 1990-2018 Petroleum Experts Limited


199 OpenServer

TIME Time
Etc.
RES[ ].MATCHED. Matched layer - see end of section (**) for more
information
THICK Thickness
POR Porosity
PERM Permeability
GASBRKSAT Gas breakthrough saturation
WATBRKSAT Water breakthrough saturation
RELPERM Relative permeability curves
(See relative perm section below)

* RES is the sub-string used for the calculation results. This is the data that can be
viewed in the Calculation-Run Calculation dialog or the Production Prediction-Run
Prediction dialog.
There are three indices to be used with RES.

The first index defines the stream. There are always four streams by default which
correspond to each of the four calculation types. Index 0 is the Buckley Leveret stream,
index 1 is the Stiles stream, index 2 is the communicating stream and index 3 is the
simple stream. Other indices will refer to any saved streams. Stream names can be
used instead of the index e.g. RES[{STILES}][0][0]. and the name can be sued for any
saved streams.

The second index defines the sheet within the stream. The first stream is the
consolidated results for the whole reservoir. The next N sheets contain results for each of
the N layers. The layer description can also be used instead of the index e.g.
RES[{STILES}][{LAYER 1}][0].

The third index defines the row in the sheet (where each row is for a different time).

** RES[].MATCHED is the layer calculated for each folder. The RELPERM is the relative
permeability curve calculated by the Fw/Fg matching process. The index defines the
stream as for the first index of the RES[][][] sub-string above. For example the thickness
of the calculated Stiles stream is RES[{STILES}].THICK.

5.7.5 PVT
All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.MB[0].PVT

INPUT[I]. Input PVT Definition


VARPVT Variable PVT - one of { YES, NO }
DATUMDEPTH Datum depth
DATUMPRESS Datum pressure

OpenServer User's Manual


MBAL and OpenServer 200

DATUMTEMP Datum temperature


TEMPGRAD Temperature gradient

The following will be under INPUT for a simple PVT model or LAYER[ ] if a variable
PVT model. If using Generalised Material Balance then the oil, gas and water models
will be preceeded by OIL, GAS and WATER respectively.
SOLGOR Solution GOR
PBCORR Pb, Rs, Bo correlation - one of { GLASO, STANDING,
LASATER, VAZBEGGS, PETROSKY }
µo CORR µo correlation - one of { BEAL, BEGGS, PETROSKY }
µg CORR µg correlation - one of { LEE, CARR }
SEP Separator type - one of { SINGLE, TWO }
USETABLES Use tables - one of { YES, NO }
USEMATCH Use match - one of { YES, NO }
SOLGOR Solution GOR
OILGRAV Oil gravity
GASGRAV Gas gravity
WATSAL Water salinity
H2S Mole percent H2S
CO2 Mole percent CO2
N2 Mole percent N2
TESTPRES Test separator pressure
TESTTEMP Test separator temperature
TESTGOR Test separator GOR
TESTGGRAV Test separator gas gravity
TANKGOR Tank separator GOR
TANKGGRAV Tank separator gas gravity
CGR CGR
DEWPOINT Dew point at reservoir temperature
RESTEMP Reservoir temperature
RESPRESS Reservoir pressure
DEPTH Depth
OILCOMP. Oil composition
NUMCOMP Number of components
USEVOLSHI Use volume shifts - one of { YES, NO }
FTS
COMPONEN.
T[i]
FRACTI Mole fraction
ON
CRITTE Critical temperature
MP
CRITPR Critical pressure
ESS

© 1990-2018 Petroleum Experts Limited


201 OpenServer

CRITV Critical volume


OL
OMEG Omega
A
MOLE Molecular weight
WT
SPECG Specific gravity
RAV
VOLSHI Volume shift
FT
NAME Component name
BICOEFF[i][j] Binary coefficient
SEPARATOR
[i].
PRESS Pressure
TEMP Temperature
TABLE[j][i]. Table data - indices are table and row - note that the temp/
bubble point per table is actually stored for each row of the
table but will have the same value for all rows that can be simply
accessed from row 0.
TEMP Temperature
Etc.
MATCHTABLE[i] Same as TABLE[I][j] above
[j].
TEMP Temperature
Etc.
MATCHON. Whether a variable is to be matched or not
OILFVF Oil FVF
Etc.
PARM. Match parameters
GLASOBP1 Glaso bubble point parameter 1
GLASOBP2 Glaso bubble point parameter 2
GLASOGOR1 Glaso GOR parameter 1
GLASOGOR2 Glaso GOR parameter 2
GLASOFVF1 Glaso Oil FVF parameter 1
GLASOFVF2 Glaso Oil FVF parameter 2
STANDBP1 Standing bubble point parameter 1
STANDBP2 Standing bubble point parameter 2
STANDGOR1 Standing GOR parameter 1
STANDGOR2 Standing GOR parameter 2
STANDFVF1 Standing Oil FVF parameter 1
STANDFVF2 Standing Oil FVF parameter 2
LASBP1 Lasater bubble point parameter 1
LASBP2 Lasater bubble point parameter 2
LASGOR1 Lasater GOR parameter 1

OpenServer User's Manual


MBAL and OpenServer 202

LASGOR2 Lasater GOR parameter 2


LASFVF1 Lasater Oil FVF parameter 1
LASFVF2 Lasater Oil FVF parameter 2
VABGBP1 Vazquez-Beggs bubble point parameter 1
VABGBP2 Vazquez-Beggs bubble point parameter 2
VABGGOR1 Vazquez-Beggs GOR parameter 1
VABGGOR2 Vazquez-Beggs GOR parameter 2
VABGFVF1 Vazquez-Beggs Oil FVF parameter 1
VABGFVF2 Vazquez-Beggs Oil FVF parameter 2
PETRBP1 Petrosky bubble point parameter 1
PETRBP2 Petrosky bubble point parameter 2
PETRGOR1 Petrosky GOR parameter 1
PETRGOR2 Petrosky GOR parameter 2
PETRFVF1 Petrosky Oil FVF parameter 1
PETRFVF2 Petrosky Oil FVF parameter 2
BEALOILV1 Beal Oil viscosity parameter 1
BEALOILV2 Beal Oil viscosity parameter 2
BEGGOILV1 Beggs Oil viscosity parameter 1
BEGGOILV2 Beggs Oil viscosity parameter 2
PETROILV1 Petrosky Oil viscosity parameter 1
PETROILV2 Petrosky Oil viscosity parameter 2
CARRGASV1 Carr gas viscosity parameter 1
CARRGASV2 Carr gas viscosity parameter 2
LEEGASV1 Lee gas viscosity parameter 1
LEEGASV1 Lee gas viscosity parameter 2
ZFACT1 Z factor parameter 1
ZFACT2 Z factor parameter 2
ZFACT3 Z factor parameter 3
GASFVF1 Gas FVF parameter 1
GASFVF2 Gas FVF parameter 2
DEWPOINT1 Dew point parameter 1
DEWPOINT2 Dew point parameter 2
CGR1 CGR parameter 1
CGR2 CGR parameter 2
CGR3 CGR parameter 3

SETUP.
PTS.NUM_PTS Returns the number of path to surface objects defined
_OBJ
PTS[i].LABEL Returns the label of the i path to surface object
PTS[i].IS_VALI Validation flag for the i path to surface object
D 1 - valid
0 - invalid
PTS[i].IS_VALI Validation flag for the i path to surface object when criteria is oil
D_OILGAS and gas outlets ONLY

© 1990-2018 Petroleum Experts Limited


203 OpenServer

1 - valid
0 - invalid
PTS[i].PROCE For the path to surface object i, accesses the pressure of
SSDATA.SEPARATORseparator j.
[j].PRESSURE
PTS[i]..PROCE For the path to surface object i, accesses the temperature of
SSDATA.SEPARATORseparator j.
[j].TEMPERATURE
PTS[i]..PROCE For the path to surface object i, accesses the pressure of chiller
SSDATA.CHILLER[J].P j.
RESSURE
PTS[i]..PROCE For the path to surface object i, accesses the temperature of
SSDATA.CHILLER[j].T chiller j.
EMPERATURE

5.7.6 Material Balance


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.MB

COMPANY Company Name


FIELD Field Name
LOCATION Location
PLATFORM Platform
ANALYST Analyst
FLUID One of {OIL,GAS,CON}
MODEL One of {SIMPLE,MULTI,VARPVT}
HISTBY One of {TANK,WELL}
COMPTRACK One of {YES,NO}

HISTWELL[I]. History wells


NAME Name
TYPE One of { ANY, CONPROD, ESPPROD, GASCAP, GASINJ,
GASLIFT, GASPROD, OILPROD, WATINJ, WATPROD }
DISABLED 0=well enabled, 1=well disabled
PERFTOP Perforation Top
PERFBOTTOM Perforation Bottom
PRODHIST[I]. Production history
TIME Time
PRESS Pressure
CUMOIL Cumulative oil production
CUMGAS Cumulative gas production
CUMWAT Cumulative water production
CUMGASIN Cumulative gas injection

OpenServer User's Manual


MBAL and OpenServer 204

J
CUMWATIN Cumulative water injection
J
CUMGOR Cumulative GOR
RECOFF 0 if record enabled, 1 if the record is disabled

TANK[I]. Tanks
MONCON Monitor contacts - one of {YES,NO}
GASCAPPROD Gas Cap production - one of {YES,NO}
TOTSAT Total Saturations - one of {YES,NO}
GASSTORAGE Gas storage - one of {YES,NO}
NAME Name
TYPE Type - one of {OIL,GAS,CON,WATER}
TEMP Temperature
PRESS Initial Pressure
POROSITY Porosity
OOIP Original oil in place
OGIP Original gas in place
OWIP Original water in place
INITGASCAP Initial gas cap
GASSTOREPV Gas storage pore volume
WATCOMPRESS Water Compressibility (3.4e38 for Use Correlations)
ROCKCOMPRES Rock Compressibility
S
PRODSTART Start of production
AQUIFTYPE Aquifer type - one of { NONE, SMALLPOT, SCHILTHUIS,
HURSTSIMPL, HURSTODEH, HURSTDAKE, VOGT,
FETKOSTEADY, FETKOUNSTEADY, HURSTMODIF ,
CARTERTRACY }
SYSTEM Type - one of { RADIAL, LINEAR, BOTTOMDRIVE }
RESTHICK Reservoir thickness
RESRADIUS Reservoir radius
CONWATER Connate water saturation
RESWIDTH Reservoir width
ANISOTROPY Anisotropy
PERMEABILITY Permeability
AQUIF. Aquifer parameter
RD Outer/Inner radius ratio
ANGLE Encroachement Angle
PERM Aquifer Permeability
VOLUME Aquifer volume
DIFFUSIV Aquifer diffusivity
TD TD constant
MODEL Type - one of { CONSTPRESS, SEALBOUND, INFINITE} -
string

© 1990-2018 Petroleum Experts Limited


205 OpenServer

ROCKFROM Rock compressibility - one of {CORREL, TABLE,


USERINPUT }
COMPRESS[I]. Rock compressibility table
PRESS Pressure
CF Rock compressibility
PORVOL[I]. Pore volume vs depth table
PV Pore volume
DEP Depth
PRODUSEGOR Use GOR for production data
PRODHIST[I]. Production history collection
TIME Time
PRESS Pressure
CUMOIL Cumulative oil production
CUMGAS Cumulative gas production
CUMWAT Cumulative water production
CUMGASINJ Cumulative gas injection
CUMWATINJ Cumulative water injection
CUMGOR Cumulative GOR
RECOFF 0 if record enabled, 1 if the record is disabled
RELPERM Relative permeability curves (See rel perm section below)

LEAK[I]. Leaks (transmissibility between the tanks)


NAME Name
TRANS Transmissibility
TCORR Tranmissibility-Permeability correction
THRESHTYPE Type - one of {NONE,EQUAL,UNEQUAL}
THRESHVALUE Pressure threshold value
USE_PROD Type - one of {YES,NO}
USEOWN Use own rel perms - one of {YES,NO}
RELPERM Relative permeability curves (See rel perm section below)
CONSTRAINTS. Constraints
SWBREAK Sw breakthru
SGBREAK Sg breakthru
SOBREAK So breakthru
WDEPBREA Water depth breakthru
K
GDEPBREA Gas depth breakthru
K
WATBREAKTWater breakthru type - one of {SAT,DEPTH}
YPE
GASBREAKT Gas breakthru type - one of {SAT,DEPTH}
YPE
RELPERMC Rel perm correction - one of {YES,NO}
ORR
PRODHIST[I]. Production history collection

OpenServer User's Manual


MBAL and OpenServer 206

TIME Time
PRESS Pressure
DELPRESS Delta Pressure
CUMOIL Cumulative oil production
CUMGAS Cumulative gas production
CUMWAT Cumulative water production
RECOFF 0 if record enabled, 1 if the record is disabled

HISTINP. Production history setup


NOESTIM Ignore estimated pressure points - one of {YES, NO}
STEPTYPE History step size type - one of {AUTO, USER}
USERSTEP User defined history step size
STDDEV Standard Deviation for History Matching Regression. ex
DoGet("MBAL.MB[0].HISTINP.STDDEV")

PREDINP. Prediction inputs


This first set of inputs correspond to the data entered in the prediction setup
dialog.
CALCTYPE Prediction type - one of {RES_PRESS, MANPRESS, PROD,
DCQ}
START Prediction start type - one of {STARTPROD, ENDHIST, USER}
USERSTART User defined prediction start time
END Prediction end type - one of {AUTO, ENDHIST, USER}
USEREND User defined prediction end time
STEPTYPE One of {AUTO,USER}
USERSTEP User defined prediction step size
WATINJ With water injection - one of {YES,NO}
GASINJ With gas injection - one of {YES,NO}
GASLIFT With gas lift injection - one of {YES,NO}
GASREC With gas recycling - one of {YES,NO}
WATREC With water recycling - one of {YES,NO}
AQUPROD With aquifer production - one of {YES,NO}
GASCAP With gas cap production - one of {YES,NO}
WATVOID With voidage replacement with water - one of {YES,NO}
GASVOID With voidage replacement with gas - one of {YES,NO}
RELPERM Use relative permeabilities - one of {YES,NO}
CALCPOT Calculate field potential - one of {YES,NO}
USEDCQ Use DCQ and swing factor - one of {YES,NO}
The next set correspond to the reporting schedule dialog
REPSTEPTYPE Reporting frequency type - One of {AUTO, USER, LIST}
REPSTEPVALUE Reporting user step size
REPSTEPSTYLE unit for user step - one of {DAY, WEEK, MONTH, YEAR}
KEEPHIST Keep history - one of {YES,NO}
USERREPSTEP[ User date list
I].

© 1990-2018 Petroleum Experts Limited


207 OpenServer

TIME Time

The next set correspond to the DCQ swing factor dialog


SWING[I]. Swing factors
TIME Time
SWINGFACT Swing factor

The next set correspond to the DCQ schedule dialog


DCQ[I]. DCQ
TIME Time
MAXSWING Swing factor
FACT

The next set correspond to the well schedule dialog


DRILL[I]. Drilling schedule
STARTTIME Start time
ENDTIME End time
WELLDEF Well definition
DTFACT Down time factor
NUMWELLS Number of wells

CONSTRAINT[I]. Prediction production and constraints


TIME Times
MANPRESS Manifold pressure
MINGASRATE Minimum gas rate
MAXGASRATE Maximum gas rate
MAXWATRATE Maximum water rate
MAXLIQRATE Maximum liquid rate
GASINJMANPRE Gas injection manifold pressure
SS
MININJGAS Minimum injection gas rate
MAXINJGAS Maximum injection gas rate
INJGASGRAV Injection gas gravity
MOLEH2S Mole % H2S
MOLECO2 Mole % CO2
MOLEN2 Mole % N2
WATSALIN Water salinity
WATRECY Water recycling
WATRECYCUTO Water recycling cutoff
FF
AQUWATMANP Aquifer production manifold pressure
RESS
MINAQUWATRA Minimum aquifer water rate
TE
MAXAQUWATR Maximum aquifer water rate

OpenServer User's Manual


MBAL and OpenServer 208

ATE
MINOILRATE Minimum oil rate
MAXOILRATE Maximum oil rate
GASVOIDREPL Gas voidage replacement
WATVOIDREPL Water voidage replacement
WATINJMANPRE Water injection manifold pressure
SS
MININJWATRAT Minimum injection water rate
E
MAXINJWATRAT Maximum injection water rate
E
MAX_GASLIFT Maximum gas lift rate
GASRECYL Gas recycling
GASRECCUTOF Gas recycling cutoff
F

PREDWELL[I]. Prediction wells


NAME Name
TYPE One of { ANY, CONPROD, ESPPROD, GASCAP, GASINJ,
GASLIFT, GASPROD, OILPROD, ATINJ, WATPROD }
DISABLED 0=well enabled, 1=well disabled
MINFBHP Minimum flowing bottom hole pressure
MAXFBHP Maximum flowing bottom hole pressure
MINFWHP Minimum flowing well head pressure
MAXFWHP Maximum flowing well head pressure
GASLIFTGLR Gas lift optimum GLR
OPTFREQ Operating frequency
CONSTFBHP Constant flowing bottom hole pressure for constant FBHP
outflow performance type.
PERFORMTYPE Well performance type one of { CFBHP, LIFTCURV, SMITH,
WITLEY }
TPC.
EXTRAPOL Extrapolation flag one of { YES, NO }
ATE
CONSTRAINTS. Abandonments
WATDEPA Water depth abandonment
BAN
WORABAN WOR water abandonment
GASDEPA Gas depth abandonment
BAN
GORABAN GOR Abandonment
MINRATE Minimum rate
MAXRATE Maximum rate
WATABANT Water abandonment type - one of {WOR, WGR, WATCUT,
YPE DEPTH}
GASABANT Gas abandonment type - one of {GOR,CGR,DEPTH}

© 1990-2018 Petroleum Experts Limited


209 OpenServer

YPE
ABANREC Allow recovery after abandonment - one of {YES,NO}
OV
IPR[I].
TYPE Inflow performance type - one of {CN, FORCH,
PSEUDOFORCH, STRLINE_VOGEL}
PI Productivity index
CROSSPI Crossflow Injectivity index
DARCY Darcy
CROSSDA Crossflow Injectivity Darcy
RCY
NONDARCYNon-Darcy
PERMCOR Permeability correction
R
CVALUE C
CROSSCV Crossflow Injectivity C
ALUE
NVALUE n
PERF_TOP Top of perforations
PERF_BOT Bottom of perforations
TOM
IPR_SHIFT IPR dP Shift
USE_RELP Use relative permeability flag
ERMS
TESTRESP Test reservoir pressure
RESS
TESTWATC Test water cut
UT
USEOWN_ Use own rel perms flag - one of {YES,NO}
RELPERMS
RELPERM Relative permeability curves (See rel perm section below)
USEGASC Gas coning flag - one of {YES,NO}
ONING
GASCONE Gas coning match data
MATCH.
F2 F2 tuning parameter
F3 F3 tuning parameter
EXPON Exponent tuning parameter
ENT
GOC Gas-oil contact
TESTD Test points
ATA.
PR Producing GOR
OD_GOR
LIQ Liquid rate
RATE

OpenServer User's Manual


MBAL and OpenServer 210

CONSTRAI abandonments and breakthroughs


NTS.
SWBRE Sw breakthru
AK
SGBRE Sg breakthru
AK
SOBRE So breakthru
AK
WATDE Water depth abandonment
PABAN
WORAB WOR water abandonment
AN
GASDE Gas depth abandonment
PABAN
GORAB GOR Abandonment
AN
DPMAX Maximum draw-down in dP
DD
PERCM Maximum draw-down in percent
AXDD
UNITMA Maximum drawdown unit
XDD
WDEPB Water depth breakthru
REAK
GDEPB Gas depth breakthru
REAK
WATBR Water breakthru type - one of {SAT,DEPTH}
EAKTYPE
WATAB Water abandonment type - one of
ANTYPE {WOR,WGR,WATCUT,DEPTH}
GASBR Gas breakthru type - one of {SAT,DEPTH}
EAKTYPE
GASAB Gas abandonment type - one of {GOR,CGR,DEPTH}
ANTYPE
RELPER Rel perm correction - one of {YES,NO}
MCORR
ABANRE Allow recovery after abandonment - one of {YES,NO}
COV

TRES[ ][ ][ ]. Tank results - see end of section (*) for more information
TIME Time
Etc.

WRES[ ][ ][ ]. Well results - see end of section (**) for more information
TIME Time
Etc.

© 1990-2018 Petroleum Experts Limited


211 OpenServer

* TRES is the sub-string used for the tank (and leak) results. This is the data that can be
viewed in the History Matching-Run Simulation dialog or the Production Prediction-Run
Prediction dialog.

There are three indices to be used with TRES:

The first index defines the stream, where:


- Index 0 is the production history stream
- Index 1 is the history simulation stream
- Index 2 is the production prediction stream

Other indices will refer to any saved streams.

The second index defines the sheet within the stream:


For single tank cases there will only ever be one sheet which refers to the one and only
tank, so always use 0. For multi-tank cases, the first sheet will always be the
consolidated results for all tanks i.e. the sum of all tanks. The next N sheets contain
results for each of the N tanks. The next M sheets contain results for each of the M
leaks.

The third index defines the row in the sheet, where each row is for a different time.

**WRES is the sub-string used for the well results. This is the data that can be viewed in
the Production Prediction-Well Results dialog.

There are three indices to be used with WRES:


The first index defines the well.

The second index defines the sheet within the stream.


For a well that has a single layer (i.e. connection to a tank) there will only ever be one
sheet which refers to the one and only layer, so always use 0. For multi-layer well, the
first sheet will be the results for the well. The next N sheets contain results for each of the
N layers.

The third index defines the row in the sheet, where each row is for a different time.

5.7.7 Production Allocation


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.PA

Most of the production allocation data is the same as the data for the material balance
tool. Therefore the variable names are mostly the same as the material balance tool.
The additional variables used by the production allocation tool are listed below:

ALLOCINP.

OpenServer User's Manual


MBAL and OpenServer 212

USERSTEP User defined allocation step size


STEPTYPE Allocation step size type - one of {AUTO, USER}

5.7.8 Tight Gas


All the following variables will need to be preceded by the following OpenServer string
structure:

MBAL.TG

Most of the tight gas data is the same as the data for the material balance tool.
Therefore the variable names are mostly the same as the material balance tool. The
additional variables used by the tight gas model are listed below:

WELL History wells


NAME Name
TYPE BoundedRadial
DARCY Darcy skin
NONDA Non Darcy skin
RCY
INITPR Initial Pressure
ESS
INITTE Initial Temperature
MP
DRAIN Drainage Area Radius
RADIUS
RESTHI Layer Thickness
CK
PRODS Start of production
TART

Production History
TIME Time
FBHP Flowing bottom hole pressure
CUMGAS Cumulative gas produced

Run Prediction
ENDHIST Start the prediction at the end of the production history
STARTPROD Start the prediction at the start of the production history
USER Start the prediction from a user defined value

Prediction End
AUTO Prediction end determined by MBAL
ENDHIST Prediction will end at the last production history time
USER Prediction will end determined by the User

© 1990-2018 Petroleum Experts Limited


213 OpenServer

Prediction Step Size


AUTO Determined by the program
USER User defined prediction step size

5.7.9 Relative Permeability Curves


All the following variables will need to be preceded by the RELPERM prefix and also by
the corresponding tool and if necessary tank name, for example the following
OpenServer string structure is used under Material Balance:

MBAL.MB[0].TANK[{tank_name}].RELPERM

PERM Permeability
DIPANGLE Dip angle
WATSWEEP Water sweep efficiency
GASSWEEP Gas sweep efficiency
FROM Type - one of {TABLES,COREY}
MODIFIED Type - one of {NO,STONE1,STONE2}
The next section is used for rel perms tables
WATER[i]. Water rel perm table
SW Water saturation
KRW Water rel perm
OIL[i]. Oil rel perm table
SO Oil saturation
KRO Oil rel perm
KROG Oil to gas rel perm
KROW Oil to water rel perm
GAS[i]. Gas rel perm table
SG Gas saturation
KRG Gas rel perm

The next section is used for corey functions


RESSAT. Residual saturation
KRW water
KRO oil
KROW oil to water
KROG oil to gas
KRG gas
ENDPOINT. End point
KRW water
KRO oil
KROW oil to water
KROG oil to gas
KRG gas
EXPON. Exponent

OpenServer User's Manual


MBAL and OpenServer 214

KRW water
KRO oil
KROW oil to water
KROG oil to gas
KRG gas

© 1990-2018 Petroleum Experts Limited


Chapter

6
PROSPER and OpenServer 216

6 PROSPER and OpenServer

6.1 Overview
The aim of this section is to provide a reference for the OpenServer variable names
corresponding to the data variable names encountered in PROSPER and also the open
functions used to execute commands. Where there are multiple instances of a given
variable, e.g. in a table, the range of rows in the table is given as i = m:n where i is an
indexing variable and m and n are the lower and upper limits of the range. The range
expression is placed above the documentation of the block of variables to which it
applies. In some cases, the range upper limit is itself a variable, such as the multilateral
well data and the method of finding this is also shown. Other refinements are multiple
dimensionalities of tables (a table within a table) and the ability to access multilateral
network items by their label rather than an index whose value is not available to the user
in the Windows interface.

At the end of this chapter there is a section with some code fragments written for VBA in
conjunction with an Excel spreadsheet. Note that only the DoGet functionality is
illustrated here since the DoSet function is trivially implemented by swapping the DoGet
and DoSet sub-routine calls.

The PROSPER data is divided into four sections:

PVT PVT data


SIN INPUT data
ANL Calculation INPUT data
OUT Calculation RESULTS

Each section will be accessed thus:

PROSPER.PVT
PROSPER.SIN
PROSPER.ANL
PROSPER.OUT

6.2 General Comments

In PROSPER there are some commands which are general (such as extracting units or
counting rows of data), irrespective of the section they are used in. The following
sections describe how these can be used.

© 1990-2018 Petroleum Experts Limited


217 OpenServer

6.2.1 Getting the strings through Ctrl+Right Click

Although a listing of all the OpenServer commands are available in the sections that
follow, an easy way of extracting these is by simultaneously using the Ctrl and Right
Click keyboard and mouse action on the desired variable.

For example, by placing the mouse cursor on top of the 'Solution GOR' box in the PVT
screen and selecting Ctrl + Right Click, the screen with the Access String for this
variable will appear. The String can then be copied on the clipboard for use in the
macro.

6.2.2 List of variables in PROSPER file

PROSPER Version 12.0 includes the feature which allows the user to see all the
OpenServer variables available in any particular file. Access to these lists is achieved
from the 'Wizard' option:

OpenServer User's Manual


PROSPER and OpenServer 218

In this screen, a particular wizard macro can be selected or a new one created:

In the screen where the wizard macro can be written, the user has access to a menu with
all the commands available in the file as shown below:

© 1990-2018 Petroleum Experts Limited


219 OpenServer

The “Variables” button gives access to all the variables available in this particular file:

OpenServer User's Manual


PROSPER and OpenServer 220

Also, the on-line help system that can be accessed directly from the main PROSPER
screen contains a majority of the currently available OpenServer commands, variables
and functions. The utility also includes a search feature, providing quick access to the
desired OpenServer string.

© 1990-2018 Petroleum Experts Limited


221 OpenServer

OpenServer User's Manual


PROSPER and OpenServer 222

© 1990-2018 Petroleum Experts Limited


223 OpenServer

6.2.3 Evaluate OpenServer Statement Section

The 'Evaluate OpenServer Statement' enables the user to analyse the effect of one
specific OpenServer operation and get an estimation of the value of one parameter of
the model, set a specific value to one parameter of the model or launch a calculation
through a calculation command.

This section can be accessed through the File | Evaluate OpenServer Statement
section in the PROSPER main menu bar.

OpenServer User's Manual


PROSPER and OpenServer 224

A particular string can be entered by hand or copied from the clipboard. Then, the
“Evaluate” button will do the requested operation of:
- DoGet (i.e. obtain the current value of the variable considered)
- DoSet (i.e. set the value of the variable considered)
- DoCommand (i.e. execute a GAP calculation for instance).

The Commands, Variables and Functions buttons enable access to the list of the
commands, variables and functions accessible through PROSPER OpenServer.

6.2.4 Setting the Units and Validation Limits

Changing the Unit System


The units section in PROSPER can be controlled by the OpenServer and units can be
set at a global level (corresponding to the unit systems shown in the list):

© 1990-2018 Petroleum Experts Limited


225 OpenServer

For example the following command will set the unit system to Norwegian SI:

DoCmd "PROSPER.SETUNITSYS(""Norwegian S.I."")"

On the other hand, if the intent is to extract the unit name of a particular variable in the
program, then the UNITNAME extension can be used at the end of the root defining the
variable. For example, if one would like to extract the unit in the program associated
with the solution GOR entry box in the PVT section, then the following command will
return the unit name:

AA = DoGet("PROSPER.PVT.Input.Solgor.Unitname")

The same goes for all variables. As another example, the top node pressure entry in the
system calculation will return it’s unit name with the following line:

AA = DoGet (“PROSPER.ANL.SYS.Pres.Unitname”)

NOTE
1. The Unitname commands will return strings, so please make sure the variables (like
AA above) are defined correctly.
2. The units of single variables can only be extracted, not set (DoGet will work on the
examples above but DoSet will not).

Changing Validation Limits

OpenServer User's Manual


PROSPER and OpenServer 226

It is also possible to use OpenServer to change validation limits; this can be done by
adding .UNITMIN and .UNITMAX statement to corresponding tag string.
For example the following command can be used to change minimum pressure limit

DoSet ("PROSPER.SIN.IPR.Single.Pres.UNITMIN"), value

One element to consider is that when changing the limits through OpenServer is that tag
strings for different parameters can access the same limit in the unit section.

For instance, two following tag strings will both access the lower pressure limit in the
units section

PROSPER.SIN.IPR.Single.Pres.UNITMIN
PROSPER.ANL.SYS.Pres.UNITMIN

6.2.5 Counting number of entry data points or calculated results

When writing macros for use with the OpenServer, one of the practical requirements is
to know how many rows of data have been calculated when executing a calculation (like
a gradient calculation for instance):

There are several commands that allow the user to extract the number of results and
many are listed in the description of roots available for every section. However the
.COUNT or .NUM commands can generally be used at the end of a string to extract the
number of rows.

Example:
For example, the pressure values in the gradient calculation results can be obtained
using the following OpenServer string:

© 1990-2018 Petroleum Experts Limited


227 OpenServer

PROSPER.OUT.GRD.Results[0][0][0].Pres[0]

In this case the total number of rows in the table can be obtained by counting the number
pressure values. This can be done by adding .COUNT to the above string (without the
index in the square brackets). The syntax is as follows:

NumCalcs = DoGet ("PROSPER.OUT.GRD.Results[0][0][0].Pres.COUNT")

Similarly in the PVT calculator screen, the number of rows can be extracted using:

NumCalcs = DoGet ("PROSPER.PVT.Calc.Results.COUNT")

NOTE:
The .COUNT is not designed to work for every screen in the program, and alternative
commands are given in the relevant sections, such as the .NUM-1.

6.3 Preferences

The below section will describe how the user can retrieve or set preferences values
using open server string:

All parameters in PROSPER preferences can be access and edited using the below
OpenServer Function: PROSPER.PREFERENCES

This Function has the following syntax: PROSPER.PREFERENCES (iType, iPref,


sValue)

The above function should run always as DoGet: DoGet(PROSPER.PREFERENCES


(iType, iPref, sValue))

OpenServer User's Manual


PROSPER and OpenServer 228

6.3.1 iType
iType value are: -2, -1, 0, 1, 2. The details of each one are in the below table:

IType
Description
value

iType = -2 This will return the number of preferences that can be changed
Syntax: DoGet(PROSPER.PREFERENCES (-2))
This will display the list of the preferences with the associated Icommand
iType = -1 that will be used if needed to retrieve the preference value or change its
current value for instance.
Syntax: DoGet(PROSPER.PREFERENCES (-1))
This with the Icommand as Ipref will return the name of the preference.
iType = 0 Syntax: DoGet(PROSPER.PREFERENCES (0, 511)) will return:
VLPMaxRates (VLP Maximum Number Of Rates)
This with the Icommand as Ipref of the preference will return the value of the
iType = 1 current value set of the preference.
Syntax: DoGet(PROSPER.PREFERENCES (1, 511)) will return: 20
( current value of VLP Maximum Number Of Rates)
To set a new value of a preference, this can be achieved by using the
value of 2 as itype, with the preference Icommand as Ipref and the value to
iType = 2 be set.
Syntax: DoGet(PROSPER.PREFERENCES (2, 511, 30)) will set the
value of VLP Maximum Number Of Rates to 30.

6.3.2 iPref
iPref represent the parameter iCommand that needed to retrieve the value of that
parameter or change its value. List of all the iPref with its associated iCommand is in
the below tabs, each tab represent the tab in the preferences screen:

Tab 1
0 = DialogFont iCommand = 100

1 = PaintAbout iCommand = 101

2 = StatusType iCommand = 102

3 = NewStatusFont iCommand = 103

4 = clrStatusLabel iCommand = 104

© 1990-2018 Petroleum Experts Limited


229 OpenServer

5 = clrStatusText iCommand = 105

6 = clrBackground iCommand = 106

7 = clrStatusBack iCommand = 107

8 = clrStatusShadow iCommand = 108

9 = clrStatusHiLite iCommand = 109

10 = Compact iCommand = 110

11 = CompactSize iCommand = 111

12 = CalcBox iCommand = 112

Tab 2

0 = DataDir iCommand = 200

1 = DefaultDataDir iCommand = 201

2 = LastFileLoadedOnStartUp iCommand
= 202

3 = LastFileListLength iCommand = 203

4 = ImportFile iCommand = 204

5 = DefaultImpDir iCommand = 205

6 = ImportFilter iCommand = 206

7 = ReportDest iCommand = 207

8 = ReportUser iCommand = 208

9 = FileCompression iCommand = 210

OpenServer User's Manual


PROSPER and OpenServer 230

10 = FileOverWrite iCommand = 211

11 = FileSaveOUT iCommand = 212

Tab 3

0 = LabelFlag iCommand = 300

1 = ScaleFlag iCommand = 301

2 = ScaleMethod iCommand = 302

3 = GridFlag iCommand = 303

4 = StampFlag iCommand = 304

5 = LegendFlag iCommand = 305

6 = MouseFlag iCommand = 306

7 = Xblocks iCommand = 307

8 = Yblocks iCommand = 308

9 = LineThickness iCommand = 309

10 = PlotReset iCommand = 310

11 = NewPlotVertFont iCommand = 311

12 = NewPlotHorzFont iCommand = 312

13 = NewPlot iCommand = 313

14 = NewPlotSymbol iCommand = 314

Tab 4

© 1990-2018 Petroleum Experts Limited


231 OpenServer

0 = Desc1 iCommand = 400

1 = Desc2 iCommand = 401

2 = Desc3 iCommand = 402

3 = Desc4 iCommand = 403

4 = Comm1 iCommand = 404

5 = Comm2 iCommand = 405

6 = Comm3 iCommand = 406

7 = Comm4 iCommand = 407

Tab 5
0 = AOFMaxOil iCommand = 500

1 = AOFMaxGas iCommand = 501

2 = AOFMaxCon iCommand = 502

3 = MinGLRInj iCommand = 503

4 = VLPMax iCommand = 504

5 = HSPTOL iCommand = 505

6 = HSPTLP iCommand = 506

7 = HSPMLT iCommand = 507

8 = HSPDIV iCommand = 508

9 = HSPLIM iCommand = 509

10 = TPDDocument iCommand = 510

OpenServer User's Manual


PROSPER and OpenServer 232

11 = VLPMaxRates iCommand = 511

12 = VLPMaxVals iCommand = 512

13 = ChokeDebug iCommand = 513

14 = CalcDone iCommand = 209

15 = CalcShow iCommand = 515

6.3.3 sValue
The svalue is the values desired to be set for any preferences based on the iType and
iPref.
6.3.4 Examples
Example 1: Retrieve the current value of VLP Maximum Number Of Rates

Example 2: Set a new value of VLP Maximum Number Of Rates

© 1990-2018 Petroleum Experts Limited


233 OpenServer

6.4 Options Summary Data

This is the data associated with the options screen in PROSPER:

OpenServer User's Manual


PROSPER and OpenServer 234

PROSPER.SIN.SUM.FLUID Fluid Type (Oil / Gas / Condensate)


Example:
DoSet "PROSPER.SIN.SUM.Fluid", 2
The command will select the “Retrograde Condensate”
Model. 0 and 1 will select oil and gas methods
respectively.
PROSPER.SIN.SUM.PVTM PVT Model (Black Oil /EOS)
ODEL Example:
DoSet " PROSPER.SIN.SUM.PVTMODEL ", 0
The command will select the “Black Oil” Model. 2 will set
the PVT Model to EOS (1 does not exist).
PROSPER.SIN.SUM.EOSM Equation of State Model (by default set to “Internal” should
ODEL only be changed when an external EOS model is available
and required.)
PROSPER.SIN.SUM.SEPA Separator option (Single-stage / Two-stage)
RATOR
PROSPER.SIN.SUM.EMUL Emulsion option (DoSet, 1 and 0 will switch this option on
SION or off)
PROSPER.SIN.SUM.HYDR Hydrates Warning option (Same logic as above)
ATE

PROSPER.SIN.SUM.FLOW Flow Type (Tubing/Annular/Both – Use


TYPE DoSet ”PROSPER.SIN.SUM.FLOWTYPE”, 0, 1, 2 for

© 1990-2018 Petroleum Experts Limited


235 OpenServer

required option respectively)


PROSPER.SIN.SUM.WELLT Well Type (Producer/Injector/Water Injector selected by
YPE doing a DoSet and setting the value to 0, 1 or 2
respectively)

PROSPER.SIN.SUM.LIFTM Lift Method. Setting the value to:


ETHOD 0 - None
1 - Gas Lift (Continuous)
2 - Electric Submersible Pump
3 - Hydraulic Drive Downhole Pump
4 - Progressive Cavity Pump
5 - Coil Tubing Gas Lift
6 - Diluent Injection
7 - Jet Pump
8 - Multiphase Pump
9 - Sucker Rod Pump
10 - Gas Lift (Intermittent)

PROSPER.SIN.SUM.LIFTTY Lift Type chosen per Lift Method


PE[i] Example:
DoSet "PROSPER.SIN.SUM.LIFTTYPE[1]", 2
The line will set the Gas Lift method to “Safety Equipment”
type. Here [i] is the index of the lift method as above and 2
is the option associated with it.

PROSPER.SIN.SUM.PREDI Prediction Flag


CT Setting this to 0, 1 and 2 will enable the “Pressure Only”,
“Pressure and Temperature(Offshore)” and “Pressure and
Temperature(On Land)” modes respectively.
PROSPER.SIN.SUM.TEMP Temperature Model
MODEL Setting this to 0, 1 and 2 will enable the “Rough
Approximation”, “Enthaply Balance” and “Improved
Approximation” methods respectively.
PROSPER.SIN.SUM.RANG Calculation Range (Full System/Pipeline Only)
E
PROSPER.SIN.SUM.OUTP Calculation Output Display Option
UT

PROSPER.SIN.SUM.STEA Steam Calculation Flag: 0 - off; 1 - on (only available if


M Temperature model is set to "Enthalpy Balance" of
"Improved Approximation")

PROSPER.SIN.SUM.COMP Completion Type (Cased Hole / Open Hole)


LETION
PROSPER.SIN.SUM.GRAV Gravel Pack. Setting the value to:

OpenServer User's Manual


PROSPER and OpenServer 236

ELPACK 0 - None
1 - Gravel pack
2 - Pre-packed screen
3 - Wire wrapped screen
4 - Slotted liner

PROSPER.SIN.SUM.INFLO Inflow Type ( Single Branch / Multi-Lateral )


WTYPE
PROSPER.SIN.SUM.GASC Gas Coning Flag
ONING

PROSPER.SIN.SUM.COMP
ANY
PROSPER.SIN.SUM.FIELD
PROSPER.SIN.SUM.LOCAT
ION
PROSPER.SIN.SUM.WELL
PROSPER.SIN.SUM.PLATF
ORM
PROSPER.SIN.SUM.ANALY
ST
PROSPER.SIN.SUM.DATE In order to export in date format (either dd/mm/yyyy or mm/
dd/yyyy depending on local settings) this must be
converted into a date string. i.e.
CDate(DoGet("PROSPER.SIN.SUM.DATE"))
PROSPER.SIN.SUM.COMM
ENTS

6.5 PVT Data Section


The PVT data is accessed using the root name PROSPER.PVT and is split up into
several sections as listed below.

INPUT Input data associated with black oil models


CORREL Correlation matching parameters
MATCH Match data
TABLE Look up table data
CALC Calculation results
EOS Data associated with equation of state model
DLL Data associated with user DLL models
EMULS Emulsion data
VISC Viscosity data

© 1990-2018 Petroleum Experts Limited


237 OpenServer

HYD Hydrates formation table

Each section will be accessed using the initial string:

PROSPER.PVT.INPUT
PROSPER.PVT.CORREL
PROSPER.PVT.MATCH
PROSPER.PVT.TABLE
PROSPER.PVT.CALC
PROSPER.PVT.EOS
PROSPER.PVT.DLL
PROSPER.PVT.EMULS
PROSPER.PVT.VISC
PROSPER.PVT.HYD

6.5.1 INPUT - Input Data


These are input data items for the Black Oil models:

PROSPER.PVT.INPUT.PBCORR Pb, Rs, Bo Correlation


0 = Glaso
1 = Standing
2 = Lasater
3 = Vazquez-Beggs
4 = Petrosky

OpenServer User's Manual


PROSPER and OpenServer 238

5 = Al Marhoun
Example:
DoSet “PROSPER.PVT.Input.PBcorr”, 1
The string will set the correlation to “Standing”.
PROSPER.PVT.INPUT.UOCORR Oil Viscosity Correlation
0 = Beal
1 = Beggs
2 = Petrosky
3 = Egbogah et al (heavy oil)
4 = Bergman-Sutton
PROSPER.PVT.INPUT.UGCORR Gas Viscosity Correlation
0 = Lee
1 = Carr
PROSPER.PVT.INPUT.SOLGOR Solution GOR
PROSPER.PVT.INPUT.API Oil Gravity
PROSPER.PVT.INPUT.GRVGAS Gas Gravity
PROSPER.PVT.INPUT.WATSAL Water Salinity
PROSPER.PVT.INPUT.PSEP Separator Pressure
PROSPER.PVT.INPUT.TSEP Serarator Temperature
PROSPER.PVT.INPUT.GORSEP Separator GOR
PROSPER.PVT.INPUT.GRVSEP Separator Gravity
PROSPER.PVT.INPUT.GORTNK Tank GOR
PROSPER.PVT.INPUT.GRVTNK Tank Gravity
PROSPER.PVT.INPUT.CGR Condensate to Gas Ratio
PROSPER.PVT.INPUT.WGR Water to Gas Ratio
PROSPER.PVT.INPUT.H2S Mole Percent H2S
PROSPER.PVT.INPUT.CO2 Mole Percent CO2
PROSPER.PVT.INPUT.N2 Mole Percent N2
PROSPER.PVT.INPUT.DEWPNT Saturation Pressure at Reservoir Temperature
(for Black Oil Condensate Model)
PROSPER.PVT.INPUT.TRES Reservoir Temperature
PROSPER.PVT.INPUT.PRES Reservoir Pressure

6.5.2 MATCH - PVT Match Data


This is the data used for matching to Black Oil Correlations.

PROSPER.PVT.MATCH.TABLE Current Table Number.


Example: The following line:
DoSet "PROSPER.PVT.MATCH.TABLE", 2

© 1990-2018 Petroleum Experts Limited


239 OpenServer

will activate the 3rd table of the 50 tables available


in the match data section.

PROSPER.PVT.MATCH.DATA.CO Returns the number of tables that have data


UNT included.
PROSPER.PVT.MATCH.DATA[i].C Returns the number of pressure values that are
OUNT entered for the table number i,
PROSPER.PVT.MATCH.OK[0:3] Returns if there exists any data defined for PVT
Match data section. the integer represents the type
of fluid representing:
0 = Oil
1 = Gas
2 = not used
3 = Condensate.
If there exists any data in the PVT match data
section, then the command will return a 1 or else 0.
PROSPER.PVT.MATCH.TEMP Max Number of Temperatures
PROSPER.PVT.MATCH.PRES Max Number of Pressures
PROSPER.PVT.MATCH.VARS Max Number of Variables
PROSPER.PVT.MATCH.DATA[i][j] Match Data
[k] i = 0 : temp
j = 0 : pres
k = 0 : varies

k= 0 Temperature
k= 1 Pressure
k= 2 Bubble Point
k= 3 Dew Point
k= 4 Oil FVF
k= 5 Oil Viscosity
k= 6 Oil Density
k= 7 Gas FVF
k= 8 Gas Viscosity
k= 9 Gas Density
k = 10 Z Factor
k = 11 Gas Oil Ratio
k = 12 Produced CGR
k = 13 Liquid Dropout

NOTE: For all rows of match data entered via


OpenServer, the temperature and bubble point
pressure must be defined, i.e. with the following
strings:
DoSet "PROSPER.PVT.MATCH.Data[i][j][0]",

OpenServer User's Manual


PROSPER and OpenServer 240

T
DoSet "PROSPER.PVT.MATCH.Data[i][j][2]",
PB

6.5.3 TABLE - Setting data to the PVT Lookup Tables

PROSPER.PVT.TABLE.USE Use Tables Flag (0=No 1=Yes)


PROSPER.PVT.TABLE.TABLE Current Table Number
PROSPER.PVT.TABLE.TEMP Number of Temperatures
PROSPER.PVT.TABLE.PRES Number of Pressures
PROSPER.PVT.TABLE.VARS Number of Variables
PROSPER.PVT.TABLE.MAXTEMP Max Number of Temperatures
PROSPER.PVT.TABLE.MAXPRES Max Number of Pressures
PROSPER.PVT.TABLE.MAXVARS Max Number of Variables
PROSPER.PVT.TABLE.DATA[i][j][k] Table Look Up Data
i = 0 to temp
j = 0 to pres
k = 0 to vars

k= 0 Temperature
k= 1 Pressure
k= 2 Bubble Point
k= 3 Dew Point
k= 4 Oil FVF
k= 5 Oil Viscosity
k= 6 Oil Density
k= 7 Gas FVF
k= 8 Gas Viscosity
k= 9 Gas Density
k=10 Z Factor
k=11 Gas Oil Ratio
k=12 Produced CGR
k=13 Liquid Dropout
k=14 Water Fvf
k=15 Water Viscosity
k=16 Water Compressibility

Entering data into these tables follows the same logic as entering the PVT Match Data.
This was described in the previous section. The variable i refers to the table that is
defined by a unique temperature, the value j refers to the row, defined by a pressure,
and the value of k refers to the entry column, defined by the variable it corresponds to.

© 1990-2018 Petroleum Experts Limited


241 OpenServer

6.5.4 CORREL – Correlation Matching Parameters


This section provides the OpenServer tag strings for the matching parameters applied
to Black Oil properties after the match calculation has been performed.
6.5.4.1 Black Oil - Oil

i = 0:4
0 = Glaso
1 = Standing
2 = Lasater
3 = Vazquez-Beggs
4 = Petrosky et al
PROSPER.PVT.CORREL.OILBUBPN Pb Number of available match point entries in
T[i].NUM-1 the 'Match Data' screen. This will return 10 (as
there are 10 rows of match data in every table).
j=0:NUM-1
PROSPER.PVT.CORREL.OILBUBPN Pb ith Match parameter
T[i].F[j] Example: The line:
DoGet("PROSPER.PVT.CORREL.OILBUBP
NT[0].F[1]")
will return the Parameter 2 of Glaso Correlation
when matched to the bubble point number
entered in the 'Match Data' table.
PROSPER.PVT.CORREL.OILBUBPN Pb Correlation standard deviation
T[i].STD

PROSPER.PVT.CORREL.OILSOLGO Rs Number of match data entries. Just like the


R[i].NUM-1 command relating to the bubble point , this will
return the number 10.
j=0:NUM-1
PROSPER.PVT.CORREL.OILSOLGO Rs ith Match parameter
R[i].F[j]
PROSPER.PVT.CORREL.OILSOLGO Rs Correlation standard deviation
R[i].STD

PROSPER.PVT.CORREL.OILOILFVF[ Bo Number of match data entries. Just like the


i].NUM-1 command relating to the bubble point , this will
return the number 10.
j=0:NUM-1
PROSPER.PVT.CORREL.OILOILFVF[ Bo ith Match parameter
i].F[j]
PROSPER.PVT.CORREL.OILOILFVF[ Bo Correlation standard deviation
i].STD

OpenServer User's Manual


PROSPER and OpenServer 242

i = 0:2
0 = Beggs et al
1 = Beal et al
2 = Petrosky
PROSPER.PVT.CORREL.OILOILVIS[i] µo Number of match data entries. Just like the
.NUM-1 command relating to the bubble point , this will
return the number 10.
j=0:NUM-1
PROSPER.PVT.CORREL.OILOILVIS[i] µ ith Match parameter
o
.F[j]
PROSPER.PVT.CORREL.OILOILVIS[i] µo Correlation standard deviation
.STD

6.5.4.2 Black Oil - Gas

i = 0:1
0 = Lee et al
1 = Carr et al
PROSPER.PVT.CORREL.GASGASVIS[i].NUM µg Number of match parameters
-1
j=0:NUM-1
PROSPER.PVT.CORREL.GASGASVIS[i].F[j] µg ith Match parameter
PROSPER.PVT.CORREL.GASGASVIS[i].STD µg Correlation standard deviation

PROSPER.PVT.CORREL.GASZFACT.NUM-1 Z Factor Number of match parameters


j=0:NUM-1
PROSPER.PVT.CORREL.GASZFACT[I].F[j] Z Factor ith Match parameter
PROSPER.PVT.CORREL.GASZFACT[I].STD Z Factor Correlation standard deviation

PROSPER.PVT.CORREL.GASGASFVF.NUM- Bg Number of match parameters


1
j=0:NUM-1
PROSPER.PVT.CORREL.GASGASFVF[i].F[j] Bg ith Match parameter
PROSPER.PVT.CORREL.GASGASFVF[i].ST Bg Correlation standard deviation
D

© 1990-2018 Petroleum Experts Limited


243 OpenServer

6.5.4.3 Black Oil - Retrograde Condensate

i = 0:1
0 = Lee et al
1 = Carr et al
PROSPER.PVT.CORREL.CONGASVIS[i].NU µg Number of match parameters
M-1
j = 0:NUM-1
PROSPER.PVT.CORREL.CONGASVIS[i].F[j]µg ith Match parameter
PROSPER.PVT.CORREL.CONGASVIS[i].STD µg Correlation standard deviation

PROSPER.PVT.CORREL.CONZFACT.NUM-1 Z Factor Number of match parameters


j = 0:NUM-1
PROSPER.PVT.CORREL.CONZFACT.F[j] Z Factor ith Match parameter
PROSPER.PVT.CORREL.CONZFACT.STD Z Factor Correlation standard deviation

PROSPER.PVT.CORREL.CONGASFVF.NUM- Bg Number of match parameters


1
j = 0:NUM-1
PROSPER.PVT.CORREL.CONGASFVF.F[j] Bg ith Match parameter
PROSPER.PVT.CORREL.CONGASFVF.STD Bg Correlation standard deviation

PROSPER.PVT.CORREL.CONDEWPNT.NUM Dew Point Number of match


-1 parameters
j = 0:NUM-1
PROSPER.PVT.CORREL.CONDEWPNT.F[j] Dew Point ith Match parameter
PROSPER.PVT.CORREL.CONDEWPNT.STD Dew Point Correlation standard
deviation

PROSPER.PVT.CORREL.CONCGR.NUM-1 Produced CGR Number of match


parameters
j = 0:NUM-1
PROSPER.PVT.CORREL.CONCGR.F[j] Produced CGR ith Match parameter
PROSPER.PVT.CORREL.CONCGR.STD Produced CGR Correlation standard
deviation

OpenServer User's Manual


PROSPER and OpenServer 244

6.5.5 CALC - Calculation Results


These are the results generated by the PVT calculation option:

PROSPER.PVT.CALC.MODE Calculation Mode (0=range


1=entered)
PROSPER.PVT.CALC.TEMPSTEP Number of Temperature Steps
(RANGE)
PROSPER.PVT.CALC.PRESSTEP Number of Pressure Steps (RANGE)
PROSPER.PVT.CALC.TEMPMIN Minimum Temperature (RANGE)
PROSPER.PVT.CALC.TEMPMAX Maximum Temperature (RANGE)
PROSPER.PVT.CALC.PRESMIN Minimum Pressure (RANGE)
PROSPER.PVT.CALC.PRESMAX Maximum Pressure (RANGE)

i = 0:10
PROSPER..PVT.CALC.PRESUSER[i] Pressure Values (USER ENTERED)
PROSPER..PVT.CALC.TEMPUSER[i] Temperature Values (USER
ENTERED)

PROSPER.PVT.CALC.NUMPRES Number of Pressure values


PROSPER.PVT.CALC.NUMTEMP Number of Temperature values
PROSPER.PVT.CALC.RESULTS.COUNT Number of Results

PROSPER.PVT.CALC.XVAR X Variable for plot


PROSPER.PVT.CALC.YVAR Y Variable for plot

PROSPER.PVT.CALC.RESULTS.COUNT-1 Number of calculation results in the


table
i = 0:COUNT-1
PROSPER.PVT.CALC.RESULTS[i].TEMPINDE Temperature Index
X
PROSPER.PVT.CALC.RESULTS[i].PRESINDE Pressure Index
X
PROSPER.PVT.CALC.RESULTS[i].TEMP Temperature
PROSPER.PVT.CALC.RESULTS[i].PRES Pressure
PROSPER.PVT.CALC.RESULTS[i].BUBPNT Bubble Point
PROSPER.PVT.CALC.RESULTS[i].DEWPNT Dew Point
PROSPER.PVT.CALC.RESULTS[i].OILFVF Oil FVF
PROSPER.PVT.CALC.RESULTS[i].OILVIS Oil Viscosity
PROSPER.PVT.CALC.RESULTS[i].OILDEN Oil Density

© 1990-2018 Petroleum Experts Limited


245 OpenServer

PROSPER.PVT.CALC.RESULTS[i].GASFVF Gas FVF


PROSPER.PVT.CALC.RESULTS[i].GASVIS Gas Viscosity
PROSPER.PVT.CALC.RESULTS[i].GASDEN Gas Density
PROSPER.PVT.CALC.RESULTS[i].ZFACTOR Gas Z Factor
PROSPER.PVT.CALC.RESULTS[i].GOR Gas Oil Ratio
PROSPER.PVT.CALC.RESULTS[i].PRODCGR Produced CGR
PROSPER.PVT.CALC.RESULTS[i].LIQDRP Liquid Dropout
PROSPER.PVT.CALC.RESULTS[i].WATFVF Water FVF
PROSPER.PVT.CALC.RESULTS[i].WATDEN Water Density
PROSPER.PVT.CALC.RESULTS[i].WATVIS Water Viscosity
PROSPER.PVT.CALC.RESULTS[i].OILCMP Oil Compressibility
PROSPER.PVT.CALC.RESULTS[i].WATCMP Water Compressibility

6.5.6 EOS - Equation of State Data


This is the data associated with the Equation of State Model:

PROSPER.PVT.EOS.EOS.NUMCOMP Number of components


PROSPER.PVT.EOS.EOS.VSFLAG Use Volume Shift flag

PROSPER.PVT.EOS.EOS.NUMCOMP-1 Number of components


i = 0:NUMCOMP-1
PROSPER.PVT.EOS.EOS.COMP[i] Mole Percent
PROSPER.PVT.EOS.EOS.TCRIT[i] Critical Temperature
PROSPER.PVT.EOS.EOS.PCRIT[i] Critical Pressure
PROSPER.PVT.EOS.EOS.VCRIT[i] Critical Volume
PROSPER.PVT.EOS.EOS.OMEGA[i] Acentric Factor
PROSPER.PVT.EOS.EOS.MOLEWT[i] Molecular Weight
PROSPER.PVT.EOS.EOS.SPGRAV[i] Specific Gravity
PROSPER.PVT.EOS.EOS.VOLSHIFT Volume Shift
i = 0:NUMCOMP-1
j = 0:NUMCOMP-1
PROSPER.PVT.EOS.EOS.BICOEFFS[i][j] Binary Interaction Coefficients
i = 0:4
PROSPER.PVT.EOS.EOS.PSEP[i] Separator Pressure
PROSPER.PVT.EOS.EOS.TSEP[i] Separator Temperature

PROSPER.PVT.EOS.PHASE Phase Indicator

OpenServer User's Manual


PROSPER and OpenServer 246

PROSPER.PVT.EOS.CALCNUM Number of Calculated points


PROSPER.PVT.EOS.CALPRES Number of Calculated Pressures
PROSPER.PVT.EOS.CALTEMP Number of Calculated Temperatures
PROSPER.PVT.EOS.PEPHASE Phase Indicator (Phase Envelope)
PROSPER.PVT.EOS.PECALC Phase Envelope Done indicator
PROSPER.PVT.EOS.PERESULT Number of Points in Phase Envelope
i=0:1
0 = Calculated
1 = Generated
PROSPER.PVT.EOS.TEMPSTEP[I] Number of Temperature steps
PROSPER.PVT.EOS.PRESSTEP[I] Number of Pressure Steps
PROSPER.PVT.EOS.TEMPMIN[I] Minimum Temperature
PROSPER.PVT.EOS.TEMPMAX[I] Maximum Temperature
PROSPER.PVT.EOS.PRESMIN[I] Minimum Pressure
PROSPER.PVT.EOS.PRESMAX[I] Maximum Pressure

PROSPER.PVT.EOS.TCRIT Phase Envelope Critical Temperature


PROSPER.PVT.EOS.PCRIT Phase Envelope Critical Pressure
PROSPER.PVT.EOS.TTMAX Phase Envelope Cricondentherm
Temp
PROSPER.PVT.EOS.PTMAX Phase Envelope Cricondentherm
Pressure
PROSPER.PVT.EOS.TPMAX Phase Envelope Cricondenbar Temp
PROSPER.PVT.EOS.PPMAX Phase Envelope Cricondenbar
Pressure
PROSPER.PVT.EOS.XVAR Plot X axis
PROSPER.PVT.EOS.YVAR Plot Y axis
PROSPER.PVT.EOS.CALCTYPE Calculation Type Flag
PROSPER.PVT.EOS.GENPRES Number of Generated Pressures
PROSPER.PVT.EOS.GENTEMP Number of Generated Temperatures
PROSPER.PVT.EOS.GENNUM Number of Generated points
PROSPER.PVT.EOS.PERESULT Number of Phase Envelope Points
i = 0 : PROSPER.PVT.EOS.PERESULT-1
PROSPER.PVT.EOS.PETEMP[i] Phase Envelope Temperature
PROSPER.PVT.EOS.PEPRES[i] Phase Envelope Pressure

PROSPER.PVT.EOS.SOLGOR Solution GOR


PROSPER.PVT.EOS.GRVGAS Gas Gravity

© 1990-2018 Petroleum Experts Limited


247 OpenServer

PROSPER.PVT.EOS.API Oil Gravity


PROSPER.PVT.EOS.USETABLE Use Tables Flag

PROSPER.PVT.EOS.CALCNUM-1 Calculated/Interpolated Results


i = 0 : CALCNUM-1
j = 0:1
0 = Liquid
1 = Vapour
PROSPER.PVT.EOS.CALCDATA[i].TEMP Temperature
PROSPER.PVT.EOS.CALCDATA[i].PRES Pressure
PROSPER.PVT.EOS.CALCDATA[i].SATPRE Saturation Pressure
S
PROSPER.PVT.EOS.CALCDATA[i].VAPFRA Vapour Fraction
C
PROSPER.PVT.EOS.CALCDATA[i].COMPR[j] Z Factor
PROSPER.PVT.EOS.CALCDATA[i].DENSITY[j Density
]
PROSPER.PVT.EOS.CALCDATA[i].VISCOSIT Viscosity
Y[j]
PROSPER.PVT.EOS.CALCDATA[i].FVF[j] Formation Volume Factor
PROSPER.PVT.EOS.CALCDATA[i].ENTHALP Enthalpy
Y[j]
PROSPER.PVT.EOS.CALCDATA[i].ENTROPY Entropy
[j]
PROSPER.PVT.EOS.CALCDATA[i].CP[j] Specific Heat Capacity (P)
PROSPER.PVT.EOS.CALCDATA[i].CV[j] Specific Heat Capacity (V)
PROSPER.PVT.EOS.CALCDATA[i].JT[j] Joules Thompson Coefficient
PROSPER.PVT.EOS.CALCDATA[i].IFT Interfacial Tension
PROSPER.PVT.EOS.CALCDATA[i].SOLGOR GOR
PROSPER.PVT.EOS.GENNUM-1 Generated Results
i = 0:GENNUM-1
j = 0:1
0 = Liquid
1 = Vapour
PROSPER.PVT.EOS.GENDATA[i].TEMP Temperature
PROSPER.PVT.EOS.GENDATA[i].PRES Pressure
PROSPER.PVT.EOS.GENDATA[i].SATPRES Saturation Pressure
PROSPER.PVT.EOS.GENDATA[i].VAPFRAC Vapour Fraction
PROSPER.PVT.EOS.GENDATA[i].COMPR[j] Z Factor

OpenServer User's Manual


PROSPER and OpenServer 248

PROSPER.PVT.EOS.GENDATA[i].DENSITY[j] Density
PROSPER.PVT.EOS.GENDATA[i].VISCOSITY Viscosity
[j]
PROSPER.PVT.EOS.GENDATA[i].FVF[j] Formation Volume Factor
PROSPER.PVT.EOS.GENDATA[i].ENTHALPY Enthalpy
[j]
PROSPER.PVT.EOS.GENDATA[i].ENTROPY[j Entropy
]
PROSPER.PVT.EOS.GENDATA[i].CP[j] Specific Heat Capacity (P)
PROSPER.PVT.EOS.GENDATA[i].CV[j] Specific Heat Capacity (V)
PROSPER.PVT.EOS.GENDATA[i].JT[j] Joules Thompson Coefficient
PROSPER.PVT.EOS.GENDATA[i].IFT Interfacial Tension
PROSPER.PVT.EOS.GENDATA[i].SOLGOR GOR
PROSPER.PVT.EOS.EOS.SepCalcMode Separator calc method.
0 - flash to stock tank
1 - use separator train
2 - use K values
3 - use path to surface object
PROSPER.PVT.EOS.EOS.PTS.NUM_PTS_O Returns the number of path to surface
BJ objects defined
PROSPER.PVT.EOS.EOS.PTS[i].LABEL Returns the label of the i path to surface
object
PROSPER.PVT.EOS.EOS.PTS[i].IS_VALID Validation flag for the i path to surface
object
1 - valid
0 - invalid
PROSPER.PVT.EOS.EOS.PTS[i].IS_VALID_O Validation flag for the i path to surface
ILGAS object when the criteria is oil and gas
outlets ONLY.
1 - valid
0 - invalid
PROSPER.PVT.Eos.EOS.PTS[i].PROCESSD For the path to surface object i,
ATA.SEPARATOR[j].PRESSURE accesses the pressure of separator j.
PROSPER.PVT.Eos.EOS.PTS[i].PROCESSD For the path to surface object i,
ATA.SEPARATOR[j].TEMPERATURE accesses the temperature of separator
j.
PROSPER.PVT.Eos.EOS.PTS[i].PROCESSD For the path to surface object i,
ATA.CHILLER[j].PRESSURE accesses the pressure of chiller j.
PROSPER.PVT.Eos.EOS.PTS[i].PROCESSD For the path to surface object i,
ATA.CHILLER[j].TEMPERATURE accesses the temperature of chiller j.

© 1990-2018 Petroleum Experts Limited


249 OpenServer

6.5.7 DLL - External PVT DLL Data

PROSPER.PVT.DLL.NUMDLL Number of External PVT DLLs Loaded


PROSPER.PVT.DLL.NUMF Number of real numbers per DLL
PROSPER.PVT.DLL.NUMI Number of integers per DLL
i = 0:NUMDLL-1
PROSPER.PVT.DLL.DLL[i].NAME DLL Name
PROSPER.PVT.DLL.NUMF-1
PROSPER.PVT.DLL.DLL[i].f[j] Real Data
PROSPER.PVT.DLL.NUMI-1
PROSPER.PVT.DLL.DLL[i].I[j] Integer Data

PROSPER.PVT.DLL.NUMEOS Number of EOS models


i = 0:NUMEOS-1
PROSPER.PVT.DLL.EOS[i].DLL Associated DLL
PROSPER.PVT.DLL.EOS[i].NAME EOS Model Name
PROSPER.PVT.DLL.EOS[i].INDEX Index within associated DLL

6.5.8 EMULSION - Emulsion Data

PROSPER.PVT.EMULS.VISCOR Viscosity Correction Flag


PROSPER.PVT.EMULS.OCCUR Emulsion Occurrence Flag
i=0:1
0 = Pump Data
1 = Flowline Data
PROSPER.PVT.EMULS.DATA[i].TEMP Experimental Pressure
PROSPER.PVT.EMULS.DATA[i].PRES Experimental Temperature
PROSPER.PVT.EMULS.DATA[i].WCL Left Water Cut For Maximum Viscosity
PROSPER.PVT.EMULS.DATA[i].WCR Right Water Cut For Maximum
Viscosity
PROSPER.PVT.EMULS.DATA[i].NUMBER Number of Emulsion Data Points
j = 0:NUM-1
PROSPER.PVT.EMULS.DATA[i].WATC[j] Emulsion Water Cut
PROSPER.PVT.EMULS.DATA[i].VISC[j] Emulsion Viscosity

PROSPER.PVT.EMULS.DATA[i].SD Match Standard Deviation


j = 0:4

OpenServer User's Manual


PROSPER and OpenServer 250

PROSPER.PVT.EMULS.DATA[i].PARM[j] Match Parameters


j = 0:100
PROSPER.PVT.EMULS.DATA[i].PLOTWATC[ Calculated WC for plotting
j]
PROSPER.PVT.EMULS.DATA[i].PLOTVISC[j] Calculated Viscosity for plotting

6.5.9 VISC - Viscosity Data


This is the customised viscosity correction data:

PROSPER.PVT.VISC.NUM Number of points

i = 0:4
0 = Viscosity
1 = Head
2 = Capacity
3 = Power
4 = Efficiency
j = 0:NUM-1
PROSPER.PVT.VISC.DATA[i][j] Viscosity Correction Data

6.5.10 HYD - Hydrates Formation Data


This is the data from the Hydrates Formation look up table:

PROSPER.PVT.HYD.PRES.COUNT Number of points in the table


i= 0:COUNT
PROSPER.PVT.HYD.PRES[i] Pressure
PROSPER.PVT.HYD.TEMP[i] Temperature

6.6 INPUT Data Section


The INPUT data is accessed using the root name PROSPER.SIN and is split up into
several sections as listed below.

SUM Options data


IPR Inflow Performance Input Data
EQP Equipment Input Data
GLF GAS Lift Input Data
GLI Intermittent Gas Lift Input Data
ESP ESP Input Data

© 1990-2018 Petroleum Experts Limited


251 OpenServer

HSP HSP Input Data


UNT Units Settings Data

Each section will be accessed using the following string structure:

PROSPER.SIN.SUM
PROSPER.SIN.IPR
PROSPER.SIN.EQP
PROSPER.SIN.GLF
PROSPER.SIN.GLI
PROSPER.SIN.ESP
PROSPER.SIN.HSP
PROSPER.SIN.UNT

6.6.1 IPR Data

6.6.1.1 Overview
The IPR data is accessed using the root name PROSPER.SIN.IPR and is split up into two
sections as listed below.

SINGLE Single branch IPR model


MULTILAT Multilateral IPR model

6.6.1.2 Single Branch Data

The single branch data has the root name PROSPER.SIN.IPR.SINGLE. The
organisation of the following tables follows that of the IPR data screens i.e. the display
choices are made using buttons and tabs as well as list box selection. However, the
division does not extend to every possible model choice as it is convenient to regard
‘Darcy-like’ models as using a sub-set of the same group of parameters.

6.6.1.2.1 Common Parameters

Some variables, e.g. well-bore radius (PROSPER.SIN.IPR.SINGLE.WBR) are common


to more than one group of models, as well-bore radius is used in reservoir and
mechanical skin models. A list of these parameters is shown below:

PROSPER.SIN.IPR.SINGLE.PERFDI
Perforation diameter

OpenServer User's Manual


PROSPER and OpenServer 252

A
PROSPER.SIN.IPR.SINGLE.SPF Shot density
PROSPER.SIN.IPR.SINGLE.PERFE
FF Perforation efficiency
PROSPER.SIN.IPR.SINGLE.PERFIN Perforation interval (production interval in open
T hole)
PROSPER.SIN.IPR.SINGLE.WBR Well-bore radius
PROSPER.SIN.IPR.SINGLE.SWC Connate water saturation (residual saturation for
relative permeability screen)
6.6.1.2.2 Model Selection and PVT Screen

These parameters are explicitly or implicitly involved in the functionality of the model
selection IPR screen, which includes the selection of PVT parameters that affect all
models. The first six flags are normally set from the 'System Summary' screen (menu
item Options), so it is recommended that they are used on a read-only basis here and
set using the PROSPER.SIN.SUM root.

The last three variables, however, are distinct from those set on the PVT screen and are
intended for local manipulation within the IPR section.

PROSPER.SIN.IPR.SINGLE.GRAVEL Sand control flag


0 = no gravel pack, 1 = gravel pack
PROSPER.SIN.IPR.SINGLE.COMPLETION Completion flag
0 = cased hole, 1 = open hole
PROSPER.SIN.IPR.SINGLE.FLUID Fluid choice
0 = oil + water, 1 = gas, 2 = condensate
PROSPER.SIN.IPR.SINGLE.GAPFLAG 1 = PROSPER loaded by GAP,
0 = PROSPER stand alone
PROSPER.SIN.IPR.SINGLE.WELLTYPE 0 = producer, 1 = injector, 2 = water
injector
PROSPER.SIN.IPR.SINGLE.IGCONE Coning flag for oil
0 = no gas coning, 1 = enabled
PROSPER.SIN.IPR.SINGLE.IPRMETHOD Reservoir/Pwf calculation model index.
Zero-based, as ordered in list box
PROSPER.SIN.IPR.SINGLE.MGSKINMETH Mechanical skin model index. Zero-
OD based, as ordered in list box
PROSPER.SIN.IPR.SINGLE.DPSKINMETH Deviation skin model index. Zero-based,
OD as ordered in list box
PROSPER.SIN.IPR.SINGLE.IRELK Relative permeability flag.
0 = no relperm, 1 = enabled
PROSPER.SIN.IPR.SINGLE.IPRMODEL IPR model name

© 1990-2018 Petroleum Experts Limited


253 OpenServer

PROSPER.SIN.IPR.SINGLE.MGSKINMODE Mechanical skin model name


L
PROSPER.SIN.IPR.SINGLE.DPSKINMODE Deviation skin model name
L
PROSPER.SIN.IPR.SINGLE.PRES Reservoir pressure
PROSPER.SIN.IPR.SINGLE.TRES Reservoir temperature
PROSPER.SIN.IPR.SINGLE.WC Water cut
PROSPER.SIN.IPR.SINGLE.WGR WGR
PROSPER.SIN.IPR.SINGLE.TOTGOR Value of GOR for IPR input screen
PROSPER.SIN.IPR.SINGLE.CGR Value of CGR for IPR input screen
PROSPER.SIN.IPR.SINGLE.GORSEP Value of separator GOR for IPR input
screen

6.6.1.2.3 Test/PI Entered Models

PROSPER.SIN.IPR.SINGLE.PINDEX Productivity index IPR value


PROSPER.SIN.IPR.SINGLE.PINSAV Returns equivalent (undamaged) PI value
from IPR plot for Vogel, Darcy, etc., type
IPR's using DoGet function
PROSPER.SIN.IPR.Single.TestData.COUN Number of data points defined in the test
T data section.
i = 0:99
PROSPER.SIN.IPR.SINGLE.TESTDATA[i].
Date
PROSPER.SIN.IPR.SINGLE.TESTDATA[i].
Comment
PROSPER.SIN.IPR.SINGLE.TESTDATA[i].
P Pressure test point
PROSPER.SIN.IPR.SINGLE.TESTDATA[i].
Q Rate test point

Example:
The following command:

DoSet "PROSPER.SIN.IPR.SINGLE.TESTDATA[0].Q", 2000

Will set the number 2000 in the rate box of the test data screen in the IPR plot shown
below:

OpenServer User's Manual


PROSPER and OpenServer 254

6.6.1.2.4 MultiRate Models

The following commands can be used to read/write the test data for the multirate IPR
models available in PROSPER. The commands are the same for all of the models.

i = 0:9 i varies from 0 to 9


PROSPER.SIN.IPR.SINGLE.MRate[0].Rate Test rate i (multi-rate)
PROSPER.SIN.IPR.SINGLE.MRate[0].Pressure Test pressure

Example:
The following command:

© 1990-2018 Petroleum Experts Limited


255 OpenServer

DoSet ("PROSPER.SIN.IPR.SINGLE.MRate[0].Rate"), 2000

Will set the number 2000 in the rate box of the test data screen in the IPR plot shown
below:

EXTRACTING RESULTS CALCULATED BY PROSPER:

This section describes the OpenServer variables to extract the variables calculated by
the Multirate models viz: 'Multirate Jones', 'Multirate C & n',' 'Multirate Forcheimer with
Pseudo Pressure' models.

PROSPER.SIN.IPR.SINGLE.MRACOE Returns the A coefficient from the Multirate


F Jones model
PROSPER.SIN.IPR.SINGLE.MRBCOE Returns the B coefficient from the Multirate
F Jones model
PROSPER.SIN.IPR.SINGLE.MRACOE Returns the A coefficient from the Multirate
FPP Forcheimer with Pseudo Pressure model
PROSPER.SIN.IPR.SINGLE.MRBCOE Returns the B coefficient from the Multirate
FPP Forcheimer with Pseudo Pressure model
PROSPER.SIN.IPR.SINGLE.MRCVAL Returns the coefficient C from the Multirate C &
n model
PROSPER.SIN.IPR.SINGLE.MREXPO Returns the exponential n from the Multirate C &
N n model

OpenServer User's Manual


PROSPER and OpenServer 256

6.6.1.2.5 Darcy-based Models

Darcy based IPR models include models such as hydraulic fracture and horizontal IPR
models that apply a correcting skin to the Darcy calculated PI. In common with the rest
of the structure of the data, parameters applied specifically to gas/condensate models
are listed with ones for oil and/or all fluids.

PROSPER.SIN.IPR.SINGLE.PERMMETHOD, Permeability entered: i = 0:1


i 0 - total permeability entered
1 - gas permeability
PROSPER.SIN.IPR.SINGLE.DFACTMETHOD Non-Darcy flow factor: i = 0:1
,i 0 - Calculated
1 - Entered
PROSPER.SIN.IPR.SINGLE.RESPERM Reservoir horizontal permeability
PROSPER.SIN.IPR.SINGLE.THICKNESS Reservoir height
PROSPER.SIN.IPR.SINGLE.DRAINAGE Reservoir drainage area
PROSPER.SIN.IPR.SINGLE.DIETZ Dietz shape factor
PROSPER.SIN.IPR.SINGLE.RELPERM Relative permeability coefficient
PROSPER.SIN.IPR.SINGLE.TIME Time
PROSPER.SIN.IPR.SINGLE.POROSITY Reservoir porosity
PROSPER.SIN.IPR.SINGLE.FRACHEIGHT Fracture height
PROSPER.SIN.IPR.SINGLE.FRACLENGTH Fracture half-length/radius
PROSPER.SIN.IPR.SINGLE.FRACFCD Fracture dimensionless conductivity
PROSPER.SIN.IPR.SINGLE.HANS Horizontal anisotropy
PROSPER.SIN.IPR.SINGLE.VANS Vertical anisotropy
PROSPER.SIN.IPR.SINGLE.WELLLEN Well length
PROSPER.SIN.IPR.SINGLE.WELLDIST Distance of well centre to reservoir
bottom
PROSPER.SIN.IPR.SINGLE.RESLEN Reservoir length
PROSPER.SIN.IPR.SINGLE.RESWID Reservoir width
PROSPER.SIN.IPR.SINGLE.WELLLDST Length distance of well to reservoir edge
PROSPER.SIN.IPR.SINGLE.WELLWDST Width distance of well to reservoir edge
PROSPER.SIN.IPR.SINGLE.EXPON Back pressure exponent
PROSPER.SIN.IPR.SINGLE.DFACT Non-Darcy flow factor
PROSPER.SIN.IPR.SINGLE.STORATIVITY Storativity ratio - dual porosity
PROSPER.SIN.IPR.SINGLE.INTERPOROSIT
Y Interporosity coefficient - dual porosity
PROSPER.SIN.IPR.SINGLE.NFRACS Number of horizontal fractures
PROSPER.SIN.IPR.SINGLE.PINSAV Formation PI

© 1990-2018 Petroleum Experts Limited


257 OpenServer

6.6.1.2.6 External Entry Model Parameters

i = 0:19
PROSPER.SIN.IPR.SINGLE.EXTENTRY[i].RATE External entry rate
j = 0:4
PROSPER.SIN.IPR.SINGLE.EXTENTRY[i].PRESSUR
E[j] Pressure responses
i = 0:4
PROSPER.SIN.IPR.SINGLE.SENVAR[i] Curve IDs
PROSPER.SIN.IPR.SINGLE.SENVAL Selected curve
PROSPER.SIN.IPR.SINGLE.IESKIN Additional skin flag
0 - no skin to add, 1 - skin to
add
PROSPER.SIN.IPR.SINGLE.EXTLABEL Curve label
PROSPER.SIN.IPR.SINGLE.EXTUNITS Curve units
PROSPER.SIN.IPR.SINGLE.NCURV Number of IPR curves
PROSPER.SIN.IPR.SINGLE.NSENSP Number of valid rate data points

6.6.1.2.7 Multi-layer (no friction dP loss) Table

i = 0:4
PROSPER.SIN.IPR.SINGLE.MLAYER[i].TYPE Layer type (e.g. disabled, Darcy,
multi-rate, PI). Zero-based
PROSPER.SIN.IPR.SINGLE.MLAYER[i].IGRAV Gravel pack enable 0 = no, 1 = yes
PROSPER.SIN.IPR.SINGLE.MLAYER[i].PRESSU Layer pressure
RE
PROSPER.SIN.IPR.SINGLE.MLAYER[i].HEIGHT Layer height
PROSPER.SIN.IPR.SINGLE.MLAYER[i].SKIN Layer skin
PROSPER.SIN.IPR.SINGLE.MLAYER[i].PERM Layer horizontal permeability
PROSPER.SIN.IPR.SINGLE.MLAYER[i].DAREA Layer area
PROSPER.SIN.IPR.SINGLE.MLAYER[i].DIETZ Layer shape factor
PROSPER.SIN.IPR.SINGLE.MLAYER[i].WBR Well-bore radius in layer
PROSPER.SIN.IPR.SINGLE.MLAYER[i].PILAY Productivity index
PROSPER.SIN.IPR.SINGLE.MLAYER[i].GOR Formation GOR/CGR/separator
GOR

OpenServer User's Manual


PROSPER and OpenServer 258

PROSPER.SIN.IPR.SINGLE.MLAYER[i].API Oil gravity


PROSPER.SIN.IPR.SINGLE.MLAYER[i].GASGRA Gas gravity
V
PROSPER.SIN.IPR.SINGLE.MLAYER[i].WC Water cut/WGR
j = 0:9
PROSPER.SIN.IPR.SINGLE.MLAYER[i].MRATE[j]. Test pressure
PRESSURE
PROSPER.SIN.IPR.SINGLE.MLAYER[i].MRATE[j]. Test rate
RATE

6.6.1.2.8 Horizontal Well with dP Friction Loss Table, Including Coning Screen

PROSPER.SIN.IPR.SINGLE.IHZMDL Horizontal well model choice.


Zero-based
i = 0:19
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].IZONTP Zone type
0 = disabled,
1 = blank,
2 = perforated,
3 = open
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].IZONSK Skin model.
0 = entered. 1 = Karakas & Tariq.
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].IZONGP Gravel pack switch: 0 = no, 1 =
yes.
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].ZONLEN Zone length
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].ZONPRM Zone permeability
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].ZONRAD Zone radius
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].ZONRGH Zone roughness
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].SKIN Skin entered by hand
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].PERFDIA Perforation diameter
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].SPF Shots per foot
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].PERFLEN Perforation length
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].DZTHICK Damaged zone thickness
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].DZPERM Damaged zone permeability
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].CZTHICK Crushed zone thickness
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].DZPERM Damaged zone permeability
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].PHASE Shot phasing
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].GPPERM Gravel pack permeability

© 1990-2018 Petroleum Experts Limited


259 OpenServer

PROSPER.SIN.IPR.SINGLE.HORIZDP[i].GPLEN Gravel pack length


PROSPER.SIN.IPR.SINGLE.HORIZDP[i].NDMETH Non-Darcy method flag
OD 0 = calculated, 1 = entered
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].PERFEFF Perforation efficiency
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].NONDAR
CY Non-Darcy flow factor
PROSPER.SIN.IPR.SINGLE.HORIZDP[i].WBR Well-bore radius
PROSPER.SIN.IPR.SINGLE.ICONE Gas, water or gas + water coning
flag. Zero based.
PROSPER.SIN.IPR.SINGLE.CONERATE Rate for coning input.
PROSPER.SIN.IPR.SINGLE.CONECHAPERON Chaperon steady state critical rate
PROSPER.SIN.IPR.SINGLE.CONEDICKEN Dikken steady state critical rate
PROSPER.SIN.IPR.SINGLE.CONEDISTANCE Well distance from bottom
PROSPER.SIN.IPR.SINGLE.CONETIME Time to breakthrough
PROSPER.SIN.IPR.SINGLE.CONEBREAK Rate used for breakthrough
calculation

6.6.1.2.9 Multi-layer with dP Friction Loss Table

i = 0:19
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].TYPE Type of layer:
0 = disabled,
1 = blank,
2 = perforated,
3 = open
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].MODEL IPR model:
0 = Darcy, 1 = Multi-rate, 2 = PI
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].ISKIN Skin model:
0 = by hand, 1 = Karakas & Tariq
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].IGPACK Gravel pack: 0 = off, 1 = on
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].MD Measured depth to layer end
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].TVD Vertical depth to layer end
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PRESSUR
E Layer pressure
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].FLOWRA
D Flowing radius
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].ROUGH Tubing roughness
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].GOR Total GOR
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].API Oil gravity

OpenServer User's Manual


PROSPER and OpenServer 260

PROSPER.SIN.IPR.SINGLE.MLAYDP[i].GASG Gas gravity


PROSPER.SIN.IPR.SINGLE.MLAYDP[i].WC Water cut
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PIENTRY Productivity index
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PERM Reservoir permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DAREA Drainage area
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DIETZ Dietz shape factor
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].WBR Well-bore radius
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].SKIN Skin entered by hand
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PERFDIA Perforation diameter
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].SPF Shots per foot
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PERFLEN Perforation length
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DZTHICK Damaged zone thickness
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DZPERM Damaged zone permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].CZTHICK Crushed zone thickness
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DZPERM Damaged zone permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PHASE Shot phasing
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].DEV Deviation
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PEN Penetration
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].VERTPER
M Vertical permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].GPPERM Gravel pack permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].GPLEN Gravel pack length
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PERFINT Perforation interval
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].PERFEFF Perforation efficiency
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].WATSAT Residual water saturation
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].OILSAT Residual oil saturation
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].WATRLK Water end-point relative
permeability
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].OILRLK Oil end-point relative permeability

PROSPER.SIN.IPR.SINGLE.MLAYDP[i].WATEXP Corey exponent for water


PROSPER.SIN.IPR.SINGLE.MLAYDP[i].OILEXP Corey exponent for oil
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].TSTWC Water cut during test
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].ESTSW Estimated water saturation
j = 0:9
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].MRATE[j].
PRESSURE Test pressure
PROSPER.SIN.IPR.SINGLE.MLAYDP[i].MRATE[j]. Test rate

© 1990-2018 Petroleum Experts Limited


261 OpenServer

RATE

6.6.1.2.10 Skin Aide Model Parameters

There are nine groups of these. Firstly there are the calculation choice flags
manipulated by the drop-down list boxes on the main screen. The other eight groups
comprise the data sets for the eight different screens that can be brought up. Note that if
in the 'System Summary' screen, the cased completion and gravel pack options are
enabled then seven buttons are present on the main Skin Aide screen. The eighth
screen comes from switching the perforation model list box (PERFMOD variable)
between 0 (in situ geometry) and 1 or 2 (API perforation models).

PROSPER.SIN.IPR.SINGLE.SKINAIDE.FLOWMO Flow model


D 0 = steady-state,
1 = semi-steady state
PROSPER.SIN.IPR.SINGLE.SKINAIDE.SKINMOD Skin model.
0 = linear flow,
1 = hemispherical flow,
2 = min. dP flow
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFMOD Perforation model.
0 = in situ geometry,
1 = API edition 4,
2 = API edition 5
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y1 Reservoir Thickness
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y2 Completed Interval
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y3 Distance To Top Completion
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y4 Drainage Area
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y5 Dietz Shape Factor
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y6 Well-bore Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GEOMETR
Y7 Deviation
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO1
Horizontal Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO2
Vertical Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO3 Horizontal Permeability for

OpenServer User's Manual


PROSPER and OpenServer 262

Geometrical Skin
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO4
Porosity
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO5
Turbulence Coefficient
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO6
Permeability Exponent
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PETRO7
Porosity Exponent
PROSPER.SIN.IPR.SINGLE.SKINAIDE.DAMAGE1
Damaged Zone Thickness
PROSPER.SIN.IPR.SINGLE.SKINAIDE.DAMAGE2
Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.DAMAGE3
Porosity
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CASING1
External Casing Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CASING2
Casing Weight
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CRUSHED
1 Crushed Zone Thickness
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CRUSHED
2 Crushed Zone Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CRUSHED
3 Crushed Zone Porosity
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CRUSHED Crushed & Damaged Zone
4 Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.CRUSHED Crushed & Damaged Zone
5 Porosity
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U1 Perforation Efficiency
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U2 Shot Density
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U3 Gun Phasing
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT Angle Between Well Vertical Plane
U4 And Perforations
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U5 Tunnel Length
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U6 Tunnel Diameter

© 1990-2018 Petroleum Experts Limited


263 OpenServer

PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U7 Cavity Entrance Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFINSIT
U8 Cavity Tip Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI1 Perforation Efficiency
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI2 Shot Density
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI3
Gun Phasing
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI4 Angle Between Well Vertical Plane
And Perforations
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI5 TTP : API RP43/2 Penetration Of
Perforations
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI6 EH : API RP43/1 Diameter Of
Perforations
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI7
Gun Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI8 Reservoir Uni-axial Compressive
Strength
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI9
Rock Density
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI1
0 Casing Elastic Limit
PROSPER.SIN.IPR.SINGLE.SKINAIDE.PERFAPI1
1 Reservoir Stress
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GPACK1
Screen Outside Diameter
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GPACK2
Annulus Gravel Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GPACK3
Annulus Gravel Porosity
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GPACK4
Tunnel Gravel Permeability
PROSPER.SIN.IPR.SINGLE.SKINAIDE.GPACK5 Tunnel Gravel Porosity

6.6.1.2.11 Two-term Model Parameters


From the Forcheimer and ‘C & n’ reservoir models.

PROSPER.SIN.IPR.SINGLE.NDARCY Non-Darcy coefficient


PROSPER.SIN.IPR.SINGLE.DARCY Darcy coefficient

OpenServer User's Manual


PROSPER and OpenServer 264

PROSPER.SIN.IPR.SINGLE.CVAL C value from 'C&n'


PROSPER.SIN.IPR.SINGLE.NVAL Exponent (n) from 'C&n'

6.6.1.2.12 Fracture Model

PROSPER.SIN.IPR.SINGLE.THETAWF Injected fluid temperature at bottom hole


PROSPER.SIN.IPR.SINGLE.QINJMEAN Mean Historical Injection Rate
PROSPER.SIN.IPR.SINGLE.SIGMARES Initial Reservoir Stress
PROSPER.SIN.IPR.SINGLE.SWEEP Sweep Efficiency
PROSPER.SIN.IPR.SINGLE.CF Injected Fluid Specific Heat Capacity
PROSPER.SIN.IPR.SINGLE.XLAMDARES Overall Reservoir Conductivity
PROSPER.SIN.IPR.SINGLE.CRES Overall Reservoir Specific Heat Capacity
PROSPER.SIN.IPR.SINGLE.RHORES Overall Reservoir Density
PROSPER.SIN.IPR.SINGLE.XLAMDASR Top and Bottom Surroundings Conductivity
PROSPER.SIN.IPR.SINGLE.CSR Top and Bottom Surroundings Specific
Heat Capacity
PROSPER.SIN.IPR.SINGLE.RHOSR Top and Bottom Surroundings Density
PROSPER.SIN.IPR.SINGLE.ALPHATIF Reservoir Thermal Expansion
PROSPER.SIN.IPR.SINGLE.BETATIF Biot's Constant
PROSPER.SIN.IPR.SINGLE.POISSON Poisson's Ratio
PROSPER.SIN.IPR.SINGLE.YOUNGMOD Reservoir Young's Modulus

6.6.1.2.13 SPOT

Options
PROSPER.SIN.IPR.Single.SPOTMain.CORREL Lp correlation type:
ATIONTYPE 0 - Conventional
1 - Synthetic
PROSPER.SIN.IPR.Single.SPOTMain.EXTFLO Calculate non-Darcy:
W 0 - No
1 - Yes
PROSPER.SIN.IPR.Single.SPOTMain.ACTIVIT Activity:
Y 0 - New well
1 - Workover / re-perf
PROSPER.SIN.IPR.Single.SPOTMain.IPRMOD Inflow equation:
EL 0 - Fetkovich
1 - Vogel

© 1990-2018 Petroleum Experts Limited


265 OpenServer

PROSPER Log data input:


.SIN.IPR.Single.SPOTMain.LOGDATAINPUT 0 - Non available
1 - Porosity, permeability, UCS &
TWC
2 - Porosity, permeability & UCS
3 - Porosity, permeability & TWC
4 - Porosity & UCS
5 - Porosity & TWC
6 - Porosity, permeability, FDC &
compressional sonic
7 - Porosity, permeability, FDC &
shear sonic
8 - Porosity, FDC & compressional
sonic
9 - Porosity, FDC & shear sonic
10 - Porosity
11 - Porosity & permeability
12 - Permeability, UCS & FDC
13 - Permeability, TWC & FDC
14 - Permeability, FDC &
compressional sonic
15 - Permeability, FDC & shear sonic
16 - UCS & FDC
17 - TWC & FDC
18 - FDC & compressional sonic
19 - FDC & shear sonic
PROSPER Perforating method:
.SIN.IPR.Single.SPOTMain.PERFOPTIONS 0 - Single run
1 - Double run
PROSPER Invasion method:
.SIN.IPR.Single.SPOTMain.PERFOPTIONS 0 - Calculate invasion
1 - Enter mud invasion
2 - Enter discrete invasion depth
3 - No invasion
PROSPER Sanding model:
.SIN.IPR.Single.SPOTMain.SANDINGMODEL 0 - None
1 - QientiQ model
PROSPER Crushed zone model:
.SIN.IPR.Single.SPOTMain.CRUSHSKINMOD 0 - Entered
EL 1 - QientiQ test results

Crushed Zone Inputs


PROSPER Permeability factor
.SIN.IPR.Single.SPOTMain.CRUSHZONEPER
MFACTOR

OpenServer User's Manual


PROSPER and OpenServer 266

PROSPER Thickness
.SIN.IPR.Single.SPOTMain.CRUSHZONETHIC
KNESS

PROSPER Lower completion type:


.SIN.IPR.Single.SPOTMain.LOWERCOMPTYP 0 - Cased and perforated
E
PROSPER User downhole stand-off:
.SIN.IPR.Single.SPOTMain.USESTANDOFF 0 - No
1 - Yes
PROSPER Enter gun per layer:
.SIN.IPR.Single.SPOTMain.GUNPERLAYER 0 - No
1- Yes
PROSPER Use SPOT IPR extensions:
.SIN.IPR.Single.SPOTMain.USESPOTIPREXT 0 - No
ENSIONS 1 - Yes

Layers
PROSPER.SIN.IPR.Single.WBR Well radius
PROSPER Drainage radius
.SIN.IPR.Single.SPOTMain.DRAINRADIUS
PROSPER.SIN.EQP.Env.Msl Mean sea-level wrt to origin
PROSPER.SIN.EQP.Env.Seabed Seabed depth wrt to origin
PROSPER Top MD
.SIN.IPR.Single.SPOTMain.LAYERS[0].TOP
PROSPER Bottom MD
.SIN.IPR.Single.SPOTMain.LAYERS[0].BOTT
OM
PROSPER Layer pressure
.SIN.IPR.Single.SPOTMain.LAYERS[0].LAYER
PRESS
PROSPER Under balance pressure
.SIN.IPR.Single.SPOTMain.LAYERS[0].UNDE
RBALANCE
PROSPER Overburden pressure gradient
.SIN.IPR.Single.SPOTMain.LAYERS[0].OVER
BURDEN

Gun Details
PROSPER Shot density
.SIN.IPR.Single.SPOTMain.LAYERS[0].GUN.S
HOTDENSITYACTUAL

© 1990-2018 Petroleum Experts Limited


267 OpenServer

PROSPER Gun phasing


.SIN.IPR.Single.SPOTMain.LAYERS[0].GUN.G
UNPHASINGACTUAL

PROSPER.SIN.IPR.Single.SPOTMain.GunAllLa Perforating efficiency


yer.PERFEFFICIENCY
PROSPER Water saturation
.SIN.IPR.Single.SPOTMain.LAYERS[0].WATE
RSATURATION

Relative Permeability
PROSPER Oil residual saturation
.SIN.IPR.Single.SPOTMain.LAYERS[0].SRO
PROSPER Oil end-point relative permeability
.SIN.IPR.Single.SPOTMain.LAYERS[0].OILEN
DPOINT
PROSPER Oil Corey exponent
.SIN.IPR.Single.SPOTMain.LAYERS[0].OILEX
P
PROSPER Gas residual saturation
.SIN.IPR.Single.SPOTMain.LAYERS[0].SRG
PROSPER Gas end-point relative permeability
.SIN.IPR.Single.SPOTMain.LAYERS[0].GASE
NDPOINT
PROSPER Gas Corey exponent
.SIN.IPR.Single.SPOTMain.LAYERS[0].GASE
XP
PROSPER Water residual saturation
.SIN.IPR.Single.SPOTMain.LAYERS[0].SWC
PROSPER Water end-point relative permeability
.SIN.IPR.Single.SPOTMain.LAYERS[0].WATE
NDPOINT
PROSPER Water Corey exponent
.SIN.IPR.Single.SPOTMain.LAYERS[0].WATE
XP

Log Data
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.LOGDATA[0].AHD Measured depth
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.LOGDATA[0].POR Porosity
OSITY

OpenServer User's Manual


PROSPER and OpenServer 268

PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.LOGDATA[0].PER Permeability
MEABILITY
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.LOGDATA[0].UCS UCS
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.LOGDATA[0].TWC TWC

Completion
PROSPER Type:
.SIN.IPR.Single.SPOTMain.COMPLETION[0].T 0 - Casing
YPE 1 - Tubing
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.COMPLETION[0]. Outer diameter
OD
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.COMPLETION[0]. Weight
WEIGHT
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.COMPLETION[0].T Top MD
OP
PROSPER i = 0 to 49
.SIN.IPR.Single.SPOTMain.COMPLETION[0].B Bottom MD
OTTOM

6.6.1.2.14 Mechanical Skin Parameters

Mechanical / Geometric Skin


PROSPER.SIN.IPR.Single.MGSkinMethod 0 - Enter skin by hand
1 - Locke
2 - MacLeod
3 - Karakas & Tariq

Locke Mechanical Geometric Skin


PROSPER.SIN.IPR.Single.Spf Shot density
PROSPER.SIN.IPR.Single.PerfDia Perforation diameter
PROSPER.SIN.IPR.Single.PerfLen Perforation length
PROSPER.SIN.IPR.Single.PerfEff Perforation efficiency
PROSPER.SIN.IPR.Single.DZThickness Damage zone thickness
PROSPER.SIN.IPR.Single.DZPerm Damage zone permeability

© 1990-2018 Petroleum Experts Limited


269 OpenServer

PROSPER.SIN.IPR.Single.Phasing Shot phasing

MacLeod Input data as above, including:


PROSPER.SIN.IPR.Single.CompMethod 0 - Underbalanced
1 - Overbalanced

Karakus & Tariq As per Locke input data, including:


PROSPER.SIN.IPR.Single.CZThickness Crushed zone thickness
PROSPER.SIN.IPR.Single.CZPerm Crushed zone permeability

Calculate Using SPOT


PROSPER 0 - Conventional
.SIN.IPR.Single.SPOTMain.CORRELATIONTYP 1 - Synthetic
E
PROSPER.SIN.IPR.Single.SKinAide.CASING1 Casing O.D.
PROSPER.SIN.IPR.Single.SKinAide.CASING2 Casing weight
PROSPER.SIN.IPR.Single.SPOTMain.CASINGG Casing grade:
RADE 0 - J55
1 - L80
2 - P105
3 - P110
PROSPER.SIN.IPR.Single.SKinAide.PERFAPI8 Reservoir uniaxial compressive
strength
PROSPER.SIN.EQP.Env.Msl Mean sea level with respect to origin
PROSPER.SIN.EQP.Env.Seabed Seabed depth with respect to origin
PROSPER.SIN.IPR.Single.SPOTMain.PERFDE Depth
PTH
PROSPER.SIN.IPR.Single.SPOTMain.OVERBU Overburden pressure gradient
RDENPRESS
PROSPER.SIN.IPR.Single.SPOTMain.ROCKTY Rock type:
PE 0 - Sandstone
1 - Carbonate
PROSPER.SIN.IPR.Single.SPOTMain.USESTA User downhole standoff:
NDOFF 0 - No
1 - Yes

6.6.1.2.15 Deviation Skin-Specific Parameters

NOTE: The first four parameters on the Wong-Clifford screen come from the common
or Darcy reservoir model sections (THICKNESS, WBR, DRAINAGE and DIETZ).

OpenServer User's Manual


PROSPER and OpenServer 270

Cinco / Martin-Bronz
PROSPER.SIN.IPR.Single.Deviation Deviation
PROSPER.SIN.IPR.Single.Penetration Penetration
PROSPER.SIN.IPR.Single.VertPerm Vertical permeability

Cinco(2) / Martin-Bronz As above

Wong-Clifford
PROSPER.SIN.IPR.Single.WONGTP Formation vertical permeability ratio
PROSPER.SIN.IPR.Single.WONGLP Local vertical permeability ratio
PROSPER.SIN.IPR.Single.WONGXW Horizontal distance from well to
reservoir edge
PROSPER.SIN.IPR.Single.WONGTD Vertical depth to top of reservoir
PROSPER.SIN.IPR.Single.PerfInts[0].MDSTART Perforation interval (MD) start
PROSPER.SIN.IPR.Single.PerfInts[0].MDEND Perforation interval (MD) end
PROSPER.SIN.IPR.Single.PerfInts[0].TVDSTART Perforation interval (TVD) start
PROSPER.SIN.IPR.Single.PerfInts[0].TVDEND Perforation interval (TVD) end

6.6.1.2.16 Gravel Pack-Specific Parameters

Gravel Pack
PROSPER.SIN.IPR.SINGLE.GPPERM Gravel pack permeability
PROSPER.SIN.IPR.SINGLE.GPLEN Gravel pack length

Pre-Packed Screen
PROSPER.SIN.IPR.Single.SCIRAD Screen inner radius
PROSPER.SIN.IPR.Single.SCORAD Screen outer radius
PROSPER.SIN.IPR.Single.SCPERM Screen permeability
PROSPER.SIN.IPR.Single.SCBETA Screen Beta (turbulence)
PROSPER.SIN.IPR.Single.OTPERM Outside permeability
PROSPER.SIN.IPR.Single.OTBETA Outside (turbulence)

Wire Wrapped Screen


PROSPER.SIN.IPR.Single.SCORAD Screen outer radius
PROSPER.SIN.IPR.Single.SCPERM Screen permeability

© 1990-2018 Petroleum Experts Limited


271 OpenServer

PROSPER.SIN.IPR.Single.OTBETA Outside (turbulence)

Slotted Liner
PROSPER.SIN.IPR.Single.SLOTIR Liner inner radius
PROSPER.SIN.IPR.Single.SLOTOR Liner outer radius
PROSPER.SIN.IPR.Single.SLOTHT Slot height
PROSPER.SIN.IPR.Single.SLOTDN Slot density
PROSPER.SIN.IPR.Single.SCORAD Screen outer radius
PROSPER.SIN.IPR.Single.OTPERM Screen outer permeability
PROSPER.SIN.IPR.Single.OTBETA Outside (turbulence)

6.6.1.2.17 Relative Permeability Screen


Test data are accessed from relative permeability plot window menu (Test Data).

PROSPER.SIN.IPR.SINGLE.OILSAT Residual oil saturation


PROSPER.SIN.IPR.SINGLE.WATRLK Water end-point relative
permeability
PROSPER.SIN.IPR.SINGLE.OILRLK Oil end-point relative permeability
PROSPER.SIN.IPR.SINGLE.WATEXP Corey exponent for water
PROSPER.SIN.IPR.SINGLE.OILEXP Corey exponent for oil
PROSPER.SIN.IPR.SINGLE.TSTWC Water cut during test
PROSPER.SIN.IPR.SINGLE.ESTSW Estimated water saturation
i = 0:9
PROSPER.SIN.IPR.SINGLE.RELPTEST[i].TESTS
W Test water saturation
PROSPER.SIN.IPR.SINGLE.RELPTEST[i].TESTK
O Test relative permeability of oil
PROSPER.SIN.IPR.SINGLE.RELPTEST[i].TESTK Test relative permeability of water
W

6.6.1.2.18 Gas Coning Parameters for Oil

PROSPER.SIN.IPR.SINGLE.CONEF2 Gas Coning F2 (match parameter)


PROSPER.SIN.IPR.SINGLE.CONEF3
Gas Coning F3 (match parameter)
PROSPER.SIN.IPR.SINGLE.CONEXP
Gas Coning Exponent (match parameter)

OpenServer User's Manual


PROSPER and OpenServer 272

PROSPER.SIN.IPR.SINGLE.CONEHT
Height between first and last perf.
PROSPER.SIN.IPR.SINGLE.CONEGOC Gas Coning Distance to GOC (gas-oil
contact)
i = 0:9
PROSPER.SIN.IPR.SINGLE.CONEMATCH[
i].RATE Cone test rate
PROSPER.SIN.IPR.SINGLE.CONEMATCH[ Cone test GOR
i].GOR

6.6.1.3 Multi-lateral Well Data

There are three main data structures :

1. Associated state data and physical data for each multi-lateral network. These data
have root PROSPER.SIN.IPR.MULTILAT.NETWORK. Note that a network item
can be a node i.e., a tie-point, junction, completion, reservoir or a link between
nodes. In the latter case a network item does not carry physical data unless it is
blank tubing, in which case a box for mouse-clicking and data entry is drawn in the
middle of the link. In all cases a network item carries state data e.g. validity. Two
methods of accessing the network item data are available; they can be enumerated
up to the number of network items (available as a data item), which implies access
via an index, or accessed via their label. In this section all the data items will be
listed as if accessed via their indices. Sample code for both methods is outlined in
the next section.

2. The calculation details available by choosing Analyse | Calculate | Details from the
multi-lateral main screen. In place of NETWORK these are referenced from roots,
namely: BRANCH, LAYER and SEGMENT. For BRANCH and LAYER there are a
variable number of nodes from model to model but the correspondence between the
table rows and data server arrays is one to one. In the case of the SEGMENT data
the outer loop corresponds to the branches listed in the drop-down list box, and the
inner loop to the rows in the table.

3. The visualisation window data, represented by the root VIEW. These data are
generated from the network items so it is recommended that they are only read and
not altered by the data server. These data are enumerated according to type in an
outer loop (0 = reservoir, 1 = tubing segment, 2 = perforation, 3 = junction, 4 = tie-
point) and by number of each type in an inner loop. Note that the latter number is not
fixed and the correspondence between a visualisation object and a network item is
many to one. For instance, a completion item can contain many tubing segments
and perforations.

© 1990-2018 Petroleum Experts Limited


273 OpenServer

6.6.1.3.1 Network items

Note that the index i below is used to index NETWORK for the rest of this sub-section
variable listings. The LABEL , TYPE and HASDATA variables can be used for
accessing data items or controlling the way the accessing is done e.g. trying to extract
any physical data from a link results in a data server error.

NETCOUNT= No. of network items including


PROSPER.SIN.IPR.MULTILAT.NETWORK.COUNT nodes and links
i = 0:NETCOUNT-1
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].LABEL
Item label, blank for links
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].TYPE Type of item.
0 = tiepoint
1 = junction
2 = completion
3 = reservoir
4 = link
(data carrying link = tubing)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].NODE Node (1) or link (0) flag
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].MASK
Item masked (1) or not (0) flag
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].SELEC
TED Item selected (1) or not (0) flag
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].HASDA
TA Item has data (1) or not (0) flag
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].ID Unique ID for item (natural
number)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].VALID Item valid (1) or not (0) flag
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].POSX x position (left-right +ve, logical
coordinates)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].POSY y position (top-bottom +ve,
logical coordinates)

If (TYPE = 0) or (TYPE = 1) then the item is a tie-point or junction. The following physical
data items can be extracted.

PROSPER.SIN.IPR.MULTILAT.NETWORK[i].MD Measured depth


PROSPER.SIN.IPR.MULTILAT.NETWORK[i].TVD Vertical depth

If (TYPE = 2) or (TYPE = 4 and HASDATA = 1) then the item has tubing physical data

OpenServer User's Manual


PROSPER and OpenServer 274

i.e. model selection, deviation survey and equipment information. The following physical
data items can be extracted.

PROSPER.SIN.IPR.MULTILAT.NETWORK[i].HFLOW Horizontal flow correlation, zero-


based list
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].VFLOW Vertical flow correlation, zero-
based list
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].CHOKE
Choke model, 0 = ELF
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].THRES
HOLD Threshold angle on (1)/off (0)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].FLOWT
YPE Flow type - tubing (0)/annular (1)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].ANGLE
Threshold angle for branch
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].WBR
Well-bore radius for branch
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DIETZ Dietz shape factor for branch,
only valid for completion items,
not blank tubing

DEVCOUNT =
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].
DEV.COUNT No. of deviation survey records
j = 0:DEVCOUNT-1
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DEV[j].
MD Measured depth
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DEV[j].T
VD Vertical depth
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DEV[j].
AZIMUTH Azimuth
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DEV[j].
DISP Cumulative displacement
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DEV[j].
ANGLE Deviation angle
EQCOUNT =
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP.
COUNT No. of equipment records
j = 0:EQCOUNT-1
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBTYPE Tubing type
1 = tubing
2 = choke

© 1990-2018 Petroleum Experts Limited


275 OpenServer

3 = casing
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBDEPTH Measured depth
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBID Tubing inside diameter
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBROUGH Tubing inside roughness
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBTOD Tubing outside diameter
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBTOR Tubing outside roughness
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBCID Casing inside diameter
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBCIR Casing inside roughness
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].EQUIP[j]
.TUBMULT Flow multiplier

If (TYPE = 2) then the item is a completion node and has perforation physical data. The
following physical data items can be extracted.

PERFCOUNT = No. of perforation intervals


PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS.
COUNT
j = 0 : PERFCOUNT - 1
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Measured depth start
j].MDSTART
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Measured depth end
j].MDEND
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Vertical depth start
j].TVDSTART
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Vertical depth end
j].TVDEND
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Skin
j].SKIN
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Non-Darcy factor
j].NDARCY
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Gravel pack non-rate dependent
j].GPSKIN skin
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Gravel pack non-Darcy factor
j].GPNDARCY
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Skin entered (0) or calculated (1)

OpenServer User's Manual


PROSPER and OpenServer 276

j].SKINFLAG
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Non-Darcy factor entered (0) or
j].NDARCYFLAG calculated (0)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Gravel pack skin disabled (0),
j].GPACKFLAG entered (1), cased (2) or open
hole (3)
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Record enabled (1)/disabled (0)
j].ENABLE
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Reservoir permeability
j].RESPERM
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Perforation diameter
j].PERFDIA
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Shot density
j].SPF
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Perforation length
j].PERFLEN
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Shot phasing
j].PHASING
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Damaged zone thickness
j].DZTHICKNESS
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Crushed zone thickness
j].CZTHICKNESS
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Damaged zone perm.
j].DZPERM
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Crushed zone perm.
j].CZPERM
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Vertical permeability
j].VERTPERM
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Gravel pack permeability
j].GPPERM
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[ Gravel pack length
j].GPLEN
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PERFS[j].P Perforation efficiency
ERFEFF

If (TYPE = 3) then the item is a reservoir node and the following physical data can be
extracted.

PROSPER.SIN.IPR.MULTILAT.NETWORK[i].FLUID Fluid
0 = oil
1 = gas
2 = condensate

© 1990-2018 Petroleum Experts Limited


277 OpenServer

PROSPER.SIN.IPR.MULTILAT.NETWORK[i].METHOD IPR model


0 = Darcy/Petex
1 = Hydraulic fracture
PROSPER.SIN.IPR.MULTILAT.NETWORK[i]..MODEL
Method name
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].PRES Pressure
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].TRES Temperature
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].API Oil gravity
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].GRVGAS
Gas gravity
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].WATERS
AL Water salinity
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].WC Water cut
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].GOR Total GOR
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].WGR WGR
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].CGR CGR
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].GORSEP
Separator GOR
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].RESTOPD
EPTH Top depth
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].RESVERT
PERM Vertical permeability
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].RESPER
M Horizontal permeability
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].THICKNE
SS Formation height
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].DRAINAG
E Drainage area
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].TIME Time elapsed
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].POROSIT
Y Total porosity
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].FRACHEI
GHT Fracture height
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].FRACLEN
GTH Fracture half length
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].FRACFC Fracture dimensionless
D conductivity
PROSPER.SIN.IPR.MULTILAT.NETWORK[i].SWC Connate water saturation

OpenServer User's Manual


PROSPER and OpenServer 278

6.6.1.3.2 Branch, Layer and Segment Details

NBRANCHES = No. of branches


PROSPER.SIN.IPR.MULTILAT.BRANCH.COUNT
i = 0:NBRANCHES-1
PROSPER.SIN.IPR.MULTILAT.BRANCH[i].RATE Rate in branch
PROSPER.SIN.IPR.MULTILAT.BRANCH[i].PRESSURE Pwf at branch top

NLAYERS =
PROSPER.SIN.IPR.MULTILAT.LAYER.COUNT Number of layers
i = 0:NLAYERS-1 Composite PI for layer
(including interference from all
branches)
PROSPER.SIN.IPR.MULTILAT.LAYER[i].PI Composite skin for layer
PROSPER.SIN.IPR.MULTILAT.LAYER[i].SKIN Layer i top
PROSPER.SIN.IPR.MULTILAT.LAYER[i].TOP Layer i bottom
PROSPER.SIN.IPR.MULTILAT.LAYER[i].BOTTOM Number of layers

NBRANCHES = Number of branches


PROSPER.SIN.IPR.MULTILAT.SEGMENT.COUNT
i = 0:NBRANCHES-1
NSEGMENTS = Number of segments in
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i].COUNT branch i
j = 0:NSEGMENTS-1
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i][j].MDT Segment measured depth
top
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i][j].MDB Segment measured depth
bottom
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i][j].TVD Segment vertical depth
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i]
[j].RATEPERSEG Segment rate
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i]
[j].RATEPERLENGTH Segment rate per unit length
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i]
[j].PRESSURE Segment pwf
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i]
[j].CUMRATE Segment cumulative rate
PROSPER.SIN.IPR.MULTILAT.SEGMENT[i][j].PRES Segment reservoir pressure
(varies with finite conductivity

© 1990-2018 Petroleum Experts Limited


279 OpenServer

6.6.1.3.3 Calculation Control Data


Finally, there are some miscellaneous parameters normally accessed through the
calculation screen (Analyse|Calculate).

PROSPER.SIN.IPR.MULTILAT.CURVECALC Curve calculation flag. 0 = 1 point, 1 =


curve
PROSPER.SIN.IPR.MULTILAT.PRESSURECAL Pressure/rate calculation switch. 0: p =
C f(q), 1: q = f(p)
PROSPER.SIN.IPR.MULTILAT.COND 0 = infinite conductivity, 1 = finite
conductivity
PROSPER.SIN.IPR.MULTILAT.RATE Single point rate input (for p = f(q))
PROSPER.SIN.IPR.MULTILAT.PRESSURE Single point pressure input (for q = f(p))
PROSPER.SIN.IPR.MULTILAT.MINPRESSURE Minimum pressure for curve calculation
PROSPER.SIN.IPR.MULTILAT.CALCPTS No. of calculation points

6.6.1.3.4 Visualisation Data


These parameters are explicitly or implicitly involved in the functionality of the model
selection.

NTYPES = No. of view object types


PROSPER.SIN.IPR.MULTILAT.VIEW.COUNT
i = 0:NTYPES-1 i = object type. 0 = reservoir, 1
= tubing, 2 = completion, 3 =
junction, 4 = tie-point
NOBJECTS =
PROSPER.SIN.IPR.MULTILAT.VIEW[i].COUNT No. of objects of given type
j = 0:NOBJECTS-1
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].FIRST 1 signifies first view object in a
branch
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].LAST 1 signifies last view object in a
branch
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].ID ID of corresponding net item.
For tubing many view objects
can be mapped to one network
item
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].STARTPT.X Start x point in physical
coordinates
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].STARTPT.Y
Start y point

OpenServer User's Manual


PROSPER and OpenServer 280

PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].STARTPT.Z
Start z point
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].ENDPT.X End x point
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].ENDPT.Y End y point
PROSPER.SIN.IPR.MULTILAT.VIEW[i][j].ENDPT.Z End z point

6.6.1.3.5 Multilateral Results

To access the results of the multilateral calculations, the following codes can be used.

PROSPER.SIN.IPR.Single.RTLIST[i] Total Liquid Rate


PROSPER.SIN.IPR.Single.MRPRES[i] Pressure
PROSPER.SIN.IPR.Single.MRPIND[i] Total PI
PROSPER.SIN.IPR.Single.MRROIL[i] Total Oil Rate
PROSPER.SIN.IPR.Single.MRRWAT[i] Total Water Rate
PROSPER.SIN.IPR.Single.MRRGAS[i] Total Gas Rate
PROSPER.SIN.IPR.SINGLE.MRQLAY[i][j] Production rate at ith pressure
value and jth layer. (see
example below)
PROSPER.SIN.IPR.Single.MRTIME[i] Time
PROSPER.SIN.IPR.Single.MRITER[i] Number of Iterations

Example:
If there are 20 points for which the IPR is calculated and there are 3 layers in the model
then the following code can be set up to extract the results for the production of each
layer.

For i = 0 To 19
For j = 0 To 2
Cells(2 + i, 4 + j) = DoGet ("PROSPER.SIN.IPR.SINGLE.MRQLAY["
+ CStr(i) + "][" + CStr(j) + "]")
Next j
Next i

6.6.2 Equipment Data

This is the data associated with the equipment data entry screens in PROSPER.

© 1990-2018 Petroleum Experts Limited


281 OpenServer

6.6.2.1 Overview
The equipment data is accessed using the root name PROSPER.SIN.EQP and is split
up into several sections as listed below:

DEVN Deviation Survey


TEMP Flowing Temperature Survey
GEO Geothermal Gradient
SURF Surface Equipment
TURF Surface Equipment (Enthalpy Balance)
DOWN Downhole Eqipment
TOWN Downhole Equipment (Enthalpy Balance)
SHC Specific Heat Capacities
ENV Surface Environment Data
DRILL Drilling Data
LITHO Lithology
DB Equipment / Rock Type Databases
GAUGE Gauge Details

6.6.2.2 DEVN – Deviation Survey Equipment

i = 0:19
PROSPER.SIN.EQP.Devn.Data[0].Md Measured depth
PROSPER.SIN.EQP.Devn.Data[0].Tvd True vertical depth

Deviation Survey Filter Options


PROSPER.SIN.EQP.Devn.RawType Raw Data Type:
0 = MD / TVD
1 = TVD / Angle
2 = MD / Angle
PROSPER.SIN.EQP.Devn.FilterAngle Filter angle
PROSPER.SIN.EQP.Devn.FilterActual Angle step
PROSPER.SIN.EQP.Devn.FilterMax Maximum number of points (20-maximum)
i = 0:999
PROSPER.SIN.EQP.Devn.RawMSD[i] Measured depth
PROSPER.SIN.EQP.Devn.RawTVD[i] True vertical depth
i = 0:19
PROSPER.SIN.EQP.Devn.FilMSD[i] Filtered Measured Depth
PROSPER.SIN.EQP.Devn.FilTVD[i] Filtered True Vertical Depth

OpenServer User's Manual


PROSPER and OpenServer 282

PROSPER.EQP.DEV.FIL.FILTER DoCmd command function to filter the


entered deviation survey data to 20-points
PROSPER.EQP.DEV.FIL.TRANS DoCmd command function to pass the 20-
filtered points to the deviation survey data
section
PROSPER.SIN.EQP.DEVN.MAX Maximum Number of Points
PROSPER.SIN.EQP.DEVN.DATA.COUNT Current Number of Points

6.6.2.3 SURF – Surface Equipment

PROSPER.SIN.EQP.SURF.HTC Overall Heat Transfer Coefficient


PROSPER.SIN.EQP.SURF.TMP Temperature of Surrounds

PROSPER.SIN.EQP.SURF.DATA.COUNT Number of items


i = 0:COUNT-1
PROSPER.SIN.EQP.SURF.DATA[i].LABEL Label
PROSPER.SIN.EQP.SURF.DATA[i].TYPE Equipment Type
0 = None
1 = Pipe
2 = Choke
3 = Fittings
PROSPER.SIN.EQP.SURF.DATA[i].LENGTH Pipe Length
PROSPER.SIN.EQP.SURF.DATA[i].TVD Pipe True vertical Depth
PROSPER.SIN.EQP.SURF.DATA[i].TEMP Fluid Temperature
PROSPER.SIN.EQP.SURF.DATA[i].ID Pipe Inside Diameter
PROSPER.SIN.EQP.SURF.DATA[i].ROUGH Pipe Inside Roughness
PROSPER.SIN.EQP.SURF.DATA[i].MULT Pipe Rate Multiplier
PROSPER.SIN.EQP.SURF.DATA[i].HTC Heat Transfer Coefficient

6.6.2.4 TURF – Surface Equipment (Enthalpy Balance)

PROSPER.SIN.EQP.TURF.DATA.COUNT Number of Items


i = 0:COUNT-1
PROSPER.SIN.EQP.TURF.DATA[i].LABEL Label
PROSPER.SIN.EQP.TURF.DATA[i].TYPE Type
PROSPER.SIN.EQP.TURF.DATA[i].LENGTH Pipe Length

© 1990-2018 Petroleum Experts Limited


283 OpenServer

PROSPER.SIN.EQP.TURF.DATA[i].TVD Pipe True Vertical Depth


PROSPER.SIN.EQP.TURF.DATA[i].OD Pipe Outside Diameter
PROSPER.SIN.EQP.TURF.DATA[i].ID Pipe Inside Diameter
PROSPER.SIN.EQP.TURF.DATA[i].MULT Pipe Rate Multiplier
PROSPER.SIN.EQP.TURF.DATA[i].DEPTH Pipe Burial Depth
PROSPER.SIN.EQP.TURF.DATA[i].ROUGH Pipe Inside Roughness
PROSPER.SIN.EQP.TURF.DATA[i].INSTHICK Total Insulation Thickness
PROSPER.SIN.EQP.TURF.DATA[i].INSCOND Total Insulation Conductivity
PROSPER.SIN.EQP.TURF.DATA[i].INSEMM Total Insulation Emmissivity
PROSPER.SIN.EQP.TURF.DATA[i].PIPECON Pipe Conductivity
PROSPER.SIN.EQP.TURF.DATA[i].PIPEEMM Pipe

PROSPER.SIN.EQP.TURF.DATA[i].INSUL.COUNT Number of Insulation Layers


j = 0:COUNT-1
PROSPER.SIN.EQP.TURF.DATA[i].INSUL[j].TYPE Insulation Type
PROSPER.SIN.EQP.TURF.DATA[i].INSUL[j].THICK Insulation Thickness

6.6.2.5 ENV – Surface Environment Data (Enthalpy Balance / Rough Approx.)

PROSPER.SIN.EQP.ENV.AIRTMP Air Temperature


PROSPER.SIN.EQP.ENV.HUMID Humidity
PROSPER.SIN.EQP.ENV.MSL Mean Sea Level with respect to Origin
PROSPER.SIN.EQP.ENV.GROUND Ground Level with respect to Origin
PROSPER.SIN.EQP.ENV.SEABED Seabed Depth with respect to Origin
PROSPER.SIN.EQP.ENV.AIRVEL Velocity of Air
PROSPER.SIN.EQP.ENV.SEAVEL Velocity of Sea

PROSPER.SIN.EQP.ENV.SGNUM Number of Points in Sea Temperature Gradient


i = 0:SGNUM-1
PROSPER.SIN.EQP.ENV.SGTMP[i] Temperature
PROSPER.SIN.EQP.ENV.SGDEP[i] Depth

6.6.2.6 DOWN – Down Hole Equipment

PROSPER.SIN.EQP.DOWN.DATA.COUNT Number of Items

OpenServer User's Manual


PROSPER and OpenServer 284

i = 0:COUNT-1
PROSPER.SIN.EQP.DOWN.DATA[i].LABEL Label
PROSPER.SIN.EQP.DOWN.DATA[i].TYPE Type
PROSPER.SIN.EQP.DOWN.DATA[i].DEPTH Measured Depth
PROSPER.SIN.EQP.DOWN.DATA[i].TID Tubing Inside Diameter
PROSPER.SIN.EQP.DOWN.DATA[i].TIR Tubing Inside Roughness
PROSPER.SIN.EQP.DOWN.DATA[i].TOD Tubing Outside Diameter
PROSPER.SIN.EQP.DOWN.DATA[i].TOR Tubing Outside Roughness
PROSPER.SIN.EQP.DOWN.DATA[i].CID Casing Inside Diameter
PROSPER.SIN.EQP.DOWN.DATA[i].CIR Casing Inside Roughness
PROSPER.SIN.EQP.DOWN.DATA[i].COD Casing Outside Diameter
PROSPER.SIN.EQP.DOWN.DATA[i].COR Casing Outside Roughness
PROSPER.SIN.EQP.DOWN.DATA[i].CID2 Casing#2 Inside Diameter
PROSPER.SIN.EQP.DOWN.DATA[i].CIR2 Casing#2 Inside Roughness
PROSPER.SIN.EQP.DOWN.DATA[i].MULT Rate Multiplier

NOTE:
If an OpenServer macro is used to build a model from scratch, it will be important to
make sure that ALL the input variables needed in the downhole equipment are
specified via the OpenServer macro.
Effectively, if for instance the roughness is left to the default value and not specified via
the OpenServer macro, the downhole equipment section will not be validated, causing
an error when trying to perform a calculation.

6.6.2.7 TOWN – Down Hole Equipment (Enthalpy Balance)

PROSPER.SIN.EQP.TOWN.DATA.COUNT Number of Items


i = 0:COUNT-1
PROSPER.SIN.EQP.TOWN.DATA[i].LABEL Label
PROSPER.SIN.EQP.TOWN.DATA[i].TYPE Type
PROSPER.SIN.EQP.TOWN.DATA[i].DEPTH Measured Depth
PROSPER.SIN.EQP.TOWN.DATA[i].TID Tubing Inside Diameter
PROSPER.SIN.EQP.TOWN.DATA[i].TOD Tubing Outside Diameter
PROSPER.SIN.EQP.TOWN.DATA[i].TIR Tubing Inside Roughness
PROSPER.SIN.EQP.TOWN.DATA[i].MULT Pipe Rate Multiplier
PROSPER.SIN.EQP.TOWN.DATA[i].INSTHICK Total Insulation Thickness
PROSPER.SIN.EQP.TOWN.DATA[i].INSCOND Total Insulation Conductivity
PROSPER.SIN.EQP.TOWN.DATA[i].INSEMM Total Insulation Emmissivity

© 1990-2018 Petroleum Experts Limited


285 OpenServer

PROSPER.SIN.EQP.TOWN.DATA[i].PIPECON Tubing Conductivity


PROSPER.SIN.EQP.TOWN.DATA[i].PIPEEMM Tubing Emmissivity

PROSPER.SIN.EQP.TOWN.DATA[i].INSUL.COUNT Number of Insulation Layers


j = 0:COUNT-1
PROSPER.SIN.EQP.TOWN.DATA[i].INSUL[j].TYPE Insulation Type
PROSPER.SIN.EQP.TOWN.DATA[i].INSUL[j].THICK Insulation Thickness

6.6.2.8 GEO – Geothermal Gradient

PROSPER.SIN.EQP.GEO.MAX Maximum Number of Points


PROSPER.SIN.EQP.GEO.HTC Overall Heat Transfer Coefficient
PROSPER.SIN.EQP.GEO.INJ Injected Fluid Temperature

PROSPER.SIN.EQP.GEO.DATA.COUNT Current Number of Points


i = 0:COUNT-1
PROSPER.SIN.EQP.GEO.DATA[i].MD Measured Depth
PROSPER.SIN.EQP.GEO.DATA[i].TMP Temperature
PROSPER.SIN.EQP.GEO.DATA[i].HTC Heat Transfer Coefficient

6.6.2.9 TEMP – Flowing Temperature Survey

The following commands are used to define the temperature survey when Calculate ->
"Pressure only" options is selected in the 'System Summary'

PROSPER.SIN.EQP.Env.DepRef Type of depth data input:


0 = Enter True Vertical
Depth
1 = Enter Measured Depth
PROSPER.SIN.EQP.TEMP.MAX Maximum Number of Points
PROSPER.SIN.EQP.TEMP.DATA.COUNT Current Number of Points
i = 0:COUNT-1
PROSPER.SIN.EQP.TEMP.DATA[i].TVD True Vertical Depth
PROSPER.SIN.EQP.TEMP.DATA[i].MD Measured Depth
PROSPER.SIN.EQP.TEMP.DATA[i].TMP Temperature

OpenServer User's Manual


PROSPER and OpenServer 286

6.6.2.10SHC – Fluid Properties – Average Heat Capacities

PROSPER.SIN.EQP.SHC.CPO Average Heat Capacity (Cp) Oil


PROSPER.SIN.EQP.SHC.CPG Average Heat Capacity (Cp) Gas
PROSPER.SIN.EQP.SHC.CPW Average Heat Capacity (Cp) Water

6.6.2.11DRILL – Drilling Data (Enthalpy Balance)

PROSPER.SIN.EQP.DRILL.DATA.COUNT Number of items


i = 0:COUNT-1
PROSPER.SIN.EQP.DRILL.DATA[i].LABEL Label
PROSPER.SIN.EQP.DRILL.DATA[i].DRILLDEPTH Drilling Depth
PROSPER.SIN.EQP.DRILL.DATA[i].DIAMETER Hole Diameter
PROSPER.SIN.EQP.DRILL.DATA[i].SHOEDEPTH Casing Shoe Depth
PROSPER.SIN.EQP.DRILL.DATA[i].CASINGOD Casing Outside Diameter
PROSPER.SIN.EQP.DRILL.DATA[i].CASINGWT Casing Weight
PROSPER.SIN.EQP.DRILL.DATA[i].CEMENTTOP Top Cement Depth
PROSPER.SIN.EQP.DRILL.DATA[i].CASINGTOP Casing Top Depth
PROSPER.SIN.EQP.DRILL.DATA[i].MUDDENSIT
Y

PROSPER.SIN.EQP.DRILL.CFLIQ Completion Fluid Liquid Type


PROSPER.SIN.EQP.DRILL.CFLIQDEN Completion Fluid Liquid Density

PROSPER.SIN.EQP.DRILL.CFLTEMP No. of Completion Fluid Liquid


Tables
i = 0:CFLTEMP-1

PROSPER.SIN.EQP.DRILL.CFLPRES[i] No of Pressures per table


j = 0:CFLPRES[i]-1
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][0] Temperature
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][1] Pressure
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][2] Density
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][3] Viscosity
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][4] Specific Heat Capacity
PROSPER.SIN.EQP.DRILL.CFLTAB[i][j][5] Conductivity

© 1990-2018 Petroleum Experts Limited


287 OpenServer

PROSPER.SIN.EQP.DRILL.CFGAS Completion Fluid Gas Type

PROSPER.SIN.EQP.DRILL.CFGTEMP No. of Completion Fluid Gas


Tables
i = 0:CFGTEMP-1

PROSPER.SIN.EQP.DRILL.CFGPRES[i] No of Pressures per table


j = 0:CFGPRES[i]-1
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][0] Temperature
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][1] Pressure
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][2] Density
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][3] Viscosity
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][4] Specific Heat Capacity
PROSPER.SIN.EQP.DRILL.CFGTAB[i][j][5] Conductivity

PROSPER.SIN.EQP.DRILL.PACKER Packer Depth


PROSPER.SIN.EQP.DRILL.MIDPROD Mid Production Depth
PROSPER.SIN.EQP.DRILL.LIQLEV Annulus Liquid Level

6.6.2.12LITHO – Lithology (Enthalpy Balance)

PROSPER.SIN.EQP.LITHO.DATA.COUNT Number of Items


i = 0:COUNT-1
PROSPER.SIN.EQP.LITHO.DATA[i].FORM Formation Type
PROSPER.SIN.EQP.LITHO.DATA[i].BOTTOM Bottom Depth
PROSPER.SIN.EQP.LITHO.DATA[i].SHALE Shaliness
PROSPER.SIN.EQP.LITHO.DATA[i].POROSITY Porosity
PROSPER.SIN.EQP.LITHO.DATA[i].PERM Permeability
PROSPER.SIN.EQP.LITHO.DATA[i].ROCK Rock Consistency
PROSPER.SIN.EQP.LITHO.DATA[i].FLUID In-Situ Fluid Type
PROSPER.SIN.EQP.LITHO.DATA[i].SALINITY Salinity

6.6.2.13DB – Databases (Enthalpy Balance)

PROSPER.SIN.EQP.DB.CEMCON Cement Conductivity

OpenServer User's Manual


PROSPER and OpenServer 288

PROSPER.SIN.EQP.DB.CASCON Casing Conductivity

PROSPER.SIN.EQP.DB.PIPE.COUNT Number of Pipe Types


i = 0:COUNT-1
PROSPER.SIN.EQP.DB.PIPE[i].LABEL Label
PROSPER.SIN.EQP.DB.PIPE[i].CON Conductivity
PROSPER.SIN.EQP.DB.PIPE[i].EMM Emmissivity

PROSPER.SIN.EQP.DB.INSUL.COUNT Number of Insulation types


i = 0:COUNT-1
PROSPER.SIN.EQP.DB.INSUL[i].LABEL Label
PROSPER.SIN.EQP.DB.INSUL[i].CON Conductivity
PROSPER.SIN.EQP.DB.INSUL[i].EMM Emmisssivity

PROSPER.SIN.EQP.DB.FLUID.COUNT Number of In-situ Fluid types


i = 0:COUNT-1
PROSPER.SIN.EQP.DB.FLUID[i].LABEL Label
PROSPER.SIN.EQP.DB.FLUID[i].DEN Fluid Specific Gravity
PROSPER.SIN.EQP.DB.FLUID[i].CON Fluid Conductivity
PROSPER.SIN.EQP.DB.FLUID[i].CP Specific Heat Capacity

PROSPER.SIN.EQP.DB.ROCK.COUNT Number of Rock Types


i = 0:COUNT-1
PROSPER.SIN.EQP.DB.ROCK[i].LABEL Name
PROSPER.SIN.EQP.DB.ROCK[i].DEN Rock Density
PROSPER.SIN.EQP.DB.ROCK[i].CON Rock Conductivity
PROSPER.SIN.EQP.DB.ROCK[i].CP Specific Heat Capacity

6.6.2.14GAUGE – Gauge Details

i = 0:9
PROSPER.SIN.EQP.Gauge.Data[i].Depth Gauge Depth
PROSPER.SIN.EQP.Gauge.Data[i].Label Gauge Label

© 1990-2018 Petroleum Experts Limited


289 OpenServer

6.6.3 Artificial Lift Data Section


The following sections show the input fields pertaining to the artificial lift data section:

6.6.3.1 Gas Lift (Continuous)

PROSPER.SIN.GLF.GRAVITY Gas Lift Gas Gravity


PROSPER.SIN.GLF.H2S Gas Lift Gas Mole Percent H2S
PROSPER.SIN.GLF.CO2 Gas Lift Gas Mole Percent CO2
PROSPER.SIN.GLF.N2 Gas Lift Gas Mole Percent N2
PROSPER.SIN.GLF.GLRINJ GLR Injected
PROSPER.SIN.GLF.CHECKVALVE Depth of Check Valve
PROSPER.SIN.GLF.GLRate Injected gas rate
PROSPER.SIN.GLF.Entry GLR / Rate?
0 - Use GLR injected
1 - Use injected gas rate
PROSPER.SIN.GLF.Method Gas Lift Method:
0 - Fixed depth of injection
1 - Optimum depth of injection
2 - Valve depths specified

OpenServer User's Manual


PROSPER and OpenServer 290

Fixed Depth of Injection


PROSPER.SIN.GLF.ValveDepth Gas lift valve depth (MD)

Optimum Depth of Injection


PROSPER.SIN.GLF.MaxDepth Maximum depth of injection
PROSPER.SIN.GLF.Casing Casing pressure
PROSPER.SIN.GLF.dP dP across valve

Valve Depths Specified


PROSPER.SIN.GLF.Casing Casing pressure
PROSPER.SIN.GLF.dP dP across valve
i = 0:9
PROSPER.SIN.GLF.Depth[i] Valve position (MD)

Example:
The following OpenServer string illustrates how to set the gas lift method using the 0 to
2 indices:

DoSet ("PROSPER.SIN.GLF.Method"), 0

The above string will set the gas lift method to fixed depth of injection.

The same rules apply for all other DoSet strings that depend on an option index.
6.6.3.2 Electircal Submersible Pump

PROSPER.SIN.ESP.Depth Pump depth (measured)


PROSPER.SIN.ESP.Frequency Operating frequency
PROSPER.SIN.ESP.MaxPumpOD Maximum O.D.
PROSPER.SIN.ESP.CableLength Length of cable
PROSPER.SIN.ESP.Efficiency Gas separator efficiency
PROSPER.SIN.ESP.Stages Number of stages
PROSPER.SIN.ESP.Volts Voltage at surface
PROSPER.SIN.ESP.Wear Pump wear factor

6.6.3.3 Hydraulic Drive Downhole Pump

PROSPER.SIN.HSP.PumpDepth Pump depth


PROSPER.SIN.HSP.PumpMaxOD Pump maximum allowable O.D.

© 1990-2018 Petroleum Experts Limited


291 OpenServer

PROSPER.SIN.HSP.TurbMaxOD Turbine maximum allowable O.D.


PROSPER.SIN.HSP.PumpSpeed Pump speed
PROSPER.SIN.HSP.PowerPC Percent power fluid of reservoir fluid
PROSPER.SIN.HSP.Stages Number of pump stages
PROSPER.SIN.HSP.Wear Pump wear factor
PROSPER.SIN.HSP.TurbStage Number of turbine stages
PROSPER.SIN.HSP.GDRflag Gas de-rating model

6.6.3.4 Progressive Cavity Pump

Sucker Rod Drive


PROSPER.SIN.PCP.Input[0] Pump depth (measured)
PROSPER.SIN.PCP.Input[11] Pump speed
PROSPER.SIN.PCP.Input[1] Maximum O.D.
PROSPER.SIN.PCP.Input[2] Gas separator efficiency
PROSPER.SIN.PCP.Input[3] Pump wear factor
PROSPER.SIN.PCP.Input[10] Total rod length

Downhole Motor Drive


PROSPER.SIN.PCP.Input[4] Cable length
PROSPER.SIN.PCP.Input[5] Voltage at surface

6.6.3.5 Coil Tubing Gas Lift

Specified Injection Depth


PROSPER.SIN.GLF.COILGG Gas lift gas gravity
PROSPER.SIN.GLF.COILGI GLR injected
PROSPER.SIN.GLF.COILH2 Mole percent H2S
PROSPER.SIN.GLF.COILC2 Mole percent CO2
PROSPER.SIN.GLF.COILN2 Mole percent N2
PROSPER.SIN.GLF.COILID Coil tubing I.D.
PROSPER.SIN.GLF.COILTK Coil tubing thickness
PROSPER.SIN.GLF.COILIR Coil tubing inside roughness
PROSPER.SIN.GLF.COILOR Coil tubing outside roughness
PROSPER.SIN.GLF.COILDP Coil tubing specified depth

OpenServer User's Manual


PROSPER and OpenServer 292

PROSPER.SIN.GLF.COILIP Gas injection pressure


PROSPER.SIN.GLF.COILDV dP across valve

Optimum Injection Depth


PROSPER.SIN.GLF.COILMD Coil tubing maximum depth

6.6.3.6 Jet Pump

PROSPER.SIN.JET.Input[0] Pump depth (measured)


PROSPER.SIN.JET.Input[1] Maximum O.D.
PROSPER.SIN.JET.Input[8] Surface injection rate
PROSPER.SIN.JET.Input[9] Surface injection pressure
PROSPER.SIN.JET.LossCoef[0] Nozzle loss coefficient
PROSPER.SIN.JET.LossCoef[1] Suction loss coefficient
PROSPER.SIN.JET.LossCoef[3] Diffuser loss coefficient

6.6.3.7 Multiphase Pump

PROSPER.SIN.FRM.Input[0] Power available


PROSPER.SIN.FRM.Input[1] Pump wear factor
PROSPER.SIN.FRM.NumPumps Pump configuration:
0 = Single pump
1 = 2 Pumps in parallel
2 = 3 Pumps in parallel
3 = 4 Pumps in parallel
4 = 5 Pumps in parallel
5 = 6 Pumps in parallel

Example:
The following OpenServer string illustrates how to set the number of pumps using the 0
to 5 indices:

DoSet ("PROSPER.SIN.FRM.NumPumps"), 1

The above string will set the number of pumps in parallel to 2.

The same rules apply for all other DoSet strings that depend on an option index.

© 1990-2018 Petroleum Experts Limited


293 OpenServer

6.6.3.8 Sucker Rod Pump

PROSPER.SIN.SRP.Input[10] Anchored tubing


0 = Yes
1 = No
PROSPER.SIN.SRP.Input[16] Pump depth
PROSPER.SIN.SRP.Input[12] Pump diameter
PROSPER.SIN.SRP.Input[13] Surface stroke length
PROSPER.SIN.SRP.Input[17] Pumping speed
PROSPER.SIN.SRP.Input[26] Rod type

Gas Anchor
PROSPER.SIN.SRP.Input[75] Gas anchor:
0 = Entered
1 = Calculated
PROSPER.SIN.SRP.Input[77] Efficiency
PROSPER.SIN.SRP.Input[76] Type:
0 = Cup type
1 = Packer type
2 = Poor boy
PROSPER.SIN.SRP.Input[78] Annulus area

Example:
The following OpenServer string illustrates how to set the tubing anchor option using the
0 to 1 indices:

DoSet ("PROSPER.SIN.SRP.Input[10]"), 0

The above string will set the tubing anchor option to Yes.

The same rules apply for all other DoSet strings that depend on an option index.
6.6.3.9 Gas Lift (Intermittent)

PROSPER.SIN.GLI.Input[0] Surface injection pressure


PROSPER.SIN.GLI.Input[1] Injection depth
PROSPER.SIN.GLI.Input[2] Gas lift gas gravity
PROSPER.SIN.GLI.Input[3] Wellhead pressure
PROSPER.SIN.GLI.Input[4] Valve port size
PROSPER.SIN.GLI.Input[5] Water cut
PROSPER.SIN.GLI.Input[6] Tubing liquid level

OpenServer User's Manual


PROSPER and OpenServer 294

6.7 Calculation Input Data


The calculation input data is accessed using the root name PROSPER.ANL and is split
up into several sections as listed below:

INF Inflow Performance Sensitivity Calculations


SYS System Calculations
GRD Gradient Calculations
VLP VLP Calculations
CHK Choke Performance Calculator
QLG QuickLook – GasLift
QLE QuickLook – ESP
QLH QuickLook – HSP
TCC Tubing Correlation Comparison
PCC Pipeline Correlation Comparison
GMT Gradient Matching
VMT VLP/IPR Matching
PMT Pipeline Matching
GEN Generate for GAP
WHP WHP to BHP Calculations

GDT Gradient Test Data


PLD Plot Details
COR Flow Correlation Information
THR Correlation Threshold Information

Each section will be accessed thus:

PROSPER.ANL.INF
PROSPER.ANL.SYS
PROSPER.ANL.GRD
PROSPER.ANL.VLP
PROSPER.ANL.CHK
PROSPER.ANL.QLG
PROSPER.ANL.QLE
PROSPER.ANL.QLH
PROSPER.ANL.TCC
PROSPER.ANL.PCC
PROSPER.ANL.GMT

© 1990-2018 Petroleum Experts Limited


295 OpenServer

PROSPER.ANL.VMT
PROSPER.ANL.PMT
PROSPER.ANL.GLD
PROSPER.ANL.GLA
PROSPER.ANL.GEN
PROSPER.ANL.WHP

PROSPER.ANL.GDT
PROSPER.ANL.PLD
PROSPER.ANL.COR
PROSPER.ANL.THR

6.7.1 Sensitivity Variables and Indexes

Correlation indexes and names


In most of the calculation screens, the different flow correlations can be selected through
the index or name:

Flow Correlation Index OpenSesrver Name


Duns and Ross Modified 0 DunsandRosModified
Hagedorn and Brown 1 HagedornBrown
Fancher and Brown 2 FancherBrown
Gray 3 Gray
Mukerjee - Brill 4 MukerjeeBrill
Beggs and Brill 5 BeggsandBrill
Dukler-Flannigan 6 DuklerFlannigan
Dukler-Eaton-Flannigan 7 DuklerEatonFlannigan
Petroleum Experts 8 PetroleumExperts
Orkizewski 9 Orkiszewski
Petroleum Experts 2 10 PetroleumExperts2
Duns and Ross Original 11 DunsandRosOriginal
Petroleum Experts 3 12 PetroleumExperts3
Beggs and Brill (Gas Head) 13 BeggsandBrillGasHead
GRE (Modified by PE) 14 GREmodifiedbyPE
GRE (With DSM) 15 GREwithDSM
GRE (Original) 16 GREoriginal
GRE (With AE) 17 GREwithAE
Petroleum Experts 4 18 PetroleumExperts4
Hydro 3P 19 Hydro3P

OpenServer User's Manual


PROSPER and OpenServer 296

Petroleum Experts 5 20 PetroleumExperts5


OLGAS2P 21 OLGAS2P
OLGAS3P 22 OLGAS3P
OLGAS3PEXT 23 OLGAS3PEXT

Example:
For example, selecting the PE2 correlation when performing a system calculation would
be done with the string:

DoSet “PROSPER.ANL.SYS.Tubing”, 10

When a correlation is not available, its index will return PE2.

NOTE:
It is generally recommended to use correlation names, as correlation indexes may vary
between different sections of PROSPER and also can change when user defined
correlations are introduced into the system. In this case using names, as opposed to
indexes, will make the macro generic and independent of those changes. The following
syntax can be used to access the correlations via their names:

DoSet ("PROSPER.ANL.SYS.TubingLabel"), "PetroleumExperts2"

Variable indexes in the sensitivity screens

The indexes for variables available in the sensitivity screens (such as the inflow and
system sensitivity calculation) are:

Reservoir Pressure 1 Gas Separation Efficiency 36


Skin 2 Pump Wear Factor (ESP) 37
Productivity Index 3 Pump Depth (Measured) 38
Shot Density 4 Dissolved and Free GLR 39
Gravel Pack Permeability 6 Water Oil Ratio 40
Perforation Diameter 7 Number of Stages 41
Gravel Pack Length 8 SSSV Size 42
Time 9 Restriction Size 43
Dimensionless fracture conductivity 10 Gas Lift Gas Specific Gravity 44
Fracture Half Length 11 Reservoir Permeability 51
Well Length 12 Perforation Length 52
Vertical Anisotropy 13 Reservoir Temperature 53
Distance from Bottom Boundary 14 Test Rate 54
Separator GOR 15 Test Pressure 55
Water Cut 16 Reservoir Thickness 56

© 1990-2018 Petroleum Experts Limited


297 OpenServer

Gas Oil Ratio 17 Drainage Area 57


Water to Gas Ratio 18 Dietz Shape Factor 58
Condensate to Gas Ratio 19 Wellbore Radius 59
Total GOR 20 Oil Rel Perm 60
Tubing/Pipe Diameter 21 Perforation Interval 61
Gas Lift Injection Rate 22 Reservoir Porosity 62
GLR Injected 23 Fracture Height 63
GLR Free 24 Horizontal Anisotropy 64
Free Gas Rate 25 Reservoir Length 65
Tubing Roughness 26 Reservoir Width 66
First Node Pressure 27 Distance from Length Boundary 67
Choke Size 28 Distance from Width Boundary 68
Casing Pressure 29 Damaged Zone Thickness 70
Compressor Discharge Pressure 30 Damaged Zone Permeability 71
Injection Depth 31 Crushed Zone Thickness 72
DP across Valve 32 Crushed Zone Permeability 73
GOR Free 33 Shot Phasing 74
Production Time 34 Deviation 75
Operating Frequency 35 Penetration 76

Perforation efficiency 77 Interporosity Coefficient 144


Vertical Permeability 78 Number of Fractures 145
Non-Darcy Coefficient 79 Number of pump stages 300
(Forchheimer)
Darcy Coefficient (Forchheimer) 80 Pump speed 301
Exponent (Back Pressure IPR) 81 Number of Turbine Stages 302
C Value (C and n IPR Model) 82 HSP Turbine Speed 303
n Value (C and n IPR Model) 83 % Power Fluid of Reservoir Fluid 304
Connate Water Saturation 84 Pump Wear Factor (HSP) 305
D Factor (PE IPR Model) 85 Pump Depth (Measured) (HSP) 306
Residual Water Fraction 86 Pipe Roughness 307
Residual Oil Fraction 87 PCP Pump Depth 308
Water End Point Rel perm 88 PCP Pump Speed 309
Oil End Point Rel Perm 89 PCP Pump Wear Factor 310
Water Corey Exponent 90 Coil Tubing Inside Diameter 311
Oil Corey Exponent 91 Coil Tubing Thickness 312
Test Water Cut (Rel Perm 92 Coil Tubing Injection Depth 313
Correction)

OpenServer User's Manual


PROSPER and OpenServer 298

Fracture Permeability 141 Coil Tubing Inside Roughness 314


Compressibility 142 Coil Tubing Outside Roughness 315
Storativity Ratio 143

Indexes related to the Thermally Induced Fracture Model

Initial Reservoir Stress 146


Sweep Efficiency 147
Injected Fluid Specific Heat Capacity 148
Overall Reservoir Conductivity 149
Overall Reservoir Specific Heat Capacity 150
Overall Reservoir Density 151
Top and Bottom Surroundings Conductivity 152
Top and Bottom Surroundings Specific Heat Capacity 153
Top and Bottom Surroundings Density 154
Reservoir Thermal Expansion 155
Biot's Constant 156
Poisson's Ratio 157
Reservoir Young's Modulus 158
Injected Fluid Temperature 159
Mean Historical Injection Rate 160

Indexes Relating to the SkinAide Model (In Situ Geometry Entered)

Reservoir Thickness (Normal to Bedding Plane) 93


Completed Interval (Along Wellbore) 94
Distance to Top of completion (Along Wellbore) 95
Drainage Area 96
Dietz Shape Factor 97
Hole Diameter 98
Deviation 99
Horizontal Permeability 100
Vertical Permeability 101
Vertical Permeability for Geometrical Skin 102
Porosity 103
Turbulence Coefficient 104
Permeability Exponent 105
Porosity Exponent 106

© 1990-2018 Petroleum Experts Limited


299 OpenServer

Damage Zone Thickness 107


Damage Zone Permeability 108
Damage Zone Porosity 109
External Casing Diameter 110
Casing Weight 111
Crushed Zone Thickness 112
Crushed Zone Permeability 113
Crushed Zone Porosity 114
Crushed and Damage Zone Permeability 115
Crushed and Damage Zone Porosity 116
Perforation Efficiency 117
Shot Density 118
Gun Phasing 119
Angle between Vertical Plane and Perforations 120
Tunnel Length 121
Tunnel Diameter 122
Cavity Entrance Diameter 123
Cavity Tip Diameter 124

Indexes Relating to the SkinAide Model, API Test Data editions 4 and 5

Perforation Efficiency 125


Shot Density 126
Gun Phasing 127
Angle Between Vertical Plane and Perforations 128
API RP43/2T Total Penetration of Perforations 129
API RP43/1 Entrly Hole Diameter of Perforations 130
Gun Diameter 131
Reservoir Uniaxial Compressive Strength 132
Rock Density 133
Casing Elastic Limit 134
Reservoir Strength 135

6.7.2 INF - Inflow Sensitivity Calculations


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.INF.DONE Calculation Done Flag


PROSPER.ANL.INF.WC Water Cut (oil wells)

OpenServer User's Manual


PROSPER and OpenServer 300

PROSPER.ANL.INF.WGR WGR (gas/condensate wells)


PROSPER.ANL.INF.GOR Total GOR (gas/condensate
wells)
PROSPER.ANL.INF.CGR CGR (gas/condensate wells)
PROSPER.ANL.INF.RATEMETHOD Rate Method:
0 - Automatic linear
1 - User specified
2 - Automatic geometric

i = 0:49
PROSPER.ANL.INF.RATES.COUNT Retrieve the number of IPR rates
PROSPER.ANL.INF.RATES[i] Set user defined rate value

PROSPER.ANL.INF.SENS.GEN.FIRST Generate Rates First Value


PROSPER.ANL.INF.SENS.GEN.LAST Generate Rates Last Value
PROSPER.ANL.INF.SENS.GEN.NUMBER Generate Rates Number of
Values (1 to 50)
PROSPER.ANL.INF.SENS.GEN.METHOD Generate Rates Spacing Type
0 = Linear Spacing
1 = Geometric Spacing
2 = Step
3 = Simple Percent
4 = Compound Percent

i = 0:9 Sensitivity variable index


j Sensitivity parameter index
k = 0:9 Sensitivity variable value index
PROSPER.ANL.INF.Sens.SensDB.Vars[i], j Selects the sensitivity parameter,
e.g. j = 6 corresponds to water-
cut.
NOTE: Use Ctrl + Right-Click to
extract the model specific j-index
type value
PROSPER.ANL.INF.Sens.SensDB.Sens[j].Vals[k] Sets the sensitivity value for jth
sensitivity parameter
PROSPER.ANL.INF.Sens.SensDB.Sens[j].Vals.Cou Returns the number of sensitivity
nt values input for jth sensitivity
parameter

PROSPER.ANL.INF.Sens.SensDB.Sens[j].Gen.First Generate Values First Value


PROSPER.ANL.INF.Sens.SensDB.Sens[j].Gen.Last Generate Values Last Value

© 1990-2018 Petroleum Experts Limited


301 OpenServer

PROSPER.ANL.INF.Sens.SensDB.Sens[j].Gen.Num Generate Values Number of


ber Values
PROSPER.ANL.INF.Sens.SensDB.Sens[j].Gen.Meth Generate Values Spacing Type
od

PROSPER.ANL.INF.Sens.SensDB.Rates[k] Sets the rate value for case k


PROSPER.ANL.INF.Sens.SensDB.Comb[i], j Sets the sensitivity variable type
in the combinations mode
PROSPER.ANL.INF.Sens.SensDB.Sens[j].Comb[k] Sets the sensitivity value for case
k
PROSPER.ANL.INF.Sens.SensDB.Sens[j].Comb.Co Counts the number of sensitivity
unt cases

PROSPER.ANL.INF.Sens.SensDB.Clear Clears all sensitivity values. If


Combinations sensitivity is
selected, it will be reset to
Variables

6.7.3 SYS - System Sensitivity Calculations


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.SYS.DONE Calculation Done Flag


PROSPER.ANL.SYS.PRES First Node Pressure
PROSPER.ANL.SYS.WC Water Cut (oil wells)
PROSPER.ANL.SYS.WGR WGR (gas/condensate wells)
PROSPER.ANL.SYS.GOR Total GOR (oil wells)
PROSPER.ANL.SYS.CGR CGR (gas/condensate wells)

i = 0:23
PROSPER.ANL.SYS.PIPE, i Defines pipeline correlation by its
index. Please refer to Sensitivity
Variables and Indexes for the list
of indexes.
PROSPER.ANL.SYS.PipeLabel, "Name" Defines pipeline correlation by its
name (label). Please refer to
Sensitivity Variables and Indexes
for the list of names.
PROSPER.ANL.SYS.TUBING, i Defines tubing correlation by its
index. Please refer to Sensitivity
Variables and Indexes for the list

OpenServer User's Manual


PROSPER and OpenServer 302

of indexes.
PROSPER.ANL.SYS.TubingLabel, "Name" Defines tubing correlation by its
name (label). Please refer to
Sensitivity Variables and Indexes
for the list of names.

PROSPER.ANL.SYS.SOLUTIONNODE Solution Node:


1 - Bottom node
2 - Top node
3 - Wellhead
PROSPER.ANL.SYS.RATEMETHOD Rate Method:
0 - Automatic linear
1 - User specified
2 - Automatic geometric

i = 0:19
PROSPER.ANL.SYS.RATES.COUNT Retrieve the number of rate values
PROSPER.ANL.SYS.RATES[i] Set user defined rate value

PROSPER.ANL.SYS.SENS.GEN.FIRST Generate Rates First Value


PROSPER.ANL.SYS.SENS.GEN.LAST Generate Rates Last Value
PROSPER.ANL.SYS.SENS.GEN.NUMBER Generate Rates Number of
Values (1 to 50)
PROSPER.ANL.SYS.SENS.GEN.METHOD Generate Rates Spacing Type
0 = Linear Spacing
1 = Geometric Spacing
2 = Step
3 = Simple Percent
4 = Compound Percent

PROSPER.ANL.SYS.ILHAND Left-hand Intersection:


0 = DisAllow
1 = Force

i = 0:9 Sensitivity variable index


j Sensitivity parameter index
k = 0:9 Sensitivity variable value index
PROSPER.ANL.SYS.Sens.SensDB.Vars[i], j Selects the sensitivity parameter,
e.g. j = 6 corresponds to water-
cut.
NOTE: Use Ctrl + Right-Click to
extract the model specific j-index
type value

© 1990-2018 Petroleum Experts Limited


303 OpenServer

PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Vals[k] Sets the numerical value for jth


sensitivity parameter
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Vals.Co Returns the number of sensitivity
unt values input for jth sensitivity
parameter

PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Gen.Firs Generate Values First Value


t
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Gen.Las Generate Values Last Value
t
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Gen.Nu Generate Values Number of
mber Values
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Gen.Met Generate Values Spacing Type
hod

PROSPER.ANL.SYS.Sens.SensDB.Rates[k] Sets the rate value for case k


PROSPER.ANL.SYS.Sens.SensDB.Comb[i], j Sets the sensitivity variable type in
the combinations mode
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Comb[k] Sets the sensitivity value for case
k
PROSPER.ANL.SYS.Sens.SensDB.Sens[j].Comb.C Counts the number of sensitivity
ount cases

PROSPER.ANL.SYS.Sens.SensDB.Clear Clears all sensitivity values. If


Combinations sensitivity is
selected, it will be reset to
Variables

6.7.4 GRD - Gradient Sensitivity Calculations


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.GRD.DONE Calculation Done Flag


PROSPER.ANL.GRD.Pres First Node Pressure
PROSPER.ANL.GRD.WC Water Cut (oil wells)
PROSPER.ANL.GRD.WGR WGR (gas/condensate wells)
PROSPER.ANL.GRD.GOR Total GOR (oil wells)
PROSPER.ANL.GRD.CGR CGR (gas/condensate wells)
PROSPER.ANL.GRD.Rate Rate
PROSPER.ANL.GRD.RATETYPE Rate Type:
0 = Liquid rates

OpenServer User's Manual


PROSPER and OpenServer 304

1 = Oil rates
2 = Gas Rate
3 = Hydrocarbon Mass flow rate
PROSPER.ANL.GRD.FIRSTNODE First Node
PROSPER.ANL.GRD.LASTNODE Last Node

i = 0:23
PROSPER.ANL.GRD.PIPE, i Defines pipeline correlation by its
index. Please refer to Sensitivity
Variables and Indexes for the list of
indexes.
PROSPER.ANL.GRD.PipeLabel, "Name" Defines pipeline correlation by its
name (label). Please refer to
Sensitivity Variables and Indexes for
the list of names.
PROSPER.ANL.GRD.TUBING, i Defines tubing correlation by its
index. Please refer to Sensitivity
Variables and Indexes for the list of
indexes.
PROSPER.ANL.GRD.TubingLabel, "Name" Defines tubing correlation by its
name (label). Please refer to
Sensitivity Variables and Indexes for
the list of names.

PROSPER.ANL.GRD.Barnea Barnea Criteria: 0 = No; 1 = Yes


PROSPER.ANL.GRD.SLUG Slug Method
0 = Brill
1 = RCS mechanistic
2 = Worst Case

i = 0:2 Sensitivity variable index


j Sensitivity parameter index
k = 0:9 Sensitivity variable value index
PROSPER.ANL.GRD.Sens.SensDB.Vars[i], j Selects the sensitivity parameter,
e.g. j = 6 corresponds to water-cut.
NOTE: Use Ctrl + Right-Click to
extract the model specific j-index
type value
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Vals[ Sets the numerical value for jth
k] sensitivity parameter
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Vals. Returns the number of sensitivity
Count values input for jth sensitivity
parameter

© 1990-2018 Petroleum Experts Limited


305 OpenServer

PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Gen. Generate Values First Value


First
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Gen. Generate Values Last Value
Last
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Gen. Generate Values Number of Values
Number
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Gen. Generate Values Spacing Type
Method

PROSPER.ANL.GRD.Sens.SensDB.Rates[k] Sets the rate value for case k


PROSPER.ANL.GRD.Sens.SensDB.Comb[i], j Sets the sensitivity variable type in
the combinations mode
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Com Sets the sensitivity value for case k
b[k]
PROSPER.ANL.GRD.Sens.SensDB.Sens[j].Com Counts the number of sensitivity
b.Count cases

PROSPER.ANL.GRD.Sens.SensDB.Clear Clears all sensitivity values. If


Combinations sensitivity is selected,
it will be reset to Variables

6.7.5 VLP - VLP Sensitivity Calculations


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.VLP.DONE Calculation Done Flag


PROSPER.ANL.VLP.Pres First Node Pressure
PROSPER.ANL.VLP.WC Water Cut (oil wells)
PROSPER.ANL.VLP.WGR WGR (gas/condensate wells)
PROSPER.ANL.VLP.GOR Total GOR (oil wells)
PROSPER.ANL.VLP.CGR CGR (gas/condensate wells)

i = 0:23
PROSPER.ANL.VLP.PIPE, i Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.VLP.PipeLabel, "Name" Defines pipeline correlation by its name
(label). Please refer to Sensitivity
Variables and Indexes for the list of
names.

OpenServer User's Manual


PROSPER and OpenServer 306

PROSPER.ANL.VLP.TUBING, i Defines tubing correlation by its index.


Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.VLP.TubingLabel, "Name" Defines tubing correlation by its name
(label). Please refer to Sensitivity
Variables and Indexes for the list of
names.

PROSPER.ANL.VLP.RATEMETHOD Rate Method:


0 - Automatic linear
1 - User specified
2 - Automatic geometric

i = 0:50
PROSPER.ANL.VLP.RATES.COUNT Retrieve the number of rate values
PROSPER.ANL.VLP.RATES[i] Set user defined rate value

PROSPER.ANL.VLP.SENS.GEN.FIRST Generate Rates First Value


PROSPER.ANL.VLP.SENS.GEN.LAST Generate Rates Last Value
PROSPER.ANL.VLP.SENS.GEN.NUMBER Generate Rates Number of Values (1 to
50)
PROSPER.ANL.VLP.SENS.GEN.METHOD Generate Rates Spacing Type
0 = Linear Spacing
1 = Geometric Spacing
2 = Step
3 = Simple Percent
4 = Compound Percent

PROSPER.ANL.VLP.FIRSTNODE First Node


PROSPER.ANL.VLP.LASTNODE Last Node

i = 0:9 Sensitivity variable index


j Sensitivity parameter index
k = 0:9 Sensitivity variable value index
PROSPER.ANL.VLP.Sens.SensDB.Vars[i], Selects the sensitivity parameter, e.g. j =
j 6 corresponds to water-cut.
NOTE: Use Ctrl + Right-Click to extract
the model specific j-index type value
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Sets the numerical value for jth sensitivity
Vals[k] parameter
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Returns the number of sensitivity values

© 1990-2018 Petroleum Experts Limited


307 OpenServer

Vals.Count input for jth sensitivity parameter

PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Generate Values First Value


Gen.First
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Generate Values Last Value
Gen.Last
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Generate Values Number of Values
Gen.Number
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Generate Values Spacing Type
Gen.Method

PROSPER.ANL.VLP.Sens.SensDB.Rates[k Sets the rate value for case k


]
PROSPER.ANL.VLP.Sens.SensDB.Comb[i] Sets the sensitivity variable type in the
,j combinations mode
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Sets the sensitivity value for case k
Comb[k]
PROSPER.ANL.VLP.Sens.SensDB.Sens[j]. Counts the number of sensitivity cases
Comb.Count

PROSPER.ANL.VLP.Sens.SensDB.Clear Clears all sensitivity values. If


Combinations sensitivity is selected, it will
be reset to Variables

6.7.6 CHK - Choke Performance


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.CHK.DONE Calculation Done Flag


PROSPER.ANL.CHK.Method, i Calculation Options:
0 = Predict mass flowrate
1 = Predict pressure drop
2 = Predict choke setting
PROSPER.ANL.CHK.Choke, i Choke Model:
0 = Petroleum Experts
1 = HYDRO - short frozen flow
2 = HYDRO - long frozen flow
4 = ELF (recommended)

Input Data
PROSPER.ANL.CHK.DATA[16] Total GOR

OpenServer User's Manual


PROSPER and OpenServer 308

PROSPER.ANL.CHK.Data[18] Condensate Gas Ratio


PROSPER.ANL.CHK.DATA[17] Water Cut
PROSPER.ANL.CHK.DATA[19] Water Gas Ratio
PROSPER.ANL.CHK.DATA[20] Separator GOR
PROSPER.ANL.CHK.DATA[0] Inlet Pressure
PROSPER.ANL.CHK.DATA[1] Inlet Temperature
PROSPER.ANL.CHK.DATA[2] Outlet Pressure
PROSPER.ANL.CHK.DATA[4] Choke Setting

Calculated Data
PROSPER.ANL.CHK.DATA[5] Liquid Rate
PROSPER.ANL.CHK.DATA[6] Gas Rate
PROSPER.ANL.CHK.DATA[21] Mass Flowrate
PROSPER.ANL.CHK.DATA[3] Outlet Temperature
PROSPER.ANL.CHK.DATA[22] Critical Pressure
PROSPER.ANL.CHK.DATA[23] Critical Rate
PROSPER.ANL.CHK.Data[24] Critical Temperature

HYDRO Choke Model Data


PROSPER.ANL.CHK.DATA[7] Inlet Diameter
PROSPER.ANL.CHK.DATA[8] Outlet Diameter
PROSPER.ANL.CHK.DATA[9] Contraction Coefficient (Cd)
PROSPER.ANL.CHK.DATA[10] Max Throttling Coefficient (Ct)
PROSPER.ANL.CHK.DATA[11] Max Flow Coefficient (Cv) (Water Only)
PROSPER.ANL.CHK.DATA[12] Hydrostatic Height From 1 To 2
PROSPER.ANL.CHK.DATA[13] Hydrostatic Height From 3 To 2
PROSPER.ANL.CHK.DATA[14] Stem Travel
PROSPER.ANL.CHK.DATA[15] Slip Factor At 2

6.7.7 QLG - QuickLook – GasLift


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.QLG.DONE Calculation Done Flag

Surface Measurements
i = 0:6
j = 0:1

© 1990-2018 Petroleum Experts Limited


309 OpenServer

PROSPER.ANL.QLG.SURFACE[i][j] Input data format


i - input data index (see below)
j - Minimum/Maximum index:
0 = Minimum
1 = Maximum
PROSPER.ANL.QLG.SURFACE[0][j] Tubing Head Pressure
PROSPER.ANL.QLG.SURFACE[1][j] Tubing Head Temperature
PROSPER.ANL.QLG.SURFACE[2][j] Liquid Rate
PROSPER.ANL.QLG.SURFACE[3][j] Water Cut
PROSPER.ANL.QLG.SURFACE[4][j] Total Gas Rate
PROSPER.ANL.QLG.SURFACE[5][j] Injected Gas Rate
PROSPER.ANL.QLG.SURFACE[6][j] Casing Head Pressure

Input Data
PROSPER.ANL.QLG.GASLIFT[0] Orifice Diameter
PROSPER.ANL.QLG.GASLIFT[1] Gas Injection Depth

i = 0:23
PROSPER.ANL.QLG.Tubing, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.QLG.TubingLable, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.QLG.Dome Dome Pressure Correction flag
0 = No
1 = Yes

Flowing Measurements
i = 0:19
j = 0:2
PROSPER.ANL.QLG.FLOWING.COUNT Number of Flowing Measurements
PROSPER.ANL.QLG.FLOWING[i][0] Measured Depth
PROSPER.ANL.QLG.FLOWING[i][1] Minimum Pressure
PROSPER.ANL.QLG.FLOWING[i][2] Maximum Pressure

Static Measurements
i = 0:19
j = 0:1
PROSPER.ANL.QLG.STATIC.COUNT Number of Static Measurements
PROSPER.ANL.QLG.STATIC[i][0] Measured Depth

OpenServer User's Manual


PROSPER and OpenServer 310

PROSPER.ANL.QLG.STATIC[i][1] Static Pressure

Valve Details
i = 0:29
PROSPER.ANL.QLG.MAND.COUNT Number of Mandrels
PROSPER.ANL.QLG.MAND[i].TYPE Valve Type
PROSPER.ANL.QLG.MAND[i].DEPTH Measured Depth
PROSPER.ANL.QLG.MAND[i].PORT Port Size
PROSPER.ANL.QLG.MAND[i].RVAL R Value
PROSPER.ANL.QLG.MAND[i].DOME Dome Pressure

6.7.8 QLE - QuickLook – ESP


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.QLE.DONE Calculation Done Flag

Input Data
PROSPER.ANL.QLE.QUICK[0] Tubing head pressure
PROSPER.ANL.QLE.QUICK[1] Liquid rate
PROSPER.ANL.QLE.QUICK[2] Water cut
PROSPER.ANL.QLE.QUICK[3] GOR
PROSPER.ANL.QLE.QUICK[4] Static Bottom Hole Pressure
PROSPER.ANL.QLE.QUICK[5] Pump Depth
PROSPER.ANL.QLE.QUICK[6] Operating Frequency
PROSPER.ANL.QLE.QUICK[7] Length Of Cable
PROSPER.ANL.QLE.QUICK[8] Gas Separation Efficiency
PROSPER.ANL.QLE.QUICK[9] Number Of Stages
PROSPER.ANL.QLE.QUICK[10] Pump Wear Factor
PROSPER.ANL.QLE.EMULSION Emulsion Flag

Surface Data
PROSPER.ANL.QLE.SURF[0] Current
PROSPER.ANL.QLE.SURF[1] Surface Voltage
PROSPER.ANL.QLE.SURF[2] Power

Downhole Data
i = 0:19

© 1990-2018 Petroleum Experts Limited


311 OpenServer

PROSPER.ANL.QLE.DOWN.COUNT Number of Downhole Data Points


PROSPER.ANL.QLE.Down[i][0] Measured Depth
PROSPER.ANL.QLE.Down[i][1] Pressure

Correlation
i = 0:23
PROSPER.ANL.QLE.Tubing, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.QLE.TubingLable, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.

6.7.9 QLH - QuickLook – HSP


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.QLH.DONE Calculation Done Flag

Input Data
PROSPER.ANL.QLH.QUICK[0] Tubing Head Pressure
PROSPER.ANL.QLH.QUICK[1] Liquid Rate
PROSPER.ANL.QLH.QUICK[2] Water Cut
PROSPER.ANL.QLH.QUICK[3] Produced GOR
PROSPER.ANL.QLH.QUICK[4] Static Bottom Hole Pressure
PROSPER.ANL.QLH.QUICK[5] Pump Depth
PROSPER.ANL.QLH.QUICK[6] Pump Speed
PROSPER.ANL.QLH.QUICK[7] % Power Fluid Of Reservoir Fluid
PROSPER.ANL.QLH.QUICK[8] Pump Stages
PROSPER.ANL.QLH.QUICK[9] Pump Wear Factor
PROSPER.ANL.QLH.QUICK[10] Turbine Stages
PROSPER.ANL.QLH.EMULSION Emulsion Flag

Downhole Data
i = 0:19
PROSPER.ANL.QLH.DOWN.COUNT Number of Downhole Data Points
PROSPER.ANL.QLH.DOWN[i][0] Measured Depth
PROSPER.ANL.QLH.DOWN[i][1] Pressure

OpenServer User's Manual


PROSPER and OpenServer 312

Correlation
i = 0:23
PROSPER.ANL.QLH.Tubing, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.QLE.TubingLable, "name" Defines tubing correlation by its name
(label). Please refer to Sensitivity
Variables and Indexes for the list of
names.

6.7.10 TCC - Tubing Correlation Comparison


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.TCC.DONE Calculation Done Flag


PROSPER.ANL.TCC.PRES First Node Pressure
PROSPER.ANL.TCC.TEMP Inlet fluid temperature
PROSPER.ANL.TCC.WC Water Cut
PROSPER.ANL.TCC.WGR WGR
PROSPER.ANL.TCC.GOR GOR
PROSPER.ANL.TCC.GORFREE Free GOR
PROSPER.ANL.TCC.CGR CGR
PROSPER.ANL.TCC.RATE Rate
PROSPER.ANL.TCC.RateType Rate type
0 = Liquid rates
1 = Oil rates
PROSPER.ANL.TCC.PIPE Pipeline Correlation
PROSPER.ANL.TCC.Barnea Barnea Criteria: 0 = No; 1 = Yes
PROSPER.ANL.TCC.SLUG Slug Method
0 = Brill
1 = RCS mechanistic
2 = Worst Case

GasLIft Wells
PROSPER.ANL.TCC.GLRate GasLIft Gas Injection Rate
PROSPER.ANL.TCC.GLDepth GasLift Injection Depth

i = 0:9
PROSPER.ANL.TCC.Comp[i].Msd Measured Depth
PROSPER.ANL.TCC.Comp[i].Prs Measured Pressure

© 1990-2018 Petroleum Experts Limited


313 OpenServer

PROSPER.ANL.TCC.COMP.COUNT Number of Comparison Points. This refers to


the number of available points in the list of
Pressure vs Depth. A DoGet() command will
return the number 10.

i = 0:23
PROSPER.ANL.TCC.CORR[i], 1 Tubing correlation selection using the
correlation Index [i]:
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.TCC.CorrLabel[{name}], Tubing correlation selection using the
1 correlation {name}.
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.TCC.CORR.COUNT Number of Tubing Correlations. Will return the
total number of correlations if a DoGet()
function is performed.

6.7.11 PCC - Pipeline Correlation Comparison


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.PCC.DONE Comparison Done Flag


PROSPER.ANL.PCC.PRES Manifold pressure
PROSPER.ANL.PCC.WC Water cut
PROSPER.ANL.PCC.WGR WGR
PROSPER.ANL.PCC.GOR Total GOR
PROSPER.ANL.PCC.GORFREE GOR free
PROSPER.ANL.PCC.CGR CGR
PROSPER.ANL.PCC.RATE Rate
PROSPER.ANL.PCC.GLRATE Gas lift gas rate
PROSPER.ANL.PCC.RateType Rate type:
0 = Liquid rates
1 = Oil rates

GasLift Wells
PROSPER.ANL.PCC.GLRate GasLIft Gas Injection Rate

OpenServer User's Manual


PROSPER and OpenServer 314

i= 0:9
PROSPER.ANL.PCC.Comp[i].Node Node along the pipeline (according to surface
equipment)
PROSPER.ANL.PCC.Comp[0].Prs Measured Pressure
PROSPER.ANL.PCC.COMP.COUNT Number of Comparison Points. This refers to
the number of available points in the list of
Pressure vs Depth. A DoGet() command will
return the number 10.

i= 0:23
PROSPER.ANL.PCC.CORR[i], 1 Tubing correlation selection using the
correlation Index [i]:
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.PCC.CorrLabel[{name}], Tubing correlation selection using the
1 correlation {name}.
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.TCC.CORR.COUNT Number of Tubing Correlations. Will return the
total number of correlations if a DoGet()
function is performed.

6.7.12 GMT - Gradient Matching


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.GMT.DONE Calculation Done Flag


PROSPER.ANL.GMT.PRES Wellhead pressure
PROSPER.ANL.GMT.WC Water cut
PROSPER.ANL.GMT.WGR Water Gas Ratio
PROSPER.ANL.GMT.GOR GOR
PROSPER.ANL.GMT.GORFREE GOR free
PROSPER.ANL.GMT.CGR CGR
PROSPER.ANL.GMT.GLRate Injected Gas Lift Gas Rate (GL wells)
PROSPER.ANL.GMT.GLDepth Gas Lift Injection Depth (GL wells)
PROSPER.ANL.GMT.Rate Liquid rate

© 1990-2018 Petroleum Experts Limited


315 OpenServer

PROSPER.ANL.GMT.RateType Rate type


0 = Liquid rates
1 = Oil rates
PROSPER.ANL.GMT.Barnea Barnea Criteria: 0 = No; 1 = Yes
PROSPER.ANL.GMT.Slug Slug Method
0 = Brill
1 = RCS mechanistic
2 = Worst Case

i = 0:9
PROSPER.ANL.GMT.Match[i].Msd Match data depth (MD)
PROSPER.ANL.GMT.Match[i].Prs Match data pressure
PROSPERR.ANL.GMT.MATCH.COUNT Number of Comparison Points. This refers to
the number of available points in the list of
Pressure vs Depth. A DoGet() command will
return the number 10.

i = 0:23
PROSPER.ANL.GMT.Corr[i], 1 Tubing correlation selection using the
correlation Index [i]:
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.GMT.CorrLabel[{name}], Tubing correlation selection using the
1 correlation {name}.
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.GMT.CORR.COUNT Number of Tubing Correlations. Will return the
total number of correlations if a DoGet()
function is performed.

6.7.13 VMT - VLP Matching


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.VMT.DONE Match done flag


PROSPER.ANL.VMT.RATETYPE Rate type
0 = Liquid rate
1 = Oil rate

OpenServer User's Manual


PROSPER and OpenServer 316

i = 0:999
PROSPER.ANL.VMT.DATA.COUNT Returns the number of well test Data (Match)
Points
PROSPER.ANL.VMT.DATA[i].ENABLE Enable test data:
1 = Disable
0 = Enable
PROSPER.ANL.VMT.Data[i].Date Test point date
PROSPER.ANL.VMT.DATA[i].DATEST Returns the date as a date string
RING
PROSPER.ANL.VMT.Data[i].Label Test point comment
PROSPER.ANL.VMT.DATA[i].THPRES Tubing Head Pressure
PROSPER.ANL.VMT.DATA[i].THTEMP Tubing Head Temperature
PROSPER.ANL.VMT.DATA[i].WC Water Cut
PROSPER.ANL.VMT.Data[i].Rate Gas rate
PROSPER.ANL.VMT.DATA[i].GDEPTH Gauge depth
PROSPER.ANL.VMT.DATA[i].GPRES Gauge pressure
PROSPER.ANL.VMT.Data[0].Pres Reservoir pressure
PROSPER.ANL.VMT.DATA[i].GOR GOR
PROSPER.ANL.VMT.DATA[i].GORFRE Free GOR
E
PROSPER.ANL.VMT.DATA[i].WGR Water gas ratio
PROSPER.ANL.VMT.DATA[i].CGR Condensate gas ratio
PROSPER.ANL.VMT.DATA[i].SGOR Separator GOR

Gas Lift
PROSPER.ANL.VMT.Data[i].Irate Gas lift gas rate
PROSPER.ANL.VMT.Data[i].Idepth Injection depth - measured

ESP
PROSPER.ANL.VMT.Data[i].Freq Operating frequency
PROSPER.ANL.VMT.Data[i].Wear Pump wear factor

i = 0:23
PROSPER.ANL.VMT.Corr[i], 1 Tubing correlation selection using the
correlation Index [i]:
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of indexes.

© 1990-2018 Petroleum Experts Limited


317 OpenServer

PROSPER.ANL.VMT.CorrLabel[{name}] Tubing correlation selection using the


,1 correlation {name}.
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.VMT.CORR.COUNT Returns the number of Tubing Correlations
PROSPER.ANL.VMT.AdjTubeLabel Returns the pressure drop model in the ‘Adjust
IPR’ calculation

6.7.14 PMT - PipeLine Matching


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.PMT.DONE Match Done Flag


PROSPER.ANL.PMT.RateType Rate Type
0 = Liquid rates
1 = Oil rates

i = 0:999
PROSPER.ANL.PMT.DATA.COUNT Number of Data (Match) Points
PROSPER.ANL.PMT.DATA[i].ENABLE Enable test data:
0 = Disable
1 = Enable
PROSPER.ANL.PMT.Data[i].Date Match point date
PROSPER.ANL.PMT.Data[i].Label Match point comment
PROSPER.ANL.PMT.Data[i].THpres Manifold pressure
PROSPER.ANL.PMT.Data[i].WC Water cut
PROSPER.ANL.PMT.Data[i].WGR WGR
PROSPER.ANL.PMT.Data[i].Rate Liquid rate
PROSPER.ANL.PMT.Data[i].Gpres Tubing head match pressure
PROSPER.ANL.PMT.Data[i].GOR GOR
PROSPER.ANL.PMT.Data[i].GORfree GOR free
PROSPER.ANL.PMT.Data[i].CGR Condensate gas ratio
PROSPER.ANL.PMT.Data[i].SGOR Separator GOR

GasLift Wells
PROSPER.ANL.PMT.Data[i].Irate GasLift Gas Injection Rate

i = 0:23

OpenServer User's Manual


PROSPER and OpenServer 318

PROSPER.ANL.PMT.Corr[i], 1 Pipeline correlation selection using the


correlation Index [i]:
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.PMT.CorrLable[{name}], 1 Pipeline correlation selection using the
correlation {name}.
0 = Deselect
1 = Select
Please refer to Sensitivity Variables and
Indexes for the list of names.
PROSPER.ANL.VMT.CORR.COUNT Returns the number of Pipeline Correlations

6.7.15 GEN - Generate For GAP


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.GEN.DONE Calculation Done Flag


PROSPER.ANL.GEN.PRES First Node Pressure
PROSPER.ANL.GEN.WC Water Cut
PROSPER.ANL.GEN.WGR Water Gas Ratio
PROSPER.ANL.GEN.TOTALGOR Total GOR
PROSPER.ANL.GEN.CGR Condensate Gas Ratio
PROSPER.ANL.GEN.SGOR Separator GOR
PROSPER.ANL.GEN.RATEMETHOD Rate Type:
0 = Automatic linear
1 = Automatic geometric

i = 0:23
PROSPER.ANL.GEN.PIPE, i Defines pipeline correlation by its
index. Please refer to Sensitivity
Variables and Indexes for the list of
indexes.
PROSPER.ANL.GEN.PipeLable, "name" Defines pipeline correlation by its
name (label). Please refer to Sensitivity
Variables and Indexes for the list of
names.
PROSPER.ANL.GEN.TUBING, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables
and Indexes for the list of indexes.
PROSPER.ANL.GEN.TubingLable, "name" Defines tubing correlation by its name

© 1990-2018 Petroleum Experts Limited


319 OpenServer

(label). Please refer to Sensitivity


Variables and Indexes for the list of
names.

i = 0:9
PROSPER.ANL.GEN.MANPRES.COUNT Number of Manifold Pressures
PROSPER.ANL.GEN.MANPRES[i] Manifold Pressures

6.7.16 WHP - BHP from WHP


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.WHP.DONE Calculation Done Flag

i = 0:23
PROSPER.ANL.WHP.Tubing, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.WHP.TubingLable, Defines tubing correlation by its name.
"name" Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.WHP.Pipe, i Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.WHP.PipeLable, "name" Defines pipeline correlation by its name.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.WHP.FNode First node:
0 = Wellhead
1 = Manifold
PROSPER.ANL.WHP.Rate Rate Type:
0 = Liquid Rate
1 = Oil Rate
PROSPER.ANL.WHP.GFlag Gas Fraction:
0 = Gas Oil Ratio
1 = Gas Rate
PROSPER.ANL.WHP.WFlag Water Farction:
0 = Water Cut
1 = Water Rate

i = 0:499
PROSPER.ANL.WHP.DATA.COUNT Number of Records

OpenServer User's Manual


PROSPER and OpenServer 320

PROSPER.ANL.WHP.DATA[i].ENABLE Enable Flag:


0 = Disable
1 = Enable
PROSPER.ANL.WHP.DATA[i].SEL Selected Flag
PROSPER.ANL.WHP.DATA[i].TIME Time

PROSPER.ANL.WHP.DATA[i].RATE Rate (Liquid/Oil/Gas)


PROSPER.ANL.WHP.DATA[i].WHP WellHead Pressure
PROSPER.ANL.WHP.DATA[i].WHT WellHead Temperature
PROSPER.ANL.WHP.DATA[i].GASF Gas Fraction
GOR / Gas Rate
CGR / Oil Rate
Separator GOR / Oil Rate
PROSPER.ANL.WHP.DATA[i].WATF Water Fraction
Water Cut / Water Rate
WGR / Water Rate
WGR / Water Rate
PROSPER.ANL.WHP.DATA[i].BHP Bottom Hole Flowing Pressure
PROSPER.ANL.WHP.DATA[i].HTC Heat Transfer Coefficient

GasLift Wells
PROSPER.ANL.WHP.DATA[i].GLIFT Injected Gaslift Gas rate

ESP Wells
PROSPER.ANL.WHP.DATA[i].Freq Pump Frequency

6.7.17 GDT - Gradient Test Data


The following commands are valid for both DoSet and DoGet functions:

PROSPER.ANL.GDT.PLOT Plot Lables Flag: 0 = No; 1 = Yes

i = 0:19
PROSPER.ANL.GDT.DATA.COUNT Number of Test Points
PROSPER.ANL.GDT.DATA[i].TVD True Vertical Depth
PROSPER.ANL.GDT.DATA[i].MD Measured Depth
PROSPER.ANL.GDT.DATA[i].PRES Pressure
PROSPER.ANL.GDT.DATA[i].TEMP Temperature

© 1990-2018 Petroleum Experts Limited


321 OpenServer

6.7.18 PLD - Plot Details

PROSPER.ANL.PLD.DET.COUNT Number of Plot Detail Records

i = 0:COUNT-1
PROSPER.ANL.PLD.DET[i].USED Used Flag
PROSPER.ANL.PLD.DET[i].TITLE Graph Title
PROSPER.ANL.PLD.DET[i].XAXIS X axis Label
PROSPER.ANL.PLD.DET[i].YAXIS Y axis Label
PROSPER.ANL.PLD.DET[i].XMIN Minimum X Value
PROSPER.ANL.PLD.DET[i].XMAX Maximum X Value
PROSPER.ANL.PLD.DET[i].XSTEP X axis Step Value
PROSPER.ANL.PLD.DET[i].YMIN Minimum Y Value
PROSPER.ANL.PLD.DET[i].YMAX Maximum Y Value
PROSPER.ANL.PLD.DET[i].YSTEP Y axis Step Value
PROSPER.ANL.PLD.DET[i].TMIN Minimum X Value (2nd X Axis)
PROSPER.ANL.PLD.DET[i].TMAX Maximum X Value (2nd X
Axis)
PROSPER.ANL.PLD.DET[i].TSTEP X axis Step Value (2nd X Axis)
PROSPER.ANL.PLD.DET[i].XEXTENT X axis Extent
PROSPER.ANL.PLD.DET[i].YEXTENT Y axis EXtent
PROSPER.ANL.PLD.DET[i].XBLKS Number of X axis Grid Blocks
PROSPER.ANL.PLD.DET[i].YBLKS Number of Y axis Grid Blocks
PROSPER.ANL.PLD.DET[i].THICK Line Thickness
PROSPER.ANL.PLD.DET[i].METHOD Scaling Method
PROSPER.ANL.PLD.DET[i].SCALE Plot Scales Flag
PROSPER.ANL.PLD.DET[i].LABEL Plot Labels Flag
PROSPER.ANL.PLD.DET[i].GRID Plot Grid FLag
PROSPER.ANL.PLD.DET[i].STAMP Date Stamp Title Flag
PROSPER.ANL.PLD.DET[i].LEGEND Draw LEgendds Flag
PROSPER.ANL.PLD.DET[i].MOUSE Show Mouse Position Flag
PROSPER.ANL.PLD.DET[i].HORIZ.HEIGHT Horizontal Font Details
PROSPER.ANL.PLD.DET[i].HORIZ.WIDTH
PROSPER.ANL.PLD.DET[i].HORIZ.ESCAPEMENT
PROSPER.ANL.PLD.DET[i].HORIZ.ORIENTATION
PROSPER.ANL.PLD.DET[i].HORIZ.WEIGHT

OpenServer User's Manual


PROSPER and OpenServer 322

PROSPER.ANL.PLD.DET[i].HORIZ.ITALIC
PROSPER.ANL.PLD.DET[i].HORIZ.UNDERLINE
PROSPER.ANL.PLD.DET[i].HORIZ.STRIKEOUT
PROSPER.ANL.PLD.DET[i].HORIZ.CHARSET
PROSPER.ANL.PLD.DET[i].HORIZ.OUTPRECISION
PROSPER.ANL.PLD.DET[i].HORIZ.CLIPPRECISION
PROSPER.ANL.PLD.DET[i].HORIZ.QUALITY
PROSPER.ANL.PLD.DET[i].HORIZ.PITCHANDFAMILY
PROSPER.ANL.PLD.DET[i].HORIZ.FACENAME
PROSPER.ANL.PLD.DET[i].VERT.HEIGHT Vertical Font Details
PROSPER.ANL.PLD.DET[i].VERT.WIDTH
PROSPER.ANL.PLD.DET[i].VERT.ESCAPEMENT
PROSPER.ANL.PLD.DET[i].VERT.ORIENTATION
PROSPER.ANL.PLD.DET[i].VERT.WEIGHT
PROSPER.ANL.PLD.DET[i].VERT.ITALIC
PROSPER.ANL.PLD.DET[i].VERT.UNDERLINE
PROSPER.ANL.PLD.DET[i].VERT.STRIKEOUT
PROSPER.ANL.PLD.DET[i].VERT.CHARSET
PROSPER.ANL.PLD.DET[i].VERT.OUTPRECISION
PROSPER.ANL.PLD.DET[i].VERT.CLIPPRECISION
PROSPER.ANL.PLD.DET[i].VERT.QUALITY
PROSPER.ANL.PLD.DET[i].VERT.PITCHANDFAMILY
PROSPER.ANL.PLD.DET[i].VERT.FACENAME
PROSPER.ANL.PLD.DET[i].COLOR.COUNT Number of Colour Records

j = 0:COUNT-1
PROSPER.ANL.PLD.DET[i].COLOR[j].BAW Black And White Setting
PROSPER.ANL.PLD.DET[i].COLOR[j].GRY Grey Scale Setting
PROSPER.ANL.PLD.DET[i].COLOR[j].COL Colour Setting
PROSPER.ANL.PLD.DET[i].ANN.COUNT Number of Annotation Records

j = 0:COUNT-1
PROSPER.ANL.PLD.DET[i].ANN[j].TEXT Annotation Text
PROSPER.ANL.PLD.DET[i].ANN[j].RECT Bounding Rectangle
PROSPER.ANL.PLD.DET[i].ANN[j].SHOW Show Flag
PROSPER.ANL.PLD.DET[i].ANN[j].FILL Background Fill Flag
PROSPER.ANL.PLD.DET[i].ANN[j].VERTICAL Text alignment flag

© 1990-2018 Petroleum Experts Limited


323 OpenServer

PROSPER.ANL.PLD.DET[i].ANN[j].COLTEXT Text Colour


PROSPER.ANL.PLD.DET[i].ANN[j].COLFILL Background Colour
PROSPER.ANL.PLD.DET[i].ANN[j].COLBORDER Border Colour
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.HEIGHT Annotation Font Details
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.WIDTH
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.ESCAPEME
NT
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.ORIENTATIO
N
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.WEIGHT
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.ITALIC
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.UNDERLINE
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.STRIKEOUT
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.CHARSET
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.OUTPRECISI
ON
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.CLIPPRECIS
ION
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.QUALITY
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.PITCHANDF
AMILY
PROSPER.ANL.PLD.DET[i].ANN[j].FONT.FACENAME

6.7.19 COR - Flow Correlation Data

i = 0:23
PROSPER.ANL.COR.CORR.COUNT Number of Correlations
PROSPER.ANL.COR.CORR[i].DLL DLL Index
PROSPER.ANL.COR.CORR[i].NAME Correlations Name
PROSPER.ANL.COR.CORR[i].INDEX Correlations Index
PROSPER.ANL.COR.CORR[i].PIPE Valid for PipeLine
PROSPER.ANL.COR.CORR[i].TUBE Valid for Tubing
PROSPER.ANL.COR.CORR[i].OIL Valid for Oil
PROSPER.ANL.COR.CORR[i].GAS Valid for Gas
PROSPER.ANL.COR.CORR[i].CON Valid for Condensate
PROSPER.ANL.COR.CORR[i].SELTUBE Selected as Tubing Correlation
PROSPER.ANL.COR.CORR[i].SELPIPE Selected as Pipeline Correlation

OpenServer User's Manual


PROSPER and OpenServer 324

PROSPER.ANL.COR.CORR[i].COMP Selected for Tubing Comparison


PROSPER.ANL.COR.CORR[i].GMATCH Selected for Gradient Matching
PROSPER.ANL.COR.CORR[i].VMATCH Selected for VLP Matching
PROSPER.ANL.COR.CORR[i].PMATCH Selected for PipeLine Matching
PROSPER.ANL.COR.CORR[i].PCOMP Selected for PipeLine Comparison
PROSPER.ANL.COR.CORR[i].SDTUBE Tubing Matching Standard Deviation
PROSPER.ANL.COR.CORR[i].SDPIPE PipeLine Matching Standard Deviation
PROSPER.ANL.COR.CORR[i].THRTUBE Threshold Flag for tubing
PROSPER.ANL.COR.CORR[i].THRPIPE Threshold Flag for PipeLine

j = 0:1
PROSPER.ANL.COR.CORR[i].A[j] Matching Parameters for Tubing
PROSPER.ANL.COR.CORR[i].A[j] Matching Parameters for PipeLine

6.7.20 THR - Correlation Threshold Data

PROSPER.ANL.THR.USE Use Threshold Angle Flag


PROSPER.ANL.THR.TUBE Pipeline Correlation to use for tubing
PROSPER.ANL.THR.ANGT Angle Greater Than (From vertical)
PROSPER.ANL.THR.PIPE Tubing Correlation to use for Pipeline
PROSPER.ANL.THR.ANGP Angle Less Than (From Vertical)

6.8 Artificial Lift Design Input Data


The Artificial Lift Design Input data is accessed using the root name PROSPER.ANL and
is split up into several sections as listed below.

GLD GasLift Design (New)


GLD GasLift Design (Existing)
GLA GasLift Adjustments
ESP Electric Submersible Pump Design
HSP Hydraulic Submersible Pump Design
PCP Progressive Cavity Pump
JET Jet Pump Design
SRP Sucker Rod Pump Design

Each section will be accessed thus:

© 1990-2018 Petroleum Experts Limited


325 OpenServer

PROSPER.ANL.GLD
PROSPER.ANL.GLA
PROSPER.ANL.ESP
PROSPER.ANL.HSP
PROSPER.ANL.PCP
PROSPER.ANL.JET
PROSPER.ANL.SRP

6.8.1 GasLift Design

The following commands are valid for both DoSet and DoGet functions:

Gas Lift Design - New Well

PROSPER.ANL.GLD.DONERATE Get rate done flag


PROSPER.ANL.GLD.DONECALC Calculation Done Flag

Design Rate Method


PROSPER.ANL.GLD.DesignMethod Design rate method:
0 = Entered by user
1 = Calculated from maximum
production
2 = Calculated from maximum revenue
PROSPER.ANL.GLD.DesignType Rate Type (DesignMethod=0):
0 = Liquid
1 = Oil
PROSPER.ANL.GLD.DesignRate Design Rate (DesignMethod=0):
PROSPER.ANL.GLD.OilRev Oil Revenue (DesignMethod=2)
PROSPER.ANL.GLD.GasRev Gas Revenue (DesignMethod=2)
PROSPER.ANL.GLD.WaterCost Water Processing Cost (DesignMethod=2)
PROSPER.ANL.GLD.GasCost Gas Processing Cost (DesignMethod=2)
PROSPER.ANL.GLD.MaxProd Maximum Liquid Rate (DesignMethod=1/2)

Input Parameters
PROSPER.ANL.GLD.MAXGAS Maximum gas available
PROSPER.ANL.GLD.MAXGASUL Maximum gas during unloading
PROSPER.ANL.GLD.FWHP Flowing top node pressure
PROSPER.ANL.GLD.UWHP Unloading top node pressure
PROSPER.ANL.GLD.OPINJPRES Operating injection pressure
PROSPER.ANL.GLD.KOINJPRES Kick-off injection pressure
PROSPER.ANL.GLD.DPVALVE Desired dP across valve

OpenServer User's Manual


PROSPER and OpenServer 326

PROSPER.ANL.GLD.MAXDEPTH Max depth of injection


PROSPER.ANL.GLD.WC Water cut
PROSPER.ANL.GLD.MINSPACE Minimum spacing
PROSPER.ANL.GLD.STATGRAD Static gradient of load fluid
PROSPER.ANL.GLD.MINTRAN Minimum transfer dP
PROSPER.ANL.GLD.MAXPORT Maximum Port Size (read only)
PROSPER.ANL.GLD.SAFETY Safety for closure of last unloading valve
PROSPER.ANL.GLD.Solgor Total GOR

PROSPER.ANL.GLD.ValveType Valve type:


0 = Casing sensitive
1 = Tubing sensitive
2 = Proportional
PROSPER.ANL.GLD.ValveD1 Min CHP decrease per valve (ValveType=0)
PROSPER.ANL.GLD.ValveD2 Percentage Pcasing-Pwellhead
(ValveType=1)
PROSPER.ANL.GLD.ValveSet Valve settings:
1 = PVc = gas pressure
2 = First valve PVo = gas pressure
3 = All valves PVo = gas pressure
4 = Pmin - Pmax
PROSPER.ANL.GLD.FracTEF Fraction of TEF (ValveType=4)
PROSPER.ANL.GLD.LastValve Injection point:
0 = Injection point is ORIFICE
1 = Injection point is VALVE
PROSPER.ANL.GLD.Dome Dome pressure correction above 1200psig:
0 = No
1 = Yes
PROSPER.ANL.GLD.SpacngMethod Valve spacing method:
0 = Normal
1 = Spacing line procedure
PROSPER.ANL.GLD.CheckRate Check rate conformance with IPR:
0 = Yes
1 = No

i = 0:23
PROSPER.ANL.GLD.Tubing, i Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.GLD.TubingLabel, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.

© 1990-2018 Petroleum Experts Limited


327 OpenServer

PROSPER.ANL.GLD.Pipe, i Defines pipeline correlation by its index.


Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.GLD.PipeLabel, "name" Defines pipeline correlation by its name
(label). Please refer to Sensitivity Variables
and Indexes for the list of names.

PROSPER.ANL.GLD.CheckIPR User IPr for unloading:


0 = Yes
1 = No
PROSPER.ANL.GLD.Orifice Orifice sizing on:
0 = Calculated dP @ orifice
1 = Min dP across orifice

Thornhill-Craver DeRating
PROSPER.ANL.GLD.ThornV De-rating percentage for valves
PROSPER.ANL.GLD.ThornO De-rating percentage for orifice

Current Valve Type


PROSPER.ANL.GLD.ValveRec.MANU Current valve type manufacturer
PROSPER.ANL.GLD.ValveRec.TYPE Valve type folder
PROSPER.ANL.GLD.ValveRec.SPEC Valve specification
PROSPER.ANL.GLD.ValveRec.SIZE Valve Port Size
PROSPER.ANL.GLD.ValveRec.RVAL Valve R value

Valve Calculation Results


i = 0:29
PROSPER.ANL.GLD.VALVE.COUNT Number of mandrels
PROSPER.ANL.GLD.Valve[i].Valve Number of Valves
PROSPER.ANL.GLD.Valve[i].Type Valve type
PROSPER.ANL.GLD.Valve[i].MSD Valve Measured Depth
PROSPER.ANL.GLD.Valve[i].TVD Valve True Vertical Depth
PROSPER.ANL.GLD.Valve[i].TubPres Tubing Pressure
PROSPER.ANL.GLD.Valve[i].CasPres Casing Pressure
PROSPER.ANL.GLD.Valve[i].CasPres Transfer Pressure
PROSPER.ANL.GLD.Valve[i].Temp Temperature at Valve Depth
PROSPER.ANL.GLD.Valve[i].GasInj GasLift Rate
PROSPER.OUT.GLN.PORT[i] Port Size
PROSPER.ANL.GLD.Valve[i].Rval R Value
PROSPER.ANL.GLD.VALVE[i].PVO Valve opening pressure (at depth)

OpenServer User's Manual


PROSPER and OpenServer 328

PROSPER.ANL.GLD.VALVE[i].PVC Valve closing pressure (at depth)


PROSPER.ANL.GLD.VALVE[i].DOME Dome pressure
PROSPER.ANL.GLD.VALVE[i].TEST Test rack opening pressure
PROSPER.ANL.GLD.VALVE[i].CASPVO Opening casing pressure

PROSPER.ANL.GLD.VALVE[i].CASPVC Closing casing pressure

PROSPER.ANL.GLD.VALVE[i].ENABLE Enable flag

Gas Lift Design - Existing Mandrels - Mandrel Details


GasLift Design - Existing mandrels uses the same OpenServer syntax as 'New GasLift
Design'.

The following commands can be used to input the valve data:


i = 0:29
PROSPER.ANL.GLD.Valve[i].Valve Number of valves
PROSPER.ANL.GLD.Valve[i].Type Valve type:
0 = None
1 = Valve
2 = Orifice
3 = Dummy
PROSPER.ANL.GLD.Valve[i].MSD Measured depth
PROSPER.ANL.GLD.Valve[i].Casing dP casing
PROSPER.ANL.GLD.Valve[i].MaxGI Maximum gas injected

Gas Lift Design - Gas Lift Adjustments


PROSPER.ANL.GLA.GLA[0] Downstream pressure constraint
PROSPER.ANL.GLA.GLA[1] Kick-off casing head pressure
PROSPER.ANL.GLA.GLA[2] Lift gas network normal pressure
PROSPER.ANL.GLA.GLA[3] Safety margin for lift gas control
PROSPER.ANL.GLA.GLA[4] Maximum CHP Under Normal Operation
(read only)
PROSPER.ANL.GLA.GLA[5] Min CP decrease to close last unloading
valve
PROSPER.ANL.GLA.GLA[6] Lift gas temperature
PROSPER.ANL.GLA.GLA[7] Target liquid production rate
PROSPER.ANL.GLA.GLA[8] Water cut
PROSPER.ANL.GLA.GLA[9] Production (total) GOR

© 1990-2018 Petroleum Experts Limited


329 OpenServer

i = 0:23
PROSPER.ANL.GLA.Corr, i Defines vertical lift correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.ANL.GLA.CorrLabel, "name" Defines vertical lift correlation by its name
(label). Please refer to Sensitivity Variables
and Indexes for the list of names.

PROSPER.ANL.GLA.Dome Dome pressure correction flag:


0 = No
1 = Yes
PROSPER.ANL.GLA.Flow Flowing calculation mode:
1 = All valves
2 = Orifice only
3 = Gradient only
PROSPER.ANL.GLA.GasInj Performance curve:
1 = Automatic
2 = User specified

Intermittent Gas Lift Design


PROSPER.SIN.GLI.Input[0] Downhole injection pressure
PROSPER.SIN.GLI.Input[1] Injection Depth
PROSPER.SIN.GLI.Input[2] Gas lift gas gravity
PROSPER.SIN.GLI.Input[3] Wellhead pressure
PROSPER.SIN.GLI.Input[4] Valve port size
PROSPER.SIN.GLI.Input[5] Water cut
PROSPER.SIN.GLI.Input[6] Tubing liquid level

6.8.2 Electical Submersible Pump Design

The following commands are valid for both DoSet and DoGet functions:

PROSPER.SIN.ESP.DONE Calculation done flag

Input Data
PROSPER.SIN.ESP.Depth Pump depth (measured)
PROSPER.SIN.ESP.Frequency Operating frequency
PROSPER.SIN.ESP.MaxPumpOD Pump maximum O.D.
PROSPER.SIN.ESP.CableLength Length of cable

OpenServer User's Manual


PROSPER and OpenServer 330

PROSPER.SIN.ESP.Efficiency Gas separator efficiency


PROSPER.SIN.ESP.Rate Design rate
PROSPER.SIN.ESP.WC Water cut
PROSPER.SIN.ESP.Solgor Total GOR
PROSPER.SIN.ESP.Pres Top node pressure
PROSPER.SIN.ESP.Safety Motor power safety margin
PROSPER.SIN.ESP.Wear Pump wear factor

i = 0:23
PROSPER.SIN.ESP.PIPE, i Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.SIN.ESP.PipeLabel, "name" Defines pipeline correlation by its name
(label). Please refer to Sensitivity Variables
and Indexes for the list of names.
PROSPER.SIN.ESP.TUBING Defines tubing correlation by its index. Please
refer to Sensitivity Variables and Indexes for
the list of indexes.
PROSPER.SIN.ESP.TubingLabel, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.

PROSPER.SIN.ESP.GDRflag Gas de-rating model

Design Results
PROSPER.SIN.ESP.DesPump Selects the pump from database
PROSPER.SIN.ESP.DesMotor Selects the motor from database
PROSPER.SIN.ESP.DesHP Selects the motor power option from database
PROSPER.SIN.ESP.DesCable Selects the cable from database

ESP OpenServer Design and Selection Sequence:

The following commands are valid for DoGet functions only:

PROSPER.ESP.DESIGNPUMPS Returns number and list of suitable pumps after


ESP Design Calculation has been done
PROSPER.ESP.DESIGNMOTORS Returns number and list of suitable motors after
ESP Design Calculation has been done
PROSPER.ESP.DESIGNCABLES Returns number and list of suitable cables after
ESP Design Calculation has been done

© 1990-2018 Petroleum Experts Limited


331 OpenServer

PROSPER.ESP.SELECTPUMP Selects desired pump after ESP Design


Calculation has been done and calculates
design parameters.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTPUMP(i
)")
will select the ith pump from the list
PROSPER.ESP.SELECTMOTOR Selects desired motor after ESP Design
Calculation has been done and calculates
design parameters.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTMOTO
R(i, j)")
will select the ith motor from the list, using the jth
power option
PROSPER.ESP.SELECTCABLE Selects desired cable after ESP Design
Calculation has been done and calculates
design parameters.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTCABLE
(i)")
will select the ith cable from the list
PROSPER Selects desired pump after ESP Design
.ESP.SELECTPUMPNAME Calculation has been done.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTPUMP
NAME(ALNAS,S700)")
will select the pump named 'Alnas S700' from
the list
PROSPER Selects desired motor after ESP Design
.ESP.SELECTMOTORNAME Calculation has been done.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTMOTO
RNAME(Centrilift,544,300HP,1675V,105A)")
will select the 'Centrilift 544 300HP 1675V
105A' motor from the list.
PROSPER Selects desired cable after ESP Design
.ESP.SELECTCABLENAME Calculation has been done.
Example: The line:
var=DoGet("PROSPER.ESP.SELECTCABLE
NAME("#1 Aluminium")")
will select the '#1 Aluminium' cable from the list.
PROSPER.ESP.PUMPNAME Returns the name of the Pump specified by the
index.

OpenServer User's Manual


PROSPER and OpenServer 332

Example: The line:


var=DoGet("PROSPER.ESP.PUMPNAME(i)")
.
will return name of the the ith pump.
PROSPER.ESP.MOTORNAME Returns the name of the Motor specified by the
index
Example: The line:
var=DoGet("PROSPER.ESP.MOTORNAME(i)
").
will return name of the the ith motor.
PROSPER.ESP.CABLENAME Returns the name of the Cable specified by the
index
Example: The line:
var=DoGet("PROSPER.ESP.CABLENAME(i)
").
will return name of the the ith cable.

Example:
The following examples outlines OpenServer commands and sequence of their
execution when designing an ESP well.

Command Result / Example of returned value


PROSPER.ANL.ESP.CALC Executed OK
PROSPER.ESP.DESIGNPUMPS DoGet PROSPER.ESP.DESIGNPUMPS - OK -
returned 50, 6 | 45 | 88 | 91 | 101 | 102 | 103 | 108 | 110
| 122 | 123 | 163 | 186 | 188 | 189 | 191 | 192 | 193 | 194
| 195 | 203 | 204 | 205 | 206 | 260 | 261 | 285 | 286 | 287
| 288 | 289 | 290 | 291 | 296 | 297 | 325 | 328 | 329 | 403
| 404 | 417 | 425 | 453 | 454 | 455 | 457 | 460 | 465 | 516
| 517 |
PROSPER.ESP.PUMPNAME(6) DoGet PROSPER.ESP.PUMPNAME(6) - OK -
returned ALNAS L6050 4.48 inches (4000-7250 RB/
day)
PROSPER.ESP.SELECTPUMP(6) DoGet PROSPER.ESP.SELECTPUMP(6) - OK -
returned 1
PROSPER.ESP.DESIGNMOTORS DoGet PROSPER.ESP.DESIGNMOTORS - OK -
returned 9, 2,36 | 3,32 | 5,67 | 6,61 | 9,38 | 13,40 |
16,41 | 17,38 |
PROSPER.ESP.MOTORNAME(2,36) DoGet PROSPER.ESP.MOTORNAME(2,36) - OK -
returned Centrilift 544 275HP 1565V 105A
PROSPER.ESP.SELECTMOTOR(2,3 DoGet PROSPER.ESP.SELECTMOTOR(2,36) - OK
6) - returned 1
PROSPER.ESP.DESIGNCABLES DoGet PROSPER.ESP.DESIGNCABLES - OK -
returned 1, 1 |

© 1990-2018 Petroleum Experts Limited


333 OpenServer

PROSPER.ESP.CABLENAME(1) DoGet PROSPER.ESP.CABLENAME(1) - OK -


returned #1 Copper 0.26 (Volts/1000ft) 115
(amps) max
PROSPER.ESP.SELECTCABLE(1) DoGet PROSPER.ESP.SELECTCABLE - OK -
returned 1

6.8.3 Hydraulic Drive Downhole Pump Design

The following commands are valid for both DoSet and DoGet functions:

PROSPER.SIN.HSP.DONE Calculation Done Flag

Input Data
PROSPER.SIN.HSP.PumpDepth Pump depth (measured)
PROSPER.SIN.HSP.PumpMaxOD Pump maximum O.D.
PROSPER.SIN.HSP.TurbMaxOD Turbine maximum O.D.
PROSPER.SIN.HSP.Rate Design liquid rate
PROSPER.SIN.HSP.WC Water cut
PROSPER.SIN.HSP.Pres Top node pressure
PROSPER.SIN.HSP.PumpSpeed Pump speed
PROSPER.SIN.HSP.TotalGOR Total GOR
PROSPER.SIN.HSP.PowerPC % Power fluid of reservoir fluid
PROSPER.SIN.HSP.Wear Pump wear factor

i = 0:23
PROSPER.SIN.HSP.Pipe, i Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.SIN.HSP.PipeLabel, "name" Defines pipeline correlation by its name
(label). Please refer to Sensitivity Variables
and Indexes for the list of names.
PROSPER.SIN.HSP.Tubing, i Defines tubing correlation by its index. Please
refer to Sensitivity Variables and Indexes for
the list of indexes.
PROSPER.SIN.HSP.TubingLabel, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.

PROSPER.SIN.HSP.GDRflag Gas de-rating model

Design Results

OpenServer User's Manual


PROSPER and OpenServer 334

PROSPER.SIN.HSP.DesPump Selects the pump from database


PROSPER.SIN.HSP.DesTurb Selects the turbine from database

6.8.4 Progressive Cavity Pump Design

The following commands are valid for both DoSet and DoGet functions:

PROSPER.SIN.PCP.DONE Calculation done flag

Sucker Rod Drive


PROSPER.SIN.PCP.Input[0] Pump depth (measured)
PROSPER.SIN.PCP.Input[1] Pump maximum O.D.
PROSPER.SIN.PCP.Input[2] Gas separator efficiency
PROSPER.SIN.PCP.Input[3] Pump wear factor
PROSPER.SIN.PCP.Input[6] Design rate
PROSPER.SIN.PCP.Input[7] Water cut
PROSPER.SIN.PCP.Input[12] Total GOR
PROSPER.SIN.PCP.Input[8] Top node pressure
PROSPER.SIN.PCP.Input[10] Total rod length

i = 0:23
PROSPER.SIN.PCP.Pipe Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.SIN.PCP.PipeLabel Defines pipeline correlation by its name
(label). Please refer to Sensitivity
Variables and Indexes for the list of
names.
PROSPER.SIN.PCP.Tubing Defines tubing correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.SIN.PCP.TubingLabel Defines tubing correlation by its name
(label). Please refer to Sensitivity
Variables and Indexes for the list of
names.

Downhole Motor Drive


PROSPER.SIN.PCP.Input[4] Cable length
PROSPER.SIN.PCP.Input[5] Voltage at surface
PROSPER.SIN.PCP.Input[9] Motor power safety margin

© 1990-2018 Petroleum Experts Limited


335 OpenServer

Design Results
PROSPER.SIN.PCP.DesPump Selects the pump from database
PROSPER.SIN.PCP.DesMotor Selects the motor from database
PROSPER.SIN.PCP.DesCable Selects the cable from database

6.8.5 Jet Pump Design

The following commands are valid for both DoSet and DoGet functions:

PROSPER.SIN.JET.DONE Calculation done flag

Input Data
PROSPER.SIN.JET.Input[0] Pump depth (measured)
PROSPER.SIN.JET.Input[1] Pump maximum O.D.
PROSPER.SIN.JET.Input[4] Design liquid rate
PROSPER.SIN.JET.Input[5] Water cut
PROSPER.SIN.JET.Input[6] Total GOR
PROSPER.SIN.JET.Input[7] Top node pressure
PROSPER.SIN.JET.Input[8] Surface injection rate
PROSPER.SIN.JET.Input[9] Surface injection pressure
PROSPER.SIN.JET.LossCoef[0] Nozzle loss coefficient
PROSPER.SIN.JET.LossCoef[1] Suction loss coefficient
PROSPER.SIN.JET.LossCoef[2] Throat loss coefficient
PROSPER.SIN.JET.LossCoef[3] Diffuser loss coefficient

i = 0:23
PROSPER.SIN.PCP.Pipe, i Defines pipeline correlation by its index.
Please refer to Sensitivity Variables and
Indexes for the list of indexes.
PROSPER.SIN.PCP.PipeLabel, "name" Defines pipeline correlation by its name
(label). Please refer to Sensitivity Variables
and Indexes for the list of names.
PROSPER.SIN.PCP.Tubing, i Defines tubing correlation by its index. Please
refer to Sensitivity Variables and Indexes for
the list of indexes.
PROSPER.SIN.PCP.TubingLabel, Defines tubing correlation by its name (label).
"name" Please refer to Sensitivity Variables and
Indexes for the list of names.

OpenServer User's Manual


PROSPER and OpenServer 336

6.8.6 Sucker Rod Pump Design

The following commands are valid for both DoSet and DoGet functions:

PROSPER.SIN.SRP.DONE Calculation done flag

PVT Data
PROSPER.SIN.SRP.Input[80] Oil gravity
PROSPER.SIN.SRP.Input[81] Gas gravity
PROSPER.SIN.SRP.Input[82] Water salinity
PROSPER.SIN.SRP.Input[83] Water cut
PROSPER.SIN.SRP.Input[84] GOR

Calculation Mode
PROSPER.SIN.SRP.Input[35] Calculation mode
0 = Enter stroke rate - calculate production rate
1 = Enter production rate - estimate stroke rate
PROSPER.SIN.SRP.Input[17] Pump Speed
PROSPER.SIN.SRP.Input[22] Target Production Rate

Pump Unit Selection


PROSPER.SIN.SRP.Input[68] Pumping unit selection by index in the database
PROSPER.SIN.SRP.Input[19] Stroke Length (read only)
PROSPER.SIN.SRP.Input[85] Maximum Stroke Length (read only)

Rod Selection
PROSPER.SIN.SRP.Input[26] Rod type
PROSPER.SIN.SRP.Input[27] Rod number
PROSPER.SIN.SRP.Input[29] Rod grade
0=K
1=C
2=D
3=E
PROSPER.SIN.SRP.Input[86] Plunger Diameter (read only)
PROSPER.SIN.SRP.Input[36] Service factor
0 = Non-corrosive
1 = salty water
2 = Hydrogen sulphide

Pump Intake Pressure


PROSPER.SIN.SRP.Input[88] Method:

© 1990-2018 Petroleum Experts Limited


337 OpenServer

0 = Entered Value
1 = Calculated From IPR
2 = Calculated From Fluid Level
PROSPER.SIN.SRP.Input[34] Intake Pressure
PROSPER.SIN.SRP.Input[15] MidPoint Perforation Depth

Design Input
PROSPER.SIN.SRP.Input[9] Unit type:
0 = Conventional clockwise
1 = Conventional anticlockwise
2 = Type II
3 = Air balanced
PROSPER.SIN.SRP.Input[10] Anchored tubing
0 = Yes
1 = No
PROSPER.SIN.SRP.Input[15] Midpoint perforation depth
PROSPER.SIN.SRP.Input[16] Pump depth
PROSPER.SIN.SRP.Input[20] Pump volumetric efficiency
PROSPER.SIN.SRP.Input[21] Unit efficiency
PROSPER.SIN.SRP.Input[12] Pump diameter
0 = 1.062-in
1 = 1.25-in
2 = 1.50-in
3 = 1.75-in
4 = 1.87-in
5 = 2.00-in
6 = 2.25-in
7 = 2.50-in
8 = 2.75-in
9 = 3.75-in
10 = 4.75-in
PROSPER.SIN.SRP.Input[13] Surface stroke length
PROSPER.SIN.SRP.Input[23] Bottom hole temperature
PROSPER.SIN.SRP.Input[24] Wellhead temperature
PROSPER.SIN.SRP.Input[25] Wellhead pressure

6.9 Calculation Results


The Calculation Results are accessed using the root name PROSPER.OUT and is split
up into several sections as listed below.

INF Inflow Sensitivity Calculations


SYS System Sensitivity Calculations

OpenServer User's Manual


PROSPER and OpenServer 338

GRD Gradient Sensitivity Calculations


VLP VLP Sensitivity Calculations
QLG QuickLook - GasLift
QLE QuickLook - ESP
QLH QuickLook - HSP
TCC Tubing Correlation Comparison
PCC Pipeline Correlation Comparison
GMT Gradient Matching
GEN Generate For GAP
SPD Sensitivity PvD
GLN Gas Lift Design (New Well)
GLE Gas Lift Design (Existing Well)
GLI Gas Lift Design (Intermittent)
ESP ESP Design
HSP HSP Design

Each section will be accessed thus:

PROSPER.OUT.INF
PROSPER.OUT.SYS
PROSPER.OUT.GRD
PROSPER.OUT.VLP
PROSPER.OUT.QLG
PROSPER.OUT.QLE
PROSPER.OUT.QLH
PROSPER.OUT.TCC
PROSPER.OUT.PCC
PROSPER.OUT.GMT
PROSPER.OUT.GEN
PROSPER.OUT.SPD
PROSPER.OUT.GLN
PROSPER.OUT.GLE
PROSPER.OUT.GLI
PROSPER.OUT.ESP
PROSPER.OUT.HSP

6.9.1 INF - Inflow Sensitivity Calculations

PROSPER.OUT.INF.DONE 'Calculation Done' Flag


PROSPER.OUT.INF.Results.COUNT Returns the number of sensitivity cases

© 1990-2018 Petroleum Experts Limited


339 OpenServer

(m)
PROSPER.OUT.INF.Results[i].COUNT Returns the number of rate values used
for calculations (m)

Calculation Results
i = 0:n-1 Sensitivity case Index
j = 0:m-1 Row index in the results table
PROSPER.OUT.INF.RESULTS[i].LiqRate[j] Liquid rate
PROSPER.OUT.INF.RESULTS[i].OilRate[j] Oil rate
PROSPER.OUT.INF.RESULTS[i].WatRate[j] Water rate
PROSPER.OUT.INF.RESULTS[i].GasRate[j] Gas rate
PROSPER.OUT.INF.RESULTS[i].IPRPres[j] Inflow pressure
PROSPER.OUT.INF.RESULTS[i].DPTotal[j] Total dP skin
PROSPER.OUT.INF.RESULTS[i].DPPerf[j] Perforation dP skin
PROSPER.OUT.INF.RESULTS[i].DPDam[j] Damage dP skin
PROSPER.OUT.INF.RESULTS[i].DPComp[j] Completion dP skin
PROSPER.OUT.INF.RESULTS[i].SKTotal[j] Total skin
PROSPER.OUT.INF.RESULTS[i].SKComp[j] Completion skin
PROSPER.OUT.INF.RESULTS[i].DPGrav[j] Gravel pack dP skin
PROSPER.OUT.INF.RESULTS[i].SKGrav[j] Gravel pack skin
PROSPER.OUT.INF.Results[i].vcGrav[j] Gravel Pack Casing Velocity
PROSPER.OUT.INF.RESULTS[i].SKLam[j] Laminar skin (SkinAide)
PROSPER.OUT.INF.RESULTS[i].SKTurb[j] Turbulence skin (SkinAide)
PROSPER.OUT.INF.RESULTS[i].DPLam[j] Laminar dP skin (SkinAide)
PROSPER.OUT.INF.RESULTS[i].DPTurb[j] Turbulence dP skin (SkinAide)

6.9.2 SYS - System Sensitivity Calculations

PROSPER.OUT.SYS.DONE Calculation Done Flag


PROSPER.OUT.SYS.Results.COUNT Returns the number of sensitivity
cases (n)
PROSPER.OUT.SYS.Results[i].COUNT Returns the number of rate values
used for calculations (m)

Calculation Results
i = 0:n-1 Sensitivity Case Index
j = 0:m-1 Row index in the results table

OpenServer User's Manual


PROSPER and OpenServer 340

PROSPER.OUT.SYS.RESULTS[i].LiqRate[j] Liquid rate


PROSPER.OUT.SYS.RESULTS[i].OilRate[j] Oil rate
PROSPER.OUT.SYS.RESULTS[i].WatRate[j] Water rate
PROSPER.OUT.SYS.RESULTS[i].GasRate[j] Gas rate
PROSPER.OUT.SYS.Results[i].VLPpres[j] VLP Pressure
PROSPER.OUT.SYS.RESULTS[i].IPRPres[j] IPR Pressure
PROSPER.OUT.SYS.RESULTS[i].DPTotal[j] Total dP skin
PROSPER.OUT.SYS.RESULTS[i].DPPerf[j] Perforation dP skin
PROSPER.OUT.SYS.RESULTS[i].DPDam[j] Damage dP skin
PROSPER.OUT.SYS.RESULTS[i].DPComp[j] Completion dP skin
PROSPER.OUT.SYS.RESULTS[i].SKTotal[j] Total skin
PROSPER.OUT.SYS.RESULTS[i].SKComp[j] Completion skin
PROSPER.OUT.SYS.RESULTS[i].DPGrav[j] Gravel pack dP skin
PROSPER.OUT.SYS.RESULTS[i].SKGrav[j] Gravel pack skin
PROSPER.OUT.SYS.Results[i].vcGrav[j] Gravel Pack Casing Velocity
PROSPER.OUT.SYS.Results[i].WHpres[j] Wellhead Pressure
PROSPER.OUT.SYS.Results[i].WHtemp[j] Wellhead Temperature
PROSPER.OUT.SYS.Results[i].FNtemp[j] First Node Temperature
PROSPER.OUT.SYS.Results[i].PrFric[j] dP Friction
PROSPER.OUT.SYS.Results[i].PrStat[j] dP Gravity
PROSPER.OUT.SYS.Results[i].MixVel[j] Total No Slip Velocity
PROSPER.OUT.SYS.Results[i].EroVel[j] Erosional Velocity
PROSPER.OUT.SYS.Results[i].CFactr[j] C Factor
PROSPER.OUT.SYS.Results[i].MaxGrn[j] Max Grain Diameter
PROSPER.OUT.SYS.Results[i].Erosion[j] Erosional Flag

Solutions Results
PROSPER.OUT.SYS.Results[0].Sol.LiqRate Liquid Rate
PROSPER.OUT.SYS.Results[0].Sol.OilRate Oil Rate
PROSPER.OUT.SYS.Results[0].Sol.WatRate Water Rate
PROSPER.OUT.SYS.Results[0].Sol.GasRate Gas Rate
PROSPER.OUT.SYS.Results[0].Sol.BHP Solution Node Pressure
PROSPER.OUT.SYS.Results[0].Sol.PRFRIC dP Friction
PROSPER.OUT.SYS.Results[0].Sol.PRSTAT dP Gravity
PROSPER.OUT.SYS.Results[0].Sol.dPTotalSkin dP Total Skin
PROSPER.OUT.SYS.Results[0].Sol.dPPerforation dP Perforation
PROSPER.OUT.SYS.Results[0].Sol.dPDamage dP Damage

© 1990-2018 Petroleum Experts Limited


341 OpenServer

PROSPER.OUT.SYS.Results[0].Sol.dPCompletio dP Completion
n
PROSPER.OUT.SYS.Results[0].Sol.CompletionSk Completions Skin
in
PROSPER.OUT.SYS.Results[0].Sol.TotalSkin Total Skin
PROSPER.OUT.SYS.Results[0].Sol.dpGravel dP Sand Control
PROSPER.OUT.SYS.Results[0].Sol.GravelPackS Sand Control Skin
kin
PROSPER.OUT.SYS.Results[0].Sol.DIlRate Gravel Pack Casing Velocity
PROSPER.OUT.SYS.Results[0].Sol.WHDenLiquid Wellhead Liquid Density
PROSPER.OUT.SYS.Results[0].Sol.WHDenGas Wellhead Gas Density
PROSPER.OUT.SYS.Results[0].Sol.WHVisLiquid Wellhead Liquid Viscosity
PROSPER.OUT.SYS.Results[0].Sol.WHVisGas Wellhead Gas Viscosity
PROSPER.OUT.SYS.Results[0].Sol.WHVelLiquid Wellhead Superficial Liquid Velocity
PROSPER.OUT.SYS.Results[0].Sol.WHVelGas Wellhead Superficial Gas Velocity
PROSPER.OUT.SYS.Results[0].Sol.WHZFactor Wellhead Z-factor
PROSPER.OUT.SYS.Results[0].Sol.WHSurfaceTe Wellhead Interfacial Tension
nsion
PROSPER.OUT.SYS.Results[0].Sol.WHPressure Wellhead Pressure
PROSPER.OUT.SYS.Results[0].Sol.WHTemperat Wellhead Temperature
ure
PROSPER.OUT.SYS.Results[0].Sol.FNDenLiquid First Node Liquid Density
PROSPER.OUT.SYS.Results[0].Sol.FNDenGas First Node Gas Density
PROSPER.OUT.SYS.Results[0].Sol.FNVisLiquid First Node Liquid Viscosity
PROSPER.OUT.SYS.Results[0].Sol.FNVisGas First Node Gas Viscosity
PROSPER.OUT.SYS.Results[0].Sol.FNVelLiquid First Node Superficial Liquid
Velocity
PROSPER.OUT.SYS.Results[0].Sol.FNVelGas First Node Superficial Gas Velocity
PROSPER.OUT.SYS.Results[0].Sol.FNZFactor First Node Z-factor
PROSPER.OUT.SYS.Results[0].Sol.FNSurfaceTe First Node Interfacial Tension
nsion
PROSPER.OUT.SYS.Results[0].Sol.FNPressure First Node Pressure
PROSPER.OUT.SYS.Results[0].Sol.FNTemperatu First Node Temperature
re

ESP Solution Details


PROSPER.OUT.SYS.Results[0].Sol.PIP Pump Intake Pressure
PROSPER.OUT.SYS.Results[0].Sol.PDP Pump Discharge Pressure
PROSPER.OUT.SYS.Results[0].Sol.PumpAvRate Average Rate Through Pump

OpenServer User's Manual


PROSPER and OpenServer 342

PROSPER.OUT.SYS.Results[0].Sol.PumpHead Pump Head Generated


PROSPER.OUT.SYS.Results[0].Sol.PumpPower Pump Power Requirement
PROSPER.OUT.SYS.Results[0].Sol.PumpEfficien Pump Efficiency
cy
PROSPER.OUT.SYS.Results[0].Sol.MotorAmps Motor Amps Requirement
PROSPER.OUT.SYS.Results[0].Sol.MotorPower Motor Power Generated
PROSPER.OUT.SYS.Results[0].Sol.MotorEfficien Motor Efficency
cy
PROSPER.OUT.SYS.Results[0].Sol.MotorSpeed Motor Speed
PROSPER.OUT.SYS.Results[0].Sol.CableVolts Voltage at Surface
PROSPER.OUT.SYS.Results[0].Sol.FreeGas Flee Gas In Pump (V/V)
PROSPER.OUT.SYS.Results[0].Sol.PRETUR Torque on Shaft

Multilayer dP Loss in Wellbore Solution Details


PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][0] Oil rate
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][1] Gas rate
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][2] Water rate
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][3] Pressure
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][4] dP Total Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][5] Total Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][6] dP Completion Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][7] Completion Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][8] dP Sand Control Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][9] Sand Control Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][10] dP Perforation Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][11] dP Damage Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][12] dP Penetration Skin
PROSPER.OUT.SYS.RESULTS[i].SOL.ML[j][13] dP Deviation Skin

Multilateral Solutions Details


PROSPER.OUT.SYS.RESULTS[i].ML.BRANCHL Branch Label
ABEL[j]
PROSPER.OUT.SYS.RESULTS[i].ML.BRANCHR Branch Rate
ATE[j]
PROSPER.OUT.SYS.RESULTS[i].ML.BRANCHP Branch Pressure
RES[j]

© 1990-2018 Petroleum Experts Limited


343 OpenServer

6.9.3 GRD - Gradient Sensitivity Calculations

PROSPER.OUT.GRD.DONE Calculation Done Flag

i = 0:9 Sensitivity variables indexes


j = 0:9
k = 0:9
PROSPER.OUT.GRD.RESULTS[i][j][k].COUNT Number of gradient results (n)

l = 0:n-1
PROSPER.OUT.GRD.RESULTS[i][j][k].LABEL[l] Label Number
PROSPER.OUT.GRD.RESULTS[i][j][k].MSD[l] Measured Depth
PROSPER.OUT.GRD.RESULTS[i][j][k].TVD[l] True Vertical Depth
PROSPER.OUT.GRD.RESULTS[i][j][k].PRES[l] Pressure
PROSPER.OUT.GRD.RESULTS[i][j][k].TEMP[l] Fluid Temperature
PROSPER.OUT.GRD.RESULTS[i][j][k].GRAD[l] Gradient
PROSPER.OUT.GRD.RESULTS[i][j][k].HOLDUP[l] Holdup
PROSPER.OUT.GRD.RESULTS[i][j][k].REGIME[l] Flow Regime Number. See Flow
Regime Number for further
information
PROSPER.OUT.GRD.RESULTS[i][j][k].HTC[l] Heat Transfer Coefficient
PROSPER.OUT.GRD.RESULTS[i][j][k].TFO[l] Formation Temperature
PROSPER.OUT.GRD.RESULTS[i][j][k].GRSTAT[l] Static Gradient
PROSPER.OUT.GRD.RESULTS[i][j][k].GRFRIC[l] Friction Gradient
PROSPER.OUT.GRD.RESULTS[i][j][k].VLSLIP[l] Slip Liquid Velocity
PROSPER.OUT.GRD.RESULTS[i][j][k].VLNSLP[l] NoSlip Liquid Velocity
PROSPER.OUT.GRD.RESULTS[i][j][k].VGSLIP[l] Slip Gas Velocity
PROSPER.OUT.GRD.RESULTS[i][j][k].VGNSLP[l] NoSlip Gas Velocity
PROSPER.OUT.GRD.RESULTS[i][j][k].AVRHSL[l] Mixture Density
PROSPER.OUT.GRD.RESULTS[i][j][k].PRSTAT[l] Pressure due to friction
PROSPER.OUT.GRD.RESULTS[i][j][k].PRFRIC[l] Pressure due to gravity
PROSPER.OUT.GRD.RESULTS[i][j][k].CASTEM[l] Casing temperature
PROSPER.OUT.GRD.RESULTS[i][j][k].ANNTEM[l] Average annulus temperature
PROSPER.OUT.GRD.RESULTS[i][j][k].RHOOIL[l] Gas density
PROSPER.OUT.GRD.RESULTS[i][j] Oil density
[k].RHOGAS[l]
PROSPER.OUT.GRD.RESULTS[i][j] Water density
[k].RHOWAT[l]

OpenServer User's Manual


PROSPER and OpenServer 344

PROSPER.OUT.GRD.RESULTS[i][j][k].DIAINT[l] Diameter
PROSPER.OUT.GRD.RESULTS[i][j][k].ANGLE[l] Angle
PROSPER.OUT.GRD.RESULTS[i][j][k].DSTEP[l] Section length
PROSPER.OUT.GRD.RESULTS[i][j][k].FMULIQ[l] Liquid viscosity
PROSPER.OUT.GRD.RESULTS[i][j] Gas viscosity
[k].FMUGAS[l]
PROSPER.OUT.GRD.RESULTS[i][j][k].SIGLIQ[l] Gas-Liquid IFT
PROSPER.OUT.GRD.RESULTS[i][j][k].SIGWAT[l] Gas-Water IFT
PROSPER.OUT.GRD.RESULTS[i][j][k].SIGOIL[l] Gas-Oil IFT
PROSPER.OUT.GRD.RESULTS[i][j][k].SIGOW[l] Oil-Water IFT
PROSPER.OUT.GRD.RESULTS[i][j][k].SLUGLM[l] Mean Slug Length
PROSPER.OUT.GRD.RESULTS[i][j][k].SLUGLX[l] 1/000 Slug Length
PROSPER.OUT.GRD.RESULTS[i][j][k].BUBLNM[l] Mean Bubble Length
PROSPER.OUT.GRD.RESULTS[i][j][k].BUBLNX[l] 1/1000 Bubble Length
PROSPER.OUT.GRD.RESULTS[i][j][k].SLUGQL[l] Mean Slug Liquid Rate
PROSPER.OUT.GRD.RESULTS[i][j][k].SLUGQG[l] Mean Slug Gas Rate
PROSPER.OUT.GRD.RESULTS[i][j][k].BUBLQL[l] Mean Bubble Liquid Rate
PROSPER.OUT.GRD.RESULTS[i][j][k].BUBLQG[l] Mean Bubble Gas Rate
PROSPER.OUT.GRD.RESULTS[i][j][k].SLGFRM[l] Mean Slug Frequency
PROSPER.OUT.GRD.RESULTS[i][j][k].SLGFRX[l] 1/1000 Slug Frequency
PROSPER.OUT.GRD.RESULTS[i][j][k].SLGHLS[l] Slug Holdup (HLS)
PROSPER.OUT.GRD.RESULTS[i][j][k].SLGHLE[l] Equilibrium Holdup (HLE)
PROSPER.OUT.GRD.RESULTS[i][j][k].CFACTR[l] C Factor (Erosional Velocity)
PROSPER.OUT.GRD.RESULTS[i][j][k].SANDDI[l] Max Transportable Grain Diameter
PROSPER.OUT.GRD.RESULTS[i][j][k].CORR[l] Correlation Index
PROSPER.OUT.GRD.RESULTS[i][j] Hydrates Formation Flag
[k].HYDRATE[l]

GasLIft Gas Gradient


PROSPER.OUT.GRD.RESULTS[i][j] Number of GasLift Gas gradient
[k].GASGRAD.COUNT Results (n)

l = 0:n-1
PROSPER.OUT.GRD.RESULTS[i][j] Depth
[k].GASGRAD.DEPTH[l]
PROSPER.OUT.GRD.RESULTS[i][j] Pressure
[k].GASGRAD.PRES[l]

© 1990-2018 Petroleum Experts Limited


345 OpenServer

6.9.3.1 GRD - Flow Regime Number


The following string

PROSPER.OUT.GRD.RESULTS[i][j][k].REGIME[l]

can be used to retrieve the predicted flow regime index for the selected multiphase flow
correlation.

Indices [i][j][k] reference the gradient calculation sensitivity variables i.e., 1, 2, 3


Index [l] references the gradient result node number

NOTE:
The flow regime numeric value in PROSPER is returned with prefix '10'. Thus, for
Petroleum Experts 5 predicting Annular Flow, the value of 105 will be returned.

The following table summarises the flow regime associated with the returned value for
each multiphase flow correlation:

Returned
Vertical Flow Correlation Flow Regime
Index Value
Duns and Ros Modified 1 Bubble
2 Plug
3 Bubble / Slug
4 Heading
5 Sklug
6 Froth
7 Transition
8 Mist
9 Gas
10 Liquid

Mukerjee Brill 1 Stratified


2 Wavy
3 Bubble / Plug
4 Slug
5 Transition
6 Froth
7 Dispersed
8 Annular / Mist
9 Gas
10 Liquid
11 Annular

OpenServer User's Manual


PROSPER and OpenServer 346

Beggs and Brill 1 Liquid


2 Gas
3 Distributed
4 Intermittent
5 Segregated
6 Transition

Dukler Flannigan 1 Liquid


2 Gas
3 Two Phase

Dukler Eaton Flannigan 1 Liquid


2 Gas
3 Two Phase

Petroleum Experts 1 Bubble


2 Slug
3 Transition
4 Mist
5 Gas

Orkiszewski 1 Bubble
2 Slug
3 Transition
4 Mist
5 Gas

Petroleum Experts 2 1 Bubble


2 Slug
3 Transition
4 Mist
5 Gas

Duns and Ross Original 1 Bubble


2 Plug
3 Bubble / Slug
4 Heading
5 Slug

© 1990-2018 Petroleum Experts Limited


347 OpenServer

6 Froth
7 Transition
8 Mist
9 Gas
10 Liquid

Petroleum Experts 3 1 Bubble


2 Slug
3 Transition
4 Mist
5 Gas

Beggs and Brill (Gas Head) 1 Liquid


2 Gas
3 Distributed
4 Intermittent
5 Segregated
6 Transition

GRE (modified by PE) 1 Liquid


2 Gas
3 Strat. Smooth
4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble

GRE (with DSM) 1 Liquid


2 Gas
3 Strat. Smooth
4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble
9 Slug (DSM)

GRE (Original) 1 Liquid

OpenServer User's Manual


PROSPER and OpenServer 348

2 Gas
3 Strat. Smooth
4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble

GRE (with AE) 1 Liquid


2 Gas
3 Strat. Smooth
4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble

Petroleum Experts 4 1 Liquid


2 Gas
3 Strat. Smooth
4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble

Hydro-3P 0 Strat. Smooth


1 Strat. Wavy
2 Annular
3 Slug Flow
4 Bubble Flow
5 Oil / Water (2P)
6 Gas (1P)
7 Oil (1P)
8 Water (1P)

Petroleum Experts 5 1 Liquid


2 Gas
3 Strat. Smooth

© 1990-2018 Petroleum Experts Limited


349 OpenServer

4 Strat. Wavy
5 Annular
6 Slug (normal)
7 Slug (induced)
8 Disp. Bubble

6.9.4 VLP - VLP Sensitivity Calculations

PROSPER.OUT.VLP.DONE Calculation Done Flag


PROSPER.OUT.VLP.Results.COUNT Returns the number of sensitivity
cases (m)

Calculation Results
i = 0:n-1 Sensitivity Case Index
j = 0:m-1 Row index in the results table
PROSPER.OUT.VLP.RESULTS[i].LiqRate[j] Liquid rate
PROSPER.OUT.VLP.RESULTS[i].OilRate[j] Oil rate
PROSPER.OUT.VLP.RESULTS[i].WatRate[j] Water rate
PROSPER.OUT.VLP.RESULTS[i].GasRate[j] Gas rate
PROSPER.OUT.VLP.Results[i].VLPpres[j] VLP Pressure
PROSPER.OUT.VLP.RESULTS[i].DPTotal[j] Total dP skin
PROSPER.OUT.VLP.RESULTS[i].DPPerf[j] Perforation dP skin
PROSPER.OUT.VLP.RESULTS[i].DPDam[j] Damage dP skin
PROSPER.OUT.VLP.RESULTS[i].DPComp[j] Completion dP skin
PROSPER.OUT.VLP.RESULTS[i].SKTotal[j] Total skin
PROSPER.OUT.VLP.RESULTS[i].SKComp[j] Completion skin
PROSPER.OUT.VLP.RESULTS[i].DPGrav[j] Gravel pack dP skin
PROSPER.OUT.VLP.RESULTS[i].SKGrav[j] Gravel pack skin
PROSPER.OUT.VLP.Results[i].vcGrav[j] Gravel Pack Casing Velocity
PROSPER.OUT.VLP.Results[i].WHpres[j] Wellhead Pressure
PROSPER.OUT.VLP.Results[i].WHtemp[j] Wellhead Temperature
PROSPER.OUT.VLP.Results[i].FNtemp[j] First Node Temperature
PROSPER.OUT.VLP.Results[i].PrFric[j] dP Friction
PROSPER.OUT.VLP.Results[i].PrStat[j] dP Gravity
PROSPER.OUT.VLP.Results[i].MixVel[j] Total No Slip Velocity
PROSPER.OUT.VLP.Results[i].EroVel[j] Erosional Velocity
PROSPER.OUT.VLP.Results[i].CFactr[j] C Factor

OpenServer User's Manual


PROSPER and OpenServer 350

PROSPER.OUT.VLP.Results[i].MaxGrn[j] Max Grain Diameter


PROSPER.OUT.VLP.Results[i].Erosion[j] Erosional Flag

6.9.4.1 VLP Export


The OpenServer command to export VLP curves is:

PROSPER.ANL.VLP.EXPORT

NOTE:
The command "PROSPER.ANL.VLP.EXPORT" will not export any file if the exported file
name and file path have not been specified before hand. The export parameters (type of
VLP format, units, name of the file, etc) can be entered through OpenServer using the
following variables:

PROSPER.ANL.VLP.EXP.Sel VLP format (see table below)


PROSPER.ANL.VLP.EXP.Table Table Number
PROSPER.ANL.VLP.EXP.Well Well Number
PROSPER.ANL.VLP.EXP.Unit Unit System (the indexes for selected format may
vary depending on the format selected)
PROSPER.ANL.VLP.EXP.File Path and name of the file
PROSPER.ANL.VLP.EXP.Datum Datum depth
PROSPER.ANL.VLP.EXP.Density Well density
PROSPER.ANL.VLP.EXP.BHP Table Quantity

The following table provides the list of formats that are available in PROSPER for VLP
export. For OpenServer export the formats can be selected via the corresponding index
or string.

Index Export Data Format


0 SLB Eclipse
1 WellDrill - SIMCO 3
2 ExxonMobil - Pegasus
3 SSI - Comp4
4 Franlab - FRAGOR
5 SSI - Comp3
6 Landmark VIP
7 Roxar - MORE
8 Petroleum Experts GAP/MBAL
9 Shell - Mores

© 1990-2018 Petroleum Experts Limited


351 OpenServer

10 Franlab - ATHOS
11 BP - GCOMP
12 ChevronTexaco - CHEARS
13 ExxonMobil - EMPOWER
14 ConocoPhillips - Psim
15 CMG - IMEX / GEM (old Format)
16 CMG - IMEX / GEM (Release 2009.10)
17 Saudi Aramco - Powers

Example:
For example, the three following OpenServer statements would export an ECLIPSE
formatted VLP file called "test.ecl" under the C:\ drive:

DoSet ("PROSPER.ANL.VLP.EXP.Sel"), "SLB Eclipse"


DoSet ("PROSPER.ANL.VLP.EXP.File"), "C:\test.ecl"
DoCmd ("PROSPER.ANL.VLP.Export")

NOTE: If well type is changed to gas lift for example, then not all tpd formats will be
accessible for export, and the tpd index value will also change. To avoid tpd index
changes, the tpd file extension can be used, i.e., *.TPD (Petex), *.ecl (Eclipse), etc.

TPD Data Export using File Extension Type

DoSet ("PROSPER.ANL.VLP.EXP.File") 'File path and file name


argument, i.e., C:\TPD_Data\File.tpd
DoSet ("PROSPER.ANL.VLP.EXP.ExtType") 'File extension, i.e., tpd,
ecl, etc.
DoCmd ("PROSPER.ANL.VLP.EXPORTBYEXT") 'Exports the tpd data in
the set file extension format

6.9.5 QLG - QuickLook – GasLift

PROSPER.OUT.QLG.DONE Calculation Done Flag


PROSPER.OUT.QLG.XMIN Minimum Pressure
PROSPER.OUT.QLG.XMAX Maxmum Pressure
PROSPER.OUT.QLG.YMIN Minimum Temperature
PROSPER.OUT.QLG.YMAX Maximum Temperature

Input Data
PROSPER.OUT.QLG.Output[20] Tubing Head Pressure
PROSPER.OUT.QLG.Output[21] Tubing Head Temperature
PROSPER.OUT.QLG.Output[22] Liquid Rate

OpenServer User's Manual


PROSPER and OpenServer 352

PROSPER.OUT.QLG.Output[23] Water Cut


PROSPER.OUT.QLG.Output[24] Total Gas Rate
PROSPER.OUT.QLG.Output[25] Gas Injection Rate
PROSPER.OUT.QLG.Output[26] Casing Head Pressure
PROSPER.OUT.QLG.Output[27] Orifice Diameter
PROSPER.OUT.QLG.Output[28] Injection Depth (Measured)

Results
PROSPER.OUT.QLG.Output[13] Flowing BottomHole Pressure
PROSPER.OUT.QLG.Output[12] Static BottomHole Pressure
PROSPER.OUT.QLG.Output[0] Tubing Pressure At Valve
PROSPER.OUT.QLG.Output[11] Casing Pressure At Valve
PROSPER.OUT.QLG.Output[1] Temperature At Valve
PROSPER.OUT.QLG.Output[2] Gas Oil Ratio
PROSPER.OUT.QLG.Output[3] GOR Free
PROSPER.OUT.QLG.Output[4] dP Across Valve
PROSPER.OUT.QLG.Output[5] Calculated Casing Head Pressure
PROSPER.OUT.QLG.Output[6] Draw Down
PROSPER.OUT.QLG.Output[7] Equivalent Calculated PI
PROSPER.OUT.QLG.Output[8] Calculated Critical Flow Rate
PROSPER.OUT.QLG.Output[9] Percentage of Criotical Flow Rate
PROSPER.OUT.QLG.Output[10] Fitted Thermal Coefficient

Gradient Calculation Results


i = 0:1 Gradient index:
0 = Top Down Gradient
1 = Bottom Up Gradient
PROSPER.OUT.QLG.Results[i].COUNT Number of calculation results for
selected gradient (n)

j = 0:n-1
PROSPER.OUT.QLG.Results[i].Label[j] Label
PROSPER.OUT.QLG.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.QLG.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.QLG.Results[i].Pres[j] Pressure
PROSPER.OUT.QLG.Results[i].Temp[j] Temperature
PROSPER.OUT.QLG.Results[i].Grad[j] Gradient
PROSPER.OUT.QLG.Results[i].Holdup[j] Holdup

© 1990-2018 Petroleum Experts Limited


353 OpenServer

PROSPER.OUT.QLG.Results[i].Regime[j] Regime
PROSPER.OUT.QLG.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.QLG.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.QLG.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.QLG.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.QLG.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.QLG.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.QLG.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.QLG.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.QLG.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.QLG.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.QLG.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.QLG.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.QLG.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.QLG.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.QLG.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.QLG.Results[i].CFactr[j] C Factor
PROSPER.OUT.QLG.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.QLG.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.QLG.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.QLG.Results[i].RhoWat[j] Water Density
PROSPER.OUT.QLG.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.QLG.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.QLG.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.QLG.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.QLG.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.QLG.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.QLG.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.QLG.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.QLG.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.QLG.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.QLG.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.QLG.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.QLG.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.QLG.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.QLG.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.QLG.Results[i].EntGas[j] Gas Enthalpy

OpenServer User's Manual


PROSPER and OpenServer 354

PROSPER.OUT.QLG.Results[i].ConOil[j] Oil Conductivity


PROSPER.OUT.QLG.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.QLG.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.QLG.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.QLG.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.QLG.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.QLG.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.QLG.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.QLG.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.QLG.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.QLG.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.QLG.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.QLG.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.QLG.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.QLG.Results[i].DiaInt[j] Diameter
PROSPER.OUT.QLG.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.QLG.Results[i].Dstep[j] Node Length
PROSPER.OUT.QLG.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.QLG.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.QLG.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.QLG.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.QLG.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.QLG.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.QLG.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.QLG.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.QLG.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.QLG.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.QLG.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.QLG.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.QLG.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.QLG.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.QLG.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.QLG.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.QLG.Results[i].PigLen[j] Cumulative Pigged Slug Length

© 1990-2018 Petroleum Experts Limited


355 OpenServer

PROSPER.OUT.QLG.Results[i].PigSvl[j] Cumulative Pigged Slug Volume


PROSPER.OUT.QLG.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.QLG.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.QLG.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.QLG.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.QLG.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.QLG.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.QLG.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.QLG.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.QLG.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.QLG.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.QLG.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.QLG.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.QLG.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.QLG.Results[i].InjDep[j] Injection Depth
PROSPER.OUT.QLG.Results[i].GasLif[j] Injected Gas Rate
PROSPER.OUT.QLG.Results[i].RhgF[j] Injected Gas Density
PROSPER.OUT.QLG.Results[i].RhgF[j] Injected Gas Viscosity
PROSPER.OUT.QLG.Results[i].FmuGf[j] Injcted Gas Viscosity
PROSPER.OUT.QLG.Results[i].GasFf[j] Injected Gas FVF
PROSPER.OUT.QLG.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.QLG.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.QLG.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.QLG.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.QLG.Results[i].JtcOef[j] Joule-Thomson Coefficient

Gas Gradient Results


PROSPER.OUT.QLG.RESULTS[i].GASGRAD.NUM Number of Points in the Gas
Gradient (n)

j = 0:n
PROSPER.OUT.QLG.RESULTS[i].GASGRAD[j].DE Depth
PTH
PROSPER.OUT.QLG.RESULTS[i].GASGRAD[j].PR Pressure
ES

OpenServer User's Manual


PROSPER and OpenServer 356

6.9.6 QLE - QuickLook – ESP

PROSPER.OUT.QLE.DONE Calculation Done Flag


PROSPER.OUT.QLE.XMIN Minimum Pressure
PROSPER.OUT.QLE.XMAX Maxmum Pressure
PROSPER.OUT.QLE.YMIN Minimum Temperature
PROSPER.OUT.QLE.YMAX Maximum Temperature

Results
PROSPER.OUT.QLE.Output[0] Pump Power Requirement
PROSPER.OUT.QLE.Output[1] Motor Power Requirement
PROSPER.OUT.QLE.Output[2] Motor Efficiency
PROSPER.OUT.QLE.Output[3] Surface Voltage
PROSPER.OUT.QLE.Output[4] Pump Intake Pressure
PROSPER.OUT.QLE.Output[5] Pump Discharge Pressure
PROSPER.OUT.QLE.Output[6] Doqnhole Rate
PROSPER.OUT.QLE.Output[7] Free Gas In Pump
PROSPER.OUT.QLE.Output[8] Surface KVA
PROSPER.OUT.QLE.Output[9] Torque On Shaft
PROSPER.OUT.QLE.Output[10] Delta T across Pump

Gradient Calculation Results


i = 0:1 Gradient index:
0 = From Static BHP
1 = Fixed Top Node
Pressure
PROSPER.OUT.QLE.Results[i].COUNT Number of calculation results for
selected gradient(n)

j = 0:n-1
PROSPER.OUT.QLE.Results[i].Label[j] Label
PROSPER.OUT.QLE.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.QLE.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.QLE.Results[i].Pres[j] Pressure
PROSPER.OUT.QLE.Results[i].Temp[j] Temperature
PROSPER.OUT.QLE.Results[i].Grad[j] Gradient

© 1990-2018 Petroleum Experts Limited


357 OpenServer

PROSPER.OUT.QLE.Results[i].Holdup[j] Holdup
PROSPER.OUT.QLE.Results[i].Regime[j] Regime
PROSPER.OUT.QLE.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.QLE.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.QLE.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.QLE.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.QLE.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.QLE.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.QLE.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.QLE.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.QLE.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.QLE.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.QLE.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.QLE.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.QLE.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.QLE.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.QLE.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.QLE.Results[i].CFactr[j] C Factor
PROSPER.OUT.QLE.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.QLE.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.QLE.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.QLE.Results[i].RhoWat[j] Water Density
PROSPER.OUT.QLE.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.QLE.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.QLE.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.QLE.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.QLE.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.QLE.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.QLE.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.QLE.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.QLE.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.QLE.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.QLE.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.QLE.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.QLE.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.QLE.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.QLE.Results[i].EntWat[j] Water Enthalpy

OpenServer User's Manual


PROSPER and OpenServer 358

PROSPER.OUT.QLE.Results[i].EntGas[j] Gas Enthalpy


PROSPER.OUT.QLE.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.QLE.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.QLE.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.QLE.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.QLE.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.QLE.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.QLE.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.QLE.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.QLE.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.QLE.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.QLE.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.QLE.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.QLE.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.QLE.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.QLE.Results[i].DiaInt[j] Diameter
PROSPER.OUT.QLE.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.QLE.Results[i].Dstep[j] Node Length
PROSPER.OUT.QLE.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.QLE.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.QLE.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.QLE.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.QLE.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.QLE.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.QLE.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.QLE.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.QLE.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.QLE.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.QLE.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.QLE.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.QLE.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.QLE.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.QLE.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.QLE.Results[i].SfBubG[j] Bubble Surge Factor (Gas)

© 1990-2018 Petroleum Experts Limited


359 OpenServer

PROSPER.OUT.QLE.Results[i].PigLen[j] Cumulative Pigged Slug Length


PROSPER.OUT.QLE.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.QLE.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.QLE.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.QLE.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.QLE.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.QLE.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.QLE.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.QLE.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.QLE.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.QLE.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.QLE.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.QLE.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.QLE.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.QLE.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.QLE.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.QLE.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.QLE.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.QLE.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.QLE.Results[i].JtcOef[j] Joule-Thomson Coefficient

6.9.7 QLH - QuickLook – HSP

PROSPER.OUT.QLH.DONE Calculation Done Flag


PROSPER.OUT.QLH.XMIN Minimum Pressure
PROSPER.OUT.QLH.XMAX Maxmum Pressure
PROSPER.OUT.QLH.YMIN Minimum Temperature
PROSPER.OUT.QLH.YMAX Maximum Temperature

Results
PROSPER.OUT.QLH.Output[0] Pump Power Required
PROSPER.OUT.QLH.Output[1] Turbine Power Generated
PROSPER.OUT.QLH.Output[2] Turbine Efficiency

OpenServer User's Manual


PROSPER and OpenServer 360

PROSPER.OUT.QLH.Output[3] Calculated Surface Injection


Pressure
PROSPER.OUT.QLH.Output[4] Pump Intake Pressure
PROSPER.OUT.QLH.Output[5] Pump Discharge Pressure
PROSPER.OUT.QLH.Output[6] Downhole Rate
PROSPER.OUT.QLH.Output[7] Solution GOR In Pump
PROSPER.OUT.QLH.Output[8] dP across Turbine
PROSPER.OUT.QLH.Output[9] Balance Supply Rate
PROSPER.OUT.QLH.Output[10] Pump Torque
PROSPER.OUT.QLH.Output[11] Gas Fraction
PROSPER.OUT.QLH.Output[12] Pump Efficiency
PROSPER.OUT.QLH.Output[13] Calculated Pump Speed
PROSPER.OUT.QLH.Output[14] Delta T Across Pump

Gradient Calculation Results


i = 0:1 Gradient index:
0 = From Static BHP
1 = Fixed Top Node Pressure
PROSPER.OUT.QLH.Results[i].COUNT Number of calculation results (n)

j = 0:n-1
PROSPER.OUT.QLH.Results[i].Label[j] Label
PROSPER.OUT.QLH.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.QLH.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.QLH.Results[i].Pres[j] Pressure
PROSPER.OUT.QLH.Results[i].Temp[j] Temperature
PROSPER.OUT.QLH.Results[i].Grad[j] Gradient
PROSPER.OUT.QLH.Results[i].Holdup[j] Holdup
PROSPER.OUT.QLH.Results[i].Regime[j] Regime
PROSPER.OUT.QLH.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.QLH.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.QLH.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.QLH.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.QLH.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.QLH.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.QLH.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.QLH.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.QLH.Results[i].Vwslip[j] Slip Water Velocity

© 1990-2018 Petroleum Experts Limited


361 OpenServer

PROSPER.OUT.QLH.Results[i].Vlnslp[j] Superficial Liquid Velocity


PROSPER.OUT.QLH.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.QLH.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.QLH.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.QLH.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.QLH.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.QLH.Results[i].CFactr[j] C Factor
PROSPER.OUT.QLH.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.QLH.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.QLH.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.QLH.Results[i].RhoWat[j] Water Density
PROSPER.OUT.QLH.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.QLH.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.QLH.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.QLH.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.QLH.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.QLH.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.QLH.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.QLH.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.QLH.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.QLH.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.QLH.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.QLH.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.QLH.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.QLH.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.QLH.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.QLH.Results[i].EntGas[j] Gas Enthalpy
PROSPER.OUT.QLH.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.QLH.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.QLH.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.QLH.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.QLH.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.QLH.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.QLH.Results[i].MassW[j] Water Mass Flow Rate

OpenServer User's Manual


PROSPER and OpenServer 362

PROSPER.OUT.QLH.Results[i].CumLiq[j] Cumulative Liquid Volume


PROSPER.OUT.QLH.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.QLH.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.QLH.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.QLH.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.QLH.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.QLH.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.QLH.Results[i].DiaInt[j] Diameter
PROSPER.OUT.QLH.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.QLH.Results[i].Dstep[j] Node Length
PROSPER.OUT.QLH.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.QLH.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.QLH.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.QLH.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.QLH.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.QLH.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.QLH.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.QLH.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.QLH.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.QLH.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.QLH.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.QLH.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.QLH.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.QLH.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.QLH.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.QLH.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.QLH.Results[i].PigLen[j] Cumulative Pigged Slug Length
PROSPER.OUT.QLH.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.QLH.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.QLH.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.QLH.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.QLH.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.QLH.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.QLH.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.QLH.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.QLH.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].ConStm[j] Steam Conductivity

© 1990-2018 Petroleum Experts Limited


363 OpenServer

PROSPER.OUT.QLH.Results[i].GasFre[j] Free Gas Rate


PROSPER.OUT.QLH.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.QLH.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.QLH.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.QLH.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.QLH.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.QLH.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.QLH.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.QLH.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.QLH.Results[i].JtcOef[j] Joule-Thomson Coefficient

6.9.8 TCC - Tubing Correlation Comparison

PROSPER.OUT.TCC.DONE Calculation Done Flag

Gradient Calculation Results


i = 0:23 Calculation results index. This index
coincides with index of the correlation
selected for comparison. Please refer
to Sensitivity Variables and Indexes
for the list of indexes.
Example:
If "Petroleum Experts 5" correlation is
selected for analysis the results for it
will be published under index 20:
PROSPER.OUT.TCC.Results[20]
PROSPER.OUT.TCC.Results.COUNT Returns the number of the last
correlations selected for analysis. This
number is equal to the correlation
index plus 1.
PROSPER.OUT.TCC.Results[i].COUNT Number of calculation results (n) for
selected correlation

j = 0:n-1
PROSPER.OUT.TCC.Results[i].Label[j] Label
PROSPER.OUT.TCC.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.TCC.Results[i].TVD[j] True Vertical Depth

OpenServer User's Manual


PROSPER and OpenServer 364

PROSPER.OUT.TCC.Results[i].Pres[j] Pressure
PROSPER.OUT.TCC.Results[i].Temp[j] Temperature
PROSPER.OUT.TCC.Results[i].Grad[j] Gradient
PROSPER.OUT.TCC.Results[i].Holdup[j] Holdup
PROSPER.OUT.TCC.Results[i].Regime[j] Regime
PROSPER.OUT.TCC.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.TCC.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.TCC.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.TCC.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.TCC.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.TCC.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.TCC.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.TCC.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.TCC.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.TCC.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.TCC.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.TCC.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.TCC.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.TCC.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.TCC.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.TCC.Results[i].CFactr[j] C Factor
PROSPER.OUT.TCC.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.TCC.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.TCC.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.TCC.Results[i].RhoWat[j] Water Density
PROSPER.OUT.TCC.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.TCC.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.TCC.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.TCC.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.TCC.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.TCC.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.TCC.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.TCC.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.TCC.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.TCC.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.TCC.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.TCC.Results[i].GasFvf[j] Gas FVF

© 1990-2018 Petroleum Experts Limited


365 OpenServer

PROSPER.OUT.TCC.Results[i].WatFvf[j] Water FVF


PROSPER.OUT.TCC.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.TCC.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.TCC.Results[i].EntGas[j] Gas Enthalpy
PROSPER.OUT.TCC.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.TCC.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.TCC.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.TCC.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.TCC.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.TCC.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.TCC.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.TCC.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.TCC.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.TCC.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.TCC.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.TCC.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.TCC.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.TCC.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.TCC.Results[i].DiaInt[j] Diameter
PROSPER.OUT.TCC.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.TCC.Results[i].Dstep[j] Node Length
PROSPER.OUT.TCC.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.TCC.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.TCC.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.TCC.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.TCC.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.TCC.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.TCC.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.TCC.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.TCC.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.TCC.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.TCC.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.TCC.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.TCC.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)

OpenServer User's Manual


PROSPER and OpenServer 366

PROSPER.OUT.TCC.Results[i].SfSlgG[j] Slug Surge Factor (Gas)


PROSPER.OUT.TCC.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.TCC.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.TCC.Results[i].PigLen[j] Cumulative Pigged Slug Length
PROSPER.OUT.TCC.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.TCC.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.TCC.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.TCC.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.TCC.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.TCC.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.TCC.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.TCC.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.TCC.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.TCC.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.TCC.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.TCC.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.TCC.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.TCC.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.TCC.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.TCC.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.TCC.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.TCC.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.TCC.Results[i].JtcOef[j] Joule-Thomson Coefficient

6.9.9 PCC - Pipeline Correlation Comparison

PROSPER.OUT.PCC.DONE Calculation Done Flag

Gradient Calculation Results


i = 0:23 Calculation results index. This index
coincides with index of the correlation
selected for comparison. Please refer
to Sensitivity Variables and Indexes for
the list of indexes.

© 1990-2018 Petroleum Experts Limited


367 OpenServer

Example:
If "Petroleum Experts 5" correlation is
selected for analysis the results for it will
be published under index 20:
PROSPER.OUT.PCC.Results[20]
PROSPER.OUT.PCC.Results.COUNT Returns the number of the last
correlations selected for analysis. This
number is equal to the correlation index
plus 1.
PROSPER.OUT.PCC.Results[i].COUNT Number of calculation results (n) for
selected correlation

j = 0:n-1
PROSPER.OUT.PCC.Results[i].Label[j] Label
PROSPER.OUT.PCC.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.PCC.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.PCC.Results[i].Pres[j] Pressure
PROSPER.OUT.PCC.Results[i].Temp[j] Temperature
PROSPER.OUT.PCC.Results[i].Grad[j] Gradient
PROSPER.OUT.PCC.Results[i].Holdup[j] Holdup
PROSPER.OUT.PCC.Results[i].Regime[j] Regime
PROSPER.OUT.PCC.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.PCC.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.PCC.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.PCC.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.PCC.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.PCC.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.PCC.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.PCC.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.PCC.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.PCC.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.PCC.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.PCC.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.PCC.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.PCC.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.PCC.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.PCC.Results[i].CFactr[j] C Factor
PROSPER.OUT.PCC.Results[i].SandDi[j] Maximum Garin Diameter

OpenServer User's Manual


PROSPER and OpenServer 368

PROSPER.OUT.PCC.Results[i].RhoOil[j] Oil Density


PROSPER.OUT.PCC.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.PCC.Results[i].RhoWat[j] Water Density
PROSPER.OUT.PCC.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.PCC.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.PCC.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.PCC.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.PCC.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.PCC.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.PCC.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.PCC.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.PCC.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.PCC.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.PCC.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.PCC.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.PCC.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.PCC.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.PCC.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.PCC.Results[i].EntGas[j] Gas Enthalpy
PROSPER.OUT.PCC.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.PCC.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.PCC.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.PCC.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.PCC.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.PCC.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.PCC.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.PCC.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.PCC.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.PCC.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.PCC.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.PCC.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.PCC.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.PCC.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.PCC.Results[i].DiaInt[j] Diameter

© 1990-2018 Petroleum Experts Limited


369 OpenServer

PROSPER.OUT.PCC.Results[i].Angle[j] Angle From Vertical


PROSPER.OUT.PCC.Results[i].Dstep[j] Node Length
PROSPER.OUT.PCC.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.PCC.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.PCC.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.PCC.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.PCC.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.PCC.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.PCC.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.PCC.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.PCC.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.PCC.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.PCC.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.PCC.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.PCC.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.PCC.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.PCC.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.PCC.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.PCC.Results[i].PigLen[j] Cumulative Pigged Slug Length
PROSPER.OUT.PCC.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.PCC.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.PCC.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.PCC.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.PCC.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.PCC.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.PCC.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.PCC.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.PCC.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.PCC.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.PCC.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.PCC.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.PCC.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.PCC.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.PCC.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.PCC.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.PCC.Results[i].EntTot[j] Total Enthalpy

OpenServer User's Manual


PROSPER and OpenServer 370

PROSPER.OUT.PCC.Results[i].CprLiq[j] Liquid Specific Heat Capacity


PROSPER.OUT.PCC.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.PCC.Results[i].JtcOef[j] Joule-Thomson Coefficient

6.9.10 GMT - Gradient Matching

PROSPER.OUT.GMT.DONE Calculation Done Flag

Gradient Calculation Results


i = 0:23 Calculation results index. This index
coincides with index of the correlation
selected for comparison. Please refer to
Sensitivity Variables and Indexes for the
list of indexes.
Example:
If "Petroleum Experts 5" correlation is
selected for analysis the results for it will
be published under index 20:
PROSPER.OUT.GMT.Results[20]
PROSPER.OUT.PCC.Results.COUNT Returns the number of the last
correlations selected for analysis. This
number is equal to the correlation index
plus 1.
PROSPER.OUT.GMT.Results[i].COUNT Number of calculation results (n) for
selected correlation

j = 0:n-1
PROSPER.OUT.GMT.Results[i].Label[j] Label
PROSPER.OUT.GMT.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.GMT.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.GMT.Results[i].Pres[j] Pressure
PROSPER.OUT.GMT.Results[i].Temp[j] Temperature
PROSPER.OUT.GMT.Results[i].Grad[j] Gradient
PROSPER.OUT.GMT.Results[i].Holdup[j] Holdup
PROSPER.OUT.GMT.Results[i].Regime[j] Regime
PROSPER.OUT.GMT.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.GMT.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.GMT.Results[i].Grstat[j] Static Gradient

© 1990-2018 Petroleum Experts Limited


371 OpenServer

PROSPER.OUT.GMT.Results[i].Grfric[j] Friction Gradient


PROSPER.OUT.GMT.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.GMT.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.GMT.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.GMT.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.GMT.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.GMT.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.GMT.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.GMT.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.GMT.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.GMT.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.GMT.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.GMT.Results[i].CFactr[j] C Factor
PROSPER.OUT.GMT.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.GMT.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.GMT.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.GMT.Results[i].RhoWat[j] Water Density
PROSPER.OUT.GMT.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.GMT.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.GMT.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.GMT.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.GMT.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.GMT.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.GMT.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.GMT.Results[i].SigWat[j] Gas-Water Interfacial Tension
PROSPER.OUT.GMT.Results[i].SigOil[j] Gas-Oil Interfacial Tension
PROSPER.OUT.GMT.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.GMT.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.GMT.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.GMT.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.GMT.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.GMT.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.GMT.Results[i].EntGas[j] Gas Enthalpy
PROSPER.OUT.GMT.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.GMT.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.GMT.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.GMT.Results[i].CprOil[j] Oil Specific Heat Capacity

OpenServer User's Manual


PROSPER and OpenServer 372

PROSPER.OUT.GMT.Results[i].CprWat[j] Water Specific Heat Capacity


PROSPER.OUT.GMT.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.GMT.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.GMT.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.GMT.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.GMT.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.GMT.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.GMT.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.GMT.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.GMT.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.GMT.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.GMT.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.GMT.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.GMT.Results[i].DiaInt[j] Diameter
PROSPER.OUT.GMT.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.GMT.Results[i].Dstep[j] Node Length
PROSPER.OUT.GMT.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.GMT.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.GMT.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.GMT.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.GMT.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.GMT.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.GMT.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.GMT.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.GMT.Results[i].SlgFrm[j] Mean Slug Frequency
PROSPER.OUT.GMT.Results[i].SlgFrx[j] 1/1000 Slug Frequency
PROSPER.OUT.GMT.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.GMT.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.GMT.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.GMT.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.GMT.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.GMT.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.GMT.Results[i].PigLen[j] Cumulative Pigged Slug Length
PROSPER.OUT.GMT.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.GMT.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.GMT.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.GMT.Results[i].StmQua[j] Steam Quality

© 1990-2018 Petroleum Experts Limited


373 OpenServer

PROSPER.OUT.GMT.Results[i].RhoStm[j] Steam Density


PROSPER.OUT.GMT.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.GMT.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.GMT.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.GMT.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.GMT.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.GMT.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.GMT.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.GMT.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.GMT.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.GMT.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.GMT.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.GMT.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.GMT.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.GMT.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.GMT.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.GMT.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.GMT.Results[i].JtcOef[j] Joule-Thomson Coefficient

Injected Gas Gradient


PROSPER.OUT.GMT.RESULTS[i].GASGRA Number of Points in the table (n)
D[l].NUM

j = 0:n
PROSPER.OUT.GMT.RESULTS[i].GASGRA Depth
D.Depth[j]
PROSPER.OUT.GMT.RESULTS[i].GASGRA Pressure
D.Pres[j]

Correlation Matching Results


PROSPER.Anl.Cor.Corr[i].Name Correlation name

j = 0:1 Correction coefficient index:


0 = Gravity coefficient
1 = Friction Coefficient
PROSPER.Anl.Cor.Corr[i].A[j] Tubing correction parameters
PROSPER.Anl.Cor.Corr[i].S[j] Pipeline correction parameters

OpenServer User's Manual


PROSPER and OpenServer 374

6.9.11 GEN - Generate For GAP

PROSPER.OUT.GEN.DONE Calculation Done Flag


PROSPER.ANL.GEN.MANPRES.COUNT Returns the number of manufold
pressure values (n)

i = 0:n-1
PROSPER.ANL.GEN.GENGLR[i].COUNT Returns the number of generated
GLR values for selected manifold
pressure (m). For non-GasLift wells
i=0

j = 0:m-1
PROSPER.ANL.GEN.Rates.COUNT Returns the number of rate values
used for calculations (f)

k = 0:f-1

Calculation Results
PROSPER.OUT.GEN.Results[i][j].LiqRate[k] Liquid rate
PROSPER.OUT.GEN.Results[i][j].OilRate[k] Oil rate
PROSPER.OUT.GEN.Results[i][j].WatRate[k] Water rate
PROSPER.OUT.GEN.Results[i][j].GasRate[k] Gas rate
PROSPER.OUT.GEN.Results[i][j].VLPpres[k] VLP Pressure
PROSPER.OUT.GEN.Results[i][j].IPRPres[k] IPR Pressure
PROSPER.OUT.GEN.Results[i][j].DPTotal[k] Total dP skin
PROSPER.OUT.GEN.Results[i][j].DPPerf[k] Perforation dP skin
PROSPER.OUT.GEN.Results[i][j].DPDam[k] Damage dP skin
PROSPER.OUT.GEN.Results[i][j].DPComp[k] Completion dP skin
PROSPER.OUT.GEN.Results[i][j].SKTotal[k] Total skin
PROSPER.OUT.GEN.Results[i][j].SKComp[k] Completion skin
PROSPER.OUT.GEN.Results[i][j].DPGrav[k] Gravel pack dP skin
PROSPER.OUT.GEN.Results[i][j].SKGrav[k] Gravel pack skin
PROSPER.OUT.GEN.Results[i][j].vcGrav[k] Gravel Pack Casing Velocity

Solutions Results
PROSPER.OUT.GEN.Results[i][j].Sol.LiqRate Liquid Rate
PROSPER.OUT.GEN.Results[i][j].Sol.OilRate Oil Rate

© 1990-2018 Petroleum Experts Limited


375 OpenServer

PROSPER.OUT.GEN.Results[i][j].Sol.WatRate Water Rate


PROSPER.OUT.GEN.Results[i][j].Sol.GasRate Gas Rate
PROSPER.OUT.GEN.Results[i][j].Sol.BHP Solution Node Pressure
PROSPER.OUT.GEN.Results[i][j].Sol.PRFRIC dP Friction
PROSPER.OUT.GEN.Results[i][j].Sol.PRSTAT dP Gravity
PROSPER.OUT.GEN.Results[i][j].Sol.dPTotalSkin dP Total Skin
PROSPER.OUT.GEN.Results[i] dP Perforation
[j].Sol.dPPerforation
PROSPER.OUT.GEN.Results[i][j].Sol.dPDamage dP Damage
PROSPER.OUT.GEN.Results[i] dP Completion
[j].Sol.dPCompletion
PROSPER.OUT.GEN.Results[i] Completions Skin
[j].Sol.CompletionSkin
PROSPER.OUT.GEN.Results[i][j].Sol.TotalSkin Total Skin
PROSPER.OUT.GEN.Results[i][j].Sol.dpGravel dP Sand Control
PROSPER.OUT.GEN.Results[i] Sand Control Skin
[j].Sol.GravelPackSkin
PROSPER.OUT.GEN.Results[i][j].Sol.DIlRate Gravel Pack Casing Velocity
PROSPER.OUT.GEN.Results[i] Wellhead Liquid Density
[j].Sol.WHDenLiquid
PROSPER.OUT.GEN.Results[i][j].Sol.WHDenGas Wellhead Gas Density
PROSPER.OUT.GEN.Results[i] Wellhead Liquid Viscosity
[j].Sol.WHVisLiquid
PROSPER.OUT.GEN.Results[i][j].Sol.WHVisGas Wellhead Gas Viscosity
PROSPER.OUT.GEN.Results[i] Wellhead Superficial Liquid Velocity
[j].Sol.WHVelLiquid
PROSPER.OUT.GEN.Results[i][j].Sol.WHVelGas Wellhead Superficial Gas Velocity
PROSPER.OUT.GEN.Results[i][j].Sol.WHZFactor Wellhead Z-factor
PROSPER.OUT.GEN.Results[i] Wellhead Interfacial Tension
[j].Sol.WHSurfaceTension
PROSPER.OUT.GEN.Results[i][j].Sol.WHPressure Wellhead Pressure
PROSPER.OUT.GEN.Results[i] Wellhead Temperature
[j].Sol.WHTemperature
PROSPER.OUT.GEN.Results[i] First Node Liquid Density
[j].Sol.FNDenLiquid
PROSPER.OUT.GEN.Results[i][j].Sol.FNDenGas First Node Gas Density
PROSPER.OUT.GEN.Results[i][j].Sol.FNVisLiquid First Node Liquid Viscosity
PROSPER.OUT.GEN.Results[i][j].Sol.FNVisGas First Node Gas Viscosity
PROSPER.OUT.GEN.Results[i][j].Sol.FNVelLiquid First Node Superficial Liquid

OpenServer User's Manual


PROSPER and OpenServer 376

Velocity
PROSPER.OUT.GEN.Results[i][j].Sol.FNVelGas First Node Superficial Gas Velocity
PROSPER.OUT.GEN.Results[i][j].Sol.FNZFactor First Node Z-factor
PROSPER.OUT.GEN.Results[i] First Node Interfacial Tension
[j].Sol.FNSurfaceTension
PROSPER.OUT.GEN.Results[i][j].Sol.FNPressure First Node Pressure
PROSPER.OUT.GEN.Results[i] First Node Temperature
[j].Sol.FNTemperature

ESP Solution Details


PROSPER.OUT.GEN.Results[i][j].Sol.PIP Pump Intake Pressure
PROSPER.OUT.GEN.Results[i][j].Sol.PDP Pump Discharge Pressure
PROSPER.OUT.GEN.Results[i] Average Rate Through Pump
[j].Sol.PumpAvRate
PROSPER.OUT.GEN.Results[i][j].Sol.PumpHead Pump Head Generated
PROSPER.OUT.GEN.Results[i][j].Sol.PumpPower Pump Power Requirement
PROSPER.OUT.GEN.Results[i] Pump Efficiency
[j].Sol.PumpEfficiency
PROSPER.OUT.GEN.Results[i][j].Sol.MotorAmps Motor Amps Requirement
PROSPER.OUT.GEN.Results[i][j].Sol.MotorPower Motor Power Generated
PROSPER.OUT.GEN.Results[i] Motor Efficency
[j].Sol.MotorEfficiency
PROSPER.OUT.GEN.Results[i][j].Sol.MotorSpeed Motor Speed
PROSPER.OUT.GEN.Results[i][j].Sol.CableVolts Voltage at Surface
PROSPER.OUT.GEN.Results[i][j].Sol.FreeGas Flee Gas In Pump (V/V)
PROSPER.OUT.GEN.Results[i][j].Sol.PRETUR Torque on Shaft

6.9.12 SPD - Sensitivity PvD

PROSPER.OUT.SPD.DONE 'Calculation Done' Flag

Gradient Calculation Results


PROSPER.OUT.SPD.Results.COUNT Returns the number of sensitivity cases
(n)

i = 0:n-1
PROSPER.OUT.SPD.Results[i].COUNT Number of calculation results (m)

© 1990-2018 Petroleum Experts Limited


377 OpenServer

j = 0:m-1
PROSPER.OUT.SPD.Results[i].Label[j] Label
PROSPER.OUT.SPD.Results[i].MSD[j] Bottom Measured Depth
PROSPER.OUT.SPD.Results[i].TVD[j] True Vertical Depth
PROSPER.OUT.SPD.Results[i].Pres[j] Pressure
PROSPER.OUT.SPD.Results[i].Temp[j] Temperature
PROSPER.OUT.SPD.Results[i].Grad[j] Gradient
PROSPER.OUT.SPD.Results[i].Holdup[j] Holdup
PROSPER.OUT.SPD.Results[i].Regime[j] Regime
PROSPER.OUT.SPD.Results[i].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.SPD.Results[i].HydFlag[j] Hydrates Formation Flag
PROSPER.OUT.SPD.Results[i].Grstat[j] Static Gradient
PROSPER.OUT.SPD.Results[i].Grfric[j] Friction Gradient
PROSPER.OUT.SPD.Results[i].PrFric[j] Friction Pressure Loss
PROSPER.OUT.SPD.Results[i].PrStat[j] Gravity Pressure Loss
PROSPER.OUT.SPD.Results[i].Vlslip[j] Slip Liquid Velocity
PROSPER.OUT.SPD.Results[i].Vgslip[j] Slip Gas Velocity
PROSPER.OUT.SPD.Results[i].Vwslip[j] Slip Water Velocity
PROSPER.OUT.SPD.Results[i].Vlnslp[j] Superficial Liquid Velocity
PROSPER.OUT.SPD.Results[i].Vgnslp[j] Superficial Gas Velocity
PROSPER.OUT.SPD.Results[i].Vwnslp[j] Superficial Water Velocity
PROSPER.OUT.SPD.Results[i].VlTurn[j] Turner Velocity
PROSPER.OUT.SPD.Results[i].VlTotl[j] Total NoSlip Velocity
PROSPER.OUT.SPD.Results[i].VlEros[j] Erosional Velocity
PROSPER.OUT.SPD.Results[i].CFactr[j] C Factor
PROSPER.OUT.SPD.Results[i].SandDi[j] Maximum Garin Diameter
PROSPER.OUT.SPD.Results[i].RhoOil[j] Oil Density
PROSPER.OUT.SPD.Results[i].RhoGas[j] Gas Density
PROSPER.OUT.SPD.Results[i].RhoWat[j] Water Density
PROSPER.OUT.SPD.Results[i].RhoLiq[j] Liquid Density
PROSPER.OUT.SPD.Results[i].RhoMix[j] Mixture Density
PROSPER.OUT.SPD.Results[i].FmuOil[j] Oil Viscosity
PROSPER.OUT.SPD.Results[i].FmuWat[j] Water Viscosity
PROSPER.OUT.SPD.Results[i].FmuGas[j] Gas Viscosity
PROSPER.OUT.SPD.Results[i].FmuLiq[j] Liquid Viscosity
PROSPER.OUT.SPD.Results[i].SigLiq[j] Gas-Liquid Interfacial Tension
PROSPER.OUT.SPD.Results[i].SigWat[j] Gas-Water Interfacial Tension

OpenServer User's Manual


PROSPER and OpenServer 378

PROSPER.OUT.SPD.Results[i].SigOil[j] Gas-Oil Interfacial Tension


PROSPER.OUT.SPD.Results[i].SigOW[j] Oil-Water Interfacial Tension
PROSPER.OUT.SPD.Results[i].OilFvf[j] Oil FVF
PROSPER.OUT.SPD.Results[i].GasFvf[j] Gas FVF
PROSPER.OUT.SPD.Results[i].WatFvf[j] Water FVF
PROSPER.OUT.SPD.Results[i].EntOil[j] Oil Enthalpy
PROSPER.OUT.SPD.Results[i].EntWat[j] Water Enthalpy
PROSPER.OUT.SPD.Results[i].EntGas[j] Gas Enthalpy
PROSPER.OUT.SPD.Results[i].ConOil[j] Oil Conductivity
PROSPER.OUT.SPD.Results[i].ConWat[j] Water Conductivity
PROSPER.OUT.SPD.Results[i].ConGas[j] Gas Conductivity
PROSPER.OUT.SPD.Results[i].CprOil[j] Oil Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].CprWat[j] Water Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].CprGas[j] Gas Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].MassFlow[j] Total Mass Flow Rate
PROSPER.OUT.SPD.Results[i].MassO[j] Oil Mass Flow Rate
PROSPER.OUT.SPD.Results[i].MassG[j] Gas Mass Flow Rate
PROSPER.OUT.SPD.Results[i].MassW[j] Water Mass Flow Rate
PROSPER.OUT.SPD.Results[i].CumLiq[j] Cumulative Liquid Volume
PROSPER.OUT.SPD.Results[i].CumWat[j] Cumulative Water Volume
PROSPER.OUT.SPD.Results[i].CumOil[j] Cumulative Oil Volume
PROSPER.OUT.SPD.Results[i].CumGas[j] Cumulative Gas Volume
PROSPER.OUT.SPD.Results[i].CumLhl[j] Cumulative Liquid Holdup
PROSPER.OUT.SPD.Results[i].CumWhl[j] Cumulative Water Holdup
PROSPER.OUT.SPD.Results[i].WatHol[j] Water Holdup
PROSPER.OUT.SPD.Results[i].DiaInt[j] Diameter
PROSPER.OUT.SPD.Results[i].Angle[j] Angle From Vertical
PROSPER.OUT.SPD.Results[i].Dstep[j] Node Length
PROSPER.OUT.SPD.Results[i].SlugLm[j] Mean Slug Length
PROSPER.OUT.SPD.Results[i].SlugLx[j] 1/1000 Slug Length
PROSPER.OUT.SPD.Results[i].BubLnm[j] Mean Bubble Length
PROSPER.OUT.SPD.Results[i].BubLnx[j] 1/1000 Bubble Length
PROSPER.OUT.SPD.Results[i].SlugQl[j] Slug Liquid Rate
PROSPER.OUT.SPD.Results[i].SlugQg[j] Slug Gas Rate
PROSPER.OUT.SPD.Results[i].BublQl[j] Bubble Liquid Rate
PROSPER.OUT.SPD.Results[i].BublQg[j] Bubble Gas Rate
PROSPER.OUT.SPD.Results[i].SlgFrm[j] Mean Slug Frequency

© 1990-2018 Petroleum Experts Limited


379 OpenServer

PROSPER.OUT.SPD.Results[i].SlgFrx[j] 1/1000 Slug Frequency


PROSPER.OUT.SPD.Results[i].SlgHls[j] Slug Holdup
PROSPER.OUT.SPD.Results[i].SlgHle[j] Equilibrium Holdup
PROSPER.OUT.SPD.Results[i].SfSlgL[j] Slug Surge Factor (Liquid)
PROSPER.OUT.SPD.Results[i].SfSlgG[j] Slug Surge Factor (Gas)
PROSPER.OUT.SPD.Results[i].SfBubL[j] Bubble Surge Factor (Liquid)
PROSPER.OUT.SPD.Results[i].SfBubG[j] Bubble Surge Factor (Gas)
PROSPER.OUT.SPD.Results[i].PigLen[j] Cumulative Pigged Slug Length
PROSPER.OUT.SPD.Results[i].PigSvl[j] Cumulative Pigged Slug Volume
PROSPER.OUT.SPD.Results[i].PigTpr[j] Cumulative Slug Production Time
PROSPER.OUT.SPD.Results[i].PigTim[j] Cumulative Slug Residency Time
PROSPER.OUT.SPD.Results[i].StmQua[j] Steam Quality
PROSPER.OUT.SPD.Results[i].RhoStm[j] Steam Density
PROSPER.OUT.SPD.Results[i].FmuStm[j] Steam Viscosity
PROSPER.OUT.SPD.Results[i].FvfStm[j] Steam FVF
PROSPER.OUT.SPD.Results[i].EntStm[j] Steam Enthalpy
PROSPER.OUT.SPD.Results[i].CprStm[j] Steam Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].ConStm[j] Steam Conductivity
PROSPER.OUT.SPD.Results[i].GasFre[j] Free Gas Rate
PROSPER.OUT.SPD.Results[i].RhgS[j] Free Gas Density
PROSPER.OUT.SPD.Results[i].RhgS[j] Free Gas Viscosity
PROSPER.OUT.SPD.Results[i].FmuGs[j] Free Gas Viscosity
PROSPER.OUT.SPD.Results[i].GasFs[j] Free Gas FVF
PROSPER.OUT.SPD.Results[i].RhoVap[j] Vapour Density
PROSPER.OUT.SPD.Results[i].FmuVap[j] Vapour Viscosity
PROSPER.OUT.SPD.Results[i].EntTot[j] Total Enthalpy
PROSPER.OUT.SPD.Results[i].CprLiq[j] Liquid Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].CprVap[j] Vapour Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].CprMix[j] Mixture Specific Heat Capacity
PROSPER.OUT.SPD.Results[i].JtcOef[j] Joule-Thomson Coefficient

GasLift Gas Gradient


PROSPER.OUT.SPD.RESULTS[i].GasGrad. Number of calculation results (m)
NUM

j = 0:m-1
PROSPER.OUT.SPD.RESULTS[i].GasGrad. Depth

OpenServer User's Manual


PROSPER and OpenServer 380

Depth[j]
PROSPER.OUT.SPD.RESULTS[i].GasGrad. Pressure
Pres[j]

6.9.13 GLN - Gas Lift Design (New Well)

i = 0:7
PROSPER.OUT.GLN.MATCHL[i] Match Parameters for Liquid Rate
PROSPER.OUT.GLN.MATCHR[i] Match Parameters for Revenue

PROSPER.OUT.GLN.NUMPC No of Points in Performance Curve


(n)
i = 0:n-1
PROSPER.OUT.GLN.PCX[i] GLR Injected
PROSPER.OUT.GLN.PCY[i] Oil Produced / Revenue

Automatic Rate Calculation Results


PROSPER.OUT.GLN.GLR GLR Injected
PROSPER.OUT.GLN.CLL Liquid Rate
PROSPER.OUT.GLN.CLO Oil Rate
PROSPER.OUT.GLN.VLP VLP Pressure
PROSPER.OUT.GLN.IPR IPR PRessure
PROSPER.OUT.GLN.STD Standard Deviation of Curve Fit
PROSPER.OUT.GLN.GMX Max Gas Injected
PROSPER.OUT.GLN.OMX Max Oil Produced

Objective Gradient
PROSPER.OUT.GLN.MSD Measured Depth of Injection
PROSPER.OUT.GLN.TVD True Vertical Depth of Injection
PROSPER.OUT.GLN.PRS Pressure
PROSPER.OUT.GLN.TMP Temperature
PROSPER.OUT.GLN.GAS Gas Injection Pressure

PROSPER.OUT.GLN.NVPLOT Number of Points (n)


i= 0:n-1
PROSPER.OUT.GLN.COMPFL[i] Unloading Gradient – Pressure
PROSPER.OUT.GLN.DPPLOT[i] Unloading Gradient - Depth

© 1990-2018 Petroleum Experts Limited


381 OpenServer

PROSPER.OUT.GLN.LISTBOX.COUNT Number of Lines in ListBox (n)


i= 0:n-1
PROSPER.OUT.GLN.LISTBOX[i] Descriptive text

PROSPER.OUT.GLN.NVALR Number of Valves (n)


i= 0:n-1
PROSPER.OUT.GLN.PORT[i] Port Size
PROSPER.OUT.GLN.PTRTVD[i] Valve Transfer Pressure - Depth
PROSPER.OUT.GLN.PTRPRS[i] Valve Transfer Pressure - Pressure
PROSPER.OUT.GLN.PMAXAR[i] Max Transfer Pressure
PROSPER.OUT.GLN.PREFAR[i] Total Injected Gas Pressure
PROSPER.OUT.GLN.PGARRR[i] Actual Injected Gas Pressure
PROSPER.OUT.GLN.PMINAR[i] Minimum Transfer Pressure
PROSPER.OUT.GLN.DELTEF[i] Tubing Effect Pressure

Results
PROSPER.OUT.GLN.LEGEND[0] Maximum Gas Available
PROSPER.OUT.GLN.LEGEND[1] Flowing Top Node Pressure
PROSPER.OUT.GLN.LEGEND[2] Operating Injection Pressure
PROSPER.OUT.GLN.LEGEND[3] Water Cut
PROSPER.OUT.GLN.LEGEND[4] ACTUAL Liquid Rate
PROSPER.OUT.GLN.LEGEND[5] ACTUAL Oil Rate
PROSPER.OUT.GLN.LEGEND[6] ACTUAL Gas Injection Rate
PROSPER.OUT.GLN.LEGEND[7] ACTUAL Injection Pressure

Gradient Calculation Results


PROSPER.OUT.GLN.RESULTS[0].NUM Number of Gradient Results (n)

j = 0:n-1
PROSPER.OUT.GLN.RESULTS[0].REGIME[j] Flow Regime Number
PROSPER.OUT.GLN.RESULTS[0].LABEL[j] Label Number
PROSPER.OUT.GLN.RESULTS[0].PRES[j] Pressure
PROSPER.OUT.GLN.RESULTS[0].TEMP[j] Fluid Temperature
PROSPER.OUT.GLN.RESULTS[0].TVD[j] True Vertical Depth
PROSPER.OUT.GLN.RESULTS[0].MSD[j] Measured Depth
PROSPER.OUT.GLN.RESULTS[0].GRAD[j] Gradient
PROSPER.OUT.GLN.RESULTS[0].HOLDUP[j] Holdup

OpenServer User's Manual


PROSPER and OpenServer 382

PROSPER.OUT.GLN.RESULTS[0].HTC[j] Heat Transfer Coefficient


PROSPER.OUT.GLN.RESULTS[0].TFO[j] Formation Temperature
PROSPER.OUT.GLN.RESULTS[0].GRSTAT[j] Static Gradient
PROSPER.OUT.GLN.RESULTS[0].GRFRIC[j] Friction Gradient
PROSPER.OUT.GLN.RESULTS[0].VLSLIP[j] Slip Liquid Velocity
PROSPER.OUT.GLN.RESULTS[0].VLNSLP[j] NoSlip Liquid Velocity
PROSPER.OUT.GLN.RESULTS[0].VGSLIP[j] Slip Gas Velocity
PROSPER.OUT.GLN.RESULTS[0].VGNSLP[j] NoSlip Gas Velocity
PROSPER.OUT.GLN.RESULTS[0].AVRHSL[j] Mixture Density
PROSPER.OUT.GLN.RESULTS[0].PRSTAT[j] Pressure due to friction
PROSPER.OUT.GLN.RESULTS[0].PRFRIC[j] Pressure due to gravity
PROSPER.OUT.GLN.RESULTS[0].CASTEM[j] Casing temperature
PROSPER.OUT.GLN.RESULTS[0].ANNTEM[j] Average annulus temperature
PROSPER.OUT.GLN.RESULTS[0].RHOOIL[j] Gas density
PROSPER.OUT.GLN.RESULTS[0].RHOGAS[j] Oil density
PROSPER.OUT.GLN.RESULTS[0].RHOWAT[j] Water density
PROSPER.OUT.GLN.RESULTS[0].DIAINT[j] Diameter
PROSPER.OUT.GLN.RESULTS[0].ANGLE[j] Angle
PROSPER.OUT.GLN.RESULTS[0].DSTEP[j] Section length
PROSPER.OUT.GLN.RESULTS[0].FMULIQ[j] Liquid viscosity
PROSPER.OUT.GLN.RESULTS[0].FMUGAS[j] Gas viscosity
PROSPER.OUT.GLN.RESULTS[0].SIGLIQ[j] Gas-Liquid IFT
PROSPER.OUT.GLN.RESULTS[0].SIGWAT[j] Gas-Water IFT
PROSPER.OUT.GLN.RESULTS[0].SIGOIL[j] Gas-Oil IFT
PROSPER.OUT.GLN.RESULTS[0].SIGOW[j] Oil-Water IFT
PROSPER.OUT.GLN.RESULTS[0].SLUGLM[j] Mean Slug Length
PROSPER.OUT.GLN.RESULTS[0].SLUGLX[j] 1/000 Slug Length
PROSPER.OUT.GLN.RESULTS[0].BUBLNM[j] Mean Bubble Length
PROSPER.OUT.GLN.RESULTS[0].BUBLNX[j] 1/1000 Bubble Length
PROSPER.OUT.GLN.RESULTS[0].SLUGQL[j] Mean Slug Liquid Rate
PROSPER.OUT.GLN.RESULTS[0].SLUGQG[j] Mean Slug Gas Rate
PROSPER.OUT.GLN.RESULTS[0].BUBLQL[j] Mean Bubble Liquid Rate
PROSPER.OUT.GLN.RESULTS[0].BUBLQG[j] Mean Bubble Gas Rate
PROSPER.OUT.GLN.RESULTS[0].SLGFRM[j] Mean Slug Frequency
PROSPER.OUT.GLN.RESULTS[0].SLGFRX[j] 1/1000 Slug Frequency
PROSPER.OUT.GLN.RESULTS[0].SLGHLS[j] Slug Holdup (HLS)
PROSPER.OUT.GLN.RESULTS[0].SLGHLE[j] Equilibrium Holdup (HLE)

© 1990-2018 Petroleum Experts Limited


383 OpenServer

PROSPER.OUT.GLN.RESULTS[0].CFACTR[j] C Factor (Erosional Velocity)


PROSPER.OUT.GLN.RESULTS[0].SANDDI[j] Max Transportable Grain Diameter
PROSPER.OUT.GLN.RESULTS[0].CORR[j] Corrleation Index
PROSPER.OUT.GLN.RESULTS[0].HYDRATE[j] Hydrates Formation Flag

Injected Gas Gradient


PROSPER.OUT.GLN.RESULTS[0].GASGRAD.N Number of Points (i)
UM

i = 0:n-1
PROSPER.OUT.GLN.RESULTS[0].GasGrad.Dept Depth
h[i]
PROSPER.OUT.GLN.RESULTS[0].GasGrad.Pres Pressure
[i]

6.9.14 GLE - Gas Lift Design (Existing Well)

i = 0:7
PROSPER.OUT.GLE.MATCHL[i] Match Parameters for Liquid Rate
PROSPER.OUT.GLE.MATCHR[i] Match Parameters for Revenue

PROSPER.OUT.GLE.NUMPC No of Points in Performance Curve


(n)
i = 0:n-1
PROSPER.OUT.GLE.PCX[i] GLR Injected
PROSPER.OUT.GLE.PCY[i] Oil Produced / Revenue

Automatic Rate Calculation Results


PROSPER.OUT.GLE.GLR GLR Injected
PROSPER.OUT.GLE.CLL Liquid Rate
PROSPER.OUT.GLE.CLO Oil Rate
PROSPER.OUT.GLE.VLP VLP Pressure
PROSPER.OUT.GLE.IPR IPR PRessure
PROSPER.OUT.GLE.STD Standard Deviation of Curve Fit
PROSPER.OUT.GLE.GMX Max Gas Injected
PROSPER.OUT.GLE.OMX Max Oil Produced

Objective Gradient

OpenServer User's Manual


PROSPER and OpenServer 384

PROSPER.OUT.GLE.MSD Measured Depth of Injection


PROSPER.OUT.GLE.TVD True Vertical Depth of Injection
PROSPER.OUT.GLE.PRS Pressure
PROSPER.OUT.GLE.TMP Temperature
PROSPER.OUT.GLE.GAS Gas Injection Pressure

PROSPER.OUT.GLE.NVPLOT Number of Points (n)


i= 0:n-1
PROSPER.OUT.GLE.COMPFL[i] Unloading Gradient – Pressure
PROSPER.OUT.GLE.DPPLOT[i] Unloading Gradient - Depth

PROSPER.OUT.GLE.LISTBOX.COUNT Number of Lines in ListBox (n)


i= 0:n-1
PROSPER.OUT.GLE.LISTBOX[i] Descriptive text

PROSPER.OUT.GLE.NVALR Number of Valves (n)


i= 0:n-1
PROSPER.OUT.GLE.PORT[i] Port Size
PROSPER.OUT.GLE.PTRTVD[i] Valve Transfer Pressure - Depth
PROSPER.OUT.GLE.PTRPRS[i] Valve Transfer Pressure - Pressure
PROSPER.OUT.GLE.PMAXAR[i] Max Transfer Pressure
PROSPER.OUT.GLE.PREFAR[i] Total Injected Gas Pressure
PROSPER.OUT.GLE.PGARRR[i] Actual Injected Gas Pressure
PROSPER.OUT.GLE.PMINAR[i] Minimum Transfer Pressure
PROSPER.OUT.GLE.DELTEF[i] Tubing Effect Pressure

Results
PROSPER.OUT.GLE.LEGEND[0] Maximum Gas Available
PROSPER.OUT.GLE.LEGEND[1] Flowing Top Node Pressure
PROSPER.OUT.GLE.LEGEND[2] Operating Injection Pressure
PROSPER.OUT.GLE.LEGEND[3] Water Cut
PROSPER.OUT.GLE.LEGEND[4] ACTUAL Liquid Rate
PROSPER.OUT.GLE.LEGEND[5] ACTUAL Oil Rate
PROSPER.OUT.GLE.LEGEND[6] ACTUAL Gas Injection Rate
PROSPER.OUT.GLE.LEGEND[7] ACTUAL Injection Pressure

Gradient Calculation Results


PROSPER.OUT.GLE.RESULTS[0].NUM Number of Gradient Results (n)

© 1990-2018 Petroleum Experts Limited


385 OpenServer

j = 0:n-1
PROSPER.OUT.GLE.RESULTS[0].REGIME[j] Flow Regime Number
PROSPER.OUT.GLE.RESULTS[0].LABEL[j] Label Number
PROSPER.OUT.GLE.RESULTS[0].PRES[j] Pressure
PROSPER.OUT.GLE.RESULTS[0].TEMP[j] Fluid Temperature
PROSPER.OUT.GLE.RESULTS[0].TVD[j] True Vertical Depth
PROSPER.OUT.GLE.RESULTS[0].MSD[j] Measured Depth
PROSPER.OUT.GLE.RESULTS[0].GRAD[j] Gradient
PROSPER.OUT.GLE.RESULTS[0].HOLDUP[j] Holdup
PROSPER.OUT.GLE.RESULTS[0].HTC[j] Heat Transfer Coefficient
PROSPER.OUT.GLE.RESULTS[0].TFO[j] Formation Temperature
PROSPER.OUT.GLE.RESULTS[0].GRSTAT[j] Static Gradient
PROSPER.OUT.GLE.RESULTS[0].GRFRIC[j] Friction Gradient
PROSPER.OUT.GLE.RESULTS[0].VLSLIP[j] Slip Liquid Velocity
PROSPER.OUT.GLE.RESULTS[0].VLNSLP[j] NoSlip Liquid Velocity
PROSPER.OUT.GLE.RESULTS[0].VGSLIP[j] Slip Gas Velocity
PROSPER.OUT.GLE.RESULTS[0].VGNSLP[j] NoSlip Gas Velocity
PROSPER.OUT.GLE.RESULTS[0].AVRHSL[j] Mixture Density
PROSPER.OUT.GLE.RESULTS[0].PRSTAT[j] Pressure due to friction
PROSPER.OUT.GLE.RESULTS[0].PRFRIC[j] Pressure due to gravity
PROSPER.OUT.GLE.RESULTS[0].CASTEM[j] Casing temperature
PROSPER.OUT.GLE.RESULTS[0].ANNTEM[j] Average annulus temperature
PROSPER.OUT.GLE.RESULTS[0].RHOOIL[j] Gas density
PROSPER.OUT.GLE.RESULTS[0].RHOGAS[j] Oil density
PROSPER.OUT.GLE.RESULTS[0].RHOWAT[j] Water density
PROSPER.OUT.GLE.RESULTS[0].DIAINT[j] Diameter
PROSPER.OUT.GLE.RESULTS[0].ANGLE[j] Angle
PROSPER.OUT.GLE.RESULTS[0].DSTEP[j] Section length
PROSPER.OUT.GLE.RESULTS[0].FMULIQ[j] Liquid viscosity
PROSPER.OUT.GLE.RESULTS[0].FMUGAS[j] Gas viscosity
PROSPER.OUT.GLE.RESULTS[0].SIGLIQ[j] Gas-Liquid IFT
PROSPER.OUT.GLE.RESULTS[0].SIGWAT[j] Gas-Water IFT
PROSPER.OUT.GLE.RESULTS[0].SIGOIL[j] Gas-Oil IFT
PROSPER.OUT.GLE.RESULTS[0].SIGOW[j] Oil-Water IFT
PROSPER.OUT.GLE.RESULTS[0].SLUGLM[j] Mean Slug Length
PROSPER.OUT.GLE.RESULTS[0].SLUGLX[j] 1/000 Slug Length

OpenServer User's Manual


PROSPER and OpenServer 386

PROSPER.OUT.GLE.RESULTS[0].BUBLNM[j] Mean Bubble Length


PROSPER.OUT.GLE.RESULTS[0].BUBLNX[j] 1/1000 Bubble Length
PROSPER.OUT.GLE.RESULTS[0].SLUGQL[j] Mean Slug Liquid Rate
PROSPER.OUT.GLE.RESULTS[0].SLUGQG[j] Mean Slug Gas Rate
PROSPER.OUT.GLE.RESULTS[0].BUBLQL[j] Mean Bubble Liquid Rate
PROSPER.OUT.GLE.RESULTS[0].BUBLQG[j] Mean Bubble Gas Rate
PROSPER.OUT.GLE.RESULTS[0].SLGFRM[j] Mean Slug Frequency
PROSPER.OUT.GLE.RESULTS[0].SLGFRX[j] 1/1000 Slug Frequency
PROSPER.OUT.GLE.RESULTS[0].SLGHLS[j] Slug Holdup (HLS)
PROSPER.OUT.GLE.RESULTS[0].SLGHLE[j] Equilibrium Holdup (HLE)
PROSPER.OUT.GLE.RESULTS[0].CFACTR[j] C Factor (Erosional Velocity)
PROSPER.OUT.GLE.RESULTS[0].SANDDI[j] Max Transportable Grain Diameter
PROSPER.OUT.GLE.RESULTS[0].CORR[j] Corrleation Index
PROSPER.OUT.GLE.RESULTS[0].HYDRATE[j] Hydrates Formation Flag

Injected Gas Gradient


PROSPER.OUT.GLE.RESULTS[0].GASGRAD.N Number of Points (i)
UM

i = 0:n-1
PROSPER.OUT.GLE.RESULTS[0].GasGrad.Dept Depth
h[i]
PROSPER.OUT.GLE.RESULTS[0].GasGrad.Pres Pressure
[i]

6.9.15 GLI - Gas Lift Design (Intermittent)

Input Data
PROSPER.SIN.GLI.Input[0] Surface Injection Pressure
PROSPER.SIN.GLI.Input[1] Injection Depth
PROSPER.SIN.GLI.Input[2] Gaslift Gas Gravity
PROSPER.SIN.GLI.Input[3] Wellhead Pressure
PROSPER.SIN.GLI.Input[4] Valve Port Size
PROSPER.SIN.GLI.Input[5] Water Cut
PROSPER.SIN.GLI.Input[6] Tubing Liquid Level

Results

© 1990-2018 Petroleum Experts Limited


387 OpenServer

PROSPER.SIN.GLI.Results[0] Downhole Injection Pressure


PROSPER.SIN.GLI.Results[1] Downhole Pressure
PROSPER.SIN.GLI.Results[2] Slug Velocity
PROSPER.SIN.GLI.Results[13] Bubble Velocity
PROSPER.SIN.GLI.Results[3] Gas Injection Rate
PROSPER.SIN.GLI.Results[4] Fall Back
PROSPER.SIN.GLI.Results[5] Produced Slug Length
PROSPER.SIN.GLI.Results[6] Produced Slug Volume
PROSPER.SIN.GLI.Results[7] Pcasing / Pslug
PROSPER.SIN.GLI.Results[8] Produced/Accumulated Slug Length
PROSPER.SIN.GLI.Results[9] Starting Slug Length / Valve Depth
PROSPER.SIN.GLI.Results[10] Time To Surface
PROSPER.SIN.GLI.Results[11] Cycle Frequency
PROSPER.SIN.GLI.Results[12] Daily Production Rate

6.9.16 ESP - ESP Design

PROSPER.OUT.ESP.DONE Calculation done flag

Design List-Box Results


PROSPER.OUT.ESP.ListBox.COUNT Counts the number of list box contents
PROSPER.OUT.ESP.ListBox[0] Wellhead pressure
PROSPER.OUT.ESP.ListBox[1] Flowing bottomhole pressure
PROSPER.OUT.ESP.ListBox[2] Water cut
PROSPER.OUT.ESP.ListBox[3] Pump frequency
PROSPER.OUT.ESP.ListBox[4] Pump intake pressure
PROSPER.OUT.ESP.ListBox[5] Pump intake temperature
PROSPER.OUT.ESP.ListBox[6] Pump intake rate
PROSPER.OUT.ESP.ListBox[7] Free GOR entering pump
PROSPER.OUT.ESP.ListBox[8] Pump discharge pressure
PROSPER.OUT.ESP.ListBox[9] Pump discharge rate
PROSPER.OUT.ESP.ListBox[10] Total GOR above pump
PROSPER.OUT.ESP.ListBox[11] Mass flow rate
PROSPER.OUT.ESP.ListBox[12] Total fluid gravity
PROSPER.OUT.ESP.ListBox[13] Average downhole rate
PROSPER.OUT.ESP.ListBox[14] Head required

OpenServer User's Manual


PROSPER and OpenServer 388

PROSPER.OUT.ESP.ListBox[15] Actual head required


PROSPER.OUT.ESP.ListBox[16] Fluid power requried
PROSPER.OUT.ESP.ListBox[17] GLR @ pump intake (V/V)
PROSPER.OUT.ESP.ListBox[18] Gas fraction @ pump intake
PROSPER.OUT.ESP.ListBox[19] Bo @ pump intake
PROSPER.OUT.ESP.ListBox[20] Bg @ pump intake
PROSPER.OUT.ESP.ListBox[21] Average cable temperature

Dunbar Plot Results


PROSPER.OUT.ESP.ESPPR1 Test point pressure
PROSPER.OUT.ESP.ESPGL1 Test point GLR

i = 0:19
PROSPER.OUT.ESP.ESPPRS[i] Test curve pressures

j = 0:9
PROSPER.OUT.ESP.ESPGLR[i][j] i=0:19
j=0:9

i = 0:9
PROSPER.OUT.ESP.ESPDBX[i] Dunbar curve GLR
PROSPER.OUT.ESP.ESPDBY[i] Dunbar curve pressure

Dunbar Plot Test Data


i = 0:19
PROSPER.OUT.ESP.NUM Number of user entered points
PROSPER.OUT.ESP.USERGOR[i] User entered GOR
PROSPER.OUT.ESP.USERPIP[i] User entered pump intake pressure
PROSPER.OUT.ESP.USERLAB User entered label

Design Menu Results


PROSPER.OUT.ESP.PMPREQ Head required
PROSPER.OUT.ESP.PUMRAT Average downhole rate
PROSPER.OUT.ESP.PUMPGR Total fluid gravity
PROSPER.OUT.ESP.PUMPGF Free GOR below pump
PROSPER.OUT.ESP.PUMPGA Total GOR above pump
PROSPER.OUT.ESP.PUMPIT Pump inlet temperature
PROSPER.OUT.ESP.PUMPIP Pump intake pressure

© 1990-2018 Petroleum Experts Limited


389 OpenServer

PROSPER.OUT.ESP.PUMPIR Pump intake rate


PROSPER.OUT.ESP.PUMPDR Pump discharge rate
PROSPER.OUT.ESP.PUMPMF Pump mass flow rate
PROSPER.OUT.ESP.PUMPAT Average cable temperature
PROSPER.SIN.ESP.DesPump Select pump
PROSPER.SIN.ESP.DesMotor Select motor
PROSPER.SIN.ESP.DesCable Select cable
PROSPER.OUT.ESP.NSTAGE Number of stages
PROSPER.OUT.ESP.PUMPOW Power required
PROSPER.OUT.ESP.PEFFIC Pump efficiency
PROSPER.OUT.ESP.PUMPOT Pump outlet temperature
PROSPER.OUT.ESP.XMTAMP Current used
PROSPER.OUT.ESP.SURKVA Surface KVA
PROSPER.OUT.ESP.XMTEFF Motor efficiency
PROSPER.OUT.ESP.XMTPOW Power generated
PROSPER.OUT.ESP.XMTRPM Motor speed
PROSPER.OUT.ESP.VOLDRP Voltage drop along cable
PROSPER.OUT.ESP.VOLTSF Voltage required at surface
PROSPER.OUT.ESP.TORQUE Torque on shaft
PROSPER.OUT.ESP.SIZE Pump size

6.9.17 HSP - HSP Design

PROSPER.OUT.HSP.DONE Calculation done flag

Design List-Box Results


PROSPER.OUT.HSP.ListBox.COUNT Counts the number of list box contents
PROSPER.OUT.HSP.ListBox[0] Well Head Pressure
PROSPER.OUT.HSP.ListBox[1] Flowing BH Pressure
PROSPER.OUT.HSP.ListBox[2] Pump Intake Pressure
PROSPER.OUT.HSP.ListBox[3] Pump Intake Rate
PROSPER.OUT.HSP.ListBox[4] Free GOR Entering Pump
PROSPER.OUT.HSP.ListBox[5] Pump Discharge Pressure
PROSPER.OUT.HSP.ListBox[6] Pump Dischage Rate
PROSPER.OUT.HSP.ListBox[7] Total GOR Above Pump
PROSPER.OUT.HSP.ListBox[8] Mass Flow Rate

OpenServer User's Manual


PROSPER and OpenServer 390

PROSPER.OUT.HSP.ListBox[9] Total Fluid Gravity


PROSPER.OUT.HSP.ListBox[10] Average Downhole Rate
PROSPER.OUT.HSP.ListBox[11] Head Required
PROSPER.OUT.HSP.ListBox[12] Fluid Power required
PROSPER.OUT.HSP.ListBox[13] GLR At Pump Intake(V/V)
PROSPER.OUT.HSP.ListBox[14] Bo At Pump Intake (V/V)
PROSPER.OUT.HSP.ListBox[15] Inlet Temperature
PROSPER.OUT.HSP.ListBox[16] Bg At Pump Intake (V/V)

Input Data
PROSPER.OUT.HSP.Sol[0] Head Required
PROSPER.OUT.HSP.Sol[1] Average Downhole Rate
PROSPER.OUT.HSP.Sol[2] Total Fluid Gravity
PROSPER.OUT.HSP.Sol[3] Free GOR Below Pump
PROSPER.OUT.HSP.Sol[4] Total GOR Above Pump
PROSPER.OUT.HSP.Sol[5] Pump Inlet Temperature
PROSPER.OUT.HSP.Sol[6] Pump Intake Pressure
PROSPER.OUT.HSP.Sol[7] Pump Intake Rate
PROSPER.OUT.HSP.Sol[8] Pump Discharge Pressure
PROSPER.OUT.HSP.Sol[9] Pump Discharge Rate
PROSPER.OUT.HSP.Sol[10] Pump Mass Flow Rate
PROSPER.SIN.HSP.PumpSpeed Pump Speed

Results
PROSPER.OUT.HSP.Sol[11] Number Of Pump Stages
PROSPER.OUT.HSP.Sol[12] Pump Power Required
PROSPER.OUT.HSP.Sol[13] Pump Efficiency
PROSPER.OUT.HSP.Sol[14] Pump Outlet Temperature
PROSPER.OUT.HSP.Sol[15] Number Of Turbine Stages
PROSPER.OUT.HSP.Sol[16] Turbine Power Generated
PROSPER.OUT.HSP.Sol[17] Delta P Across Turbine
PROSPER.OUT.HSP.Sol[18] Head Loss Across Turbine
PROSPER.OUT.HSP.Sol[19] Pressure @ Surface
PROSPER.OUT.HSP.Sol[20] % Power Fluid Of Reservoir Fluid
PROSPER.OUT.HSP.Sol[21] Balance Supply Rate

© 1990-2018 Petroleum Experts Limited


391 OpenServer

6.10 Commands

File Management
PROSPER.SHUTDOWN Exit the PROSPER program
PROSPER.OPENFILE Open an existing file
Example:
DoCmd ("PROSPER.OPENFILE(""C:
\test.Out"")") - opens a macro code based
PROSPER file.
DoCmd ("PROSPER.OPENFILE=""" +
Range("a3") + """") - opens an Excel
spreadsheet based PROSPER file.
DoCmd ("PROSPER.OPENFILE(" +
Range("a3")) - alternative method to open an
Excel spreadsheet based PROSPER file.
PROSPER.SAVEFILE Save the current data set to file. The file path
should be provided in the same way as for
.OPENFILE command.
PROSPER.NEWFILE Reset the current data set to initial conditions. If
the file is not saved the changes will be lost.
PROSPER.REFRESH Redraw the font screen to update any changes

Units
PROSPER.MENU.UNITS.OILFIELD Select Oil Field units
PROSPER.MENU.UNITS.NORSI Select Norwegian SI units
PROSPER.MENU.UNITS.CANSI Select Canadian SI units
PROSPER.MENU.UNITS.GERSI Select German SI units
PROSPER.MENU.UNITS.FRESI Select French SI units
PROSPER.MENU.UNITS.LATSI Select Latin SI units
PROSPER.UNITS.RESET Resets the unit system to default (oil field units)

PVT Section
PROSPER.PVT.CALC Perform the calculation command in the PVT
section
PROSPER.PVT.MATCH Perform the PVT matching regression
PROSPER.PVT.MATCHALL Perform the PVT matching for ALL variables
and correlations
PROSPER.PVT.INPUT.WGRMIN Calculate minimum free WGR
PROSPER.EOS.INT EOS - interpolate
PROSPER.EOS.GEN EOS - generate

OpenServer User's Manual


PROSPER and OpenServer 392

PROSPER.EOS.HYD EOS - calculate hydrates pressure curve


PROSPER.EOS.PROP EOS - calculate black oil properties
PROSPER.EOS.PHASE EOS - calculate phase envelope
PROSPER.EOS.WAX EOS - calculate wax apperance temperature
PROSPER.EOS.PTS.ADD("ptsname") Adds a path to surface object definition
PROSPER.EOS.PTS(i).REMOVE Removes the i path to surface object. All the
indices of the path to surface after the one
being removed are going to change:
recommended to use strings.
PROSPER.EOS.PTS(i).IMPORT("filena Imports a *.prc file to the i path to surface object
me")
PROSPER.EOS.PTS(i).EXPORT("filen Exports the i path to surface to a *.prc file
ame")
PROSPER.EOS.PTS(i).RENAME("new Renames the i path to surface object
name")
PROSPER.EOS.PTS(i).ADDEQUIPME Adds equipment to the i path to surface object.
NT(equip, label, coordinates) Arguments
equip - Separator, Joint, Chiller
label - label of equipment
coordinates - xy coordinates of equipment
(from 0 to 1)

Example:
DoCmd
"PROSPER.EOS.PTS[0].ADDEQUIPMENT(""
Separator"", ""sep1"", 0.33,0.5)"
PROSPER.EOS.PTS(i).ADDCONNEC Adds a connection between two pieces of
TION(equip1, label1, output1, equip2, equipment for the i path to surface
label2, input2) Arguments
equip1 - Separator, Joint, Chiller, Source,
Export
label1 - label of equipment
output1 - Liquid, Vapour, Output
equip2 - Same as equip1
label2 - label of equipment
input2 - Liquid, Vapour, Input

Example:
DoCmd
"GAP.MOD[{PROD}].FLASHOPTIONS.PTS[0].
ADDCONNECTION(""Source"", ""Source"",
""Output"", ""Separator"", ""sep1"", ""Input"")"
PROSPER.EOS.PTS(i).REMOVEEQUI Removes equipment from the i path to surface
PMENT(equip, label) object.

© 1990-2018 Petroleum Experts Limited


393 OpenServer

Arguments
equip - Separator, Joint, Chiller
label - label of equipment
PROSPER.EOS.PTS(i).REMOVECON Removes a connection between two pieces of
NECTION(equip1, label1, output1, equipment in the i path to surface object. For
equip2, label2, input2) argument definitions see adding a connection
above.
PROSPER.EOS.PTS.UPDATEVALID Updates the validation flags used in the
ATION interface. To be used when you build a path to
surface object from the OpenServer

Inflow Section
PROSPER.IPR.CALC Perform the inflow calculation
PROSPER.IPR.API43 Perform the API RP43 calculation
PROSPER.ANL.INF.CALC Perfoms the inflow sensitivity calculation
PROSPER.ANL.INF.GENRATES Generate rates for the inflow sensitivity
calculation

Downhole Equipment Section


PROSPER.EQP.DEV.FIL.FILTER Perform the filter calculation in the deviation
survey section
PROSPER.EQP.DEV.FIL.RESET Resets the deviation survey filter calculation
PROSPER.EQP.DEV.FIL.TRANS Transfers the deviation survey filter data to the
deviation survey section
PROSPER.EQP.DEV.FIL.CALC Calculates the angle in the deviation survey
filter

System Calculations
PROSPER.ANL.SYS.CALC Performs the system calculation
PROSPER.ANL.SYS.GENRATES Generates rates for the system calculation
PROSPER.ANL.SYS.EXPORT Export lift curves generated by the system 3-
variable calculation

Sensitivity PvD Calculations


PROSPER.ANL.SPD.CALC Performs the sensitivity PvD calculation

Gradient Calculations
PROSPER.ANL.GMT.CALC Performs the gradient matching calculation
PROSPER.ANL.GRD.CALC Performs the gradient sensitivity calculation

Tubing / Pipeline Correlation Comparison

OpenServer User's Manual


PROSPER and OpenServer 394

PROSPER.ANL.TCC.CALC Performs the tubing correlation comparison


PROSPER.ANL.TTC.CALC Performs the tubing correlation comparison
(Enthalpy Balance)
PROSPER.ANL.TPC.CALC Performs the pipeline correlation comparison
(Enthalpy Balance)
PROSPER.ANL.PCC.CALC Performs the pipeline correlation comparison

VLP Calculations
PROSPER.ANL.VLP.CALC Performs the VLP calculation
PROSPER.ANL.VLP.GENRATES Generate rates for the VLP calculation
PROSPER.ANL.VLP.EXPORT Export lift curves generated by the VLP
calculation

Choke Performance
PROSPER.ANL.CHK.CALC Performs the choke performance

VLP / IPR Matching


PROSPER.ANL.VMT.UVAL Estimate U-value for the VLP / IPR matching
PROSPER.ANL.VMT.CALC Performs VLP matching
PROSPER.ANL.VMT.VLPIPR(i, j) Performs the VLP / IPR calculation
i - index of the correlation, starts with 1.
Setting to 0 will run calculations for all
correlations;
j - index of the test record, starts with 1.
Setting to 0 will run calculations for all tests.
PROSPER.ANL.VMT.ADJUSTPI(j) Adjusts PI for the selected well test record. Only
available for PI Entry IPR model.
j - record index (starts from 1). Setting i to 0
will adjust PI for all well tests.
PROSPER.ANL.VMT.ADJUSTPRES(j) Adjusts Reservoir Pressure for the selected
well test record.
j - record index (starts from 1). Setting i to 0
will adjust Reservoir Pressure for all well
tests.
PROSPER.ANL.VMT.ADJUSTSKIN(j) Adjusts Skin factor for the selected well test
record. Only available if "Enter Skin by Hand" is
selcted in the IPR section.
j - record index (starts from 1). Setting i to 0
will adjust Reservoir Pressure for all well
tests.

Pipeline Matching

© 1990-2018 Petroleum Experts Limited


395 OpenServer

PROSPER.ANL.PMT.CALC Performs the pipeline matching

GAP Performance Curves


PROSPER.ANL.GEN.CALC Generates GAP performance curve

Artificial Lift Design & Quick-Look


PROSPER.ANL.GLN.CALC Performs the gas lift design (New Well). This
command will also perform the Calculations for
the Gas Lift Performance Curve (when using
the method as Calculated from Max
Production). In the Results section the
Calculations for the Dome Pressure and Test
Rack Opening Pressure are also performed
with the help of this command.
PROSPER.ANL.GLE.CALC Performs the gas lift design (Existing Well)
PROSPER.ANL.GLI.CALC Performs the gas lift design (Intermittent Gas
Lift)
PROSPER.ANL.CLT.CALC Performs the coil tubing gas lift design
calculation
PROSPER.ANL.GLA.CALC Performs the gas lift adjustments calculation
PROSPER.ANL.ESP.CALC Performs the ESP design calculation
PROSPER.ANL.ESP.PLOT.CALC Calculate the ESP Plot Data after design and
pump selection
PROSPER.ANL.HSP.CALC Performs the HSP design calculation
PROSPER.ANL.HSP.SYS.CALC Performs the System Command in the HSP
design section
PROSPER.ANL.PCP.CALC Performs the PCP design calculation
PROSPER.ANL.JET.CALC Performs the jet pump design calculation
PROSPER.ANL.JET.DESIGN Performs the jet pump design Pump Selection
calculation
PROSPER.ANL.QLG.CALC Performs the quick-look gas lift
PROSPER.ANL.QLE.CALC Performs the quick-look ESP
PROSPER.ANL.QLH.CALC Performs the quick-look HSP
PROSPER.ANL.SRP.CALC Performs the sucker rod pump design

BHP From WHP Calculation


PROSPER.ANL.WHP.CALC Performs the WHP to BHP calculation

Menu Commands - File


PROSPER.MENU.FILE.IMPORTMANY Import files

OpenServer User's Manual


PROSPER and OpenServer 396

PROSPER.MENU.FILE.IMPORTADD Add import type


PROSPER.MENU.FILE.PRINTSET Printer set up
PROSPER.MENU.FILE.REMOTE Software key
PROSPER.MENU.FILE.CLIPBOARD Clipboard
PROSPER.MENU.FILE.WORDPAD WordPad
PROSPER.MENU.FILE.APP1 User application 1
PROSPER.MENU.FILE.APP2 User application 2
PROSPER.MENU.FILE.APP3 User application 3
PROSPER.MENU.FILE.APP4 User application 4
PROSPER.MENU.FILE.USER_FLOW User correlations - flow correlations
PROSPER.MENU.FILE.USER_EOS user correlations - EOS model
PROSPER.MENU.FILE.USER_CHOK User correlations - choke model
E
PROSPER.MENU.FILE.USER_HSP User correlations - ESP / HSP gas de-rating
model
PROSPER.MENU.FILE.USER_VISC User correlations - viscosity model
PROSPER.MENU.FILE.USER_IPR User corrlations - inflow performance model
PROSPER.MENU.FILE.PREFERENC File preferences
ES
PROSPER.MENU.FILE.FILELIST File list
PROSPER.MENU.FILE.EVAL Evaluate OpenServer statement

Menu Commands - Options


PROSPER.MENU.OPTIONS Options

Menu Commands - PVT


PROSPER.MENU.PVT.INPUT PVT input
PROSPER.MENU.PVT.TABLE PVT table
PROSPER.MENU.PVT.MATCH PVT match
PROSPER.MENU.PVT.CALC PVT calculation
PROSPER.MENU.PVT.REGRESS PVT matching (regression)
PROSPER.MENU.PVT.SAVE save a PVT (*.pvt) file
PROSPER.MENU.PVT.OPEN Open a *.pvt file
PROSPER.MENU.PVT.CORREL PVT correlation parameters
PROSPER.MENU.PVT.STEAM Steam calculator
PROSPER.MENU.PVT.REPORT PVT report
PROSPER.MENU.PVT.EXPORT PVT export

© 1990-2018 Petroleum Experts Limited


397 OpenServer

Menu Commands - System


PROSPER.MENU.SIN.EQUIP Equipment (tubing, etc.)
PROSPER.MENU.SIN.IPR System inflow performance
PROSPER.MENU.SIN.EDITEQUIP Edit ALL system equipment (tubing, etc.)
PROSPER.MENU.SIN.EQUIPSUM Display equipment summary
PROSPER.MENU.SIN.GAS Gas lift data
PROSPER.MENU.SIN.ESP Electrical submersible pumps
PROSPER.MENU.SIN.HSP Hydraulic submersible pumps
PROSPER.MENU.SIN.PCP Progressive cavity pumps
PROSPER.MENU.SIN.CLT Coil tubing data
PROSPER.MENU.SIN.DIL Diluent injection
PROSPER.MENU.SIN.JET Jet pumps
PROSPER.MENU.SIN.MPP Multi-phase pumps
PROSPER.MENU.SIN.SRP Sucker rod pumps
PROSPER.MENU.SIN.GLI Intermittent gas lift
PROSPER.MENU.SIN.SOLIDS Solids
PROSPER.MENU.MATCH.VLP Matching - VLP / IPR quality check
PROSPER.MENU.MATCH.GRADIENT Matching - gradient traverse
PROSPER.MENU.MATCH.PIPE Matching - pipeline
PROSPER.MENU.MATCH.COMPTUB Matching - correlation comparison - Tubing
E
PROSPER.MENU.MATCH.COMPPIPE Matching - comparison - pipeline
PROSPER.MENU.MATCH.PARMTUB Matching - correlation comparison parameters
E - Tubing
PROSPER.MENU.MATCH.PARMPIPE Matching - correlation comparison parameters
- Pipeline
PROSPER.MENU.MATCH.THRESHO Matching - correlation thresholds
LD
PROSPER.MENU.MATCH.QUICKLOO Matching - quick-look
K

Menu Commands - Calculation


PROSPER.MENU.ANL.IPR Inflow (IPR)
PROSPER.MENU.ANL.SYSTEM System calculations menu
PROSPER.MENU.ANL.GRADIENT Gradient traverse
PROSPER.MENU.ANL.VLP VLP calculations menu
PROSPER.MENU.ANL.GENGAP Generate for GAP
PROSPER.MENU.ANL.CHOKEPERF Choke performance

OpenServer User's Manual


PROSPER and OpenServer 398

PROSPER.MENU.ANL.WHP2BHP BHP from WHP

Menu Commands - Design


PROSPER.MENU.DESIGN.DATABAS Artificial lift database
E
PROSPER.MENU.DESIGN.GLD.NEW Gas lift - new well
PROSPER.MENU.DESIGN.GLD.EXIS Gas lift - existing mandrels
T
PROSPER.MENU.DESIGN.GLD.ADJU Gas lift - gas lift adjustments
ST
PROSPER.MENU.DESIGN.CLT Coil tubing gas lift
PROSPER.MENU.DESIGN.ESP Electrical submersible pump
PROSPER.MENU.DESIGN.HSP Hydraulic pump
PROSPER.MENU.DESIGN.PCP Progressive cavity pump
PROSPER.MENU.DESIGN.JET Jet pump

Menu Commands - Output


PROSPER.MENU.OUTPUT.REPORT Report
PROSPER.MENU.OUTPUT.EXPORT Export
PROSPER.MENU.OUTPUT.PLOT Plot

Menu Commands - Help


PROSPER.MENU.HELP_CONTENTS Contents
PROSPER.MENU.HELP_INDEX Index
PROSPER.MENU.HELP_SEARCH search
PROSPER.MENU.HELP_KEYBOARD Keyboard
PROSPER.MENU.HELP_WHATSNE What's new
W
PROSPER.MENU.HELP_QUICKSTAR Quick start guide
T
PROSPER.MENU.HELP_EXAMPLE Worked examples
PROSPER.MENU.HELP_DEFINITION Definitions and references
S
PROSPER.MENU.HELP_GLOSSARY Glossary of terms
PROSPER.MENU.HELP_MANUAL Manual
PROSPER.MENU.HELP_FLOWCORR Flow correlations
PROSPER.MENU.HELP_OS_COMMA OpenServer commands
ND
PROSPER.MENU.HELP_OS_VARIAB OpenServer variables

© 1990-2018 Petroleum Experts Limited


399 OpenServer

LES
PROSPER.MENU.HELP_OS_HELP OpenServer help
PROSPER.MENU.HELP_ABOUT About PROSPER
PROSPER.MENU.HELP_WEB_HOME Web home page
PROSPER.MENU.HELP_WEB_USER Web user area

Calculation Plots
PROSPER.PLOT.1 IPR
PROSPER.PLOT.2 VLP matching IPR
PROSPER.PLOT.3 Inflow
PROSPER.PLOT.4 System
PROSPER.PLOT.5 System (selected curves)
PROSPER.PLOT.6 Gas lift design
PROSPER.PLOT.7 Gas lift design (selected curves)
PROSPER.PLOT.8 ESP pump plot
PROSPER.PLOT.9 ESP solution pump plot
PROSPER.PLOT.10 ESP design pump plot
PROSPER.PLOT.11 Sensitivity
PROSPER.PLOT.12 Sensitivity PvD
PROSPER.PLOT.13 Sensitivity PvD (selected curves)
PROSPER.PLOT.14 Deviation survey
PROSPER.PLOT.15 Constrained VLP
PROSPER.PLOT.16 Unconstrained system
PROSPER.PLOT.17 Unconstrained VLP
PROSPER.PLOT.18 Generate for GAP
PROSPER.PLOT.19 Gas lift design performance curve
PROSPER.PLOT.20 PVT calculations
PROSPER.PLOT.21 Tubing correlation comparison
PROSPER.PLOT.22 Gradient matching
PROSPER.PLOT.23 Gradient
PROSPER.PLOT.24 Gradient (selected curves)
PROSPER.PLOT.25 VLP
PROSPER.PLOT.27 ESP motor
PROSPER.PLOT.28 EOS phase envelope
PROSPER.PLOT.29 EOS (generated data)
PROSPER.PLOT.30 EOS (calculated data)
PROSPER.PLOT.31 GAP performance curve

OpenServer User's Manual


PROSPER and OpenServer 400

PROSPER.PLOT.32 Quick-look
PROSPER.PLOT.33 VLP mataching
PROSPER.PLOT.34 IPR relative permeability
PROSPER.PLOT.35 Downhole equipment drawing
PROSPER.PLOT.36 Surface equipment drawing
PROSPER.PLOT.37 Pipe elevation
PROSPER.PLOT.38 Horizontal IPR
PROSPER.PLOT.39 ESP gas separation sensitivity (Dunbar plot)
PROSPER.PLOT.40 GLA mandrel performance
PROSPER.PLOT.41 GLA static gradient
PROSPER.PLOT.42 GLA flowing gradient
PROSPER.PLOT.43 Emulsion
PROSPER.PLOT.44 ESP quick-look
PROSPER.PLOT.45 Pipeline correlation comparison
PROSPER.PLOT.46 WHP to BHP
PROSPER.PLOT.47 Flow map
PROSPER.PLOT.48 HSP pump plot
PROSPER.PLOT.49 HSP design pump plot
PROSPER.PLOT.50 HSP system solution pump plot
PROSPER.PLOT.51 HSP turbine plot
PROSPER.PLOT.52 HSP design turbine plot
PROSPER.PLOT.53 Curve fit plot
PROSPER.PLOT.54 HSP quick-look
PROSPER.PLOT.55 Downhole temperature gradient (downhole
equipment section)
PROSPER.PLOT.56 PVT table
PROSPER.PLOT.57 PVT match data
PROSPER.PLOT.58 IPR multi-lateral
PROSPER.PLOT.59 IPR multi-lateral details
PROSPER.PLOT.60 Sea temperature gradient
PROSPER.PLOT.61 Customised completion fluid
PROSPER.PLOT.62 Hydrates data
PROSPER.PLOT.63 Water vapour
PROSPER.PLOT.64 Rheological parameters
PROSPER.PLOT.65 PCP pump
PROSPER.PLOT.66 HSP power fluid data
PROSPER.PLOT.67 Isochronal inflow performance curve

© 1990-2018 Petroleum Experts Limited


401 OpenServer

PROSPER.PLOT.68 Deviation survey raw data


PROSPER.PLOT.69 FRAMO pump performance curve
PROSPER.PLOT.70 4-variable system
PROSPER.PLOT.71 4-variable sensitivity
PROSPER.PLOT.72 FRAMO pump solution point

6.11 Functions
The following are functions that can be retrieved using the DOGET statement.

Example:
DoGet "PROSPER.GETTVD(1500)"

The command will return the TVD for an MD of 1500.

PROSPER.ANL.NODES.NUMBE Returns The Number Of Nodes In The Equipment


R Description (n). This is based on all of the nodes
defined within the Deviation, Surface and Downhole
equipment sections.

i = 0:n-1
PROSPER.ANL.NODES.TYPE[i] Returns The Equipment Type Of The ith Node
PROSPER.ANL.NODES.MSD[i] Returns The Measured Depth Of The ith Node
PROSPER.ANL.NODES.TVD[i] Returns The True Vertical Depth Of The ith Node

PROSPER.GETMD Returns The Measured Depth For A Given True


Vertical Depth
PROSPER.GETTVD Returns The True Vertical Depth For A Given
Measured Depth
PROSPER.PVT.MATCHED Returns 1 if the PVT is Matched otherwise 0
PROSPER.INTERACT Set Interactive Mode On/Off (1/0)
Example:
Cells(1, 1) = DoGet("PROSPER.INTERACT(1)")
This will set the PROSPER instance to be in
INTERACTIVE mode. In the interactive mode, any
error messages displayed by PROSPER will be
relayed to the user (and may cause the macro to
abort.)

Cells(1, 2) = DoGet("PROSPER.INTERACT(0)")
This will set the PROSPER instance to be in NON-

OpenServer User's Manual


PROSPER and OpenServer 402

PROSPER.ANL.NODES.NUMBE Returns The Number Of Nodes In The Equipment


R Description (n). This is based on all of the nodes
defined within the Deviation, Surface and Downhole
equipment sections.
INTERACTIVE mode. Any error messages that are
generated will be suppressed and the macro will
continue execution.

Both commands will return a value of 0 if the


command is executed correctly. If it is executed
incorrectly, the command will return a value = 1.
PROSPER.MULTILAT.ADDTIE MultiLateral Inflow - Add Tie Point ("Label", x, y) -
returns node index
PROSPER.MULTILAT.ADDJOINT MultiLateral Inflow - Add Joint ("Label", x, y) -
returns node index
PROSPER.MULTILAT.ADDCOMP MultiLateral Inflow - Add Completion ("Label", x, y) -
returns node index
PROSPER.MULTILAT.ADDRES MultiLateral Inflow - Add Reservoir ("Label", x, y) -
returns node index
PROSPER.MULTILAT.ADDLINK MultiLateral Inflow - Join Two Nodes ("Label", from,
to)
PROSPER.MULTILAT.CALCSKIN MultiLateral Inflow - Calculate Skin (node, row) or
("node", row) - returns calculated skin

PROSPER.ESP.DESIGNPUMPS Returns number and list of suitable pumps after


ESP Design Calculation has been done (n).

i = 0:n-1
PROSPER.ESP.DESIGNMOTOR Returns number and list of suitable motors after
S ESP Design Calculation has been done (m).

j = 0:m-1
PROSPER.ESP.DESIGNCABLES Returns number and list of suitable cables after
ESP Design Calculation has been done (f).

k = 0:f-1
PROSPER.ESP.SELECTPUMP(i) Selects desired pump after ESP Design
Calculation has been done and calculates design
parameters.
Example:
ret = PROSPER.ESP.SELECTPUMP(i)
PROSPER.ESP.SELECTMOTOR( Selects desired motor after ESP Design
j) Calculation has been done and calculates design

© 1990-2018 Petroleum Experts Limited


403 OpenServer

PROSPER.ANL.NODES.NUMBE Returns The Number Of Nodes In The Equipment


R Description (n). This is based on all of the nodes
defined within the Deviation, Surface and Downhole
equipment sections.
parameters.
PROSPER.ESP.SELECTCABLE( Selects desired cable after ESP Design Calculation
k) has been done and calculates design parameters.
PROSPER.ESP.PUMPNAME(i) Returns the name of the Pump specified by the
index.
Example:
ret = PROSPER.ESP.PUMPNAME(i).
PROSPER.ESP.MOTORNAME(j) Returns the name of the Motor specified by the
index.
PROSPER.ESP.CABLENAME(k) Returns the name of the Cable specified by the
index.
PROSPER.IPR.AOF Returns the AOF of a layer specified by the index.
ret = PROSPER.IPR.AOF(i)
PROSPER.HSP.SELECTPUMP(i) Selects desired pump after HSP Design
Calculation has been done and calculates design
parameters.
Example:
ret = PROSPER.HSP.SELECTPUMP(i)

6.12 Code Samples


The following examples are not a tutorial in VBA and are presented as an illustration
rather than an implementation. Variables are defined as necessary, and then used in
later code fragments.

The first example is an explanation of the OpenServer code illustrated in the


OpenServer PROSPER example located in: C:/Program Files/Petroleum Experts/
IPM 7/samples/OpenServer/Prosper.

The folder contains the PROSPER file (HORWELDP.OUT) and the OpenServer
Macro.xls file.

The objective of the macro is to perform sensitivities on the well length and completion
zone length and automatically retrieve and plot the results from a system 3-variable
VLP / IPR calculation.

The example illustrates the use of DoSet, DoGet and DoCmd functions.

OpenServer Example 1:
The following code structure will be observed when reviewing the macro code
(Macro.xls file) via the Visual Basic editor:

OpenServer User's Manual


PROSPER and OpenServer 404

Sub Macro1() 'Macro name

Connect 'Establishes the connection between Excel


and the IPM tools

For Row = 13 To 29 'Loop, telling Excel where


the data is situated in the spreadsheet

DoSet ("PROSPER.SIN.IPR.Single.WellLen"),
Cells(Row, 4) 'Sets the Excel data as
the well length in PROSPER
DoSet
("PROSPER.SIN.IPR.Single.HorizdP[0].ZONLEN"),
Cells(Row, 4) 'Sets the Excel data as the
zone length in PROSPER
DoCmd ("PROSPER.ANL.SYS.CALC") 'Performs the
system 3-variable calculation

Cells(Row, 5) = DoGet("PROSPER.OUT.SYS.Results[0]
[0][0].Sol.LiqRate") 'Extracts the system
calculation liquid rate result and passes the
value to the defined cell reference in Excel
i.e., Row, Column.

DoEvents 'Plots the data in Excel after each


calculation (VB code)
Next 'Closes the defined loop

Disconnect 'Disconnects the Excel communication to


PROSPER
End Sub 'Macro ends

Scrolling further down the OpenServer template sample code (and in the OpenServer
sample macro template), it can be observed that error handling code has already been
entered.

The error handling code structure that follows, illustrates the necessary error handling
code that needs to be included in macros, ensuring that correct communication between
Excel and the tools is established.

As previously mentioned, the OpenServer template already contains the necessary


error handling code that is required. Also, all the OpenServer examples located in the
above samples directory structure can be modified to suit individual needs and can be
used as a starting basis to develop additional macros to meet individual modelling
requirements.

The following error handling code structures are to be used when developing

© 1990-2018 Petroleum Experts Limited


405 OpenServer

OpenServer macros when not using the provided template that already includes the
error handling macro code:

Function GetAppName(Strval As String) As String 'This


utility function extracts the application name from the
tag string

Dim Pos
Pos = InStr(Strval, ".")
If Pos < 2 Then
MsgBox "Badly formed tag string"
End
End If
GetAppName = Left(Strval, Pos - 1)
If StrComp(GetAppName, "PROSPER", 1) <> 0 Then
MsgBox "Unrecognised application name in tag
string"
End
End If
End Function

Sub DoCmd(Cmd As String) 'Performs a command, then


checks for errors
Dim lErr As Long
lErr = Server.DoCommand(Cmd)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Sub

Function DoGet(Gv As String) As String 'Gets a


value, then checks for errors
Dim lErr As Long
Dim AppName As String

DoGet = Server.GetValue(Gv)
AppName = GetAppName(Gv)
lErr = Server.GetLastError(AppName)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Function

Sub DoSet(Sv As String, Val) 'Sets a value, then checks

OpenServer User's Manual


PROSPER and OpenServer 406

for errors
Dim lErr As Long
Dim AppName As String

lErr = Server.SetValue(Sv, Val)


AppName = GetAppName(Sv)
lErr = Server.GetLastError(AppName)
If lErr > 0 Then
MsgBox Server.GetErrorDescription(lErr)
Set Server = Nothing
End
End If
End Sub

OpenServer Example 2:
The objective of the following code samples show how to establish connection between
Excel and the tools using a different structure and use the DoSet, DoGet and DoCmd
functions.

Other code samples will also illustrate how to open a PROSPER file and set up macro
code structures to manage data arrays.

The following code skeleton should wrap around all code fragments. This simply
initialises a data-server object and provides a sub-routine that can be called as a macro
from an action push-button for instance.

Option Explicit
Dim Server As Object

Sub DoStuff()
Set Server = CreateObject("PX32.OpenServer.1")
'This complete string can be replaced with Connect
if desired (as above), and establishes the link
between Excel and the tools

Range("A6", "Z1000").Clear 'Clears the Excel


spreadsheet data in the specified range

'Your code goes here

Set Server = Nothing 'Disconnects the Excel


communication to the IPM tool
MsgBox "Macro completed" 'Message box will appear
after the macro has completed showing the entered
"text"

End Sub

© 1990-2018 Petroleum Experts Limited


407 OpenServer

Given the above functions, the first code fragment in the following example shows how to
open a file by name either from being hard-coded in the macro or obtained from an
Excel cell reference.

The above macro code can be modified to perform the following calls if desired:

DoCmd ("PROSPER.OPENFILE(C:\Well Files\PROSPER.OUT)")


'Opens the PROSPER file located in the directory
structure
DoCmd ("PROSPER.OPENFILE=""" + Range("a3") + """")
'Opens a PROSPER file located in the 'a3' Excel cell
reference

The code below obtains a single variable. This variable can also be from a table as
shown in the third and fourth lines – the first layer pressure from the multi-layer IPR
model.

Cells(6, 2) = DoSet ("PROSPER.SIN.IPR.SINGLE.PRES")


'Sets the reservoir pressure with the value located in
the Excel cell reference
Cells(6, 3) = DoGet ("PROSPER.SIN.IPR.SINGLE.PRES")
'Gets the reservoir pressure from the PROSPER file and
places it in the defined cell reference
Cells(7, 2) = Doset
("PROSPER.SIN.IPR.SINGLE.MLAYER[0].PRESSURE") 'Sets
the layer '1' reservoir pressure in the multi-layer IPR
model
Cells(7, 3) = DoGet
("PROSPER.SIN.IPR.SINGLE.MLAYER[0].PRESSURE") 'Gets the
reservoir pressure from layer '1' in the multi-layer IPR
model

Extracting Data from a Multi-Layer IPR Model:


Lets consider a multi-layer IPR model where it is desired to extract layer pressure and
GOR data sequentially from each layer for a 3-layer system.

We can achieve the objective by setting up a loop that will sequentially interrogate each
layer and retrieve the layer pressure and GOR.

The DoGet functions can of course be expanded to extract additional information as


required and the code can also be modified to use the DoSet function to set values from
Excel to PROSPER.

One way to do this using a loop type structure is as follows:

Dim i, k As Integer

OpenServer User's Manual


PROSPER and OpenServer 408

i = 0
k = 0

For k = 0 To 2
For i = 0 To 1

Cells(10, 1 + k) =
DoGet("PROSPER.SIN.IPR.Single.MLayer[" + CStr(k)
+ "].PRESSURE")
'The above string cell reference tells Excel that
the layer pressure data for the 3-layer IPR model
will be placed in row 10 and column 1, 2 and 3
respectively (cell references are row, column).
Excel will increase the column by '1' since the
column counter k = 1.

'The [" + Cstr(k) + "] remark converts the k-


string to a value that is used to index through
each layer. The string suffix .PRESSURE tells
the macro that it is the pressure variable value
that is being queried via the DoGet function.

Cells(11, 1 + k) =
DoGet("PROSPER.SIN.IPR.Single.MLayer[" + CStr(k)
+ "].GOR")
'The syntax to retrieve (or set) the GOR is the
same as above.
Next i 'Closes the 'i' loop
Next k 'Closes the 'k' loop

End Sub

The above code illustrates one of many possible methods to retrieve (or set) multiple
data sets.

The code below tabulates the variables from a multi-layer model using a slightly different
approach:

Dim i As Integer
Dim j As Integer
Dim StringRoot As String 'The below StringRoot call
defines the following section of a given OpenServer
string, and enables having to paste repeated OpenServer
strings to set or retrieve common string variables. For
example, the StringRoot of:
PROSPER.SIN.IPR.SINGLE.MLAYER.PRESSURE is:

© 1990-2018 Petroleum Experts Limited


409 OpenServer

PROSPER.SIN.IPR.SINGLE.MLAYER, followed by [" &


FORMAT(i) & "], where 'i' will be the loop counter that
will be used to automatically loop through all the
defined given layers in a multi-layer IPR model.

As can be observed below, rather than using the common


returned openserver string for the IPR section, the
StringRoot approach can be used as illustrated below:

Dim StringOut As String


i = 0
Do While i < 5
StringRoot = "PROSPER.SIN.IPR.SINGLE.MLAYER[" &
Format(i) & "]"
Cells(10 + i, 2) = StringRoot
Cells(10 + i, 3) = DoGet(StringRoot & ".TYPE")
Cells(10 + i, 4) = DoGet(StringRoot & ".IGRAV")
Cells(10 + i, 5) = DoGet(StringRoot &
".PRESSURE")
Cells(10 + i, 6) = DoGet(StringRoot & ".HEIGHT")
Cells(10 + i, 7) = DoGet(StringRoot & ".SKIN")
Cells(10 + i, 8) = DoGet(StringRoot & ".PERM")
Cells(10 + i, 9) = DoGet(StringRoot & ".DAREA")
Cells(10 + i, 10) = DoGet(StringRoot & ".DIETZ")
Cells(10 + i, 11) = DoGet(StringRoot & ".WBR")
Cells(10 + i, 12) = DoGet(StringRoot & ".PILAY")
Cells(10 + i, 13) = DoGet(StringRoot & ".GOR")
Cells(10 + i, 14) = DoGet(StringRoot & ".API")
Cells(10 + i, 15) = DoGet(StringRoot &
".GASGRAV")
Cells(10 + i, 16) = DoGet(StringRoot & ".WC")
i = i + 1
Loop

Note that the multi-rate models within the multi-layer constitute a table within a table:

i = 0
Do While i < 5
StringRoot = "PROSPER.SIN.IPR.SINGLE.MLAYER[" &
Format(i) & "]"
Cells(16, 2 + 3 * i) = StringRoot

j = 0
Do While j < 10
StringOut = StringRoot & ".MRATE[" & Format(j) &
"].PRESSURE"
Cells(16 + j, 3 + (3 * i)) = DoGet(StringOut)
StringOut = StringRoot & ".MRATE[" & Format(j) &

OpenServer User's Manual


PROSPER and OpenServer 410

"].RATE"
Cells(16 + j, 4 + (3 * i)) = DoGet(StringOut)

j = j + 1
Loop
i = i + 1
Loop

Now a variable length data structure is dealt with in the multi-lateral network. Some of
the ‘state’ variables for each item are printed out.

Dim String1 As String


Dim String3 As String

Cells(8, 2) = "PROSPER.SIN.IPR.MULTILAT.NETWORK.COUNT"
StringRoot =
DoGet("PROSPER.SIN.IPR.MULTILAT.NETWORK.COUNT")
Cells(8, 3) = StringRoot
Dim Count As Integer
Count = Val(StringRoot)
StringRoot = "PROSPER.SIN.IPR.MULTILAT.NETWORK["

i = 0
Do While i < Count
String1 = StringRoot & Format(i) & "]"
String3 = String1 & ".LABEL"
Cells(i * 10 + 11, 2) = String3
Cells(i * 10 + 11, 3) = DoGet(String3)
String3 = String1 & ".Type"
Cells(i * 10 + 12, 2) = String3
Cells(i * 10 + 12, 3) = DoGet(String3)
String3 = String1 & ".Node"
Cells(i * 10 + 13, 2) = String3
Cells(i * 10 + 13, 3) = DoGet(String3)
String3 = String1 & ".Mask"
Cells(i * 10 + 14, 2) = String3
Cells(i * 10 + 14, 3) = DoGet(String3)
String3 = String1 & ".HasData"
Cells(i * 10 + 16, 2) = String3
Cells(i * 10 + 16, 3) = DoGet(String3)
String3 = String1 & ".ID"
Cells(i * 10 + 17, 2) = String3
Cells(i * 10 + 17, 3) = DoGet(String3)
String3 = String1 & ".Valid"
Cells(i * 10 + 18, 2) = String3
Cells(i * 10 + 18, 3) = DoGet(String3)

i = i + 1

© 1990-2018 Petroleum Experts Limited


411 OpenServer

Loop

Now, get all tie-point or junction data. Note the use of a line-count variable for
formatting.

StringRoot = " .SIN.IPR.MULTILAT.NETWORK["


Dim iType As Integer
Dim iLineCount As Integer
iLineCount = i * 10 + 11

i = 0
Do While i < Count
String1 = StringRoot & Format(i) & "]"
String3 = String1 & ".Type"
iType = Val(DoGet(String3))
If (iType = 0) Or (iType = 1) Then
iLineCount = iLineCount + 1
Cells(iLineCount, 2) = "Junction/Tiepoint"
iLineCount = iLineCount + 1
String3 = String1 & ".MD"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".TVD"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 2
End If

Continuing the loop, get all tubing model and deviation survey items, whether in a tubing
network item or a completion node.

Dim iHasData As Integer


String3 = String1 & ".HasData"
iHasData = Val(DoGet(String3))
If (iType = 2) Or (iType = 4 And iHasData = 1) Then
iLineCount = iLineCount + 1
Cells(iLineCount, 2) = "Completion/tubing"
iLineCount = iLineCount + 1
String3 = String1 & ".Hflow"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".Vflow"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".Choke"

OpenServer User's Manual


PROSPER and OpenServer 412

Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".Threshold"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".FlowType"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".Angle"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".WBR"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 1
String3 = String1 & ".Dietz"
Cells(iLineCount, 2) = String3
Cells(iLineCount, 3) = DoGet(String3)
iLineCount = iLineCount + 2
End If

String3 = String1 & ".Dev.COUNT"


Dim iDevCount As Integer
iDevCount = Val(DoGet(String3))

j = 0
Do While j < iDevCount
String2 = String1 & ".Dev[" & Format(j) & "]"
Cells(iLineCount, 2) = String2
String3 = String2 & ".MD"
Cells(iLineCount, 3) = DoGet(String3)
String3 = String2 & ".TVD"
Cells(iLineCount, 4) = DoGet(String3)
String3 = String2 & ".Azimuth"
Cells(iLineCount, 5) = DoGet(String3)
String3 = String2 & ".Disp"
Cells(iLineCount, 6) = DoGet(String3)
String3 = String2 & ".Angle"
Cells(iLineCount, 7) = DoGet(String3)
iLineCount = iLineCount + 1

j = j + 1
Loop

© 1990-2018 Petroleum Experts Limited


413 OpenServer

iLineCount = iLineCount + 3

i = i + 1
Loop

Finally, a method of obtaining the unique identifier (ID) of a node called ‘Comp1’ is
illustrated. The node label is placed within braces ‘{}’ to differentiate it generically from
an index.

StringRoot = "{Comp1}"
StringOut = " .SIN.IPR.MULTILAT.NETWORK[" & StringRoot
& "].ID"
Cells(10, 2) = StringOut
Cells(10, 3) = DoGet(StringOut)

OpenServer User's Manual


Chapter

7
415 OpenServer

7 PVTP and OpenServer


7.1 OverView
The aim of this section is to provide a reference for the OpenServer variable names
corresponding to the data variable names encountered in PVTP and also the open
functions used to execute commands.

A comprehensive series of Excel spreadsheets are distributed with PVTP. All major
labels, methods and calculations are illustrated within these files.

The areas can be accessed in PVTP with OpenServer:

BLACKOIL Black Oil data input and calculations


OPTIONS System Options setup
STREAMBASE[stream no. or stream name] Stream data input (componet list etc.)
STREAMRUN[stream no. or stream name] Existing stream data
LABDATA[stream no. or stream name] Lab data input
CALCUL[stream no. or stream name] Calculations

Each section will be accessed thus:

PVT.BLACKOIL
PVT.OPTIONS
PVT.STREAMBASE[stream no. or stream name]
PVT.STREAMRUN[stream no. or stream name]
PVT.LABDATA[stream no. or stream name]
PVT.CALCUL[stream no. or stream name]

NOTE:
At present, no access is given to matching data within the Black Oil models.

7.2 Finding a Variable Test String


In common with all the programs, the labels used within the OpenServer can be
visualised by pressing Ctrl while doing a mouse right click when over a specific dialog
item.

For example, by placing the mouse cursor on top of the Critical Temperature for the first
component in the composition and selecting Ctrl + Right Click, the screen with the
Access String for this variable will appear. The String can then be copied on the
clipboard for use in the macro.

OpenServer User's Manual


PVTP and OpenServer 416

7.3 File and Streams


PVTP has a Multiple Document Interface(MDI) . This means the program can load more
than one *.pvi file. The files are manipulated using the following commands:

OPENFILE Opens a pvi file


SAVEFILE Saves the active file with the given file name
CLOSEFILE Closes the active file without saving it
SHUTDOWN Closes all files without saving them
SETACTIVEFILE Sets named file as the active document
UPDATEDISPLAY Instructs program to update the main screen with the latest active
file data

The file commands are demonstrated in the OPENPVT.XLS sample Excel file.
Each file can contain multiple streams. Each stream contains Base, Runtime and
Calculation data. Individual streams can be accessed by way of a zero-based index or
the stream name.

Example:

© 1990-2018 Petroleum Experts Limited


417 OpenServer

A typical string to get a piece of stream data would be:

PVT.STREAMBASE[{WellStream}].COMPOSITION[1]

This accesses the composition of the second component within the stream called
WellStream. Details of stream contents are described in Sections 7.6 and 7.7.

The stream commands are demonstrated in the OPENPVT.XLS sample Excel file.

Streams can be manipulated using the following commands:

CREATE_EMPTY_STREAM Adds an empty stream to the active file


SET_ACTIVE_STREAM Sets the active stream within the active file
COPY_STREAM Copies an identified stream within the active
file
COPYSTREAMBASE_TO_STREAMRU Copies BASE data to RUNTIME for the
N identified stream
COPYSTREAMRUN_TO_STREAMBAS Copies RUNTIME data to BASE for the
E identified stream

7.4 BLACKOIL
This section deals with access to the input data and calculations within the Blackoil
model of the PVTP program.

Use of the model and data is demonstrated within the OPEN_BLACKOIL_CALC.XLS


sample Excel file.

System Options setup for Black Oil calculations

The setting of the file to a BlackOil model is done within the options section with the
DoSet command.
"PVT.OPTIONS.METHOD” with value BLACKOIL"

The type of model is set by


“PVT.OPTIONS.FLUIDTYPE” to “OIL”,”GAS” or “CONDENSATE”

There is only one set of blackoil data per file so no stream indication is required. To
obtain a piece of blackoil data the command string would be:
"PVT.BLACKOIL.SEPPRESS".

CORRPB Correlation for PB,Rs,Bo


CORRUO Correlation for Oil Viscosity

OpenServer User's Manual


PVTP and OpenServer 418

CORRUG Correlation for Gas Viscosity


SOLGOR Solution GOR
OILGRAV Oil Gravity
GASGRAV Gas Gravity
SEPPRESS Separator Pressure
SEPTEMP Separator Temperature
SEPGOR Separator GOR
SEPGASGRAV Separator Gas Gravity
TANKGOR Tank GOR
TANKGASGRAV Tank Gas Gravity
CGR Condensate to Gas Ratio
H2S H2S Concentration
CO2 CO2 Concentration
N2 N2 Concentration
DEWPOINT Condensate Dewpoint
RESTEMP Reservoir Temperature
RESPRESS Reservoir Pressure
WATER_SALINITY Water Salinity
PVT_MATCHED Flag to indicate that PVT is matched

7.5 OPTIONS
This section deals with access to common options within the active PVTP file. The
options deal with many aspects of how and where models are used, which calculations
are carried out etc.

The Options sheet within the OPENPVT.XLS sample Excel file, gives an indication of
how these data points can be accessed.

Example:
A typical DoSet command would be

DoSet (" PVT.OPTIONS.VISCMETHOD”), “LOHRENZ”

Sets the model for EoS calculations to Lohrenz Bray Clark.

The option available includes:

METHOD Defines the model being used i.e. BLACK OIL or


EOS
FLUIDTYPE Defines the black oil model to be used i.e.

© 1990-2018 Petroleum Experts Limited


419 OpenServer

OIL,GAS or CONDENSATE
SEPARATORTYPE Defines the number of separators within a blackoil
model i.e. SINGLE to TWO
EOSTYPE Defines the equation to be used for the EoS model
i.e. PENGROB or SRK
COMPANY Gives access to the Company string within the
Options Dialog
FIELD Gives access to the Field string within the Options
Dialog
LOCATION Gives access to the Location string within the
Options Dialog
PLATFROM Gives access to the Platform string within the
Options Dialog
ANALYST Gives access to the Analyst string within the
Options Dialog
COMMENT Gives access to the Comment string within the
Options Dialog
CALC_TYPE Sets the active calculation. The keyword is
replaced with appropriate command (see
Calculations Section 8.7 for more details)
CALC_TYPE Sets the flash type for mixtures with water or solids
to MULTIPHASE or TWOPHASE
VISCMETHOD Sets the viscosity model for EoS calculations
USE_VOLSHIFT Switches volume shift on and off during EoS
calculations
CALC_PSAT_IN_CMPGRAD Flag to calculate Saturation Pressure during
compositional gradient calculation
CALC_PSAT_IN_CCE Flag to calculate Saturation Pressure during CCE
calculation
CALC_THERMALCOND_IN_CC Flag to calculate Thermal Conductivity during CCE
E calculation
USE_ADV_PHASE_DETECTION Preferences|Calc Tolerances: Use advanced
phase detection flag
SHOW_CALCS Preferences|Calc Tolerances: Show calculated
values during calculation flag
OPTIMISE_REGRESSION Preferences|Calc Tolerances: Optimise
calculations during regression flag
OPTIMISE_CVD_REGRESSION Preferences|Calc Tolerances: Optimise CVD
calculation during regression flag
REGRESS_MAXSTEPS Preferences|Calc Tolerances: Maximum number of
iterations during regression
PHASE_CALC_MAXITER Preferences|Calc Tolerances: Maximum number of

OpenServer User's Manual


PVTP and OpenServer 420

iterations during phase check


PHASE_CALC_MINPRESS Preferences|Calc Tolerances: minimum pressure
during phase check
PHASE_CALC_VAPTEST Preferences|Calc Tolerances: vapour fraction used
as test in phase check
OVERRIDE_PHASE_CALC Preferences|Calc Tolerances: override phase
check and force phase
FIXED_PHASE Preferences|Calc Tolerances: forced phase after
phase check override
FORTLIB_ITERATIONS Preferences|Calc Tolerances: Fortran library
maximum iterations
FORTLIB_PRECISION Preferences|Calc Tolerances: Fortran library
calculation precision
SHOWPLOT_POINTS Preferences|Calc Tolerances: Show points on plots
CALC_GOR_CORRECTED_WIT Flag to correct FVF and GOR within CCE, CVD
H_SEPS etc. through a separator train
REGR_GOR_CORRECTED_WIT Flag to correct FVF and GOR through a separator
H_SEPS train during regression
TARGET_GOR_CORRECTED_W Flag to flash through a separator train to get gas
ITH_SEPS and oil used in Target GOR calc.
USE_INDIVIDUAL_SEP_CORRE Flag to use individual stream values for separator
CTION correction.
VOLSHIFT_D Volume Shift D parameter
VOLSHIFT_E Volume Shift E parameter
ECLIPSE_OILTYPE Eclipse Blackoil Export: Option for oil
ECLIPSE_GASTYPE Eclipse Blackoil Export: Option for gas
ECLIPSE_WATERTYPE Eclipse Blackoil Export: Option for water
WAXTEMP_NUMSTEPS Wax Appearance Temperature Calc.:Max number
of steps
WAXTEMP_MINTEMP Wax Appearance Temperature Calc.:minimum
temperature
WAXTEMP_MAXTEMP Wax Appearance Temperature Calc.:maximum
temperature
WAXTEMP_TESTSOLIDS Wax Appearance Temperature Calc.:solids value
used as test
WAX_MODEL Selects model used in wax calculations
HYDRATE_METHOD Selects method used in hydrate calculations
HYDRATE_INHIBITOR Selects inhibitor used in hydrate calculations
HYDRATE_USE_INHIBITOR Flag to say whether inhibitor is used in hydrate
calculations
HYDRATE_USE_INHIBITOR Flag to say whether hydrate II is calculated in

© 1990-2018 Petroleum Experts Limited


421 OpenServer

hydrate calculations
SLIMTUBE_TEST_RECOVERY Slimtube calculation test value for recovery
SLIMTUBE_TEST_POREVOL Slimtube calculation test value for pore volume
PHASE_ENV_THETA_VALUES Phase Envelope Calculation: vapour fractions that
are to be calculated
CREATE_MAX_ITERATIONS Create Streams to target GOR and
PSAT:maximum number of iterations
CREATE_GOR_END_TEST Create Streams to target GOR:test of target value
being found
CREATE_PSAT_END_TEST Create Streams to target PSAT:test of target value
being found
CREATE_PSAT_PHASE Create Streams to target PSAT:phase to be
produced

7.6 STREAMBASE
This structure is the main depository for defining a stream. It contains component
definitions, properties, reference data etc. Unlike the STREAMRUN version below, this
data is saved with the file. The command COPYSTREAMRUN_TO_STREAMBASE
will put runtime data into the base structure for saving.

See the distributed Excel File OPENPVT.XLS for the main set of variables and calls
which manipulate streams etc.

Example:
A typical string to get a piece of stream data would be:

PVT.STREAMBASE[{WellStream}].CRITTEMP[8]

This accesses the critical temperature of the ninth component within the stream called
WellStream.

The stream variables available include:

STREAMNAME Accesses the stream name of the indicated stream


STREAMCOMMENT Accesses the stream comment of the indicated
stream
NUMCOMPONENTS Accesses the stream number of components
NUMPSEUDOS Accesses the stream number of pseudo components
RESTEMP Accesses the stream reservoir temperature
REFPRESS Accesses the stream refererence pressure
REFDEPTH Accesses the stream refererence depth

OpenServer User's Manual


PVTP and OpenServer 422

STANDPRESS Accesses the stream standard pressure


STANDTEMP Accesses the stream standard temperature
WATERSALINITY Accesses the stream water salinity value
COMPONENT[x] Accesses name of component x (zero based index)
COMPONENT_LONG[x] Accesses description of component x (zero based
index)
COMPONENT_TYPE[x] Accesses type of component x (zero based index) 0 –
no type 1- HC 2 – NON-HC 3 – CUSTOM 4-
PSEUDO
COMPONENT_INDEX[x] Accesses where component x (zero based index) is
within database
COMPOSITION[x] Accesses composition of component x (zero based
index)
CRITTEMP[x] Accesses critical temperature of component x (zero
based index)
CRITPRESS[x] Accesses critical pressure of component x (zero
based index)
CRITPVOL[x] Accesses critical volume of component x (zero based
index)
ACCENFACT[x] Accesses accentric factor of component x (zero
based index)
OMEGAA[x] Accesses OmegaA value of component x (zero
based index)
OMEGAB[x] Accesses OmegaB value of component x (zero
based index)
MOLEWT[x] Accesses molecular weight value of component x
(zero based index)
PARACHOR[x] Accesses parachor value of component x (zero based
index)
BOILPT[x] Accesses boiling point of component x (zero based
index)
SPECGRAV[x] Accesses specific gravity of component x (zero
based index)
RHOAPP[x] Accesses apparent density of component x (zero
based index)
VOLSHIFTC[x] Accesses volume shift C parameter of component x
(zero based index)
VOLSHIFTS[x] Accesses volume shift S parameter of component x
(zero based index)
ZRACK[x] Accesses Z Rackett parameter of component x (zero
based index)
ZCRIT[x] Accesses critical Z factor of component x (zero based

© 1990-2018 Petroleum Experts Limited


423 OpenServer

index)
MELTPT[x] Accesses melting point of component x (zero based
index)
HEATFUSION[x] Accesses heat of fusion of component x (zero based
index)
SOLPAR[x] Accesses solubility parameter of component x (zero
based index)
SOLPARSOLID[x] Accesses solid solubility parameter of component x
(zero based index)
AROMATIC_PERCENT[x] Accesses aromatic content of pseudo component x
(zero based index)
BINARY_INT_COMPS [x][y] Accesses binary interaction coefficient between
component x and y (zero based indices)
BINARY_INT_COMPS [x][y] Accesses binary interaction coefficient between
component x and y (zero based indices)
RECOM_RESULT_COMP [x] Recombination: resulting composition of component x
(zero based index)
RECOM_STOCKOIL_COMP [x] Recombination: stock tank oil composition of
component x (zero based index)
RECOM_STOCKGAS_COMP Recombination: stock tank gas composition of
[x] component x (zero based index)
RECOM_GAS_SEP_COMP Recombination: sep gas composition of component x
[sep][x] in separator sep(zero based indices)
RECOM_SEP_GOR [sep] Recombination: GOR in separator sep(zero based
index)
RECOM_SEP_TEMP[sep] Recombination: Temperature of separator sep(zero
based index)
RECOM_STOCKOIL_DENSITY Recombination: Stock tank oil density
RECOM_GAS_DENSITY Recombination: gas density
RECOM_GAS_GRAVITY Recombination: gas gravity
RECOM_STOCKTANK_GOR Recombination: Stock tank GOR
RECOM_STOCKTANK_TEMP Recombination: Stock tank temperature
PSEUD_ARCH_COMPONENT Pseudo Component Archive: name of pseudo x (zero
[x] based index)
PSEUD_ARCH_COMPOSITIO Pseudo Component Archive: composition of pseudo
N[x] x (zero based index)
PSEUD_ARCH_MWT[x] Pseudo Component Archive: mole weight of pseudo x
(zero based index)
PSEUD_ARCH_TCRIT[x] Pseudo Component Archive: critical temperature of
pseudo x (zero based index)
PSEUD_ARCH_PCRIT[x] Pseudo Component Archive: critical pressure of
pseudo x (zero based index)

OpenServer User's Manual


PVTP and OpenServer 424

PSEUD_ARCH_VCRIT[x] Pseudo Component Archive: critical volume of


pseudo x (zero based index)
PSEUD_ARCH_AFACT[x] Pseudo Component Archive: acentric factor of
pseudo x (zero based index)
PSEUD_ARCH_TBOIL[x] Pseudo Component Archive: boiling temp. of pseudo
x (zero based index)
MIXCRITTEMP Stream calculated critical temperature
MIXCRITPRESS Stream calculated critical pressure
CRICONDENBAR Stream calculated cricondenbar
CRICONDENTHERM Stream calculated cricondentherm
BPT_CORRELATION Pseudo Correlation for BPt
AFTCPC_CORRELATION Pseudo Correlation for AF Tc and Pc
BIC_PURE_CORRELATION Correlation for pure component BICs
BIC_PSEUDO_CORRELATIO Correlation for pseudo component BICs
N
QUALITY_PLOT_VAP_COMP[ Quality Plot: composition of vapour component x (zero
x] based index)
QUALITY_PLOT_LIQ_COMP[x] Quality Plot: composition of liquid component x (zero
based index)
QUALITY_PLOT_SEPTEMP Quality Plot: separator temperature
QUALITY_PLOT_SEPPRESS Quality Plot: separator pressure

7.7 STREAMRUN
This structure is the temporary description of a stream which is used in calculations. It is
similar to STREAMBASE and contains component definitions, properties, reference
data etc. Unlike the STREAMBASE version above, this data is not saved with the file.
The command COPYSTREAMBASE_TO_STREAMRUN will put base data into the
runtime structure prior to calculations.

See the distributed Excel File OPENPVT.XLS for more details and examples. Of
particular interest is the example of the Flash calculation within this file, as it
demonstrates how the runtime input data and the runtime calculation results can be
utilised.

Example:
A typical string to get a piece of runtime data would be:

PVT.STREAMRUN[{WellStream}].CRITPRESS[0]

This accesses the critical pressure of the first component within the stream called
WellStream.

© 1990-2018 Petroleum Experts Limited


425 OpenServer

The stream runtime variables available include:

NUMCOMPONENTS Accesses the runtime number of components


NUMPSEUDOS Accesses the runtime number of pseudo components
RESTEMP Accesses the runtime reservoir temperature
REFPRESS Accesses the runtime refererence pressure
REFDEPTH Accesses the runtime refererence depth
TEMPERATURE Accesses the calculation temperature
PRESSURE Accesses the calculation pressure
STANDTEMP Accesses the runtime standard temperature
WATERSALINITY Accesses the runtime water salinity value
COMPONENT[x] Accesses name of component x (zero based index)
COMPONENT_LONG[x] Accesses description of component x (zero based index)
COMPONENT_TYPE[x] Accesses type of component x (zero based index):
0 – no type
1 – HC
2 – NON-HC
3 – CUSTOM
4 – PSEUDO
COMPONENT_INDEX[x] Accesses where component x (zero based index) is within
database
COMPOSITION[x] Accesses composition of component x (zero based index)
CRITTEMP[x] Accesses critical temperature of component x (zero based
index)
CRITPRESS[x] Accesses critical pressure of component x (zero based
index)
CRITPVOL[x] Accesses critical volume of component x (zero based
index)
ACCENFACT[x] Accesses accentric factor of component x (zero based
index)
OMEGAA[x] Accesses OmegaA value of component x (zero based
index)
OMEGAB[x] Accesses OmegaB value of component x (zero based
index)
MOLEWT[x] Accesses molecular weight value of component x (zero
based index)
PARACHOR[x] Accesses parachor value of component x (zero based
index)
BOILPT[x] Accesses boiling point of component x (zero based index)
SPECGRAV[x] Accesses specific gravity of component x (zero based
index)

OpenServer User's Manual


PVTP and OpenServer 426

RHOAPP[x] Accesses apparent density of component x (zero based


index)
VOLSHIFTC[x] Accesses volume shift C parameter of component x (zero
based index)
VOLSHIFTS[x] Accesses volume shift S parameter of component x (zero
based index)
ZRACK[x] Accesses Z Rackett parameter of component x (zero
based index)
ZCRIT[x] Accesses critical Z factor of component x (zero based
index)
MELTPT[x] Accesses melting point of component x (zero based index)
HEATFUSION[x] Accesses heat of fusion of component x (zero based
index)
SOLPAR[x] Accesses solubility parameter of component x (zero
based index)
SOLPARSOLID[x] Accesses solid solubility parameter of component x (zero
based index)
RESULT_KVALUES [x] Last Calc Results: K Value of component x (zero based
index)
LIQUID_COMPOSITION Last Calc Results: liquid composition of component x in
[phase][x] liquid phase ph (zero based indices)
VAPOUR_COMPOSITION Last Calc Results: vapour composition of component x in
[0][x] vapour phase 0 (zero based indices)
SOLID_COMPOSITION [0] Last Calc Results: lsolid composition of component x in
[x] vapour phase 0 (zero based indices)

[ph]: Phase index 0 – vapour , 1 - liquid


DENSITY [ph] Last Calc Results: density of phase ph
ZFACTOR [ph] Last Calc Results: z factor of phase ph
VISCOSITY [ph] Last Calc Results: viscosity of phase ph
SPECIFIC_ENTHALPY Last Calc Results: enthalpy of phase ph
[ph]
SPECIFIC_ENTROPY [ph] Last Calc Results: entropy of phase ph
CP [ph] Last Calc Results: specific heat Cp of phase ph
CV [ph] Last Calc Results: specific heat Cv of phase ph
SPEEDOFSOUND [ph] Last Calc Results: speed of sound of phase ph
JTHOMSONCOEFF [ph] Last Calc Results: Joule-Thomson coeff.of phase ph
THERMALCOND [ph] Last Calc Results: Thermal Cond..of phase ph

IFT Last Calc Results: Interfacial tension of mixture


VAP_FRACTION Last Calc Results: Vapour fraction calculated

© 1990-2018 Petroleum Experts Limited


427 OpenServer

SOLID_FRACTION Last Calc Results: Solid fraction calculated


WATER_FRACTION Last Calc Results: Water fraction calculated
NON_WATER_FRACTION Last Calc Results: Hydrocarbon fraction calculated
NUM_PHASES Last Calc Results: Multiphase flash number of phases
detected
NUM_LIQUID_PHASES Last Calc Results: Multiphase flash number of phases
detected
PROFILEOILFRACTION [n] Profile Calc: dead oil fraction n
PROFILESATPRESS[n] Profile Calc: Saturation Pressure for dead oil fraction n
PROFILEPHASE [n] Profile Calc: phase detected for dead oil fraction n
PROFILE_BLEND_FRAC Profile Calc: fraction of stream 1 added to blend
TION [n]
PROFILE_BLEND_GOR Profile Calc: GOR calculated for blend fraction n
[n]

7.8 CALCUL
This structure controls the calculations. It contains the values of calculation ranges,
intermediate values results and analysis.

The following list of examples is provided in the PVTP/Samples folder of IPM installation
directory:

C:\Program Files\Petroleum Experts\IPM 8\Samples\pvtp

The distributed spreadsheets illustrate the following calculations:

Spreadsheet Name
OPENPVT.XLS FLASH calculation specifically packaged up
for use with OpenServer
OPEN_CRITPOINT_PHASE_ENV_CAL Mixture Critical Point and Phase Envelope
C.XLS
OPEN_CCE_PSAT_CALC.XLS Single point and ranged saturation pressure
plus constant composition expansion
OPEN_CVD_DEPL_CALC.XLS Constant volume depletion and depletion
study
OPEN_DIFF_COMPOS_CALC.XLS Differential liberation and composite
differential
OPEN_SEP_CALC.XLS Small and full separator calculations
OPEN_COMPGRAD_SWELL_CALC.X Compositional gradient and Swelling Test
LS

OpenServer User's Manual


PVTP and OpenServer 428

OPEN_SLIMTUBE_CALC.XLS Slim tube calculation


OPEN_HYDRATE_CALC.XLS Hydrate formation pressure
OPEN_WAX_CALC.XLS Wax amount and wax appearance
temperature
OPEN_CALCS_WITH_WATER.XLS Multiphase CCE and separator calculation
with water present
OPEN_BLACKOIL_CALC.XLS Calculation as used in the black oil export
table
OPEN_UTILITIES.XLS Utility calculations i.e. isenthalpic flash,water
saturation, create stream to target
GOR,create stream to a target PSAT. The
procedure used to initiate calculations and
retrieve results is outlined in section 8.8

Example:
A typical DoGet string to return a segment of runtime data would be:

PVT.CALCUL[{WellStream}]. CALC_USER_CCE_TEMPS [4]

This accesses the fifth user-defined temperature input value for the CCE calculation
within the stream called WellStream.

The available stream runtime variables include:

CALC_MODE Flag to set calculation mode to automatic or


user-defined (for calcs without individual flag
see rest of table)
CALC_CCE_MODE Flag to set calculation mode to automatic or
user-defined for CCE
CALC_GRAD_MODE Flag to set calculation mode to automatic or
user-defined for compositional gradient
CALC_WAXTEMP_MODE Flag to set calculation mode to automatic or
user-defined for wax appearance temperature
CALC_WAXTEMP_MODE Flag to set calculation mode to automatic or
user-defined for wax appearance temperature
CALC_ECLIPSE_MODE Flag to set calculation mode to automatic or
user-defined for eclipse export
UTILS_ENTHALPY_BALANCE_MOD Flag to set calculation mode to automatic or
E user-defined for utilities enthalpy balance
calculation
EXP_SAT_UNSAT_MODE Flag to set calculation mode to automatic or
user-defined for variable bubble point export
SLIMTUBE_MODE Flag to set calculation mode to automatic or
user-defined for slim tube calculation

© 1990-2018 Petroleum Experts Limited


429 OpenServer

UTILS_WATERSATN_MODE Flag to set calculation mode to automatic or


user-defined for utilities water saturation
calculation
CALC_HYDRATE_MODE Flag to set calculation mode to automatic or
user-defined for hydrate calculation
CALC_FIRST_STREAM First stream index – SWELL etc.calculation
CALC_SECOND_STREAM Second stream index – SWELL etc.calculation
CALC_NUM_RESULTS Number of lines of results calculated
CALC_NUM_CURVES Number of curves calculated for phase
envelope
CALC_MIN_TEMP Calculation minimum temperature
CALC_MAX_TEMP Calculation maximum temperature
CALC_MIN_PRESS Calculation minimum pressure
CALC_MAX_PRESS Calculation maximum pressure
CALC_USER_TEMPERATURES[n] Calculation user-defined temperatures
CALC_USER_PRESSURES[n] Calculation user-defined pressures
CALC_NUM_DEPTHABOVEVALUE Gradient :number of depths above reference
S
CALC_MAX_DEPTHABOVE Gradient :maximum of depths above reference
CALC_NUM_DEPTHBELOWVALUE Gradient :number of depths below reference
S
CALC_MAX_DEPTHBELOW Gradient :maximum of depths below reference
CALC_CMPGRAD_DEPTHABOVE Gradient :user-defined depths above reference
CALC_CMPGRAD_DEPTHBELOW Gradient :user-defined depths below reference
CALC_TEMP_GRADIENT Gradient :temperature gradient value
CALC_USE_RELATIVE_DEPTHS Gradient :temperature gradient value
CALC_SEP_PRESSURES[n] Separator Calculation : stage pressures
CALC_SEP_TEMPERATURES Separator Calculation : stage temperatures
SELECTED_PTS Selected path to surface for stream i
PTS.PROCESSDATA.SEPARATOR Counts number of separator elements in the
COUNT path to surface object
PTS.PROCESSDATA.CHILLERCOU Counts number of chiller elements in the path
NT to surface object
PTS.PROCESSDATA.JOINTCOUNT Counts number of joint elements in the path to
surface
PTS.PROCESSDATA.SOURCECOU Counts number of source elements in the path
NT to surface object
PTS.PROCESSDATA.SEPARATOR[i Counts number of connections from separator i
].CONNECTSFROMCOUNT
PTS.PROCESSDATA.SEPARATOR[i Extracts where connection j is from for
].CONNECTSFROM[j] separator i

OpenServer User's Manual


PVTP and OpenServer 430

PTS.PROCESSDATA.SEPARATOR[i Counts number of connections to separator i


].CONNECTSTOCOUNT
PTS.PROCESSDATA.SEPARATOR[i Extracts where connection j is to for separator i
].CONNECTSTO[j]
PTS.PROCESSDATA.SEPARATOR[i Label of separator i
].LABEL
PTS.PROCESSDATA.SEPARATOR[i pressure of separator i
].PRESSURE
PTS.PROCESSDATA.SEPARATOR[i Temperature of separator i
].TEMPERATURE
PTS.PROCESSDATA.SEPARATOR[i Extracts liquid volume of separator i
].LIQUIDVOLUME
PTS.PROCESSDATA.SEPARATOR[i Extracts vapour volume of separator i
].VAPOURVOLUME
PTS.PROCESSDATA.SEPARATOR[i Extracts EOS properties of separator i. The
].EOSPROPERTIES. following EOS properties are accessible:
NumComponents
Tcrit[j]
Pcrit[j]
Vcrit[j]
Acentric[j]
MW[j]
SpGrav[j]
Vs[j]
Tboil[j]
Parachor[j]
OmegaA[j]
OmegaB[j]
PTS.PROCESSDATA.SEPARATOR[i Extracts liquid composition properties of
].LIQUIDCOMPOSITION. separator i. The following composition
properties are accessible:
NumComponents
MoleFraction[j]
AverageMolecularWeight
ResidualAmount
ResidualWeight
StartCalcWeight
PTS.PROCESSDATA.SEPARATOR[i Extracts liquid flash results of separator i. The
].LIQUIDFLASHRESULTS. following flash results are accessible:
VapourFraction
VolumeVapourFraction
LiquidDropout
Zfactor[j]
Density[j]
Viscosity[j]

© 1990-2018 Petroleum Experts Limited


431 OpenServer

EnthalpyPerMole[j]
EntropyPerMole[j]
Enthalpy[j]
Entropy[j]
Cp[j]
Cv[j]
JTCoeff[j]
SpeedOfSound[j]
MolecularWeight[j]
MolarVolume[j]
IFT
CostaldOilDensity
StandingKatzOilDensity
VapourToLiquidFraction
VolumeVapourToLiquidFraction
WaterInGasFraction
WaterInOilFraction
HCInWaterFraction
TotalEnthalpy
TotalCp
PTS.PROCESSDATA.SEPARATOR[i Extracts liquid composition properties of
].VAPOURCOMPOSITION. vapour separator i. The following composition
properties are accessible:
NumComponents
MoleFraction[j]
AverageMolecularWeight
ResidualAmount
ResidualWeight
StartCalcWeight
PTS.PROCESSDATA.SEPARATOR[i Extracts vapour flash results of separator i. The
].VAPOURFLASHRESULTS. following flash results are accessible:
VapourFraction
VolumeVapourFraction
LiquidDropout
Zfactor[j]
Density[j]
Viscosity[j]
EnthalpyPerMole[j]
EntropyPerMole[j]
Enthalpy[j]
Entropy[j]
Cp[j]
Cv[j]
JTCoeff[j]
SpeedOfSound[j]
MolecularWeight[j]

OpenServer User's Manual


PVTP and OpenServer 432

MolarVolume[j]
IFT
CostaldOilDensity
StandingKatzOilDensity
VapourToLiquidFraction
VolumeVapourToLiquidFraction
WaterInGasFraction
WaterInOilFraction
HCInWaterFraction
TotalEnthalpy
TotalCp
PTS.PROCESSDATA.CHILLER[i]. Same as separator variables above
PTS.PROCESSDATA.JOINT[i].CONN Counts number of connections from joint i
ECTSFROMCOUNT
PTS.PROCESSDATA.JOINT[i].CONN Extracts where connection j is from for joint i
ECTSFROM[j]
PTS.PROCESSDATA.JOINT[i].CONN Counts number of connections to joint i
ECTSTOCOUNT
PTS.PROCESSDATA.JOINT[i].CONN Extracts where connection j is to for joint i
ECTSTO[j]
PTS.PROCESSDATA.JOINT[i].LABE Label of joint i
L
PTS.PROCESSDATA.JOINT[i].EOSP Extracts EOS properties of joint i. The following
ROPERTIES. EOS properties are accessible:
NumComponents
Tcrit[j]
Pcrit[j]
Vcrit[j]
Acentric[j]
MW[j]
SpGrav[j]
Vs[j]
Tboil[j]
Parachor[j]
OmegaA[j]
OmegaB[j]
PTS.PROCESSDATA.JOINT[i].OUTP Extracts liquid composition properties of joint i.
UTCOMPOSITION. The following composition properties are
accessible:
NumComponents
MoleFraction[j]
AverageMolecularWeight
ResidualAmount
ResidualWeight
StartCalcWeight

© 1990-2018 Petroleum Experts Limited


433 OpenServer

PTS.PROCESSDATA.SOURCE[i].CO Counts number of connections from source i


NNECTSFROMCOUNT
PTS.PROCESSDATA.SOURCE[i].CO Extracts where connection j is from for source i
NNECTSFROM[j]
PTS.PROCESSDATA.SOURCE[i].CO Counts number of connections to source i
NNECTSTOCOUNT
PTS.PROCESSDATA.SOURCE[i].CO Extracts where connection j is to for source i
NNECTSTO[j]
PTS.PROCESSDATA.SOURCE[i].LA Label of source i
BEL
PTS.PROCESSDATA.SOURCE[i].EO
Extracts EOS properties of source i. The
SPROPERTIES. following EOS properties are accessible:
NumComponents
Tcrit[j]
Pcrit[j]
Vcrit[j]
Acentric[j]
MW[j]
SpGrav[j]
Vs[j]
Tboil[j]
Parachor[j]
OmegaA[j]
OmegaB[j]
PTS.PROCESSDATA.EXPORTBLOC Counts number of connections from
K.CONNECTSFROMCOUNT exportblock
PTS.PROCESSDATA.EXPORTBLOC Extracts where connection j is from
K.CONNECTSFROM[j]
PTS.PROCESSDATA.EXPORTBLOC Counts number of connections to exportblock
K.CONNECTSTOCOUNT
PTS.PROCESSDATA.EXPORTBLOC Extracts where connection j is to for
K.CONNECTSTO[j] exportblock
PTS.PROCESSDATA.EXPORTBLOC Checks for connection to gas outlet
K.ISGASCONNECTED
PTS.PROCESSDATA.EXPORTBLOC Checks for connection to LNG outlet
K.ISLNGCONNECTED
PTS.PROCESSDATA.EXPORTBLOC Checks for connection to LPG outlet
K.ISLPGCONNECTED
PTS.PROCESSDATA.EXPORTBLOC Checks for connection to condensate outlet
K.ISCONDENSATECONNECTED
PTS.PROCESSDATA.EXPORTBLOC Checks for connection to oil outlet
K.ISOILCONNECTED
PTS.PROCESSDATA.EXPORTBLOC Checks for connection and non-zero mole rate

OpenServer User's Manual


PVTP and OpenServer 434

K.HASGAS
PTS.PROCESSDATA.EXPORTBLOC Checks for connection and non-zero mole rate
K.HASLNG
PTS.PROCESSDATA.EXPORTBLOC Checks for connection and non-zero mole rate
K.HASLPG
PTS.PROCESSDATA.EXPORTBLOC Checks for connection and non-zero mole rate
K.HASCONDENSATE
PTS.PROCESSDATA.EXPORTBLOC Checks for connection and non-zero mole rate
K.HASOIL
PTS.PROCESSDATA.EXPORTBLOC Extracts liquid composition properties of
K.CONDENSATECOMPOSITION. condensate export block. The following
composition properties are accessible:
NumComponents
MoleFraction[j]
AverageMolecularWeight
ResidualAmount
ResidualWeight
StartCalcWeight
PTS.PROCESSDATA.EXPORTBLOC Extracts EOS properties of the condensate
K.CONDENSATEEOSPROPERTIES. export block. The following EOS properties are
accessible:
NumComponents
Tcrit[j]
Pcrit[j]
Vcrit[j]
Acentric[j]
MW[j]
SpGrav[j]
Vs[j]
Tboil[j]
Parachor[j]
OmegaA[j]
OmegaB[j]
PTS.PROCESSDATA.EXPORTBLOC Extracts condensate export block flash results.
K.CONDENSATERESULTS. The following flash results are accessible:
VapourFraction
VolumeVapourFraction
LiquidDropout
Zfactor[j]
Density[j]
Viscosity[j]
EnthalpyPerMole[j]
EntropyPerMole[j]
Enthalpy[j]
Entropy[j]

© 1990-2018 Petroleum Experts Limited


435 OpenServer

Cp[j]
Cv[j]
JTCoeff[j]
SpeedOfSound[j]
MolecularWeight[j]
MolarVolume[j]
IFT
CostaldOilDensity
StandingKatzOilDensity
VapourToLiquidFraction
VolumeVapourToLiquidFraction
WaterInGasFraction
WaterInOilFraction
HCInWaterFraction
TotalEnthalpy
TotalCp
PTS.PROCESSDATA.EXPORTBLOC Extracts composition properties of LNG export
K.LNGCOMPOSITION. block. See condensate composition above.
PTS.PROCESSDATA.EXPORTBLOC Extracts EOS properties of the LNG export
K.LNGEOSPROPERTIES. block. See condensate EOS properties above.
PTS.PROCESSDATA.EXPORTBLOC Extracts LNG export block flash results. See
K.LNGRESULTS. condensate results above.
PTS.PROCESSDATA.EXPORTBLOC Extracts composition properties of LPG export
K.LPGCOMPOSITION. block. See condensate composition above.
PTS.PROCESSDATA.EXPORTBLOC Extracts EOS properties of the LPG export
K.LPGEOSPROPERTIES. block. See condensate EOS properties above.
PTS.PROCESSDATA.EXPORTBLOC Extracts LPG export block flash results. See
K.LPGRESULTS. condensate results above.
PTS.PROCESSDATA.EXPORTBLOC Extracts composition properties of the gas
K.GASCOMPOSITION. export block. See condensate composition
above.
PTS.PROCESSDATA.EXPORTBLOC Extracts EOS properties of the gas export
K.GASEOSPROPERTIES. block. See condensate EOS properties above.
PTS.PROCESSDATA.EXPORTBLOC Extracts gas export block flash results. See
K.GASRESULTS. condensate results above.
PTS.PROCESSDATA.EXPORTBLOC Extracts composition properties of the oil
K.OILCOMPOSITION. export block. See condensate composition
above.
PTS.PROCESSDATA.EXPORTBLOC Extracts EOS properties of the oil export block.
K.OILEOSPROPERTIES. See condensate EOS properties above.
PTS.PROCESSDATA.EXPORTBLOC Extracts oil export block flash results. See
K.OILRESULTS. condensate results above.
PTS.PROCESSDATA.EXPORTBLOC Export pressure of the condensate export
K.CONDENSATEEXPORTPRESSUR block.

OpenServer User's Manual


PVTP and OpenServer 436

E
PTS.PROCESSDATA.EXPORTBLOC Export temperature of the condensate export
K.CONDENSATEEXPORTTEMPERA block.
TURE
PTS.PROCESSDATA.EXPORTBLOC Export pressure of the LNG export block.
K.LNGEXPORTPRESSURE
PTS.PROCESSDATA.EXPORTBLOC Export temperature of the LNG export block.
K.LNGEXPORTTEMPERATURE
PTS.PROCESSDATA.EXPORTBLOC Export pressure of the LPG export block.
K.LPGEXPORTPRESSURE
PTS.PROCESSDATA.EXPORTBLOC Export temperature of the LPG export block.
K.LPGEXPORTTEMPERATURE
PTS.PROCESSDATA.EXPORTBLOC Molecular weight upper limit of LNG export
K.LNGMOLECULARWEIGHTUP
PTS.PROCESSDATA.EXPORTBLOC Molecular weight upper limit of LPG export
K.LPGMOLECULARWEIGHTUP
PTS.PROCESSDATA.EXPORTBLOC Standard pressure for export
K.STANDARDPRESSURE
PTS.PROCESSDATA.EXPORTBLOC Standard temperature for export
K.STANDARDTEMPERATURE
PTS.PROCESSDATA.FIXEDPOINT.C Counts number of connections from fixed point
ONNECTSFROMCOUNT
PTS.PROCESSDATA.FIXEDPOINT.C Extracts where connection j is from
ONNECTSFROM[j]
PTS.PROCESSDATA.FIXEDPOINT.C Counts number of connections to fixed point
ONNECTSTOCOUNT
PTS.PROCESSDATA.FIXEDPOINT.C Extracts where connection j is to
ONNECTSTO[j]
PTS.PROCESSDATA.FIXEDPOINT.L Extracts label of fixed point
ABEL
PTS.PROCESSDATA.FIXEDPOINT.F 0 - Gas
IXEDPOINTDATA.FIXEDQUANTITYTY 1 - Liquid
PE 2 - Mass
PTS.PROCESSDATA.FIXEDPOINT.F Extracts actual rate value
IXEDPOINTDATA.FIXEDQUANTITY
PTS.PROCESSDATA.FIXEDPOINT.F 0 - Use upstream
IXEDPOINTDATA.MEASUREMENTC 1 - Use export
ONDITIONSMETHOD 2 - Use user values
PTS.PROCESSDATA.FIXEDPOINT.F 0 - Not set
IXEDPOINTDATA.OUTLETPHASE 1 - Liquid
2 - Vapour
PTS.PROCESSDATA.FIXEDPOINT.F Pressure of fixed point
IXEDPOINTDATA.PRESSURE

© 1990-2018 Petroleum Experts Limited


437 OpenServer

PTS.PROCESSDATA.FIXEDPOINT.F Temperature of fixed point


IXEDPOINTDATA.TEMPERATURE
PTS.SURFACERESULTS.HASLNGR Checks for LNG results
ESULTS
PTS.SURFACERESULTS.HASLPGR Checks for LPG results
ESULTS
PTS.SURFACERESULTS.HASCOND Checks for condensate results
ENSATERESULTS
PTS.SURFACERESULTS.OILGASRE Used to extract surface results. The following
SULTS. parameters can be extracted:
CGR
GASMOLARVOLUME
GOR
MOLEFRACTIONINGAS
MOLEFRACTIONINOIL
OILMOLARVOLUME
API
GASDENSITY
GASFRAVITY
GASMOLEWT
GASVISCOSITY
GASVOLUME
GASWEIGHT
GASZFACTOR
GROSSHV
IDEALGASDENSITY
NETHV
OILDENSITY
OILGRAVITY
OILMOLEWT
OILVISCOSITY
OILVOLUME
OILWEIGHT
OILZFACTOR
OILCOMPOSITION. (see composition
above)
GASCOMPOSITION. (see composition
above)
PTS.SURFACERESULTS.LNGRESU Extracts the LNG export results. The following
LTS.EXPORTRESULTS. parameters can be extracted:
DENSITY
GASMOLARVOLUME
LIQUIDMOLARVOLUME
MOLECULARWEIGHT
MOLEFRACTION
RESIDUALMASS

OpenServer User's Manual


PVTP and OpenServer 438

GASRESIDUALVOLUME
LIQUIDRESIDUALVOLUME
SPECIFICVOLUME
VISCOSITY
WEIGHT
ZFACTOR
PTS.SURFACERESULTS.LNGRESU Extracts the LNG surface results. See export
LTS.SURFACERESULTS. results above for all parameters which are
accessible.
PTS.SURFACERESULTS.LNGRESU Extracts composition properties of LNG
LTS.COMPOSITION. surface results. See condensate composition
above.
PTS.SURFACERESULTS.LPGRESU Extracts the LPG export results.See export
LTS.EXPORTRESULTS. results above for all parameters which are
accessible.
PTS.SURFACERESULTS.LPGRESU Extracts the LPG surface results. See export
LTS.SURFACERESULTS. results above for all parameters which are
accessible.
PTS.SURFACERESULTS.LPGRESU Extracts composition properties of LPG
LTS.COMPOSITION. surface results. See condensate composition
above.
PTS.SURFACERESULTS.CONDENS Extracts the condensate export results.See
ATERESULTS.EXPORTRESULTS. export results above for all parameters which
are accessible.
PTS.SURFACERESULTS.CONDENS Extracts the condensate surface results. See
ATERESULTS.SURFACERESULTS. export results above for all parameters which
are accessible.
PTS.SURFACERESULTS.CONDENS Extracts composition properties of condensate
ATERESULTS.COMPOSITION. surface results. See condensate composition
above.
PTS.INPUTCOMPOSITION. Extracts input composition. See condensate
composition above.
PTS.INPUTEOSPROPERTIES. Extracts input EOS properties. See
condensate EOS properties above.
PVT.CALCUL[i].PTS[j] Access to all the PTS results of a given
[k].SURFACERESULTS etc… calculation (as per the strings above)
i: stream name or index
j: row index
k: 0 for feed PTS, 1 for liquid, 2 for vapour.
The value of 0 for the feed is only valid in
the CCE. Value returned is -1 if there is no
vapour or liquid present
CALC_PSAT_MIN_TEMP PSAT Calculation auto minimum temperature
CALC_PSAT_MAX_TEMP PSAT Calculation auto maximum temperature

© 1990-2018 Petroleum Experts Limited


439 OpenServer

CALC_PSAT_NO_VALUES PSAT Calculation auto no of values


CALC_USER_CCE_TEMPS[n] CCE Calculation : user-defined temperatures
CALC_USER_CCE_PRESSURES[n] CCE Calculation : user-defined pressures
CALC_CCE_NO_TEMP_VALUES CCE Calculation : auto number of
temperatures
CALC_CCE_NO_PRESS_VALUES CCE Calculation : auto number of pressures
CALC_CCE_MAX_TEMP CCE Calculation : auto maximum temperature
CALC_CCE_MIN_TEMP CCE Calculation : auto minmum temperature
CALC_CCE_MAX_PRESS CCE Calculation : auto maximum pressure
CALC_CCE_MIN_PRESS CCE Calculation : auto minmum pressure
CALC_DIFF_PRESSURES[n] DIFF Calculation : stage pressures
CALC_DIFF_TEMP[0] DIFF Calculation : temperature
CALC_COMPOS_PRESSURES[n] Composite Differential Calculation : stage
pressures
CALC_COMPOS_TEMP[0] Composite Differential Calculation :
temperature
CALC_CVD_PRESSURES [n] CVD Calculation : stage pressures
CALC_CVD_TEMP[0] CVD Calculation : temperature
CALC_DEPL_PRESSURES[n] Depletion Study Calculation : stage pressures
CALC_DEPL_TEMP[0] Depletion Study Calculation : temperature
CALC_SWELL_TEMPS[n] Swelling Test : temperatures
CALC_SWELL_COMPS[n] Swelling Test : compositions
CALC_SWELL_VOLS[n] Swelling Test : vol/vol inputs
CALC_GORCORR_SEP_PRESSUR GOR/FVF Correction : Separator stage
ES [n] pressures
CALC_GORCORR_SEP_TEMPERA GOR/FVF Correction : Separator stage
TURES [n] temperatures
REGR_GORCORR_SEP_PRESSUR Regression GOR/FVF Correction : Separator
ES [n] stage pressures
REGR_GORCORR_SEP_TEMPERA Regression GOR/FVF Correction : Separator
TURES [n] stage temperatures
CALC_PHASEENV_TEST_PRESSU Phase Envelope Test Points: pressures
RES [n]
CALC_PHASEENV_TEST_TEMPER Phase Envelope Test Points: temperatures
ATURES [n]
CALC_SHOW_PHASEENV_TESTPT Phase Envelope Test Points: show points flag
S
CALC_TEST_POINT_VALUE1[n] Plot Test Points: value 1
CALC_TEST_POINT_VALUE2[n] Plot Test Points: value 2
CALC_TEST_POINT_INDEX1[n] Plot Test Points: index 1

OpenServer User's Manual


PVTP and OpenServer 440

CALC_TEST_POINT_INDEX2[n] Plot Test Points: index 2


CALC_TEST_POINT_PROCESS[n] Plot Test Points: process eg CCE
CALC_BKOIL_EXPORT_COLUMN [n] Blackoil Export Calculation: column select flag
CALC_BKOIL_EXPORT_TEMPS [n] Blackoil Export Calculation: table temperature
CALC_BKOIL_EXPORT_PRESSURE Blackoil Export Calculation: table pressures
S [n][l]
CALC_BKOIL_EXPORT_TABLE Blackoil Export Calculation: active table
number
CALC_PHASE_ENV_CURVE_POINT Phase Envelope Calculation: number of points
S per curve
CALC_PHASENV_FRACTION[n] Phase Envelope Calculation: vapour fractions
to calculate
CALC_WAXTEMP_MAX_PRESS Wax Appearance Temp: auto maximum
pressure
CALC_WAXTEMP_MIN_PRESS Wax Appearance Temp: auto minimum
pressure
CALC_WAXTEMP_NO_PRESS_VAL Wax Appearance Temp: auto number of
UES pressure values
CALC_WAXTEMP_PRESSURES[n] Wax Appearance Temp: user-defined
pressures
CALC_HYDRATE_MAX_TEMP Hydrate Calculation: auto maximum
temperature
CALC_HYDRATE_MIN_TEMP Hydrate Calculation: auto minimum
temperature
CALC_HYDRATE_NO_TEMP_VALU Hydrate Calculation: auto number of
ES temperature
CALC_HYDRATE_TEMPERATURES[ Hydrate Calculation: user-defined
n] temperatures
CALC_HYDRATE_INHIBIT_CONC [n] Hydrate Calculation: inhibitor concentrations
UTILS_ENTHALPY_BALANCE_STAR Utility Enthalpy Balance: start pressure
T_PRESS
UTILS_ENTHALPY_BALANCE_END Utility Enthalpy Balance: end pressure
_PRESS
UTILS_ENTHALPY_BALANCE_END Utility Enthalpy Balance: end temperature
_TEMP
UTILS_ENTHALPY_BALANCE_MAX Utility Enthalpy Balance: auto maximum
_PRESS pressure
UTILS_ENTHALPY_BALANCE_MIN_ Utility Enthalpy Balance: auto minimum
PRESS pressure
UTILS_ENTHALPY_BALANCE_NO_ Utility Enthalpy Balance: auto number of
VALUES pressures
UTILS_ENTHALPY_BALANCE_USE Utility Enthalpy Balance: auto number of

© 1990-2018 Petroleum Experts Limited


441 OpenServer

R_PRESSURES pressures
CALC_SMALL_SEP_OILDENSITY[n] Small Separator Calc: oil density result array
CALC_SMALL_SEP_OILAPI[n] Small Separator Calc: oil API result array
CALC_SMALL_SEP_GOR[n] Small Separator Calc: GOR result array
CALC_SMALL_SEP_GASGRAVITY[n Small Separator Calc: gas gravity result array
]
SLIMTUBE_NUMCELLS Slimtube calculation: Number of cells
SLIMTUBE_CELL_DELTAX[n] Slimtube calculation: Delta X value for cell n
SLIMTUBE_CELL_DELTAY[n] Slimtube calculation: Delta Y value for cell n
SLIMTUBE_CELL_DELTAZ[n] Slimtube calculation: Delta Z value for cell n
SLIMTUBE_CELL_DEPTH[n] Slimtube calculation: Depth value for cell n
SLIMTUBE_CELL_PRESSURE[n] Slimtube calculation: Pressure value for cell n
SLIMTUBE_CELL_PERM[n] Slimtube calculation: Permeability value for cell
n
SLIMTUBE_CELL_POROSITY[n] Slimtube calculation: Porosity value for cell n
SLIMTUBE_PRESSGRADIENT Slimtube calculation: Pressure gradient
SLIMTUBE_RESOILSATN Slimtube calculation: Residual Oil saturation
SLIMTUBE_GASSATN Slimtube calculation: Gas saturation
SLIMTUBE_ROCKCOMP Slimtube calculation: Rock Compressibility
SLIMTUBE_TEMPERATURE Slimtube calculation: Temperature
SLIMTUBE_PERM_NUMINTABLE Slimtube calculation: Number of perms in table
SLIMTUBE_PERM_NUMINTABLE Slimtube calculation: Number of perms in table
SLIMTUBE_CELL_TABLE_SOIL[n] Slimtube calculation: Table SOIL value n
SLIMTUBE_CELL_TABLE_KRO[n] Slimtube calculation: Table KRO value n
SLIMTUBE_CELL_TABLE_KRG[n] Slimtube calculation: Table KRG value n
SLIMTUBE_CELL_TABLE_PCGO[n] Slimtube calculation: Table PCGO value n
SLIMTUBE_PRODRATE Slimtube calculation: Production rate
SLIMTUBE_STARTPRESSURE Slimtube calculation: Start Pressure
SLIMTUBE_INJRATE Slimtube calculation: Injection rate
SLIMTUBE_INJRATEPPI Slimtube calculation: Injection rate PPI
SLIMTUBE_INJPPI Slimtube calculation: Injection PPI
SLIMTUBE_TIMESTEP[n] Slimtube calculation: Time step number n
SLIMTUBE_NUM_TIMESTEPS Slimtube calculation: Number of time steps
SLIMTUBE_CELLDATA_VALUES Slimtube calculation: Number of cell data
values
SLIMTUBE_PRODCELL Slimtube calculation: Producing Cell
SLIMTUBE_INJCELL Slimtube calculation: Producing Cell
SLIMTUBE_PRESSURES[n] Slimtube calculation: user-defined tube
pressures

OpenServer User's Manual


PVTP and OpenServer 442

SLIMTUBE_TIMESTEPS[n] Slimtube calculation: Calculated timesteps


SLIMTUBE_MAXPRESSURE Slimtube calculation: auto maximum pressure
SLIMTUBE_MINPRESSURE Slimtube calculation: auto minimum pressure
SLIMTUBE_PRESSURE_VALUES Slimtube calculation: auto number of pressures
SLIMTUBE_PRESSURE_VALUES Slimtube calculation: auto number of pressures
UTILS_TARGETGOR Stream Target GOR calculation: GOR Target
UTILS_TARGETPSAT Stream Target PSAT calculation: Saturation
Pressure Target
UTILS_TARGETPSAT_TEMP Stream Target PSAT calculation: temperature
UTILS_WATERSATN_MAXTEMP Utilities water saturation calculation: auto
maximum temperature
UTILS_WATERSATN_MINTEMP Utilities water saturation calculation: auto
minimum temperature
UTILS_WATERSATN_MAXPRESS Utilities water saturation calculation: auto
maximum pressure
UTILS_WATERSATN_PRESSVALUE Utilities water saturation calculation: number of
S pressures
UTILS_WATERSATN_PRESSVALUE Utilities water saturation calculation: number of
S temperatures

7.9 Carrying out Calculations and Obtaining Results


Examples of all modes and calculations are included in the sample Excel spreadsheets
distributed with PVTP. The calculation to be done is set using the
OPTIONS.CALC_TYPE variable.

The following alternative calls can be made:

BLACKOIL_OIL Black oil model for oil


BLACKOIL_GAS Black oil model for gas
BLACKOIL_COND Black oil model for condensate
CRITPOINT Critical point calculation
PHASEENV Phase envelope calculation
PSAT Saturation pressure calculation
CCE Constant composition expansion
CVD Constant volume depletion
DIFF Differential liberation
SEP Separator calculation
COMPGRAD Compositional gradient calculation
SWEL Swelling test calculation

© 1990-2018 Petroleum Experts Limited


443 OpenServer

DEPL Depletion study calculation


BLACKOIL_EXPORT Black oil export table calculation
CCE_WITH_WATER Multiphase constant composition expansion
SEP_WITH_WATER Multiphase separator
COMPOS Composite Differential liberation
MULTIPHASE Multiphase (wax) flash
WAXTEMP Wax appearance temperature
HYDRATE Hydrate formation pressure
ISENTHALPIC_FLASH Enthalpy balance calculation
SLIMTUBE SlimTube simulation
WATER_SATURATION Water saturation calculation

Additional Calculations:
FLASH – Section 8.9
Small Separator Calculation – Section 8.10
Saturation Pressure at Reference Conditions – Section 8.11
Recombination Calculations – Section 8.12
Allocation: Blending to a target GOR – Section 8.13

Important Calls:
RESET_STREAM_IN_CALC_FLAGS resets stream calculation flags prior to
calculation
DoCmd Do calculation identified by keyword on stream
"PVT.KEYWORD[{Wellstream}]" index or name
CALC_COLUMN_TOTAL Find number of columns calculated
CALC_NUM_RESULTS Find lines of results calculated
CALC_COLUMN_NAME[n] Get name of column n (zero based index)
CALC_COLUMN_UNIT[n] Get unit string of column n (zero based index)
CALC_COLUMN_VALUE[l][n] Get value calculated for line l and column n
(zero based indices)

Example:
The code fragment below is taken from the OPEN_CCE_PSAT_CALC.XLS file and
shows the basics of setting up and initiating a calculation.

'Identify the mode to be used in the calculation USER or AUTO


SendCellData "PVT.CALCUL[" + CStr(iStream) + "].CALC_CCE_MODE"
If (Worksheets(Sheet).Cells(10, 2) = "AUTO") Then
iLine = 13
'AUTO Mode
'send calculation ranges
SendCellData "PVT.CALCUL[" + CStr(iStream) +
"].CALC_CCE_MIN_TEMP"

OpenServer User's Manual


PVTP and OpenServer 444

SendCellData "PVT.CALCUL[" + CStr(iStream) +


"].CALC_CCE_MAX_TEMP"
SendCellData "PVT.CALCUL[" + CStr(iStream) +
"].CALC_CCETEMPVALUES"
SendCellData "PVT.CALCUL[" + CStr(iStream) +
"].CALC_CCE_MIN_PRESS"
SendCellData "PVT.CALCUL[" + CStr(iStream) +
"].CALC_CCE_MAX_PRESS"
SendCellData "PVT.CALCUL[" + CStr(iStream) +
"].CALC_CCEPRESSVALUES"
Else
iLine = 23
' USER Mode
' send individual temperatures and pressures
For iCalc = 0 To 9
DoSetStr iLine, 1, "PVT.CALCUL["+CStr(iStream)
+"].CALC_USER_CCE_TEMPS["+CStr(iCalc)+"]", False
For iCol = 0 To 4
DoSetStr iLine, 2 + iCol, "PVT.CALCUL[" + CStr(iStream) +
"].CALC_USER_CCE_PRESSURES[" + CStr(iCalc + (10 *
iCol)) + "]", False
Next
iLine = iLine + 1
Next
End If
' Clear the stream calculation flags
DoCmd "PVT.RESET_STREAM_IN_CALC_FLAGS"
' Tell the program to do a CCE Calculation on stream identified by index iStream
DoCmd "PVT.CCE[" + CStr(iStream) + "]"

The first section reflects the CCE input dialog, sending the mode the calculation is to
operate with and the temperatures and pressures to be used. All that is required then is
to clear any existing calculation flags and to initiate the command using the keyword
from the list above

Note that the calculation has been set up to do one stream at a time. To do multiple
streams, call the command again with a different stream and index name.

Once the calculation is complete, any of the columns calculated can be accessed as
shown in the code fragment below:

'Find the number of results produced during the calculation


iNumRes = DoGetCheck("PPVTVT.CALCUL["+CStr(iStream)
+"].CALC_NUM_RESULTS")

'Find the number of columns calculated for CCE


iNumCols = DoGetCheck("PVT.CALC_COLUMN_TOTAL")

© 1990-2018 Petroleum Experts Limited


445 OpenServer

For iCol = 0 To iNumCols - 1


'Get column names
Worksheets(Sheet).Cells(iLine, iCol + 1) =
DoGet("PVT.CALC_COLUMN_NAME["+CStr(iCol)+"]")

'Get column units


Worksheets(Sheet).Cells(iLine + 1, iCol + 1) =
DoGet("PVT.CALC_COLUMN_UNIT["+CStr(iCol)+"]")
For iRes = 0 To iNumRes - 1
'Get all column values
Worksheets(Sheet).Cells(iLine + iRes + 2, iCol + 1) =
DoGet("PVT.CALCUL["+CStr(iStream)
+"].CALC_COLUMN_VALUE["+CStr(iRes)+"]["+CStr(iCol)+"]")

Next
Next

The calculation results form a table which is normally displayed in PVTP results dialog.
The first step is to find the number of lines calculated using CALC_NUM_RESULTS.
The number of columns available for this calculation can then be retrieved using
CALC_COLUMN_TOTAL. Individual column names and units are found by calls to
CALC_COLUMN_NAME and CALC_COLUMN_UNIT with a zero-based index for
the column number. Repeated calls to CALC_COLUMN_VALUE is then used to fill in
the table.

7.9.1 Analysis
Analysis is available with most of the calculations. This data can be retrieved using code
segments illustrated below:

' Get analysis number iRes


Worksheets(Sheet).Cells(4, 2) = iRes

'Display the analysis block temperature and pressure


iErr = DisplayCellData("Temperature", DoGetCheck("PVT.CALCUL[" +
CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) + "].STAGE_TEMP"))
iErr = DisplayCellData("Pressure", DoGetCheck("PVT.CALCUL[" + CStr(iStream)
+ "].CALC_ANALYSIS[" + CStr(iRes) + "].STAGE_PRESS"))
Worksheets(Sheet).Range("A10:E200").ClearContents

'Find the number of components


iNumComp = DoGetCheck("PVT.STREAMRUN[" + CStr(iStream) +
"].NUMCOMPONENTS")
iLine = 10
For icomp = 0 To iNumComp - 1

OpenServer User's Manual


PVTP and OpenServer 446

'Get component name, liquid composition, vapour composition and K values


Worksheets(Sheet).Cells(iLine + icomp, 1) = DoGet("PVT.STREAMRUN[" +
CStr(iStream) + "].COMPONENT[" + CStr(icomp) + "]")
Worksheets(Sheet).Cells(iLine + icomp, 2) = DoGetCheck("PVT.CALCUL["
+ CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) +
"].LIQUID_COMPOSITION[" + CStr(icomp) + "]")
Worksheets(Sheet).Cells(iLine + icomp, 3) = DoGetCheck("PVT.CALCUL["
+ CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) +
"].VAPOUR_COMPOSITION[" + CStr(icomp) + "]")
Worksheets(Sheet).Cells(iLine + icomp, 4) = DoGetCheck("PVT.CALCUL["
+ CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) + "].KVALUES[" +
CStr(icomp) + "]")
Next
iLine = iLine + iNumComp

'Get Extra data


iErr = DisplayCellData("Percent Vapour", DoGetCheck("PVT.CALCUL[" +
CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) + "].VAP_PERCENT"))
iErr = DisplayCellData("Percent Liquid", DoGetCheck("PVT.CALCUL[" +
CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) + "].LIQ_PERCENT"))
iErr = DisplayCellData("Oil Gravity", DoGetCheck("PVT.CALCUL[" +
CStr(iStream) + "].CALC_ANALYSIS[" + CStr(iRes) + "].OIL_GRAVITY"))

The individual analysis blocks are accessed via the label CALC_ANALYSIS[n] where n
is a zero-based index. Data is divided into identification, e.g. STAGE_TEMP or
STAGE_DEPTH component data such as vapour composition K values etc. or extra
data such as Oil_GRAVITY , TOTAL_GOR etc.

The data available is listed below:

STAGE_TEMP Analysis temperature


STAGE_PRESS Analysis pressure
STAGE_DEPTH Analysis depth
TOTAL_COMPOSITION[n] Total composition for component[n]
VAPOUR_COMPOSITION[n] Vapour composition for component[n]
WATER_COMPOSITION[n] Water composition for component[n]
LIQUID_COMPOSITION[n] Liquid composition for component[n]
LIQUID_COMPOSITION2[n] Liquid 2 composition for component[n] - multiphase
LIQUID_COMPOSITION3[n] Liquid 3 composition for component[n] - multiphase
LIQUID_COMPOSITION4[n] Liquid 4 composition for component[n] - multiphase
LIQUID_COMPOSITION5[n] Liquid 5 composition for component[n] - multiphase
SOLID_COMPOSITION[n] Solid composition for component[n]
ACCVAP_COMPOSITION[n] Accum. vapour composition for component[n]
KVALUES[n] K Values for component[n]

© 1990-2018 Petroleum Experts Limited


447 OpenServer

VAP_PERCENT Mole percent vapour


LIQ_PERCENT Mole percent liquid
ACCUM_PERCENT Mole percent accum. vapour
OIL_GRAVITY Oil gravity
TOTAL_GOR Total GOR
STAGE_GOR Stage GOR
GAS_GRAVITY Gas gravity
STAGE_GROSS_HV Stage gross heating value
STAGE_NET_HV Stage net heating value
ACCUM_GROSS_HV Accum. gross heating value
ACCUM_NET_HV Accum net heating value

7.9.2 Flash Calculation


The two-phase flash calculation is a key part of any EoS calculation package. The
majority of calculations (e.g. constant volume depletion or separator) are constructed
from a series of flash calculations. To increase the flexibility of using the OpenServer
capabilities with PVTP , the flash calculation has been made accessible to the user.

Example:
The core of the flash commands is given in the code segment below, which is taken
from the Excel spreadsheet OPENPVT.XLS.

' Tell program which temperature and pressure to flash at


SendCellData "PVT.STREAMRUN[" + CStr(iStream) + "].RUNTEMP"
SendCellData "PVT.STREAMRUN[" + CStr(iStream) + "].RUNPRESS"

'Do flash calculation


DoCmd "PVT.FLASH[" + CStr(iStream) + "]"
iLine = iLine + 2

'Display compositions and results


DisplayRuntimeComponentData

All the work of flash is done within the STREAMRUN structure and as such is done with
a temporary, intermediate type of data. The sequence followed is as follows.

Set up the compositions and properties within the STREAMRUN structure


Send the required flash temperature and pressure to RUNTEMP and
RUNPRESS respectively
Perform flash using the FLASH command
Read the vapour and liquid compositions and K values calculated from
STREAMRUN

OpenServer User's Manual


PVTP and OpenServer 448

Read the other calculated data eg. Vapour fraction, z factors phase densities etc.
from STREAMRUN .

A Visual Basic file (FlashDemo.*) which gives illustrates doing a flash is also distributed
with PVTP.

7.9.3 Small Separator Calculation


The small separator calculation is called from the small calculation dialog within PVTP.
The inputs to it are the same as the larger separator calculation, but the calculation has
been slimmed down to run faster and give a smaller number of results.
Both separator calculations are illustrated in OPEN_SEP_CALC.XLS. The fragment of
code below is taken from this file.

For iCalc = 0 To 9
DoSetStr iLine, 1, "PVT.CALCUL[" + CStr(iStream) +
"].CALC_SEP_TEMPERATURES[" + CStr(iCalc) + "]", False
DoSetStr iLine, 2, "PVT.CALCUL[" + CStr(iStream) +
"].CALC_SEP_PRESSURES[" + CStr(iCalc) + "]", False
iLine = iLine + 1
Next
iLine = iLine + 1
DoCmd "PVT.SMALL_SEP[" + CStr(iStream) + "]"
iLine = 26
'Worksheets(Sheet).Range("A27:z39").ClearContents
iErr = DisplayCellData("Number of Stages", DoGetCheck("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SEPTEMPVALUES"))
iNumRes = DoGetCheck("PVT.CALCUL[" + CStr(iStream) +
"].CALC_SEPTEMPVALUES")
iLine = iLine + 1
Worksheets(Sheet).Cells(iLine, 1) = "Temperature"
Worksheets(Sheet).Cells(iLine, 2) = "Pressure"
Worksheets(Sheet).Cells(iLine, 3) = "Oil Density"
Worksheets(Sheet).Cells(iLine, 4) = "Oil API"
Worksheets(Sheet).Cells(iLine, 5) = "GOR"
Worksheets(Sheet).Cells(iLine, 6) = "Gas Gravity"
iLine = iLine + 1
For iRes = 0 To iNumRes - 1
Worksheets(Sheet).Cells(iLine + iRes, 1) = DoGet("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SEP_TEMPERATURES[" + CStr(iRes) + "]")
Worksheets(Sheet).Cells(iLine + iRes, 2) = DoGet("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SEP_PRESSURES[" + CStr(iRes) + "]")
Worksheets(Sheet).Cells(iLine + iRes, 3) = DoGet("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SMALL_SEP_OILDENSITY[" + CStr(iRes) + "]")
Worksheets(Sheet).Cells(iLine + iRes, 4) = DoGet("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SMALL_SEP_OILAPI[" + CStr(iRes) + "]")

© 1990-2018 Petroleum Experts Limited


449 OpenServer

Worksheets(Sheet).Cells(iLine + iRes, 5) = DoGet("PVT.CALCUL[" +


CStr(iStream) + "].CALC_SMALL_SEP_GOR[" + CStr(iRes) + "]")
Worksheets(Sheet).Cells(iLine + iRes, 6) = DoGet("PVT.CALCUL[" +
CStr(iStream) + "].CALC_SMALL_SEP_GASGRAVITY[" + CStr(iRes) + "]")
Next

The procedure followed is as follows:

Place the stage temperatures and pressures within the


CALC_SEP_TEMPERATURES[n] and CALC_SEP_PRESSURES zero-based
arrays
Call the SMALL_SEP[stream] command
Read the number of stages determined using the CALC_SEPTEMPVALUES
variable
Read the stage outputs VIZ oil gravity, gas gravity GOR etc.

7.9.4 Saturation Pressure at Reference Conditions


The Saturation Pressure at Reference calculation is called from the small calculation
dialog within PVTP. The use of this calculation is illustrated in
OPEN_CCE_PSAT_CALC.XLS from which the code fragment below is taken:

SendCellData "PVT.STREAMRUN[" + CStr(iStream) + "].RUNTEMP"


DoCmd "PVT.SINGLE_PSAT[" + CStr(iStream) + "]"
iLine = 7
iErr = DisplayCellData("PSAT", DoGetCheck("PVT.STREAMRUN[" +
CStr(iStream) + "].RUNPRESS"))

The use of this calculation is very straightforward. Place the temperature required in
RUNTEMP. Then call the calculation using the SINGLE_PSAT command. The resulting
saturation pressure will be placed in the RUNPRESS variable.
7.9.5 Recombination Calculation
The PVTP program contains 2 recombination calculations which are accessed via the
Data|Select Components dialog. The 2 modes available are:

- Simple: where compositions of 1 separator vapour are combined with stock


tank oil and gas to give the recombined composition and
- Extended: where up to 5 separator compositions can be used.

Both modes can be run via the open server using the following commands.

RECOMBINE_SIMPLE[n] Perform the simple recombination on stream n


RECOMBINE_COMPLEX[n] Perform the complex recombination on stream
n

OpenServer User's Manual


PVTP and OpenServer 450

COPY_RECOMBINE_COMPOSITIO Overwrite the current STREAMBASE


N composition with the one calculated by
recombination

It should be noted that the recombination data is held within the STREAMBASE
structure. If the composition is to be used, it must be transferred to the STREAMRUN
area. An example of how the recombine data is read and set is distributed in the
OPEN_RECOMBINATION.XLS sample file. The code segment below is taken from this
file:

DoSet "PVT.STREAMBASE[" + CStr(iStream) +


"].RECOM_STOCKTANK_GOR", CStr(ThisGOR)
DoCmd "PVT.SET_ACTIVE_STREAM[" + CStr(iStream) + "]"
DoCmd "PVT.RECOMBINE_SIMPLE[" + CStr(iStream) + "]"
DoCmd "PVT.COPY_RECOMBINE_COMPOSITION[" + CStr(iStream) + "]"
DoCmd "PVT.COPYSTREAMBASE_TO_STREAMRUN"
Temp = Worksheets(Sheet).Cells(10, 7)
DoSet "PVT.STREAMRUN[" + CStr(iStream) + "].RUNTEMP", CStr(Temp)
DoCmd "PVT.SINGLE_PSAT[" + CStr(iStream) + "]"
Press = DoGet("PVT.STREAMRUN[" + CStr(iStream) + "].RUNPRESS")

In this segment a recombination is done on the basis of a changing recombination GOR.


The recombined composition is then copied to STREAMBASE and then to
STREAMRUN. Once in runtime it is used to find the saturation pressure of the
recombined fluid using the calculation described in section 8.9.

The sequence followed is

- Set a new recombination GOR via the RECOM_STOCKTANK_GOR variable


- Make the selected stream the current one using the SET_ACTIVE_STREAM
command
- Calculate the recombination using the RECOMBINE_SIMPLE command
- Overwrite the stream composition with the result of the recombination using
COPY_RECOMBINE_COMPOSITION
- Copy composition to STREAMRUN to allow calculation to be done
- Set the temperature at which PSAT is to be calculated
- Do saturation pressure calculation
- Read result which is in RUNPRESS

7.9.6 Allocate: Blending to a Target GOR


The allocation calculation is called from the stream menu in PVTP. The use of this
calculation is illustrated in OPEN_ALLOCATE_BLEND.XLS from which the code
fragment below is taken:

© 1990-2018 Petroleum Experts Limited


451 OpenServer

Worksheets("Allocate").Cells(3, 4) = DoGet("PVT.STREAMBASE[" +
CStr(iStream) + "].STREAMNAME[0]")
Worksheets("Allocate").Cells(4, 4) = DoGet("PVT.STREAMBASE[" +
CStr(iStream2) + "].STREAMNAME[0]")
iLine = 10
SendCellData "PVT.CALCUL[" + CStr(iStream) + "].UTILS_TARGETGOR"
DoSet "PVT.CALCUL[" + CStr(iStream) + "].CALC_SECOND_STREAM",
iStream2
iLine = 12
SendCellData "PVT.OPTIONS.CREATE_MAX_ITERATIONS"
SendCellData "PVT.OPTIONS.CREATE_GOR_END_TEST"
DoCmd "PVT.CALCULATE_BLEND_GOR[" + CStr(iStream) + "]"
DoCmd "PVT.UPDATEDISPLAY"
iLine = 31
iErr = DisplayCellData("Mole Percent Blend Stream 1",
DoGet("PVT.STREAMRUN[" + CStr(iStream) +
"].MOLE_PERCENT1_BLEND_GOR"))
iErr = DisplayCellData("Mole Percent Blend Stream 2",
DoGet("PVT.STREAMRUN[" + CStr(iStream) +
"].MOLE_PERCENT2_BLEND_GOR"))
iErr = DisplayCellData("Weight Percent Blend Stream 1",
DoGet("PVT.STREAMRUN[" + CStr(iStream) +
"].WEIGHT_PERCENT1_BLEND_GOR"))
iErr = DisplayCellData("Weight Percent Blend Stream 2",
DoGet("PVT.STREAMRUN[" + CStr(iStream) +
"].WEIGHT_PERCENT2_BLEND_GOR"))

The sequence followed is:

- Set up the streams to be used


- Send the target GOR to be matched
- Setup the calculation limits if required
- Send the CALCULATE_BLEND_GOR command.
- Retrieve the results from the MOLE_PERCENT1_BLEND_GOR etc. variables

OpenServer User's Manual


Chapter

8
453 OpenServer

8 REVEAL and OpenServer

8.1 Overview
This section is designed to complement the Petroleum Experts IPM OpenServer
Manual, providing REVEAL specific implementation information.

The following sections describe OpenServer commands specific to REVEAL, and the
data structures that may be accessed. The data structures fall into three categories,
Script Data, Results Data and Runtime Variables.

All of the data exchanged via OpenServer will by default be in oilfield units. See the
main OpenServer documentation to see how data may be transferred in alternative unit
systems.

8.2 Commands

The REVEAL specific function commands are given below. The commands are used
under DoCmd statement

NEWFILE() Start a new REVEAL project file.


Example: "REVEAL.NewFile()"
OPENFILE(file name) Open an existing REVEAL project file
Example: "REVEAL.OpenFile(C:\Petex\testfile.rvl)"
"REVEAL.OpenFile("C:\Petex directory\test file.rvl")"

NOTE: If the filename contains 'white space' characters,


then it should be enclosed with quotes
SAVEFILE() Save an existing REVEAL project file
Example: "REVEAL.SaveFile()"
SAVEASFILE(file name) Save a REVEAL project file with a new name
Example: "REVEAL.SaveAsFile(C:\Petex\newfile.rvl)"
START() Starts REVEAL application
Example: "REVEAL.Start()"
START_BLOCK() Run/continue while blocking other OpenServer
communication
Example: "REVEAL.Start_Block()"
INITIALISE() Start a simulation and pause before the equilibration
Example: "REVEAL.Initialise()"
RESTART(restart_number) Start a simulation from a restart file and pause before the
equilibration. Use the Project|Edit / Review Project..
menu option to view the stored restart file available

OpenServer User's Manual


REVEAL and OpenServer 454

Example: "REVEAL.Restart(0)"
ONE_STEP() Take one tim-estep for the simulation
Example: "REVEAL.One_Step()"
STOP() Stop a simulation
Example: "REVEAL.Stop()"
PAUSE() Pause a simulation
Example: "REVEAL.Pause()"
SWITCH_GRID(grid_numbe Switch between refinement scripts in the input and is only
r) used to access data in the input script for refinements.
Each grid has an integer, with the first main grid being
zero and refined grids starting from one
Example: "REVEAL.Switch_Grid(1)"
OPEN_DATABLOCK Open a datablock for data read or write in the input script
(datablock_label) and is the label (name) associated with a datablock (red
font) in the input script
Example: "REVEAL.Open_Datablock(_xperm)"
SCRIPT_WRITE() Rewrite the script following changes to the input, required
for changes to the script to be registered for subsequent
simulation runs.
Example: "REVEAL.Script_Write()"

8.3 Script Data


The script or input data variables may be read or written using the OpenServer.

The refinement grid (if present) should be selected using the Switch_Grid command.

If the data to be read/written is within a datablock, then the datablock should be opened
using the Open_Datablock command.

The OpenServer data strings can be obtaoined using <CTRL> + mouse right click
within input wizard. This should always be used to identify the OpenServer string.

Once changes have been made to the input data, the "REVEAL.Script_Write()"
command should be run to register the changes.

Example:
The following syntax can be sued to set a transmissibility multiplier barrier for a
horizontal layer when the data is input as a range; the second range (index 1) is being
modified

SetValue ("REVEAL.Script.Reservoir.Data[11][1].Value",0.0)
DoCommand ("REVEAL.Script_Write()")

Example:
The following script is used to set the porosity in refinement grid 1 when the data is

© 1990-2018 Petroleum Experts Limited


455 OpenServer

entered as a datablock array for block (3,2,1) to 0.2 - note the indexing starts at zero
and cycles (Z,Y,X)

DoCommand ("REVEAL.Switch_Grid(1)")
DoCommand ("REVEAL.Open_Datablock(_porosity)")
SetValue ("REVEAL.Block._porosity.Tab[0].Data[0][1][2]",0.2)
DoCommand ("REVEAL.Script_Write()")

8.4 Results Data


The reservoir average and well results can be accessed using OpenServer.

The OpenServer data strings can be obtaoined using <CTRL> + mouse right click
within output data results.

The well and average reservoir results data OpenServer strings have the following form:

REVEAL.WellRes[{stream_label}][{well_lablel}][timestep].Variable
REVEAL.AveRes[{stream_label}][{region_lablel}][timestep].Variable

where label names may be replaced by integer values.

The number of timesteps canbe found with the following function:

n_timesteps = GetValue("REVEAL.WellRes[0][0].Count")

Example:
Total cummulative oil for current stream at the 10th recorded timestep

CO = GetValue("REVEAL.WellRes[{Well Results}][{Total}][9].CumOilProduced")

Example:
Bottom hole temperature for first saved stream, second well, at the 6th recorded
timestep

BHT = GetValue("REVEAL.WellRes[1][2][5].REVEAL.BottomHoleTemperature")

Example:
Initial total pore volume for current stream

PV = GetValue("REVEAL.AveRes[{Average Results}][{Total}][0].PoreVolume")

OpenServer User's Manual


REVEAL and OpenServer 456

8.5 Runtime Data

All of the internal REVEAL data are available during a simulation. This data is not
available once a simulation has been stopped. Since this data is extremely large and
most of it of no interest only some variable will be specified. Great care should be taken
setting internal calculation variables to the point where it is not recommended for most
variables, with the exception of well control variables.

The data in REVEAL is organised into two main groups called Master and Run. The
Master data contains everything that is not grid specific, while the Run data contains all
of the grid specific data for the main grid and all refinement grids. For example the well
control data is contained in the Master data structures, while grid pressures are
contained in the Run data structures. The Run variables are indexed by their grid
number, with zero corresponding to the main grid and subsequent integers
corresponding to refined grids.

All of the runtime variables are indexed from 0. However, if the returned value is an
index, then the returned value is indexed from 1 (see ACTIND and KWM).

The following is a list of some of the useful Master variables that may be accessed. The
variables listed are those associated with timestep and well control.

Master Variables
"REVEAL.IsRun" Flag if simulation is still running: 0-still running, 1-run
finished
"REVEAL.Master.T" Current time
"REVEAL.Master.DT" Current time-step - may be modified during the next
solve
"REVEAL.Master.DTMAX" Maximum time-step allowed for next solve
"REVEAL.Master.LSHUTIN[we If true then well is not included in solver calculations: 1-
true, 0-false,
l the well_number is in the order it appears
in the well lsection, indexed starting from zero
_
n
u
m
b
e
r
]
"
"REVEAL.Master.LNOFLOW[ If true then well rate is zero (no VLP/IPR intersection),
cross flowwmay still occur and Pwf is calculated :1-true,
0-false e
l

© 1990-2018 Petroleum Experts Limited


457 OpenServer

l
_
n
u
m
b
e
r
]
"
"REVEAL.Master.IFLAG[well_ Well type flag: 1-fixed Pwf injector, 2-fixed Pwf
producer, n3-fixed rate injector, 4-fixed rate producer, 5-
fixed THP uinjector, 6-fixed THP producer
m
b
e
r
]
"
"REVEAL.Master.IVOLR[well_ Rate type for producer: 1-liquid, 2-oil, 3-water, 4-gas
n
u
m
b
e
r
]
"
"REVEAL.Master.INJTYPE[wel Rate type for injector: 1-water, 2-gas
l
_
n
u
m
b
e
r
]
"
"REVEAL.Master.LTINJ[well_n If true then injection temperature calculated from VLP:
1-true, 0-false
u
m
b
e
r
]

OpenServer User's Manual


REVEAL and OpenServer 458

"
"REVEAL.Master.CTOTW[0] Injection water mass fraction: 1 for water injector, 0 for
gas injector
[
w
e
l
l
_
n
u
m
b
e
r
]
"
"REVEAL.Master.CTOTW[1] Injection oil mass fraction: 0 for water injector, 0 for gas
injector [
w
e
l
l
_
n
u
m
b
e
r
]
"
"REVEAL.Master.CTOTW[2] Injection gas mass fraction: 0 for water injector, 1 for
gas injector
[
w
e
l
l
_
n
u
m
b
e
r
]
"

© 1990-2018 Petroleum Experts Limited


459 OpenServer

"REVEAL.Master.PWF[well_n Well control bottom hole flowing pressure


u
m
b
e
r
]
"
"REVEAL.Master.PWS[well_n Well control tubing head pressure
u
m
b
e
r
]
"
"REVEAL.Master.QI[well_num Well control flow rate in scf/d (positive for injection,
negative for
b production)
e
r
]
"
"REVEAL.Master.TTI[well_num Well control bottom hole temperature
b
e
r
]
"

The following is a list of some of the useful Run variables that may be accessed.
Contact Petroleum Experts for details of additional Run time variables if required.
Run Time Variables
"REVEAL.Run[0].NX" X direction dimension of main grid
"REVEAL.Run[0].NY" Y direction dimension of main grid
"REVEAL.Run[0].NZ" Z direction dimension of main grid
"REVEAL.Run[0].IJKD" Total number of active blocks in main grid
"REVEAL.Run[0].ACTIND[99 Active block number (indexed from 1) corresponding to
]" global grid block 100 in main grid - global grid block =
(IZ-1)*NX*NY + (IY-1)*NX + IX, where NX, NY and NZ are
the grid dimensions and IX, IY and IZ are the indices in
the global grid. If the global grid block specified is
inactive, then the value returned is zero.
"REVEAL.Run[0].P[0][99]" Main grid water phase pressure for active block 100
"REVEAL.Run[1].P[1][99]" First refinement grid oil phase pressure for active block

OpenServer User's Manual


REVEAL and OpenServer 460

100
"REVEAL.Run[0].P[2][99]" Main grid gas phase pressure for active block 100
"REVEAL.Run[0].S[0][99]" Main grid water phase saturation for active block 100
"REVEAL.Run[0].S[1][99]" Main grid oil phase saturation for active block 100
"REVEAL.Run[0].S[2][99]" Main grid gas phase saturation for active block 100
"REVEAL.Run[0].TT[99]" Main grid temperature for active block 100
"REVEAL.Run[0].RSSOL[99] Main grid solution RS (scf/STB) for active block 100
"
"REVEAL.Run[0].GRIDV[99]" Main grid total block volume for active block 100
"REVEAL.Run[0].POR[99]" Main grid porosity for active block 100
"REVEAL.Run[0].IPERF[grid Main grid perforation flag of first perforated block for well
_well_number][0] grid_well_number: 0-not perforated, 1-perforated - the
grid_well_number corresponds to the well number in the
specified grid (e.g. main grid). The grid_well_number
may be found from the global well_number using the
KWM variable. Perforations must have been specified
in the input script if they are to be activated or
deactivated by OpenServer
"REVEAL.Run[0].KWM[well_ Main grid grid_well_number (indexed from 1)
number]" corresponding to the global well_number variable

Example:
Set well 2 to be a fixed liquid rate producer with a rate of 1000 STB/d

SetValue("REVEAL.Master.LSHUTIN[1]",0)
SetValue("REVEAL.Master.LNOFLOW[1]",0)
SetValue("REVEAL.Master.IFLAG[1]",4)
SetValue("REVEAL.Master.IVOLR[1]",1)
SetValue("REVEAL.Master.QI[1]",Cstr(-1000*5.615))

Example:
Set well 3 to be a fixed THP water injector with a THP of 100 psig and injection
temperature of 50F

SetValue("REVEAL.Master.LSHUTIN[2]",0)
SetValue("REVEAL.Master.LNOFLOW[2]",0)
SetValue("REVEAL.Master.IFLAG[2]",5)
SetValue("REVEAL.Master.INJTYPE[2]",1)
SetValue("REVEAL.Master.LTINJ[2]",0)
SetValue("REVEAL.Master.PWS[2]",100)
SetValue("REVEAL.Master.TTI[2]",50)
SetValue("REVEAL.Master.CTOTW[0][2]",1)
SetValue("REVEAL.Master.CTOTW[1][2]",0)
SetValue("REVEAL.Master.CTOTW[2][2]",0)

© 1990-2018 Petroleum Experts Limited


461 OpenServer

Example:
Find the oil phase saturation for block IX,IY,IZ = (10,20,5) in the main grid

NX = GetValue("REVEAL.Run[0].NX")
NY = GetValue("REVEAL.Run[0].NY")
NZ = GetValue("REVEAL.Run[0].NZ")
IJK0 = (NZ-1)*NX*NY+(IY-1)*NX+IX
IJK = GetValue("REVEAL.Run[0].ACTIND["+Cstr(IJK0-1)+"]")
SO = GetValue("REVEAL.Run[0].S[1]["+Cstr(IJK-1)+"]")

Example:
Perforate blocks 5-10 for well 3 in refinement 1

KW = GetValue("REVEAL.Run[1].KWM[2]")
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][4],1)
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][5],1)
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][6],1)
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][7],1)
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][8],1)
SetValue ("REVEAL.Run[0].IPERF["+Cstr(KW-1)+"][9],1)

OpenServer User's Manual


Chapter

9
463 OpenServer

9 RESOLVE and OpenServer


9.1 Overview

OpenServer is the mechanism by which external applications can interact and control
all the programs in the IPM suite (Prosper, GAP, Reveal, PVTP, MBAL, and RESOLVE).
For example a VBA macro in Excel can be used to open, interrogate, and run IPM
programs.

The OpenServer functionality that is in RESOLVE operates on the same principles as


other programs. For more information, see the OpenServer manual that is distributed
with the IPM suite. There follows a brief overview of the functionality of the OpenServer
with specific reference to RESOLVE.

External OpenServer macros can be written to control RESOLVE. These macros can be
written in any langauge that supports automation, for example: Visual Basic, VBA,
VBScript, C++, Java, Matlab. Most typically they are written as VBA macros in an Excel
spreadsheet; the OpenServer example macros are in this form. An OpenServer macro
can call three different functions/subroutines on the program (RESOLVE) it is controlling.
These are:

retval = DoGet("tagstring")
DoSet("tagstring"), "value"
DoCmd("tagstring")

The first of these interrogates a variable in the application (for example, the schedule
start date). The second sets a variable to the value 'value'. The third performs a
command (for example, load a file, perform a run). In each case, tagstring is a '.'
delimited string that refers to the variable or command in question. For example, to get
the start date in RESOLVE:

retval = DoGet("Resolve.Schedule.StartDate.DateStr")

will return the date in the form of dd/mm/yy (depending on the international settings). To
execute a prediction run, use:

DoCmd("Resolve.Run")

In each case, the tagstring starts with the application name (in this case, Resolve).
When getting or setting a variable, the rest of the string is a delimited list of child
variables until we get to the required variable (DateStr is a 'child' variable of the
'StartDate' property, which is a child of the Schedule data, and so on). The variables
supported by RESOLVE are documented here. When executing a command, the string
simply refers to the command to be executed: these are documented here.

OpenServer User's Manual


RESOLVE and OpenServer 464

There is a quick way to find an OpenServer tagstring if the variable is part of the user
interface. In this case, go to the required screen and press <Ctrl> and RClick over the
variable in question. A screen will appear with the variable tagstring which can then be
copied to the clipboard.

Hysys and OpenServer


The Hysys driver supports the use of the OpenServer (see Module variables). In
versions 3.1 and later of Hysys the Hysys application by default pops up a message box
whenever a file is loaded. This halts OpenServer, and the macro can not continue until
this message box has been cleared. To remove the message box, from the Hysys
application go to Tools | Preferences | Simulation Page and uncheck the item: 'Confirm
before adding if active correlations are present' under 'Stream property correlations'. In
fact, the preferences should be set to avoid pop up windows that may interrupt the
OpenServer operation.

Note on the use of dates


When a date property is returned it is returned in the form of the number of days since
01/01/1900. This can be useful if arithmetic on dates is to be performed(differences,
etc). To return a calendar date, append the string '.DateStr' (as above) to the tagstring.

Empty variables
Variables that are not set (or are blank) in RESOLVE return a large number (3.4e35)
when the OpenServer queries them.

9.2 Commands

The following list describes the OpenServer commands with their arguments. Some of
these arguments may be optional - if this is the case they will be specified by "arg =
(default value)".

RESOLVE.NewFile() Clears the current RESOLVE file and creates an empty


system
RESOLVE.OpenFile(filename, Opens the file 'filename'
mode = 0) If mode = 1 the file is opened in 'Results Only' mode,
i.e. the client applications are not loaded and the only
functionality enabled is the ability to view the results
that were saved with the file
RESOLVE.SaveFile() Saves the current RESOLVE file
RESOLVE.SaveAsFile(filename Saves the current RESOLVE file as 'filename'. If
, overwrite = 0) 'overwrite' = 0 (default) the command will return an
error if the file already exists. overwrite = 1 forces the
file save
RESOLVE.BrSave() Performs a broadcast save, i.e. broadcasts a save
command to all the client modules. Note that not all
modules (e.g. Eclipse) may implement a Save

© 1990-2018 Petroleum Experts Limited


465 OpenServer

command (the PETEX products always do)


RESOLVE.SaveMod(label) Broadcasts a 'Save' command to the module
specified by 'label'. Note, as with BrSave above, that
not all modules implement the Save command
RESOLVE.Run() Runs the RESOLVE prediction. This call blocks until
the run is complete
RESOLVE.RunOneStep() Runs a single step of the RESOLVE prediction. This
call blocks until it is completed
RESOLVE.RunEnd(runtoend = Terminates the current prediction if single-stepping
0) through the run. If runtoend = 1 the run will be
completed to the end of the schedule
RESOLVE.CreateModule(driver Driver - the name of the driver (or application name),
, x, y, label) e.g. GAP
x - the x coordinate of the icon on the screen (left = 0)
y - the y coordinate of the icon on the screen (top = 0)
label - the label to give to the module
RESOLVE.DeleteModule(label) Label - the name of the module to delete
RESOLVE.LoadModule(label) Label - the name of the module to load. This loads the
module with the current module data (e.g. for a GAP
module the GAP application will start and load up the
required case)
RESOLVE.LinkItems(mod1, mod1 - the parent module of the first item to link
item1, mod2, item2) item1 - the label of the first item to link
mod2 - the parent module of the second item to link
item2 - the label of the second item to link
RESOLVE.DeleteLink(mod1, Removes a connection between icons. Arguments as
item1, mod2, item2) for LinkItems()
RESOLVE.ShutDown() Shuts down RESOLVE

9.3 Top Level Variables

Properties and Collections


Some variables in RESOLVE are collections of data items. For example, the Module
data below is a collection of the client modules that are embedded on the RESOLVE
interface. An element of a collection can be accessed with either a numerical index
(e.g. RESOLVE.Module[0]) or by label in curly brackets (e.g.
RESOLVE.Module[{Network}]). More details are given below where appropriate.

Certain properties can be interrogated or (depending on whether the collection is read


only) set for all collections. These are:

COUNT Returns the number of objects in the collection

OpenServer User's Manual


RESOLVE and OpenServer 466

ADD Adds an item to the collection.


Example: DoSet("RESOLVE.Schedule.Add"), 1
RESET Removes all items from the collection
REMOVE Remove a given item from the collection.
Example: DoSet("RESOLVE.Schedule.Remove"), 1

Variables at the Top Level


DebugFlag Sets or clears the flag that determines whether debug data is
saved during a run.
Example: DoSet("RESOLVE.Properties.DebugFlag"), 1
IsRunning Returns whether or not RESOLVE is currently performing a forecast
or optimisation run.
EnableOptimisatio Sets or clears the flag for performing an optimised solve or
n forecast. Finer control of optimisation runs (e.g. setting or removing
controls and constraints from the problem) is available through the
Module data items or the Optimiser Schedule data items (see
below).
Module A collection of module data items. For more information on Module
variables, see Module variables. To index a given module, the
alias or label of the item can be used.
Example: RESOLVE.Module[{Reservoir}].
Driver A collection of drivers registered with the RESOLVE application.
See Driver variables.
Schedule A collection of schedules, as accessed from the Schedule screen
in the interface. See Schedule variables.
ModLink A collection of individual module connections, containing data such
as the calculation order and adaptive time-stepping sensitivity.
See ModLink variables.
Connection A collection of connection data items. See Connection variables.
Properties System Properties in RESOLVE model. See Properties variables.
OptimiserData The optimisation parameters. See Optimiser variables.
OptimiserSchedule In a forecast run these variables control the way the problem can
be changed as a function of time. See Optimiser schedule
variables.
Results The results variables. The tag strings for these variables depend
on the case being run and can always be determined by using the
<Ctrl> <Rclick> method described here.
ErrorMessage Returns the error message of the current timestep.
IsError Returns 1 if there is an error message and 0 if there is no error for
the timestep in questions.
Runtime variables The following variables are top level variables that can be
accessed during a Resolve run. If a run is being performed with a

© 1990-2018 Petroleum Experts Limited


467 OpenServer

series of 'RunOneStep' commands, then after every command the


following variables can be interrogated (all read-only).
NextTimestepEnd Returns the projected date of the end of the next time-step.
CurrentTime The current date at which the run is sitting.
LastTime The date before the last time-step leading to this one.
Timestep The (integer) number of time-steps since the start of the run.

NOTE:
The date variables return a double-precision number which is the number of days since
01/01/1900. To get a date string, the DateStr can be appended to the tag strings.

Example:
DoGet("RESOLVE.CurrentTime") may return 36525.0, while as
DoGet("RESOLVE.CurrentTime.DateStr") will return 01/01/2000.

9.3.1 Module variables

Module Collection
There are no variables specific to this collection. Index individual items by number
(Module[0]) or label (Module[{Network}]).

The collection is read only. Module lists can be manipulated (created/deleted/linked) by


calling an appropriate command.

Module Item Variables


The following variables are specific to the module item and will need to be preceded by
the following OpenServer string structure:

RESOLVE.Module[{module name or index}].

XPos / YPos The position of the module icon on the main screen.
Alias The label/alias given to the module when it was created
Driver Data pertaining to the registration information of the driver
(see Driver variables).
SrcSnk A collection of source/sink child data for the module (see
SrcSnk variables).
OptCtrl A collection of optimisation control variables specific to this
module (see Module Optimisation variables).
OptConstraint A collection of optimisation constraint equations specific to
this module (see Module Optimisation variables).
OptObjFn The objective function (if present) for this module (see Module
Optimisation variables).

OpenServer User's Manual


RESOLVE and OpenServer 468

ShowChildren Determines whether the module child icons are displayed


(expanded) on the main screen
ProducesCompositions Returns whether the module produces compositional/EOS
data (read only).
BaseComposition For a compositional module, returns the base set of
compositions that will be used in the run (read only).
CalcOrder The calculation order in the RESOLVE system (as specified in
the RESOLVE Manual.
StartDate The start date of the module (which may be different to the
RESOLVE start date). For example, this could be the start
date of a reservoir simulation run (read only).

Example: Syntax for the above commands is as follows:

RESOLVE.Module[{GAP}].XPos

Internal Driver Variables


If RESOLVE does not find the variable of the tagstring in the above list, RESOLVE will
pass the string on to the driver which controls the application in question.

Example:
RESOLVE.Module[{GAP}].CaseDetails.FileName

The tag string does not represent a variable in RESOLVE, and so the string
'CaseDetails.FileName' is passed on to the GAP driver, where it is recognised as
referring to the GAP filename.

In the case of IPM products (REVEAL/GAP), the string will be passed on to the
OpenServer of the connected applications if it is not processed by the driver.

Example:
RESOLVE.Module[{GAP}].MOD[{PROD}].INFLOW[{comp1}].IPR[0].ResTemp

The tag string will refer to an internal variable of GAP (a well layer temperature).

The following is a list of the variables that are supported by the GAP, REVEAL, and
Hysys drivers.

GAP
CaseDetails.FileName Sets the GAP filename to open
CaseDetails.HostName The host machine on which to run GAP
CaseDetails.System 0 - main system
1 - associated water injection

© 1990-2018 Petroleum Experts Limited


469 OpenServer

2 - associated gas injection


CaseDetails.PredictiveModel 0 - set according to GAP model
1 - always non-predictive

REVEAL
CaseDetails.FileName Sets the REVEAL filename to open
CaseDetails.HostName The host machine on which to run REVEAL
CaseDetails.RestartFrom The index of the restart file from which REVEAL
should be restarted. 0 represents no restart -
perform equilibration
CaseDetails.GlobalControlMode The global control mode for all the wells in
REVEAL. Values are:
0 - fixed bottom hole pressure
1 - fixed rate
2 - fixed THP
3 - 'system response'
CaseDetails.LoadCompletionData Specifies whether completion data should be
loaded as children under the individual wells

Hysys
CaseDetails.FileName Sets the Hysys filename to open
CaseDetails.HostName The host machine on which to run Hysys

NOTE:
In addition, all the plant equipment and the variables that can be scheduled for each
piece of equipment can be obtained. These can then be added to a schedule.
An example of how this is done is in the OpenServer example macro:
HysysOpenServer.xls.

9.3.1.1 Module Optimisation variables

Any module within RESOLVE may have an objective function, constraints, and/or control
variables set up. These elements can all be accessed through the OpenServer.

Variables Common to all Three Variable Types:

Enabled
Enables or disables the element in the optimisation. This might be useful to automate
runs with and without certain control variables or constraint equations, or to switch
between objective functions. If this fag is used when performing a forecast, the control
(or whatever) will be enabled or disabled for the entire forecast.

Name

OpenServer User's Manual


RESOLVE and OpenServer 470

The name of the element, e.g. 'Well1 WHP'.

Unit
The measurement unit of the quantity for the optimisation element.

Optimiser Control Variables


BoundsMask
Specifies whether the control is bounded:
0 - not bounded
1 - has lower bound
2 - has upper bound
3 - has upper and lower bounds

LowerBound
The lower bound of the control (if applicable through BoundsMask)

UpperBound
The upper bound of the control (if applicable through BoundsMask)

Perturbation
The perturbation to apply to the control, in the appropriate unit (note that this changes
dynamically during the run depending on the current trust region of the SLP: this quantity
is the first pertubation).

InitialBound
The initial 'trust' bound to apply to the control, in the appropriate unit. As with the
perturbation, this changes dynamically during the course of the run.

CentrePerturbation
Flag to tell Resolve whether to perform a centre-based perturbation on the control (rather
than the usual, default, forward perturbation). See the RESOLVE Optimisation pages for
more information.

MinimumPerturbation
The minimum perturbation that the control can use. The perturbation is adapted to the
current 'trust region'; this prevents the perturbation becoming too small.

Optimiser Constraint Equations:


Limit
The value of the constraint (i.e. the limit)

LimitType
The type of the constraint:
0 - less than
1 - equal to
2 - greater than

© 1990-2018 Petroleum Experts Limited


471 OpenServer

Optimiser Objective Function:


Maximise
Flag whether the problem is a maximisation or minimisation.

9.3.1.2 SrcSnk variables

The SrcSnk variables correspond to the sources and sinks exposed by a parent
module.

SrcSnk collection

There are no variables specific to this collection. Index individual items by number
(SrcSnk[0]) or label (SrcSnk[{Well1}]).

The collection is read only. Items can be manipulated by calling an appropriate


command (listed below).

SrcSnk Item:
All the following variables will need to be preceded by the following OpenServer string
structure:

RESOLVE.Module[{module name or index}].SrcSnk[{child name or index}].

XPos / YPos The position of the icon on the main screen


Label (read only) The label applied to the item by the application when the
module was loaded
TypeStr (read only) A string describing the item in question (e.g. 'well', 'injection
manifold')
SSType (read only) 1 - source
2 - sink
3 - source and/or sink, depending on what the item is
connected to
IsConnectable (read only) Is the item marked as connectable (can it, in principle, be
connected to some other item)?
DataProvider (read only) Data provider or data acceptor (see the RESOLVE Manual ).
BiDirectional (read only) Does/can this this item form part of a bidirectional link (see
the RESOLVE Manual).
ItemType (read only) For informational purposes only. Values are:
0 - none
1 - producer
2 - injector
3 - undefined
PhaseType (read only) The dominant phase of the item. Values are:
0 - anything

OpenServer User's Manual


RESOLVE and OpenServer 472

1 - water
2 - liquid
3 - oil
4 - gas
5 - condensate
IsConnected (read only) Return whether this item is connected to another item in
RESOLVE.
Connection Return connection data if IsConnected is true. Possible data
is:
Label The label of the item to which this item is connected.
SrcSnk A further collection of children of this item (as described on
this page).

Example:
The following syntax can be used to retrieve the position of Well1 child icon exposed by
GAP module {Network}:

RESOLVE.Module[{Network}].SrcSnk[{Well1}].XPos

9.3.2 Driver variables

Driver Collection:
There are no variables specific to this collection. Index individual items by number
(Driver[0]) or application (Driver[{GAP}]).

Driver Item:
All the following variables will need to be preceded by the following OpenServer string
structure:

RESOLVE.Driver[{module name or index}].

InterfaceVersion (read only) The interface version of RESOLVE that this driver
was built with
Application (read only) The application implemented with this driver
NeedsComposition (read only) Whether the application implemented here is purely
EOS and requires compositional data to function.
ProvidesComposition (read only) Whether the application can provide EOS data
AppType (read only) The application type (for informational purposes):
0 - unknown
1 - reservoir simulator
2 - nodal analysis
3 - process simulator
Description (read only) A description string describing the application.

© 1990-2018 Petroleum Experts Limited


473 OpenServer

Example:
The following syntax can be used to retrieve the information regarding GAP module

DoGet ("RESOLVE.Driver[{Production}].Description")

9.3.3 ModLink variables

ModLink Collection:
There are no variables specific to this collection. Index individual items by number
(ModLink[0]). There is one entry in this collection for every connection between modules.
For example, if module A is connected to module B and module C, there will be two
entries in this collection: A-B and A-C.

This collection is used to hold the calculation order data as well as some adaptive time-
stepping data.

ModLink Item
All the following variables will need to be preceded by the following OpenServer string
structure:

RESOLVE.ModLink[index].

CalcOrder This is the order of calculation for this module pair. It is the number that is
entered on the Calculations Order screen.
Mod1 This is the name of the first module in the pair (the order is arbitrary).
Mod2 This is the name of the second module in the pair.

The following variables are part of the data required to set up adaptive time-stepping in
a RESOLVE prediction.
TargetRMS This is an array of RMS targets for the target variable (see below). It is an
array over all schedule records.
Example: The tag string:
RESOLVE.ModLink[2].TargetRMS[1]
will obtain the second (zero indexed) schedule record RMS target for the
third module link object.
TargetVar Similarly, this is an array of target variables over all schedule records for
this module link, e.g. water cut, THP.

9.3.4 Schedule variables

Schedule Collection:

OpenServer User's Manual


RESOLVE and OpenServer 474

All the following variables will need to be preceded by the following OpenServer string
structure:

RESOLVE.Schedule.

RunWithScript Enables/disables the script


StartDate Sets/retrieves the start date of the RESOLVE run.

Schedule Item:
Individual items of the schedule data are indexed by number. The individual items listed
below are preceded with the following structure:

RESOLVE.ScheduleList[index].

TimestepMode 0 - fixed timesteps


1 - adaptive time stepping
InitialTimestep The fixed time step for fixed time step mode, or the initial
time step if adaptive time stepping is implemented
InitialTimestepType The time step/initial time step value is measured in:
0 - days
1 - weeks
2 - months
3 - years
MaxTimestep Adaptive time stepping only. The maximum time step size
at which to grow the time step
MaxTimestepType See InitialTimetepType above
EndDate The end date of this schedule record
OptimisationMode 0 - optimise at every timestep
1 - no optimisation
2 - optimise at a given frequency
OptimisationFrequency If OptimisationMode is set to 2, then this is the frequency at
which the optimisation takes place
OptimisationFrequencyTy The optimisation frequency value is measured in
pe 0 - days
1 - weeks
2 - months
3 - years

9.3.5 Event Driven Sheduling variables

Event Driven Scheduling conditions collection:

© 1990-2018 Petroleum Experts Limited


475 OpenServer

All the following variables will need to be preceded by the following string structures
depending upon the the Schedule type (Start, Pre-Solve or Post-Solve) being used:

RESOLVE.AdvancedScheduleStart[i][j].
RESOLVE.AdvancedSchedulePreSolve[i][j].
RESOLVE.AdvancedSchedulePostSolve[i][j].

where i - index of the row (zero-based);


j - index of the condition (zero-based)

MaxNumberToExecute Defines a number of times the condition is verified


and action is executed.
Does not require index [j] in the above preceding
structure as defined once for all conditions in the row.
LHS.Expression Defines the left hand side expression of a condition
Condition Defines the condition sign
0 = "<"
1 = ">"
2 = "="
3 = "<>"
RHS.Expression Defines the right hand side expression of a condition
Logical[j] Defines AND/OR logical elements to combine
several conditions together.
Does not require index [j] in the above preceding
structure.

Actions collection:
All the following variables will need to be preceded by the following string structures
depending upon the the Schedule type (Start, Pre-Solve or Post-Solve) being used:

RESOLVE.AdvancedScheduleStart[i].Action.
RESOLVE.AdvancedSchedulePreSolve[i].Action.
RESOLVE.AdvancedSchedulePostSolve[i].Action.

where i - index of the row (zero-based);

VariableActions[k].Variable Defines the variable to take action upon


k - index of the action row
VariableActions[k].NewValue Defines a new value of the variable
k - index of the action row
ClosureActions[k].Connection Defines closure actions. The same string is used to
define "Module 1", "Module 2" and "Connections"
ClosureActions[k].Action Defines the action upon the connection
0 = Open;
1 = Close flow.

OpenServer User's Manual


RESOLVE and OpenServer 476

RedoSolve Forces RESOLVE to re-do the network solve.


Only available under the PostSolve[i] routine.
ForceOptimisation Forces global optimisation when network is re-solve.
Only available if global optimisation is performed on
the network and RedoSolve is activated.

Actions ranking collection:

RankingActions[l].ActionToPerfo Defines action in the ranking table


rm l - index of the row
RankingActions[l].RankingVariab Defines Ranking variable for the action
le.Expression l - index of the row
RankingActions.RankBy Defines the Order of execution
0 = Lowest First
1 = Highest First
RankingActions.NumberToExec Defines the Counter
ute

9.3.6 Scenario Manager Variables

Scenario Index
It is possible to retrieve a zero based index of scenario currently running in RESOLVE.

The following syntax is used in this case:

i = RESOLVE.Scenario

The scenario number will be assigned to variable i and can later be used in Prediction
Script to determine some other logic. This makes RESOLVE script adjustable to
scenarios.

NOTE:
Please note that scenario number is only accessible through RESOLVE Prediction
Script

Scenario Item
Individual items of scenarios can be indexed by number (RESOLVE.Scenario[0]) or by
name (RESOLVE.Scenario[{Scenario1}])

9.3.7 Connection variables

Connection Collection:
There are no variables specific to this collection. Index individual items by number only

© 1990-2018 Petroleum Experts Limited


477 OpenServer

(Connection[0]).

The collection is read only. Items can be connected by calling an appropriate command.

Connection Item:
All the following variables will need to be preceded by the following OpenServer string
structure:

RESOLVE.Connection[index].

Mod1.Alias / Mod1.Name The first module connected


Mod2.Alias /Mod2.Name The second module connected
Source.Label The first source/sink connected (see note below)
Sink.Label The second source/sink connected (see note below)

NOTE:
The source is considered to be the 'data provider' and the sink is the 'data acceptor', i.e.
the source/sink status is determined by the data flow direction, and not necessarily the
fluid flow. A case where the fluid flow is different to the data flow direction is that of
injector coupling between a reservoir simulator and a surface network: in this case fluid
is passing from the network to the simulator, but it is the simulator that supplies the
network with IPR data.

The data providers have small dots at the top left hand corner of their icon on the
RESOLVE screen.

9.3.8 Properties variables

Properties variables listed below used to define system properties in RESOLVE. All the
commands are preceded with the following string structure:

RESOLVE.Properties.

Run properties
ForecastMode Forecast mode: 0 - Full forecast;
1 - Full forecast with global
optimisation;
2 - Single solve/optimisation only.
EnableScript Visual Basic scripting : 0 - Disable; 1 - Enable
ReloadOnStart Run initialisation: 0 - Do not reload client modules;
1 - Reload client modules
RunInParallel Parallelisation:
0 - Perform all calculations in series;
1 - Perform timestep calculations in parallel

OpenServer User's Manual


RESOLVE and OpenServer 478

NonFatalErrorDisplay Valiadation:
0 - Ignore non-fatal validation errors;
1 - Report non-fatal errors and terminate run
DebugFlag Debug logging:
0 - Disable debug logging;
1 - Enable debug logging
UseOldReporting Reporting:
0 - Use upgraded reporting structure (IPM 7)
1 - Use old reporting structure (pre-IPM 7)
StopOnTargetOrOptimiserErro Optimiser/target solver failure:
r 0 - Continue forecast with existing solution;
1 - Terminate forecast with error
ConnectionPopup Connection popup windows:
0 - Current data;
1 - Chart;
2 - Pie

System view
SystemTitle The title displayed at the top of the main window
DisplaySystemTitle Toggle the display of the system title at the top of the
main window

9.3.9 Optimiser parameter variables

The optimiser parameter variables relate to the quantities listed on the Optimisation
Parameters screen.

Optimisation modes of underlying applications


The following commands should be preceded with the following string structure:

RESOLVE.OptimiserData.

KeepUnderlyingOptimisatio Retain optimisation of underlying applications within


n iterations of RESOLVE optimiser: 0 - off; 1 - on
Reoptimise Reoptimise applications if controls change by more than
tolerance: 0 - off; 1 - on
ReoptimiseTol Controls tolerance value for reoptimisation (if Reoptimise
is set to 1)
DoAppOptimisation When not in forecast, use application optimisations to
provide starting point: 0 - off; 1 - on. This option is only
available if "Single solve/optimisation only" is selected in
System Summary

© 1990-2018 Petroleum Experts Limited


479 OpenServer

OptimisationMode Starting conditions of each optimisation when underlying


applications are not optimising:
0 - Keep values from last timestep;
1 - Reset all variables to values from start of run

Top/Second Level Optimiser Variables


The following OpenServer variables define the optimiser settings for Top/Second Level
of the optimiser hierarchy. All the following commands should be preceded with the
following structure:

RESOLVE.OptimiserData[index].Parameters.

The index in square brackets corresponds to the optimisation level: 0 - Top level; 1 -
Second level.

Optimiser Type of the optimiser:


"" - Petroleum Experts SLP;
"GIRO" - GIRO
MaxGrowth Maximum growth multiplier of the trust region in the SLP (> 1).
MinGrowth Minimum growth multiplier of the trust region in the SLP (< 1)
MaxIter Maximum number of SLP iterations.
StepMultiplier Step multiplier
ObjFnTol Tolerance on the convergence of the objective function.
ConstraintTol Tolerance on how much a constraint can be violated for the solution
to be considered feasible.
LinearCritereon The linearity test quantity for the trust region (see the SLP
description for more information).
RedoTol Redo tolerance

9.3.10 Optimiser schedule variables

The optimiser schedule consists of a list of 'sub-schedules' which terminate at a given


date and which run concurrently; in each sub-schedule controls and constraints can be
enabled or disabled and the objective function can be changed. Alternatively, the
optimiser can be disabled all together.

All the following commands should be preceded with the following string structure:

RESOLVE.OptimiserData[i].Schedule.

Type Defines the type of the schedule: 1- Simple; 2 - Advanced

OpenServer User's Manual


RESOLVE and OpenServer 480

Simple Optimiser Schedule


The commands listed below are used to define the optimiser parameters when Simple
schedule type is selected. These commands should be preceded with the following
string structure:

RESOLVE.OptimiserData[i].Schedule.List[j].

Where j is a zero based index corresponding to the schedule entry number.

OptMode Optimisation mode: 0 - Optimise at every timestep;


1 - Never optimise; 2 - Optimise at fixed time interval
Interval Length of the interval between the optimisations ( active if Optimisation
Mode 2 is selected)
IntervalType Interval between the optimisations is in: 0 - Days; 1 - Weeks; 2 - Months; 3
- Years (active if Optimisation Mode 2 is selected)
EndDate Schedule end date

Advanced Optimiser Schedule


The commands listed below are used to define the optimiser parameters when
Advanced schedule type is selected. These commands should be preceded with the
following string structure:

RESOLVE.OptimiserData[i].Schedule.Advanced.List[j].

Where j is a zero based index corresponding to the schedule entry number.

Count Returns the number of sub-schedules in the list (read only). The index after
List keyword should be removed.
Example: RESOLVE.OptimiserData[i].Schedule.Advanced.List.Count
Date The end date for the schedule entry
DisableAll Disable optimiser for the current entry: 0 - on; 1 - off
Enable This is an array over all control variables, constraints, and objective
functions, determining whether these individual elements are active or
inactive in the sub-schedule. They are ordered as follows:

1. Each module in the RESOLVE.Module array:


2. Objective functions for the module
3. Constraints for the module
4. Control variables for the module

9.4 Sample macros

The OpenServer examples (example1.gar) are distributed as GAP archive files (.gar).

© 1990-2018 Petroleum Experts Limited


481 OpenServer

These archives contain the required Excel spreadsheet that implements the macro, as
well as any other associated files. For instructions on how to extract the archives, see
the GAP documentation.

example1.gar
This example performs the following tasks:

a. Creates a new (empty) system and interrogates the driver list to check that
REVEAL and GAP drivers are available
b. Puts the current driver versions on the spreadsheet
c. Creates an instance of GAP and REVEAL on the main window and loads cases
into these modules
d. Links the module wells together
e. Interrogates the RESOLVE connections variables and outputs these to the
spreadsheet
f. Sets a schedule in RESOLVE
g. Runs the prediction
h Gets the results from RESOLVE and puts them into the spreadsheet. These are
then plotted by Excel.

OpenServer User's Manual


Chapter

10
483 OpenServer

10 OpenServer Examples
10.1 OpenServer VBA Template

The OpenServer template files can be located in the following directory:


C:\Program Files\Petroleum Experts\IPM XX\Samples\OpenServer\Template\

Two files are available:

OpenServer Template.xls
This spreadsheet contains the skeleton code required to use the OpenServer (i.e.
initialisation, utility routines) but does not actually do anything. It can be use as starting
point for a new macro.

GAP Prediction Template.xls


This spreadsheet contains the skeleton code required to use the OpenServer and
additionally the commands initialising the GAP prediction run (number of prediction
timesteps and a loop).

The main advantage of using this templates is that they contain a debugging routine
executed after the DoGet, DoSet and DoCmd commands which may help identifying
any error in the code.

10.2 GAP Examples


10.2.1 Basic Code Structure
The following GAP prediction code explanation illustrates the required basic code
structure to initiate a prediction run and provides the ability to control field development
events by dynamically monitoring prediction results.

VBA Macro Structure Top Level


Declare any user-specified custom variables:

Dim Min_LiqRate As Single


Dim WellX_Liqrate As String
Dim WellY_Liqrate As String
Dim NumSteps As Integer
Etc.

OpenServer User's Manual


OpenServer Examples 484

Initialisation
In this section the GAP model initial setup is performed and the spreadsheet previous
results (if any) can be automatically cleared using:

Range (Cells(x, y), Cells(xn, yn)).ClearContents

Call Connect ‘Establishes the link between Excel and GAP

NOTE: After the Connect sub command, wells, etc., can be masked at this point prior
to running a prediction. For example, this would be the approach taken if setting up a
drilling queue.

Example:
DoGapFunc (“GAP.MOD[{PROD}].WELL[{WellY}].MASK()”) ‘Command masking well
WellY prior to performing the prediction. The code will show how to automatically open
(UnMask) well WellY during the prediction by monitoring well WellX liquid rate

Also, prior to starting a prediction, flow rate limits, etc., can be set that can be
dynamically monitored during a given prediction. Based on the macro structure, field
development actions will be taken if the monitored rate has been violated, e.g. open
other wells if the a threshold separator rate can no longer be achieved.

Example:
Min_LiqRate = 6000

The above approach hard-codes the pre-defined and declared variable Min_LiqRate
value directly in the macro code (use of the Min_LiqRate variable will be illustrated
later).

It is more convenient to supply a spreadsheet cell reference for the control rate using the
following approach:

Min_LiqRate = Cells(x, y)

NOTE: When using Strings, they must be converted in the OpenServer string from a
numeric value using ‘Cstr’ as per the following example:

WellY_LiqRate = DoGet (“GAP.MOD[{PROD}].WELL[{WellY}].PREDRES[“ & Cstr(j) &


“].LIQRATE”)

The command return well WellY rates during the prediction to a defined variable
WellY_LiqRate. The ‘j’ is a counter that corresponds to the current time step; it can
also be used to automatically index to the next Excel row to place the next time-step

© 1990-2018 Petroleum Experts Limited


485 OpenServer

results and will be explained in the Prediction Run section.

NumSteps = DoGAPFunc("GAP.PREDINIT()") 'Initialises the GAP Prediction and


returns the total number of prediction steps that can be used with the counting variable
‘j’ for instance

Prediction Run
For j = 0 To NumSteps - 1 'Loop executed at each prediction step where ‘j’ is the
counter using the information obtained via the PREDINIT() call.

DoGAPFunc ("GAP.PREDDOSTEP(0)") 'Performs one Prediction Step

PredDate = DoGet("GAP.MOD[{PROD}].WELL[{WellX}].PREDRES.DATES[" + CStr(j)


+ "]") 'Extracts the prediction date for reporting purposes to a cell reference defined later
on in the code

WellX_LiqRate = DoGet("GAP.MOD[{PROD}].WELL[{WellX}].PREDRES[" & CStr(j) &


"].LIQRATE") 'Gets Well W1 rate for reporting purposes to a cell reference defined later
on in the code

Cells(x, y) = WellX_LiqRate 'Well WellX liquid rate from the Solver results that will be
displayed in the defined cell reference
Cells(x + j, y) = PredDate 'Prediction date results from the Prediction results
Cells(x + j, y) = WellX_LiqRate 'Well WellX liquid rate results from the Prediction results

NOTE: The ‘j’ inclusion in the above cell reference tells Excel to automatically index to
the next row to place the following time-step results until all prediction steps have been
completed.

If WellY_Active_Flag = 1 Then 'If Well WellY is active based on the returned FLAG
value, the rate will be reported in the following cell reference if the well is active

WellY_LiqRate = DoGet("GAP.MOD[{PROD}].WELL[{WellY}].PREDRES[" & CStr(j) &


"].LIQRATE")

Cells(x, y) = WellY_LiqRate ‘Well WellY liquid rate from the Solver results that will be
displayed in the defined cell reference

Cells(x + j, y) = WellY_LiqRate ‘Prediction results using the ‘j’ loop counter to index to
the next row after each network solve during the prediction

End If

OpenServer User's Manual


OpenServer Examples 486

Field Development Decisions


If Val(Wx_LiqRate) < Val(Min_LiqRate) Then 'If well WellX liquid rate is lower than the
previously defined (or cell referenced value) Min_Liqrate variable value, then a decision
can be made to open well WellY

DoGAPFunc "GAP.MOD[{PROD}].WELL[{WellY}].UNMASK()" 'Well WellY will be


unmasked if the above condition has been met

Cells(x, y) = "Well WellY Active" ‘Reports the above message in quotation marks to the
corresponding cell reference

WellY_Active_Flag = 1 'Sets the well active flag

End If

Cells(xn + j, yn) = Cells(x1 + j, y1) + Cells(x2 + j, y2) 'Total prediction rate results cell
reference from adding the previously defined cell references. the same could easily be
achieved by simply capturing the separator liquid rate for instance

DoEvents 'Spreadsheet refresh to allow seeing the results plot dynamically

Next j

Finalisation
DoSlowCmd "GAP.PREDEND(0)" 'Finalises the Prediction run in GAP restoring initial
values in the model

Call Disconnect 'Breaks connection between Excel and the IPM tools

MsgBox "Macro Finished"

End Sub

10.2.2 Example 1 – GAP Open Server Example A


The objective of this example is to:
Review the abilities of OpenServer to link third party software to the IPM tools.

This example demonstrates how a VBA macro can be used to:


Perform a prediction in GAP (having control of GAP at each prediction step)
Modify the GAP model (enable a well in this case) depending on the result of the
ongoing prediction (well producing liquid rate in this case)
Read the calculation results and report them in the Excel spreadsheet

© 1990-2018 Petroleum Experts Limited


487 OpenServer

This example involves a VBA macro. The VBA macro, the Excel file, and the GAP
model have been prepared in advance and the code structure will be a useful resource
to further modify the macro or use as a basis to develop further macros.

We are not going into the explanation of how to write the VB macro because the user is
expected to have (or be trained in) the required computing knowledge.

To execute the macro, extract the GAP archive file and open the main *.gap file. Also,
open the corresponding Excel macro file that has also been included in the GAR file.
Please ensure that the macro security has been set to enable macros.

To run the macro, simply select the Run Macro button located on the Excel
spreadsheet.

Files required for this example:

The files for this example and the final model are in the following directory.
~\samples\OpenServer\GAP\
OpenServer Example A.GAR
This is a GAP Archive file that also contains the macro. To extract a GAP
archive file (GAR file), from the main GAP menu select File | Archive |
Extract

The production network


The GAP model consists of two naturally flowing oil wells producing from a reservoir to a
surface gathering system ending in a fixed pressure separator.

OpenServer User's Manual


OpenServer Examples 488

Macro Explanation:
The macro controls the GAP prediction run and extracts Well 1 liquid rate as the
prediction advances.

When the liquid rate is less than a pre-set minimum liquid rate then the second well (W2)
is enabled, simulating the well coming on-stream.

OpenServer macros are ideal when events need to be triggered by results during the
prediction run where they cannot be scheduled in the component itself where a fixed
date for the event is required.

VBA Macro Structure:


Initialisation

In this section the GAP model initial setup is performed and the spreadsheet previous
results (if any) are cleared.

Prediction Run

This section performs the GAP prediction run step by step.


At each step the Well 1 liquid rate is checked and if less than the minimum liquid rate
value set in the spreadsheet then the Well 2 is enabled

© 1990-2018 Petroleum Experts Limited


489 OpenServer

Finalisation

This section finalises the GAP model (original model values are restored) and the
connection between Excel and the IPM tools is ended.

This example provides the basis for the users who wish to set different events triggered
by the step prediction results. The user can use this VBA macro as a starting point and
modify it to suit individual needs.

For further details on macro structure please see Basic_Code_Structure for more
information.

10.2.3 Example 2 – GAP Open Server Example B


The objective of this example is to:
Review the abilities of OpenServer to link third party software to the IPM Tools.

This example demonstrates how a VBA macro can be used to:


Perform a quality check of the GAP well models performance against production
test data in a batch mode
Match IPR in order to reproduce production test data (in case there were any
discrepancy between this and the GAP well models performance).

This macro uses the ‘Model Validation’ functionality within GAP.


This functionality allows checking the well model performance in GAP against production
test data.
This is fully described in chapter 7 of GAP User Guide. The same methodology will be
used in this example.

In brief, the ‘Model Validation’ feature in GAP uses production test conditions jointly with
the well model IPR and VLPs to calculate the well production rate. These rates are then
displayed against the measured test rates.

The only functionality that the macro adds is the capability of matching the IPR
parameters (Reservoir Pressure or Productivity Index) to match the well models in case
there is a discrepancy with the production test data. This could still be done within GAP
interface but would be manually.

It is important to mention that the objective of this example is to illustrate the


potential of the OpenServer functionality and by no means suggesting that any
discrepancy between well models performance and wells production test data
should be corrected by modifying the IPR without carrying out a
comprehensive diagnostic/analysis of this discrepancies are (e.g. pvt, flow
correlations, production test data quality, etc.)

OpenServer User's Manual


OpenServer Examples 490

As in the previous examples, the excel file and the GAP model have been prepared.
The files required to run this particular model are:

The files for this example and the final model are in the following directory.
~\samples\OpenServer\GAP\
OpenServer Example B.GAR
This is a GAP Archive file and needs to be extracted. To extract a GAP archive
file (GAR file), from the main GAP menu select File | Archive | Extract

Setup
Before running the macro, GAP needs to be opened and the required files extracted
from the GAR file ‘OpenServer-Example B.GAR’
Open the Excel file ‘OpenServer-IPR Matching’ and follow the instruction described
below.

The VBA Macro is designed to follow a stepwise procedure which is described below:

1) Initialisation.
This step opens a given GAP file and retrieves well models data such as Label, WC,
GOR, Reservoir Pressure, PI (as per the IPR data screen)

© 1990-2018 Petroleum Experts Limited


491 OpenServer

2) Production Test Data.


After step 1, the production test data for each well should be entered in a separate table.
This table is already populated for this example.

OpenServer User's Manual


OpenServer Examples 492

3) Transfer Test Data.


This step transfers the production test data entered in the test data table into the main
table from where the values will be taken for any further calculation.
These values will overwrite the ones previously imported from the existing well models
in GAP (WC, GOR, etc...)
For this example, the production test data is simply a ‘copy-paste’ between different
tables in Excel, but this ‘link’ could be done between any other application and Excel
(e.g. a database) where this data is stored.

© 1990-2018 Petroleum Experts Limited


493 OpenServer

4) Calculate Rates
This step calculates the production rates based on the well models in GAP for those
production test conditions.

OpenServer User's Manual


OpenServer Examples 494

If the difference between these calculated rates and the production test rates is larger
than the tolerance value entered in the spreadsheet they will be highlighted red.
Otherwise they will be highlighted green. The error will also be reported.

© 1990-2018 Petroleum Experts Limited


495 OpenServer

5) IPR Matching
This step will regress on either reservoir pressure or productivity index until the
production test rate is honoured by the well models in GAP.
Both original values and matched values will be reported in a separate table for
inspection.
After doing the regression, the original values can be restored (by using the ‘Revert’
button) before regressing on the other variable.

OpenServer User's Manual


OpenServer Examples 496

© 1990-2018 Petroleum Experts Limited


497 OpenServer

OpenServer User's Manual


OpenServer Examples 498

6) Confirm Matched Parameters


Once the regression is done, one needs to select which parameter is to be updated in
the model (Reservoir Pressure or Productivity Index)

© 1990-2018 Petroleum Experts Limited


499 OpenServer

7) Update/Save the G A P model


This step saves the GAP model with the changes done.

OpenServer User's Manual


OpenServer Examples 500

10.2.4 Example 3 – GAP Open Server Example C

This example uses OpenServer to run several GAP models in a batch mode (one after
the other) without requiring the user to save/open the different files.
This allows running different models/scenarios (e.g. overnight) keeping the results in
each model so they can be inspected later.

The Excel file is called ‘OpenServer Example C - Batch Predictions.xls’ and is located
in ~\samples\OpenServer\GAP\

The spreadsheet is set up for up to ten GAP models but can easily be extended to as
many as required.

10.2.5 Example 4 – GAP Open Server Example D

The objective of this example is to:


Show some of the capabilities of OpenServer to link third party software
to the IPM Tools.

This example demonstrates how a VBA macro can be used to:


Perform a prediction in GAP (having control of GAP at each prediction
step)
Modify the GAP model (schedule Wells to come on stream in this case)
depending on the result of the ongoing prediction (total gas rate) and the
target gas rate
Read the calculation results and report them in the Excel spreadsheet

This example involves a VBA macro. The VBA macro, the Excel file, and the GAP model
have been prepared in advance. We are not going into the explanation of how to write
the VB macro because the user is expected to have (or be trained in) the required
computing knowledge.

The actual time required to perform the example is short since all of the files have been
prepared. The exercise is simple, just press a button in the Excel file provided. However,
the purpose of this example is providing an introduction to OpenServer capabilities and
providing a template which can be used for developing other macros.

Files required for this example:

The files for this example and the final model are in the following
directory.
~\samples\OpenServer\GAP\
OpenServer Example D.GAR
This is a GAP Archive file and needs to be extracted. To extract a GAP

© 1990-2018 Petroleum Experts Limited


501 OpenServer

archive file (GAR file), from the main GAP menu select File | Archive |
Extract

The production network


The GAP model consists of 10 gas wells producing from a reservoir to a manifold
located in a platform and then the gas is taken to shore through a main pipeline.

Figure 10.17:
Gas Sample

What the VBA macro does

The objective of this macro is to provide the required well drilling scheduling such that a
target gas rate is met.
The target rate, initial number of wells and maximum number of wells can be modified.

The macro controls GAP prediction run extracting the total gas rate at each prediction
step and comparing this to the target gas rate. If this target rate is not met, more wells
are enabled.

OpenServer macros are ideal when events need to be triggered by results during the
prediction run and hence they cannot be scheduled in the component itself where a fix
date for the event is required.

VBA macro structure

OpenServer User's Manual


OpenServer Examples 502

Initialisation

In this section the GAP model initial setup is performed and the spreadsheet previous
results (if any) are cleared.

Prediction Run

This section performs the GAP prediction run step by step.


At each step the total gas rate is checked and if less than the target rate an extra well is
enabled.
If adding one well is not enough, another well is added. This is repeated until the amount
of wells is enough to meet the target rate.
In order to check this, every time that a well is added a Solve Network is performed. This
approach is very powerful as it does not affect the prediction run and allows checking in
advance what the next step results (gas rate) will be.
Once the production conditions are satisfactory, then the next prediction step is
performed.

Finalisation

This section finalises the GAP model (original model values are restored) and the
connection between Excel and IPM tools is ended.

This example provides the basis for the users who wish to set different events triggered
by the step prediction results. The user can use this VBA macro as a starting point and
modify it to suit individual needs.

10.3 MBAL Examples

This section describes the example files that are provided with OpenServer installation
related to MBAL. These files may be used as a starting point to develop additional VBA
macros for MBAL application. Please note that some of these examples will not run
without some modification – this is due to the different date formats in different
countries.

All of the following examples are located in the following directory


~\samples\OpenServer\MBAL\

OPENSERV.XLS
This is the simple spreadsheet used as an example in section 3.5 of MBAL User Guide.

CALCWELL.XLS
This is an advanced spreadsheet macro that is used to calculate the well schedule
required to meet a fixed production rate. The user may specify a single well type and the

© 1990-2018 Petroleum Experts Limited


503 OpenServer

maximum number of wells available. The macro will then calculate at each step the
minimum number of wells required to meet the required rate. The well schedule dialogue
will contain the required wells on completion of the macro.

MBSAMPLES.XLS
This example runs two predictions with different OOIP and displays a summary of results
for both runs.

SENSITIV.XLS
This example runs a prediction for a number of OOIP and RDs. It runs a prediction for
each combination of values and displays the final cumulative rate and pressure for each
run – it also saves a prediction stream for each run.

OPENSERV.MDB
This is an Access database example that is used to transfer data from the database to
MBAL. Measured rates and pressures are stored in the database. The macro converts
these to cumulative rates and transfers them to the MBAL tank production history.
NOTE: Please check the MBAL file path, which is implicitly specified in the macro.

MBALTEST.PXB
This is the example of the batch file method used in section 4.3 in the MBAL User Guide

10.3.1 Step-by-Step Material Balance Prediction Examples

STEP1.XLS
In this example we calculate a manifold pressure schedule to keep the rate above a
target rate. At each time step the macro checks the current rate. If the rate falls below the
target rate, the macro will add a new row to the table of production and constraints to
decrease the manifold pressure by a fixed amount. After running the macro, the
production and constraints dialogue will contain the calculated manifold pressure
schedule.

STEP2.XLS
In this example we increase the PI of the well by a fixed percentage every n year – the
percentage and number of year’s n is read from the spreadsheet.

STEP3.XLS
In this example we calculate a well schedule that will achieve an entered rate for the
duration of the prediction. The well schedule is initialised with 10 wells each of the two
well definitions. We then run the prediction step by step and check if the specified rate is
produced. If not, we add new rows to the well schedule until the rate is produced. The
two well definitions are added alternatively. On completion of the prediction, the
calculated well schedule can be viewed in the well schedule dialogue.

OpenServer User's Manual


OpenServer Examples 504

10.4 Step-by-Step Production Allocation Examples

PASTEP1.XLS
In this example we perform a production allocation calculation. However one of the
layers has work-overs performed during the history. So at two different dates we
increase the PI.

10.5 Direct Access Examples

FRACT_FLOW_MATCH_1.XLS
In this example we do a prediction where we calculate the tank pressure from production
rates defined for each well. In addition we calculate the GOR, Wc etc for each well at
each step in the prediction. This particular form of the prediction can be used to check
that the prediction matches the WC and GOR from the production history for single layer
case.

FRACT_FLOW_MATCH_2.XLS
In this example we do a prediction where we calculate the tank pressure from a manifold
pressure for each well rather than a common manifold pressure for all wells. It also uses
the input production schedule as a maximum well rate constraint. This particular form of
the prediction can be used to check that the prediction matches the WC and GOR from
the production history for multi-layer cases.

DA1.XLS
This file contains the macro described in detail in the previous section concerning the
high level direct access OpenServer.

DA2.XLS
This file contains the macro described in detail in the previous section concerning the
low level direct access OpenServer.

10.6 PROSPER Example


The following example is designed to take the user through building a simple macro for
PROSPER that performs a system calculation and then returns the results. The objective
of this example is to point out the steps needed to create the macro and to get users
started in performing a variety of simple tasks using the OpenServer functionality of
PROSPER.

Step 1: Locate the OpenServer Template spreadsheet and open it up

© 1990-2018 Petroleum Experts Limited


505 OpenServer

Step 2: Access the VBA script utility of the spreadsheet from the following path

OpenServer User's Manual


OpenServer Examples 506

This will prompt the VBA script as shown below:

© 1990-2018 Petroleum Experts Limited


507 OpenServer

Step 3: Open the PROSPER file to work with. In this case it is the
T02_SIMPLEOILWELL.OUT sample file installed in the samples directory or PROSPER:

OpenServer User's Manual


OpenServer Examples 508

Creating this OpenServer macro will revolve around the same steps as doing the
calculation manually. So, the commands to be used can be accessed using the Ctrl and
Right Click functionality.

Step 4: Access the system calculation screen and get the string that controls the well
head pressure

Select 'Copy' and return to the spreadsheet

Step 5: Use the DoSet command to start writing the macro

© 1990-2018 Petroleum Experts Limited


509 OpenServer

This line will set the fist node pressure to be 150psi. Note that OpenServer only
transfers values, not units. So the number 150 will be taken regardless of the units set in
the PROSPER file.

Step 8: Use the list of commands to find the right command to perform the system
calculation in PROSPER. The list of commands can be accessed from OpenServer
function of Help menu and then selecting Commands. To find the command type
"system" in the search string and then select the 'Find' button, the necessary string will
be highlighted in the list.

OpenServer User's Manual


OpenServer Examples 510

As we can see from the above list, the command is PROSPER.ANL.SYS.CALC

Step 9: Insert the calculation command in the macro:

© 1990-2018 Petroleum Experts Limited


511 OpenServer

Step 10: From the PROSPER file get the string that extracts the results of the system
calculation by selecting Ctrl + Right Click on the calculated parameter

OpenServer User's Manual


OpenServer Examples 512

Step 11: Set this in the macro:

© 1990-2018 Petroleum Experts Limited


513 OpenServer

Notice that the DoGet function will send the result to cell A20 of Excel.

Step 12: Execute the macro

Once this is done (by selecting the 'Run' button on the Excel spreadsheet), the rate result
can be seen in cell A20 of the active Excel sheet as shown below:

OpenServer User's Manual


OpenServer Examples 514

Just to check that the result extracted is the same as the one given by PROSPER, the
system calculation screen shows the same number as the rate result:

© 1990-2018 Petroleum Experts Limited


515 OpenServer

OpenServer User's Manual

You might also like