Permanent magnet synchronous motor electromagnetic field finite element rapid simulation calculation method

By using an adaptive mesh generation method based on electromagnetic field spatial gradient information to dynamically adjust the mesh density, the problems of wasted computational resources and high cost in traditional methods are solved, and efficient and accurate simulation of electromagnetic fields of permanent magnet synchronous motors is achieved.

CN121659636APending Publication Date: 2026-03-13JIANGYONG YUANJIE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Traditional finite element simulation methods for electromagnetic fields of permanent magnet synchronous motors rely on human experience or indirect error estimation, making it difficult to accurately capture complex electromagnetic field distributions, resulting in wasted computational resources and high computational costs.

Method used

An adaptive mesh generation method based on electromagnetic field spatial gradient information is adopted to dynamically adjust the mesh density, identify regions with drastic electromagnetic field changes for mesh densification, and keep smooth regions sparse. The preset accuracy is achieved through iterative optimization.

Benefits of technology

It achieves precise capture of key areas, reduces waste of computing resources, improves simulation efficiency and accuracy, reduces computing costs, and enhances the automation level of the simulation process and the consistency of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121659636A_ABST
    Figure CN121659636A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of motor electromagnetic field simulation, and discloses a permanent magnet synchronous motor electromagnetic field finite element rapid simulation calculation method. The method comprises the steps that a three-dimensional model is constructed, material attributes are loaded, and an initial grid is generated; after the electromagnetic field equation is solved, space gradient information of field distribution is extracted so as to accurately identify a magnetic field violent change area and a smooth area; dynamically adjusting the grid density according to the identification result, encrypting the key area, and keeping the non-key area sparse; and recalculating and evaluating the error based on the optimized grid, and performing loop iteration until the result meets the preset tolerance. According to the method, the gradient information is used for directly driving grid self-adaption, accurate distribution of computing resources is achieved, the problem that the efficiency is low due to the fact that a traditional method depends on experience or mathematical residual errors is solved, and the simulation speed is increased while the computing precision is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electromagnetic field simulation technology for electric motors, specifically a rapid finite element simulation calculation method for the electromagnetic field of a permanent magnet synchronous motor. Background Technology

[0002] The design and performance optimization of permanent magnet synchronous motors heavily rely on finite element analysis of electromagnetic fields. Traditional simulation methods, after constructing a 3D model, typically rely on the engineer's experience to manually set the global or local mesh density, or employ adaptive meshing techniques based on posterior error estimation. Manual meshing methods are highly dependent on the operator's expertise and prior judgment, making it difficult to accurately capture the details of complex electromagnetic field distributions. This is especially true for regions with drastic magnetic field changes, such as air gaps and the edges of permanent magnets; an overly sparse mesh leads to insufficient computational accuracy, while an overly dense mesh introduces unnecessary computational overhead.

[0003] While existing automatic adaptive meshing techniques can reduce reliance on human experience, they largely depend on indirect error estimates, such as mathematical residuals obtained after solving the governing equations, to determine mesh refinement regions. These indirect indicators have a weak intuitive correlation with changes in the physical field, potentially leading to insufficient sensitivity or lag in identifying key physical regions. Computational resources are often uniformly or suboptimally distributed across the solution domain; smooth regions may be over-refined, while the mesh in critical regions may not be sufficiently precise. This necessitates multiple iterations before reaching the desired accuracy, resulting in high computational costs. Finite element analysis requires a simulation method that can directly and rapidly respond to the changing characteristics of the physical field itself and intelligently allocate computational resources. Summary of the Invention

[0004] The purpose of this invention is to provide a rapid finite element simulation calculation method for the electromagnetic field of a permanent magnet synchronous motor, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, this invention provides a rapid finite element simulation calculation method for the electromagnetic field of a permanent magnet synchronous motor, the method comprising: A three-dimensional geometric model was constructed based on the design specifications of the permanent magnet synchronous motor, and material property data was loaded into the finite element analysis platform. In the finite element analysis platform, an automatic mesh generation algorithm is used to create an initial computational mesh based on the geometric model, and the solution conditions for the electromagnetic field control equations are set. The initial electromagnetic field distribution is obtained by solving the electromagnetic field control equations, and the spatial gradient information of the electromagnetic field distribution is extracted. The spatial gradient information is used to identify regions with drastic electromagnetic field changes and regions with smooth electromagnetic fields, and region labeling data is generated. The density distribution of the computational grid is dynamically adjusted based on the region marking data. In regions with drastic changes, the grid is refined, while in smooth regions, the grid remains sparse. The electromagnetic field distribution is recalculated based on the adjusted grid, and the computational error is evaluated. When the calculation error does not meet the preset tolerance, repeat the mesh adjustment and recalculation steps until the error meets the requirements, and output the final electromagnetic field distribution result as simulation data.

[0006] Preferably, the construction of a three-dimensional geometric model based on the design specifications of the permanent magnet synchronous motor and the loading of material property data into the finite element analysis platform includes: Geometric dimensions and material parameters are extracted from the motor design database, and parametric geometric models are generated using 3D modeling software; Import the parametric geometric model into the finite element analysis platform and assign material property data to the corresponding geometric components; Verify the integrity and consistency of the geometric model, and start mesh generation after ensuring that the model data is correct.

[0007] Preferably, the step of creating an initial computational mesh based on the geometric model using an automatic mesh generation algorithm includes: Analyze the topological structure of the geometric model to determine key feature edges and faces; An initial computational mesh is generated based on key features using the frontier advancement method, and mesh size control parameters are set. Check the quality metrics of the initial computational mesh, such as cell shape and connectivity, and optimize low-quality mesh regions.

[0008] Preferably, the step of obtaining the initial electromagnetic field distribution by solving the electromagnetic field control equations and extracting the spatial gradient information of the electromagnetic field distribution includes: Discretize the electromagnetic field control equations to form a linear algebraic system; The initial electromagnetic field distribution is obtained by solving the linear algebraic system using the preconditional conjugate gradient method. Calculate the gradient vector of each node in the initial electromagnetic field distribution and summarize it into a spatial gradient information dataset.

[0009] Preferably, the step of using the spatial gradient information to identify regions with drastic electromagnetic field changes and smooth regions includes: Set a gradient threshold and compare the spatial gradient information with the gradient threshold; Cells with gradient values ​​exceeding a threshold are marked as regions of rapid change, while cells with gradient values ​​below the threshold are marked as regions of smooth change. Output region labeling data, including region boundaries and a list of cells.

[0010] Preferably, the step of dynamically adjusting the density distribution of the computational grid based on the region marker data includes: Analyze the region labeling data to determine the geometric extent of areas of drastic change; Apply local mesh densification algorithms to areas of rapid change to increase mesh node density; Maintain the original mesh density in smooth areas and perform only local smoothing. Generate new mesh data and update the finite element model.

[0011] Preferably, the recalculation of the electromagnetic field distribution based on the adjusted grid and the evaluation of the calculation error include: The electromagnetic field control equations are discretized again on the new grid to obtain the updated linear system. The electromagnetic field distribution is calculated using an iterative solver, and the residual norm is monitored. The computational error value is calculated based on the residual norm and the difference between the previous and subsequent iteration steps.

[0012] Preferably, the step of repeating mesh adjustment and recalculation when the calculation error does not meet the preset tolerance includes: Compare the calculated error value with the preset tolerance. If the calculated error is greater than the preset tolerance, then re-extract the spatial gradient information based on the latest electromagnetic field distribution and proceed to the region identification step. The process is repeated until the calculation error is less than or equal to the preset tolerance.

[0013] Preferably, the calculation of the gradient vectors of each node in the initial electromagnetic field distribution and the summarization into a spatial gradient information dataset specifically includes: Based on the shape function theory of the finite element method, the gradient of the electromagnetic field quantity inside each element is calculated; The node averaging method is used to smoothly transfer the cell gradient data to the grid nodes, thus obtaining the gradient vector of each node; The magnitude values ​​of the gradient vectors of all nodes are stored as a spatial gradient information dataset for subsequent region identification.

[0014] Preferably, the application of a local mesh densification algorithm to increase the mesh node density in areas of drastic change specifically includes: Analyze the region labeling data to identify all grid cells belonging to areas of drastic change; Each unit to be encrypted is recursively divided into two or four parts to generate finer sub-units. Establish topological connections between newly generated sub-cells to ensure a smooth transition between the encrypted region and the surrounding sparse mesh region; Verify the geometric correctness and quality of the newly generated mesh, and complete the local mesh refinement.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This study uses the spatial gradient information of the electromagnetic field distribution as a direct indicator to drive mesh adaptation, replacing the traditional indirect error estimation method based on mathematical residuals. The spatial gradient is an intuitive measure of the rate of change of the physical field, capable of instantly and accurately pinpointing physical boundaries where magnetic field strength or flux density changes drastically. This identification method, based on the intrinsic properties of the physical field, avoids the computational overhead and judgment delays caused by error estimation through complex mathematical derivations. This makes the capture of key regions more sensitive and direct, providing a higher confidence level for mesh adjustment decisions in each adaptive cycle.

[0016] Based on the region-labeled data generated from spatial gradient information, a non-uniform mesh density distribution strategy is dynamically implemented. Selective mesh refinement is performed in regions with drastic gradient changes, while the original sparse mesh is explicitly maintained in smooth regions with low gradients. This strategy achieves optimal allocation of computational resources within the solution domain, precisely targeting limited mesh nodes and computing power to the regions with the greatest impact on overall computational accuracy. This targeted resource allocation avoids the computational scale expansion caused by unnecessary mesh refinement in regions with gentle magnetic fields, reducing the degrees of freedom required for a single finite element solution, thereby improving the efficiency of single-field calculations while ensuring computational accuracy in critical regions.

[0017] Gradient-based region identification and non-uniform mesh adjustment are integrated into an automated closed-loop process, with the termination condition based on whether the computational error meets a preset tolerance. This achieves automatic feedback and execution of the mesh optimization strategy from field analysis results, requiring no manual intervention. Each iteration makes the mesh distribution more closely match the actual characteristics of the current physical field, enabling the entire simulation process to converge to the target accuracy quickly with the fewest iterations. This intelligent self-optimization mechanism reduces reliance on operator experience, improves the automation level and reliability of the simulation process, and ensures the consistency and repeatability of the results. Attached Figure Description

[0018] Figure 1 This is a schematic diagram illustrating the working principle of the finite element rapid simulation calculation method for the electromagnetic field of a permanent magnet synchronous motor as described in this invention. Figure 2 A flowchart for constructing a 3D geometric model and loading material properties; Figure 3 A flowchart for solving the electromagnetic field control equations and extracting gradient information; Figure 4 A bar chart comparing the number of units in different regions; Figure 5 This is a graph showing the changes in multiple indicators during the adaptive iterative process. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1 This invention provides a rapid finite element method for simulating the electromagnetic field of a permanent magnet synchronous motor (PMSM). The method includes: firstly, constructing a three-dimensional geometric model based on the design specifications of the PMSM and loading material property data into a finite element analysis platform; secondly, creating an initial computational mesh based on the geometric model using an automatic mesh generation algorithm within the platform, while simultaneously setting the solution conditions for the electromagnetic field control equations; thirdly, obtaining the initial electromagnetic field distribution by solving the electromagnetic field control equations and extracting spatial gradient information from it; fourthly, using this spatial gradient information to identify regions with drastic electromagnetic field changes and smooth regions, generating corresponding region marker data; fifthly, dynamically adjusting the density distribution of the computational mesh based on the region marker data, refining the mesh in regions with drastic changes and maintaining a sparse mesh in smooth regions; sixthly, recalculating the electromagnetic field distribution based on the adjusted mesh and evaluating the calculation error; seventhly, repeating the mesh adjustment and recalculation steps if the calculation error does not meet the preset tolerance until the error meets the requirements, and finally outputting the electromagnetic field distribution result as simulation data. This method significantly improves computational efficiency and accuracy through adaptive mesh optimization.

[0021] Example 1: See Figure 2In practical implementation, the geometric dimensions and material parameters of the permanent magnet synchronous motor are systematically extracted from the motor design database. The geometric dimensions include a series of precise values ​​such as stator outer diameter, core length, air gap width, and the specific shape and installation position of the permanent magnet. The material parameters cover key attributes such as the BH curve of the silicon steel sheet, the remanence and coercivity of the permanent magnet, and the conductivity of the winding. The process of generating a parametric geometric model using 3D modeling software involves setting the extracted dimensional parameters as driving variables in the model. Through the software's built-in parametric design function, 3D solid models of components such as the stator, rotor, permanent magnet, shaft, and housing are constructed. The Boolean operation relationships and assembly constraints between the components are also defined simultaneously, thus forming a fully parametric 3D geometric model of the permanent magnet synchronous motor that can be modified in conjunction with design variables. When importing parametric geometric models into the finite element analysis platform, standard data exchange formats such as STEP or IGES are used for model transfer. Within the finite element analysis platform, material property data is assigned to each imported geometric component. Specifically, this involves creating or calling corresponding material models from the platform's material library, accurately assigning material parameters such as the magnetic properties of silicon steel sheets, the hard magnetic properties of permanent magnets, and the conductive properties of copper windings to the corresponding components in the geometric model. Verifying the integrity and consistency of the geometric model is a crucial step. The geometric inspection tool of the finite element analysis platform is used to scan the model for topological errors such as missing patches, boundary gaps, and overlapping entities. Simultaneously, the assignment of material properties is verified to be completely consistent with the design specifications. After confirming that the model data is correct, the mesh generation module is officially started.

[0022] In the specific implementation, an automatic mesh generation algorithm is used to create an initial computational mesh based on the geometric model. First, the topological structure of the geometric model is analyzed to determine key feature edges and surfaces. Key feature edges include geometric boundaries where field quantities may change abruptly, such as the edge contour of the permanent magnet, the stator slot opening boundary, and the air gap annular interface. Key feature surfaces include regions such as the permanent magnet surface and the stator tooth end face. Based on the identified key features, the advancing front method is applied to generate the initial computational mesh. The advancing front method starts with triangular meshes on the model boundary surface and uses these triangles as the leading edge to advance into the model volume, generating tetrahedral elements until the entire three-dimensional geometric domain is filled with mesh. During this process, mesh size control parameters are set to constrain the global and local mesh density. Global parameters, such as the maximum element volume, limit the overall mesh size, while local parameters, such as setting smaller element sizes in the air gap region, capture potential field quantity gradients at that location.

[0023] Checking the quality metrics of the initial computational mesh is an essential step after mesh generation. Mesh quality is quantified by calculating metrics such as element shape ratio, aspect ratio, and Jacobian matrix determinant for each mesh element. The element shape ratio measures how closely the element approximates an ideal tetrahedron, the aspect ratio assesses the degree of anisotropy, and the Jacobian matrix determinant reflects whether distortion exists during the mapping process. After identifying low-quality mesh regions, an optimization program is initiated. Twisted elements with excessively low element shape ratios undergo node position smoothing, elongated elements with abnormal aspect ratios are locally re-partitioned, and invalid elements with negative Jacobian determinant values ​​are deleted and rebuilt. After a series of optimization operations, a high-quality initial computational mesh suitable for electromagnetic field finite element calculations is obtained.

[0024] In some embodiments, the construction of the parametric geometric model can be further refined. In the 3D modeling software, not only are the dimensional parameters of the components defined, but also the parametric relationships between the components are established. For example, the interference fit dimensions between the rotor inner diameter and the shaft, and the angular relationship between the number of stator slots and the pole slot fit. This in-depth parametric approach ensures that the geometric model maintains correct geometric relationships and assembly constraints during subsequent design changes. In some embodiments, the loading process of material property data includes a more detailed constitutive model definition. For silicon steel sheets, instead of simply specifying a constant permeability, complete BH curve data points are input to simulate nonlinear magnetization characteristics. For permanent magnet materials, their demagnetization curve model is defined to accurately reflect their magnetic properties at the operating point.

[0025] Optionally, during the geometric model integrity verification stage, the real-time correlation update function between the finite element analysis platform and the original 3D modeling software can be enabled. When minor flaws are found in the geometric model in the finite element analysis platform, they can be directly fed back to the 3D modeling software for correction through the correlation update function. The correction results are automatically synchronized to the finite element analysis platform, avoiding errors that may be introduced by repeated model import and export. Optionally, when generating meshes using the leading edge propagation method, curvature adaptation and proximity adaptation functions can be combined. The curvature adaptation function automatically refines the generated mesh in areas with large geometric curvature to better fit the surface, while the proximity adaptation function automatically identifies and refines the areas between closely spaced geometric surfaces. This is particularly beneficial for accurately discretizing the narrow air gap region in permanent magnet synchronous motors.

[0026] It is understandable that the process of extracting data from the motor design database can be automated using a script interface. This interface directly reads the design tables or parametric files from the database and drives the background parameter updates of the 3D modeling software, thereby achieving a seamless conversion from design data to a geometric model. Similarly, it is understandable that the quality optimization of the initial computational mesh is an iterative process, which may require multiple runs of quality checks and optimization algorithms until the quality indicators of all mesh elements reach or exceed the computational tolerance threshold set by the finite element analysis platform.

[0027] Example 2: See Figure 3 The process of obtaining the initial electromagnetic field distribution and extracting spatial gradient information by solving the electromagnetic field control equations is, in practice, primarily a process of discretizing the electromagnetic field control equations to form a linear algebraic system. The electromagnetic field control equations are typically derived from Maxwell's equations. The partial differential equations are discretized using the finite element method. By selecting appropriate shape functions, such as linear Lagrange shape functions or higher-order shape functions, and applying the Galerkin weighted residual method or least squares method to each grid cell, the continuous equations are transformed into discrete algebraic equations. Finally, these are assembled into a global linear system, which can be represented in matrix equation form.

[0028] Where: symbol Represents the global coefficient matrix, assembled from element stiffness matrices, reflecting mesh geometry and material properties; symbol Represents an unknown vector, containing electromagnetic field quantities such as magnetic vector potential or electric field scalar potential at all nodes; symbol The right-hand vector is composed of source terms such as current density or the equivalent current contribution of a permanent magnet. Careful handling of boundary conditions is necessary during discretization. For example, Dirichlet boundary conditions are directly introduced through fixed node values, while Neumann boundary conditions are incorporated into the right-hand vector through surface integral terms to ensure the integrity of the physical model.

[0029] The preconditioned conjugate gradient method is employed to solve linear algebraic systems and obtain the initial electromagnetic field distribution. This method is an iterative solver suitable for large sparse symmetric positive definite systems. Its implementation includes initializing the guessed solution vector, calculating the initial residuals, selecting a preconditioner such as an incomplete Cholesky decomposition or a Jacobi diagonal preconditioner, and then entering an iterative loop. In each step, the matrix-vector product is calculated, the solution vector and residuals are updated, and a convergence criterion is checked. The convergence criterion is typically based on the relative error of the residual norm; for example, iteration terminates when the residual norm 2 is less than a set tolerance value, such as 1e-6. The output is stable initial electromagnetic field distribution data, including magnetic flux density, magnetic field strength, and other field quantities at each node. During the solution process, the iteration history is monitored to avoid oscillations or divergences, and the preconditioner parameters are adjusted as necessary to accelerate convergence.

[0030] The gradient vectors of each node in the initial electromagnetic field distribution are calculated based on the shape function theory of the finite element method. For each mesh element, the electromagnetic field quantity, such as magnetic flux density B, is a continuous function within the element, expressed by shape function interpolation from the node values. Gradient calculation utilizes the derivative information of the shape function. For example, for a tetrahedral element, the partial derivative of the shape function with respect to the local coordinates can be transformed to the global coordinate system using the Jacobian matrix, thereby calculating the gradient vector of the electromagnetic field quantity within the element. A node averaging method is used to smoothly transfer the element gradient data to the mesh nodes. The node averaging method traverses each node, collecting the gradient contributions of all elements sharing that node, and performs a weighted average based on element volume or mass to eliminate gradient discontinuities between elements, resulting in smooth gradient vector values ​​at each node. The gradient vector contains information on three spatial components. The magnitudes of the gradient vectors of all nodes are stored as a spatial gradient information dataset. The magnitude of the gradient vector is calculated as the square root of the sum of the squares of each component, representing the magnitude of the electromagnetic field quantity's spatial variation. The dataset is organized in array or list form, with each node corresponding to a magnitude record, while also retaining gradient direction information for subsequent analysis. The storage format is compatible with the finite element platform data interface, facilitating fast reading, writing, and access. It is used in the subsequent region identification process, and the spatial gradient information dataset serves as the input for mesh adaptive loops to drive mesh densification decisions.

[0031] In some embodiments, different numerical integration schemes can be employed when discretizing the electromagnetic field control equations. For example, Gaussian integration points can be sampled within the element to calculate the stiffness matrix elements. The choice of integration order balances computational accuracy and efficiency. For nonlinear material problems, it is also necessary to integrate Newton-Raphson iteration to handle material nonlinearity. In some embodiments, the implementation of the preconditioning conjugate gradient method can be combined with more advanced preconditioning techniques, such as algebraic multigrid preconditioners or domain decomposition-based preconditioners, to address ill-conditioned system matrices and improve convergence speed. Optionally, post-processing smoothing techniques can be introduced during the gradient calculation stage, such as using Laplace smoothing or superconvergent patch recovery methods to reprocess the initial gradient estimate, further improving the smoothness and accuracy of the gradient field. Optionally, the storage of the spatial gradient information dataset can include metadata annotations, such as grid version identifiers, computation timestamps, physical quantity units, etc., to enhance data traceability and management efficiency.

[0032] Example 3: In specific implementation, setting a gradient threshold is the initial step. The gradient threshold, as a scalar value, is used to distinguish the degree of drastic change in the field quantity. Its setting is based on the statistical characteristics or physical requirements of the spatial gradient information dataset. The spatial gradient information dataset comes from the nodal gradient vector magnitude values ​​calculated in Example 2, and includes gradient magnitude data on all grid nodes. When comparing the spatial gradient information with the gradient threshold, the gradient value of each node or unit in the spatial gradient information dataset is traversed, and each value is numerically compared with the preset gradient threshold to determine whether it exceeds or falls below the threshold. This comparison operation is implemented through a loop algorithm, processing each entry in the dataset one by one. Units with gradient values ​​exceeding the threshold are marked as regions of drastic change. These units are usually located at locations where the field quantity changes abruptly, such as the air gap edge, permanent magnet corner, or stator slot opening. The marking process involves assigning a region identifier to each unit, for example, using the integer value 1 to represent a region of drastic change. Units with gradient values ​​below the threshold are marked as smooth regions. These regions have slow field quantity changes, such as inside the iron core or the casing, and are also marked with the integer value 0 to represent smooth regions. The output region marking data includes region boundaries and a cell list. The region boundaries are defined by extracting the coordinates of the geometric contour points of the marked region, while the cell list records the indices of all grid cells belonging to drastically changing and smooth regions. The data is stored in a structured array or file format for easy access by the subsequent mesh adjustment module.

[0033] In practice, the specific method for setting the gradient threshold can be based on the global statistics of the spatial gradient information dataset. For example, calculate the mean and standard deviation of all gradient values ​​in the dataset, and then define the gradient threshold using a formula:

[0034] Where: symbol Represents the gradient threshold, used to distinguish between regions of rapid change and smooth regions; symbol Represents the arithmetic mean of all gradient values ​​in the spatial gradient information dataset, reflecting the overall level of the gradient; symbol The standard deviation represents the total gradient values ​​in the spatial gradient information dataset, measuring the degree of dispersion of the gradient; (symbol) This represents a positive real constant, typically set according to simulation accuracy requirements, such as 1.0 or 2.0 to adjust the threshold sensitivity. The calculation process first iterates through the spatial gradient information dataset, sums all gradient values, and divides by the total number of nodes to obtain the average value. Then, calculate the sum of squared deviations of each gradient value from the mean, divide by the number of nodes minus one, and take the square root to obtain the standard deviation. Finally, substitute the values ​​into the formula to calculate the threshold. This statistical method can adapt to the gradient distribution characteristics of different motor models, avoiding the subjectivity of manually setting thresholds.

[0035] The operation of comparing spatial gradient information with a gradient threshold is implemented in code as a loop structure, which reads each gradient value from the spatial gradient information dataset and compares it with the threshold. Perform a floating-point comparison; if the gradient value is greater than... If the gradient value is less than or equal to the specified value, then the corresponding grid cell is marked as a region of drastic change; if the gradient value is less than or equal to the specified value, then the region of drastic change is marked as a region of drastic change. If the gradient is too low, it is marked as a smooth region. For node-based gradient data, the node gradient needs to be mapped to its corresponding cell. Typically, the average gradient of nodes within the cell is used as the cell gradient value for comparison to ensure consistent labeling. During labeling, an attribute field is added to each cell to store the region type. Regions with drastic changes and smooth regions are recorded with different flag values. A region mapping table is maintained to track the correspondence between cells and regions. When outputting region labeling data, region boundaries are generated by scanning the connectivity of labeled cells, identifying the continuous geometric boundary point sequence of drastic changes, for example, by extracting boundary node coordinates by traversing cell boundary surfaces. The cell list directly outputs the index of all cells and their region labels. The data format can be a common format such as JSON or HDF5, containing fields such as the number of regions, an array of boundary point coordinates, and a list of cell indices. This data serves as input for the mesh adaptive loop to guide local mesh refinement. In some embodiments, the gradient threshold setting can be combined with multi-scale analysis, such as hierarchical clustering of the spatial gradient information dataset, automatically selecting the threshold based on the gradient value distribution histogram, so that the ratio of drastic changes to smooth regions reaches a preset balance. In some embodiments, the comparison operation may incorporate fuzzy logic or soft thresholding techniques, such as using a sigmoid function to smooth the transition region markings, thus avoiding boundary discontinuities caused by hard thresholding.

[0036] Optionally, the output region labeling data can include region metadata, such as region area, volume, or gradient statistical summary, to enhance data interpretability. Optionally, the labeling process can be parallelized, distributing the spatial gradient information dataset in blocks across multiple processor cores for simultaneous comparison, accelerating region identification in large-scale meshes. It is understood that the accuracy of the gradient threshold directly affects the region identification effect; a threshold that is too high may cause drastically changing regions to be missed, while a threshold that is too low may misclassify smooth regions as drastically changing regions. It is understood that the integrity of the region labeling data is crucial for subsequent mesh adjustments; it is essential to ensure that all cells are correctly classified and that boundary information is accurate.

[0037] Example 4: Dynamically adjusting the density distribution of the computational mesh based on region-marked data. Parsing the region-marked data is the first step. The region-marked data file output from Example 3 is read. This file contains region boundary coordinates and element list information. A parsing algorithm is used to extract the geometric range description of drastically changing regions. The geometric range is defined by a set of boundary point coordinates or a bounding box. Simultaneously, the global indexes of all mesh elements marked as drastically changing regions are identified from the element list. Within these drastically changing regions, a local mesh refinement algorithm is applied to increase the mesh node density. This algorithm operates on each mesh element within the identified drastically changing region, generating a finer sub-mesh through recursive subdivision while maintaining the mesh density outside the region. In smooth regions, the original mesh density is maintained, with only local smoothing performed. Smoothing optimizes element shape by adjusting node positions without altering element connectivity. New mesh data is generated and the finite element model is updated. The new mesh data contains the updated coordinates of all nodes and element topology connections. The new mesh data is imported into the finite element analysis platform to replace the old mesh, and material properties and boundary conditions are reallocated to complete the finite element model update.

[0038] In practice, parsing region marker data to determine the geometric extent of drastically changing areas requires processing the data structure. Region marker data is usually stored in a specific format. See Table 1 for a simplified region marker data structure.

[0039] Table 1: Region Label Data Structure Table

[0040] The parsing process reads the above data, uses the Bounding_Box field to quickly locate the spatial position of the drastically changing region in the global model, and accurately obtains the set of target cells that need to be encrypted through the Element_List field, providing input for local mesh encryption.

[0041] In regions of rapid change, local mesh refinement algorithms are applied to increase mesh node density. The core of these algorithms is to recursively bisection or quartet each cell to be refined. For three-dimensional tetrahedral cells, recursive bisection typically uses the longest-side bisection method, inserting a new node at the midpoint of the longest side of the cell to divide the original tetrahedron into two smaller tetrahedrons. For two-dimensional triangular cells or surface triangles of a three-dimensional mesh, quartet partitioning can be used, connecting the midpoints of the three sides to divide the original triangle into four similar smaller triangles. The partitioning process is recursive; the same partitioning rules can be applied to newly generated sub-cells until the required refinement depth is met. The refinement depth is controlled by a preset subdivision level; for example, level 2 indicates two recursive partitions of the original cell. The refinement operation determines the location of new nodes according to the following relationship:

[0042] Where: symbol Represents the spatial coordinate vector of the newly inserted node; symbol and symbols This represents the spatial coordinate vectors of the two endpoints of the partitioned edge. Topological connections are established between the newly generated sub-cells. By updating data structures such as the cell-node association table and the node-cell adjacency table, the correct connections of grid nodes within the encrypted region and between the encrypted region and surrounding sparse grid regions are ensured, avoiding non-manifold edges or isolated nodes, thus achieving a smooth transition in grid density.

[0043] Verify the geometric correctness and quality of the newly generated mesh. This includes checking whether the mesh completely covers the geometric domain, whether there are overlapping elements, and whether the element Jacobian matrix is ​​greater than zero to ensure element validity. Simultaneously, evaluate the quality indicators of the refined mesh, such as element shape ratio, and perform local smoothing optimization on elements with poor quality. After generating the new mesh data, update the node coordinate array, element connection matrix, and material property mapping table in the finite element model to complete the mesh adaptive adjustment.

[0044] In some embodiments, the local mesh refinement algorithm can employ a mesh template-based approach, such as predefining standard subdivision templates for different types of elements (tetrahedrons, hexahedrons), and directly applying the templates to generate sub-elements according to the refinement level, thereby improving refinement efficiency. In some embodiments, the processing of smooth regions can be combined with a mesh coarsening algorithm. For smooth regions with extremely low gradient values, elements can be appropriately merged while maintaining connectivity, further improving computational efficiency. Optionally, constrained Delaunay meshing techniques can be introduced when establishing topological connectivity to generate high-quality transition elements at the boundaries of the refined regions. Optionally, geometric tolerance checks can be integrated when verifying the geometric correctness of the mesh to ensure that the deviation between the new mesh and the original CAD model is within an acceptable range. It is understood that the depth of recursive meshing needs to be weighed according to the accuracy requirements and computational resources of the specific problem. Excessive meshing will lead to a surge in the number of elements and a significant increase in computational cost. It is understood that the processing of smooth transition regions is crucial to ensuring the stability of numerical computation, and the rate of change of element size between refined and sparse regions needs to be controlled within a reasonable range.

[0045] See Figure 4The figure shows that in the multi-scale mesh adaptive cyclic method, regions with drastic electromagnetic field changes have fewer cells due to the need for mesh refinement, while smooth regions have more cells due to the use of sparse meshes. This reflects the effect of dynamically adjusting the mesh density based on the spatial gradient information of the electromagnetic field, demonstrating the advantage of this method in optimizing the allocation of computational resources while ensuring computational accuracy. Region 1 has 1286 cells, and Region 2 has 954 cells; while Region 1 has 3872 cells, Region 2 has 4219 cells, and Region 3 has 3568 cells.

[0046] Example 5: Recalculating the electromagnetic field distribution based on the adjusted mesh, evaluating computational errors, and controlling the adaptive loop. The first step is to re-discrete the electromagnetic field governing equations on the new mesh to obtain an updated linear system. This process is similar to the initial discretization but based on the new mesh topology. The element stiffness matrix and load vector are recalculated using the node coordinates and element connection information of the new mesh. The calculation of the element stiffness matrix involves numerical integration on each new element to account for changes in material properties and geometry. Then, the contributions of all elements are assembled into a global stiffness matrix and a global load vector, forming the updated linear algebraic system. An iterative solver is used to calculate the electromagnetic field distribution and monitor the residual norm. Iterative solvers, such as the GMRES method or the BiCGSTAB method, are applied to solve the updated linear system. Iteration begins from an initial guessed solution, and each iteration calculates the product of the matrix and vector and updates the solution vector. Simultaneously, the norm of the current residual vector is calculated as a measure of convergence. The computational error value is calculated based on the residual norm and the difference between the previous and subsequent iteration steps. The computational error value is a comprehensive index used to determine whether the accuracy of the solution under the current grid meets the requirements. The computational error value is compared with the preset tolerance to determine whether to continue the adaptive loop. If the computational error is greater than the preset tolerance, the spatial gradient information is re-extracted according to the latest electromagnetic field distribution and the process jumps to the region identification step. The grid adjustment and recalculation process is repeated until the computational error is less than or equal to the preset tolerance.

[0047] In practice, various strategies can be used to calculate the error value based on the residual norm and the difference between consecutive iteration steps. A typical method for calculating the error value combines a weighted combination of the relative residual and the change in the solution vector between adjacent iteration steps, specifically defined by the following formula:

[0048] Where: symbol Represents the computational error value at the k-th adaptive loop iteration step; symbol Represents the residual vector obtained after solving the linear system in the k-th step, with the symbol... Represents the right-hand vector of a linear system; symbol Represents the electromagnetic field distribution solution vector obtained in the k-th step; symbol Represents the solution vector of the previous step (step k-1); symbol and symbols The weighting coefficients are used to balance the contributions of the residual term and the solution variation term in error assessment. They are usually set to positive values ​​based on the characteristics of the problem and satisfy the following conditions: The calculation process begins by calculating the residual vector after each solution of the linear system. And find its 2-norm. Simultaneously calculate the current solution vector With the solution vector from the previous step The norm of the difference is then substituted into the formula to calculate the overall error. .

[0049] The operation of comparing the calculated error value with the preset tolerance is implemented in the code as a conditional statement, where the preset tolerance is... It is a user-defined small positive number, for example or This represents the maximum acceptable relative error. If we calculate the error value... Greater than the preset tolerance If the current mesh solution is not accurate enough, further mesh optimization is needed; at this point, the electromagnetic field distribution is calculated based on the latest calculation. Re-execute the gradient extraction process in Example 2, i.e., based on The new spatial gradient information is calculated, and then the process jumps to the region identification step in Example 3 to begin a new round of mesh adaptive looping. The error value of each iteration is recorded during the loop execution process. And grid size, monitor convergence trend, when the calculation error value of a certain iteration Less than or equal to the preset tolerance When the loop terminates, the final electromagnetic field distribution result is output as high-precision simulation data.

[0050] In some embodiments, the evaluation of computational error values ​​can incorporate more complex methods based on posterior error estimators, such as using the gradient or flux jump values ​​at cell boundaries to estimate discrete errors, providing more reliable accuracy metrics. In some embodiments, the preset tolerance can be dynamically adjusted according to the mesh size or the magnitude of physical quantities, allowing for stricter tolerances when the mesh is very dense, achieving a balance between accuracy and cost. Optionally, monitoring the residual norm can be combined with convergence history analysis, for example, detecting stagnation or oscillations in the residual norm's decline and prematurely terminating invalid iterations to save computation time. Optionally, when jumping to the region identification step, an incremental update strategy can be introduced, re-identifying only newly added gradient change regions near the previously marked regions to reduce redundant computation. It is understood that the accuracy of the computational error values ​​directly affects the termination judgment of the adaptive loop; overly lenient error evaluation may lead to premature termination and insufficient accuracy, while overly conservative evaluation may lead to unnecessary mesh refinement, increasing the computational burden. It is understood that memory and storage resources need to be managed during loop execution, especially as the model size increases significantly after multiple mesh refinements, requiring the computing platform to have sufficient resources to support the complete adaptive process.

[0051] See Figure 5 The figure presents the changing patterns of key indicators during the multi-scale mesh adaptive iteration process. The horizontal axis is plotted as the number of adaptive iterations, the left vertical axis as the error value (logarithmic scale), and the right vertical axis as the number of mesh nodes (in ten thousand). The curves for comprehensive calculation error, relative residual, and solution vector change all show a decreasing trend with increasing iteration count, reflecting the effect of adaptive mesh refinement on improving computational accuracy. The number of mesh nodes increases significantly with increasing iteration count, reflecting the mesh refinement process in areas of drastic change. A preset tolerance (3.0e-04) is used as the accuracy threshold; when the comprehensive calculation error and other indicators are below this tolerance, it indicates that the simulation accuracy meets the requirements. These curves intuitively demonstrate the trade-off between accuracy and computational scale during adaptive iteration, providing crucial evidence for convergence analysis and efficiency optimization of rapid finite element simulation of the electromagnetic field of permanent magnet synchronous motors.

[0052] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0053] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A rapid finite element simulation method for electromagnetic field calculation of a permanent magnet synchronous motor, characterized in that, The method is implemented through a multi-scale grid adaptive loop and includes the following steps: A three-dimensional geometric model was constructed based on the design specifications of the permanent magnet synchronous motor, and material property data was loaded into the finite element analysis platform. In the finite element analysis platform, an automatic mesh generation algorithm is used to create an initial computational mesh based on the geometric model, and the solution conditions for the electromagnetic field control equations are set. The initial electromagnetic field distribution is obtained by solving the electromagnetic field control equations, and the spatial gradient information of the electromagnetic field distribution is extracted. The spatial gradient information is used to identify regions with drastic electromagnetic field changes and regions with smooth electromagnetic fields, and region labeling data is generated. The density distribution of the computational grid is dynamically adjusted based on the region marking data. In regions with drastic changes, the grid is refined, while in smooth regions, the grid remains sparse. The electromagnetic field distribution is recalculated based on the adjusted grid, and the computational error is evaluated. When the calculation error does not meet the preset tolerance, repeat the mesh adjustment and recalculation steps until the error meets the requirements, and output the final electromagnetic field distribution result as simulation data.

2. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The construction of a three-dimensional geometric model based on the design specifications of a permanent magnet synchronous motor, and the loading of material property data into the finite element analysis platform, includes: Geometric dimensions and material parameters are extracted from the motor design database, and parametric geometric models are generated using 3D modeling software; Import the parametric geometric model into the finite element analysis platform and assign material property data to the corresponding geometric components; Verify the integrity and consistency of the geometric model, and start mesh generation after ensuring that the model data is correct.

3. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The process of creating an initial computational mesh based on the geometric model using an automatic mesh generation algorithm includes: Analyze the topological structure of the geometric model to determine key feature edges and faces; An initial computational mesh is generated based on key features using the frontier advancement method, and mesh size control parameters are set. Check the quality metrics of the initial computational mesh, such as cell shape and connectivity, and optimize low-quality mesh regions.

4. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The process of obtaining the initial electromagnetic field distribution by solving the electromagnetic field control equations and extracting the spatial gradient information of the electromagnetic field distribution includes: Discretize the electromagnetic field control equations to form a linear algebraic system; The initial electromagnetic field distribution is obtained by solving the linear algebraic system using the preconditional conjugate gradient method. Calculate the gradient vector of each node in the initial electromagnetic field distribution and summarize it into a spatial gradient information dataset.

5. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The method of using the spatial gradient information to identify regions of drastic electromagnetic field changes and smooth regions includes: Set a gradient threshold and compare the spatial gradient information with the gradient threshold; Cells with gradient values ​​exceeding a threshold are marked as regions of rapid change, while cells with gradient values ​​below the threshold are marked as regions of smooth change. Output region labeling data, including region boundaries and a list of cells.

6. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The step of dynamically adjusting the density distribution of the computational grid based on the region marker data includes: Analyze the region marker data to determine the geometric extent of areas of drastic change; Apply local mesh densification algorithms to areas of rapid change to increase mesh node density; Maintain the original mesh density in smooth areas and perform only local smoothing. Generate new mesh data and update the finite element model.

7. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, The process of recalculating the electromagnetic field distribution based on the adjusted grid and evaluating the calculation error includes: The electromagnetic field control equations are discretized again on the new grid to obtain the updated linear system. The electromagnetic field distribution is calculated using an iterative solver, and the residual norm is monitored. The computational error value is calculated based on the residual norm and the difference between the previous and subsequent iteration steps.

8. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 1, characterized in that, When the calculation error does not meet the preset tolerance, the repeated mesh adjustment and recalculation steps include: Compare the calculated error value with the preset tolerance. If the calculated error is greater than the preset tolerance, then re-extract the spatial gradient information based on the latest electromagnetic field distribution and proceed to the region identification step. The process is repeated until the calculation error is less than or equal to the preset tolerance.

9. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 4, characterized in that, The calculation of the gradient vectors of each node in the initial electromagnetic field distribution and the summarization of these vectors into a spatial gradient information dataset specifically includes: Based on the shape function theory of the finite element method, the gradient of the electromagnetic field quantity inside each element is calculated; The node averaging method is used to smoothly transfer the cell gradient data to the grid nodes, thus obtaining the gradient vector of each node; The magnitude values ​​of the gradient vectors of all nodes are stored as a spatial gradient information dataset for subsequent region identification.

10. The finite element method for rapid simulation calculation of electromagnetic field of permanent magnet synchronous motor as described in claim 6, characterized in that, The application of a local mesh densification algorithm to increase mesh node density in areas of rapid change specifically includes: Analyze the region labeling data to identify all grid cells belonging to regions of drastic change; Each unit to be encrypted is recursively divided into two or four parts to generate finer sub-units. Establish topological connections between newly generated sub-cells to ensure a smooth transition between the encrypted region and the surrounding sparse mesh region; Verify the geometric correctness and quality of the newly generated mesh, and complete the local mesh refinement.