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