Hex-dominant parametric: Valve Geometry


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.


In this tutorial, the meshing process for a valve geometry is carried out using the “Hex-dominant parametric” approach. The “Hex-dominant parametric” is the semi-automatic meshing option that uses hexahedral cells and allows full flexibility in meshing parameters with all type of refinements options.

The objective is to get a good quality mesh that resolves the geometry and domain well. The valve geometry configuration used has a small opening angle of 25 degrees. The main challenge here will be the meshing of small gap between the valve and the pipe casing.

This tutorial will highlight some essential points of the meshing process that would help in getting better simulation results.

Import tutorial project into workbench

Getting started

  • To start this tutorial, you have to import the tutorial project “Meshing Tutorial-Hex-dominant parametric for Valve Geometries” 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 “Valve-25-STL” to load the CAD model in the viewer. The figure below shows additionally the valve geometry inside the pipe for illustration.
  • Note: the STL geometry is pre-split to separate the faces for meshing and later assignment of boundary conditions.


It is important that the geometry has the Inlet and Outlet faces/sections at certain distance Upstream and Downstream of the valve. Typically an Upstream distance of at least 4-7D and Downstream distance of 8-12D is recommended for numerical simulations to achieve better accuracy of results.

Mesh Generation

  • To create a new mesh from this CAD model, click the blue ‘Mesh geometry button’
  • Automatically, a new mesh called “Valve-25-STL-mesh” is created and a default mesh operation called “Operation 1”.
  • To specify how exactly the mesh shall be generated, click on the operation itself (currently called Operation 1, you may rename it to ‘Hex-mesh’) and select the meshing type as: ‘Hex-dominant parametric’ and scroll down to the bottom and click save.
  • After saving, a sub-tree will be generated with “Geomerty Primitives” and “Mesh Refinements” as shown below. This will be used to define the meshing parameters and refinements.

1-) Geometry Primitives and Main Settings

Here we will specify the settings and primitives for the ‘Base Mesh’ and other refinements that will be applied later.

  • We start with “BaseMeshBox”, under Geometry Primitives. Here we specify the extents of the box for the Base Mesh as shown in the figure below.
  • The ‘Base Box’ (shown in blue) then surrounds the half geometry as shown. This is because we want to mesh only the half geometry and apply a symmetry condition at the x-max plane.
  • Next comes the “Material Point”, which specifies the space that will be meshed.
  • So for this case, the point must be located in the region between the valve surface and the pipe surface. This is specified as shown in figure below.
  • we now specify the Base Mesh discretization by clicking on the name ‘SHM’ and giving the number of cells in each coordinate direction as shown in figure. Here we also select the compute cores for parallel computation.


For a good quality mesh, it is recommended to have near cube cells for the base mesh. see Hex-dominant parametric documentation for details.


For an intended fine mesh ( around or more than 5 million cells ) e.g as in case of this tutorial, please select 16 or 32 compute core machine to meet the memory requirements.

  • Now we create additional ‘Geometry Primitives’, to be used later for region refinements. Click ‘Geometry primitives’ and ‘add new primitive’ of type ‘Cylinder’ as shown in figures below.
  • Specify the name ‘Cylinder-Valve’ and following values, then save to get the shown cylinder region.
  • Similarly create 4 more primitives of ‘Type: Cylinder’ as detailed in the table below:
  • These will be later used to refine the up/down stream regions, the opening gap between the valve and pipe, and hinge areas.
  Cylinder-Pipe Cylinder-Edge Cylinder-Hinge-1 Cylinder-Hinge-2
Reference Point (x) 0 0 -1.16 -1
Reference Point (y) 0 -0.03 -0.04 0
Reference Point (z) -3 -0.01 -0.01 0
Axis (x) 0 0 0 0.13
Axis (y) 0 0.02 0.02 0
Axis (z) 10 0.0425 0.0425 0
Radius 1 1.1 0.57 0.17
  • The figure below illustrates the created primitives:

2-) Mesh Refinements

Here we will add the necessary refinements for the surfaces, edges and regions to generate a fine mesh of optimum size. The refinement levels given are relative to the ‘baseMesh’ cell size with each level reducing the size to half. see Hex-dominant parametric documentation for details.

i-) Surface refinement

This refinement is very important and necessary to resolve the surface mesh of the body. A fine surface mesh is required to capture the geometry in detail.

  • To add a ‘Surface refinement’ click on ‘Mesh Refinements’ and then click ‘Add mesh refinement’ button as shown.
  • Re-name it to ‘Surf-pipe-inlet-outlet’ and select a Type ‘Surface refinement’ to specify the parameters as shown in figure below.
  • This will refine the pipe, inlet and outlet surfaces. Select the shown faces and click save.
  • Create 1 more surface refinements for the valve surface as detailed in the figure below:

ii-) Feature edge refinement

This refinement is important to resolve the feature edges of the geometry and produce a fine mesh at the edges.

  • Add a new mesh refinement and select type ‘Feature refinement’ for refinement near edges. Re-name and enter the values as detailed in the figure below.
  • This will now apply a level-5 refinement at a distance of 0.01m from the extracted edges in all directions.

iii-) Region refinement

Region refinements will refine the volume mesh cells based on the given refinement level. These are important to get a fine volume mesh in the vicinity, upstream and downstream of the valve.

  • Now we add ‘Region refinements’ using the geometry primitives created before to refine the volume mesh.
  • So add a new mesh refinement, rename to ‘Reg-hinge-1’, select Type ‘Region refinement’ and specify the settings as shown below and save.
  • This will apply a level 7 refinement inside the selected region.
  • Similarly, create 3 more ‘Region refinements’ as detailed in the table below:
  Reg-edge-hinge-2 Reg-valve Reg-pipe
Region refinement mode inside inside inside
distance 1 1 1
Level 5 3 2
Refined region      
Assigned geometry primitive Cylinder-Hinge-2 & Cylinder-Edge Cylinder-valve Cylinder-Pipe

iv-) Layer refinement

  • Lastly, add a ‘Layer refinement’ for resolving the viscous region of the boundary layer. Specify the settings as shown below.
  • This will generate 3 layers based on relative size.
  • Choose the inside physical walls and valve i.e the face_3 and face_4 from the assignment box and click save.

3-) Advanced Settings

To generate a mesh of optimum quality, make sure the advance settings are set as shown in the figures below.

  • For ‘Castellated mesh’ and ‘Span’ controls:
  • For ‘Layer control’:
  • For ‘Mesh Quality control’:
  • That is all !
  • Now click on “SHM” (under Mesh Operations) in the tree and start the meshing operation by clicking ‘Start’ button in the center panel at the top.


All operations are computed on the remote cloud (not on your computer). Once an operation is started you can simply move on to another project/operation or start multiple other operations or even logout.

  • After some minutes of computing, there will appear a ‘Meshing Log’ tree item below our mesh operation.
  • Once the mesh operation is finished, the mesh can now be viewed in the viewer.
  • The figure below shows highlights of the generated mesh for illustration.