Computing mixture fraction in Cantera
I'd like to take a slightly more informal tone with this article...
So, for those of you that are both students, post-docs, and researchers in combustion physics, I'm sure that it would be silly for me to review the definition/concept of mixture fraction. Acordingly, I'll dispense with the details...
If you use Cantera for any of your combustion analysis needs, then you have, at some point, been looking around for a tool that will compute the mixture fraction. In my case, I could not actually find one online, so I built one myself! This utilizes the approach in Norbert Peters' Turbulent Combustion book.
This little module I wrote can be accessed through GitHub, using the following command:
$ git clone https://github.com/paulgarias/mixture_fraction.git
The source file is also include here.
Assuming that you installed Catera and can access the Cantera module in python, you should be able to simply import the class in the file in the following way
>>> import cantera as ct
>>> from mixture_fraction import mf
>>> gas = ct.Solution('gri30.xml', 'gri30_mix')
>>> gas.X = "O2:0.21, N2:0.79"
>>> Y_o = gas.Y # Need the mass fraction composition at oxidizer stream
>>> gas.X = "CH4:1.0"
>>> Y_f = gas.Y # Need the mass fraction composition at fuel stream
>>> h = mf(gas,Y_o,Y_f)