Quote:
Would there be some samples or templates available to learn the minimum stuff I should implement?
Samples in VB6 would be ok, as it maps easily to j++.
See
http://www.cocosimulator.org/index_support.html; section "How to I add user defined unit operations?", first example contains VB code.
Quote:
To simplify my life I had decided not to define ports in my application.
Streams are simply pre-defined members of unit classes.
In CAPE-OPEN terms: ports are the connection points of the unit operation. To this, the simulation environment will connect a Material Object (if it is a material port). The Material Object is what you should think of as the stream in the flowsheet. You do not define it, the simulation environment does. You will just see that they get connected to your ports.
Quote:
The units can only work with the specified streams.
It is not clear for me if this can be translated to CAPE-OPEN.
It seems to me that you want to define a port for each 'stream' of your unit operation class. Then at
Code:
ICapeUnit::Validate, you make sure that the unit will not run if not all ports are connected (and it would be wise to check things like: are the connected material objects of the same type, e.g. do they have the same list of compounds). At
Code:
ICapeUnit::Calculate you can get the input values from the material objects connected to the inlet ports, and you must specify flow, overall composition and two more variables for the materials connected to the outlet ports, and then perform a flash for the materials connected to the outlet ports.
Quote:
Again, I have to think about the way to switch to CAPE-OPEN: the J++ track or another one?
I cannot advise you there; this is a personal choice. Generally it is possible to mix languages as well, in case of Java it would be possible to compile C++ solvers (e.g. the Sundials solvers) and call them via JNI.