CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   How to obtain RMS and averaged velocity in the SOLVER? (

ripperjack April 9, 2013 11:15

How to obtain RMS and averaged velocity in the SOLVER?
Hi all,

I want to output some variables which is not included as default variables in openfoam, eg. <u'T'>, so I need to add something into my solver.

For example, I want to calculate u'T'=(u-uMean)*(T-TMean), so I need to obtain uMean first.

My question is: uMean is the "locally averaged variables" (can be calculated at each time step, and is based on the simulated time), or is the mean values after the simulation is done (can not be calculate until the simulation is ended)? Which one is the openfoam's default method when calculating UMean, pMean, and pPrime2Mean etc?

Can you guys help me? Many thanks!

Bernhard April 10, 2013 06:24

Well, it is your definition of UMean. In general one would use the time average for this.

I don't know which method you are referring to. If you store all data of all timesteps, you can calculate the mean quantities as a post-processing step. The alternative is to calculate things during runtime (search for fieldaverage and functionobject), which saves you a lot of storage space.

Also the second other quantities can be calculated like this, as <(u-uMean)^2> = <u^2>-uMean^2, so you basically need the time average of u and u^2.

I am not sure if this fieldAverage function-object can handle crossterms between u and T, but one should manage to extend the function-object code a bit.

Someone may advertise swak4Foam, which contains easily customizable function-objects. It may be worth examining these options before starting cumbersome implementations.

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