CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   extracting kinetic energy (

argse2 November 12, 2009 03:32

extracting kinetic energy
hi foamers,

I am new to openfoam. i created a mesh and modified pisoFoam to my case.
now I need to know the kinetic energy m/2 * v of each control volume.
Is there a post processing tool, a function in paraFoam which can do that task?
Otherwise I like to know how to read the solution domain mesh and iterator through all cells.

best regards and thx

kumar November 13, 2009 04:44

I think there is no direct utility to extract kinetic energy, but it is possible by simple coding and compiling.
It is also a good excercise for understanding the way to make a new application and compile it.

I looked in to this post and did exactly as it is specified in this post and my utility to extract KE was ready. So i want you to check this link

hope it helps.
K.Suresh kumar

argse2 November 13, 2009 10:18

Hi Kumar,

thx alot. coding seems to be quite easy. but according to linked post, shouldn't it be
0.5 * m * U & U or am i completely wrong?

best regards

muellea November 13, 2009 13:24

Well, it depend on what you wan't to know. If you wanna know the kinetic energy of your entire computational domain, then you are right (you have to take the total mass then).
But in most cases you are interested in a kinetic energy field, so it is convenient to represented:
  • either mass-specific: 0.5*U*U
  • or volume-specifc: 0.5*rho*U*U
The other representation with the mass is not used in continuums mechanics, since the mass of a particle (cell) is grid-dependent.

do you agree?

argse2 November 13, 2009 14:25

hi muellea,

i agree with you. thx.

maybe my previous post have been to vague.

i need to compare the solution of our inhouse fv solver with those of openfoam. our solver computes the volume of each control volume, multiplies it with the fluid's density and the mass specific kinetic energy as i (almost) wrote in my initial question.

so 0.5 * rho * mesh.V() & U & U should do the job if openfoam computes on the same grid than ours?

muellea November 13, 2009 17:23

Hi Argse2,

sorry i should have read your first post properly. I think it should work like that, except that i would take 0.5*rho*mesh.V()*U&U, since the & stands for the inner product and Mesh.V() and rho are as far as i know scalar-fields, whereas U is a vectorfield.

Hopefully you get it run. And let's see whether Openfoam beats your inhouse solver ;).

All times are GMT -4. The time now is 15:48.