1

I'm trying to use Cantera with a kinetic scheme for biomass pyrolysis to look at concentration changes over time in a batch reactor. An overview of the kinetics is shown below along with a reference to the paper. Notice that species concentrations are on a mass basis such as kg/m^3.

primary

secondary

  • wood = biomass which is typically pine
  • gas = lumped species which contains light non-condensable gases
  • tar = lumped species of condensable pyrolysis vapors
  • char = fully pyrolyzed wood, basically carbon

Reference: Colomba Di Blasi. Analysis of Convection and Secondary Reaction Effects Within Porous Solid Fuels Undergoing Pyrolysis. Combustion Science and Technology, vol. 90, pp. 315-340, 1993.

Assuming an initial wood concentation of 1.0, I can solve the system of reaction rate equations with Python and plot the conversion with time as shown below.

plot

Unfortunately, my attempt to use the kinetic scheme with Cantera is giving errors about incompatible phase types. My blasi.cti file contains the following:

#-------------------------------------------------------------------------------
#  Phases data
#-------------------------------------------------------------------------------


stoichiometric_solid(
    name = "wood",
    species = "wood",
    density = (700, "kg/m3")
)

ideal_gas(
    name = "gas",
    species = "gas"
)

ideal_gas(
    name = "tar",
    species = "tar"
)

stoichiometric_solid(
    name = "char",
    species = "char",
    density = (110, "kg/m3")
)

#-------------------------------------------------------------------------------
#  Species data
#-------------------------------------------------------------------------------

species(
    name="wood"
)

species(
    name = "gas"
)

species(
    name = "tar"
)

species(
    name = "char"
)

#-------------------------------------------------------------------------------
#  Reaction data
#-------------------------------------------------------------------------------

# Reaction 1
reaction("wood => gas", [1.4345e4, 0, 88.6])

# Reaction 2
reaction("wood => tar", [4.125e6, 0, 112.7])

# Reaction 3
reaction("wood => char", [7.3766e5, 0, 106.5])

# Reaction 4
reaction("tar => gas", [4.28e6, 0, 108])

# Reaction 5
reaction("tar => char", [1.0e6, 0, 108])

and the Python file blasi_reactor.py that uses the above cti file is:

import cantera as ct
import matplotlib.pyplot as plt

tk = 773.15     # temperature [K]
p = 101325.0    # pressure [Pa]

gas = ct.Solution('blasi.cti')
gas.TP = tk, p
r = ct.IdealGasConstPressureReactor(gas)

sim = ct.ReactorNet([r])
time = 0.0
states = ct.SolutionArray(gas, extra=['t'])

for n in range(50):
    time += 1.0
    sim.advance(time)
    states.append(r.thermo.state, t=time)

plt.figure()
plt.plot(states.t, states.X[:, gas.species_index('wood')])
plt.plot(states.t, states.X[:, gas.species_index('gas')])
plt.plot(states.t, states.X[:, gas.species_index('tar')])
plt.plot(states.t, states.X[:, gas.species_index('char')])
plt.xlabel('Time [s]')
plt.ylabel('Concentration [kg/m^3]')
plt.show()

The error message from Cantera is:

Traceback (most recent call last):
  File "blasi_cantera.py", line 9, in <module>
    r = ct.IdealGasConstPressureReactor(gas)
  File "interfaces/cython/cantera/reactor.pyx", line 191, in cantera._cantera.Reactor.__init__
  File "interfaces/cython/cantera/reactor.pyx", line 28, in cantera._cantera.ReactorBase.__init__
  File "interfaces/cython/cantera/reactor.pyx", line 199, in cantera._cantera.Reactor.insert
  File "interfaces/cython/cantera/reactor.pyx", line 50, in cantera._cantera.ReactorBase.insert
cantera._cantera.CanteraError:
***********************************************************************
CanteraError thrown by IdealGasReactor::setThermoMgr:
Incompatible phase type provided
***********************************************************************

How do I define lumped species such as wood, gas, tar, and char with Cantera? Is it even possible to use such a kinetic scheme in Cantera? I typically create my own pyrolysis models using Python but I would like to use the reactor features in Cantera. This would also allow me to compare results between Cantera and my personal Python models.

Note - I looked at the examples on the Cantera documentation website but everything is for well defined gas phase species where you know the elemental composition and NASA coefficients.

wigging
  • 8,492
  • 12
  • 75
  • 117
  • Hi! I think you asked a very similar question recently, but I don't see it now... in any case, I think the advice I gave over there to post this on the [Google Group](https://groups.google.com/forum/#!forum/cantera-users) is still true, you're more likely to get a more useful response over there. The short version is that, as far as I know, Cantera enforces element conservation for reactions, so you'll at least have to give your species elements. – darthbith Dec 06 '18 at 01:48
  • @darthbith Where do I define the species elements in the `cti` file? And by elements, are you referring to `C`, `H`, `O`, `N`, etc.? For the pyrolysis kinetics, I don't know what elements make up the species. The species are all lumped groups. – wigging Dec 06 '18 at 22:03
  • @darthbith I posted my question in the Google Group but it doesn't look like it was accepted. Do I need to get permission to submit a post or new topic? – wigging Dec 07 '18 at 19:33
  • You need to follow the instructions on the top of the Group page and include all the details in your post there, rather than linking to the post here. It's better if everything is included in your post on the Group so people don't have to go to separate places to be able to respond. Specifically, "please provide a minimal, complete, and verifiable example in your post that demonstrates the problem when making your post; in short this means including a code example and input files along with information about your operating system and Cantera version." – darthbith Dec 07 '18 at 22:56
  • The species elements are defined in the `species` object, see https://cantera.org/documentation/docs-2.4/sphinx/html/cti/classes.html#cantera.ctml_writer.species You can also define your own made up elements; which elements you use shouldn't really matter, as long as they're conserved – darthbith Dec 07 '18 at 22:58
  • Also, yes, a moderator will have to approve your message. It might take a few hours/a day for that to happen. – darthbith Dec 07 '18 at 22:59
  • 1
    @darthbith Alright, I posted this question on the Cantera Google Group. – wigging Dec 10 '18 at 03:04
  • Thanks for updating the post with more detail too! – darthbith Dec 10 '18 at 15:37

1 Answers1

0

It is possible to use your own, even made-up elements and species as long as the thermodynamics data (the one with the specific heat coefficients are present and correct), however, finding the right coefficients for such bulk materials (check these: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19940013151.pdf).

Also, for kinetic calculations and reactor chain it is easier to work with ct.IdealGasReactor, it is also supposed to support multi-phase.

Moreover, you need at least upstream reservoir between the reactors and syncState them at each iteration.

p.s. you can check this publication out, done by Cantera: https://www.researchgate.net/publication/320592565_Modelling_of_biomass_combustion_chemistry_to_investigate_gas_phase_alkali_sulfate_formation

Travis_Dudeson
  • 101
  • 2
  • 15
  • I'd encourage you to post this over on Google Groups as well. One small correction, `IdealGasReactor`s (by their nature) cannot handle multi-phase `Solution`s. – darthbith Dec 19 '18 at 18:05
  • Yes, the Google group is very helpful. Some of the developers are also actively answering some of the questions. – Travis_Dudeson Dec 19 '18 at 21:13