Tutorial: Convert a Stream file from an EOS to another EOS

Level: Basic

Required Knowledge: None

Keywords: Stream, Characterization, Library

Pipe-It Utilities: Streamz, Strexzel



A characterization in Pipe-It terms is a collection of names, and optionally, properties of components. An EOS characterization is a collection of names of hydrocarbon species and their properties that permit EOS modeling computations. The characterization files need to be imported into Pipe-It’s Streamz Library in order to perform Stream Management tasks. Once two characterizations are available in the Library, a file defining methods to convert between them could be imported and then used in more advanced Stream Management tasks involving these two characterizations. This tutorial will focus on conversion between EOS characterizations.

What is a conversion?

Characterizations are used in Pipe-It in stream files that contain quantities of each component comprising the characterization. For example a stream file may contain Stock Tank Barrels of Oil per day and Standard Cubic feet of Gas per day as quantities of the components SO and SG. Each stream in a stream file might have different quantities associated with these component representing production from a well, or a field. Other stream files may have Pound Moles of components like Methane, Ethane, Butane etc. Conversions in Pipe-It are a way of specifying what fraction of the original quantity of each component in an initial stream ends up (or gets converted to) a portion of the quantity of the component of the resulting stream. Conversions are defined in terms of split factors, for each component of the input stream, that will multiply that component’s quantity to result in a portion of the output streams quantity. The final quantity of each component for the output stream is the sum of these individual portions for that component. In other words the conversion is a matrix multiplication of the input component quantities matrix by the split factor matrix resulting in the component quantity matrix for the output stream, as shown by this equation:

v1 to vm represent the quantities of the input stream, u1 to un represent the quantities of the output stream, S11 to Snm represent the split factors.

These split factors could be dependent on variables that are part of the streams eg. GOR, pressure, well type, ...

Getting Started

We'll use the "Manipulate a Stream EOS Characterization" tutorial as a starting point. If you decide not to go through that previous tutorial, please create a Pipe-It project and go through the two first steps of the "Manipulate a Stream EOS Characterization" tutorial: Load an EOS Characterization into the Streamz Library and Associate the EOS Characterization to a Stream File. The 9-components EOS characterization SPE3EOS will be used as input characterization. It is associated to the stream file called EOSstream.str

In order to have a clean project, we'll create a composite of the elements that have been created in the "Manipulate a Stream EOS Characterization" tutorial. Select all the elements except the EOSstream.str resource and right click on the selection area. Choose " Create composite from Selection...".

We can rename the composite to "Manipulate EOS Characterization" by right-clicking on the composite.

We have now isolated the EOSstream.str resource that will be used in the next steps.


Let us assume we need to study the development of quantities of 3-groups of components. The output characterization will be composed of:

This simplified conversion involves trivial lumping into the 3-components characterization.

Creation of a 3-components Characterization

The first step is to create this 3-components characterization in a text file and import it to the Streamz Library. We use the already imported 9-components characterization as a starting point. Open the Streamz Library and double-click the spe3eos.chr file.

It opens it in the text editor. Let us first save this file to the local folder with a new name e.g. CHAR-3COMP.chr. Let us then clean this by removing the comments to make it more readable. The CHAR keyword allows naming of the characterization. We'll call the characterization 3-COMP. We can remove the commented lines. Since we do not know the properties of this 3-components characterization, we will list only the NAME. The line containing the units is then not needed. Use the following names:

All the other properties are removed. Since this ends up being a non-EOS characterization, we can also remove the Binary Interaction Parameters. The END keyword completes the definition of this characterization. Let us save the file. The cleaned-up file should look like this:

Import the newly created characterization file into the Library as described in previous tutorial ( Load an EOS Characterization into the Streamz Library). The characterization is recognised and pressing the OK button imports it. Now there are two characterizations in the project.

Creation of the Output Stream file

To use this new characterization we need a resource. Drop the resource by clicking on the icon in the toolbar and give it a file name: 3COMPstream.str. Now we need to set a characterization to this resource. Right-click on the resource and select "Set Characterization...". Select the 3-COMP characterization.

Now we have an input stream resource but an empty output stream resource. Let us use the simple Streamz Copier to obtain the output stream file. We drop the Copier and make the necessary connections.

Open this Copier. We are immediately informed about a problem: There is no conversion to convert from SPE3EOS to 3-COMP.

Running this project informs us about the error again both visually on the canvas and on the console. Such a conversion method needs to be available in the Streamz Library.

Creation of the Conversion file

We'll create the missing conversion from scratch. Open the input and output characterizations in an editor. Lets then save CHAR-3COMP.chr as SPE3EOS-3COMP.cnv and make it ready as a conversion method.

  1. Begin by registering the characterizations that will participate in this conversion by using the RESTORE keyword followed by the names. The names should match the names in the Streamz Library. The first should be the input characterization, the one we will be converting from, in this case SPE3EOS. The output characterization or the one we will be converting to is 3-COMP.
  2. Then comes the CONVERT keyword followed by the name of the input characterization again, SPE3EOS. This is followed by the quantity type, for which this conversion is being defined. In this case, it will be from MOLES to MOLES. The same pair of characterizations can use different methods for different quantity types. This command merely indicates what pair of characterizations and pair of quantity types are being defined.
  3. The following line then lists the actual split factors and the components using the SPLIT keyword. This line says some portion of the input component CO2 will end up in the output component CO2-N2 and that portion is 1, i.e. all of it will end up in that component. Similarly we specify the split factors of each pair of components. It is probably better to use copy and paste to get initial entries and correct them rather than writing from scratch.
  4. The END keyword indicates the completion of this convertor definition.

The resulting conversion file should look like this:

In fact, this convertor says that all quantity values of CO2 and N2 from the input stream will make up the quantity of the CO2-N2 component of the output streams. It is similar for all the other components. This is a very simple trivial lumping split factor based convertor.

Loading the Conversion file in the Streamz Library

Open the Streamz Library by clicking on its icon in the toolbar. We will import the conversion file created by clicking on the "Add File" icon. Importing this file into the Streamz Library recognizes the fact that there are no characterizations defined in this file, but one conversion. The conversion will use the pair of pre-existing characterizations.

Note: The convertor cannot be imported unless the associated characterizations are already present in the Streamz Library.

Conversion Set-up

Open the Streamz Copier. Note that the error message is now gone. Go to the Conversion tab. Selection of the proper conversion between both characterizations is done automatically. You can check the conversion used by double-clicking on the green cell of the table. Once a conversion for a pair of characterizations is defined, as above, they can be used hundreds of times in the same projects without the need for specifying them over and over again. Each Copier, like this one, is set up to use a conversion automatically and the proper one is used based on availability. If multiple methods are defined, only then, one needs to choose the proper one using the Manual option.

Running the conversion

Running the project goes fine. We can view the 3COMPstream.str stream file containing the three components in Strexzel by double-clicking on it. The quantities are the sum of moles of their respective contributing component moles. We can also plot them with the plotting option in Strexzel.


To summarize, we started with an EOS characterization, attached to a compositional stream resource. We created a simplified 3-components characterization and a conversion from the 9-components to the 3-components characterization. We imported them into the Streamz Library and used a Streamz Copier to obtain the profile for the 3-components characterization.

Copyright © 2008-2013 Petrostreamz