[Cantera structure] CVODE solver.

485 views
Skip to first unread message

Jan Zowczak

unread,
Oct 22, 2013, 2:04:36 PM10/22/13
to canter...@googlegroups.com
Dear all,
I'm still very new to Cantera. I used it quite a lot, but never have got deeper. I have a standard Cantera working on 64-bit Windows with Python 2.7 and NumPy library. My questions are maybe extremely simple, but -
1. where is actually located the CVODE solver used normally by Cantera? 
2. I'm aware of the Sundials package and its Windows version. I understand that if Sundials is installed, Cantera uses its solvers. Are they any better for normal use which doesn't involve sensitivity analysis? 

BR, Jan

--
505 455 949

Nick Curtis

unread,
Oct 22, 2013, 5:20:01 PM10/22/13
to canter...@googlegroups.com
1.)  Take a look at the ODE_Integrators.cpp file (http://code.google.com/p/cantera/source/browse/cantera/trunk/src/numerics/ODE_integrators.cpp?spec=svn2535&r=2352) in /src/numerics/
basically it has a conditional compile on whether sundials there, switching between CVodesIntegrator (sundials) and CVodesInt (cantera)

The default solver is CVodesInt.h and CVodesInt.cpp, both in the same folder

2)  It's probably better to use Sundials.  It's an actively developed package, so it's probably more robust/optimized than the Cantera solver simply because it's been developed for quite some time.  It also isn't terribly difficult to compile on windows, follow this: http://sundials.wikidot.com/installation-cmake and you should be fine

Jan Zowczak

unread,
Oct 22, 2013, 5:56:43 PM10/22/13
to canter...@googlegroups.com
Thank you, Nick. You made it clear.

I found before this address for Sundials, it won't be hard. Is there any reason why not to download an already compiled library from here? https://code.google.com/p/cantera/downloads/detail?name=sundials-2.4.0-amd64.zip&can=2&q=

And forgive me my ignorance, but where go all these files from the src folder when I install Cantera on Windows? In my Cantera folder in Program Files I have only 4 folders - bin, data, matlab and samples, which don't contain any of these files. Nothing in Cantera site package folder in Python neither. 


2013/10/22 Nick Curtis <arg...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Cantera User's 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/groups/opt_out.



--
505 455 949

Ray Speth

unread,
Oct 22, 2013, 5:57:43 PM10/22/13
to canter...@googlegroups.com
Jan,

If you're using the precompiled versions of Cantera, you are already using the Sundials solvers. You only need to download and compile Sundials yourself if you are compiling Cantera as well.

The solver used by Cantera when Sundials is not present is just an older version of CVODE. The source code for that solver is in the 'ext/cvode' directory of the Cantera source code tree. Besides sensitivity analysis, the most significant feature of the CVODE solver in Sundials (as far as Cantera is concerned) is that it has better error handling capabilities, which means that there are certain recoverable situations that can be handled internally rather than generating integration errors.

Regards,
Ray


On Tuesday, October 22, 2013 2:04:36 PM UTC-4, jan wrote:

Jan Zowczak

unread,
Oct 22, 2013, 6:12:48 PM10/22/13
to canter...@googlegroups.com

Jan Zowczak

unread,
Oct 22, 2013, 6:13:04 PM10/22/13
to canter...@googlegroups.com
Thanks Ray,
then I'm still a bit confused about two issues.
1 - after the installation of the compiled version, where are the solvers physically in the folders? 
2 - in the manual for windows installation there is still the suggestion that Sundials package might be useful. Do I understand well that it concerns only some additional features of Sundials (like CVODES), because the Sundials' CVODE solder is anyway built in?


2013/10/22 Ray Speth <yar...@gmail.com>

-- 

You received this message because you are subscribed to the Google Groups "Cantera User's 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/groups/opt_out.



-- 
505 455 949


2013/10/23 Jan Zowczak <jan...@gmail.com>




--
505 455 949

Ray Speth

unread,
Oct 22, 2013, 9:34:07 PM10/22/13
to canter...@googlegroups.com
Jan,

The compiled source code for the Sundials CVODES solver ends up in the "cantera_shared.dll" library that's installed with the Matlab or legacy Python module, or in the "_cantera.pyd" file that's installed with the new version of the Python module.

As it says in the directions, those extra files are only useful if you are compiling a program that uses Sundials directly. If you're using the Python or Matlab interfaces, those files are unnecessary.

Regards,
Ray

Jan Zowczak

unread,
Oct 23, 2013, 2:01:02 AM10/23/13
to canter...@googlegroups.com
Thanks Ray. That's what I wanted to know.


2013/10/23 Ray Speth <yar...@gmail.com>



--
505 455 949
Reply all
Reply to author
Forward
0 new messages