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. Offline systems can point FOAMNORDIC_ONNX_RUNTIME_ROOT at an unpacked 1.28.0 distribution.
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.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 4.4 MB
Release files / foamnordic-1.0.11-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | foamnordic-1.0.11-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 832.9 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
238b1923bf82e45ba61ad5603b0b5f07376383f01d60d9bcc3d32153859e7253
|
|
BLAKE2b-256 checksum How to use checksums |
812c6ebb13a73e580afcda83c8e76413895b8e70a93cd5e83f38274b02885b80
|
| 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.11-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | foamnordic-1.0.11-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 781.0 kB |
| Tags | CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
b9663ff669e9af53c69042b3fd0c3c18fdb742bdc50e993ae53f48db86dd50d9
|
|
BLAKE2b-256 checksum How to use checksums |
227c1d109d2a8279c44aedf0a58a07562f5bfbf6912451d78774ca221a547f0d
|
| 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.11-cp312-cp312-macosx_12_0_arm64.whl
| Download URL | foamnordic-1.0.11-cp312-cp312-macosx_12_0_arm64.whl |
|---|---|
| Size | 586.4 kB |
| Tags | CPython 3.12 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c4729eab09757aadb0ae2dd8785d2a0a9d80ef6d21b27ef14fe3e94b454a158f
|
|
BLAKE2b-256 checksum How to use checksums |
cd90fe0ae50515b64d1b57323f86f3a129a98587c02f93385994abf02ddce7bb
|
| 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.11-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | foamnordic-1.0.11-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 833.3 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
187d4f7508dd2a9fe76c3484b60fe77cb61ae9b590db8bac1f775e9a8860b3b6
|
|
BLAKE2b-256 checksum How to use checksums |
404a51521aeb6ba90bd16300f50d76a3884931411c95766616f23ceab138f0be
|
| 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.11-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | foamnordic-1.0.11-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 781.9 kB |
| Tags | CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
c25609eefbabddb4b13f9f48b66e490a044de3ca5499ba02daf86a2425cb1918
|
|
BLAKE2b-256 checksum How to use checksums |
3ee1367bc0f7fe928cb4b55b559a1b50c8d6f5bc244b9d9d9e2369b51cc0d050
|
| 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.11-cp311-cp311-macosx_12_0_arm64.whl
| Download URL | foamnordic-1.0.11-cp311-cp311-macosx_12_0_arm64.whl |
|---|---|
| Size | 587.1 kB |
| Tags | CPython 3.11 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ae83e4998b9281fcc110ecc1eab86758cd6ad869f0a0f88b0aff149df4169417
|
|
BLAKE2b-256 checksum How to use checksums |
da801dfd7764c8b041bac003026405b9a0d39b9195d16c1a06dd5fdd2fcacdfa
|
| 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.11
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.