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

[pythonFlu] Postprocessing using pythonFlu + Matplotlib +Scipy

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2011, 07:56
Default Postprocessing using pythonFlu + Matplotlib +Scipy
  #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 try using pythonFlu + Matplotlib + Scipy/Numpy to do some postprocessing.
I'm able to export some data in raw format (x,y,z, field1, field2, ...) on surfaces (patches or plane defined in sampleDict) and read them with a simple python script.

I've got some difficulties to use the Numpy meshgrid and Matplotlib contour in my script even in my mesh is block structured.

I first try to plot a scalar field on a patch. The mesh obtained from blockMesh is structured (in fact block-structured). My major problem is automatically obtain the size of the x (Nx) and y (Ny) data on this particular patche to use meshgrid and contour in my script.

meshgrid(x, y)
For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y
where X and Y are (Ny, Nx) shaped arrays with the elements of x
and y repeated to fill the matrix

Does pythonFlu have some magic tool with it to do those kind of postprocessing ?
Did you manage to postprocess your openfoam data only with matplotlib+numpy+scipy ?

Thanks for shearing your experiences.
Cheers

Francois
francois is offline   Reply With Quote

Old   June 20, 2011, 08:06
Default
  #2
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
May I add that I would like to preserve the original mesh structure (near wall refinement, etc ..) over interpolating the data on a new equally spaced grid.
francois is offline   Reply With Quote

Old   June 21, 2011, 11:26
Default
  #3
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Hi Francois,

Quote:
Originally Posted by francois View Post
My major problem is automatically obtain the size of the x (Nx) and y (Ny) data on this particular patche to use meshgrid and contour in my script.
Once you can generate the data and import them in Python it should be pretty easy to find out the metrics you are looking for.
Am I wrong? May be you could attach the whole example to demonstrate your point?

Quote:
Originally Posted by francois View Post
Does pythonFlu have some magic tool with it to do those kind of postprocessing ?
Did you manage to postprocess your openfoam data only with matplotlib+numpy+scipy ?
pythonFlu is focused completely on OpenFOAM wrapping.
Nevertheless, we could start to develop third-party OpenFOAM related post-processing tools based on Python.
Integration with pythonFlu better be optional, to make this tools valuable by themselves.

Best regards,
Alexey
alexey2petrov is offline   Reply With Quote

Reply


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
using fieldAverage library to average postprocessing eelcovv OpenFOAM Programming & Development 32 May 17, 2022 09:55
[snappyHexMesh] Debug option in snappy / Write volScalarField with cellLevel for postprocessing Ruli OpenFOAM Meshing & Mesh Conversion 1 March 30, 2014 08:57
SciPy dtucker SU2 Installation 2 January 31, 2013 00:52
pythonFlu - Python wrapping for OpenFOAM C++ API alexey2petrov OpenFOAM Announcements from Other Sources 13 December 21, 2012 11:43
Question about Postprocessing Using UDF(in tutoria sarah_ron2002 FLUENT 1 April 10, 2007 16:17


All times are GMT -4. The time now is 16:12.