Python tools and utilities for OpenFOAM
Currently in the pre-alpha release state.
pyOFTools is a collection of Python utilities for working with OpenFOAM simulations. It provides:
- Region selection and geometry tools
- Field manipulation functions
- Post-processing utilities
- Time series analysis
- Dictionary handling
- Python 3.8 or higher
- OpenFOAM of2012 or higher (for OpenFOAM integration features)
- Required Python packages: numpy, pydantic
pip install pyOFToolsgit clone https://github.com/HenningScheufler/pyOFTools
cd pyOFTools
pip install -e .git clone https://github.com/HenningScheufler/pyOFTools
cd pyOFTools
pip install -e ".[dev]"import pyOFTools
# Use region selection tools
from pyOFTools import Box, Sphere
# Create geometric regions
box = Box(min=(0, 0, 0), max=(1, 1, 1))
sphere = Sphere(center=(0.5, 0.5, 0.5), radius=0.3)
# Combine regions
region = box & sphere # intersectionThe project also includes CMake build system for embedding Python into OpenFOAM as function objects. The CMake build is separate from the Python package installation.
Run the test suite:
pytestDocumentation is work in progress and will be available at the project homepage.
GPL-3.0-or-later