Grid Refinement for One-dimensional Flows#
Overview#
The Cantera 1D solver uses a progressive mesh refinement strategy when solving the governing equations. The system is initially solved on a coarse grid, and then the solution is analyzed to identify regions where it is not well resolved, such as areas with steep gradients. Additional grid points are inserted in these regions and then the system is solved again. This process is repeated until the solution is deemed to be well resolved. This incremental refinement procedure maximizes the probability that the initial guess for each subsequent refined solution lies within the domain of convergence of the Newton solver.
The algorithm tracks information about which grid points should be kept and which ones need to have additional grid points inserted to the right of them. This data is used to refine the grid as well as to prevent too many points from being removed during a refinement step.
Refinement Criteria#
There are 4 refinement criteria that can be set by a user to control the grid refinement process: ratio, slope, curve, and prune.
Ratio#
This refinement option controls the maximum ratio of the spacing between the grid
points that are adjacent to a point under consideration. If the ratio between two
adjacent grid points is greater than the ratio
specified by the user (
Larger Left Interval#
For grid points that have a larger spacing on the left interval, as shown in the figure below,
the ratio,
Larger Right Interval#
For grid points that have a larger spacing on the right interval, as shown in the figure below,
the ratio,
These conditions are checked for all grid points in the domain, and if the ratio is greater than the user-specified value, then an additional grid point is inserted between the two points. To illustrate the interplay between the insertion of points in the domain and the marking of points to be kept, consider again the two cases above.
For the case where the spacing on the right interval is too large, the grid is refined and a stencil of points around the point under consideration are marked to be kept. The figure below shows an example of the stencil of points that are marked to be kept when the spacing on the right interval is too large.
Likewise, for the case where the spacing on the left interval is too large, the grid is refined and a stencil of points around the point under consideration are marked to be kept. The figure below shows an example of the stencil of points that are marked to be kept when the spacing on the left interval is too large.
Marking the surrounding grid points prevents them from being removed during the refinement step that they were marked in. This is one of the ways that the algorithm ensures that the grid does not change too drastically during a refinement step.
Slope#
This refinement option controls the maximum change in a solution component between two adjacent grid points compared to the maximum change in that component across the entire domain. If the ratio of the change in a solution component between two adjacent grid points is greater than the user-specified value, then an additional grid point is inserted between the two points. This criterion is used to ensure that the solution is well-resolved in regions where the solution has steep gradients.
The specific criteria that is being enforced is:
Where
Curve#
This refinement option controls the maximum curvature of the solution component between two adjacent grid points compared to the maximum curvature of that component across the entire domain. If the ratio of the curvature between two adjacent grid points is greater than the user-specified value, then an additional grid point is inserted between the two points. This criterion is used to ensure that the solution is well-resolved in regions where the solution has steep gradients.
The specific criteria that is being enforced is:
Where
Note: The slope is computed using a backward difference scheme and so the estimate of the derivative at a grid point depends on the solution at the grid point and the solution at the grid point to the right.
Prune#
This refinement option works in contrast to the other refinement options. Instead of adding grid points, this option removes grid points that are not needed. The pruning parameter helps the grid refinement algorithm identify areas where the grid may be overly refined. It is most useful when running multiple simulations where the boundary conditions change, and the location of the regions where grid refinement is needed changes. In this case, the prune parameter can be used to remove grid points that are no longer needed.
You specify a pruning value
If
For example, consider a case where the slope refinement criteria is set to 0.5, we
can look at the pruning criteria as
All of the values are below the original
Here, the points with values of