A Python tool to parse and plot residual data from OpenFOAM case directories. This tool is designed to work with output from Eddy3D, an airflow and microclimate simulation plugin for Rhino and Grasshopper, but can be used with standard OpenFOAM residual files as well.
- Automatic Detection: Recursively finds
residuals*.datand OpenFOAMlog.*files in case directories. - Batch Processing: Handle multiple case directories or single files.
- Plotting: Generates high-quality PNG plots of residuals vs. iterations.
- Data Export: Exports cleaned data for further analysis.
- Smart Scaling: Automatically adjusts plot scales based on residual magnitude.
- Python 3.10 or later
Install from PyPI:
pip install openfoam-residualsor with uv:
uv add openfoam-residuals-
Clone the repository:
git clone https://github.com/Eddy3D-Dev/OpenFOAM-Residuals.git cd OpenFOAM-Residuals -
Install dependencies:
uv sync
You can run the tool directly using uv run:
Plot residuals for a specific file (residuals*.dat or log.*):
uv run python -m openfoam_residuals.main -f /path/to/residuals.datAutomatically find and plot all residual files in a directory (recursive):
uv run python -m openfoam_residuals.main -w /path/to/case/dirProcess multiple case directories at once:
uv run python -m openfoam_residuals.main -w case1 -w case2-o,--out: Specify output directory (default:exports).--no-plots: Skip plot generation and only export data.-v,--verbose: Increase logging verbosity (e.g.,-vv).
uv run pytestGNU General Public License v3 (GPLv3)