Skip to main content

Automated Code Generation for Maximizing Performance of Detailed Chemistry Calculations in OpenFOAM

  • Conference paper
  • First Online:

Abstract

In direct numerical simulation of turbulent combustion, the majority of the total simulation time is often spent on evaluating chemical reaction rates from detailed reaction mechanisms. In this work, an optimization method is presented for speeding up the calculation of chemical reaction rates significantly, which has been implemented into the open-source CFD code OpenFOAM. A converter tool has been developed, which translates any input file containing chemical reaction mechanisms into C++ source code. The automatically generated code allows to restructure the reaction mechanisms for efficient computation and enables more compiler optimizations. Additional performance improvements are achieved by generating densely packed data and linear access patterns that can be vectorized in order to exploit the maximum performance on HPC systems. The generated source code compiles to an OpenFOAM library, which can directly be used in simulations through OpenFOAM’s runtime selection mechanism. The optimization concept has been applied to a realistic combustion case simulated on two peta-scale supercomputers, among them the fastest HPC cluster Hazel Hen (Cray XC40) in Germany. The optimized code leads to a decrease of total simulation time of up to 40% and this improvement increases with the complexity of the involved chemical reactions. Moreover, the optimized code yields good parallel performance on up to 28,800 CPU cores.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   219.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. BP Energy Outlook, British Petroleum (2016), www.bp.com/energyoutlook

  2. T. Poinsot, D. Veynante, Theoretical and Numerical Combustion (RT Edwards, Toulouse Cedex, 2005)

    Google Scholar 

  3. A. Lipatnikov, Fundamentals of Premixed Turbulent Combustion (CRC, Boca Raton, 2012)

    Google Scholar 

  4. C.K. Law, Combustion Physics (Cambridge University Press, Cambridge, 2010)

    Google Scholar 

  5. J.H. Chen, Petascale direct numerical simulation of turbulent combustion—fundamental insights towards predictive models. Proc. Combust. Inst. 33, 99–123 (2011)

    Google Scholar 

  6. F. Zhang, T. Zirwes, P. Habisreuther, H. Bockhorn, Numerical simulation of turbulent combustion with a multi-regional approach, in High Performance Computing in Science and Engineering ’15, ed. by W.E. Nagel, D.B. Kröner, M.M. Resch (Springer, Berlin, Heidelberg, 2015), pp. 267–280

    Google Scholar 

  7. G.P. Smith, D.M. Golden, M. Frenklach, N.W. Moriarty, B. Eiteneer, M. Goldenberg, C.T. Bowman, R.K. Hanson, S. Song, W.C. Gardiner, V.V. Lissianski, Z. Qi, GRI 3.0 reaction mechanism (1999), http://www.me.berkeley.edu/gri_mech

  8. LLNL Heptane Reaction Mechanism (2012), https://combustion.llnl.gov/mechanisms/alkanes/n-heptane-detailed-mechanism-version-3

  9. T. Lu, C.K. Law, Toward accommodating realistic fuel chemistry in large-scale computations. Prog. Energy Combust. Sci. 35(2), 192–215 (2009)

    Google Scholar 

  10. V. Damian, A. Sandu, M. Damian, F. Potra, G.R. Carmichael, The kinetic preprocessor KPP—a software environment for solving chemical kinetics. Comput. Chem. Eng. 26, 1567–1579 (2002)

    Google Scholar 

  11. K.E. Niemeyer, N.J. Curtis, pyJac, Version 1.0.1 (2016), https://github.com/kyleniemeyer/pyJac

  12. H.G. Weller, G. Tabor, H. Jasak, C. Fureby, A tensorial approach to computational continuum mechanics using object-oriented techniques. Comput. Phys. 12, 620–631 (1998)

    Google Scholar 

  13. S. Vo, A. Kronenburg, O.T. Stein, E.R. Hawkes, Direct numerical simulation of non-premixed syngas combustion using OpenFOAM, in High Performance Computing in Science and Engineering ’16, ed. by W.E. Nagel, D.B. Kröner, M.M. Resch (Springer, Heidelberg, 2016)

    Google Scholar 

  14. F. Zhang, H. Bonart, T. Zirwes, P. Habisreuther, H. Bockhorn, N. Zarzalis, Direct numerical simulation of chemically reacting flows with the public domain code OpenFOAM, in High Performance Computing in Science and Engineering ’14, ed. by W.E. Nagel, D.H. Kröner, M.M. Resch (Springer, Berlin, Heidelberg, 2015), pp. 221–236

    Google Scholar 

  15. D.G. Goodwin, H.K. Moffat, R.L. Speth, Cantera: an object-oriented software toolkit for chemical kinetics, thermodynamics, and transport processes. Version 2.3.0b (2016), http://www.cantera.org

  16. T. Zirwes, Weiterentwicklung und Optimierung eines auf OpenFOAM basierten DNS Lösers zur Verbesserung der Effizienz und Handhabung. Bachelor’s thesis, Karlsruhe Institute of Technology, Germany, 2013

    Google Scholar 

  17. R.J. Kee, M.E. Coltrin, P. Glarborg, Chemically Reacting Flow: Theory and Practice (Wiley, Hoboken, 2005)

    Google Scholar 

  18. CHEMKIN 10131, Reaction Design: San Diego (2013)

    Google Scholar 

  19. F. Zhang, T. Zirwes, H. Nawroth, H. Bockhorn, C.O. Paschereit, Combustion generated noise: an environment related issue for future combustion systems. Energy Technol. 5(7), 1045–1054 (2017)

    Article  Google Scholar 

  20. OpenFOAM. The Open Source CFD Toolbox. User Guide (2014)

    Google Scholar 

  21. Cray Inc., Cray XC40 (2016), http://www.hlrs.de/systems/cray-xc40-hazel-hen

    Google Scholar 

  22. ForHLR II (2016), https://www.scc.kit.edu/dienste/forhlr2.php

Download references

Acknowledgements

This work was supported by the German Research Council (DFG) through Research Units DFG-BO693/27 “Combustion Noise”. This work was performed on the national supercomputer Cray XC40 Hazel Hen at the High Performance Computing Center Stuttgart (HLRS) under the grant with acronym ‘Cnoise’ and on the computational resource ForHLR II funded by the Ministry of Science, Research and the Arts Baden-Württemberg and DFG (“Deutsche Forschungsgemeinschaft”).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Feichi Zhang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zirwes, T., Zhang, F., Denev, J.A., Habisreuther, P., Bockhorn, H. (2018). Automated Code Generation for Maximizing Performance of Detailed Chemistry Calculations in OpenFOAM. In: Nagel, W., Kröner, D., Resch, M. (eds) High Performance Computing in Science and Engineering ' 17 . Springer, Cham. https://doi.org/10.1007/978-3-319-68394-2_11

Download citation

Publish with us

Policies and ethics