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

[snappyHexMesh] Declaring a single STL file's faces to be different boundaries

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By AtoHM
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2021, 03:01
Default Declaring a single STL file's faces to be different boundaries
  #1
New Member
 
Homer Bacanto
Join Date: Dec 2020
Posts: 13
Rep Power: 2
hmrbcnt is on a distinguished road
Let's say that I have an STL file in the form of a cube, with its bottom face on the ground so it only has five visible faces within the generated blockmesh.


Is there a way for me to declare each of these individual faces as a different boundary or a different cellzone so I can sample each face with surfaceFieldValue or volFieldValue?


I know that it should be possible to do so if I import each face as a different STL file, but I'm aiming to do this with tens of STL objects, so I was wondering if there was a quicker way.

Any help would be much appreciated.
hmrbcnt is offline   Reply With Quote

Old   March 17, 2021, 22:47
Default
  #2
New Member
 
Homer Bacanto
Join Date: Dec 2020
Posts: 13
Rep Power: 2
hmrbcnt is on a distinguished road
Anyone? Bump
hmrbcnt is offline   Reply With Quote

Old   March 18, 2021, 03:25
Default
  #3
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 222
Rep Power: 14
Yann is on a distinguished road
Quicker way: using a CAD software which preserve faces names when exporting a STL file. Have a look in the motorbike tutorial: the STL contain the whole motorbike geometry with different names in it.

This is a recurrent question, you should find several threads on the forum about that and the different options to deal with it.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   March 18, 2021, 21:35
Default
  #4
New Member
 
Homer Bacanto
Join Date: Dec 2020
Posts: 13
Rep Power: 2
hmrbcnt is on a distinguished road
Quote:
Originally Posted by Yann View Post
Quicker way: using a CAD software which preserve faces names when exporting a STL file. Have a look in the motorbike tutorial: the STL contain the whole motorbike geometry with different names in it.

This is a recurrent question, you should find several threads on the forum about that and the different options to deal with it.

Cheers,
Yann

Hello, Yann!



Thank you for that suggestion. Unfortunately, I am currently using an add-on that automatically exports solids/cubes as one STL file, and I understand that decomposing each into their individual faces will be difficult. Is there an alternative option?

Another question is how do you specify a cellZone with snappyHexMesh using one STL file with multiple solids inside? Thank you!
hmrbcnt is offline   Reply With Quote

Old   March 19, 2021, 03:35
Default
  #5
Senior Member
 
M
Join Date: Dec 2017
Posts: 376
Rep Power: 7
AtoHM is on a distinguished road
There are ways. I recently desribed (an unconvenient) one here and Carlos suggested to use blender: How to split stl file?


To specify cellZones you can either do that after meshing with the topoSet tool or introduce entries in the refinementSurfaces subdictionary. When I do this, I usually split the stl i have in to separate ones for each body (of utility "surfaceSplitByPatch") and then reference the single stl files. There you can declare a cellZoneInside and it should work. google for the correct syntax.


//Or use locationsInMesh as Yann suggests below. I wasn't aware of that, as I never do it that way.
Yann likes this.

Last edited by AtoHM; March 19, 2021 at 04:56.
AtoHM is offline   Reply With Quote

Old   March 19, 2021, 03:50
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 222
Rep Power: 14
Yann is on a distinguished road
Hello Homer,

Have you tried to open your STL file with a text editor to see if there are several solids named inside?
It should follow this syntax:

Code:
solid name
   [...]
endsolid name
solid another_name
   [...]
ensolid another_name
If not, you will have to modify your STL file with another software. I don't use it but I think some people here use Salome for this purpose. (EDIT : or Blender, as suggested by AtoHM)

The only other way around I can think of would be to use topoSet and createPatch to separate the faces after meshing but it won't be easier than exporting individual STL files for meshing.


About cellZones: you can use a STL file to define a cellZone in snappyHexMesh if your STL contains a single closed volume. So you need to use as many STL as cellZones you need to create and you won't be able to do it if your STL contains several volumes.

If you are using the ESI-OpenCFD OpenFOAM branch, you can use a STL file containing several closed volumes and use the "locationsInMesh" to create cellZones. (OpenFOAM-v1612+ and above)

Yann
AtoHM likes this.
Yann is offline   Reply With Quote

Reply

Tags
openfoam, snappyhexmesh, stl file

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[snappyHexMesh] Layers not growing at all zonda OpenFOAM Meshing & Mesh Conversion 12 June 6, 2020 11:28
[Other] Can't Shake Erros: patch type 'patch' not constraint type 'empty' BrendaEM OpenFOAM Meshing & Mesh Conversion 11 August 24, 2018 12:03
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 2 June 24, 2017 05:29
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01


All times are GMT -4. The time now is 04:54.