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

Metadata

Release files for foamnordic 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for foamnordic 1.0.9
File
foamnordic-1.0.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
foamnordic-1.0.9-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
foamnordic-1.0.9-cp312-cp312-macosx_12_0_arm64.whl CPython 3.12 CPython 3.12 macOS 12.0+ ARM64 Details
foamnordic-1.0.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
foamnordic-1.0.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
foamnordic-1.0.9-cp311-cp311-macosx_12_0_arm64.whl CPython 3.11 CPython 3.11 macOS 12.0+ ARM64 Details

Total release size: 4.4 MB

Release files / foamnordic-1.0.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL foamnordic-1.0.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 832.6 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c631169abc55352381f41c01cc4b0d4e17e69b44dc93515e4d781c87a113be2
BLAKE2b-256 checksum
How to use checksums
949276ab88d982eca4b54bd7550aede53e21ca0a98c3e613c7acac1811397b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / foamnordic-1.0.9-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.9-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 780.7 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
ff900d771de728fd1345bda0fa5c73b70d0b2f3a13e09817ec51226e0025ac2a
BLAKE2b-256 checksum
How to use checksums
fe5e9c7dd0b70fcd778df07b807fa110626de598c5aeecae21b5868212239854
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / foamnordic-1.0.9-cp312-cp312-macosx_12_0_arm64.whl

Download URL foamnordic-1.0.9-cp312-cp312-macosx_12_0_arm64.whl
Size 586.2 kB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
40e95234b64db2cd79d5ff12e17137901ff6e33a9c87a405bebff7beb8e34ee4
BLAKE2b-256 checksum
How to use checksums
62dfad9cbbea3999f1c20dd2efa49c1389e4ac947699d6cdabd4908a59632a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / foamnordic-1.0.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL foamnordic-1.0.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 833.0 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
34a4b8d9fd1bbbb00e80b677763d50fe32ec79382d0d9bf13304b2e20f32079d
BLAKE2b-256 checksum
How to use checksums
52130de03c0ecadec8882db7570a0b17716051da64774cd70c9569e024574f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / foamnordic-1.0.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.9-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 781.6 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
8a20504625c90bdfd21e470ba52b9b913cb55a43cd4ea0df2a7515b307ef5157
BLAKE2b-256 checksum
How to use checksums
0f335a2b7bcbc7f6f1e4ec37d4e599217ebd1148d011099caf0641d9df2fad89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / foamnordic-1.0.9-cp311-cp311-macosx_12_0_arm64.whl

Download URL foamnordic-1.0.9-cp311-cp311-macosx_12_0_arm64.whl
Size 586.9 kB
Tags CPython 3.11 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
e991a500fcbba7276d5e79bd06ac3deb52c78278133a50454d24b2ebaa4ef0d2
BLAKE2b-256 checksum
How to use checksums
880b4c8cdce26ac7a0eb4a55fbfc2d20784b2be808d9031c523b1c6373321972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

1.0.9 This release

6 release files

1.0.8

6 release files

1.0.7

6 release files

1.0.6

6 release files

1.0.5

6 release files

1.0.4

6 release 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