Opening a fsd file through COM

Discusses use of COCO, the process simulation and modelling software suite from AmsterCHEM, downloadable from http://www.cocosimulator.org

Moderator: jasper

DanW
Posts: 17
Joined: 01 November 2012, 03:01

Opening a fsd file through COM

Post by DanW »

Hi Jasper,

Suppose that I have COCO installed and correctly registered. Is it possible to open a simulation file (fsd) through COM (that is, without opening COFE) and access all the flowsheet items (streams and unit operations) as CAPE-OPEN objects?

Regards
Daniel
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Opening a fsd file through COM

Post by jasper »

You can open a flowsheet document via COM, yes. This requires creating an OLE version of COFE (via automation, see here for the details http://cocosimulator.org/index_help.php ... mation.htm), but you can of course hide the OLE site if you write that yourself.

Not sure where you want to go, but another way to access an fsd as an object would be as a CAPE-OPEN unit operation: http://cocosimulator.org/index_help.php ... heetuo.htm
DanW
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Post by DanW »

Thanks for the answer, Jasper.

I've developed a capital cost estimation tool which currently works as a plugin for dwsim. I'm working on making it standalone, being able to open flowsheets from other simulators to read data from the streams and unit operations via an "import" tool.

It's been a while since I've worked with the flowsheet monitoring interface, but I'll see if can make it work with COCO through that interface as well.
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Opening a fsd file through COM

Post by jasper »

That would be very nice - note that the monitoring interface is in a review stage in the M&T group, after which it will be officially published, with a bunch of modifications.
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Opening a fsd file through COM

Post by jasper »

If you want to grab and interpret the content of a flowsheet document, I would recommend monitoring (best the newly unreleased interface, I can upgrade to that as well).

There is an alternative for COFE - which is to unpack the fsd and parse the xml.
DanW
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Post by DanW »

jasper wrote:If you want to grab and interpret the content of a flowsheet document, I would recommend monitoring (best the newly unreleased interface, I can upgrade to that as well).

There is an alternative for COFE - which is to unpack the fsd and parse the xml.
Is it a ZIP file too? I'll take a look, that would be better because the user wouldn't need to have COCO installed (or installed without admin privileges).

Do you know if there's a simulator which supports the Flowsheet Monitoring interface other than COCO and DWSIM?
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Opening a fsd file through COM

Post by jasper »

No - not at this point. But several parties have expressed an interest in implementing it once it is published.
DanW
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Post by DanW »

COFE's XML file seems very "human-readable". I'll proceed through this path and get back here as soon as I have something to show.
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Opening a fsd file through COM

Post by jasper »

Ok - note that COUSCOUS units and TEA will write to IPropertyBag, which translates nicely to XML, but many PMCs don't, in which case the content of the PMC will be a BASE64 blob.
DanW
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Post by DanW »

I've finished the Import tool. I'm mapping some COUSCOUS unit operations according to cost data availability.

The workflow to import data from a FSD file is very simple:
ccost010.png
ccost010.png (40.69 KiB) Viewed 29867 times
ccost011.png
ccost011.png (21.27 KiB) Viewed 29867 times
ccost012.png
ccost012.png (52.94 KiB) Viewed 29867 times
ccost013.png
ccost013.png (43.18 KiB) Viewed 29867 times
ccost014.png
ccost014.png (71.21 KiB) Viewed 29867 times
I also map material and energy streams to Materials and Utilities.
Post Reply

Return to “COCO (AmsterCHEM)”