This formulation for the reactor's governing equations significantly improves
the performance of integrator, mostly by improving the quality of the
Jacobian. The effect is small for smaller mechanisms (GRI 3.0) but can lead to
order-of-magnitude improvements for mechanisms with hundreds or thousands of
species.
Since this set of variables corresponds to the intrinsic state variables used
for IdealGasPhase objects, we also eliminate the need to iterate when setting
the state of the thermo object.
Additionally, by using temperature as an independent variable, the
temperature-dependent parts of the kinetic rate expressions do not need to be
recomputed while updating the Jacobian (this optimization is not currently
implemented).
To eliminate discontinuities in Cp/R, H/RT and S/R between the high- and
low-temperature NASA polynomials, formulate and solve a linear least squares
problem for a set of 11 coefficients (3 of the original coefficients 14 being
eliminated by the continuity requirements) which minimizes the changes in the
computed properties at a set of temperatures covering the valid temperature
range.
We expect the high- and low-temperature NASA polynomials for each species to be
continuous in a number of places, despite many frequently used thermo databases
having data that is inconsistent.
In addition to warning about discontinuities, We now modify the provided
coefficients to ensure continuity at the midpoint temperature. This resolves
numerical issues, e.g. with the algorithm used for setting the state of a
reactor network.
Actual array values could be outside the assumed bounds as a result of solver
tolerances, so it doesn't actually make sense to check these when restoring the
solution.
Resolves Issue 88.
This addresses a performance issue where many failed timesteps would be
taken after adding new grid points. These failed timesteps are slow because
they require additional Jacobian re-evaluations. It is more efficient to
preemptively reduce the time step after adding new grid points.
Resolves Issue 155.