Abstract
Monte Carlo codes are essential components of many reactor physics simulation workflows as high-fidelity continuous-energy neutron transport solvers. Among Monte Carlo radiation transport codes, MCNP is particularly notable due to its diverse simulation capabilities, large user base, and long validation history. Despite being a powerful simulation tool, MCNP provides limited capabilities to allow automated execution, model transformation, or support for user-defined logic and abstractions that limit its compatibility with modern workflows. To better integrate MCNP into a modern scientific workflow, we have developed an intuitive yet full-featured MCNP Application Program Interface (API) in Python, named MCNPy, which provides a specialized set of classes for MCNP input development. Moreover, to guarantee that our reading, writing, and modeling capabilities remain self-consistent (and to render the huge scope of the MCNP API manageable), we have adopted a strategy of model-driven software development in which a generalized model of the MCNP input format has been created. From this generalized model, or “metamodel,” problem-specific implementations such as an engine for input validation or a codebase for programmatic operations may be automatically generated. Since MCNPy primarily acts as a Python front-end to the underlying Java API that directly interfaces with the metamodel, it is intrinsically linked to the metamodel and thus remains maintainable. With MCNPy, users can programmatically read, write, and modify any syntactically valid MCNP input file regardless of its origin. These capabilities allow users to automate complicated tasks like design optimization and model translation for nuclear systems. As examples, this work demonstrates the use of MCNPy to find the critical radius of a plutonium sphere and to translate a 9000+ line MCNP input file into a corresponding OpenMC model.
Original language | English |
---|---|
Pages (from-to) | 1600-1620 |
Number of pages | 21 |
Journal | Nuclear Science and Engineering |
Volume | 197 |
Issue number | 8 |
DOIs | |
State | Published - 2023 |
Funding
This material is based upon work supported by the NRC Office of Nuclear Regulatory Research under award number 31310020M0006. Partial support for this work also came from the U.S. Department of Energy Office of Nuclear Energy under award number DE-NE0008707. This research was performed under appointment of the third author to the Rickover Fellowship Program in Nuclear Engineering sponsored by the Naval Reactors Division of the National Nuclear Security Administration. This work was supported by the U.S. Nuclear Regulatory Commission [31310020M0006]; the U.S. Department of Energy Office of Nuclear Energy’s Nuclear Energy University Programs [DE-NE0008707]. This material is based upon work supported by the NRC Office of Nuclear Regulatory Research under award number 31310020M0006. Partial support for this work also came from the U.S. Department of Energy Office of Nuclear Energy under award number DE-NE0008707. This research was performed under appointment of the third author to the Rickover Fellowship Program in Nuclear Engineering sponsored by the Naval Reactors Division of the National Nuclear Security Administration.
Funders | Funder number |
---|---|
NRC Office of Nuclear Regulatory Research | 31310020M0006 |
Naval Reactors Division | |
U.S. Nuclear Regulatory Commission | |
Office of Nuclear Energy | |
National Nuclear Security Administration | |
Nuclear Energy University Program | DE-NE0008707 |
Keywords
- API
- MCNP
- MCNPy
- Python
- metamodel