Can anyone help me: Additional mechanisms

947 views
Skip to first unread message

Totally_Counterflow

unread,
Aug 31, 2016, 8:08:38 AM8/31/16
to Cantera Users' Group

First post. Hi!


So basically I'm trying to make the Miller & Bowman 1989 AB Mechanism work in Cantera, a module for Python 3.4 I have running.


I have a .txt file of the mechanism (apparently) that I obtained from a university mechanisms list. (http://www.sciencedirect.com/science/article/pii/0360128589900178) and in order to use it with Cantera, I need it in a .cti format (I think?) and that what I specifically need help on - the conversion of a mechanism file.


I'm no skilled coder with Python, it's all new stuff to me. I can get the GRI3.0 that comes with the module to work with counterflow combuistion (my true goal) and with the help of someone else i've tried the Konnov 2009 mechanism (which required some editing before conversion, using the ck2cti code that comes with Cantera) but the Konnov mechanism keeps failing the time intergration (failed both adiabatic premixed AND counterflow combustion) and the code won't complete.


So, my question: Can anyone tell me how or suggest to me about how to go about converting a .txt mechanism file into a file format that will work for the Cantera module?


I have files attached, which are .txt mechanisms. The Miller & bowman is my first specific target.


I'm not asking for the conversion to be done for me, that's cheating - I'm merely wondering if it's an easy or difficult task, and how to go about it.


Regards and thanks for your time

T.Counterflow

mill-bow89AB.txt
TianGlarborgJuly2009.doc

Krzysiek Ufnal

unread,
Sep 15, 2016, 4:04:24 PM9/15/16
to Cantera Users' Group
I have the same problem, did you find a solution?
And did you find any database with konnov mechanisms?
Message has been deleted

Totally_Counterflow

unread,
Sep 16, 2016, 6:19:58 AM9/16/16
to Cantera Users' Group
Hi there Krzysiek!

I've haven't found a final solution.
By searching on Science Direct, some papers related to Konnov include a version of the Konnov Mechanism, but I don't quite know which version.
for example, this one has one attached - http://www.sciencedirect.com/science/article/pii/S0010218009001138 I think it's CHEMKIN files.

I can't find a database with any mechanisms i recognise from the literature, Like miller & bowman or Lindsedt or Tian etc.
there's these however:
http://veroniquedias.github.io/UCLMechanism/UCL_Mechanism.html
https://combustion.llnl.gov/mechanisms
http://ignis.usc.edu/Mechanisms/Model%20release.html

And a couple of others but it's all found through a google search and some picking away at things.

If this lets you get the Konnov mechanism working for ANYTHING could you let me know what you got it working for? I would like it to work for counterflow combustion in Cantera.

Regards
Totally_Counterflow

Ray Speth

unread,
Sep 17, 2016, 11:54:01 PM9/17/16
to Cantera Users' Group
Hi,

For the Miller & Bowman mechanism, the main problem is that what you have is incomplete: you also need a file containing the thermodynamic data for each species (i.e. the NASA polynomial coefficients) as well as a file with the transport parameters for each species. I don't know where you got the text file with the mechanism (it's not supplementary material from the linked article), but that data should have been in the same location.

For the second mechanism that you attached, this file only provides the output of the Chemkin preprocessor, not the input file that you would actually need to use this mechanism in Cantera, Chemkin, or probably any other piece of software. Besides the fact that this is also lacking the corresponding thermodynamic data and transport data, you would have to manually recreate the input file (although it does appear to contain everything you would need to rewrite the "reactions" section of the input).

If you get as far as a successfully converted mechanism, don't take integration failures in Cantera's 1D solver as an indication that something's wrong with the mechanism. There are some known issues in the solver that have been corrected in the current development version.

Regards,
Ray

Krzysiek Ufnal

unread,
Sep 20, 2016, 3:44:46 PM9/20/16
to Cantera Users' Group
Thanka a lot, if I figure it aout I'll share :)

Alan Kong

unread,
Sep 23, 2016, 1:32:13 AM9/23/16
to Cantera Users' Group
Hi Totally_Counterflow and Krzysiek,

I had also encounter problems when trying to create other mechanism files from scratch. Like what Ray had mentioned, u need 3 files in total
1) Mechanism files with all reactions.
2) Thermodynamic properties files which most reference from Burcat's. These are in the format of NASA 7 coefficient polynomial.
3) Transport properties files.

For me, I tried to convert the Jones-Lindstedt 4 reaction 6 species mechanism into CHEMKIN format first before converting using the ck2cti tool. The problem is most of the time, you need to derive the reverse rate constant yourself because most literature do not provide that information (only forward reaction rate is included). This is one of the requirement values for the calculation done in Cantera. 

For the thermodynamic properties, the nasa 7 coefficient polynomial must be included for all species that is in your mechanism files. This is also the same for the transport properties files. There are many database available online which you use according to your specification. For the thermodynamic properties, I had been using Burcat's.

All in all, I think you need to do some researching first before generating your mechanism files and probably read some chemical kinetic textbook like the one from Wartnaz which give you an expression to determine the reverse reaction rate.

Hope these helps.

Thomas D Plumpton

unread,
Dec 15, 2016, 5:55:25 AM12/15/16
to canter...@googlegroups.com
Mr Kong,

apologies for taking so long to get back to you. FAR too long
I'm still having trouble getting this moving. PhD transfer reports are to blame.

Anyway.

I'm really, REALLY having trouble just getting Cantera to use a different mechanism to the GRI-Mech 3.0 Mechanism that it 'comes with' for some-nitrogen-chemistry combustion. Would you be able to help me work through getting another mechanism to run? (or anyone, for that matter. I would just very much like to achieve this. It feels like it should be simple, but repeatedly seeing 'time intergration failed' makes me think something else is going on.)

Someone somewhere suggested that it was the Build of Cantera that I was using, and I can no-longer find that comment for some reason. So.

Instead of Konnov, I do have another mechanism I'd like to try. The files I do have for a mechanism from a 2014 paper are for the Mathieu and Petersen 2014 Shock-tube combustion mechanism.

I only have two files for them, and I believe they'll need converting using ck2cti. That part I can do, possibly, although I'll be missing a third file - I have a 'mech.imp' file and a 'therm.dat' file, so I'll need a 'transport' file? Where would you suggest to supply if from, should I simply use the one I have for a Konnov mechanism? I did ask if that was all the files in the beginning and the mechanism supplier said 'yes'. So as far as I know, I'll need to supply the third file?
I can't find the paper submission on Science direct however, so If you needed to see the files I'd have to send them to you directly.

I've also attached another mechanism which is not in a Chemkin format, and I am interested to use this one as well - I assume i'd have to write the .cti. file from scratch by copying across the .doc mechanism (the TianGlarborg attachment)?

I know it seems a little bit like ELI5 (Explain Like I'm 5) but I'm quite new to the nitty-gritty of this, and I would like to get better.

Thank you for your time (or anyone's time)

Regards
Tom (Totally_Counterflow)


--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-users+unsubscribe@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.



--

Mr Thomas Plumpton

Energy 2050

Department of Mechanical Engineering


 

Email: coa03tp

TianGlarborgJuly2009.doc

Ray Speth

unread,
Dec 16, 2016, 12:35:02 AM12/16/16
to Cantera Users' Group
Tom,

My previous reply is here. The update to what I said before is that what was then the development version of Cantera has now matured somewhat and there is a beta release (2.3.0b1) available that you should be able to try. See this thread for details on how to install it. If you use this version, I think it will resolve almost all cases that would lead to the 'time integration failed' error while solving 1D flames.

As far as mechanisms which do not include a transport file, this is unfortunately somewhat common. Authors who develop their mechanisms for the purpose of studying zero-dimensional kinetics (i.e. homogeneous reactors and the like) do not necessarily go to the effort of determining or publishing the transport model coefficients that would be needed in order to simulate 1D flames.

Regards,
Ray

Totally_Counterflow

unread,
Dec 16, 2016, 2:19:43 PM12/16/16
to Cantera Users' Group
Mr Speth,

Thank you. for the life of me I couldn't understand why I couldn't find me. Of course, I've left a bunch of info at the bottom of the message... I don't know if I can edit the message to get rid of it, so that's a wonderful little task I annoyingly need to do...

I will install the latest Cantera and try again. I really appreciate your help.

As to the missing transport properties, I guess i need to canibalise the properties from various sources as I've seen others do.

Many thanks again for your help

Regards
Thomas Plumpton

asau...@sheffield.ac.uk

unread,
Dec 22, 2016, 10:18:46 AM12/22/16
to Cantera Users' Group
Hi,

I had a time integration problem recently (like in the picture below). What I did to solve the problem, which is now solved, is modifying the value of tol_ss, tol_ts, and set_time_step. I hope it helps. 

Displaying time step failure.JPG
Message has been deleted

Totally_Counterflow

unread,
Feb 1, 2017, 12:26:27 PM2/1/17
to Cantera Users' Group
Ray (and others)

Many thanks! The 'time intergration' error disappeared with using Python 3.5.3 and Cantera 2.3.0, to be replaced with 'too many timesteps without solution'... see image and files.

I'll see if I can fiddle with the tolerances to make it work. The code above and attached is the non-premixed ethane/air counterflow flame example from the website with some changes, and the konnov... 2009? mechanism.
Thanks again for your time!

Tom
counterflow ethane and air with konnov.py
konnov.cti
how cantera failed at standard tolerances.png

Ray Speth

unread,
Feb 1, 2017, 11:12:33 PM2/1/17
to Cantera Users' Group
Tom,

This mechanism seems to have a couple of reactions where the reverse rate constants are suspiciously high at low temperatures (i.e. multiple orders of magnitude higher than any others). The worst offender is reaction 1026 (zero-indexed), C2N2 + M = 2 CN + M. If I disable this reaction, I am able to get a converged solution, although it takes a while. If I disable the four reactions with the highest reverse rate constants at 300 K, then the solver converges quite rapidly. You might want to look at where the rate constants for these reactions came from to see if they're actually accurate at low temperatures or not.

Regards,
Ray

Thomas D Plumpton

unread,
Feb 2, 2017, 8:24:23 AM2/2/17
to canter...@googlegroups.com
Ray,

Okay wow. It can work.

I'm going to demonstrate my immense lack of experience and understanding at this point - I haven't much of an idea how you did that, and would very much like to ask many questions about how you came to that conclusion. I could ask them here, but it might become long winded - What would be best to do?

The more experienced programmers around me here at my location cannot help much with this, as Python/Cantera is simply not something they've been exposed to, and my understanding of what is going on behind the scenes is fledgling at best, currently.

From what i can fathom, I am guessing that the Warnings as the code ran alerted you to high reverse rate constants, but they seemed to be for T=1500 according to the warnings, not lower temperatures...? So the four biggest offenders, you picked those out somehow, and I think I know how to check the appropriate literature for the mechanism to make sure it's been copied/converted correctly, I just have to backtrack the mechanism to it's paper and assess the paper's appendix or mechanism list to look up the reverse rate constants, and then... check the .cti file and compare. As long as I know which of the reactions it is of course, and I know that the worse is 1026 (zero-indexed) and I could search the .cti to find that one, thanks to you.

That's literally all I've got. If the mechanism was copied/converted 'correctly' from the original file, then it was meant to run with those numbers, and it would be easiest to say 'mechanism not suited to CFC flames'. At some point, by turning off certain reactions, it stops being that mechanism and states being 'modiefed by this person', right? That's just a question rather than a statement.

I was simply going to start fiddling with the tolerances of the time stepping and the steady-state calculations until it passed, using nothing but trial and error.
I would rather understand what your experience has taught you and apply that, As I have six mechanisms to get running for NH3/H2/Air or NH3/CH4/Air flames in counterflow diffusion setups.

Apologies and thanks for your time,

Regards
Tom

Steven DeCaluwe

unread,
Feb 2, 2017, 2:16:02 PM2/2/17
to <cantera-users@googlegroups.com>
Hi Tom,

I can’t answer your bigger picture question, at the moment, but one thing in particular to look for when things were copied are the units, and if they match with what is at the top of your cantera input file (or with the cantera defaults, if no units specification is present).  Even if the numbers/magnitudes were copied correctly a discrepancy in the intended units, particularly if there is mixing & matching between mechanisms, could lead to significant problems.

Cheers,
Steven

——————————————————————————————————
Steven DeCaluwe, PhD
Assistant Professor of Mechanical Engineering
Colorado School of Mines
Brown Building W410B
Golden, CO 80401

Twitter: @DrDeCaluwe

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.

Ray Speth

unread,
Feb 3, 2017, 12:17:21 AM2/3/17
to Cantera Users' Group

Tom,

The warnings that are printed are about a different issue, which is discontinuities in the thermo data between the NASA polynomials evaluated for each temperature range. These can also cause issues for the solver, but apparently not in this particular case.

My approach for identifying this as the problem was to start by seeing if this was an example of any of the known failure modes of the solver, which mostly involve flames that are very close to the edge of the domain. I ran your code interactively, and after the integration error used the method ‘restore_time_stepping_solution’ to check on how the solver was progressing. This looked pretty normal, so my next guess was something funny in the mechanism.

I’ve seen issues with unusually high reverse rate constants in other mechanisms, so this was basically the first thing I looked at. What I like to do is plot the forward and reverse rate constants for each reaction using Matplotlib:

gas.TP = 300, 101325
plt.semilogy(gas.forward_rate_constants, 'r.')
plt.semilogy(gas.reverse_rate_constants, 'b.')

An example of this plot is attached for 3 cases:

  • the Konnov mechanism at 300 K
  • the GRI 3.0 mechanism at 300 K
  • the Konnov mechanism at 1800 K

As you can see, at 300 K, the Konnov mechanism contains a fair number of reactions where the reverse rate constant is far higher than any of the forward rate constants, and much higher than any of the rate constants in the GRI mechanism. In contrast, at 1800 K, there are only a couple of reactions which have reverse reaction rates that are outliers, and even these are not nearly as high.

These high reverse rate constants are nonphysical — as you can see, there is a fairly clear ceiling on the reaction rate constant, around 1e12 m^3/kmol/s, which is defined by the rate of collisions between molecules. Anything much higher than this is suspect. I think the case where reactions like this appear is when the forward rate constant is determined for high temperatures, and is irrelevantly small for low temperatures. However, the equilibrium constant for the reaction, determined from the species thermodynamics, can be extremely large in some cases, and taking a very small forward rate constant times that equilibrium constant gives an impossibly large value for the reverse rate constant.

I unfortunately don’t know of a simple fix for reactions where the rate constants demonstrate this behavior.

Regards,
Ray

rate-constants-gri-300K.png
rate-constants-konnov-1800K.png
rate-constants-konnov-300K.png

Thomas D Plumpton

unread,
Jun 6, 2017, 11:27:32 AM6/6/17
to canter...@googlegroups.com
Ray,

Thank you for this response, apologies for taking so long to discuss it with you.

Since finding this issue I have been able to convert a few other mechanisms which have behaved, but I'm currently using one mechanism which demonstrates similar signs to the above. The code you use for the semilogy plots in your previous assessment of the Konnov mechanism - could I get a copy of it? I have the attached mechanism and example below, and the convergence problem is similar:

Inline images 1

I'd like to see if it's a rate/reverse constants issue. It might not be - I could just need to adjust the newton-time-stepping limits (although I'm not 100% sure how to do that, There's probably some code on the Cantera website for how to set it I guess, as it's not in the up-to-date examples.)

Many thanks again for your time,
Regards

Tom


--
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/r8LJXFyfXGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-users+unsubscribe@googlegroups.com.

To post to this group, send email to canter...@googlegroups.com.
Visit this group at https://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.
CounterflowUpdatedExample.py
TianMech2009.cti

Ray Speth

unread,
Jun 9, 2017, 12:56:55 AM6/9/17
to Cantera Users' Group
Hi Tom,

I ended up putting together an extended version of this example for the Cantera Workshop -- you can find the code at https://github.com/Cantera/ncm-2017-materials/blob/master/mech_debug/thermo_debugging.ipynb. I think the general message is that there are unfortunately a lot of mechanisms in the wild where the only validation was done for things like ignition delay and stirred reactor configurations, where the low-temperature behavior is not a concern, and therefore they do not work when you try to do 1D flame simulations with them.

Regards,
Ray

Thomas D Plumpton

unread,
Jun 9, 2017, 10:48:16 AM6/9/17
to canter...@googlegroups.com
Hi Ray

Wow that is useful.

That general message does in fact sound super correct - A lot of the mechanisms i'm interested in were utilised in PREMIX on Chemkin with premixed flames, or weren't even used for 1D simulations.

That said some of the more modern mechanisms, such as Duynslaegher 2012 and Mathieu 2014 have converted nicely and performed a fast-solution to a simple combination of gases with no Carbon.

My current stickler, and the reason I was re-asking about the rate constants, was the Tian 2009 mechanism, as it had proved (by you) to be possible to make the Konnov 2009 mechanism run by eliminating the high-value constant reactions (the 4 that were in excess of 10^12. I suspected it was the same problem (simplifying the fuels for simulation still resulted in the time integration failure, but it took WAY longer because it got some success.)

So I developed (with your comments/emails/suggestions and the help of others) the attached code for an inserted mechanism. From running it with the also-attached mechanism i know that there's probably some issues with the 1800K reactions numbers 564 and 604 in the same way that they caused the Konnov mechanism to gunk up:
1800K 564 C2H4 + NO2 <=> C2H3 + HNO2
1800K 604 CH2(S) + NH3 <=> CH2NH + 2 H 

I'm looking in the reaction mechanism, and Although I could refer to which mechanisms had high forward rates, I realised that I don't think I really know how reverse rates are worked out?
Anyway, I'm assuming that if I comment out 564 and 604, the mechanism will be able to resolve the 1D flame solution as it did with Konnov?

Regards
Tom

RateConstantsCode.py
TianMech2009.cti

Thomas D Plumpton

unread,
Jul 27, 2017, 7:04:59 AM7/27/17
to canter...@googlegroups.com
Ray,

I'm looking back at the Konnov mechanism, using your rate constants code, and I see what you mean about High Constants - I was going to focus on the four bad ones at 1800K. Apologies but the graphs don't go high enough! (+37 is a long way from where mine stops)

1800K 804 C3H3 + H <=> C3H2 + H2 2.43206684347e+15
1800K 807 C3H3 + OH <=> C3H2 + H2O 7.42898543935e+13
1800K 812 2 C3H3 <=> C6H5 + H 1.92387139958e+16
1800K 813 C2H2 + CH <=> C3H2 + H 1.8478989687e+13

And then start looking at the worst offenders at 300K, which would be the highest of these:
300K 7 HNCN + M <=> H + NCN + M 2.07444289308e+28
300K 12 HNCN + O2 <=> HO2 + NCN 1.43545580606e+18
300K 98 NH3 + M <=> H + NH2 + M 1.06566005874e+18
300K 109 N2H2 + M <=> H + NNH + M 2.96932286038e+15
300K 110 N2H2 + M <=> 2 NH + M 9.99680130626e+20
300K 117 N2H3 + M <=> NH + NH2 + M 4.16154801454e+18
300K 118 N2H3 + M <=> H + N2H2 + M 4.78392687002e+16
300K 126 N2H4 (+M) <=> 2 NH2 (+M) 5.69345174406e+13
300K 127 N2H4 + M <=> H + N2H3 + M 2.13384413618e+20
300K 296 CH3 + M <=> CH + H2 + M 1.21956123359e+23
300K 333 CH2 + M <=> C + H2 + M 3.03069317961e+16
300K 334 CH2 + M <=> CH + H + M 1.23136243123e+16
300K 412 C2H4 + M <=> C2H3 + H + M 2.19008391793e+18
300K 417 2 C2H4 <=> C2H3 + C2H5 8.0838936715e+16
300K 466 CH2CO (+M) <=> CH2 + CO (+M) 2.05384715306e+13
300K 482 HCCO + M <=> CH + CO + M 5.37087721115e+16
300K 578 C2H5OH <=> CH2OH + CH3 7.5568241739e+14
300K 721 C3H6 <=> H + SC3H5 2.45675664557e+16
300K 722 C3H6 <=> H + TC3H5 8.50165504198e+14
300K 723 C3H6 <=> C2H3 + CH3 1.11354412484e+14
300K 738 C3H6 + O2 <=> HO2 + SC3H5 5.80531321893e+23
300K 739 C3H6 + O2 <=> HO2 + TC3H5 4.5872201556e+19
300K 750 C2H5CHO <=> C2H5 + HCO 1.95240724512e+17
300K 777 C3H4 + M <=> C3H3 + H + M 6.25586449276e+12
300K 788 PC3H4 + M <=> C3H3 + H + M 2.38402639637e+14
300K 804 C3H3 + H <=> C3H2 + H2 6.71165799908e+29
300K 807 C3H3 + OH <=> C3H2 + H2O 7.61719246642e+20
300K 813 C2H2 + CH <=> C3H2 + H 7.21882354968e+23
300K 901 C4H2 (+M) <=> C4H + H (+M) 2.1230833091e+25
300K 940 PC3H4 <=> C2H + CH3 2.13700653963e+25
300K 1027 C2N2 + M <=> 2 CN + M 3.30306107011e+37


This mechanism needs some chopping for CFC! Thank you for your time. Why is it though that the 300K reactions with high reverse constants are more affecting? I will check their source.

Regards
Tom

300K_graph.pdf
1800K_graph.pdf
Reply all
Reply to author
Forward
0 new messages