# Grid generation around airfoil from data

Here is the data

I have (x,y) data for a grid around an airfoil and I am trying to figure out how I can draw radial and polar lines for the grid to look like a mesh. I have tried ListPlot and ListLinePlot, but I have only managed to get circular lines, but not radial ones.

Here is what the data looks like:

and here is ListLinePlot

How can I improve these images?

• It'd be good to get the data. Feb 15, 2013 at 2:35
• I think we really need to see the data, but until then take a look at ListCurvePathPlot. Feb 15, 2013 at 2:39
• How do I include a .dat file here? Feb 15, 2013 at 3:10
• You have to upload it somewhere else and link it. Sorry. :-/ Feb 15, 2013 at 3:15
• A mere set of points, such as that in the data file, is practically meaningless--there are infinitely many ways they could be gridded. In fact, from the images it appears that the points have little to do with aerodynamics and everything to do with the interpolation algorithm. What are you really trying to achieve? Are you trying to depict flow and potential around the airfoil? Or are you trying to depict a finite element mesh used to solve equations? (That appears to be the sense in which the existing answer is offered.) Something else? Feb 15, 2013 at 3:28

By looking at the plot and the connecting line stretching along the x axis, I'm guessing the structure of the data is as follows (I could be wrong, but this seems to make a lot of sense):

t = Flatten[
Table[r {Cos[x], 2 Sin[x]}, {r, 1, 10}, {x, 0, 2 Pi, Pi/10}], 1];

Show[ListLinePlot[#], ListLinePlot[Transpose[#]]] &@
Partition[t, Nearest[(# -> Range[Length[#]]) &@Rest@t, t[[1]]] + 1]


So what I did then is to re-create an additional level in the given list t such that the individual round-trips around the origin (airfoil) can be separated. That list is then plotted as is to get azimuthal lines, and transposed to get radial lines.

Not knowing the dimension of the data, I had to add some gymnastics to feel out the length of the azimuthal sublists corresponding to a round-trip. I did this using Nearest to find when the points revolve back to the closest distance to the first element of the list.

If you want the grid to look more uniform and thinner, you could do something like this before plotting:

SetOptions[ListLinePlot, PlotStyle -> Directive[Black, Thin]];

• OK, I just checked that my solution works with your data. Problem solved. Just name your data list t and use the Show command.
• @l3win The line width should default to the thinnest possible. If you have it set to something else try PlotStyle -> AbsoluteThickness[1] inside ListLinePlot. If you want the lines to appear lighter (but not be thinner) try PlotStyle -> Opacity[0.5]. Feb 15, 2013 at 3:41