CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

ODE Solver of OpenFOAM-extend

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2016, 09:53
Post ODE Solver of OpenFOAM-extend
  #1
New Member
 
Sergey Lesnik
Join Date: Mar 2015
Posts: 14
Rep Power: 11
serles is on a distinguished road
Hello Foamers,

I'm stuck within implementing a set of ODE in OpenFOAM-extend 3.2. The greatest problem is that the extenden version has no Test-ODE.C, at least I couldn't find it. Thus, I implemented my ODEs in OF-2.3, which is working fine, and now try to transfer it to the extend version.

I'm trying to figure out what is the meaning of the "coeffs" function in ODE.H:

Code:
        
        //- Return access to coefficients
        virtual scalarField& coeffs() = 0;

        //- Return reference to coefficients
        virtual const scalarField& coeffs() const = 0;
These are abscent in OF-2.3, but here they are pure virtual and must be overloaded. I figured out the at some point in ODESolver.C the function provides y, but y is alredy defined in "derivatives()", which makes no sense to me.


Code:
    
scalarField& y = ode_.coeffs();

for (label nStep = 0; nStep < MAXSTP; nStep++)
    {
        ode_.derivatives(x, y, dydx_);

        for (label i=0; i<nEqns; i++)
        {
            yScale_[i] = mag(y[i]) + mag(dydx_[i]*h) + SMALL;
        }

        if ((x + h - xEnd)*(x + h - xStart) > 0.0)
        {
            h = xEnd - x;
        }

        scalar hNext, hDid;
        solve(x, y, dydx_, eps, yScale_, h, hDid, hNext);
What should I put in the definition of these "coeffs" functions?

Can anybody provide a simple test case for the current OpenFOAM-extend version (something like Test-ODE)?
serles is offline   Reply With Quote

Old   August 4, 2016, 10:06
Default
  #2
New Member
 
Giovanni Stabile
Join Date: Sep 2014
Location: Trieste (Italy) - Florence (Italy)
Posts: 14
Rep Power: 11
giovastabile is on a distinguished road
Hi I'm also havin the same issues.. did you maybe find a solution?

Regards,

Giovanni
giovastabile is offline   Reply With Quote

Old   August 5, 2016, 11:01
Default
  #3
New Member
 
Sergey Lesnik
Join Date: Mar 2015
Posts: 14
Rep Power: 11
serles is on a distinguished road
Hey Giovanno,
I couldn't really figure out how it was meant to be done but I brought it to tun.
Now I think "coeffs" function is about starting values for your ODE or at least initializing the variable "y". So a fast solution would be to put there something which intitializes your scalarfield y and returns it back. It needs only to compile, it will not affect your solution (IMHO)

In my case, I needed also to change some routines in ODESolver and thus I just copied the whole ODE directory to my solver directory, changed and compiled it. Here you need to make sure that you include only your version of ODE directory for compiler under Make/options: EXE_INC = -I./ODE and also you have to mention all the .C files in the file Make/files: ODE/ODESolver.C; ODE/RK.C ... (ans so on)

Hope this helps!
Greets,
Sergey
serles is offline   Reply With Quote

Old   August 8, 2016, 03:17
Default
  #4
New Member
 
Giovanni Stabile
Join Date: Sep 2014
Location: Trieste (Italy) - Florence (Italy)
Posts: 14
Rep Power: 11
giovastabile is on a distinguished road
Dear Sergey,

Thank you for the prompt answer, I had also the same idea and I compared the code with the codes from standard versions of OpenFOAM. It looks that it is not used inside the routines. I will try to do as you mentioned.

Regards,

Giovanni
giovastabile is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using ODE in OpenFoam skabilan OpenFOAM Programming & Development 22 April 6, 2022 06:05
Memory protection in OpenFOAM / combinig with FORTRAN botp OpenFOAM Programming & Development 2 February 15, 2016 12:25
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
Two ODE objects simultaneously JBUNSW OpenFOAM Programming & Development 0 November 28, 2012 21:46
Working directory via command line Luiz CFX 4 March 6, 2011 20:02


All times are GMT -4. The time now is 09:58.