Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “C 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 55 records · Page 3

An implicit barotropic mode solver for MPAS-ocean using a modern Fortran solver interface

Here, we demonstrate use of a modern Fortran solver interface to manage solver algorithms for an implicit barotropic mode solver in the Model for Predictions Across Scales-Ocean (MPAS-O). ForTrilinos, a Fortran interface to Trilinos that contains a large collection of solver capabilities written in C++, has been implemented in MPAS-O to provide access to a suite of linear solver options. By virtue of the simplified wrapper and interface generator (SWIG) automation tool that generates modern Fortran interfaces to C++ code, we were able to implement the Fortran solver interface in MPAS-O using a familiar Fortran coding style while minimizing performance degradation. The ForTrilinos solver interface is written within MPAS-O’s time stepping modules as a subroutine in conjunction with MPAS-O code. Applied to an idealized ocean and a high-resolution realistic ocean test case, parallel performance of ForTrilinos solvers is examined. It is found that parallel scalability of the ForTrilinos solvers is highly dependent on the number of global synchronization points per solver iteration in each iterative solver algorithm. ForTrilinos solvers perform best compared to the Fortran hand-crafted (FHC) solver when the amount of work per processor is large enough. However, parallel scalability is better with the FHC solver and so when the work per core is modest FHC outperforms ForTrilinos. The intercomparison between the ForTrilinos and FHC solvers reveals that this performance hit in the ForTrilinos solver mostly comes from the global synchronization process, while suggesting that the matrix-vector multiplication process in the FHC solver needs to be optimized for better performance.

97 MATHEMATICS AND COMPUTING↗

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

Performant implementation of the atomic cluster expansion

The atomic cluster expansion is a general polynomial expansion of the atomic energy in multi-atom basis functions. Here we implement the atomic cluster expansion in the performant C++ code PACE that is suitable for use in large scale atomistic simulations. We briefly review the atomic cluster expansion and give detailed expressions for energies and forces as well as efficient algorithms for their evaluation. We demonstrate that the atomic cluster expansion as implemented in PACE shifts a previously established Pareto front for machine learning interatomic potentials towards faster and more accurate calculations. Moreover, general purpose parameterizations are presented for copper and silicon and evaluated in detail. We show that the new Cu and Si potentials significantly improve on the best available potentials for highly accurate large-scale atomistic simulations.

74 ATOMIC AND MOLECULAR PHYSICS↗

Transient Efficiency Flexibility and Reliability Optimization of Coal-Fired Power Plants: Model-Predictive Control Library Development (Report)

This document pertains to the reporting requirements of DOE contract FE-0031767. The document covers the development of a model predictive control (MPC) library for implementing MPC for a general dynamic system. The library is implemented in a standardized manner in Matlab/Simulink, where core functions on model prediction, linearization and formulation and solution of a quadratic programming (QP) optimization problem is done in the core library - independent of the specific application. The user can provide the application-specific dynamic model in continuous and discrete time, to rapidly implement and test the MPC performance in a desktop simulation. The MPC optimization objective and constraints are also easily configured via an Excel file to allow iterative refinement as needed. Finally, the MPC library enables a rapid deployment to a target environment through auto C-code generation and containerization. The MPC library works seamlessly with the model based estimation (MBE) library to obtain the overall output feedback control solution. In this program, the reduced order model (ROM) of a coal-fired power plant (CFPP) is used to implement and test the MPC solution.

01 COAL, LIGNITE, AND PEAT↗

Transient Efficiency, Flexibility, and Reliability Optimization of Coal-Fired Power Plants - Final Report

This program developed an advanced model-based monitoring and model-predictive control algorithms for a coal fired power plant (CFPP), and deployed these algorithms in a real-time platform to demonstrate performance benefits for transient flexibility and plant operation efficiency. More specifically, the objectives were successfully achieved through a combination of (i) developing a high-fidelity transient plant model in Apros, which was used as a high-fidelity plant simulation between $100-50\% TMCR$ where TMCR denotes the turbine maximum continuous rating, i.e., baseload, (ii) developing a very fast physics-based reduced-order model (ROM) of the plant, which ran more than $100\times$ faster than real-time, enabling its use as real-time embedded model for model-based estimation (MBE) and model predictive control (MPC) (iii) implementing a real-time MBE based on ROM using a robust unscented Kalman filter (UKF) to continuously tune the ROM to match the measurements from high-fidelity Apros plant model despite significant plant-model mismatch, and thus, obtain a Digital Twin of the plant (iv) designing and implementing a real-time MPC with dual objectives of transient plant load tracking with high ramp rates and minimizing coal consumption, i.e., improving plant efficiency in the baseload-partload operation range of $100-50\% TMCR$. Each key element above was developed and tested individually, and has been reported in corresponding Topical Reports. Finally, all the individual elements were integrated in an overall closed-loop system, that was successfully tested in desktop Simulink test harness simulations with ROM or high-fidelity model as the plant. Thereafter, the Simulink implementation was used to auto-generate C-code and deploy as real-time Docker microservice containers in Linux, and validate that they can run in real-time in the hardware-in-the loop (HIL) setup and produce the same results as in Simulink. The results of the integrated simulation tests in Simulink as well as the real-time HIL deployment are documented in this final report, showing good load tracking for load ramps at $3-4\%/min$ ramp rates, and achieving up to $5.5\%$ reduction in coal relative to baseline operation at $50\% TMCR$ load. The desktop and HIL simulations show successful performance of the overall model based estimation and control solution and achieve the key objectives of the program for flexible, efficient and reliable operation of subcritical coal fired power plants.

20 FOSSIL-FUELED POWER PLANTS↗

ECAR-6564 MARVEL Project Primary Coolant System ASME BPVC Section III Division 5 Design by Analysis

This report demonstrates that the MARVEL Reactor Primary Coolant Boundary (herein referred to as the Primary Coolant System, or PCS) is designed to meet ASME BPVC Section III Division 5 elevated temperature service design-by-analysis criteria. The analysis approach that delineates division of responsibilities to meet project objectives is discussed herein. In short, Design and Service Level A, B, and C code calculations are detailed in ECAR-6580 for the majority of the PCS with complex geometry, while the Lower Downcomers, Bottom Head, and Reactor Core Barrel are analyzed in ANL-23/56. Service Level D code calculations are detailed in this document.

21 SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLANTS↗

Demonstration of Model-Based Design for Digital Controller Using Formal Methods

This report describes work originally performed in FY19 that assembled a workflow enabling formal verification of high-consequence digital controllers. The approach builds on an engineering analysis strategy using multiple abstraction levels (Model-Based Design) and performs exhaustive formal analysis of appropriate levels – here, state machines and C code – to assure always/never properties of digital logic that cannot be verified by testing alone. The operation of the workflow is illustrated using example models and code, including expected failures of verification when properties are violated.

97 MATHEMATICS AND COMPUTING↗

Shorter function summaries for finite state machine-based high consequence systems using logic synthesis and tautologies (Final Report LDRD 24-1302)

Computer programs are often viewed as collections of functions – each function has parameters (inputs) and computes a return value, and each has potential side effects that modify program state (outputs). In this research, a Sandia symbolic execution tool designed to support “human-in-the-loop” analysis was modified to automatically create “function summaries,” and a new tool, “diaboolical,” was created to support enhancing readability of the summary using a novel approach to bit-vector simplification that leverages logic synthesis and tautologies. For this effort, students at Auburn University created several finite state machines (FSMs) to serve as exemplars for high-consequence systems. Function summaries for each of the machines were obtained, and then portions of the summaries were simplified using both diaboolical and the simplification procedure of a popular SMT solver. A comparison of the results shows that diaboolical can often produce smaller function summaries, with expression length improvements over the unsimplified function summaries ranging from 0% to 90% for diaboolical and 0% to 65% for the SMT solver, though diaboolical had a significantly greater cost in time. Diaboolical was evaluated against a collection of “arbitrary” C-code as well as FSM exemplars, and for both datasets it achieved an approximately 10% improvement in expression length compared to simplifications that could be obtained using existing techniques. Function summaries can assist assurance efforts that evaluate existing systems and their executable code. A smaller function summary is likely easier for humans to understand and could thus increase the ability and efficacy of assurance practices centered around the analysis of executable artifacts.

97 MATHEMATICS AND COMPUTING↗

Enabling Efficient Sparse Computations using Linear Algebra Aware Compilers

This project developed the LAPIS compiler framework, built on the Multilevel Intermediate Representation (MLIR), to optimize sparse linear algebra operations and support performance portability across diverse architectures. The main innovation of LAPIS is the Kokkos dialect, which allows for lowering codes from a high productivity language to different architectures in an elegant way. The dialect also allows the conversion of lower-level MLIR code to C++ Kokkos code, facilitating the integration of scientific machine learning (SciML) models into applications. To extend LAPIS for distributed memory architectures, a new partition dialect was created to manage the distribution of sparse tensors and express communication patterns for sparse linear algebra operations. This dialect also supports the distributed execution of operators and includes algorithmic optimizations to minimize communication to improve performance. The project also demonstrates that MLIR can enable effective linear algebra-level optimizations, improving performance on different GPUs for both sparse and dense linear algebra kernels. Key applications of LAPIS include sparse linear algebra and graph kernels, TenSQL, a relational database management solution built on GraphBLAS, and the development of subgraph isomorphism and monomorphism kernels, showcasing performance portability. In summary, the LAPIS framework supports productivity, performance, portability, and distributed memory execution, while also enabling linear algebra-level optimizations that are challenging in traditional programming languages, with successful applications ranging from simple sparse linear algebra to complex graph kernels.

97 MATHEMATICS AND COMPUTING↗

Transient Efficiency, Flexibility, and Reliability Optimization of Coal-Fired Power Plants - Final Program Review

This program developed an advanced model-based monitoring and model-predictive control algorithms for a coal fired power plant (CFPP), and deployed these algorithms in a real-time platform to demonstrate performance benefits for transient flexibility and plant operation efficiency. More specifically, the objectives were successfully achieved through a combination of (i) developing a high-fidelity transient plant model in Apros, which was used as a high-fidelity plant simulation between $100-50\% TMCR$ where TMCR denotes the turbine maximum continuous rating, i.e., baseload, (ii) developing a very fast physics-based reduced-order model (ROM) of the plant, which ran more than $100\times$ faster than real-time, enabling its use as real-time embedded model for model-based estimation (MBE) and model predictive control (MPC) (iii) implementing a real-time MBE based on ROM using a robust unscented Kalman filter (UKF) to continuously tune the ROM to match the measurements from high-fidelity Apros plant model despite significant plant-model mismatch, and thus, obtain a Digital Twin of the plant (iv) designing and implementing a real-time MPC with dual objectives of transient plant load tracking with high ramp rates and minimizing coal consumption, i.e., improving plant efficiency in the baseload-partload operation range of $100-50\% TMCR$. Each key element above was developed and tested individually, and has been reported in corresponding Topical Reports. Finally, all the individual elements were integrated in an overall closed-loop system, that was successfully tested in desktop Simulink test harness simulations with ROM or high-fidelity model as the plant. Thereafter, the Simulink implementation was used to auto-generate C-code and deploy as real-time Docker microservice containers in Linux, and validate that they can run in real-time in the hardware-in-the loop (HIL) setup and produce the same results as in Simulink. The results of the integrated simulation tests in Simulink as well as the real-time HIL deployment are documented in this final report, showing good load tracking for load ramps at $3-4\%/min$ ramp rates, and achieving up to $5.5\%$ reduction in coal relative to baseline operation at $50\% TMCR$ load. The desktop and HIL simulations show successful performance of the overall model based estimation and control solution and achieve the key objectives of the program for flexible, efficient and reliable operation of sub-critical coal fired power plants.

20 FOSSIL-FUELED POWER PLANTS↗

ECAR-6564 Rev 1 MARVEL Project Primary Coolant System ASME BPVC Section III Division 5 Design by Analysis

This report demonstrates that the MARVEL Reactor Primary Coolant Boundary (herein referred to as the Primary Coolant System, or PCS) is designed to meet ASME BPVC Section III Division 5 elevated temperature service design-by-analysis criteria. The analysis approach that delineates division of responsibilities to meet project objectives is discussed herein. In short, Design and Service Level A, B, and C code calculations are detailed in ECAR-6580 [9] for the majority of the PCS with complex geometry, while the Lower Downcomers, Bottom Head, and Reactor Core Barrel are analyzed in ANL-24/36. Service Level D code calculations are detailed in this document.

21 - SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLAN↗

TUMME: Tsinghua University Minnesota Master Equation program

We report that TUMME is a program for assembling and solving master equations for gas-phase chemical kinetics based on chemically significant eigenmodes. TUMME has interfaces to the Gaussian, Polyrate, and/or MSTor output files that allow the master equation code to obtain the microcanonical flux coefficients needed for the coefficient matrix of the master equation. The flux coefficients for reactions with barriers can be calculated by multi-structural variational transition state theory with small-curvature tunneling (MS-VTST/SCT) or by simpler approximations to this such as conventional transition state theory without tunneling (also called RRKM theory). The flux coefficients for barrierless reactions are provided by a hard-sphere model. TUMME is written in double precision with Python 3; quadruple and octuple precision are also available for some subtasks in C++. The Python code can run in serial or parallel (MP or MPI), and the C++ code can run on a single processor or on multiple processors with OpenMP.

71 CLASSICAL AND QUANTUM MECHANICS, GENERAL PHYSIC↗

MFANS 2024 - Dimensional Analysis Made Easy

There is a significant impact of dimensional errors in systems. Dimensional analysis is difficult due to the large size of systems. SA4U and Scalpel are practical programs which can have an impact beyond traditional software as they are able to perform precise dimensional analysis and repair C++ source code.

97 MATHEMATICS AND COMPUTING↗

Assurance of Reasoning Enabled Systems (ARES)

ARES was in part motivated by the determination of President’s Council of Advisors on Science and Technology (PCAST) on May 13th, 2023 that published a set of inquiries: In an era in which convincing images, audio, and text can be generated with ease on a massive scale, how can we ensure reliable access to verifiable, trustworthy information? How can we be certain that a particular piece of media is genuinely from the claimed source? What technologies, policies, and infrastructure can be developed to detect and counter AI-generated disinformation? In an effort to automatically analyze and patch/optimize code the work in this report describes various neural Machine Learning (ML) analysis engine implementations to assist in situations where source code is deficient or completely lacking to decompile (lift) binary code to ’C’. The goal is to gradually reduce human intervention. To this end, two Large Language Model (LLM) variants (Code LLama 2, LLama 3.1 and Starcoder1, Starcoder 2) where finetuned with ’before/after’ code pairs on the OpenBLAS library. LLama trained on the lowering process, Starcoder trained on the lifting process with National Security Agency’s (NSA) open-source Ghidra decompiler assist. The inferencing test results indicate correctness for only very short sequences for Starcoder 2. Moving forward, the experiments conclude with a set of recommendations of required resources and technologies

97 MATHEMATICS AND COMPUTING↗

Approach to nonlinear magnetohydrodynamic simulations in stellarator geometry

The capability to model the nonlinear magnetohydrodynamic (MHD) evolution of stellarator plasmas is developed by extending the M3D-C 1 code to allow non-axisymmetric domain geometry. We introduce a set of logical coordinates, in which the computational domain is axisymmetric, to utilize the existing finite-element framework of M3D-C 1 . A C 1 coordinate mapping connects the logical domain to the non-axisymmetric physical domain, where we use the M3D-C 1 extended MHD models essentially without modifications. We present several numerical verifications on the implementation of this approach, including simulations of the heating, destabilization, and equilibration of a stellarator plasma with strongly anisotropic thermal conductivity, and of the relaxation of stellarator equilibria to integrable and non-integrable magnetic field configurations in realistic geometries.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Large language model evaluation for high–performance computing software development

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

97 MATHEMATICS AND COMPUTING↗

Uncertainty analysis for VERA problem 2 using the cell-code Condor v2.8.05

Condor is a cell-level neutronic calculation code that applies multi-group collision probabilities with heterogeneous response coupling method within generic geometry configurations. Under the Condor's code continuous development, the incorporation of up-to-date methodologies and state-of-the-art practices in reactor analysis represents a driving force. In this work, the capabilities of Condor v2.8.05 to develop an uncertainty analysis for realistic PWR-kind fuel assemblies are studied. The Total Monte Carlo approach is applied to quantify the impact of fabrication tolerances in the code's results for reactivity and power distributions, by means of randomly sampled input values using the VERA problem 2 as basis. The VERA problem 2 proposes a series of Westinghouse 2D 17 x 17-type fuel lattices, to be calculated reflected at beginning-of-life without Xe. The configurations correspond to a modern PWR. Selected neutronic parameters from Condor runs are thus analyzed in terms of the observed spread as well as the obtained distributions for the randomly perturbed cases, showing the capability of the code to handle the required input data, as well as its ability to provide valuable insights regarding uncertainty quantification.

21 SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLANTS↗

Reactivity initiated accident uncertainty quantification for fuel assembly with subchannel code

UNIST CORE lab has developed a multiphysics coupling framework (MPCORE) consisting of Neutronics, Thermal Hydraulics and Fuel Performance modules. It can accommodate one-dimensional as well as sub-channel code Thermal Hydraulics (TH) module. Generally, running a transient requires more computational power due to the convergence of modules with each other. The difference between one-dimensional and sub-channel TH modules is studied in this research for a Reactivity Initiated Accident (RIA). Both TH modules are compared for a RIA uncertainty propagation in a single VERA fuel assembly with 2.11% enrichment. MPCORE is capable of analyzing the transient at any burnup point but for current work, only fresh fuel has been considered. The results have been obtained using dynamic gap heat conductance in FRAPTRAN. Peak centerline temperature, fuel enthalpy and DNBR are compared for both the approaches. The results indicate that the use of sub-channel code lead to greater safety margin for critical parameters. Computation time comparison is also presented for both the cases. (authors)

22 GENERAL STUDIES OF NUCLEAR REACTORS↗