Contrib/pythonFlu

From OpenFOAMWiki
< Contrib
Revision as of 08:41, 6 April 2011 by Francois (Talk | contribs)

pythonFlu is the Python wrapping for OpenFOAM C++ API. This article is just a cut and paste from pythonFlu homepage. Francois 10:41, 6 April 2011 (CEST)

Copyrights ©

2010 - Alexey Petrov

2009 - 2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR)

GNU General Public License, version 3

Developers: Alexey Petrov, Andrey Simurzin

1 Motivation

It comes from daily engineering practice. I mean the need to make OpenFOAM calculation environment more interactive and more automated at the same time.

It is hard to interact with OpenFOAM solver because of C++ code definition - it needs to be compiled before you could see the results of modifications you have made. How about the interactivity like in MatLab, where the user can actually play with its functionality step by step, immediately see the results and analyze them?

To automate interaction with solver, to run an optimization scheme or benchmark calculations you need to invent your own "scripting" wheel. This wheel will be responsible for passing the data to and fro binary solver, controlling and analyzing the solver output, running the solver execution and stopping it. Are you ready?

2 Solution

pythonFlu is the Python wrapping for OpenFOAM C++ API. It enriches the existing OpenFOAM best features, such as expressiveness and robustness, with such unique advantages as interactivity and automation. Using pythonFlu you possess all the power of OpenFOAM; you have the same performance and use the same math-like notation. Certainly, pythonFlu neither provides a commonplace GUI interface nor os going to define a solver for you, however, it gives you much more - a unique engineering environment, where everything can be accessed and run under the same Python terms.

3 Features

  • Supports different OpenFOAM versions and forks
(so, if you have some preferences on account of OpenFOAM distribution, there should be no problem)
  • Keeps the same performance as the referenced OpenFOAM C++ solvers
(even more, pythonFlu encourages solver developers to improve the original performance by avoiding unnecessary data duplication)
  • Enables definition of OpenFOAM pure Python classes derived from the corresponding C++ ones
(allows you to define custom fvPathFields and "physical models")
  • Makes it possible to distribute your pythonFlu solver code in a light-weight, portable, ready to use Python format