Star simulator complex curved surface permanent magnet blocking method based on magnetization direction clustering

By using a clustering method based on magnetization direction, and combining magnetization direction similarity, spatial connectivity, and size constraints, the K-means algorithm is improved for permanent magnet block segmentation. This solves the problems of large differences in magnetization direction and insufficient spatial connectivity in existing technologies, and achieves high-precision magnetic field distribution and manufacturing feasibility.

CN122050894APending Publication Date: 2026-05-15UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610037829.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the spatial rule-based partitioning leads to significant differences in the magnetization direction of permanent magnets, and the standard clustering algorithm does not consider spatial connectivity and size constraints, making it impossible to manufacture and assemble magnetic blocks, thus affecting magnetic field accuracy and manufacturing feasibility.

Method used

A clustering method based on magnetization direction is adopted to establish a grid in the poloidal and circumferential directions. The magnetic blocks are divided by magnetization direction similarity, spatial connectivity and size constraints. An improved K-means clustering algorithm is used to ensure that the magnetization direction is consistent and the space is connected within the same magnetic block. Secondary segmentation is performed to meet the size requirements of additive manufacturing equipment.

Benefits of technology

This improved the magnetic field accuracy and manufacturing feasibility of the stellarator permanent magnet system, ensured the continuity of the magnetic blocks in physical space and met the requirements of additive manufacturing, reduced the discretization error of the magnetization direction, and achieved a high-precision magnetic field distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122050894A_ABST
    Figure CN122050894A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of magnetic confinement fusion energy, and discloses a star simulator complex curved surface permanent magnet blocking method based on magnetization direction clustering. The method comprises the following steps: performing magnetic field inversion calculation according to plasma constraint requirements of a star simulator to establish a grid to obtain a grid point data set, setting a threshold value and a size upper limit through magnetization direction unit vector clamping angle quantity similarity, and dividing magnetic blocks according to magnetization direction similarity space connectivity and size constraint by adopting a clustering algorithm, and carrying out secondary segmentation on the over-limit magnetic block to calculate the average magnetization direction. The magnetic field precision and the manufacturing feasibility of the star simulator permanent magnet system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of magnetic confinement fusion energy technology, and in particular to a method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering. Background Technology

[0002] Stellarators are an important type of device for magnetic confinement fusion research. They achieve nuclear fusion reactions by confining plasma with a three-dimensional asymmetric magnetic field, offering significant advantages over tokamas, such as steady-state operation, no risk of breakage, and low recycle energy. Traditional stellarators typically employ complex three-dimensional twisted coil systems to generate the required asymmetric magnetic field configuration. For example, the Wendelstein 7-X device in Germany uses a modular coil system composed of fifty non-planar superconducting coils, each with a unique three-dimensional twisted shape. While this complex coil structure can generate a high-quality magnetic field configuration, its design, manufacturing, assembly, and maintenance are extremely difficult and costly. The construction cost of a single large stellarator device can reach hundreds of millions to billions of US dollars, with a construction period exceeding ten years. In recent years, the application of permanent magnets in stellarators has received widespread attention. Permanent magnets offer advantages such as no energy maintenance required, relatively simple structure, and low operating costs. Combining them with planar coils can significantly reduce the complexity and construction cost of stellarator devices. The planar coils generate the main circumferential magnetic field, while the permanent magnets generate the poloidal magnetic field component and some rotational transformations; together, they form the three-dimensional asymmetric magnetic field configuration required by the stellarator. According to the stellarator magnetic field optimization calculation, the ideal permanent magnet has a complex three-dimensional curved surface shape and the magnetization direction changes continuously in space. Magnetic field optimization is usually based on plasma equilibrium equations and stability conditions. The distribution of permanent magnets that can generate the target magnetic field configuration is obtained through numerical calculation inversion. The calculation results show that permanent magnets with magnetization intensity and magnetization direction that change continuously with spatial position need to be arranged in the annular region outside the plasma boundary. The spatial distribution of magnetization direction presents a complex three-dimensional asymmetric feature, which corresponds to the periodic symmetric structure of the stellarator magnetic field.

[0003] However, the theoretically continuously varying permanent magnets face two major technical challenges in actual manufacturing: the limited forming space of additive manufacturing equipment and the requirement for uniform magnetization of each magnet block in the magnetization process. Therefore, the overall permanent magnet must be discretized into multiple independently manufactureable magnetic blocks, each uniformly magnetized in a single direction. This direction is obtained by calculating the average of the theoretical magnetization directions at points within the corresponding region of the magnetic block. Existing methods for dividing magnetic blocks typically involve regular division on a spatial coordinate grid, dividing the permanent magnet design area into regular cuboids or simple geometric shapes according to a preset grid density. This method ignores the distribution characteristics of the magnetization directions, leading to potentially large differences in magnetization directions within the same magnetic block. When the magnetic blocks are uniformly magnetized according to the average magnetization direction, there is a significant deviation between this average direction and the theoretical optimal magnetization direction at each point within the block, increasing the discretization error and affecting the accuracy of the magnetic field. While standard clustering algorithms can group data based on feature similarity, they typically only consider similarity in feature space and do not consider the spatial relationship of data points. This makes it impossible to guarantee that the magnetic blocks are connected single entities in physical space, which makes them impossible to manufacture and assemble. At the same time, existing methods are difficult to satisfy the three conditions of similar magnetization direction, spatial connectivity, and size constraints simultaneously during the clustering process. Summary of the Invention

[0004] This application provides a method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering. This method addresses the problems in existing technologies where spatial rule-based partitioning leads to significant differences in magnetization directions within the same magnet block and large discretization errors in the average magnetization direction. It also solves the problem that standard clustering algorithms do not consider spatial connectivity and size constraints, making it impossible to manufacture and assemble the magnet blocks. This application improves the magnetic field accuracy and manufacturing feasibility of stellarator permanent magnet systems.

[0005] This application provides a method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering. The method includes: Step S1: Perform magnetic field inversion calculations based on the plasma confinement requirements of the stellarator, establish a grid in the directions of the poloidal angle theta and the circumferential angle zeta, and obtain a grid point dataset, which includes position coordinates and magnetization direction vectors; Step S2: Measure the similarity of magnetization directions by the angle between two unit vectors of magnetization directions, and set the threshold for similarity of magnetization directions and the upper limit for the size of the magnetic block; Step S3: Using a clustering algorithm, the grid point dataset is divided into several magnetic blocks based on magnetization direction similarity, spatial connectivity, and size constraints. This ensures that the angle between the magnetization directions of any two points within the same magnetic block is less than the similarity threshold and that they are spatially connected, thereby obtaining a set of magnetic blocks. Step S4: Perform secondary division on the magnetic blocks in the magnetic block set whose spatial size exceeds the upper limit of the size to obtain the final magnetic blocks that meet the size constraints, and calculate the average magnetization direction of each final magnetic block.

[0006] The technical solution provided in this application obtains a grid point dataset containing position coordinates and magnetization direction vectors by performing magnetic field inversion calculations based on the plasma confinement requirements of the stellarator and establishing a grid in the poloidal and circumferential directions. This dataset completely records the theoretical optimal magnetization direction information for each spatial location within the permanent magnet design area. Compared with the existing method of establishing a grid based solely on spatial coordinates, the grid point dataset of this invention includes the key physical quantity of magnetization direction, enabling the block segmentation process to directly utilize the distribution characteristics of magnetization direction rather than relying solely on spatial positional relationships. By using the angle between two unit vectors of magnetization direction as a similarity metric and setting a similarity threshold and an upper limit for the size of the magnetic block, this invention establishes a quantitative basis for judging the similarity of magnetization direction and engineering constraints. The angle measurement method has clear geometric meaning and mathematical properties. The setting of the similarity threshold achieves a reasonable trade-off between magnetic field accuracy and manufacturing assembly complexity. The upper limit constraint ensures that each magnetic block can be formed in one step using additive manufacturing equipment. This collaborative setting of multiple constraints is the key to the transformation of theoretical optimization into engineering implementation in this invention. A clustering algorithm is used to divide the grid point dataset into several magnetic blocks based on magnetization direction similarity, spatial connectivity, and size constraints. This ensures that the angle between the magnetization directions of any two points within the same magnetic block is less than the similarity threshold and that they are spatially connected. This fundamentally solves the problem of large differences in magnetization directions within the same magnetic block caused by spatial rule-based partitioning in existing technologies. By prioritizing the similarity of magnetization directions, the magnetization directions of each grid point within the same magnetic block are highly consistent. When calculating the average magnetization direction, the deviation between the direction of each point and the average direction is effectively controlled, significantly reducing the discretization error of the magnetization direction. The spatial connectivity constraint ensures that each magnetic block is a physically continuous single entity that meets the requirements of additive manufacturing and magnetization processes.

[0007] A secondary segmentation method is used to obtain the final magnetic blocks that satisfy the size constraints in the magnetic block set whose spatial size exceeds the upper limit. The average magnetization direction of each final magnetic block is calculated. This solves the problem that the magnetic blocks obtained in the initial clustering may exceed the forming space limit of the additive manufacturing equipment. The secondary segmentation adopts the strategy of establishing the segmentation plane at the midpoint of the coordinate range along the excess direction. After segmentation, the spatial connectivity of the subset is checked to ensure that each sub-magnetic block is a connected domain. The recursive segmentation mechanism ensures that all magnetic blocks satisfy the size constraints in the end. Since the included angle of the magnetization direction of the grid points in the original magnetic block is already less than the similarity threshold, the sub-magnetic blocks after segmentation inherit this characteristic, and the consistency of the magnetization direction is not destroyed. The average magnetization direction is calculated by vector summing and normalizing the magnetization direction vectors of all grid points within the magnetic block. This average direction accurately represents the magnetization requirement of the magnetic block. Since the magnetization direction of each point within the magnetic block is highly consistent, the deviation between the average magnetization direction and the direction of each point is controlled within an acceptable range. The actual magnetic field distribution is closer to the theoretical optimization result, providing a high-precision magnetic field realization scheme for the stellarator permanent magnet system. At the same time, it meets the engineering requirements of additive manufacturing size constraints and uniform magnetization in the magnetization process, realizing the organic combination of magnetic field optimization theory and engineering manufacturing capabilities. Attached Figure Description

[0008] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This is a schematic diagram of an embodiment of the stellarator complex curved surface permanent magnet segmentation method based on magnetization direction clustering in this application. Figure 2 This is a schematic diagram of the segmentation effect of the complex curved surface permanent magnet in the stellarator device in the embodiments of this application; Figure 3 This is a schematic diagram of a three-dimensional geometric model of a magnetic block in an embodiment of this application. Detailed Implementation

[0010] This application provides a method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0011] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the stellarator complex curved surface permanent magnet segmentation method based on magnetization direction clustering in this application includes: Step S1: Perform magnetic field inversion calculations based on the plasma confinement requirements of the stellarator. Establish a grid in the directions of the poloidal angle theta and the circumferential angle zeta to obtain a grid point dataset. The grid point dataset contains position coordinates and magnetization direction vectors. Based on plasma equilibrium equations and stability conditions, the spatial distribution characteristics of permanent magnets capable of generating the target magnetic field configuration are determined through numerical inversion. The grids established along the poloidal angle theta and circumferential angle zeta employ periodic boundary conditions, with both angles ranging from zero to twice pi. The number of grid nodes is determined according to the required accuracy of the magnetic field calculation. Each grid node corresponds to a unique spatial coordinate and a theoretically optimal magnetization direction vector. The magnetization direction vector is normalized to a unit vector. The grid topology describes spatial connectivity by defining the adjacency relationship between each node and its four adjacent nodes.

[0012] Step S2: Measure the similarity of magnetization directions by the angle between two unit vectors of magnetization directions, and set the threshold for similarity of magnetization directions and the upper limit for the size of the magnetic block; Specifically, the angle between two unit magnetization direction vectors is used as a quantitative indicator, calculated through vector dot product and inverse cosine function. The setting of the magnetization direction similarity threshold requires a trade-off between magnetic field accuracy and manufacturing assembly complexity. A smaller threshold results in more consistent magnetization directions within the magnetic block but increases the total number of magnetic blocks, while a larger threshold reduces the number of magnetic blocks but increases discretization error. The upper limit of the magnetic block size is determined based on the forming space of the additive manufacturing equipment; a typical forming space is a 300 mm cube. This size constraint ensures that each magnetic block can be formed in a single pass using the additive manufacturing equipment.

[0013] Step S3: Using a clustering algorithm, the grid point dataset is divided into several magnetic blocks based on the similarity of magnetization directions, spatial connectivity, and size constraints. This ensures that the angle between the magnetization directions of any two points within the same magnetic block is less than the similarity threshold and that they are spatially connected, thus obtaining a set of magnetic blocks. The clustering algorithm used is an improvement on the traditional K-means clustering algorithm, with improvements in three aspects: the clustering feature is changed from spatial location coordinates to magnetization direction vectors, and the cluster center is represented as the vector average of the magnetization directions instead of the spatial coordinate mean; a dual constraint condition is added to the assignment step, where grid points are only assigned to a cluster if the angle between the magnetization directions is less than a threshold and the grid point is spatially connected to the already assigned point set; and the magnetization direction of the cluster center is recalculated in the update step using a vector summation normalization method. Spatial connectivity is determined by checking whether the set of adjacent points of a grid point contains already assigned points, and the iterative process continues until the clustering results converge, i.e., the grid point assignment no longer changes in two consecutive iterations.

[0014] Step S4: Perform secondary division on the magnetic blocks in the magnetic block set whose spatial size exceeds the upper limit of the size to obtain the final magnetic blocks that meet the size constraints, and calculate the average magnetization direction of each final magnetic block.

[0015] Specifically, for magnetic blocks whose spatial dimensions exceed the capabilities of additive manufacturing equipment, the spatial dimensions of the magnetic block are determined by calculating the minimum and maximum values ​​of all grid points contained within the magnetic block along the three coordinate axes. When the dimension in any direction exceeds the upper limit, a segmentation plane is established at the midpoint of the coordinate range along that direction, and the magnetic block is divided into two subsets based on the coordinate values ​​of the grid points in that direction. After segmentation, a connectivity check is performed on each subset, and a depth-first search or breadth-first search algorithm is used to identify connected components, with each connected component serving as an independent sub-magnetic block. For sub-magnetic blocks that still exceed the size upper limit, the segmentation operation is recursively performed until all magnetic blocks satisfy the size constraints. The average magnetization direction is calculated by vector summation and normalization of the magnetization direction vectors of all grid points within the magnetic block.

[0016] In one specific embodiment, step S1 includes: Based on the plasma equilibrium equation and stability conditions, the magnetic field inversion calculation of the permanent magnet design area is performed to obtain the theoretical optimal magnetization direction at each spatial location point. The range of polar angle from zero to twice pi is divided into equally spaced polar nodes, and the range of circumferential angle from zero to twice pi is divided into equally spaced circumferential nodes to establish a mesh topology. For each node in the mesh, calculate its spatial position coordinates in the three-dimensional Cartesian coordinate system and the corresponding magnetization direction vector. Then, normalize the magnetization direction vector to obtain the unit magnetization direction vector. Construct a grid point dataset, which records the spatial coordinates and unit magnetization direction vector of each grid point, and define the set of adjacent points of each grid point, including the four adjacent grid points.

[0017] Specifically, the magnetic field inversion calculation employs a numerical inversion method to deduce the permanent magnet distribution from the target magnetic field configuration. The plasma equilibrium equation describes the mechanical equilibrium state of the plasma within the stellarator, and stability conditions constrain the magnetic field configuration to ensure plasma confinement performance. The inversion calculation solves for the theoretically optimal magnetization direction that generates the target magnetic field at each spatial location within the permanent magnet design region. This magnetization direction is represented as a three-dimensional vector, containing components along the three coordinate axes in a Cartesian coordinate system. The poloidal angle and circumferential angle are two natural coordinate parameters in the stellarator's toroidal geometry. The poloidal angle describes the angular variation along the smaller radius, while the circumferential angle describes the angular variation along the larger radius. Both range from zero to twice pi, reflecting the periodic symmetry of the stellarator's structure.

[0018] The grid topology describes spatial connectivity by defining the adjacency relationships between nodes. Each grid node's set of adjacencies includes two adjacent nodes in the polar direction (front and back) and two adjacent nodes in the circumferential direction (left and right). Boundary nodes are treated with periodic boundary conditions so that nodes with a polar angle of zero are adjacent to nodes with a polar angle of twice pi, and the same applies to the circumferential angle. Spatial position coordinates in the three-dimensional Cartesian coordinate system are calculated through coordinate transformation using the polar angle, circumferential angle, and the large and small radii parameters of the stellarator. This coordinate transformation involves trigonometric function operations to convert the circumferential coordinate system to a rectangular coordinate system. The normalization of the magnetization direction vector involves dividing the vector by its magnitude to obtain a unit vector. The normalized unit magnetization direction vector retains only direction information while eliminating amplitude differences, making the magnetization directions of different grid points comparable. The grid point dataset serves as the data foundation for subsequent clustering and partitioning, completely recording the spatial position and magnetization direction information of each grid node. The set of adjacency points is defined as the basis for judging spatial connectivity in the clustering algorithm.

[0019] Figure 2 This is a schematic diagram illustrating the segmented effect of the complex curved surface permanent magnet in the stellarator device of this application embodiment. For example... Figure 2 As shown, the plasma is located in the central annular region of the stellarator device, and permanent magnet blocks are distributed outside the plasma. Each permanent magnet block has a magnetization direction vector marked on its surface, and the magnetization direction exhibits a complex three-dimensional asymmetric distribution in space. Permanent magnet blocks of different colors and grayscale represent different magnetic blocks obtained by the method of this application. The magnetization direction arrows within each magnetic block are aligned with the same height, reflecting the core feature of the magnetization direction-based clustering and block division method. There are obvious turns in the magnetization direction between adjacent magnetic blocks, and the boundaries of the magnetic blocks are located in regions where the magnetization direction changes significantly.

[0020] In one specific embodiment, step S2, measuring the similarity of magnetization directions by the angle between two unit vectors of magnetization directions, includes: Extract the unit magnetization direction vector for any two grid points; The cosine of the angle between two unit magnetization direction vectors is calculated using the vector dot product operation. The magnetization direction angle is obtained by processing the cosine value of the included angle using the inverse cosine function; The similarity of the magnetization directions of two grid points can be determined by the angle between their magnetization directions; the smaller the angle, the higher the similarity of their magnetization directions.

[0021] Specifically, the unit magnetization direction vector is a normalized three-dimensional vector with a magnitude of 1, representing only the magnetization direction and not including magnetization intensity information. The vector dot product operation is a mathematical operation that sums the corresponding components of two vectors. For two unit magnetization direction vectors, the geometric meaning of their dot product is equal to the cosine of the angle between the two vectors. The dot product value ranges from -1 to +1. When the two vectors are in the same direction, the dot product value is 1; when they are in opposite directions, the dot product value is -1; and when they are perpendicular, the dot product value is 0. The inverse cosine function is the inverse function of the cosine function, mapping the cosine of the angle back to the corresponding angle value. The input range is from -1 to +1, and the output range is 0 to pi in radians or 0 to 180 degrees. The mathematical expression of the inverse cosine function ensures that the angle value is uniquely determined from the dot product value.

[0022] The magnetization direction angle, as a similarity metric, has clear physical meaning and mathematical properties. A 0-degree angle indicates that the two magnetization directions are completely identical, with the highest similarity; a 90-degree angle indicates that the two magnetization directions are orthogonal, with lower similarity; and a 180-degree angle indicates that the two magnetization directions are completely opposite, with the lowest similarity. By setting a similarity threshold for magnetization directions, continuous angle values ​​are transformed into discrete judgment criteria. Only when the angle between the magnetization directions of two grid points is less than the threshold are their magnetization directions considered sufficiently similar and they can be assigned to the same magnetic block. This angle-based similarity measurement method contrasts with traditional methods based on spatial distance. The core of this invention lies in dividing permanent magnets into blocks based on magnetization direction similarity rather than spatial location. The establishment of the angle measurement standard provides a quantitative basis for subsequent clustering algorithms.

[0023] In one specific embodiment, step S2, setting a magnetization direction similarity threshold, includes: A trade-off analysis was conducted based on the magnetic field accuracy requirements and the complexity of manufacturing and assembly. When a more accurate magnetization direction is required, set a smaller threshold range, typically 20 to 30 degrees; when a reduction in the number of magnets is required, set a larger threshold range, typically 40 to 50 degrees. Taking into account the accuracy requirements of the magnetic field, the similarity threshold of the magnetization direction is determined, with a typical value of thirty-five degrees; The angle between the magnetization directions of any two grid points within the same magnetic block must be less than the magnetization direction similarity threshold.

[0024] Specifically, the trade-off analysis involves two mutually constraining factors: magnetic field accuracy and manufacturing / assembly complexity. Magnetic field accuracy is determined by the deviation between the average magnetization direction of the magnetic blocks and the theoretically optimal magnetization direction, while manufacturing / assembly complexity is directly related to the total number of magnetic blocks. A smaller similarity threshold results in smaller differences in magnetization directions among points within the same magnetic block, reducing discretization errors when calculating the average magnetization direction and improving magnetic field accuracy. However, this also leads to a smaller range of grid points satisfying the similarity condition, an increase in the number of magnetic blocks generated by clustering, and increased workload and cost in additive manufacturing and assembly. A larger similarity threshold allows grid points with large differences in magnetization directions to cluster together, increasing the number of grid points in a single magnetic block, reducing the total number of magnetic blocks, and lowering manufacturing / assembly complexity and cost. However, this increases the dispersion of magnetization directions within the magnetic blocks, weakens the representativeness of the average magnetization direction, and increases discretization errors, leading to a decrease in magnetic field accuracy.

[0025] The determination of the similarity threshold of 35 degrees comprehensively considers the stellarator's magnetic field configuration's tolerance for magnetic field accuracy and actual engineering manufacturing capabilities. This threshold ensures that the angle between any grid point within the same magnetic block and the average magnetization direction is controlled within an acceptable range. Since the clustering algorithm ensures that the angle between the magnetization directions of any two grid points within the same magnetic block is less than 35 degrees, based on the triangle inequality property of vector angles, the angle between each grid point and the average magnetization direction of the magnetic block is also limited to a similar range, thus effectively controlling discretization errors. This method of error control through similarity threshold constraints contrasts sharply with existing technologies that rely on spatial rule partitioning, which can lead to differences in magnetization directions within the same magnetic block reaching 60 degrees or even greater. This invention ensures the consistency of magnetization directions within the magnetic block from the source of the partitioning strategy.

[0026] In one specific embodiment, step S2, setting the upper limit of the magnetic block size, includes: Obtain the forming space parameters of the additive manufacturing equipment; The maximum size limit of the magnetic block in the three coordinate axes is determined based on the molding space parameters. Set the maximum size limit, typically 300 mm by 300 mm by 300 mm; The spatial dimensions of each magnetic block are constrained to not exceed the upper limit of the magnetic block size, ensuring that the magnetic blocks are formed in one step by additive manufacturing equipment.

[0027] Specifically, the forming space parameters are inherent physical limitations of additive manufacturing equipment, determining the maximum external dimensions of parts that the equipment can manufacture in a single operation. These parameters include independent dimensional limitations along three coordinate axes. The forming space of commercial metal additive manufacturing equipment is typically cubic or cuboid in shape, varying between different models. A typical forming space is a 300 mm cube, while some larger equipment can reach 500 mm or more. The maximum dimensional limitations of the magnetic block along the three coordinate axes are directly inherited from the forming space parameters. The spatial dimensions of the magnetic block are obtained by calculating the difference between the maximum and minimum coordinates of all grid points contained within the magnetic block in each direction. When the dimension in any direction exceeds the corresponding maximum dimensional limit, the magnetic block cannot be formed in a single operation within the equipment.

[0028] The dimensional constraints ensure that each magnetic block is a physically manufacturable entity, avoiding theoretically reasonable but engineering-impractical modular designs. Additive manufacturing technology constructs three-dimensional parts by layer-by-layer stacking. The magnetic block material is typically a neodymium iron boron permanent magnet alloy, which is formed by melting and solidifying metal powder layer by layer through processes such as selective laser melting or electron beam melting. A one-time formed magnetic block has a continuous microstructure and uniform magnetic properties. If the magnetic block size exceeds the equipment limit, it needs to be manufactured in segments and then spliced ​​together. The splicing interface will introduce structural weaknesses and magnetic property inhomogeneities. This invention incorporates dimensional constraints into the algorithm during the clustering and modularization stage. By checking the magnetic block size during the clustering process and performing secondary segmentation on the magnetic blocks that exceed the limit, it ensures that all magnetic blocks ultimately meet the dimensional requirements for one-time forming, thereby transforming the theoretically optimized magnetic field design into an engineering-feasible manufacturing solution.

[0029] In one specific embodiment, step S3 includes: An improved K-means clustering algorithm is used to initialize the magnetization directions of several cluster centers; In the allocation step, the angle between the unit magnetization direction vector of each grid point and the magnetization direction of each cluster center is calculated, and the cluster center with the smallest angle is selected as the candidate cluster center. Determine whether the included angle of the magnetization direction of the grid points is less than the similarity threshold, and determine whether the grid points are spatially connected to the set of points assigned to candidate cluster centers in the grid topology. When both the magnetization direction similarity and spatial connectivity conditions are met, grid points are assigned to candidate cluster centers to obtain a set of magnetic blocks.

[0030] Specifically, the improved K-means clustering algorithm makes three key improvements over the traditional algorithm: first, it changes the clustering features from spatial coordinates to magnetization direction vectors; second, it adds dual constraints in the allocation step; and third, it uses vector averaging to calculate cluster centers in the update step. The initialization of the magnetization direction of the cluster centers determines the algorithm's convergence speed and result quality. Initialization methods include uniformly sampling representative magnetization directions from the grid point dataset or using the K-means++ strategy to select initial centers with significant differences in magnetization directions. The number of cluster centers is determined based on the total number of grid points and the expected average number of grid points per magnetic block. If the total number of grid points is 40,000 and the expected average number of grid points per magnetic block is 200, then 200 cluster centers are initialized. In the allocation step, each grid point is processed individually, calculating the angle between the unit magnetization direction vector of that point and the magnetization directions of all cluster centers. The angle value is obtained through vector dot product and inverse cosine function, and the cluster center with the smallest angle is selected as the candidate.

[0031] The similarity of magnetization direction is determined by comparing whether the angle between a grid point and the candidate cluster center is less than a similarity threshold of 35 degrees. This determination ensures that grid points assigned to the same cluster have similar magnetization directions. Spatial connectivity is determined by checking whether a grid point is adjacent to the set of points already assigned to candidate cluster centers in the grid topology. Specifically, this involves obtaining the set of adjacent points of the grid point and checking if at least one point in the set already belongs to the set corresponding to the candidate cluster center. If so, spatial connectivity is determined; otherwise, spatial connectivity is determined. Assignment is only performed when a grid point simultaneously meets both conditions: the angle between its magnetization direction and its spatial connectivity with the assigned point set. Otherwise, the grid point remains unassigned or attempts to be assigned to another cluster center with the second smallest angle that also meets both conditions. This dual-constraint assignment mechanism is fundamentally different from the traditional K-means algorithm, which assigns based solely on distance or similarity. This invention ensures that each magnetic block is a physically continuous single entity rather than multiple dispersed regions through spatial connectivity constraints, meeting the process requirements of one-step additive manufacturing.

[0032] In one specific embodiment, determining whether a grid point is spatially connected to the set of points already assigned to candidate cluster centers in the grid topology includes: Get the set of adjacent points of a grid point; Determine whether there exists at least one point in the set of adjacent points that belongs to the set of points already assigned to candidate cluster centers; When at least one point in the set of adjacent points belongs to the set of points already assigned to candidate cluster centers, it is determined that the grid point is spatially connected to the set of points already assigned. If no point in the set of adjacent points belongs to the set of points already assigned to candidate cluster centers, it is determined that the grid point and the space of the assigned point set are not connected.

[0033] Specifically, the set of adjacent points is defined during the grid point dataset construction phase. For any node in the grid, its adjacent points include two adjacent nodes in the polar direction (front and back) and two adjacent nodes in the circumferential direction (left and right), totaling four adjacent points. The adjacency relationship is determined based on the grid topology and is independent of the actual spatial distance between grid points in the three-dimensional Cartesian coordinate system; rather, it reflects the adjacency on the grid index. The set of points assigned to candidate cluster centers refers to the set of all grid points that have been assigned to that cluster center in the current iteration. This set gradually expands as the assignment steps proceed, initially being an empty set or containing only the seed points selected during cluster center initialization. The operation to determine whether at least one point in the adjacent point set belongs to the assigned point set is implemented through set intersection operations. If the intersection of the adjacent point set and the assigned point set is not empty, then at least one point belongs to both sets simultaneously.

[0034] The determination of spatial connectivity relies on the adjacency relationship propagation in the grid topology. When an assigned point exists among the adjacent points of a grid point, the grid point is directly connected to the assigned point through the adjacency relationship, and thus connected to the entire set of assigned points through the assigned point, ensuring that the entire set remains connected after the grid point is added to the set. If no assigned point exists in the set of adjacent points, the grid point is isolated from the set of assigned points in the grid topology. Forcibly assigning it would cause the set to form multiple disconnected connected components, violating the requirement that the magnetic block is a single continuous entity. This connectivity determination method based on adjacency relationships is computationally efficient, requiring only the checking of the ownership status of a finite number of adjacent points, avoiding complex graph search algorithms. This invention, through spatial connectivity constraints, ensures that each magnetic block generated by the clustering algorithm is a connected region in the grid topology, corresponding to a continuously distributed permanent magnet block in physical space, satisfying the dual requirements of one-time molding in additive manufacturing and uniform magnetization in the magnetization process.

[0035] In one specific embodiment, step S3 further includes updating the magnetization direction of the cluster centers: The total magnetization vector is obtained by summing the magnetization direction vectors of all grid points within the magnetic block corresponding to each cluster center. The total magnetization vector is normalized to obtain the updated magnetization directions of the cluster centers; Repeat the assignment and update steps until the clustering results converge; The clustering result is considered converged when the clustering affiliation of grid points no longer changes in two consecutive iterations.

[0036] The vector summation operation sums the components of the magnetization direction vectors of all grid points within the magnetic block along the three coordinate axes. If the magnetic block contains several grid points, the magnetization direction vector of each grid point is represented as a three-dimensional vector. The three components of the total magnetization vector are equal to the arithmetic sum of the components of the magnetization direction vectors of all grid points in their corresponding directions. Vector summation preserves the spatial orientation information of the magnetization direction. Unlike scalar averaging, which only calculates the numerical magnitude, vector summation considers the relative orientation relationship of each magnetization direction vector. When the magnetization directions of all points within the magnetic block are highly consistent, the magnitude of the total magnetization vector obtained by vector summation is close to the number of grid points. When the magnetization directions within the magnetic block are dispersed, the components in opposite directions cancel each other out, resulting in a decrease in the magnitude of the total magnetization vector. The normalization process divides the total magnetization vector by its magnitude to convert it into a unit vector, eliminating the magnitude information and retaining only the orientation information. The updated magnetization direction of the cluster center represents the average orientation of the magnetization directions of all grid points within the magnetic block.

[0037] The iterative process gradually optimizes the clustering results by repeatedly executing allocation and update steps. In the allocation step, grid points are reassigned based on the current cluster center magnetization direction. In the update step, the cluster center magnetization direction is recalculated based on the new point set. Each iteration enhances the consistency of magnetization direction within a block and improves clustering quality. Convergence is determined by comparing the clustering status of grid points in two consecutive iterations. The cluster center number of each grid point in the current iteration is recorded, and the assignment number is recorded again after the next iteration. The two records are compared point by point. If the assignment numbers of all grid points are the same, convergence is determined. Convergence indicates that the clustering results have reached a stable state, and continued iteration will not change the block division results. At this point, the grid points within each block have similar magnetization directions and are spatially connected. The cluster center magnetization direction accurately represents the average magnetization direction of the block, providing an optimized initial block set for subsequent secondary segmentation and average magnetization direction calculation.

[0038] In one specific embodiment, step S4 includes: Calculate the coordinate range of the spatial position coordinates of all grid points contained in each magnetic block in three directions to obtain the spatial dimensions of the magnetic block in three directions; Determine whether the spatial dimensions of the magnetic block in three directions exceed the upper limit of the magnetic block size, and determine the directions of the exceeding dimensions; Establish a dividing plane at the midpoint of the coordinate range along the out-of-limit dimension direction, and divide the grid points contained in the magnetic block into two subsets according to their coordinate values ​​in the out-of-limit direction; Perform spatial connectivity checks on the partitioned subsets, treat each connected component as an independent sub-block, and recursively perform partitioning on sub-blocks that still exceed the size limit until all sub-blocks satisfy the size constraint.

[0039] The coordinate range calculation involves traversing all grid points contained in the magnetic block to extract the minimum and maximum values ​​of its spatial coordinates. This is calculated along each of the three coordinate axes. The coordinate range in a given direction equals the maximum coordinate value minus the minimum coordinate value; this difference represents the spatial dimension of the magnetic block in that direction. The judgment operation compares the spatial dimensions of the magnetic block in each of the three directions with the corresponding upper limit of 300 millimeters. If the dimension in any direction exceeds 300 millimeters, the magnetic block needs to be segmented. The exceeding dimension may occur in a single direction or multiple directions simultaneously; the direction with the greatest degree of exceeding the limit is prioritized for segmentation. The segmentation plane is located at the midpoint of the coordinate range in the exceeding direction. The coordinates of this midpoint are equal to half the sum of the maximum and minimum coordinate values. The segmentation plane is perpendicular to the exceeding direction and passes through the midpoint, dividing the three-dimensional space into two half-spaces.

[0040] The classification of grid points is determined based on the relationship between their coordinate values ​​in the out-of-limit directions and their positions on the dividing plane. Grid points with coordinate values ​​less than their positions on the dividing plane are assigned to the first subset, while those with coordinate values ​​greater than or equal to their positions on the dividing plane are assigned to the second subset. Spatial connectivity is checked using a depth-first search or breadth-first search algorithm to identify connected components in the grid topology. An unvisited grid point is randomly selected from the subset as the starting point, and all reachable grid points are traversed through adjacency relationships and marked as visited. These reachable points constitute a connected component. This process is repeated until all points in the subset have been visited, and each connected component is considered an independent sub-block. Recursive partitioning recalculates the spatial dimensions of each sub-block. If out-of-limit directions still exist, the sub-block is partitioned again. The recursion terminates when the spatial dimensions of all sub-blocks in all three directions do not exceed 300 millimeters. The recursive partitioning process ensures that the partitioning results satisfy both size constraints and maintain the spatial connectivity of each block. Furthermore, since the magnetization direction angle of the grid points within the original block is less than 35 degrees, the partitioned sub-blocks inherit this characteristic, and the consistency of magnetization direction is not compromised.

[0041] In one specific embodiment, a three-dimensional geometric model is established for each final magnetic block, specifically including: Extract the set of spatial coordinates of all grid points contained in each final magnetic block; The Alpha shape algorithm is used to process the set of spatial position coordinates. Tetrahedral meshes are generated by Delaunay tetrahedral subdivision. Tetrahedrals with circumscribed sphere radii less than or equal to the Alpha parameter value are retained. The outer surface triangular facets of the retained tetrahedral set are extracted to obtain the geometric model of the outer surface of the magnetic block. Analyze the geometric complementary relationship between the surfaces of adjacent magnetic blocks, identify the raised areas on the outer surface of the magnetic block and the corresponding recessed areas on the outer surface of the adjacent magnetic blocks, and mark the surface areas with nested relationships; The geometric model of the outer surface of the magnetic block and the nested positioning features are exported as a 3D modeling format file. The raised areas and the recessed areas of the adjacent magnetic blocks are nested to form geometric constraints to achieve self-positioning of the assembly.

[0042] The spatial coordinate set contains the coordinates of all grid points within the final magnetic block in a three-dimensional Cartesian coordinate system. This set serves as the point cloud data input to the Alpha shape algorithm for three-dimensional surface reconstruction. Delaunay tetrahedron partitioning is a classic algorithm in computational geometry that partitions a discrete set of points in three-dimensional space into non-overlapping tetrahedral units. Each tetrahedron consists of four vertices and four triangular faces. The partitioning satisfies the Delaunay criterion, meaning that the circumsphere of any tetrahedron does not contain any other points from the point set. The Alpha parameter controls the level of detail of the reconstructed surface. This parameter is set to 1.5 to 2.5 times the average spacing between grid points. The circumsphere radius of each tetrahedron generated by the partitioning is calculated. Tetrahedrons with a circumsphere radius less than or equal to the Alpha parameter value are retained, while those with a radius greater than the Alpha parameter value are deleted. The retained tetrahedron set constitutes the solid part of the magnetic block. The outer surface extraction operation identifies the triangular face with only one adjacent tetrahedron as the outer surface. These triangular faces are pieced together to form the geometric model of the outer surface of the magnetic block, represented as a triangular mesh data structure.

[0043] Geometric complementarity analysis identifies protrusions and depressions by calculating the distance and normal direction between triangular facets on the surfaces of adjacent magnetic blocks. For a triangular facet on the surface of a magnetic block, its normal vector points outward. If the distance between this facet and the corresponding facet on the surface of an adjacent magnetic block is less than a set threshold and the normal vectors of the two facets are in opposite directions, a nesting relationship is determined. A protruding region is the outward-protruding part of the magnetic block surface, with its normal vector pointing outward and its local curvature positive. A depressed region is the inward-recessed part of the magnetic block surface, with its normal vector pointing inward and its local curvature negative. The protruding and depressed regions of adjacent magnetic blocks correspond in spatial position and are complementary in shape. The labeling operation adds attribute labels to facets with nesting relationships in the triangular mesh data structure, recording the geometric parameters of the nesting features, including protrusion depth, depression depth, and matching area. The 3D modeling file uses STL format or other standard formats, containing complete surface geometry information and nested positioning feature annotations of the magnetic block. During assembly, the raised area is embedded into the recessed area of ​​the adjacent magnetic block. The geometric matching of the two provides positional and directional constraints, reducing the difficulty of assembly alignment and enabling accurate installation of the magnetic block without the need for precision positioning tools.

[0044] Figure 3 This is a schematic diagram of a three-dimensional geometric model of a magnetic block in an embodiment of this application. Figure 3As shown, the magnetic block is generated using the Alpha shape algorithm based on the set of spatial coordinates of grid points. The geometric model consists of triangular facets, demonstrating the triangular mesh structure of the outer surface of the magnetic block. The shape of the magnetic block exhibits irregular three-dimensional curved surface features, including complex geometric features such as protrusions and depressions. These irregular shapes are naturally determined by the clustering and segmentation results of the magnetization direction. The protruding and concave regions of adjacent magnetic blocks can nest with each other to form geometric constraints, providing a structural basis for self-positioning during assembly.

[0045] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering, characterized in that, The method includes: Step S1: Perform magnetic field inversion calculations based on the plasma confinement requirements of the stellarator, establish a grid in the directions of the poloidal angle theta and the circumferential angle zeta, and obtain a grid point dataset, which includes position coordinates and magnetization direction vectors; Step S2: Measure the similarity of magnetization directions by the angle between two unit vectors of magnetization directions, and set the threshold for similarity of magnetization directions and the upper limit for the size of the magnetic block; Step S3: Using a clustering algorithm, the grid point dataset is divided into several magnetic blocks based on magnetization direction similarity, spatial connectivity, and size constraints. This ensures that the angle between the magnetization directions of any two points within the same magnetic block is less than the similarity threshold and that they are spatially connected, thereby obtaining a set of magnetic blocks. Step S4: Perform secondary division on the magnetic blocks in the magnetic block set whose spatial size exceeds the upper limit of the size to obtain the final magnetic blocks that meet the size constraints, and calculate the average magnetization direction of each final magnetic block.

2. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 1, characterized in that, Step S1 includes: Based on the plasma equilibrium equation and stability conditions, the magnetic field inversion calculation of the permanent magnet design area is performed to obtain the theoretical optimal magnetization direction at each spatial location point. The range of polar angle from zero to twice pi is divided into equally spaced polar nodes, and the range of circumferential angle from zero to twice pi is divided into equally spaced circumferential nodes to establish a mesh topology. For each node in the mesh, calculate its spatial position coordinates in a three-dimensional Cartesian coordinate system and its corresponding magnetization direction vector. Then, normalize the magnetization direction vector to obtain a unit magnetization direction vector. Construct the grid point dataset, which records the spatial coordinates and unit magnetization direction vector of each grid point, and define the set of adjacent points of each grid point, including the four adjacent grid points.

3. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 1, characterized in that, In step S2, the measurement of magnetization direction similarity by the angle between two unit vectors of magnetization directions includes: Extract the unit magnetization direction vector for any two grid points; The cosine of the angle between two unit magnetization direction vectors is calculated using the vector dot product operation. The magnetization direction angle is obtained by processing the cosine value of the included angle using the inverse cosine function; The similarity of the magnetization directions of two grid points is determined by the angle between the magnetization directions. The smaller the angle between the magnetization directions, the higher the similarity of the magnetization directions.

4. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 3, characterized in that, In step S2, setting a magnetization direction similarity threshold includes: A trade-off analysis was conducted based on the magnetic field accuracy requirements and the complexity of manufacturing and assembly. When a more accurate magnetization direction is required, set a smaller threshold range, typically 20 to 30 degrees; when a reduction in the number of magnets is required, set a larger threshold range, typically 40 to 50 degrees. Taking into account the magnetic field accuracy requirements, the similarity threshold of the magnetization direction is determined, with a typical value of thirty-five degrees; The angle between the magnetization directions of any two grid points within the same magnetic block must be less than the magnetization direction similarity threshold.

5. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 4, characterized in that, In step S2, setting the upper limit of the magnetic block size includes: Obtain the forming space parameters of the additive manufacturing equipment; The maximum size limit of the magnetic block in the three coordinate axes is determined based on the molding space parameters. The maximum size limit is set to a typical value of 300 mm by 300 mm by 300 mm; The spatial dimensions of each magnetic block are constrained to not exceed the upper limit of the magnetic block size, ensuring that the magnetic blocks are formed in one step by additive manufacturing equipment.

6. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 1, characterized in that, Step S3 includes: An improved K-means clustering algorithm is used to initialize the magnetization directions of several cluster centers; In the allocation step, the angle between the unit magnetization direction vector of each grid point and the magnetization direction of each cluster center is calculated, and the cluster center with the smallest angle is selected as the candidate cluster center. Determine whether the included angle of the magnetization direction of the grid points is less than the similarity threshold, and determine whether the grid points are spatially connected to the set of points assigned to candidate cluster centers in the grid topology. When both the magnetization direction similarity and spatial connectivity conditions are met, the grid points are assigned to the candidate cluster centers to obtain the set of magnetic blocks.

7. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 6, characterized in that, The step of determining whether the grid point is spatially connected to the set of points already assigned to candidate cluster centers in the grid topology includes: Get the set of adjacent points of a grid point; Determine whether there exists at least one point in the set of adjacent points that belongs to the set of points already assigned to candidate cluster centers; When at least one point in the set of adjacent points belongs to the set of points already assigned to candidate cluster centers, it is determined that the grid point is spatially connected to the set of points already assigned. When there are no points in the set of adjacent points that belong to the set of points already assigned to candidate cluster centers, it is determined that the grid points are not spatially connected to the set of points already assigned.

8. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 6, characterized in that, Step S3 further includes updating the cluster center magnetization direction: The total magnetization vector is obtained by summing the magnetization direction vectors of all grid points within the magnetic block corresponding to each cluster center. The total magnetization vector is normalized to obtain the updated cluster center magnetization direction; Repeat the assignment and update steps until the clustering results converge; The clustering result is considered converged when the clustering affiliation of grid points no longer changes in two consecutive iterations.

9. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 1, characterized in that, Step S4 includes: Calculate the coordinate range of the spatial position coordinates of all grid points contained in each magnetic block in three directions to obtain the spatial dimensions of the magnetic block in three directions; Determine whether the spatial dimensions of the magnetic block in three directions exceed the upper limit of the magnetic block size, and determine the directions of the exceeding dimensions; A dividing plane is established at the midpoint of the coordinate range along the dimensional direction of the over-limit, and the grid points contained in the magnetic block are divided into two subsets according to their coordinate values ​​in the over-limit direction; Perform spatial connectivity checks on the partitioned subsets, treat each connected component as an independent sub-block, and recursively perform partitioning on sub-blocks that still exceed the size limit until all sub-blocks satisfy the size constraint.

10. The method for segmenting complex curved surface permanent magnets in stellarators based on magnetization direction clustering according to claim 9, characterized in that, This also includes creating a three-dimensional geometric model for each final magnetic block, specifically including: Extract the set of spatial coordinates of all grid points contained in each final magnetic block; The set of spatial coordinates is processed using the Alpha shape algorithm. A tetrahedral mesh is generated by Delaunay tetrahedron subdivision. Tetrahedrons with a radius of circumscribed sphere less than or equal to the Alpha parameter value are retained. The outer surface triangular facets of the retained tetrahedron set are extracted to obtain the geometric model of the outer surface of the magnetic block. Analyze the geometric complementary relationship between the surfaces of adjacent magnetic blocks, identify the raised areas on the outer surface of the magnetic block and the corresponding recessed areas on the outer surface of the adjacent magnetic blocks, and mark the surface areas with nested relationships; The geometric model of the outer surface of the magnetic block and the nested positioning features are exported as a three-dimensional modeling format file. The raised area and the recessed area of ​​the adjacent magnetic block are nested with each other to form geometric constraints to achieve self-positioning of the assembly.