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 325 records · Page 18

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.↗

Development of Physics-Based Transition Models for Unstructured-Mesh CFD Codes Using Deep Learning Models

Predicting transition locations over a vehicle surface is of fundamental importance for many engineering applications. With the transition information, the Reynolds-averaged Navier-Stokes (RANS) computations can turn on the turbulence model at the right locations so that drag, lift and other aerodynamic quantities can be accurately predicted. In contrast to the popularity of RANS-based transition modeling in which transition onset is governed by the turbulence equations, physics-based transition models that account for instability waves within the boundary layer, thus more compliant to flow physics, only gained more attention in recent years. This paper describes the development of a new physics-based transition model based on either the linear stability theory (LST) or parabolized stability equations (PSE). The model is designed to communicate with a structured or unstructured-mesh RANS solver back and forth in order to more accurately compute transition fronts over a three-dimensional body. In the developed model, the Python suite of interface codes in conjunction with the LASTRAC software can be executed autonomously to produce transition onset locations for a given laminar or RANS-computed transitional state. In addition, as a proof of concept, the tool set consists of a deep learning neural network model that has been designed and trained to predict instability wave evolutions inside the boundary layer for various instability wave mechanisms across a selected speed range. A machine-learned intelligent profile interpolation model has also been devised to enable reliable instability-wave spectra predictions with just a few points in the mean flow profiles.

Transition Modeling↗

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↗

Design workflow of a symmetric traveling wave antenna for fast ion production on DD tokamaks

Initial computational plasma physics scoping and a finite element method antenna modeling design workflow for a symmetric center-fed high-field side high harmonic fast wave traveling wave array (TWA) antenna are reported here. The TWA is designed to generate a test population of fast deuterium ions in an existing D–D tokamak by heating neutral beam deuterium ions, accelerating them from 80 keV to several hundred keV. The resulting fast particles are tailored to mimic key reactor energetic particle parameters with regards to exciting Alfven eigenmode instabilities, allowing for a D–D tokamak like DIII-D or ASDEX-U to replicate reactor-relevant conditions experimentally. Initial scenario scoping for high single-pass absorption as well as good preferential fast ion damping relative to electron damping was completed using the ray-tracing/Fokker–Planck codes GENRAY and CQL3D. Python RF network analysis packages were used to create a custom TWA optimization tool to inform a COMSOL flat antenna design, and Petra-M was used to study cold plasma effects. The TWA produced by this workflow has several novel features when compared to previous TWA studies, including symmetric center feeding, and passive end straps for image current cancellation for reduced impurity production. We show here that the antenna design workflow can readily produce TWA antennas optimized for reflection coefficient, image current cancellation, and launched power spectrum shape; and that a population of fast ions can be generated in the correct region of parameter space, warranting future more detailed studies.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Linac Coherent Light Source data analysis using psana

Psana ( Photon Science Analysis ) is a software package that is used to analyze data produced by the Linac Coherent Light Source X-ray free-electron laser at the SLAC National Accelerator Laboratory. The project began in 2011, is written primarily in C++ with some Python, and provides user interfaces in both C++ and Python. Most users use the Python interface. The same code can be run in real time while data are being taken as well as offline, executing on many nodes/cores using MPI for parallelization. It is publicly available and installable on the RHEL5/6/7 operating systems.

Damiani, D.↗

ARM Data Integrator

The Atmospheric Radiation Measurement (ARM) Data Integrator (ADI) streamlines the development of scientific algorithms and analysis of time-series NetCDF data, and improves the content and consistency of the output data products produced by these algorithms. The framework automates the process of retrieving and preparing data for analysis, and allows users to design output data products through a graphical interface. It also provides a modular, flexible software development architecture that scientists can use to generate C, Python, and IDL source code templates that embed the pre and post processing logic allowing the scientist to focus on only their science. The input data, preprocessing, and output data specifications of algorithms are defined through a graphical interface and stored in a database. ADI implements workflow for data integration and supports user access to data through a library of software modules. Data preprocess capabilities supported include automated retrieval of data from input files, merging the retrieved data into appropriately sized chunks, and transformation of the data onto a common coordinate system grid. Through the graphical interface, users can view the details of both their data products and those in the ARM catalog and allows developers to use existing data product to build new data products. Views of the output data products include an overlay of how the design meets ARM archive's data standards providing the user with a visual cue indicating where their output violates an archive standard. The ADI libraries access the information provided through the GUI via a Postgres database. The ADI framework and its supporting components can significantly decrease the time and cost of implementing scientific algorithms while improving the ability of scientists to disseminate their results.

Source record↗

SPRFSim

SPRFSim is a code that performs RF/Beam interaction simulations for an ion LINAC. The input files can be constructed from scratch or parsed from PARMELA or TraceWin simulations. The code is written in Python, and relies on matplotlib and numpy.

Edelen, Jonathan↗

Solar System Initial Abundnace Reader

This code is a simply python module that allows the user to read in the solar system value from a provided database. It simply reads in the database, and calculates ratios with various values. Currently, the solar system values from Lodders et al. (2009) are solely included. The tool is designed to assist a astrophysics / cosmochemist user in their daily life of calculating those ratios for programs and was written by the author to simplify his own life. A setup.py routine has been written as well. Release is anticipated via github as well as in the form of a pypi package.

Trappitsch, RetoG.↗

GEOPHIRES v2.0

GEOPHIRES v2.0 is a geothermal techno-economic simulation tool upgraded from GEOPHIRES v1.2. The name stands for "GEOthermal energy for Production of Heat and electricity (“IR”) Economically Simulated". GEOPHIRES combines reservoir, wellbore, and surface plant technical models with cost correlations and levelized cost models to estimate the capital and operation and maintenance costs, instantaneous and lifetime energy production, and overall levelized cost of energy of a geothermal plant. In addition to electricity generation, direct-use heat applications and combined heat and power or cogeneration can be modeled. Various upgrades have been implemented to develop GEOPHIRES v2.0, including: updating the built-in cost correlations, coupling to the external reservoir simulator TOUGH2, enhancing the built-in wellbore simulator, converting the programming language to Python, and making the code open-source. Users are encouraged to build upon the tool, e.g. by implementing their own correlations or coupling to other simulators.

Beckers, Koenraad↗

SNL Fugu to IBM's TrueNorth Corelet Programming Environment Transcompiler

This code is written in python and will take a defined network x graph and return a MATLAB file that defines a Truenorth Corelet of the network x graph. The network x graph is designed to be based on the FUGU specification (an internally developed Sandia spiking network definition). SAND2020-12195 M Sandia National Laboratories is a multimission laboratory managed and operated by National Technology & Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525.

Hill, Aaron↗

CEGANN: CRYSTAL EDGE GRAPH ATTENTION NEURAL NETWORK

SF-22-156 Machine learning (ML) models and applications in materials design and discovery typically involve the use of feature representations or descriptors followed by a learning algorithm that maps them to user desired properties of interest. Most popular mathematical formulation-based descriptors are not unique across atomic environments and suffer from transferability issues across different application domains and/or material classes. The CEGANN code provides a unified interface to facilitate material characterization across materials across multiple scales (from atomic to mesoscale) and diverse classes of materials ranging from metals oxides, non-metals, and even hierarchical materials such as zeolites and semi ordered materials such as mesophases. CEGANN implements a Graph Attention Network (GAT) type convolution architecture. The details of network architecture can be found in the paper https://doi.org/10.48550/arXiv.2207.10168. The software comes with pretrained examples and dataset for the classification of the following representative systems: (1) Structure-level representation such as space group (2) Structural dimensionality (e.g., bulk, 2D, clusters etc.) (3) Grain boundary identification (4) Nucleation and growth of a zeolite polymorph (5) Characterization of binary mesophases and their phase transitions (6) Growth of ice. The code is written in python programming language.

CHAN, HENRYT↗

A Data Processing Pipeline To Extract A Knowledge Graph From Sec Documents For Socio-technical Analysis Of Critical Infrastructure Influence

The code is written in Python and consists of the following pipeline that is implemented in Apache Airflow. This pipeline intends to understand the companies that are directly or indirectly involved with a type of critical infrastructure system at some point in that system's lifecycle. The pipeline takes a configuration file that specifies a list of initial companies to consider, a geographic region of interest (disk) expressed as a latitude/longitude point and distance, and a set of SEC form types from which to extract entities and relations. There are three main components to this pipeline as currently implemented: Social Network Extraction, Critical Infrastructure Network Extraction, and Inference and Fusion. First, Social Network Extraction, implemented as the `organizations_sec` component of the workflow graph queries the SEC EDGAR webservice using the list of initial companies from the configuration file. Given this, it extracts metadata that documents the number of each type of form for the given set of companies and their location. This forms metadata represents a catalog of data sources for the extracted social network knowledge graph. The pipeline then downloads these forms from the website and saves them in a build directory for further processing. These documents are then parsed for entities and relations. Second, the Critical Network Extraction component extracts entities and relations for a critical infrastructure sector. Currently, we focus on Electric Vehicle charging stations and this information is available via the Department of Energy (DOE) database on fueling stations maintained by NREL. Third, the Inference and Fusion component relates the social network graph to the critical infrastructure graph in order to understand the impact of a company within a geographic region. Relations include ownership of the EV Charging Station asset as well as maintenance/ownership of the EV payment networks. The fused network can be represented in many ways and currently we emit a knowledge graph.

Weaver, GabrielA.↗