Skip to main content

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, Optax 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 artefacts 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

foamnordic-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (829.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

foamnordic-1.0.8-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (777.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

foamnordic-1.0.8-cp312-cp312-macosx_12_0_arm64.whl (582.7 kB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

foamnordic-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (829.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

foamnordic-1.0.8-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (778.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

foamnordic-1.0.8-cp311-cp311-macosx_12_0_arm64.whl (583.4 kB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

File details

Details for the file foamnordic-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc6a8ff97ef14fab679572087617376d04a6281e03f762dfee2a9df27da37ead
MD5 8813e92f2b8184d974f466a4f11a3a62
BLAKE2b-256 3d2360f4e6780718e5fa712693514fcd8320a305e5183f12d0603566bc5bdd46

See more details on using hashes here.

File details

Details for the file foamnordic-1.0.8-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0bb1a2d0d3f56f04d032348db5b66c9f6bb4b17133314629e6badae6b086afaf
MD5 bde55d9f3a221a8c67de065bd7c10df5
BLAKE2b-256 9976faa0b97eab8ed66333050e8a471bc0d195a052e933e6875f3a5be0b3e040

See more details on using hashes here.

File details

Details for the file foamnordic-1.0.8-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9db65c4bfcdb57ed81f4a87cafd6f1f1d27354d8da9bef9984d8d8e66cdd27a4
MD5 e1cbe14e2bb2624ee6959bef65e0182b
BLAKE2b-256 5b1921884b20ddf78576453af742a6d641d69280f6fcea78e0be070f316d71c7

See more details on using hashes here.

File details

Details for the file foamnordic-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3a3bb3981466e54b5038cd25179e14d62cc3f89fc878fb54678f8208639190c
MD5 e2fe21be3808e354b41dc3a6a717005c
BLAKE2b-256 1b1168f53f7d834efa5e17689e999b4310bd62a1c6de1454f01f01c8df7d0312

See more details on using hashes here.

File details

Details for the file foamnordic-1.0.8-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d2528e24cbed67cdee094ff2fcda691085d0f42f9a17d78a25668a0e3fa96b3a
MD5 683eec7f9e53c6413391c66eb02a7466
BLAKE2b-256 ba80f3d2d5fcbf976b07e3667e322f554943e3f160a7c03149c355d54e103f17

See more details on using hashes here.

File details

Details for the file foamnordic-1.0.8-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for foamnordic-1.0.8-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 1f8edbe45a2bac5571ed28dd1060a5b4687fcc3b9928983fed48272d699208f2
MD5 175fa400bcf4ccdc0d71aaa5c04a4dcb
BLAKE2b-256 5756524550ed235bb9829bf60fcd7a5af2d27e0cfd699c52bea0c4da995f0480

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.8 This release

6 files

1.0.7

6 files

1.0.6

6 files

1.0.5

6 files

1.0.4

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page