CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] SnappyHexMesh for airfoil 2D case: High computational effort for low quality mesh (https://www.cfd-online.com/Forums/openfoam-meshing/117824-snappyhexmesh-airfoil-2d-case-high-computational-effort-low-quality-mesh.html)

Simon_A May 15, 2013 16:57

SnappyHexMesh for airfoil 2D case: High computational effort for low quality mesh
 
Good Evening,

using SnappyHexMesh for a 2D airfoil case, I encounter the following problem:

short description:
Snappy meshes in 3rd dimension and consumes high computational power, but after extrudeMesh, the mesh quality is low.


In blockMesh, the patches "left" and "right" are set "empty", which should tell snappy to not mesh in the 3rd dimension - however, this is happening along the stl surface.

The workaround to then generate a 2D mesh as described in the various threads here is to extrude one of the empty patches using extrudeMesh.

In theory, this works.

In practice, I have to generate a 20 million cells mesh with snappy to get 100000 cells after having used extrudeMesh.

Is something wrong in this workflow, or is there actually some kind of bug in snappy that causes computational inefficiency ?

platform:
Ubuntu 12.10, OF 2.2.0 (also encountered the same problem on a OF 1.6 machine)

Thank you very much for any help regarding this problem.

case file:
https://dl.dropboxusercontent.com/u/...nlineDB.tar.gz

haakon May 16, 2013 02:47

Quote:

Originally Posted by Simon_A (Post 427836)
Good Evening,

using SnappyHexMesh for a 2D airfoil case, I encounter the following problem:

short description:
Snappy meshes in 3rd dimension and consumes high computational power, but after extrudeMesh, the mesh quality is low.


In blockMesh, the patches "left" and "right" are set "empty", which should tell snappy to not mesh in the 3rd dimension - however, this is happening along the stl surface.

This is (as far as I know) the behaviour of snappyHexMesh. It is a 3D application, no matter what you do.

Quote:

Originally Posted by Simon_A (Post 427836)
The workaround to then generate a 2D mesh as described in the various threads here is to extrude one of the empty patches using extrudeMesh.

In theory, this works.

In practice, I have to generate a 20 million cells mesh with snappy to get 100000 cells after having used extrudeMesh.

Is something wrong in this workflow, or is there actually some kind of bug in snappy that causes computational inefficiency ?

No, I think your workflow is quite right.

Quote:

Originally Posted by Simon_A (Post 427836)
platform:
Ubuntu 12.10, OF 2.2.0 (also encountered the same problem on a OF 1.6 machine)

Thank you very much for any help regarding this problem.

case file:
https://dl.dropboxusercontent.com/u/...nlineDB.tar.gz

BTW: Have you seen the tutorial at https://www.hpc.ntnu.no/display/hpc/...l+Calculations ?

Simon_A May 16, 2013 03:35

Quote:

Originally Posted by haakon (Post 427895)
BTW: Have you seen the tutorial at https://www.hpc.ntnu.no/display/hpc/...l+Calculations ?

Hello Hakoon,

thank you very much for your quick answer.

Yes, I have seen and done that tutorial which is very helpful, however, I am simulating a multi element airfoil and using blockMesh for the slat and airfoil seems to be very complex and difficult.

haakon May 16, 2013 03:39

I am not utilizing blockMesh in that tutorial, but snappyHexMesh. There is the "alternative meshing", which is blockMesh, but if you download the tutorial files, you get a sHM case.

When it comes to your problem, you say that you suffer from bad mesh quality after the extrude process. Can you give any examples (I have not run your case)? It might be easier to help you if you describe your problem in more details.

Simon_A May 16, 2013 03:56

Sorry for the non-explicit wording. "Bad quality" in this case refers not to any checkMesh results or anything else related to the final mesh and its geometric properties.

What I meant is the general quality of the mesh in terms of cell quantity necessary for that test case.

It takes hours to create the 3D mesh with all the useless cells along the surface in the 3rd dimension, and finally I can only use 100000 out of 20 Mio. cells.

Changing the depth of the initial mesh did not significantly change the number of cells on the stl-surface.

sh.d May 27, 2013 11:48

snap
 
hello
i want to mesh a 2d airfoil but not span it
can any one help me?

sh.d May 27, 2013 11:56

snap
 
1 Attachment(s)
the following is the my test case

skeptik August 12, 2013 09:07

snappy
 
2 Attachment(s)
Quote:

Originally Posted by Simon_A (Post 427836)
short description:
Snappy meshes in 3rd dimension and consumes high computational power, but after extrudeMesh, the mesh quality is low.

I've obtained quite good mesh in 2D. It was so hard and i spent a lot of time, but at the end i've got a good mesh.

Sadly i still have problems with tail zone and prism layers there. See it here.

Attachment 24323
Attachment 24324

Simon_A August 13, 2013 03:46

hello ilya,

it is difficult to get rid of the collapsing layers at the trailing edge, actually, the only thing to make it less bad is to set a refinement box at the trailing edge with the same size as your layers are.

The layers are usually growing with an expansion ratio, and there is no way to set the in the refinement box, it is all linear there.

good luck

skeptik August 13, 2013 04:35

Quote:

Originally Posted by Simon_A (Post 445348)
actually, the only thing to make it less bad is to set a refinement box at the trailing edge with the same size as your layers are.

good trick!
i don't ever think about it. Thanks!

neiht September 11, 2013 23:54

trailing edge has the big feature angle so to solve this problem i think u need to increase limited feature angle

skeptik September 12, 2013 04:30

Quote:

Originally Posted by neiht (Post 451247)
trailing edge has the big feature angle so to solve this problem i think u need to increase limited feature angle

of course feature angle has influence on meshing near tail. but not for this case, i think.

blackgalaxy October 5, 2014 02:09

Airfoil mesh with only square blocks
 
2 Attachment(s)
Hello

Actually I am new to OpenFoam. I generate a mesh for the airfoil same as OpenFoam tutorial. But I want to have full face match cubic mesh instead of triangles. As you can see from the airfoil picture there are triangles in the grid which I want them to eliminate and have something like second picture (cubic mesh). Can someone guide me to how to get rid of triangles mesh? What feature in snappyhexmesh I should hide to have only square blocks.:confused:
Thanks

skeptik October 6, 2014 02:38

Quote:

Originally Posted by blackgalaxy (Post 512936)
Hello

Actually I am new to OpenFoam. I generate a mesh for the airfoil same as OpenFoam tutorial. But I want to have full face match cubic mesh instead of triangles. As you can see from the airfoil picture there are triangles in the grid which I want them to eliminate and have something like second picture (cubic mesh). Can someone guide me to how to get rid of triangles mesh? What feature in snappyhexmesh I should hide to have only square blocks.:confused:
Thanks

Not for shappyHexMesh. If you want pure hex mesh use blockMesh.

blackgalaxy October 6, 2014 09:55

Quote:

Originally Posted by skeptik (Post 513047)
Not for shappyHexMesh. If you want pure hex mesh use blockMesh.

Hello ilya,
Thank you so much for your answer. Would you please help me how can I produce multi level of refinement of quadrilateral mesh with blockMesh? Is there any tutorials for making multi level of refinement with blockMesh? I greatly appreciate your help. Thanks

wyldckat October 18, 2014 13:10

Greetings to all!

@Srsh: I hope you don't mind, I'll quote a question you sent me via private message, with a question very similar to the posts above. In addition, I'll try to answer some of the questions above.

I've trimmed a bit the message, to get to the bulk of the question:
Quote:

Originally Posted by blackgalaxy
I am trying to generate simple test case with SHM to generate quad grids. As I understand SHM can't make only quad mesh. so I really appreciated if you could answer these two question:
Do you think with making the castellated mesh, I mean the first step of SHM mesh generation, I can produce quad mesh?
Also do you think it is possible to change the source code of snappyHexmesh to get the quad mesh out of it?
Thank you so much for your time and consideration.



Actually, I'll start with your first post: there is a misconception of the mesh you're seeing in ParaView. Have a look at this FAQ entry: http://openfoamwiki.net/index.php/FA...is_in_ParaView - there you'll see how to see the real mesh and not the one you're seeing. Because the mesh you're seeing already has decomposed the more complex cells down to tetrahedral/prisms and in that FAQ is explained how to see the original cells.

Regarding blockMesh, check this page: http://openfoamwiki.net/index.php/BlockMesh
Regarding snappyHexMesh: http://openfoamwiki.net/index.php/SnappyHexMesh

Now, as for the questions in the private message: it's very tricky to do such a mesh with snappyHexMesh. This mesher is essentially what I call a chiseller: it will chisel the initial base+refined mesh onto the geometry, therefore it might end up having to deform some cells more than it might be acceptable.

I suggest you go ask Daniel Wei for a copy of the Enosh mesher: http://www.cfd-online.com/Forums/ope...generator.html - that mesher allegedly was specifically designed to assist in creating better meshes for airfoils.

Best regards,
Bruno

blackgalaxy October 21, 2014 12:20

Quote:

Originally Posted by wyldckat (Post 514971)
Greetings to all!

@Srsh: I hope you don't mind, I'll quote a question you sent me via private message, with a question very similar to the posts above. In addition, I'll try to answer some of the questions above.

I've trimmed a bit the message, to get to the bulk of the question:


Actually, I'll start with your first post: there is a misconception of the mesh you're seeing in ParaView. Have a look at this FAQ entry: http://openfoamwiki.net/index.php/FA...is_in_ParaView - there you'll see how to see the real mesh and not the one you're seeing. Because the mesh you're seeing already has decomposed the more complex cells down to tetrahedral/prisms and in that FAQ is explained how to see the original cells.

Regarding blockMesh, check this page: http://openfoamwiki.net/index.php/BlockMesh
Regarding snappyHexMesh: http://openfoamwiki.net/index.php/SnappyHexMesh

Now, as for the questions in the private message: it's very tricky to do such a mesh with snappyHexMesh. This mesher is essentially what I call a chiseller: it will chisel the initial base+refined mesh onto the geometry, therefore it might end up having to deform some cells more than it might be acceptable.

I suggest you go ask Daniel Wei for a copy of the Enosh mesher: http://www.cfd-online.com/Forums/ope...generator.html - that mesher allegedly was specifically designed to assist in creating better meshes for airfoils.

Best regards,
Bruno

Hello Bruno,
Thank you so much for your kind response. That was really helpful. I was wondering how can I extract these meshes from OpenFoam. I am trying to export the mesh to the plot3D format but apparently OpenFoam doesn't have this option. I used writeMeshObj command to export mesh but it seems it doesn't help. Would you please let me know if there is any way to transfer grid to structural format like plot3D. Thank you again.

Best Regards,
Srsh

linnemann October 21, 2014 13:15

Hello

Have you tried

http://hvirvel.dk/airfoilmesher/

blackgalaxy October 27, 2014 11:46

Quote:

Originally Posted by linnemann (Post 515396)

Hello Niels,

Thank you for your concern. Actually one of my test cases was working on the airfoil. I choose airfoil to see if I could generate quad mesh with SHM. I have to generate grid for several geometries which are different from airfoil.

wyldckat October 27, 2014 15:39

Hi Srsh,

Quote:

Originally Posted by blackgalaxy (Post 515392)
I am trying to export the mesh to the plot3D format but apparently OpenFoam doesn't have this option.

AFAIK, there is no easy way to do this. You'll have to create your own utility to perform this.
There is a utility named plot3dToFoam, which does the opposite of what you're looking for. The source code is located at the path indicated by the following command:
Code:

echo $FOAM_UTILITIES/mesh/conversion/plot3dToFoam
Another utility that you can use as a basis for creating such a new conversion utility is star4ToFoam, whose source code is in the same parent folder as "plot3dToFoam".

Good luck! Best regards,
Bruno


All times are GMT -4. The time now is 02:45.