CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problems with adjustable timestep control and maxCo Number (https://www.cfd-online.com/Forums/openfoam-solving/58326-problems-adjustable-timestep-control-maxco-number.html)

wolle1982 November 18, 2008 06:46

Hi all, I'm using OF 1.5 an
 
Hi all,

I'm using OF 1.5 an try to make a turbFoam simulation run with adjustable Timestep control.
But it doesn't work. the solver always keeps the preset deltaT. NO adjustment is done at all!!

As I read in this forum ( http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi ) to make it work I have to change my turboFoam.C.
But by recompiling it there appears an error:

-------------------------
.../setInitialDeltaT.H: In function 'int main(int, char**)':
.../setInitialDeltaT.H36: error 'CoNum was not declared in this scope
turbFoam wurde nicht aktualisiert
-------------------------

How can I correct the missing declaration?

Or should this work in OF1.5 already rigth? If so, what do I have to change or adjust and in what file?

Thanks a lot.

niklas November 18, 2008 07:21

in turbFoam.C After: # inc
 
in turbFoam.C
After:
# include "initContinuityErrs.H"
add this:
# include "readTimeControls.H"

and after:
# include "CourantNo.H"
add this:
# include "setDeltaT.H"

and run wmake.

in system/controlDict add these lines.

adjustTimeStep on;
maxCo 0.3;

wolle1982 November 18, 2008 08:55

Thank you. This solved it fina
 
Thank you. This solved it finally!!
As a conclution for all others: My turbFoam.C now looks like this:

.
.
.
int main(int argc, char *argv[])
{

# include "setRootCase.H"

# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "CourantNo.H"
# include "readTimeControls.H"
# include "setInitialDeltaT.H"


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

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

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"

// Pressure-velocity PISO corrector
.
.
.
.
My controlDict has the following lines attached
=======================
.
.
adjustTimeStep yes;

maxCo 5;

maxDeltaT 0.01;
.
.
.
=================================

after that I did "wclean" and "wmake" inside the ../incompressible/turbFoam/ directory.

Finally it works.

wendywu June 18, 2009 13:00

courant number bigger in icoFoam
 
Quote:

Originally Posted by niklas (Post 200227)
in turbFoam.C
After:
# include "initContinuityErrs.H"
add this:
# include "readTimeControls.H"

and after:
# include "CourantNo.H"
add this:
# include "setDeltaT.H"

and run wmake.

in system/controlDict add these lines.

adjustTimeStep on;
maxCo 0.3;

Hi,
I also met this problem, when I run icoFoam on a case with complex 3D shape. courant number becomes bigger and bigger. it seems non reasonable.
Do I need to correct it like what you said here?
Thank you.

Wendy.

megacrout July 27, 2011 05:40

Hi Niklas,

Thanks a lot, that was exactly what I needed.
I actually did it with pisoFoam, it works great.

Tibo

mar001 September 24, 2015 10:07

DelT, adjustableTIme,courantNumber
 
I have set my transient turbulent flow simulation to adjustable time steps. And also set the max. COurant number to 1. I am simulating flow over a smooth cylinder. While using my FFT MATLAB script to plot the dominant frequency as the Strouhal's frequency i realized I got two spikes. One at 2.575 and another peak at 2.795. Reynolds number of : 5.5*10^5. Is this is a physical phenomenon or that my time step delT has been so small to capture the dominant frequency twice. If yes what is the correction that I can do?


All times are GMT -4. The time now is 04:02.