Fugacity coefficients of mixtures with phase not imposed

133 views
Skip to first unread message

Salvador Asensio

unread,
Apr 5, 2021, 8:01:23 AM4/5/21
to coolprop-users
Hi,

This may be a silly question, but I can't find an answer, sorry.
I am working with a mixture of R134a and R1234yf at different compositions and when I needed to calculate the fugacity coefficients of each component of the mixture I found out that when I do not impose the phase I get a result I do not understand, as it is neither the gas nor the liquid phase fugacity coefficient.

An example of this is below. With this code, the liquid phase fugacity coefficient is 0.873 and 0.909 for each compound, for the gas, the coefficients are 0.894 and 0.887, and the third case gives 0.798 and 0.787 as a result. What phase do these fugacity coefficients correspond to? Or what am I calculating instead of gas or liquid?

Thank you in advance.

Python code:

import CoolProp
AS = CoolProp.AbstractState('HEOS','R134a&R1234yf')
x = 0.517
T = 283.16               
P = .4498                
AS.set_mole_fractions([x,1-x])
AS.specify_phase(CoolProp.iphase_liquid)
AS.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS.fugacity_coefficient(0),AS.fugacity_coefficient(1))
print(' ')
print(' ')

AS2 = CoolProp.AbstractState('HEOS','R134a&R1234yf')           
AS2.set_mole_fractions([x,1-x])
AS2.specify_phase(CoolProp.iphase_gas)
AS2.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS2.fugacity_coefficient(0),AS2.fugacity_coefficient(1))
print(' ')
print(' ')

AS3 = CoolProp.AbstractState('HEOS','R134a&R1234yf')      
AS3.set_mole_fractions([x,1-x])
AS3.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS3.fugacity_coefficient(0),AS3.fugacity_coefficient(1))

Ian Bell

unread,
Apr 5, 2021, 9:12:42 AM4/5/21
to coolpro...@googlegroups.com
The question is what densities (and vapor qualities if two-phase) you are getting from these approaches.  If all are the same, then the fugacity coefficients should definitely all be the same.  

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/84eb0a7f-ea46-4bdf-bd9e-108b6ed3cfb9n%40googlegroups.com.

Salvador Asensio

unread,
Apr 5, 2021, 11:45:12 AM4/5/21
to coolprop-users

Hi again and thank you for the fast response.

Checking the vapor quality and density, I see that when I do not specify the phase, I get a two phase mixture.
Now, I have a new question. When I use AS.phase(), I get the outputs 0, 5 and 6 for the liquid, vapor, and two-phase mixture.
What do these numbers mean?

Thank you,

Python code:

import CoolProp
AS = CoolProp.AbstractState('HEOS','R134a&R1234yf')
x = 0.517
T = 283.16               
P = .4498                
AS.set_mole_fractions([x,1-x])
AS.specify_phase(CoolProp.iphase_liquid)
AS.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS.fugacity_coefficient(0),AS.fugacity_coefficient(1))
print(AS.rhomolar())
print(AS.get_mole_fractions())
print(AS.Q())
print(AS.phase())
print(' ')

AS2 = CoolProp.AbstractState('HEOS','R134a&R1234yf')           
AS2.set_mole_fractions([x,1-x])
AS2.specify_phase(CoolProp.iphase_gas)
AS2.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS2.fugacity_coefficient(0),AS2.fugacity_coefficient(1))
print(AS2.rhomolar())
print(AS2.get_mole_fractions())
print(AS2.Q())
print(AS2.phase())
print(' ')

AS3 = CoolProp.AbstractState('HEOS','R134a&R1234yf')      
AS3.set_mole_fractions([x,1-x])
AS3.update(CoolProp.PT_INPUTS,P*1e6,T)
print(AS3.fugacity_coefficient(0),AS3.fugacity_coefficient(1))
print(AS3.rhomolar())
print(AS3.get_mole_fractions())
print(AS3.mole_fractions_liquid())
print(AS3.mole_fractions_vapor())
print(AS3.Q())
print(AS3.phase())

Ian Bell

unread,
Apr 5, 2021, 11:06:34 PM4/5/21
to coolpro...@googlegroups.com
Docs for phase: http://www.coolprop.org/apidoc/CoolProp.AbstractState.html#CoolProp.AbstractState.phase


Numerical values can be obtained programmatically (you should never hard-code, always query).  In Python:

>>> import CoolProp as CP
>>> CP.iphase_liquid
0

Salvador Asensio

unread,
Apr 6, 2021, 2:51:10 AM4/6/21
to coolprop-users
Alright, thank you very much.
Reply all
Reply to author
Forward
0 new messages