Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “PYTHON”

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 559 records · Page 31

CCSI Toolset 3.21 Release

CCSI Toolset 3.21 Release Highlights Parallelization support was added for Sequential Design of Experiments (SDOE) computations using Dask (preliminary). Input type dependent ordering capability was added to the SDOE module. With this implementation the user can specify the level of difficulty to change an input (Easy or Hard) and FOQUS will generate the appropriate ordered design depending on the input difficulty combination. Python version support was extended. FOQUS is now compatible with Python 3.8 through 3.12. Platforms used for automated testing were expanded to include macOS ARM (Apple Silicon). Updates to the FOQUS documentation to include information on how to set paths for SimSinter and TurbineLite. Turbine configuration section was added to Debugging Documentation.

AS↗

rabpro: global watershed boundaries, river elevation profiles, and catchment statistics

River and Basin Profiler (rabpro) is a Python package to delineate watersheds, extract river flowlines and elevation profiles, and compute watershed statistics for any location on the Earth’s surface. As fundamental hydrologically-relevant units of surface area, watersheds are areas of land that drain via aboveground pathways to the same location, or outlet. Delineations of watershed boundaries are typically performed on digital elevation models (DEMs) that represent surface elevations as gridded rasters. Depending on the resolution of the DEM and the size of the watershed, delineation may be very computationally expensive. With this in mind, we designed rabpro to provide user-friendly workflows to manage the complexity and computational expense of watershed calculations given an arbitrary coordinate pair. In addition to basic watershed delineation, rabpro will extract the elevation profile for a watershed’s mainchannel flowline. This enables the computation of river slope, which is a critical parameter in many hydrologic and geomorphologic models. Finally, rabpro provides a user-friendly wrapper around Google Earth Engine’s (GEE) Python API to enable cloud-computing of zonal watershed statistics and/or time-varying forcing data from hundreds of available datasets. Altogether, rabpro provides the ability to automate or semi-automate complex watershed analysis workflows across broad spatial extents.

54 ENVIRONMENTAL SCIENCES↗

cppTPSA/pyTPSA: a C++/Python package for truncated power series algebra

The truncated power series algebra (TPSA), also referred to as differential algebra (DA), is a well-established and widely used method in particle accelerator physics and astronomy. The most straightforward usage of TPSA/DA is to calculate the Taylor expansion of a given function at a specific point up to order ?. In recent years, as the application of TPSA/TA has been extended to other fields, a reusable implementation of TPSA/DA as a modern C++ library or other high level programming language like Python has become desirable. The cppTPSA package implements TPSA/DA in C++11 and provides developers a convenient library with which to build advanced TPSA/DA-based methods. A Python 3 library, pyTPSA, has also been developed based on the C++ lib.

97 MATHEMATICS AND COMPUTING↗

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↗

xesn: Echo state networks powered by Xarray and Dask

Xesn is a Python package that allows scientists to easily design Echo State Networks (ESNs) for forecasting problems. ESNs are a Recurrent Neural Network architecture introduced by Jaeger (2001) that are part of a class of techniques termed Reservoir Computing. One defining characteristic of these techniques is that all internal weights are determined by a handful of global, scalar parameters, thereby avoiding problems during backpropagation and reducing training time significantly. Because this architecture is conceptually simple, many scientists implement ESNs from scratch, leading to questions about computational performance. Xesn offers a straightforward, standard implementation of ESNs that operates efficiently on CPU and GPU hardware. The package leverages optimization tools to automate the parameter selection process, so that scientists can reduce the time finding a good architecture and focus on using ESNs for their domain application. Importantly, the package flexibly handles forecasting tasks for out-of-core, multi-dimensional datasets, eliminating the need to write parallel programming code. Xesn was initially developed to handle the problem of forecasting weather dynamics, and so it integrates naturally with Python packages that have become familiar to weather and climate scientists such as Xarray (Hoyer & Hamman, 2017). However, the software is ultimately general enough to be utilized in other domains where ESNs have been useful, such as in signal processing (Jaeger & Haas, 2004).

97 MATHEMATICS AND COMPUTING↗

Developing a Prototype Methodology to Rank CO2-EOR Wells and Assess Their Reuse Potential for Geologic Carbon Storage

This paper presents a prototype methodology to assess the possible transition of Class II carbon dioxide-enhanced oil recovery (CO2-EOR) wells to Class VI wells. The focus is on wellbore construction materials—casing, cement, tubing, and the packer—and includes comprehensive workflows to evaluate these materials, with primary emphasis on compliance with Environmental Protection Agency (EPA) Class VI well construction and conversion guidelines. These workflows systematically assess material properties and performance criteria to ensure regulatory compliance and optimize long-term wellbore integrity and functionality. Utilizing Python scripts and JavaScript Object Notation (JSON) representations, the study automates checks on digitized Texas Railroad Commission (TRRC) data to rank wells based on workflow criteria. By emphasizing critical factors such as casing integrity, cementing techniques, tubing compatibility, and packer selection, the methodology helps well owners and operators prioritize wells for potential reuse as CO2 injection wells. Given limitations in digitized data, manual user verification is required in some sections. Future improvements include integrating non-digitized data through web scraping and machine learning techniques. This research serves as a practical guide for stakeholders, supporting environmental compliance and sustainable well operations.

geologic carbon sequestration↗

PETSc Users Manual (Rev. 3.13)

This manual describes the use of PETSc for the numerical solution of partial differential equations and related problems on high-performance computers. The Portable, Extensible Toolkit for Scientific Computation (PETSc) is a suite of data structures and routines that provide the building blocks for the implementation of large-scale application codes on parallel (and serial) computers. PETSc uses the MPI standard for all message-passing communication. PETSc includes an expanding suite of parallel linear solvers, nonlinear solvers, and time integrators that may be used in application codes written in Fortran, C, C++, and Python. PETSc provides many of the mechanisms needed within parallel application codes, such as parallel matrix and vector assembly routines. The library is organized hierarchically, enabling users to employ the level of abstraction that is most appropriate for a particular problem. By using techniques of object-oriented programming, PETSc provides enormous flexibility for users. PETSc is a sophisticated set of software tools; as such, for some users it initially has a much steeper learning curve than a simple subroutine library. In particular, for individuals without some computer science background, experience programming in C, C++, python, or Fortran and experience using a debugger such as gdb or dbx, it may require a significant amount of time to take full advantage of the features that enable efficient software use. However, the power of the PETSc design and the algorithms it incorporates may make the efficient implementation of many application codes simpler than \rolling them" yourself.

97 MATHEMATICS AND COMPUTING↗

Coastal Typologies: Methods for Improving Representation of Arctic Coastal Environments, Starting with Alaska's Northern Slope [Slides]

The objectives of the project included: Broaden QGIS (mapping) and Python (data analysis) skill set; Contribute to overall development of coastal typologies by conducting data mining and analysis; Expand scientific literacy; Narrow data sources to those most useful for project; Convert chosen data sets into image formats for analysis; and, Utilize python to analyze images.

58 GEOSCIENCES↗

Multi-Model and Multi-Scale Global Sensitivity Analysis for Identifying Controlling Processes of Complex Systems

An environmental model consists of multiple process level sub-models, and each sub-model represents a process that is key to the operation of the simulated system. Global sensitivity analysis methods have been widely used to identify important processes for system model development and improvement. The existing methods of global sensitivity analysis only consider parametric uncertainty, and are not capable of handling model uncertainty caused by multiple process models that arise from competing hypotheses about one or more processes. To address this problem, this project develops a new method to probe model output sensitivity to competing process models by integrating model averaging methods with variance-based global sensitivity analysis to address uncertainty in process models and parameters. The new method yields three process sensitivity indices. The first one is called first-order process sensitivity index, and it is derived as a single summary measure of relative process importance. Evaluating the index is computationally expensive, because it relies in a Monte Carlo scheme that requires thousands and even millions of model executions. To reduce computational cost, this project develops a computationally efficient, quasi Monte Carlo method, and this method is presented in Chapter 2 of this report with and a numerical example for demonstration. The numerical example shows that the results of the quasi Monte Carlo method are substantially close to those of the full Monte Carlo method, but the computational cost of the quasi Monte Carlo method is only 0.7% of that of the full Monte Carlo method. The second index is called total-effect process sensitivity index, and it measures interactions between different processes. Therefore, this sensitivity index includes the first-order process sensitivity index, and can be used to identify influential processes. On the other hand, the total-effect process sensitivity index can also be used to screen non-influential processes. This is demonstrated by two numerical examples using the Sobol-G* functions and groundwater flow models that consider recharge process, geological process, and snowmelt process. The numerical examples shows that the total-effect process sensitivity index is more informative than the first-order process sensitivity. The derivation of the process sensitivity index and the numerical examples are discussed in Chapter 3. Chapter 4 presents two computationally efficient methods for screening non-influential processes to exclude them from further investigation. The two methods are the multi-model difference-based sensitivity (MMDS) analysis method, which can be implemented using the Latin Hypercube Sampling. The second one is the implementation of MMDS method using a binning method. The numerical example for the Sobol-G* function indicates the two methods are capable of identifying non-influential models, and the numerical examples for the groundwater flow and reactive transport show that the two methods are effective for groundwater problems. However, it should be noted that the two methods are numerical approximations, and they can only be used for screening non-influential processes, not for ranking importance of system processes. All the sensitivity analysis methods are implemented by developing python codes, and the codes are in a software called SAMMPY: a python package for process sensitivity analysis under multiple models. The SAMMPY design and structure are discussed in Chapter 5, and the package is released to the public for free download.

54 ENVIRONMENTAL SCIENCES↗

Thermal Energy Storage Model Development within the Integrated Energy Systems Hybrid Repository

This publication details newly created energy storage models developed within the HYBRID Modelica repository as part of the Department of Energy Office of Nuclear Energy (DOE-NE) Integrated Energy Systems (IES) program, led by Idaho National Laboratory (INL). Model development to-date includes creation of dynamic systems-level models of concrete, latent heat, and packed-bed thermocline energy storage technologies for deployment in the IES-based HYBRID repository. Models are developed using the latest publicly available data and incorporate the possibility of control strategy inclusion for use with the existing IES modeling, analysis, and optimization toolset. Simulations showcase the abilities of each technology to cyclically charge and discharge when exposed to time-varying boundary conditions. In addition, low-level surrogate models for some of the thermal energy storage technologies were created using Python. These lower order Python files are much cheaper to run (i.e., computationally faster) and thus operate well when incorporated within the stochastic optimization problems run for the IES program. Moreover, economic data was collected for use within the INL-developed Framework for Optimization of ResourCes and Economics (FORCE). This information is incorporated within the FORCE platform. This work has resulted in creation of systems-level models for concrete, latent heat, and thermocline thermal energy storage systems with associated control systems. Now that these models are available, they can be utilized within different integrated energy park concepts to understand optimal system operation, control, and dispatching. Moreover, given the generic nature of the models, industrial partner technologies (e.g., Storworks Power, EnergyNest) can be quickly added to the repository using the existing models as a basis. Additional dynamic models for thermal energy storage concepts can be developed and added to the HYBRID repository as needed.

25 ENERGY STORAGE↗

NRAP-Open-IAM: Open Wellbore Component (V.2.0)

The Open Wellbore component of NRAP-Open-IAM is applicable to the calculation of Area of Review at a carbon storage site and fast estimation of dense gas dispersion from multiple continuous CO 2 surface leakage sources for risk assessment. The Open Wellbore Component of NRAP-Open-IAM is a lookup table model based on the drift-flux approach. The National Research Assessment Partnership’s second-generation integrated assessment model, NRAP-Open-IAM, is open-source software written in Python for use in performance and quantitative risk assessment of geologic carbon storage (GCS) systems. The look-up table for open well leakage is an updated version the previous model which provides finer resolution of reservoir depth and more accurate fluid properties than the previous open well look-up table, especially in calculating the gas (CO 2 -rich) phase properties. The component model input parameters include the reservoir transmissivity, aquifer transmissivity, brine salinity, well radius, and well top and bottom depths. The reservoir transmissivity and brine salinity were set to values consistent with the reservoir component, and the well top and bottom depths varied with location. The possible outputs from the Open Wellbore component are leakage rates of CO 2 and brine to either an aquifer or atmosphere, depending on the depth of the well top. Several python test scripts are presented that demonstrate that the Open Wellbore component works correctly. Use of the open wellbore model in NRAP-Open-IAM may result in a large CO 2 leakage rates, comparable to the leakage rates of CO 2 blow out.

54 ENVIRONMENTAL SCIENCES↗

PDQ Users Manual. Manual Version 2, for PDQ Code Version 1.20

PDQ is a tool for the management of the input and execution of batch jobs for simulation codes that use a text based input system. It accomplishes this goal by operating at two levels. First, it takes input file templates (commonly known at LANL as input deck templates) and creates multiple instantiations by performing substitutions of data from table files into symbols (variables) found in the template. Second, it provides commands to submit the created files to the SLURM batch system for execution. These two activities taken together produce a whole that is greater than the sum of its parts and provides an elegant way of executing studies across multiple similar simulations while minimizing the risk of typographical errors in the input files. PDQ was originally developed as a job management system called XVS by Jeff McAninch while he was at LANL. Besides the capabilities described here, XVS had many other features specific for interactions with particular simulation codes. After Jeff’s departure, maintenance of XVS was taken over by Rendell Carver; he added some new features as well as kept it functioning as the batch system at LANL was changed from LSF to MOAB to SLURM. In 2017, Rob Pelak decided to develop a different version that removed the additional features (many of which were rendered obsolete with the retirement of the simulation code or batch system that they supported) and produced a cleaner “bare bones” version of XVS. A few other behaviors of XVS that Rob found irksome were altered. Rob gave the resulting code a new name: PDQ. In 2022 Danielle McDermott developed a version that runs under Python 3.X. As suggested by Rob, she used the python2to3 utility to identify most changes. Given that PDQ continues to operate with Python version 2.7 we have advanced the version number to 1.20.

97 MATHEMATICS AND COMPUTING↗

Crosslink V.0.11.x User Manual

CrossLink is a novel two-dimensional and three-dimensional geometry and mesh generation software package developed by the Simulation Tools team at Los Alamos National Laboratory. This software represents the third generation of topology-based mesh generation technology developed by the Department of Defense and the Department of Energy with a special focus on complex multi-material hydrodynamic applications, mesh scalability, and high-order element mesh generation. The topology-based meshing approach offered by CrossLink enables users to quickly and easily mesh complex geometries in a repeatable and robust manner. CrossLink’s topology-based meshing approach is well-suited for parametric design studies, parametric design optimization, damage scenario assessment, and iterative design modification (i.e. feature addition and/or removal). CrossLink’s python API allows workflow scripting of the geometry creation and mesh generation process for traceability, repeatability, data provenance, and version control. CrossLink consists of three main components: a graphical user interface (GUI), a geometry creation and mesh generation engine, and a python API that provides a workflow scripting interface to the geometry and meshing functions.

97 MATHEMATICS AND COMPUTING↗

Unified Language Frontend for Physic-Informed AI/ML

Artificial intelligence and machine learning (AI/ML) are becoming important tools for scientific modeling and simulation as in several other fields such as image analysis and natural language processing. ML techniques can leverage the computing power available in modern systems and reduce the human effort needed to configure experiments, interpret and visualize results, draw conclusions from huge quantities of raw data, and build surrogates for physics based models. Domain scientists in fields like fluid dynamics, microelectronics and chemistry can automate many of their most difficult and repetitive tasks or improve the design times by use of the faster ML-surrogates. However, modern ML and traditional scientific highperformance computing (HPC) tend to use completely different software ecosystems. While ML frameworks like PyTorch and TensorFlow provide Python APIs, most HPC applications and libraries are written in C++. Direct interoperability between the two languages is possible but is tedious and error-prone. In this work, we show that a compiler-based approach can bridge the gap between ML frameworks and scientific software with less developer effort and better efficiency. We use the MLIR (multi-level intermediate representation) ecosystem to compile a pre-trained convolutional neural network (CNN) in PyTorch to freestanding C++ source code in the Kokkos programming model. Kokkos is a programming model widely used in HPC to write portable, shared-memory parallel code that can natively target a variety of CPU and GPU architectures. Our compiler-generated source code can be directly integrated into any Kokkosbased application with no dependencies on Python or cross-language interfaces.

71 CLASSICAL AND QUANTUM MECHANICS, GENERAL PHYSIC↗

Real-Time Optimization Workflow Status Update

Economically optimal and safe operation of integrated energy systems (IES) requires optimization at many different time scales. A real-time optimization (RTO) workflow will attempt to maximize revenue and minimize operational costs on a time scale of minutes to hours. Such a workflow requires the use of a digital twin (DT), which is a virtual representation of a physical system. The DT is updated using real-time data from the physical system, and serves as a model in an optimization framework. The optimization results are then sent back to the physical system to complete the loop. This report details the progress made in developing building blocks for a DT/RTO framework. The Risk Analysis Virtual Environment (RAVEN) platform within the Framework for Optimization of Resources and Economics (FORCE) tool suite can perform many of the tasks required for building a DT and performing RTO. The first item of this report details RAVEN enhancements that enable RAVEN workflows to be run in various environments. Data communication between the physical system and its DT is essential for successful RTO. This includes preprocessing real-time data, loading data into a data warehouse, and querying the stored data. The second section of this report describes the progress made in implementing an adapter in Python in order for Deep Lynx to handle the data communication. Typical dispatch optimization frameworks are built on linear programming (LP). The prototype RTO workflow developed in this report uses an LP problem as a part of a receding-horizon- or economic model predictive control (EMPC) based optimization. The third section of this report details the framework of an RTO workflow in which the system consists of a simple electrical storage device. A DT can be built from a reduced-order model (ROM). Integrating a ROM into a typical LP optimization framework has been challenging because most optimization packages require the user to write algebraic expressions for the system model. The final section of this report shows how an externally built RAVEN ROM can be integrated in an RTO framework by using the Python package Pyomo. This demonstrates the RTO workflow capability from a software-only perspective and is an important step in demonstrating the capability to implement an RTO workflow for a physical system.

97 MATHEMATICS AND COMPUTING↗

CrossLink: Geometry API [Slides]

The mesh generation process is very challenging and time consuming when working with complex CAD models. The process of creating and sorting geometric entities into groups appropriate for meshing is labor intensive and prone to error. In addition, the common data exchange formats such as STEP and IGES do not propagate information such as entity names that may be defined in the original model. Finally, entity counts change frequently with parameter variation as a result of tolerance-based geometry operations. Thus, sorting by index does not provide a robust and repeatable means for grouping. xGeom is a geometry library that enables the creation of NURBS curves and surfaces via a python scripting interface. xGeom is ideal for studying relatively simple models and is fully integrated with CrossLink’s mesh generation capabilities. For more complex models, xCAD is a python-based Creo Parametric CAD model driver that enables the model to be generated, queried, parametrically modified, regenerated, and exported without data loss and in a fully repeatable manner.

97 MATHEMATICS AND COMPUTING↗

Tools for Assessing Performance: FY23-Q1 Report [Slides]

LANL was tasked with working with NREL to implement QUIC within the TAP API by the end of Q1, FY2023. If QUICURB cannot be implemented in a way that it can be run outside of the QUIC platform, there will be no further R&D funding for QUIC development. QUIC includes a graphical user interface that imports and preprocesses the various input data streams (3D building databases, ambient wind, vegetation, etc.) and writes them in a format that the QUICURB Fortran executable requires. In order to interface with the TAP API, a Python script was developed that would replace the functionality previously only available within QUICGUI. LANL worked with NREL to test the Python script to ensure that it was operation and fulfilled the requirements.

58 GEOSCIENCES↗

PETSc/TAO Users Manual (Rev. 3.19)

This manual describes the use of the Portable, Extensible Toolkit for Scientific Computation (PETSc) and the Toolkit for Advanced Optimization (TAO) for the numerical solution of partial differential equations and related problems on high-performance computers. PETSc/TAO is a suite of data structures and routines that provide the building blocks for the implementation of large-scale application codes on parallel (and serial) computers. PETSc uses the MPI standard for all distributed memory communication. PETSc/TAO includes a large suite of parallel linear solvers, nonlinear solvers, time integrators, and opti mization that may be used in application codes written in Fortran, C, C++, and Python (via petsc4py; see Getting Started). PETSc provides many of the mechanisms needed within parallel application codes, such as parallel matrix and vector assembly routines. The library is organized hierarchically, enabling users to employ the level of abstraction that is most appropriate for a particular problem. By using techniques of object-oriented programming, PETSc provides enormous flexibility for users. PETSc is a sophisticated set of software tools; as such, for some users it initially has a much steeper learning curve than packages such as MATLAB or a simple subroutine library. In particular, for individuals without some computer science background, experience programming in C, C++, python, or Fortran and experience using a debugger such as gdb or lldb, it may require a significant amount of time to take full advantage of the features that enable efficient software use. However, the power of the PETSc design and the algorithms it incorporates may make the efficient implementation of many application codes simpler than “rolling them” yourself. For many tasks a package such as MATLAB is often the best tool; PETSc is not intended for the classes of problems for which effective MATLAB code can be written. There are several packages, built on PETSc, that may satisfy your needs without requiring directly using PETSc. We recommend reviewing these packages functionality before starting to code directly with PETSc. PETSc can be used to provide a “MPI parallel linear solver” in an otherwise sequential, or OpenMP parallel code. This approach cannot provide extremely large improvements in the application time by utilizing large numbers of MPI processes but can still improve the performance. Certainly all parts of a previously sequential code need not be parallelized but the matrix generation portion must be parallelized to expect true scalability to large numbers of MPI processes. See PCMPI for details on how to utilize the PETSc MPI linear solver server. Since PETSc is under continued development, small changes in usage and calling sequences of routines will occur. PETSc has been supported for twenty-five years; see mailing list information on our website for information on contacting support.

97 MATHEMATICS AND COMPUTING↗