Matlab Unit report tolerances

Moderator: jasper

Matlab Unit report tolerances

Postby King » 18 May 2017, 06:20

I try to calculate the dew point by 'getEquilibrium' function and easy 'for recycle' script in matlab unit-op. I find that the calculated dew temperature is 0.001 high than the actual dew point.
For example, if the dew point is -23.333℃, when calculated by the 'getEquilibrium' function, the phase is also vapor in -23.334℃.
King
 
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Postby jasper » 18 May 2017, 11:07

Can you provide the script? Which property package are you using?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Matlab Unit report tolerances

Postby King » 18 May 2017, 13:12

jasper wrote:Can you provide the script? Which property package are you using?

Here is matlab unit-op module
Attachments
dewpoint.rar
(847 Bytes) Downloaded 1082 times
King
 
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Postby jasper » 23 May 2017, 12:38

Not clear. I see your script, which is essentially running many T+P flashes and checking whether a liquid is present.

Which simulation environment are you running this in? Can you reduce the problem to 2 equilibrium calculations:

1) calculate the dew point temperature:

Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'vaporfraction',1,'pressure',P)


2) calculate the T-P flash at the temperature below (?) the dew point where only vapor appears?

Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'temperature',T,'pressure',P)


(where T is the temperature below the dew point that gives vapor only)

and post the outputs?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Matlab Unit report tolerances

Postby King » 23 May 2017, 15:10

jasper wrote:Not clear. I see your script, which is essentially running many T+P flashes and checking whether a liquid is present.

Which simulation environment are you running this in? Can you reduce the problem to 2 equilibrium calculations:

1) calculate the dew point temperature:

Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'vaporfraction',1,'pressure',P)


2) calculate the T-P flash at the temperature below (?) the dew point where only vapor appears?

Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'temperature',T,'pressure',P)


(where T is the temperature below the dew point that gives vapor only)

and post the outputs?



1.In PROII 9.4
2.My idea is to use the getEquilibrium function, and if liquid is exist, T=T+10^(1-k), else T=T-10^(1-k), here k is to control the accuracy from 1 to 0.0001.
unless arrive at satisfactory accuracy
3.My script is to calculate Dewpoint at the temperature when liquid is first exist, and then plus 10^(1-k) (Kelvin)
4.Aside from my script, you can try to use getEquilibrium function to see the phases at the temperature of 0.001K lower than the dewpoint (calculated by the simulation environment), it will show only vapor phase instead of two phases actually
King
 
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Postby jasper » 23 May 2017, 19:47

Understand, but I would expect the thermodynamic to return a vapor + liquid (or just liquid) at T < Tbub for any P at which the phase boundary is not retrograde. The simple test I suggested would check whether this is the case.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Matlab Unit report tolerances

Postby King » 24 May 2017, 01:24

jasper wrote:Understand, but I would expect the thermodynamic to return a vapor + liquid (or just liquid) at T < Tbub for any P at which the phase boundary is not retrograde. The simple test I suggested would check whether this is the case.


It is strange. It show the correct dewpoint today. Maybe there is something wrong last time when running the simulation。

Thank you Jasper!
King
 
Posts: 22
Joined: 17 February 2017, 06:22


Return to MATLAB Unit Operation (AmsterCHEM)

Who is online

Users browsing this forum: No registered users and 1 guest

cron