Search NASA⌕ Search

SEARCH · Search NASA

Results for “python code”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 289 records · Page 16

An X-ray Intensity Operations Monitor (AXIOM) (Final LDRD Project Report)

The Saturn accelerator has historically lacked the capability to measure time-resolved spectra for its 3-ring bremsstrahlung x-ray source. This project aimed to create a spectrometer called AXIOM to provide this capability. The project had three major development pillars: hardware, simulation, and unfold code. The hardware consists of a ring of 24 detectors around an existing x-ray pinhole camera. The diagnostic was fielded on two shots at Saturn and over 100 shots at the TriMeV accelerator at Idaho Accelerator Center. A new Saturn x-ray environment simulation was created using measured data to validate. This simulation allows for timeresolved spectra computation to compare the experimental results. The AXIOM-Unfold code is a new parametric unfold code using modern global optimizers and uncertainty quantification. The code was written in Python, uses Gitlab version control and issue tracking, and has been developed with long term code support and maintenance in mind.

43 PARTICLE ACCELERATORS↗

Improved Verification and Validation Testing and Tools including Nuclear Criticality Safety Applications with the MCNP6.3® Code [Abstract]

A new Python-based framework has been developed to enable a more consistent layout with automatable setup, execution, and documentation of all verification and validation (V&V) test suites previously established for use with the MCNP code. In this paper, the new general framework for the V&V test suites is discussed, including information on all of the current capabilities and plans for future capabilities. For nuclear criticality safety applications, the existing V&V benchmark problems within the criticality, extended criticality, and analytic k-effective test suites have been ported into this new framework. In addition, the status and updates to the Rossi-alpha and subcritical multiplicationtest suites will be discussed. Some V&V results exercising new MCNP6.3 capabilities will be demonstrated.

97 MATHEMATICS AND COMPUTING↗

Final Report - PyVERAIn: An Open Source, Python-based CASL Preprocessing Platform for Reactor Geometry, Code Discretizations, and Parallel Domain Decompositions

The introduction of advanced modeling and simulation practices over the last several decades has proven to produce better products, more quickly, and at the reduced cost. This computational experimentation has enabled the design and development of a variety of innovative products by reducing the need to build expensive prototypes, and by allowing rapid, comprehensive design studies across a wide range of products. Despite these successes, there are significant barriers to widespread adoption of these tools. This project aims to address several of these barriers.

22 GENERAL STUDIES OF NUCLEAR REACTORS↗

User’s Manual for Seal_Flux: A Seal Barrier Reduced-Order Model (Update)

This report provides a brief description on the use of the Seal_Flux computer program developed as part of the effort to quantify the risk of geologic storage of carbon dioxide (CO 2 ) under the U.S. Department of Energy’s (DOE) National Risk Assessment Partnership (NRAP). The Seal_Flux code simulates the flow of CO 2 through a low permeability rock horizon or seal formation overlying the storage reservoir into which CO 2 is injected. A two-phase, relative permeability approach with Darcy’s law is used for one-dimensional (1D) flow computations of CO 2 through the horizon in the vertical direction. The code also allows the simulation of time-dependent processes that can influence such flow. However, as part of its design, Seal_Flux is what can be termed a “reduced-order model” (ROM) and is not intended as a full-functioning flow code. The theory and simulation in the code is streamlined and directed towards the implementation of Monte Carlo risk analyses of CO 2 transport or as termed in this context as “leakage.” While presented in this report as a stand-alone tool, the Seal_Flux code is intended to function in the future as one of several models as part of an integrated, systems-level model of CO 2 storage performance. Finally, the code is written in Python 3.10 to provide an open framework for further development by others and to assist in linking the code with other modules in an integrated assessment model.

58 GEOSCIENCES↗

Fourier-Bessel Particle-In-Cell (FBPIC) v0.1.0

The Fourier-Bessel Particle-In-Cell code is a scientific simulation software for relativistic plasma physics. It is a Particle-In-Cell code whose distinctive feature is to use a spectral decomposition in cylindrical geometry. This decomposition allows to combine the advantages of spectral 3D Cartesian PIC codes (high accuracy and stability) and those of finite-difference cylindrical PIC codes with azimuthal decomposition (orders-of-magnitude speedup when compared to 3D simulations). The code is built on Python and can run both on CPU and GPU (the GPU runs being typically 1 or 2 orders of magnitude faster than the corresponding CPU runs.) The code has the exact same output format as the open-source PIC codes Warp and PIConGPU (openPMD format: openpmd.org) and has a very similar input format as Warp (Python script with many similarities). There is therefore tight interoperability between Warp and FBPIC, and this interoperability will increase even more in the future.

Lehe, Remi↗

Large language model evaluation for high–performance computing software development

We apply AI-assisted large language model (LLM) capabilities of GPT-3 targeting high-performance computing (HPC) kernels for (i) code generation, and (ii) auto-parallelization of serial code in C ++, Fortran, Python and Julia. Our scope includes the following fundamental numerical kernels: AXPY, GEMV, GEMM, SpMV, Jacobi Stencil, and CG, and language/programming models: (1) C++ (e.g., OpenMP [including offload], OpenACC, Kokkos, SyCL, CUDA, and HIP), (2) Fortran (e.g., OpenMP [including offload] and OpenACC), (3) Python (e.g., numpy, Numba, cuPy, and pyCUDA), and (4) Julia (e.g., Threads, CUDA.jl, AMDGPU.jl, and KernelAbstractions.jl). Kernel implementations are generated using GitHub Copilot capabilities powered by the GPT-based OpenAI Codex available in Visual Studio Code given simple + + prompt variants. To quantify and compare the generated results, we propose a proficiency metric around the initial 10 suggestions given for each prompt. For auto-parallelization, we use ChatGPT interactively giving simple prompts as in a dialogue with another human including simple “prompt engineering” follow ups. Results suggest that correct outputs for C++ correlate with the adoption and maturity of programming models. For example, OpenMP and CUDA score really high, whereas HIP is still lacking. We found that prompts from either a targeted language such as Fortran or the more general-purpose Python can benefit from adding language keywords, while Julia prompts perform acceptably well for its Threads and CUDA.jl programming models. Finally, we expect to provide an initial quantifiable point of reference for code generation in each programming model using a state-of-the-art LLM. Overall, understanding the convergence of LLMs, AI, and HPC is crucial due to its rapidly evolving nature and how it is redefining human-computer interactions.

97 MATHEMATICS AND COMPUTING↗

ENDFtk: A robust tool for reading and writing ENDF-formatted nuclear data

ENDFtk is a recently developed C++ and Python interface to interact with ENDF-6 formatted nuclear data files. It provides a robust and complete interface, allowing the reading and writing of all formats currently part of the ENDF-6 formats manual, as well as some non-ENDF formats used by the NJOY processing code. It provides an interface that mimics the names in the ENDF-6 formats manual as well as an equivalent interface using human-readable attribute names. It is robust and powerful enogh for nuclear data experts to develop complex applications, while also simple enough to be used non-experts to retrieve and manipulate evaluated nuclear data. ENDFtk offers the ability to easily interrogate and manipulate data either in large-scale code projects or in simple Python scripts. Here, in this paper, a brief overview of the interface is given, as well as more substantial examples demonstrating plotting simple data, interacting with more complex data, and writing new data to files. ENDFtk is open source and available for download via GitHub (https://github.com/njoy/ENDFtk).

97 MATHEMATICS AND COMPUTING↗

Rigorous Two-Step Activation for Fusion Systems with PyNE - Paper 127

In fusion systems, high energy neutrons activate system components. After shutdown, the biological dose rate from photons emitted from these components must be estimated as a function of position and time for maintenance planning. High resolution results can be obtained using the mesh-based Rigorous Two-Step (R2S) method. A neutron transport simulation provides mesh-based neutron fluxes. Using these fluxes and an appropriate irradiation scenario, a nuclear inventory analysis code is used to determine the photon source density within each mesh volume element at any decay time after shutdown. The photon source density mesh is used as a source for photon transport. Photon fluxes are tallied at positions of interest and flux-to-dose rate conversion factors are used to estimate the biological dose rate. Previous work by the authors involved the creation of R2S-ACT, an open source R2S workflow, using the Direct Accelerated Geometry Monte Carlo (DAGMC) version of MCNP5 (DAG-MCNP5) for both transport steps and the ALARA nuclear inventory analysis code. Various use cases may require different combinations of transport and activation codes, and nearly all of the capabilities of R2S-ACT have broader utility. For these reasons, the individual components of R2S-ACT were reimplemented within PyNE. PyNE is a collaborative, trans-institutional, open source project consisting of Python, Cython, and C++ code pertinent to nuclear simulations and analysis. This work involved additions to the PyNE mcnp, mesh, material, alara, dagmc, and sampling modules. A lightweight r2s module was then added to connect the code from these modules. The r2s and sampling modules, together with DAG-MCNP5 and ALARA form a complete R2S workflow for obtaining shutdown dose rate results. Mesh operations, geometry discretization, physics code input/output parsing, and mesh-based source sampling capabilities have been added to PyNE generically, eliminating the need to duplicate this effort across multiple applications. The PyNE r2s module uses these capabilities to couple MCNP and ALARA to form an R2S workflow, which has been validated with the FNG shutdown dose rate benchmark. Future work will involve benchmarking the workflow using tetrahedral mesh and also non-analog sampling options. added so that they can be used interchangeably. This will allow for comparisons between results obtained by different physics codes with minimal human effort. Work will also be done to create and implement an importance sampling method for biasing neutron transport towards regions of phase space of high importance to photon dose rate tallies. This will improve the efficiency of obtaining shutdown dose rate results in large, highly-attenuating geometries. (authors)

61 RADIATION PROTECTION AND DOSIMETRY↗

Parallel Fenics Implementation of Block Solvers (pFibs)

This software is a Python package designed to act as an interface between FEniCS and PETSc to facilitate the construction and application of parallel block solvers/preconditioners. The original intent of this software was to help enable Battery and Wind Farm simulations for use on high performance computing systems. The code is written in Python and uses the petsc4py module to access the more advance features of the PETSc Krylov Solver. In essence, pFibs is an interface to make accessing these features more streamlined. Additionally, pFibs also provides a template for building custom Python based preconditioning algorithms.

Allen, Jeffery↗

ExactPack Documentation

For code verification, one compares the code output against known exact solutions. There are many standard test problems used in this capacity, such as the Noh and Sedov problems. ExactPack is a utility that integrates many of these exact solution codes into a common API (application program interface), and can be used as a stand-alone code or as a python package. ExactPack consists of python driver scripts that access a library of exact solutions written in Fortran or Python. The spatial profiles of the relevant physical quantities, such as the density, fluid velocity, sound speed, or internal energy, are returned at a time specified by the user. The solution profiles can be viewed and examined by a command line interface or a graphical user interface, and a number of analysis tools and unit tests are also provided. We have documented the physics of each problem in the solution library, and provided complete documentation on how to extend the library to include additional exact solutions. ExactPack’s code architecture makes it easy to extend the solution-code library to include additional exact solutions in a robust, reliable, and maintainable manner.

97 MATHEMATICS AND COMPUTING↗

Python/Lua Benchmarks

This is an adaptation of the pre-existing Scimark benchmark code to a variety of Python and Lua implementations. It also measures performance of the Fparser expression parser and C and C++ code on a variety of simple scientific expressions.

Busby, L.↗

Python/Lua Benchmarks

This is an adaptation of the pre-existing Scimark benchmark code to a variety of Python and Lua implementations. It also measures performance of the Fparser expression parser and C and C++ code on a variety of simple scientific expressions.

Busby, L.↗

Scientific Computational Imaging Code (SCICO)

Scientific Computational Imaging Code (SCICO) is a Python package for solving the inverse problems that arise in scientific imaging applications. Its primary focus is providing methods for solving ill-posed inverse problems by using an appropriate prior model of the reconstruction space. SCICO includes a growing suite of operators, cost functionals, regularizers, and optimization routines that may be combined to solve a wide range of problems, and is designed so that it is easy to add new building blocks. SCICO is built on top of JAX rather than NumPy, enabling GPU/TPU acceleration, just-in-time compilation, and automatic gradient functionality, which is used to automatically compute the adjoints of linear operators. An example of how to solve a multi-channel tomography problem with SCICO is shown in Figure 1. The SCICO source code is available from GitHub, and pre-built packages are available from PyPI. It has extensive online documentation, including API documentation and usage examples, which can be run online at Google Colab and binder.

97 MATHEMATICS AND COMPUTING↗

PyAlbany: A Python interface to the C++ multiphysics solver Albany

Albany is a parallel C++ finite element library for solving forward and inverse problems involving partial differential equations (PDEs). In this paper we introduce PyAlbany, a newly developed Python interface to the Albany library. PyAlbany can be used to effectively drive Albany enabling fast and easy analysis and post-processing of applications based on PDEs that are pre-implemented in Albany. PyAlbany relies on the library PyBind11 to bind Python with C++ Albany code. Here we detail the implementation of PyAlbany and showcase its capabilities through a number of examples targeting a heat-diffusion problem. In particular we consider the following: (1) the generation of samples for a Monte Carlo application, (2) a scalability study, (3) a study of parameters on the performance of a linear solver, and finally (4) a tool for performing eigenvalue decompositions of matrix-free operators for a Bayesian inference application.

97 MATHEMATICS AND COMPUTING↗

Development code for sensitivity and uncertainty analysis of input on the MCNPX for neutronic calculation in PWR core

This research was carried out on the development of code for uncertainty analysis is based on a statistical approach for assessing the uncertainty input parameters. In the butn-up calculation of fuel, uncertainty analysis performed for input parameters fuel density, coolant density and fuel temperature. This calculation is performed during irradiation using Monte Carlo N-Particle Transport. The Uncertainty method based on the probabilities density function. Development code is made in python script to do coupling with MCNPX for criticality and burn-up calculations. Simulation is done by modeling the geometry of PWR terrace, with MCNPX on the power 54 MW with fuel type UO2 pellets. The calculation is done by using the data library continuous energy cross-sections ENDF / B-VI. MCNPX requires nuclear data in ACE format. Development of interfaces for obtaining nuclear data in the form of ACE format of ENDF through special process NJOY calculation to temperature changes in a certain range.

21 SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLANTS↗

Inputs, Outputs and Plotting Scripts for paper Extending near-axis equilibria in DESC

Python scripts and outputs from the DESC and pyQSC/pyQIC codes used to create the results in the paper "Extending near-axis equilibria in DESC". The contained README file has the details of which scripts create which figures, as well as on what versions of the codes were used. The repo also contains python pickle (.p) files and .txt files with the data used to create each figure (which are used by the plotting scripts).

DESC↗

Calculation of machine precision second order derivatives using dual-complex numbers

It is well known that both complex and dual numbers can be employed to obtain machine precision first-order derivatives; however, neither, on their own, can compute machine precision 2nd order derivatives. To address this limitation, it is demonstrated in this paper that combined dual-complex numbers can be used to compute machine precision 1st and 2nd order derivatives. The dual-complex approach is simpler than utilizing multicomplex or hyper-dual numbers as existing dual libraries can be used as is or easily augmented to accept complex numbers, and the complexity of developing, integrating, and deploying multicomplex or hyper-dual libraries is avoided. The efficacy of this approach is demonstrated for both univariate and multivariate functions. Finally, source code examples using the Python, Julia, and Mathematica languages are provided as supplemental material.

97 MATHEMATICS AND COMPUTING↗

A Python Multiscale Thermochemistry Toolbox (pMuTT) for thermochemical and kinetic parameter estimation

Estimating the thermochemical properties of systems is important in many fields such as material science and catalysis. The Python multiscale thermochemistry toolbox (pMuTT) is a Python software library developed to streamline the conversion of ab-initio data to thermochemical properties using statistical mechanics, to perform thermodynamic analysis, and to create input files for kinetic modeling software. Its open-source implementation in Python leverages existing scientific codes, encourages users to write scripts for their needs, and allows the code to be expanded easily. The core classes developed include a statistical mechanical model in which energy modes can be included or excluded to suit the application, empirical models for rapid thermodynamic property estimation, and a reaction model to calculate kinetic parameters or changes in thermodynamic properties. In addition, pMuTT supports other features, such as Brønsted–Evans–Polanyi (BEP) relationships, coverage effects, and ab-initio phase diagrams.

37 INORGANIC, ORGANIC, PHYSICAL, AND ANALYTICAL CH↗