Metadata-Version: 2.5
Name: stacknordic
Version: 0.1.2
Summary: OpenFOAM data preparation and reduction for DNS, LES, and machine learning
Project-URL: Homepage, https://github.com/PentagonToy/StackNordic
Project-URL: Documentation, https://github.com/PentagonToy/StackNordic/blob/main/docs/README.md
Project-URL: Issues, https://github.com/PentagonToy/StackNordic/issues
Project-URL: Source, https://github.com/PentagonToy/StackNordic
Project-URL: Changelog, https://github.com/PentagonToy/StackNordic/blob/main/CHANGELOG.md
Author-email: Hanseul Kang <hanseul.kang@aalto.fi>
License-Expression: GPL-3.0-only
License-File: LICENSE
Keywords: CFD,DNS,LES,OpenFOAM,scientific computing
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.13,>=3.11
Requires-Dist: cantera<4,>=3.1
Requires-Dist: h5py<4,>=3.12
Requires-Dist: hedgehogs>=0.0.1
Requires-Dist: numpy<3,>=2
Requires-Dist: scipy<2,>=1.14
Description-Content-Type: text/markdown

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="others/assets/banner_dark.svg">
  <img src="others/assets/banner_light.svg" alt="StackNordic" width="960">
</picture>

# StackNordic

StackNordic reconstructs and prepares stored OpenFOAM results for DNS, LES and machine-learning workflows. It reads OpenFOAM.com and OpenFOAM Foundation cases, including reconstructed, uncollated, collated and grouped-collated layouts.

[Documentation](https://pentagontoy.github.io/FoamNordic/stacknordic/) · [Installation](https://pentagontoy.github.io/FoamNordic/stacknordic/installation/) · [API](https://pentagontoy.github.io/FoamNordic/stacknordic/api/)

## Installation

Use Python 3.11 or 3.12.

```console
pip install stacknordic
```

Activate a compatible OpenFOAM runtime for reconstruction and other operations that call OpenFOAM utilities. See the [installation guide](docs/installation.md) for runtime and environment setup.

## Reconstruct a case

Activate the Python environment and the OpenFOAM runtime, enter a decomposed case, and run:

```console
stacknordic reconstruct --n-jobs -1 --progress
```

Use `--time` or `--time-range` to select times, `--fields` to select fields and `--output-dir` to write to a separate case. The `-reconstructPar` alias accepts the same options. See the [CLI reference](docs/api/openfoam.md#command-line) for examples.

## Core workflows

- [Export reconstructed or decomposed fields directly](docs/api/dataset.md), including time-local decomposition and mesh addressing.
- [Compute progress variables and reaction rates](docs/api/fields.md#field-computing) from declared Cantera contracts.
- [Package and compile Cartesian datasets](docs/api/dataset.md#snapshot-packaging) as self-describing HDF5 snapshots or time series.
- [Filter and downsample DNS data](docs/api/filtering.md) with declared Reynolds, Favre, variance and SGS reductions.
- [Run a closed set of post-processing operations](docs/api/fields.md#post-processing) on OpenFOAM cases or exported Cartesian datasets.

Use the [case-to-dataset example](docs/tutorials/case-to-dataset.md) to turn a stored result into HDF5, or browse the [documentation index](docs/README.md).

## Development

```console
uv sync --dev
uv run pytest
uv run ruff check .
uv build
```
