Académique Documents
Professionnel Documents
Culture Documents
RESOLVE
October, 2003
USER GUIDE
The information in this document is subject to change as major improvements and/or
amendments to the program are generated. When necessary, Petroleum Experts will issue
the proper documentation.
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.
All names of companies, wells, persons or products contained in this documentation are part of
a fictitious scenario or scenarios and are used solely to document the use of a Petroleum
Experts product.
1 Introduction ....................................................................................................................................................1
1.1 Contacting Petroleum Experts ...............................................................................................................1
2 Methodology ..............................................................................................................................................1
2.1 How RESOLVE Works ..........................................................................................................................1
2.1.1 Step 1: Load and query application case......................................................................................1
2.1.2 Step 2: Connect individual sources and sinks from client applications .........................................1
2.1.3 Step 3: Create a schedule ............................................................................................................1
2.1.4 Step 4: Run the simulation............................................................................................................2
4 Menu Commands.......................................................................................................................................1
4.1 Overview................................................................................................................................................1
4.1.1 Menu: File .....................................................................................................................................1
4.1.2 Menu: Options ..............................................................................................................................2
4.1.3 Menu: System...............................................................................................................................3
4.1.4 Connection Wizard........................................................................................................................4
4.1.5 System Properties.........................................................................................................................5
4.1.6 Menu: Module ...............................................................................................................................7
4.1.7 Menu: Schedule............................................................................................................................7
4.1.8 Timestep control ...........................................................................................................................8
4.1.9 Scripting control ............................................................................................................................9
4.1.10 Menu: Run ..................................................................................................................................11
4.1.11 Menu: Results.............................................................................................................................12
4.1.12 Menu: View .................................................................................................................................12
Appendix B..............................................................................................................................................................1
B1 Distributed Applications .........................................................................................................................1
F2 Startup ...................................................................................................................................................1
F5 Data flow................................................................................................................................................2
F7 Conclusion.............................................................................................................................................3
1 Introduction
2 RESOLVE version and build number - use the menu option Help|About RESOLVE... to
obtain this information.
4 Include a REVEAL archive (*.rvl) file where possible. Check that this file is not too
large (>2MB). If it is large, then run the simulation for one timestep and save the file,
this will eliminate potentially large quantities of graphical output data.
CHAPTER 1 – INTRODUCTION
Licenses - RESOLVE can be run using a single user (stand-alone) license or on a network.
In either case, a special security key is needed. The security key is called Bitlock for stand-
alone licenses, and Hardlock for network licenses. The security key is provided by
Petroleum Experts.
For a stand-alone license, the security key (Bitlock) must be attached to the parallel port of
the PC. For a network installation, the security hey (Hardlock) can be attached to any PC
communicating with the network. You should refer to the separate installation procedure for
a network Hardlock sent with the purchase of a Hardlock license.
RESOLVE is built around an 'application-driver' scheme that allows users with specific
connectivity requirements to build their own connections. See the architecture section for
more information.
RESOLVE runs on a PC (Windows 95, 98, 2000, NT) with a single interface to all
functionality.
2 Methodology
2.1 How RESOLVE Works
This section describes briefly the steps that are used to make connections between
separate applications.
For details as to what sources and sinks are exposed by an application, see the help
file for the individual driver in question.
The application that receives the inflow data does not have to use all of it - for
example, an economics package would not necessarily be interested in the delivery
pressures.
5. Pass the optimised results back to the objects that generated the inflow
relation
7. Return to step 2.
For example, consider the case where two reservoir simulations 'sim1' and 'sim2' are
connected to different wells of a surface network 'network', which in turn is connected
to a process simulator 'process'. The data can be passed from the simulators to the
network model entirely independently, and so the grouping 'Network~sim1~sim2' is
formed. When a RESOLVE simulation is run, data will be passed between the
modules of this group first, and Solve commands will be broadcast to the module
'network'. RESOLVE will then pass the data from the network model to the process
simulator, as it recognises the system 'Network-process' as a separate grouping.
RESOLVE is the master controller application - at each of the above steps the
command (to perform a timestep, etc) is broadcast to all the client applications
simultaneously. This allows multiple simulations (for example) to run in parallel,
perhaps over a network.
2. The drivers. The drivers, in the form of dynamic link libraries (DLLs), are the
implementations of the linkage. Each driver implements the connection with that
product by communicating with the application in question and by passing on
requests for data from RESOLVE. The form of communication with the application is
irrelevant to RESOLVE - in general, Petex programs will use OpenServer, other PC
packages (such as Hysys, above) will tend to use DCOM, wile other programs may
use PVM or CORBA, for example. Drivers must be registered in RESOLVE before
they can be used: this can be done from the RESOLVE front screen (see
Registration).
To illustrate further, consider the events that occur when a case of an application is
loaded into RESOLVE. RESOLVE will tell the driver to create an instance of the
required application (e.g. GAP) and then tell the driver to load the case into the
application. RESOLVE will then ask the driver for the details of the sources and sinks
exposed by the case - this request will be passed on to the application and returned
to RESOLVE to display on the screen.
The structure of the drivers is 'Open Source'. This means that users who would like to
develop their own linkage can develop and build their own drivers to load into
RESOLVE. For more information, see the developer notes that are distributed with the
software.
In order for RESOLVE to use a driver it must be registered with the RESOLVE system.
A new installation of RESOLVE will automatically detect and load new drivers (or
more recent drivers than the currently registered set); however, there are some
circumstances in which you may wish to register the drivers by hand.
App Module:
This is the name of the driver as it will appear in RESOLVE when an instance is
created.
DLL Path:
This is the path to the dynamic link library that implements the link.
Application Type:
This is an identifier given to RESOLVE, supplied by the driver, that determines the
nature of the application that is being linked. It is used by RESOLVE to guess the
'upstream' and 'downstream' components of a system. This guess can be overridden
by the user before the system is executed so this identifier is not crucial to the
running of RESOLVE.
Requires composition
Can produce composition:
These flags determine whether an application is compositional (i.e. requires EOS
data to run) and whether it is able to produce EOS data. For example, GAP, although
not currently fully compositional (the hydraulic calculations are based on black-oil
Ver:
The driver version number.
Description:
This is a brief decscription of the driver functionality, including the appropriate
versions of the connected software with which the driver works.
Register:
Use this to register a new driver. When this is pressed, a screen will be presented
allowing you to browse for the required driver. Once selected, RESOLVE will check
that the file has the correct format for a RESOLVE driver, and will then add it to the
above list.
Unregister:
Unregister currently registered drivers by highlighting them in the list and then
clicking Unregister.
Configure:
This will bring up a configuration screen appropriate to the driver. For example, the
GAP driver will invoke a screen allowing you to select the path to the correct version
of GAP on your PC.
Source/Sink node:
( - source)
( - sink)
Nodes are described as sources or sinks depending on the direction of fluid flow from
upstream to downstream. For example, a well in GAP can be a sink for a production
well or a source for an injection well.
Nodes can also be undefined withe respect to their being sources or sinks. In this
case they take the description from the item to which they are connected (e.g. a well
Uni-directional/bi-directional links:
When the RESOLVE system is run, a node is allowed to generate a table of inflow
data or a single point of inflow data. In the former case, the data acceptor will
calculate an operating point on the table (which may or may not be optimised, see
the Schedule screen) and that operating point will be returned. This is a bi-directional
link. In the latter case, the data transfer is entirely one way from data provider to data
acceptor. Nodes that generate tables of data are indicated with a red bar over the
icon.
Compositional/non-compositional nodes:
Each driver that is registered with RESOLVE indicates whether it is able to generate
EOS data, and also whether it requires EOS data to perform its calculations. For
example, a process simulator may require EOS data, whereas GAP will be able to
provide EOS data while still using black oil calculations internally. See driver
registration.
When a compositional case is run for the first time, RESOLVE queries the client
modules for their base composition. It then generates the following screen:
their compositions mapped together correctly. The red cross indicates that, for this
connection, the mapping is not yet complete.
Component lists:
The component lists on either side of the screen list the base compositions for the
two modules that are highlighted in the module connection list.
Add All:
If the compositions displayed in the two lists already 'line up', then this button will
automatically generate the links between the components.
Remove Link:
To remove an existing component mapping, highlight the entry in the list and press
this button.
Once this mapping has been set up it will be saved with the RESOLVE (.rsl) file. This
means that this screen will not be displayed on subsequent runs. If you wish to edit
this mapping before a run, you can go to Run | Edit Composition Tables from the
main menu. When the run is carried out, RESOLVE will cross-check the current base
compositions of the client modules against the compositions saved with the file, and
will re-display this screen if necessary.
2. Check that you have drivers for GAP and REVEAL installed in RESOLVE. From the
RESOLVE front screen, go to Options | Register and check that these drivers appear in
the list. In general, RESOLVE will attempt to install these drivers the first time it is run. If
they are not installed, then you must install them before proceeding. Go to Registration
for more information.
3. Check that the drivers are configured correctly. To configure the GAP driver, double
click on the driver in the list as invoked in the previous step. From the resulting screen,
browse to the directory in which GAP is installed. Repeat for the REVEAL driver.
4. You should already have extracted the sample files. Go here for more information.
In this example we are going to connect the Reveal and GAP cases provided as part of
the 'gapex' sample file.
Select Options|Units and set the input and output units to Oilfield, then select OK.
Now is a good time to save the file using File|Save As..., and enter a file name (e.g.
example1.rsl).
You should already have the drivers for REVEAL and GAP installed.
From the main menu, go to System | Create instance or select the icon.
From the resulting menu, select 'Reveal'. The cursor, when held over the main screen, will
change to indicate that an instance of the application can be made. Click on the main
screen where you would like the Reveal icon to be, and give the case a label (say,
'Reservoir').
Double-click on the resulting icon - a screen appears allowing you to browse for a case
name and to select a machine on which you would like the case to run. Leave the
'machine' field blank so that the application runs locally. For the case name, browse to the
file 'smartwell.rvl'. When you press OK, RESOLVE will take a few moments to start
REVEAL and load the required case. It will then query the case for its sources and sinks
and will display these on the screen.
In the case of REVEAL, the driver extracts well and completion data - in this case, it
determines that there is a single well in the model which is completed in four places. You
can go into REVEAL to confirm this.
Label the GAP case that you create 'Network'. Browse for the case 'smartwell.gap'.
As before, RESOLVE will take a few moments to load GAP and query the case. It will find
four production wells (sinks) and a separator (source) which it will display on the screen.
Background information:
You may note that the completions are modeled as wells in the GAP model. In fact, the
wells have 'null' lift curves in which the manifold pressure is equal to the bottom hole
pressure at all rates - effectively, the wells are simply inflow objects and the lift curves are
implicit in the surface network.
Before we make the connections, we will move the icons on the screen to make the
connections clearer.
Connect the cmp_1 icon in REVEAL to comp1 in GAP by clicking into the first icon and
dragging the connection to the second.
Repeat this for all the icons: cmp_2 to cmp_4.
Note that it is possible to make the connections using the connection wizard. This is
obtained by invoking System | Connection Wizard under the main menu.
In this example, we will change the simulator wells to be run as fixed rate wells. When
GAP optimises its system, it will return the result as an operating point for the well on the
inflow relation that REVEAL passed for that completion, i.e. a node pressure and rate.
REVEAL will then have to control that completion with that fixed rate or pressure for the
duration of the following timestep.
Double-click the REVEAL icon on the main screen. Select the 'Associated Data' tab.
Select 'Fixed Rate' from the selection box at the top of the screen.
Note that it is possible to commence the REVEAL run from a restart using this screen.
For the purposes of this example, we will concentrate on the basic scheduling only.
Invoke the schedule screen from the main menu using Schedule | Timesteps. Select a
duration of 500 days with a timestep length of 50 days.
Note that the timestep length is the RESOLVE timestep length. When a timestep is
required RESOLVE will broadcast the request to all the connected clients, and those
applications that have a time dependency will take as many internal timesteps up to the
RESOLVE timestep as they require. When they have completed their timesteps, they will
pause and wait for further instructions from RESOLVE. This is important for
synchronisation purposes - if there are many simulation models connected to a surface
network (for example) then these models must be synchronised before inflow data is
passed.
On this screen it is also possible to set the optimisation frequency. The default of '1'
means that RESOLVE will attempt to optimise at every timestep. It may be desirable (for
performance reasons, for example) to perform unoptimised solves at some timesteps.
This number can be changed to optimise at every 'n' timesteps.
A validation window will appear immediately. This is warning that there is a separator in
GAP that is unconnected. In principle, this could be connected to a further module such
as a process simulator. The validation message is only a warning so you may press OK
to continue.
GAP and REVEAL will now be controlled by RESOLVE. REVEAL will take 50 day
timesteps as set in the schedule, and at the end of each timestep GAP will perform an
optimisation. You can observe this behaviour in the main windows of these programs.
1. It is generally possible to view all the results of a simulation for any of the client
applications in the application itself.
2. RESOLVE has a limited set of results that it keeps from the run.
The results from the client applications are best viewed when the run has completed or is
paused: this is because RESOLVE is controlling the application and it is possible that
viewing application results will interfere with the control. For this reason, application user
interfaces are disabled while the run is proceeding.
RESOLVE will keep a basic set of results for each connected sink. These can be
observed by invoking Results | Sink Results, or by clicking on the icon. From this
screen results can be plotted and reports generated.
For this case, try to plot the results for comp1 and comp3 of the GAP model from
RESOLVE.
Note how:
1. The GOR and water cut evolve due to coning from gas and water layers in the
REVEAL simulation.
2. GAP chokes the completions to limit the gas through the system. GAP does not
necessarily shut in the gassy completion as gas lift is desirable to lift the fluids as
the water cut increases.
This tutorial has only touched on the functionality of RESOLVE. For more information, see
the help sections that refer to the menu and toolbar commands.
4 Menu Commands
4.1 Overview
New
The current system is cleared and all connected clients are closed. A new blank file
is created.
Open
A RESOLVE case can be loaded from disk. This will in turn load the client
applications that this case refers to - there is no need to have the client applications
already open.
Save
Saves the current RESOLVE project. The connected applications will be stored in the
file to be reopened when the case is reopened.
Save As
As above, except to a new file name.
Broadcast Save
Broadcasts a 'save case' message to all the connected clients.
Data directory
Set the default directory that will be displayed when File | Open is invoked.
CHAPTER 4 – MENU COMMANDS
Print commands
Commands for printing the system, configuring the printer driver, and previewing the
print job.
Units
Displays a screen with the current sets of input and output units that RESOLVE will
employ.
Register
This invokes a screen that can be used to register and configure additional drivers for
RESOLVE.
When RESOLVE is started for the first time, it will attempt to load a default set of
drivers that come as part of the software distribution. These will include drivers for
Petex products (GAP and REVEAL) and possibly other products for which Petex
have built drivers (e.g. Hysys). You can use the registration screen to configure these
drivers, change to different versions of the drivers, or add drivers of your own.
These are the commands that can be accessed from the 'System' menu.
Create Instance
This will invoke a menu with a list of the available drivers. To create an instance, click
on the application that you would like to load and click onto the front screen at the
location at which you would like the icon to be displayed.
Link
Enters 'link' mode for linking connected sources / sinks together.
Select
Enters 'selection' mode for selecting icons for later manipulation (e.g. moving).
Selection can be done per icon (by clicking into the icon) or by dragging over a
rectangle which will toggle the selection state of all the icons within the rectangle.
Selected icons are marked with a blue circle.
Move
Enters 'move' mode for moving icons. Icons can be moved individually by clicking
into the icons and dragging with the mouse, or collectively by clicking near a group of
selected icons and dragging to the new location.
Delete
Enters 'delete' mode for deleting clients. Source and sink icons can not be deleted
individually as these are properties of the client application cases. The clients can be
deleted in this mode by clicking onto the main icons.
Connection Wizard
Invokes the Connection Wizard.
Icon Sizes
Allows the user to change the icon sizes on the screen. This may be useful if a
system is fairly complex and is looking cluttered.
Properties
Invokes the system properties screen. This allows various options relevant to the
simulation to be set, as well as some graphical preferences (e.g. screen fonts).
Module lists:
The drop down list boxes at the top of the screen contain all the client modules in the
Resolve system. Select the two modules that you wish to make connections for from
the lists on the left and right of the screen. The sources/sinks that correspond to the
module are then listed in the list boxes below.
Sorting options:
The lists of nodes can be manipulated in various ways. Nodes can be selected in the
lists and removed by clicking the Remove Selected button. The lists are, by default,
sorted alphabetically (as it is normal to connect items with common names), but the
sorting can be reversed by clicking <Reverse Sort>. The Reset button will display all
nodes sorted alphabetically.
Display Filter:
Use the checkboxes to determine which items appear in the list. By default, data
providers and data acceptors (i.e. all items) are listed. Click on the checkboxes to
apply a filter to the list, and then click Apply.
Connections can then be made by highlighting the individual sources and sinks in the
list and clicking on Add Individual Item. If the lists have been sorted and filtered to
align the nodes that are to be connected, then Add All can be used to form
automatic connections between the node lists. The resulting connections are
displayed in the list box at the bottom of the screen.
When Options | System properties is invoked from the main menu, the following
screen is invoked.
System title:
This controls the display of a system title on the main screen. To give the system a
title, enter the title in the text box supplied. The font for the title can be changed by
pressing the 'Font' button. The system title information is saved with the Resolve file.
Label fonts:
Press the 'Font' button to change the font that is used to label the icons on the main
Resolve screen.
Runtime options:
Change Label
The alias that was set when the object was created can be changed here
Edit Case
Equivalent to double clicking on the icon in question, this invokes the 'Edit Case'
screen to allow the user to change the case being studied. In general, this will result
in the current connections being lost as the new case is loaded in.
Reload
Broadcasts a message to the client application to reload the case from scratch into
the application.
Save
Broadcasts a 'save' message to the client application to save the case.
Update query
Often used in conjunction with the reload, this will update the sources and the sinks
displayed with the current contents of the case.
There may be other options available for some drivers - these depend on the driver
itself and more details can be found under the help for that driver.
These are the commands that can be accessed from the 'Schedule' menu.
Timesteps
This will invoke a screen that allows the user to set a timestep length and schedule
duration for the RESOLVE run. See timestep control for more information.
Script
This is a function that allows advanced condition-dependent scheduling to be
implemented. See scripting for more information.
The timestep lengths (the times between synchronisation of the modules) are set
from this screen.
On the left hand side is a list of concurrent schedules. The buttons at the bottom of
the list allow schedule records to be added, removed, and inserted, or the entire list
can be cleared. When a schedule in the list is highlighted, that schedule timing and
duration is displayed at the top of the screen.
Timestep duration in Resolve can be fixed, or individual timestep lengths can be set.
Regular/fixed timesteps:
If this option is selected, the schedule duration and timestep length only need to be
set.
the case of GAP (for example), systems can be optimised by adjusting lift variables,
setting chokes, etc. The 'Optimise every ...' field allows the user to specify how often
the 'optimise' command is sent.
To create or edit a script, go to Schedule | Script from the main menu. The following
editor is invoked:
Several functions ('entry points') are called by Resolve at predefined parts of the
simulation. Use the drop down lists at the top of the screen to select the function that
you wish to implement.
Declarations:
This is not a function that is called, but this section allows variables to be set up and
instantiated with initial values.
PreSolve:
(as in the above example). This is called by Resolve just before the Solve command
is sent to a group of connected modules, after the data has been passed between
the applications. The argument to the function (ModuleList) is a string that is a
delimited list of the modules that form the group, the delimiter being a tilde '~'
character. For example, in a simple Resolve system consisting of two modules
('Simulator' and 'Network') that are connected together, PreSolve will be called with
an argument 'Simulator~Network'. The argument can be used to check exactly which
part of the Resolve system is currently being solved.
PostSolve:
This is also called with a ModuleList argument. It is called after the Solve command
and after the data has been passed back to the receiving module.
Finish:
Called at the end of the simulation, to allow post-processing, tidying of data, etc.
Validate
This performs the 'pre-processing' of the run without doing the run itself. It can be
used to perform a simple validation of the system.
Start
Commences a run (from scratch or following a pause). If it is starting from scratch,
RESOLVE will validate the system beforehand and display any validation errors.
Stop
Terminates a run
Pause
Pauses a run. During a simulation, the client applications user interfaces are disabled
- pressing pause will reenable the applications and allow the user to view results, etc.
Do One Step
Single-steps through a simulation.
RESOLVE will make a guess as to the required order based on the client types. The
calculation order can be changed manually using this screen.
Debug Logging
Turn the debug logging on or off. The debug logging will generate a detailed record
of all the data that is passed between applications during a run which will then be
saved with the RESOLVE file. It allows cases to be debugged remotely without
necessarily having access to all the drivers or applications.
Sink Results
This invokes a screen with a basic set of results for all the sink objects in the system.
They are grouped by application: for each application total quantities are also
recorded.
From this screen plotting and reporting functions can also be performed.
Log Window
Displays the log window. The log window can be written to by script commands (see
scripting for more information), which is potentially useful for debugging purposes.
The log file is saved with the RESOLVE file - this menu item can then be used to
display the currently saved log file.
A1 Sample Files
The following is a brief description of the sample files included with the installation.
Depending on where RESOLVE was installed, they may be found in C:\Program
Files\Petroleum Experts\IPM #\Samples\resolve, where # is the IPM (Integrated
Production Management) release version number.
The sample files are all based on connections between REVEAL and GAP. Check
the information in the step-by-step guide: getting started before attempting to load a
sample file.
1. Extract the archive using GAP. Start GAP. Make sure that the version of GAP
that you start is the same as the version of GAP that RESOLVE will run. Select
File | Archive | Extract from the GAP main menu and browse to the .gar file that you
extracted from the original zip file.
2. Follow the on-screen instructions to unpack the .gar file to the subdirectory that
you have created. Load the unpacked .gap file into GAP and check that all the
associated paths (e.g. to lift curves, etc) are correct. You can check this from Edit |
Edit project paths.
3. Close down GAP and start RESOLVE. You should now be able to open the .rsl file
from RESOLVE. The RESOLVE file will have been generated with different paths to
the linked cases: as the file loads, RESOLVE will prompt you to browse for the new
case directories.
4. When the RESOLVE load is completed, save the .rsl file so that the new case
paths are saved.
SMARTWELL
This is a model of an intelligently completed well ('smartwell') in which a REVEAL
well, completed in four places, is controlled on a completion-by-completion basis with
GAP.
GAS-SCHEDULE
This is the same as Gapex, except that it implements a script that will test for a high
GOR (> 25000 scf/STB) in the gas completion and shut it in if it exceeds this amount.
This is illustrating the scripting capability of RESOLVE.
VOIDAGE
This is using a REVEAL model linked to a combined production and injection system
in a GAP case. The production system is solved first, and the voidage is calculated
by the script. This is then set as a constraint in the injection system which is then
solved. This example is essentially implementing a voidage replacement scheme.
2-2 APPENDIX A – SAMPLE FILES
WATER-RECYCLING
This is an example where REVEAL wells are connected at the wellhead to a GAP
model that uses a lift curve to model the delta P to the manifold. The wells in this
case are gas lifted. A script is included that can allow water to be recycled into the
REVEAL model. In addition, the script calculates the saturations around the
multilateral well bores in REVEAL and outputs a warning to the user when they
exceed a certain threshold.
WATER-RECYCLING2
This is the same as Gapex, except that it allows the produced water to be recycled
back into the REVEAL model (up to a maximum of 4000 STB/d as set in the GAP
model). It also contains a script that shuts in the water injector when the water
saturations in the reservoir exceed a certain threshold.
Appendix B
B1 Distributed Applications
This functionality is implemented as part of the driver code. However, in general, this
is how to set up a remote machine to be able to launch IPM programs from
RESOLVE.
5. Under the Security tab, change the access and launch permissions to allow
you (as user) full access to the remote machine.
7. Press OK. You should now be able to create instances of PXSERVER and
launch the IPM programs from RESOLVE on a remote PC.
Windows 98/ME
Petroleum Experts is not able to support these architectures when RESOLVE is used
remotely. RESOLVE is still supported when used as a local application on these
operating systems.
The reason for this is that the Microsoft implementation of DCOM on these systems
does not allow remote applications to run interactively.
- Create an instance of Hysys from the 'Create Instance' menu on the Resolve main
screen. Click on the Resolve screen to create a Hysys icon.
- Load a pre-modeled case of Hysys by double-clicking on the created icon and the
browsing to the case in question. Note that it is possible to run Hysys on a remote
computer over a network. To do this, DCOM security must be set up on the
registered Hysys component on the remote computer. See your IT system
administrator for this.
- Click on the OK button. An instance of Hysys will be created in the background that
will load the required case.
- The driver will now determine the 'sources' and 'sinks' of the Hysys model for
display on the Resolve screen. These correspond to the input streams and output
streams of the model.
- The Hysys streams can now be connected in Resolve to other sources and sinks
from other applications. Note that the streams in Hysys are 'uni-directional'. This
means that a single point is passed by the program that supplies the data to Hysys
and Hysys returns no data back. The streams can only be connected to other uni-
directional sources/sinks.
- Resolve does not extract any reporting variables from uni-directional connections -
it is necessary to set up the variables that you wish to monitor. Right click on the
Hysys icon in Resolve, and click on 'Output variables'. From the resulting screen,
browse to the variables that you wish to report.
- As many cases of Hysys as you wish can be loaded into Resolve at one time.
When the case is run in Resolve, data will be passed to the connected input
stream(s) in Hysys. This data will consist of a single point of pressure, temperature,
mass flow rates, and black oil and compositional data. This data will be set at the
input stream.
2-3 APPENDIX C – HYSYS LINK
The compositional data is set in Hysys by poking the data into the fluid package. This
means that all streams that access the same fluid package will be affected. If more
than one input stream is connected through Resolve, and these share a fluid
package, then the compositional data of that fluid package will effectively be written
twice, once for each stream. This is only a problem if the input streams arise from
different sources with different properties. It is possible to set up different fluid
packages for different streams in Hysys, but then a stream cutter (or some
mechanism for mapping components between fluids) will be necessary in the Hysys
model.
Once the data has been passed, Hysys is allowed to solve the system. Data for the
monitored variables (see above) are extracted. Also, the data for any output streams
that are connected in Resolve are generated. Black oil data (that may be required for
connection to black oil applications) is obtained from a series of flash calculations.
For more information on the data that is passed by Resolve, and on how to set up a
Resolve model, please see the Resolve help.
Here are some other points that should be considered when creating the Hysys
model.
- The driver has been developed for use with steady state (non-dynamic) Hysys.
Dynamic (time-dependent) behaviour is assumed to come from the connected
models.
- When the model is created, the fluid package must contain all the components that
are expected from the connected model (e.g. GAP). The components can be pure or
pseudo (hypo). They do not have to have the same names as in the GAP model as
Resolve will map GAP components to Hysys components as part of the initialisation
process.
- When the compositional properties (critical temperature, pressure, etc) are passed,
only pseudo-component properties can be changed in Hysys. Pure component
properties are left unchanged. If you would like to pass the critical properties for a
pure component, then this would have to be set up as a hypothetical component in
Hysys. This would, however, mean that Hysys does not have any knowledge of the
pure component that it is supposed to represent (for the purposes of enthalpy
calculations, etc).
- When compositional properties are set in Hysys, they are applied to the fluid
package that is accessed by a stream. If the fluid package is shared across several
input streams all streams will be affected by the changes.
- This may also affect cases where more than one input stream is connected in
Resolve. If the streams access the same fluid package, then the fluid package will be
updated twice, potentially with different fluid properties. It is possible in Hysys for the
input streams to access different fluid packages, but then a stream cutter or some
other mapping will be required to map the different packages together in the Hysys
model.
Hysys Filename:
This is the Hysys case name (extension *.hsc).
Machine Name:
Hysys cases run from Resolve can be distributed over a network. Enter in this field
the name of the machine on the network on which you would like the Hysys case to
run. The machine name can be given as an IP address or a name in the DNS
register (e.g. 'dave-8200').
When entering file (case) names for remote machines, the file name entered should
be relative to the local machine.
C4 Other Functions
Save Case:
Saves the Hysys case to the current file name
Reload Case:
Reloads the case from file (useful if the file has been edited). Resolve will always
reload the file before a simulation run anyway, unless told otherwise in the simulation
options.
Output variables:
Connections made to Hysys are uni-directional and as a result no results data is
stored by Resolve by default. Use this option to set the variables that Resolve is to
store as part of its reporting. When this option is selected, the Hysys model is
interrogated for all available variables pertaining to both material streams, energy
streams, and equipment. These are then available for reporting.
Show case:
This simply makes the case visible to the user. It is important that Hysys is not quit
while Resolve is controlling it, as the connection can not be remade once it is lost
without re-opening the Resolve file.
D1 Driver Configuration
Before the driver can be used effectively, it must be configured for use with GAP.
The configuration screen can be accessed from the Resolve driver registration
screen (Options | Register on the main menu). Click on the GAP driver in the list and
press the 'Configure' button.
Application timeout:
In case of difficulties, Resolve will wait a certain period when attempting to start up
GAP. If it is not able to do so then Resolve will call an error after the timeout period.
For most cases a timeout of 30 seconds should be appropriate. If you are running on
a fairly slow machine you may want to make this value larger to avoid Resolve 'timing
out' unnecessarily.
GAP Filename:
This is the GAP case name (extension *.gap).
System:
As well as the main system, GAP cases can optionally contain associated water and
gas injection systems. This control can be used to select one of these systems rather
than (by default) the main system. This is useful if you would like to connect
separately to a GAP case and an associated system of a GAP case. Two instances
of GAP can be created in Resolve, one of which points to the main system while one
points to the associated system.
Machine Name:
GAP cases run from Resolve can be distributed over a network. Enter in this field the
name of the machine on the network on which you would like the GAP case to run.
The machine name can be given as an IP address or a name in the DNS register
(e.g. 'dave-8200').
When entering file (case) names for remote machines, the file name entered should
be relative to that machine and not the local machine.
Predictive Mode:
GAP can be used as a standalone calculator or in predictive mode. By default, GAP
is run in the same mode as is set up in the GAP model, which may be predictive if
there are MBAL or decline curve tanks present. The prediction mode can be
overridden here to always use GAP as a standalone calculator.
D3 Other functions
Save Case:
Saves the GAP case to the current file name
Reload Case:
Reloads the case from file (useful if the file has been edited). Resolve will always
reload the file before a simulation run anyway, unless told otherwise in the simulation
options.
Test OpenServer
This simply tests whether PXServer.exe is registered with the operating system and
returns the full path ofl i
APPENDIX D – GAP LINK 3-3
6. As with all calculations, quality checking of the model before the simulation is
run is extremely important to check for errors at an early stage before adding
extra complexity.
Before the driver can be used effectively, it must be configured for use with Reveal.
The configuration screen can be accessed from the Resolve driver registration
screen (Options | Register on the main menu). Click on the Reveal driver in the list
and press the 'Configure' button.
Application timeout:
In case of difficulties, Resolve will wait a certain period when attempting to start up
Reveal. If it is not able to do so then Resolve will call an error after the timeout
period. For most cases a timeout of 30 seconds should be appropriate. If you are
running on a fairly slow machine you may want to make this value larger to avoid
Resolve 'timing out' unnecessarily.
Reveal Filename:
This is the Reveal case name (extension *.rvl).
Machine Name:
Reveal cases run from Resolve can be distributed over a network. Enter in this field
the name of the machine on the network on which you would like the Reveal case to
run. The machine name can be given as an IP address or a name in the DNS
register (e.g. 'dave-8200').
When entering file (case) names for remote machines, the file name entered should
be relative to that machine and not the local machine.
Well Control:
When Reveal is connected through Resolve, the connected wells can be controlled
by:
2-3 APPENDIX E – REVEAL LINK
Fixed rate (total liquid rate, or gas rate for gas reservoirs),
Fixed bottom hole pressure
Fixed manifold pressure
The third option is available only when Reveal is connected to GAP, and is generally
to be preferred as the lift curve will give some of the system response of the surface
network and so will reduce the explicitness of the system. If fixed manifold pressure
is selected, it is essential to include the same lift curves that are in the GAP model in
the Reveal model.
E3 Other Functions
Save Case:
Saves the Reveal case to the current file name
Reload Case:
Reloads the case from file (useful if the file has been edited). Resolve will always
reload the file before a simulation run anyway, unless told otherwise in the simulation
options.
Test OpenServer
This simply tests whether PXServer.exe is registered with the operating system and
returns the full path of the registered application.
Here are some brief notes on how Reveal cases can be set up for use with Resolve.
In general terms, there are no special requirements that a Reveal model has to fulfill
in order to be used by Resolve. The following points are worth bearing in mind,
however:
3. Lift curves in Reveal will be ignored unless the wells are controlled with a
fixed manifold pressure.
4. Wells will be set to production or injection wells depending on the item that
they are connected to. If a Reveal well is connected to a water injector in
GAP, then it will become a water injector in Reveal.
Fluids that are injected into Reveal may not be at the same temperature as the
reservoir. It is important in these cases to have a fully thermal PVT.
It is also sometimes helpful to run some of the example files (that link Gap to Reveal and
Gap to Hysys).
F1 Template code
A driver template, coded in C++ and distributed as a zipped archive, is available from
Petroleum Experts on request. This is the stub code for the Reveal driver.
The stub driver code contains many comments and supplements this document.
F2 Startup
Ensure that Resolve is installed and the default drivers (for GAP, Reveal, and Hysys) are
registered with the application.
You can check this from the Resolve menu. Go to Options | Register and check that the
drivers are present in the list. Resolve should attempt to register these when it is started for
the first time: if they are not registered, then click on the Register button and locate the
drivers on your driver.
F5 Data flow
The starting point for Resolve consists of having two or more systems modeled in the client
applications that are ready to be connected. These are then loaded into the Resolve front
screen:
1. An instance of the application object is created by the user invoking Create Instance |
(app name) and then clicking on an arbitrary position on the front screen.
2. The user edits the case by double-clicking on the icon end entering some case
details (in the simplest form this might just be a file name). The driver tells the
application to load the case.
3. Resolve interrogates the driver for the case contents, i.e. the sources and sinks that
the driver exposes. It then displays these as child icons of the main application icon
on the front screen.
4. When more than one case is loaded, objects that generate inflows (drawn with a dot
in the top left corner) can connect to objects that receive inflows. This is done
graphically on the front screen.
The user now enters a schedule for the simulation: this may be just a schedule duration and
a timestep length.
Finally, the user presses ‘Start Simulation’. Resolve will now control all the client (connected)
applications by broadcasting commands to all the client drivers. These commands may be
ignored if they are not applicable to the application: for example, DoTimestep() is irrelevant
to an application that is not time dependent and is just doing instantaneous solves.
It should be possible to identify the above procedures in the code of the driver stub.
F6.2 ExtShared.h
This is shared by all Resolve drivers. It contains some general definitions and the data
structures that are passed between Resolve and the driver.
It also contains the command ID #define’s that are broadcast by Resolve to the drivers.
F6.3 ExtDllEntry.cpp
This is the main entry point of the driver DLL. It consists of five entry points:
1. ExtIdentify(). This identifies the driver to Resolve, passing a structure that contains
fields for the application, driver description, and other options.
2. ExtCreateInstance(). This creates a new instance of the model in the driver. Each
instance of the model is represented by a separate icon on the Resolve screen.
These models should be able to be controlled independently by the driver.
3. ExtDestroyInstance(). Destroys an instance as created above.
4. ExtConfigure(). Allows the user to configure the driver. For GAP and Reveal drivers
this allows information such as the application executable paths to be stored.
5. ExtCmd(). The main message loop for the driver. A model handle is passed and a
command ID: the driver must call the requested command for the given model.
F6.4 ExtInterface.h
This is the definition file for an abstract class that can (although it is not obligatory) be used
as a template for a general model class. It contains virtual functions (and some pure virtual
functions) for all the possible commands. These can be overridden in a subclass.
The ExtModel.cpp file in DriverStub is well commented and should provide you with a good
idea of what the various methods are supposed to be doing.
F7 Conclusion
Please contact Petroleum Experts if help or advice is needed in the development of your
driver. Source code of existing drivers is available. It may also be possible to make small
changes to the interface to accommodate applications that do not fit neatly into the model
outlined above.