Jump to content
Mr. Carsten Fuetterer

OpenFoam Bounding Box Feature: Create a clean volume mesh

Recommended Posts

Hi guys,
today I want to share with you my latest feature which creates a bounding box for your OpenFoam internal flow geometry.
The idea came, when I struggled with SnappyHexMesh because the edges of the boundaries where not captured correctly, which resulted in a bad prismlayer mesh like this:

 (image 1)
I found out that the reason for this, was the bounding box, where the inlet and outlet boundary do not lay within the first layer of the box like this:


 (image 2)
So I created I bounding box which automatically adjusts with the changing geometry. It calculates the maximum and minimum positions and creates the bounding box with a user specified offset. A nice setup looks like this:

(image 3)
This setup produces a nice volume mesh with clean prism layers:


(image 4)
The complete bounding box, where the subdivision in x, y and z coordinates can be specified, looks like this:


(image 5)

The following picture shows how to connect the BlockMeshDict with the bounding box feature:

 (image 6)

Remember that you have to create an entry for the vertices by selecting these, right click and select new entry:


 (image 7)

This creates a new entry in your config dialog. There you have to change the type to FString:

 (image 8)
Do the same for the line where the blocks are defined (see image 6).
Now you have create a new entry for the point in mesh, which you can find in your SnappyHexMeshDict. Follow the same procedure, but just mark the three coordinate like this for a new entry:
(image 9)

That's it. This is just a first version of the feature. I could imagine to write another feature for the creation of the bounding box for external flows, where you could specify different patches within the BlockMeshDict.


Of course you are also welcome to post your features here in the forum.


Attached is the feature and an example how to use this feature with a complete software connector. This example by the way couples OpenFoam for Windows with CAESES.


Have a nice day








Share this post

Link to post
Share on other sites
Guest Mr. Lorenz Krieg

Hi Carston,

I´m trying to run your "caeses as an GUI for OpenFoam" example. 

could you supply me with your prepared OpenFoam Files as well?

The folders 0, constant and system as well as  the Allrun script ?

Many thanks,



Share this post

Link to post
Share on other sites

Hi Lorenz,


All these files are included in the example from Carsten - just check the software connector where you can find them as templates post-8-0-31859200-1494314367_thumb.png.




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...