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. |
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" |
Hi,
Can you give me a link to the code, I suspect that there are more information that I need. Regards |
Hi,
did you find a solution to get the field values from the nodes? Regards, Cenk |
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
|
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 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. |