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] SnappyHex + refinement (https://www.cfd-online.com/Forums/openfoam-meshing/219823-snappyhex-refinement.html)

jdotfr August 9, 2019 15:45

SnappyHex + refinement
 
5 Attachment(s)
Hello!


I am trying to generate a 2-D domain for a breakwater in a flume with a slope and I have encountered two problems, which I present in the two attached cases. I am using OpenFOAM 2.3.0, but I also have 1712+ to postprocess.



The first problem concerns both two cases. At first I created a box and inserted it into the domain. With a box, snappyHexMesh performed great (picture: mesh_.png). However, when replacing the box for a structure with a slope, snappyHexMesh was creating cells in places it shouldn't (picture: mesh_2.png). I am quite new with snappyHexMesh, but I have tried almost every combination of inputs and none have worked yet. The only option is not including refinement (either through refineMesh > better; or creating a refinement box in the snappyHexMeshDict > worse); however, I have a very long domain and I cannot afford to have so many cells in the x-direction, so I need to find out. Here I attach the full case (file: Case1.tar.gz). It takes very short to run (Allrun). Within the constant/polymesh I also give the raw geometry (named caisson) in .geo format.


Regarding the second issue, it is that when using a refinementBox in snappyHexMeshDict instead of refineMesh my domain is no longer 2D. At the intersection between the bounding box and the .stl object, where the refinement has taken place, new nodes are created in the y-direction (detailed picture: mesh_3.png). In fact, there is one mesh check that fails and when checking topology it says that "... this mesh is not 1D or 2D". The file for this case is given as Case2.tar.gz


Attachment 71678


Attachment 71683

Attachment 71679

Attachment 71680

Attachment 71681



I appreciate any help you can provide me, particularly for the first problem, as I am struggling a lot with this snappyHexMesh.


Thank you very much!!!!

pbrady2013 August 12, 2019 21:16

Snappy2D As Expected
 
Quote:

Originally Posted by jdotfr (Post 741679)
Hello!

Regarding the second issue, it is that when using a refinementBox in snappyHexMeshDict instead of refineMesh my domain is no longer 2D. At the intersection between the bounding box and the .stl object, where the refinement has taken place, new nodes are created in the y-direction (detailed picture: mesh_3.png). In fact, there is one mesh check that fails and when checking topology it says that "... this mesh is not 1D or 2D". The file for this case is given as Case2.tar.gz


Hi,


I've not looked in detail at the first issue but I've come across the second. First: snappy is doing exactly as expected. It does not know about 2D per se and simply splits in all directions.


Second: what I usually do with snappy for 2D is run as per you have done until I'm happy with the results when visualised from the side. I then run an extrusion of one cell into the direction of the 2D. From there if I want the mesh centred over an origin I do a transform back to the origin. So its:


Code:

snappyHexMesh
extrudeMesh
transformPoints
checkMesh

Hope that helps,
-pete


All times are GMT -4. The time now is 03:34.