This knowledge base article will guide you on how to check mesh quality and how to improve it.
A high-quality mesh is one of the most critical factors that must be considered to ensure simulation accuracy, and this is why it is very important to check and improve your mesh quality. In this article, we will use the Standard mesher as an example.
Please visit this tutorial to learn how to use the standard mesher within SimScale.
The following topics are discussed:
- Checking the Meshing Log to have a quantitative idea about the overall mesh quality.
- Using the Mesh Quality feature to locate bad elements.
- Using manual mesh refinement to improve mesh quality.
The picture above is the initial mesh that will be used as an example.
1. Meshing Log
First, generate the mesh and once the mesh has been generated, you can see the mesh quality in the Meshing Log. You will find the Meshing Log under the Mesh settings in the simulation tree.
In the meshing log, you will find the statistical results of your generated mesh. These results will be mentioned as mesh metrics and these metrics will differ depending on the mesh type. It is worth keeping in mind that we need to monitor these values because it will affect the result of the simulation. Below are values that can be used as a best practice reference on when to check and improve your mesh quality:
- tetAspectRatio: \(\ll \) 100
- Non-orthogonality: \(\ll \) 75
- tetEdgeRatio: \(\ll \) 100
- VolumeRatio: \(\ll \) 100
The picture above shows that our mesh has bad quality because the maximum volume ratio is 93. Now, we have learned how to identify a bad quality mesh, but what is the cause and where are these bad quality elements located? Let’s find out.
2. Mesh Quality Feature
The Mesh quality is a SimScale feature, which visualizes the element quality. You will find this feature below the Meshing Log. In this example, we are only going to focus on reducing the maximum value for our volume ratio.
To visualize the volume ratio, do the following:
- Click “Results”.
- Choose the “Volume ratio”.
Everything in blue shows that the volume ratio is small in the overall domain. However, the current view can only show the surface elements. The best way to locate the bad quality elements is to isolate them and to do this we can use Isovolumes.
Isovolumes serves as a filter to isolate elements, whose volume ratio falls under a defined range. In this example, we will find mesh cells that have a volume ratio between 20 and 93. The steps below will explain how you can isolate these elements:
- Click the “+” icon next to Isovolumes.
- Type the range of the Volume ratio you are interested in. In this example, we want to identify the elements in between 20 and 93 volumetric ratio. Keeping the volume ratio below 100 is good enough for incompressible flow simulation. Here, we reduced the minimum limit to be able to locate the bad elements faster. The assumption is that the element quality will most likely change gradually.
- Locate the highlighted elements on the screen.
In the picture above, bad elements can be seen, but it is difficult to determine their location. You can focus on the bad elements by changing the view to Transparent Surface Outline Mesh, and then zooming in.
Now, we know where the bad elements are located. Such issues often occur due to the CAD model issues, ill-defined surfaces, small gaps, or sharp corners. The most cost-effective way to deal with these issues is through CAD cleaning.
However, if you don’t have a chance to do CAD cleaning, you can try to refine the mesh for the whole domain or only refine the mesh where the bad elements exist.
3. Mesh Refinement
You can always use SimScale’s automatic sizing feature to adjust the mesh size. Increasing the “Fineness” level will gradually increase the mesh size in the overall domain.
Another possibility is to refine the mesh in the problematic region with region refinement. Below is an example of how to refine the mesh in a specific region of your model:
The picture above shows the problematic region where there is a face in the geometry that becomes smaller and smaller. This is a problem because when the thickness of this face becomes too small, sharp edge cells are generated in this region. We will need a region refinement to mesh this region properly. For that:
- Add a region refinement.
- Create a geometry primitive (Cartesian box).
- Assign the Cartesian box you’ve just created.
- Assign a suitable cell size to the region.
We can also see that the mesh generated at the inlet of the pump is too coarse, and we can refine this by refining the whole model by increasing the fineness level.
After regenerating the mesh, we will get new mesh with new mesh quality statistics.
The initial mesh was updated with a region refinement as well as an increase in the general mesh fineness. We can see that the maximum volume ratio has decreased to 60.240.
We can also observe visually that the element sizes are relatively smaller in the region where the refinement was applied.