Abstract
In this paper, high-order single-point extrapolation-based stiff ordinary differential equation (ODE) solvers are studied for computational fluid dynamics modeling of combustion where operator splitting is applicable. Performances of these extrapolation-based solvers and a state-of-the-art solver using multipoint backward differentiation formula method are investigated in terms of speed and solution accuracy. For a constant-pressure adiabatic system, three ODE systems based on molar concentrations, mass fractions, and mole fractions are considered. Semianalytic Jacobian formulations are derived for all these systems. Compared to the previous study, error quantification analyses are performed in a more detailed way that all physical quantities in the ODE system are taken into account with the purpose that root mean square of normalized errors can be computed (rather than evaluating only temperature and some key radical species). These calculations are repeated for a range of user-specified error tolerance values of each ODE solver considered. Accuracy, computational efficiency, and robustness are demonstrated using chemical mechanisms for real or surrogate engine-relevant fuels that range in size from 48 to 7171 species, and for two configurations: a constant-pressure homogeneous reactor and a high-pressure transient spray flame at an engine-relevant condition.
Similar content being viewed by others
References
Bader, G., Deuflhard, P.: A semi-implicit mid-point rule for stiff systems of ordinary differential equations. Numer. Math. 41, 373–398 (1983). https://doi.org/10.1007/BF01418331
Cai, L., Pitsch, H.: Optimized chemical mechanism for combustion of gasoline surrogate fuels. Combust. Flame. 162(5), 1623–1637 (2015). https://doi.org/10.1016/j.combustflame.2014.11.018
Curran, H.J., Gaffuri, P., Pitz, W.J., Westbrook, C.K.: A comprehensive modeling study of n-heptane oxidation. Combust. Flame. 114(1–2), 149–177 (1998). https://doi.org/10.1016/S0010-2180(97)00282-4
Davis, T.A., Natarajan, E.P.: Algorithm 907: KLU, a direct sparse solver for circuit simulation problems. ACM. Trans. Math. Softw. 37(3), 1–17 (2010). https://doi.org/10.1145/1824801.1824814
Deuflhard, P.: Recent progress in extrapolation methods for ordinary differential equations. SIAM. Rev. 27(4), 505–535 (1985). https://doi.org/10.1137/1027140
Engine Combustion Network Spray A. Available at https://ecn.sandia.gov/diesel-spray-combustion/target-condition/spray-ab/ (2022).
Ferreyro-Fernandez, S., Paul, C., Sircar, A., Imren, A., Haworth, D.C., Roy, S., Modest, M.F.: Soot and spectral radiation modeling for high-pressure turbulent spray flames. Combust. Flame. 190, 402–415 (2018). https://doi.org/10.1016/j.combustflame.2017.12.016
Frassoldati, A., D’Errico, G., Lucchini, T., Stagni, A., Cuoci, A., Faravelli, T., Onorati, A., Ranzi, E.: Reduced kinetic mechanisms of diesel fuel surrogate for engine CFD simulations. Combust. Flame. 162(10), 3991–4007 (2015). https://doi.org/10.1016/j.combustflame.2015.07.039
Gao, Y., Liu, Y., Ren, Z., Lu, T.: A dynamic adaptive method for hybrid integration of stiff chemistry. Combust. Flame 162(2), 287–295 (2015). https://doi.org/10.1016/j.combustflame.2014.07.023
Goodwin, D.G., Moffat, H.K., Schoegl, I., Speth, R.L., Weber, B.W.: Cantera: an object-oriented software toolkit for chemical kinetics, thermodynamics, and transport processes. Zenodo. (2022). https://doi.org/10.5281/zenodo.6387882
Hairer, E., Wanner, G.: Solving ordinary differential equations II: Stiff and differential-algebraic problems, 2nd edn., pp. 131–142. Springer, Berlin Chap. IV.9 (1996).
Herbinet, O., Pitz, W.J., Westbrook, C.K.: Detailed chemical kinetic mechanism for the oxidation of biodiesel fuels blend surrogate. Combust. Flame. 157(5), 893–908 (2010). https://doi.org/10.1016/j.combustflame.2009.10.013
Hindmarsh, A.C., Serban, R., Balos, C.J., Gardner, D.J., Reynolds, D.R., Woodward, C.S.: User Documentation for CVODE v5.8.0. Technical Report UCRL-SM-208108, Lawrence Livermore National Laboratory (2021)
Imren, A., Haworth, D.C.: On the merits of extrapolation-based stiff ODE solvers for combustion CFD. Combust. Flame 174, 1–15 (2016). https://doi.org/10.1016/j.combustflame.2016.09.018
Kee, R.J., Rupley, F.M., , Miller, J.A.: CHEMKIN-II: A FORTRAN chemical kinetics package for the analysis of gas-phase chemical kinetics. Technical Report SAND89-8009, Sandia National Laboratories (1990).
Liu, S., Hewson, J.C., Chen, J.H., Pitsch, H.: Effects of strain rate on high-pressure nonpremixed n-heptane autoignition in counterflow. Combust. Flame. 137(3), 320–339 (2004). https://doi.org/10.1016/j.combustflame.2004.01.011
Luo, Z., Som, S., Sarathy, S.M., Plomer, M., Pitz, W.J., Longman, D.E., Lu, T.F.: Development and validation of an n-dodecane skeletal mechanism for diesel spray-combustion applications. Combust. Theory. Model. 18(2), 187–203 (2014). https://doi.org/10.1080/13647830.2013.872807
Luong, M.B., Luo, Z., Lu, T.F., Chung, S.H., Yoo, C.S.: Direct numerical simulations of the ignition of lean primary reference fuel/air mixtures with temperature inhomogeneities. Combust. Flame. 160(10), 2038–2047 (2013). https://doi.org/10.1016/j.combustflame.2013.04.012
McNenly, M.J., Whitesides, R.A., Flowers, D.L.: Faster solvers for large kinetic mechanisms using adaptive preconditioners. Proc. Combust. Inst. 35, 581–587 (2015). https://doi.org/10.1016/j.proci.2014.05.113
Mehl, M., Pitz, W.J., Westbrook, C.K., Curran, H.J.: Kinetic modeling of gasoline surrogate components and mixtures under engine conditions. Proc. Combust. Inst. 33, 193–200 (2011). https://doi.org/10.1016/j.proci.2010.05.027
OpenBLAS an optimized BLAS library. Available at https://openblas.net (2022)
OpenFOAM open source software for computational fluid dynamics. Available at https://openfoam.org (2022)
Pei, Y., Mehl, M., Liu, W., Lu, T., Pitz, W.J., Som, S.: A multicomponent blend as a diesel fuel surrogate for compression ignition engine applications. J. Eng. Gas. Turb. Pow. 137(11), 111502–1115029 (2015). https://doi.org/10.1115/1.4030416
Perini, F., Galligani, E., Reitz, R.D.: An analytical jacobian approach to sparse reaction kinetics for computationally efficient combustion modeling with large reaction mechanisms. Energy. Fuels. 26(8), 4804–4822 (2012). https://doi.org/10.1021/ef300747n
Perini, F., Galligani, E., Reitz, R.D.: A study of direct and Krylov iterative sparse solver techniques to approach linear scaling of the integration of chemical kinetics with detailed combustion mechanisms. Combust. Flame 161(5), 1180–1195 (2014). https://doi.org/10.1016/j.combustflame.2013.11.017
Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes: The Art of Scientific Computing, 3rd edn. Cambridge University Press, UK (2007)
Ranzi, E., Frassoldati, A., Granata, S., Faravelli, T.: Wide-range kinetic modeling study of the pyrolysis, partial oxidation, and combustion of heavy n-alkanes. Ind. Eng. Chem. Res. 44, 5170–5183 (2005). https://doi.org/10.1021/ie049318g
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.: Comprehensive chemical kinetic modeling of the oxidation of 2-methylalkanes from C7 to C20. Combust. Flame. 158(12), 2338–2357 (2011). https://doi.org/10.1016/j.combustflame.2011.05.007
Schwer, D.A., Tolsma, J.E., Green, W.H., Barton, P.I.: On upgrading the numerics in combustion chemistry codes. Combust. Flame 128(3), 270–291 (2002). https://doi.org/10.1016/S0010-2180(01)00352-2
Yao, T., Pei, Y., Zhong, B.-J., Som, S., Lu, T., Luo, K.H.: A compact skeletal mechanism for n-dodecane with optimized semi-global low-temperature chemistry for diesel engine simulations. Fuel 191, 339–349 (2017). https://doi.org/10.1016/j.fuel.2016.11.083
Acknowledgements
The author is grateful for technical support from Dr. Daniel C. Haworth of the Pennsylvania State University.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The author declares no conflict of interest.
Ethical approval
Not applicable.
Appendices
Appendix
Appendix A describes the SIBS algorithm including modifications that have been made from the original formulation in the literature. Computer files can be provided by the author on request.
Appendix A SIBS algorithm
The original SIBS (semi-implicit Bulirsch-Stoer) method is presented in Bader and Deuflhard (1983). Further discussion can be found in Press et al. (2007), and a C++ implementation has been provided with recent versions of Cantera (see Goodwin et al. (2022)) and OpenFOAM (see OpenFOAM (2022)). Several changes have been made in the current implementation. These include: reformulating the ODEs as described in the main text, including approximations in computing the Jacobian that are described in detail in Section 3; modifying the algorithm used to estimate the solver internal time step and the target order of accuracy, following what was done with SEULEX in Imren and Haworth (2016); adding a Jacobian stability algorithm (see Deuflhard (1985), and Hairer and Wanner (1996)) and other robustness checks appropriate for combustion problems, following what was done with SEULEX in Imren and Haworth (2016); and modifying the data structures for computational efficiency and to use the KLU sparse linear algebra libraries.
The ODE solver is called for each computational element to solve the initial value problem of Eqs. 1–4 of the paper, given the initial composition (either mass fractions, mole fractions, or molar concentrations) and temperature (initial condition vector \({\varvec{\phi }} _ 0 = {\varvec{\phi }} ( t_0 )\)), the right-hand side vector \(\mathbf{S} = \mathbf{S} ( {\varvec{\phi }} )\), and the computational time step \(\Delta t _ \mathrm{CFD}\). The solver requires the user-specified tolerances RTOL and ATOL, an initial estimate of the solver internal time step \(\Delta t _ \mathrm{ODE}\), and an initial target order of accuracy for the time integration. The latter is expressed in terms of the target number of rows to be computed in the extrapolation table \(k_\mathrm{targ} + 1\), and the order of accuracy is a factor of two times the number of rows that is computed. Here \(\Delta t _ \mathrm{ODE}\) is taken to be the solver’s internal time step estimate from the end of the previous CFD time step for the computational element (\(\Delta t _ \mathrm{ODE}\) is saved for each computational element). Discussion of the extent to which the saved value of \(\Delta t _ \mathrm{ODE}\) from the end of the previous time step provides a reasonable estimate for the start of a new time step in an operator-splitting strategy can be found in Imren and Haworth (2016). For the cases reported in this paper, the CPU time and accuracy results are essentially the same if \(\Delta t _ \mathrm{ODE}\) is set to \(\Delta t _ \mathrm{CFD}\) at the beginning of each CFD time step. The value of \(k_\mathrm{targ}\) can be specified directly, or can be computed based on the values of the user-specified error tolerances RTOL and ATOL, and on the maximum number of rows that can be computed \(k_\mathrm{max}\). Here \(k_\mathrm{max} = 12\), corresponding to 24th-order time accuracy. The general idea on each internal solver time step \(\Delta t _ \mathrm{ODE}\) is to construct a sequence of progressively more accurate approximations to \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\), until a solution is found that is accurate to within the user-specified tolerances RTOL and ATOL. Then \(\Delta t _ \mathrm{ODE}\) and \(k_\mathrm{targ}\) are updated, and integration continues over the next solver internal time step, until eventually the end of the current CFD time step \(\Delta t _ \mathrm{CFD}\) is reached.
For each \(\Delta t _ \mathrm{ODE}\), the approximate solutions for \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\) can be organized into a divided difference table (Fig. A1). The table is constructed row by row, starting with the top row (\(i = 0\)), and continuing as needed to the bottom row (\(i = k _ \mathrm{targ} + 1\)). The first two rows are always computed; rows \(3 \rightarrow k _\mathrm{targ} +1\) are computed only if needed to satisfy the specified level of accuracy, as described in the following. Each row i of the table corresponds to a uniform partition of \(\Delta t _ \mathrm{ODE}\) into substeps \(h_i = \Delta t _ \mathrm{ODE} / n_i\), where the sequence of partitions for \(k_\mathrm{targ} = 12\) is:
Entries in the first column of the table are generated using a modified midpoint-rule method; that requires the solution of a linear system. Then an algebraic formula is used to construct columns \(1 \rightarrow i\) to yield successively higher-order approximations to \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\). The Jacobian matrix is computed only once, at the beginning of the procedure for the current \(\Delta t _ \mathrm{ODE}\).
At the start of each \(\Delta t _ \mathrm{ODE}\), some initial operations are performed. The Jacobian \(\mathbf{J} = \mathbf{J} _ 0 = \mathbf{J} ( {\varvec{\phi }} _ 0 )\) is computed. Then a semi-implicit Euler step is taken to compute \({\varvec{\Delta }} _ 0 = {\varvec{\phi }} _ 1 - {\varvec{\phi }} _ 0\) for a time step \(h = h_0\):
This form (divided through by the time step) is computationally expedient, as it reduces the number of operations required to update the solution when h changes (for fixed \(\mathbf{J}\)). A “Jacobian stability” algorithm is applied to ensure that the time step is sufficiently small for the method to eventually converge. The approach was suggested by Deuflhard (see Deuflhard (1985), and Hairer and Wanner (1996)), based on convergence of Newton iterations. Eq. A2 is solved again with the right-hand side vector updated based on \({\varvec{\phi }} _ {1}\) (without updating the Jacobian), to obtain \({\varvec{\Delta }}_1\):
The computational cost is that of a single right-hand side evaluation, since the factored matrix is available from the first solution of the linear system. A monotonicity check is then performed to ensure that \(\theta \equiv |\mathbf{\Delta }_1 / \mathbf{\Delta } _ 0 |< 1\). If \(\theta \ge 1\), \(\Delta t _ \mathrm{ODE}\) is reduced by a specified factor f (here \(f = 2\)), and the solver internal time step is restarted. When \(\Delta t _ \mathrm{ODE}\) is sufficiently small that \(\theta < 1\), the algorithm proceeds.
First-column entries for rows \(i = 0 , \ldots , k _ \mathrm{targ} + 1\) are computed (only if needed for \(i > 1\)) using a modified semi-implicit midpoint rule. For row i, \(m = n_i\) (Eq. A1) steps are required to integrate from \({\varvec{\phi }} _ 0\) to \({\varvec{\phi }} ( t _ 0 + \Delta t _ \mathrm{ODE} )\). A semi-implicit Euler method is used for the first step; that is followed by \(m - 1\) steps using a semi-implicit midpoint rule; then a final “smoothing step” is taken. With \(h = h _ i\) and \(\mathbf{J} = \mathbf{J} _ 0\), the algorithm (written in terms of the solution update on each step, \({\varvec{\Delta }} _ k \equiv {\varvec{\phi }} _ {k+1} - {\varvec{\phi }} _ k\)) can be written as:
Then \(\overline{{\varvec{\phi }}} _ {m}\) is the first-column table entry for row i. The computational cost for each step is that of a single right-hand side evaluation.
As noted earlier, the table of successive approximations to \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\) is constructed row by row, and only as needed for \(i \ge 2\). The first-column entry for row i is computed using the modified midpoint-rule method described above. Then the Aitken-Neville algorithm (or Richardson extrapolation) is used to calculate columns \(1 \rightarrow i\) of row i to yield higher-order approximations to \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\), where the order of accuracy increases by two in each successive column:
This formula is used to compute \({\varvec{\phi }} _ {i,j}\) for \(1 \le j \le i\), where \({\varvec{\phi }} _ {i,j}\) is a \(\bigl ( 2 \cdot (j+1) \bigr )\)th-order approximation to \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\). As each row of the table is computed, an estimate of the work required for that row (denoted as \(cpu_i\), proportional to the CPU time used to form the row) is computed and stored, based on the number of linear system solves and right-hand side updates. After each row is computed, convergence is checked using criteria that are essentially the same as those used in CVODE. Here the difference between \({\varvec{\phi }} _ {i,i}\) and \({\varvec{\phi }} _ {i,i-1}\) is used to determine whether or not \({\varvec{\phi }} _ {i,i}\) is a sufficiently accurate estimate of \({\varvec{\phi }} ( t_0 + \Delta t _ \mathrm{ODE} )\). For each dependent variable \(\alpha\) in table row i, \({\Delta } _ {\alpha , i} = \vert \phi _ {\alpha , i,i} - \phi _ {\alpha , i,i-1} \vert\) (\(\alpha = 1 , \ldots , N _ {\phi }\)) is calculated, and a scaled error is computed as:
where \(scale _ {\alpha } \equiv \mathrm{ATOL} + \vert \phi _ {\alpha , i , i} \vert \cdot \mathrm{RTOL}\).
A provisional value of \(\Delta t _ \mathrm{ODE}\) for each row, \(\Delta t ' _{\mathrm{ODE},i}\), is computed and stored based on the expected relationship between the scaled error and the time step size:
from which a provisional value for the next internal time step is:
where \(S_1\) and \(S_2\) are heuristic “safety factors” whose values are close to, but less than, one. Convergence corresponds to \(err _ {i} < 1\). If \(err _ {i} \ge 1\) and \(i < k _ \mathrm{targ}\), the algorithm continues to the next value of i (to compute the next row of the table). If \(err _ {i} \ge 1\) and \(i = k _ \mathrm{targ}\), \(\Delta t _ \mathrm{ODE}\) is reduced by a specified factor f (here \(f = 2\)), and the time step starts over using the smaller value of \(\Delta t _ \mathrm{ODE}\). If \(err _ {i} < 1\), then \(i _\mathrm{conv}\) (the row at which a converged solution was found) is set to i, \(\Delta t _ \mathrm{ODE}\) and \(k _ \mathrm{targ}\) are updated as described below, and integration proceeds to the next solver internal time step.
At the conclusion of a successful (converged) internal time step, the values of \(\Delta t _ \mathrm{ODE}\) and \(k _ \mathrm{targ}\) for the next internal time step are set in a manner that is expected to yield a converged solution for the least CPU time, based on the values of \(\Delta t ' _ {\mathrm{ODE},i}\) and \(cpu_i\) that were computed and stored for each row for the current time step. Specifically, \(\Delta t _ \mathrm{ODE} = \Delta t ' _ {\mathrm{ODE},i_\mathrm{conv}} \cdot cpu_{i_\mathrm{conv}} / cpu_{i_\mathrm{conv}-1}\), and \(k_\mathrm{targ}\) can decrease by two if \(cpu_{i_\mathrm{conv}-1} / h_{i_\mathrm{conv}-1} < 0.7 cpu_{i_\mathrm{conv}} / h_{i_\mathrm{conv}}\) and can increase by two if \(cpu_{i_\mathrm{conv}-1} / h_{i_\mathrm{conv}-1} > 0.9 cpu_{i_\mathrm{conv}} / h_{i_\mathrm{conv}}\).
Additional tests have been implemented for robustness in combustion applications. The temperature is checked to ensure that it remains between the lower and upper limits specified in the thermodynamic property data, and the magnitude of the scaled change in the solution vector over an iteration is checked to make sure that it is not too large. A failure of either of these checks also results in a reduction in \(\Delta t_\mathrm{ODE}\).
Rights and permissions
Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Imren, A. A Detailed Error Quantification Analysis of Extrapolation-Based Stiff ODE Solvers for Combustion CFD. Flow Turbulence Combust 110, 457–488 (2023). https://doi.org/10.1007/s10494-022-00369-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10494-022-00369-z