Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
614 stars 348 forks source link

CVode error encountered upon slightly tweaking inputs in a reactor advance call #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Cantera with Python bindings.
2. Run the attached testcase under python (the file h2o2.cti is available in 
the Cantera source under data/inputs).
3. If the last mass fraction in the list (Ar mass fraction) is specified as 
0.7, I get the following output for the final mass fractions:
[7.38e-2, ..., 2.25e-1, ...7.007e-1]: appears reasonable

However, when I change the Ar mass fraction to 0.701 (instead of 0.7), I get:
[CVODES ERROR]  CVode
  At t = 0.00294744 and h = 1.39401e-022, the corrector convergence test failed repeatedly or with |
h| = hmin.

The gas mass fractions are all Nans.

What is the expected output? What do you see instead?
Expected output should be same as what we get when Ar mass fraction is 0.7. 
Instead there is a CVode failure.

What version of the product are you using? On what operating system?
Cantera with Python Bindings:32 bit (available on the website for downloading). 
Error happens on 64-bit also.

Please provide any additional information below.

Is this behavior the expected one: meaning slight changes can cause CVode 
errors especially when we set tolerances to low values? Are there any 
guidelines to be followed for setting the tolerances (in this case, if I remove 
the 'setTolerances' call, the 0.701 mass fractions case goes through fine and 
gives results similar to the 0.7 case. Also, could someone test if this is an 
issue with the Python versions only, or if the C++ code also shows the same 
behavior? 

Many thanks!

Original issue reported on code.google.com by vibha.sr...@gmail.com on 21 Sep 2011 at 7:59

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, this was on Windows 7 OS.

Original comment by vibha.sr...@gmail.com on 21 Sep 2011 at 8:24

GoogleCodeExporter commented 9 years ago
This should be fixed by the changes in r1329.

With this fix, the code runs and you can see the effect of those tolerances, 
which are pretty crude. With the given tolerances, the Ar mass fraction is 
visibly not conserved.  Dropping the absolute tolerance down to 1e-9 makes 
things a lot better.

Original comment by yarmond on 25 Mar 2012 at 11:37