Re: Liq/vapor mix in reactor? How do I add a new fluid to Cantera?

320 views
Skip to first unread message

Ray Speth

unread,
Jan 7, 2013, 1:30:02 PM1/7/13
to canter...@googlegroups.com
Hi Justin,

I don't think Cantera's reactor model has been tested much with two-phase components, but fundamentally the model is general enough that this should work. I just fixed a small bug that caused issues for phases that have no associated reaction mechanism (r2032), but if you update to that revision you should be able to run the following small sample written for the new Cython module:

import cantera as ct

p1 = ct.Water()
p1.TP = 300, 101325
r1 = ct.ConstPressureReactor(p1)
r1.volume = 1e-3

env = ct.Solution('air.xml')
env.TP = 500, 101325
res = ct.Reservoir(env)

w = ct.Wall(r1, res)
w.heatTransferCoeff = 250
w.area = 1

net = ct.ReactorNet([r1])

while net.time < 100:
    net.step(100)
    print('t = %5f, T = %6f, x = %4f' % (net.time, r1.T, r1.thermo.X))

I expect that there are probably other bugs in the reactor network model that will crop up when trying to use pure fluids in them, as most of the existing use of the reactors has been with ideal gas mixtures.

As to the second part of your question, adding a new two-phase fluid to Cantera is a fair bit of work. You need a detailed equation of state for the  fluid, and then that has to be implemented in C++. The equations for most of the existing fluids in Cantera are from the book "Thermodynamic properties in SI" by W. C. Reynolds. If that book as an equation for nitrous oxide, then adding it to Cantera would probably be somewhat easier, as Cantera will already have implementations for equations in the same form. For an example, take a look at the source files in the src/tpx directory, e.g. CarbonDioxide.cpp.

Regards,
Ray

On Friday, January 4, 2013 6:57:48 PM UTC-5, Justin Black wrote:
Hi,
I'm using Cantera 2.0.1 in Python 2.7
I want to model nitrous oxide in two phase liq/vapor in a reactor.
Do reactors support multiple phases? It appears that they do in the documentation, but I haven't found a clear example.
How would I add a new fluid (nitrous oxide) to cantera?

It appears that liquidvapor.cti defines two-phase models, but then at the bottom it says the nasa definitions are only at one condition.
Could I add nitrous oxide there?
Where else would I need to define its properties?

Reply all
Reply to author
Forward
0 new messages