OpenFOAM Tutorial snappyHexMesh

This will show how to create a mesh from STL files with snappyHexMesh (using OpenFOAM 2.3 or higher).

We will then setup a steadystate turbulent case with simpleFOAM – and run it.

The meshing and solving will be done in parallel on the following machine:

Hardware:

Supermicro X7DWA-N Server Board

32Gb Ram
Dual X5473 Quad core 3.33Ghz XEONS
Nvidia Graphics Card

Software:

Ubuntu 12.04 LTS
PyFOAM (only needed if you want to plot residuals)
-NumPY (required for PyFOAM)
OpenFOAM 2.3

Two text files are given here which show you which commands to type into the OpenFOAM terminal window in Linux to complete the
mesh and running of the case. Also included is a blank “template” piece of code in case you want to add any “function objects” to the
case. Such as for making streamlines before post-processing or calculating things like wall shear stress.

Openfoam_code.tar

calibrate_3.0_SimpleFoam.tar

In this case its a small mesh – so as long as you have at least 4GB Ram you will be fine – it only uses a max of about 1.8Gb but if you only have a 2GB machine
you will probably find it starts using swap and gets very slow !

For the full tutorial see the video on (coming on 1st June 2014) youtube. However here are shown some pictures of the resulting mesh.

Patch Names

Patch Names

Section view 1

Section view 1

Overall Section View

Overall Section View

Closeup of refined viscous layers

Closeup of refined viscous layers

Viscous Layers

Viscous Layers

Outer Refinement Zones

Outer Refinement Zones

Overall Mesh

Overall Mesh

Velocity_SimpleFoam

Velocity_SimpleFoam

Pressure_SimpleFoam

Pressure_SimpleFoam

7 Comments

    • You will have to clarify if you dont understand:
      a) What a refinement box does in OpenFOAM
      b) What it does specifically in this case

      Two possible answers to your question !

  1. You are a star! Thank you so much for these tutorials. So much more thorough and easier to understand than other ones on You Tube with no one speaking. After following your tutorial, I managed to get a passable mesh for my own geometry quite easily!

  2. Pingback: Do different openfoam versions have different formats of the configuration files? -- CFD Online Discussion Forums

Leave a Reply

Your email address will not be published. Required fields are marked *