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.

Documentation · Installation · API

Install

Use Python 3.11 or 3.12. Install the PyPI release with pip:

pip install foamnordic

Or use uv in an existing virtual environment:

uv pip install foamnordic

Follow the public installation guide for optional environment setup, OpenFOAM activation, the integration build and foamnordic doctor checks before running a case.

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. Downloads try GitHub first and fall back to Microsoft's official NuGet package after network or HTTP errors, with pinned SHA-256 checks for both sources. The NuGet fallback requires macOS 14 or later on Apple Silicon. Offline systems can point FOAMNORDIC_ONNX_RUNTIME_ROOT at an unpacked 1.28.0 SDK, or use foamnordic build --without-onnx when native ONNX execution is not required.

On macOS with OpenFOAM.app:

openfoam
foamnordic build
foamnordic doctor

Use the Python environment containing FoamNordic inside the OpenFOAM shell. The build calls wmake internally.

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.12

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.12
File Actions
foamnordic-1.0.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for foamnordic-1.0.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
foamnordic-1.0.12-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 for foamnordic-1.0.12-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
foamnordic-1.0.12-cp312-cp312-macosx_12_0_arm64.whl CPython 3.12 CPython 3.12 macOS 12.0+ ARM64 Details for foamnordic-1.0.12-cp312-cp312-macosx_12_0_arm64.whl
foamnordic-1.0.12-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 for foamnordic-1.0.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
foamnordic-1.0.12-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for foamnordic-1.0.12-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
foamnordic-1.0.12-cp311-cp311-macosx_12_0_arm64.whl CPython 3.11 CPython 3.11 macOS 12.0+ ARM64 Details for foamnordic-1.0.12-cp311-cp311-macosx_12_0_arm64.whl

Total release size: 4.4 MB

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

Download URL foamnordic-1.0.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 834.3 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b1245e6623a43ec75ed01013b35d0b2ef7f7ada8dc5bac0c8e5a7718f8242d75
BLAKE2b-256 checksum
How to use checksums
ba99d87538f49a43a5163442fe53a90043dcd41982e91b50ae53d3cf61679d06
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.12-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.12-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 782.4 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
bb38f692117c231c7cebbf3c8d836f414c16bf98fc9640ce0ef5d7e2001f6bdb
BLAKE2b-256 checksum
How to use checksums
e5a5a0acd2ef76cdcc0fd5c41dc2b706d4a8636f051791be34a0d1abeaf40010
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.12-cp312-cp312-macosx_12_0_arm64.whl

Download URL foamnordic-1.0.12-cp312-cp312-macosx_12_0_arm64.whl
Size 586.1 kB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
b2077b45df164b63dfc7e1c91cd03150219fcd0089aff99acb0827c1c64ab864
BLAKE2b-256 checksum
How to use checksums
71a3e6bd85d3cfecfe8a7756c6e773d3d100f9bb7d96f4b8590052d52d9c93d2
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.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL foamnordic-1.0.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 834.7 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
abb3940cefc9187548a328d391465ed87b4c0f0980b8cfcf061398de206c8f32
BLAKE2b-256 checksum
How to use checksums
1aa800ac129eaa06705a222c5696749e40ade4bc6e641e7c80c45d7e04863dbc
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.12-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.12-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 783.3 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
5f74a00b86ca489f15b5ec03d9fb7f187af71e3d42d69a52dadd08fed2fba4ba
BLAKE2b-256 checksum
How to use checksums
f82bdb29709b706251bf6aa9c7f4b128be4b72e1877def40fb41ae1eeebc6f34
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.12-cp311-cp311-macosx_12_0_arm64.whl

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

Security for foamnordic 1.0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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