# A Novel Meshing Method Based on Adaptive Size Function and Moving Mesh for Electromagnetic Finite Element Analysis

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Mesh Generation Theory

^{2}+ y

^{2}= 1 on the two-dimensional plane, as shown in Figure 1. The zero-level function of ϕ(x, y) = x

^{2}+ y

^{2}− 1 is ϕ(x, y) = 0, that is, ∂Ω = {(x, y)|ϕ(x, y) = 0}, which is exactly the same. In this case, the inner area is Ω

^{−}= {(x, y)|x

^{2}+ y

^{2}< 1}, the boundary of the area is Ω

^{e}= {(x, y)|x

^{2}+ y

^{2}< 1}, and the outer area is Ω

^{+}= {(x, y)|x

^{2}+ y

^{2}> 1}. These areas are shown below:

_{0}, Equation (2) can be a fixed solution of the ordinary differential equation (ODE) (non-physical) system.

_{k}= kΔt is set, the approximate solution p

_{k}≈ p(t

_{k}) will be updated as follows:

_{ij}= [p

_{i}, p

_{j}] variable spring constant f(p

_{i}, p

_{j}), which depends on the current length of the mesh element edge ||l

_{i}

_{j}|| and the desired ideal length e

_{ij}. By adopting the concept of normalized length and defining s

_{ij}= ||l

_{ij}||/e

_{ij}, the force balance function f can be expressed as:

## 3. The Proposed Meshing Method for Finite Element Analysis

#### 3.1. Curvature and Approximate Medial Axis Based Mesh Size Function

#### 3.1.1. Curvature Based Mesh Size Function

_{c}(x). For the unstructured background mesh, the value of h(x) was specified on the boundary node, and the value of the remaining nodes was set to infinity. Later, these values can be uniformly propagated to other locations in the mesh domain through distance gradient constraints. It is recommended to use a closed form of curvature expression, which will improve the calculation accuracy and speed. The boundary curvature κ(x) is solved by a defined distance function. Compared with the method of using edge advance-Delanuany, this method is easier to use and avoids the problem of numerical inaccuracy that may be caused by the ordering of edges.

_{0}(x) is the initial mesh size function; and ∆x is the resolution of the background meshes. By adding ∆x to limit the size of the edge of the narrow band that may appear near the area in order to deal with the possible high curvature problem, this method will not affect the interior of the area as the coupling process with other mesh size functions can avoid the waste of computing resources.

#### 3.1.2. Medial Axis Set Based Mesh Size Function

_{m}(x) anywhere in the domain. The local feature size is measured based on the distance between neighboring boundaries. The local feature size of the boundary node p is approximately similar to the shortest distance between the node p and the intermediate axis. The middle axis is a special set of internal points, where the internal points in the set are at the same distance from at least two points on the boundary of the geometric domain. For the sake of saving time, this paper used the approximate medial axis set, that is, by finding the local extremum in ∇ϕ(x), it is equivalent to defining the position of the intermediate point ‘m’ as the position satisfying and $\Vert \nabla \varphi \Vert \le 0.9$ and ϕ(x) <0. It must be noted that ϕ(x) should be a piecewise smooth distance function, then the signed distance function ϕ(x) is differentiable, and each point that is differentiable should satisfy $\Vert \nabla \varphi \Vert =1$. For any node p that is satisfied, the distance to the intermediate axis will be defined as ϕ

_{m}(x) = ϕ(x, m). The local feature size function h

_{m}based on the approximate intermediate shaft is calculated as follows:

_{0}is the initial mesh size specified by the user, and k

_{t}is the scale factor of the middle axis. Generally, users use h

_{0}as the benchmark, preset the number of elements required by the local feature size, and then determine the k

_{t}value, and ϕ

_{m}is the absolute distance to the nearest medial point. The approximate medial axis is used to calculate the mesh size function, which adapts to the characteristics of the geometric domain and avoids computational complexity. There is no doubt that the mesh size function generated based on the intermediate axis is also applicable to geometric domains with similar branch pipe shapes. It is only necessary to find the set of points in the area that conform to the definition of the medial axis to generate a structured mesh with topological characteristics, which will facilitate analysis and comparison between different parts of the finite element domain.

_{m}(x) was the lowest 0.65 and the average mesh quality was 0.94. Using the local feature size function h

_{m}(x), the mesh quality was the lowest at 0.71, and the average mesh quality was 0.94. The local feature size function based on the approximate medial axis can ensure the average mesh quality of the mesh and meet the requirements of the accurate finite element solution.

#### 3.2. Distance Gradient Limiting Function

_{min}and h

_{max}, and h

_{0}(x) should be between them

_{ext}(x) is provided as user input.

_{g}(x), which can be satisfied by finding the steady-state solution of the so-called gradient limit equation [15],

_{min}in the triangle. Using the angle to solve g can maximize the calculation error caused by the mesh superposition or distortion. Compared with solving the steady-state solution of the gradient limit equation, this method is a simple and efficient strategy.

_{min}→60.0° and g = 0.3 corresponds to θ

_{min}= 45.0°. The specific functions are as follows:

_{i},x

_{j}∈ Ω, where x

_{j}can only be smoothed from adjacent points x

_{i}∈ Ω, and its premise is h(x

_{i}) < h(x

_{j}), which can be guaranteed by the distance function.

_{0}(x) and the signed distance function ϕ(x), which may be appropriate:

_{0}is the percentage change of the mesh size with the boundary.

_{0}= 0.1). Use Equation (6) to calculate the quality of mesh elements.

#### 3.3. Moving Meshing Algorithm

#### 3.3.1. Second Order Projection Algorithm

#### 3.3.2. Dynamic Technology

_{0}/max(r

_{0}), where r

_{0}= [h(p

_{x})]

^{−2}. If it is greater than, the point is deleted. In this way, the quality of boundary elements can be guaranteed to a large extent.

_{ij}= ||l

_{ij}||/e

_{ij}and ||l

_{ij}|| is the current mesh element length, and the desired length is e

_{ij}.

_{avg}is the average of the quality of the entire meshes, ϕ

_{i}is the distance function expression of moving boundary, and ϕ is the distance function expression of the fixed boundary.

_{0}were used for the novel moving meshing algorithm. Approximately solve Equation (3) with the pre-Euler method. p

_{i}

^{k}is set to the position of node i in the k time step, provided that the discrete time t

_{k}= kΔt is set. In order to get the steady state, the node position is updated iteratively by Equation (26).

_{ij}is the expected mesh edge length and e

_{ij}is the actual mesh edge length. N

_{i}is the neighborhood of node i.

## 4. Validation Analysis

#### 4.1. Verification of 2D Moving Mesh

_{0}= 0.6). Use Equation (6) to calculate the quality of the mesh elements.

#### 4.2. 3D Moving Mesh Verification

_{0}= 0.1). We used Equation (6) to calculate the quality of the mesh elements.

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Nguyen, H.N.; Canh, T.N.; Thanh, T.T. Finite element modelling of a composite shell with shear connectors. Symmetry
**2019**, 11, 527. [Google Scholar] [CrossRef] [Green Version] - Guo, W.; Nie, Y.; Zhang, W. Acceleration strategies based on bubble-type adaptive mesh refinement method. Math. Comput. Simul.
**2020**, 170, 143–163. [Google Scholar] [CrossRef] - Zhao, Y.; Xiao, X.; Xu, W. Accelerating the Optimal Shape Design of Linear Machines by Transient Simulation Using Mesh Deformation and Mesh Connection Techniques. IEEE Trans. Ind. Electron.
**2018**, 65, 9825–9833. [Google Scholar] [CrossRef] - Lo, S.H. A new mesh generation scheme for arbitrary planar domains. Int. J. Numer. Methods Eng.
**1985**, 21, 1403–1426. [Google Scholar] [CrossRef] - Peraire, J.; Vahdati, M.; Morgan, K.; Zienkiewicz, O.C. Adaptive remeshing for compressible flow computations. J. Comput. Phys.
**1987**, 72, 449–466. [Google Scholar] [CrossRef] - Shephard, M.S. Approaches to the automatic generation and control of finite element meshes. Appl. Mech. Rev.
**1988**, 1, 169–185. [Google Scholar] [CrossRef] [Green Version] - Thacker, W.C. A brief review of techniques for generating irregular computational grids. Int. J. Numer. Methods Eng.
**1980**, 15, 1335–1341. [Google Scholar] [CrossRef] - Bowyer, A. Computing Dirichlet tessellations. Comput. J.
**1981**, 24, 162–166. [Google Scholar] [CrossRef] [Green Version] - Zhang, W.; Nie, Y.; Cai, L.; Qi, N. An adaptive discretization of incompressible flow using node-based local meshes. Comput. Model. Eng. Sci.
**2014**, 102, 55–82. [Google Scholar] - Field, D.A. Laplacian smoothing and Delaunay triangulations. Commun. Appl. Numer. Methods
**1988**, 4, 709–712. [Google Scholar] [CrossRef] - Frey, W.H.; Field, D.A. Mesh relaxation: A new technique for improving triangulations. Int. J. Numer. Methods Eng.
**1991**, 31, 1121–1133. [Google Scholar] [CrossRef] - Engwirda, D. Locally-Optimal Delaunay-Refinement and Optimisation-Based Mesh Generation. Ph.D. Thesis, School of Mathematics and Statistics, The University of Sydney, Sydney, Australia, September 2014. [Google Scholar]
- Funken, S.A.; Schmidt, A. Adaptive Mesh Refinement in 2D—An Efficient Implementation in Matlab. Comput. Methods Appl. Math.
**2019**, 20, 459–479. [Google Scholar] [CrossRef] - Funken, S.A.; Schmidt, A. A Coarsening Algorithm on Adaptive Red-Green-Blue Refined Meshes. arXiv Prepr.
**2020**, arXiv:2001.06343. [Google Scholar] [CrossRef] - Persson, P.-O.; Strang, G. A Simple Mesh Generator in MATLAB. SIAM Rev.
**2004**, 46, 329–345. [Google Scholar] [CrossRef] [Green Version] - Roberts, K.J.; Pringle, W.J.; Westerink, J.J. On the automatic and a priori design of unstructured mesh resolution for coastal ocean circulation models. Ocean Model.
**2019**, 144, 101–509. [Google Scholar] [CrossRef] [Green Version] - Zhao, Y.; Zhang, X.; Ho, S.L.; Fu, W. An Adaptive Mesh Method in Transient Finite Element Analysis of Magnetic Field Using a Novel Error Estimator. IEEE Trans. Magn.
**2012**, 48, 4160–4163. [Google Scholar] [CrossRef] - Zhao, Y.; Ho, S.L.; Fu, W. A Novel Adaptive Mesh Finite Element Method for Nonlinear Magnetic Field Analysis. IEEE Trans. Magn.
**2013**, 49, 1777–1780. [Google Scholar] [CrossRef] - Zhao, J.; Li, S. Adaptive mesh refinement method for solving optimal control problems using interpolation error analysis and improved data compression. J. Frankl. Inst.
**2020**, 357, 1603–1627. [Google Scholar] [CrossRef] - Zhang, W.; Nie, Y.; Gu, Y. Adaptive finite element analysis of elliptic problems based on bubble-type local mesh generation. J. Comput. Appl. Math.
**2015**, 280, 42–58. [Google Scholar] [CrossRef] - Elliot, R.; Qiu, L.; Yu, Y.; Fedkiw, R. An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids. J. Comput. Phys.
**2013**, 254, 107–154. [Google Scholar] - Hagihara, S.; Motoda, S.; Tsunori, M.; Ikeda, T.; Miyazaki, N. Adaptive meshfree method based on adding and moving nodes. Int. J. Comput. Methods
**2006**, 3, 429–443. [Google Scholar] [CrossRef] - Fratini, L.; Macaluso, G.; Pasta, S. Residual stresses and FCP prediction in FSW through a continuous FE model. J. Mater. Process. Technol.
**2009**, 209, 5465–5474. [Google Scholar] [CrossRef] - Petrillo, A.; Picariello, A.; Santini, S.; Scarciello, B.; Sperli, G. Model-based vehicular prognostics framework using Big Data architecture. Comput. Ind.
**2020**, 115, 103–177. [Google Scholar] [CrossRef] - Galli, A.; Gravina, M.; Moscato, V.; Sperli, G. Deep Learning for HDD health assessment: An application based on LSTM. IEEE Trans. Comput.
**2020**, 1. [Google Scholar] [CrossRef] - Weeber, K.; Hoole, S.R.H. Geometric parametrization and constrained optimization techniques in the design of salient pole synchronous machines. IEEE Trans. Magn.
**1992**, 28, 1948–1959. [Google Scholar] [CrossRef] - Yamazaki, K.; Ishigami, H.; Abe, A. An adaptive finite element method for minor shape modification in optimization algorithms. IEEE Trans. Magn.
**2008**, 44, 1202–1205. [Google Scholar] [CrossRef] - Helenbrook, B.T. Mesh deformation using the biharmonic operator. Int. J. Numer. Methods Eng.
**2003**, 56, 1007–1021. [Google Scholar] [CrossRef] - Ho, S.L.; Zhao, Y.; Fu, W.N.; Zhang, X. A Novel Mesh Morphing Technique for Large Shape Deformation and Its Application to Optimal Design Problems. IEEE Trans.Magn.
**2013**, 49, 2165–2168. [Google Scholar] [CrossRef] - De Boer, A.; Van Der Schoot, M.; Bijl, H. Mesh deformation based on radial basis function interpolation. Comput. Struct.
**2007**, 85, 784–795. [Google Scholar] [CrossRef] - López, E.J.; Nigro, N.M.; Storti, M.A.; Toth, J.A. A minimal element distortion strategy for computational mesh dynamics. Int. J. Numer. Methods Eng.
**2007**, 69, 1898–1929. [Google Scholar] [CrossRef] [Green Version] - Ho, S.L.; Chen, N.N.; Fu, W.N. A moving mesh embedded algorithm in finite element method for optimal design of electromagnetic devices. IEEE Trans. Magn.
**2011**, 47, 2947–2950. [Google Scholar] [CrossRef] - Zhao, Y.; Niu, S.; Ho, S.L.; Fu, W.N.; Zhu, J. A Parameterized Mesh Generation and Refinement Method for Finite Element Parameter Sweeping Analysis of Electromagnetic Devices. IEEE Trans. Magn.
**2012**, 48, 239–242. [Google Scholar] [CrossRef] - Ho, S.L.; Zhao, Y.; Fu, W.N. An efficient parameterized mesh method for large shape variation in optimal designs of electromagnetic devices. IEEE Trans. Magn.
**2012**, 48, 4507–4510. [Google Scholar] [CrossRef] - Zhang, C.; Wang, W.; An, S.; Shentu, N. Two-dimensional finite element mesh generation algorithm for Electromagnetic Field Calculation. Chin. Phys. B
**2020**, 30, 010–101. [Google Scholar] [CrossRef] - Shewchuk, J. What is a Good Linear Finite Element? Interpolation, Conditioning, Anisotropy, and Quality Measures. Univ. Calif. Berkeley
**2002**, 73, 137–139. [Google Scholar] - M’zali, N.; Martin, F.; Sundaria, R.; Henneron, T.; Benabou, A.; Belahcen, A. Finite-Element Modeling of Magnetic Properties Degradation Due to Plastic Deformation. IEEE Trans. Magn.
**2020**, 56, 1–4. [Google Scholar] [CrossRef]

**Figure 2.**Validation of the mesh size function based on curvature. (

**a**) Mesh generation without h

_{c}(x); (

**b**) mesh generation with h

_{c}(x); (

**c**) mesh quality map without h

_{c}(x); and (

**d**) mesh quality map with h

_{c}(x).

**Figure 3.**Verification of the mesh size function based on h

_{m}(x). (

**a**) Signed distance function ϕ(x); (

**b**) the approximate medial axis of Sandia Fork; (

**c**) mesh quality map without h

_{m}(x); (

**d**) mesh quality map with h

_{m}(x); (

**e**) mesh quality map without h

_{m}(x); and (

**f**) mesh quality map with h

_{m}(x).

**Figure 4.**Validation of mesh size function based on distance gradient constraint. (

**a**) mesh generation without h

_{gd}(x); (

**b**) mesh generation with h

_{gd}(x); (

**c**) mesh quality map without h

_{gd}(x); (

**d**) mesh quality map with h

_{gd}(x).

**Figure 6.**Verification of the moving mesh algorithm. (

**a**) Mesh generation with a 45 mm shaft radius; (

**b**) mesh generation with a 35 mm shaft radius; (

**c**) mesh quality map with a 45 mm radius of the rotating shaft; (

**d**) mesh quality map of the shaft radius of 35 mm (moving meshing algorithm).

**Figure 7.**Electromagnetic analysis (

**a**) flux lined and flux density from time-harmonic analysis; (

**b**) time-stepping simulation continued from the time-harmonic solution.

**Figure 8.**Three dimensional verification of the moving meshing algorithm. (

**a**) Original 3-D mesh (radius 0.5); (

**b**) mesh generation by moving meshing algorithm (radius 0.7); (

**c**) the original 3-D mesh quality map; (

**d**) mesh quality map of radius 0.7 (moving meshing algorithm).

Iterations | Time(s) | Minimum Mesh Quality | Average Mesh Quality | |
---|---|---|---|---|

with h_{gd}(x) | 37 | 5.6s | 0.546 | 0.9356 |

without h_{gd}(x) | 61 | 8.3s | 0.0219 | 0.8713 |

Shaft Power | 37kW |
---|---|

Voltage | 400 V |

Frequency | 50 Hz |

Connection | Star |

Pole pairs | 2 |

outer diameter of stator | 310 mm |

inner diameter of stator | 200 mm |

Air gap | 0.8 mm |

Numbers of stator slots | 48 |

Numbers of rotor slots | 40 |

Algorithm | Iterations | Time(s) | q_{avg} | q_{min} |
---|---|---|---|---|

parametric mesh technology | 59 | 1.75 | 0.56 | 0.21 |

moving mesh algorithm | 46 | 1.41 | 0.92 | 0.54 |

without moving mesh algorithm | 126 | 20.29 | 0.93 | 0.57 |

Algorithm/Location | N1 | N2 | N3 | N4 |
---|---|---|---|---|

Commercial software | 0.717308 | 1.096067 | 0.937374 | 1.334008 |

Moving mesh algorithm is not used | 0.717302 | 1.096063 | 0.937371 | 1.334010 |

Using moving mesh algorithm | 0.717304 | 1.096062 | 0.937370 | 1.334011 |

Algorithm | Iterations | Time(s) | q_{avg} | q_{min} |
---|---|---|---|---|

Parametric mesh technology | 53 | 2.72 | 0.54 | 0.27 |

Moving mesh algorithm | 37 | 2.01 | 0.90 | 0.56 |

Without moving mesh algorithm | 76 | 7.84 | 0.94 | 0.51 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Zhang, C.; An, S.; Wang, W.; Lin, D.
A Novel Meshing Method Based on Adaptive Size Function and Moving Mesh for Electromagnetic Finite Element Analysis. *Symmetry* **2021**, *13*, 254.
https://doi.org/10.3390/sym13020254

**AMA Style**

Zhang C, An S, Wang W, Lin D.
A Novel Meshing Method Based on Adaptive Size Function and Moving Mesh for Electromagnetic Finite Element Analysis. *Symmetry*. 2021; 13(2):254.
https://doi.org/10.3390/sym13020254

**Chicago/Turabian Style**

Zhang, Chunfeng, Siguang An, Wei Wang, and Dehui Lin.
2021. "A Novel Meshing Method Based on Adaptive Size Function and Moving Mesh for Electromagnetic Finite Element Analysis" *Symmetry* 13, no. 2: 254.
https://doi.org/10.3390/sym13020254