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/)
-   -   Sum velocity fields over time (https://www.cfd-online.com/Forums/openfoam-post-processing/197033-sum-velocity-fields-over-time.html)

Svensen December 25, 2017 13:49

Sum velocity fields over time
 
I have a series of time steps, i.e. t = 0; 1; 2; 3; 4.
I want to create a new vector field like U_sum = U(0) + U(1) + U(2) + U(3) +U(4).

Is it any way to do it using postProcess utility or ParaView ?

HakikiCanakkaleli December 28, 2017 16:21

Hi,

I haven't tested below, yet may hopefully give some ideas:

1. In Paraview, Filters -> Alphabetical -> Calculator might be a help.

2.
Code:

postProcess -func add <fields>
might be used.

In addition, Python libraries could be very useful, which I prefer over any other post-processing tools.

KingKraut January 20, 2023 05:29

any progress
 
Hey,

did you find a solution for the problem?

The add-function Object only allows the summation of different fields at the same time.

I am currently looking for a tool or trying to implement it myself, which does time integration of a particular field during run time. I am quite amazed that I cannot find such a function object in the OpenFOAM-libraries. I am not sure, if I am just too blind to find ist...

Anyway. I thought by finding a tool, which does additions of the same field for different times, i guess such a tool could easily be modified into a time integration function object.

Of course a proper time integration function object from OpenFOAM would be something I would like much more!

Thanks for any hints or suggestions!!

PS: Still cant believe, such a function object does not exist yet...

Edit: I would like something, that I can use during the simulation run, which is why I am looking for afunction object!

Numericer January 23, 2023 14:18

You can modify the solver by creating a new field that reads the previous time value of velocity and writes the sum of that value and the new velocity to the present time folder. This will be done each during each time step, so that in the end you will have sum of all velocties at all times.


You can do the same without modifying the solver if you know how to work with bash.


All times are GMT -4. The time now is 17:11.