pyOFTools

Python post-processing for OpenFOAM simulations.

pyOFTools lets you write in-situ post-processing in Python that runs inside your OpenFOAM solver. Define what to compute with a decorator, and pyOFTools handles field access, parallel reduction, and CSV output.

from pyOFTools.postprocessor import PostProcessorBase
from pyOFTools.builders import field
from pyOFTools.aggregators import VolIntegrate

postProcess = PostProcessorBase()

@postProcess.Table("volume.csv")
def water_volume(mesh):
    return field(mesh, "alpha.water") | VolIntegrate()

Supported versions: OpenFOAM 2406 / 2412 / 2506, Python 3.9–3.13

Which doc should I read?

  • New here? Start with a tutorial — they walk through an end-to-end workflow.

  • Have a specific task? A how-to guide gives a step-by-step recipe.

  • Looking up an API? See the reference.

  • Want the design? Read the explanation section.

Getting started

Project