CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Automatic time step adjustment in channelOodles (http://www.cfd-online.com/Forums/openfoam-solving/60468-automatic-time-step-adjustment-channeloodles.html)

maka October 6, 2005 06:08

Hi, Is the automatic time s
 
Hi,

Is the automatic time step adjustment available in channelOodles or it is just in interFoam. I ran the following setup to see the feature but it did not work. I need this option in a solver that I write which is a variant of channelOoles. Here is system/controlDict. Thanks!

---------------------------
application channelOodles;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 1;

deltaT 0.2;

writeControl timeStep;

writeInterval 200;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

// automatic time step

adjustTimeStep yes;

maxCo 0.1;

maxDeltaT 1;


thanks.

hjasak October 6, 2005 06:40

Putting stuff into the diction
 
Putting stuff into the dictionary without having the code read it will not help you much :-)

No, chanelOodles does not have the time-step control built in, but you can easily do it yourself:

1) go to interFoam have a look how time-step control is done:

...
# include "readTimeControls.H"
# include "setInitialDeltaT.H"
...

while (runTime.run())
{
...
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"

runTime++;

Info<< "Time = " << runTime.timeName() << nl << endl;

2) make a copy of the solver you want to change and replace the time loop with the similar stuff
3) adjust include paths (looking at interFoam as an example), compile and fix any compilation problems you hit
4) done!

Enjoy,

Hrv

maka October 6, 2005 11:04

Thanks. It worked!
 
Thanks. It worked!

sega May 9, 2009 05:11

Can you post your code for channelOodles with additonal time step control.
I'm currently facing a similar problem.
I have to ensure an upper limit for the Courant-Number, but need to save computational time, so maximum timestep for the given maxCo is the goal!

sega May 13, 2009 10:47

Quote:

Originally Posted by sega (Post 215566)
Can you post your code for channelOodles with additonal time step control.

Well, just to complete my own question for all the followers to read this thread.
It's basically copy & past of the stuff Hrvoje wrote above.
Additionally you have to put the three lines
Code:

adjustTimeStep  yes;
maxCo          0.3;
maxDeltaT      1;

into your controlDict! Thats it and have fun!


All times are GMT -4. The time now is 08:37.