Quad mesh around 2D aerofoil
Quad mesh around 2D aerofoilPosted by Blue Jay at December 29. 2012
I'm trying to create a 'C' mesh around a simple 2D airfoil. I've imported the aerofoil, built the domain and created various faces which I'm gonna mesh then eventually extrude by one cell for use in OpenFoam.
However, I'm really struggling with the meshing process. The approach I've been trying is 2D quadrangle algorithm, 1D wire discretization algorithm, then n.b. segments hypothesis. However, with this it complains there is more than 4 sides (I believe it is classing the section of the airfoil surface as multiple edges), therefore I tried composite side discretization as the 1D hypothesis, however this isn't working either.
As you can probably tell I'm pretty new at this, and I'm rather stumped. Any help would be much appreciated.
Hi Blue Jay,
such a topic (CMesh around airfoil) has been discussed in this forum a few month ago. Check the following link:
Hope it helps,
Re: Quad mesh around 2D aerofoilPosted by William Tougeron at December 29. 2012
Hello Blue Jay
You get this error because each face must have only for edges and the ones touching your foil have more than four. You can check it by using the Measures -> What is tool. This is because you generated your upper and lower sides with the polyline tool (I suppose), which create wires (organised set of edges) and not edges. You should rebuild them with the interpolation tool (New Entity -> Basic -> Curve, then third icon at the top right of the dialogue box "Interpolation").
Then, you will have to split your upper and lower edges only to create the edges of your faces touching the foil. You can do it with the partition tool (Operations -> Partition).
Hope this helps
Re: Quad mesh around 2D aerofoilPosted by Blue Jay at December 29. 2012
Thanks for the replies guys,
Max, I did look at that thread, however I couldn't figure out how he made the quad mesh without any partitions to start with.
William, you're an absolute star! I think that's exactly what I needed. However, when I create a face bounded by the interpolated curve, the face edge doesn't follow the curve. I've attached a screenshot to show what I mean. Is this just a bug or have I missed something?
Hi Blue Jay,
as the name of the function "Interpolation" already specifies: it's an interpolation. In the front area of the wing the length of the section to interpolate is much shorter than in the back section (check the screenshot). I think that the interpolation function implemented in salome is not able to deal with the form. It maybe makes sense to divide the back section in several additional sections.
Stefan, splines made with the interpolation tool of Salome always go through the exact position of the input vertexes.
I make especially foil meshing and the first step of my work is often to rebuild the foils with this tool. Then I create only two blocks (sometime only one) around it and it works fine.
What I see in your screenshot, Blue Jay, is probably a display matter (which is very common in Salome). To fix it, select your geometrical object (eg. your face), left-click in the 3D window, and select
Deflection Coefficient. Then, reduce it to its minimum (by adding some 0s after the period). Like this your face's edge should well follow your foil on the screen
Hope this solved the problem
thx for the information - i didn't know that.
Do you know a possibility to decrease the Deflection Coefficient in general? If i change it in the preferences menu then it's only taken into account for one session.
If i change it in the preferences menu then it's only taken into account for one session.
Yes... I have the same problem and I don't know how to fix it. One time I installed Salome 6.5.0 on a Ubuntu 10.10 version and all the settings were saved between each session. But most of time I install Salome, this is not the case. And I don't why.
I personnaly use the Debian 4.0 Etch binaries and the Install Wizard.
Maybe a developer could help us about this?...
I am also interrested in this issue
Re: Quad mesh around 2D aerofoilPosted by Blue Jay at December 30. 2012
That was indeed the problem! I suspected it was probably a display issue, so I carried on anyway, and now have a decent looking quad mesh! Now to try and fine-tune it and get it running. Many thanks for your help guys.
Hi Blue Jay,
could you post a pic of your final mesh?
I've actually got one more question with regards to meshing algorithms if that's ok? I've been using the 'local length' hypothesis to get all cell lengths around my foil surface consistent. However, they seem to diverge to the nodes above - i've attached a screen shot to show you what I mean. The cells I'm talking about are in the submesh on the upper right of the foil, under the 'orthogonal mode' icon. Is this just the hypothesis not set correctly? I didn't use 'propogation of 1D hyp. on opposite edge' as it wouldn't work. I'm assuming this is as it would try to keep the same cell length as at the surface, and as the edges are different lengths a quad mesh wouldn't be possible. I'll attach the dumped study in another post in case it helps.
Once i've got the cell lengths consistent, i'll propagate them away from the foil surface and hopefully the mesh will be ready to run - i'll post a pic of the mesh then!
Here is the dumped study.
Re: Quad mesh around 2D aerofoilPosted by William Tougeron at December 31. 2012
Hello Blue Jay
I have some problem to run your dump study (it seems that the 6.6.0 version generates sometimes corrupted dump studies because I had a similar problem earlier...).
But looking to your screenshot, I guess you made some mistake when applying your hypotheses. Indeed, all your edges excepted one have exacly 15 segments, which is the default value for the Nb. Segments hypothesis. So I guess you didn't apply the Local Length to all your edges...
In your script, I see that you apply your sub-mesh on sub-geometries that you exploded. But I recomend you to use groups (far more practical to use). In the Geometry module, you can create groups on your object to mesh (right-click on your object in the study tree, then Create Group). Like this, you can create a group containing all your edges touching the foil and apply on them only one hypothesis (eg. your Local Length)
Hope this helps
Re: Quad mesh around 2D aerofoilPosted by Max Fischer at December 31. 2012
Hi Blue Jay,
i tried to set the Local length hypothesis to receive an equal node distribution around the airfoil - in my case it worked without problem (see the attached figure). But with an equal distribution and a fine mesh you receive in the front area of the airfoil quickly bad elements. If you create a very fine mesh then you get in the back area bad elements or you reach the max. element border. From my point of view it makes maybe sense to work with a non-equal distribution. What do you think? Can you maybe write a few sentences about the mesh requirements?
I tried the hypothesis "Number of elements" with an unequal distribution. With that settings i receive a very strange mesh. I think the reason is the orientation of the lines (node 1 to node 2 or node 2 to node 1). Did you make a similar experience?
Re: Quad mesh around 2D aerofoilPosted by William Tougeron at January 01. 2013
Happy New Year
Without screenshot it is difficult to say anything. But if you think the problem is the orientation of edges, you can switch them when editing the Nb. Segment hypothesis.
If you edit your submesh, then if you click on the "edit" button beside your hypothesis, (and if you select a non uniform distribution of nodes), then the edges will appear in the 3D window under the form of arrows. You can select them and add them to the "reversed edge list" by clicking on the Add button. Like this, the edges will be meshed "upside down". (The best to be able to select them is to hide everything before editing the hypothesis, and then don't hesitate to strongly zoom on the edges to select...)
Hope this answered your question
Have a nice day
Hey guys, happy new year!
I agree a non-uniform distribution would make more sense, however I'm getting really confused now with this local length hypothesis, as everything I do seems to throw up errors. If I set a section of the foil surface to a cell length, do I need a hypothesis for the outer edge of that domain section?
Max, I tried to set a local length for the whole foil surface, similar to what you did, and cannot even get a coarse mesh, it continually fails. Something like you produced in your screenshot would be a great start. I keep getting errors at the edges of the domain. I understand that some cell lengths are likely to throw up errors, however no matter what cell length I choose, no section of the mesh is error free. I've attached a screen shot to show what I mean, and I'll attach the dumped study as well in case you can see anything obvious that I'm doing wrong. I really appreciate this help, I'm just going round in circles here!
Here's the study, hopefully it will work this time.
Many thanks guys!
Re: Quad mesh around 2D aerofoilPosted by William Tougeron at January 02. 2013
I have again problem running your dump study... It stops during the meshing step with the error:
Traceback (most recent call last):
> File "input", line 1, in module<br> File "/home/tougeron/Desktop/airfoilmesh.py", line 1257, in module
> [ SubMesh_1, SubMesh_2 ] = Mesh_1.GetMesh().GetSubMeshes()<br> ValueError: too many values to unpack
But the geometry was built and I could try to do the same as you did and I had the same problem as in your screenshot.
The reason is simple
When you propagate the Local Length algorithm, you apply the same local length on your foil as on your farfield
Instead of propagation, you can use the Projection 1D hypothesis on your "farfield" edges. It will "copy" the node distribution exactly as you wanted to do with the propagation.
I also noticed a problem in your geometry: your blocks are not "glued" together, leading to redundant faces between each of them (in your final compound, you should have only one face between two touching blocks). To remove them, your can use the Repair -> Glue Faces tool.
I hope this time you will succeed
Re: Quad mesh around 2D aerofoilPosted by Blue Jay at January 03. 2013
I finally have a mesh! I've attached a pic of it below. Just wanted say thankyou for the help you've both given, i've learnt a hell of a lot! Now to try and get the case running, no doubt i'll get into bother with that as well, but thats for another day.
Re: Quad mesh around 2D aerofoilPosted by Luis Fernando Garcia at June 04. 2013
I've just seen your work and it's fantastic! I do congratulate you for that. Currently I'm learning how to use this software and I'm working with airfoils too, I'm wondering if could you help me on how to import the coordinates of an airfoil into salome-meca? It'll be great if you could help me with that!
My best regards
Re: Quad mesh around 2D aerofoilPosted by William Tougeron at June 05. 2013
My strategy to do so is to create a Python script. It is not complicated.
I use a Spreadsheet (eg. Libreoffice or Excel) to create it. Here is the way:
1- At the top of the sheet, you can write in the first row:
2- Then, in the second row, put in the first column:
Let the second column void.
Put in the third column a single coma:
Let the fourth column void.
Put in the fifth column:
Put in the sixth column:
3- Then, past in the third and fifth columns your X and Y coordinates
4- Extend the other columns to the end of your coordinates. You should have something like this:
geompy.addToStudy(geompy.MakeVertex( 1 , 5 ,0),'Vertex 1')
geompy.addToStudy(geompy.MakeVertex( 2 , 6 ,0),'Vertex 2')
5- Copy-paste your sheet into a text file, save it under the .py format, load it into Salome and press [F5]. That's it!
Hope you will find it useful