|
[Sponsors] |
November 25, 2010, 09:02 |
Custom derivative method in ODE solver.
|
#1 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Hello,
When using the ODE solvers, I want to calculate the derivatives. This is reasonably complicated so I have a separate class for doing this. The problem is that the derivative method in the ODE base class is 'const'. So I can't do the following: Code:
void MyODE::derivatives ( const scalar x, const scalarField& y, scalarField& dydx ) const { myDerivativeCalculator.solve(); for (int i=0;i<nEqns();++i){ dydx[i] = myDerivativeCalculator.getSources(i); myDerivativeCalculator.setY(y[i]); } } I was wondering why the derivative method is const, and the best way to get around this.
__________________
Laurence R. McGlashan :: Website |
|
January 28, 2011, 00:12 |
|
#2 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
In a similar situation ,I wanted to calculate the numerical jacobian in one of my cases . Have you found a workaround for this ? Besides this is OpenFOAM a good platform to solve a system of differential algebraic equation system ? As of now , I am using SUNDIALS ......
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
two mixing compresible fluids solver | ziemowitzima | OpenFOAM Running, Solving & CFD | 27 | August 13, 2020 13:40 |
Need ODE solver | Levi | Main CFD Forum | 3 | April 9, 2003 23:38 |
The NAC Method solver | Maciej Matyka | Main CFD Forum | 2 | June 8, 2001 17:04 |
Mesh generator and CFD solver | Gennady Kireyko | Main CFD Forum | 0 | May 6, 2001 12:13 |
Laplace or Stokes equations solver by Boundary Elements Method | Lemonnier | Main CFD Forum | 3 | December 28, 1999 14:48 |