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

Solving ODEs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2012, 12:36
Post Solving ODEs
  #1
New Member
 
Mostafa Moghaddami
Join Date: Oct 2009
Posts: 13
Rep Power: 17
Mostafa is on a distinguished road
Dear All,

I am trying to write a new solver to solve a set of ODEs. I used the commands that are used in the ode.H and ode.C files to create an ODE solver and set of ODEs object.

I have attached the whole folder of the solver also the following is the main solver file:

Code:
#include "fvCFD.H"
#include "ODESolver.H"
#include "ODE.H"
#include "MostafaODEModel.H"




// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    
    MostafaODEModel ode(mesh);
     autoPtr<ODESolver> odeSolver_;
     odeSolver_(ODESolver::New("RK", ode));


    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<<"Create Fields"<<endl;
    #include "createFields.H"

    Info<< "\nStarting time loop\n" << endl;

    while (runTime.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl <<endl
                << "Time value="<<runTime.value()<<endl;

        c[0]=x;c[1]=y;c[2]=z;

        odesolver.solve(ode,0,10,c,0.01,0.1);

        runTime.write();

        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }

    Info<< "End\n" << endl;

    return 0;
}
I compiled the solver and I got the following Errors:

Quote:
ODESample.C: In function ‘int main(int, char**)’:
ODESample.C:50: error: no match for call to ‘(Foam::autoPtr<Foam::ODESolver>) (Foam::autoPtr<Foam::ODESolver>)’
/opt/openfoam201/src/OpenFOAM/lnInclude/autoPtrI.H:114: note: candidates are: T& Foam::autoPtr<T>::operator()() [with T = Foam::ODESolver]
/opt/openfoam201/src/OpenFOAM/lnInclude/autoPtrI.H:128: note: const T& Foam::autoPtr<T>::operator()() const [with T = Foam::ODESolver]
ODESample.C:67: error: ‘odesolver’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/ODESample.o] Error 1
Any help would be appreciated.
Mostafa is offline   Reply With Quote

Reply

Tags
autoptr, ode, odesolver


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
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 06:24
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 01:16.