Matlab Unit report tolerances

Moderator: jasper

Post Reply
King
Posts: 22
Joined: 17 February 2017, 06:22

Matlab Unit report tolerances

Post by King »

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

Re: Matlab Unit report tolerances

Post by jasper »

Can you provide the script? Which property package are you using?
King
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Post by King »

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

Re: Matlab Unit report tolerances

Post by jasper »

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?
King
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Post by King »

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

Re: Matlab Unit report tolerances

Post by jasper »

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.
King
Posts: 22
Joined: 17 February 2017, 06:22

Re: Matlab Unit report tolerances

Post by King »

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

Return to “MATLAB Unit Operation (AmsterCHEM)”