I am new to the field of CFD. When should one go for structured grid and when should one go for unstructured? (Yes, it depends a lot on the geometry of the problem) More specifically, I want to know the difference in the computational power required, accuracy achieved and efforts involved in both types of grid. What are good resources that explain structured and unstructured grids in most simple language?
I am currently implementing a VoF method (a geometrical method for two phase flow simulation on Eulerian mesh) that is native to structured grid, on an unstructured grid, so here are my experiences so far (please note that what I'm writing comes from working with a specific implementation):
- fast generation of meshes for complex geometries
- straightforward operations on mesh topology
- tetrahedral mesh: edge swapping, refinement
- hexahedral mesh: octree based refinement (split the cell with 2 planes)
- sliding mesh interfaces (rotating geometries, etc)
- finite volume method built on top of this kind of mesh: it is robust, parallelization of the method is straightforward, implementation of boundary conditions is very easy
reduced accuracy because of a smaller cell stencil: you can only access face neighbours of a cell (this may differ for different mesh implementations, but in my case it is so)
because of a smaller stencil, implementation of higher order interpolation schemes (WENO, ENO) is very difficult (problems in parallelization)
reconstruction of gradients for sharp fields that propagate in the skew direction (involve information coming from point neighbours) is not straightforward
higher accuracy than for unstructured mesh: you can access points in all directions and build large stencils
octree based mesh refinement: the mesh is represented using an octree data structure, so the top level geometry is a box
refinement is much faster than for unstructured (on an unstructured mesh, the complete mesh is copied and inflated)
for dealing with relative motion of bodies, complex immersed grid (chimera mesh) are used (most are not mass conservative)
if you need a boundary conform mesh, you can do it for curved boundaries, but the discretization is then translated into the curvilinear coordinate system
mostly used for flow domains in the shape of boxes (however, octree refinement and cell cut methods allow for fully complex geometries within the boxed domains)
So, if you have a boxed domain, and a complex geometry within, and you require high accuracy, use the structured mesh.
On the other hand, if the geometry of your domain bounary is complex (like metal alloy casting into complex moulds), use the unstructured mesh. Also, if the simulation requires relative motion of bodies, unstructured mesh is the choice, simply because the chimera libraries are very difficult to get (military based research).
Another question is what is available to you at what cost, like: licence fees, time needed to learn an open source library, etc.
As you have mentioned yourself, this is greatly dependent on the geometry of the problem involved but also on the computational framework used (i.e. FEM, FDM or FVM).
Finite Difference Methods (FDM) are often restricted to structured grids that do not require special data structures for recording of grid information. That being said, FDM can be extended to semi-structured grids such as adaptive quadtree or octree based grids by using more sophisticated data structures. Nevertheless, structured grids are much simpler to code and easier to develope. Besides, with this type of grids, domain decomposition and parallelization are often trivial. They are usually suitable for simple domains, but certain methods, such as immersed boundary or immersed interface methods, have been developed that utilize this type of grids for even non-trivial geometries.
Finite Volume Methods (FVM) and Finite Element Methods (FEM), on the other hand, are often more general and can (uniformly) handle various geometries. This, however, comes at the cost of using more complicated data structures which results in more complex algorithms and more development-time. They are usually harder to parallelize since the the grid now should be partitioned into sub-domains before they are sent to different processors. That being said, the existence of well-written software packages for specific tasks (such as preconditioners, linear solvers and graph partitioners) along with their robustness and versatility, makes them an excellent choice to consider if you have non-trivial geometries.
Finally, no matter which type of method (and thus grid) you choose, there both high (expensive) and low (cheap) order methods in all three different families that you can choose from for your specific problem.