|
[Sponsors] |
July 13, 2016, 11:42 |
Utility to export field data
|
#1 | |
New Member
Thomas Kelly
Join Date: Jul 2016
Posts: 1
Rep Power: 0 |
Good morning,
I have looked through the file structure used by openfoam and see that the field data I want (i.e the U vectors) are listed based on cell number: Quote:
I am hoping that there is a utility or script out there which would streamline this process so I can quickly export the physical coordinates of each cell to be used in combination with the vector data. Ultimately I'll likely be using this data to make a gridded product to be used in my own model, but I can handle that aspect. |
||
November 23, 2024, 08:48 |
|
#2 |
New Member
Enrico DL
Join Date: Feb 2024
Location: Barcelona
Posts: 2
Rep Power: 0 |
Hi, eventually it's late but in case some new student has the same question..
1)If you're writing your own solver or functionObject, from the code you can access the vector through the method mesh.C() of the mesh class, that return all the cell centres coordinates as a vectorField, e.g.: const vectorField& myCellCentres = mesh.C(); 2)There is a postProcess command to obtain all the cell centres: $ cd myOFcase $ postProcess -func writeCellCentres note: if you're running on a HPC and you have to use slurm and can't run commands directly on terminal, remember to put the header in your .sh script sourcing OF. e.g. : #!/bin/bash source /usr/lib/openfoam/openfoam2306/etc/bashrc postProcess -func writeCellCentres |
|
Tags |
export data, polymesh, positions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
Comsol Magnetic field data to Fluent MHD | dean993 | FLUENT | 4 | December 17, 2018 13:31 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
sample utility surfaceformat as grid data for gnuplot circular crosssection | cfddwarf | OpenFOAM Post-Processing | 0 | July 13, 2012 10:05 |
chtMultiRegionFoam - exchange data between flow field and temperature | phsieh2005 | OpenFOAM Running, Solving & CFD | 0 | February 7, 2012 10:16 |