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*.datfiles 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.
This project uses uv for dependency management.
-
Install
uv(if not already installed):curl -LsSf https://astral.sh/uv/install.sh | sh -
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:
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 pytestuv run ruff check
uv run ruff formatGNU General Public License v3 (GPLv3)