I'm going to demonstrate how to use an equation of state spreadsheet for mixtures to determine
vapor-liquid equilibrium. The idea is we're going to use the Peng-Robinson equation of
state and what we're going to do is calculate the fugacity coefficients for both the liquid
phase and the vapor phase, and in this particular case, we're going to use an example where
we know the liquid phase composition for pentane, normal hexane, normal heptane mixture. We
know the temperature. We want to determine the vapor phase compositions, yi being the
mole fractions in the vapor phase, and the pressure. We're going to use this PRFUG spreadsheet
from the Elliott and Lira textbook. So let's look at that spreadsheet. So here I'm looking
at the spreadsheet and I've done a couple of things. I've gone into 'Review' and you
notice it says 'protect sheet'. Well when you first open it, it actually is protected
and so I've unprotected it because I want to be able to change some of the cells. I
want to highlight the liquid phase, the liquid phase in this case is the more stable phase.
Notice it has a lower fugacity than the vapor phase, right? Vapor phase has larger volume
but the lower fugacity is the stable phase. Remember the objective here is to calculate
the fugacity coefficient for liquid phase, also for the vapor phase. Well I put in the
mole fractions that we already know for the liquid phase given the problem. I've input
the temperature. I guessed the pressure. We don't know the pressure, this is a guess of
a tenth of a MPa or one bar. And then I've copied the critical values. Now these, you could certainly
look them up or you could copy and paste from the Peng-Robinson equation of state spreadsheet
for a single component. And so once I have this information here, what I want to do is
create a duplicate but I want that duplicate to be for vapor phase composition. So if I
go here and say move or copy, and create a copy, put it at the end. So notice, it will
come up with a problem. It says we have this variable. So if I click 'No' then I need to
rename it and I'm just going to rename is triple A. And now same thing for B. I'm going
to name B likewise. And we'll continue doing this but I'll pause while I do the rest. Now
I'm going to rename this vapor fugacities and I'm going to highlight the vapor instead
of the liquid. First, I need to put in my guess values, and I'm going to change this
to yi to make it easier to remember. So I've made those changes, vapor fugacities, I've
highlighted the vapor phase, these are the fugacities I want to use. Now, I'm going to
be changing the pressure. What I'm going to do to be consistent, I'll change the pressure
here in the liquid phase and then I want the value in the vapor phase to be the same value
so I don't want to have to change it twice. So I'm going to set it so it's equal to this
value. That way when I make the change in one place it's already changed in the other
place. Now what I'm going to do is set up a table to list the fugacities for liquid
and vapor phase and our guess values and then go through iterations to find the correct
vapor composition and the correct pressure. So I'm going to pause and set this table up
and then talk about what it is. So I've set up this table and I'll go through and explain
in a little more detail, but the notation of course mole fraction in the liquid phase,
the fugacity coefficient in the liquid phase, the values we guess - which are over here
- for gas phase mole fractions, the fugacity coefficients of the vapor phase - which are
calculated here. Just like the fugacity coefficient of the liquid coefficient on the other page
of the spreadsheet. Ki is going to be ratio of fugacity coefficients, we'll talk more
about that. Yi is our new value for y based on the Ki and xi. Yi is equal to Ki times
xi. And then we normalize because these values are not going to add to one. So we'll go through
those in sequence. So now we have the table set up, what we're going to do is populate
it. First I want the mole fractions in the liquid phase which would be here. And so I'm
going to copy them from this page in the spreadsheet, that way this will be a more general program
if I change the liquid phase compositions, I can calculate the new vapor phase. So I'm
going to take the values from the other page in the spreadsheet for liquid phase fugacities.
I'm going to set this equal to the pentane liquid phase fugacity coefficient. I'll do
the same for the hexane and octane, and I'll pause while I do that. This way, these liquid
phase fugacities can change when I change the pressure for the liquid phase as we adjust
to find the correct pressure and gas phase mole fractions. So I'm going to put the guesses
made for the liquid phase here and do the same two for the other components. So with
those guesses, now I have vapor phase fugacity coefficients. So again, using the same procedure.
I'm going to set this equal to the n-pentane fugacity coefficients. Again, I'll pause and
enter the other values. So now, Ki remember is the ratio of the liquid phase value fugacity
coefficient divided by the vapor phase fugacity coefficient and I can do the same calculation
for the other two. So now I can calculate a new y value. This new y value is my K value
from the fugacity coefficient ratio times my xi. So this is just Ki multiplied by xi.
And likewise, I can do this for the other two. So a couple things. Of course these values
are quite different from our guess, but they also don't add to one. So what I'm going to
do is normalize by first taking a summation of these three values. And then I'm going
to set this equal to yi, in this case y for normal pentane, divided by the summation.
Now I can't copy these cells because we're using the same cell for the divider but I
take this divided by the summation and likewise for the third. So now I have normalized it.
These add to one. So I'm going to copy these values, and I want to paste them here, but
I want to do a paste where I paste numerical values not the equations. That could create
problems. And so notice I've copied them to only two significant figures so just to show
I'm copying the same thing. So we have yi values that are new. This of course is giving
us new values for the fugacity coefficients but because these added up to a number less
than one, it means we need to adjust the pressure but we have to do it, remember, in the liquid
phase. So we have to lower the pressure because the yi's were less than one. So I'm going
to put 0.06 as a guess. Change in liquid phase, that of course also changes the vapor phase.
That then changed the liquid phase fugacities. Changed the vapor phase fugacities. Now notice
that I have yi and I can give this more significant figures. It just happens to be exactly 0.200.
Notice now the yi is closer to one, the summation. What we can do, of course the normalization
and we've already done it here in this table, we're dividing our new yi by the summation.
And then we can put these new values which are actually pretty close. So I can again
copy these and paste them here, keeping in mind that I'm just pasting the numerical values.
And then I should adjust the pressure lower, again in the liquid phase. So let me try since
I've already solved this, I'll try this value. Now notice what's happened for these y values
and this pressure, the y's now, normalize this column, remember, they're summing to
0.99. That's close enough for our kinds of calculations we're doing. Of course this table
here just to make sure this is normalized, they're slightly different. And so at this
point we're going to stop because we've demonstrated the idea. Notice for the fugacity of vapor-phase
the values that we're using from this spreadsheet is lower than the fugacity of the liquid phase,
so this is the vapor phase is the stable phase whereas here the liquid phase has the lower
fugacity for the mixture, it's the stable phase. So what we've done is calculate now
the bubble pressure, the pressure we see the first bubble of vapor at this temperature.
And this is going to be the composition of that vapor. This is a general procedure of
using the equation of state to get vapor-liquid equilibrium, in this case, for a three component
mixture.