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] Adding Layers to a curved Geometry (https://www.cfd-online.com/Forums/openfoam-meshing/239418-adding-layers-curved-geometry.html)

I7aniel November 4, 2021 10:13

Adding Layers to a curved Geometry
 
4 Attachment(s)
Hello everyone,

I am trying to simulate a flow through a pourous media. Therefore I have a geometry exported out of CAD and tried to mesh it with SHM. I want to do a 2D simulation so i plan on creating a 2D mesh using extrudeMesh after i create the mesh out of the CAD file. I attached the STL File which I use. I tried adding layer using the light red patches. Therefore Layers are added from both sides.

Inside the mesh this worked for three layers, however adding more layers results in problems due to the displacement of the other cells. Has anybody an idea how I can add more layers or how I can mesh the cells to follow the boundary? It is very important to the simulation that the cells "follow" the curved geometry at the left side over the hole diameter.

I added a screenshot of the mesh with 3 layers, this is how it should look like but the layers over the complete diameter. I also don't understand why the outside of the mesh has no layers (see also screenshot).

Has anybody an idea how i can mesh the curved geometry, so that the cells follow the outer walls? With blockMesh and splines i can create a geometry like that but I need the exact geometry from the CAD files.

Thanks in advance guys!

I7aniel November 8, 2021 03:46

If somebody has an idea how I can mesh the curve geometry without SHM so that the cells are aligned to the curvature I would also appreciate that. I just have to use this geometry, but I am not fixed to using SHM

guin November 8, 2021 06:56

Quote:

Originally Posted by I7aniel (Post 815993)
If somebody has an idea how I can mesh the curve geometry without SHM so that the cells are aligned to the curvature I would also appreciate that. I just have to use this geometry, but I am not fixed to using SHM

If I were you I'd give a try with blockMesh directly. You can find a handy option to project your edges based on a given geometry, for instance given by a loaded surface.

Here an example using a runtime-generated sphere https://github.com/OpenFOAM/OpenFOAM.../blockMeshDict

I guess You'll probably rather want to use something called "searchableSurface" or "searchableTriSurface" ... though I never use this and the precise name may differ (please someone correct me if wrong)

You can find more details at the user manual https://cfd.direct/openfoam/user-guide/v9-blockmesh/

guin November 8, 2021 06:59

Quote:

Originally Posted by I7aniel (Post 815993)
If somebody has an idea how I can mesh the curve geometry without SHM so that the cells are aligned to the curvature I would also appreciate that. I just have to use this geometry, but I am not fixed to using SHM

Another option for a hex-based mesh might be using SALOME-MECA ( https://www.salome-platform.org/ ) though installing that just for it sounds a bit hardcore to me.

I7aniel November 8, 2021 08:49

Quote:

Originally Posted by guin (Post 816017)
If I were you I'd give a try with blockMesh directly. You can find a handy option to project your edges based on a given geometry, for instance given by a loaded surface.

Here an example using a runtime-generated sphere https://github.com/OpenFOAM/OpenFOAM.../blockMeshDict

Hi guin thanks for yor answer, did you use blockMesh for a geometry that was given, in the example the geometry is a basic cylinder, do you know how i can import my surface in the blockmesh dict?

Thanks in advance,

Daniel

guin November 8, 2021 09:42

Quote:

Originally Posted by I7aniel (Post 816031)
Hi guin thanks for yor answer, did you use blockMesh for a geometry that was given, in the example the geometry is a basic cylinder, do you know how i can import my surface in the blockmesh dict?

Thanks in advance,

Daniel

That's actually why I suggested you taking a look at the user manual https://cfd.direct/openfoam/user-guide/v9-blockmesh/

By the end of the section 5.3.3 Projection of vertices, edges and faces it tells you how to look for further examples inside the tutorials on your own
Code:

find $FOAM_TUTORIALS -name blockMeshDict | xargs grep -l project
In your terminal (e.g. using bash) you can then, for instance, open them with your favourite editor (e.g. gedit ?):
Code:

gedit $(find $FOAM_TUTORIALS -name blockMeshDict | xargs grep -l project)
I especially suggest you testing and trying to understand the workflow used in the cases involving following ones:
https://github.com/OpenFOAM/OpenFOAM.../blockMeshDict
https://github.com/OpenFOAM/OpenFOAM.../blockMeshDict

Best luck


All times are GMT -4. The time now is 14:00.