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

Opening a fsd file through COM

Postby DanW » 03 May 2017, 19:32

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
DanW
 
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Postby jasper » 04 May 2017, 06:46

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?page=COFE/Automation/automation.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?page=COFE/flowsheetuo.htm
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Opening a fsd file through COM

Postby DanW » 04 May 2017, 13:41

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.
DanW
 
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Postby jasper » 04 May 2017, 14:04

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: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Opening a fsd file through COM

Postby jasper » 04 May 2017, 14:06

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.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Opening a fsd file through COM

Postby DanW » 04 May 2017, 14:36

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?
DanW
 
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Postby jasper » 04 May 2017, 14:42

No - not at this point. But several parties have expressed an interest in implementing it once it is published.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Opening a fsd file through COM

Postby DanW » 04 May 2017, 18:50

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.
DanW
 
Posts: 17
Joined: 01 November 2012, 03:01

Re: Opening a fsd file through COM

Postby jasper » 04 May 2017, 19:02

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.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Opening a fsd file through COM

Postby DanW » 06 May 2017, 00:09

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 26430 times


ccost011.png
ccost011.png (21.27 KiB) Viewed 26430 times


ccost012.png
ccost012.png (52.94 KiB) Viewed 26430 times


ccost013.png
ccost013.png (43.18 KiB) Viewed 26430 times


ccost014.png
ccost014.png (71.21 KiB) Viewed 26430 times


I also map material and energy streams to Materials and Utilities.
DanW
 
Posts: 17
Joined: 01 November 2012, 03:01

Next

Return to COCO (AmsterCHEM)

Who is online

Users browsing this forum: No registered users and 5 guests

cron