COCO - CAPE-OPEN to CAPE-OPEN simulation environment
 Help

Stream access functions

The stream access functions are implemented in the module COFEStreams. The following functions are currently available:

COFE_GetStreamCount
declared as: Public Function COFE_GetStreamCount()
arguments: [none]
return value: the number of streams in the flowsheet
description: Returns the number of streams that are present in the flowsheet. The names of the streams can be obtained with COFE_GetStreamNames.
example pageaccess streams example

COFE_GetStreamNames
declared as: Public Function COFE_GetStreamNames(Optional growArray As Integer = 0)
arguments: growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional, see Entering array formulas)
return value: Array with names of the streams
description: Returns an array with the names of the streams in the document. The stream names can be passed to the stream access functions described here. Alternatively, the 1-based index into the returned array can be used to identify a stream. Stream names are not forced to be unique inside COFE; it is up to the user to either make sure the stream names are unique or to use stream indices.
The returned array is in column format.
example pageaccess streams example

COFE_GetStreamType
declared as: Public Function COFE_GetStreamType(streamID) As String
arguments: streamID: name or index of the stream
return value: stream type
description: Returns the stream type for the specified stream:
  • "material": the specified stream is a material stream
  • "energy": the specified stream is an energy stream
  • "information": the specified stream is an information stream
example pageaccess streams example

COFE_GetUpStreamUnitName
declared as: Public Function COFE_GetUpStreamUnitName(streamID) As String
arguments: streamID: name or index of the stream
return value: Name of the upstream unit operation
description: Returns the name of the upstream unit operation, if any. The returned unit operation name can be used in unit operation access functions.
example pageaccess streams example

COFE_GetDownStreamUnitName
declared as: Public Function COFE_GetDownStreamUnitName(streamID) As String
arguments: streamID: name or index of the stream
return value: Name of the downstream unit operation
description: Returns the name of the downstream unit operation, if any. The returned unit operation name can be used in unit operation access functions.
example pageaccess streams example

COFE_GetStreamMaterialType
declared as: Public Function COFE_GetStreamMaterialType(streamID) As String
arguments: streamID: name or index of the stream
return value: stream's type
description: Returns the type of the material template of the material associated with the specified stream (if the stream is a material stream, see COFE_GetStreamType)
example pageaccess streams example

COFE_GetStreamPressure
declared as: Public Function COFE_GetStreamPressure(streamID)
arguments: streamID: name or index of the stream
return value: Pressure, Pa
description: Returns the pressure of the material associated with the specified stream (if the stream is a material stream)
example pageaccess streams example

COFE_GetStreamTemperature
declared as: Public Function COFE_GetStreamTemperature(streamID)
arguments: streamID: name or index of the stream
return value: Temperature, K
description: Returns the temperature of the material associated with the specified stream (if the stream is a material stream)
example pageaccess streams example

COFE_GetStreamFlow
declared as: Public Function COFE_GetStreamFlow(streamID, basis As String)
arguments: streamID: name or index of the stream
basis: "mass" or "mole"
return value: Flow, mol/s or kg/s
description: Returns the flow of the material associated with the specified stream (if the stream is a material stream)
example pageaccess streams example

COFE_GetStreamComposition
declared as: Public Function COFE_GetStreamComposition(streamID, basis As String, Optional growArray As Integer = 0)
arguments: streamID: name or index of the stream
basis: "mass" or "mole"
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional)
return value: composition, mole fraction or mass fraction
description: Returns the overall composition of the material associated with the stream (if the stream is a material stream)
The returned array is in column format.
example pageaccess streams example

COFE_GetStreamPresentPhases
declared as: Public Function COFE_GetStreamPresentPhases(streamID, Optional growArray As Integer = 0)
arguments: streamID: name or index of the stream
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional)
return value: list of present phases
description: Returns the list of phases that are present on the stream (if the stream is a material stream)
The returned array is in column format.
example page-

COFE_GetStreamPhaseFraction
declared as: Public Function COFE_GetStreamPhaseFraction(streamID, phase As String, basis As String)
arguments: streamID: name or index of the stream
phase: name of the phase, phase must be present
basis: "mass" or "mole"
return value: Phase fraction, mole fraction or mass fraction
description: Returns the phase fraction of a phase that is present on the specified stream (if the stream is a material stream)
example page-

COFE_GetStreamPhaseComposition
declared as: Public Function COFE_GetStreamPhaseComposition(streamID, phase As String, basis As String, Optional growArray As Integer = 0)
arguments: streamID: name or index of the stream
phase: name of the phase, phase must be present
basis: "mass" or "mole"
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional)
return value: Phase composition, mole fraction or mass fraction
description: Returns the composition of a phase that is present on the specified stream (if the stream is a material stream)
The returned array is in column format.
example page-

COFE_GetStreamItems
declared as: Public Function COFE_GetStreamItems(streamID, Optional growArray As Integer = 0)
arguments: streamID: name or index of the stream
growArray: grows the array to the specified amount of elements, leaving blanks for unused elements (optional)
return value: array of stream data item names
description: Returns an array of the names of the parameter objects that carry the data on the stream, if the stream is an information or energy stream
The returned array is in column format.
example pageaccess streams example

COFE_GetStreamItemValue
declared as: Public Function COFE_GetStreamItemValue(streamID, valueID)
arguments: streamID: name or index of the stream
valueID: name of a data item
return value: data item value
description: Returns the value of a data item carried on a stream (if energy or information stream). A list of a stream's data items can be obtained from COFE_GetStreamItems. The dimensionality of the returned value can be obtained from COFE_GetStreamItemDimension.
The returned array format depends on the stream item (often scalar, but can be row vector, column vector or matrix).
example pageaccess streams example

COFE_GetStreamItemDimension
declared as: Public Function COFE_GetStreamItemDimension(streamID, valueID) As String
arguments: streamID: name or index of the stream
valueID: name of a data item
return value: textual dimensionality descriptor
description: description of the dimensionality (unit of measure) of the value associated with the data item on the stream. A list of a stream's data items can be obtained from COFE_GetStreamItems. The value of a stream item can be obtained from COFE_GetStreamItemValue.
example pageaccess streams example