COCO - CAPE-OPEN to CAPE-OPEN simulation environment

Unit operations

Flowsheets are all about unit operations, and their connections to each other. A unit operation is a process that happens between streams. A unit operation can be as simple as a pump, or as complex as a distillation column. A unit operation can have 1 or more inlets, and 1 or more outlets. Each inlet or outlet that is used should be connected to a stream.

Unit operations are external objects. You therefore will need to have unit operations (such as those in COUSCOUS) installed on your system.

You can insert a unit operation into your flowsheet by selecting Insert Unit Operation from the Flowsheet menu, or by clicking the unit operation toolbar button, or press Ctrl+U. A list of CAPE-OPEN compliant unit operations will appear. See also Inserting models.

To edit a unit operation, double click on it or select Edit unit operation from the menu. By default, the COFE dialog to edit unit operations will appear (you can change the behaviour when double-clicking a unit operation from Application Preferences. To access the edit dialog as implemented by the unit operation itself (if present), select Edit on the Edit page. To bypass the COFE dialog and immediately use the unit operation's interface, hold down Alt while double clicking the unit operation; or change the default behaviour for double-clicking a unit from Application Preferences.

In the COFE edit unit operation dialog, you will find the reports that the unit operation produces on the Reports page. A special report, the Status report, is added by COFE, and it describes the solution status after the last run, or the reason the specification of a unit is incomplete.

The Edit page in the COFE dialog will allow access to the parameter values exported by the unit operation. The parameters that are read/write (those not shown in gray) can be modified by clicking on them. Upon right-clicking a parameter, you can choose to add the parameter to the unit's tool tip, or add the parameter to the Watches. When editing array parameters, a sub-dialog will pop up allowing access to the individual array elements. These elements can also be added to the Watches by using the menu that pops up when right-clicking.

The Balance page will allow you to see mass-, enthalpy-, entropy- and component-balances for the unit operation. The balances are calculated from the in- and outlets of the unit at the moment they are requested; if the unit is not solved, the balances may not show numeric values.

The Ports page will show the ports exported by the unit operation, the type of port, and their connection status.

In addition to the ports that are exposed by the unit operation, you can add virtual information ports in COFE. A virtual information port is an in- or output information port that is coupled to the value of a real parameter (or real element of an array parameter). Like regular information ports, you can connect virtual information ports with information streams.

If the unit has at least one inlet material port, and if the total mass flow going into the unit operation is below the mass tolerance, this will be detected as a zero-flow condition. By default, COFE bypasses units with zero-flow condition when solving. When this is done, all outlet concentrations, pressure and temperature are copied from a compatible inlet stream (or equimolar in case of no compatible inlet stream), and all outlet flows are set to zero. Energy streams will default to zero work (with temperature being equal to an inlet stream). Information stream items will attempt a value of zero, if zero is inside the valid range. If not, the closest valid data value to zero will be used. On the Ports page, you can however change whether the unit is bypassed when the flow is zero (Port Operations menu).

By default, COCO will only allow you to connect streams of the same stream type to a unit operation. This is to ensure that the unit operation uses consistent thermodynamic between the inlets and outlets. You can change this option on the Ports page (Port Operations menu), allowing for different stream types to be connected to a unit.

COCO will by default perform a mass-balance check on a unit operation after it calculates. To bypass the mass balance check for a given unit operation, you can turn it off from the Port Operations menu.

The Info page will show additional information about the unit operation.


Some unit operations require knowledge of reactions. To this end, a reaction package needs to be assigned to the unit operation. If the unit operation knows how to deal with a reaction package, you can assign a loaded reaction package by clicking with the right mouse button on the unit operation and selecting Assign Reaction Package.


A special unit operation is the controller unit operation. A controller is used to manipulate one variable (controlled variable) in order to attain a specified value (set point) of another (measured variable).

Due to the way controllers modify the equations system, controllers are not CAPE-OPEN unit operations. They are internal COFE unit operations. To insert a controller, choose Controller from the Insert menu.

A controller must always appear in a recycle and cannot be calculated on its own. Due to the nature of the task of controller, the equations are no longer suitable for direct substitution methods, and recycles that contain a controller cannot be solved using the Wegstein method. The selected Newton method will be used instead to solve a recycle containing a controller.

Controllers have one inlet information port for the measured variable. You can specify the set point by double clicking on the controller. The controller variable is exposed via an outlet information port. You can therefore control all real variables that are exposed as information ports and can be connected with information streams. For controlling parameter values, or using parameter values as measured variable, use virtual information ports, as described above. To use a material stream variable (pressure, temperature, flow, ...) as the measured variable, you can use the Measure Unit to expose the variable.

The relative error of the controller equation is determined by

relative error = (measured variable - set point) / SCALE

where SCALE is determined from

SCALE = max(abs(set point),10-8)

if set point is non-zero. For a set point of zero, a SCALE of 1.0 is assumed. If this scale is not suitable for the problem at hand, a more suitable value can be specified.

To control feed or recycle flows, see the flow constraint unit (below).

Flow constraints

The flow constraint unit operation has two purposes:

Flow constraint in a closed recycle

In some cases, closed recycles (recycles without feeds or product streams) appear in the flowsheet. Examples are heat pumps or catalyst recycles. As these recycles have no feeds or products, the flow and composition in this recycle may be under-determined. This means that any value for flow (or composition) will be a solution. For simple cases, you can therefore set an initial guess for the recycle flow and composition, and the final solution will not have changed from the initial guess.

In other cases, you may want the total flow of the recycle to be part of the equations to be solved. This can be accomplished by adding a Flow Constraint unit operation to the recycle. To insert a flow constraint, choose Flow Constraint from the Insert menu.

For a flow constraint unit, the total flow (mass flow or molar flow) can be specified as a parameter. This means that - using the flow constraint unit - you can link the total flow parameter of the unit (and thus the total flow of the recycle) to a virtual information port, then connect an information stream to it. This information stream could be the controlled variable of a controller (see above).

Flow constraint on a feed

The flow constraint unit operation can also be used as the first unit operation after a feed flow. This allows for controlling the feed flow.

Due to the way flow constraints modify the equations system, Flow Constraint unit operations are not CAPE-OPEN unit operations.


You can associate an icon with a specific unit operation. To change the icon for a unit operation in your flowsheet, click on the unit with the right mouse button. Here, you see the Icon menu.

From the unit icon menu you can select a different icon. The unit icon selection dialog will show up. If you select a unit icon, you can indicate that you want this selection to always apply by default for unit operations of the current type.

You can also clear the icon selection. Unit operations that have no icon are shown as a rectangle. You can change the size of the rectangle by dragging the edges of the rectangle. You can also change the size of units that have an icon, depending on whether the icon is scalable or not. Some icons are only scalable in either the horizontal or vertical direction.

From the unit icon menu, you can also flip or rotate an selected unit icon.

Unit icons are saved with the flowsheet file, so changes made to the unit icon file do not apply to existing documents, until you re-select the icon.

Units that created warnings during the last solution will show in a different color than units that are solved without warnings. In addition, an exclamation mark icon is displayed in the bottom right of the unit operation. The warnings are shown when you hold your mouse above the warning icon, as well as in the Status report of the unit operation (double click the unit operation, go to the Reports tab). You can accept the warnings. After that, the unit will show as solved without warnings.

To add a comment to a unit, right click on the unit operation and select Comment. Unit operations that have comments will show an information icon in the bottom left of the unit operation. The comment will show if you hold your mouse over the information icon.


The label that is displayed with a unit operation is the name of the unit operation. You can toggle the display for all unit operation labels from the View menu. For each individual unit operation, you can turn off the display of the label by unchecking Show from the Label menu. The label menu shows when clicking on the unit operation with the right mouse button. From the label menu, you can also change the position and rotation of the unit label.

Alternatively, you can change the name of a unit operation by double clicking the label. You can move the label by dragging it with the mouse.