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℃.
Matlab Unit report tolerances
Moderator: jasper
Re: Matlab Unit report tolerances
Can you provide the script? Which property package are you using?
Re: Matlab Unit report tolerances
Here is matlab unit-op modulejasper wrote:Can you provide the script? Which property package are you using?
- Attachments
-
- dewpoint.rar
- (847 Bytes) Downloaded 1581 times
Re: Matlab Unit report tolerances
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:
2) calculate the T-P flash at the temperature below (?) the dew point where only vapor appears?
(where T is the temperature below the dew point that gives vapor only)
and post the outputs?
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)
Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'temperature',T,'pressure',P)
and post the outputs?
Re: Matlab Unit report tolerances
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:
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,'vaporfraction',1,'pressure',P)
(where T is the temperature below the dew point that gives vapor only)Code: Select all
[phases,phasefractions,compositions,T,P]=getEquilibrium(x,'temperature',T,'pressure',P)
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
Re: Matlab Unit report tolerances
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.
Re: Matlab Unit report tolerances
It is strange. It show the correct dewpoint today. Maybe there is something wrong last time when running the simulation。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.
Thank you Jasper!