CVodes Error while using step()

718 views
Skip to first unread message

Abhishek Deshmukh

unread,
Jun 28, 2013, 7:06:16 PM6/28/13
to canter...@googlegroups.com
Hi,

I tried to run a sample case kinetics1 with different fuels, pressures and temperatures. I am getting following error even if I am using step() method to advance in time.

[CVODES ERROR]  CVode
  At t = 356.811 and h = 2.75736e-10, the error test failed repeatedly or with |h| = hmin.


***********************************************************************
CanteraError thrown by CVodesIntegrator:
 CVodes error encountered. Error code: -3
***********************************************************************

 terminating... 

Code is attached.

Thanks and regards,
Abhishek

kinetics1.cpp

Nick Curtis

unread,
Jul 1, 2013, 3:05:59 PM7/1/13
to canter...@googlegroups.com
Things that can cause this error:
1.  Setting a minimum step size on your reactornet.  IMO you should never do this when you're using the step() method
2.  Your tolerances are too small, from what I can see in your code THIS is the culprit

10^-18 on the atol is usually far to small for me, try ~10^-15 (honestly I leave the atol at whatever the default is, and decrease the rtol from 10^-9 to 10^-12)
Essentially this error means that CVODES can't pick a step size small enough (as in, limited by numerical precision of a double) to get error within your tolerances.

Another option (if you really want 10^-18 as the atol) is to put a try {} catch(CVodesErr e) around your step call
when you catch an error increase your atol (i.e. multiply by 10) and try to step again, repeat as many times as necessary (easiest with a goto, but ugly).

Ray Speth

unread,
Jul 1, 2013, 4:37:31 PM7/1/13
to canter...@googlegroups.com
Abhishek,

This is a persistent problem with the formulation of the reactor network governing equations that are implemented in Cantera. I have been working on a new formulation for the equations which has better numerical properties, which is currently available in the development version of Cantera (the 'trunk' branch in Subversion). This work isn't completely finished yet (it doesn't work correctly for non-ideal phases), but I tested it with the example you provided and it seems to work reasonably well.

Regards,
Ray


On Friday, June 28, 2013 7:06:16 PM UTC-4, Abhishek Deshmukh wrote:

Abhishek Deshmukh

unread,
Jul 1, 2013, 5:13:53 PM7/1/13
to canter...@googlegroups.com
Hi,

I am able to overcome the problem when I use matlab ode15s. 
But I want to use c++ version for my code. 

Regards,
Abhishek

Oku Nyong

unread,
Jun 9, 2015, 9:31:51 AM6/9/15
to canter...@googlegroups.com
Hello All,
Can anyone give me a clue on how to handle this error.I'm running into an understanable error while trying to perform autoignition delay calculations essentially, using a IdealGasReactor.I'm using cantera 2.2 on python 3.4.3 platform.These error is show below.
Thank you in advance.

Traceback (most recent call last):
  File "C:\Users\Oku\Dropbox\Can_Py_ Simulation\Piston Velocity and Cantera  Calculation\zero dimensional modelling with cantera\final_zero modelling_cantera.py", line 21, in <module>
    gas.TPX =  298.0, 1.030865*ct.one_atm, 'NC10H12:0.0801539, O2:0.208400128, N2:0.78358442'
  File "cantera\thermo.pyx", line 831, in cantera._cantera.ThermoPhase.TPX.__set__ (interfaces\cython\cantera\_cantera.cpp:20163)
  File "cantera\thermo.pyx", line 524, in cantera._cantera.ThermoPhase.X.__set__ (interfaces\cython\cantera\_cantera.cpp:15792)
RuntimeError:
***********************************************************************
CanteraError thrown by parseCompString:
unknown species 'NC10H12'
***********************************************************************

Bryan W. Weber

unread,
Jun 9, 2015, 10:19:23 AM6/9/15
to canter...@googlegroups.com
Dear Oku,

It means that Cantera can't find the species you're trying to use when setting the mole fraction. Check that you're using the right name for the species.

Bryan

Oku Nyong

unread,
Jun 9, 2015, 10:59:56 AM6/9/15
to canter...@googlegroups.com
Dear Bryan,
Thanks you i now have sorted out i really appreciate.
--
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 post to this group, send email to canter...@googlegroups.com.
Visit this group at http://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.

Ray Speth

unread,
Jun 9, 2015, 11:28:58 AM6/9/15
to canter...@googlegroups.com
Oku,

Please stop making your posts by replying to old, unrelated threads. In the future, if you have a new question, visit the Google Groups page at https://groups.google.com/forum/?fromgroups=#!forum/cantera-users and click on the bright red "New Topic" button.

Regards,
Ray


On Tuesday, June 9, 2015 at 9:31:51 AM UTC-4, Oku Nyong wrote:

Oku Nyong

unread,
Jun 9, 2015, 12:51:53 PM6/9/15
to canter...@googlegroups.com
Alright Ray  well noted.
Reply all
Reply to author
Forward
0 new messages