Tutorial: Manipulate a Simple Stream Characterization

Level: Basic

Required Knowledge: None

Keywords: Stream, Characterization, Library

Pipe-It Utilities: Streamz, Strexzel

Introduction

Objectives

This tutorial will focus on populating the Streamz Library of a Pipe-It project with characterizations and then using them, together with a stream file, for simple tasks.

Getting Started

This tutorial will be using the Pipe-It project created in the "Create a Stream file" tutorial. We advice to go through that tutorial first. Open the Pipe-It project. The stream file resource called 1stStream.str should be available on the canvas. Additional information about this resource can be obtained by hovering your mouse over it till the info “i” button becomes visible and then clicking it. In this case it shows the name of the file on the disk and its size.

Note: This info button shows up only if the menu item View / Show info button is checked.

Characterization

Create a Characterization file

Double-click the stream file resource. This action opens it in Strexzel. We recall from the previous tutorial, that stream quantities are stored under the component columns, in this case SO & SG. Characterization definitions in Pipe-It are stored in a text file, usually with the .chr extension. The easiest way to obtain a *.chr file is to use a stream file loaded into Strexzel.

Go to the Strexzel menu item “Save Characterization…” will allow you to save the characterization in a text file. Give it a name, e.g. Blackoil.chr. We can then close Strexzel.

We can locate the file by right-clicking the canvas and say “Show project in Explorer”. The *.chr file created is located there. Like any other file it can be dragged onto the canvas and it becomes a resource. We can open it in an editor and view its contents.

We see that this file contains certain keywords in the proper syntax. This is the advantage of creating a characterization file using Strexzel. We see that the name of the characterization is “Black Oil?”. It has two components names SO & SG. The molecular weight of neither is defined. The definition of the characterization then ends with the END keyword.

Load a Characterization into a Pipe-It project

To use this characterization in Streams management tasks, we need to enter it into the Streamz Library, accessible from the Window menu item.

Another window opens which is currently empty. To add a characterization we click "Add file". Navigate to the Black Oil?.chr file and open it. The file importer will parse the file and identify all available characterizations, and list them ready for import. Conversions, which we will be studying in a future tutorial, will also be listed if found.

The Streamz Library interface allows you to see the file that are part of the library together with the characterizations and conversions (if found). In this case only one characterization was found. The names of the components are also listed.

This is now ready for use in Pipe-It. We can close the Window and go back to the canvas. The "Black Oil?.chr" resource can now be deleted if desired. The file will remain on the disk and is accessible to the project via the Streamz Library.

Although a stream resource by itself does not need to be linked to a characterization, using the resource for streams management tasks does need this connection. We do this by right-clicking a stream file resource and choosing “Set Characterization…”. A window opens allowing you to choose the characterization. In the current tutorial project, there is only one so we select it and say OK.

Selecting the info button now shows this additional information.

Stream Simple Management Tasks

Copy a Stream File

Now this stream resource is ready for some Streamz Process tasks, the simplest of which is a Streamz Copier. The Streamz Copier is found under the Process icon (green oval) in the task bar.

Select it and then click the canvas where it is to be placed. Place it close to the resource. The philosophy of Pipe-It is that some data in a file, in this case contained in the resource 1stStream.str, is manipulated by an application, in this case the Process called Streamz Copier 0001. So these two need to be connected by using a connector (arrow in the task bar). Select it and point to the resource. Attach the connector to the resource by clicking on one of the points appearing on the edges of the resource. Then direct the mouse to the edge of the Process and click on one of the point that appears. You get a pop-up asking you what kind of connection it is. Since this will be an input stream to the process, we choose it.

Now, we need to create the output file that will be created by this Streamz Copier. This file has to be made known to the Process too. Create an empty resource by clicking the resource icon in the task bar and placing it downstream to the process. Make the connection as before, this time starting from the process, choosing the proper connection and ending at this new resource.

This resource is incomplete in two respect:

  1. We need to associate it with a file. This is done by right-clicking and choosing “Set Resource File…”. Since this file does not exist yet, just give it a name, e.g. 2ndStream.str.
  2. We need to associate a characterization to the file, as before. Right-click on the resource, select "Set Characterization..." and pick the Black Oil? characterization listed.

Now this small executable unit of this Pipe-It project is complete and can be run. Click on the Run button in the task bar. After running the Project, the file behind the output resource should have been created and it can be opened in Strexzel by double-clicking on it. The content is identical to the input since the copier made a copy of the original. To see a log of the run, we can make the run log visible by selecting “View….Show Console” menu item. We see the console output of the program that just ran in Pipe-It, in this case Streamz.

Operation on a Stream File

Getting an exact copy of the original file is not too interesting. Let us explore the facilities in this Streamz Copier and see what else can be done. Double-click the Copier, it opens up its GUI. This allows simple to advanced manipulation while performing the copying:

We would like to:

We need to:

Advanced Copy operations where the output streams are either multiplied or divided by values of accompanying variables can be achieved. A powerful Copy operation could include a conversion if the output characterization happens to be different than the input. In such cases conversion methods have to be created in files and those files imported into the Streamz Library. This topic is detailed in another tutorial.

If you click on run in the task bar, the Streamz Copier will now generate the stream file considering the different specificities we entered.




Copyright © 2008-2013 Petrostreamz