CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] How to get the coordinates of velocity data at all cells and at all times (https://www.cfd-online.com/Forums/paraview/189406-how-get-coordinates-velocity-data-all-cells-all-times.html)

vidyadhar June 19, 2017 09:33

How to get the coordinates of velocity data at all cells and at all times
 
Hello,

I have done a simulation, from its output, I have velocity (U.gz) at different times.

If I open the U.gz file at a certain time, it contains velocity data of all cells (nCells:5515515) in my domain.

I would like to know the coordinates of these velocity data at these cells.

In constant/polyMesh, I have points.gz which are the coordinates of points (nPoints:5673136) of my domain.
The number of points are greater than the no. of cells according to owner.gz ( "nPoints:5673136 nCells:5515515 nFaces:16702984 nInternalFaces:16390106"; )

I dont know how paraview reads the data.
Can anyone let me know how to get the coordinates of the velocity data at each cell as contained in U.gz and for each time.

Thanks in advance!!!

vidyadhar



vidyadhar June 20, 2017 05:40

How to get coordinates of cell data
 
Quote:

Originally Posted by wyldckat (Post 446469)
Hi Ehsan,


For reference, the official guide says this: http://www.paraview.org/Wiki/ParaVie...s.2C_arrays.29

I can't believe I'm going to have to explain this :( ... OK, in ParaView there are three basic geometrical types of representation:
  • Points
  • Lines
  • Surfaces
If this wasn't enough, there are at least two basic types of data content:
  • Data that is registered in points, aka "Point Data". Among these are the following usual usage scenarios:
    • The data is associated to the vertexes of cells and faces as real data.
    • The data is associated to the vertexes of cells and faces as interpolated data. One example of this type of data is to use the filter "Cell Data" to "Point Data".
  • Data that is registered in surfaces, aka "Cell Data". Among these are the following usual usage scenarios:
    • The data is associated to the centre of each cell or face as real data (this is how OpenFOAM usually stores the real data).
    • The data is associated to the centre of each cell or face as interpolated data or perhaps as an average of the data. Example of interpolation for this case is the filter "Cell Data" to "Point Data".
In addition, ParaView uses the following convention:
  • Data on surfaces are either the real values from the centres i.e. "Cell Data" or are showing the interpolated values from the "Point Data".
  • Data on points are usually only the data from themselves, assuming that they have the geometrical characteristic associated to it.
    • Note: Glyphs themselves (e.g. used as vector representation or for seeing where the points are) only work on "Point Data".
  • Data on Lines... are probably what ParaView thinks it's best to show, depending on "Cell Data" or "Point Data".


Is it clear enough now? :confused:


Best regards,
Bruno



Hello Bruno,

I need your help in getting the following:

I have a simulation data of various times. In each time, I have the velocity data as a file U.gz.

If I open this U.gz file in any saved time, I can see the velocity values (x y z components) for all the cells of my domain. (I hope this data corresponds to cell data only)

In my constant/polyMesh directory, I have points.gz containing the coordinates of all the points of my domain.

But, I would like to know the coordinates of the cell data (velocity data) as mentioned in the U.gz file, if possible. (I have saved the data from paraview: File>saveData: it gave me .csv files for all times. This data contains both velocity values and points. Does it represent cell data or point data?)

Else, I request you to let me know how to find the velocity data at all points of my domain for all times.

Thanks & Regards,
vidyadhar

wyldckat June 25, 2017 11:03

Quick answer:
  1. When opening an OpenFOAM case In ParaView, by default the U values that have positions are only for the "Point Data" fields.
  2. This means that you need to use the "Cell Centers" filter, and select the option to create the vertex data as well. This will create a new fields on the centres of the cells, which will be of type "Point Data", but should be in reference to the original fields in "Cell Data" format.
  3. Furthermore, if your mesh has polyhedral cells, then make sure that you use the polyhedral representation mode in ParaView, as explained here: https://openfoamwiki.net/index.php/F...is_in_ParaView
  4. Beyond this, in order to export directly in OpenFOAM without relying on ParaView, you will need to either use a function object for sampling or the sample utility to do so. I know there is at least one thread on this topic here at the forum... but I'm unable to find it at the moment.

Turin Turambar April 27, 2020 07:41

Quote:

Originally Posted by wyldckat (Post 654791)
Quick answer:
  1. When opening an OpenFOAM case In ParaView, by default the U values that have positions are only for the "Point Data" fields.
  2. This means that you need to use the "Cell Centers" filter, and select the option to create the vertex data as well. This will create a new fields on the centres of the cells, which will be of type "Point Data", but should be in reference to the original fields in "Cell Data" format.
  3. Furthermore, if your mesh has polyhedral cells, then make sure that you use the polyhedral representation mode in ParaView, as explained here: https://openfoamwiki.net/index.php/F...is_in_ParaView
  4. Beyond this, in order to export directly in OpenFOAM without relying on ParaView, you will need to either use a function object for sampling or the sample utility to do so. I know there is at least one thread on this topic here at the forum... but I'm unable to find it at the moment.


Hello Bruno, have you found out how to export all velocity field and its point coordinates without a need of using paraview? I searched the forum but I also couldn't find the thread you mentioned in step four.


Thank you.


Regards

Flowkersma April 28, 2020 16:05

Hi Turin,

OpenFOAM has a function object to write the cell Centers. Just execute
Code:

simpleFoam -postProcess -func writeCellCentres
and the utility will write the cell centers where the U values are also stored.

Best, Mikko

Turin Turambar April 29, 2020 07:17

Quote:

Originally Posted by Flowkersma (Post 767729)
Hi Turin,

OpenFOAM has a function object to write the cell Centers. Just execute
Code:

simpleFoam -postProcess -func writeCellCentres
and the utility will write the cell centers where the U values are also stored.

Best, Mikko




Thank you very much Mikko. I am using the old version (2.4.0), so here for anyone wants to know how to invoke this command in that case. Just simply type:



Code:



writeCellCentres


Thank you again


Best regards


Turin

ari003 May 10, 2020 08:19

Quote:

Originally Posted by vidyadhar (Post 654115)
Hello Bruno,

I need your help in getting the following:

I have a simulation data of various times. In each time, I have the velocity data as a file U.gz.

If I open this U.gz file in any saved time, I can see the velocity values (x y z components) for all the cells of my domain. (I hope this data corresponds to cell data only)

In my constant/polyMesh directory, I have points.gz containing the coordinates of all the points of my domain.

But, I would like to know the coordinates of the cell data (velocity data) as mentioned in the U.gz file, if possible. (I have saved the data from paraview: File>saveData: it gave me .csv files for all times. This data contains both velocity values and points. Does it represent cell data or point data?)

Else, I request you to let me know how to find the velocity data at all points of my domain for all times.

Thanks & Regards,
vidyadhar

Hi, it s Arijit I am also in search of a tool which will give me the velocity at all cells in a plane. Would you please share how you get that for each time step?
Thanks in advance.

vidyadhar May 10, 2020 21:45

Hi,
I was using caelus (caelus-cml.com) which was similar to openFoam. The velocities are saved automatically in each time step.

ari003 May 11, 2020 08:35

Thanks for the reply, if anyone of you know about OpenFoam then I was keen to ask one more thing that is as following:-
I want to create a plane in my OpenFoam simulation where I would like to get the velocities of each cell at each time interval. I used the cutting plane tool and made some addition to the control dict file and it gave me the values of velocity at each time interval but when I used the probe option over a line in ParaView it gave me value of 1000 cells along a horizontal line but when I checked the vtk file of cutting plane it only showed 24 results along a horizontal. How is that possible?

ari003 May 20, 2020 20:06

Quote:

Originally Posted by wyldckat (Post 654791)
Quick answer:
  1. When opening an OpenFOAM case In ParaView, by default the U values that have positions are only for the "Point Data" fields.
  2. This means that you need to use the "Cell Centers" filter, and select the option to create the vertex data as well. This will create a new fields on the centres of the cells, which will be of type "Point Data", but should be in reference to the original fields in "Cell Data" format.
  3. Furthermore, if your mesh has polyhedral cells, then make sure that you use the polyhedral representation mode in ParaView, as explained here: https://openfoamwiki.net/index.php/F...is_in_ParaView
  4. Beyond this, in order to export directly in OpenFOAM without relying on ParaView, you will need to either use a function object for sampling or the sample utility to do so. I know there is at least one thread on this topic here at the forum... but I'm unable to find it at the moment.

I was wondering how to execute your point 2. I mean I want to get the velocity corresponding to cell centers and not of points. So in this regard it will be really helpful if anyone willing to reply.


All times are GMT -4. The time now is 16:40.