Hex-dominant parametric: Mesh around a vehicle


The content of this tutorial is not up to date with the current live version of SimScale. The tutorial setup and the results are still valid! Please do not get confused if styles like buttons and entity names have changed in the meantime.

This short tutorial shows how to create a mesh using the Hex-Dominant meshing operation for a wind tunnel analysis of a vehicle. This operation is very powerful and it gives you multiple options to refine your mesh, create regions and many more. In this tutorial we will stay with the quite basic options.


Link to tutorial project containing the geometry:

Import tutorial project into workbench

Getting started

  • Geometry can be uploaded by drag and drop or can also be directly imported from Onshape.
  • For this tutorial, you have to import the tutorial project into your ‘Dashboard’ via the link above.
  • Once imported, the ‘Work bench’ is open and you will be in the ‘Mesh creator’ tab.
  • Click on the CAD model name under ‘Geometry’ to load the model in the viewer.

2) Mesh generation

Click the available geometry. Then click on “Mesh Geometry” button in the options panel.

The CAD viewer after uploading a STEP file of the Ahmed body
  • Choose as a type Hex-Dominant parametric (only CFD)
  • Select the number of cells in each direction for Bounding Box as shown in the figure below. This bounding box will serve as the domain bounds for the simulation.
  • Select the shown number of computing cores for this operation.
Choose snappyHexMesh within the available meshing operations

3) Define the base mesh box that forms the wind tunnel

  • Once you save the Hex-Dominant parametric(only CFD) operation, the tree is automatically expanded with the items of this operation
  • An important parameter is the size of the base box, which is used as the surrounding fluid domain.
  • To change the size of the box click on BaseMeshBox within the tree
  • The settings panel now shows the coordinates of the two points defining the box
  • Change the maximum and minimum point of the box such that the box forms your wind tunnel
The bounding box adjusted to the vehicle shape

The bounding box adjusted to the vehicle shape

  • As soon as the bounding box is adjusted properly, we can hide it by clicking on the ‘eye’ icon in the viewer selection box (top right corner)

4) Define the Material Point

  • Material point: This is the parameter the algorithm uses to determine wether the mesh is created inside a shape or outside. In this case this point therefore lies within the base mesh box, but not the shape itself to create the mesh outside the vehicle.
  • Select the MaterialPoint and give the coordinates
Setting the Material point

Setting the Material point

5) Add Surface and Feature refinements

  • In order to resolve the features of the vehicle accurately you can add a Feature Refinement under the Mesh Refinements.
  • This will refine the feature edges and the surrounding area upto the distance and level specified
Definition of the feature refinement

Definition of the feature refinement

  • Same goes for the surfaces of the vehicle: Adding a surface refinement ensures a good resolution of the vehicle walls.
  • The surface is refined based on a minimum and maximum level. The maximum level is applied where the surface curvature angle exceeds 30 degrees. Here you can select the complete volume (solid) to refine all surfaces or individual faces by selecting them in the viewer and clicking the ‘Add selection from viewer’ button.
  • Here we select the solid volume.
Definition of the surface refinement

Definition of the surface refinement

6) Add a boundary layer refinement

  • In order to resolve the large gradients near the walls, we will add a finer boundary layer near the vehicle
  • Therefore click on Add new Mesh Refinement in the Mesh Refinemens tree item of the current mesh
  • Choose the type to be Layer Addition
  • Add the faces to the mapping which are physical walls (see figure)
Choose the faces on which a boundary layer shall be created

Choose the faces on which a boundary layer shall be created

  • As soon as you assigned all relevant faces, chose how many layers you’d like to have
  • For a sophisticated analysis, one would normally introduce more finer meshed regions closer to the vehicle which will be omitted in this short tutorial. ( This can be done by creating a box region under geometry primitive, adding a region refinement and selecting the created box in refined entities )
  • The other settings do not need to be modified.

7) Start the mesh operation

  • Once you are satisfied with the settings, hit the Start button at the end of the mesh operation settings panel
  • The mesh operation is carried out in parallel on the number of cores you specified
  • Depending on the size of your base mesh and the refinement levels you specified this can take some time ( Computing)
  • Once the computation is done, you’ll get notified through the notification box
  • Note: The Hex-Dominant operation can create very large meshes which might cause problems for the 3D visualization (see Limitations)

8) Inspect the resulting mesh

  • In order to have a closer look at the mesh that has been computed, you can cut through it with the Filter Mesh clip inside the viewer
  • Hit the Filter button and choose Mesh clip
  • The plane indicates where the mesh will be cut
  • Press Apply - the platform will show you within seconds the cut view of the current mesh
A mesh clip view of the resulting mesh

A mesh clip view of the resulting mesh

Tips and tricks

  • Note that the Hex-Dominant meshing operation is very powerful and flexible but not straightforward - but do not get frustrated when your first meshes are not as you expect. With some more practice and especially more knowledge on each parameter it is a powerful tool for creating CFD meshes
  • The first parameter one should take care of is the cell count of the baseMeshBox - it massively influences the resulting mesh
  • Second, make use of the refinements: Feature refinement gives you a good resolution of the edges, surface refinement ensures a quality mesh near the surfaces, and volume refinements allow you to resolve interesting regions more precisely