Nothing Special   »   [go: up one dir, main page]

COCO Help COFE

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

COFE Page 1 of 54

COFE
CAPE-OPEN Flowsheeting Environment
COFE is a CAPE-OPEN compatible flowsheeting environment. In combination with one or more thermodynamic
systems, and one or more unit operations, and optionally one or more reaction packages, it can be used to put together a
flowsheet for steady state simulation of chemical processes.

For more information, see:

Flowsheeting
Plotting
Calculator

Material objects
Thermodynamic standard versions 1.0 and 1.1
All material objects for COFE and TEA support both CAPE-OPEN version 1.0 and CAPE-OPEN version 1.1 standard.
More-over, conversions between the two standards are available and automatically applied. Conversions apply to
property identifiers, property calculation routines, (two-)phase identifiers and overall calculations. For example, if a
CAPE-OPEN version 1.1 property package is loaded into COFE, exporting phases GAS and LIQUID1, a CAPE-OPEN
version 1.0 aware unit operation would obtain initial inlet values (pressure, temperature, overall composition) from the
material object. If it would need vapor Gibbs free energy, it would call CalcProp on the material object specifying
property gibbsFreeEnergy for phase Vapor. The COFE material would translate this into a CalcSinglePhaseProp for
gibbsEnergy for phase GAS. The property package sets the values on the material object, the unit operation can obtain
then; each using their own version of thermo dynamics.

Restrictions
The following restrictions apply to material objects:

all supported properties (except for special properties temperature, pressure, flow, totalFlow, fraction and
phaseFraction) must appear in props.ini in the proper format,
composition derivatives for two-phase properties are not supported when using CAPE-OPEN version 1.0
thermodynamics,
all material objects keep a single copy for pressure and temperature; in CAPE-OPEN version 1.0 pressure and
temperature are only available for the overall phase. In CAPE-OPEN version 1.1, if pressure is specified for phase
1, and subsequently a different pressure is specified for phase 2, the latter pressure will apply to all phases.
Implicitly this means that phase equilibria with different pressures for different phases (possibly appearing in
porous media or particulate phases) are not properly captured by the material objects,
flow and totalFlow are read/write for the overall phase, but read-only for all other phases,
Total basis (or empty basis for extensive properties) are not supported,
version 1.0 properties "mass" and "moles" are not supported,
multiple vapor phases are not supported,
if material objects are not released by the PMCs, the application will not exit.

See also: Property definitions

Flowsheeting
Flowsheet Configuration
Streams
Unit operations
Connecting unit operations
Colors and status
Selecting streams and unit operations
Solving the flowsheet
Editing and displaying streams
Flowsheet log

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 2 of 54

Flowsheet printing
Inserting models
Inserting objects
Flowsheet report
Add-ins

Flowsheet configuration
To enter the flowsheet configuration window, select Configuration from the Flowsheet menu or press Ctrl+K.

The flowsheets configuration window allows you to adjust the following:


Property packages
Reaction packages
Compounds
Properties
Phase Info
Property packages
Stream types
Flowsheet Options
Reference state
Order of Streams and Units

Property packages
To be able to work with compounds and properties, 1 or more property packages need to be added to your simulation. A
property package is a complete set of definitions and property calculation methods specific to a certain flowsheeting
problem.

Property packages are external objects. You therefore will need to have property packages or thermodynamic systems
that export property packages (such as TEA) installed on your system.

Each stream is based on a stream type. Each stream type references a property package. Multiple stream types can
reference the same property package in COFE, but each stream type can only reference a single property package.

To add a property package to your simulation, go to the Flowsheet Configuration window and open the Property
Packages page.

You can add a property package to your simulation by clicking on the Add button. A list of CAPE-OPEN Stand-Alone
property packages and Thermodynamic systems will appear. These are separated into version 1.0 and 1.1 CAPE-OPEN
versions. Some thermo servers may only be available in one particular version. See also Inserting models.

Each listed Thermodynamic system will export zero or more property packages. If a thermodynamic server is selected
for which multiple property packages are available, you are asked to select one. At this point, some thermodynamic
servers, such as TEA, may implement a custom interface that allows directly configuring a new system; to do so, hit the
New button (which may not be available, depending on the system).

After adding a property package, the compounds and property definitions that appear in the property package are
automatically added to the simulation.

To remove a property package from your simulation, select the property package and click remove.

To change the configuration of a property package, select the property package and click Edit. This functionality may
not be supported by the property package. In that case, Edit will do nothing.

You can rename a property package by clicking on the Rename button while the property package is selected. Property
package names must be unique to the simulation.

To get information on a property package, click Info while the property package is selected.

Reaction packages

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 3 of 54

To be able to work with unit operations that require reaction packages, you must add one or more reaction package to
your simulation. A reaction package defines a set of reactions, the kinetic rates or equilibrium data, the reaction heats
and various other properties of the reactions.

Reaction packages are external objects. You therefore will need to have reaction packages or reaction package managers
that export reaction packages (such as CORN) installed on your system.

To add a reaction package to your simulation, go to the Flowsheet Configuration window and open the Reaction
Packages page.

You can add a reaction package to your simulation by clicking on the Add button. A list of Reaction Package Managers
will appear. Each Reaction Package Manager will export zero or more reaction packages. See also Inserting models.

To remove a reaction package from your simulation, select the reaction package and click remove.

To change the configuration of a reaction package, select the reaction package and click Edit. This functionality may not
be supported by the reaction package. In that case, Edit will do nothing.

You can rename a reaction package by clicking on the Rename button while the reaction package is selected. Reaction
package names must be unique to the simulation.

To get information on a reaction package, click Info while the reaction package is selected.

Compounds
To inspect the compounds in your simulation, go to the Flowsheet Configuration window and open the Compounds
page.

The compounds shown at this page is the union of all compounds that are defined by all loaded Property packages.

You cannot add or remove compounds directly to the simulation, since compounds are defined by the property packages
in use. To add compounds to your simulation, make sure to add them to all property packages that you require to be able
to use these compounds in calculations. Adding a compound to a property package automatically makes that the
compound is present in the simulation. Similarly, in order to remove a compound from the simulation, make sure to
remove it from all the property packages that are in use. It is not required to remove a compound if you do not plan on
using it; for each stream type you can determine which compounds it supports.

To get information on a compound, select the compound and click the Info button.

To change the name of a compound as it appears in the simulation, select the compound and click Rename.

To change the order of the compounds, select a compound that you wish to move, and click the Up or Down button.

Properties
To inspect the properties in your simulation, go to the Flowsheet Configuration window and open the Properties page.

The properties shown at this page is the union of all properties that are defined by all loaded Property packages.

You cannot add or remove properties directly to the simulation, since properties are defined by the property packages in
use. To add properties to your simulation, make sure to add them to all property packages that you require to be able to
calculate these properties. Adding properties to a property package automatically makes that the properties are present
in the simulation. Similarly, in order to remove a property from the simulation, make sure to remove it from all the
property packages that are in use.

COFE will only support properties that are defined in the props.ini file in the COCO data folder. See defining
properties.

For each property, you can change the way it is displayed in the Stream Display. For each phase-type and two-phase-
type combination, you can choose whether to show Mixture type, Pure type, both or none. Also, you can change the
units that will be used for the property when it is displayed.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 4 of 54

Property definitions
COFE will only support properties that it knows of. This is because demands are put on the materials to be able to
perform unit conversion on property values as well as property value storage. Therefore, COFE will need to know a
number of details about the properties it is expected to support. These details are stored in the file props.ini in the COCO
data folder.

props.ini is a tab delimited data file; each item is delimited from another item with a tab character. If you decide to
modify props.ini, do it with care and back up the existing version before you begin. If COFE or TEA fail to read
props.ini, the material will not be able to store any properties and simulation becomes imposible.

The first line is a header line. All other lines of text in props.ini describe one propery each. The following items should
appear on each line.

property name 1.0


This is the CAPE-OPEN name of the property, as in the Thermodynamics 1.0 standard.

property name 1.1


This is the CAPE-OPEN name of the property, as in the Thermodynamics 1.1 standard.

description
A descriptive text of the property

default display
Determines the default way the property is displayed in the stream display. Combination of the values 1 (Overall), 2
(Vapor), 4 (Liquid) and 8 (Solid), so a value of 14 for Vapor, Liquid and Solid. Make the value a minus value to show
the Pure rather than Mixture values.

class
Property class. Determines the dimension of storage for the property. Currently, the only defined classes are:

A: scalar for mixture, vector for pure; i.e. density

B: vector for mixture, vector for pure; i.e. fugacity

extensive
Determines whether the property is extensive (1) or not (0). For example, enthalpy is extensive, so a value of 1 for
enthalpy.

canHaveTotal
Determines whether the property can be displayed for the flow (1) or not (0). For example, enthalpy can be displayed
for the flow (J/s) or per amount (J/mol), so a value of 1 for enthalpy.

pureComponent
If non-zero, the property is only available for pure compounds, so not for a mixture. Allowed values are:

1: the property depends only on temperature, e.g. idealgasenthalpy

2: the property depends only on pressure, e.g. glassTransitionTemperature

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 5 of 54

IsTwoPhase
Zero for a single phase property, 1 for a two-phase property.

MassBasisDependency
The power to use for molar weight during mass conversions.

Pa, N, J, mol or kg, m, s, K


The power for each of these units in the dimension, i.e. density (mol/m3 or kg/m3) should have 1 for mol or kg or mol
and -3 for m, with 1 for MassBasisDependency.

See alo: Material objects

Phase Info
The phase information page allows for inspecting and renaming the phases. For the selected phase, the aggregation state
is shown. Also shown is the name the phase as known to each property package to which it is mapped. If a property
package does not appear in the list, data relevant to that phase cannot be calculated for that property package.

Hit the Rename button to rename a phase. Although not required for thermo version 1.1 and higher, it is advised to use
'vapor' for the vapor phase and 'liquid' for the 1st liquid phase.

Stream Types
COFE can use more than one material stream type. Each stream type is associated to a property package, so before you
configure stream types, make sure to add at least one property package to your simulation. At least one stream type must
always be present. This is the default stream type. The default stream type cannot be removed from the simulation. Each
stream in the flowsheet is associated with a stream type.

To add a stream type to your simulation, go to the Flowsheet Configuration window and open the Stream Types page.
Click New to add a stream type to the simulation. Click Delete to remove the selected stream type from the simulation.
Click Rename to rename the selected stream type.

To change settings for a stream type, first select the desired stream type. You can change the description of a stream
type by clicking the Description button.

To associate a property package with the stream type, select it from the list of available property packs. More than one
stream type can be associated with the same property package.

By default, all the compounds exported by the property package will be available in the stream type. Remove check
marks for those compounds that you do not want the stream type to support.

Each stream type also has a default color scheme.

Flowsheet Options
To change the flowsheet options for a flowsheet, go to the Flowsheet Configuration window and open the Flowsheet
Options page.

Mass balance relative tolerance


This relative tolerance will be used to determine whether mass balances, component balances, mol fraction summations,
etc, are accurate.

Recycle relative tolerance


This relative tolerance will be used to determine whether recycles are converged during the solution of a flowsheet.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 6 of 54

Info level
This setting determines the amount of information that will be displayed in the Log pane of the flowsheet document.
Use Silent to suppress all but critical output. Use normal for a reasonable level of verbosity. The Verbose and Debug
levels show considerable more information, and might be useful to track down problems.

Maximum number of stored log lines


The log will not contain more lines than this number. All lines that appear above this number will cause earlier lines to
be removed from the log.

Maximum number of iterations


Determines the amount of iterations that can be used for each recycle in the flowsheet during the solution stage.

Max. successive Wegstein steps


Determines how many Wegstein steps are attempted before switching to Newton. Switching to the Newton method is
done automatically if the Newton method is not disallowed (see below) and divergence is detected after 5 successive
iterations. Setting this number to zero will cause the Wegstein method not to be used.

Max. successive Newton steps


Determines how many Newton steps are attempted when the Wegstein solution method is detected to diverge. If the
number of Newton steps is exceeded, the solution algorithm will switch back to the Wegstein method. Set to zero to
prevent the Newton algorithm to be used.

Newton method
The method used for Newton. Current options are:

Full: Full Newton; determines Jacobian at each iteration and performs line search for global convergence;
Broyden: Broyden's method; determines Jacobian at first iteration and when required. Jacobian is updated using
iteration information. Performs line search for global convergence;
Lazy: Lazy Newton method; determines Jacobian at first iteration. Jacobian is not updated for a fixed number of
steps or when required to to a failed or inaccurate step or change in state variables. Performs line search for global
convergence;

Relative Newton log P perturbation


The relative perturbation of log(P) in the Newton algorithm to determine gradients. Expressions are accepted.

Relative Newton log T perturbation


The relative perturbation of log(T) in the Newton algorithm to determine gradients.Expressions are accepted.

Relative Newton flow perturbation


The relative perturbation of component flows in the Newton algorithm to determine gradients. Expressions are accepted.

Calculate Dew- and Bubble point properties if not supported by the


property package
This will enable the properties dew point temperature, dew point pressure, bubble point temperature and bubble point
pressure even if they are not supported by the property package that is used. If the property package fails calculation for
these properties (which is attempted only once between different configurations of the property package), they will be
calculated by T-VF or P-VF equilibrium calculations.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 7 of 54

Calculate mixture overall enthalpy, enthalpyF, enthalpyNF, entropy,


entropyF, entropyNF, energy and volume if not supported by the property
package
This will enable the properties enthalpy, enthalpyF, entropy, entropyF and volume for the overall phase for the mixture
calculation type, even if they are not supported by the property package that is used. If the property package fails
calculation for these properties (which is attempted only once between different configurations of the property package),
they will be calculated by summation of the property over the present phases.

Reference state
Whether to use reference state correction and the reference conditions (temperature, pressure and phase). Expressions
are accepted.

Initialize solution with simplified models


Selecting this option will allow COFE to enable simplified models on unit operations that support this option. The
simplified models will only be used if user-specified initial guess values cannot be used to initialize the solution of
flowsheet recycles (e.g. after using the Reset button on the toolbar); the simplified solutions will be used if the initial
normalized recycle residual is above 10, and will be turned off after the first iteration at which the normalized recycle
residual drops below unity. The final solution for a converged flowsheet will never involve a simplified model solution.

Simplified model solutions are not a standard CAPE-OPEN feature. Unit operations that choose to support simplified
solutions can obtain the named value SimplifiedModelRequest from the ICapeCOSEUtilities implementation of the
simulation context. This value should be obtained during the Calculate call, and can change between two calculations.
The value of SimplifiedModelRequest is a boolean, with a value of TRUE indicating the unit operation may apply a
simplified model. As a guideline, a simplified model evaluation may ignore certain aspects of physics (such as heat
balances, pressure drop calculations, etc), in order to result a more stable and faster model evaluation. As also simplified
models may be perturbed for a Newton iteration, simplified models should generally not run with a lowered
convergence or integration tolerance.

Units of measure
All units of measure that are selected are stored for future use. If a new unit of measure is created, the default units will
come from the set of units of measure that is configured for the document. You can edit this set by clicking the Edit
button.

Sets of units-of-measure can be configured from the application preferences. To load a set of units-of-measure as the
default set, click the Select button.

If you have modified the default units-of-measure, you can click the Apply button to use the new defaults for all units-
of-measure that are currently present in the document.

Reference states
Each property package that is loaded can have their own reference state for enthalpy and entropy.

To correct for different reference states in different property packages, the Solve options page allows for turning on a
reference state correction.

If reference state correction is turned on, the reference state must be selected. The reference state can be in the ideal gas
phase, the vapor phase or the liquid phase. It will be at specified temperature and pressure (pressure is irrelevant if the
reference state is in the ideal vapor phase).

The reference state correction will apply to properties enthalpy and entropy, as well as to the properties enthalpyNF
(enthalpy which does not include heat of formation) and entropyNF (entropy which does not include entropy of
formation), but does not apply to enthalpyF (which does include enthalpy of formation) or entropyF (which does include
entropy of formation). The reference state correction is also applied to properties idealGasEnthalpy and
idealGasEntropy.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 8 of 54

The following table shows which property is used for reference state correction, depending on the reference phase:

reference phase
properties ideal gas vapor liquid
enthalpy, idealGasEnthalpy idealGasEnthalpy vapor enthalpy liquid enthalpy
entropy, idealGasEntropy idealGasEntropy vapor entropy liquid entropy
enthalpyNF idealGasEnthalpy vapor enthalpyNF liquid enthalpyNF
entropyNF idealGasEntropy vapor entropyNF liquid entropyNF

Reference state correction is applied by calculation the reference state property for each pure compound, and subtracting
the sum of products of mole fraction and reference state values from the calculated property before correction.

If reference state is applied, the property packages must provide idealGasEnthalpy for correction of enthalpy,
enthalpy.DmolFraction, enthalpy.Dmoles and idealGasEnthalpy. Note that reference states do not apply to temperature
and pressure derivatives. The property packages must supply idealGasEntropy for correction of entropy,
entropy.DmolFraction, entropy.Dmoles and idealGasEntropy. If reference state correction is turned on, and
idealGasEnthalpy is not available from the property package, all the enthalpy terms above will fail to evaluate.
Similarly, all above entropy terms will fail to evaluate in case of missing idealGasEntropy.

By default, reference state correction is turned off. There are three scenarios in which you may want to turn on reference
state correction:

When using multiple property packages: in this case different property packages may have different reference
states. Correcting for reference states makes sure that enthalpies and entropties from different packages are
comparable. When adding a property package after the first one, you will automatically be asked to turn on
reference state correction,
When using reactions: it is not always known whether heat of formation and entropy of formation are included in
the property package's enthalpy and entropy calculations. When turning on reference state correction, it is sure
that these are not included, and that heat of reaction for example still must be applied,
When you need the reference state to be known and you are not sure what the property package is doing.

Order of streams and units


The order in which streams and units are shown can be modified. The stream order affects the Stream Display as well as
any dialogs that request the user to pick a stream from the flowsheet. By default the streams sorting is done by
connectivity, with feed streams appearing first and product streams appearing last. The unit sort order affects all dialogs
where the user is requested to select a unit operation. By default, the unit sorting is done based on connectivity.

Stream sorting order


To change the way that streams sort, choose Stream Order in the Flowsheet Configuration dialog. Sorting options
include by Connectivity, Alphabetical, Right to Left, Top to Bottom and Bottom to Top. For each of these options, you
can force feed streams to always appear at the start of the list, and product streams to always appear at the end of the
list, by checking the appropriate boxes. You can also manually determine the order of the streams. Select the Manual
sort order, and move streams up and down in the list by using the Up and Down buttons.

Unit sorting order


To change the way that unit operations sort, choose Unit Operation Order in the Flowsheet Configuration dialog.
Sorting options include by Connectivity, Alphabetical, Right to Left, Top to Bottom and Bottom to Top. You can also
manually determine the order of the units. Select the Manual sort order, and move units up and down in the list by using
the Up and Down buttons.

Material streams
Material streams are flows of materials from one place in the flowsheet to another. Each material stream is associated
with a stream type, and can therefore carry only a specific set of compounds. More over, streams have a temperature, a
pressure, a phase composition and possibly a number of thermodynamic and/or physical properties.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 9 of 54

Information streams
Information streams represent a flow of information from one place in the flowsheet to another. The actual data on an
information stream can vary, and is determined by the first port such a stream is connected to. COFE currently only
supports a collection of scalar real data elements. You may not be able to connect the other end of an information stream
to a unit operation's information port if the unit operation decides that the data that is available on the stream (resulting
from connecting the first end of the stream) is not compatible with the data that is expected by the unit operation.

In COFE, in addition to information ports exposed by unit operations, you can add virtual information ports to a unit
operation. Virtual information ports are connected to a real parameter value (or real element of an array parameter).

Energy streams
Energy streams are flow of heat duty from one place in the flowsheet to another. Energy streams are much like
information streams, only the meaning (and names) of the information items transferred by the stream is pre-defined:

name meaning dimension


work the amount of energy that is transferred; must always be present W
temperatureLow, temperatureHigh the temperature range between which the energy is transferred K
axisFrequency the rotation frequency of an axis that is performing work s-1

Mind that inlet and outlet for an information port determines which unit operation is responsible for determining the
amount of data. Positive work is provided by an outlet and consumed by an inlet; the outlet determines the amount of
work. Negative work is provided by an inlet and consumed by an outlet; the outlet determines the amount of work.

Streams and unit operations


Streams can originate from a unit operation, or can be a feed stream. Streams can go to a unit operation, or can be a
product stream.

To add a stream to your flowsheet, first select the stream type on the toolbar. Then, select Insert stream from the menu
or the toolbar, or by pressing Ctrl+I. Click on the start position of the stream. Move your mouse to the end position of
the stream and click again. A stream can be connected to unit operations at the time it is inserted.

To remove a stream from the flowsheet, select the stream and press Del on the keyboard, or select Delete from the Edit
menu, or Delete from the menu that pops up when clicking with the right mouse button on the stream. Mind that all
selected streams and unit operations will be deleted.

The route of a stream is automatically determined. You can however add and remove points to the route that you want
the stream to follow. To add points to the route, right click on the stream. To remove a route point, right click on the
route point.

An attempt will be made to make the route such that streams are overlapping as little as possible, and streams do not
overlap with unit operations. The routes of streams are calculated in order in which they appear in the flowsheet. To
change the order of a stream in the flowsheet, select the stream and select and item from the Stacking Order menu that
appears when you click the right mouse button on the stream.

To set the properties for a stream, open the stream in the stream display. Hover your mouse over the stream to get more
information on the stream and its content.

You can change the name of a stream by clicking the right mouse button on the stream and select Rename. If the name
is displayed, you can also simply double click the name. The name of the stream will be displayed on the stream if the
Stream Labels sub-menu of the View menu is ticked. The name is always displayed on top of the stream, by default in
the centre of the stream's route. You can change the location of the name display by dragging the name, or right clicking
and selecting Label Location.

Stream comments
Right click on a stream and select Comment to add or change a comment for a stream. Streams with comments will

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 10 of 54

show an information icon. Hold your mouse over the icon to see the content of the comment.

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.

Reactors
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

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 11 of 54

clicking with the right mouse button on the unit operation and selecting Assign Reaction Package.

Controllers
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

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 12 of 54

operations.

Icons
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.

Labels
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.

Connecting unit operations


To connect an outlet of a unit operation, pick up the starting position of a stream using the mouse, and drop it on one of
the unit's connection points. You can only connect an outlet if the unit is exposing outlets of the proper type that are not
yet connected.

To connect an inlet of a unit operation, pick up the ending position of a stream using the mouse, and drop it on one of
the unit's connection points. You can only connect an inlet if the unit is exposing inlets of the proper type that are not
yet connected.

When you hold the start or an end of the stream over the unit operation's icon, the nearest connection point will be
highlighted.

To disconnect a stream from a unit operation, use the mouse to drag the connected end of the stream away from the unit
operation. In some cases (e.g. after modifying the unit operation in such a way that it has fewer connection points)
streams are automatically disconnected.

You can only connect material streams to material ports. You can only connect energy streams to energy ports. You can
only connect information streams to information ports.

In COFE, by default you are only allowed to connect material streams of the same material types to a unit operation.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 13 of 54

This is to prevent errors by unit operations that are not aware of stream types. For each unit operation, you can change
this option from the Ports page of the unit operation dialog.

In order to convert one material stream into another, a special internal unit operation type can be used, called the
StreamConverter.

Colours and status


The colors of streams and unit operations depend on their status. The following colours are used:
Gray: the specification of the stream or unit operation is incomplete
Black: the specification of the stream or unit operation is complete
Green: the stream or unit operation has been solved
Red: an error occurred while solving the stream or unit operation

A quick way to get more information on the status of a stream or unit operation is to hover the mouse over it until a
message pops up.

From the flowsheet settings dialog, Appearance tab, the default colour scheme may be changed, and additional colour
schemes may be defined. For a colour scheme, colours can be specified for the various states units and streams may be
in.

If multiple colour schemes are defined, the colour schemes applies to unit operations and streams can be changed using
the context menu when one or more units and/or streams are selected.

Selecting streams and unit operations


To select a stream or unit operation, click with the left mouse button.

To select multiple streams or unit operations, select the first one as described above, and select additional ones while
holding down the Shift or Control key on the keyboard. Clicking streams or unit operations that are already selected will
cause them to be unselected.

Alternatively, drag with the left mouse button to form a reactangle around the streams and unit operation that you want
to select.

When multiple streams and unit operations are selected, operations like moving and deleting can be performed on all of
them at the same time. To move the selection, hold down the left mouse button on one of the selected items, move the
mouse and let go of the mouse button.

Solving the flowsheet


Before you can solve the flowsheet, the specification must be ok. If the specification is not ok, you can not start the
solution procedure. To check whether the specification is ok, choose Validate from the Flowsheet menu, or press the
corresponding button on the toolbar, or use F8. If specification is not ok, messages will appear stating which
information is invalid or missing.

If the specification is ok, you can proceed to solve. Choose Solve from the Flowsheet menu, or press the corresponding
button on the toolbar, or use F5.

You can specify an initial guess for flows inside a recycle if the solution does not easily converge; see Stream Display.
The initial guess values are those that are on the stream at the moment the solution process is started. When you Reset
(Ctrl+R) the flowsheet or individual streams, manually specified values will be restored on a stream. You can wipe a
the complete content of a stream by selecting the stream (or multiple streams) and choosing Wipe from the menu that
pops up when clicking the right mouse button. You can then also remove the manual specification from the stream by
choosing Save Initial Guess after wiping the stream.

If you have problems setting up the initial guess, you can track the solution of unit operations manually. For each unit
operation that has all its inputs specified and for which all the inlet streams are complete, you can solve the unit by
selecting Calculate from the menu that pops up if you click the right mouse button.

The solution will alternate between the Wegstein method and the Newton method. In the Solution Options the

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 14 of 54

maximum number of successive iterations for each of the methods can be specified. Specifying zero iterations for a
method will turn the method off altogether.

You can abort the solution procedure by clicking the solve/stop button again, or by pressing Ctrl+C on the keyboard.
The solution procedure will only abort after the currently evaluating unit operation returns (this is an external process
and cannot be aborted). This may take some time; it is not required during this time to hit the stop button more than
once.

Stream display
To modify or inspect the content of a stream, open the stream in the Stream Display. To open a single stream in the
Stream Display, select the stream and choose Edit / View streams from the flowsheet menu, or use the Edit Stream
button on the toolbar, or press F10.

By default, the Stream Display will open as a new view, that can remain open while you are making your changes.
Multiple Stream Displays can be opened at the same time. If you start editing a selection of streams for which a Stream
Display is already open, this will be activated rather than creating a new Stream Display. A modal dialog will be shown
instead if you hold down Ctrl when starting the Stream Display.

To open all streams connected to a unit operation, select the unit operation, and then choose Edit Streams. The Stream
Display will contain all selected streams and all streams connected to selected unit operations. If nothing is selected, all
streams will be opened in the Stream Display.

To open or close a section of information in the stream dialog, click on the gray section title bar. The green triangle will
indicate open and closed sections. Sections are only present if there is information to show in the sections.

You can add or remove streams in an open dialog and change the display order of streams by using the menu that pops
up when you click the stream header, or when you right-click on stream data.

To modify a value, click on it. Expressions are accepted for all real inputs. To modify the unit / dimension of a value,
click on it. This will modify the dimension for all values of the same property. Not all values of a stream can be
modified; in general only the values of the Overall section and the name and description in the Stream section can be
modified. If you attempt to modify vapor phase fraction, an equilibrium calculation at fixed vapor fraction will be
attempted. Clicking on values that cannot be modified has no effect.

The stream display allows to specify temperature, pressure, composition and total flow directly. If you want to make a
specification using vapor fraction, first make a complete specification based on pressure and temperature at which vapor
is present. Next, click on the displayed value of vapor fraction to set its value. You will have to specify whether you
want pressure or temperature to remain at its specified value.

Similarly, to specify a combination of overall enthalpy or entropy (or enthalpyF or entropyF) and pressure or
temperature, make sure that overall enthalpy or entropy are displayed, and then click on it.

The order in which the streams appear in the Stream Display corresponds to the Stream Order in the Flowsheet
Configuration. You can manually change the order of streams, by right clicking on the stream data and select To Left,
To Right, To First or To Last.

The properties that are displayed in the Stream Display can be chosen from the Properties page of the Flowsheet
Configuration window.

Properties that are shown in the Stream Display can be added to the Watches by using the menu that pops up when
right-clicking the value.

Initial guess and reset


All values present on streams that are not feed streams (i.e. streams of which the starting point is connected to a unit
operation) will serve as initial guess for recycles.

Values explicitly set on streams serve as reset values. This is, if you reset a stream, these values will be restored on the
stream. You can reset a stream by choosing reset from the menu that pops up if you click the right mouse button on the
stream in the flowsheet view. If you reset the whole flowsheet (by using the button on the toolbar, or the menu), all
streams will be reset to values that have been manually set on the stream, or empty values if no values have been set for

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 15 of 54

a stream.

Therefore, after resetting the flowsheet, manually set values will serve as initial guesses. To clear manually set values,
edit the value as described above, and leave it blank or type N/A. A quick way to remove all values from a stream is
clicking on the stream in the flowsheet with the right mouse button, and select Wipe from the menu that pops up.

Flowsheet log
Below each flowsheet window, a flowsheet log is displayed that shows messages that are logged during flowsheet
manipulation and during the solution phase.

In the flowsheet options can be specified how long the long can be (maximum number of lines) and how verbose the log
should be.

To empty the log, choose Clear Log from the File menu.

Errors and warnings view


As alternative to the log, the errors and warnings view can be activated instead of the log view. This will keep track of
all validation and solve errors and warnings.

Flowsheet printing
To print your flowsheet, make sure the flowsheet window is active, and select Print from the File menu or use Ctrl+P.
By default, flowsheets print on a single page. The page layout is used from the current printer setup; you may want to
specify the printer paper to be used in landscape.

To print using multiple pages, select Flowsheet Print Options from the File menu. Here, you can specify the number of
pages in width and height. You can also specify which part of the flowsheet is used for determining the print size. By
default, this is the entire extent of the flowsheet plus a margin. Use the custom settings to adjust the print range.

You can also copy all items or a selection from the flowsheet, and paste in another application to print.

Inserting models
When inserting unit operations, property packages or reaction packages, the CAPE-OPEN model selection dialog will
show. Here, all the registered CAPE-OPEN models of the specified type are shown.

For each model, you can unfold the model details by expanding the model's tree node. You can get more model details
if you click About when a model is selected.

Model classes
Models may appear in a model class, e.g. all reactor models can be shown in model class Reactors. To change the class
that a model appears in, click on the model with the right mouse button and select Model Class. Model classes are stored
between COFE sessions in the "ModelClasses.dat" configuration file in the COCO data folder (the user copy resides in
[Application Data]\COCO\data; the system copy in [COCO installation folder]\data; user entries take precedence over
system entries).

Inserting objects
From the Insert menu, various types of objects can be inserted into the flowsheet:

Graphics objects: poly-lines, text, rectangles, ovals and bitmaps;


OLE objects (any type of object from any application that supports OLE);
Report objects: stream report, unit report, unit parameter report, author report.

Moving, sizing and deleting objects

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 16 of 54

To move an object, drag the object to the desired location. To size an object, drag one of the size handles of the object to
obtain the desired size. To delete an existing object, select the object and hit Delete.

An object can be selected by clicking on it. Multiple objects can be selected by drawing a marquee around it. Individual
objects can be added to the selection or removed from the selection by holding down Shift or Control while selecting the
object.

You can change the properties of an object by double-clicking on the object.

A selection of multiple objects can be moved or deleted at the same time. Scaling for multiple objects is not supported.

Stacking order
The order in which the objects are drawn is called the stacking order. This determines which object is in front in case of
overlapping objects. You can change an object's location in the stacking order by clicking on the object with the right
mouse button and select Move Up, Move Down, Move To Top or Move To Bottom.

Reports
Reports behave like any other object, except for the size of a report is determined by its content. You can change the
font size (and therefore the report size) and some other properties that affect the size of the report from the Format page
by double-clicking on the report.

Reports will automatically be updated as the data in the report changes. The unit of measure of the data is the same unit
of measure that is used for the data in other contexts. For stream properties, the unit of measure can be modified from
the stream display (double click on a stream), or from the Properties page of the Flowsheet Configuration.

The unit of measure by default shows as a separate column at the end of the table. This can be turned off in the report
configuration; the unit of measure will then show in the property column.

Stream reports

Stream reports will show selected properties of selected streams. Double click the report to select streams, and change
the order of streams. Overall properties as well as per-phase properties can be selected. For energy and information
streams, the selected properties are ignored, and all data contained in the stream is shown.

Overall properties as well as properties for each existing phase can be added to the report. On the Format configuration
tab, the composition threshold will cause compounds for which the composition fraction is below this number show as
zero composition or zero component flow.

Unit reports

Unit operations optionally come with reporting functionality. One can check the reports that are exposed by a unit
operation by double clicking on the unit operation and inspect the first tab. The "Solve log" report if present is generated
by COFE, and not part by the unit operation.

Upon inserting a unit report in the flowsheet, the unit operation and the desired report must be selected. Additional
report properties, like tab size and line wrapping, can be specified.

Unit parameter reports

Unit parameter reports will show values for parameters of unit operations. You can add multiple parameters of multiple
unit operations to the same report.

Author report

The author report will show the following properties (if filled in): title, author, company and document creation date.
These can be modified by selecting Properties from the File menu.

Flowsheet report
To generate a textual flowsheet report, select Report from the flowsheet menu or hit Ctrl+T. The flowsheet report

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 17 of 54

shows the following items

Document summary
Properties from the Summary box (File menu)
Report creation date
Solution status
All stream types
Property package name
Supported properties (optional)
Supported compounds
Supported phases
Tables of each material stream of the stream type
Stream name
Stream connections
Overall properties (configurable)
Per-phase properties (configurable) for existing phases
Tables with energy streams (if present)
Stream name
Stream connections
Properties
Tables with information streams (if present)
Stream name
Stream connections
Properties
Each unit operation
Summary
Type
Name
Description
Status
All ports
Name
Description
Direction
Type
Connected stream
All parameters (excluding configured suppressed ones)
Balance (if solved)
Mass balance
Enthalpy balance (if enthalpy is available)
EnthalpyF balance (if enthalpyF is available)
Entropy balance (if entropy is available)
EntropyF balance (if entropyF is available)
Component balances
Unit reports (configurable)
Overall balances (if flowsheet is solved)
Mass balance
Enthalpy balance (if enthalpy is available)
EnthalpyF balance (if enthalpyF is available)
Entropy balance (if entropy is available)
EntropyF balance (if entropyF is available)
Component balances

Configuration
When selecting the flowsheet report, the flowsheet report configuration is shown. Apart from the above items that are
indicated as configurable, you can indicate the desired line length, number of digits for reporting numbers and tab stop
size (in case of unit operation reports containing tabs).

The composition threshold sets a value below which compounds are reported as absent. Compounds with a composition
fraction less than the specified value show as having zero composition and zero component flow.

The column sizes for tables are automatically determined from the entries that will appear. The line length will be
adjusted if it is too small to contain a table with at least one data column.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 18 of 54

Report window
The report will show in a textual report window; by default this is a View that can be kept open while working with the
flowsheet. As long as the flowsheet is not modified, the Report View title will include "up-to-date". Multiple reports at
different solutions can be open at the same time. Hit Ctrl+S to save the report as text file. If multiple views cannot be
opened (such as in embedded flowsheets, the report will show in a modal dialog. Hit ESC to close the report.

Add-ins
Flowsheet add-in objects are objects that implement a flowsheet monitoring class. They can use the flowsheet
monitoring interface provided by COFE.

COFE comes installed with these add-ins, but you can use third party add-ins or create your own.

To add a flowsheet add-in, choose Add from the Add-in menu. To remove or rename and add-in, or sort the add-ins
order, choose Manage Add-ins from the Add-In menu.

To activate an add-in, you can either use the Add-In Manager, or directly select the desired add-in from the Add-In
menu.

Plots
COFE has plotting / graphing functionality built in. See one of the following for more information:

Creating plots
Appearance and properties
Missing data points
Automatic calculation
Printing

Creating plots
To create a plot, choose Create from the Plot menu and select the type of plot you want to create. Depending on the type
of plot, you will be asked to provide additional information on what to plot.

By default, plots are shown in a separate window. Most plots can be embedded in the flowsheet as well however. Upon
creation, you can indicate whether you want to embed the plot. Once the plot is created in a view, you can embed the
plot by selecting Embed from the Plot menu. Embedded plots can be taken out of the flowsheet into a separate view
(right click on the plot).

To edit an embedded plot, double click on the plot.

Once a plot is created, you can add series to a plot by selecting Add Series from the Plot menu. You can only add series
to a plot that are consistent with the type of plot; for example, you can only add temperature series to a temperature plot.

Plot types
The following plot types are currently available:

Temperature plot
Pressure plot
Binary plot
TX plot
PX plot
Array parameter plot

Temperature plot
A temperature plot is a plot of any thermodynamic or physical or reaction property that is known to a stream versus

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 19 of 54

temperature.

To create a temperature plot, select Temperature Plot from the Create plot sub menu of the Plot menu. Once a
temperature plot is created, you can add more series to the plot by selecting Add Series from the Plot menu if the plot is
active, or press Ins.

To create a temperature plot with reaction properties, select Temperature Plot With Reaction Data from the Create plot
sub menu of the Plot menu.

Before creating a temperature plot menu, you must create a stream. A series of a temperature plot always refers to a
stream. Even if none of the streams conditions are used, the stream still serves as a reference for the thermodynamic
models used by the stream type of the stream.

Before you can create a plot with reaction data, at least one reaction package also needs to be present in the simulation.

So you can create plots of properties using different thermodynamic properties by creating two stream types with
different models, using each stream type for creation of a stream. Then create a temperature plot using one of the
streams, and add a series to the plot using the other stream.

During creation of a plot or a series, you will be prompted for the following input:

Stream
The selected stream for plotting serves as the basis for the thermodynamics and as a reference point for all properties
that are not varied (pressure, concentration, ...)

Reaction Package
If you have chosen to create a plot with reaction data, you will be asked for the reaction package to calculate the data.

Reaction
If you have chosen to create a plot with reaction data, you will be asked for the name of the reaction that the property is
to be calculated for.

Property
The property to plot. In addition to the thermodynamic and physical properties that are exported by the property package
associated with the stream type of the selected stream, you can plot "mass fraction", "mole fraction" and "phase
fraction". For a reaction data plot, only reaction properties will be shown.

Phase
The identifier of the phase for which to plot the property for. Not all combinations of phases and properties are allowed
(e.g. bubble point is only allowed for the Overall phase). Also, not all combinations of phases and properties make sense
(some may not be supported by the property package, like surface tension for the vapor phase).

For a reaction plot, this will be the reaction phase as exported by the reaction package for the selected reaction.

Pure or Mixture
The calculation type for the property.

Depending on the above choices, the property may be a scalar, vector or matrix. For a vector and matrix you can choose
which compounds you want to plot the selected property for. Selecting a compound for a vector property results a single
plot series; selecting a compound for a matrix property results a vector of plot series.

This does not apply to reaction properties.

Composition type

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 20 of 54

The following composition types can be used:

Specified Phase: use the composition corresponding the selected phase, as it appears in the selected stream.
Overall Phase: use the composition corresponding to the Overall phase of the selected stream.
Equilibrium: use the composition corresponding the selected phase, after calculating the equilibrium for each
plotted data point.
Override: specify the composition to use.

Pressure type
The following pressure types can be used:

Stream: use the pressure of the selected stream.


Override: specify the pressure at which to plot.
Offset to stream: specify the pressure to add to the pressure of the selected stream.

Range
The temperature range for the independent axis.

Pressure plot
A pressure plot is a plot of any thermodynamic or physical or reaction property that is known to a stream versus
pressure.

To create a pressure plot, select Pressure Plot from the Create plot sub menu of the Plot menu. Once a pressure plot is
created, you can add more series to the plot by selecting Add Series from the Plot menu if the plot is active, or press Ins.

To create a pressure plot with reaction properties, select Pressure Plot With Reaction Data from the Create plot sub
menu of the Plot menu.

Before creating a pressure plot, you must create a stream. A series of a pressure plot always refers to a stream. Even if
none of the streams conditions are used, the stream still serves as a reference for the thermodynamic models used by the
stream type of the stream.

Before you can create a plot with reaction data, at least one reaction package also needs to be present in the simulation.

So you can create plots of properties using different thermodynamic properties by creating two stream types with
different models, using each stream type for creation of a stream. Then create a pressure plot using one of the streams,
and add a series to the plot using the other stream.

During creation of a plot or a series, you will be prompted for the following input:

Stream
The selected stream for plotting serves as the basis for the thermodynamics and as a reference point for all properties
that are not varied (temperature, concentration, ...)

Reaction Package
If you have chosen to create a plot with reaction data, you will be asked for the reaction package to calculate the data.

Reaction
If you have chosen to create a plot with reaction data, you will be asked for the name of the reaction that the property is
to be calculated for.

Property
The property to plot. In addition to the thermodynamic and physical properties that are exported by the property package

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 21 of 54

associated with the stream type of the selected stream, you can plot "mass fraction", "mole fraction" and "phase
fraction". For a reaction data plot, only reaction properties will be shown.

Phase
The identifier of the phase for which to plot the property for. Not all combinations of phases and properties are allowed
(e.g. bubble point is only allowed for the Overall phase). Also, not all combinations of phases and properties make sense
(some may not be supported by the property package, like surface tension for the vapor phase).

For a reaction plot, this will be the reaction phase as exported by the reaction package for the selected reaction.

Pure or Mixture
The calculation type for the property.

Depending on the above choices, the property may be a scalar, vector or matrix. For a vector and matrix you can choose
which compounds you want to plot the selected property for. Selecting a compound for a vector property results a single
plot series; selecting a compound for a matrix property results a vector of plot series.

This does not apply to reaction properties.

Composition type

The following composition types can be used:

Specified Phase: use the composition corresponding the selected phase, as it appears in the selected stream.
Overall Phase: use the composition corresponding to the Overall phase of the selected stream.
Equilibrium: use the composition corresponding the selected phase, after calculating the equilibrium for each
plotted data point.
Override: specify the composition to use.

Temperature type
The following temperature types can be used:

Stream: use the temperature of the selected stream.


Override: specify the temperature at which to plot.
Offset to stream: specify the temperature to add to the temperature of the selected stream.

Range
The pressure range for the independent axis.

Binary plot
A binary plot is a plot of any thermodynamic or physical property that is known to a stream versus a composition
ranging between two pure compounds.

To create a temperature plot, select Binary Plot from the Create plot sub menu of the Plot menu. Once a binary plot is
created, you can add more series to the plot by selecting Add Series from the Plot menu if the plot is active, or press Ins.

Before creating a binary plot, you must create a stream. A series of a binary plot always refers to a stream. Even if none
of the streams conditions are used, the stream still serves as a reference for the thermodynamic models used by the
stream type of the stream, and the compounds which are available.

So you can create plots of properties using different thermodynamic properties by creating two stream types with
different models, using each stream type for creation of a stream. Then create a binary plot using one of the streams, and
add a series to the plot using the other stream.

During creation of a plot or a series, you will be prompted for the following input:

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 22 of 54

Compounds
The compounds for which to create the plot; the independent axis will vary from the second compound specified on the
left side, to the first compound specified on the right side.

Stream
The selected stream for plotting serves as the basis for the thermodynamics and as a reference point for all properties
that are not varied (pressure, temperature, ...)

Property
The thermodynamic or physical property to plot. In addition to the properties that are exported by the property package
associated with the stream type of the selected stream, you can plot "mass fraction", "mole fraction" and "phase
fraction".

Phase
The identifier of the phase for which to plot the property for. Not all combinations of phases and properties are allowed
(e.g. bubble point is only allowed for the Overall phase). Also, not all combinations of phases and properties make sense
(some may not be supported by the property package, like surface tension for the vapor phase).

Pure or Mixture
The calculation type for the property.

Depending on the above choices, the property may be a scalar, vector or matrix. For a vector and matrix you can choose
which compounds you want to plot the selected property for. Selecting a compound for a vector property results a single
plot series; selecting a compound for a matrix property results a vector of plot series.

Temperature type
The following composition types can be used:

Stream: use the temperature of the selected stream.


Override: specify the temperature at which to plot.
Offset to stream: specify the temperature to add to the temperature of the selected stream.

Pressure type
The following composition types can be used:

Stream: use the pressure of the selected stream.


Override: specify the pressure at which to plot.
Offset to stream: specify the pressure to add to the pressure of the selected stream.

TX Plot
The TX plot is a special case of the binary plot. It is a shortcut way to plot the properties dewPointTemperature and
bubblePointTemperature vs binary composition.

To make a TX plot, the properties dewPointTemperature and bubblePointTemperature must be known to the stream
used for the plot series.

PX Plot
The PX plot is a special case of the binary plot. It is a shortcut way to plot the properties dewPointPressure and
bubblePointPressure vs binary composition.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 23 of 54

To make a PX plot, the properties dewPointPressure and bubblePointPressure must be known to the stream used for the
plot series.

Array Parameter Plots


The array parameter allows plotting 1D homogeneous double precision array parameters; you can plot a parameter vs. a
parameter, a parameter vs index, or index vs. a parameter. When plotting a parameter vs. a parameter, the number of
elements in the parameters must match.

You can also plot 1D arrays extracted from multi-dimensional arrays. In this case, for an n-dimensional array, you will
have to specify the indices for n - 1 dimensions, so that only one dimension remains. You can change the fixed indices
from the plot series properties (double click the series or its legend).

Plot properties
To change the appearance of an item in a plot, double click the item.

The default colors and resolution for new plots can be configured in the application preferences.

You can change axis properties by double clicking an axis (or the area containing the axis label), you can change series
properties by double clicking a series (in the legend or in the plot area), you can change the background properties by
double clicking the background, and you can change the legend properties by double clicking the legend (but not on a
series).

Missing data points


If errors occur during the calculation of a plot series, data points will be missing. This will result in gaps in the plot
series, or the plot series not appearing at all.

To find out why the points are missing, look at the error report for a plot series. You can obtain the error report by
double clicking the series. You can double click the series in the plot area (if not all points are missing) or in the legend.

Automatic calculation
By default, plots automatically recalculate when the dependent material changes, when the plotting properties (like axis
range) change, or when the thermodynamic models underlying the material have been altered.

Recalculating plot series can take some time. You can turn off the automatic recalculation for a plot from the Plot menu.
When a plot that does not automatically recalculate has been invalidated, it will show that a recalculation is required,
rather than showing the plot. You can recalculate a plot manually from the Plot menu.

Printing plots
To print a plot, make sure it is active and choose Print from the file menu. Plots will always be printed on a single page,
using the page setup for the active printer. If you want to print on a part of the page, simply select a smaller page from
the printer setup window, or use Copy from the Edit menu when nothing is selected in the plot, paste in another
application for further processing there.

Parametric studies
To study how flowsheet input values (e.g. feed stream values, unit operation parameters) affect the solution of the
flowsheet, Parametric Studies can be used. To start a Parametric Study, make sure that the flowsheet is solved. Then
select Parametric Study from the Flowsheet menu (or hit F9).

Using parametric studies, one can perform a manual optimization of a flowsheet. Make sure to select the value which is
to be optimized as an output, and the values that are to be modified as inputs. Once the study solves, the best input
values can be selected from the study results.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 24 of 54

Selection of input values


On the Inputs page, select the input values that you want to modify. To add an input value, click the Add button.
Multiple Input values can be selected in the New Input Parameter dialog.

For the selected input, the current value will be shown in the Parametric Study dialog. Enter the lower and upper limit of
the input value for your study. Expressions are accepted. Also enter the number of intervals that the input value should
be modified over. By default, each interval is equally sized. For input values that are of logarithmic nature, such as
pressures, it may be better to change to increments that are equal in the logarithmic domain. Zero intervals are allowed
only if the minimum and maximum value for an input are equal.

Inputs can be renamed by clicking on the input name, or selecting the input and click the Rename button.

Each input value will be solved for (number of intervals + 1) values. For each combination of input values, a flowsheet
job will be solved. The initial guess for each job will be taken from the closest solution available. It is assumed that the
input values that appear first in the list have the least impact on the flowsheet solution; therefore it is best to keep values
that allow for an easy solution when modified to be first in the list. The order of inputs can be modified by using the
Move Up and Move Down buttons.

The unit of measure of input values can be changed by clicking on the displayed unit of measure.

Selection of output values


On the Outputs page, select the values of the solution that you are interested in. It is best to add all the outputs that you
may be interested in, as adding values after the study has started requires re-solving the study.

Like the inputs, the name and unit of measure of output values can be changed. Also the order in which the outputs
appear can be modified.

Solving the parametric study


One input and output values of interested have been configured, click OK to solve the parametric study.

Parametric studies will always solve in background threads. By default, up to 4 threads will be used. If you find that the
document fails to solve unexpectedly, or if you find that COFE crashes, one of the models you are using may not be
implemented in a thread-safe manner. In this case, please try again with the maximum numbers of threads set to 1.
Multiple threads will allow maximum use of multiple nodes on a multi-node computer. If your computer is equipped
with more than 4 nodes, please adjust the maximum number of concurrent jobs accordingly. The maximum number of
concurrent solutions can be specified in the Application Preferences.

A Parametric Study view will open that initially lists all values of inputs. While the jobs are solved in the background,
output values will appear in the table. The right-most column will show the status of each of the jobs. The second
column will show which job is used as an initial guess for a given job (no entry in this column indicates that the current
solution is used as initial guess).

To abort the solution of the parametric study, hit the Stop button on the toolbar. It may take a few seconds for all jobs to
terminate.

Parametric study results


If a job has solved with warnings, the warnings can be inspected by clicking Status text for that job (which appears in
the right-most column). If a job has failed to solve, the errors that were collected during the course of solving the job are
available by clicking the status text of that job.

The results can be plotted; you can use one input value on the X-axis, and for all other inputs either select a particular
value, or select that each value will create its own curve. The result plot can be created while the study is solving; points
that become available when jobs finish are automatically added to the plot. For inputs for which a particular value has
been selected, you can select a different value by opening the plot's properties dialog.

Multiple parametric study windows can be open, but not all may be up to date. As long as the flowsheet is unchanged
since starting the study, the text up-to-date will appear in the study's title.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 25 of 54

The results can be copied to other applications by using Copy from the Edit menu; the tab-delimited values will be
copied to the clipboard, ready to paste in for example a spread sheet application. To save the study results in a text file,
choose Export Parametric Study Results from the File menu.

Document Explorer
The Document Explorer quickly allows access to the open documents in COFE, and each of the views that are open for
each document. So quickly switch to a particular document, just click on the document in the Document Explorer. This
will activate the most recently used view. To quickly select a particular view, just click on the desired view in the
Document Explorer.

The Settings node on each view will allow quick access to the Flowsheet Configuration dialog.

To open a document's Properties, or to close a document, right click on the Document node. To quickly close a
particular view, right click on the view. Closing the last Flowsheet view will close the entire Document.

The Document Explorer can be shown or hidden from the View menu, and by default docks to the left side of the COFE
window; the Document Explorer window can also be undocked, or docked to the right side of the COFE window; use
the mouse to drag the Document Explorer window to its desired position.

Watches
Using COFE's Unit Operation dialog, you can access the values of parameters and elements of array parameters. Using
the Stream Display, you can access all values of streams.

Values of Unit Operation Parameters, Unit Operation Parameter array elements or certain Stream values can be added to
the Watch window, for quick inspection and editing. The Watch window can be shown or hidden from the View menu,
and by default docks to the left side of the COFE window; the Watch window can also be undocked, or docked to the
right side of the COFE window; use the mouse to drag the Watch window to its desired position.

To add values to the Watch window, right click the desired parameter values in the Unit Operation dialog, or the desired
Stream values in the Stream display. Alternatively, right-click with the mouse in the Watch window and select Add
Watch.

Watch values are grouped in sections, according to the Stream or Unit operation that the Watch value belongs to. You
can sort the individual watches inside a section by dragging a value to its desired position. You can sort the sections by
dragging an entire section to its desired position.

To remove a watch from the Watch window, right-click on the Watch value and select Remove.

Input values can be edited in the Watch window. Just click on the value to edit. Expressions are accepted for real values.

The unit of measure cannot be modified in the Watch window; use the Unit Operation dialog or the Stream Display to
change the desired unit of measure.

Watch values will update automatically when values are changed.

A flowsheet as Unit Operation


You can run a COFE flowsheet as unit operation. This makes it possible to use 'sub-flowsheets' in COFE, but also in
other simulation environments. Inserting a flowsheet as unit operation works just like inserting other unit operations;
insert a unit operation of type "COFE Flowsheet Unit Operation".

Initially, the inserted flowsheet will be empty. When editing the unit operation, a flowsheet editing window will appear
that let's you configure the flowsheet. Selecting Import Existing Flowsheet from the Unit Operation menu allows for
loading a pre-configured flowsheet.

Streams and external connections


After loading an existing flowsheet, or when adding streams, streams may be present that do not flow to or from an
internal unit operation. These streams are global feed and product streams to the entire embedded flowsheet. Each of

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 26 of 54

these streams will automatically be mapped to a port. The ports must be connected to streams in the host simulation
environment for the flowsheet unit operation to be able to run. Upon calculation, values from the external streams will
be copied to the internal feed streams. Then the flowsheet is calculated. Finally, values of the product streams are copied
to the external product streams.

The compounds on the internal material streams must match the compounds on the streams connected to the external
ports; the order may differ, but each of the internally present compounds must match exactly one of the externally
present compounds. The matching is automatic, but you may be asked to identify which external compound matches an
internal compound at the moment a port is connected. Your choice is remembered and you will not be asked again. You
can inspect and reset previously matched compounds (if any) from the Unit Operation menu while editing the flowsheet
unit operation.

For energy and information ports, an exact match is not required. The mapping between external and internal data items
is automatic; at least one data item must be successfully mapped. Internal input data items that cannot be mapped will be
set to a missing number. External output data items that cannot be mapped will be set to their default value (if one is
available) or to a missing number.

During copying from and to external material streams, the thermodynamic equilibrium will be recalculated. If the
external thermodynamics are consistent with the thermodynamics used for the internal stream, the equilibrium
calculation will give the same values. For different internal and external thermodynamic systems, these values may be
different and may depend on which variables are kept fixed for the equilibrium calculation.

Selecting External Ports from the Unit Operation menu allows for inspecting all external ports currently present, and for
configuring which values are kept constant during the equilibrium calculation when copying from and to external
material streams. For the TP specification, temperature and pressure are kept constant. For the PH specification,
temperature and enthalpy are kept constant. For the Auto specification, TP will be used by default. If there is only one
compound present on the material stream, PH will be used instead.

Internal and external parameters


The internal unit operations may expose parameters. These parameters can be exposed to the external simulation
environment, as part of the flowsheet unit operation. To configure which parameters are exposed, select External
Parameters from the Unit Operation menu. Setting parameters in the host simulation environment will immediately
translate into setting the corresponding parameters on the internal unit operations.

Internal thermodynamic systems


Configuring thermodynamic systems for the embedded flowsheet works like configuring thermodynamics of any COFE
flowsheet. In addition to the CAPE-OPEN Property Packages, you can also add thermodynamics that are consistent with
the material streams connected to the external material ports. Multiple external thermodynamic systems are supported:
you can add one thermodynamic package for each external material port.

If a port disappears (because the internal stream is deleted or connected to an internal unit operation), the
thermodynamic system associated with that port (if present) is automatically removed.

The compounds definitions of a thermodynamic system that uses the material stream connected to an external port will
match the compounds on the external material stream. Using external thermodynamics thus allows for an easy way to
make sure that the compounds match, and will ensure thermodynamic consistency with the host environment.

Forwarding messages
Messages that appear in the log of the embedded flowsheet are - if supported by the host simulation environment -
automatically forwarded to the host environment's log. This can be disabled by unchecking Forward Logged Messages
To Host from the Unit Operation menu.

Applications of flowsheets embedded as unit operations


One can use flowsheets embedded as unit operations to

create sub-flowsheets in COFE,


create COFE based sub-flowsheets in other CAPE-OPEN compliant simulation environments,
get things to run in other CAPE-OPEN compliant simulation environments if support for certain features lacks in

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 27 of 54

these environments, but is present in COFE. For example: if a third party unit operation only supports version 1.1
thermodynamics and a host simulation environment only supports version 1.0 thermodynamics, you can add a
COFE based flowsheet and insert the third party unit operation in there. Configure usage of the external
thermodynamics, and COFE will take care of the version 1.0 / version 1.1 conversions.

Calculator
COFE provides a tool to calculate properties, reaction properties and equilibria at any given condition. To open the
calculator tool, select Calculator from the Flowsheet menu, or press F4. You can only enter the calculator, if at least one
property package is existing in your simulation.

When the calculator is open, you will first have to select one of the following types of calculations:

Equilibrium: do an equilibrium calculation,


Property: calculate a physical or thermodynamic property or one of its derivatives. Calculations can be done for a
single point or for a range of pressures or temperatures.
Reaction property: calculate a reaction property. Calculations can be done for a single point or for a range of
pressures or temperatures.

You will be guided through the specification for your calculation. Not necessarily all the data that you can enter is
required. For example, when calculating bubble point temperature there is no need to specify Temperature, but the
calculation will likely fail if you do not specify Pressure.

To open the calculator using all the data of an existing stream, right click on the stream and select Calculator For This
Stream. To open the calculator using all the data of an existing temperature or pressure plot series, right click on the
series and choose Open Calculator For This Series.

Select Use Mole Fraction or Use Mass Fractions from the Calculator menu to switch the Calculator tool to mole or mass
fractions for compositions and phase fractions.

To use the data in another application, use Copy from the Edit menu. The data will be on the clipboard in textual, tab
delimited format, ready to paste in any spread sheet application.

Expressions are accepted for all real inputs in the calculator.

Automation
COFE can be loaded into an active document container, like for example Microsoft Excel. An instance of a COFE
flowsheet document can also be created by means of automation (OLE/COM), for example in Microsoft Visual Basic.

Note: If you want to use COFE in excel, skip this chapter and start reading here.

Using both of the above approaches, one can obtain programmatic access to obtain information from and manipulate
items inside the COFE flowsheet document. This chapter describes how to create an instance of a Flowsheet document,
and how to access the document items by means of automation.

COFE exposed - where possible - all CAPE-OPEN interfaces through its automation interfaces. The exposed interfaces
allow you to manipulate all COFE objects, but are primarily intended for accessing information in a read-only manner.
Some operations are safe, that is, you can for example safely change the values of temperatures or compositions in
streams and then study the effect of it. All changes related to the topology of the flowsheet itself however are advised to
be changed only through COFE's front end. Even though you could instruct a unit operation's port to disconnect from its
material, COFE would not know about it and would assume the material is still connected to the port. So you are
advised to not manipulate any information related to the topology of the flowsheet other than through the COFE user
interface. MANIPULATING COFE'S TOPOLOGY THROUGH AUTOMATION MAY LEAD TO UNPREDICTIBLE
BEHAVIOUR

For more information, see:

CAPE-OPEN documentation references


Creating a Flowsheet document using automation
Interface descriptions
Using COFE in Excel

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 28 of 54

CAPE-OPEN references
Only few of the interfaces implemented by the COFE automation objects are defined by COFE. Most interfaces
are defined by the CAPE-OPEN standard.

Documents describing the exposed CAPE-OPEN interfaces are included in this help file. These are however
merely copies of the original documents that are available from CO-LaN.

The following documents are used in this help file:

Document Original location Description


CAPE-OPEN version 1.1 CO-LaN v1.1 Business Interfaces Interfaces describing material objects and
thermodynamic interface objects related to physical and thermodynamic
property calculations
CAPE-OPEN version 1.0 CO-LaN v1.0 Business Interfaces Interfaces describing material objects and
thermodynamic interface objects related to physical and thermodynamic
property calculations
CAPE-OPEN Unit CO-LaN v1.0 Business Interfaces Interfaces describing unit operation objects,
Operations Interface their ports and other interfaces as exposed by
Specification unit operations
CAPE-OPEN Parameter CO-LaN v1.0 Common Interfaces Interfaces describing parameters and
Common Interface parameter specifications.
CAPE-OPEN Collection CO-LaN v1.0 Common Interfaces Interfaces describing collections of objects
Common Interface
CAPE-OPEN Identification CO-LaN v1.0 Common Interfaces Interfaces exposing names and descriptions of
Common Interface all CAPE-OPEN objects
CAPE-OPEN Utilities CO-LaN v1.0 Common Interfaces Interfaces exposing collections of parameters
Common Interface and functionality to edit, initialize and
terminate.
CAPE-OPEN Simulation CO-LaN v1.0 COSE (CAPE- Interfaces describing the context of a
Context COSE interface OPEN Simulator Executive) simulation, logging capabilities and a
Interface (or PME Interface) collection of material template objects
Error Common Interface CO-LaN v1.0 Common Interfaces Interfaces describing error descriptions and
error codes returned by CAPE-OPEN objects
CAPE-OPEN Chemical CO-LaN v1.0 Business Interfaces Interfaces describing objects related to
Reactions Interface chemical reactions and electrolytes.
specification

Creating a COFE document by automation


Creating a new COFE flowsheet document in an active document container

To create a new COFE document inside a container document, click on the Insert menu and choose Object (the
precise menu structure may depend on the application). On the Create New tab, select "COCO/COFE Flowsheet
document".

To edit the created document, double click on the COFE icon.

Using an existing fsd document on disk

To create a COFE document inside a container document that is based on an existing fsd document on disk, click
on the Insert menu and choose Object (the precise menu structure may depend on the application). On the Create
From File tab, click Browse. Select an existing fsd document.

Accessing the document's interfaces programmatically

To access the document's interfaces programmatically, study the documentation of the document container to
make yourself familiar with the container's programming language and object model.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 29 of 54

For example, in Microsoft Office applications, the programming language is Visual Basic for Applications
(VBA), and you can access the embedded documents by examining the OLEObjects collection, and find the
OLEObject object that has its OLEObject.progID member set to "COCO_COFE.Document". You can then assign
its OLEObject.object member to a variable of type COFE_document. Or:

Dim obj As OLEObject


Dim document As COFE_document

For Each obj In myWorkSheet.OLEObjects


If (obj.progID = "COCO_COFE.Document") Then
Set document = obj.object
Exit For
End If
Next

Setting references

For the programming language of the container application to know about COFE's data types, you will have to set
a reference to the type library of COFE. In VBA, this is done by choosing References from the Tools menu, and
adding a reference to 'COFE'. If 'COFE' does not appear in the list, browse to the COCO installation folder, and
select COFE.tlb (the type library containing COFE's type definitions).

You will also need access to the CAPE-OPEN type definitions. To do this, set a reference to the CAPE-OPEN 1.0
Type library, or the CAPE-OPEN 1.1 Type library, depending on your needs. These type libraries need to be
installed; the COCO installer contains the installer for the type libraries, available from the CO-LaN web site. If -
after installing the CAPE-OPEN type libraries - they do not show up in the list of available choices, browse to the
installation directory, usually C:\Program Files\Common Files\CAPE-OPEN.

Creating a COFE document programmatically

To create a COFE document programmatically, first make sure to add COFE as a reference (see above). Then,
create a new object of the COFE document type. For example, in VBA:

Dim document As COFE_Document


Set document = New COFE_document

Alternatively, use CreateObject,

Dim document
Set document = CreateObject("COCO_COFE.Document")

or, using an existing file:

Dim document As COFE_Document


Set document = GetObject("mydocument.fsd")

(The advanced VBA user will have noticed that the second example did not declare the type of variable document
and thus uses late binding, and therefore does not require a reference to the COFE type library. Using early
binding however is the advised method).

COFE interfaces and exposed objects


Most of the objects expose CAPE-OPEN interfaces directly. The CAPE-OPEN can be recognized by their naming
convention, they all start with ICape. Although this document indicates to some extent which CAPE-OPEN
interfaces can be expected to be implemented, for reference of the interfaces the reader is referred to the CAPE-
OPEN interface specifications documents, which are available from CO-LaN, the CAPE-OPEN Laboratory
Network, and partially included in these documents.

The interfaces that are exposed by COFE all start with ICOFE:
ICOFEDocument: this interface is exposed by the COFE document object. See Creating a COFE document
by automation for how to obtain an object of the COFE document type
ICOFEStream: this interface is exposed by COFE streams (material-, energy- and information streams)
ICOFEMaterial: this interface is exposed by COFE material objects

Error handling

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 30 of 54

All CAPE-OPEN interfaces should implement CAPE-OPEN error handling. For more information, see Error
Common Interface from the CAPE-OPEN interface specifications. Specifically, all TEA, CORN, COUSCOUS
and COFE objects return ECapeUnknownHR, and a descriptive error text can be obtained through the ECapeUser
interface.

COFE may return automation other than CAPE-OPEN errors. Specifically, an error code and error description
will be provided. Error codes that can be returned are:

code meaning
1001 invalid type for collection ID
1002 index out of range
1003 invalid string identifier for collection item
1004 requested object is not a COM object and cannot be accessed via automation
1005 invalid argument value

ICOFEDocument interface
The ICOFEDocument is exposed by the COFE Flowsheet document object. See Creating a COFE document by
automation for how to obtain an object of the COFE document type.

The following methods are exposed by the ICOFEDocument interface:


GetCompoundConstantDimensionality
GetError
GetPropertyDimensionality
GetReactionObject
GetReactionPackageCount
GetReactionPackageNames
GetSimulationContext
GetStream
GetStreamCount
GetStreamNames
GetUnit
GetUnitCount
GetUnitNames
LoadFromString
SaveCopy
SaveToString
ShowMainConfiguration
SolveFlowsheet
ValidateFlowsheet
GetCompoundConstantDimensionality
declared as: BSTR GetCompoundConstantDimensionality(BSTR propName);
arguments: propName: the name of the property for which to get the dimensionality descriptor
return value: dimensionality descriptor
description: textual description of the dimensionality of the specified compound constant. Compound constants
can be obtained from any material object, using GetComponentConstant (CAPE-OPEN version 1.0
thermodynamic interface) or GetCompoundConstant (CAPE-OPEN version 1.1 thermodynamic
interface)

GetError
declared as: BSTR GetError(IDispatch* CO_Object, long errorCode);
arguments: CO_Object: reference to the object that threw the error
errorCode: the error code that was returned by the object
return value: textual error descriptor
description: returns a textual error descriptor as last thrown by the object that was passed to it. Should only be
used directly after the object threw the error

GetPropertyDimensionality

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 31 of 54

declared as: BSTR GetPropertyDimensionality(BSTR propName, BSTR basis);


arguments: propName: the name of the property for which to get the dimensionality descriptor
basis: the basis that is passed to the function that obtains the property value
return value: dimensionality descriptor
description: textual description of the dimensionality of the specified property. Properties can be obtained from
any material object, using GetProp (CAPE-OPEN version 1.0 thermodynamic interface),
GetSinglePhaseProp, GetTwoPhaseProp, GetPDependentProperty, GetTDependentProperty,
GetOverallProp, GetTPFraction and CalcAndGetLnPhi (CAPE-OPEN version 1.1
thermodynamic interface)

GetReactionObject
declared as: IDispatch* GetReactionObject(VARIANT reactionPackageID);
arguments: reactionPackageID: name of reaction package loaded into the document, or 1-based index into
the array returned by GetReactionPackageNames
return value: reaction object
description: returns a reference to a reaction object interfaces. Interfaces exposed by the reaction object are
ICapeReactionChemistry, ICapeReactionProperties, ICapeReactionsRoutine,
ICapeThermoMaterialContext (see CAPE-OPEN Chemical Reactions Interface specification) and
ICapeIdentification (see CAPE-OPEN Identification Common Interface).

GetReactionPackageCount
declared as: LONG GetReactionPackageCount();
return value: number of reaction packages loaded into the document
description: returns the count of reaction packages loaded into the document. See also:
GetReactionPackageNames and GetReactionObject

GetReactionPackageNames
declared as: VARIANT GetReactionPackageNames();
return value: array containing names of reaction packages loaded into the document
description: returns the names of reaction packages loaded into the document. See also:
GetReactionPackageCount and GetReactionObject

GetSimulationContext
declared as: IDispatch* GetSimulationContext();
return value: reference to the simulation context interface
description: returns the simulation context (can be used to obtain a list of material templates, and create material
objects of choice for use of property or equilibrium calculations, see CAPE-OPEN Simulation
Context COSE interface). Implemented interfaces: ICapeMaterialTemplateSystem,
ICapeSimulationContext, ICapeDiagnostic, ICapeCOSEUtilities and ICapeIdentification
(see CAPE-OPEN Identification Common Interface)

GetStream
declared as: IDispatch* GetStream(VARIANT streamID);
arguments: streamID: name of stream in the document, or 1-based index into the array returned by
GetStreamNames
return value: reference to a stream object
description: returns a stream object. Implemented interfaces: ICOFEStream and ICapeIdentification (see
CAPE-OPEN Identification Common Interface).

For material streams, additional interfaces are ICOFEMaterial and ICapeThermoMaterialObject


(CAPE-OPEN version 1.0 thermodynamic interface), and ICapeThermoCompounds,
ICapeThermoEquilibriumRoutine, ICapeThermoMaterial, ICapeThermoPhases,
ICapeThermoPropertyRoutine, ICapeThermoUniversalConstant (CAPE-OPEN version 1.1
thermodynamic interface).

For energy and information streams, an additional interface is ICapeCollection (see CAPE-OPEN
Collection Common Interface) exposing the parameters that are present on the stream (see CAPE-

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 32 of 54

OPEN Parameter Common Interface).

GetStreamCount
declared as: LONG GetStreamCount();
return value: number of streams in the document
description: returns the count of streams in the document. See also: GetStreamNames and GetStream

GetStreamNames
declared as: VARIANT GetStreamNames();
return value: array containing names of the streams in the document
description: returns the names of streams in the document. The names of the streams may not be unique; it is up
to the user to ensure unique stream names. See also: GetStreamCount and GetStream

GetUnit
declared as: IDispatch* GetUnit(VARIANT unitID);
arguments: unitID: name of unit operation in the document, or 1-based index into the array returned by
GetUnitNames
return value: reference to a unit operation object
description: returns a unit operation object. The unit operation objects are passed on as they are imported into
the document, and are therefore not implemented by COFE. If a unit operation is not imported into
the document using the CAPE-OPEN COM interfaces, it cannot be passed on via this function.

Implemented interfaces: ICapeUnitOperation (see CAPE-OPEN Unit Operations Interface


Specification), ICapeIdentification (see CAPE-OPEN Identification Common Interface).

Via the ICapeUnitOperation interface one can get access to a collection of the unit operation's
ports and the streams attached to it.

Also, a unit operation typically exposes an ICapeUtilities (see CAPE-OPEN Utilities Common
Interface) that in turn exposes an ICapeCollection interface via GetParameters, from which one
can access the unit operation's parameters (see CAPE-OPEN Parameter Common Interface).

GetUnitCount
declared as: LONG GetUnitCount();
return value: number of unit operations in the document
description: returns the count of unit operations in the document. See also: GetUnitNames and GetUnit

GetUnitNames
declared as: VARIANT GetUnitNames();
return value: array containing names of the unit operations in the document
description: returns the names of unit operations in the document. The names of the unit operations may not be
unique; it is up to the user to ensure unique stream names. See also: GetUnitCount and GetUnit

LoadFromString
declared as: void LoadFromString(BSTR* string);
arguments: string: string representing the content of a document, created by SaveToString
description: This function reloads a document from a string-encoding that was previously created using
SaveToString. The mechanism of loading and saving to strings is a way to provide persistence for
automation environments in which saving the embedded object is not supported for some reason.
This function should be called only for new, empty flowsheet document objects.

SaveCopy
declared as: VARIANT_BOOL SaveCopy(BSTR path);
arguments: path: path to fsd file
return value: TRUE if saving the copy has succeeded
description: Save a copy of the embedded Flowsheet document object to the fsd file specified by path. Most

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 33 of 54

active document containers do not support storing the embedded object separately.

SaveToString
declared as: void SaveToString(BSTR* string);
arguments: string: pointer to string variable that will receive a string representing the content of a document.
description: This function produces a string representing the content of the current flowsheet document, that can
be used to restore the content of a new, empty document by LoadFromString. The mechanism of
loading and saving to strings is a way to provide persistence for automation environments in which
saving the embedded object is not supported for some reason.

ShowMainConfiguration
declared as: void ShowMainConfiguration();
description: Shows the configuration dialog for the document object. Allows the user to change and inspect
loaded property packages, reaction packages and material types. Also allows inspection of
supported compounds, properties and phases.

SolveFlowsheet
declared as: VARIANT_BOOL SolveFlowsheet(BSTR* message);
arguments: message: string receiving the message describing cause of failure.
return value: TRUE if the flowsheet is solved
description: Solve the flowsheet. Returns True if the flowsheet was solved successfully, or False in case of
failure. The reason for failure is indicated in the returned message.

ValidateFlowsheet
declared as: VARIANT_BOOL ValidateFlowsheet(VARIANT* messages);
arguments: messages: list of strings with descriptions of invalid items.
return value: TRUE if the flowsheet is valid
description: Validates the flowsheet. Returns True if the flowsheet can be solved, or False if one or more items
are invalid. The invalid items are returned as array of string messages.

ICOFEStream interface
The ICOFEStream is exposed by the COFE stream objects. COFE stream objects can be obtained by
ICOFEDocument.GetStream.

The following methods are exposed by the ICOFEStream interface:


DownstreamUnit
StreamType
UpstreamUnit
DownstreamUnit
declared as: [propget] HRESULT DownstreamUnit([out, retval] IDispatch** pVal);
return value: pVal: reference to the downstream unit operation, if any
description: returns the downstream unit operation if the stream is connected on the downstream side, or
Nothing. The downstream unit is passed on as the CAPE-OPEN unit operation that is imported into
COFE. See ICOFEDocument.GetUnit for a description of exposed interfaces for unit operation
objects. See also UpstreamUnit.

StreamType
declared as: [propget] HRESULT ([out, retval] eStreamType* pVal);
return value: pVal: stream type of the stream
description: returns the type of stream (STREAMTYPE_MATERIAL for material streams,
STREAMTYPE_ENERGY for energy streams, or STREAMTYPE_INFORMATION for
information streams). See ICOFEDocument.GetStream for a description of exposed interfaces for
each type of stream.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 34 of 54

UpstreamUnit
declared as: [propget] HRESULT UpstreamUnit([out, retval] IDispatch** pVal);
return value: pVal: reference to the upstream unit operation, if any
description: returns the upstream unit operation if the stream is connected on the upstream side, or Nothing.
The upstream unit is passed on as the CAPE-OPEN unit operation that is imported into COFE. See
ICOFEDocument.GetUnit for a description of exposed interfaces for unit operation objects. See
also DownstreamUnit.

ICOFEMaterial interface
The ICOFEMaterial is exposed by the COFE material objects. This can be material streams that are obtained by
ICOFEDocument.GetStream, or materials created using the material template server that is obtained from
ICOFEDocument.GetSimulationContext.

Material objects expose in addition to ICOFEMaterial the following interfaces: ICOFEStream,


ICapeIdentification (see CAPE-OPEN Identification Common Interface), ICapeThermoMaterialObject
(CAPE-OPEN version 1.0 thermodynamic interface), and ICapeThermoCompounds,
ICapeThermoEquilibriumRoutine, ICapeThermoMaterial, ICapeThermoPhases,
ICapeThermoPropertyRoutine, ICapeThermoUniversalConstant (CAPE-OPEN version 1.1 thermodynamic
interface).

The following methods are exposed by the ICOFEMaterial interface:


GetSupportedPhaseList
MaterialType
GetSupportedPhaseList
declared as: HRESULT GetSupportedPhaseList([out,retval] VARIANT* phaseList);
argument: phaseList: list of phases that are supported by the material
description: Obtains a list of phases that the current material supports. This is not the same list as the PhaseIds
method (CAPE-OPEN version 1.0 thermodynamic interface) as this lists the phases that are
currently present on the material, like GetPresentPhases (CAPE-OPEN version 1.1
thermodynamic interface); it is however the same list as returned by GetPhaseList (CAPE-OPEN
version 1.1 thermodynamic interface).

MaterialType
declared as: [propget] HRESULT MaterialType([out, retval] BSTR* pVal);
return value: pVal: name of the stream type
description: Obtains the stream type for the given material. The stream type can be used to recreate a material of
the same type using the material template server that is obtained from
ICOFEDocument.GetSimulationContext. Alternatively, one can create a material of the same type
of a given material using its Duplicate method (CAPE-OPEN version 1.0 thermodynamic
interface) or CreateMaterial method (CAPE-OPEN version 1.1 thermodynamic interface)

Using COFE in Excel


Excel and automation

Using the COFE automation, one can set up his or her own way of operating COFE inside Microsoft Excel. This
requires creating a COFE flowsheet object inside an .xls workbook, and some additional VBA (Microsoft Visual
Basic for Applications) programming.

Most common tasks envisioned for running COFE inside Microsoft Excel is the use of thermodynamic functions,
and the monitoring of properties of streams and unit operation at flowsheet solution. To facilitate these tasks, an
Excel template is provided with COFE that will set up a worksheet for you that will allow you to include a new or
existing COFE flowsheet document, and set you up to perform the most common tasks.

The following tasks can be performed with COFE in Excel:

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 35 of 54

Create a new COFE-in-Excel document


Entering functions
Flowsheet operations

Excel versions

The approach outlined in this help file has been tested under Microsoft Excel 2000, 2003, 2007 and 2010.

Macro security

Since VBA macros are required to operate COFE inside Excel in a useful manner, these macros will need to be
stored somewhere. Often, software venders place a locked-down Excel add-in with the required macros in a
location on your computer that is considered safe. In such a case, Excel will can allow for automatically enabling
the macros in such an add-in. Usually, the user is not allowed to change the add-in, and all programmed
functionality remains as is when the application was distributed.

For COFE, a different approach was used. Each COFE document contains its own macros. The user can simply
access these macros by starting the VBA editor inside Excel (Macros from the Tools menu, select Visual Basic
Editor). Since CAPE-OPEN allows for a vast amount of different operations, it is considered important and useful
for the end-user to be able to not only access the macros that operate on CAPE-OPEN objects, but also to modify
them and to add to them to suit the user's specific needs.

This results in each COFE-in-Excel xls document being self-consistent and ready to ship. The down side is that
changing the macros in a single document will not change the macros in all of your documents.

Another down side is macro security. For the macros to run properly in Excel 2003 and earlier, they will have to
be enabled. Excel allows the following levels of macro security:
Very high: macros are only allowed to run from trusted locations and trusted sources. This setting will make
that the COFE macros will not run;
High: macros are only allowed to run from trusted locations and trusted sources. Trusted sources are signed
with a digital signature. COFE-in-Excel documents are not, and therefore this setting will make that the
COFE macros will not run;
Intermediate: the user can specify with opening a document whether the macros should be enabled or
disabled for the selected document. The macros should only be enabled for documents that are from a
trusted source;
Low: all macros are automatically enabled. This setting is not recommended.

It is recommended to use the intermediate macro security level (select Options from the Tools menu in Excel, go
to the Security tab, click the Macro Security button), and click enable on the macro security document ONLY
when the document is from a location that you can trust.

For Excel 2007 and later, the Excel document should be stored in a trusted location. Open the Trust Center for
more information (Excel 2007: click the Office button and click the Excel Options button; Excel 2010: select
Options from the File ribbon).

COFE menu

A few functions in Excel files embedding a COFE document are available via the COFE menu; in Excel 2007 or
later, this menu is available from the Add-in ribbon.

Creating a new COFE-in-Excel document


Getting started

To create a new COFE document in Excel, you will need the COFE.xlt Excel template that is located in the
COCO installation folder.

One way to create a new document is to simply double-click the COFE.xlt file. Mind that this it not the same as
opening the COFE.xlt file from the File menu in Excel (as this will cause the xlt file to be overwritten when
choosing Save from the File menu).

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 36 of 54

To make it easier to start a new file, one can:


make a short-cut to the COFE.xlt file in any desired location, and double-click the short-cut instead, or
copy the COFE.xlt file from the COCO installation folder to your Excel template folder. Now you will see
the template if you choose New from the File menu within Excel.

When starting a new file or opening an existing file, macros need to be enabled, see macro security.

When using any of the above methods to start a new file, first you will be prompted for a flowsheet document.
You can use either a new - empty - flowsheet document, or one that is existing on disk already. If you choose a
new document, the document configuration dialog pops up. Here, one should at least load a property package (and
assign it to the default stream type) to be able to use thermodynamics inside Excel.

If you choose an existing document, you will be asked for the location of an .fsd file on your computer. If you
cancel the action of inserting a document, the Excel file will close, as the macros require a document to be
present.

Next, you will be prompted for which examples you would like to be in the document. Select the desired
examples and click ok. The examples are a starting point for setting up your own calculations.

The streams and unit operations examples require streams and unit operations to be present in the flowsheet; they
are best viewed using an existing flowsheet file on disk to start with.

The Flowsheet document object

The flowsheet document object will be inserted into the Flowsheet page. If you switch to the flowsheet page, the
flowsheet document object will automatically be activated. The activation is done inside the Excel application, but
in some circumstances (if the fsd file was saved with multiple windows open, or if the COFE application is
running and visible) the document may open in the COFE application instead.

If you switch away from the Flowsheet page, the script assumes you may have made changes to the flowsheet
configuration, and all COFE dependent formulas will be recalculated.

All VBA code related to flowsheet document maintenance, scaling and activation of the flowsheet object,
maintenance of the COFE Excel menu, the start-up wizard, etc, is located in the VBA code for the COFEWorkbook
and FlowsheetObject objects. All VBA code is accessible and can be modified by the user to suit his or her
needs.

Functionality like updating calculations, resizing, ..., is triggered by activation of flowsheet pages. If you find that
your document did not update properly, switching to another page and switching back may resolve the issue.

Entering functions in Excel


VBA functions

The functions that are implemented in VBA to access COFE data from within Excel worksheets are a good
starting point, but do not represent the full extent of what can be done. While the functions will provide a good
starting point for the beginning Excel user without VBA knowledge, the experienced user is encouraged to
modify and add to the functions implemented in VBA.

All COFE related functions in VBA start with COFE_. Most of the functions can be seen in action from the
example pages that are available when starting a new document.

Available functions

thermodynamic functions
stream access functions
unit operation access functions
dimensionality formatting functions

Entering functions and arguments

To facilitate entering COFE functions in Excel, start with typing - at the desired location - an equal sign followed
by the function name, followed by an opening brace. For example: =COFE_ObtainProperty(Then, use the Excel

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 37 of 54

formula wizard to help you along; hit the formula wizard on the left of the formula bar:

The formula wizard will show each of the function arguments and allow you to enter data for it:

If you do not know the function name, you can click on the formula wizard when the formula bar is empty. Select
User defined for the function category. You can then pick the COFE_ function from the list.

Entering array formulas

Many of the functions return values that are arrays. If you enter such a function in a single cell, you will only see
the first element of the resulting array. Instead, you will need to enter an array formula in Excel. To do this,
follow the following steps:
Select the cells in which you want the answer to appear (a range of multiple cells),
Enter the formula, and its arguments, as outlined above,
Press Ctrl+Shift+Enter when you are done entering the formula. The Ctrl key ensures in Excel that the
function is entered for the entire selection, as an array formula.

Most functions return arrays that are formatted as columns. Some return row functions. This is listed with each
function. You can use the Excel function Transpose to convert row arrays to column arrays and vice versa.

If the range you have selected is shorter than the array that is returned from the function, only part of the array
results will appear. If the range is longer than the returned array, Excel by default repeats the elements that appear
at the start of the array. To circumvent this behaviour, the COFE_ functions that return an array are generally fit
with an additional argument growArray, which, if specified, will make that the returned array is at least the
specified amount of items long and the unused elements will be set to an empty string. This is useful the function
results depend on the flowsheet configuration. For example, if you use the =COFE_GetCompoundNames() function,
the resulting array has the size of the amount of compounds in the document. If you set up a spread sheet to work
with different thermo models, the amount of compounds may vary. You can assign the result of that function to
an array that is large enough to hold all desired cases (for example, 100 elements). To prevent the first elements
from repeating over and over, you can specify a value of 100 for the growArray argument, e.g.
=COFE_GetCompoundNames(,100).

Thermodynamic functions
The thermodynamic functions are implemented in the module COFEThermo. The following functions are currently
available:
COFE_GetTemplateCount
COFE_GetTemplateNames
COFE_GetCompoundCount

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 38 of 54

COFE_GetCompoundNames
COFE_ObtainProperty
COFE_ObtainComponentConstant
COFE_CalculateEquilibrium
COFE_CalculateEquilibriumHeaders

COFE_GetTemplateCount
declared as: Public Function COFE_GetTemplateCount()
arguments: [none]
return value: number of material templates
description: returns the numbers of available material templates in the flowsheet document object. The
template names can be obtained from COFE_GetTemplateNames.
example page Calculate properties example

COFE_GetTemplateNames
declared as: Public Function COFE_GetTemplateNames(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 of available template names
description: returns the available material templates in the flowsheet document object. Any of the template
names can be used for each of the thermodynamic functions. Passing a template name is optional
for all functions. If a template name is not specified, the name default is used.
The returned array is in column format.
example page Calculate properties example

COFE_GetCompoundCount
declared as: Public Function COFE_GetCompoundCount(Optional templateName As String =
"default")
arguments: templateName: name of the template for which to return the number of compounds (optional)
return value: number of compounds
description: Returns the number of compounds in materials of the specified type. Composition inputs to
thermodynamic functions need to be an array of which the size corresponds to the number of
compounds. Property values that are evaluated for each compounds - such as
fugacityCoefficient - will be an array with the number of elements matching the number of
compounds.
example page Calculate properties example

COFE_GetCompoundNames
declared as: Public Function COFE_GetCompoundNames(Optional templateName As String =
"default", Optional growArray As Integer = 0)
arguments: templateName: name of the material template for which to get the compound names
growArray: grows the array to the specified amount of elements, leaving blanks for unused
elements (optional)
return value: List of compound names available in materials of the specified type.
description: Returns a list of compound names available in materials of the specified type.
The returned array is in column format.
example page Calculate properties example, Calculate equilibrium example

COFE_ObtainProperty
declared as: Public Function COFE_ObtainProperty(p As Double, T As Double, composition As
Range, compositionBasis As String, propertyName As String, phaseName As String,
calcType As String, basis As String, Optional templateName As String =
"default")
arguments: p: pressure, Pa
T: temperature, K
composition: composition, mole fraction or mass fraction
compositionBasis: basis for composition, "mole" or "mass"
propertyName : name of the property to calculate

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 39 of 54

phaseName: name of the phase for which to calculate the property


calcType: calculation type, "mixture" or "pure"
basis: basis for the returned property, "mole", "mass" or ""
templateName: type of material to use for the calculation (optional)
return value: Calculated property value
description: This is the main routine for calculation of physical or thermodynamic properties at specified
pressure, temperature and composition (mole or mass fraction), for the specified phase (typically
"vapor" or "liquid". For a list of property names available in the flowsheet document object, go
to the flowsheet configuration, select the Properties tab, which is a subset of the full list of CAPE-
OPEN properties.
Properties that have dimenensions that include a mass or mole specification require either "mass"
or "mole" for the basis. All other properties require an empty string for the basis. The calculation
type must be either "mixture" or "pure", the latter referring to the compounds as if they were not
in the mixture (if "pure", the specified composition does not play a role in the calculation). The
template name is optional; if not specified, the "default" stream type will be used.
The returned array is often a scalar. For vector properties, expect a row vector.
See also: COFE_FormatPropertyDimensionality.
example page Calculate properties example

COFE_ObtainComponentConstant
declared as: Public Function COFE_ObtainComponentConstant(propertyName As String,
compoundName As String, Optional templateName As String = "default")
arguments: [none]
return value: propertyName: name of the constant property to obtain
compoundName: name of the compound for which to obtain the constant
templateName: type of material to use
description: Obtain a compound constant for a given compound. For a list of available compound constant
names, see CAPE-OPEN version 1.0 thermodynamic interface, section 4.12.1, or list of constant
properties.
See also: COFE_FormatCompoundConstantDimensionality.
example page Calculate properties example

COFE_CalculateEquilibrium
declared as: Public Function COFE_CalculateEquilibrium(eqType As String, spec1 As Double,
spec2 As Double, composition As Range, basis As String, Optional templateName
As String = "default", Optional growArray As Integer = 0)
arguments: eqType: equilibrium specification type
spec1: first specification (see table)
spec2: second specification (see table)
composition: overall composition (mass or mole fraction)
basis: basis argument for composition and spec1 and spec2, as well as resulting compositions
and phase fractions (if applicable), "mass" or "mole"
templateName: type of material to use (optional)
growArray: grows the array to the specified amount of elements, leaving blanks for unused
elements (optional)
return value: array containing phase fractions for each phase and compositions for each phase
description: Calculates an equilibrium using either of the following type specifications:

type spec1 spec2


TP temperature pressure
PT pressure temperature
PVF pressure vapor fraction
VFP vapor fraction pressure
TVF temperature vapor fraction
VFT vapor fraction temperature
PH pressure enthalpy
HP enthalpy pressure

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 40 of 54

TH temperature enthalpy
HT enthalpy temperature
HVF enthalpy vapor fraction
VFH vapor fraction enthalpy
PS pressure entropy
SP entropy pressure
TS temperature entropy
ST entropy temperature
SVF entropy vapor fraction
VFS vapor fraction entropy

Depending on the property package, not all of the above may be supported. If no template name is
supplied, the "default" stream type will be used.

The input specifications have the following dimension:

specification "mole" basis "mass" basis


composition mole fraction mass fraction
pressure Pa Pa
temperature K K
vapor fraction mole fraction mole fraction
enthalpy J/mol J/kg
entropy J/mol/K J/kg/K

The output phase fractions and compositions are in mole or mass fractions, depending on the
specified basis.

A list of headers indicating the meaning of the values can be obtained from the
COFE_CalculateEquilibriumHeaders function.

The returned array is in row format.


example page Calculate equilibrium example

COFE_CalculateEquilibriumHeaders
declared as: Public Function COFE_CalculateEquilibriumHeaders(basis As String, Optional
templateName As String = "default", Optional growArray As Integer = 0)
arguments: basis: basis argument as passed to COFE_CalculateEquilibrium
templateName: template name as passed to COFE_CalculateEquilibrium
growArray: grows the array to the specified amount of elements, leaving blanks for unused
elements (optional)
return value: Array of headers corresponding to the values from COFE_CalculateEquilibrium
description: Returns an array of names corresponding to the elements of the array returned by
COFE_CalculateEquilibrium.
The returned array is in row format.
example page Calculate equilibrium example

Stream access functions


The stream access functions are implemented in the module COFEStreams. The following functions are currently
available:
COFE_GetStreamCount
COFE_GetStreamNames
COFE_GetStreamType
COFE_GetUpStreamUnitName

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 41 of 54

COFE_GetDownStreamUnitName
COFE_GetStreamMaterialType
COFE_GetStreamPressure
COFE_GetStreamTemperature
COFE_GetStreamFlow
COFE_GetStreamComposition
COFE_GetStreamPresentPhases
COFE_GetStreamPhaseFraction
COFE_GetStreamPhaseComposition
COFE_GetStreamItems
COFE_GetStreamItemValue
COFE_GetStreamItemDimension

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 page access 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 page access 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 page access 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 page access 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

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 42 of 54

be used in unit operation access functions.


example page access 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 page access 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 page access 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 page access 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 page access 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 page access 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)

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 43 of 54

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 page access 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 page access streams example

COFE_GetStreamItemDimension
declared as: Public Function COFE_GetStreamItemDimension(streamID, valueID) As String
arguments: streamID: name or index of the stream

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 44 of 54

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 page access streams example

Unit operation access functions


The unit operation access functions are implemented in the module COFEUnitOperations. The following
functions are currently available:
COFE_GetUnitOperationCount
COFE_GetUnitOperationNames
COFE_UnitOperationGetParameterCount
COFE_UnitOperationGetParameterNames
COFE_UnitOperationGetParameterValue
COFE_UnitOperationFormatParameterDimensionality
COFE_GetUnitPortCount
COFE_UnitOperationGetPortNames
COFE_UnitOperationGetPortType
COFE_UnitOperationGetPortDirection
COFE_UnitOperationGetPortStreamName

COFE_GetUnitOperationCount
declared as: Public Function COFE_GetUnitOperationCount()
arguments: [none]
return value: the number of unit operations in the flowsheet
description: Returns the number of unit operations that are present in the flowsheet. The names of the unit
operations can be obtained with COFE_GetUnitOperationNames.
example page access unit operation example

COFE_GetUnitOperationNames
declared as: Public Function COFE_GetUnitOperationNames(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 unit operations
description: Returns an array with the names of the unit operations in the document. The unit operation names
can be passed to the unit operation access functions described here. Alternatively, the 1-based
index into the returned array can be used to identify a unit operation. Unit operation names are not
forced to be unique inside COFE; it is up to the user to either make sure the unit operation names
are unique or to use unit operation indices.
The returned array is in column format.
example page access unit operations example

COFE_UnitOperationGetParameterCount
declared as: Public Function COFE_UnitOperationGetParameterCount(unitID)
arguments: unitID: name or index of the unit operation
return value: Number of parameters
description: Returns the number of parameters exposed by the specified unit operation
example page access unit operations example

COFE_UnitOperationGetParameterNames
declared as: Public Function COFE_UnitOperationGetParameterNames(unitID, Optional growArray
As Integer = 0)
arguments: unitID: name or index of the unit operation
growArray: grows the array to the specified amount of elements, leaving blanks for unused

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 45 of 54

elements (optional)
return value: array of parameter names
description: Returns an array with the names of the parameters exposed by the unit operation. The names of the
parameters can be used in the functions to access unit operation parameters.
The returned array is in column format.
example page access unit operations example

COFE_UnitOperationGetParameterValue
declared as: Public Function COFE_UnitOperationGetParameterValue(unitID, parameterID)
arguments: unitID: name or index of the unit operation
parameterID: name or index of a parameter exposed by the unit operation
return value: value of the parameter
description: Returns the value of a parameter exposed by the unit operation. This may be a scalar or array
value, depending on the parameter. The parameter dimensionality can be obtained using
COFE_UnitOperationFormatParameterDimensionality.
The returned value format depends on the parameter (often scalar, but can be row vector, column
vector or matrix).
example page access unit operations example

COFE_UnitOperationFormatParameterDimensionality
declared as: Public Function COFE_UnitOperationFormatParameterDimensionality(unitID,
parameterID) As String
arguments: unitID: name or index of the unit operation
parameterID: name or index of a parameter exposed by the unit operation
return value: dimensionality descriptor
description: Returns a string describing the dimensionality (unit of measure) for the specified parameter
exposed by the specified unit operation.
example page access unit operations example

COFE_GetUnitPortCount(unitID)
declared as: Public Function COFE_GetUnitPortCount(unitID)
arguments: unitID: name or index of the unit operation
return value: number of ports
description: Returns the number of ports exposed by a unit operation
example page access unit operations example

COFE_UnitOperationGetPortNames
declared as: Public Function COFE_UnitOperationGetPortNames(unitID, Optional growArray As
Integer = 0)
arguments: unitID: name or index of the unit operation
growArray: grows the array to the specified amount of elements, leaving blanks for unused
elements (optional, see Entering array formulas)
return value: array of port names
description: Returns an array with the names of the ports exposed by the specified unit operations. The port
names can be used in functions to access the port properties and connected stream.
The returned array is in column format.
example page access unit operations example

COFE_UnitOperationGetPortType
declared as: Public Function COFE_UnitOperationGetPortType(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: port type
description: Returns the type of the specified port exposed by the specified unit operation:

"material": the port is a material port

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 46 of 54

"energy": the port is an energy port


"information": the port is an information port
"any": the port is of unspecified type
example page access unit operations example

COFE_UnitOperationGetPortDirection
declared as: Public Function COFE_UnitOperationGetPortDirection(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: port direction
description: Returns the direction of the specified port exposed by the specified unit operation:

"in": the port is an inlet port


"out": the port is an outlet port
"in/out": the port is marked as inlet/outlet
example page access unit operations example

COFE_UnitOperationGetPortStreamName
declared as: Public Function COFE_UnitOperationGetPortStreamName(unitID, portID) As String
arguments: unitID: name or index of the unit operation
portID: name of index of a port exposed by the unit operation
return value: name of the stream attached to the port
description: Returns the name of the stream attached to the specified port of the specified unit operation, if any.
The returned stream name can be used in stream access functions.
example page access unit operations example

Dimensionality functions
The dimensionality functions are implemented in the module COFEDimensionality. The following functions are
currently available:
COFE_FormatPropertyDimensionality
COFE_FormatCompoundConstantDimensionality

COFE_FormatPropertyDimensionality
declared as: Public Function COFE_FormatPropertyDimensionality(propName As String, basis As
String) As String
arguments: propName: name of property passed to COFE_ObtainProperty
basis: basis passed to COFE_ObtainProperty
return value: dimensionality descriptor
description: Returns a string description of the dimensionality (unit of measure) of a property calculated by
COFE_ObtainProperty.
example page calculate properties example

COFE_FormatCompoundConstantDimensionality
declared as: Public Function COFE_FormatCompoundConstantDimensionality(propName As String)
As String
arguments: propName: name of constant property passed to COFE_ObtainComponentConstant
return value: dimensionality descriptor
description: Returns a string description of the dimensionality (unit of measure) of a constant obtained from
COFE_ObtainComponentConstant.
example page calculate properties example

Flowsheet operations in Excel

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 47 of 54

The flowsheet page

The COFE-in-Excel document is a Microsoft Excel (.xls) workbook. Inside this workbook, there is a sheet
containing the flowsheet object. If you switch to that sheet, the flowsheet will automatically be activated. The
activation should happen inside Excel (but in some circumstances happens inside the COFE application, if COFE
is open and active, or of the flowsheet document was saved from COFE with multiple windows open).

In the active flowsheet document, you can use normal COFE functionality, i.e. edit the flowsheet configuration,
add / remove and manipulate streams and unit operations, etc. When you switch back to the Excel document (by
switching to a worksheet page), all COFE dependent data will be recalculated, as it may have changed during the
editing of the flowsheet.

The COFE menu

When the Flowsheet page is not active, but the COFE menu is active, you will find a COFE menu. The COFE
menu can be used for the following actions.

Configure flowsheet

Choosing Configure Flowsheet from the COFE menu inside Excel will enter the flowsheet configuration. Here,
you can change property packages, setup stream types, and more.

Replace flowsheet

Choosing Replace Flowsheet from the COFE menu inside Excel will replace the flowsheet document object with
a new or existing one. You will be prompted first on whether you want a new - empty - flowsheet, or one that is
based on an fsd file on disk. If you choose a new one, the new flowsheet will be inserted and the flowsheet
configuration will automatically be launched (one will have to at least add a property package to get started). If
you choose for an existing flowsheet document on disk, you will be prompted to browse for its location.

The new flowsheet document will replace the existing flowsheet document inside the Excel workbook; it will not
be added to it. Only one flowsheet document should be present per workbook (for the implemented VBA
functions to properly work).

Save a copy

Choosing Save a copy from the COFE menu inside Excel will prompt you for a location where to save a copy of
the embedded flowsheet document object as .fsd file.

CAPE-OPEN properties
For a complete reference of properties, please see CAPE-OPEN version 1.0 thermodynamic interface and CAPE-
OPEN version 1.1 thermodynamic interface.

The following properties define a material object:

Property description
Pressure Pressure, Pa
Temperature Temperature, K
Flow Total flow, mol/s or kg/s
Fraction Composition, mole or mass fraction
PhaseFraction Fraction of a phase, mole or mass fraction

The following properties may be available by calculation:

Thermo version 1.0 name Thermo version 1.1 name description


activity activity Activity
Activity
activityCoefficient activityCoefficient
coefficient

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 48 of 54

Temperature at
boilingPointTemperature boilingPointTemperature liquid-vapour
transition
Bubble point
bubblePointPressure bubblePointPressure
pressure
Bubble point
bubblePointTemperature bubblePointTemperature
temperature
Isothermal
compressibility compressibility
compressibility
Compressibility
compressibilityFactor compressibilityFactor factor
(P*V/R*T)
Heat capacity
of a solute in an
cpAqueousInfiniteDilution cpAqueousInfiniteDilution infinitely dilute
aqueous
solution
density density Density
Dew point
dewPointPressure dewPointPressure
pressure
Dew point
dewPointTemperature dewPointTemperature
temperature
Dielectric
dielectricConstant dielectricConstant
constant
Binary
diffusion
coefficients for
diffusionCoefficient diffusionCoefficient all species in
mixture relative
to all other
species
Chemical
equilibrium
constant
dissociationConstant dissociationConstant
corresponding
to a dissociation
reaction
energy internalEnergy Internal energy
enthalpy enthalpy Enthalpy
entropy entropy Entropy
excessEnergy excessInternalEnergy Excess energy
excessEnthalpy excessEnthalpy Excess enthalpy
excessEntropy excessEntropy Excess entropy
Excess Gibbs
excessGibbsFreeEnergy excessGibbsEnergy
Free Energy
Excess
excessHelmholtzFreeEnergy excessHelmholtzEnergy Helmholtz Free
Energy
excessVolume excessVolume Excess volume
Coefficient of
expansivity expansivity linear
expansion
fugacity fugacity Fugacity
Fugacity
fugacityCoefficient fugacityCoefficient
coefficient
Fugacity
coefficient of

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 49 of 54

vapour on the
fugacityCoefficientOfVapor fugacityCoefficientOfVapor
saturation line
Gibbs Free
gibbsFreeEnergy gibbsEnergy
Energy
Glass
glassTransitionPressure glassTransitionPressure Transition
Pressure
Glass
glassTransitionTemperature glassTransitionTemperature Transition
Temperature
Heat capacity at
heatCapacity heatCapacityCp constant
pressure (Cp)
Heat capacity at
heatCapacityCv heatCapacityCv constant
volume (Cv)
Heat capacity
(Cp) of liquid
heatCapacityOfLiquid heatCapacityOfLiquid
on the
saturation line
Solid heat
heatCapacityOfSolid heatCapacityOfSolid capacity (Cp) at
1 atm
heatOfFusion heatOfFusion Heat of fusion
Heat of solid
heatOfSolidSolidPhaseTransition heatOfSolidSolidPhaseTransition
phase transition
Heat of
heatOfSublimation heatOfSublimation
sublimation
Enthalpy
change on
heatOfVaporization heatOfVaporization evaporation of
the liquid on the
saturation line
Helmholtz Free
helmholtzFreeEnergy helmholtzEnergy
Energy
Enthalpy of
idealGasEnthalpy idealGasEnthalpy
ideal Gas
Temperature-
dependent part
idealGasEntropy idealGasEntropy
of entropy of
ideal gas
Heat capacity
idealGasHeatCapacity idealGasHeatCapacity
of ideal gas
dT/dP at
jouleThomsonCoefficient jouleThomsonCoefficient
constant H
K factors of a
kvalues kvalue pair of phases
in equilibrium
Natural
logarithm of
logFugacity logFugacity
fugacity
coefficient
Natural
logarithm of
logFugacityCoefficient logFugacityCoefficient
fugacity
coefficient
Logarithm of K
factors of a pair

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 50 of 54

of phases in
logkvalues logkvalue
equilibrium
The geometrical
mean of the
activity
meanActivityCoefficient meanActivityCoefficient coefficients of
the ions in an
electrolyte
solution
Pressure on the
meltingPressure meltingPressure
melting line
Temperature on
meltingTemperature meltingTemperature
melting line
mixture average
molecular
molecularWeight molecularWeight
weight (relative
molar mass)
Osmotic
osmoticCoefficient osmoticCoefficient
coefficient
PH PH PH
POH POH POH
self-diffusion
coefficient in
selfDiffusionCoefficientGas selfDiffusionCoefficientGas
gas phase at 1
atm
self-diffusion
coefficient in
selfDiffusionCoefficientLiquid selfDiffusionCoefficientLiquid
liquid phase on
saturation line
Pressure at
solidSolidPhaseTransitionPressure solidSolidPhaseTransitionPressure
phase transition
Temperature at
solidSolidPhaseTransitionTempareture solidSolidPhaseTransitionTempareture
phase transition
solubilityIndex solubilityIndex Solubility index
Solubility
solubilityProduct solubilityProduct
product
thermodynamic
speedOfSound speedOfSound
speed of sound
Vapour
pressure of
sublimationPressure sublimationPressure
solid on the
sublimation line
Interfacial
surfaceTension surfaceTension tension for a
pair of phases
Surface tension
of the liquid on
surfaceTensionSatLiquid surfaceTensionSatLiquid
the saturation
line
Thermal
thermalConductivity thermalConductivity
Conductivity
Thermal
thermalConductivityOfLiquid thermalConductivityOfLiquid conductivity on
saturation line
Solid thermal
thermalConductivityOfSolid thermalConductivityOfSolid conductivity at
1 atm
Thermal

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 51 of 54

conductivity of
thermalConductivityOfVapor thermalConductivityOfVapor
dilute gas
Vapour
vaporPressure vaporPressure pressure of
saturated liquid
Second Virial
virialCoefficient virialCoefficient
Coefficient
viscosity viscosity Viscosity
Viscosity of
viscosityOfLiquid viscosityOfLiquid liquid on
saturation line
Viscosity in
viscosityOfVapor viscosityOfVapor
dilute gas state
volume volume Volume
Volume change
volumeChangeUponMelting volumeChangeUponMelting
upon melting
Volume change
volumeChangeUponSolidSolidPhaseTransition volumeChangeUponSolidSolidPhaseTransition upon solid
phase transition
Volume change
volumeChangeUponSublimation volumeChangeUponSublimation upon
sublimation
Volume change
volumeChangeUponVaporization volumeChangeUponVaporization upon
vaporization
Volume of
volumeOfLiquid volumeOfLiquid liquid on
saturation line
Volume of solid
volumeOfSolid volumeOfSolid
at 1 atm

CAPE-OPEN constant properties


For a complete reference of properties, please see CAPE-OPEN version 1.0 thermodynamic interface and CAPE-
OPEN version 1.1 thermodynamic interface.

The following compound properties may be available for any given compound:

Thermo version 1.0 name Thermo version 1.1 name description


Complete IUPAC
iupacName iupacName
Name
Chemical Abstract
casRegistryNumber casRegistryNumber Sequencing
Number (CAS)
Chemical formula
(brutto,
chemicalFormula chemicalFormula
nomenclature
according to Hill)
Chemical
structureFormula structureFormula
structure formula
SMILES chemical
SMILESformula SMILESformula
structure formula
Pitzer Acentric
acentricFactor acentricFactor
Factor

associationParameter associationParameter Association-


Parameter

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 52 of 54

(Hayden-
O'Connell)
BornRadius BornRadius Born radius
charge charge Charge
Critical
criticalCompressibilityFactor criticalCompressibilityFactor Compressibility
Factor
criticalDensity criticalDensity Critical Density
criticalPressure criticalPressure Critical Pressure
Critical
criticalTemperature criticalTemperature
Temperature
criticalVolume criticalVolume Critical Volume
Diffusion
diffusionCoefficient diffusionCoefficient
coefficient
diffusionVolume diffusionVolume Diffusion volume
dipoleMoment dipoleMoment Dipole Moment
Heat of Melting at
heatOfFusionAtNormalFreezingPoint heatOfFusionAtNormalFreezingPoint melting point
(1.01325 bar)
Heat of
Vaporization at
heatOfVaporizationAtNormalBoilingPoint heatOfVaporizationAtNormalBoilingPoint
boiling point
(1.01325 bar)
Ideal gas enthalpy
idealGasEnthalpyOfFormationAt25C idealGasEnthalpyOfFormationAt25C of formation at
25C
Ideal gas Gibbs
idealGasGibbsFreeEnergyOfFormationAt25C idealGasGibbsFreeEnergyOfFormationAt25C free energy of
formation at 25C
Lennard-Jones
energy parameter
energyLennardJones energyLennardJones divided by
Boltzmann
constant
Lennard-Jones
lengthLennardJones lengthLennardJones
length parameter
Liquid Density at
liquidDensityAt25C liquidDensityAt25C
25 C
Liquid Volume at
liquidVolumeAt25C liquidVolumeAt25C
25 C
parachor parachor Parachor
Radius of
gyrationRadius gyrationRadius
Gyration
Relative
molecularWeight molecularWeight
molecular mass
Standard aqueous
StandardEnthalpyAqueousDilution StandardEnthalpyAqueousDilution infinite dilution
enthalpy
Standard Entropy
standardEntropyGas standardEntropyGas
of Gas
Standard Entropy
standardEntropyLiquid standardEntropyLiquid
of Liquid
Standard Entropy
standardEntropySolid standardEntropySolid
of Solid

standardFormationEnthalpyGas standardFormationEnthalpyGas Standard


Formation

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 53 of 54

Enthalpy of Gas
Standard
Formation
standardFormationEnthalpyLiquid standardFormationEnthalpyLiquid
Enthalpy of
Liquid
Standard
standardFormationEnthalpySolid standardFormationEnthalpySolid Formation
Enthalpy of Solid
Standard
standardFreeFormationEnthalpyGas standardFormationGibbsEnergyGas Formation
Enthalpy of Gas
Standard
Formation
standardFreeFormationEnthalpyLiquid standardFormationGibbsEnergyLiquid
Enthalpy of
Liquid
Standard Free
standardFreeFormationEnthalpySolid standardFormationGibbsEnergySolid Formation
Enthalpy of Solid
Standard aqueous
StandardGibbsAqueousDilution StandardGibbsAqueousDilution infinite Gibbs
energy
Temperature at
normalBoilingPoint normalBoilingPoint boiling point
(1.01325 bar)
Temperature of
normal melting
normalFreezingPoint normalFreezingPoint
point (1.01325
bar)
Triple Point
triplePointPressure triplePointPressure
Pressure
Triple Point
triplePointTemperature triplePointTemperature
Temperature
Van der Waals
vanderwaalsArea vanderwaalsArea
Area
Van der Waals
vanderwaalsVolume vanderwaalsVolume
Volume

Document properties
To open the Document Properties dialog, select Properties from the File menu, or hit F12.

Here, you can enter document details such as Author, Company, Title and Comments. Also shown is the
Document Creation date. The creation date will be set automatically, but can be modified manually if desired.

The bottom of the Document Properties dialog will show the full path to the document file, if it has been
previously saved.

A selection of the Document Properties can be inserted into the flowsheet as a report.

Preferences
To change COFE's application preferences, choose Preferences from the Edit menu (or press F2).

General preferences
New files are by default blank files containing only program defaults. You can select a template file that will
serve as a starting point when you create a new file. All items in the template file will be present in the new file
(flowsheet options, configured thermodynamics, even streams and unit operations, etc...).

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12
COFE Page 54 of 54

Hit Browse to select a template .fsd file that will serve as the basis for new files. To revert back to a blank
document, select the Blank option.

By default, COCO will check for updates when COFE is started, if it has not been checked within a week. You
can turn off the automatic update checking in the preferences window.

The default time out for out-of-proc OLE clients is 60 seconds. If such an OLE object is invoked and takes longer
than this time-out to return control to COFE, a standard OLE "Not Responding" box will pop up. If you are using
out-of-process OLE objects (such as OATS) that frequently take more time than the default 60 seconds, configure
a larger time-out.

Many dialogs shown by COFE have a check box at the bottom to prevent the same (or similar) message to be
shown next time. Clicking the Reset button on the General tab will cause all these messages to show again.

COFE will by default solve its flowsheets in a background thread. This allows for the main thread (that is
responsible for user interaction and updating the windows) to continue functioning properly, and allows for
continuing to use COFE while a flowsheet is solving. It also allows for solving multiple flowsheets at the same
time. To be able to solve in a background thread, COFE saves the document, and reloads it in a different thread.
Therefore, if Save or Load do not function properly for any of the flowsheet elements, this will fail. It could also
cause multi-threading issues to arise, if not properly implemented by the flowsheet elements. To disable solving
in a background thread, make sure that "Allow solving in a background thread" is not checked.

Parametric studies are always solved in background threads; to make effective use of a multi-core computer,
COFE will use multiple background threads to solve a parametric study. By default, COFE allows for multiple
solution threads for solving parametric studies. If you find that parametric studies do not result expected solutions,
or you run into unexpected crashes when running parametric studies, the possibility exists that a flowsheet
component does not deal well with multi-threading. Please try in this case setting the maximum number of
concurrent solutions for parametric studies to 1.

By default, a COFE unit operation dialog opens when you double-click a Unit Operation. This behaviour can be
changed by selecting "Show Unit's GUI" when double-clicking a Unit Operation; in this case the COFE dialog
will be skipped, and the Unit Operation's private dialog will be shown directly.

Unit sets
On the Unit sets tab, you can configure sets of units-of-measure. The configured sets of units-of-measure can be
used as default units-of-measure in a flowsheet.

One of the sets is the default set. This default set will automatically apply to new blank documents (unless a
document template is selected). The default set will also be used for documents that were saved with a version of
COFE older than 1.13.0.14.

To edit a unit set, select the set and click Edit. For each of the indicated quantities you can pick the default unit-
of-measure. If the "Prefer mass rather than molar" box is checked, properties that can be shown in mass or mole
basis will show in mass basis. E.g. enthalpy will show - in SI units - as J/kg, not as J/mol. This option also affects
the default selection for mole or mass fractions in the stream dialog and reports.

If the "Prefer flow units for extensive properties" is checked, extensive properties for which overall calculation is
supported, will show in time dimensions. Energy content of a stream will thus show as J/s.

Plots
The Plots tab allows configuration of the default colors and resolution for plots.

file://C:\Users\klaus\AppData\Local\Temp\~hh1DF7.htm 2018/06/12

You might also like