Jump to content



Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

0

Help With First Principles Calculation Of Vapor Pressure


6 replies to this topic
Share this topic:
| More

#1 MSwickrath

MSwickrath

    Brand New Member

  • Members
  • 3 posts

Posted 15 September 2017 - 09:41 AM

Hi all - I want to calculate vapor pressures from first principles for a class of compounds. In this instance, I am interested in ionic liquids. More generally though, I want to setup a calculation approach for any compound so I can use this technique and resulting tool in the future (...that is, don't say 'reference x has vapor pressure of many ionic liquids' because that doesn't help on with the larger question that I am interested in answering). 

 

I have critical pressure, critical temperature, and Pitzer acentric factors but little else (note, not from measurements but from group contribution methods, "Critical properties of Ionic Liquids. Revisited” , by J. O. Valderrama and R.E. Rojas, IECR (2009)). 

 

First, let me start by stating the obvious that I am an moron - you may have to type slow to me. I think I have a bad definition in my thermodynamic approach or I am doing something wrong. Can you help set me straight?

 

Second, here is my approach...

 

For a pure component, at equilibrium, vapor and liquid fugacity must be equal

 

fL = fv

 

Pure vapor fugacity is equal to total pressure multiplied by the vapor fugacity coefficient

 

fvϕ(T,P)P

 

Gas fugacities are calculated using the SRK equation of state (EOS) implemented in Excel with VBA. I have validated my approach extensively with common industrial materials using some process simulators I have had intermittent access to (CHEMCAD and Aspen Plus). I am pretty confident I don't have a flaw with my implementation of the EOS. 

 

For the liquid phase for the pure component, I am calculating the vapor fugacity in equilibrium with the liquid. Or, in other words, I am calculating the vapor fugacity at vapor pressure (...keep in mind that vapor pressure is an unknown and I use an initial guess for vapor pressure). I am using the asterisk below to denote saturation conditions where P* is vapor pressure.

 

f= fv* = ϕ(T,P*P*×exp[VL(P-P*)/(RT)]

 

The exponential term is the Poynting correction factor with VL as the . The fugacity coefficient was calculated as a vapor fugacity at vapor pressure (where again, my vapor pressure was an initial guess).

 

Thereafter, my thoughts were to use some optimization technique to solve for vapor pressure that makes objective function, F, equal to zero (or close to it).

 

minimize F = {ϕ(T,P)P - ϕ(T,P*P*×exp[VL(P-P*)/(RT)]}2

 

However, things are breaking down and I get a non-physical result. First, instead of solve the problem I don't know the answer to, I seek to solve the equations for water and compare the predictions to the Antoine equation for water vapor pressure (I am starting at conditions close to ambient). I am not even getting far enough to compare against data though.

 

Instead, I find the objective function is minimized when P*=P. From this, I infer the non-physical result is due to a non-physical setup. When P*=P, the Poynting correction factor equals one and the objective function, F, becomes.

 

F = {ϕ(T,P)P - ϕ(T,P*P*}2

 

Using Solver in Excel (...even though I am optimizing on variable, Solver is much more robust than Goal Seek), it continues to converge on P = P* which then sets ϕ(T,P)P - ϕ(T,P*). At 300 K, I believe the vapor pressure of water is somewhere around 20 mm Hg without looking it up which is definitely not 760 mm Hg.

 

Do I have a flaw in my approach? Is it not possible to calculate vapor pressure from critical properties and an EOS? 

 

As I am typing this out, I see I am trying to enforce f= fv* and equality can be realized numerically if one makes P = P* which is not thermodynamically correct.

 

Pending vapor pressure can be calculated from an EOS, the next question is accuracy which I will try to evaluate using some common materials of industrial importance. I ultimately want to couple this with the Clausius-Clapeyron equation to try and get enthalpy of vaporization as a function of temperature (then, with an enthalpy latent heat method, I can maybe calculate liquid heat capacity given the ideal heat capacity of the material which I have for ionic liquids from another group contribution method paper - this can be a really powerful technique if I can get it to work).

 

Thank you all in advance for your time and attention I am hope others can learn from your response while I do the same (...which is another motivation for someone to work through the thermo rather than post a link to some database for ionic liquids).

 



#2 MrShorty

MrShorty

    Gold Member

  • ChE Plus Subscriber
  • 517 posts

Posted 15 September 2017 - 10:25 AM

I have not used this algorithm for this calculation. The approach I usually use:

 

fL=fV

P*phiL=P*phiV -- Rearrange

P=P*phiL/phiV -- which sets up a simple "successive approximations" algorithm.

Guess a P.

Use EOS to compute phi liquid and phi vapor

put those quantities into the right side of the equation and calculate next guess for P

Repeat until P converges.

 

Exactly how to implement that in Excel depends on exactly how you have your EOS phi calculator set up, but it should be fairly straightforward.


Edited by MrShorty, 15 September 2017 - 10:25 AM.


#3 MSwickrath

MSwickrath

    Brand New Member

  • Members
  • 3 posts

Posted 15 September 2017 - 11:10 AM

I have not used this algorithm for this calculation. The approach I usually use:

 

fL=fV

P*phiL=P*phiV -- Rearrange

P=P*phiL/phiV -- which sets up a simple "successive approximations" algorithm.

Guess a P.

Use EOS to compute phi liquid and phi vapor

put those quantities into the right side of the equation and calculate next guess for P

Repeat until P converges.

 

Exactly how to implement that in Excel depends on exactly how you have your EOS phi calculator set up, but it should be fairly straightforward.

 

Thanks for the prompt response MrShorty. I am not using your exact approach but I think I am essentially doing the same thing in principle. I think where I may be going awry is with my definition for your phiL. Is phiL at given T and P the same as phiV at T and P* (with P* defined as vapor pressure)? That is at least what I tried to do. When I do that, then I find that one solution is P=P* which I know isn't true (but at least my algorithm converges nicely which is the other part of the battle).

 

Long story short - I think I am calculating a bogus fugacity coefficient somewhere using wrong conditions or something. I have been reviewing thermo texts but they are all tomes and it is hard to find anything that provides a clear-cut explanation on what I am trying to accomplish. 

 

 

 

 

-------------------------------------------------------------------------------------------

Edit: Solution procedure has been found in Section 5.5 of Sandler, Chemical and Engineering Thermodynamics, 3rd Ed., John Wiley & Sons, Inc. (1999), pp 295-296.

 

I am re-working my analysis now. I plan to update this post when I find my error in the hopes it saves someone else some time down the road.


Edited by MSwickrath, 15 September 2017 - 11:58 AM.


#4 MrShorty

MrShorty

    Gold Member

  • ChE Plus Subscriber
  • 517 posts

Posted 15 September 2017 - 12:05 PM

Is phiL at given T and P the same as phiV at T and P* (with P* defined as vapor pressure)?
Maybe, but I am not sure. It looks to me like you are trying to use the Poynting factor to get at the liquid fugacity and fugacity coefficient rather than getting the fugacity coefficient of the liquid directly from the EOS.Here's how I get phiL and phiV for a given iteration:

 

1) Given values for T and Pguess (either initially guessed P, or the estimated P from the current iteration).

2) Solve EOS for compressibility Z of the vapor (should be a value near 1) at T and Pguess.

3) Put this Z into the EOS's equation for phi to get the fugacity coefficient of the vapor phivap (normally a value near 1).

4) Solve EOS again to get compressibility Z of the liquid (should be a value near 0) at same T and Pguess. Remember that our cubic EOS should have 3 real roots in V or Z: one corresponding to the vapor phase, one corresponding to the liquid phase, and a 3rd discarded root.

5) Put the liquid Z into the EOS's equation for phi to get the fugacity coefficient of the liquid philiq (could be anything depending on how close the current Pguess is to the solution P).

6) From P=P*philiq/phivap, get next estimate for Pguess and return to step 1.

 

As I indicated above, note that the Poynting factor does not figure into this variation of the calculation. Does that help?



#5 MSwickrath

MSwickrath

    Brand New Member

  • Members
  • 3 posts

Posted 15 September 2017 - 12:15 PM

 

Is phiL at given T and P the same as phiV at T and P* (with P* defined as vapor pressure)?
Maybe, but I am not sure. It looks to me like you are trying to use the Poynting factor to get at the liquid fugacity and fugacity coefficient rather than getting the fugacity coefficient of the liquid directly from the EOS.Here's how I get phiL and phiV for a given iteration:

 

1) Given values for T and Pguess (either initially guessed P, or the estimated P from the current iteration).

2) Solve EOS for compressibility Z of the vapor (should be a value near 1) at T and Pguess.

3) Put this Z into the EOS's equation for phi to get the fugacity coefficient of the vapor phivap (normally a value near 1).

4) Solve EOS again to get compressibility Z of the liquid (should be a value near 0) at same T and Pguess. Remember that our cubic EOS should have 3 real roots in V or Z: one corresponding to the vapor phase, one corresponding to the liquid phase, and a 3rd discarded root.

5) Put the liquid Z into the EOS's equation for phi to get the fugacity coefficient of the liquid philiq (could be anything depending on how close the current Pguess is to the solution P).

6) From P=P*philiq/phivap, get next estimate for Pguess and return to step 1.

 

As I indicated above, note that the Poynting factor does not figure into this variation of the calculation. Does that help?

 

 

Thanks again MrShorty - that actually makes a lot of sense and that is not what I was doing. I am going to give that a try...

 

Thanks again!

 

----------------------------------------------------------------------------------------------------------

Edit: I tried the approach and it worked really well. For water, I calculated 21 mm Hg at 300 K while NIST Antoine equation parameters provide 26 mm Hg (close enough for me for the materials I am really interested in).

 

Also, I see what MrShorty is saying - Poynting correction does not factor into this approach.

 

Thanks for the explanation! This analysis will be a handy tool for me moving forward.


Edited by MSwickrath, 15 September 2017 - 12:53 PM.


#6 MrShorty

MrShorty

    Gold Member

  • ChE Plus Subscriber
  • 517 posts

Posted 15 September 2017 - 02:41 PM

I did not previously see your edit to post #3 referencing Sandler's text and the algorithm he suggests. I would be curious what kind of approach he took in that text, but I don't have immediate access to it. If you have a chance, could you post a quick synopsis of his algorithm?

 

In any case, glad you got something to work.


Edited by MrShorty, 15 September 2017 - 02:41 PM.


#7 breizh

breizh

    Gold Member

  • Admin
  • 6,292 posts

Posted 17 September 2017 - 03:03 AM

https://www.e-educat...520/m16_p6.html

 

You may find additional pointers in this document.

Breizh






Similar Topics