Information Calculator: Calculation Error

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

Moderator: jasper

Information Calculator: Calculation Error

Postby nrgeng » 25 May 2014, 12:35

I am using COCO 2.6.0.24. The output displays a wrong answer. I reported other issues in January and February. I hope this can be fixed. I have sent the fsd file.
nrgeng
 
Posts: 239
Joined: 16 February 2013, 12:45
Location: USA

Re: Information Calculator: Calculation Error

Postby jasper » 25 May 2014, 12:39

Which issues in Jan & Feb are you referring to?

For this case: the answer appears correct to me. Do take into account please that M_flow is in mol/s, not kmol/h which is why the answer you expect, you will find if you multiply by 3600 s/h and divide by 1000 mol/kmol. Hope that helps.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Information Calculator: Calculation Error 2

Postby nrgeng » 25 May 2014, 14:08

Everything that I see on the fsd has units of kmol/h: 1) the stream report, 2) Document Explorer stream view, and 3) when I mouse over the stream. I see nothing in mol/s. Maybe that is the problem. What are you looking at that shows mol/s for M_flow? Stream 109 is dimensionless.
nrgeng
 
Posts: 239
Joined: 16 February 2013, 12:45
Location: USA

Re: Information Calculator: Calculation Error

Postby jasper » 25 May 2014, 14:59

All units that are transferred between the simulator and the unit operations or the thermodynamics are in pure SI unit. This is a CAPE-OPEN convention (one that makes sense). You specify the kmol/h on the simulator side. The unit operation merely knows that it is a quantity in mol/s and offers only one unit of measure for that: mol/s. This is indicated as such on the Inputs section of the information calculator; the same page on which the equation is entered.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Information Calculator: Calculation Error 3

Postby nrgeng » 25 May 2014, 15:33

I set the variable units in COFE and do not expect to do units conversion math. So now you are telling me that with only the Information Calculator Unit, I have to include unit conversion math within the calculation, but for all other COCO Units the unit conversions are performed by COFE. Is this true?
nrgeng
 
Posts: 239
Joined: 16 February 2013, 12:45
Location: USA

Re: Information Calculator: Calculation Error

Postby jasper » 25 May 2014, 19:41

No - none of the COUSCOUS units does unit conversion.

When you double click any unit operation in COFE, you first get to see what COFE sees from the unit. This includes parameters, and their dimensionality. COFE has a unit conversion system, and offers it at that level.

Then there is Show GUI. This will show the dialog that belongs to the unit operation. None of the ones included in COCO will provide unit conversion. If you enter parameter values at this level, it will always be in SI units. But typically there is no need to, as you can do it on the COFE level.

Here you are entering an expression at the unit operation level. This expression takes inputs from parameters, of which the values have SI units. A similar thing happens in reaction expressions in CORN, also expressions that use variables that are only available in SI units.

The only way around that would be to provide a unit conversion system at COUSCOUS and at CORN level (note that these are different binary modules than COFE, each module uses CAPE-OPEN interfaces only to interact). Seems like an overkill. The unit conversion systems would not be aware of each other. So they would not be aligned with each other; you would still to select your unit of measure separately on COFE level than on COUSCOUS level. CAPE-OPEN transfers dimensionality but not unit conversions. It would not be straight forward to capture unit conversion systems in a generic interface, as the diversity is rather large.

Next there would need to be unit conversion systems built in to the Excel unit operation, Matlab unit operation, Scilab unit operation, FlowExchange unit operation, etc.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Information Calculator: Calculation Error 4

Postby nrgeng » 25 May 2014, 20:59

Here is an example that I have working. The Information Calculator Unit sums thermal energies. The inputs and the one output are configured in kW units in COFE. The Information Calculator GUI shows units of J/s. In the Edit Unit Operation dialog, I selected kW units. I did not include any conversion factors in the output function. So why did the energies add correctly? This Information Calculator Unit provides the correct answer the other Information Calculator Unit does not. How can the user know when unit conversion in the formula is required?
nrgeng
 
Posts: 239
Joined: 16 February 2013, 12:45
Location: USA

Re: Information Calculator: Calculation Error

Postby jasper » 26 May 2014, 05:46

No example is attached, but if you are just summing of course it does not matter which unit of measure you use. The sum works with any unit of measure. In the example of yesterday, the formula includes dimensional numbers. For example, the number you divide by could be in s/kmol; I cannot tell just by looking at the formula.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Information Calculator: Calculation Error 5

Postby nrgeng » 16 June 2014, 14:56

Thanks for all the information. I added another input with the variable's units (in the Unit Operation dialog) and Surprise!, Surprise!, the answer is what I expected. I did not have to perform a units conversion within the Information Calculator Formula. The calculation error was due to my neglecting the units of the normalization coefficient. My disregard of units again! Problem resolved-->operator error.
nrgeng
 
Posts: 239
Joined: 16 February 2013, 12:45
Location: USA

Re: Information Calculator: Calculation Error

Postby jasper » 16 June 2014, 15:03

Glad to hear it works.
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 6 guests