CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Using python for post-processing: pythonFlu, swak4foam, ... ? (http://www.cfd-online.com/Forums/openfoam-post-processing/120643-using-python-post-processing-pythonflu-swak4foam.html)

francois July 11, 2013 09:26

Using python for post-processing: pythonFlu, swak4foam, ... ?
 
Hi all,

I would like to know if it's possible to use pythonFlu/swak4foam for post-processing data from an already computed case or is it only available at solver run time level ?

When the run is finished, is pythonFlu/swak4foam suited to do things like that:

* get scalar, vector fields into numpy arrays to be able to manipulate them later
* get cell/face center coordinates, faces surfaces, normals to faces ...
* sample data over line/plane/surface (something like OpenFOAM sample utility)
* compute gradient, integral, ....
* etc

I would like to replace Paraview + python scripts by my own Scipy/Matplotlib scripts

Thanks for sharing your experiences. :)
Regards

Francois

gschaider July 11, 2013 11:03

Quote:

Originally Posted by francois (Post 439182)
Hi all,

I would like to know if it's possible to use pythonFlu/swak4foam for post-processing data from an already computed case or is it only available at solver run time level ?

When the run is finished, is pythonFlu/swak4foam suited to do things like that:

* get scalar, vector fields into numpy arrays to be able to manipulate them later
* get cell/face center coordinates, faces surfaces, normals to faces ...
* sample data over line/plane/surface (something like OpenFOAM sample utility)
* compute gradient, integral, ....
* etc

I would like to replace Paraview + python scripts by my own Scipy/Matplotlib scripts

Thanks for sharing your experiences. :)
Regards

Francois

Wie pythonFlu this is possible "out of the box" (once you compiled pythonFlu): as it wraps the usual OF-functionality with a Python-layer you can do anything you can do in OF

In swak4Foam something like a hybrid of funkyDoCalc and the pythonIntegration-functionObject would be possible: calculate some swakVariables then inject the values into the Python-space and drop the user to the Python-shell or execute his script. The problem with this approach is that all the actual OF-specific work (gradients, sampling etc) has to be done in the first (swak)-part.

But thanks for the idea. I might consider implementing such a thing. Feature requests in http://sourceforge.net/apps/mantisbt...?page_number=1 might speed up that decision process. Or maybe someone feels like implementing it (contributions most welcome)


All times are GMT -4. The time now is 21:43.