Computation of kinetic energy of the flow
I am really puzzled about how tocompute the overall kinetic energy of the flow, i mean I(1/2*U^2)dV, where I is an integral over the given volume.
I understand that I have to sum over all subvolumes but I do not even know how to start . Please help me
dimensionedScalar ketotal = sum(ke*mesh.V());
Thank you very much for your answer it was very useful.
Just a small comment,
It is better just to compute the Ek just by
dimensionedScalar ketotal = sum(0.5*(U&U)*mesh.V());
In this way you do not need to construct an additional volScalar field
which can save alot of memory
Thinking about the issue once agin, the last change does not reduce the
memory consumption since U&U opration still consumpts the same amount of memory as if volScalarfield is defined explicitly. I would recommend another way , which is longer but allows you to save the memory:
forAll (mesh.C().internalField(), patchI)
This is of course right for non-slip boundary conditions.
|All times are GMT -4. The time now is 17:18.|