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

[OpenFOAM] Plotting Cell-Center Data Over Line

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2023, 09:09
Default Plotting Cell-Center Data Over Line
  #1
New Member
 
Josh
Join Date: Nov 2022
Location: Scotland
Posts: 6
Rep Power: 3
joshc is on a distinguished road
Hi all,

I appreciate that this problem has been raised before (mainly here: Plot over line question) but I am having trouble implementing the suggested solutions.

I would like to use a tool akin to the "Plot Over Line" feature to save some CFD data from a 2D mesh. The problem is that the Plot Over Line feature is incapable of using solely the data produced by the CFD code and stored at the cell centres. Instead, it uses some interpolation which reduces the precision of the data I would like to analyse quite considerably.

Ideally, the solution would compute line segments within each of the cells in the mesh and then associate a cell-centered value with them and plot only the data at those cell-centres.

Is there a straight-forward way of doing this in Paraview? All suggestions are welcome.

Thanks in advance,
Josh
joshc is offline   Reply With Quote

Old   December 13, 2023, 12:20
Default
  #2
Senior Member
 
CFD_Lovers
Join Date: Mar 2015
Posts: 168
Rep Power: 11
sinatahmooresi is on a distinguished road
Hello Josh,


I am having the same problem. Did you find any solutions?


Sina
sinatahmooresi is offline   Reply With Quote

Old   December 13, 2023, 12:23
Default
  #3
New Member
 
Josh
Join Date: Nov 2022
Location: Scotland
Posts: 6
Rep Power: 3
joshc is on a distinguished road
Quote:
Originally Posted by sinatahmooresi View Post
Hello Josh,


I am having the same problem. Did you find any solutions?


Sina

Hi Sina,

Yes, there is a solution to this. It turns out that Paraview is not an optimal software for extracting the cell-centred data which is produced by an OpenFOAM solver. To obtain this data, you should use the sampleDict with the interpolation method set to "cell", and you can extract data along lines this way. Note that this is actually built-in functionality with the standard OpenFOAM installation, so I found in my cases that this was an easier way to deal with the data I wanted to use than going through Paraview.

Hope this helps.
Josh
joshc is offline   Reply With Quote

Old   December 13, 2023, 13:01
Default
  #4
Senior Member
 
CFD_Lovers
Join Date: Mar 2015
Posts: 168
Rep Power: 11
sinatahmooresi is on a distinguished road
Hello Josh,



Thank you for your prompt answer. Yes, the plot over line feature is the key answer. However, if you look at "sampleDict", you notice you can manage the number of points (nPoints) so that the solver interpolates data in whatever number of points along the desired line.
My question is, how can I make sure that the very first data is exactly at the very first cell above the wall, for instance? Imagine you would put the lowest point of your line on the edge of your domain. I would expect openFOAM to "extrapolate" data from the real very first cell centre (that has a values) to the desired point I asked for, which is in this example lower than the cell centre. It might be addressed with some options like "lineUniform", "libeCell", .. in sampleDict, which I am not sure yet.


Sina
sinatahmooresi is offline   Reply With Quote

Old   December 14, 2023, 06:51
Default
  #5
New Member
 
Josh
Join Date: Nov 2022
Location: Scotland
Posts: 6
Rep Power: 3
joshc is on a distinguished road
Quote:
Originally Posted by sinatahmooresi View Post
Hello Josh,



Thank you for your prompt answer. Yes, the plot over line feature is the key answer. However, if you look at "sampleDict", you notice you can manage the number of points (nPoints) so that the solver interpolates data in whatever number of points along the desired line.
My question is, how can I make sure that the very first data is exactly at the very first cell above the wall, for instance? Imagine you would put the lowest point of your line on the edge of your domain. I would expect openFOAM to "extrapolate" data from the real very first cell centre (that has a values) to the desired point I asked for, which is in this example lower than the cell centre. It might be addressed with some options like "lineUniform", "libeCell", .. in sampleDict, which I am not sure yet.


Sina
Hi Sina,

In order to do this, you should use the lineCell type. This option does not require that you specify the number of interpolated points; rather, you will specify the start and end points of your line and, if you have the interpolationScheme set to "cell", it will indiscriminately extract the cell centres.

Example:

sets
(
Example
{
type lineCell;
axis x;

start ( 0 0 0);
end ( 2 0 0 );

}
)

Otherwise, if you refer to a point which lies on a boundary which is not appearing, I think it's probably possible in most cases to determine "by hand" the value of the cell.

Hope this helps...
Josh
joshc is offline   Reply With Quote

Old   January 28, 2024, 10:04
Default
  #6
New Member
 
Nafiz Ahmed Khan
Join Date: Nov 2023
Location: Canada
Posts: 18
Rep Power: 2
Nafiz375 is on a distinguished road
Hello Josh,
I'm trying to extract cell-centered U and V component velocities (U_x and U_y) from the entire specified zone I marked in the attached picture. Is there any way to extract those values either in ParaView or SampleDict, as you mentioned earlier?

vel_mag.jpg

Regards,
Nafiz
Nafiz375 is offline   Reply With Quote

Reply

Tags
line


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
[Commercial meshers] Problem with Mesh conversion from FLUENT Meshing to OpenFOAM mn17jyf OpenFOAM Meshing & Mesh Conversion 3 November 1, 2023 09:49
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
CFD by anderson, chp 10.... supersonic flow over flat plate varunjain89 Main CFD Forum 18 May 11, 2018 07:31
[blockMesh] BlockMeshmergePatchPairs polyTopoChanger benru OpenFOAM Meshing & Mesh Conversion 3 June 29, 2008 21:24
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19


All times are GMT -4. The time now is 19:39.