OpenMC Anywhere
OpenMC Monte Carlo Particle Transport Code with unofficial Windows/Apple/Linux pypi wheel (openmc executable + libopenmc shared library).
Let's type pip install openmc-anywhere or uv add openmc-anywhere, and write your script with import openmc
What is OpenMC Anywhere
This is an unofficial binary redistribution of upstream openmc-dev/openmc.
The distribution name is openmc-anywhere; the import name is plain openmc, exactly as upstream.
Prebuilt wheel
| Target | Wheel tag | OpenMC | HDF5 | DAGMC | MOAB | NJOY | |
|---|---|---|---|---|---|---|---|
x86_64-unknown-linux-gnu |
manylinux_2_28_x86_64 |
0.16.0 | 2.1.1 | 3.2.4 | 5.6.0 | 2016.79 | |
aarch64-unknown-linux-gnu |
manylinux_2_28_aarch64 |
0.16.0 | 2.1.1 | 3.2.4 | 5.6.0 | 2016.79 | |
x86_64-pc-windows-gnu |
win_amd64 |
0.16.0 | 2.1.1 | 3.2.4 | 5.6.0 | 2016.79 | |
x86_64-apple-darwin |
macosx_11_0_x86_64 |
0.16.0 | 2.1.1 | 3.2.4 | 5.6.0 | 2016.79 | |
aarch64-apple-darwin |
macosx_11_0_arm64 |
0.16.0 | 2.1.1 | 3.2.4 | 5.6.0 | 2016.79 |
Getting-started
import openmc
# A 20 cm sphere of natural lithium driven by a 14.1 MeV point source: the tritium breeding ratio comes out at 0.2683.
li = openmc.Material()
li.add_element("Li", 1.0)
li.set_density("g/cm3", 0.534)
sphere = openmc.Sphere(r=20.0, boundary_type="vacuum")
cell = openmc.Cell(fill=li, region=-sphere)
settings = openmc.Settings(run_mode="fixed source", batches=5, particles=10_000)
settings.source = openmc.IndependentSource(
space=openmc.stats.Point(), energy=openmc.stats.Discrete([14.1e6], [1.0])
)
tally = openmc.Tally(name="tbr")
tally.filters = [openmc.CellFilter(cell)]
tally.scores = ["H3-production"]
model = openmc.Model(openmc.Geometry([cell]), openmc.Materials([li]), settings, openmc.Tallies([tally]))
with openmc.StatePoint(model.run(output=False)) as sp:
t = sp.get_tally(name="tbr")
print(f"openmc {openmc.__version__} TBR = {t.mean.item():.4f} +/- {t.std_dev.item():.4f}")
$ export OPENMC_CROSS_SECTIONS=/path/to/cross_sections.xml # data is not bundled
$ pip install openmc-anywhere && python main.py
# or
$ uv add openmc-anywhere && uv run main.py
openmc 0.16.0.0 TBR = 0.2683 +/- 0.0004
openmc.data.IncidentNeutron.from_njoy("n-092_U_235.endf", temperatures=[300, 600, 900])
License
This repository's build tooling is MIT (see
LICENSE). The redistributed
components keep their own terms: OpenMC (MIT), HDF5 (BSD-3-Clause style), DAGMC
(BSD-2-Clause), NJOY2016 (LANL BSD-3-Clause style), and MOAB (LGPL-3.0-or-later).
MOAB is statically linked into the openmc executable and into libopenmc, so
redistributing these wheels carries the LGPL-3.0 obligations for a Combined Work.
MOAB is modified here: see src/moab-*.patch.
Thirdparty Licenses
Every license text is in
thirdparty-license/,
and each wheel ships the same set under <dist-info>/licenses/thirdparty-license/.
thirdparty-license/README.md
maps each file to the component and version it covers.
Corresponding Source for every redistributed component is this repository at the tag
matching the wheel version. Each component is pinned as a git submodule under src/;
git submodule status prints the exact upstream revision. make cross-<triple> at that
tag rebuilds these binaries, which is how the relink freedom of LGPL-3.0 §4(d)(0) is
provided: substitute your own MOAB and rebuild.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openmc_anywhere-0.16.0.0-py3-none-win_amd64.whl.
File metadata
- Download URL: openmc_anywhere-0.16.0.0-py3-none-win_amd64.whl
- Upload date:
- Size: 14.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ade1e4eada5200a85609811dd999886a143af55a353fad27accfdfb86fdaf28
|
|
| MD5 |
7eeb1fed4ec1b19dd34de95f8343fe08
|
|
| BLAKE2b-256 |
4a58749f397b563abffd276a4051d23fda940e04606fe7ae5d814c1bd841ebc7
|
File details
Details for the file openmc_anywhere-0.16.0.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: openmc_anywhere-0.16.0.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 15.0 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e78825d9fdc057b1faeb1540e7bb10f57c23386f0f52ada3349078f0608f36
|
|
| MD5 |
11d9ac0d4f6b29f1a2a50ddeea97cb5d
|
|
| BLAKE2b-256 |
e6c69a959443be876f6420c0e67a2c6c4ea8a667a4a245b6ce2e451daa673704
|
File details
Details for the file openmc_anywhere-0.16.0.0-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: openmc_anywhere-0.16.0.0-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 14.5 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c258e5049733959cb351fd74ee5b53c2dec3b478cb7dfe3176e0c09b79dfe358
|
|
| MD5 |
f770d2738c66ad02cb30d71517ab82e8
|
|
| BLAKE2b-256 |
8134b6cefc19d1bde2f1d7c600e50d4b7986a5c8e87184ca646d8156378d9a11
|
File details
Details for the file openmc_anywhere-0.16.0.0-py3-none-macosx_11_0_x86_64.whl.
File metadata
- Download URL: openmc_anywhere-0.16.0.0-py3-none-macosx_11_0_x86_64.whl
- Upload date:
- Size: 12.5 MB
- Tags: Python 3, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95dd702595eb9ef74911803376804dd4d50ed1d507aac9a15228c68097551c9b
|
|
| MD5 |
0796f3d16d6b6c3283c8372d5e23acce
|
|
| BLAKE2b-256 |
baa6e771ce9de93b09e8c5c6e15efd3a5a989e36550762bb5ff9107a9972ce3d
|
File details
Details for the file openmc_anywhere-0.16.0.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: openmc_anywhere-0.16.0.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 11.1 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
811b1a1c6e42f1f001b63e299ceaefc41b44b3972150ff868211cf5bc38e77be
|
|
| MD5 |
510eaeb8a1dd7f3b15c7421b7541082a
|
|
| BLAKE2b-256 |
329e2d9e98e3f9959c5d42006dce48bba3dc32fb9c4189c763958e30c160d01b
|