Personal tools
You are here: Home Forum Use Re: C-grid around an airfoil, for viscous CFD analysis

Re: C-grid around an airfoil, for viscous CFD analysis

Up to Use

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Luca Cirrottola at September 26. 2012

Hi everybody,

I'm new to salome (i've been using it for less than a month), and I'm interested in hexahedral meshes for CFD simulations.

I'm trying to create a C-grid around a NACA airfoil for a 2D viscous CFD simulation in OpenFOAM. Using Python scripts, I have managed to create a face around the airfoil and to mesh it with a 2D quadrangle algorithm, using propagation of 1D hypotheses from the airfoil contour to the external boundary. Once this grid is properly refined, I will extrude it of one cell.

However, in my mesh the cells are very inclined near the wall. I'd like to ask whether there is a way to impose grid orthogonality to the face edges, as it happens when dealing with C-grid structured meshes.

I'll attach some images to make what i mean more clear.

Thank you in advance,

Luca

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Luca Cirrottola at September 26. 2012

The first image refers to the grid i wish to create. The following one is a zoom of my current mesh.

Thanks.

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Saint Michael at September 27. 2012

Hi Luca

I propose splitting the face around the airfoil into several logic quadrangles by lines normal to airfoil boundary (see the attached picture). Sptitting can be done using Partition.

St.Michael

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Luca Cirrottola at September 27. 2012

Thank you, St.Michael.

I will try your hint. However, in this way, I can only satisfy the orthogonality approximately: the higher the number of partitions, the better approximation I will get. I was wondering if there is any means to put this requirement into the mesh hypotheses, but if there is not, I'll try to make your method suite my needs.

Luca

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Saint Michael at September 27. 2012

Unfortunately it's impossible to set orthogonality constraint to meshing parameters.

Maybe the mesh would become closer to your need if you created the face around airfoil from a scaled airfoil profile?


St.Michael

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Luca Cirrottola at September 27. 2012

Ok, so I deduce that the only way is to adjust the boundaries shape and to split the face into several parts, to keep the cells distortion under control as mush as possible.

Thank you, your expertise has been very helpful.

Luca

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by gned at November 12. 2012

Previously Luca Cirrottola wrote:

Ok, so I deduce that the only way is to adjust the boundaries shape and to split the face into several parts, to keep the cells distortion under control as mush as possible.

Thank you, your expertise has been very helpful.

Luca

Luca, scusa.

Sto cercando praticamente di fare la tua stessa cosa (griglia a C), programmando in Fortran (non sto ancora adoperando Salomé). Se mi riesce, vorrei poi passare anch'io a degli scritti Python. Sono quindi curiosa di sapere come è andata a finire. Tu ci sei poi riuscito? come ?

grazie,

i

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by William Tougeron at November 13. 2012

Hello Luca,

Viscous layer meshing is not easy with Salome. But I developed a user friendly Python library to do so in few steps only (and even more). It will be soon available from the VZLU website. I am finishing the documentation.

I let you know went it will be available.

Concerning your issue, you can create edges perpendicular to your airfoil by this way:

First, extrude your airfoil in its plane normal direction (eg. in the Z direction if your airfoil lies on the XY plane).

Then, create a vertex on your airfoil where you want the edge to start.

Then create a normal to the extruded surface at your vertex position. You will get a vector normal to your airfoil. You can then construct your perpendicular edge by extruding your vertex or copy it and create an edge from two vertexes.

Concerning the external viscous layer shape, I mean the "offset" of the airfoil, you can close your extruded face to make a solid. Then, you can use the offset tool of Salome (which applies only on solids) to create an offset around the whole solid. But then you can just cut this offset face with a plane and you will get your airfoil offset.

Sometimes, this offset method doesn't work properly. So you can create a Python routine which will create one hundred normal vectors around the airfoil with the method I gave above and construct one hundred offset vertexes, then link them with a spline. This is what my library does, among other possibilities.

Please, be patient. :)

William

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by William Tougeron at November 29. 2012

Hello,

The script I told about is now available. You can generate easily C grids around foils (or other things) thanks to it. I present this script here :

http://www.salome-platform.org/forum/forum_12/238346311

It is optimized for hybrid meshing but I don't see any reason not to use it for fully structured grids.

Best regards,

William

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Dirk Schweitzer at June 21. 2013

Hello William,

I'm trying to follow your instructions above. At the point

"Then create a normal to the extruded surface at your vertex position. You will get a vector normal to your airfoil."

I'm always getting normal vectors pointing into my airfoil. Is there an easy way to reverse the direction of a normal vector upon creation? I can of course rotate the vector by 180° but I'm just wondering whether there's a faster way to achieve this.

Thanks,

Dirk

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by William Tougeron at June 21. 2013

Hello Dirk,

You just have to use the Repair > Change Orientation. :)

Best regards

William

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Dirk Schweitzer at June 29. 2013

Hello William,

sorry for my late reply and thank you for your useful answer. Seems kind of obvious now ;)

Merci,

Dirk

 

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at December 24. 2014

HI

I am trying to mesh a NACA foil on Salome, but i can't do anything with the two shapes i attach here. The meshing algoritm automatic quadrangulation didn't  success.

Any idea? What could be wrong?

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at December 24. 2014

Second shape:

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Saint Michael at December 24. 2014

Hi

To get an all-quadrangle mesh using Quadrangle (Mapping) algo one needs to assure equal number of mesh segments on opposite sides of the geom face. Use sub-meshes to have different number of segments on different geom edges.

You can find examples in this post http://www.salome-platform.org/forum/forum_10/133096357

St.Michael

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at January 01. 2015

I think that to get controlled the meshing process it is necessary to define all the subgeometries for a given shape (points, lines, wires, shells...) and use them in the mesh module.

In the .hdf i post here i tried to create a quadrangle mesh but i couldn't mesh "squares", but "rectangles".

What could be a valid procedure to mesh "correctly" the shape i attach?

 

Thank you

 

https://www.dropbox.com/s/3j4v4zpbw2e029l/Study1_clean.hdf.zip?dl=0

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by William Tougeron at January 01. 2015

Hello,

The problem is that your longest edges are split into many small edges, as shown here (one color = one edge):

You need to fuse these tangent edges so as to have something like this:

You can for example extract vertexes from your face (New Entity > Explode) and build splines from them (New Entity > Basic > Curve, then 3rd icon at the top).

Best regards,

William

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at January 03. 2015

Here I post the complete file with all the subshapes i got, one by one:

points->polyline (this is done in the .py script, second link) ->face->shell

 

I get the same result in meshing using quadrangle mapping.

 

https://www.dropbox.com/s/mnn0fw1ze6uyn0j/Study1.hdf?dl=0

https://www.dropbox.com/s/cd7eo9plhwp1zhg/naca_1.py?dl=0

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by William Tougeron at January 05. 2015

Hello,

To make a spline in a script, the suitable function is:

geompy.MakeInterpol()

Enclosed is a modified script.

Best regards,

William

Attachments

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at January 06. 2015
Thaks you all!
 
Definig the curve as a spline, not as a POLYline it seems to work fine

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Pablo_Diaz at January 06. 2015

https://www.dropbox.com/s/n049jmvpm0rn8a0/naca_3.png?dl=0

 

How could i define different number of points in each edge?

Re: C-grid around an airfoil, for viscous CFD analysis

Posted by Saint Michael at January 12. 2015

Hi Pablo

To get different number of points you are to create a sub-mesh on an edge or a group of edges. The edge(s) for the sub-mesh should be extracted in Geometry module using New Entity > Explode or New Entity > Group > Create.

St.Michael

Powered by Ploneboard
Document Actions