|
[Sponsors] |
February 27, 2014, 05:49 |
Why is Sundials CVODE ode-solver so slow?
|
#1 |
New Member
James Behzadi
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 27
Rep Power: 15 |
Dear all,
I implemented SUNDIALS CVODE 2.7 in OpenFOAM 2.0.x. I pretty much followed the instructions given here. I am using BDF with Newton linear solver. I tested my implementation with OpenFOAM's native "test-ode.C" solver and it works fine. However, when I use it to integrate the ODE system in a 58 species chemistry mechanism which is highly stiff, the cpu-time dramatically increases. It becomes even slower than OpenFOAM's native ODE-solver "RK" which is an explicit ODE solver. The problem, I guess, is the jacobian. The chemistry mechanism I am using is in the form of a Fortran subroutine that outputs the derivatives "only". I don't have any information on the jacobian. That's why I can not provide the jacobian function as input to CVODE, and consequently CVODE calculates the jacobian by its internal "difference-quotient" jacobian estimator. Any help is highly appreciated. Jalal |
|
February 27, 2014, 12:06 |
|
#2 |
New Member
Luis Cardona
Join Date: Mar 2011
Location: Medellin, Colombia
Posts: 6
Rep Power: 15 |
@JBUNSW
After several tests I reached similar conclusions about CVODE. So in my case I had to use SIBS. In order to speed up a bit my simulation, which also involved a chemical mechanism, I ended using a tabulation technique (ISAT) and got a faster simulation by a factor of 2 or more (28 species mechanism). Perhaps it wouldn't be possible to use in your case, because your mechanism comes from a FORTRAN routine... |
|
March 6, 2014, 20:52 |
|
#3 |
New Member
James Behzadi
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 27
Rep Power: 15 |
Thanks Luis for your feedback.
Anyone else has anything to share, please? Any tips are highly appreciated. |
|
April 30, 2014, 15:23 |
|
#4 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
I have also noticed it. For mechanisms that are important for my work,
(~100-200 species), CVODE slows to a crawl, or cannot solve the system at all. On the other hand for the large mechanisms, SIBS seems to run. |
|
September 10, 2020, 08:15 |
|
#5 | |
Senior Member
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11 |
Quote:
I am planning to follow your path to use CVODE with OpenFOAM. Before I put in the effort (and after your observation of performance of CVODE), I would like to consult you, if possible. I am trying to solve ODE with fraction orders such as dy/dx = -1*sqrt(y). I tried the ODE solver in OpenFOAM. The explicit solver RK family and Euler require an extreme small time step to integrate. And all the other ODE solvers complain about singular matrix. After some google, I realize the ODE that I try to solve is a type of fractional ODE and is difficult to solve (I may be wrong). Here is the definition of the ODE in the ODE-test that I use to solve dy/dx = -1*sqrt(y). Did I made some mistakes? Do you think I can benefit from CVODE? Code:
void derivatives ( const scalar x, const scalarField& y, scalarField& dydx ) const { dydx[0] = -1*Foam::pow(y[0],0.5); } void jacobian ( const scalar x, const scalarField& y, scalarField& dfdx, scalarSquareMatrix& dfdy ) const { dfdx[0] = 0.0; dfdy(0, 0) = -1*0.5*Foam::pow(y[0],0.5-1.0); } Rdf |
||
September 13, 2020, 15:56 |
|
#6 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
It has been some time since I have used CVODE, and there have been newer versions of the code. If you need help with CVODE, I would ask you to read the documentation of the code, and ask questions on their mailing list.
|
|
September 22, 2022, 05:45 |
|
#7 | |
Member
bany
Join Date: Nov 2019
Posts: 50
Rep Power: 8 |
Quote:
Dear JBUNSW, i like follow your work implementing CVODE into OpenFOAM. Sorry to recall this post. Are you solve the problem that slower calculation when used CVODE? Thanks a lot |
||
September 25, 2022, 16:12 |
|
#8 |
Senior Member
|
||
Tags |
cvode, dq jacobian |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is it possible to accelerate the ode solver of reactingFoam? | pajofego | OpenFOAM Running, Solving & CFD | 2 | August 10, 2014 06:38 |
Need ODE solver | Levi | Main CFD Forum | 3 | April 9, 2003 23:38 |
CFX 5.5 | Roued | CFX | 1 | October 2, 2001 17:49 |
Setting a B.C using UserFortran in 4.3 | tokai | CFX | 10 | July 17, 2001 17:25 |
Error during Solver | cfd guy | CFX | 4 | May 8, 2001 07:04 |