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 253 records · Page 14

Orbit-averaging and deposition accuracy for runaway electron beams in hybrid kinetic-MHD simulations of the runaway plateau

We develop a new procedure that combines the kinetic orbit runaway electron code (KORC) and the NIMROD extended-magnetohydrodynamic code to simulate runaway electrons (REs) in the post-disruption plateau. KORC integrates guiding-center orbits, with a barycentric-based binary search strategy providing initial guesses for the Newton–Raphson logical-to-physical coordinate inversion, ensuring reliable particle-to-mesh mapping in NIMROD, whose fields remain static for the present study. Samples are drawn in accord with experimental parallel current profiles of RE beams during the plateau phase. Deposition in NIMROD is verified through comparison with a Python-based finite-element code that ensures periodicity in the poloidal direction and continuity at the magnetic axis. Accurate representation of near-axis fields requires finer mesh resolution to prevent under- and overshoots in current density from orbit inaccuracies. Yet, at a fixed particle count, increasing mesh resolution amplifies statistical noise in the deposited fields. An orbit-averaging method accumulates partial current deposits over multiple kinetic steps and reduces the statistical noise with little added computational cost. By coupling kinetic routines from KORC directly into the NIMROD codebase, these developments lay essential groundwork for future self-consistent KORC–NIMROD coupling.

Algorithms and data structure↗

Modeling, Performance Assessment, and Nodal Data Analysis of TRISO-Fueled Systems with Shift

This technical report documents several enhancements to the Shift Monte Carlo (MC) code under the US Department of Energy (DOE) Nuclear Energy Advanced Modeling and Simulation (NEAMS) program in fiscal year (FY) 2022. Performance enhancements were added to Shift specifically for tristructural isotropic (TRISO)–fueled reactor systems and guided based on performance analysis in FY 2021. For the pebble performance model developed in previous studies, the runtime improved by ~ 91× compared to the original model and ~ 2× compared to the user-optimized model. Compared to Serpent, Shift is ~ 3× slower if Serpent delta-tracking is enabled but ~ 2× faster when delta-tracking is disabled. The multigroup cross section generation was improved through simplifying tally input definitions, porting several post-processing tally operations from Python scripts into the Shift code base, and accounting for production reactions in the scattering multiplicity. Progress was also made on two emerging capabilities: (1) the development of Titan (a Shift reactor physics user interface) and (2) initial investigation into path-length tallies for computing multigroup scattering matrices.

11 NUCLEAR FUEL CYCLE AND FUEL MATERIALS↗

Convective Parameters Derived from Radiosonde Data (SONDEPARAM) Value-Added Product Report

Radiosondes provide fundamental observations of the vertical profile of atmospheric state (pressure, temperature, humidity, and winds), with important implications for subsequent studies on environmental controls on cloud conditions. Within convective cloud environments, there is an increasing demand for additional value-added products (VAPs) to facilitate the use of U.S. Department of Energy Atmospheric Radiation Measurement (ARM) user facility radiosonde data sets. Such VAPs should provide quick and reliable estimates for several standard radiosonde parameters or quantities of interest using common assumptions, as well as open, flexible code for visualization and user interaction. The Convective Parameters Derived from Radiosonde Data (SONDEPARAM) VAP will apply several robust algorithms used in Wang et al. (2020) for the calculation of useful radiosonde convective cloud parameters, including the convective available potential energy (CAPE), convective inhibition (CIN), and other convective parameters, for several different assumptions regarding the initial parcel characteristics (i.e., surface-based, most unstable, mixed layer). These ARM VAP codes are developed in open, flexible Python formats, with the intention that these parameters/calculations will be incorporated into traditional ARM quick-look radiosonde plotting, yet associated with user-available codes for ease in user reproduction and assumption modification.

54 ENVIRONMENTAL SCIENCES↗

Evaluation of a collisional radiative model for electron temperature determination in hydrogen plasma

A collisional-radiative (CR) model that extracts the electron temperature, T e , of hydrogen plasmas from Balmer-line-ratio measurements is examined for the plasma electron density, n e , and T e ranges of 10 10 –10 15 cm –3 and 5–500 eV, respectively. The CR code, developed and implemented in Python, has a forward component that computes the densities of excited states up to n = 15 as functions of T e , n e , and the molecular-to-atomic neutral ratio r(H 2 /H). The backward component provides ne and r(H 2 /H) as functions of the Balmer ratios to predict the T e . The model assumes Maxwellian electrons. Furthermore, the density profiles of the electrons and of the molecular and atomic hydrogen neutrals are shown to be of great importance, as is the accuracy of the line-ratio measurement method.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

JPype

JPype is a Python module to provide full access to Java from within Python. It allows Python to make use of Java only libraries, exploring and visualization of Java structures, development and testing of Java libraries, scientific computing, and much more. By gaining the best of both worlds using Python for rapid prototyping and Java for strong typed production code, JPype provides a powerful environment for engineering and code development. This is achieved not through re-implementing Python, as Jython has done, but rather through interfacing at the native level in both virtual machines. This shared memory based approach achieves decent computing performance, while providing the access to the entirety of CPython and Java libraries.

Nelson, KarlE.↗

labquake_future_prediction

The labquake_future_prediction code is a collection of python modules and scripts that serves as supporting information for the article “Predicting future laboratory fault friction through deep learning” for publication in the journal of “Geophysical Research Letters”. It is designed to predict laboratory fault slips in the immediate future by scanning continuous acoustic emission (AE) waveforms recorded in laboratory biaxial shear experiments. The predictions are made with a deep learning model based on convolutional encoder-decoder (CED) models and the Transformer model primarily developed for Natural Language Processing (NLP). The deep learning model is trained with the tensorflow package using publicly available laboratory data sets in standard binary file format in numpy. The utility functions for reading data files, configuring model hyperparameters, constructing the CED and Transformer models, training and testing of the models are defined in python module files. The workflow of training the models for labquake future predictions and the multiple GPU’s rapid model hyperparameter optimization as described in the journal article, are demonstrated in accompanying python script files and Jupyter notebooks.

Wang, Kun↗

Control And Optimization Modular Modeling Application For Nuclear Deployment

The purpose of the COMMAND code is to provide a flexible, scalable tool for use in developing, integrating, and testing the technologies necessary for achieving autonomous operations of advanced nuclear reactors. The code enables users to efficiently implement custom simulations and experiments by combining key methods from different software modules. These modules are focused on: modeling and simulation tools, such as nuclear simulation tools used for high-fidelity modeling (e.g., Reactor Excursion and Leak Analysis Program [RELAP5-3D] and Monte Carlo N-Particle [MCNP]); machine learning and optimization tools (e.g., anomaly detection and data-driven modeling techniques); advanced control in its digital, high-performance, and supervisory control forms (e.g., proportional integral derivative (PID) control and model predictive control (MPC); and integration with hardware through industrial communication protocols. To ensure flexibility and scalability, COMMAND was designed to be both modular—the software “pieces” all inherit from generic building blocks and can be combined and connected to create complicated simulations—and high performing—designed for parallel processing, enabling simulations and experiments to take advantage of multi-core computers, servers, and nodes. The code is written in the Python programming language due to the language's popularity, active community, and open-source and cross-platform nature. Maintaining consistency with other simulation tools used within the nuclear energy community, users implement simulations and experiments through text input files, which define components, parameters, connections, etc., through lines of text. Given that COMMAND is written in Python, these input files are native Python scripts, and so use the standard Python structure and formatting. This also enables users to take advantage of Python's extensive package library to develop custom capabilities for their specific use cases.

Faber, Jacob [Idaho National Laboratory (INL), Ida↗

Emulsion droplets detection suite

The code is a set of Python libraries/scripts that leverage open source computer vision packages like YOLO and SAM2 to identify emulsion droplets in plate reader images and videos of microfluidic device flows.

Reddy, Tyler [LANL]↗

matsim-agents v1.0

matsim-agents is a multi-agent AI framework for atomistic materials simulation and discovery. It orchestrates large language models (LLMs), machine-learned interatomic potentials (MLIPs), and DFT codes into a single agentic loop running on laptops and DOE leadership-class supercomputers. MULTI-AGENT ORCHESTRATION A LangGraph state machine with three nodes: a Planner that converts a natural-language research objective into structured tasks; an Executor that dispatches atomistic tools and loops until the queue is empty; and an Analyst that summarizes results into a human-readable report. State is checkpointed after every step and human-in-the-loop gates can be inserted at any edge. HYPOTHESIS-DRIVEN DISCOVERY CHAT An interactive REPL (matsim-agents chat) that couples LLM dialogue with atomistic simulation. Chemical formulas are automatically detected in conversation turns and trigger a full crystal-phase exploration: structure generation → relaxation → stability scoring → result injection back into the conversation, creating a closed hypothesis-refinement loop. CRYSTAL PHASE ENUMERATION Given a composition, the phase explorer enumerates prototypes by stoichiometry: elemental (fcc/bcc/hcp/sc/diamond), binary 1:1 (rocksalt/CsCl/zincblende/ wurtzite/fluorite/rutile), ternary 1:1:3 (cubic perovskite), ternary 1:2:4 (perovskite + spinel), quaternary 1:1:2:6 (Fm-3m double perovskite). 2-D prototypes (graphene, h-BN, MoS2 2H/1T) and multilayer stacking are also supported via --include-2d and --num-layers. SUPERCELL GENERATION AND SITE DECORATION Auto-tiling to a minimum atom count (--min-atoms), explicit NxNxN tiling (--supercell), symmetry-distinct site decorations (--n-orderings), and isotropic lattice-scale sweeps (--lattice-scales) for volume bracketing. MLFF RELAXATION AND STABILITY SCORING HydraGNN (multi-headed GNN) drives structure relaxation via ASE with FIRE, BFGS, or BFGSLineSearch. Stability output: delta-E/atom ranking across phases and a max-residual-force dynamical-stability proxy. Other MLIPs (MACE, NequIP, Orb) can be plugged in through the same interface. DFT BACKENDS Quantum ESPRESSO pw.x and VASP 6.6 are first-class labellers. Both have validated GPU builds and SLURM/PBS launchers for three DOE platforms: Frontier (AMD MI250X, ROCm), Aurora (Intel PVC, oneAPI), Perlmutter (NVIDIA A100, CUDA). QE produces ~100 binaries (pw.x, ph.x, epw.x, ...). VASP supports scf, relax, vc-relax, and vc-relax-shape run types. ACTIVE-LEARNING LOOP matsim-agents al run CONFIG.yaml drives an iterative HydraGNN-DFT loop: MD generates candidates → ensemble/MC-dropout uncertainty selects the most informative → DFT labels them in parallel inside one allocation → dataset grows → HydraGNN retrains → repeat. DFT backend is a single YAML toggle (dft.backend: vasp | qe). LLM-generated seed structures are supported (no curated POSCAR library needed). Config uses ${VAR}, ${VAR:-default}, ${VAR:?msg} shell-style substitution for cross-user/cross-site portability. LLM BACKENDS Ollama (local, default), vLLM (HPC multi-GPU serving), OpenAI, Anthropic, HuggingFace Transformers+Accelerate. Selected at runtime via flag or env var with no code changes. HPC PORTABILITY Same Python entry points run on Frontier (ROCm 7.2), Aurora (oneAPI), and Perlmutter (CUDA 12). DFT and ML stacks are never co-loaded in the same shell; they couple through the scheduler and filesystem. Advanced multi-node launchers (serve, discovery-chat, single-relaxation, active-learning, QE warm-start) are provided for all three platforms. CODABENCH COMPETITION BUNDLE A self-contained benchmark: 159 atomistic test structures across 11 material classes, 5 tasks (formation energy, forces, ML relaxation, AI-DFT relaxation, phase stability ranking), public/private leaderboard split (30/70), and four ready-to-run baselines: MACE-MP-0, HydraGNN, UMA, AllScAIP.

Lupo Pasini, Massimiliano [Oak Ridge National Labo↗

ELM model simulations of Plum Island Ecosystems LTER low marsh site 2018-2020

Model simulations using the Department of Energy's Energy Exascale Earth System Model (E3SM) land model (ELM) with improved capabilities to represent vegetation response to salinity and inundation. The simulations were conducted for a tidal salt marsh at Plum Island Ecosystems Long Term Ecological Research (LTER) site near Rowley, Massachusetts, USA; the site is a low marsh dominated by Spartina alterniflora. The model was forced with site-specific meteorology, salinity and tidal cycles from 2018-2020. Four sets of model simulations are included and described below:1. Parameterization of the salinity response function. These simulations tested different combinations of values for optimal salinity and salinity tolerance.2. Model evaluation. This comparison conducted simulations using the default model, the salinity function only, the submergence function only, and both the salinity and submergence functions. 3. Salinity scenarios. These simulations used the 2018 salinity input data varied by -5 to +10 ppt salinity.4. Water level scenarios. These simulations used the tide height varied by -10 to +50 cm. These simulations were used to demonstrate how the salinity and submergence functions better represent carbon uptake by tidal salt marshes.The data package includes netCDF files used as forcing files for tide height and salinity, one for each year 2018-2020 at observed salinity concentrations, and an additional three forcing files in which salinity concentrations were varied 5 ppt lower, 5 ppt higher, and 10 ppt higher than the measured 2018 time series. Also included are python scripts for creating forcing files, plain text parameter and command files for running simulations, model outputs in netCDF format, and python scripts for visualizing outputs. Code for the modified E3SM model is archived in Sulman et al 2023 at doi:10.15485/1991625. More detail about files is provided in the README.md file.

54 ENVIRONMENTAL SCIENCES↗

SLIA Reference Architecture Models

The SLIA Reference Architecture Models project, sponsored by the DOE CESER Energy CyberSense Program (Oct 2024–Sep 2025), advanced LLNL’s PySCES simulation tool to better support CyTRICS Prioritization and Initial Risk Assessment (PIRA) reference architectures. Key achievements include enhancements to the PySCES transmission substation facility model, expanded asset coverage, and enhancements to the PySCES code base. Software improvements reduced code complexity, migrated PySCES to Python version 3.11, introduced an object-oriented design, and added a schema database for easier updates and validation. New features support device criticality assessments and a more precise parametric simulation mode. Remaining gaps include model validation, workflow limitations, Monte Carlo convergence issues, full device criticality metric implementation, model fidelity, and general software improvements. Continued development is recommended to address these gaps and fully align PySCES with CyTRICS PIRA requirements.

97 MATHEMATICS AND COMPUTING↗

Advancing Neutrino Simulation Modeling with MARLEY: Insights from the NNSA-MSIIP Internship

Core-collapse supernovae are intense sources of tens-of-MeV neutrinos. However, there is no experimental data to validate the current event generator MARLEY (Model of Argon Reaction Low Energy Yields) that can model supernova neutrinos. To validate the model, I developed a new muon capture feature within the MARLEY simulation framework by coding key functions in C++, Python, and ROOT. I generated and analyzed one million simulated muon capture events and comparing the results to experimental data. To improve the model, I worked on optimizing the model’s parameters to improve its precision using statistical methods.

Wong, Baker [Fermilab]↗

Progress on Optimizing Wind Farms and Rotor Designs Using Adjoints

Modern wind plants are increasingly tasked with multiple performance objectives. In addition to designing plants that maximize power output and minimize the levelized cost of energy (LCOE), the design and operation of wind plants is increasingly influenced by challenges regarding grid integration of variable generation renewables. This places a growing emphasis on making wind plants more controllable and predictable. WindSE is a Reynolds-averaged Navier-Stokes (RANS) model designed around analytical gradient and adjoint methods, with the ability to capture terrain-induced effects, as shown in Figure 1. The recent addition of an unsteady solver with an actuator line method (ALM) and ongoing work to enable massively parallel optimizations gives it a unique niche to explore coupled plant-level controls and design problems. This code is an open source python package built on the FEniCS framework that utilizes fast, parallel PETSc solvers to model fluid flow throughout wind-farm scale domains. Two recent studies performed using WindSE demonstrate the capability to optimize under a wide variety of flow conditions and objective functions. In the first, we present an optimization focused on modifying the layout of a wind farm with a fixed number of turbines for maximum total power output [1]. This study highlights the ability to quickly perform simulations using the steady Navier-Stokes solver combined with rotors represented as actuator disks while also stressing the importance of capturing terrain-induced effects. Gradient-based optimization using the RANS equations is viable due to the inclusion of efficiently computed adjoint derivatives. We interpret the physical results of the optimal layout and also discuss the computational cost of scaling to larger problems. In the second study, we present the capabilities of the unsteady Navier-Stokes solver, where rotor-blade profiles represented by actuator lines are optimized to enhance wake steering effects and overall power production [2]. We quantify the wind plant performance gains obtained from this type of simultaneous control co-design optimization as compared to optimizing the blade design and yaw independently. Figure 2 shows the differences between a baseline two-turbine system and an optimized system where we fine-tune the blade chord profile. Results and challenges from each study are quickly summarized and used to motivate the current development efforts within WindSE. Current and future work is focused on enabling higher-resolution studies with more degrees of freedom through parallelization of both the simulation and optimization algorithms. We present benchmarking results to show that WindSE performs well in both weak- and strong-scaling tests and further demonstrate that the optimizer obtains the same convergence rates in both shared- and distributed-memory environments. Using larger wind farms, we can study deep-array effects within an optimization context, allowing the use of objective functions that have been previously unstudied. As an example, we present ongoing work on a blockage metric which characterizes the loss of available kinetic energy due to wake effects from multiple upstream turbines.

adjoint optimization↗

Semi-analytic model of magnetized liner inertial fusion

The code that was developed is called SAMM (Semi-Analytic MagLIF Model). In 2015, McBride and Slutz published all of the equations that are solved by the code in the original SAMM paper: R. D. McBride and S. A. Slutz, ?A semi-analytic model of magnetized liner inertial fusion?, Phys. Plasmas 22, 052708 (2015); http://doi.org/10.1063/1.4918953. The SAMM code is now implemented in both the MATLAB and Python programming languages. Students from multiple universities have requested copies of the code so that they can become more familiar with the MagLIF concept. We would like to seek an open-source solution. There is no market value to this code, as there are plenty of more sophisticated simulation codes already available; SAMM is merely a simplified model that is purely for educational purposes. In fact, at least one graduate student (from the University of California, San Diego) has already implemented and published his own modified version of the model: J. Narkis, H. U. Rahman, J. C. Valenzuela, F. Conti, R. D. McBride, D. Venosa, and F. N. Beg, ?A semi-analytic model of gas-puff liner-on-target magneto-inertial fusion?, Phys. Plasmas 26, 032708 (2019); https://doi.org/10.1063/1.5086056. SAND2020-12244 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.

Moore, Thomas↗

Fragme∩t: An Open‐Source Framework for Multiscale Quantum Chemistry Based on Fragmentation

Fragment-based quantum chemistry offers a means to circumvent the nonlinear computational scaling of conventional electronic structure calculations, by partitioning a large calculation into smaller subsystems then considering the many-body interactions between them. Variants of this approach have been used to parameterize classical force fields and machine learning potentials, applications that benefit from interoperability between quantum chemistry codes. However, there is a dearth of software that provides interoperability yet is purpose-built to handle the combinatorial complexity of fragment-based calculations. To fill this void we introduce “Fragme∩t”, an open-source software application that provides a tool for community validation of fragment-based methods, a platform for developing new approximations, and a framework for analyzing many-body interactions. Fragme∩t includes algorithms for automatic fragment generation and structure modification, and for distance- and energy-based screening of the requisite subsystems. Checkpointing, database management, and parallelization are handled internally and results are archived in a portable database. Interfaces to various quantum chemistry engines are easy to write and exist already for Q-Chem, PySCF, xTB, Orca, CP2K, MRCC, Psi4, NWChem, GAMESS, and MOPAC. Applications reported here demonstrate parallel efficiencies around 96% on more than 1000 processors but also showcase that the code can handle large-scale protein fragmentation using only workstation hardware, all with a codebase that is designed to be usable by non-experts. Fragme∩t conforms to modern software engineering best practices and is built upon well established technologies including Python, SQLite, and Ray. The source code is available under the Apache 2.0 license.

37 INORGANIC, ORGANIC, PHYSICAL, AND ANALYTICAL CH↗

Training Data Regarding Optimal Power Flow For Efficient Machine Learning

The code is intended to take the data outputted by the MATPOWER OPF solver tools and restructures the data in a way that is best suited for machine learning. The variables are read and the desired values are taken and added to an array in the correct format. This array is then converted into a python array for future use. The code also utilizes MATPOWER's ability to construct different power flow scenarios and repeat them a chosen number of times. Each iteration will add a new line to the formatted array so that the final output is a matrix has a height equal to the number of repetition used.

Seidel, RachaelI↗

PyDislocDyn: Code Manual

PyDislocDyn [1] is a suite of python programs designed to perform various calculations for basic research in dislocation dynamics in metals with various crystal symmetries in the continuum limit.

97 MATHEMATICS AND COMPUTING↗

Equilipy: a python package for calculating phase equilibria

The CALPHAD (CALculation of PHAse Diagram) approach (Nigel Saunders & Miodownik, 1998) provides predictions for thermodynamically stable phases in multicomponent-multiphase materials across a wide range of temperatures. Consequently, the CALPHAD calculations became an essential tool in materials and process design (Luo, 2015). Such design tasks frequently require navigating a high-dimensional space due to multiple components involved in the system. This increasing complexity demands high-throughput CALPHAD calculations, especially in the rapidly evolving field of alloy design. In response to the need, we developed Equilipy an open-source Python package designed for calculating phase equilibria of multicomponent-multiphase systems. Equilipy is specifically tailored for high-throughput CALPHAD calculations, offering parallel computations across multiple processors and nodes with the given NPT input conditions namely elemental compositions (N), pressure (P), and temperature (T). Equilipy utilizes the program structure and Gibbs energy functions from the Fortran-based program, Thermochimica (Piro et al., 2013), with incorporating a new Gibbs energy minimization algorithm. This algorithm, originally developed by Capitani and Brown in 1987 (Capitani & Brown, 1987), has been revised and implemented to enhance the stability and performance of calculations. The Fortran codes are precompiled and interfaced with Python via F2PY, ensuring high computation speed. Benchmark tests shown in Figure 1 demonstrate that Equilipy’s computation speed is comparable to those of established commercial software, TC-Python and PanPython. This result highlights its efficiency and potential applications in various scientific and industrial fields.

97 MATHEMATICS AND COMPUTING↗