Refine a 3D-Mesh resulting in pure hex-mesh
Hi FOAMers!
I tried to use refineMesh to refine some regions of my mesh. Unfortunately, it produces polyhedral-cells, which are unacceptable for our purposes. Does anyone of you have any idea how to refine those cells while not producing non-hexa-cells. Hanging nodes are not a problem. Normally it should be possible to split every convex hexa cell in eight smaller hexas, by simply splitting the edges in half and adding 7 additional vertices, or am I mistaken? If it is possible, do you know if there is a tool, which does exactly that? Thank you very much in advance!! Thomas |
It would even be helpful, if somebody knew that its not possible in openFoam! Or even better would know a tool which can refine keeping up the hexa-structure of mesh.
Thanks alot! |
The answer depends on a few parameters:
1) Is your original mesh hexahedral only? 2) What coordinate system and directions are your refining your region in? A visual example and your refineMeshDict would be helpful. |
4 Attachment(s)
Hi Marco!
Thanks alot for your reply! I hope you had a nice weekend. Sorry for answering late. I didnt find the time to write earlier. Regarding your questions: Quote:
Quote:
My refineMeshDict: Quote:
Thomas |
Hi,
Are you sure that the resulting mesh has polyhedral cells? Sometimes Paraview produces artifacts in the image showing some edges that are not really in the model. I've seen a thread about this some time ago, but I wasn't able to locate it. Does checkmesh report polyhedral cells? Best Regards, Paulo |
Hi Paulo,
thank you for your relpy. Indeed checkMesh reports polyhedral cells. And as I said it seems as though they are located at the interface between the refined and the non-refined cells. Best regards, Thomas |
Hi Thomas,
this is totally normal, so don't worry, if they were hexahedral cells initially that has not changed with the refinement. See this example of a general (level 0) hex next to a refined one: Code:
·----·----·--------· Also don't pay attention on how paraview splits the cells, it is just a visualization artifact. Best, Pablo |
Hi Thomas,
Pablo is correct; you always will have polyhedral cells in the interface, and Paraview divides polyhedral cells in tetrahedra before visualization. The only remaining question is: Do you need to be completely sure that there are only hexahedra in your mesh? I found the thread about the visualization artifacts: http://www.cfd-online.com/Forums/ope...-parafoam.html Best Regards, Paulo |
Excellent response from Vatatuk. There is another thing you should be aware of. When you refine in the global direction, things get weird when your faces are not aligned with major coordinate sections. Think of refining a cube rotated 45 degrees on the z axis. If you refine in x and y, you will need to cut the cell into triangles (cutting from corner to corner) so you get the same number of cells in x as in y, something like this: http://www.mathematische-basteleien....0of%20a%20Cube
If you want the division to be aligned with the local coordinate system, you will need to use the patchLocal coordinate system, and only refine a subset where a patch normal can be aligned to one of the local coordinate systems. |
Thank you Pablo and Paulo for your replies. It fells like I am one step closer to the solution, if there is any.
Ok, so what you are saying, Pablo is that at the interface of refined to non refined cells the faces get split. Therefore, the unrefined cell at the interface has no more six faces but nine, since one of the former six faces got split into four new faces. Each of the for new faces should then have four vertices. However, in the faces-file there are faces with five and six vertices. Is there a contradiction to your post Pablo, or did I understand something wrong? We in deed need a perfectly hexaedral mesh, Paulo. We want to use adaptive Mesh refinement, and our in-house code uses isotropic mesh refinement based on a hexadrical mesh. Best regards, Thomas |
Hey Marco,
thank you too! I changed to local refinement, but the result is exactly the same. However, you are right of course I will keep the local coordinate setting, just in case. Therefore, an update on my refineMeshDict: Quote:
Thomas |
I've been using refineMesh in 2.3.x, so the entries might be different. The most important entry is patch, which defines the normal direction, and the other direction tan1. The local coordinate system is such that tan1 X tan2 = normal.
If you wanted to refine a purely cylindrical mesh, the patch I would select the outer surface of the cylinder (to get the radial direction), and set tan1 as the axial direction, so that tan2 is the azimuthal direction. Judging from your mesh, you won't be able to do this on all cells at once, so you should select subsets of the mesh using topoSet. One last thing; when refineMesh is run without arguments, global refinement happens in all directions no matter what. At least it does in 2.3.x. You need to use -dict as an option to specify you want to use the dictionary. |
Quote:
this probably has to do with the issue that Marco pointed out and I had not noticed before: some of your cells are not aligned with the global XYZ axes. Since you have already tried the local directions, I don't know how to correct this issue. Best, Pablo |
Sounds reasonable, thanks a lot guys!
|
Quote:
|
Either make the mesh in blockmesh and enforce hexahedral cells everywhere, or use snappyHexMesh and adjust the settings as best you can.
|
Quote:
Do not write: Code:
directions (tan1, tan2, normal); Code:
directions (tan1 tan2 normal); Using the commas can result in problems in my experience if several overlapping topoSets are used to be refined. In my test cases ( see my post at https://www.cfd-online.com/Forums/op...ere-added.html ) you would not be able to do the Allrun_wrong_command_order with the case "0_understandRefineMesh" and you could not run Allrun with the case "1_understandRefineMesh". The error message would be something like Code:
could not find direction "tan1,"; As long as your topoSets do not overlap with already refined topoSets you can use the comma without issues. |
All times are GMT -4. The time now is 09:27. |