OpenFOAM-Residuals
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.
Features
- 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.
Requirements
- Python 3.10 or later
Installation
Install from PyPI:
pip install openfoam-residuals
or with uv:
uv add openfoam-residuals
Development Setup
-
Clone the repository:
git clone https://github.com/Eddy3D-Dev/OpenFOAM-Residuals.git cd OpenFOAM-Residuals
-
Install dependencies:
uv sync
Usage
You can run the tool directly using uv run:
Single File
Plot residuals for a specific file (residuals*.dat or log.*):
uv run python -m openfoam_residuals.main -f /path/to/residuals.dat
Case Directory
Automatically find and plot all residual files in a directory (recursive):
uv run python -m openfoam_residuals.main -w /path/to/case/dir
Multiple Directories
Process multiple case directories at once:
uv run python -m openfoam_residuals.main -w case1 -w case2
Options
-o,--out: Specify output directory (default:exports).--no-plots: Skip plot generation and only export data.-v,--verbose: Increase logging verbosity (e.g.,-vv).
Development
Running Tests
uv run pytest
License
GNU General Public License v3 (GPLv3)
Metadata
Release files for openfoam-residuals 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openfoam_residuals-0.3.1.tar.gz | 519.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openfoam_residuals-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 543.9 kB
Release files / openfoam_residuals-0.3.1.tar.gz
| Download URL | openfoam_residuals-0.3.1.tar.gz |
|---|---|
| Size | 519.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b20333e6dd6ed46a98602e611ceaa684bf000b8c267505f68653e66129e3a84
|
|
BLAKE2b-256 checksum How to use checksums |
a3975f13c1625285eedfad806bc40b3fcc4d584e07510704a3d5100d56caa0ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / openfoam_residuals-0.3.1-py3-none-any.whl
| Download URL | openfoam_residuals-0.3.1-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
877142e8a4eaa291d551bac0ab5c6c4c22b32f434907715435748183f9fe5d04
|
|
BLAKE2b-256 checksum How to use checksums |
2f3cc17cf829dfed39b772dfd66080684339592c4b55f87a3270c735cd3be9cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|