×

pyJac: analytical Jacobian generator for chemical kinetics. (English) Zbl 1411.80001

Summary: Accurate simulations of combustion phenomena require the use of detailed chemical kinetics in order to capture limit phenomena such as ignition and extinction as well as predict pollutant formation. However, the chemical kinetic models for hydrocarbon fuels of practical interest typically have large numbers of species and reactions and exhibit high levels of mathematical stiffness in the governing differential equations, particularly for larger fuel molecules. In order to integrate the stiff equations governing chemical kinetics, generally reactive-flow simulations rely on implicit algorithms that require frequent Jacobian matrix evaluations. Some in situ and a posteriori computational diagnostics methods also require accurate Jacobian matrices, including computational singular perturbation and chemical explosive mode analysis. Typically, finite differences numerically approximate these, but for larger chemical kinetic models this poses significant computational demands since the number of chemical source term evaluations scales with the square of species count. Furthermore, existing analytical Jacobian tools do not optimize evaluations or support emerging SIMD processors such as GPUs. Here we introduce pyJac, a Python-based open-source program that generates analytical Jacobian matrices for use in chemical kinetics modeling and analysis. In addition to producing the necessary customized source code for evaluating reaction rates (including all modern reaction rate formulations), the chemical source terms, and the Jacobian matrix, pyJac uses an optimized evaluation order to minimize computational and memory operations. As a demonstration, we first establish the correctness of the Jacobian matrices for kinetic models of hydrogen, methane, ethylene, and isopentanol oxidation (number of species ranging 13-360) by showing agreement within 0.001% of matrices obtained via automatic differentiation. We then demonstrate the performance achievable on CPUs and GPUs using pyJac via matrix evaluation timing comparisons; the routines produced by pyJac outperformed first-order finite differences by 3–7.5 times and the existing analytical Jacobian software TCHem by 1.1-2.2 times on a single-threaded basis. It is noted that TCHem is not thread-safe, while pyJac is easily parallelized, and hence can greatly outperform TCHem on multicore CPUs. The Jacobian matrix generator we describe here will be useful for reducing the cost of integrating chemical source terms with implicit algorithms in particular and algorithms that require an accurate Jacobian matrix in general. Furthermore, the open-source release of the program and Python-based implementation will enable wide adoption.

MSC:

80-04 Software, source code, etc. for problems pertaining to classical thermodynamics
80A30 Chemical kinetics in thermodynamics and heat transfer
80A25 Combustion

References:

[1] Sarathy, S. M.; Westbrook, C. K.; Mehl, M.; Pitz, W. J.; Togbe, C.; Dagaut, P.; Wang, H.; Oehlschlaeger, M. A.; Niemann, U.; Seshadri, K.; Veloo, P. S.; Ji, C.; Egolfopoulos, F. N.; Lu, T., Combust. Flame, 158, 12, 2338-2357 (2011)
[2] Mehl, M.; Pitz, W. J.; Westbrook, C. K.; Curran, H. J., Proc. Combust. Inst., 33, 1, 193-200 (2011)
[3] Mehl, M.; Chen, J.-Y.; Pitz, W. J.; Sarathy, S. M.; Westbrook, C. K., Energy Fuels, 25, 11, 5215-5223 (2011)
[4] Herbinet, O.; Pitz, W. J.; Westbrook, C. K., Combust. Flame, 157, 5, 893-908 (2010)
[5] Lu, T.; Law, C. K., Prog. Energy Comb. Sci., 35, 2, 192-215 (2009)
[6] Turányi, T.; Tomlin, A. S., Analysis of Kinetic Reaction Mechanisms (2014), Springer-Verlag: Springer-Verlag Berlin Heidelberg · Zbl 1314.92005
[7] Lu, T.; Law, C. K., Combust. Flame, 144, 1-2, 24-36 (2006)
[8] Pepiot-Desjardins, P.; Pitsch, H., Combust. Flame, 154, 1-2, 67-81 (2008)
[9] Hiremath, V.; Ren, Z.; Pope, S. B., Combust. Theory Model., 14, 5, 619-652 (2010) · Zbl 1214.80005
[10] Niemeyer, K. E.; Sung, C. J.; Raju, M. P., Combust. Flame, 157, 9, 1760-1770 (2010)
[11] Lu, T.; Law, C. K., Combust. Flame, 148, 3, 117-126 (2007)
[12] Ahmed, S. S.; Mauß, F.; Moréac, G.; Zeuch, T., Phys. Chem. Chem. Phys., 9, 9, 1107-1126 (2007)
[13] Pepiot-Desjardins, P.; Pitsch, H., Combust. Theory Model., 12, 6, 1089-1108 (2008) · Zbl 1158.80325
[14] Maas, U.; Pope, S. B., Combust. Flame, 88, 3-4, 239-264 (1992)
[15] Lam, S.-H.; Goussis, D. A., Int. J. Chem. Kinet., 26, 4, 461-486 (1994)
[16] Lu, T.; Ju, Y.; Law, C. K., Combust. Flame, 126, 1-2, 1445-1455 (2001)
[17] Gou, X.; Sun, W.; Chen, Z.; Ju, Y., Combust. Flame, 157, 6, 1111-1121 (2010)
[18] Lu, T.; Law, C. K., Combust. Flame, 154, 1-2, 153-163 (2008)
[19] Niemeyer, K. E.; Sung, C. J., Combust. Flame, 161, 11, 2752-2764 (2014)
[20] Niemeyer, K. E.; Sung, C. J., Energy Fuels, 29, 2, 1172-1185 (2015)
[21] Banerjee, I.; Ierapetritou, M., Combust. Flame, 144, 3, 619-633 (2006)
[22] Liang, L.; Stevens, J.; Farrell, J. T., Proc. Combust. Inst., 32, 1, 527-534 (2009)
[23] Shi, Y.; Liang, L.; Ge, H.-W.; Reitz, R. D., Combust. Theory Model., 14, 1, 69-89 (2010) · Zbl 1187.80038
[24] Gou, X.; Chen, Z.; Sun, W.; Ju, Y., Combust. Flame, 160, 2, 225-231 (2013)
[25] Yang, H.; Ren, Z.; Lu, T.; Goldin, G. M., Combust. Theory Model., 17, 1, 167-183 (2013) · Zbl 1263.80023
[26] Curtis, N. J.; Niemeyer, K. E.; Sung, C. J., Combust. Flame, 162, 1358-1374 (2015)
[27] Pope, S. B., Combust. Theory Model., 1, 1, 41-63 (1997) · Zbl 1046.80500
[28] Curtiss, C. F.; Hirschfelder, J. O., Proc. Natl. Acad. Sci., 38, 3, 235-243 (1952) · Zbl 0046.13602
[29] Byrne, G. D.; Hindmarsh, A. C., J. Comput. Phys., 70, 1, 1-62 (1987) · Zbl 0614.65078
[30] Brown, P. N.; Byrne, G. D.; Hindmarsh, A. C., SIAM J. Sci. Stat. Comput., 10, 5, 1038-1051 (1989) · Zbl 0677.65075
[31] Hindmarsh, A. C.; Brown, P. N.; Grant, K. E.; Lee, S. L.; Serban, R.; Shumaker, D. E.; Woodward, C. S., ACM Trans. Math. Software, 31, 3, 363-396 (2005) · Zbl 1136.65329
[32] Oran, E. S.; Boris, J. P., Numerical Simulation of Reactive Flow (2001), Cambridge University Press: Cambridge University Press Cambridge · Zbl 0980.76002
[33] Spafford, K.; Meredith, J.; Vetter, J.; Chen, J.; Grout, R.; Sankaran, R., (Euro-Par 2009 Parallel Processing Workshops. Euro-Par 2009 Parallel Processing Workshops, LNCS, vol. 6043 (2010), Springer-Verlag: Springer-Verlag Berlin, Heidelberg), 122-131
[34] Shi, Y.; G, W. H.; Wong, H.-W.; Oluwole, O. O., Combust. Flame, 158, 5, 836-847 (2011)
[35] K.E. Niemeyer, C.J. Sung, C.G. Fotache, J.C. Lee, 7th Fall Technical Meeting of the Eastern States Section of the Combustion Institute, 2011. https://doi.org/10.6084/m9.figshare.3384964.v1; K.E. Niemeyer, C.J. Sung, C.G. Fotache, J.C. Lee, 7th Fall Technical Meeting of the Eastern States Section of the Combustion Institute, 2011. https://doi.org/10.6084/m9.figshare.3384964.v1
[36] Shi, Y.; Green, W. H.; Wong, H.-W.; Oluwole, O. O., Combust. Flame, 159, 7, 2388-2397 (2012)
[37] Stone, C. P.; Davis, R. L., J. Propul. Power, 29, 4, 764-773 (2013)
[38] Niemeyer, K. E.; Sung, C. J., J. Comput. Phys., 256, 854-871 (2014) · Zbl 1349.76880
[39] Niemeyer, K. E.; Sung, C. J., J. Supercomput., 67, 2, 528-564 (2014)
[40] C. Safta, H.N. Najm, O.M. Knio, TChem - A Software Toolkit for the Analysis of Complex Kinetic Models, Tech. Rep. SAND2011-3282, Sandia National Laboratories, May 2011.; C. Safta, H.N. Najm, O.M. Knio, TChem - A Software Toolkit for the Analysis of Complex Kinetic Models, Tech. Rep. SAND2011-3282, Sandia National Laboratories, May 2011.
[41] M.R. Youssefi, Development of Analytic Tools for Computational Flame Diagnostics (Master’s thesis) University of Connecticut, Aug. 2011. http://digitalcommons.uconn.edu/gs_theses/145/; M.R. Youssefi, Development of Analytic Tools for Computational Flame Diagnostics (Master’s thesis) University of Connecticut, Aug. 2011. http://digitalcommons.uconn.edu/gs_theses/145/
[42] Bisetti, F., Combust. Theory Model., 16, 3, 387-418 (2012) · Zbl 1262.80089
[43] Perini, F.; Galligani, E.; Reitz, R. D., Energy Fuels, 26, 8, 4804-4822 (2012)
[44] Dijkmans, T.; Schietekat, C. M.; Van Geem, K. M.; Marin, G. B., Comput. Chem. Eng., 71, 521-531 (2014)
[45] Nickolls, J.; Buck, I.; Garland, M.; Skadron, K., Queue, 6, 2, 40-53 (2008)
[46] Law, C. K., Combustion Physics (2006), Cambridge University Press: Cambridge University Press New York
[47] Warnatz, J.; Maas, U.; Dibble, R. W., (Combustion. Combustion, Physical and Chemical Fundamentals, Modeling and Simulation, Exeriments, Pollutant Formation (2006), Springer: Springer Berlin Heidelberg) · Zbl 1036.80500
[48] Glassman, I.; Yetter, R. A., Combustion (2008), Academic Press: Academic Press Burlington, MA
[49] S. Gordon, B.J. McBride, Computer Program for Calculation of Complex Chemical Equilibrium Compositions, Rocket Performance, Incident and Reflected Shocks, and Chapman-Jouguet Detonations, Tech. Rep. NASA-SP-273, NASA Lewis Research Center, Mar. 1976.; S. Gordon, B.J. McBride, Computer Program for Calculation of Complex Chemical Equilibrium Compositions, Rocket Performance, Incident and Reflected Shocks, and Chapman-Jouguet Detonations, Tech. Rep. NASA-SP-273, NASA Lewis Research Center, Mar. 1976.
[50] Lindemann, F. A.; Arrhenius, S.; Langmuir, I.; Dhar, N. R.; Perrin, J.; McC Lewis, W. C., Trans. Faraday Soc., 17, 598-606 (1922)
[51] Gilbert, R. G.; Luther, K.; Troe, J., Ber. Bunsenges. Phys. Chem., 87, 2, 169-177 (1983)
[52] Stewart, P. H.; Larson, C. W.; Golden, D. M., Combust. Flame, 75, 1, 25-31 (1989)
[53] Reaction Design: San Diego, CHEMKIN-PRO 15113, 2012. http://www.ansys.com/Products/Fluids/ANSYS-Chemkin-Pro; Reaction Design: San Diego, CHEMKIN-PRO 15113, 2012. http://www.ansys.com/Products/Fluids/ANSYS-Chemkin-Pro
[54] 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.0, 2017. http://www.cantera.orghttp://dx.doi.org/10.5281/zenodo.170284; 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.0, 2017. http://www.cantera.orghttp://dx.doi.org/10.5281/zenodo.170284
[55] Venkatesh, P. K.; Dean, A. M.; Cohen, M. H.; Carr, R. W., Rev. Chem. Eng., 13, 1, 1-67 (1997)
[56] Venkatesh, P. K.; Chang, A. Y.; Dean, A. M.; Cohen, M. H.; Carr, R. W., AICHe J., 43, 5, 1331-1340 (1997)
[57] Venkatesh, P. K., J. Phys. Chem. A, 104, 2, 280-287 (2000)
[58] 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. Qin, GRI-Mech 3.0, http://www.me.berkeley.edu/gri_mech/; 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. Qin, GRI-Mech 3.0, http://www.me.berkeley.edu/gri_mech/
[59] Python Software Foundation, Python language reference, version 2.7.10, 2015. Available at http://www.python.org; Python Software Foundation, Python language reference, version 2.7.10, 2015. Available at http://www.python.org
[60] K.E. Niemeyer, N.J. Curtis, http://dx.doi.org/10.5281/zenodo.251144; K.E. Niemeyer, N.J. Curtis, http://dx.doi.org/10.5281/zenodo.251144
[61] van der Walt, S.; Colbert, S. C.; Varoquaux, G., Comput. Sci. Eng., 13, 22-30 (2011)
[62] Behnel, S.; Bradshaw, R.; Citro, C.; Dalcin, L.; Seljebotn, D. S.; Smith, K., Comput. Sci. Eng., 13, 31-39 (2011)
[63] K. Simonov, PyYAML version 3.11, Mar. 2014. Available at http://pyyaml.org; K. Simonov, PyYAML version 3.11, Mar. 2014. Available at http://pyyaml.org
[64] R.J. Hogan, https://github.com/rjhogan/Adept; R.J. Hogan, https://github.com/rjhogan/Adept
[65] Burke, M. P.; Chaos, M.; Ju, Y.; Dryer, F. L.; Klippenstein, S. J., Int. J. Chem. Kinet., 44, 7, 444-474 (2011)
[66] H. Wang, X. You, A.V. Joshi, S.G. Davis, A. Laskin, F. Egolfopoulos, C.K. Law, USC Mech Version II. High-temperature combustion reaction model of \(H_2 / \operatorname{CO} / C_1 C_4\) http://ignis.usc.edu/USC_Mech_II.htm; H. Wang, X. You, A.V. Joshi, S.G. Davis, A. Laskin, F. Egolfopoulos, C.K. Law, USC Mech Version II. High-temperature combustion reaction model of \(H_2 / \operatorname{CO} / C_1 C_4\) http://ignis.usc.edu/USC_Mech_II.htm
[67] Sarathy, S. M.; Park, S.; Weber, B. W.; Wang, W.; Veloo, P. S.; Davis, A. C.; Togbe, C.; Westbrook, C. K.; Park, O.; Dayma, G.; Luo, Z.; Oehlschlaeger, M. A.; Egolfopoulos, F. N.; Lu, T.; Pitz, W. J.; Sung, C. J.; Dagaut, P., Combust. Flame, 160, 12, 2712-2728 (2013)
[68] Shampine, L. F., Numerical Solution of Ordinary Differential Equations (1994), Chapman & Hall: Chapman & Hall New York · Zbl 0832.65063
[69] Lam, S.-H.; Goussis, D. A., Symp. (Int.) Combust., 22, 931-941 (1988)
[70] Lam, S.-H., Combust. Sci. Technol., 89, 5-6, 375-404 (1993)
[71] Lam, S.-H., Combust. Sci. Technol., 179, 4, 767-786 (2007)
[72] Lu, T.; Yoo, C. S.; Chen, J. H.; Law, C. K., J. Fluid Mech., 652, 45-64 (2010) · Zbl 1193.76156
[73] Luo, Z.; Yoo, C. S.; Richardson, E. S.; Chen, J. H.; Law, C. K.; Lu, T., Combust. Flame, 159, 1, 265-274 (2012)
[74] Shan, R.; Yoo, C. S.; Chen, J. H.; Lu, T., Combust. Flame, 159, 10, 3119-3127 (2012)
[75] Hogan, R. J., ACM Trans. Math. Software, 40, 4, 26 (2014) · Zbl 1369.65037
[76] Richardson, L. F., Phil. Trans. R. Soc. A, 210, 307-357 (1911) · JFM 42.0873.02
[77] Lyness, J. N.; Moler, C. B., Numer. Math., 8, 5, 458-464 (1966) · Zbl 0141.33404
[78] Lyness, J. N.; Moler, C. B., Numer. Math., 14, 1, 1-13 (1969) · Zbl 0175.16102
[79] Martins, J. R.R. A.; Sturdza, P.; Alonso, J. J., ACM Trans. Math. Software, 29, 3, 245-262 (2003) · Zbl 1072.65027
[80] Shampine, L. F., ACM Trans. Math. Software, 33, 4, 26 (2007) · Zbl 1365.65057
[81] Ridout, M. S., Am. Stat., 63, 1, 66-74 (2009)
[82] Anderson, E.; Bai, Z.; Bischof, C.; Blackford, S.; Demmel, J.; Dongarra, J.; Du Croz, J.; Greenbaum, A.; Hammarling, S.; McKenney, A.; Sorensen, D., LAPACK Users’ Guide (1999), SIAM: SIAM Philadelphia, PA · Zbl 0934.65030
[83] C. Safta, H.N. Najm, O.M. Knio, http://www.sandia.gov/tchem/index.html; C. Safta, H.N. Najm, O.M. Knio, http://www.sandia.gov/tchem/index.html
[84] Free Software Foundation, https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/; Free Software Foundation, https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/
[85] NVIDIA, CUDA Toolkit 7.5, Sep. 2015. Available at https://developer.nvidia.com/cuda-downloads; NVIDIA, CUDA Toolkit 7.5, Sep. 2015. Available at https://developer.nvidia.com/cuda-downloads
[86] K.E. Niemeyer, N.J. Curtis, C.J. Sung, Data, plotting scripts, and figures for “pyJac: analytical Jacobian generator for chemical kinetics”, figshare, CC-BY license, 2017. http://dx.doi.org/10.6084/m9.figshare.4578010.v1; K.E. Niemeyer, N.J. Curtis, C.J. Sung, Data, plotting scripts, and figures for “pyJac: analytical Jacobian generator for chemical kinetics”, figshare, CC-BY license, 2017. http://dx.doi.org/10.6084/m9.figshare.4578010.v1
[87] Correa, S. M., Combust. Flame, 93, 1-2, 41-60 (1993)
[88] Chen, J.-Y., Combust. Sci. Technol., 122, 1-6, 63-94 (1997)
[89] Bhave, A.; Kraft, M., SIAM J. Sci. Comput., 25, 5, 1798-1823 (2004) · Zbl 1061.65002
[90] Ren, Z.; Pope, S. B., Combust. Flame, 136, 1-2, 208-216 (2004)
[91] Ren, Z.; Liu, Y.; Lu, T.; Lu, L.; Oluwole, O. O.; Goldin, G. M., Combust. Flame, 161, 1, 127-137 (2014)
[92] N.J. Curtis, K.E. Niemeyer, Fileset for testing thread-safety of TChem, figshare, Jan. 2017. http://dx.doi.org/10.6084/m9.figshare.4563982.v1; N.J. Curtis, K.E. Niemeyer, Fileset for testing thread-safety of TChem, figshare, Jan. 2017. http://dx.doi.org/10.6084/m9.figshare.4563982.v1
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.