Using Adaptive Meshing for Local Solution Improvement
One of the perennial questions in finite element modeling is how to choose a mesh. We want a fine enough mesh to give accurate answers, but not too fine, as that would lead to an impractical solution time. As we’ve discussed previously, adaptive mesh refinement lets the software improve the mesh, and by default it will minimize the overall error in the model. However, we often are only interested in accurate results over some subset of the entire model space. Today we will introduce a technique to refine the mesh based on a local metric.
A Model with Global Mesh Refinement
Let’s take a look at a simple mechanical problem — a bracket that is fixed at the bottom and has a load applied at the top. Two different fillet radii are applied and, as a consequence, it is difficult to predict where the peak stresses will be. Let’s first solve the problem on an extremely coarse mesh, using the default second-order elements, and observe the results. We can see that the peak stresses are at the larger radius fillet, and that the mesh appears to quite poorly resolve the solution.
Stresses and deformations solved on a coarse mesh.
To get a more accurate solution, we can go to the Adaptation and Error Estimates settings available with the Stationary, Frequency Domain, and Eigenvalue study steps. An example of these settings is shown in the screenshot below. The error estimate is by default based upon minimizing the L2 norm of error squared, which is a global metric. That is, the remeshing will reduce the error everywhere in the model. The default refinement method is Mesh initialization, which will refine the mesh in areas where smaller elements are needed, but can also coarsen the mesh where a fine mesh is not needed. By default, this adaptive refinement will be done twice, but in the screenshot below, a total of four refinements are specified.
Adaptive mesh refinement settings to reduce the global error in the model. Relevant settings are highlighted.
The result of this adaptive mesh refinement is shown below. Note how the mesh is quite uniformly refined throughout the domain. The stress field is clearly smoother than on our original mesh.
The results of the adaptive mesh refinement using the L2 norm of error squared as the error estimate.
Local Solution-Based Adaptive Mesh Refinement
Let’s now set up the same problem, but use a different metric for the adaptive mesh refinement. From the coarse mesh, we can probably already see that the highest stresses are at the larger radius fillet so we can tell the adaptive mesh refinement algorithm to address the stresses in this location. We will switch to a Functional Error Estimate, which requires that we enter a functional with respect to which the mesh will be improved. The functional can be any differentiable scalar output based upon the solution. The functional we will use is the integral, along the boundary, of the von Mises stress, the model variable
comp1.solid.mises. An Integration component coupling named
comp1.intop1() is defined at the boundary defining the larger fillet, as shown in the screenshot below.
Adaptive mesh refinement settings to reduce the local error at one location in the model.
The Integration coupling operator is used to define the boundary where we will evaluate the stress.
When we look at the results of this approach, we should notice two features of the refined mesh. First, it has preferentially inserted smaller elements around the fillet boundary that we selected. This is as expected, since we are trying to get more accurate results in this region. However, we also observe that the mesh has been refined in other regions of the model, not just at the boundary of interest. The adaptive mesh refinement algorithm will globally adjust the mesh to better resolve the local stresses, and these stresses depend on the solution everywhere else in the model.
We can also see that using manual mesh refinement to predict the peak stress may be very difficult, because we usually cannot easily determine what other parts of the model may affect our solution.
The refined mesh, based upon a local functional error estimate.
Conclusions on Adaptive Meshing
We have seen that you can specify a local quantity over which to perform adaptive mesh refinement, and the software will refine the mesh to give better results locally, but also refine the mesh in other regions of the model that you may not immediately realize affect the local quantity you are interested in. The technique shown here is a powerful way to refine the mesh with confidence.
Editor’s note: This blog post was updated on 8/21/17.
- COMSOL Now
- Fluid & Heat
- Structural & Acoustics
- Today in Science