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] How To Prepare a Large, Complex Geometry for SnappyHexMesh? (https://www.cfd-online.com/Forums/openfoam-meshing/219512-how-prepare-large-complex-geometry-snappyhexmesh.html)

Nosravi July 30, 2019 02:39

How To Prepare a Large, Complex Geometry for SnappyHexMesh?
 
Hello!

I am relatively new to OpenFOAM, and I am tasked to simulate flow in a small, rocky river using the interFoam solver. I have the 3D model of the river, however, I have a couple of questions before I try to create the mesh:

- Does the geometry have to be closed to use SnappyHexMesh, meaning do I need to add a 'roof' representing the atmosphere? Currently my model consists of the banks, riverbed, a dam and inlet/outlet planes.

- Would it be preferrable to keep the riverbank, riverbed and dam as one STL, or split them apart? I think they will all have the same boundary conditions.

I will attach pictures of the geometry.
Imgur album: https://imgur.com/a/9B8c4NQ

These are my initial questions, I would really appreciate some input! Cheers

akidess July 30, 2019 03:18

You don't need a roof. Just prepare your background mesh accordingly - snappyHexMesh will never make anything larger. Same for the inlet and outlet planes.

If you never change the parts, it doesn't really matter if you have one or multiple STLs. If for instance you want to check different dams it makes sense to have a separate STL just for the dam to replace it easier.

InterFoam is picky about the mesh. Avoid sudden changes in mesh density at the fluid interface, and pay attention to good mesh quality (orthogonality, skewness).

Nosravi July 30, 2019 03:39

Quote:

Originally Posted by akidess (Post 740445)
You don't need a roof. Just prepare your background mesh accordingly - snappyHexMesh will never make anything larger. Same for the inlet and outlet planes.

If you never change the parts, it doesn't really matter if you have one or multiple STLs. If for instance you want to check different dams it makes sense to have a separate STL just for the dam to replace it easier.

InterFoam is picky about the mesh. Avoid sudden changes in mesh density at the fluid interface, and pay attention to good mesh quality (orthogonality, skewness).

Thank you so much for the reply!

So if I understand you correctly, the roof and inlet/outlet planes are unnecessary as long as the block i make around the geometry does this job?

There is a slight slope to the river, and it is not completely straight, so a box will not envelop it perfectly, AFAIK.

Will I then use setFields to specify for interFoam that i don't want water on the 'underside' of the model?

akidess July 30, 2019 05:17

There should be no underside of the model. Your top, left, right, front and back should be given by your background mesh, and snappyHexMesh will snap the bottom boundary to your riverbank STL. This is indeed not currently possible with your STL, because the river is not straight and your banks don't extend far enough to the sides. You will need to extend the banks, or build an atmosphere STL boundary as you initially suggested.

Nosravi July 30, 2019 07:12

Quote:

Originally Posted by akidess (Post 740456)
There should be no underside of the model. Your top, left, right, front and back should be given by your background mesh, and snappyHexMesh will snap the bottom boundary to your riverbank STL. This is indeed not currently possible with your STL, because the river is not straight and your banks don't extend far enough to the sides. You will need to extend the banks, or build an atmosphere STL boundary as you initially suggested.

Thank you again! I will try to improve my STL file so that my background mesh will declare the boundaries.


All times are GMT -4. The time now is 05:15.