# On torque computation in electric machine simulation by harmonic mortar methods

## Abstract

The use of trigonometric polynomials as Lagrange multipliers in the harmonic mortar method enables an efficient and elegant treatment of relative motion in the stator-rotor coupling of electric machine simulation. Explicit formulas for the torque computation are derived by energetic considerations, and their realization by harmonic mortar finite element and isogeometric analysis discretizations is discussed. Numerical tests are presented to illustrate the theoretical results and demonstrate the potential of harmonic mortar methods for the evaluation of torque ripples.

## 1 Introduction

A particular challenge for electric machine simulation is the relative motion of stator and rotor and the computation of quantities of interest depending on the rotation angle, e.g., the torque as a measure for the magneto-mechanic energy conversion. Various approaches have been proposed to tackle the coupling of subdomain problems on moving geometries, e.g., moving band, mortar and Lagrange multiplier or discontinuous Galerkin methods [1, 7, 13, 16], all with their specific advantages and shortcomings. In addition, different strategies have been discussed for the numerical computation of the torque, e.g., via virtual displacements or the Maxwell stress tensor; see [12] for an overview.

In this paper, we consider harmonic mortar finite element and isogeometric analysis methods proposed in [3, 10], which are based on finite element or isogeometric analysis approximations of the magnetic problems in the stator and rotor subdomains, coupled by a Lagrange multiplier technique using trigonometric functions. These methods have several interesting properties:

1. (a)

They are based on the Galerkin approximation of a certain weak formulation of the problem using Lagrange multipliers. This will allow us to give an unambiguous definition of the torque resulting in an exact energy conservation principle also on the discrete level.

2. (b)

The computed torque, as a function of the rotation angle, can be shown to be smooth, i.e., infinitely differentiable, and therefore no spurious torque ripples are introduced by non-smoothness of the numerical approximation.

3. (c)

The use of trigonometric functions for the Lagrange multipliers additionally allows for an efficient assembling of the coupling matrices for multiple rotation angles, avoiding the repeated integration of interface terms.

The resulting methods therefore are particularly well-suited for multiquery applications, e.g., the construction of performance maps, the setup of reduced order models, coupled frequency or time domain simulations. This will be illustrated by computation of cogging torque in the numerical tests.

The remainder of the manuscript is organized as follows: Sect. 2 introduces the magnetostatic setting for electric machines in two dimensions. The strong and weak formulations of the problem are presented and the energy balance is used to derive the torque. The discretization of the problem is given in Sect. 3 using the Galerkin approach. Section 4 discusses the harmonic mortar method and its implementation. Numerical results for the torque computation using the harmonic mortar method are demonstrated in Sect. 5. Finally the paper is concluded with a discussion in Sect. 6.

## 2 Problem statement

For ease of presentation, we consider a linear magnetostatic setting in two space dimensions. The geometric setup represents the cross section of a cylindrical device and consists of a stator domain $$\Omega _{S}$$ completely enclosing the rotor domain $$\Omega _{R}$$ with common interface $$\Gamma = \partial \Omega _{S} \cap \partial \Omega _{R} = \partial \Omega _{R}$$; see Fig. 1. Motivated by the application context, we assume that Γ is a circle placed within the air gap and centered around the origin. Using a standard vector potential formulation [1, 10], the magnetic fields in the two subdomains are described by

\begin{aligned}& {-}\operatorname {div}(\nu _{S} \nabla a_{S}) = j_{e} \quad \text{in } \Omega _{S}, \end{aligned}
(1)
\begin{aligned}& {-}\operatorname {div}(\nu _{R} \nabla a_{R}) = \operatorname {div}M^{\perp }\quad \text{in } \Omega _{R}, \end{aligned}
(2)

where $$a_{S}$$, $$a_{R}$$ are the z-component of the magnetic vector potential, $$j_{e}$$ is the impressed electric source density, and $$M^{\perp } = (m_{y},-m_{x})$$ the rotated magnetization vector. The equations are formulated in two different coordinate systems attached to the respective subdomains, such that the position of material continuities stays fixed under relative motion. We further assume that

\begin{aligned}& a_{S} = 0 \quad \text{on } \Sigma \end{aligned}
(3)

on the outer boundary $$\Sigma = \partial \Omega _{S} \setminus \Gamma$$. The continuity of the magnetic field and the magnetic vector potential across the interface are encoded in

\begin{aligned}& a_{S} = a_{R} \circ \rho _{-\alpha } \quad \text{on } \Gamma , \end{aligned}
(4)
\begin{aligned}& n_{\Gamma }\cdot (\nu _{S} \nabla a_{S}) = n_{\Gamma }\cdot (\nu _{R} \nabla a_{R}) \circ \rho _{-\alpha } \quad \text{on } \Gamma , \end{aligned}
(5)

where $$\rho _{\alpha }$$ describes the rotation of a point by angle α around the origin and $$(f\circ g)(x)=f(g(x))$$ is the concatenation of functions. Furthermore, $$n_{\Gamma }$$ denotes the unit normal vector on Γ pointing from $$\Omega _{R}$$ to $$\Omega _{S}$$. The second coupling condition allows us to introduce

\begin{aligned}& \lambda := n_{\Gamma }\cdot (\nu _{S} \nabla a_{S}) \end{aligned}
(6)

which amounts to the tangential trace of the magnetic field at the interface.

### Dependence on α

By (4)–(5) the solutions $$(a_{S},a_{R},\lambda )$$ of (1)–(6) implicitly depend on the rotation angle α, even if the sources $$j_{e}$$ and M are independent of α, which we assume in the sequel. We write $$u(\cdot \vert \alpha )$$ to highlight the dependence of a function u on the angle α and denote by

\begin{aligned} u'(\cdot \vert \alpha ) := \frac{d}{d\alpha } u(\cdot \vert \alpha ) := \lim_{ \varepsilon \to 0} \frac{1}{\varepsilon } \bigl(u(\cdot \vert \alpha + \varepsilon ) - u(\cdot \vert \alpha ) \bigr) \end{aligned}
(7)

the derivative of such a parameter-dependent function u with respect to the parameter α. By differentiation of (4) with respect to α, we can see that

\begin{aligned}& a'_{S}(x_{\theta }\vert \alpha ) = a'_{R}(x_{\theta - \alpha }\vert \alpha ) + \frac{d}{d\theta } a_{R}(x_{\theta -\alpha }\vert \alpha ) \quad x_{\theta }\in \Gamma , \end{aligned}
(8)

where $$x_{\theta -\alpha } = \rho _{-\alpha }(x_{\theta })$$ is the point in the rotated coordinate system of $$\partial \Omega _{R}$$ corresponding to a point $$x_{\theta }=(r_{\Gamma }\cos \theta ,r_{\Gamma }\sin \theta )$$ on the fixed interface Γ; see Fig. 1. Furthermore, $$\frac{d}{d\theta } u(x_{\theta }) = r_{\Gamma }n_{\Gamma }^{\perp }\cdot \nabla u(x_{\theta })$$ amounts to the tangential derivative of u along Γ and $$r_{\Gamma }$$ is the radius of Γ.

### Weak formulation

Using standard arguments, sufficiently regular solutions of (1)–(5) can be seen to satisfy the variational identities

\begin{aligned}& (\nu _{S} \nabla a_{S}, \nabla v_{S})_{\Omega _{S}} + \langle \lambda , v_{S} \rangle _{\Gamma }= (j_{e}, v_{S})_{\Omega _{S}}, \end{aligned}
(9)
\begin{aligned}& (\nu _{R} \nabla a_{R}, \nabla v_{R})_{\Omega _{R}} - \langle \lambda , v_{R} \circ \rho _{-\alpha }\rangle _{\Gamma }= \bigl(-M^{\perp }, \nabla v_{R} \bigr)_{\Omega _{R}} , \end{aligned}
(10)
\begin{aligned}& \langle a_{S} - a_{R} \circ \rho _{-\alpha }, \mu \rangle _{\Gamma }= 0 \end{aligned}
(11)

for all smooth test functions $$v_{S}$$, $$v_{R}$$, and μ defined on $$\Omega _{S}$$, $$\Omega _{R}$$, and Γ, respectively, with $$v_{S}=0$$ on Σ. Using the considerations outlined above, the coupling condition (11) can also be rephrased as

\begin{aligned}& \bigl\langle a'_{S} - a'_{R} \circ \rho _{-\alpha }, \mu \bigr\rangle _{\Gamma }= \biggl\langle \frac{d}{d\theta } a_{R} \circ \rho _{- \alpha }, \mu \biggr\rangle _{\Gamma } \end{aligned}
(12)

which will be used in the following considerations.

### Energy balance and torque computation

As a next step, we introduce the magnetic energy of the system. For ease of notation, we assume a unit length L of the device in axial direction. Then

\begin{aligned} E(a_{S},a_{R}) = \int _{\Omega _{S}} \frac{\nu _{S}}{2} \vert \nabla a_{S} \vert ^{2} \,dx + \int _{\Omega _{R}} \frac{\nu _{R}}{2} \vert \nabla a_{R} \vert ^{2} + M^{\perp }\cdot \nabla a_{R} \,dx. \end{aligned}
(13)

Let us note that, via the fields $$a_{S}$$, $$a_{R}$$, the energy also implicitly depends on the rotation angle α. By elementary calculations, we may then compute

\begin{aligned} \frac{d}{d\alpha } E(a_{S},a_{R}) &= \bigl(\nu _{S} \nabla a_{S}, \nabla a'_{S} \bigr)_{ \Omega _{S}} + \bigl(\nu _{R} \nabla a_{R}, \nabla a'_{R} \bigr)_{\Omega _{R}} + \bigl(M^{\perp }, \nabla a'_{R} \bigr)_{\Omega _{R}} \\ &= \bigl(j_{e}, a'_{S} \bigr)_{\Omega _{S}} - \bigl\langle \lambda , a'_{S} \bigr\rangle _{\Gamma }+ \bigl\langle \lambda , a'_{R} \circ \rho _{-\alpha } \bigr\rangle _{\Gamma }, \end{aligned}

where we used the variational identities (9)–(10) with $$v_{S}=a'_{S}$$ and $$v_{R} = a'_{R}$$ in the second step. Using the differential form (12) of the coupling condition, we arrive at the energy balance

\begin{aligned} \frac{d}{d\alpha } E(a_{S},a_{R}) &= \bigl(j_{e},a'_{S} \bigr)_{\Omega _{S}}- \biggl\langle \lambda , \frac{d}{d\theta } a_{R} \circ \rho _{-\alpha } \biggr\rangle _{\Gamma }, \end{aligned}

where the first term denotes the electric work required to maintain the electric current $$j_{e}$$ in the stator coils (neglecting Ohmic losses), and the second term is the mechanic work required for an infinitesimal rotation of the system. These energy-based considerations immediately give rise to the following definition of the torque

\begin{aligned} T(\alpha ) := \biggl\langle \lambda , \frac{d}{d\theta } a_{R} \circ \rho _{- \alpha } \biggr\rangle _{\Gamma }. \end{aligned}
(14)

Note that $$a_{R}$$ and λ and hence T are functions of the rotation angle α. In general, the energy and torque have to be scaled by the axial length L.

### Remark 1

The above formula can be derived in various ways, see [4, 9, 12]. Since the stator and rotor were both assumed to be rigid bodies, the torque can be computed here directly without resorting to the Maxwell stress tensor. Using rotational symmetry as well as integration by parts along the interface Γ, we can express the torque alternatively as

\begin{aligned} T(\alpha ) = - \biggl\langle \frac{d}{d\theta } \lambda \circ \rho _{\alpha }, a_{R} \biggr\rangle _{\Gamma }, \end{aligned}
(15)

which may be more convenient depending on the particular setting.

## 3 Galerkin approximation

For discretization of the problem (1)–(5), we consider Galerkin approximations of the variational equations (9)–(11) using appropriate finite-dimensional sub-spaces $$V_{h,S} \subset H^{1}_{\Sigma }(\Omega _{S})$$, $$V_{h,R} \subset H^{1}(\Omega _{R})$$, and $$M_{N} \subset H^{-1/2}(\Gamma )$$. Let us note that the boundary conditions (3) are incorporated explicitly in the definition of $$H^{1}_{\Sigma }(\Omega _{S})=\{v \in H^{1}(\Omega _{S}) : v=0 \text{ on } \Sigma \}$$ here. The discrete problem for a fixed angle α then reads as follows.

### Problem 1

Find $$a_{h,S} \in V_{h,S}$$, $$a_{h,R} \in V_{h,R}$$ and $$\lambda _{N} \in M_{N}$$ such that

\begin{aligned}& (\nu _{S} \nabla a_{h,S}, \nabla v_{h,S})_{\Omega _{S}} + \langle \lambda _{N}, v_{h,S}\rangle _{\Gamma }= (j_{e}, v_{h,S})_{ \Omega _{S}} , \end{aligned}
(16)
\begin{aligned}& (\nu _{R} \nabla a_{h,R}, \nabla v_{h,R})_{\Omega _{R}} - \langle \lambda _{N}, v_{h,R} \circ \rho _{-\alpha }\rangle _{\Gamma }= - \bigl(M^{\perp }, \nabla v_{h,R} \bigr)_{\Omega _{R}} , \end{aligned}
(17)
\begin{aligned}& \langle \alpha _{h,S} - \alpha _{h,R} \circ \rho _{-\alpha }, \mu _{N} \rangle _{\Gamma }= 0 \end{aligned}
(18)

for all discrete test functions $$v_{h,S} \in V_{h,S}$$, $$v_{h,R} \in V_{h,R}$$, and $$\mu _{N} \in M_{N}$$.

By choosing bases for the approximation spaces $$V_{h,S}$$, $$V_{h,R}$$ and $$M_{N}$$, the discrete variational problem can be turned into a linear system of equations for the corresponding coordinate vectors; see Sect. 4 for details. The above variational form is however more convenient for the analysis of the discretization.

### Well-posedness

For the following considerations, we assume that $$V_{h,S}$$, $$V_{h,R}$$, and $$M_{N}$$ are finite-dimensional and that $$\nu _{S}$$, $$\nu _{R}$$ are uniformly positive and bounded from above. The source currents $$j_{e}$$ and magnetization vector M, as well as the domains $$\Omega _{S}$$, $$\Omega _{R}$$ are assumed to be sufficiently regular. We can then establish the well-posedness of the discretization scheme as follows.

### Lemma 1

Assume that

\begin{aligned} \sup_{v_{h,S} \in V_{h,S}} \frac{\langle v_{h,S}, \mu _{N}\rangle _{\Gamma }}{ \Vert v_{h,S} \Vert _{H^{1}(\Omega _{S})}} \ge \beta \Vert \mu _{N} \Vert _{H^{-1/2}(\Gamma )} \quad \textit{for all } \mu _{N} \in M_{N}. \end{aligned}
(19)

Then the discrete variational problem (16)(18) is uniquely solvable and

\begin{aligned} & \Vert a_{S} - a_{h,S} \Vert _{H^{1}(\Omega _{S})} + \Vert a_{R} - a_{h,R} \Vert _{H^{1}( \Omega _{R})} + \Vert \lambda - \lambda _{N} \Vert _{H^{-1/2}(\Gamma )} \\ &\quad \le C(\beta ) \bigl( \Vert a_{S} - v_{h,S} \Vert _{H^{1}(\Omega _{S})} + \Vert a_{R} - v_{h,R} \Vert _{H^{1}(\Omega _{R})} + \Vert \lambda - \mu _{N} \Vert _{H^{-1/2}( \Gamma )} \bigr) \end{aligned}

for all $$v_{h,S} \in V_{h,S}$$, $$v_{h,R} \in V_{h,R}$$ and $$\mu _{N} \in M_{N}$$.

The assertion is a direct consequence of Brezzi’s saddle-point theory [6]; also see [7, 11] for application in the current context. Under the stability condition (19), the Galerkin approximations obtained by Problem 1 thus always lead to quasi-optimal error estimates with respect to the chosen approximation spaces. Two particular examples of Galerkin approximations will be discussed below.

### Discrete torque computation and energy balance

Mimicking the formula (14) for the torque obtained on the continuous level, it seems natural to define the discretized approximation of the torque as

\begin{aligned} T_{h,N}(\alpha ) := \biggl\langle \lambda _{h}, \frac{d}{d\theta } a_{h,R} \circ \rho _{-\alpha } \biggr\rangle _{\Gamma }. \end{aligned}
(20)

The torque computation for a given angle α thus only requires the solution of one magnetostatic interface problem (16)–(18) for this specific angle. With the same reasoning as on the continuous level, we obtain the following result.

### Lemma 2

Let $$(a_{h,S},a_{h,R},\lambda _{N})$$ denote a solution of (16)(18). Then

\begin{aligned} \frac{d}{d\alpha } E(\alpha _{h,S},\alpha _{h,R}) = \bigl(j_{e},a'_{h,S} \bigr)_{ \Omega _{S}} - T_{h,N} \end{aligned}
(21)

with discrete torque $$T_{h,N}$$ defined by the formula (20).

This assertion illustrates that the electro-magneto-mechanic energy balance holds exactly also on the discrete level.

### Alternative representation and smooth dependence on α

If the space $$M_{N}$$ of discrete Lagrange multipliers consists of sufficiently smooth functions, we may express the discrete torque equivalently as

\begin{aligned} T_{h,N} = - \biggl\langle \frac{d}{d\theta } \lambda _{N} \circ \rho _{ \alpha }, a_{h,R} \biggr\rangle _{\Gamma }. \end{aligned}
(22)

By a recursive argument, one can then show the following result.

### Lemma 3

Let $$M_{N}$$ consist of $$k-1$$ times continuously differentiable functions. Then the solution $$(a_{S},a_{R},\lambda _{N})$$ is k times differentiable with respect to α.

A proof of this assertion follows from the algebraic structure of the discretized problem; see the end of the next section.

## 4 Harmonic mortar discretizations

As a particular choice of a Galerkin approximation, we now consider the following choice of spaces: $$V_{h,S}$$ and $$V_{h,R}$$ are standard $$H^{1}$$-conforming finite element spaces [5] over appropriate triangulations of the stator and rotor domain $$\Omega _{S}$$ and $$\Omega _{R}$$. Note that no conformity of the mesh across the interface is required. For approximation of the Lagrange multipliers, we consider the space

\begin{aligned} M_{N} = \Biggl\{ \mu _{N}(x_{\theta }) = \frac{c_{0}}{2} + \sum_{n=1}^{N} c_{n} \cos (n \theta ) + d_{n} \sin (n \theta ) : c_{n}, d_{n} \in \mathbb {R}\Biggr\} \end{aligned}
(23)

of trigonometric polynomials of degree ≤N.

### Remark 2

As shown in [11], the inf-sup condition (19) holds true, if N is chosen not too large. As a rule of thumb, N must not exceed the number of degrees of freedom in $$V_{h,S}$$ and $$V_{h,R}$$ associated to the interface Γ. For a finite element approximation on a quasi-uniform mesh and with fixed polynomial degree p, stability can thus be guaranteed for $$N \lesssim h^{-1} p$$; see [11, Theorem 1]. Similar results hold for isogeometric methods for the stator and rotor domains [3, 8]. Following the considerations of the previous section, both methods allow for a torque computation consistent with a discrete energy conservation principle.

### Implementation of the harmonic mortar finite element method

In the following, we discuss some details concerning the implementation of the harmonic mortar finite element method outlined above. As we will see, the use of trigonometric polynomials for the discrete Lagrange multipliers brings advantages also for the numerical realization.

After choosing appropriate basis functions for the finite element subspaces $$V_{h,S}$$, $$V_{h,N}$$ and the trigonometric polynomials in $$M_{N}$$, the discrete variational problem (16)–(18) can be turned into a linear system

\begin{aligned}& K_{S} a_{S}(\alpha ) +B_{S}^{\top } \lambda ( \alpha ) = {J_{e}} , \end{aligned}
(24)
\begin{aligned}& K_{R} a_{R}(\alpha ) -B_{R}(\alpha )^{\top }\lambda (\alpha ) = {J_{M}} , \end{aligned}
(25)
\begin{aligned}& B_{S} a_{S}(\alpha ) - B_{R}(\alpha ) a_{R}(\alpha )= 0. \end{aligned}
(26)

The source vectors $$J_{e}$$ and $$J_{M}$$ and the matrices $$K_{S}$$, $$K_{R}$$ and $$B_{S}$$ are independent of the angle α, whereas $$B_{R}$$ and hence also the solution vectors $$a_{S}$$, $$a_{R}$$ and λ depend on the rotation angle. For the harmonic mortar, the entries of the coupling matrix $$B_{R}(\alpha )$$ can be computed by the following expressions

\begin{aligned}& \bigl[B_{R}(\alpha ) \bigr]_{2n,j} = \int _{0}^{2\pi } \cos (n \theta ) \phi _{j}(x_{ \theta -\alpha }) r_{\Gamma }\,d\theta , \quad n \ge 0, \\& \bigl[B_{R}(\alpha ) \bigr]_{2n-1,j} = \int _{0}^{2\pi } \sin (n \theta ) \phi _{j}(x_{\theta -\alpha }) r_{\Gamma }\,d\theta , \quad n \ge 1, \end{aligned}

where $$\phi _{j}$$ are the basis functions for the Galerkin approximation on $$\Omega _{R}$$.

### Remark 3

By trigonometric summation formulas, we get

\begin{aligned}& \bigl[B_{R}(\alpha ) \bigr]_{2n,j} = \cos (n\alpha ) \bigl[B_{R}(0) \bigr]_{2n,j} -\sin (n \alpha ) \bigl[B_{R}(0) \bigr]_{2n-1,j}, \\& \bigl[B_{R}(\alpha ) \bigr]_{2n-1,j} = \sin (n\alpha ) \bigl[B_{R}(0) \bigr]_{2n,j} + \cos (n \alpha ) \bigl[B_{R}(0) \bigr]_{2n-1,j}, \end{aligned}

with smooth coefficients depending on α, hence the integrals in the coupling matrix $$B_{R}(\alpha )$$ in fact only have to be evaluated for a single angle $$\alpha =0$$. In matrix notation, we may then write

\begin{aligned} B_{R}(\alpha ) = R(\alpha ) B_{R}(0), \end{aligned}
(27)

where $$R(\alpha )$$ is a block diagonal matrix with $$2\times 2$$ blocks. Further, note that the integrals in the definition of $$B_{R}(0)$$ consist of products of trigonometric functions with polynomials, which can be computed analytically [15].

### Algebraic energy balance and torque computation

On the algebraic level, the energy is given by $$E=\frac{1}{2} \Vert a_{S} \Vert ^{2}_{K_{S}} + \frac{1}{2} \Vert a_{R} \Vert _{K_{R}}^{2} - j_{M}^{\top }a_{R}$$ where $$\Vert x \Vert _{M}^{2} = x^{\top }M x$$ is the square of the norm associated with a symmetric positive semi-definite matrix M. Then

\begin{aligned} \frac{d}{d\alpha } E &= \bigl(K_{S} a_{S}, a_{S}' \bigr) + \bigl(K_{R} a_{R}, a_{R}' \bigr) - \bigl(j_{M},a_{R}' \bigr) \\ &= - \bigl(B_{S}^{\top }\lambda , a_{S}' \bigr) + \bigl(j_{e}, a_{S}' \bigr) + \bigl(B_{R}^{\top }\lambda , a_{R}' \bigr) \\ &= \bigl(j_{e}, a_{S}' \bigr) - \bigl(B_{S} a_{S}' - B_{R} a_{R}', \lambda \bigr) = \bigl(j_{e}, a_{S}' \bigr) - \bigl(B_{R}' a_{R}, \lambda \bigr). \end{aligned}

Hence the discrete torque can be simply computed by the algebraic formula

\begin{aligned} T_{h,N}(\alpha ) = \lambda ^{\top }(\alpha ) B_{R}'(\alpha ) a_{R}( \alpha ) = \biggl\langle \lambda _{h}, \frac{d}{d\theta }a_{h,R}\circ \rho _{- \alpha } \biggr\rangle . \end{aligned}

Note that $$B_{R}'(\alpha )$$ can be expressed as $$B_{R}'(\alpha )=R'(\alpha )B_{R}(0)$$ by using (27). Moreover, the matrix $$R'(\alpha )$$ is block diagonal with $$2 \times 2$$ blocks whose entries can be computed analytically; see above.

### Derivatives with respect to α and proof of Lemma 3

By formal differentiation of the above equations, we can see that

\begin{aligned}& K_{S} a'_{S}(\alpha ) - B_{S}^{\top }\lambda '( \alpha ) = 0, \end{aligned}
(28)
\begin{aligned}& K_{R} a'_{R}(\alpha ) - B_{R}(\alpha )^{\top }\lambda '(\alpha ) = B_{R}'( \alpha )^{\top }\lambda (\alpha ), \end{aligned}
(29)
\begin{aligned}& B_{S} a'_{S}(\alpha ) - B_{R}(\alpha ) a'_{R}(\alpha ) = B_{R}'( \alpha ) a_{R}(\alpha ). \end{aligned}
(30)

Together with (28)–(30), one can see that the solution of (24)–(26) is differentiable with respect to the angle α. By recursion, we may further conclude that the torque $$T_{h,N}$$ of the harmonic mortar method is a smooth function of the angle α. The same argument provides a proof of Lemma 3.

## 5 Numerical results

In the following, we demonstrate the application of the harmonic mortar finite element and isogeometric analysis method for computing the torque in a six-pole permanent magnet synchronous machine shown in Fig. 2. The geometry consists of a rotor with three pole pairs with embedded permanent magnets and a stator with 36 slots filled with copper windings. The length of the actual machine is $$L=0.1\text{ m}$$, so the energy and torque have to be scaled by L as outlined above. Some information about the geometry and material parameters is summarized in Table 1; for details see [2, Chapter V.A].

### Simulation setup

In our numerical tests, we compute the cogging torque via formula (22) in the absence of excitation currents $$j_{e}=0$$. For the discretization of the magnetostatic problems in the stator and rotor domains, we used open source package GeoPDEs [17]. The computations are carried out with B-splines of degree $$p=1$$ and $$p=2$$ with maximal continuity as basis functions for the solution; this corresponds to a standard finite element method (FEM) and a multipatch spline discretization with patchwise $$C^{1}$$-continuous splines of second order (IGA). To accommodate for material discontinuities, only $$C^{0}$$-continuity is enforced across patch borders; see [3] for details. At the external boundaries of the stator and rotor, the magnetic vector potential a is set to zero. For the computations of different degree p the mesh refinement has been adapted such that the number of degrees of freedom is comparable for $$p=1$$ and $$p=2$$. The number of degrees of freedom for $$p=1$$ is $$N_{\mathrm{dof},R}=26{,}532$$ in the rotor domain and $$N_{\mathrm{dof},S}=39{,}528$$ in the stator domain. For $$p=2$$ the number of degrees of freedom is $$N_{\mathrm{dof},R}=25{,}140$$ in the rotor domain and $$N_{\mathrm{dof},S}=37{,}764$$ in the stator domain. The reference solution is computed on a refined mesh with $$p=2$$ leading to $$N_{\mathrm{dof},R}=93{,}360$$ and $$N_{\mathrm{dof},S}=128{,}664$$ degrees of freedom in the rotor and stator domain, and with trigonometric degree $$N=200$$. The saddlepoint problems (24)–(26) are solved efficiently by a Schur complement method; details are given in the Appendix. An independent reference torque was computed with JMAG® using a finite element discretization of order $$p=1$$ with 1,084,517 elements.

### Symmetry of the solution

A snapshot of the magnetic vector potential and its isolines, which correspond to the magnetic flux lines, is depicted in Fig. 2. Note that by symmetry of the rotor and stator geometry, the solution components $$(a_{S},a_{R},\lambda )$$ have a 60 anti-symmetry. In particular, for the Fourier expansion of the computed Lagrange multiplier

\begin{aligned} \lambda _{N}(\theta ) = \frac{c_{0}}{2} + \sum_{n=1}^{N} c_{n} \cos (n \theta ) + d_{n} \sin (n \theta ), \end{aligned}
(31)

only the coefficients $$c_{n}$$, $$d_{n}$$ with index $$n\in \mathcal{N}=\{3,9,15,\ldots\}$$ are non-zero. By careful construction of the meshes, the geometric symmetries are preserved on the discrete level and the same behavior is observed for the numerical solution, as can be seen from Table 2. In practice, the computational cost can be reduced substantially by solving the problem only for one pole of the machine and using anti-periodic boundary conditions; see [3] for details. In the present case the number of degrees of freedom can be reduced by a factor of six. Using this prior knowledge, most of the Lagrange multipliers can be eliminated already during assembling leading to more efficient computations, in particular in connection with the Schur complement technique outlined in the Appendix.

### Torque computation

In Fig. 3, we display the torque computed via formula (14) with FEM ($$p=1$$) and IGA ($$p=2$$) for different orders N of harmonic basis functions. By the 10 symmetry of the stator slots and the corresponding symmetry of the mesh, the computed torque can be shown to exhibit a periodic behavior with a period length of 10. Moreover, the torque can be seen to be anti-symmetric with respect to half of the period. We further observe that the torque converges towards that of the reference solution when increasing the number N of harmonic basis functions. As indicated in Remark 2, the computation becomes unstable when the dimension of the Lagrange multiplier space $$M_{N}$$ exceeds the number of degrees of freedom of $$V_{h,S}$$ and $$V_{h,R}$$ associated to the interface Γ.

Due to periodicity, the torque $$T_{h,N}$$ can be approximated by a Fourier series

\begin{aligned} T_{h,N}^{M}(\alpha ) = \frac{\hat{c}_{0}}{2} + \sum_{m=1}^{M} \hat{c}_{m} \cos (m \alpha ) + \hat{d}_{m} \sin (m \alpha ) \end{aligned}
(32)

with coefficients $$\hat{c}_{m}, \hat{d}_{m} \in \mathbb {R}$$. By the symmetry properties discussed above, one can see that only $$\hat{d}_{m}$$ for $$m\in \mathcal{M}=\{36,72,108,\ldots\}$$ is non-zero, while $$\hat{d}_{m}=0$$ of all $$m \notin \mathcal{M}$$ and $$\hat{c}_{m}=0$$ for all m. The corresponding results of our computations are shown in Table 3.

## 6 Discussion

We have discussed the harmonic mortar method using trigonometric polynomials as Lagrange multipliers for the efficient treatment of rotation in electric machine computation. The energy balance has been used to derive an explicit formulation for the computation of the torque in the continuous and discretized settings. It has been shown that the electro-magneto-mechanic energy balance holds exactly also on the discrete level. Furthermore, if the functions in the Lagrange multiplier space are smooth then this is inherited by the torque. The derived formulation has been applied to a typical permanent magnet synchronous machine model using isogeometric analysis and a lowest order finite element method with an exact geometry mapping. The cogging torque has been computed with the proposed method and the influence of the number of Lagrange multiplier basis functions on the solution has been investigated.

## Availability of data and materials

The software framework used for the numerical test is available at http://rafavzqz.github.io/geopdes/ [17]. The CAD description of the permanent magnet synchronous machine geometry is available as an IGES file [14].

## Abbreviations

Computer Aided Design

FEM:

Finite Element Method

IGA:

Isogeometric Analysis

## References

1. Alotto P, Bertoni A, Perugia I, Schözau D. Discontinuous finite element methods for the simulation of rotating electrical machines. Compel. 2001;20:448–62.

2. Bontinck Z. Simulation and robust optimization for electric devices with uncertainties. Dissertation, Technische Universität Darmstadt, 2018. https://tuprints.ulb.tu-darmstadt.de/id/eprint/8330.

3. Bontinck Z, Corno J, Schöps S, De Gersem H. Isogeometric analysis and harmonic stator-rotor coupling for simulating electric machines. Comput Methods Appl Mech Eng. 2018;334:40–55.

4. Bossavit A. Forces in magnetostatics and their computation. J Appl Phys. 1990;67:5812–4.

5. Braess D. Finite elements. 3rd ed. New York: Cambridge University Press; 2007.

6. Brezzi F. On the existence, uniqueness and approximation of saddle-point problems arising from Lagrangian multipliers. RAIRO Anal Numér. 1974;8:129–51.

7. Buffa A, Maday Y, Rapetti F. A sliding mesh-mortar method for a two dimensional currents model of electric engines. ESAIM: Math Model Numer Anal. 2001;35:191–228.

8. Cottrell JA, Hughes TJR, Bazilevs Y. Isogeometric analysis: toward integration of CAD and FEA. New York: Wiley; 2009.

9. Coulomb JL. A methodology for the determination of global electromechanical quantities from a finite element analysis and its application to the evaluation of magnetic forces, torques and stiffness. IEEE Trans Magn. 1983;16:2514–9.

10. De Gersem H, Weiland T. Harmonic weighting functions at the sliding interface of a finite-element machine model incorporating angular displacement. IEEE Trans Magn. 2004;40:545–8.

11. Egger H, Harutyunyan M, Merkel M, Schöps S. On the stability of harmonic mortar methods with application to electric machines. In: Schilders W, van Beurden M, Budko N, editors. Scientific computing in electrical engineering SCEE 2020. Mathematics in industry. Berlin: Springer; 2021.

12. Henrotte F, Hameyer K. Computation of electromagnetic force densities: Maxwell stress tensor vs. virtual work principle. J Comput Appl Math. 2004;168:235–43.

13. Lange E, Henrotte F, Hameyer K. A variational formulation for nonconforming sliding interfaces in finite element analysis of electric machines. IEEE Trans Magn. 2010;46:2755–8.

14. Merkel M, Gangl P, Schöps S. Results of the shape optimization of rotating electric machines using isogeometric analysis. 2020. https://doi.org/10.5281/zenodo.3688478.

15. Neuman E. Moments and Fourier transforms of b-splines. J Comput Appl Math. 1981;7(1):51–62.

16. Tsukerman I. Accurate computation of ‘ripple solutions’ on moving finite element meshes. IEEE Trans Magn. 1995;31:1472–5.

17. Vázquez R. A new design for the implementation of isogeometric analysis in Octave and Matlab: GeoPDEs 3.0. Comput Math Appl. 2016;72:523–54.

## Acknowledgements

We thank the JSOL Corporation for the fruitful discussions, partnership and JMAG license.

## Funding

This work is supported by the Graduate School CE within the Centre for Computational Engineering at Technische Universität Darmstadt, by the German Research Foundation via the project SCHO 1562/6-1, and by the Defense Advanced Research Projects Agency (DARPA), under contract HR0011-17-2-0028. The views, opinions and/or findings expressed are those of the author and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. Open Access funding enabled and organized by Projekt DEAL.

## Author information

Authors

### Contributions

The initial manuscript was drafted by HE and RL and extended and edited by MH, MM and SSc. The simulations were conducted by MM. All authors read and approved the final manuscript.

### Corresponding author

Correspondence to Melina Merkel.

## Ethics declarations

### Competing interests

The authors declare that they have no competing interests.

## Appendix

### Appendix

If the machine model uses only a small number of interface modes N then local condensing is very effective. Let as assume that the matrices $$K_{S}$$ and $$K_{R}$$ are non-singular, e.g. due to Dirichlet boundaries of the stator and rotor domains, then the system (24)–(26) can be rewritten as

\begin{aligned}& a_{S}(\alpha ) +K_{S}^{-1}B_{S}^{\top } \lambda ( \alpha ) = K_{S}^{-1}{J_{e}}, \end{aligned}
(33)
\begin{aligned}& a_{R}(\alpha ) -K_{R}^{-1}B_{R}(0)^{\top }R( \alpha )^{\top }\lambda ( \alpha ) = K_{R}^{-1}{J_{M}}, \end{aligned}
(34)
\begin{aligned}& B_{S} a_{S}(\alpha ) - R(\alpha )B_{R}(0) a_{R}(\alpha )= 0. \end{aligned}
(35)

The internal degrees of freedom are straightforwardly eliminated using the Schur-complement. This gives rise to the low-dimensional interface problem

\begin{aligned} {K}_{\mathrm{int}}(\alpha ) {\lambda } &= {f}_{\mathrm{int}}(\alpha ) \end{aligned}
(36)

with

\begin{aligned}& {K}_{\mathrm{int}}(\alpha )=B_{S}K_{S}^{-1}B_{S}^{\top }+R( \alpha )B_{R}(0)K_{R}^{-1}B_{R}(0)^{\top }R( \alpha )^{\top }, \end{aligned}
(37)
\begin{aligned}& {f}_{\mathrm{int}}(\alpha )=B_{S}K_{S}^{-1}{J_{e}}-R( \alpha )B_{R}(0)K_{R}^{-1}{J_{M}}. \end{aligned}
(38)

The inverses in (37) and (38) are not needed explicitly. Instead, one factorization and a few forward/backward substitutions (for each spectral basis at the interface) can be used to precompute the necessary expressions. Thus, only the small system (36) has to be solved in the online phase for different rotation angles.

The internal degrees of freedom can be cheaply reconstructed, i.e.,

\begin{aligned}& a_{S}(\alpha )=K_{S}^{-1}j_{e}-K_{S}^{-1}B_{S}^{\top } \lambda (\alpha ), \end{aligned}
(39)
\begin{aligned}& a_{R}(\alpha )=K_{R}^{-1}j_{M}+K_{R}^{-1}B_{R}(0)^{\top }R( \alpha )^{\top }\lambda (\alpha ). \end{aligned}
(40)

This is computationally convenient when dealing with rotation since only the low-dimensional matrix $${R}(\alpha )$$ depends on α. This leads to a significant reduction in, e.g., when considering the computation of a rotating electric machine.

## Rights and permissions

Reprints and permissions

Egger, H., Harutyunyan, M., Löscher, R. et al. On torque computation in electric machine simulation by harmonic mortar methods. J.Math.Industry 12, 6 (2022). https://doi.org/10.1186/s13362-022-00121-2