CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Probes function gives different values than ParaView (https://www.cfd-online.com/Forums/paraview/148123-probes-function-gives-different-values-than-paraview.html)

Bazinga February 4, 2015 14:32

Probes function gives different values than ParaView
 
Hello,

I tried to check convergence for a simulation using pisoFoam using the probe function in the controlDict file when I realized that these values differ from the values that I obtain in ParaView.

I checked all three velocity components, the magnitude of the velocity vector, and the pressure in ParaView using the Plot Over Line filter to obtain the value at the probe location and all values differ a little bit: I created a line from -0.625/0/0 to -0.625/0/0.125 and checked the maximum value of the x component of the velocity (velocity increases over height) in the information box. I also checked the value at the graph at 0.125 height just to be sure that it is indeed that maximum value of the velocity. I also checked the y and z value of the velocity using the values of the graph.


First, I used the last time step of the simulation, after that i checked other time steps and there is always a difference to the according value at those time steps for the probe function.

I did the same procedure for other probe points (not displayed in the code below) always with the same result.

I thought that maybe there is an interpolation problem, but the mesh is rather small and I think I can exclude it as the source of the problem.

Here is my implementation of the probes:
Code:

functions
{
        probes
        {
        type probes;
        functionObjectLibs ("libsampling.so");
        enabled true;
        outoutControl timeStep;
        outputInterval 1;
        fields
        (
        U p
        );
        probeLocations
        (
        ( -0.625 0 0.125 )
        );
        }
}

I tried to look for this problem here and at other places and could not find a solution.
I found that nandiganavishal had the same problem but could not find the solution: http://www.cfd-online.com/Forums/ope...ation-run.html

I am fairly new to OpenFOAM so I might be doing a newbie mistake.

Hope my explanation is sufficient to understand and solve the problem. Let me know if I did not state all information necessary.

Thanks in advance

opedrofunk February 4, 2015 15:02

How to correctly probe values in paraview from OpenFoam data
 
All values in OpenFOAM are collocated at the cell center. So the values from the libsampling functionObject in OpenFOAM are interpolated directly from those values.

With paraview, however, this is not exactly the case. The values are first interpolated to the mesh "nodes", and then interpolated to the "probe" location.

As the "point" values in paraview are created by interpolation, you will often see differences in min/max values. You can try this for yourself by taking a cell value, of some property (pressure, for example), and applying the "cell Data To Point Data" filter. You'll see smooth contours if you plot the output from that filter, but you might notice that the values are slightly different. This is exactly what paraFoam/paraview is doing when it generates "point" values.

To get values from paraview that match openfoam, you'll need to do it a bit differently. Luckily, it's a pretty easy fix - a method that would work would be to:
1. extract the cell centers from your data in paraview using the "cell centers" filter;
2. Apply the "Delaunay3D" filter create an interpolation space;
3. Probe values from that result.

That should give you an exact correspondence between the two.

Hope that helps!
Peter

Bazinga February 5, 2015 01:48

Dear Peter,

thank you very much for your explanation. I will try your proposed procedure.

Bazinga February 5, 2015 06:53

I tried the procedure you mentioned, but I did not get the same results for the probe function results and the ParaView results. First, Paraview crashed when using the Delaunay3D filter for my testcase, so I made a smaller mesh in order to use it.

I used the default settings for the Cell Centers and Delaunay3D filters and checked those results using the Plot over Line filter.

Now, the values of the probe function are in between the original values of ParaView and the once that I got using the filters you suggested.

Just to give you an idea about the size of the error:
Probe: 4.54523 m/s, Paraview: 4.42494 m/s, Paraview with filter: 4.61284 m/s

shang November 29, 2017 13:59

Quote:

Originally Posted by opedrofunk (Post 530425)
All values in OpenFOAM are collocated at the cell center. So the values from the libsampling functionObject in OpenFOAM are interpolated directly from those values.

With paraview, however, this is not exactly the case. The values are first interpolated to the mesh "nodes", and then interpolated to the "probe" location.

As the "point" values in paraview are created by interpolation, you will often see differences in min/max values. You can try this for yourself by taking a cell value, of some property (pressure, for example), and applying the "cell Data To Point Data" filter. You'll see smooth contours if you plot the output from that filter, but you might notice that the values are slightly different. This is exactly what paraFoam/paraview is doing when it generates "point" values.

To get values from paraview that match openfoam, you'll need to do it a bit differently. Luckily, it's a pretty easy fix - a method that would work would be to:
1. extract the cell centers from your data in paraview using the "cell centers" filter;
2. Apply the "Delaunay3D" filter create an interpolation space;
3. Probe values from that result.

That should give you an exact correspondence between the two.

Hope that helps!
Peter

Hi Peter,

Thanks for your answer. But if my probe location locates at the shared edge or face between two cell, how the interpolation is done in OpenFOAM?

Regards,
Yeru


All times are GMT -4. The time now is 06:23.