CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Extract nodal values (https://www.cfd-online.com/Forums/openfoam-post-processing/205153-extract-nodal-values.html)

charles4allme August 10, 2018 10:22

Extract nodal values
 
Hello,

Just a quick question. Is it possible to get field values from the nodes of a cell in openfoam or does one just get values from the cell face or boundary patch?

Thanks.

amod_kumar August 19, 2018 09:02

Hi,
Not sure what you meant! I came across a piece of code which might do this job:

forAll( mesh.C(), i )
fout << mesh.C()[i][0] << " " << x[i] << "\n"

charles4allme August 20, 2018 05:48

Hi,

Can you give me a link to the code, I suspect that there are more information that I need.

Regards

Cenk20 June 10, 2020 09:19

Hi,
did you find a solution to get the field values from the nodes?


Regards,
Cenk

amod_kumar June 10, 2020 12:06

I was not able to do it in OpenFOAM. However, I am partially successful doing it in ParaView. This post might help - https://www.paraview.org/Wiki/Data_Selection

ships26 July 9, 2020 06:02

I think I had this problem a while ago. You mean getting the values from the control volume's center? You can write the cell center coordinates to files at a given timestep "t":
Code:

postProcess -func writeCellCentres -time t
Just substitute t by the timestep you want to write them to. Files C,Cx,Cy and Cz will be generated with the coordinates of the cell centers in that timestep's folder.

The cell coordinates are written in those files in the same order as the field files, so you just need to write a matlab or c script to search for the ones you want.


There might be an easier way to do this, but this method has worked out for me, so far.


Edit: if you mean the nodes of a cell's face, I don't think OF stores those, but you can probably interpolate them or use ParaView as amod_kumar suggested.


All times are GMT -4. The time now is 14:48.