## Adapting Elements for 2D and 3D Electromagnetics

The implementation of an adaptive meshing algorithm requires two phases.

The critical part of the process is determining where to refine the mesh. Any method used to measure the relative error in a solution must respect the physics of the simulation being performed. The solution gradient, itself, is a simple yet fast way to determine the local needs for mesh density in both the BEM and FEM. Also, if the mesh poorly represents the solution, errors in the fundamental field properties or satisfaction of boundary can be an indicator. For example, in the FEM solution to an electric field problem, the priority of elements to refine may be ordered by the magnitude of the difference in divergence of the D-field and the volumetric charge (normally zero) over each element. In the BEM solution to the same problem, the difference in the tangential E-field or the normal D-field at each element might be used to select which areas require a more dense mesh.

After determining where density in the mesh is required, the preferred method for generating the refined mesh for the next solution is to directly refine the existing mesh by inserting a number of points. Some algorithms will generate a density function to be used when generating the mesh from scratch. The density function in certain areas is increased at each step. By inserting points directly into the existing mesh, it is guaranteed that the elements with the greatest errors are refined. Using another refinement step after this to preserve a shape property will ensure that the transition between areas with a highly dense mesh and those with a more coarse mesh also contains well shaped elements.

A simple example is a parallel plate capacitor analyzed with interest in the electric fields. The field solution can be subsequently used to determine the total charge on the conducting surfaces which may be used to determine the stability of the solution. Using a BEM solver, the solution is a charge distribution on each plate – given an assigned constant voltage on each plate. Since the charge density is nearly constant on a large part of the capacitor plates, only few elements are required there. The charge density increases rapidly near the edges of the plates and therefore the most accurate solutions will have a very dense mesh at these edges. Similarly, for the FEM solution, the fields bend most at the corners of the plates and therefore the 3D mesh must be fine in those areas. In the center, between the plates and in the open space surrounding the capacitor, the field is relatively constant and therefore a coarse density is sufficient.

Adapted (left) and uniform (right) BEM meshes for parallel plate model with approximately the same number of elements.

Using the same general principles, the models with more complex electric field patterns such as a high voltage insulator can also be meshed adaptively.

Section view of the adapted BEM mesh (right) of a high voltage insulator model (left).

By changing the type of physical guidelines for increasing the mesh density, the same general approach can be used for difference physical models. For example, using analogous magnetic field properties can be used to generate adaptive meshes for a variable reluctance sensor model or an eddy current model, such as a coil used for crack detection in metal surfaces.

Adapted FEM meshes on a variable reluctance sensor (left) and an eddy current nondestructive test coil sensor (right).

As an example of the efficiency and convergence of the adaptive process, a series of cogging torque calculations on the 2D permanent magnet motor model is performed using a FEM solver. Cogging torque can be a very difficult computation because it consists of an accumulation of very small forces acting in opposite directions. The calculated cogging torque for various numbers of elements using adaptive and uniform mesh distributions are shown in the graph below. With the adapted mesh, a stable convergence of less than 1% change is achieved after about 30 000 elements, while the uniform mesh solutions show greater fluctuations than this even after 100 000 elements. The case of over 400 000 uniform elements is included to confirm this.

Comparison of cogging torque calculations using adapted and uniform FEM meshes with similar number of elements

Using adaptive meshing gives simulation software users confidence in results and maintains efficiency in generating solutions and post-processing results. In electromagnetic simulation tools, refinement based on the solution and on fundamental field quantities are reliable ways to determine the areas of physical models where mesh refinement should be performed. This type of adaptive meshing places the expertise for mesh generation in the hands of the software and eliminates the need for mesh “tinkering” on the part of the software user.

Adaptive meshing is included in the suite of electromagnetic simulation tools from INTEGRATED Engineering Software for both 2D and 3D model simulations. All packages also include BEM and FEM solvers so users may choose the best method for their application. The presence of both kinds of solvers also provides and extra level of confidence, as users can compare results from each solution method to the other.