Escolar Documentos
Profissional Documentos
Cultura Documentos
=1
The first <component | variable> argument corresponds to Qc, the
second to Qm, the third to w and the fourth to Qref. The Qref argument
can be given as a variable or component reference, a constant (defined
by SET CONSTANT <name> <value>) or a literal value. The last
argument (MAX,AVG,MID) is optional and defines which algorithm that
Strexzel should use for computing the Qref value. If no algorithm is
specified, Strexzel will default to MAX. Algorithm specification is only
applicable to component or variable argument. If the argument is a
constant or a literal, an error will occur.
MAX: Selects the maximum value from the column vector specified by
the Qref argument.
MIN: Selects the minimum value from the column vector specified by
the Qref argument.
AVG: Selects the median value from the column vector specified by the
Qref argument.
EXCLUDEZEROWEIGHTS: This optional algorithm control parameter
makes it possible to exclude rows containing zero weights from the
calculation.
If a Qref value of zero is computed, it will be substituted with the value
1.
Sum product
CALCULATE <reference name> SumProduct <component | variable> <component |
variable>
SumProduct is calculated according to the formula
= 1
=1
2
Sum
CALCULATE <reference name> Sum <component | variable>
Pipe-It Manual Page 156
Sum is calculated according to the formula
=
=1
Min
CALCULATE <reference name> Min <component | variable>
Min returns the smallest value found in the variable or component
column.
Max
CALCULATE <reference name> Max <component | variable>
Max returns the largest value found in the variable or component
column.
Mean
CALCULATE <reference name> Mean <component | variable>
Mean returns the median value from a sorted set conteining the values
from the component or variable column.
Example
The following macro creates a stream file with 5 streams, two variables
and two components and initiates these with dummy data. It finally
computes SSQ for v1=Qc, v2=Qm, c1=w and c2=Max(Qref)
I NSERT STREAMS 1 5 Amount
I NSERT VARI ABLE 1 v1 r eal
I NSERT VARI ABLE 1 v2 r eal
I NSERT COMPONENT 1 c1
I NSERT COMPONENT 1 c2
SET FORMULA v1 1
SET FORMULA v2 2
SET FORMULA c1 3
SET FORMULA c2 4
CALCULATE mySSQ SSQ v1 v2 c1 c2
The output is then written to the .SSQ file
CALCULATE out put : SSQ: mySSQ=2. 8125. Resul t wr i t t en t o f i l e: unt i t l ed. ssq
Pipe-It Manual Page 157
GUI
This command does not have a GUI equivalent.
Change Stream Units
Syntax
CHANGE STREAM UNI TS <f i r st st r eamr ow number > <number of st r eams> <Amount |
Vol ume | Mol es | Mass>
Important: By running this command, it is possible to create stream file
containing multiple units. While this is a valid stream file, formulas in
Strexzel macros will not be able to refer to or assign values to
component columns in such a file.
Description
This command will redefine units for a numbe of stream streams
starting at the stream/row number in the first argument.
Example
Given that Strexzel has loaded the stream file:
STREAMZ 1
Char ' '
Var i abl e v0 r eal
DATA
v0 Amount Comp_01
1 0
CHANGE STREAM UNITS 1 1 Moles will result in the following stream
file after saving:
STREAMZ 1
Char ' '
Var i abl e v0 r eal
DATA
v0 Mol es Comp_01
1 0
Pipe-It Manual Page 158
GUI
This command is available from the GUI by selecting Streams/Change?
Stream Units from the menu. The command applies to streams that are
selected (by selecting the row headers)
Edit Component
Syntax
EDIT COMPONENT <position> <component name> <molecular weight>
Description
This comand can be used to change a components name or its
molecular weight. <position> refers to the component index.
Example
We have two variables and two components in a stream file:
After running
EDIT COMPONENT 1 NewName
Pipe-It Manual Page 159
The name of the component will have been changed from "c1" to
"NewName" and the molecular weight changed to 10.
GUI
This command is available from the GUI by selecting Component/Edit
component from the menu.
Edit Variable
Syntax
EDIT VARIABLE <variable name> <type> <unit>
Description
This comand can be used to change a variable's type and unit.
Valid types are (Valid units in parentheses):
string (n/a)
integer (n/a)
real (n/a)
Pipe-It Manual Page 160
time (a, d, h, min, mo, s, wk, yr)
distance (cm, ft, in, km, m, mi, mm, yd)
area (acre, cm2, ft2, ha, in2, km2, m2, mi2, mm2, yd2)
volume (acre-ft, acre-in, bbl, cm3, ft3, in3, yd3, dl, dm3, gal, l, m3,
Mcf, ml, mm3, MMcf)
mass (g, kg, lbm, t, ton)
mole (mol, kmol, lbmol, MMscf, Mscf, scf, sm3)
temperature (C, F, K, R)
pressure (atm, atmg, bar, barg, kg/cm2, kg/cm2g, kPa, kPag, MPa,
MPag, Pa, Pag, psia, psig, torr, torrg)
Example
We have two variables and two components in a stream file:
After running
EDIT VARIABLE v2 mass kg
The type of the variable changed from "real" to "mass" and the unit set
to kg.
Pipe-It Manual Page 161
GUI
This command is available from the GUI by selecting Variables/Edit?
variable from the menu. The command applies to a selected variable
(by selecting the column header).
Expose Components
Syntax
EXPOSE COMPONENT <component name | component index>
Description
If a stream file contains multiple units, Strexzel will display a column
for each component-unit combination. If a columne has been removed
from view with the REMOVE COLUMN command, the column can be brought
back into view by running the expose command.
Example
Given a stream file with mass and amount units and a single
component. The user has deleted one of the columns:
Pipe-It Manual Page 162
After running
EXPOSE COMPONENTS c1
The Amount c1 column is again visible.
GUI
This command is available from the menu by selecting
Components/Expose? components from the menu. It does not present
a separate GUI.
Insert Component
Syntax
I NSERT COMPONENT <POSI TI ON> <NAME> [ MW]
I NSERT COMPONENT <NAME> <BEGI NNI NG | END> [ MW]
I NSERT COMPONENT <NAME> <BEFORE | AFTER> <NAME> [ MW]
Description
The command inserts a new component in the model. The command
has three syntax variations.
Parameters:
<POSI TI ON> specifies that the component will be inserted at a specific
index. This is a value between 1 and the number of already defined
components in the model.
<NAME> is the name of the new component.
[MW] The component's molecular weight (optional).
Pipe-It Manual Page 163
<BEGI NNI NG> specifies that the new component will be inserted in the first
component column.
<END> specifies that the new component will be inserted after the last
component column.
<BEFORE> specifies that the component will be inserted in the column
preceding another component (identified by the next <NAME> argument).
<AFTER> specifies that the component will be inserted after another
component (identified by the next <name> argument).
Example
Given a stream file with two variables and two components
Executing
I NSERT COMPONENT 2 NEW1
results in the "NEW1" component being inserted between c1 and c2 at
component index 2
and then executing
I NSERT COMPONENT NEW2 BEGI NNI NG
results in the "NEW2" component being inserted as the fist component
and then executing
I NSERT COMPONENT NEW3 AFTER NEW1
Pipe-It Manual Page 164
results in the "NEW3" component being inserted after the "NEW1"
component.
GUI
This command is available from the menu by selecting
Components/Insert? Component from the menu.
Insert Streams
Syntax
I NSERT STREAMS <f i r st st r eamr ownumber > <number of st r eams> <Amount > |
<Vol ume> | <Mol es> | <Mass>
Important: By running this command, it is possible to create stream file
containing multiple units. While this is a valid stream file, formulas in
Strexzel macros will not be able to refer to or assign values to
component columns in such a file.
Description
This command inserts one or more streamsstarting at the stream/row
number in the first argument.
Pipe-It Manual Page 165
Example
Given that Strexzel has loaded an empty stream file:
STREAMZ 1
Char ' '
DATA
executing
INSERT STREAMS 1 5 moles
(and then, in this example, a component (c1) just to get some data)
will insert 5 streams in the model (and stream file after saving)
STREAMZ 1
Char ' '
DATA
Mol es c1
0
0
0
0
0
GUI
This command is available from the menu by selecting Streams/Insert?
Streams from the menu.
Insert Variable
Syntax
I NSERT VARI ABLE <POSI TI ON> <NAME> <TYPE> <UNI T>
I NSERT VARI ABLE <NAME> <BEGI NNI NG | END> <TYPE> <UNI T>
I NSERT VARI ABLE <NAME> <BEFORE | AFTER> <NAME> <TYPE> <UNI T>
Pipe-It Manual Page 166
Description
The command inserts a new variable in the model. The command has
three syntax variations.
Parameters:
<POSI TI ON> specifies that the variable will be inserted at a specific index.
This is a value between 1 and the number of already defined variables
in the model.
<NAME> is the name of the new variable.
<BEGI NNI NG> specifies that the new variable will be inserted in the first
variable column.
<END> specifies that the new variable will be inserted after the last
variable column.
<BEFORE> specifies that the variable will be inserted in the column
preceding another variable (identified by the next <NAME> argument).
<AFTER> specifies that the variable will be inserted after another variable
(identified by the next <NAME> argument).
<TYPE> specifies the variables type.
<UNI T> specifies the variables unit (optional for real, integer and string).
Valid types are (Valid units in parentheses):
string (n/a)
integer (n/a)
real (n/a)
time (a, d, h, min, mo, s, wk, yr)
distance (cm, ft, in, km, m, mi, mm, yd)
area (acre, cm2, ft2, ha, in2, km2, m2, mi2, mm2, yd2)
volume (acre-ft, acre-in, bbl, cm3, ft3, in3, yd3, dl, dm3, gal, l, m3,
Mcf, ml, mm3, MMcf)
mass (g, kg, lbm, t, ton)
Pipe-It Manual Page 167
mole (mol, kmol, lbmol, MMscf, Mscf, scf, sm3)
temperature (C, F, K, R)
pressure (atm, atmg, bar, barg, kg/cm2, kg/cm2g, kPa, kPag, MPa,
MPag, Pa, Pag, psia, psig, torr, torrg)
Example
Given a stream file with two variables and two components
Executing
INSERT VARIABLE 2 NEW1 mass kg
results in the "NEW1" variable being inserted between the a and the b
variable at variable index 2
and then executing
INSERT VARIABLE NEW2 beginning volume dm3
results in the "NEW2" variable being inserted as the fist variable
and then executing
INSERT VARIABLE NEW3 AFTER NEW1 time h
results in the "NEW3" variable being inserted after the "NEW1"
variable.
Pipe-It Manual Page 168
GUI
This command is available from the menu by selecting Variables/Insert
Variable from the menu.
Load Characterization
Syntax
LOAD CHARACTERI ZATI ON <f i l ename>
Description
Loads a characterization file for the model. The command will update
the model with this characterization. This will in effect create
component representations in the model for components that are found
in the specified characterization file (if not already defined).
The <filename> parameter can contain a file name, relative or absolute
path to a file name. The path syntax is different for MacOS (using
forward slash) and Windows (using back slash). But Windows also
allows use of forward slash so it is recommended (in general in Pipe-It)
to use forward slashes to allow the project to be portable.
Pipe-It Manual Page 169
If a relative path is specified, this will be interpreted as relative to the
startup folder for the application.
Example
Given the following characterization file named myChar.chr.
CHARACTERI ZATI ON " SBO+RBO"
==========================
COMPONENT MW
- - - - - - - - - - -
SO
SG
SW
END; ( of char act er i zat i on)
Given that Strexzel has loaded a stream file containing the SG
component and some streams
Executing
LOAD CHARACTERIZATION myChr.chr
will result in the SQ and SW components being created
If the model is saved, the streamz file will have the characterization
name and components defined
STREAMZ 1
Char ' SBO+RBO'
DATA
Amount SO Amount SG Amount SW
0 0 0
0 0 0
0 0 0
Pipe-It Manual Page 170
GUI
This command is available from the menu by selecting File/Load
Characterization from the menu. Upon activation, it presents a
standard file open dialog that enables the user to browse to the desired
file.
Move Component
Syntax
MOVE COMPONENT <component name> [ LEFT | RI GHT] <number of col umns>
MOVE COMPONENT <component name> [ BEFORE | AFTER] <component name>
Description
The command will move a component to a new position in the model.
Specifying "BEFORE" or "AFTER" can be used to move a component to
another position, relative to another component identified by the
second <component name> argument. Specifying "LEFT" or "RIGHT" moves a
component <number of columns> in the specified direction. <number of
col umns> cannot be a number that would result in a move to a 0 or
negative index, or an index greater than the number of defined
components.
Example
Given that Strexzel has loaded a model containing two variables and
two components.
Executing
MOVE COMPONENT c1 AFTER c2
will result in the two components changing places.
Pipe-It Manual Page 171
GUI
This command is available from the menu by selecting Compnent/Move
Component(s) from the menu. The command applies to one or more
selected components in the stream window.
Move Streams
Syntax
MOVE STREAMS <r ow st ar t > <r owend> [ TO <r ow t o st ar t at > | UP <number of
r ows> | DOWN <number of r ows>]
Description
This command can be used to rearrange the sequence of streams in the
model.
Pipe-It Manual Page 172
Example
Given that Strexzel has loaded the following model:
executing
MOVE STREAMS 1 2 DOWN 2
will move the first two streams two rows down.
GUI
This command is available from the menu by selecting Streams/Move?
streams(s) from the menu. The command applies to one or more
selected streams in the stream window.
Pipe-It Manual Page 173
Move Variable
Syntax
MOVE VARI ABLE <var i abl e name> [ LEFT | RI GHT] <number of col umns>
MOVE VARI ABLE <var i abl e name> [ BEFORE | AFTER] <var i abl e name>
Description
The command will move a variable to a new position in the model.
Specifying "BEFORE" or "AFTER" can be used to move a variable to
another position, relative to another variable identified by the second
<variable name> argument. Specifying "LEFT" or "RIGHT" moves a
variable <number of col umns> in the specified direction. <number of col umns>
cannot be a number that would result in a move to a 0 or negative
index, or an index greater than the number of defined variables.
Example
Given that Strexzel has loaded a model containing two variables and
two components.
Executing
Pipe-It Manual Page 174
MOVE VARI ABLE a AFTER b
will result in the two variables changing places.
GUI
This command is available from the menu by selecting Variables/Move
variables(s) from the menu. The command applies to one or more
selected variables in the stream window.
Name Characterization
Syntax
NAME CHARACTERI ZATI ON <name>
Pipe-It Manual Page 175
Description
This command updates the characterization name in the model. (It
does not save the characterization). This name corresponds to the Char
name in a streamz file.
Example
Executing
NAME CHARACTERI ZATI ON myChr
and saving the model will result in the Char now containing the new
name
GUI
This command is available from the menu by selecting File/Name
Characterization from the menu.
Remove Columns
Syntax
REMOVE COLUMNS <i ndex1> [ i ndex2] . . . [ i ndex n]
Pipe-It Manual Page 176
Description
The command removes variables and or components by view index
(visual index, not model index).
Example
Given that Strexzel has defined the following model:
Executing
REMOVE COLUMNS 1 2 4
will remove the variables a and b, along with component c2
GUI
This command is available from the GUI by selecting one or more
column headers and then pressing the <DEL> (or equivalent) key.
Variable and Component columns can be selected at the same time.
Remove Component
Syntax
REMOVE COMPONENT NAMED <COMPONENT NAME> | <I NDEX>
Description
Removes a component based on name or its model index.
Example
Given that Strexzel has defined the following model:
Pipe-It Manual Page 177
Executing
REMOVE COMPONENT 2
will remove the c2 component.
GUI
This command is available from the menu by selecting
Component/Remove? component from the menu. It applies to a
selected component and does not present a separate GUI.
Remove Streams
Syntax
REMOVE STREAMS <r ownumber > [ r ownumber ] . . . [ r ownumber ]
Description
The command removes streams from the model.
Example
Given that Strexzel has defined the following model:
Pipe-It Manual Page 178
Executing
REMOVE STREAMS 1 3 5
will remove streams 1,3 & 5 from the model.
Remove Variable
Syntax
REMOVE VARI ABLE UNUSED | ALL
REMOVE VARI ABLE NAMED <var i abl e name>
Description
The command removes variables from the model. <ALL> specifies that all
variables should be removed. <UNUSED> specifies that variables that are
defined, but not used should be removed. <var i abl e name> specified that a
specific variable should be removed.
Example
Given that Strexzel has defined the following model:
Executing
Pipe-It Manual Page 179
REMOVE VARI ABLE ALL
will remove all the variables.
GUI
This command is available from the menu by selecting
Variables/Remove? variable(s) from the menu.
Save Characterization
Syntax
SAVE CHARACTERI ZATI ON <f i l ename>
Description
Saves a characterization file for the model.
The <filename> parameter can contain a file name, relative or absolute
path to a file name. The path syntax is different for MacOS (using
forward slash) and Windows (using back slash)
If a relative path is specified, this will be interpreted as relative to the
startup folder for the application.
Pipe-It Manual Page 180
Example
Given that Strexzel has loaded a model containing the components c1
& c2 with respective molecular weights of 10 and 20.
Executing
SAVE CHARACTERI ZATI ON myChar . chr
will save a characterization file with the following contents:
CHARACTERI ZATI ON " "
===================
COMPONENT MW
- - - - - - - - - - -
c1 20
c2 10
END; ( of char act er i zat i on)
GUI
This command is available from the menu by selecting File/Save?
Characterization from the menu. It presents a standard file save dialog
that enables the user to select a location for the characterization file.
Set Constant
Syntax
SET CONSTANT <NAME> <VALUE>
Description
Defines a constant that later can be referenced in mathematical
expressions or formulas.
Example
Executing
SET CONSTANT pi 3. 1415926
will make the constant pi available in expressions.
Pipe-It Manual Page 181
GUI
This command does not have any GUI equivalent.
Set Formula
Syntax
SET FORMULA <component name | var i abl e name> [ =] [ expr essi on]
Description
The command assigns a formula to a component or variable. An empty
<expression> will remove the current formula.
Predefined constants:
e - 2.718281828459045235360287
pi - 3.141592653589793238462643
Allowed operators:
+, -, *, /,
Logical: ==, !=, >, <, <=, >=, and, or, xor (case sensitive)
Bit manipulation: &, |, <<, >> (bitwise AND, OR, SHIFT LEFT, SHIFT
RIGHT)
String concatenation
if then else conditionals with lazy evaluation: ?:
Unit postfix operators:
Unit postfixes {n}, {mu}, {m}, {k}, {G}, {M} (nano, micro, milli, kilo,
giga, mega)
Defined numerical functions:
sin - sine function.
cos -cosine function.
Pipe-It Manual Page 182
tan - tangens function.
asin - arcus sine function.
acos - arcus cosine function.
atan - arcus tangens function.
sinh - hyperbolic sine function.
cosh - hyperbolic cosine function.
tanh - hyperbolic tangens function.
asinh - hyperbolic arcus sine function.
acosh - hyperbolic arcus cosine function.
atanh - hyperbolic arcus tangens function.
log2 - base 2 logarithm.
log10 - base 10 logarithm.
log - (log10).
ln - e base logarithm.
exp - e raised to the power of the argument.
sqrt - square root of the argument.
sign - returns -1 if the argument is less than zero, 1 if it is greater than
zero, otherwise zero.
round - rounds a number to the specified number of digits.
abs - absolute value.
rnd - takes two arguments (lower and upper bound) and returns a
pseudo random number in the range [lower bound, upper bound].
Random generator should bee initialized by running the SEED
command before using this function.
Functions with variable number of arguments. These functions can take
a variable range as argument or a comma separated list of arguments
(example: sum(var1:var5) will return the sum of the variables from
var1 to var5)
Pipe-It Manual Page 183
sum
min
max
avg
Defined string functions:
tostring
concat
substr
strlen
str2dbl
toupper
tolower
Comments:
Be very careful if using logical operators on the result of calulations
involving real as these calculations may lead to a loss of precision. This
is also the case when referring to typed variables using units. Unit
conversion may occur in the background and this can lead to a loss of
precision.
Expressions can be nested
Expressions can reference constants defined by the SET CONSTANT
command.
Ambiguities between variables and components can be resolved by
prefixing variables with "v::" and components with "c::"
Formulas are not persisted in stream files.
Formulas are evaluated and the model is updated in one pass. Updated
references does not trigger re-evaluation.
Referencing component or variable names that contain mathematical
operators, requires quotes around the name (Example: SET FORMULA a =
" C1+C2")
Pipe-It Manual Page 184
A weakness in the parser may lead to problems discriminating between
the string literal and quoted variable or component reference by the
same name.
IF Syntax Example
SET FORMULA r es = i f ( a >=1, 0, 3)
First argument is the condition, using logical operators, second is the
value that is assigned given that it evaluates to true, third is the value
assigned given that it evaluates to false). The expression is equivalent
to:
SET FORMULA r es = ( a >=1) ? 0 : 3
Nested if example:
SET FORMULA r es = i f ( a >=1, i f ( b==3, 2, 3) , 3)
Using combinations of logical operators inside if-statement:
SET FORMULA r es = i f ( ( a > 1) and ( b<3) , 1, 0)
String function
SET FORMULA r es = a / / b
concatenation
SET FORMULA r es = subst r ( a, 1, 1)
substring with zero based offset
SET FORMULA r es = st r 2dbl ( b)
convert from a string type (b)
to real (res)
Math expressions
SET FORMULA r es = 2*si n( var A) +10*cos( var B)
SET FORMULA r es = "c2+c3"/ 2
where "c2+c3" is a component name that has to be enclosed in quotes
because it contains an operator
SET FORMULA r es = v: : a+c: : a
Where name ambiguity requiring type prefix
SET FORMULA r es = r nd( - 5, 5)
Assigns random numbers in the interval [-5, 5] to the res column
Pipe-It Manual Page 185
GUI
This command is available from the GUI by selecting a column and then
typing in a formula in the formula edit window.
The formula bar accepts (and ignores) options = in front of the
formula.
Set Precision
Syntax
SET PRECI SI ON <pr eci si on>
Description
The command changes the models precision (defaults to 6)
Example
Given the model:
Executing SET PRECISION 2 changes the precision in the model
Pipe-It Manual Page 186
Saving this model results in the following stream file:
STREAMZ 1
Char ' '
Var i abl e b r eal
Var i abl e a r eal
DATA
a b Amount c1 Amount c2
1 10 1e+02 1e+03
2 20 2e+02 2e+03
3 30 3e+02 3e+03
4 40 4e+02 4e+03
5 50 5e+02 5e+03
GUI
This command is available by selecting Edit / Output precision from the
menu.
The user can select a lower view precision by selecting View/Precision?.
Here it is possible to select a different precision for viewing purposes.
This precision can not be higher than the output precision.
Pipe-It Manual Page 187
Seed
Syntax
SEED <seed val ue>
Description
Initializes the internal pseudo random generator with <seed value>
Example
SEED 42
GUI
This command is not available via the GUI.
Strexzel GUI
The Strexzel GUI has three main components. These are the stream
viewer window, the macro editor and the message window. Functions
for manipulating stream files are available via the GUI or as macro
commands. Most GUI actions have macro equivalents and will be
recorded in the macro window. Macros can then be edited and tested in
the macro editor before they are saved as macro (.stm) files.
Pipe-It Manual Page 188
Stream window
The stream displays the contents of stream files. Streams are
represented as rows and variables and components as columns. If the
stream file/model contains variables, these will be displayed to the left
of the component columns.
Streams can be filtered on columns by specifying a column in the filter
drop box and a selection criteria in the filter text box.
Pipe-It Manual Page 189
If Strexzel already has a loaded stream file, opening a new file by
clicking the toolbar button or selecting File/Open from the menu, will
open the file in a new instance of Strexzel.
Cells can be modified via Strexzel macros, manually, or data can be
copy/pasted to from the grid by selecting Copy/Paste from the Edit
menu or by using keyboard shortcut keys.
Pipe-It Manual Page 190
Actions can be undone/redone by selecting Edit/Undo/Redo from the
menu, or via keyboard shortcuts (<CTRL>+<Z> / <CTRL>+<Y>)
No changes are made to the stream file before the user selects
File/Save/SaveAs from the menu, or clicks the save icon on the toolbar
Macro window
The macro window can be made visible or hidden by selecting
View/Macro from the menu. User GUI actions are recorded as macros
and can be further edited in the macro window.
When a user types new text in the macro window, Strexzel will try to
match the text against known commands or variables/components. If
matches are found, Strexzel will display a droplist of matching
commands. Pressing <ENTER> completes a selection in this droplist.
Pipe-It Manual Page 191
Tip: When working with files containing long variable or component
names, double clicking on a column header will insert the name at the
current location in the macro window.
The macro window has it's own toolbar. This contains shortcuts for
loading/saving macro files and executing/debugging macros.
In edit mode, the macro editor behaves just like any other simple text
editor. If the user switches to debug mode, Strexzel will attempt to run
the macro. In this mode, the current command is identified by a yellow
background, already executed lines with a green background, and
failed lines with a red background. The user can execute the next line,
or backtrack using the arrow keys, or step, using the toolbar buttons.
Normal editing is allowed in debug mode, but the Strexzel will stop
execution on the first error. On encountering an error, a message will
be displayed in the message window. This message will give feedback
to the user regarding the error and also show an example of the correct
syntax for the failed command.
Pipe-It Manual Page 192
Message window
The message window can be made visible/hidden by selecting
View/Message from the menu. The window will display error and status
messages to the user. User actions that affect the state of the model
will result in a "processed ok" or error message in the message
window.
Formulas
Any column can be assigned a formula. This can be done by selecting
the column and typing in the formula in the formula edit box. Press
<ENTER> to activate the formula. The formula syntax is described in
the SET FORMULA documentation.
Formulas will be recorded as macros and can be persisted as macro
files, but are not saved in the stream file.
Menu/Toolbar
All GUI actions that are not view, or preference related have macro
equivalents, but not all macro commands have GUI equivalent. All
functions are described under Strexzel macros.
Pipe-It Manual Page 193
Strexzel interaction with Pipe-It.
Pipe-It has integrated Strexzel, which is really a separate application, in
two important ways.
The Strexzel Utility on Pipe-It Toolbar is the natural way to drop a
Strexzel instance on the Canvas. This has been discussed elsewhere:
Another useful interaction is when the user wants to load an str file and
a corresponding macro file together in a single graphical instance of
Strexzel. In such case the user selects the two resources on the Pipe-It
canvas and right-clicks to get an Open in Strexzel option:
Console mode / Command line arguments
This is the mode for running Strexzel inside a Pipe-It project. Output
that normally is presented in the message window is now written to the
Console and an optional log file.
The command line arguments are:
Argument Description
-i
Input stream file. If this is the only argument, Strexzel will
start in GUI mode and open the file
Pipe-It Manual Page 194
-o Output stream file
-m Macro file
-l Log file
-t Test/verification file
-c
Characterization file. This file is loaded after the stream file
and before any specified macro is executed.
-s SSQ file where the SSQ result(s) are written to.
Command line options:
Argument Description
- - edi t
Forces Strexzel to open in GUI mode. Useful for opening a
stream file and a corresponding macro file from the
command line
Unless - - edi t is specified, Strexzel will open the stream and macro file
(and optionally the characterization file), then execute the macro and
write the result to console out and optionally a log file. Strexzel will
return an exit code of 0 if the macro execution is successful, or a
positive number in case of an error.
Pipe-It Manual Page 195
Convertors
Convertors are a group of growing applications that help convert files
from a foreign format to the format used by Streamz.
Ecl2Str
Description
This convertor is designed to read the Eclipse Simulator
(Schlumberger) UNSMRY and SMSPEC files and the input DATA file to
create a corresponding Stream file based on certain options. It is the
main utility to get Eclipse production results into Pipe-It. It has existed
since 1999 and continuously improved to keep pace with the evolution
of Eclipse.
Command Line Arguments
Argument Description
-a Date to Phase-in model. Used to shift time variables.
-b Only use if input file is using different byte-order.
-c Characterization name.
-d ECLIPSE input .dat file.
-e Date to end output of results. Used to output part results.
-f
Reference date. Use to adjust time variables in multi-model
scenarios.
-g Gas injection present (non-use = OFF).
-k
Key grouping option, takes comma-separated list without
spaces.
-l Calculation level. [g, w, c].
-m
Path mapping definition file, tab-delimited, multiline, format:
old_path[tab]new_path[new line]old_path2[tab]new_path2
-o Output .str file (main output of this utiity).
-p
Input pvt file. For use in getting BO output from Comp runs.
Need to provide quivalent BO data file or pvt file containing
BOPVT data.
-r Restart date. Date to start output of results. Used to output
Pipe-It Manual Page 196
part results.
-s ECLIPSE Input UNSMRY file.
-t
Minimum time step. Skips times steps less than this (in
days.
-T Find and run tests (used with special Test Bench setup).
-v Error level output. -v [err | warn | info | debug].
-w Name of water component.
-x
Use settings from .psm file (for backward compatibility -
ignores all other cmd args).
-h Command line help.
A Scripter Assistant Utility is available on the toolbar for its easy usage:
Example
Pipe-It Manual Page 197
Pre Ecl
Description
PreEcl will read an Eclipse data and write to an Eclipse summary
include file. The purpose is to ensure that the Eclipse data set includes
request for writing out all necessary output vectors to the UNSMRY file
to enable Pipe-It to later convert it to stream file format. An include
file, specified by the -s argument below, is created containing the
keywords. A new DATA file, specified by the -o argument, is also
created containing an INCLUDE statement pointing to this include file.
Otherwise the content of the new DATA file is identical to the original
input DATA file.
Command Line Arguments
Argument Description
-d ECLIPSE Original Input (*.DATA) file.
-o ECLIPSE Updated Input (*.DATA) file with include keyword.
-s ECLIPSE Include (*.SUMMARY) file.
-l Calculation level. -l [g | w | c].
-m Path mapping definition file, tab-delimited, multiline, format.
-x
Use settings from .psm file (for backward compatibility -
ignores all other cmd args).
-T Find and run tests (used with special Test Bench setup).
-v Error level output. -v [err | warn | info | debug].
Pipe-It Manual Page 198
-h Command line help.
If the data file contains a BLACKOIL keyword it will proceed to add the
following set of keywords (depending on the calculation level) to the
summary include file:
Keyword Descriptione Calculation level
FOPR Field oil production rate f
FGPR Field gas production rate f
FOPT Field oil production total f
FGPT Field gas production total f
FOPRS Field solution oil production rate f
FGPRS Field solution gas production rate f
FOPTS Field solution oil production total f
FGPTS Field solution gas production total f
FPR Field pressure f
FWPR Field water production rates f
GOPR Group oil production rate f, g
GGPR Group gas production rate f, g
GOPT Group oil production total f, g
GGPT Group gas production total f, g
GOPRS Group solution oil production rate f, g
GGPRS Group solution gas production rate f, g
GOPTS Group solution oil production total f, g
GGPTS Group solution gas production total f, g
GWPR Group water production rate f, g
WOPR Well oil production rate f, g, w
WGPR Well gas production rate f, g, w
WOPT Well oil production total f, g, w
WGPT Well gas production total f, g, w
WOPRS Well solution oil production rate f, g, w
Pipe-It Manual Page 199
WGPRS Well solution gas production rate f, g, w
WOPTS Well solution oil production total f, g, w
WGPTS Well solution gas production total f, g, w
WBHP Well BHP pressure f, g, w
WWPR Well water production rate f, g, w
WGIR Well gas injection rate f, g, w, i
WWIR Well water production rate f, g, w, i
COFR Connection oil flow rate f, g, w, i, c
CGFR Connection gas flow rate f, g, w, i, c
COFRS Connection free oil flow rate f, g, w, i, c
CGFRS Connection free gas flow rate f, g, w, i, c
BPR Block pressure f, g, w, i, c
CWFR Connection water flow rate f, g, w, i, c
If the BLACKOIL keyword is not encountered, it will add the following
set of keyword (depending on the calculation level) :
FOPR Field oil production rate f
FGPR Field gas production rate f
FOPT Field oil production total f
FGPT Field gas production total f
FZMF Field stream mole fraction f
FXMF Field liquid mole fraction f
FYMF Field vapour mole fraction f
FHMPR Field hydrocarbon molar production rate f
FPR Field pressure f
FWPR Field water production rate f
GOPR Group oil production rate f, g
GGPR Group gas production rate f, g
GOPT Group oil production total f, g
GGPT Group gas production total f, g
Pipe-It Manual Page 200
GZMF Group stream mole fraction f, g
GXMF Group liquid mole fraction f, g
GYMF Group vapour mole fraction f, g
GHMPR Group hydrocarbon molar production rate f, g
GWPR Group water production rate f, g
WOPR Well oil production rate f, g, w
WGPR Well gas production rate f, g, w
WOPT Well oil production total f, g, w
WGPT Well gas production total f, g, w
WZMF Well stream mole fraction f, g, w
WXMF Well liquid mole fraction f, g, w
WYMF Well vapour mole fraction f, g, w
WHMPR Well hydrocarbon molar production rate f, g, w
WBHP Well bottom hole pressure f, g, w
WWPR Well water production rate f, g, w
CCFR Connection component flow rate f, g, w, c
BPR Block pressure f, g, w, c
COPR Connection oil production rate f, g, w, c
CGPR Connection gas production rate f, g, w, c
CWPR Connection water production rate f, g, w, c
The converter updates the output file (from -o) with an include
statement for the summary file (from -s). It finally traverses the group
tree structure and writes keywords for the corresponding level back to
the summary file.
A Scripter Assistant Utility is available on the toolbar for its easy usage:
Pipe-It Manual Page 201
Example
Comments
Pre_Ecl and Ecl2Str use a common library for parsing Eclipse files. This
parser will only recognize keywords that are relevant for converting
data to Streamz files. The parser scans the input in a line by line
manner and ignores comments and unrecognized keywords. This can
potentially have side effects if a recognized keyword is also a
parameter for an unrecognized keyword. When used from Pre_Ecl, the
eclipse parser will read and attempt to parse the following keywords:
Section Recognized keywords
RUNSPEC FIELD, METRIC, LAB, DIMENS, LGR, TABDIMS, COMPS,
Pipe-It Manual Page 202
BLACKOIL, WELLDIMS, SMRYDIMS, STRT
SCHEDULE
SOLUTION, END, OUTSOL, RPTSOL, RESTART, TSTEP,
DATES, WLIST, WEFAC, GEFAC, [WELSPECS | WELLSPEC |
WELSPECL], [COMPDAT | COMPDATL | COMPDATM],
GRUPTREE
If Pre_Ecl is unable to interpret data associated with required fields, it
will generate an error to the console and exit. The eclipse parser can in
some cases define default values for omitted data. In these cases, the
parser will log this to the console.
Sen2Str
Description
Sen2Str is similar to Ecl2Str in that both read production data from
binary files of reservoir simulators. Sen2Str does this task for the
SENSOR (Coats Engineering) simulator. Two modes are available, one
for the fort.74 binary file and the other for the fort.61 binary file.
fort.74 Command Line Arguments
Argument Description
-b Only use if fort.74 file is big endian.
-c Characterization name.
-d Sensor input .dat file.
-g Gas injection present (non-use = OFF).
-o Sensor out file (used for reading PVT data).
-p Sensor fort.74 file (needs PSM keyword in Sensor .dat file).
-r Restart day (used to specify start of T2 in STR file).
-s Output .str file (main output of this utiity).
-T Find and run tests (used with special Test Bench setup).
-x
Use settings from .psm file (for backward compatibility -
ignores all other cmd args).
-h Command line help.
Pipe-It Manual Page 203
fort.61 Command Line Options
--well Export well records.
--platform Export platform records.
--region Export region records.
--
superregion
Export superregion records.
--field Export field records.
--tracer
Export tracer section from Fort.61. Each combination of
cptname and name are exported as a separate file. The
filename is prefixed "tracer_".
--bigendian
fort.61 Command Line Arguments
Argument Description
-p Sensor fort.61 file.
-s Output .str file (main output of this utiity).
-r Restart day (used to specify start of T2 in STR file).
A Scripter Assistant Utility is available on the toolbar for its easy usage
of either mode:
Pipe-It Manual Page 204
Example
SENSOR based Pipe-It project where the normal mode (Fort.74) and
fort.61 mode is used. The corresponding Scripts are shown below.
Pipe-It Manual Page 205
Pipe-It Manual Page 206
Script Assistant
Script Assistant is an application for creating predefined Program
shortcuts. A suite of scripts is supplied by Petrostreamz, and available
in the toolbar. The scripts will set up the Program Script automatically,
by defining sockets and a Graphical User Interface (GUI) for selecting
switches and options.
Overview
Table of Contents
Overview
Workflow
Detailed Description
Reference Documentation
Examples
Scripts supplied by Petrostreamz or created by the user are available in
Pipe-It's toolbar?.
Novice and expert user of Pipe-It will utilize these scripts to quickly use
custom Processes for often used programs. The Script Assistant
facilitates creation of new scripts and modification of existing scripts
through a GUI?.
Using Scripts
If you are new to Pipe-It, you might only have Petrostreamz Scripts
available in your toolbar. This section will show you how to use one of
those scripts in your project.
Select the Strexzel icon and drag the script to the Canvas?.
Pipe-It Manual Page 207
Connect? the desired resources to the created script. Sockets? is
automatically available through the script, which ensures that the
command line is correctly created.
Creating Scripts
This section will demonstrate how to create a simple script. We chose
to create a script which will launch the software PhazeComp, an
equation-of-state program for compositional phase behavior modeling
and fluid characterization.
Open Script Assistant and press the 'New' toolbar button.
Name the script PhazeComp, press save, and double click the new
script in the Global Scripts list.
PhazeComps command line is expected to look like: "PhazeComp
[inputfile] [outputfile]". Start by setting up the executable.
This assumes that the PhazeComp is in your operating systems
command path. If this is not the case, refer to your operating systems
manual, or add the complete path your executable file. Adding the
complete path might make it harder to share the project with others,
as they might not have the executable located in the same directory,
adding often used applications to the environment path is
recommended.
Pipe-It Manual Page 208
Click the icon button to add an icon.
PhazeComp does not accept any command line options, so we can skip
the Options list.
Add a new reference by clicking the add reference button. Populate the
dialog as follows:
Add another reference named "PhazeComp output file (*.*)", similar as
step 6, except you chose output socket instead.
To allow the user of the script to connect resources which does not go
to the command line, but established dependencies, add two more
sockets - one input and one output both with the "Goes To Command
Line" option unchecked. Name them "Other Input Dependencies" and
Pipe-It Manual Page 209
"Other Output Dependencies". Your reference list should now look lie
this:
Exceptions - Warnings/errorr. Script Assistant also allows you to add
the syntax specifications of the programs warnings and error
messages. Doing this will allow Pipe-It to catch errors and warnings,
and organize them in the console window.? Exceptions are identified by
a name, type, description and search pattern (regular expression). To
learn more about regular you can read more about it here. Phazecomp
outputs Errors, Warnings and Fatal Errors which can be caught be the
regular expression:
8. ^\ \ #{6}\ \ s+ERROR\ \ : \ \ s+( . *) \ \ #{6}
Add all 6 regular expressions illustrated underneath:
Press "Save Script" and PhazeComp is now available in the toolbar from
Pipe-It.
Modifying Scripts
Modification of scripts is initiated from the Script Assistant's main
window. This example will demonstrate how to modify the script we
created earlier by adding another socket where the user is supposed to
connect include files.
Find the script you created in the Global Script List, and double click it.
Pipe-It Manual Page 210
Add another file reference named "Include Files", which does not go to
the command line.
Workflow
Using Script Assistant is an opportunity to personalize Pipe-It, integrate
your favorite programs and applications as a part of Pipe-It. An
advanced user of Pipe-It will be able to recognize frequently repeated
creations of specific Programs and create a script instead. There is
several possible workflows, but here is one suggestion on how to go
about creating good scripts:
Create the script, give it a file name and a script name.
Find or create an icon. The image should be square, and scale well to
16x16 pixels.
Investigate which command line arguments your program accepts.
Asses if they all are useful, if there's too many it might get confusing.
Divide the program's arguments you wish to include into references
and options.
Set up the references one by one.
Set up the options one by one. Preview the results to make sure it is
intuitive to use.
If the program has a fixed syntax of the error output, set them up in
the exception tab.
Pipe-It Manual Page 211
Detailed Description
Script Assistant GUI
The Script Assistant GUI has three main windows. The Script Window
for managing and creating new scripts. The Edit Dialog for editing
individual scripts, and the Argument Dialog for editing a scripts
arguments.
Script Window
The Script Assistants main window is designed for
Creating new scripts
Editing existing scripts.
Deleting Scripts
Organizing your scripts.
The menu bar
The menu consist of the File and Edit menu.
Pipe-It Manual Page 212
File Menu
New creates a new script
Save saves the current structure settings
Exit exits script assistant
Edit Menu
Create a new Script
Open an existing Script
Save Settings
Edit highlighted script
Delete highlighted script
Scripts tab
Structure tab
Global scripts list
Script names
Script file location
Project scripts list. Will only show up if opened with an active project.
Edit Dialog
The Script Assistants edit window is designed for creating and
organizing a scripts arguments, warnings and error log output.
Creating new arguments for a script.
Deleting arguments for a script.
Organizing your arguments.
Defining warnings and error regular expressions.
Pipe-It Manual Page 213
Preview scripts.
Script Name The scripts name, which will be used to identify the
Script in Pipe-It and Script Assistant.
Icon Button Used to set the Scripts Icon.
Executable The name of the executable you wish the script to
execute. You can use the browse button to locate it, but be wary of
absolute path if you plan to share the project.
Options A list of of different options to be presented to the user. The
list displays the options name, type and values. Editing of options is
done via the Option Dialog. Options can be added, removed, or moved
by using the buttons underneath the option list. A preview of how the
script will appear in Pipe-It can be viewed by pressing the Preview
button, which will open the Preview Dialog.
References A list of file references. Each reference represent one
socket, and has a name, type, and reference text. The reference text is
translated to a file path based on options selected in the reference
dialog. The reference dialog is accessed by double clicking a reference.
Option Dialog
Types:
Pipe-It Manual Page 214
Integer
Floating Point
List
Check Box
Date
String
Reference Dialog
The Script Assistants Reference dialog is designed for editing a scripts
file references.
The GUI
Reference Name: Edit the reference name.
Goes To Command Line: Check if the file should go to the command
line or not. A typical usage for a file reference which does not go to the
command line is when the connection is supposed to be used for
establishing dependencies.
Allow Multiple Connections: Check if more than the first connector
connection to the socket should go to the command line or not.
Socket Type: Specifies whether the socket is an input or output
socket.
Minimum Matches for Execution: Sets the minimum required
connections to the socket to make the program execute.
Bounding Text: Sets the reference's bounding text. It is often used to
add quotes and arguments.
Substitution: Relative File Path or full file path. Example: Use
C:\Projects\SPE3\model\model.dat or \model.dat, relative to the
current working directory.
Exclude File Extension: Check to exclude file exenstion. Example:
File = model.dat results in model if checked.
Parent Directory Only: Reference the parent directory instead of the
file. Example: C:\Projects\SPE3\model\model.dat results in
C:\Projects\SPE3\model
Pipe-It Manual Page 215
Current Reference: Displays the current reference based on the
current selections in the dialog.
Preview Dialog
Exception Tab
Petrostreamz Scripts
Pipe-It Applications
Pipe-Itc
Pipe-Itc is the command line version of Pipe-It and is often used to call
external Pipe-it projects.
Streamz
Streamz is a unique program for comprehensive petroleum fluid
management. It requires a Streamz driver file as input, and produces a
Streamz log file as output.
Strexzel
Strexzel is a Petrostreamz developed program for editing Stream files.
The script will usually launch Strexzel in macro mode.
Pipe-It Manual Page 216
Input Sockets:
Socket Socket Name Description
1
Macro file
(*.STM) File
Specifies the macro file which will be executed
on launch
2
Input StreamFile
(*.STR)
Input stream file. If this is the only argument,
Strexzel will start in GUI mode and open the
file
Output Sockets:
Socket Socket Name Description
1 Output StreamFile (*.STR) Output stream file
2 Output SSQ File (*.SSQ) Sum of Squares File
3 Output LOG file (*.LOG) Log File
Options:
Strexzel does not have any options.
Pre_Ecl
Pre_Ecl prepares an Eclipse data file, before it is run, to output results
needed by Pipe-It.
Convertors
Convertors translates files with a specific format to a Stream file.
Pipe-It Manual Page 217
Ecl2Str
Ecl2Str converts Eclipse output to stream file format.
Sen2Str
Sen2Str converts SENSOR output to stream file format.
txt2Str
txt2Str converts a general tabular text file to stream file format.
Reference Documentation
Examples
When a script is used in a project, the customized Program is set up. It
provides a GUI for setting switches, and sockets for connecting
resources.
Pipe-It Manual Page 218
Scripts are stored in three locations.
[Pipe-It Installation Directory]\Utilities Scripts supplied by
Petrostreamz. These will be overwritten every time you update Pipe-It.
[Application Data Folder]\Petrostreamz\utilities\ Your users scripts,
available in all projects for the current computers user. These will take
precedence over Petrostreamz utilities if duplicate script names are
found.
[Current Project Folder]\Utilities\ Project utilities, available in the
current open project. Each time you save a project which uses scripts,
all utilities used will be saved in this folder. These scripts will take
precedence over all other utilities if duplcicates are found.
Pipe-It Manual Page 219
Plotz
Plotz is a standalone program packaged with Pipe-It to plot the
important result or data that the user might be interested in viewing
graphically. It has special automated handling of stream file that may
contain hundreds of thousands of streams for plotting. Additionally it
supports automated plotting of history data in Optimizer ppo files.
Plotz can also plot data from other sources. Tabular data from any plot
files are plotted very easily by naming and specifying columns via an
interface that closely resembles Linkz.
Automated Plotting of Stream files (.str)
Plotz had been tightly integrated into Pipe-It by means of right-click
menu of Resources:
This generates a basic Plot in no time
Pipe-It Manual Page 220
This only works for Stream file Resources. In many cases this auto
generated plot may be serve the purpose sufficiently well (just to view
the development of the component against time).
However if the user needs to adjust the x- and y- data and split the
plot into multiple charts, adjust the plotted series properties etc. for
this particular file, he/she can customize to heart|s content and save
the result to a *.plotz file.
Pipe-It Manual Page 221
These files are xml files containing all information to recreate the plot.
They can contain the references to the files used and data used from
those files. Once such files are created, they can be dragged onto the
Canvas as Resources. A Plotz Process should be also placed and and
the Plotz Resource connected to it. For Dependencies sake (to ensure
the Plotz process is re-run) STR Resource used in the Plotz instance
should also be connected.
When the project is run, the Plotz process will run after the STR
Resource is updated and a graphical instance of Plotz, with the updated
data and the customized properties of the Plot will be shown.
If the purpose of the plot is to save the results for a report, Plotz has
an output file argument (using the -o before the file name) to direct the
result to a pdf, png or jpg file without bringing up the graphical
interface:
Pipe-It Manual Page 222
If multiple Resources are selected before the right-click, Plotz will try to
set up a Comparison Plot where it matches common individual
components present in both files and setting up a chart for each.
Again the plot may be customized and saved if needed. In this example
both axis are changed from Linear to Logarithmic due to the nature of
the data. Observed data for gas rates are being compared against
model data in Pipe-It unique Liquid Rich Shale Templates History
Matching module.
Pipe-It Manual Page 223
Plotz GUI
Plotz interface is divided into:
Charts area: Rendering of the chart occurs here. New charts can be
added by using the + buttons in the left corner of this area. Charts can
be moved to left or right using the arrow buttons on the right corner of
this area.
Pipe-It Manual Page 224
Properties Panel: Properties Panel may or may not be visible at any
moment. To make it visible use the Window/Show Properties Panel
menu item. To close this panel use the small cross on the top right
corner. This is subdivided into:
Source Data area: Use the + button to browse for files that contain
source data to be plotted. STR & PPO files load directly while other
types of files need a Linkz style user assistance (discussed later). Each
data container is shown under each file in a tree like manner.
Plotted Series area: Data containers from the above may be dragged
and dropped onto the X or Y columns of this area to immediately plot
them in the current chart. Double-clicking into an entry here brings the
Display properties tab for that item and allows one to customize the
appearance.
Manage Axes area: This allows adding new X- or Y- axes for the
current chart in focus.
Help
Normal the working in Plotz are straightforward but may need some
practice to get used to. All the properties of all the items can be
customized.
From the Help menu item one can get access to a summary of Plotz
options:
Pipe-It Manual Page 225
Using templates
Templates are .plotz files that contain customizations of the different
items of a plot. Usually the data sources and the plotted series are
removed before saving a Plot as a template.
A colorful template may be saved:
When making a default plot (e.g. using the right-click method to Plot a
Stream File) may result in a plot like:
Now using a template by specifying on the command line:
Pipe-It Manual Page 226
Will yield a customized plot automatically:
Using the command-line
Once a desired plot is set up, the command line mode is the most
common usage of Plotz with Pipe-It. Many time Plotz will be used as
quality check points. In such cases the Input Plotz file will be used with
all input STR files to launch Plotz in a graphical instance, as part of a
complete Pipe-It project execution. The engineer can visually inspect
Pipe-It Manual Page 227
the plots and close the Plotz program to let the remaining project
execute. If the engineer finds inconsistent results, the project execution
can be stopped at that point. Hence it will not be necessary to wait for
the completion of the complete project to QC the results. Multiple Plotz
instances may be set up in this way to QC different key points in a
complicated project.
A plot involving optimization should not be set up in this way since the
iterations will require unnecessary user intervention (to close the Plotz
windows).
Another usage of the command line mode is to automatically obtain
PDF, png or jpg output of the important plots in a project
automatically. This can even be combined with an Optimizer run (Case
Matrix for example) and an slick file zipping, copying and renaming
processes, to obtain thousands of quality plots automatically.
To facilitate the use of these mode of operations Pipe-It include a Plotz
Utility made using the Script Assistant:
It has pre-configured Plotz command line and sockets for easy use of
Plotz command line mode.
Pipe-It Manual Page 228
This can be dropped on the Canvas, connected to the Resources and
run very easily. The command line adapts to the particular usage:
Graphical Interface and Functionality
Creating a new plot
A new plot is automatically created when the Plotz is opened and it is
ready for use straight away. Additionally, if your work needs to be
cleared then you can start it all over by using a menu option File ->
New. Bear in mind that if you have some unsaved work in the current
plot you will be offered to save it. In addition, when you quit the
application your current plot size and position settings will be saved so
opening it for next time returns you to the previous state.
Saving a plot
To save your current plot, there are two options available for that: File
-> Save or
File -> Save as. In case of the File -> Save option, if your plot is
new and you have not saved it yet then you will be asked for a file
where to save the plot, otherwise if you opened the plot from a saved
one or have it saved already, then the current plot file will be silently
overwritten. In addition, if you have not changed your Title items
Pipe-It Manual Page 229
name then upon saving it will be set to the filename (without the
extension) else it remains untouched. It is commonly recommended to
save your plot in time to prevent data loss due to some unforeseen
consequences.
Opening a plot file
Plot files are opened from a File -> Open menu option. However there
are several requirements for plot files and data files. If you have saved
a plot file and there is a series opened in the plot file. Be sure that the
series file in the same relative path as when you made the save as
otherwise your plot file will be opened and the series are marked as
inexistent (you will be able to set the series file to proper one after
you have opened the plot).
If you have saved one of plot files recently and about to open it again,
there is a fastest way of reaching it, just use the File -> Open Recent.
Recently opened plots are automatically appear there.
If you have opened a file, made some changes there and about to
return to the initial state, its fairly easy to do, just use File -> Revert
to Saved option.
Export
You can export your current plot to the document .pdf format as well as
image formats, such as .jpeg, .png, .gif.
You can either export the whole plot to the desired format or just the
current chart.
File -> Export exports the whole plot.
File -> Export Chart exports only current chart.
Pipe-It Manual Page 230
Items
The whole plot scene is a set of items. You can interact with those
items, such as select, change properties, add, remove, etc. Some of
items are dynamically added and removed, such as Axes and Datasets.
There are two non-removable (core) items: Background and Area.
All items are selectable and have properties that can be changed in the
Properties panel (see below).
All items are selectable, just point over the item and press the left
mouse button. You will see the selection being drawn around the items
border.
Pipe-It Manual Page 231
Pipe-It Manual Page 232
Appendix
Pipe-It Manual Page 233
Pipe-It Manual Page 234
Streamz Tabulation Reference
TABUl at e [ ( var 1| dom1) uni t s [ AND ( var 2| dom2) uni t s . . . ] ] [ I F f l t r ]
[ FROM i nf i l e1 [ AND i nf i l e2 . . . ] ] [ TO out f i l e1 [ AND out f i l e2
. . . ] ]
[ WEI GHt [ OVER| PER| BY] ( var 4| dom4) uni t s [ AND ( var 5| dom5) uni t s
. . . ] ]
[ OVER ( var 6| dom6) uni t s [ AND ( var 7| dom7) uni t s . . . ] ]
[ PER ( var 8| dom8) uni t s [ AND ( var 9| dom9) uni t s . . . ] ]
[ DI SPl ay ( var 10| dom10) uni t s [ AND ( var 11| dom11) uni t s . . . ] ]
[ ( COLLATe| ORDER*| ACCRUe) [ dom12 uni t s [ val 1 [ val 2 . . . ]
[ STEP uni t s st ep1 [ st ep2 . . . ] ] ] ] ]
PER and WEIGHt PER are new options that apply to the COPY,
COMBine, TOTAL, TABUlate, PROCess, and REALLOCate commands.
PER is very similar to OVER, except for when it gets applied. For output
streams that are created from just a single input stream (as is always
the case with the COPY, PROCess, and REALLOCate commands), PER
and OVER give identical results. When an output stream is composed of
several constituent streams, however (as can be the case with the
COMBine, TOTAL, or TABUlate commands), the effects might be
different (although not necessarily). OVER is applied once for each
constituent stream (you can remember this as "over and over"),
whereas PER is applied just once "per" output stream. Generally, OVER
will give you an average constituent rate of some sort, whereas PER
will give you a combined average rate, which might be different.
Detailed explanations, along with the actual formulas, are given in the
associated document "Weighting.pdf". DISPlay (alias SHOW*) is
another new option for the TABUlate command. It can be used to
display the output values of variables other than those tabulated and
collated. Variables that are simply DISPlayed will have no effect on how
the tabulations or collations are performed. They will just be output
whenever they can be determined unambiguously. Specifically, an
ordinary variable will be shown whenever its value is the same for all
constituents of an output stream, while domain variables will be
adjusted to show the encompassing domains for each output stream.
The most powerful new feature, though, is the COLLATe (alias
GATHER*) option and the related options ORDER* (alias REORDER*)
and ACCRUe (alias INTEGRAte). As you can see, each one of these
options has several options of its own. Some examples:
COLLATE
COLLATE time days
COLLATE time years 0 1 2 3 4 5 d.
COLLATE time months 0 1 2 3 STEP months 3*3 4*6 2*12
Pipe-It Manual Page 235
Explanations:
Collate all of the streams for which the tabulated variables match.
Same as (a), but also track and output the overall range of a domain.
Same as (a), but divide the collated streams into two or more domain
ranges specified by explicit collation points.
Same as (c), but allow one or more collation points to be specified
explicitly, with the remainder specified by a list of interval steps.
Let's assume "TABULATE WELL" is the primary command and that your
input files include streams from 10 unique wells (satisfying any
specified filter). Here are the results you'd get from the above options:
Ten total output streams (one for each well), where each stream would
contain the name of the well and the sum of all the input stream
amounts associated with the corresponding well. That sum could also
be WEIGHted to convert rates to cumulatives, OVERed or PERed to
convert cumulatives to average rates, or WEIGHted OVER or WEIGHted
PER to convert rates to average rates.
Same as (a), except the total time range for each well (in days) would
also be shown for each output stream.
As many as 70 total output streams (up to 7 for each well). For each
well, you would get the cumulative or average amounts (depending on
the WEIGHt, OVER and PER options) for time ranges that might include
(but only if non-empty): minimum to 0 years, 0-1 years, 1-2 years, 2-3
years, 3-4 years, 4-5 years, and 5 to maximum years.
As many as 140 total output streams (up to 14 for each well). For each
well, you would get the cumulative or average amounts (depending on
the WEIGHt, OVER and PER options) for time ranges that might include
(but only if non-empty): minimum to 0 months, 0-1 months, 1-2
months, 2-3 months, 3-6 months, 6-9 months, 9-12 months, 12-18
months, 18-24 months, 24-30 months, 30-36 months, 36-48 months,
48-60 months, and 60 to maximum months.
Now let's assume that "TABULATE WELL AND TIME (MONTHS)" is the
primary command. The results of cases (b), (c), and (d) remain
essentially the same, except the times will always be output by
months, regardless of the units given for the collation points. Case (a)
will behave quite differently, however. It will now collate all the streams
that have unique combinations of WELL, starting TIME, and ending
TIME. That could be any number of streams (as few as 10 or as many
as the total number of input streams).
Pipe-It Manual Page 236
As you can see, you'll have a lot of flexibility at your disposal. As for
the specific question about reporting cumulative molar productions,
let's assume that you simply want monthly cumulatives for each well
over a 10-year period (for example). If your input streams are already
in terms of cumulatives, you would say:
TABULATE WELL, COLLATE TIME MONTH 0, STEP MONTHS 120*1
On the other hand, if your input streams are in terms of daily rates,
you would simply add "WEIGHT TIME DAYS" to the above command.
Then, if you decided you wanted average daily rates for each well over
those monthly time periods, you would just add "OVER TIME DAYS" or
(more likely) "PER TIME DAYS" to the previous command, depending
on how your input data were arranged and the type of average you
wanted (see Weighting.pdf for more information).
If you replace the COLLATe keyword with ORDER* (leaving all other
input the same), the output streams will be sorted according to the
following criteria:
Highest priority: Output stream units (in case your conversions lead
to differences). Amounts will come first, then Volumes, Moles, and
finally Masses.
Next priorities: Tabulated variables (except those belonging to the
ORDERed domain, if any). Priority will be assigned in the order the
variables (or domains) were specified by the TABUlate command (with
lower domain variables taking priority over their upper counterparts).
The variables will be sorted into ascending order (numerically or
alphabetically), with undefined variables coming last.
Final priority: The ORDERed domain, which will be sorted into
ascending order.
DISPlayed variables will have no effect on the sorting.
The final option uses the keyword ACCRUe. If you use this in place of
the ORDER* keyword, each set of ordered results (having the same
tabulated variables aside from the ordered domain) will be further
combined into running totals before being output. All of the other
previous rules for the ORDER option (as well as for the WEIGHT, OVER
and PER options) still apply.
Pipe-It Manual Page 237
Terminology
Unsure about what we mean? Need a one line definition of a term used
on the website? What is a Resource? A Process?
This is the place you want to bookmark. A collection of all technical
terms in the context of Pipe-It. Even Pipe-It is defined here! Use the
search function to search for the term.
TERM EXPLANATION
Annotations Text boxes that have no bearing on the execution of a
project. They are useful in providing titles and notes to
the user of the project.
App2Str Format translators from 3rd party applications to Pipe-
It/Streamz stream file (*.str) format. Ecl2Str(from
Eclipse
TM
) and Sen2Str(from Sensor
TM
) are shipped
with Pipe-It. Large scale usage of Pipe-It with other
programs are likely to result in newer App2Str utilities.
Canvas The graphical playing field displayed by Pipe-It. It is,
by default, gray in color with an image of the Pipe-It
logo in the background. There always exists the main
top level canvas, but the user may create multiple
cascading composites, each having their own
canvases.
Characterization A flexible collection of components, and optionally
their properties, that may be used to represent
streams in stream files. Quantities of each component
(of the characterization) are stored as values in
stream files. Quantities may be in mass, moles,
volumes, or a generic amount. Usually defined in
simple text files that are imported into Pipe-It Streamz
Library prior to use.
Composite A brownish rectangle with round corners and double
lines. Used to group logically related base elements
(Resources, Processes or other Composites). Used to
define the extent of execution of a part of a project.
Connectors An elbowed (or straight) line with an arrow-head
defining a connection between Resources and
Processes. Connections transcending composites go
via sockets but can always be tracked back to the
originating Resource or Process.
Pipe-It Manual Page 238
Conversion A translation of streams from one characterization to
another. A Streamz conversion method is defined in
a simple file and imported into the Streamz Library,
automatically connecting to pre-existing in-out
characterization pairs. In case of ambiguity user
assistance is need. Once in the library, their usage is
mostly automatic.
Linkz The Pipe-It proprietary technology that allows the user
to pin-point numbers in text (and Excel) files and
denote them as variables of the Pipe-It project. An
intuitive and robust fingerprinting method is used
customized by the user to uniquely define the location
of the number with respect to surrounding tokens.
These numbers can then be read and written by Pipe-
It. Repeatedly and without regard to their original line
in the file. Columns/Rows? and whole matrices are
supported. Text tokens too.
Map Linkz The customized Pipe-It process that manages mapping
of Linkz variables from one resource to another (read
one file to another). Enables quick and easy way to
pass results of one application as input to another.
Optimizer Pipe-It supervisor that can control multiple launches
of the underlying Pipe-It model. Works with Linkz
variables to cause values to written (VAR and AUX) to
files before the launch of the model, or cause the
values to be read (AUX, OBJ and KPI) after the
completion of the model run. Can launch multiple
user-specified (Case Matrix) or automated (Solver
Driven) executions of the underlying model. The
underlying model may be the full project or parts of it
(Composites).
Petrostreamz Is the Trondheim, Norway based company that
develops and sells Pipe-It. It also offers consultancy
and training related to Pipe-It.
Pipe-It Is the software application developed and sold by
Petrostreamz AS. Conceptually it allows piping
together the various computational models used in a
value chain, or workflow, into an integrated &
automated project. Once integrated and automated, it
allows the user to optimize on any key result
computed by the integrated poject.
Pipe-It model Strictly the model part of a Pipe-It project. The Pipe-It
Project Model (ppm) file is the main entry point for
Pipe-It Manual Page 239
Pipe-Its Runner and is only needed to execute a
project. For typical usage of Pipe-It, the term model is
interchangeably used with the term project.
Pipe-It project A collection of files that represent all the graphical
(*.ppv) and logical (*.ppm) parts of a Pipe-It data-set.
The Pipe-It Project View (ppv) file is the main entry
point into Pipe-It and is the point of interaction for the
user. Ppv files are associated with Pipe-It upon
installation and double-clicking a projects ppv file
loads it into Pipe-It.
Pipe-Itc The command line version of Pipe-It, enabling Pipe-It
to be called from any 3rd party application that can
launch applications. Since Pipe-It is such an
application, Pipe-It can call Pipe-It itself!
Plotz The visualization tool of Pipe-It. Runs as any 3rd party
application. Can make 2-d plots of any tabulated data
in text or Excel files. Can easily mix-n-match. Special
handling of stream files allows users to be up-and-
running with most frequent of Resources. Command
line usage allows dump of scores created plots as PDF
(or image) files ready for reports or presentations.
Process A greenish oval. Represents a launch of an application
(program, script etc.) from within Pipe-It. Can only
connect to Resources on input/output, never directly
to another Process.
Resource A pale-bluish rectangle with round corners. Can be
dropped from the toolbar using an icon of the same
appearance. Represents a file on the disk. If no file is
specified, it will report a broken status to the Runner.
Runner Often called the brain of Pipe-It, it is the hidden
entity that come into play when the user hits the Run
(or Play) button on the Pipe-It toolbar. It analyses the
myriad of interconnected Pipe-It Resources, Processes
and Composites and determines the most efficient way
of launching the entire project. All dependencies are
worked out and possibilities of parallel / sequential
executions considered. It sets up the queue of
resources & applications to be run, causing the
dependent applications to be waiting for the
completion of upstream portions of the project.
Sockets Connection ports that drive the connectors in and out
of composites. Also the connections points on
Pipe-It Manual Page 240
Resources and Processes. Single Input and Output
sockets pre-exists on each such graphical element,
more of each type can be added and renamed by the
user.
Solver A Pipe-It supplied or user plugged-in algorithm to
control the multiple launches of Pipe-It from the
Optimizer automatically driving the currently selected
OBJ (Objective) to a maximum, minimum or first-
feasible value. User specified bounds of all variables
(VAR/AUX/KPI) will be honored during the
optimization.
Stream files Tab-delimited text files following rules of Streamz.
Contain a header section followed by stream data that
can easily run into millions of streams. Each line is a
single stream. Each stream contains optional tags of
variables followed by quantity of all components
making up the stream.
Streamz 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.
Streamz Copier Copies of all streams from all incoming stream files to
all connected output stream files. Unless filters are
invoked. Automatically performs characterization
conversions if needed.
Streamz Generic 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.
Streamz
Processes
These are a collection of automated ready-to-run
Streamz tasks embedded into Pipe-It to get the user
up-and-running with streams management.
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.
Strexzel Stream file editor allowing manipulation of existing
Streamz variables and/or components, including
Pipe-It Manual Page 241
mathematical manipulations. All such actions are
recorded in Macros that can be used on command-line
mode in Pipe-It with no user interference. Sum of
Squares of differences (SSQ) between columns of
stream data can easily be computed allowing, for
example, history matching of measured data by
optimizing the computational model.
Pipe-It Manual Page 242
Advanced Linkz trick
Example 1, Output of PhazeComp
Output of PhazeComp application looks in such way:
Problem of locating values of variables which are based in fourth
column "Current" is related to possibility of presence of numbers in
"Reg Var" column. Then with appearing a number in the column, the
position of token can shifted and you get wrong value of your variable.
Solution
We need to avoid of considering numbers in "Reg Var" as tokens. For
this you need to change delimiters regular expression. Because value of
variable is definitely larger than 2 digits, we can just ignore all tokens
with length less than 3 symbols. For this, in delimiters dialog, change
TOKEN REGEXP
[ ^$del i mi t er s] + to [ ^$del i mi t er s] {3, }
It means that instead "+" (which means at least one symbol and more)
linkz will look for "{3,}" (which means at least three symbols and
more)
Then first two columns will be ignored and tokens are counted from
"Variable" column.
Pipe-It Manual Page 243
Interaction with 3rd party software
Pipe-It is built to launch any 3rd party application like Eclipse
1
, Hysys
2
,
VIP
3
, OLGA
4
and others via the Program (Script). If the program
expects command line argument (e.g. file names) and/or options
(switches), they can be supplied. If the program binary (executable) is
not on the system path then the entire path to the executable should
be included. Quotes should be used if spaces are part of the path.
Example with Eclipse, assuming eclrun is on the path:
ecl r un Ecl i pse " ODEHI MPES_PSM"
Example with Olga, where the executable is not on the path:
" c: \ Pr ogr amFi l es ( x86) \ SPT Gr oup\ OLGA 7. 2. 2\ opi . exe" "Hydr at e. genkey"
Pipe-It can use resource references to make the command line flexible
and reusable.
If a 3
rd
party application is used frequently then Pipe-Its Script
Assistant can be used to create a short-cut on the toolbar and the
application appears tightly embedded into Pipe-It. Its usage becomes
as simple as drag and drop.
Modifying data used by these applications and using results produced
by these applications is as simple as using Linkz on the applications
input and output files.
Launching application that donot have text files for interaction is
accomplished by wrapping the launch in a COM-complaint scripting
language. Windows ships with the Windows Scripting Host (WHS) that
can read and execute *.vbs files to accomplish this. If the user has
other scripting environments installed on the computer where Pipe-It is
to be used, for example Ruby, Perl, Python etc., any & all such systems
can be used instead.
Interacting with Microsoft Excel
The Pipe-It created resource files (*.str files) are tab de-limited and
can readily be opened in a spreadsheet program like Microsoft Excel.
The Pipe-It scripter command can be set to execute a the following
1
Eclipse is trademark of Schlumberger Ltd
2
Hysys is trademark of AspenTech Inc
3
VIP is trade mark Landmark Graphics Corp.
4
OLGA is the trademark of Schlumberger.
Pipe-It Manual Page 244
command, where one or more .str files can be specified before the .xls
file that will use the data from these files:
" C: / Pr ogr amFi l es ( x86) / Mi cr osof t Of f i ce/ Of f i ce14/ EXCEL. EXE" "OUTPUT- STR\
VLC2. st r " "Pol yFi t . xl s"
A simpler way, if you do not want to find out the location of Excel,
would be:
Cmd / c St ar t Excel " OUTPUT- STR\ VLC2. st r " "Pol yFi t . xl s"
This causes Excel to behave as it is part of Pipe-It since the execution
continues as soon as the instance of Excel is closed.
Pipe-It Manual Page 245
Getting Started with Streamz (Application)
Introduction
Pipe-It provides the user with a set of tools to manage the conversion of information
among a multitude of models handling fluid streams. This software is developed to be
very flexible to use. It can perform automated, multi-step conversions using batch
scripts on a large number of streams. The package consists of a GUI for visually piping
together a project, running external models to generate or import fluid streams,
powered by the core program Streamz. This manual will get the user up and running
with the Streamz program using a typical data set and explains the use of each
command as they are encountered.
Conventions used in this document
Any reference to "Streamz" in the text refers to the Streamz program. To distinguish
between different kinds of text, we use a few typographical conventions:
Upper case, bold font is used for Streamz keywords mentioned in the text:
CONVERT, TITLE, MOLES, COPY
User-specified data to Streamz keywords are in italics:
TITLE title_string
Portions of an actual data-set used in this document are in Courier font, and enclosed
within a box:
t i t l e ' Exampl e conver si on of Bl ack- Oi l st r eams'
subt i t l e ' Conver t ed t o 6 component EOS'
Definitions
Keyword types:
Command primary keyword that introduces instructions.
Sub-command sub-level keyword that introduces further instructions.
Option sub-level keyword that sets parameters.
Arguments user-specified input to a keyword.
Introducing Streamz
Streamz is a generic program to convert fluid streams from one characterization to
another. A fluid stream is any collection of data containing information about the
amounts of the constituents of a petroleum fluid, and any other associated information
like origin, pressure, temperature, etc. A characterization is a definition of the names of
Pipe-It Manual Page 246
components making up the fluid stream and, in most cases, their molecular weights.
Exceptions include black-oil streams, which do not have associated molecular weights.
Equation-of-state (EOS) characterizations may also include critical properties and binary
interaction parameters.
The user controls a run of Streamz via one or more nested driver files, the
first of which is the Primary Input file. This file (through possible inclusion of
other driver files) names the fluid characterizations, describes their
properties, and defines conversions between them. It allows the user to
specify the opening of stream files containing the streams for particular
characterizations, and also allows instructions for filtering, combining and
copying streams from one file to another. This interaction of Streamz with
various files is depicted in Figure 1. Instructions are in the form of
commands, sub-commands, options and arguments. All keywords and
arguments are case insensitive for recognition purposes, but retain their
user-specified cases otherwise (in particular for arguments such as title
strings and file names). The program automatically invokes conversions
among the required characterizations. Typically, various pre-processors
generate the program commands, thereby ensuring that the syntax is
correct.
Invoking Streamz
Streamz can be invoked by using the Streamz utility in Pipe-It, or from the operating
system's command line using the program name Streamz. Up to two command-line
arguments can follow the Streamz command. The first argument is the name of the
Primary Input file, which contains the instructions and keywords to the Streamz
program. The second argument is the name of the Standard Output file, to which the
program will write various messages about its execution. Path information included with
Pipe-It Manual Page 247
the file names will be considered relative to the current working directory from which the
Streamz command was issued. Streamz normally requires additional input from one or
more stream files and can generate other "result" files, but these can only be specified
from within the Primary Input file.
St r eamz I nput Fi l e Out put Fi l e
Invoking the program with only the first argument results in a prompt to the user (in the
form of a simple text prompt or a standard file dialog box, depending on the operating
system) to supply the name of the Standard Output file. If the prompt is canceled, there
will be no Standard Output file. If "@" (without the quotes) is given in response to the
file dialog box, the Standard Output will be redirected to the screen. Invoking the
program with no arguments results in prompts for both the Primary Input and Standard
Output files, in that order.
A Typical Data-Set
This section steps through the "hows" and "whys" of a typical Primary Input file to
Streamz. This input file is an example of a typical usage of the Streamz program, and
contains some of the most used keywords and their options. This data set is designed to
give the first time user a template to start creating his/her own input files that allow
using the program straight away. This section will list the full data set and then step
through it line-by-line (or portion-by-portion), explaining the syntax and usage of each
keyword and option.
Description
The data set is set up to first convert streams, in the form of surface oil and gas
volumes, from a popular black-oil reservoir simulator (Eclipse 100) into 6-component
molar-rate streams. Next, a conversion to 6-component mass-rate streams is
performed. The 6-component molar-rate streams are then converted to 17-component
molar-rate streams required by a process simulator.
The Data-Set
Ti t l e ' A dat a- set f or a r i ch gas condensat e f i el d, Opi t z'
TI TLE ' Bl ack- oi l t o EOS- 6 Conver si on'
CHAR ' Opi t z BO'
NAME
SO
SG
STREAMFI LE I NP1: I NPUT "Opi t zBO. st r "
CHAR ' Opi t z EOS- 6'
NAME MW
X1 18. 640
X2 58. 890
X3 112. 420
CN1 179. 980
CN2 310. 000
CN3 480. 000
CONVERT ' Opi t z BO' f r omVOLUMES t o MOLES
SET PRES ( bar ) 422. 073
SPLI T SO X1 3. 62E- 03 8. 28E- 01 1. 01E+00
9. 36E- 01 1. 28E+00 2. 15E- 01
Pipe-It Manual Page 248
SPLI T SG X1 3. 84E- 02 4. 52E- 03 1. 06E- 03
2. 37E- 04 - 5. 15E- 04 - 2. 35E- 04
SET PRES ( bar ) 400
SPLI T SO X1 - 1. 44E- 02 8. 74E- 01 1. 06E+00
9. 68E- 01 1. 28E+00 1. 76E- 01
SPLI T SG X1 3. 84E- 02 4. 45E- 03 9. 89E- 04
1. 89E- 04 - 5. 24E- 04 - 1. 75E- 04
SET PRES ( bar ) 300
SPLI T SO X1 - 9. 77E- 02 1. 03E+00 1. 24E+00
1. 07E+00 1. 22E+00 9. 83E- 02
SPLI T SG X1 3. 85E- 02 4. 21E- 03 7. 10E- 04
3. 84E- 05 - 4. 13E- 04 - 5. 18E- 05
SET PRES ( bar ) 200
SPLI T SO X1 - 1. 77E- 01 1. 13E+00 1. 42E+00
1. 14E+00 1. 12E+00 7. 78E- 02
SPLI T SG X1 3. 84E- 02 4. 05E- 03 4. 52E- 04
- 3. 97E- 05 - 2. 32E- 04 - 1. 89E- 05
SET PRES ( bar ) 100
SPLI T SO X1 - 1. 98E- 01 1. 09E+00 1. 58E+00
1. 16E+00 1. 05E+00 7. 17E- 02
SPLI T SG X1 3. 82E- 02 4. 12E- 03 2. 57E- 04
- 5. 58E- 05 - 1. 10E- 04 - 7. 73E- 06
SET PRES ( bar ) 50
SPLI T SO X1 - 1. 27E- 01 8. 11E- 01 1. 62E+00
1. 20E+00 1. 07E+00 7. 26E- 02
SPLI T SG X1 3. 79E- 02 4. 52E- 03 2. 37E- 04
- 6. 83E- 05 - 1. 00E- 04 - 6. 87E- 06
STREAMFI LE OUT1: OUTPUT ' Opi t zEOS6z. st r '
COPY
STREAMFI LE I NP1: CLOSE
STREAMFI LE OUT1: CLOSE
TI TLE ' Opi t z EOS- 6 t o EOS- 17 Conver si on'
TI TLE ' ( kg- mol es/ day of EOS- 6 t o kg- mol es/ hr of EOS- 17) '
TI TLE ' ( al so t o kg/ hr of EOS- 6) '
STREAMFI LE I NP1: I NPUT ' Opi t zEOS6z. st r '
STREAMFI LE OUT1: OUTPUT ' Opi t zEOS6w. st r '
CONVERT ' Opi t z EOS- 6' t o MASS
CHAR ' Opi t z EOS- 17'
NAME MW FULLNAME
CO2 ' CARBON DI OXI DE'
N2 ' NI TROGEN '
C1 ' METHANE '
C2 ' ETHANE '
C3 ' PROPANE '
I C4 ' I SOBUTANE '
C4 ' N- BUTANE '
I C5 ' 2- METHYL BUTANE'
C5 ' N- PENTANE '
C6 84. 198 ' HEXANES '
C7 97. 464
C8 111. 251
C9 125. 799
C10 139. 157
CN1 180. 000
CN2 310. 000
CN3 480. 000
CONVERT ' Opi t z EOS- 6' f r omMOLES t o MOLES, conser ve MASS
GAMMA X3 C7, FI LE GAM1
Pipe-It Manual Page 249
SHAPE 1. 570, AVERAGE 1. 0, BOUND 0. 662693471, ORI GI N 1. 0
SET PRES 423 bar
SPLI T X1 CO2 0. 03514 0. 00462 0. 84342 0. 11682
SPLI T X2 C3 0. 50204 0. 07055 0. 19427 0. 05624 0. 08078 0. 09611
SET PRES 373. 3 bar
SPLI T X1 CO2 0. 03459 0. 00485 0. 84757 0. 11299
SPLI T X2 C3 0. 51820 0. 07066 0. 19165 0. 05460 0. 07709 0. 08779
SET PRES 318. 2 bar
SPLI T X1 CO2 0. 03397 0. 00492 0. 85170 0. 10941
SPLI T X2 C3 0. 53182 0. 07159 0. 19091 0. 05227 0. 07273 0. 08068
SET PRES 263 bar
SPLI T X1 CO2 0. 03396 0. 00492 0. 85388 0. 10725
SPLI T X2 C3 0. 54201 0. 07101 0. 18935 0. 05089 0. 07101 0. 07574
SET PRES 207. 8 bar
SPLI T X1 CO2 0. 03378 0. 00495 0. 85473 0. 10653
SPLI T X2 C3 0. 54935 0. 07134 0. 19025 0. 04875 0. 06897 0. 07134
SET PRES 152. 7 bar
SPLI T X1 CO2 0. 03429 0. 00480 0. 85325 0. 10766
SPLI T X2 C3 0. 55334 0. 07151 0. 19109 0. 04924 0. 06800 0. 06682
SET PRES 97. 5 bar
SPLI T X1 CO2 0. 03509 0. 00469 0. 84823 0. 11198
SPLI T X2 C3 0. 55519 0. 07285 0. 18874 0. 05077 0. 06843 0. 06402
SET PRES 49. 3 bar
SPLI T X1 CO2 0. 03604 0. 00432 0. 83710 0. 12254
SPLI T X2 C3 0. 55296 0. 07289 0. 19728 0. 04956 0. 06706 0. 06025
STREAMFI LE OUT2: OUTPUT ' Opi t zEOS17z. st r '
GAMMAFI LE GAM1: OPEN ' Opi t zEOS6. gam'
NEWSFI LE NWS1: OPEN ' Opi t zEOS17. nws' , USER AAZ
COPY, SCALI NG 0. 041666667 ; ( conver t dai l y t o hour l y pr oduct i on)
Stepping through the data-set
This section steps through the Primary Input file presented in the previous section.
Ti t l e ' A dat a- set f or a r i ch gas condensat e f i el d, Opi t z'
TI TLE ' Bl ack- oi l t o EOS- 6 Conver si on'
The purpose of the TITLE command is to print a boxed title to the standard output file.
The quoted string following the TITLE keyword is centered within a box made up of
asterisk (*) characters. The box expands to accommodate the full length of the string.
This may be used to visually separate different tasks being run from the same input file.
A sub-command recognized within the context of TITLE is SUBTITLE (also given by a
subsequent TITLE keyword, as illustrated above). Each of these sub-commands prints
its line of text within the same box as the primary TITLE text. Using SUBTITLE after
another keyword has been used (i.e., outside the context of the TITLE command) will
result in an error.
CHAR ' Opi t z BO'
NAME
SO
SG
Pipe-It Manual Page 250
The CHAR command names a fluid characterization. In the present example, the
characterization_name "Opitz BO" is defined.
The NAME sub-keyword triggers the tabular input of an EOS property
table, which defines the names and properties (such as molecular weights
and critical parameters) of the components that make up the
characterization. Because a black-oil characterization is being defined in
this example, the property table consists of only the component names.
In this case, the names given to the two components are "SO" and "SG"
(Surface Oil and Surface Gas). A detailed discussion of the property table
is included later.
STREAMFI LE I NP1: I NPUT "Opi t zBO. st r "
The STREAMFILE keyword initiates the opening of a stream file for either input or
output. The first argument to the keyword is a file_nickname (INP1 used here). The sub-
command INPUT directs that an existing file is to be opened for input. Its argument is
either the actual file name ("OpitzBO.str" in our example case) or else the keyword
PROMPT, in case the user wants to be prompted interactively for the actual file name. If
the file name is entered here, and contains blanks or unusual punctuation, it should be
quoted. It may contain OS specific path directives if the file is in another directory,
relative to the current input file. The information in the file being opened should
correspond to the "current" characterization. The current characterization is the one just
defined (or made "current" with the RESTORE command, followed by the appropriate
char_name). In our case it is the "Opitz BO" characterization with two components. The
stream data in the file being opened with this STREAMFILE command should contain
the quantity information for two components only.
CHAR ' Opi t z EOS- 6'
NAME MW
X1 18. 640
X2 58. 890
X3 112. 420
CN1 179. 980
CN2 310. 000
CN3 480. 000
Here we have the definition of a second characterization using the CHAR command. We
need two defined characterizations to convert from one to the other. This is an EOS
characterization named "Opitz EOS-6" with 6 components. The NAME sub-keyword
triggers tabular input of an EOS property table and defines the properties of the
components that make up this characterization. This tabular input scheme is very
flexible, allowing any of the component properties (including their NAME) to be input in
any order. Each property is identified by a heading keyword. For example, MW indicates
molecular weight. The only constraint of the tabular input scheme is that any entries in
the table that belong to a particular heading (i.e., property) should line up with the
heading. This allows unknown entries to be left blank without misaligning the rest of the
table. The specific rules for lining up the table are described in Appendix A of the
Streamz Reference Manual. The name of each component is listed under the NAME
heading. The value of any other property corresponding to that component is entered in
the same row, lined up under the heading corresponding to the desired property. In our
example case, the molecular weight of X3 is 112.420. This input scheme is designed to
enable cut-and-paste from any other data file or spreadsheet with minimal editing. The
example requires only the NAME and MW properties but input of a full EOS property
table is also allowed for forward compatibility.
Pipe-It Manual Page 251
CONVERT ' Opi t z BO' f r omVOLUMES t o MOLES
The CONVERT keyword initiates the definition of a conversion procedure to convert
streams corresponding to an input characterization into streams corresponding to an
output characterization. The first argument to the keyword is the name of the input
characterization (in this case "Opitz BO"). This must have been previously defined. The
output characterization is the "current" characterization (the one defined last or made
"current" by the RESTORE command). The FROM option defines the input units
expected by the conversion procedure. Conversion will be possible only for input streams
specified in these (or compatible) units. Four units are currently understood, namely
MASS, MOLES, VOLUMES, and AMOUNT. The FROM units should match those in the
corresponding input stream files (MASS and MOLES are compatible if the component
molecular weights have been defined). The actual streams may be in more specific,
dimensional units, which may also denote rates, concentrations, fluxes, etc. For
example, kgmol, lbmol/day, gmole/cc, or lbmol/ft
2
/sec would all fall under the category
of MOLES. The true, dimensional units are not relevant to the program, but should be
kept track of by the user, so as not to confuse lbmol/day with kgmol/hr, for example. We
use VOLUMES here because we know that the input streams are in Sm
3
/D (i.e.
volumetric rates). The TO option specifies the units of the output streams. A CONSERVE
option to the CONVERT command will be discussed later in this section. If the FROM
units are not specified, they will default to the TO units, the CONSERVE units, or
MOLES, in that order of preference. Then, if the TO or CONSERVE units have not been
specified, they will default to the FROM units.
SET PRES ( bar ) 422. 073
SPLI T SO X1 3. 62E- 03 8. 28E- 01 1. 01E+00
9. 36E- 01 1. 28E+00 2. 15E- 01
SPLI T SG X1 3. 84E- 02 4. 52E- 03 1. 06E- 03
2. 37E- 04 - 5. 15E- 04 - 2. 35E- 04
.
.
.
SET PRES ( bar ) 50
SPLI T SO X1 - 1. 27E- 01 8. 11E- 01 1. 62E+00
1. 20E+00 1. 07E+00 7. 26E- 02
SPLI T SG X1 3. 79E- 02 4. 52E- 03 2. 37E- 04
- 6. 83E- 05 - 1. 00E- 04 - 6. 87E- 06
One way to convert an input stream to an output stream is through a set of split factors.
Each split factor specifies the portion of a given input component that partitions into a
given output component. Each component (input or output) may have several split
factors associated with it and the split factors may be functions of one or more control
variables. Streamz handles the input of these split factors by means of the SET and
SPLIT (or DELUMP) keywords, which are discussed in this section. Examples are shown
in the above extract, which contains only a portion of the relevant part of the data-set
(missing portions are replaced by dots).
The SET sub-command is known within the context of the CONVERT
command and is used to specify control variables and set their values.
Here we designate the previously defined pressure variable "PRES"
(defined in our input stream file by the VARIABLE command) as our one
control variable and set its value initially to 422.073 bar (variables of
pressure, temperature, time or distance need to be assigned unitsin this
case, BAR). Our split factors therefore become piecewise linear functions
of pressure, starting with those at 422.073 bar. If we had specified
additional control variables, the split factors would become piecewise
Pipe-It Manual Page 252
linear functions of those variables as well. The first argument to the SET
sub-command is the name of the primary control variable, followed by its
value and units (if applicable), in either order (the parentheses shown
here are optional and are actually ignored). Additional control variables,
along with their values and units, could be given as additional arguments,
as long as only one input line is used for the entire set of control
variables. If the split factors are known to be constant, there is no need
for the SET keyword.
The SPLIT (or its alias DELUMP) sub-command is one of the two methods
Streamz uses to convert streams (the other being GAMMA distribution
modeling). This specifies the split factors for conversion of a single input
component to one or many output components. A split factor is the
fraction of a component in the input stream that goes into a specified
component of the output stream. The first argument to this keyword is
always the name of the input component. That's followed by a series of
doublets, each consisting of an output component name and its split factor,
in either order. Either element of each doublet may be omitted, however.
If the component is omitted, it defaults to the one following that of the
previous doublet (with the first doublet defaulting to the first component).
If a split factor is omitted, it defaults to 1. The doublets continue until a
keyword that is not a component name is encountered. Thus, at 422.073
bar in our example, SO will split into six output components, starting with
component X1. The same applies to SG. Since the CONVERT is FROM
VOLUMES TO MOLES, each volume of SO will split into 3.62E-03 MOLES of
X1, 8.28E-01 MOLES of X2, 1.01E+00 MOLES of X3, 9.36E-01 MOLES of
CN1, 1.28E+00 MOLES of CN2, and 2.15E-01 MOLES of CN3. Similarly,
each volume of SG will split into 3.84E-02 MOLES of X1, 4.52E-03 MOLES
of X2, 1.06E-03 MOLES of X3, 2.37E-04 MOLES of CN1, -5.15E-04 MOLES
of CN2, and -2.35E-04 MOLES of CN3. Note that this conversion assumes
that the actual input VOLUMES will have units of Sm
3
(for both SO and SG)
and that the MOLES it produces on output will actually be kgmols. Also
note that negative split factors are normal for this type of process-
dependent, black-oil to compositional conversion. Here, SG/SO ratios of
915 or more would result in negative EOS mole fractions, but for the
process of interest, input streams that are saturated at 422.073 bar
should never have SG/SO ratios that high. That being said, the design of
process-dependent conversions is beyond the scope of this document.
Split factors are defined for a range of values of the dependent variable.
In our example, the streams from a reservoir simulator are expected to
be saturated at pressures from 422 bar to 50 bar. Each table uses the SET
keyword to set the value of the pressure control variable, and uses the
SPLIT keyword to define the split factors associated with each pressure
"node". If a stream (in a stream file being converted) has this associated
variable at an intermediate value, linear interpolation is used to calculate
the split factors for conversion.
Pipe-It Manual Page 253
STREAMFI LE OUT1: OUTPUT ' Opi t zEOS6z. st r '
The STREAMFILE keyword has already been discussed for input files. Here it is used
with the OUTPUT option, which takes either the name of the file to be created
("OpitzEOS6z.str" in this case) or else the keyword PROMPT, in case the user wants to
be prompted interactively for the new file name. Because the "Opitz EOS-6"
characterization is "current", the streams written to this file will correspond to this
characterization.
COPY
The COPY command initiates a read & write operation from all open input stream files to
all open output stream files (one of each, in this case). Because the input and output
files correspond to different characterizations, each stream needs to be converted before
output. The program invokes the relevant conversion definition (in this case split factors
are used) automatically. Because the SPLIT command is used with the SET option, and
because the streams in the input stream file have a defined pressure variable named
PRES, the split factors will be interpolated (if necessary) and then used to calculate the
output streams. For advanced usage, the COPY command allows conditional processing
(using the IF option to select criteria specified by previous FILTER commands), variable
WEIGHTING (and OVERING), stream NORMALIZATION, constant SCALING, and
selective outputting (using the TO option to specify the file_nicknames of only the files
to which output is desired).
STREAMFI LE I NP1: CLOSE
STREAMFI LE OUT1: CLOSE
The STREAMFILE command is used with the CLOSE option to close the files associated
with the supplied file_nicknames.
TI TLE ' Opi t z EOS- 6 t o EOS- 17 Conver si on'
TI TLE ' ( kg- mol es/ day of EOS- 6 t o kg- mol es/ hr of EOS- 17) '
TI TLE ' ( al so t o kg/ hr of EOS- 6) '
Three TITLE commands are used. The first is interpreted as the primary TITLE
command and the next two are interpreted as SUBTITLE sub-commands. The result is
the output of all three lines, in a single box, to the Standard Output file. This visually
marks the start of the next task being run from the same file.
STREAMFI LE I NP1: I NPUT ' Opi t zEOS6z. st r '
STREAMFI LE OUT1: OUTPUT ' Opi t zEOS6w. st r '
Two stream files are associated with file_nicknames ("INP1" and "OUT1") and opened.
The first ("OpitzEOS6z.str") is the same as that used for OUTPUT in the previous task.
It is being used for INPUT now, allowing intermediate results from the same run of
Streamz to be used for subsequent conversions. The second is a new OUTPUT file. Since
both STREAMFILE commands are issued one after the other, both will be associated
with the same, "current" characterization ("Opitz EOS-6"). As we will soon see, this is
exactly what is required.
CONVERT ' Opi t z EOS- 6' t o MASS
This CONVERT command defines a conversion from the "Opitz EOS-6" characterization
to the "current" (also "Opitz EOS-6") characterization. Conversions from any
characterization to "itself" are always defined, as long as the FROM and TO units are
compatible. The only reason for specifying this type of self-conversion is to force a
change of units (TO MASS, in this case) for each stream processed. The FROM units
Pipe-It Manual Page 254
aren't specified, so by the rules previously outlined, they are assumed to equal the
specified TO units, MASS. The CONVERT FROM MASS (of "Opitz EOS-6") TO MASS (of
"Opitz EOS-6") is trivial (and even if non-trivial SPLIT factors were entered, they'd be
ignored). It will obviously work for input streams given with MASS as units, but it will
also work for input streams given in MOLES. That's because the "Opitz EOS-6"
characterization includes the molecular weights of all its components, making MOLES
and MASS completely compatible (i.e., internally convertible) for this characterization.
In either case, all output streams will be given in MASS. The next COPY command will
automatically invoke this CONVERT TO MASS when it copies the streams from INP1 to
OUT1, since both of these files are associated with the "Opitz EOS-6" characterization.
CHAR ' Opi t z EOS- 17'
NAME MW FULLNAME
CO2 ' CARBON DI OXI DE'
N2 ' NI TROGEN '
.
.
.
C6 84. 198 ' HEXANES '
.
.
.
CN2 310. 000
CN3 480. 000
We now define a new, 17-component characterization. Reproduced above is only a
portion of the original data-set. Note the use of a new property, FULLNAME. This allows
names of components containing embedded spaces, which might be required in some
usages. The FULLNAME property might also be used to associate a remark with the
component. Currently this property is used for output to an in-house process simulator
format.
CONVERT ' Opi t z EOS- 6' f r omMOLES t o MOLES, conser ve MASS
This command defines the conversion from the "Opitz EOS-6" characterization to the
current ("Opitz EOS-17") characterization. The conversion is defined from molar streams
to molar streams. Note the use of the CONSERVE option. This allows the user to specify
the quantities to conserve during the conversion (MASS, in this case). Use of the
CONSERVE option has two effects. First, the split factors will be checked for possible
material balance errors; if they will not conserve the requested quantities, warnings will
be issued. Second, it determines the way Gamma distribution modeling is performed.
Gamma modeling can conserve either moles or mass, but generally not both. Moles are
conserved by default, but the option to CONSERVE MASS can be used instead. Any
combination of FROM, TO, and CONSERVE units may be specified, but the CONSERVE
option has an effect only if the conserved units are compatible with both the FROM and
TO units. Otherwise, it is ignored.
GAMMA X3 C7, FI LE GAM1
SHAPE 1. 570, AVERAGE 1. 0, BOUND 0. 662693471, ORI GI N 1. 0
The GAMMA option is another possible method of defining the conversion between
characterizations (the first being the SPLIT option). It can be used just by itself, if the
characterization contains only heavy components for which a continuous distribution is a
good approximation (e.g., heptanes plus, C
7+
, or decanes plus, C
10+
). Or it can be used
for a heavy-end subset of the components, with split factors being used for the
remaining, lighter components. It expects 2 mandatory arguments in the form of the
names of one component each of the input and output characterizations. These are the
lightest components in each which are requested to participate in the Gamma modeling.
The molecular weights and the amounts of all input components as heavy as, or heavier
Pipe-It Manual Page 255
than, that specified, would be used to calculate a gamma distribution model. The model,
and the molecular weights of all output components as heavy as, or heavier than, that
specified, would then be used to calculate the amounts of the output stream. In the
example, we specify that X3 and heavier components (MW-wise) should be fit to a
Gamma distribution model. We also specify that C7 and heavier components of the
output streams will receive amounts based on the calculated model.
Without going into the mathematical details here, the Gamma model
describes a continuous molar distribution as a function of molecular
weight. The function itself is defined for molecular weights from an origin
value to infinity, but only the molecular weights greater than or equal to a
boundary value (greater than or equal to the origin value) are considered for
the molar distribution. The molar distribution has an average MW and the
function has a particular shape, which can (a) decay exponentially from a
finite value at the origin MW, (b) decay faster than exponentially from an
infinite value at the origin MW, or (c) decay slower than exponentially
after rising from zero at the origin MW and going through a maximum.
Shapes of type (b) are typical for gas condensates and shapes of type (c)
are typical for heavy oils, while shape (a) falls in-between. The
distribution is described by four parameters: one for the shape and three
others for the origin, boundary, and average molecular weights.
The calculation of the model is essentially the determination of the four
model parameters by means of regression. The user has control over the
regression by specifying the starting values and the upper & lower bounds
of these parameters. The four model parameters are specified by optional
sub-keywords known within the context of the CONVERT command. These
sub-keywords are SHAPE, BOUNDARY, AVERAGE, and ORIGIN (or ZERO).
The exponential shape (a) has a SHAPE parameter of 1. Shapes of type
(b) have SHAPE parameters less than 1 (typically no less than 0.4) and
shapes of type (c) have SHAPE parameters greater than 1 (typically no
greater than 5). The model's average MW is given by the product of the
AVERAGE parameter (typically around 1) and the calculated average MW
of the portion of the input stream being modeled. The model's boundary
MW is given by the product of the BOUNDARY parameter (between 0 and
1) and the MW of the input component specified as the first argument to
the GAMMA keyword. The model's origin MW is given by the product of the
ORIGIN parameter (between 0 and 1) and the model's boundary MW.
Each of the four parameter keywords may be entered with zero to three
numerical arguments. If a particular parameter keyword is entered
without any arguments (or if it is not entered at all), its default initial
value and bounds will be used during regression. If it is entered with at
least one argument, the first argument is taken as the parameter's initial
value, the minimum argument is taken as the lower bound for regression,
and the maximum argument is taken as the upper bound. If the initial
value and both bounds turn out to be equal (e.g., when only one
argument is entered), then that single fixed value will be used for the
Pipe-It Manual Page 256
model and it will not be altered by regression. In our case we have fixed
all the parameters. They were calculated previously by fitting a sample of
the fluid to the Gamma distribution model.
An optional sub-keyword within the context of the GAMMA keyword is
FILE. This specifies the nickname of the file to which gamma model results
are written. An actual file needs to be opened with the GAMMAFILE
command and associated with this nickname before the results will
actually be written. We use the file_nickname "GAM1" in this example.
SET PRES 423 bar
SPLI T X1 CO2 0. 03514 0. 00462 0. 84342 0. 11682
SPLI T X2 C3 0. 50204 0. 07055 0. 19427 0. 05624 0. 08078 0. 09611
.
.
.
SET PRES 49. 3 bar
SPLI T X1 CO2 0. 03604 0. 00432 0. 83710 0. 12254
SPLI T X2 C3 0. 55296 0. 07289 0. 19728 0. 04956 0. 06706 0. 06025
Again we have reproduced only a portion of the relevant part of the data-set. The
current conversion definition uses a combination of GAMMA and SPLIT methods. While
the X3-plus to C7-plus conversion is covered by the GAMMA command, pressure-
dependent split factors are specified for the conversion of the other components. X1 of
input streams splits into C02 and the next 3 components (based on order of definition in
CHAR command) of the output streams. X2 splits into C3 and the next 5 components.
The splitting is a function of pressure where interpolation is used if required.
STREAMFI LE OUT2: OUTPUT ' Opi t zEOS17z. st r '
This specifies the file_nickname and the actual disk file where streams corresponding to
the "current" characterization ("Opitz EOS-17") will be written.
GAMMAFI LE GAM1: OPEN ' Opi t zEOS6. gam'
NEWSFI LE NWS1: OPEN ' Opi t zEOS17. nws' , USER AAZ
The primary GAMMAFILE command is used to OPEN (also possible with the FILE or
OUTPUT keywords), CLOSE, or PROMPT for a file where the results of gamma
modeling are to be written. It first associates a file_nickname (GAM1, in this case) with
this file. This file_nickname must be used when closing the file or when specifically
directing output to it (with the FILE option of the GAMMA sub-command of the
CONVERT command). The OPEN sub-keyword takes the name of the file to be created
("OpitzEOS6.gam" in this case) as its argument. Gamma files are typically used for a
small number of streams.
The primary NEWSFILE command provides temporary functionality to
create output stream files in an in-house process simulator format. It
uses the OPEN (also possible with the FILE or OUTPUT keywords), CLOSE,
or PROMPT options to handle a file of this type. It first associates a
file_nickname (NWS1, in this case) with this file. This file_nickname must be
used when closing the file (using the CLOSE option) or when specifically
directing output to it (with the TO option of the COPY, TABULATE, or WRITE
commands). The OPEN sub-keyword takes the name of the file to be
created ("OpitzEOS17.nws" in this case) as its argument. An additional
Pipe-It Manual Page 257
sub-keyword (required by the proprietary process simulator format) is
USER, which takes the initials of the user as its argument ("AAZ" in the
example). The NEWSFILE command is likely to be eliminated from
Streamz in a future version.
COPY, SCALI NG 0. 041666667 ; ( conver t dai l y t o hour l y pr oduct i on)
The COPY command copies the streams from all open input stream files to all open
output stream files (or a subset specified by the TO option), converting the streams as
needed. The SCALING option multiplies the output streams by a constant factor. This
can be used for conversion from one set of units (e.g. moles/day) to another
(moles/hour), for example. Other options are illustrated in the Streamz Reference
Manual.
Keyword Abbreviations
Streamz keywords have some required starting characters, with any trailing characters
being optional. Optional trailing characters may be replaced by anything (or nothing).
For example:
In CONVERT only CONV is required. And since the trailing characters can
be replaced, CONVERSION is also valid for that keyword.
The required part, or abbreviations, of some keywords are listed in the
table below.
Keyword Abbreviation
AVERAGE AVE
BOUNDARY BOUND
CLOSE CLOS
CONSERVE CONS
CONVERT CONV
FILTER FILT
FULLNAME FULL
GAMMAFILE GAMMAF
INPUT INP
MOLES MOLE
NEWSFILE NEWSF
NORMALIZATION NORM
ORIGIN ORIG
OUTPUT OUT
OVERING OVER
Pipe-It Manual Page 258
PROMPT PROM
RESTORE REST
SCALING SCAL
STREAMFILE STREAMF
SUBTITLE SUBT
TABULATE TABU
TITLE TIT
VARIABLE VAR
VOLUMES VOLUME
WEIGHTING WEIGH
A Typical Stream file
A Stream file consists of a header section and a data section. The header section
contains information about the file and defines the basic characteristics of the stream
data in the file. The data section contains headings for the data and the actual stream
data. An important point to note is that stream files are tab-delimited. This means that
each individual piece of information (i.e. each record) is separated from the next by a
tab character. It is important that such files are not edited in a text editor that removes
the tabs and converts them to spaces. The reason for using tab-delimited files is the
ease of import into Microsoft Excel for further manipulation.
Pipe-It Manual Page 259
Plots on Canvas in Pipe-It projects and using
"R" language
Using Item properties dialog or with drag-and-drop you can easily
attach images to your canvas items. Pipe-It uses OS file watchers, so if
any of your image is changed, it is reloaded and appropriate items,
which have attached the image, are updated.
It opens very powerful way to generate graphics and diagrams from
your project scripts and show result images directly on canvas. You can
use different utils or languages to generate them - they should be just
part of your project (just scripters) to run with project and update
appropriate graphics files.
One of advantages is possibility to use "R" language. This is very
powerful language that used for for statistical computing and graphics.
For example few screenshots that illustrates possibilities at their
webpage:
http://www.r-project.org/screenshots/screenshots.html
http://addictedtor.free.fr/graphiques/thumbs.php?sort=votes
As example we can study how to make plots for some STR file. Imagine
that you have some Resource with attached STR file:
This file: TUNE.str contains:
St r eamz 1
Not e "Case: P50"
Char "BO+W"
Var i abl e Year I nt eger
Var i abl e Gr oup St r i ng
Dat a
Set Gr oup TUNE
Year Amount s SO SG SW
2006 271552 555555550 13781
2007 150029 1736142619 6788
2008 26812 4347876676 1239
2009 178500 5451284722 0
2010 109233 6447013889 0
Pipe-It Manual Page 260
2011 40767 6385229167 0
2012 151500 1478472222 6122
2013 135000 1305000000 5510
2014 15000 145000000 612
There is a table that can be easily loaded with "R" language. For
generating graphic "Year" --> "Amounts", only 4 lines of "R" code is
required:
The script file: str-to-png.r contains:
png( "TUNE. st r . png" )
i np <- r ead. t abl e( "TUNE. st r " , sep="\ t " , ski p=11, h=T)
pl ot ( i np[ [ 1] ] , i np[ [ 2] ] , t ype="b")
dev. of f ( )
Now you need to create simple script that call this "R" script file and
generates png
(You need to have "R" in your PATH environment variable)
When you run the project you get TUNE.str.png. Which you can attach
as background directly to your Resource file.
Pipe-It Manual Page 261
Then the plot will be generated each time your resource got new data
and is completed during project run and background of the Resource
will be updated automatically.
Actually you can attach the image to any other item - "script-to-png" or
canvas background or background of composite or annotation - it does
not matter, Pipe-It watch if the image is changed and updates
appropriate items on canvas. You can create several "monitors" to
watch how some diagrams are changed during run etc.
See also:
http://www.r-project.org/
http://www.r-project.org/screenshots/screenshots.html
http://addictedtor.free.fr/graphiques/thumbs.php?sort=votes
Pipe-It Manual Page 262
Pipe-It File types
The following file types are used by Pipe-It. The extensions are typical
but not mandatory.
*.stz Streamz engine driver files
*.str Pipe-It resource (stream) files
*.psm Pipe-It utility driver files
*.log Log files containing messages logged by Streamz or utilities.
*.chr Characterization files containing the format description of
resources
*.cnv Conversion files containing methods for conversion of resources
from one format to another
*.ppm Logical project model in XML format
*.ppv Visualization of the project model in XML format
*.ppl Linkz library of the project in XML format
*.pps Streamz library of the project in XML format
The program performs operations on a project depending on 3 required
files:
Petrostreamz Pipe-It View file with default extension .ppv that
contains the project visual description of the elements of the project.
Petrostreamz Pipe-It Model file with default extension .ppm that
contains the project model description including all elements (Resource
and Process) and element dependencies and execution information.
Optionally two additional files may be used for projects that are typical:
Petrostreamz Pipe-It Linkz file with default extension .ppl that
contains the project library of all links used in project.
Petrostreamz Pipe-It Streamz Library file with default extension
.pps that contains the project library of all characterizations and
conversion that can be used in project.
Pipe-It Manual Page 263
Copyright Notice
Copyright 2006, 2013 Petrostreamz AS. All rights reserved. No part of
this manual may be reproduced, stored in a retrieval system, or
translated in any form or by any means, electronic or mechanical,
including photocopying and recording, without the prior written
permission of Petrostreamz AS, Granaasveien 1, 7048 Trondheim,
Norway
Disclaimer
Use of this product is governed by the License Agreement.
Petrostreamz AS makes no warranties, express, implied, or statutory,
with respect to the product described herein and disclaims without
limitation any warranties of merchantability or fitness for a particular
purpose. Petrostreamz AS reserves the right to revise the information
in this manual at any time without notice.