websights

Fill out the form to download

Required field
Required field
Not a valid email address
Required field
Required field
  • Set up your own cloud-native simulation in minutes.

  • Documentation

    Tutorial: Creating a Standard Mesh on the Example of a Heat Sink

    This tutorial demonstrates how to create meshes using the Standard mesh tool. To showcase the effect of the setup parameters, a total of 6 meshes will be created, using a heat sink as the model.

    heat sink discretization standard mesh
    Figure 1: Heat sink mesh created with the standard algorithm

    Overview

    This meshing tutorial teaches users how to:

    • Create meshes using the standard meshing algorithm;
    • Apply different types of mesh refinement;
    • Use all basic and advanced settings;
    • Inspect the mesh.

    Note

    The usual workflow in SimScale is the following:

    1. Prepare the CAD model for the simulation;
    2. Set up the simulation;
    3. Create the mesh;
    4. Run the simulation and analyze the results.

    Since this is a meshing tutorial, it will focus on the third step.

    1. Prepare the CAD Model and Select the Analysis Type

    First of all, click the button below. It will copy the tutorial project containing the geometry into your workbench.

    The starting project contains a heat sink, a chip, and the flow region. The following picture demonstrates what should be visible after importing the project.

    heat sink geometry for standard mesh tutorial project
    Figure 2: Imported CAD model of a heat sink, chip, and flow region in the Workbench

    1.1 Create the Simulation

    Since we have a flow region and solid parts in the geometry, there will be interfaces between these volumes. In these cases, to enhance the detection of contacts, it’s recommended to run an imprint operation.

    In this tutorial, the Imprint operation has already been performed. Therefore, we can directly proceed to ‘Create the Simulation’:

    creating simulation after imprinting
    Figure 3: Creating a new simulation for the geometry

    Now, the analysis type widget opens. From the list, select ‘Conjugate Heat Transfer v2.0’, and click once more on ‘Create Simulation’:

    library of analysis types available
    Figure 4: Analysis types available in SimScale

    After creating a simulation, the simulation tree loads in the left-hand side panel. The global simulation settings will remain as default.

    global settings conjugate heat transfer analysis
    Figure 5: Default global simulation settings

    2. Simulation Setup

    Important

    In section 2 of the tutorial, we set up a simple simulation to make use of the physics-based meshing functionality.
    If you are not interested in the physics-based meshing option, you can directly jump to section 3 Standard Mesh.

    2.1 Model

    Specify gravity under Model. It will be -9.81 m/s² in the y-direction:

    gravity natural convection
    Figure 6: Specifying gravity in the model tab

    2.2 Materials

    In the simulation tree, please expand the Materials tab. Click on the ‘+ button’ next to Fluids and choose ‘Air’ from the fluid materials library.

    materials library showing fluids
    Figure 7: Fluid materials library

    Afterward, assign it to the Air domain.

    air material assignment
    Figure 8: Assigning air to the air domain

    Now repeat the process for the two Solids. Assign Aluminium to the Heat sink and Silicon to the Chip:

    assigning material to a heat sink in a conjugate heat transfer analysis
    Figure 9: The heat sink volume consists of aluminium.

    For the Chip volume, the material will be Silicon:

    assigning material to a chip in a conjugate heat transfer analysis
    Figure 10: Assigning silicon as material to the chip volume

    2.3 Boundary Conditions

    Click on the ‘+ button’ next to Boundary conditions. Select Natural convection inlet/outlet and assign it to the 6 outer faces of the air domain.

    natural convection inlet outlet definition heat sink meshing tutorial
    Figure 11: Boundary condition to simulate natural convection for the heat sink geometry

    3. Standard Mesh

    The standard meshing tool will be used to mesh the heat sink. A total of six different meshes will be created, to show how the configuration parameters affect the resulting mesh. Make sure to check this documentation page for the standard mesh settings.

    To create a mesh, please navigate to Mesh in the simulation tree. A tab with options will open.

    default settings for the standard meshing tool
    Figure 12: Default settings for the standard mesher

    Let’s get a brief overview of the basic settings:

    • Cell Sizing can be either manual or automatic. With Manual sizing, it’s possible to specify a maximum and minimum edge lengths for cells in the entire domain;
    • With the Fineness sliding bar, users can specify global levels of fineness to their meshes;
    • Automatic boundary layers generates layers automatically on all no-slip walls, based on the boundary conditions set by the user;
    • With Physics-based meshing, the regions near inlets and outlets are automatically refined. This option is useful to capture high gradients in these regions. Furthermore, if any advanced concepts are defined (such as porous medium and power sources), the algorithm automatically assigns cell zones to these volumes. To use physics-based meshing, users have to fully set up their simulation before creating a mesh.
    • When the Hex element core is enabled, the standard mesh becomes hybrid, generating tetrahedral cells close to the walls and hexahedral cells distant from walls.

    3.1 Mesh One: Default Settings

    Now it’s possible to use the default settings. Please head back to Mesh and hit ‘Generate‘.

    standard mesh default settings generation
    Figure 13: Generating a standard mesh with default settings. Note that the cell estimates may vary.

    The default standard mesh takes about 5 minutes to complete. When it finishes running, you can hide the Air domain to inspect the solid parts:

    standard mesher with default settings
    Figure 14: Heat sink mesh using standard mesher with default settings

    The default mesh is too coarse. For heat sinks, it’s recommended to generate a minimum of 2 or 3 elements across the fin thickness. Let’s generate a new mesh with a Fineness level of 7.

    3.2 Mesh Two: Changing Global Fineness

    The settings for the second mesh will be the same, except for the global level of Fineness.

    Follow the steps below to create a new mesh:

    creating a new mesh in simscale
    Figure 15: Steps to create a brand new mesh

    Now simply adjust the Fineness slide bar to 7 and ‘Generate’ the second mesh.

    heat sink mesh changing global fineness
    Figure 16: Settings for the second heat sink mesh, using fineness 7

    The second mesh takes roughly 10 minutes to run. Let’s now compare the heat sink discretization using the first and second meshes:

    comparing discretization heat sink different fineness
    Figure 17: Mesh using global fineness 7 (left) and mesh created with default settings (right).

    The fineness level changes the mesh size globally. Comparing the new and previous meshes, there is almost no obvious change in the element size on the heat sink. This shows that a large portion of refinement is performed in the air domain. Local refinement on heat sink and chip would be a more cost-effective way to generate a mesh.

    3.3 Mesh Three: Local Element Size Refinement

    Using the steps from figure 15, please create another mesh. To enhance the discretization of the fins, we will use a Local element size refinement. The other settings remain default.

    To create a refinement, click on the ‘+ button’ next to Refinements and select Local element size.

    creating a local element size refinement
    Figure 18: Creating a new refinement for a standard mesh.

    With local element size, you can specify a maximum element size for selected entities. It’s particularly useful to increase the resolution on small faces.

    For the heat sink model, each fin is 0.002 meters thick. A Maximum element size of 0.001 meters will ensure at least 2 elements across the thickness.

    Set up the refinement as below. To save time, assign it to a pre-saved saved selection named Local element size refinement.

    assigning a refinement to a set of faces
    Figure 19: Assigning a local element size refinement to a previously created Saved Selection.

    Now we can go back to the Mesh tab and hit ‘Generate’.

    using local element size refinement standard mesh
    Figure 20: Overview of the configuration for the third mesh

    Now, with the controlled cell size, it’s possible to see a big difference in the fins’ discretization.

    local element size refinements to get more cell density
    Figure 21: Effects of the local element size refinement on cell density

    So far, we have learned how to visualize the mesh on surfaces. However, this does not give us any information regarding the interior elements. For such cases, the Mesh quality feature can be used to see the interior cells. Please follow the steps below:

    creating a mesh section view cutting plane mesh quality
    Figure 22: Steps to create a cutting plane in the Mesh quality tool
    1. Click on the Mesh quality
    2. Click on the ‘+ button’ next to Cutting Planes

    As we are not interested in seeing the quality of the cells at the moment, change the Scalar to ‘None’ and enable Show element mesh. Now the interior is visible – We can see the hexahedral cells in the middle of the domain. By zooming in to the fins, the boundary layers can be seen:

    mesh inspection quality tool
    Figure 23: Section view of a heat sink mesh, highlighting layer generation on the walls.

    3.4 Mesh Four: Region Refinement

    From the image above, we can see that mesh size suddenly increases when it transitions from tetrahedral to hexahedral cells.

    Due to the natural convection, a hot air plume is expected to rise along the vertical axis of the heat sink. To ensure that we are capturing the convection plume more accurately, a region refinement is recommended.

    For the fourth mesh, let’s copy the third mesh and add a region refinement. To copy a mesh, follow the steps below:

    copying an existing mesh
    Figure 24: When you copy a mesh, all mesh settings, including refinements, are copied to the new one.
    1. Click on the arrow to access the mesh menu
    2. Click on Copy mesh settings from…
    3. Select the third mesh to copy all of its settings

    After these steps, the fourth mesh can be set up. Click on the ‘+ button’ next to Refinements and create a Region refinement. The Maximum edge length defines the maximum element size within a region. Please input ‘0.004’ meters.

    Afterward, click on the ‘+ button’ next to Geometry primitives and select a Cartesian box.

    creating a geometry primitive for a region refinement
    Figure 25: Setting up a region refinement

    Next, define the coordinates of the cartesian box, keeping in mind that it should fully cover the heat sink and chip. Consider the possible flow motion while deciding where to place the refinement region.

    region refinement cartesian box dimensions
    Figure 26: Specifying dimensions for a cartesian box. Please assign this box to the region refinement.

    Go ahead and ‘Generate’ the fourth mesh. This one has an improved discretization around the heat sinks. To visualize it clearly, we can enter the mesh quality environment again:

    region refinement standard mesher
    Figure 27: Effect of a region refinement. This mesh is better suited to capture natural convection.

    3.5 Mesh Five: Inflate Boundary Layers

    By default, the Automatic boundary layers option creates 3 layers. However, you can change all of the layer settings, giving you full control over the layer generation.

    Please copy the settings from the previous mesh and configure the new mesh as below:

    adjusting the number of layers in a standard mesh
    Figure 28: The boundary layers are automatically created on all solid walls of the geometry.

    For this mesh, we will only adjust the Number of layers to ‘5’. It is also possible to easily control the Layer gradation by either specifying the Growth rate or the First layer thickness. After adjusting the number of layers, we are ready to ‘Generate’ the fifth mesh.

    The extra layers can be seen with a mesh clip. With this configuration, the near-wall profiles are captured more accurately.

    boundary layers created with manual refinement on a standard mesh
    Figure 29: Custom boundary layers generated on the fin.

    3.6 Mesh Six: Advanced Settings

    By expanding Advanced settings, you will find three additional parameters:

    • Small feature suppression represents a threshold to ignore small entities. Only entities larger than the input value are meshed.
    • The Gap refinement factor represents the number of cells in small gaps. It doesn’t necessarily have to be an integer.
    • Finally, the Global gradation rate is the ratio between the size of two adjacent cells. In short, it controls how fast the mesh transitions from small to large cells. The default setting is 1.22 – smaller values result in a smoother transition, whereas larger values cause a faster transition.

    On one of the sides of the heat sink, a lot of small features are present. Their smallest edge has about 0.2 mm of length. Naturally, gaps are also present, between the fins.

    small features and gap elements in a heat sink
    Figure 30: Highlighting small features (left) and one gap element (right) within the heat sink.

    To see how both advanced settings work, please copy the settings of the very first mesh from this tutorial. Change Small feature suppression to 0.0005 meters and the Gap refinement factor to 2.

    standard meshing tool advanced settings
    Figure 31: Advanced standard mesh settings

    Comparing the first mesh to the advanced settings mesh, the differences can be seen clearly:

    standard mesh small feature suppression
    Figure 32: Mesh with feature suppression and gap elements (bottom) versus default settings mesh (top)

    The 2 gap elements improve the discretization of the gaps between the fins, while the small feature suppression prevents the small faces from being meshed.

    The small feature suppression setting can be particularly helpful when the CAD models are not very clean.

    Congratulations! You have finished the standard meshing tutorial!

    Note

    If you have questions or suggestions, please reach out either via the forum or contact us directly.

    Last updated: November 8th, 2023

    Contents