FoamNordic
FoamNordic is a native C++ and Python framework for ordinary OpenFOAM and machine-learning field programs, including equation-level closures. It keeps atomic field exchange, packing, and lifecycle in the native runtime, delegates model formats and execution to BindNordic, and exposes a compact declarative API for cases, placement, launch, observations, and results.
Note: The FoamNordic GitHub repository is temporarily private while the software is used in ongoing research and a related publication. The repository will be made public after the research is presented. PyPI distributions remain available in the meantime.
FoamNordic is active research software. Release notes and upgrade guidance are maintained in the changelog.
Install
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "foamnordic[ml]"
# Load or enter the desired OpenFOAM environment once, then:
foamnordic build
foamnordic --version
foamnordic --help
foamnordic dir
foamnordic doctor
The ml extra includes scikit-learn, ONNX, Equinox, and CPU JAX on Linux or macOS. Install foamnordic[ml-cuda12] for CUDA 12 JAX on Linux. CUDA selection is explicit rather than inferred from CPU architecture. Install plain foamnordic for ordinary OpenFOAM runs, mathematical functions, or existing artifacts that do not require those authoring libraries.
Binary wheels carry the native Python control runtime and compact OpenFOAM source build kit. foamnordic build compiles it for the currently loaded ABI; each case later selects that runtime from its declared of_cmd and shell. The build also prepares the native ONNX ModelHost and verified ONNX Runtime 1.28.0. Offline systems can point FOAMNORDIC_ONNX_RUNTIME_ROOT at an unpacked 1.28.0 distribution.
First case
from pathlib import Path
import foamnordic as fno
case = fno.OpenFOAM.Case(
name="cavity",
case_dir=Path("cases/cavity"),
run_dir="output/cavity",
of_cmd="module load openfoam/2512", # macOS OpenFOAM.app: "openfoam"
shell="bash",
)
# Use an existing cavity case with a blockMeshDict and initial fields.
case.initialize(ranks=1, mesh="blockMesh", validate_mesh=True)
print(case.fields.keys())
run = fno.Longship(case=case).launch()
run.summary()
result = run.stop()
post = result.postprocess
statistics = post.statistics(["U", "p"], time_idx=-1, verbose=True)
Paths may be strings, pathlib.Path, or text PathLike objects. FoamNordic uses 0/ when available and otherwise copies 0.orig/ to 0/ inside the isolated run without changing the source case.
Platforms
- Linux
x86_64 - Linux
aarch64 - macOS Apple Silicon (
arm64)
Native macOS development uses OpenFOAM.app. It provides current OpenFOAM releases as Apple Silicon applications and Homebrew packages.
Learn more
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foamnordic-1.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 743.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85fd99e4c854748b58a45ac5e4eab7200213d4da9d0748e5bd91c123059e2d0
|
|
| MD5 |
d2418612485289de0373fe1118fc12c0
|
|
| BLAKE2b-256 |
af2ec5a1199684aafd0ad7ebc13e3ccb9c766580f4bf3e2347f9431185cb0524
|
File details
Details for the file foamnordic-1.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 696.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eddaa7105b4cbfc8795b40a0cef6a9d24cc6a4e260ec2d992d14f95bbd552a06
|
|
| MD5 |
96a12cf4c506e4b5a79d8e05d106d100
|
|
| BLAKE2b-256 |
bee17f259b22ec5a15bc771924e1cfe7cffcec9cac52fa5186bb1149bc427bd7
|
File details
Details for the file foamnordic-1.0.7-cp312-cp312-macosx_12_0_arm64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp312-cp312-macosx_12_0_arm64.whl
- Upload date:
- Size: 508.6 kB
- Tags: CPython 3.12, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
653b0a7ec90330d72ffa42348da3d70389a4568583804901ed77af3dd22e78ea
|
|
| MD5 |
7b3e0068eb455215c18403bf48a24d61
|
|
| BLAKE2b-256 |
7a9c69f824c7ad96b6203764f9caab20f0b758fed0cace363dc9214d4b379437
|
File details
Details for the file foamnordic-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 744.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeec839b028f860d3b65efff5d78ff7a72cc7b37626581999f8426a6d6982efe
|
|
| MD5 |
289696b7aa8ec82fae840e5f1e0b04c4
|
|
| BLAKE2b-256 |
17eb5c38c3abe786c425b758e7838d5326d36b8d0159bb55b2344f060769349f
|
File details
Details for the file foamnordic-1.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 697.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9f43dfb65498072bc344699daa6dcfec45209af476d6e949216bacae53d2cd8
|
|
| MD5 |
e0c4989b326776028c00e495d8af97f8
|
|
| BLAKE2b-256 |
c9ab1c9490f04eb0b84fb3aec574544d0c77cadaa5b71a0c9f01fb168852ee77
|
File details
Details for the file foamnordic-1.0.7-cp311-cp311-macosx_12_0_arm64.whl.
File metadata
- Download URL: foamnordic-1.0.7-cp311-cp311-macosx_12_0_arm64.whl
- Upload date:
- Size: 509.2 kB
- Tags: CPython 3.11, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49a58911ff28e872e619e18fc8c29f00d29c561e74e77446c37409fa64978c2e
|
|
| MD5 |
3ac8600430385ac2d3f416af931dac85
|
|
| BLAKE2b-256 |
69f44bd67646f3242b874c041de430ea7d130ed32ce60d6866adacbce96e03e6
|