|
[Sponsors] |
April 22, 2012, 12:36 |
Solving ODEs
|
#1 | |
New Member
Mostafa Moghaddami
Join Date: Oct 2009
Posts: 13
Rep Power: 17 |
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; } Quote:
|
||
Tags |
autoptr, ode, odesolver |
|
|
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 |