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
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, model)
Creates a new node in the system specified.
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, optimise, potential, model)
Performs a solve network in prediction mode.
PREDEND (dorest, optimise, potential) Stops a production prediction calculation.
PREDINIT (ignore internal timesteps, ignore internal scheduling)
Performs production prediction initialisation.
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, potential)
Perfoms a solver calculation within GAP.
START () See Start and Shutdown section
STARTASYNC () See Start and Shutdown section
GENIPRLAYER Specifies the target IPR layer in a multilayer IPR model
Example: GAP.MOD[i].WELL[j].
GENIPRLAYER to n-1 where 'n' is the layer number corresponding to the layer the IPR will be generated
TRANSFERPROSPERIPR (well, layernumber, PVTMethod)
Transfers the IPR from PROSPER to the well node
Example: GAP.MOD[i].WELL[j].
TRANSFERPROSPERIPR
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.
Returns date for snapshot of the specified 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_number].DateStr
Returns date for snapshot of the specified number (if exist). The date is returned as a string in DD/MM/YYYY format.
EXAMPLE
DoGet ("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 : number2]
Returns dates for all the snapshots in the 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 : number2].DateStr
Returns dates for all the snapshots in the 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_number)
Loads the snapshot that corresponds to the 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/2010})")
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.
Copy any column of the equipment control screen into another column of this screen.
MOD[i].ResetControls(column) Resets any column of the equipment control screen.
MOD[i].RESETSCHEDULE (type, equiptype)
Resets any scheduling associated with the 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].MASK () Masks the node considered.
EQUIP[i].
REMOVEALLGROUPMEMBERSHIPS ()
Deletes all the existing group memberships.
EQUIP[i].REMOVEFROMGROUP (group)
Removes the node considered from the 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.
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].VALIDATE () Validates the ipr considered.
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:
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