Cantera really slow when using othermechanism beside GRI30 in flame simulation

357 views
Skip to first unread message

Simon Nemo

unread,
Mar 23, 2021, 9:11:52 AM3/23/21
to Cantera Users' Group

Hi All,

I am using the Cantera 2.5.1 with Matlab 2020 and simulate a flame just like in the tutorial flame1.m.

When i use gas=GRI30('Mix') as the mechanism for the gas, it will run for just like 10s. If i use e.g. Aramco 2.0 with gas=solution('aramco2.cti') the simulation needs 1.5h.

Iam new to cantera, maybe its just a newbe mistake I make? The composition of the gas is just O2, N2, Methane for the simplest case and H2 and maybe C2 in later cases.


Thanks,
Simon

Steven DeCaluwe

unread,
Mar 23, 2021, 10:51:42 AM3/23/21
to <cantera-users@googlegroups.com>
Hi Simon,

To a first approximation, the computation time will scale with the number of variables squared.  This is not my field, so I don’t know the particulars of the Aramco mech, but I imagine that it is quite a bit larger than GRI… A run time of 1.5h would suggest it has roughly 20x as many species? So about 1000? 

If this does not fully explain the discrepancy, I wonder if the transport mechanism might make a difference?  You are using GRI 3.0 with mixture-averaged diffusion coefficients—are you doing the same with the Aramco mech?  No idea if this would increase the time by much, but I suppose I’m just searching for any difference at all.

Best,
Steven


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/bc0ca8da-4f8d-4cfe-b87d-95ab13cbee81n%40googlegroups.com.

Ray Speth

unread,
Mar 23, 2021, 2:07:39 PM3/23/21
to Cantera Users' Group
Hi all,

The scaling is actually with the number of species cubed, due to the LU factorization of the Jacobian matrix, which has a bandwidth proportional to the number of variables at each grid point. AramcoMech 2.0 has 493 species, compared to 53 for GRI 3.0. Not counting the other variables at each grid point, that would suggest about a factor of 800 increase in the computational time. The result you're getting is maybe a little better than that, since not all of the time is spent in the LU factorization, at least for the smaller problem.

There are approaches that would avoid this unfortunate cubic scaling, some of which are discussed in this Enhancement proposal. As a near term alternative, you could also consider using Ember, which solves a time-dependent 1D flame using an explicit integrator for the chemistry term, which gives it near-linear scaling in the number of species.

Regards,
Ray

Simon Nemo

unread,
Mar 24, 2021, 9:11:04 AM3/24/21
to Cantera Users' Group
Thank you very much for your answers.

The scaling factor for the species makes absolutely sense in regards to the computation time.

Atm I am using the calculation with gri3.0 in parallel to a dynamic gas turbine simulation to determine its emissions. A much longer calculation time than the 10s with GRI is not really handy but aramco 2.0 seems more precise for burning Methane, Hydrogen, Oxygen and C2..

Unfortunatelly, I am currently using matlab for the cantera code which would mean I need to rewrite the code in python for Ember. :/ Maybe I am too lazy for that :D

Best regards,
Simon
Message has been deleted

Simon Nemo

unread,
Mar 24, 2021, 12:31:46 PM3/24/21
to Cantera Users' Group
With USCMECH II, the calculation time is around 90s which would be much better.

The reason for aramco instead of USCmech was, that the publications which I want to refer to uses aramco. Also, it seems that aramco predicts the combustion better than GRI and USC at high pressure? For ambient pressure USC seems better, but my calculations are at 10-20 bar.

Weiqi Ji schrieb am Mittwoch, 24. März 2021 um 14:22:07 UTC+1:
USCMech II might be a better choice for your needs.
Message has been deleted

Sandeep Jella

unread,
Mar 24, 2021, 12:55:19 PM3/24/21
to canter...@googlegroups.com
Simon,

Try getting reduced versions of ARAMCO from here


Glancing through the paper (Fig 6 & 7) the comparisons of reduced mechanism to the parent seems promising but it all depends on how 'hi-fi' you want to get.

I would agree with you that ARAMCO (especially the latest from NUI) is relevant to high pressure / gas turbine conditions. 

Best wishes,

Sandeep.



Sandeep Jella

unread,
Mar 24, 2021, 12:55:58 PM3/24/21
to canter...@googlegroups.com
PS - the mechanisms are in the supplementary material.
Message has been deleted

Simon Nemo

unread,
Mar 26, 2021, 4:12:36 AM3/26/21
to Cantera Users' Group
Thanks to both of you for your tipps. Unfortunatelly, I have no access at the moment to the Fuel article, but I will try to get it somehow. It seems as the best solution for my problem.

I will let you know what my results are.

Weiqi Ji schrieb am Mittwoch, 24. März 2021 um 17:58:41 UTC+1:
Cool. BTW, It will be great if you can upload the converted Canetra format into this Github repo https://github.com/jiweiqi/CollectionOfMechanisms/tree/master/C4_compounds/Aramco%202.0
Reply all
Reply to author
Forward
0 new messages