San Diego mechanism + Cantera 2.3 = no steady-state solution - Any tips?

385 views
Skip to first unread message

Marc El

unread,
Jun 15, 2018, 8:28:02 AM6/15/18
to Cantera Users' Group
Hey guys,

I am relatively new to Cantera and I have a problem. I am trying to calculate laminar flame speeds of hydrogen/n-heptane mixtures using Cantera 2.3 and Python but unfortunately it does not work with the San Diego mechanism (http://web.eng.ucsd.edu/mae/groups/combustion/mechanism.html) - the solver finds no steady-state solution. It works for other mechanisms, for example the LLNL reduced n-heptane mechanism. I tried to figure out the problem but I was not able to. Unfortunately I am not able to tell you more as I do not know what causes the problem. It would be great if someone could help me.

Attached you'll find my code for one operating point that fails as well as the mechanism used.

Best regards
Marc
LLNL_nheptane_reduced_mechanism.cti
LFS_hydrogen_nheptane_usgr.txt

Alex K

unread,
Jun 15, 2018, 9:06:33 AM6/15/18
to Cantera Users' Group
Hi Marc,

Could you please provide the .cti file for the San Diego mechanism that is failing for you? You have provided the LLNL condition which you said was already working.

Best,

Alex
Message has been deleted

Marc El

unread,
Jun 18, 2018, 7:36:25 AM6/18/18
to Cantera Users' Group
Hi,

oh man, it seems that I was very confsued when I posted my question - there were also several typos in my code.
Attached you find the correct mechanism and code. Sorry for any inconvenience.
Best regards Marcel
LFS_hydrogen_nheptane.txt
San_Diego_Mech_complete.cti

Alex K

unread,
Jun 18, 2018, 11:17:35 PM6/18/18
to Cantera Users' Group
No Problem.

I had a quick look at this. I get the same error running your script (I'm running on cantera 2.3.0 installed under anaconda python 3.6.5 interface on Mac OSX 10.13.4).

I plugged your .cti file into the example templates. The constant pressure ignition and burner flame cases seem to work as expected for the same thermochemical conditions. However, the failure to converge is also observed for the free flame example. I did note that you override many of the default parameters in your script and there is some redundancy in the setting of initial conditions, but these were not the cause of the issue. For future reference I would start by trying to reproduce your issue in the example template cases, as this quickly rules-out lots of potential bugs.

Unfortunately I don't have much to recommend. My next guess would be to look at the version of the mechanism you are using. The SD mechanisms have a detailed version history on that repo - could be worth seeing if the behaviour is introduced at some point and then diffing the versions to isolate the problem. If you have access to other software that can solve the free flame problem, it couldn't hurt to see if that gives you a sensible solution.

Best,

Alex

Alex K

unread,
Jun 18, 2018, 11:30:10 PM6/18/18
to Cantera Users' Group
Just to clarify - there may very well be a way to solve this issue by playing with some of the settings exposed by the python cantera interface. All I did was check against some template cases and then a cursory look at some of the more obvious potential problems. I've used the C0-C3 SD chemistry with cantera in the free flame model in the past without issue over a very wide range of conditions and found it to be very robust.

Marc El

unread,
Jun 19, 2018, 6:51:42 AM6/19/18
to Cantera Users' Group
Thanks a lot, Alex! Your help is very much appreciated. 

Regarding your comments about my coding: I will try to clean it up a little bit and to use as much default parameters as possible. Other than that I will try an older version of the SD mechanism to see if it works. 

Best,
Marcel

Ray Speth

unread,
Jun 19, 2018, 11:47:27 AM6/19/18
to Cantera Users' Group
Marcel,

I think you'll find that this reaction mechanism has a number of suspiciously high reverse rate constants, which are a frequent source of problems with using Cantera's 1D solver. You can take a look at this example of how to identify the problematic reactions.

Regards,
Ray
Message has been deleted

Marc El

unread,
Jun 20, 2018, 7:28:15 AM6/20/18
to Cantera Users' Group
Hi Ray,

thanks for your input. I used your linked code and get the following output. Now I know that these reactions (list and black circle) might be causing the problem but what can I do now? Change the different factors in the cti-file or cross-out the reactions? I do think that might not be the right way.

Thanks in advance,
Marcel
CUG_reaction_rates.JPG

Marc El

unread,
Jun 20, 2018, 7:34:03 AM6/20/18
to Cantera Users' Group
P.S. The right diagram shows reaction 269.

Tom Condra

unread,
Jun 21, 2018, 3:28:29 AM6/21/18
to Cantera Users' Group
There are unfortunately many mechanisms out there which are not easy to work with!.
My personal advice is to simply use another mechanism.
For Heptane I suggest the following - you can find the files in the Supplementary Material:

"On the formation and early evolution of soot in turbulent nonpremixed flames", Fabrizio Bisetti et al
See: doi:10.1016/j.combustflame.2011.05.021

"An updated experimental and kinetic modeling study of n- heptane oxidation"
Kuiwen Zhang et al
See: doi:10.1016/j.combustflame.2016.06. 028
I recommed that you use the HT version - the "complete" version is VERY big - my laptop simply halts.
The Zhang data (only the bigger version) can also be found at the Galway site (http://c3.nuigalway.ie/mechanisms.html)

I do not have a hidden agenda for recommending these. My reason is because these
mechanisms files (Mechanism, Thermo and Transport) convert to a CTI file without ANY difficulties
and because the results (flame speed) match the data given. I cannot comment on their veracity for
Heptane/Hydrogen mixtures.

By the way, I totally agree with the remark by Alex about using the latest "template" files.
The solver for flame speed developed by Ray and Co is really good (thanks) - fast, effective and intelligent.
I am also an advocate for using the Prune command, especially where you are using H2.

Regards
Tom

Marc El

unread,
Jun 21, 2018, 4:43:09 AM6/21/18
to Cantera Users' Group
Hi Tom,

thanks a lot for your tips and of course also for the papers and mechanisms. I will try them out.

Thanks again to all of you.

Marcel

Marc El

unread,
Jul 16, 2018, 8:02:59 AM7/16/18
to Cantera Users' Group
Hi @ all,

I just want to thank all of you again. I managed it to get the mechanism working. Results are quite ok.

Best regards
Marcel

Shrabanti Roy

unread,
Nov 7, 2018, 1:50:23 PM11/7/18
to Cantera Users' Group
Hi Ray,
I am using cantera 2.3.0 on windows 10, 64 bit on Python interface.
I am trying to calculate laminar burning speed using free flame code of cantera. The simulation is failing for most of the the temperature cases. I am getting following error.

"f.solve(loglevel=loglevel, auto=True)
File "interfaces\cython\cantera\onedim.pyx", line 901, in cantera._cantera.Sim1D.solve (interfaces\cython\cantera\_cantera.cpp:87036)
cantera._cantera.CanteraError: Could not find a solution for the 1D problem"


The mechanism I am using is running fine with ignition delay time.

I found your suggestion of using this mech_debug code from the following link  "https://github.com/Cantera/ncm-2017-materials/tree/master/mech_debug"
I tried to use the code for my mechanism. I got a  list of reverse reactions, the rates of which are off from other reactions. However, I couldn't find how should I fixed the issues after using this code. I tried just by deleting the listed equations. 
I am trying to improve my mechanism. I am wondering how to fixed a mechanism after using the code. I attached my mechanism and codes that I am using.
ethanol.cti
flame speed.py
reaction_correction.py
Reply all
Reply to author
Forward
0 new messages