CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Probes function gives different values than ParaView

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 6 Post By opedrofunk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2015, 14:32
Default Probes function gives different values than ParaView
  #1
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
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
Bazinga is offline   Reply With Quote

Old   February 4, 2015, 15:02
Default How to correctly probe values in paraview from OpenFoam data
  #2
Member
 
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11
opedrofunk is on a distinguished road
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
opedrofunk is offline   Reply With Quote

Old   February 5, 2015, 01:48
Default
  #3
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
Dear Peter,

thank you very much for your explanation. I will try your proposed procedure.
Bazinga is offline   Reply With Quote

Old   February 5, 2015, 06:53
Default
  #4
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
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
Bazinga is offline   Reply With Quote

Old   November 29, 2017, 13:59
Default
  #5
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 11
shang is on a distinguished road
Quote:
Originally Posted by opedrofunk View Post
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
shang is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 21:41
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


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