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/)
-   -   Reduce "log" file dimensions (http://www.cfd-online.com/Forums/openfoam-solving/97121-reduce-log-file-dimensions.html)

francesco_capuano February 9, 2012 07:08

Reduce "log" file dimensions
 
Hi,

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,
Francesco

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<<..."

Code:

// 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.
Bernhard

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 12:50.