CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

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

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2013, 10:26
Default Using python for post-processing: pythonFlu, swak4foam, ... ?
  #1
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
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
francois is offline   Reply With Quote

Old   July 11, 2013, 12:03
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by francois View Post
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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] fails in parallel with -otherTime? Phicau OpenFOAM Community Contributions 3 June 26, 2013 14:00
pythonFlu - Python wrapping for OpenFOAM C++ API alexey2petrov OpenFOAM Announcements from Other Sources 13 December 21, 2012 12:43
How to get Python Shell into ParaView 3.8.1? blaise OpenFOAM Installation 3 July 24, 2012 05:58
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 10:36
Post Processing in FEM Abhijit Tilak Main CFD Forum 0 April 26, 2004 12:59


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