Streamz

Introduction

If you are using Pipe-It, or getting ready to use it, there are chances that you want to perform some petroleum stream management tasks. This means using a stream of data pertaining to actual oil, gas or water quantities, and/or their properties, and performing some computations on them. An example might be the aggregation of streams from multiple wells, originating from a reservoir simulator and feeding to a process simulator. Or using measurements from a production well test and obtaining compositional molar streams. When it comes to stream management, Streamz is the unmatched application that is the envy of all petroleum applications.

Streamz is a unique program for comprehensive petroleum fluid management. It is a decade proven technology that is the “engine” of Pipe-It, a new software for model-based integration and optimization developed by Petrostreamz AS and launched on December 12, 2011. Streamz is now exclusively available only as an integral component of Pipe-It. Streamz is a generic program to convert fluid streams from one characterization to another. A characterization is a description of the number and names of components making up the stream, and optionally their molecular weights & critical properties. Streamz is controlled by an input file which names the characterizations, their properties, and defines conversions among them. This file allows the user to specify opening of stream files, containing the streams in particular characterizations, and also commands for filtering, combining and copying streams from one file to another. The program automatically invokes conversions among the differing characterizations as required, provided they have been previously supplied.

It is the petroleum engineering application package with Pipe-It that excels in performing efficient and consistent petroleum streams management. It is often referred to as “engine” of Pipe-It. To enable new Pipe-It users to get familiar with Streamz Pipe-It provides a suite of assisted mode, automated Streamz Processes. These are accessed by the user when they click on the drop-down triangle in the Pipe-It GUI next to the Process (Process button on toolbar) button.

Streamz Process in Pipe-It GUI

Streamz Copier copies all streams from all incoming stream files to all connected output stream files unless filters are invoked. It automatically performs characterization conversions if needed.

Streamz Tabulator aggregates incoming streams, whether from a single or multiple stream file to produced, usually smaller, aggregated stream files. Conversions performed automatically. Typical usage: aggregate well streams to field streams.

Streamz Separator is used to separate each stream in an input stream file to produce two separated streams on each of the two (gas and oil) output stream files. There are no conversions allowed, input and output stream files should be in the same characterization. One of 3 methods (EOS Flash, Split Factors, and K-values) can be specified. However in the current version, only EOS Flash method is available. Pressure and temperature conditions of the Separator can be specified or taken from an attached Pre-Include file (in which case they can be manipulated by the Optimizer).

A complete Surface Processing Facility can be modeled by connecting the product streams from one separator as the feed stream to the next.

Streamz Generic is a user specified Stream management “task” implemented as a ready-to-run Pipe-It Process. All connected stream file Resources, and their corresponding characterizations, are made available on-the-fly. The user can concentrate on writing Streamz “code” to define the non-vanilla task at hand. Great for learning and validating Streamz commands.

When a user graduates to become a power user of Streamz they can access the full power of Streamz by writing Streamz driver files of their own and launching Streamz as a standard 3rd party application (or via the supplied Streamz Script; see image below). The user is totally uninhibited and all Streamz command documented in the reference manual can be used. However in the context of using Streamz within a Pipe-It integrated project users at all levels of Streamz knowledge will tend to use the Streamz Processes, utilizing the benefit of on-the-fly code generated based on the stream resources, characterizations and conversion in use.

Default Scripts provided by Pipe-It installation. Available via the Scripts toolbar.

More and more Streamz Processes are likely to be added providing more Streamz functionality via the Pipe-It GUI.

Streamz Language Commands

Streamz is built to take instructions from a user written driver file using the Stream command "language". The user typically states fluid characterizations, specifies conversion among multiple characterization and causes the program to convert quantities contained in stream files containing hundreds (or millions) of streams. A rich set of about 30 commands (primary keywords) are understood by Streamz (but not very well by users). The alphabatical list is given below. Each is explained, with examples on page linked to the command.

Primary Keywords Brief Description
BIPS Enter a table of Binary Interaction Parameters
CD Change Directory
CHARACTERIZATION Name and enter a fluid characterization
CLEAR Clear named filters and streams
COMBINE Combine input streams into named streams
COMPONENT Enter a table of properties for current characterization
CONVERT Define a conversion procedure from a named to "current" characterization
COPY Copy streams from input to output stream files
DEFINE Define named filters
DOMAIN Name domains and their types
ECHO Turn on echoing of input (driver) files
END Declare the end of current primary keyword
EOF Declare the end of file
EOS Declare the Equation of State for next characterization
FILTER Define named filters
GAMMAFILE Open and close files for Gamma distribution results
INCLUDE Include files
LUMP Create lumped fraction from defined components
MIX Prepare named streams from other streams or components
PROCESS Process a stream through a set of connected separators
REDUCE Convert from molar streams to volumetric streams
RESTORE Make a previously defined characterization "current"
SEPARATOR Define a separator
SPLITFILE Open and close split files
STREAMFILE Open and close stream files
TABS Define "tab" positions for current file
TAG Add variables & values to named streams
TABULATE Sum-up and tabulate variables while converting
TITLE Define a boxed title
TOTAL Sum named streams
VARIABLE Name variables and their types
WRITE Output named streams to stream file(s)

ALIAS Table: It is a list of Aliases of Primary Keywords and their Sub-Keywords.

These commands are discussed in detail in a separate Streamz Language Documentation.

Streamz GUI (Streamz Assistants)

Streamz predates Pipe-It by almost 5 years and is a comprehensive stream management solution by itself. It was created in 2001 and immediately began to be used in large scale projects involving integration of multiple reservoir simulation output, conversion from black-oil to compositional streams and simplified surface process simulations. Streamz has a rich command language allowing it to perform all its tasks on hundreds and thousands of streams. It has the capability to perform a series of tasks with output files of one tasks becoming input files of following tasks. But to the new engineer the richness of the command language becomes a barrier in using it.

Pipe-it was born from the need to making Streamz easy to use. Having an intuitive and easy to understand graphical interface itself Pipe-It provides GUI assistants for the most often used tasks of Streamz. The user merely connects the stream file (.str) Resources to these assistants, fill in some fields to specify optional information and a stream management Process is ready to be launched in Pipe-It.

There are three steps necessary to use this Streamz GUI:

Populating the Streamz Library

Start Pipe-It and load the project you want to work with. Now click in the Stream Library icon on the toolbar, as shown in the figure, to launch the Stream Library.

Click on the '+' icon on the toolbar to add a file. A standard file browser dialog box opens up to allow you to select the file. This file will be a standard Streamz characterization or conversion file in proper Streamz syntax. The file importer will validate the file before importing it and lists the number of Streamz characterizations and conversion definitions found. It is possible that a file being imported into the library contains multiple characterizations and/or conversions, but this is not recommended.

Once a file is chosen the above dialog is shown to the user. This example is an import of a single characterization contained in the file "Pvt/EOS19.chr". If the user needs to review the content of the file they can click on the "Open in Editor" button. If some edits were made the file can be re-loaded. Once the user is satisfied, they can click the OK button to complete the import. The image below shows an import of a file containing a conversion.

A window is shown after choosing a file for import. Recognized characterizations and conversions are shown. Errors will also appear here if encountered.

A Streamz library as it appears after being populated with few files. The Files tab is shown here. Some file entries are expanded to show the characterizations and conversions contained in them. Some overview, like the number of conversions and characterizations, are also listed.

The characterization tab is selected in the Streamz library. More details about each characterization and their usage in the project is listed.

The Conversion tab is selected. A Matrix and List view is available. The Matrix view gives a good orientation on conversion methods available in the library for use.

Assigning characterizations to Resources

Once characterizations have been added to the Library assigning one to a stream file Resource is simple.

Using Streamz Processes (Assistants)

Clicking on the appropriate Streamz Processes will allow dropping them on to the Canvas.

Opening each of these shows a tabbed window where the specifications of each Streamz method are provided by the user based on presented GUI. Each of these process have some parts in common, which we discuss now, before taking up the parts specific to each.

Basic

Basic tab is usually the first one for each Streamz Process. It allows the user to:

Conversion

The Conversion tab shows the current conversion to be used for this Streamz Process. If input and output resources have same characterization the entry will be usually empty. However in some cases (calculations of mass rates from moles) the non-default convertor may be invoked.

For Streamz Process involving a conversion the appropriate convertor would be shown:

Streams

This tab is mostly for information. It confirms that there are input and output resources connected to the process and also that their characterization has been set. It will also populate the window with all the current variables present in the respective stream files.

An Offset for a stream variable can be specified here to shift all values for the variable by that amount. This might be useful to get multiple stream files to a common time basis, for example.

Code

The Code page gives a preview of the Streamz code that is generated on the fly, based on the selections and specifications in the other tabs. This is a useful educational tool for learning the syntax of Streamz. This is also useful for debugging purposes. This code will be echoed into the Pipe-It console and will be executed by a launch of Streamz within Pipe-It. This code is for view only and can not be edited by the user. Only the Streamz Generic has the possibility to add user code, but limited to the "streamz task" portion of the code.

Streamz Copier

This is the simplest of Streamz tasks and correspondingly has the least amount of graphical interfaces. Apart from the common tabs discussed earlier, the Advanced tab has the following additional specifications:

The above Advanced specification for the Copy Process is designed to obtain yearly rates from daily rate.

Streamz Tabulator

Basic

All consecutive streams tagged with the same values of requested tabulation variables/domains will be aggregated (added) and output as a single stream in tabulated form. Only the values of the requested variables will be part of the table. Typical usage is in the case of reservoir simulation streams, that originally contain streams for each well grid connection, A "Tabulate Time (d) and Well" will add all the connection streams to well level but the original time-steps are retained. It can not be used with two or more stream files from different simulations where the time-step is likely to be different. Gathering (see Advanced panel) options should be used in such cases.

In the above example, well to group aggregation is being performed (with the title of the Streamz Tabulator), hence Tabulation of Time (d) and Group variables are requested.

The Display option allows request for other variables that are not participating in the tabulation but are needed to be reported in the output stream file. Only variables that are not changed from stream to stream in the output will be shown, the other variables will have a blank column.

Other options for Normalize, Scale, and Filter are still available in the Basic tab and usable as described in common section.

Advanced

The advanced tab of the Tabulator still have the Multiply and Divide options but the Divide offer two variations:

Gather

The gathering (collate) options are very powerful and allow the user to output tabulated streams at user-specified intervals. The intervals can be equally spaced throughout or in batches. Ordering options additionally allows the gathered streams to be put in ascending order for any of the chosen tabulation variables. Finally the ordered streams may be output as running totals instead of actual quantities for each stream by choosing to accumulate them.

Streamz Separator

A Streamz Separator is the preferred way in Pipe-It to take feed streams in a stream file and obtain two product streams in two separate output stream files. All streams contained within the input stream file will be "separated".

A typical usage would be to obtain gas and oil moles corresponding total wellstream moles at certain conditions of temperature and preussre.

Above, a single stage of separation is being performed. All feed streams are contained in the file linked to the "FEED Stream" resource. Exactly the same number of streams will be written to each product stream files linked to the resources "GAS Stream" and "OIL Stream". Like all Streamz Processes in Pipe-It each such resource should be a valid stream file with an attached Characterization form the Streamz Library. For Streamz Separators both input and output resources should be using the same characterization.

On double-clicking, the specifications dialog for the Streamz Separator opens up allow the user to interact. The first (and default) tab contains the specifications for method of separation.

Split Factor & K-Values Separators support multiple sets for different values of variables that may be part of streams in a stream file. A different set will be used if the value of the stream variable matches exactly the value specified in a set. If the value falls in between to set values, linearly-interpolated values of the split factors (or K-Values) will be used.

This image illustrates how such sets can be created, edited and removed.

Streamz Separators are building blocks Separation Facilities that are often used in the industry. A 3-stage separation may be achieved by connecting products from a Separator as feed to the next separator and so on. Each product is saved to a file (linked to a Resource) before being used as feed to the next, to honour the R-P-R rule of Pipe-It.

Full-blown multi-stage separation facilities can easily be implemented using these building blocks. Each stage could be use any one of the 3 separation methods (Split factor, K-Values or EOS Flash). When run in tandem with Pipe-Itc they can support recycle loops within the facility with user defined convergence.

Streamz Generic

A Streamz Generic offers pre-written (read-only) Streamz code generation based on the Resource connectivity and Streamz Library usage at the top. On the lower half is an area for user specific code where the full power of Streamz Application is available. By default this is populated by only the COPY command.

Streamz Documentation

Other documentation, available in the Appendix, for Streamz are:




Copyright © 2008-2013 Petrostreamz