Topology optimization in Flux 2D

The set of structural optimization functions provided in Flux has been improved and expanded in version 2023.1 to include Topology optimization tools for the design of electromagnetic devices.

Introduction

In version 2023.1, Flux 2D provides its users with novel topology optimization tools for the design of electromagnetic devices. This new toolset complements the free-shape optimization functions already available in Flux 2D, allowing electromagnetic designers to benefit even further from the state-of-the-art structural optimization methods offered by the Flux-OptiStruct coupling.

In Free-shape optimization, the boundaries of selected parts of an initial design are iteratively displaced and modified by the procedure. The result is an improved shape that satisfies the optimization criteria and that usually resembles the original design. Topological optimization methods, on the other hand, are based upon the addition or removal of the matter composing the parts being optimized. This process is governed by the evolution of the values of a material density function throughout the optimization procedure, and frequently leads to quite innovative shapes that may not have been previously considered. Figure 1 illustrates both approaches in the simple case of the optimization of a beam.



Figure 1. Comparison of free-shape (a) and topology (b) optimization strategies in a simple structural mechanics example (the structural optimization of a beam).
This powerful new feature is now available in Beta mode and may be applied in the optimization of a broad range of electromagnetic devices (including rotating machinery and actuators). Its use is outlined in the next sections of the documents, which cover the following topics:

Topology optimization strategies implemented in Flux 2D

Two well-known topology optimization strategies for electromagnetic devices are available in Flux 2D through a coupling with OptiStruct, namely:
  • the Density method and
  • the LevelSet method.
For an introduction on these gradient-based methods, please refer to the following open access reference:

F. Lucchini, R. Torchio, V. Cirimele, P. Alotto and P. Bettini, "Topology Optimization for Electromagnetics: A Survey," in IEEE Access, vol. 10, pp. 98593-98611, 2022, doi: 10.1109/ACCESS.2022.3206368.

How to create a topology optimization problem?

In spite of their diverse underlying principles, free-shape optimization and topological optimization may be regarded as complementary techniques and belong to the same framework of structural optimization methods offered in Flux 2D.
Consequently, they share common tools for the description of an optimization problem, as shown in Figure 2. These are accessible through the SolverOptimization branch of the Data tree.


Figure 2. The structural optimization tools available in the Flux 2D Data Tree (highlighted inside the red rectangle). These tools are used to describe both free-shape optimization (previously available in Flux) and topological optimization problems.
Remember: For further details concerning the creation and configuration of all the entities occurring in the previous steps, the user may refer to the illustrated documentation embedded in each dialog box. Additionally, the user may also refer to the existing user guide pages on Free-Shape optimization.
Remember: The topology optimization tools are made available in Beta mode. A more comprehensive discussion on their use will be available in the user guide in an upcoming Flux version.

Users that are familiar with the free-shape optimization tools in Flux 2D should not experience difficulties to create a topology optimization problem. The creation workflow is as follows:
  1. Launch Flux 2D in Beta mode or in Advanced mode. To select one of these user modes, before executing Flux 2D, click the Options button in Flux Supervisor. Then, in System, select User mode and set the desired option.
  2. Create a project representing a first design of the device to be optimized. The project must satisfy the following rules:
    • The project application must be either the Magneto Static or Transient Magnetic application.
    • The geometry must be meshed. Moreover, the mesh must be very refined.
      Remember: Flux 2023.1 also provides a new Macro (MeshingForMechanicalOptim.PFM) that helps users obtain a suitable mesh. For further information, check the page New and Updated Macros of this release note.
    • It must have a coherent physical description (verifiable through the Check Physics command).
    • The project must be ready to be solved, i.e., it must contain a fully defined Solving scenario.
  3. Then, proceed to create one or more Responses by clicking the corresponding node of the Data tree. Responses may be regarded as physical quantities (magnetic flux, torque, force, volume, etc.) used to describe to optimization goals or constraints in the optimization problem.
  4. Similarly, create one or more Constraints by clicking the corresponding node of the Data tree. Constraints may be physical or geometrical in nature and are required to fully define the optimization problem.
  5. Create a structural mechanics problem (which may be regarded as a complementary constraint) by clicking the following nodes of the Data tree:
    • Mechanical regions.
    • Mechanical boundary conditions.
    • Mechanical problem.
    Important: The possibility of describing a Mechanical problem to further constrain the structural optimization procedure itself is a new feature that was not available in previous Flux versions. It may also be used with free-shape optimization problems and not only with topology optimization. For a comprehensive discussion on this new feature, please refer to the following chapter of this release note: Mechanical problems for free-shape and topology optimization in Flux 2D.
    Important: The description of a mechanical problem is not mandatory, but is highly advisable for obtaining more realistic, mechanically compliant and manufacturable shapes as a result.
  6. Click the Optimization problem node of the Data tree to describe the topology optimization problem. Flux asks for the type of optimization (Minimization or Maximization), for the optimization goals (one or more of the previously created Responses), for one or more of the available Constraints and for an optional Mechanical problem definition.
  7. Finally, configure the Optimization options:
    • In the General tab and
    • In the Topology optimization tab.

How to solve a topology optimization problem in Flux 2D?

After completing the steps outlined in the previous section, the description of the optimization problem is complete. Then, to run the topology optimization procedure:

  • While in pre-processing, click the Solving menu;
  • Select the command Run Topology Optimizaton.

At this point, Flux 2D will display the Run Topology Optimizaton dialog box and ask for the following data:



Figure 3. The Run Topology Optimization dialog box.
  • The Faces to optimize, i.e., a list of geometrical faces representing the parts of the device that will be subjected to optimization.
  • The Solving scenario previously created;
  • The name of the Working directory that will store data generated by the Flux-OptiStruct coupling during the optimization procedure;
  • The Optimization problem previously described;
  • The Topology optimization method to be employed. Two options are available from the drop-down menu:
    • the Density method and
    • the LevelSet method.

Once all the required data has been provided, click OK to launch the topology optimization. Flux 2D will them invoke the OptiStruct coupling and a new window will appear, displaying the OptiStruct iterations until convergence (or until the maximum number of iterations configured in the Optimization options has been reached).

Note: It is possible to interrupt the optimization during its execution by simply closing the OptiStruct window displaying the iterations.
Important: Before running the topological optimization in a project, verify if OptiStruct was properly installed in your system and if Flux Supervisor was correctly configured with its path. Further information is available in the section Software requirements.

How to explore the results of a topology optimization problem?

Once the topology optimization is completed, Flux 2D will write the following outputs in the Working directory configured by the user:
  • A new Flux 2D project containing the optimized design. This project has the following properties:
    • This project may or may not be automatically opened in a new instance of Flux 2D at the end of the optimization, depending on the settings configured in the Optimization options (as discussed in step 7 of the previous section).
    • The new project has its name derived from the name of the initial project (the string _OptimizationResults is appended to the original project name).
    • That project contains the design that results from the topology optimization, considering the default Density threshold configured in the Optimization options (see step 7 of the previous section).
      Note: In the topology optimization procedure, the material density is a real-valued function in the range [0,1] defined on the faces subjected to optimization. The Density threshold is the lowest density value for which the material is considered present in a given design.
      Note: To make sure that the design resulting from the topology optimization is properly displayed in the new Flux project, it is mandatory to click the button Display or hide face elements available in the Flux 2D toolbar after its opening.
    • The scenario provided for the execution of the command Run Topology optimizaton is solved in the new project. Consequently, it is ready for post-processing, allowing the user to evaluate electromagnetic quantities to verify if the optimization goals and constraints have been satisfied.
  • An H3d file (with .h3d extension) representing the evolution of the optimized design through the optimization procedure. This file may be opened in Altair SimLab and has the following properties:
    • Its name is derived from the name of the initial project used to launch the topology optimization (the string _des is appended to the original project name).
    • It may be used to display in SimLab a graphical representation of the design at each optimization step. More precisely, it allows viewing a color map representing the material density function on the faces subjected to optimization at each optimization step.
    • It may also be used to explore the effect of changing the material Density threshold at each optimization step, including the final design. This may be achieved with the aid of Shape Explorer tool available in SimLab. Analyzing the results this way is useful to explore the impact of that threshold in the final design yielded by the optimization.
    • The H3d file may be previewed and analyzed in SimLab during the optimization process, before it reaches its end.
The Density threshold may also be modified in the project containing the topology optimization results to generate variations of the final design. To modify this threshold and generate a new project with a variant design:
  • In the project with the topology optimization results, click the Solving menu.
  • Select the command Explore topologies from optimization results.
  • In the Explore topologies from optimization results dialog box:
    • Provide a name for the new project (the project is overwritten with the new design if no name is provided)
    • Provide the new value for the density threshold in the field.
  • After confirming the threshold modification, Flux will update the design.
    Note: After updating the design with a new density threshold, the user needs to re-solve the scenario to post-process the results.

Example of application

Let's consider the conception of the rotor of a three-phase synchronous reluctance machine.

With the topology optimization tools available in Flux 2D, it is now possible to obtain a rotor design that satisfies a set of specifications using only a rough initial design. In this example, the initial shape is simply a hollow solid cylinder, as shown in Figure 4.



Figure 4. Topology optimization of the rotor of a three-phase synchronous reluctance motor (a) using a hollow solid cylindrical rotor as an initial design (b). The geometrical face subjected to optimization is shown in yellow.

The desired performance specifications need to be translated into a topology optimization problem that tries to maximize the torque of the machine, while satisfying certain constraints. These are summarized in Table 1 below:

Table 1. The design goal and the constraints for designing the rotor of a reluctance machine through topology optimization in Flux 2D.
Objective or Constraint Response or Constraint type Definition
Objective Average torque Maximize
Constraint Von Mises stress Lower than 260 MPa (i.e., 80% of the yield stress value of the electric steel M330_35A used in the rotor)
Constraint Volume Lower than 80% of the initial design volume
Constraint Symmetry 45 degrees symmetry (i.e., with respect to the red dotted line shown in Figure 4).

The topology optimization has been executed on the yellow face shown in Figure 4 using the LevelSet method. A Mechanical problem has also been added to the description in this case to further constrain the topology optimization procedure.

Figure 5a shows the final design obtained after convergence of the topology optimization procedure and compares it to the rotor geometry of a reference machine (Figure 5b). The resulting geometry is quite similar to the reference, showing that the topology optimization techniques may be used efficiently in the conception of rotating electrical machinery.


Figure 5. The material density function of the final design displayed in SimLab (a) compared to the rotor geometry of a reference reluctance machine (b).

Software requirements

As already mentioned, the new topological optimization tools delivered with version 2023.1 rely on a coupling between Flux and OptiStruct. Consequently, to use this feature the following software are mandatory:
  • Altair Flux 2023.1;
  • Altair OptiStruct 2023 or later.
Remember: After completing the installations, check if the path to OptiStruct is correctly configured in Flux Supervisor. To verify this setting:
  • In Flux Supervisor, click the Options button.
  • Then, in Acces paths, select Coupled Software.
  • Check if the field OptiStruct scripts directory is correctly configured:
    • In Windows systems, this field should contain the folder storing the file optistruct.bat. After a standard installation of OptiStruct, that path should be similar to C:\Program Files\Altair\2023\hwsolvers\scripts.
    • Similarly, in Linux systems, this field should contain the subfolder of the OptiStruct installation directory containing the file optistruct.sh.
Additionally, and as discussed in the section How to explore the results of a topology optimization problem?, the user may want to install the latest version of Altair SimLab to exploit the content of the generated H3d files.

Current limitations

This new feature is made available in Flux 2023.1 in Beta mode. Consequently certain limitations still apply. Most of them are related to the type of region to which the faces subjected to topology optimization have been assigned, or to the type of material assigned to those regions. The most important cases are listed below:
  • Unavailable in the following applications:
    • Steady State AC Magnetic;
    • Non-magnetic or coupled applications.
  • The faces being optimized need to be finely meshed. Moreover, the following mesh types are forbidden:
    • Mesh with first order elements;
    • Heterogeneous meshes (i.e., mixing triangles and quadrangles).
  • Axisymmetric domains are not supported yet.
  • It is not possible to perform the topology optimization in Transient magnetic applications with the Initialized by file option.
  • Only faces lying on a Magnetic non conducting regions may be used for topology optimization. Assigning other types of region (such as Air or vacum regions, Regions with current density, Laminated magnetic non conducting regions, Coil conductor regions and Solid conductor regions) to faces make them incompatible with topology optimization in this version.
  • Only faces on regions characterized by materials with simple B(H) magnetic properties may be used (e.g., Linear isotropic, Isotropic analytic saturation, Isotropic analytic saturation + knee adjustment, isotropic spline). Faces in regions with hysteretic, anisotropic and magnet materials are not allowed.