Cantera Matlab Fall-off reactions

315 views
Skip to first unread message

Julia Stellner

unread,
Jan 10, 2018, 5:40:07 AM1/10/18
to Cantera Users' Group
Hello,

I'm using Cantera with the Matlab interface and currently I have a problem.
I want to simulate the ignition delay times in a homogeneous reactor, how this works I already know.
The problem is that I'm using an extern reaction mechanism from Tang for DEE (CTI file attached below)
In this mechanism are many fall-off reactions, which somehow Cantera doesn't understand.
It always gives this error code:

>> DEE_test
Error using ctmethods

***********************************************************************
CanteraError thrown by ct2ctml_string:
Error converting input file
"\\ifkm-pc014.ifkm.kit.edu\julia\Cantera\Reaktionsmechanismen\DEE_improved_TANG\DEE_improved_174.cti" to CTML.
Python command was: 'python'
The exit code was: 1
-------------- start of converter log --------------
***** Error parsing input file *****


species '(+' not found while parsing reaction: 'ch2oh (+ M) =>
ch2o + h (+ M)'.

Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "C:\Program
  Files\Python36\lib\site-packages\cantera\ctml_writer.py", line
  2668, in convert
    write(outName)
  File "C:\Program
  Files\Python36\lib\site-packages\cantera\ctml_writer.py", line
  374, in write
    rx.build(r)
  File "C:\Program
  Files\Python36\lib\site-packages\cantera\ctml_writer.py", line
  1220, in build
    "reaction: '{1}'.".format(s, self._e))
cantera.ctml_writer.CTI_Error: species '(+' not found while
parsing reaction: 'ch2oh (+ M) => ch2o + h (+ M)'.
--------------- end of converter log ---------------
***********************************************************************


Error in XML_Node (line 20)
    x.id = ctmethods(10, 15, 0, src);

Error in Solution (line 47)
doc = XML_Node('doc', src);

Error in DEE_test (line 2)
gas =
Solution('\\ifkm-pc014.ifkm.kit.edu\julia\Cantera\Reaktionsmechanismen\DEE_improved_TANG\DEE_improved_174.cti');


So it seems that Cantera cannot find the +M in the fall-off reactions.
Do I need to download an extra package or attach something to my file to make it work?


Please find attached the Matlab sheet and the reaction mechanism in CTI format.

Thank you for your help!!
Julia
DEE_improved_174.cti
DEE_lambda2_CH4100_ignition_delay_times.m

Ray Speth

unread,
Jan 10, 2018, 2:24:58 PM1/10/18
to Cantera Users' Group

Julia,

In this input file, there are many reactions that are defined like this:

# Reaction 97
reaction('ch2oh (+ M) => ch2o + h (+ M)', [8.653000e+12, -0.038, 32410.0])

# troe fall-off reaction

However, a falloff reaction requires additional information — at a minimum, the rate expression in the low-pressure limit, and if the Troe function is to be used as indicated in the comment, the parameters for that as well. These parameters should be provided as arguments to the falloff_reaction declaration. In fact, immediately above this reaction is a correctly specified falloff reaction:

# Reaction 96
falloff_reaction('ch2o + h (+ M) => ch2oh (+ M)',
                 kf=[5.400000e+11, 0.454, 3600.0],
                 kf0=[1.270000e+32, -4.82, 6530.0],
                 efficiencies='h2:2.0 h2o:6.0 co:1.5 co2:2.0 ch4:2.0 c2h6:3.0',
                 falloff=Troe(A=0.7187, T3=103.0, T1=1291.0, T2=4160.0))

This problem seems to occur repeatedly in this input file. How was this CTI file generated?

Regards,
Ray

Julia Stellner

unread,
Jan 11, 2018, 1:42:13 AM1/11/18
to Cantera Users' Group
Hi Ray,

thanks for the reply.
I generated the CTI file was generated with the Cantera tool ck2cti. While using this occured no errors in the Command Window.
So you think even though Matlab didn't show any errors, the tool still messed up converting the Chemkin format files to the CTI file?

What should I do to get a correct working input file?

Thanks
Julia


Ray Speth

unread,
Jan 11, 2018, 10:34:52 AM1/11/18
to Cantera Users' Group
Julia,

Can you provide the Chemkin-format input files? It's impossible to know what's happening here without them.

Regards,
Ray

Julia Stellner

unread,
Jan 11, 2018, 2:16:16 PM1/11/18
to Cantera Users' Group
Ray,

of course, you can find the Chemkin-format input files attached


DEE_improved_174.txt
therm.txt
tran.txt

Ray Speth

unread,
Jan 11, 2018, 6:54:56 PM1/11/18
to Cantera Users' Group

Julia,

This mechanism contains many reactions which are defined as falloff reactions with explicit reverse rate constants provided, for instance:

ch2o+h(+m)<=>ch2oh(+m) 5.400e+11 0.454 3.600e+03
rev/ 8.653e+12 -0.038 3.241e+04 /
low / 1.2700e+32 -4.8200e+00 6.5300e+03 / 
troe / 7.1870e-01 1.0300e+02 1.2910e+03 4.1600e+03 / !troe fall-off reaction
h2/2/ h2o/6/ co/1.5/ co2/2/ ch4/2/ c2h6/3/

After taking a look at this, I’m surprised that this is considered valid input to Chemkin, since there’s no way that a simple Arrhenius reverse rate can do a decent job of matching the constraints on the reverse rate that are imposed by chemical equilibrium when the forward rate is determined by the more complex falloff rate parameterization. To see what’s happening, I created a simplified input file with just this one reaction (attached) and used the following Python script to plot the rate coefficients:

import cantera as ct
import matplotlib.pyplot as plt
import numpy as np
gas = ct.Solution('testmech.cti')
T = np.linspace(300, 1500, 100)
s = ct.SolutionArray(gas, len(T))
f, ax = plt.subplots(1,2)
s.TPX = T, 1e2, 'ch2o:0.1, ch2oh:0.05, h:0.001, n2:0.849'
ax[0].semilogy(1000/T, s.reverse_rate_constants[:,0], label='reversible')
ax[0].semilogy(1000/T, s.forward_rate_constants[:,1], label='explicit')
s.TPX = T, 1e7, 'ch2o:0.1, ch2oh:0.05, h:0.001, n2:0.849'
ax[1].semilogy(1000/T, s.reverse_rate_constants[:,0], label='reversible')
ax[1].semilogy(1000/T, s.forward_rate_constants[:,1], label='explicit')
ax[1].legend()
ax[0].set_title('P = 100 Pa')
ax[1].set_title('P = 1e7 Pa')
ax[0].set_xlabel('1000/T')
ax[1].set_xlabel('1000/T')
ax[0].set_ylabel('ch2oh->ch2o+h rate constant')
f.tight_layout()

What this shows is that in the high-pressure limit, the explicit reverse rate coefficient is reasonably close to what would be expected if the reaction were treated as reversible. However, in the low-pressure limit, the rate determined using the explicit reverse rate constant is pretty far off. I haven’t checked any of the other reactions, but would expect similar behavior. I do not think using these reverse rate coefficients makes sense for falloff reactions.

Regards,
Ray

testmech.cti

Julia Stellner

unread,
Jan 12, 2018, 1:38:42 AM1/12/18
to Cantera Users' Group
Ok thank you a lot for your reply.

So what's your suggestion to do next? Is there a way to make the input file usable? Or is it completely wrong? Could I for example delete all reverse rate coefficients?

Thanks!
Julia

Nick Curtis

unread,
Jan 12, 2018, 9:54:32 AM1/12/18
to Cantera Users' Group
Julia,
There are typically no fast and hard rules about how to fix a bad mechanism or thermo file.  If I had to guess, I would say this is the result of a bad (or simply careless) merging of reactions from other chemical mechanisms. I suggest you read this recent comment on mechanism selection, although it was in response to bad thermo data rather than bad reactions, much of it is very relevant.

Most likely (in my estimation) Chemkin would simply accept this mechanism without complaint, and simply discard the explicit reverse reaction rates as I don't believe they are allowed to be specified for falloff reactions (in the same way that you can't really give explicit reverse rates for P-Log or Chebyshev reactions).  This is one of many failings of Chemkin (negative A-coefficients in P-Log reactions, anyone?) in this regard, and it is entirely possible the authors of the mechanism didn't even realize that this had occured.

The first thing I would do is recreate the rest that Ray gave in Chemkin.  That would at least tell you whether the explicit reverse coefficients are ignored or not.
From there you can decide whether it is safe to simply delete the explicit coefficients, or whether you should track down a different mechanism for the fuel you are studying

Best,
Nick

Nick Curtis

unread,
Jan 12, 2018, 9:56:37 AM1/12/18
to Cantera Users' Group
Sorry, a typo in my response,. I

The first thing I would do is recreate the test that Ray gave in Chemkin

Nick 

Julia Stellner

unread,
Jan 14, 2018, 5:21:52 AM1/14/18
to Cantera Users' Group
Ok I understand.

Thank you a lot for your help!
Reply all
Reply to author
Forward
0 new messages