CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Incompressible LES tutorial (oodles) - time averaged statistics (https://www.cfd-online.com/Forums/openfoam/66184-incompressible-les-tutorial-oodles-time-averaged-statistics.html)

bernarde July 8, 2009 09:45

Incompressible LES tutorial (oodles) - time averaged statistics
 
Good day

I have completed the Incompressible LES tutorial (oodles pitzDaily). Viewing the results in paraFoam gives me the field values at discrete time steps throughout the simulation.

However, I would like to view the average over say the last 100 steps, to view the statistics of the solution. Is there a way I can do this in paraFoam?

Also, how is convergence judged in this example? Normally I judge conversion in a LES by looking at velocity at a probe point and observing the instance when this velocity starts fluctuating around a constant value.

Any help on this greatly appreciated.

Regards

fs82 July 10, 2009 04:47

Hi,

put this in your controlDict for averaging:

functions
(
fieldAverage1
{
// Type of functionObject
type fieldAverage;

// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldAverage.so");

// Fields to be averaged - runTime modifiable
fields
(
U
{
mean on;
prime2Mean on;
base time;
}
p
{
mean on;
prime2Mean on;
base time;
}
);
}
);

If you want to probe points during calculation, there exists another funktion you can turn on in your controlDict:
probes1
{
// Type of functionObject
type probes;

// Where to load it from (if not already in solver)
functionObjectLibs ("libsampling.so");

// Locations to be probed. runTime modifiable!
probeLocations
(
(0.0 0.0 0.0)
);

// Fields to be probed. runTime modifiable!
fields
(
U
p
);
}

bernarde July 10, 2009 05:05

Thanks. I figured out how to do this. The problem I have was more to view the averaged values in paraView. I found that you required the UMean and PMean files in the /0 folder to enable paraFoam to load them into the postprocessor.

fs82 July 10, 2009 05:25

I do not using paraview. I prefer Tecplot, but if you turn on the fieldAverage1 function I mentioned above, you will get at every time step you write out during a run a Umean, Pmean UprimeToMean and PprimeToMean file. I am sure that paraview will load Umean and Pmean, because Tecplot does that to (to be more acurate: the foamToTecplot converter treat this fields). May be paraview will get problems with the symmetic tensor field UPrimeToMean, like the foamToTecplot converter, but I dont think so.

leonardo.morita July 10, 2009 06:40

Once your case is finished, I don't think it's possible to access averages if you didn't turn on fieldAverage function during runtime...neither it is possible to do an averaging like you said, over a specific period of time.

bernarde July 10, 2009 07:01

Yes, I understand that you need to turn on averaging if you require this for your postprocessing. However, it must be possible to start averaging only after a certain time, say once you have reached psudo-convergence.

leonardo.morita July 10, 2009 07:37

Sure, you can follow a variable with probes and once you judge it has "converged", you go to the controlDict and change "off" to "on". So that averaging will start at that time. Then you can check averaging time in the file <time>/uniform/fieldAveragingProperties.
One important thing to know is that if you change off/on once again, averaging will restart.

bernarde July 10, 2009 07:49

Thanks, this is what I was looking for, will give it a try. How do you monitor the probe variables - do you make use of paraFoam, or do you just view the values in the console? It would be ideal to plot them.

leonardo.morita July 10, 2009 07:54

Since a text file is created, I open it with excel, for example, and plot data.
Hint: try to follow more than one point, at "strategic" positions, in order to make sure (or almost) a "steady-state" has been reached.

bernarde July 10, 2009 08:03

Thanks man, I'll try the excel method. I agree, more than one point is better. Still, it's sometimes hard to be certain if a "steady state" has really been reached.

fs82 July 13, 2009 06:39

Allright, it seems to me your problem is solved. OpenFoam reread the controlDict every timestep, if you have set runTimeModifiable to yes. So you can start averaging by switching between on/off. I prefer to comment out the fieldAverage1-function.

Sud09463 August 26, 2016 14:57

time average velocity calculation LES openfoam
 
Hi fs82
i am using OF3.0. when I am putting fieldAverage in controlDict file, it is showing the following error:
--> FOAM FATAL ERROR:
Unknown function type fieldAverage

Valid functions are :

4
(
patchProbes
probes
sets
surfaces
)


How i can calculate average velocity using paraFoam in OF3.0?? I am new to openfoam, please help

fs82 August 29, 2016 02:40

Please check if there is a functionOpnject available in

$FOAM_SRC/postProcessing/functionObjects/field/fieldAverage

You will find some piece of code an an example controlDict how to use this fieldAverage functionObject. Furthermore, you can do a "grep -R fieldAverage" on the tutorials directory and find an tutorial case using the fieldAverage functionObject.

Sud09463 August 29, 2016 07:26

fieldAveraging OF3.0
 
Hello fs82,
thanku 4 quick response. fieldAverage is there in OF3.0 also. but i have one more doubt that, the Umean we are calculating using fieldaverage is time average velocity field or something else?


All times are GMT -4. The time now is 03:55.