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.

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. FoamNordic supports OpenCFD and adds experimental OpenFOAM Foundation 14 support in 1.0.13. 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.13

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

Total release size: 4.4 MB

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

Download URL foamnordic-1.0.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 837.2 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
13633af136f1d13f0022ce6e805fd9e9a19b749c35c892aa08eae358e5e34df8
BLAKE2b-256 checksum
How to use checksums
4e6be34ee680ff8325c725494b7fecaa069af04bfff264e0d809923147c5424a
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.13-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.13-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 785.3 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
7c61552803144d1749a11cdec27cd448d402f4b6955c8a5b05afba63a32fdf59
BLAKE2b-256 checksum
How to use checksums
83331e23d6d389f998689833ed76edbdbdfe02017a0cd6dc2cdd32fbb418444c
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.13-cp312-cp312-macosx_12_0_arm64.whl

Download URL foamnordic-1.0.13-cp312-cp312-macosx_12_0_arm64.whl
Size 589.0 kB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
76d9edeb8a584e8eb728ac7f0852ba896f564c77acef4d95db27e831d587acfe
BLAKE2b-256 checksum
How to use checksums
3f497157b1545c06cdf5a1bf5e4be0523c15961a5d2ad27e9cf2d3d1068be069
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.13-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL foamnordic-1.0.13-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 837.6 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cc5be891592e08eb74929e29a3f5d0c75c27decb8477b150bebc9d4c69ed8262
BLAKE2b-256 checksum
How to use checksums
0ea345f1645aaefe071c495b3e000ffe41a44e1988024d591fad1635ffd2da2b
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.13-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL foamnordic-1.0.13-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 786.2 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
2fa9a6d4382fc93446ebcded56443711894246338188dfdc87b4f398c9759467
BLAKE2b-256 checksum
How to use checksums
f96d2a1a3cfbf86127a498721aa7fcc8e2760dfca2542377d5596640f21ca4b1
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.13-cp311-cp311-macosx_12_0_arm64.whl

Download URL foamnordic-1.0.13-cp311-cp311-macosx_12_0_arm64.whl
Size 589.7 kB
Tags CPython 3.11 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
283d84d495eee337e5cd8878f0adb7df195710732ca71dbad6718ff715ab95dc
BLAKE2b-256 checksum
How to use checksums
ab7a58c7a057905df19316e6e2cbfcaada13fd8d0787a9705dc6fa3476a4f850
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.13

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