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] Naming patches for snappyHexMesh (https://www.cfd-online.com/Forums/openfoam-meshing/202441-naming-patches-snappyhexmesh.html)

yasasvi.harishkumar May 31, 2018 06:22

Naming patches for snappyHexMesh
 
Hello, I'm a beginner to sHM and I would like to know if there is any way to name patches without having multiple stl files. I only have one stl file for my geometry and now I can't run an analysis until I name the patches. I would appreciate the help. Thanks!

simrego May 31, 2018 09:30

Depending on your CAD software, you have to save the stl file with patch names. Most of the CAD softwares export with the same name for every patches (which is not good for you, since you lose all patch names). In this case if you export every patch into a different stl file, you can merge them with a little modification.
But why do you want only one stl file? Doesn't matter if you have 1 or 10 files, you will just have a bit less lines in your shmDict, but not so much.
And also if you have multiple stl files, and you have to modify the geometry, it's enough if you just export the modified patches. Just make sure your surface is closed or shm will fail.

yasasvi.harishkumar May 31, 2018 23:08

Thanks simrego! But I currently have only one stl file which was provided to me. Anyway I can make do with this?

simrego June 1, 2018 04:04

You can modify the STL files with meslab or salome or many other softwares.
Or you can just run shm with the single stl file, and with topoSet and createPatch utilities you can create patches.

jmilo March 26, 2021 12:40

I know this thread is old, but for anyone else wondering, you can auto patch the stl file in OpenFoam:
Quote:

surfaceAutoPatch input.stl output.stl angle
where "input.stl" is the original stl file, "output.stl" is the stl file divided into patches and "angle" is an angle between 0 and 180 for the inclusion of geometric features. Now, if you want the individual patches as stl files you can do:
Quote:

surfaceSplitByPatch output.stl
and OpenFoam will generate individual stl files for each patch on the surface. This is particularly useful when you only have the stl file and don't have access to the software that generated it. Each patch in "output.stl" can be renamed in snappyHexMeshDict (e.i: inlet, outlet, wall...) and the meshed geometry will preserve these names.

hope this help

PedroS November 3, 2023 06:25

Hello. I am starting to use openfoam, and I am trying to use SnappyHexMesh to mesh a T junction. I am using Solidworks to create the geometry and then export it as STL. The problem is that the surfaceAutoPatch command is not being recognized. I have already executed the autoPatch command but it patches the block mesh and not the stl. I don't know if surfaceAutoPatch command is not available on the openfoam version I am using. Do I really need to use surfaceAutoPatch or can I patch the stl with autoPatch command?

I am using openfoam 2306.

jmilo December 14, 2023 20:15

Quote:

Originally Posted by PedroS (Post 859418)
Hello. I am starting to use openfoam, and I am trying to use SnappyHexMesh to mesh a T junction. I am using Solidworks to create the geometry and then export it as STL. The problem is that the surfaceAutoPatch command is not being recognized. I have already executed the autoPatch command but it patches the block mesh and not the stl. I don't know if surfaceAutoPatch command is not available on the openfoam version I am using. Do I really need to use surfaceAutoPatch or can I patch the stl with autoPatch command?

I am using openfoam 2306.

Hey Pedro, did you solve your problem?
As far as I know surfaceAutoPatch works for OpenFOAMv11 (and other previous versions) from the OpenFOAM Foundation (openfoam.org). The version you're quoting belongs to ESI-OpenCFD (openfoam.com). These 2 codes are similar but also very different in many regards.
Looking at the source code for openFOAM 2306 from openfoam.com (https://develop.openfoam.com/Develop...lities/surface) there is a utility called "surfacePatch", you might wanna try that one (I have limited experience with openFOAM from openfoam.com)
Now, if you go to the source code for OpenFOAMv11 (from openfoam.org) (https://github.com/OpenFOAM/OpenFOAM...lities/surface) the utility surfaceAutoPatch exists and it's described on the source file.
Hope this helps.

PedroS December 20, 2023 11:54

Hi John.
When I posted that question I was starting to explore OpenFoam. Since then, I haven't had much time to come back to it. I work every day with Ansys Fluent but I think OpenFoam is a very interesting platform. As soon as I find some time, I will come back to it.
Anyway, appreciate your response. I will analyze it and then I'll let you know if I found the solution. Thanks!


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