Search NASASearch

DOE OSTI · 3027746

MontePy: a Python library for reading, editing, and writing MCNP input files.

Abstract

The Monte Carlo N-Particle (MCNP) radiation transport code is a highly capable and accurate code with a long legacy. MCNP uses the Monte Carlo simulation process to simulate the path of particles (e.g., neutrons, photons, charged particles, etc.), and their interaction with materials. It is widely used in nuclear engineering, high-energy physics, and other fields. Its origins in the mid-twentieth century predate many modern software conventions. MCNP users provide an input file to MCNP, which it then uses to create an internal representation of the simulation problem. These input files originally had to be stored as punchcard decks, and the user manual still uses the terminology of cards and decks, despite moving beyond punchcards. MCNP predates nearly all modern human readable markup or data serialization languages, such as the extensible Markup Language (XML), the Standard Generalized Markup Language (SGML), YAML (YAML Ain’t Markup Language), and Javascript Object Notation (JSON). Due to this, MCNP uses an entirely custom defined syntax language for its input, making off-the-shelf libraries for XML, YAML, and JSON impossible to use for scripting various operations on MCNP input files (Kulesza et al., 2022).

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Gale, Micah D. [Idaho National Laboratory (INL), Idaho Falls, ID (United States)] (ORCID:0000000164514818), Labossiere-Hickman, Travis J. [Idaho National Laboratory (INL), Idaho Falls, ID (United States)] (ORCID:0000000307423404), Carbno, Brenna Anne [Idaho National Laboratory (INL), Idaho Falls, ID (United States)] (ORCID:0009000566915128), Bascom, Andrew John [Idaho National Laboratory (INL), Idaho Falls, ID (United States)] (ORCID:0009000566915128). 2025-04-09. MontePy: a Python library for reading, editing, and writing MCNP input files.. https://doi.org/10.21105/joss.07951

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related reports

Alchemy: A Model-Based Approach for 2D to 3D Autonomous Nuclear System Design

Engineering design of nuclear power plant (NPP) piping and equipment systems frequently bypasses crucial 2D system planning, instead moving straight to 3D modeling. This often leads to designs that exceed building envelope constraints, forcing expensive and time-consuming redesigns. When 2D modeling is employed, it typically involves labor-intensive manual workflows that convert 2D drawings into 3D models, resulting in inefficiencies and errors across design iterations. These workflows further suffer from poor software interoperability and dependence on proprietary software ecosystems, thereby contributing to schedule delays and cost overruns. This paper presents Alchemy, an autonomous framework that transforms 2D system definitions into Industry Foundation Classes (IFC)-compliant 3D building information models (BIMs) for expediting nuclear facility design at the conceptual preliminary phase. Using a model-based approach, the framework treats the 2D system diagram as the central reference model employed to automatically generate all subsequent outputs, ensuring consistency between the system definition and the resulting physical design. A web-based interface enables engineers to define hierarchical system topologies including associated equipment, geometric properties, and connectivity requirements. A two-phase equipment layout optimization algorithm automatically computes collision-free spatial configurations within predefined building envelopes. An artificial intelligence (AI)-assisted pipe routing module then generates orthogonal, collision-free routing paths, allowing the user to select either an A* search-based method or an Ant Colony Optimization (ACO)-based method. All outputs are authored natively in IFC format, relying on open-source technologies and standardized formats in order to ensure extensibility and eliminate proprietary software dependencies. The proposed framework is validated on two representative pressurized-water reactor (PWR)-based case studies, for which it autonomously generates IFC-compliant 3D models in minutes, drastically reducing workflows that typically require hours of manual effort. The generated model demonstrates topologically correct equipment placement, physically plausible spatial relationships, and collision-free pipe routing consistent with known PWR loop configurations. This work represents a foundational step toward digital engineering for nuclear facility preliminary design, with future ongoing development targeting design code compliance and expanded system complexity.

97 - MATHEMATICS AND COMPUTING