While an integration of (2.16) theoretically gives the magnetic force on an object, numerical
problems arise when trying to evaluate this integral on a finite element mesh made of first-order
triangles. Though the solution for vector potential A is relatively accurate, the distributions of B
and H are an order less accurate, since these quantities are obtained by differentiating the trial
functions for A. That is, A is described by a linear function over each element, but B and H are
piece-wise constant over each element. Errors in B and H can be particularly large in elements in
which the exact solution for B and H changes rapidly–these areas are just not well approximated
by a piece-wise approximation. Specifically, large errors can arise in the tangential components
of B and H in elements adjacent to boundaries between materials of different permeabilites. The
worst errors arise on this sort of interface at corners, where the exact solution for B is nearly a
singularity.
If the stress tensor integral is evaluated on the interface between two different materials, the
results will be particularly erroneous. However, the stress tensor has the property that, for an
exact solution, the same result is obtained regardless of the path of integration, as long as that path
encircles the body of interest and passes only through air (or at least, every point in the contour
is in a region with a constant permeability). This implies that the stress tensor can be evaluated
over a contour a few elements away from the surface of an object–where the solution for B and
H is much more accurate. Much more accurate force results will be obtained by integrating along
the contour a few elements removed from any boundary or interface. The above discussion is the
rationale for the first guideline for obtaining forces via stress tensor:
Never integrate stress stress tensor along an interface between materials. Always de-
fine the integration contour as a closed path around the object of interest with the
contour displaced several elements (at least two elements) away from any interfaces
or boundaries.
As an example of a properly defined contour, consider Figure 2.23. This figure represents a
horseshoe magnet acting on a block of iron. The objective is to obtain the magnetic forces acting
upon the iron block. The red line in the figure represents the contour defined for the integration.
The contour was defined running clockwise around the block, so that the normal to the contour
points outward. Always define your contour in a clockwise direction to get the correct sign. Note
that the contour is well removed from the surface of the block, and the contour only passes through
air. To aid in the definition of a closed contour, grid and the “snap to grid” were turned on, and the
corners of the contour are grid points that were specified by right mouse button clicks.
The second rule of getting good force results is:
Always use as fine a mesh as possible in problems where force results are desired.
Even though an integration path has been chosen properly (away from boundaries and interfaces),
some significant error can still arise if a coarse mesh is used. Note that (2.16) is composed of B
2
terms – this means that stress tensor is one order worse in accuracy than B. The only way to get
that accuracy back is to use a fine mesh density. A good way to proceed in finding a mesh that is
“dense enough” is to solve the problem on progressively finer meshes, evaluating the force on each
mesh. By comparing the results from different mesh densities, you can get and idea of the level
of accuracy (by looking at what digits in the answer that change between various mesh densities).
You then pick the smallest mesh density that gives convergence to the desired digit of accuracy.
45