Mesh refinement for 1D solver

246 views
Skip to first unread message

Alan Kong

unread,
Jun 24, 2015, 8:03:44 AM6/24/15
to canter...@googlegroups.com
Hi all,

I have a question on how the refinement of the grid works in Cantera for the 1D solver.

What I understand from the simulation is this.

     1. You set a grid of equidistance point.
     2. The solver try to solve with these grid points and find a converged solution -> gives initial guess for next iteration
     3. Using the initial guess, it compute this weight function which contains information on the temp slope and temp curvature in the temperature profile in the spatial domain for every grid interval
     4. Comparing this weighting value against a grid refinement value threshold, this determine where new points will be added. (for each grid interval, this weighting value is calculated, if needed, a point will be added halfway in this grid interval)
     5. With the new grid, solver simulation again, find converged solution and calculate the weighting value to see if more points are needed
     6. Repeat process until no new points is added. -> process to solve equations with final grid

So my question is, if u start with a pretty fine grid, those extra points at region of low change in T profile will not be remove I guess since from what I can understand, the refinement process only add more grid points but does not remove unnecessary grid points.

Thus, is it advisable to just give a coarse grid at initial guess, and then subsequent once u roughly know where to flame is, u can set a proper grid according to that problem and speed up the calculation process?

Cheers

Alan





Ray Speth

unread,
Jun 24, 2015, 9:24:04 AM6/24/15
to canter...@googlegroups.com
Alan,

That description of the grid refinement algorithm is mostly correct. I would mention a few clarifications:

- There is not a single weight function, but a test for each solution component at each existing grid point. If any refinement criterion (slope, curvature, ratio) is not satisfied for any solution component (temperature, velocity, each species mass fraction), then a new point is added.
- The refinement process can remove points, if you set a non-zero value for "prune" when calling set_refine_criteria. This is not generally useful when solving a single flame, but can help when solving multiple flames sequentially using the previous solution as an initial guess. The diffusion_flame_batch.py example demonstrates this feature.

Unless you already have a converged solution to a nearby problem, I think you should start out with a relatively coarse initial grid. The time it takes to solve on a particular grid is a function of both the number of points in the grid and quality of the initial guess. When the initial guess is not particularly good, it will be faster to solve with only a few points. Then the subsequent solves on more refined grids should proceed fairly quickly since the initial guess for those problems is reasonably good.

Regards,
Ray
Message has been deleted

Alan Kong

unread,
Jun 25, 2015, 2:28:47 AM6/25/15
to canter...@googlegroups.com
Thanks for the clear explanation!

cheers

Alan
Reply all
Reply to author
Forward
0 new messages