CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   save the fields using a different frequency (https://www.cfd-online.com/Forums/openfoam/139290-save-fields-using-different-frequency.html)

openfoammaofnepo July 21, 2014 10:00

save the fields using a different frequency
 
Dear All,

I would like to make some quantities saved as a high frequency, e.g. 25 time step for each writing, while others 100 time step. This is because some quantities are more important in terms of unsteady variations.

I found that in openfoam, in the run-time post-processing
Code:

partialWrite:
allows registered objects, e.g. fields, to be written at different times (frequencies).

But I do not how set up in this calcualtions. Does anybody know how to perform that? do you have any other ideas about realizing this target?

Thank you very much.
OFFO

olivierG July 22, 2014 08:11

Hello,

You should define this in your ControlDict file, at the end, like this:
Code:

functions
{
the_name_you_want
{
type partialWrite;
functionObjectLibs ("libIOFunctionObjects.so");
objectNames (p U T); // the fields you want to write here
writeInterval 25;// freq of write
}
}

regards,
olivier

openfoammaofnepo July 22, 2014 08:34

Thank you.

I tried your suggestion in the tutorial in compressible/rhoPimpleFoam/les/pitzDaily

If write pressure as the in the following item:

Code:

objectNames (p);
The original in controlDict is 100, and the frequency for saving p is 50. Then I found that for all the time instants only contan p, all other variables are excluded. Did you have this problem? or I neglected something? Thanks.

olivierG July 22, 2014 09:45

hello,

Yes this is the behaviour of partialWrite. It delete all entries except those selected.
If you wan U and T each 100 iterate, you may try to add another function obsject, like:
functions
{
func1
{
type partialWrite;
objectNames (p)
writeInterval 25;
}
func2
{
type partialWrite;
objectNames (p U T);
writeInterval 100;
}
}

NB: not tested.

regards,
olivier


All times are GMT -4. The time now is 16:54.