CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Help linking icoFoam and ODE solvers (http://www.cfd-online.com/Forums/openfoam/60718-help-linking-icofoam-ode-solvers.html)

skabilan October 18, 2007 06:13

Hi, What would be the best
 
Hi,

What would be the best way to link icoFoam and a ODE solver? Basically what i want is: the ODE solver solves a set of equations and supplies the pressure at the outlets to icoFoam. Which then computes on the mesh. This should repeat after every time step (transient simulation).

Thanks in advance for all your help!

Warm Regards,
Senthil

david_flo1 February 19, 2008 16:48

Hi, did you manage to do that?
 
Hi, did you manage to do that?

I am looking the same problem here. Got any suggestions?

Cheers

skabilan February 23, 2008 00:24

Hi, I was able to integrate
 
Hi,

I was able to integrate the ODE solver in OF with icoFoam. Take a look at the /OpenFOAM-1.4.1/applications/test/ODETest. You can use the same driver with your ODE set to solve the equations.

Senthil

david_flo1 February 25, 2008 12:15

Forgive my persistence but alt
 
Forgive my persistence but although after checking the ODE I kinda understand how it works, how to use available specific ODE solvers, yet it is not clear to me how to use its results for input on each time step on a FOAM fv solver.

I am a FOAM newbbie here, any more specific details, please, or an example if you don't mind.

Regards

skabilan February 25, 2008 13:02

Hi Bernardo, Take a look at
 
Hi Bernardo,

Take a look at the timeVaryingUniformFixedValue patch in the directory /OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/fields/fvPatchFields/derived/
This patch is used for transient simulation.The patch reads the pressure value from a file (user specified) after every time step. You can insert the ODE solver in the patch and can supply the outlet condition to OF after every time step.

Senthil

david_flo1 February 26, 2008 10:18

Ok, I'll try it then. Maybe bo
 
Ok, I'll try it then. Maybe bother you later along the way with some other question :D

thanks Senthil

Bernardo

markc January 6, 2009 05:33

Hello All, A new question,
 
Hello All,

A new question, basically a C++ question, with respect to implementing a ode solver. Starting from ODETest.C the following question:
the derivatives are given in the member function derivatives, which is inherited from ODE.H.
In ODETest the DE's are like:
dydx[0] = -y[1];
dydx[1] = y[0] - (1.0/x)*y[1];
dydx[2] = y[1] - (2.0/x)*y[2];
dydx[3] = y[2] - (3.0/x)*y[3];

But now I want to add some extra parameters which are constants in the DE's. E.g. the above may look like:
dydx[1] = y[0] - (constant_1 / x)*y[1];
(just an example).
However I am not able to bring in constants like this because the ODETest class is inherited from ODE.H and there those variables are not declared.
A possible workaround is to put the constants in the y vector and threat some components of the y vector as constants. However I do not think this is a nice way.

Any hints how to perform this task? I am currently studying C++ but any help about this question would be appreciated.

Thanks in advance,

Mark


All times are GMT -4. The time now is 10:38.