Page 1 of 1

Scilab UnitOp calc thermo without feed

PostPosted: 12 April 2017, 14:58
by greTol
Hi Jasper,

I added a scilab unit operation to a flowsheet. This unit only has one port: An output.
When I call "getSinglePhaseProperty" to get the activity coefficient
e1_greek_gamma_i = getSinglePhaseProperty("activityCoefficient","liquid",e1_T,e1_p,e1_x_i);
I get the following error:

Error:
Failed to calculate activityCoefficient:
CalcSinglePhaseProp failed:
Failed to obtain temperature from the material object:
no values set for temperature, phase overall, calcType mixture

In another unit operation, that has input ports, the same line works.
Is it really a problem that my unit has no input?
If yes, is there a workaround to get results from these thermo functions anyway?

Would be glad to get an answer.

With best regards,

greTol

Re: Scilab UnitOp calc thermo without feed

PostPosted: 12 April 2017, 15:02
by jasper
Is there any way you can send me a file that contains this issue so that I can investigate?

Re: Scilab UnitOp calc thermo without feed

PostPosted: 13 April 2017, 12:14
by jasper
The problem is that T and P are zero on the very first call to activity. You can see it if you do

disp(e1p1_T)
e1_greek_gamma_i = getSinglePhaseProperty("activityCoefficient","liquid",e1p1_T,e1p1_P,e1_x_L_i);

instead of just

e1_greek_gamma_i = getSinglePhaseProperty("activityCoefficient","liquid",e1p1_T,e1p1_P,e1_x_L_i);

The error message of course is not nice - I will check how to improve upon that.

Re: Scilab UnitOp calc thermo without feed

PostPosted: 14 April 2017, 09:46
by jasper
The error message from COCO is nicer now - it does not accept a value of 0 for temperature or pressure anymore.

Also if you are using Scilab 6.0 - please update your Scilab Unit Operation; the error handling is fixed there too.

Thank you for posting your issue.