CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   Exporting results in x,y,z (

ConorMD June 14, 2020 13:13

Exporting results in x,y,z
Hello All,

Can anyone tell me how to export my pressure field into an x,y,z format instead of in a list according to the mesh?

Also, is it possible to convert/export my surface mesh into an x,y,z format?

Many thanks,

HPE June 14, 2020 17:07


- Pressure is a scalar quantity; therefore, there won't be three components of first-order tensor to output.
- Could you please elaborate what you meant by the surface mesh? OF does not produce a surface mesh, like STL, per se. But you can extract surface meshes from selected patches by using surfaceMeshExtract utility.
- If you want to extract such surface meshes, could you tell me what you meant by x,y,z data? I assume it is raw csv file - no header, no parentheses? I don't remember any off-the-shelf application for this, but in OpenFOAM context the option name is `raw`. May be surfaceMeshExport, or surfaceMeshConvert utilities may help.
- Also you can perform this action with ParaView: as asked here.

ConorMD June 14, 2020 17:41

Thanks for your reply, HPE.

Let me phrase the question better.

I would like to know how to get the x,y,z locations of all of those scalar quantities, or if it is possible.


HPE June 15, 2020 03:56

Sure: writeCellCentres function object.


postProcess -func writeCellCentres -latestTime
should write `C`, `Cx`, `Cy`, and `Cz` fields of cell centre locations.

The order of the content of these fields corresponds the order of the pressure field.

ConorMD June 15, 2020 05:22

Thank you HPE,

This is very helpful.

One last question:

Is it possible to run this utility on one patch only? I am trying to extract a pressure field from a foil surface.


All times are GMT -4. The time now is 07:02.