[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - Add new Material Port after UO loaded into simulator

Add new Material Port after UO loaded into simulator

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

Moderator: jasper

Add new Material Port after UO loaded into simulator

Postby bcbooo » 09 March 2015, 03:13

For a "Mixer" unit operation block, I create one inlet port and one outlet port on it's initialization. When an inlet stream is connected to it's inlet port, I will create a new inlet port and add to the "port collection", then the UO will have two inlet ports and one outlet port. More inlet ports will be created and added while inlet streams connected.

I find that Simulator only refreshes ports connection status when UO intialized or Edited, whether COFE or Aspen Plus. So after new port created and added to port collection, Simulator doesn't know this change and still has the same inlet ports count as before, unless click on the UO icon to open it's Edit Window by hand.

So I wonder are there any other strategies to refresh ports status after new port created?
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Add new Material Port after UO loaded into simulator

Postby jasper » 09 March 2015, 07:25

The port and parameter collections can only be changed during Edit and at instantiation. So the strategy for changing the number of ports upon connection of a port (or for example upon changing a parameter "number of inlets") is not recommended. I am afraid you will need to depend on the user to enter the unit's Edit method. Alternatively, just create your unit with sufficient (10?) ports, and allow that ports remain unconnected. This strategy is ok, not all ports need to be connected to run. It is up to Validate to decide whether unconnected ports are ok or not.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Add new Material Port after UO loaded into simulator

Postby bcbooo » 09 March 2015, 07:44

Thank you Jasper for your reply.

Creating a Unit Operation Block with sufficient ports is not rational for users, on one hand UO can't decide how many ports is sufficient, maybe 10, 20, even 100 more; On the other hand, especially in Aspen Plus' environment, when user connects the stream with port, Aspen Plus will popup a dialog with the list of ports for the user to select which port to be connected, too many ports pre-assigned will make user puzzled.

So I advise simulators to modify some strategies, for example, when stream is connected to a port, the simulator will refresh the port collection to get ports count and connection status.

Thank you for your consideration.
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Add new Material Port after UO loaded into simulator

Postby jasper » 09 March 2015, 08:04

It is considered an unreasonable overhead to require simulators to re-evaluate the collection of ports and parameters upon any change in port connection, parameter value (e.g. parameter "number of inlet ports") or operating condition. So the unit operation specification clearly states that the simulator only has the requirement to re-evaluate the port collection upon initialization, loading and editing. The parameter common interface specification makes a similar statement about the parameter collection.

CAPE-OPEN remains an interaction between PMEs and PMCs, and both will have to adhere to the agreements for the interaction to work. The agreement in this case is that it is not required for the PME to continuously re-evaluate the port collection upon any change.

Hope that helps
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Add new Material Port after UO loaded into simulator

Postby bcbooo » 21 March 2015, 02:14

Attachments
Dynamic Add New Port.zip
(78.54 KiB) Downloaded 781 times
Untitled.jpg
Untitled.jpg (114.95 KiB) Viewed 26924 times
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Add new Material Port after UO loaded into simulator

Postby jasper » 21 March 2015, 09:19

User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Add new Material Port after UO loaded into simulator

Postby bcbooo » 23 March 2015, 00:40

Sorry Jasper, you may misunderstand my point. There is a bug in COFE, when the dynamic created outlet port is connected with a stream, the "ports dialog" considers the stream as a outlet stream, but the bottom tip window considers the stream as a inlet stream, it conflicts.

I surmise COFE doesn't take the dynamic port method into consideration, so that the bug occurs. I hope you could fix this problem. Thanks!
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Add new Material Port after UO loaded into simulator

Postby jasper » 23 March 2015, 08:25

I do not think there is a bug in COFE. I think you are not implementing persistence.

That what happens is; you hit Solve. COFE creates a new thread, saves your unit in the original thread (if you implement save), creates your unit in the new thread, loads it (if you implement load) and tries to connect the ports that were connected in the original unit.

If the copied unit does not contain the port, that will result in that message.

You can easily verify my hypothesis: Edit, Preferences, turn off "Allow solving flowsheet in a separate thread". Now you are running the same unit as the one in the foreground thread. If this runs ok, please check if you have implemented persistence, and if persistence properly restores the ports.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Add new Material Port after UO loaded into simulator

Postby bcbooo » 25 March 2015, 00:35

:lol:
Jasper you are right, I forgot the persistence. Sorry for disturbing.
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: Add new Material Port after UO loaded into simulator

Postby jasper » 25 March 2015, 08:05

Glad to hear it is resolved.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain


Return to COCO (AmsterCHEM)

Who is online

Users browsing this forum: No registered users and 27 guests