You are on page 1of 4

source: http://www.cocosimulator.org/index_support.

html page 1 of 4

Frequently Asked Questions


What makes COCO unique?
COCO is a steady state flowsheet simulation environment that is completely geared towards using CAPE-OPEN
interfaces.

Why is COCO free?


COCO is developed with CAPE-OPEN development in mind. COCO is geared towards providing good feedback when
testing interoperability. Nevertheless, COCO is also suitable for case studies of specific engineering problems.
COCO is free in order to provide people with the opportunity to do high-quality CAPE OPEN development and testing.

Updating COCO
To update COCO, please run COCO UPdate (CUP) from the COCO Start Menu. If CUP is not available, you are probably
running a version of COCO older than 1.13; please download the latest version of COCO.
The latest modifications to COCO are documented here.

Using CUP with a proxy server

CUP will use the default internet explorer proxy-server settings, if available from

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable
= (DWORD)1
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer
= (STRING)<server name>:<port number>

If not available, and the internet connection fails, you will be prompted for proxy server details. If your proxy server
requires authentication, you may get prompted for user name and password.
CUP supports the Basic, Digest and NTLM authorization schemes. CUP supports proxy server authorization since
version 1.13.0.5 (NTLM since version 1.13.0.6)

How do I add new compounds to TEA/CORN?


Compound definitions in TEA and CORN are using Pure Compound Data (PCD) files that are compatible with those of
ChemSep. COCO comes with a data base of more than 150 compounds. Within a configuration of TEA you can
individually edit these compounds. So if your compounds require modification from existing compounds, simply modify
them as you use them is one way to go.
If you have a DIPPR license, we can provide you with a PCD file that contains all compounds from the DIPPR databank.
Please contact us for more information.
Soon a tool will be available here to manipulate PCD files directly. This will allow you to modify existing compound
definitions as well as create new ones.

How do I build a flowsheet from scratch?


Starting from a new, empty, COFE file, you will need to perform the following steps to get started:

• define thermodynamics: enter the flowsheet configuration dialog, and add a thermodynamic property package.
You can use any CAPE-OPEN v1.0 or v1.1 compatible property package; if you have installed COCO, you will at
least have TEA installed. You can use an existing TEA property package or create your own TEA property
package. After loading a property package into your simulation, compound and phase definitions will
automatically be present. You can load multiple property packages in your simulation if you want to have access
to different models in different parts of your flowsheet,
• define material types: a material type in COFE defines what property package is used, and which compounds can
be present. The default material type is always present, and when you add your first property package, you will be
asked to associate this with the default material type,
• insert and configure unit operation models: a flowsheet in general has multiple unit operations in there. You can
mix unit operations from COUSCOUS, from ChemSep and from any third party model set, as long as the unit
operations are CAPE-OPEN v1.0 compatible.
• insert and hook up streams: you can now insert streams. To connect streams to ports of unit operations, simply
source: http://www.cocosimulator.org/index_support.html page 2 of 4

use the mouse to drag the beginning of a stream onto a unit operations' edge. Depending on the unit operations
graphical representation, connection points will be highlighted. You can modify the graphical representation of a
unit operation by clicking on the unit operation with the right mouse button and enter the Icon menu,
• define inlet stream conditions: for each inlet stream to the flowsheet (streams that do not originate from the outlet
of a unit operation), you will need to specify flow, pressure, temperature and composition. You can simply double
click on a stream to enter data,
• validate: if your model is ready to run, the run button is enabled. If not, you can obtain information of what part of
the flowsheet is incompletely specified by pressing the Validate button.

See also: Introduction to flowsheeting with COCO and ChemSep.

How to I add user defined unit operations?


All CAPE-OPEN compatible unit operations can be used inside COFE. Since CAPE-OPEN is an OPEN standard, this
means that you can simply write your own models. To do this, some knowledge on COM programming is required, or one
can use a data programming language such as Microsoft Visual Basic 6.0, that is completely designed around COM.
Newer programming environments can also be used. For example, when programming for .NET, the runtime callable
wrappers can be used to expose your models as COM objects.
The interface specifications can be downloaded from the CAPE-OPEN Laboratories Network web site; they are by default
also installed on your system as part of COCO.
To get started writing your own unit operations, you should start by picking a programming environment that you are
comfortable with, and that allows you to expose COM objects. Here are a couple of options for starting points:

• For any programming environment that allows you to build COM objects, you need to perform the following steps:
• Create a project,
• Create a class that will represent the unit operation. This is the only class that external applications will
need to create, and thus needs to be registered as a COM object,
• All CAPE-OPEN objects are required to implement ICapeIdentication and the CAPE-OPEN error
interfaces,
• The unit operation class needs to implement ICapeUnit. It is advised to also implement ICapeUtilities.
Optionally you can implement ICapeUnitReport,
• You need to create additional COM classes for the parameter collection and the port collection. These
classes need to implement ICapeCollection (one of these collections could be the unit operation class
itself, but the unit operation cannot expose two ICapeCollection interfaces, so you will need to implement
at least one additional class),
• You will need to create one or more COM classes that function as ports. Ports need to expose
ICapeUnitPort,
• If you want to add parameters to your unit operation, you will need to implement one or more classes
exposing ICapeParameter. A parameter exposes a parameter specification, which may or may not be a
separate class. This class should implement ICapeParameterSpec, and depending on the parameter type
also any of the following: ICapeRealParameterSpec, ICapeIntegerParameterSpec,
ICapeBooleanParameterSpec, ICapeOptionParameterSpec, ICapeArrayParameterSpec,
• If your unit operation needs to save and load its state, it needs to implement either an IPersistStream or
an IPersistStreamInit interface,
• The unit operation class needs to be registered as a COM object. Additionally, the CapeDescription sub-
key of the CLSID key needs to be present, with its values (see the Methods and Tools document from the
CO-LaN web site). Additionally, the registration for the unit operation needs to include the CAPE-OPEN
Object category ID, and the CAPE-OPEN Unit Operation category ID.
• If you use Borland Delphi, you could start with the Delphi CAPE-OPEN wizard.
• If you are using .NET based programming languages, you can import the CAPE-OPEN type libraries directly. An
example if given by the FlowExhange unit operation for which the source code is available with the installation. A
CAPE-OPEN Primary Interop Assembly is in the making, and to be released by CO-LaN, as an alternative to
importing the type library. Once available, this should be used instead to avoid type conflicts in .NET 2 based
assemblies.
You could also use class libraries that will provide .NET to COM wrapping for you. One such a class library is
source: http://www.cocosimulator.org/index_support.html page 3 of 4

written by William Barrett (EPA, US), and is optionally installed by the COCO installer; the installer includes the
libraries, documentation and an example. Alternatively, you could use the MOSE CAPE-OPEN unit operation
wizard for .NET. This package contains base classes, a readme.txt describing how to generate a unit operation,
and examples. See here for details.
• If you are still using Visual Basic 6.0, make sure you have the CAPE-OPEN type libraries installed (available from
CO-LaN or by using the COCO installer). Start a new project, type ActiveX DLL. By default your project will have
one class. Save the project and the class using appropriate names (for example VB6unit.vbp and
UnitOperation.cls). Add a reference to the CAPE-OPEN type libraries (Project, References, CAPE-OPEN 1.1 type
library). Compile your class. Copy the resulting DLL to a reference location. Set the project compatibility mode to
Binary Compatibility (Component tab of project properties), and point to the reference DLL. This insures that the
CLSID between compilations will remain constant.
In the top of the unit operation class, type "Implements ICapeUnit", "Implements ICapeUtilities", "Implements
ICapeIdentification", "Implements ECapeUser", "Implements ECapeRoot", "Implements ECapeUnknown". All of
the functions of these interfaces will require implementation. The body of the function will be generated for you if
you select the interface name from the left combo-box and the function name from the right combo-box.
A unit operation requires two collections, one for ports and one for parameters. Add a class for each of these two
collections, and implement ICapeIdentification, ECapeUser, ECapeRoot, ECapeUnknown and ICapeCollection.
Add a class to represent ports, and implement ICapeIdentification, ECapeUser, ECapeRoot, ECapeUnknown and
ICapeUnitPort. If you want parameters in your unit operation, add a class to represent parameters. Implement
ICapeIdentification, ECapeUser, ECapeRoot, ECapeUnknown and ICapeParameter, and ICapeParameterSpec.
Depending on the type of parameter, you may also need to implement ICapeRealParameterSpec,
ICapeBooleanParameterSpec, ICapeArrayParameterSpec, ICapeIntegerParameterSpec and / or
ICapeOptionParameterSpec.
To implement persistence, set the unit operation class to persistable. Add the member routines
Class_ReadProperties and Class_WriteProperties.
Finally, you need to add information to the registry for other applications to find your CAPE-OPEN unit operation.
This requires you to know the CLSID of your unit operation object (which you can find using RegEdit.exe) and
write a .reg file that adds the appropriate entries for category IDs and the CapeDescription key.
A mixer-splitter example implementing all of the above can be downloaded from here.
• The mixer-splitter example is also available in Visual C++ (Visual Studio 2005 Professional) using ATL and STL,
and can be downloaded from here.
• Another alternative is to put together unit operations without programming. Examples of applications that allow
you to enter CAPE-OPEN unit operation model equations:
• AmsterCHEM's Excel-based CAPE-OPEN Unit Operation
• AmsterCHEM's Matlab CAPE-OPEN Unit Operation
• AmsterCHEM's SciLab CAPE-OPEN Unit Operation
• PSE's gPROMS gO:CAPE-OPEN
• COFE Flowsheet can be used as CAPE-OPEN Unit Operation, hence any combination of CAPE-OPEN
unit operations can be used as unit operation

How do I add user defined thermo models?


All CAPE-OPEN compatible unit thermodynamic packages can be used inside COFE. Since CAPE-OPEN is an OPEN
standard, this means that you can simply write your own models. To do this, some knowledge on COM programming is
required, or one can use a data programming language such as Microsoft Visual Basic 6.0, that is completely designed
around COM.
The interface specifications can be downloaded from the CAPE-OPEN Laboratories Network web site; they are by default
also installed on your system as part of COCO.
It is strongly advised that any new CAPE-OPEN thermodynamic components implement at least version 1.1 of the CAPE-
OPEN thermodynamic standard. Many of the knowledge required to program a CAPE-OPEN unit operation (see above)
also applies to programming thermodynamic components. It is therefore recommended to first start of by building a simple
CAPE-OPEN unit operation, as this is generally an easier task and will allow you to get acquainted with the CAPE-OPEN
concepts. See above for starting points on how to build CAPE-OPEN unit operations.
A Visual 2012 SP1 C++ and/or MinGW based version 1.1 stand-alone Property Package "Water" for calculation of
properties of water and steam, is available in the COCO distribution. The source code is available from here.
A C++ and VB6 code example for a version 1.0 Thermo System and version 1.1 Property Package Manager is available
source: http://www.cocosimulator.org/index_support.html page 4 of 4

from here; see COIdealThermoExample.

Can I use ChemSep / COUSCOUS / TEA in other simulation environments?


Yes. As long as these environments provide CAPE-OPEN compatibility.

Running COCO under WINE


Since version 1.13, the installer has been adjusted to proceed successfully under wine. A common installation issue under
wine is that the temp sub-folder of the installation folder still contains setup files. If this is the case, please remove this
folder manually.
Known issues under wine:

• TERNYP may not display graphics (depending on wine and OS version)


• images in the CHM help file may or may not display. There are several CHM viewers available. The online version
of the help is an alternative
• inserting text objects in flowsheets is somewhat problematic; text objects may not be rendered properly
• the solve button on the toolbar does not display properly
• the header rows in the stream dialog do not display properly (wrong text background)
• auto scaling of text columns in list views does not work properly

COULIS or OATS crashes


It is not uncommon that installation of third party software causes improper registration of the CAPE-OPEN type libraries.
COULIS and OATS run out-of-process and thus depend on proper installation of these type libraries. Please try re-
installing the CAPE-OPEN type libraries (available in the COCO installer or from
https://colan.repositoryhosting.com/trac/colan_coidl/downloads)

Installer says: not a valid Windows application


If after downloading the installer, the installer does not run, with the message that the installer is not a valid Windows
application, most likely the download got aborted before it was complete. Make sure that the file size of the installer
matches the size reported in the downloads section. If not, restart or complete the download.

How do I become a contributor?


COCO is free of charge, but it not an open-source project. Contributions can be made in the form of stand-alone
components, in the form of flowsheet benchmark and testing documents, in the form of online discussions, etc
If you define your own models (thermo dynamics, unit operations, numeric solvers, ...) and you want these to be shipped
with COCO, or you feel that in any other way you can contribute to the COCO simulation environment, please contact us.

You might also like