Is Grid Generation an Art or Science?

Figure 1: Grids for multi-element configurations using various modes of grid generation. Image courtesy – centaur software and ISCFDC

opinion.                                                                                                            3832 words/ About 20 mins

Since the birth of the engineering field of Computational Fluid Dynamics, there is a raging debate on the topic,  whether grid generation is “an art”  or  “a science” ?. There are strong reasons to support either one or the other , but the debate continues. CFD in general is seen as a science, a tool to mathematically obtain fluid flow information. CFD solvers making use of numerical algorithms and the grid-generators, both math  based, at the fundamental level is seen as science. However the arrangement of grid points in the computational domain is seen as an “art”, an element greatly influencing the outcome of the CFD simulation.

Why  “art”  in the first place?
Immaterial of the element shapes , whether triangles/tetrahedrons/triangular prisms, quadrilaterals/hexahedrons, or very general polyhedrons, they are glued together in some fashion to form what is called a grid (mesh) that envelops the domain of interest. The envelope forms the foundation upon which the physics solver (typically CFD solver) must operate. The general perception in the grid generation part of the story is  , the process of generating it is more of  “an art” than  “a science”. Is there an inherent rationale behind the arrangement of the basic geometrical elements or its just a subject matter of visual feel/appeal of the meshing software ?

Can a bunch of logical reasons or rational explanations be called a “science”? Is there a need for a debate on the classification of grid-generation? Why worry on the details of grid generation? , can we not move on to the solver straight away? Why can’t we trust the physics solver to generate accurate, reliable CFD numbers for the fluid flow problem at hand and move on?

If we sit back and contemplate , it’s easy to see why this debate came into existence in the first place. The simple reason being – all grids are not created equal. And all grids do not give you the same CFD results even for a simplistic geometry like an airfoil. Let alone the type of elements chosen, and the total number of elements , the arrangement and alignment of these elements is  significant and can have a strong influence on the final outcome.

The definition of science tells us , a process can be termed as science if it can be replicated under similar conditions by different individuals who in the end should converge exactly to the same results. This basic definition seems to be violated in the field of grid-generation, and hence has taken the tag of “an art”.

Figure 2: Cartesian grid for NHLP2D configuration. Image source – ISCFDC

The “science” of grid-generation
Various aspects of grid generation have a deep scientific reasoning behind what we do with it , and why we go about doing it. For instance, there is a reason for the first cell height placement inside the boundary layer, a reason for the growth rate used, a reason for the choice of the far-field distance, a reason for the orthogonality of cells inside a boundary layer, a reason for the choices of grid density, and, of course, a reason to stress high grid quality and so fourth. And, moreover, in addition to all of these rational choices, there is the underlying need to accurately represent the boundaries of the simulation region. These choices and associated constraints upon the grid have their roots in the physics of fluid dynamics, the given regional geometric definitions, and the extent within which the numerical methods do function. For other physics based simulations, there are yet more reasons for additional and/or different constraints upon the generated grid.

This “science” based aspects of grid-generation is greatly understood and appreciated in the CFD community. In a way, this has helped to standardise the grid generation practices and has aided in automating parts of the grid-generation process. Based only on the foundation of scientific rational reasoning, members of the CFD community have established international workshops like the American Institute of Aeronautics and Astronautics (AIAA) Drag Prediction Workshop (DPW) and the AIAA High Lift Prediction Workshop (HiLiftPW) in order to assess the CFD methodology as validated against wind tunnel experiments. A bigger chunk of this process are the flow solver strategies and the act of grid/mesh generation. Due to its importance, the committees running these workshops have come-up with formal guidelines for grid generation that address the classification of fluid flow problems. Imbedded in these classifications from the workshops, there are significant signals of what is good and what is not.

If we were to stand back from the minute details, it is only due to a set of rational and logical reasoning in the grid generation process,  we have been able to teach , replicate , and enable flow solvers to generate meaningful CFD data as best as they can.

When we speak of “meaningful”,  what we are really saying is that we can trust the accuracy of the CFD results so that we can make good decisions from those results. Such decisions rely upon having enough CFD accuracy to answer our key questions with respect to the level of physics being modelled. All of this can make CFD a powerful and reliable design tool.

Figure 3: Unstructured grid for NHLP2D Multi-element Configuration. Image source – Centaur Software

The “art” of grid-generation
Having seen some of the scientific aspects of the process, we are brought to the question: What is in grid-generation which makes one perceive it as more of as an art than a science?

The answer lies in the way we go about filling the computational domain with the geometric elements. Though, all we do is populating the fluid region by a grid of an element type or types, it is really how we go about doing it and which of the various options we use. It is this collective whole in the end which brings us to the differences among the grids. Even, well within the standard grid generation framework that was laid out, there are various possibilities and it is up to the CFD engineer to decide which options to pick and use to create the grid.

This aspect can be clearly seen in the grids generated by the participants in CFD workshops like the AIAA DPWs and HiLiftPW. Even after adhering to the stringent guidelines prescribed by the committees, the grids, whether structured or unstructured are visibly different, which in turn are reflected in the simulated CFD results. It is for this reason that the organizers would like the participants to use the workshop committee grids, as this will aid in reducing the wide scatter of CFD results due to variation in grids.

What makes grid-generation seem artistic is the fuzzy value or nature of desired grid features, although many, of them, can be stated in a rather analytical way. This includes grid alignment to flows, grid point patterns, good element shapes, gentle transitions between the elements (smoothness), local enrichment for anticipated physics, and relative cell orientations. Although this list is not necessarily complete, it does indicate that various tradeoffs are required and that the person doing the grid generation must then make a number of choices along the way. Standard grid generation guidelines have laid out stringent rules for some specifics such as grid resolution, growth rate and cell count, but not for the fuzzy items like flow alignment or topology structure which bring in the differences in sometimes less than subtle ways.

Figure 4: Cut section showing volume grid at a spanwise station on JAXA high-lift configuration as generated for the AIAA HiLIFTPW-3 Workshop. Referring the same gridding guidelines, different organisations have generated different grids. A – NASA Ames Chimera grid tools, B – DLR SOLAR, C1 – VGRID, C2 – VGRID, D – JAXA tools, E – ANSA. Image source- HiLiftPW-3 Workshop

The mysterious aspects of grid generation
A common method to reduce uncertainty is to perform a grid convergence study, whereby a family of grids are generated and used at various levels of point count. This is done in order to eliminate some of the uncertainties due to grid resolution. In doing so, one must navigate through items like the first cell off the wall and growth rate for the treatment of boundary layers. However, albeit with the best of intentions, they do fail to quantify the role of the more fuzzy qualities. It is these aspects that seem to highlight the art of grid generation.

In the case of multi-block grids, this process is easier to do and is also much more precise in the end. What one does in this context is to generate a fine grid that has a succession of embedded sub-grids of progressive lower density. For example, suppose that we simply want a fine, medium, and coarse grid. Then we generate a fine grid with a factor of 4 in its cell count from which we then combine neighboring cells to get the medium grid, and from the medium grid we do it again to get the coarse grid. Aside from the ease with which this is executed, we do have grid points that do not change as we go up in resolution: there is no interpolation required in going up from coarse to medium to fine. However, we do have one concern, which is the required first spacing off of the wall for boundary layers. What this means is that our fine grid first off the wall spacing must be 4 times finer than that in the coarse grid.

For the various unstructured approaches, we do not generally have such a nice nested structure. Each grid level is generated separately with variations in the total number of points which then will give us say a fine, medium, and coarse mesh. Due to the separate mesh generation actions, it is easy to enforce the same first spacing off of the wall for the boundary layer. However, the general transfer of data between the meshes needs interpolation.

Even the type of elements chosen to generate the grid plays a role in mystifying the differences brought to the CFD solution. Although improvements in CFD solver algorithms over time have diminished the influence of element types, there still remain such differences and those differences are hard to assess in an analytical way. The fact is clearly still evident, that quadrilateral and hexahedral elements still score over other element types and  good multi-block assemblies of such elements score even higher.

This is quite evident in the wider spread of CFD results from the various participants using unstructured grids when compared with the participants using structured grids. This phenomenon occurred in both the Drag Prediction and Highlift workshops. This is not by chance. Structured grids are more flow aligned, less dissipative, and better at capturing the physics than their unstructured counterparts.

In the aspect of flow alignment, unstructured quads/hexas are better than unstructured trias/tets, regularly placed Cartesian hex cells are better than the unstructured quad/hex, while structured multi-blocks quad/hex cells are far superior to cartesian quad/hex.

Though the type of elements are the same in Cartesian and multi-block structured grids, the lack of low alignment, the persistent presence of hanging-nodes, lack of smooth gradual transitioning across grid levels and the shift in the grid arrangement at the boundary layer padding interface, makes Cartesian grids less accurate compared to multi-block.

It is for this reason that, CFD engineers opt for structured multi-block when they want to quantify the change in fluid-flow due to minute changes in product design. Though sometimes painful to generate, it’s considered to be worth the effort as it captures the changes in fluid flow due to subtle variations in geometric parameters with higher accuracy . Long term CFD engineers in certain specialised fields like Hypersonics assure structured multi-block is the only way for them to get accurate reliable numbers.

Figure 5: Structured Multi-block grid for MDA-3 Element Configuration using GridPro.

Prominence of the “art” aspect in multi-block structured grids
In a way, the tag of “art” can be more aptly crowned on multi-block structured grid generation than on any other modes of grid generation. Unstructured , Cartesian meshing  and polyhedral meshing are automatic in nature with lesser user intervention.   Apart from fixing the element size, growth rate, number of layers in the viscous padding, there is hardly anything much a user can do to influence the final grid. What the user gets is a pretty uniform carpeting of the flow region in an automated way. What the user does not get is the ability to extract reliable CFD results in situations that are physics intense and/or answering questions that need a higher level of accuracy. The mystery aspect of flow-alignment and the ways to control it is not understood in a clear way.

If there is any element of “art” in purely unstructured grid generation, it lies in the quality of appreciation of the geometry and the flow-field by the Engineer, and the subtle way in which he plays with the available options in capturing the geometry and physics. This is something, which comes only with experience. Though one may frame a set of rules for grid-generation, it is the subtlety of using these options, which gives the “art” angle to unstructured grid generation.

Unarguably, the structured multi-blocking is where the “art” aspect is explicitly observed. The way the blocks are built and arranged and aligned around the body of interest is all dependent on the creative intelligence of the CFD Engineer. The 3D visualizing ability of the Engineer is tested to the core. The ability to create logical blocks around tricky corners and locations is what sets apart a good mesh generation player from an average mesh generation player.

In a multi-block grid generator like GridPro, there are multiple ways to create a logically correct topology for even a simple configuration like an airfoil. In each way, there is typically some desired advantage. Such advantages can be to locally resolve certain flow field physics features of particular interest. Since what the primary user inputs is the pattern of points expressed through a coarse overlaid wireframe, it is quite easy to create grids with many blocks. However, this is sort of like opening a pandora’s box. The flexibility offers a huge opportunity to deploy a number of options to play with. This means that users have a larger window on creativity, which in turn increases the artistic quotient of the grid generation process. It is this aspect, which makes structured multi-block grid generators more artistic than other modes of grid generation. On the other hand, from a user defined topology the grid generation is automatic and thus can inspire automated strategies for complete automation, especially with various vertical applications.

Figure 6: Airfoil with Icing, Multi-Block Structured grid using GridPro.

The tension
As we have noted already, there are various levels of automation with the most automatic generic methods being a trimmed Cartesian approach, a tetrahedral approach, and a polyhedral approach. In each of these generic approaches, the flow field region is uniformly carpeted in some manner while giving some provision to treat viscous flow boundary layers. Such boundary layer treatment has involved some level of hybridization with different element types.

In most cases, the boundary layer treatment has been quite modest for the broad brush collection of users of the generic CFD codes while those practitioners who are closer to doing a better job tend to be more of the extreme specialists who typically do not use the “standard” broad brush CFD offerings, at least in a direct manner. By a modest boundary layer treatment, we typically see just a few cells given to resolve the boundary layer and a lack of smooth transition from the boundary layer portion into the rest of the field. In doing so, the fluid dynamic solution will not conform to truth when the boundary layer goes unresolved and/or gets smeared away upon hitting the non-smooth transition between layer aligned grid and the rest of the inner grid portion.

In a further quest for human access, the entire CFD process is bought inside CAD or at least to a higher level of integration with CAD. Quite often, this level of access is called the “democratization of CFD” which means that CFD is now opened up to a much larger group of users. What this means is that, in addition to an already growing number of new CFD users, we do add even many more to the pot. The argument here is that we do not need to hire the so called CFD experts who typically have some advanced degree in the subject of CFD or fluids for that matter.

Given this situation, we are brought to a new term from number users. What is now often said is the flow field solution is “good enough”. This term has to be considered with some care. On one end of the argument, there is some truth to this statement. That truth is that if we have a  situation in terms of the physics being modelled and/or we ask a very modest question, then we can get an answer that is a good guide for our decision making. For example, if we were using CFD to fly a kite, we might want to know what direction the wind is blowing and if it is strong enough for the kite to fly up, then the simple use of broad brush CFD codes will give us the desired answer with quite a bit of over-kill. A more down to earth example would be that of asking for the air resistance on a car traveling at 30 mph. Here, we would be ok with the answer. However, if we asked for the level of noise generated by a side mirror on the car we would then be challenged on trusting the answer. Our take away from these examples, is that there are a group of cases where the broad brush CFD approach can answer what we desire to know.

Figure 7: Structured Multi-Block Grid for a Wind Turbine using GridPro. 

On the other end of the “good enough” statement, we can find ourselves in trouble. This is because we can get output data typically in a good graphical form but upon examination we cannot trust what we see in order to make meaningful decisions. This situation will occur when the physics is more significant and the questions are more thorough. In order to assess the value here, the user needs to have a greater depth of understanding. What happens now is that there are quite a number of levels required for this understanding to happen and as a result we now have a cascade of people and associated cases under simulation. What occurs is that the CFD must be more carefully monitored and this quite often involves doing the grid generation portion in a much better way. Even what is good for the AIAA workshops like DPW and High Lift is quite often not good enough for even higher end physics situations like hypersonics.

In addition, to the pure flavours of grids represented above, there are a number of fully hybrid grid methods where we try to use some hexahedral grid structure (such as multiblock) for the needs of certain regions and unstructured grids for other regions. While well intended, there are some “artistic” issues with this approach. In order to transition between the hexahedral elements and the tetrahedral elements, we need to use pyramidal elements. However, in many CFD applications, the pyramidal elements are known to hurt the solution accuracy. Thus, we now see a need for users to push the pyramidal elements away from the regions of significant physics and thus we see the need to do this artfully.

The net effect of all of this is that, the quality of the CFD process is split into successive levels. For the more general generic application, where there is little requirement of users to understand in a good enough way to successively higher levels, where a greater degree of user understanding along with associated actions is required. In summary, what we have is a tension of what to choose as we go from level to level.

These choices impact what we choose to do for grid generation, which will have an ever growing impact upon the CFD results. For example, for airplane applications there are many choices for grid generation while for hypersonic applications the choices become more focused upon multi block grids with higher quality. Also, as the choices become more challenging for CFD, the need grows for departing from the simple uniform covering of the flow domain to one where the grid points are more concentrated in the location where interesting physics is expected. The desire to automate these concentrations brings us to consider adaptive grid generation, and this is yet a further discussion that considers a multitude of strategies for a multitude of cases. We leave this for another time.

If we stand back a bit, we see that there is a real tension between productivity in the process of doing CFD and gaining enough value from the results of CFD. As we have seen above, we gain the most productivity with enhanced automation and the most CFD value from the needed accuracy. In the big picture, we use CFD to gain reliable and trustworthy results for our decision making as balanced with how long it will take to execute the CFD process. Thus, we have the tension between the time of execution and the value of the results from that execution.

Figure 8: Structured Multi-block grid for a Spaceship configuration using GridPro.

Concluding remarks:
Mankind has designed airplanes, blasted-off rockets and has reached moon even before the advent of modern powerful high-speed computers. Even though not having understood and deciphered all the nitty gritty of aerospace, these amazing feats were possible.

In a similar lane, whether grid-generation is a definable, measurable and replicable scientific process or is it is seen as an artistic creative process with a pint of elusive mystery associated with it, it is something, which has made CFD a reliable engineering tool, aiding in the design of various products over the years.

Art or science, CFD simulations needs healthy grids to generate reliable numbers. How “healthy grids” are generated is up to the CFD engineer. Whether he sees himself as Leonardo da Vinci painting a Mona Lisa or a man of science following a stringent set of rules and generates the grid, the bottom line is, it doesn’t matter. What matters at the end of the day is whether the design engineer is satisfied with the data churned by CFD simulation and whether it is unquestionably reliable to be used in his product design. After all CFD is just a tool to get flow parameters to design a device and grid-generation is just one stage out of many in meeting that objective. That’s the bottom line and the rest are mere arguments of the ever-contradicting human minds.

Facebook
Facebook
Google+
Google+
http://blog.gridpro.com/grid-generation-an-art-or-science/
YouTube
LinkedIn

Subscribe To GridPro Blog

By subscribing, you'll receive every new post in your inbox. Awesome!

Leave a Reply