CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Reduce "log" file dimensions (

francesco_capuano February 9, 2012 07:08

Reduce "log" file dimensions

I was wondering if there is a way to reduce the log file dimension, for instance by setting the output to be written every, let's say, 10 time steps rather than every time step.

The file can reach enormous dimensions!

Any ideas?

Thanks in advance,

BernhardGrieser February 9, 2012 11:47

Hi Francesco,

in case you really want to do that, you might try the following:

Open your solver source file (e.g. icoFoam.C) and wrap an if-clause around each piece of code containing "Info<<..."


// add before the time loop
double timeGap = 0.01; // that's the black-out time for the log file
double lastOutput = runTime.time().value();

// add within the time loop (wrap all the output)
if (runTime.time().value()-lastOutput>timeGap)

      Info<< ...

      lastOutput = runTime.time().value();

Don't forget to wrap #include CourantNo.H etc. as well.

Hope that helped.

francesco_capuano February 9, 2012 12:23

Hi Bernhard,

thanks for your reply, that's a nice idea. Unfortunately, some Info statements are included into the solvers' classes, and should be also included within an if-clause.

One remedy could be to turn to zero the corresponding values inside the DebugSwitches subdictionary within the main controlDict file, inside the /etc directory. But then any information about the residuals would be lost.

Or, is there any member function for controlling the output infos of the solvers?

All times are GMT -4. The time now is 06:56.