Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “Python codes”

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 145 records · Page 8

SALSA_python (SALSython) v1

SALSA_python (Semi-Analytical Leakage Solutions for Aquifers) is a software that computed semi-analytical solutions for hydraulic head and brine leakage in multilayered aquifer–aquitard systems with geologic pressure forcing. It can simulate brine leakage into aquifers in a multi-aquifer-aquitard system with multiple injection and leaky wells. This situation is encountered in underground CO2 storage wherein brine leakage from pressurized reservoirs into aquifers is of concern. SALSA_python calls the original SALSA[1] subroutines in python by using the salsa2.so library. This enables the incorporation and coupling of SALSA computations into existing python-based codes and tools. SALSA_python is available for Linux and Mac operating systems. [1] Cihan, A., Oldenburg, C. M., & Birkholzer, J. T. (2022). Leakage from coexisting geologic forcing and injection-induced pressurization: A semi-analytical solution for multilayered aquifers with multiple wells. Water Resources Research, 58, e2022WR032343.

Bhuvankar, Pramod↗

stor4build

The EnergyPlus simulation engine supports modeling and simulation of thermal energy storage (TES) systems in several ways, including using the Python-EMS feature, which extends the operation of the engine with custom code written in Python. Creation of models using this feature can be tedious and error prone, with the connection of the model components to the Python code a particularly troublesome area. The stor4build Python package simplifies this process by modifying an input model to add a selected TES technology (implemented with the Python-EMS feature) and runs the simulation. The package leverages the OpenStudio middleware software development kit to automate this process as much as possible, eliminating potential errors and simplifying usage of EnergyPlus. The package provides objects, functions, and OpenStudio measures that implement the necessary operations to automate the creation of EnergyPlus models that integrate TES technologies with building systems. In addition, two user interfaces are provided: a command line interface and a web application programming interface. The automated process implemented by the package greatly simplifies the modeling and simulation process, allowing for parametric studies to be executed much more efficiently and effectively. The OpenStudio-based workflow is also very flexible and will allow for future additions of new technologies.

DeGraw, JasonWilliam [Oak Ridge National Laborator↗

\texttt{qec\_code\_sim}: An open-source Python framework for estimating the effectiveness of quantum-error correcting codes on superconducting qubits

Quantum computers are highly susceptible to errors due to unintended interactions with their environment. It is crucial to correct these errors without gaining information about the quantum state, which would result in its destruction through back-action. Quantum Error Correction (QEC) provides information about occurred errors without compromising the quantum state of the system. However, the implementation of QEC has proven to be challenging due to the current performance levels of qubits -- break-even requires fabrication and operation quality that is beyond the state-of-the-art. Understanding how qubit performance factors into the success of a QEC code is a valuable exercise for tracking progress towards fault-tolerant quantum computing. Here we present \texttt{qec\_code\_sim}, an open-source, lightweight Python framework for studying the performance of small quantum error correcting codes under the influence of a realistic error model appropriate for superconducting transmon qubits, with the goal of enabling useful hardware studies and experiments. \texttt{qec\_code\_sim} requires minimal software dependencies and prioritizes ease of use, ease of change, and pedagogy over execution speed. As such, it is a tool well-suited to small teams studying systems on the order of one dozen qubits.

Lopez, Santiago↗

Conceptual Spacer Design for the ATR GEN I Target for Pu-238 Production in the Advanced Test Reactor at Idaho National Laboratory

The initial target design used for Pu-238 production at Idaho National Laboratory was designed by Oak Ridge National Laboratory to optimize the production of Pu-238 in the High Flux Isotope Reactor (HFIR) and are referred to as HFIR GEN II targets. To take advantage of the Advanced Test Reactor’s (ATR) taller active core region a redesign of the HFIR GEN II targets was needed. It was proposed to stack two HFIR GEN II targets nose to nose about the core center line; however, this resulted in excessive neutron and photon heating in the pellets located in the center. This peak heating was not desirable so three alternative designs were investigated for the ATR GEN I targets. The python-based code, MCNP to ORIGEN2 in Python (MOPY), was used to calculate the heating rates after 40 days of irradiation to capture the effects of each configuration. The purpose of this paper is to document the details of these conceptual design calculations and comparisons for the ATR GEN I targets.

07 ISOTOPE AND RADIATION SOURCES↗

Conceptual Spacer Design for the ATR GEN I Target for Pu-238 Production in the Advanced Test Reactor at Idaho National Laboratory

The initial target design used for Pu-238 production at Idaho National Laboratory was designed by Oak Ridge National Laboratory to optimize the production of Pu-238 in the High Flux Isotope Reactor (HFIR) and are referred to as HFIR GEN II targets. To take advantage of the Advanced Test Reactor’s (ATR) taller active core region a redesign of the HFIR GEN II targets was needed. It was proposed to stack two HFIR GEN II targets nose to nose about the core center line; however, this resulted in excessive neutron and photon heating in the pellets located in the center. This peak heating was not desirable so three alternative designs were investigated for the ATR GEN I targets. The python-based code, MCNP to ORIGEN2 in Python (MOPY), was used to calculate the heating rates after 40 days of irradiation to capture the effects of each configuration. The purpose of this paper is to document the details of these conceptual design calculations and comparisons for the ATR GEN I targets.

07 ISOTOPE AND RADIATION SOURCES↗

Efficient Space–Time Reduced Order Model for Linear Dynamical Systems in Python Using Less than 120 Lines of Code

A classical reduced order model (ROM) for dynamical problems typically involves only the spatial reduction of a given problem. Recently, a novel space–time ROM for linear dynamical problems has been developed [Choi et al., Space–tume reduced order model for large-scale linear dynamical systems with application to Boltzmann transport problems, Journal of Computational Physics, 2020], which further reduces the problem size by introducing a temporal reduction in addition to a spatial reduction without much loss in accuracy. The authors show an order of a thousand speed-up with a relative error of less than 10−5 for a large-scale Boltzmann transport problem. In this work, we present for the first time the derivation of the space–time least-squares Petrov–Galerkin (LSPG) projection for linear dynamical systems and its corresponding block structures. Utilizing these block structures, we demonstrate the ease of construction of the space–time ROM method with two model problems: 2D diffusion and 2D convection diffusion, with and without a linear source term. For each problem, we demonstrate the entire process of generating the full order model (FOM) data, constructing the space–time ROM, and predicting the reduced-order solutions, all in less than 120 lines of Python code. We compare our LSPG method with the traditional Galerkin method and show that the space–time ROMs can achieve O(10−3) to O(10−4) relative errors for these problems. Depending on parameter–separability, online speed-ups may or may not be achieved. For the FOMs with parameter–separability, the space–time ROMs can achieve O(10) online speed-ups. Finally, we present an error analysis for the space–time LSPG projection and derive an error bound, which shows an improvement compared to traditional spatial Galerkin ROM methods.

97 MATHEMATICS AND COMPUTING↗

Electron transport in gaseous detectors with a Python-based Monte Carlo simulation code

Understanding electron drift and diffusion in gases and gas mixtures is a topic of central importance for the development of modern particle detection instrumentation. The industry-standard MagBoltz code has become an invaluable tool during its 20 years of development, providing capability to solve for electron transport (‘swarm’) properties based on a growing encyclopedia of built-in collision cross sections. We have made a refactorization of this code from FORTRAN into Cython, and studied a range of gas mixtures of interest in high energy and nuclear physics. The results from the new open source PyBoltz package match the outputs from the original MagBoltz code, with comparable simulation speed. An extension to the capabilities of the original code is demonstrated, in implementation of a new Modified Effective Range Theory interface. We hope that the versatility afforded by the new Python code-base will encourage continued use and development of the MagBoltz tools by the particle physics community.

97 MATHEMATICS AND COMPUTING↗

Validation and Verification of Python based Neutron Spectrum Unfolding Software

To validate and verify the python-based code (PySL), designed to replicate the programs used by STAYSL for Beam Correction Factor (BCF) and Self-Shielding Factor (SHIELD), a series of tests were performed. To test BCF a python script was written to generate a random flux history file and both versions of the code processed the data. The test verified matching values up to at least one decimal place, approximately 10,000 tests where run and each one passed. Isotopes began to fail the tests once neutron saturation was reached. To verify this the total time of exposure was varied the isotopes that failed were compared to a list of their half-lives. The test process for SHIELD was very similar but, in this case, the code began by producing an input file with varying thickness and device type/environment for the SHIELD input. The failure condition for this test was if any of the data points for an isotope had a difference above 3%. Approximately 40 of these tests were run and there were only 3 isotopes that had reoccurring failures but only 2% of their points were above the 3% difference. A visual comparison was conducted by plotting the results from both programs. Although the test failed, the differences between their values were minuscule, and the self-shielding factor’s shape was preserved when plotted. Next steps for this project will be validating and verifying the python-based SigPhi code and then reproducing and testing the least squares unfolding performed by STAYSL.

73 - NUCLEAR PHYSICS AND RADIATION PHYSICS↗

PsDNS

PsDNS is a Python package which makes it easy to solve partial differential equation using a pseudo-spectral method. The code uses Python classes and Numpy-like arrays to provide a simple interface with which users can construct equations, integrators, and diagnostics. It also includes implementation for common problems, in particular, the incompressible Navier-Stokes equation in a periodic domain, which is commonly used as a benchmark problem for turbulence research. PsDNS uses MPI to allow massively parallel computation for large problems.

Israel, Daniel↗

pyJSPEC - A Python Module for IBS and Electron Cooling Simulation

The intrabeam scattering is an important collective effect that can deteriorate the property of a high-intensity beam and electron cooling is a method to mitigate the IBS effect. JSPEC (JLab Simulation Package on Electron Cooling) is an open-source C++ program developed at Jefferson Lab, which simulates the evolution of the ion beam under the IBS and/or the electron cooling effect. The Python wrapper of the C++ code, pyJSPEC, for Python 3.x environment has been recently developed and released. It allows the users to run JSPEC simulations in a Python environment. It also makes it possible for JSPEC to collaborate with other accelerator and beam modeling programs as well as plentiful python tools in data visualization, optimization, machine learning, etc. In this paper, we will introduce the features of pyJSPEC and demonstrate how to use it with sample codes and numerical results.

Zhang, H.↗

UQpy v4.1: Uncertainty quantification with Python

This paper presents the latest improvements introduced in Version 4 of the UQpy, Uncertainty Quantification with Python, library. In the latest version, the code was restructured to conform with the latest Python coding conventions, refactored to simplify previous tightly coupled features, and improve its extensibility and modularity. To improve the robustness of UQpy, software engineering best practices were adopted. A new software development workflow significantly improved collaboration between team members, and continuous integration and automated testing ensured the robustness and reliability of software performance. Continuous deployment of UQpy allowed its automated packaging and distribution in system agnostic format via multiple channels, while a Docker image enables the use of the toolbox regardless of operating system limitations.

97 MATHEMATICS AND COMPUTING↗

Limits on wCDM from the EFTofLSS with the PyBird code

We apply the Effective Field Theory of Large-Scale Structure to analyze the wCDM cosmological model. By using the full shape of the power spectrum and the BAO post-reconstruction measurements from BOSS, the Supernovae from Pantheon, and a prior from BBN, we set the competitive CMB-independent limit $w=-1.046_{-0.052}^{+0.055}$ at 68% C.L. After adding the Planck CMB data, we find $w=-1.023_{-0.030}^{+0.033}$ at 68% C.L. Our results are obtained using PyBird, a new, fast Python-based code which we make publicly available.

79 ASTRONOMY AND ASTROPHYSICS↗

Curifactory: A research experiment manager

Curifactory is a command line tool and framework for organizing Python experiment code, configuration parameters, and results. It is an opinionated and lightweight approach to workflow management infrastructure and is primarily intended to support researchers conducting experiments on one machine. This software was developed to support the reproducibility of results for several data science projects in the Nuclear Nonproliferation Division at Oak Ridge National Laboratory. Curifactory is intended to be a general framework and is not specific to machine learning or data science. It can aid in any field in which experiments are primarily computation-based studies and can be implemented in Python (e.g., high-energy physics, astronomy, computational chemistry). Here, the design emphasizes the automated caching of intermediate data analysis artifacts to speed up development involving computationally intensive tasks. It also allows for data provenance and experiment reproduction. Individual experiment runs are tracked through logs and their output reports, and entire copies of a run with all cached data and metadata can be exported for others to run using Curifactory on another machine. Curifactory experiments can either be integrated into a project from the beginning or can be written on top of an existing codebase without needing significant modification. A few important views of the Curifactory library can be seen in Figure 1.

97 MATHEMATICS AND COMPUTING↗

INGRID: An interactive grid generator for 2D edge plasma modeling

A fusion boundary-plasma domain is defined by axisymmetric magnetic surfaces where the geometry is often complicated by the presence of one or more X-points; and modeling boundary plasmas usually relies on computational grids that account for the magnetic field geometry. The new grid generator INGRID (Interactive Grid Generator) presented in this work is a Python-based code for calculating grids for fusion boundary plasma modeling, for a variety of configurations with one or two X-points in the domain. INGRID first performs partitioning over the domain consisting of a small number of patches conforming to the magnetic field and wall geometry; then it generates a subgrid on each of the patches and joins them into a global grid. This domain partitioning strategy makes possible a uniform treatment of various configurations with one or two X-points in the domain. This includes single-null, double-null, and other configurations with two X-points in the domain. The INGRID design allows generating grids either interactively, via a parameter-file driven GUI, or using a non-interactive script-controlled workflow. Results of testing demonstrate that INGRID is a flexible, robust, and user-friendly grid-generation tool for fusion boundary-plasma modeling.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Machine learning guided optimal composition selection of niobium alloys for high temperature applications

Nickel- and cobalt-based superalloys are commonly used as turbine materials for high-temperature applications. However, their maximum operating temperature is limited to about 1100 °C. Therefore, to improve turbine efficiency, current research is focused on designing materials that can withstand higher temperatures. Niobium-based alloys can be considered as promising candidates because of their exceptional properties at elevated temperatures. The conventional approach to alloy design relies on phase diagrams and structure–property data of limited alloys and extrapolates this information into unexplored compositional space. In this work, we harness machine learning and provide an efficient design strategy for finding promising niobium-based alloy compositions with high yield and ultimate tensile strength. Unlike standard composition-based features, we use domain knowledge-based custom features and achieve higher prediction accuracy. We apply Bayesian optimization to screen out novel Nb-based quaternary and quinary alloy compositions and find these compositions have superior predicted strength over a range of temperatures. We develop a detailed design flow and include Python programming code, which could be helpful for accelerating alloy design in a limited alloy data regime.

Mohanty, Trupti (ORCID:0000000342701430)↗

Demonstration of TOFFEE: A Response Uncertainty Quantification Tool

A key characteristic in neutron transport is nuclear data. Cross-section uncertainty is not used in MCNP6.3 to propagate response uncertainty without external analysis. Here, the TOol For Fast Error Estimation (TOFFEE) is a Python-based code developed to automate the propagation of cross-section uncertainty for MCNP evaluations. TOFFEE implements the sandwich rule to calculate the uncertainty from cross sections with sensitivity coefficients from MCNP6.3 and ENDF/B covariance data. In this paper, TOFFEE has been tested with benchmark experiments, and it has been compared to the uncertainty quantification capabilities of Sampler and TSUNAMI, within SCALE, to verify the application’s capabilities.

97 MATHEMATICS AND COMPUTING↗

${\tt Warm}$SPy: a numerical study of cosmological perturbations in warm inflation

We present ${\tt Warm}$SPy, a numerical code in Python designed to solve for the perturbations' equations in warm inflation models and compute the corresponding scalar power spectrum at CMB horizon crossing. In models of warm inflation, a radiation bath of temperature T during inflation induces a dissipation (friction) rate of strength Q ∝ T c /Φ m in the equation of motion for the inflaton field Φ. While for a temperature-independent dissipation rate (c = 0) an analytic expression for the scalar power spectrum exists, in the case of a non-zero value for c the set of equations can only be solved numerically. For c > 0 (c < 0), the coupling between the perturbations in the inflaton field and radiation induces a growing (decaying) mode in the scalar perturbations, generally parameterized by a multiplicative function G(Q) which we refer to as the scalar dissipation function. Using ${\tt Warm}$SPy, we provide an analytic fit for G(Q) for the cases of c = {3,1,-1}, corresponding to three cases that have been realized in physical models. Compared to previous literature results, our fits are more robust and valid over a broader range of dissipation strengths Q ϵ [10 -7 ,10 4 ]. Additionally, for the first time, we numerically assess the stability of the scalar dissipation function against various model parameters, inflationary histories as well as the effects of metric perturbations. As a whole, the results do not depend appreciably on most of the parameters in the analysis, except for the dissipation index c, providing evidence for the universal behaviour of the scalar dissipation function G(Q).

79 ASTRONOMY AND ASTROPHYSICS↗

Implementation of a practical Markov chain Monte Carlo sampling algorithm in PyBioNetFit

Abstract Summary Bayesian inference in biological modeling commonly relies on Markov chain Monte Carlo (MCMC) sampling of a multidimensional and non-Gaussian posterior distribution that is not analytically tractable. Here, we present the implementation of a practical MCMC method in the open-source software package PyBioNetFit (PyBNF), which is designed to support parameterization of mathematical models for biological systems. The new MCMC method, am, incorporates an adaptive move proposal distribution. For warm starts, sampling can be initiated at a specified location in parameter space and with a multivariate Gaussian proposal distribution defined initially by a specified covariance matrix. Multiple chains can be generated in parallel using a computer cluster. We demonstrate that am can be used to successfully solve real-world Bayesian inference problems, including forecasting of new Coronavirus Disease 2019 case detection with Bayesian quantification of forecast uncertainty. Availability and implementation PyBNF version 1.1.9, the first stable release with am, is available at PyPI and can be installed using the pip package-management system on platforms that have a working installation of Python 3. PyBNF relies on libRoadRunner and BioNetGen for simulations (e.g. numerical integration of ordinary differential equations defined in SBML or BNGL files) and Dask.Distributed for task scheduling on Linux computer clusters. The Python source code can be freely downloaded/cloned from GitHub and used and modified under terms of the BSD-3 license (https://github.com/lanl/pybnf). Online documentation covering installation/usage is available (https://pybnf.readthedocs.io/en/latest/). A tutorial video is available on YouTube (https://www.youtube.com/watch?v=2aRqpqFOiS4&t=63s). Supplementary information Supplementary data are available at Bioinformatics online.

59 BASIC BIOLOGICAL SCIENCES↗