CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to have only some field print in time steps folders? (https://www.cfd-online.com/Forums/openfoam-post-processing/229488-how-have-only-some-field-print-time-steps-folders.html)

lucie.recurt August 11, 2020 06:10

How to have only some field print in time steps folders?
 
Hello foamies!!!



I'm working on a particles track case using OpenFOAM 20.06. My case is running but I would like to have only the positions file in my time's folders. I tried to do that by adding those line in the controlDict file:



functions
{ writeObjects1
{
type writeObjects;
libs ("libutilityFunctionObjects.so");


objects (
U
boundary
cellZones
data
epsilon
faceZones
faces
fvSchemes
fvSolution
k
kinematicCloud
kinematicCloud:UCoeff
kinematicCloud:UTrans
kinematicCloudOutputProperties

kinematicCloudProperties
mu
neighbour
nu
nut
owner
phi
pointConstraints
pointMesh
pointZones
points
rho
tetBasePtIs
transportProperties
turbulenceProperties
volPointInterpolate(U)
volPointInterpolation
);// i.e fields you don't want
writeOption noWrite;//anyWrite;autoWrite
}

writeObjects1
{
type writeObjects;
libs ("libutilityFunctionObjects.so");
objects (
kinematicCloudPositions );
writeOption autoWrite;
}
}


but it's not working, I got every field write in every time step folder...


Does someone know how to do that?



Thanks in advance!

simrego August 13, 2020 15:02

Hi!


I shouldn't do this. Instead try to increase the writeInterval in the controlDict, to make sure at least sometimes you write your fields (thus you can restart the run if needed). Then you could write the needed fields more frequently with this functionObject.

lucie.recurt August 19, 2020 04:35

Thanks you so much for your answer. I decided to write it like that:

functions
{writeObjects1
{
type writeObjects;
libs ("libutilityFunctionObjects.so");


objects (
kinematicCloud
);// i.e fields you don't want
writeOption autoWrite;//anyWrite;autoWrite
writeControl timeStep;
writeInterval 1;
}
writeObjects2
{
type writeObjects;
libs ("libutilityFunctionObjects.so");


objects (
kinematicCloud
);// i.e fields you don't want
writeOption noWrite;//anyWrite;autoWrite
}
it prints just the folder lagrangian

simrego August 19, 2020 05:02

1 Attachment(s)
So is it working now or not? I'm not sure.
I just modified the aachenbomb tutorial and it's working properly for me. It writes everything at every 5e-5 seconds, but it will write the sprayCloud object for every timestep. (it is OF v1912, but I guess it should be fine with the foundation version too)
You can change the writeControl and the objects entries as you wish.
And make sure that you have only one setting for a field. In your post you set autoWrite, then noWrite in the second functionObject. You should decide if you need the fields or not. :D


All times are GMT -4. The time now is 23:22.