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/)
-   -   Limit amount of output (http://www.cfd-online.com/Forums/openfoam-solving/93771-limit-amount-output.html)

Taltan October 26, 2011 08:07

Limit amount of output
 
I am running a compressible LES simulation and I want to only save the p and U fields for each time step. Currently it saves all variables which quickly eats up my allocated storage.

Is this possible to do without changing the source code?

I tried the "printCoeffs" variable and seeing no effect at all.

blaise January 29, 2015 10:47

Hello Taltan,

did you solve that problem? I am looking for a solution to that myself.

Best regards,

Pascal.

alexeym January 29, 2015 11:00

Hi,

There is partialWrite functionObject (see $FOAM_SRC/postProcessing/functionObjects/IO/partialWrite for more details).

In controlDict you can set writeInterval to something quite large, while in partialWrite you choose necessary fields and set writeInterval to 1.

blaise January 29, 2015 11:18

Hello alexeym,

that was a quick answer with the right keyword!
So you mean something like that in the controlDict functions section:

partialWrite
{
type partialWrite;
functionObjectLibs ("libIOFunctionObjects.so");
outputControl outputTime;
objectNames (U p k);
outputInterval 1; // (timeStep, outputTime)

//writeInterval 10.5; //(adjustableTime, runTime, clockTime, cpuTime)
}

That will give me ONLY U, p, k fields as output in every timestep? What will the last line do? The output timing is already set in the upper part of the controlDict!

Cheers,

Pascal.

alexeym January 29, 2015 11:27

Hi,

Quote:

Originally Posted by blaise (Post 529541)
That will give me ONLY U, p, k fields as output in every timestep?

It is supposed to ;)

Quote:

What will the last line do? The output timing is already set in the upper part of the controlDict!
You set outputInterval (integer value) if your outputControl is either timeStep, or outputTime. Otherwise you set writeInterval (real value).

blaise January 29, 2015 12:03

Hello alexeym,

that does not seem to work, as I still get the full amount of fields written.
I use OF 2.3.x. Here is my controlDict:

libs
(
"libOpenFOAM.so"
"libincompressibleTurbulenceModel.so"
"libincompressibleRASModels.so"
"libLEMOS-2.3.x.so"
);
application pisoFoam;
startFrom startTime;
startTime 25.0;
stopAt endTime;
endTime 26;
deltaT 0.0001;
maxDeltaT 0.01;
adjustTimeStep off; // on;
maxCo 0.7;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 12;
writeCompression uncompressed;
timeFormat general;
timePrecision 12;
runTimeModifiable false;

functions
{
#include "readFields"
partialWrite
{
type partialWrite;
functionObjectLibs ("libIOFunctionObjects.so");
outputControl outputTime;
objectNames (U p k);
outputInterval 1; // (timeStep, outputTime)

writeInterval 1; //(adjustableTime, runTime, clockTime, cpuTime)
}
}

When I comment out writeInterval (as I understand it from your answer, because outputInterval is set to an integer), I get an error because of the missing writeInterval setting. And writeInterval has to be an integer, concluding from the error message if I set it to 1.5.
What am I misunderstanding here?

Thank you,

Pascal.

Edit:
Even when I set writeInterval in controlDict to 10000, I still get the full set of files written each timestep.
???

alexeym January 29, 2015 12:39

Hi,

My bad ;) It was just a guess. Was not able to make partialWrite work also. But writeRegisteredObject does the job quite nice:

Code:

    wro
    {
        type            writeRegisteredObject;

        // Where to load it from
        functionObjectLibs ("libIOFunctionObjects.so");

        // Execute upon options:
        //  timeStep
        //  outputTime
        //  adjustableTime
        //  runTime
        //  clockTime
        //  cpuTime
        outputControl  timeStep;

        // Objects (fields or lagrangian fields in any of the clouds)
        // to write every outputTime
        objectNames    (p);

        exclusiveWriting    false;

        // Interval of time (sec) to write down(
        writeInterval  1; //(adjustableTime, runTime, clockTime, cpuTime)
    }

This saves p every time step. And this time I've checked it ;)

blaise January 30, 2015 03:29

Hello alexeym,

that's it! Works perfectly!

Thank you VERY much!

Best regards,

Pascal.


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