mean value for every slice in a certain direction

Hi there,

I have a finished OpenFOAM Simulation of a pipe which extrudes on the y axis.
Since it’s a turbulent simulation plotting over line doesn’t make sense because of the occurrence of Kármán vortex street. So I want to calculate the average in x and z direction for every y and plot that as a line plot over y.

I have gotten so far:

  1. create a slice on a set position y
  2. use integrateVariables Filter to get a sum as well as the area
  3. use calculator to do sum/Area

So far so good but I want this (or anything which gives me the required output) to happen for every position in y. Placing hundreds of slices isn’t fun after all. Any suggestions?

This is a perfect use for Python scripting in ParaView. Set up your SliceIntegrate VariablesCalculator pipeline and adjust the slice’s position in a for loop to compute the quantity of interest. You’ll then have to save the computed values into a vtkTable object, then create a Trivial Producer source and set the data on that source. You should then be able to plot the data. Caveat: this won’t work if you are using ParaView in client/server mode.

Another way is to write a Programmable Filter that computes this quantity and performs the iteration described above all using VTK filters. The output type of this filter should be vtkTable which you can plot.

Hi there

And thank you very much for the help.

Unfortunately my knowledge on python is very basic at best and I never used that function in ParaView so far. Of course I am happy to learn.
Is there a similar structure of a for loop in paraView I can look into?