Scilab UnitOp calc thermo without feed

Moderator: jasper

Post Reply
greTol
Posts: 20
Joined: 26 August 2013, 14:45

Scilab UnitOp calc thermo without feed

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

Re: Scilab UnitOp calc thermo without feed

Post by jasper »

Is there any way you can send me a file that contains this issue so that I can investigate?
User avatar
jasper
Posts: 1129
Joined: 24 October 2012, 15:33
Location: Spain
Contact:

Re: Scilab UnitOp calc thermo without feed

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

Re: Scilab UnitOp calc thermo without feed

Post 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.
Post Reply

Return to “Scilab Unit Operation (AmsterCHEM)”