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

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.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (743.9 kB view details)

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

foamnordic-1.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (696.5 kB view details)

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

foamnordic-1.0.7-cp312-cp312-macosx_12_0_arm64.whl (508.6 kB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

foamnordic-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (744.5 kB view details)

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

foamnordic-1.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (697.6 kB view details)

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

foamnordic-1.0.7-cp311-cp311-macosx_12_0_arm64.whl (509.2 kB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

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

File hashes

Hashes for foamnordic-1.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e85fd99e4c854748b58a45ac5e4eab7200213d4da9d0748e5bd91c123059e2d0
MD5 d2418612485289de0373fe1118fc12c0
BLAKE2b-256 af2ec5a1199684aafd0ad7ebc13e3ccb9c766580f4bf3e2347f9431185cb0524

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for foamnordic-1.0.7-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 eddaa7105b4cbfc8795b40a0cef6a9d24cc6a4e260ec2d992d14f95bbd552a06
MD5 96a12cf4c506e4b5a79d8e05d106d100
BLAKE2b-256 bee17f259b22ec5a15bc771924e1cfe7cffcec9cac52fa5186bb1149bc427bd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for foamnordic-1.0.7-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 653b0a7ec90330d72ffa42348da3d70389a4568583804901ed77af3dd22e78ea
MD5 7b3e0068eb455215c18403bf48a24d61
BLAKE2b-256 7a9c69f824c7ad96b6203764f9caab20f0b758fed0cace363dc9214d4b379437

See more details on using hashes here.

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

File hashes

Hashes for foamnordic-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eeec839b028f860d3b65efff5d78ff7a72cc7b37626581999f8426a6d6982efe
MD5 289696b7aa8ec82fae840e5f1e0b04c4
BLAKE2b-256 17eb5c38c3abe786c425b758e7838d5326d36b8d0159bb55b2344f060769349f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for foamnordic-1.0.7-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d9f43dfb65498072bc344699daa6dcfec45209af476d6e949216bacae53d2cd8
MD5 e0c4989b326776028c00e495d8af97f8
BLAKE2b-256 c9ab1c9490f04eb0b84fb3aec574544d0c77cadaa5b71a0c9f01fb168852ee77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for foamnordic-1.0.7-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 49a58911ff28e872e619e18fc8c29f00d29c561e74e77446c37409fa64978c2e
MD5 3ac8600430385ac2d3f416af931dac85
BLAKE2b-256 69f44bd67646f3242b874c041de430ea7d130ed32ce60d6866adacbce96e03e6

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.8

6 files

This release

1.0.7 This release

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