Electromagnetic Force Calculation Method in Finite Element Analysis for Programmers

Background/Objectives : Finite element method has been used widely for structural analysis of electromagnetic systems for a long time. Maxwell stress sensor and principle of virtual work are used to calculate electromagnetic force from finite element analysis results. Methods/Statistical analysis : In this paper, specific methodologies were presented when programming was coded directly without the use of commercial software. Maxwell stress sensor is the amount of tension expressed by the interaction of electromagnetic force with mechanical physical quantity. Findings : When calculating the electromagnetic force, a method of integration was proposed when trying to integrate by selecting the element around the body to obtain the force. Also, the principle of virtual work is to induce electromagnetic force from the derivation of system energy. This method was proposed to differentiate the matrix in the finite element method. Improvements/Applications : We selected a 3-dimensional Axisymmetric model to validate the usefulness of the proposed method of calculation.


Introduction
The finite element method(FEM) is one of the numerical analysis techniques that divides a continuum structure into finite number of elements and then performs calculations based on an approximate solution based on the energy principle for each domain. A finite number of elements use elements of a one-dimensional straight line, a two-dimensional triangle, a square, and a three-dimensional tetrahedron [1]. CAE is the method most commonly used for structural analysis and electromagnetic field analysis. It is a method developed for stresses and electromagnetic field analysis of complex shapes. This technique requires a high-performance computer because it performs extensive system matrix calculations, but it can also be used as a personal computer due to recent computer developments. Other numerical methods include finite difference method and boundary element method [2,3].
In electromagnetics, the Maxwell stress tensor is a 3 × 3 tensor that represents the strain generated by the electromagnetic field. The Maxwell stress tensor is a symmetrical 2-order tensor used in classical electromagnetics to represent the interaction between electromagnetic force and mechanical momentum. Calculation of the force exerted by a conductor carrying a currents in an uniform magnetic field is easily accomplished by Lorentz's law of force [4]. However, when calculating the magnetic force received by a ferromagnetic body in a magnetic field, the current term in the Lorentz equation must be replaced by a magnetic field or magnetic flux density. At this time, when the formula is developed by using the Maxwell stress tensor, the electromagnetic force can be easily expressed [5][6][7].
The concept of virtual displacement in relation to the concept of virtual operations in analytical mechanics is meaningful only when discussing motion-constrained physical systems. In the special case of infinite displacement, the virtual displacement means a minute change in the position coordinates of the system so that the constraint is satisfied [8][9][10].
In this paper, we introduce the coding techniques useful for programmers when calculating the electromagnetic force using the finite element method. In the case of integration of the object receiving the electromagnetic force using Maxwell stress, the path setting and the normal direction vector setting are specified according to the integration path. Also, when using the principle of virtual displacement, we need to differentiate the system matrix and developed this method. In order to verify the usefulness of the proposed method, an axisymmetric three-dimensional model with analytic solutions was established and compared with the proposed method [11].

Mathematical Theory for Electromagnetic Force
The basic principles of the Maxwell stress method and the virtual displacement method, which have been used for the calculation of the electromagnetic force, are explained by using the results of the finite element analysis. First, a mathematical process for deriving the Maxwell stress from the Lorentz force is described. The magnetic force density is expressed by the current density and the magnetic flux density as follows.
The current density term by Ampere's law are as follows.
Therefore, the force exerted by a magnetic field on an object having a volume V is as follows.
Using the vector identity, the magnetic flux density curl operation is developed as follows.
Therefore, the force of the volume is given by the following equation.
[ ] Where s is the surface of volume V and n is the extrinsic unit vector perpendicular to s .
When the extrinsic unit vector and divergence theorem are applied, the electromagnetic force equation can be expressed as Maxwell stress as follows.
The following is a concrete expression of Maxwell's stress and a representation of a unit vector. (9) z n y n x n n z y x+ + = (10) Generally, the electromagnetic force calculation uses the Lorentz equation, but the electromagnetic force in a region where no current flows in the magnetic field cannot be calculated. Therefore, by using Maxwell stress, it is possible to overcome this disadvantage because the current term is treated as magnetic flux density term. The force acting on an object with volume V is equal to the area of the stress tensor P acting on the surface s of the object.
When integrating Maxwell stress in a two-dimensional problem, the integral path becomes a line in the X-Y plane. The finite element used in this calculation is a triangular element, the trial function is a linear function, and the magnetic vector potential is used as a variable. [ ] The force acting on the differential length( l ∆ ) is the product of the Maxwell stress and the differential area.
The differential force is expressed as follows using the x and y components of the magnetic flux density and the normal unit vector.
[ ] In the above equation,   Figure 1 shows the shape of the elements surrounding the body receiving electromagnetic force. Serial numbers are assigned to triangle elements, and data is stored by assigning a constant number to each element node. The triangle element is divided into two cases where two nodes are in contact with the body and one case where one node is in contact. These two elements are not always alternately in the integral path. In the pointed shape of an object, elements that touch only one node are arranged continuously [12]. By setting a constant integration path in the triangular element and integrating the Maxwell stress, the electromagnetic force can be obtained. Figure 2 illustrates the integration path when integrating the Maxwell stress tensor in the element. The integral path is a closed loop around the body to calculate the force. In a finite element method, the magnetic flux density in the element is uniform when using a triangular element. Therefore, depending on how the integration path is set, the result of electromagnetic force may be somewhat different. Three examples of integration paths are described as follows. The first is to set the straight path from the midpoint of one side of the triangle element to the midpoint of the other side [13][14]. Here, We will now describe how to apply the virtual displacement method in the finite element method. The virtual displacement method is a method of calculating the electromagnetic force based on energy. When the virtual displacement p is considered, the electromagnetic force F in the p direction can be obtained by calculating the change amount of the total system magnetic field energy. When the magnetic field energy is differentiated in the finite element method, it is necessary to differentiate the system matrix inevitably.
If we express the magnetic force using the virtual displacement method as follows, and the magnetic flux density is represented by the magnetic vector potential A, the following is obtained in the two-dimensional space.
The square of the magnetic flux density and magnetic flux density used in the above energy equation can be expressed in each element as follows.
When the partial differential form is taken for each component in the virtual displacement method, the components of the magnetic force are as follows.
Here, the partial differentiations of the triangular element and the matrix are respectively as follows. In this case, is '1' if the i-th node on the element is on the boundary, and '0' otherwise. When using the virtual displacement method to calculate the electromagnetic force, the electromagnetic force of all the elements except the element that touches the boundary of the force body becomes '0'. Therefore, as in the Maxwell stress method, it is possible to obtain the total electromagnetism of the object by integrating the electromagnetic force of the element in contact with the boundary.

Numerical Application
The electromagnetic force calculation method using Maxwell stress tensor and the principle of virtual displacement is verified by comparing with the results of axisymmetric three-dimensional analysis in which has analytic solutions.  Figure 4 shows the proposed method for the coaxial circular loop with two currents. This model has an analytic solution and is also called a dipole model. This model is modeled by three-dimensional axial symmetry and compared with the results of the proposed method. The structural dimensions a, b, and c of the analytical model were 0.1 m, respectively, and the current through the circular loop was 594.5 A.
In order to obtain this model analytically, it is assumed that there is no cross -sectional area of the magnetic dipole. However, in the finite element method, it is impossible to interpret it unless there is an area or a volume in each area. Therefore, it is applied only to the three -dimensional axisymmetric problem which can be modeled as a twodimensional problem. The electromagnetic force between two magnetic dipoles on the coaxial axis can be analytically determined by the following equation.  Figure 5 shows the equi-potential line and mesh around the upper cable for numerical analysis of coaxial cable. Table 1 represents the results of force calculation using three kinds of method. Although the numerical analysis results are a little bit large, they agree with the analytical solution. The error of the numerical analysis method is very slight, about 0.19% in both cases.

Conclusions
In this paper, we describe the methodology for analyzing electromagnetic fields and calculating electromagnetic force using finite element method. In general, the algorithm is described from the standpoint of a programmer who codes the Maxwell stress tensor and the principle of virtual work used for electromagnetic force calculation. The Maxwell stress tensor method describes the integral path when calculating the force. Also, when applying the principle of the virtual displacement, we mentioned that the matrix is differentiated. In addition, three dimensional models with analytical solution were selected and compared with the proposed method.