Skip to main content

Python framework for OpenFOAM

Project description

Fluidsimfoam

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.

Install

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 https://foss.heptapod.net/fluiddyn/fluidsimfoam
cd fluidsimfoam
poetry install
poetry shell

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.3.tar.gz (62.3 kB view hashes)

Uploaded Source

Built Distribution

fluidsimfoam-0.0.3-py3-none-any.whl (37.0 kB view hashes)

Uploaded Python 3

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