CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Two ODE objects simultaneously (

JBUNSW November 28, 2012 22:46

Two ODE objects simultaneously
Dear all,

I have a rather non-conventional problem to solve. It is a PDE which people split it into stiff and nonstiff ODE's. The result of this "operator splitting" is two different sets of ODE's which can be solved separately.

The problem is that the number of equations are not the same. Let's say I have n1_ nonstiff ODE's and n2_ stiff ODE's.

My understanding of existing architecture of OpenFOAM 2.0.x is that, it allows the use of only one ODE solver at a time. The ODE object is constructed at runtime, and all the variables used in the integration are initialised at the constructor of the ODESolver class, viz.

Foam::ODESolver::ODESolver(const ODE& ode)

My understanding is that constructor can initialise the ODE object for either n1_ or n2_ not both. Currently I am solving the stiff part with SIBS and for the nonstiff part, I am using the LU solver that comes with OpenFOAM. I would like to solve my nonstiff ODE's with some jacobian-free ODE solver like RK.

I searched the forum in hope of finding something relevant. I cam up with the following threads, but apparently none of them address my problem.

A trial of implementing of CVODE as ODESolver
Problem implementing CVODE ODE solver (see post #15)
OpenFOAM 1.7 and CVODE

My questions:
1) Is there any way to create two ode objects that one of them uses one ODEsolver (SIBS per say) and the other one uses another (RK for example)?!
2) Or rephrasing my first question, is there any way to use the same ODE solver (SIBS for example) to solve two different sets of ODE's with n1_ and n2_ equations?!


All times are GMT -4. The time now is 21:40.