Symbolic construction of the chemical Jacobian of quasi-steady state (QSS) chemistries for Exascale computing platforms

Malik Hassanaly, Nicholas T. Wimer, Anne Felden, Lucas Esclapez, Julia Ream, Marc T. Henry de Frahan, Jon S. Rood, Marc DayarXiv 2024 · DOI

Introduction

Simulating turbulent combustion—such as the complex fluid dynamics inside a jet engine—represents one of the most significant computational challenges in modern engineering. The primary hurdle lies in the "stiffness" of chemical kinetics, where reaction timescales can vary by several orders of magnitude. To handle this stiffness, researchers rely on implicit numerical solvers that require a Jacobian matrix: a mathematical map describing how the production rate of every chemical species changes in response to every other species.

As simulations move toward Exascale platforms, the computational cost of these Jacobians becomes a bottleneck. While the Quasi-Steady State Approximation (QSSA) is often used to reduce the number of variables and make simulations tractable, it introduces complex, nonlinear algebraic constraints. Traditionally, deriving analytical Jacobians for these reduced models was a manual "mathematical nightmare," forcing researchers to use slow, memory-intensive, and often unstable numerical approximations. This paper presents a symbolic framework integrated into the PelePhysics library to automate this process for high-performance computing.

Methodology: Symbolic Differentiation and Graph Theory

The researchers developed a pipeline that uses the sympy Python package to symbolically track species dependencies and automatically generate C++ code for the Jacobian. A critical component of this framework is the application of graph theory to manage the solvability of the resulting algebraic systems.

Graph-based identification of Strongly Connected Components (SCCs) to solve algebraic QSS systems.

By utilizing Tarjan’s algorithm, the framework identifies "Strongly Connected Components" (SCCs) within the chemical network. As illustrated in the figure above, this allows the system to be decomposed into smaller, manageable groups (G1, G2). These SCCs can then be solved efficiently using back-substitution or localized Gaussian pivoting, significantly reducing the computational overhead of the QSS reduction.

Overcoming the "Code Bloat" Challenge

One of the most significant findings of this work is that the primary obstacle to symbolic chemistry is not the mathematics, but software engineering. Naive symbolic code generation for a standard fuel like n-dodecane resulted in a source file exceeding 65 GB—far too large to compile or fit into GPU memory. To address this, the authors implemented aggressive memory optimizations:

  • Common Subexpression Elimination (CSE): Identifying and pre-computing repeated mathematical terms.
  • Operation Count Replacement: Replacing subexpressions only when it yields a net reduction in computational load.
  • Subexpression Recycling: Reusing memory slots for temporary variables to minimize the GPU memory footprint.

These techniques successfully compressed the generated code from 65 GB down to a manageable 2.9 MB.

Key Results and Performance

The method was validated using standard chemical mechanisms, including Methane, n-Dodecane, and n-Heptane. In 3D turbulent multi-pulse ignition simulations on the Frontier Exascale cluster, the analytical Jacobian provided a 1.35x to 2x speedup over traditional finite difference methods on CPUs. More importantly, it provided essential numerical stability; while Jacobian-free iterative methods (like GMRES) often crashed during the volatile ignition phase, the analytical Jacobian allowed simulations to progress smoothly to completion.

Comparison of ignition delay errors across different linearization methods.

The study also explored different linearization strategies. As shown in the table above, "one-sided reaction linearization" offers a "Goldilocks" balance for complex mechanisms. While species linearization is the most accurate (0.848% error), one-sided reaction linearization (8.97% error) is significantly more accurate than standard reaction linearization (13.3%) while remaining much easier to implement symbolically.

Conclusion

By combining symbolic differentiation with graph-theoretic solvability and aggressive memory optimization, this framework enables stable, high-performance simulations of complex fuels on the world's most powerful supercomputers. Future work will focus on integrating symbolic temperature derivatives to further reduce reliance on finite difference approximations and extending the approach to broader types of algebraic chemistry reductions.

Summary updated

BibTeX
@misc{hassanaly2024symbolic,
  author = {Malik Hassanaly and Nicholas T. Wimer and Anne Felden and Lucas Esclapez and Julia Ream and Marc T. Henry de Frahan and Jon S. Rood and Marc Day},
  title = {{Symbolic construction of the chemical Jacobian of quasi-steady state (QSS) chemistries for Exascale computing platforms}},
  year = {2024},
  eprint = {2405.05974},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.05974},
}
Figure