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/)
-   -   Simple question abt force output interval (https://www.cfd-online.com/Forums/openfoam-post-processing/230831-simple-question-abt-force-output-interval.html)

quarkz October 8, 2020 03:18

Simple question abt force output interval
 
Hi,

I'm trying to ask a rather simple question on force output interval.

How can I tell OF that I want the force output file to write every 10 steps or 0.001 interval?

I use the motorBike tutorial as an example:

forceCoeffs1
{
type forceCoeffs;

libs (forces);

writeControl timeStep;
timeInterval 10;

log yes;

So I modify timeInterval to 10. But when I check, it still outputs every timestep.

So is there any solution? Or did I do something wrong?

Thanks!

Krapf October 8, 2020 03:35

Try writeInterval instead of timeInterval (see tutorials/multiphase/interFoam/RAS/DTCHull).

quarkz October 9, 2020 00:33

Hi Krapf,

I just changed the writeInterval to 10:

writeControl timeStep;
writeInterval 10;

but I'm still getting force output at every timestep:

602 (-1.658054e+01 1.597868e+03 3.869050e+03) (-3.151841e+00 1.598027e+03 3.869377e+03) (-1.342870e+01 -1.591310e-01 -3.273975e-01)
603 (-1.650899e+01 1.597155e+03 3.868442e+03) (-3.089344e+00 1.597315e+03 3.868768e+03) (-1.341965e+01 -1.600401e-01 -3.266844e-01)
604 (-1.640912e+01 1.597292e+03 3.868515e+03) (-2.998325e+00 1.597453e+03 3.868841e+03) (-1.341080e+01 -1.609618e-01 -3.262860e-01)
605 (-1.639075e+01 1.597377e+03 3.869334e+03) (-2.987208e+00 1.597539e+03 3.869660e+03) (-1.340354e+01 -1.617590e-01 -3.259897e-01)

Why is this so?

Yann October 9, 2020 03:03

Hello quarkz,


What OpenFOAM version are you using?


Yann

quarkz October 9, 2020 10:40

Hi Yann,

I'm using v2006

Yann October 9, 2020 11:15

Thanks! Maybe give a try to these parameters:

Code:

executeControl  timeStep;
executeInterval 10;


Here is what I have found for OpenFOAM-v2006:

Code:

type            forces;
libs            ("libforces.so");

// How often force and moment volume fields will be written
writeControl    writeTime; // none

// How often the forces force.dat and moment.dat data files are updated
// Note: .dat files are always updated on writeControl times
executeControl  timeStep;
executeInterval 1;


Let us know if it solves your problem!


Yann

quarkz October 12, 2020 02:05

Thanks Yann, I ran Allclean and Allrun again with:

executeControl timeStep;
executeInterval 10;

but it still output every time step. So what's wrong? Does it work?

Yann October 12, 2020 06:17

Hi quarkz,

I use the forces function object quite often and I don't remember having this issue but unfortunately I do not have OpenFOAM-v2006 installed anywhere to test it.

I don't really know how to help. Maybe you can post your controlDict file, just in case someone can spot an error somewhere.

Yann

quarkz October 30, 2020 03:02

Hi all,

I finally found the solution.

The keywords are:

For time:

executeControl adjustableRunTime;
executeInterval 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;

For timesteps:

executeControl writeTime;
executeInterval 40;

writeControl timeStep;
writeInterval 40;

Btw, I'm using OF 2006.


All times are GMT -4. The time now is 05:21.