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
Tutorials
How-to guides
- Write a custom aggregator node
- Extract solver residuals to a CSV
- Measure the interface area of a VOF free surface
- Sample a field along a line
- Sample a field on a cutting plane
- Compute a surface integral over a patch
- Compute a volume integral
- Wire pyOFTools into
system/controlDict - Migrate from the raw-WorkFlow API to
@PostProcessorBase - Troubleshooting
Reference
Project