I have a surface with field values (.vtk), which is an output of an openfoam postprocessing (I have made it using a cutting plane on my geometry). I need to calculate the average field value on the surface and I don’t know how to do it.

I was trying to do it using the programmable filter in paraview, but I couldn’t. I have found some examples on how to use the tool here https://www.paraview.org/Wiki/Python_Programmable_Filter, but I still don’t know how to get the cell areas, and how to average the integral. Can somebody provide me a useful script to compute an average field? Thanks!