CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Naming patches for snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By jmilo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2018, 06:22
Question Naming patches for snappyHexMesh
  #1
New Member
 
Yasasvi Harish Kumar
Join Date: May 2018
Posts: 4
Rep Power: 7
yasasvi.harishkumar is on a distinguished road
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!
yasasvi.harishkumar is offline   Reply With Quote

Old   May 31, 2018, 09:30
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
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.
simrego is offline   Reply With Quote

Old   May 31, 2018, 23:08
Default
  #3
New Member
 
Yasasvi Harish Kumar
Join Date: May 2018
Posts: 4
Rep Power: 7
yasasvi.harishkumar is on a distinguished road
Thanks simrego! But I currently have only one stl file which was provided to me. Anyway I can make do with this?
yasasvi.harishkumar is offline   Reply With Quote

Old   June 1, 2018, 04:04
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
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.
simrego is offline   Reply With Quote

Old   March 26, 2021, 12:40
Default
  #5
New Member
 
John Parra
Join Date: Jun 2020
Posts: 3
Rep Power: 5
jmilo is on a distinguished road
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
Yann and PedroS like this.
jmilo is offline   Reply With Quote

Old   November 3, 2023, 06:25
Default
  #6
New Member
 
Pedro Silva
Join Date: Oct 2023
Posts: 5
Rep Power: 2
PedroS is on a distinguished road
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.
PedroS is offline   Reply With Quote

Old   December 14, 2023, 20:15
Default
  #7
New Member
 
John Parra
Join Date: Jun 2020
Posts: 3
Rep Power: 5
jmilo is on a distinguished road
Quote:
Originally Posted by PedroS View Post
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.
jmilo is offline   Reply With Quote

Old   December 20, 2023, 11:54
Default
  #8
New Member
 
Pedro Silva
Join Date: Oct 2023
Posts: 5
Rep Power: 2
PedroS is on a distinguished road
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!
PedroS is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 08:19
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 08:00
Cyclic boundaries in OF 21x morard OpenFOAM 25 May 13, 2013 22:35
naming wall patches in OpenFoam musahossein Main CFD Forum 0 December 6, 2011 11:13


All times are GMT -4. The time now is 12:49.