CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: snappyHexMesh and Others (
-   -   Boundary conditions on patches, from a stl file. (

emirust September 6, 2012 09:18

Boundary conditions on patches, from a stl file.
2 Attachment(s)
Hey Foamers!

I am trying to do some simulations on a tunnel of a water dam. It is a .stl file that has not been computer generated, but rather found by taking some measurements on site. Check out the attached picture.

What I do is first run blockMesh to create a rectangular box around the stl geometry, and then run snappyHexMesh to mesh my actual geometry.

My question concerns the boundary of my geometry (here inlet and outlet of water). Until now, I haven't found another way than creating my outer box so it cuts the tunnel at the entrance and exit (as seen in picture 2, for the last part of the tunnel). In my initial conditions, I would use the "inlet" and "outlet" patch from the outer box to set my initial and boundary conditions.

Do you guys have any idea on a better way to procede?

Would opening this stl file in a CAD software to manipulate it , and "explode" the geometry in three parts: inlet, outlet, tunnel, and somehow combine them in openFoam work?

So, if you skimmed through the post, my question is: how to create different patches from a stl files for boundary condtions. ;-)


Doug68 September 9, 2012 00:25

In the absence of a learned reply I'll have a go...

I've yet to work out the detail of this myself (which is something I need to do). But I believe multiple ascii stl files can be combined into a single stl (with the name for each part of the stl being different) each part of the stl file can then become treated as a patch.

Once you have that I would think you define a patch as an inlet or outlet?

emirust September 10, 2012 03:49

So, how would you procede to make several stl files out of an original geometry?

I also found some tools for meshManipulation here:

Some interesting functions as "createPatch", that would help me I think.

Anyone know where I can find some informations about createPatch, faceSet etc... ?


Doug68 September 10, 2012 04:36

The process of creating separate STL files will depend on the software being used.
For me I'm using SolidEdge so instead of creating a single large file from an assembly I'd break this down by extracting the STL at sub-assembly or even part level if I wish.

Nucleophobe October 23, 2012 09:05

If you size your bounding box right in the blockMesh, you should be able to use it to create your patches.

You just need to define the patches you want in the blockMeshDict (i.e. inlet, outlet, etc.)

I've done this before. Let me know if you'd like to see an example dict file.

Good luck!

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