Skip to main content

Python framework for OpenFOAM

Project description


PyPI Documentation Status

Python framework for OpenFOAM

OpenFOAM is a very popular open-source C++ CFD framework. Working with OpenFOAM implies writting and modifying a lot of input files describing a simulation. The method described in the official OpenFOAM documentations is to copy an existing simulation directory and to modify the input files by hand. Fluidsimfoam is a Python package designed to improve the life of OpenFOAM users.

Fluidsimfoam allows one to write Fluidsim solvers based for the simulations on OpenFOAM. There are open-source solvers (in particular fluidsimfoam-tgv, fluidsimfoam-cbox and fluidsimfoam-sed) and it is not be difficult to write your own solver based on your OpenFOAM cases.

With a Fluidsimfoam solver, it becomes very easy to

  • launch/restart simulations with Python scripts and terminal commands,
  • load simulations, read the associated parameters/data and produce nice figures/movies.

Fluidsimfoam can be seen as a workflow manager for OpenFOAM or a Python wrapper around OpenFOAM. It uses OpenFOAM on the background and is thus NOT a rewrite of OpenFOAM!

The best way to use Fluidsimfoam is to write or use a solver adapted for your particular use case. However, one can also use Python objects provided by Fluidsimfoam for some common tasks, like parsing/writting input files, modifying field files, writting blockMeshDict files, etc.

Fluidsimfoam is now in quite early development. The goal is to get the equivalent of Snek5000, our Fluidsim framework for Nek5000. Looking at the Snek5000 tutorials should give a good idea of what Fluidsimfoam will soon allow.

For our examples, we currently target OpenFOAM v2206 but it should be possible to write Fluidsimfoam solvers targeting any recent OpenFOAM versions.

See more in Fluidsimfoam documentation.


Currently, it still makes sense to install Fluidsimfoam like we, the fluidsimfoam developers, install it, i.e. in a dedicated controlled virtual environment created by Poetry. After installing Poetry (for example with something like pip install poetry), the following commands should install and activate the virtual environment:

hg clone
cd fluidsimfoam
poetry install
poetry shell

For better user experience with Matplotlib figures, you can also install with poetry install --extra qt.

Related projects

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluidsimfoam-0.0.4.tar.gz (76.1 kB view hashes)

Uploaded source

Built Distribution

fluidsimfoam-0.0.4-py3-none-any.whl (44.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page