vapor liquid equilibrium

493 views
Skip to first unread message

Joe

unread,
Jan 30, 2017, 12:14:02 AM1/30/17
to Cantera Users' Group
Hello,

I've been working to model multi-component vapor liquid equilibrium systems using Cantera with mixed success. Most of my problems appear related to difficulties for cantera's equilibrate() function to converge, which also appears to depend closely on the initial conditions. 

For example, I have had the best success with the following cti file:

ideal_gas(name = "vapor",
      elements = " O  H  C",
      species = """ nasa: C8H18,n-octane  C6H6 C7H8 """,
      options = ["skip_undeclared_elements"],
      initial_state = state(temperature = 300.0,
                            pressure = OneAtm)    )
                     
incompressible_solid(name = "liquid",
                     elements = "H O C",
                     species = """ nasa: C8H18(L),n-octa  C6H6(L) C7H8(L) """,
                     #species = """ nasa: C8H18(L),n-octa  C6H6(L) """,
                     density = (0.8765, 'g/cm3'),
                     initial_state = state(temperature = 300.0,
                                           pressure = OneAtm))


In python, I run this simple script:

import cantera as ct
liquid = ct.Solution('hydrocarbons.cti', 'liquid')
vapor = ct.Solution('hydrocarbons.cti', 'vapor')
liquid.Y = 'C7H8(L):1.0  C6H6(L):1.0'
vapor.Y = 'C7H8:1.0  C6H6:1.0'
mix = ct.Mixture([(vapor, 1.0), (liquid, 1.0)])

mix.T = 373.15
mix.P = 101325.0
mix.equilibrate('TP', solver='gibbs')


This example case will converge on a close to realistic solution. The chemical potentials of each of the species is equal in each phase. But if the pressure approaches or exceeds the single phase limits, the solver fails to converge. Furthermore, if the initial composition - say C7H8(L) is set to 10.0 mole instead of 1.0 - the solver won't converge. I've also tried other models with different materials (water and methanol), and have had no luck with equilibrate(). I have the following questions:

1. In the cti file, I used incompressible_solid() to define the multi-component liquid phase. I haven't seen a more appropriate name in the documentation (here: http://www.cantera.org/docs/sphinx/html/cti/phases.html), but this phase definition allowed multiple components in an incompressible phase. Poking around in the source and some papers I've looked at suggest some other phase definitions are supported in xml. Are my problems related to this phase definition? Is there a more appropriate way to define a multi-component liquid phase?

2. My limited understanding of equilibrate() is from the many examples that use this function to find chemical reaction equilibrium. I'm interested in equilibrium between phases where there are no chemical reactions. In this case, how does Cantera's solver know from the cti file definition that species defined in the vapor and liquid phases are in fact the same chemical scpecie? In other words, from my cti example file above, how does Cantera know that "C6H6" defined in the "vapor" phase is the same component as "C6H6(L)" defined in the "liquid" phase?

It seems that Cantera has many of the fundamental tools necessary to perform simple vapor-liquid equilibrium calculations. With such a tool, one could model multi-component distillation problems with relative ease. Any help is greatly appreciated.

My version:

joe@arthur:~$ conda list | grep cantera
cantera                   2.2.1               np111py35_4    bryanwweber


Thanks!
Joe

Ray Speth

unread,
Jan 30, 2017, 3:22:24 PM1/30/17
to Cantera Users' Group
Joe,

I don't think you can use Cantera's existing equilibrium solvers to solve a multi-species liquid/vapor equilibrium problem. As you have already identified, Cantera's solvers are designed to solve for chemical equilibrium, in which case all that is held constant are the elemental abundances and the thermodynamic properties used to define the state. There is no link between any of the gas and liquid phase species, since preserving the total quantity of any species is not a condition for the algorithm. I can imagine such a solver being a useful addition to Cantera, though.

I think your use of the "incompressible_solid" class for defining a liquid is fine -- this is just the name in the CTI format. The underlying C++ class is the one called "ConstDensityThermo", which makes no distinction between liquids and solids.

I'm not sure why the solver is having trouble with certain mixture compositions, although I will say that there are already a number of cases where Cantera's equilibrium solvers are known to have problems. I don't know whether this is a different problem or a manifestation of one of the already-documented issues.

Regards,
Ray

Joe Poshusta

unread,
Jan 30, 2017, 6:02:25 PM1/30/17
to canter...@googlegroups.com
Ray,

Thanks for your reply. I was afraid this was the answer. I have been thinking of ways to build a solver in python using phase and composition properties made available by Cantera, but it would be more elegant and efficient to add the capability to Cantera in C++. I guess I'll poke around the code to learn more. 

Thanks again,
Joe


--
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/KrMQG6W9MAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-users+unsubscribe@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages