CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Custom derivative method in ODE solver.

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   November 25, 2010, 09:02
Default Custom derivative method in ODE solver.
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough

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:

        const scalar x,
        const scalarField& y,
        scalarField& dydx
    ) const

        for (int i=0;i<nEqns();++i){
            dydx[i] = myDerivativeCalculator.getSources(i);

...unless I declare myDerivativeCalculator as mutable in the header of MyODE.

I was wondering why the derivative method is const, and the best way to get around this.
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   January 28, 2011, 00:12
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 122
Rep Power: 8
balkrishna is on a distinguished road
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 ......
balkrishna is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
two mixing compresible fluids solver ziemowitzima OpenFOAM Running, Solving & CFD 21 April 23, 2015 06:14
Need ODE solver Levi Main CFD Forum 3 April 9, 2003 22:38
The NAC Method solver Maciej Matyka Main CFD Forum 2 June 8, 2001 16:04
Mesh generator and CFD solver Gennady Kireyko Main CFD Forum 0 May 6, 2001 11:13
Laplace or Stokes equations solver by Boundary Elements Method Lemonnier Main CFD Forum 3 December 28, 1999 14:48

All times are GMT -4. The time now is 03:20.