Fundamental questions on Validation and Calculation methods

Discusses CAPE-OPEN specific middleware and corresponding development kit

Moderator: jasper

Fundamental questions on Validation and Calculation methods

Postby ahmedsabriz » 13 June 2021, 19:44

Greetings.

I am new to CAPE-OPEN development, starting with COBIA, with the aim of developing PMC for my thesis. I use the COBIA class wizard, refer to its documents, while slowly progressing through the CAPE OPEN documentation, especially interfaces needed for my unit operation. I have a basic question about validation and calculation methods in the ICapeUnit Interface:

My understanding is that validation is called at least once before calculation and in scenarios explained in CO_Unit_Operations_v6.25. However, the two methods feel entangled in my head, and I wonder if I am missing something. The mixer example in the class wizard guide performs few checks when validation is called. One check is comparing the material compounds among ports to ensure consistency. It iterates through the ports of the portCollection which is simple and contains only feed and product material streams in this case. However, if I am adding a blank stream in the PME as the product expecting it to be populated by the unit, how are validation and calculation performed?
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Fundamental questions on Validation and Calculation meth

Postby jasper » 14 June 2021, 07:27

Validate is of course a place to catch errors in the configuration, such as unconnected ports, that should prevent the user from solving the flowsheet to begin with.

Generally, at the moment Calculate is called, you can assume Validate has been called at the same configuration, except feed stream values. In case the unit operation is inside a recycle, chances are that Calculate will be called many a time, while Validate needs to be called only once. So any static information that does not depend on feed stream values can be obtained already in Validate.

At the same time, Validate should avoid doing any lengthy calculations; it would cause a GUI to become laggy.

More information is in the unit operation specification document:

https://www.colan.org/specifications/unit-operation-interface-specification/
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain


Return to CAPE-OPEN Binary Interop Architecture

Who is online

Users browsing this forum: No registered users and 1 guest

cron