Unstructured airfoil mesh

Hello,

I am trying to create an unstructured hexahedral mesh for flow past a wing in 3D. In this case the wing geometry is 2D and the third direction is a simple extrusion. I’m struggling to understand how to control the mesh density. I am using a spectral element solver so my code is rather sensitive to the grid but it is difficult to predict apriori.

For now I can make a structured grid but that is a bit problematic due to high aspect ratio cells nears the boundary. With an unstructured grid I am able to to make a grid as well but I’m struggling with how to control the high resolution and low resolution areas. I used the boundary layer option to generate a structured grid near the airfoil and that is not very satisfactory.

I’m struggling with how to ensure a relatively smooth transition between a structured near airfoil grid and a relative refined separated flow and wake region. I have a good intuitive sense of what the grid should look like but I’m not sure how / what I would do to get that.

I added a few pictures. I want something like unstr_wing.jpg and airfoil_mesh_far.jpg but so far I have a messy field which doesn’t seem to give me much control of where resolution is concentrated.

Any help would be greatly appreciated.

Matt