How to post process a Topology Optimization solution?

Introduction

Following the detailed steps for defining Magneto-mechanical Optimization How to create a Magneto-Mechanical Topology Optimization solution?, this page guides users toward the visualization and interpretation of results from various output files. Three main topics are covered:
  • Comparing the electromagnetic torque between the initial Electromagnetic Solution and the Optimized Solution
  • Exploring the different result files generated by both the Flux and OptiStruct solvers
  • Instructions on how users can replace the initial geometry with the optimized geometry

Electromagnetic torque comparison

To compare the electromagnetic torque between initial Electromagnetic Solution and the Optimized Solution, users can follow these steps:

Prerequisites:

  1. Ensure the initial Electromagnetic Solution has been successfully solved.
  2. It is recommended to use File-> Save As (replace the existing .slb file) at this stage to ensure Electromagnetic Solution results are saved.

Once saved, proceed with solving the Optimization Solution.

Locate Result Files (.csv):

Upon completion of the solving Optimization Solution process, right-click on Results and select Open results folder. Make a note of this path, as it indicates where the Optimization runs and where the .csv files are stored.

Note: The previous action must be done before Save As command is used. If this is not the case, right-clicking on Results and selecting Open results folder, the displayed folder will not be the one that the Optimization Solution runs and consequently .csv files are saved.

To workaround this, users must know which folder has been selected to save Solutions solving files.

  1. Right-click on Solutions, select Solution folder and verify the selected option:
    • Database folder: The Optimization solution runs in the same folder as the .slb file.
    • Scratch folder: Optimization solution runs in the directory specified under File-> Preferences-> Scratch directory.
    • Selected folder: Optimization solution runs in a user-define folder.
  2. After validating, which folder is used for saving the solving files, the .csv files are saved in a hierarchical structure under this folder like:

    “Name_Of_slb” (the folder without the “.slb” extension) –> “Name_Of_Optimization_solution” –>“Name_Of_OptiStruct_solution".

To prepare the plot view for comparison:

  1. Click on File-> Save As and replace the existing .slb file to save the current state of Optimization Solution.
  2. Hide the Optimization Solution results by right-clicking on the results display area and selecting Hide results.
  3. Activate the initial Electromagnetic Solution by setting it as current.

Plot the optimized electromagnetic torque:

  1. Navigate to Results-> Plot in the Main menu.
  2. In the Create Curve window, click the folder icon to browse for the .csv file. Locate and select "Name_Of_Flux_Solution.csv" .csv file using the path identified in Locate Result Files paragraph.
  3. In the Define result select Motion folder-> "Name_Of_motion_LBC" and choose either ELTORQ or ELECMAG as the quantity.
  4. Close the Create curve window.

Add the electromagnetic torque from the Electromagnetic Solution:

  1. Click the Add Curve button in the bottom-right corner of the plot window.
  2. From Define Curve section, in the Solution/Data file drop down menu, select the name of the Electromagnetic Solution and follow the same steps as previously to visualize torque.
  3. Close Create Curve window.

Compare Curves:

The initial and the optimized electromagnetic torque can now be compared.

Reviewing results files in the Result panel

Following the solving process, three distinct result files become available in the Result panel. These include one file from the Flux solver (electromagnetic analysis) and two files from the OptiStruct solver (mechanical analysis). Users can display their results by selecting the appropriate file and Result component from the drop-down menu in the Result Panel. (Result Panel)

Note: The names of these result files correspond directly to their respective Solution names. For example, "Name_Of_OptiStruct_Solution_des" and "Name_Of_OptiStruct_Solution_s1" files are produced by OptiStruct solver.
  1. Density File.

    This file contains the element densities determined by the OptiStruct Topology Optimization algorithm. The algorithm assigns a density value to each element, effectively deciding whether it should be material or air, based on the defined Objective and the Response Constraints.

    Visualization of elements:

    • Red elements typically indicate regions identified as material (density value close to 1).
    • Blue elements typically indicate regions identified as air (density value close to 0).
    • Elements with other colors represent intermediate density values, meaning the optimizer has not definitively classified them as either material or air.

    Refining visualization:

    To refine the visualization and focus on specific density ranges, users can navigate to Results-> Shape Explorer in the Main menu. This tool allows displaying only elements identified as material (density value of 1) or elements within a specified intermediate density range (between 1 and the minimum density value calculated by the optimizer). Users can also export in a .STL format the desired geometry after selecting a proper density value/range. This .STL file can be further used to imprint the optimized geometry to the initial one (How to replace initial geometry with the optimized one).

    Note: The OptiStruct solver serves a dual function: it acts as both a mechanical solver and an optimizer for topology studies.
  2. Electromagnetic solution file.

    This file, generated by the Flux solver, contains electromagnetic results based on the chosen solution type and Result Request selections (Common EM Results).

    Key results may include:

    • An (Magnetic Vector Potential)
    • B (Magnetic Flux Density)
    • dLossV (Volume Density of Joule Losses)

    Other results are:

    • Comp(3, J) (Current Density, Z-component)
    • H (Magnetic Field Strength)
    • Mur (Relative Permeability)
    • Rho (Resistivity)
    • Sigma (Conductivity)
    • dEmagV (Volume Density of Magnetic Energy)
    • dFLapV (Volume Density of Laplace Force)

    All these electromagnetic quantities are accessible via the Component drop down menu. For Magneto-mechanical Topology Optimization, the most critical result components are the Magnetic Vector Potential (An), the Magnetic Flux Density (B) and the Volume Density of Joule Losses (dLossV). Topology Optimization aims to modify the structure's volume and/or shape within the design space. This modification directly impacts the distribution of magnetic flux lines within the optimized body. Analyzing Magnetic Flux Density (B) in the final optimized structure is crucial for identifying regions where magnetic flux lines are excessively concentrated, which could lead to core saturation and degraded performance.

  3. Mechanical solution file

    This file, generated by OptiStruct solver, contains mechanical results dependent on the mechanical solution type and Result Request selections. Available result components may include:

    • Displacement
    • Element Stresses(2D_3D)
    • Applied Forces
    • Applied Moments
    • Energy Error Density

    For validating the optimized design, the most important result components are Displacement and Element Stresses (2D_3D). Engineers can use these, among other results, to ensure the optimized body meets structural requirements. For instance, the optimized geometry must not exceed specific stress values defined in the Response Constraint section of the optimization setup.

How to replace initial geometry with the optimized one

After refining the element density range the visualized optimized geometry can be integrated back in the initial Electromagnetic Solution through the following procedure:

  • Export the optimized geometry as an STL file after density range refinement.
  • Duplicate the bodies (.gda) of Electromagnetic Solution.
  • Go to the Main menu and import the .STL file (File->Import->Discrete models). A new assembly with the name of the .STL file will be created.
  • Rename the imported meshed body and then drag and drop it to the duplicated .gda .
  • Go to Main menu and select Geometry->Imprint->Edges on Faces.
    Note: If Imprint tool is not shown, set current the mechanical or the optimization solution
  • Display only the imported optimized geometry and select the edges that will be imprinted
  • Hide the optimized geometry and display the initial faces and select them.
  • Click on OK button
    Note: If the imprinted faces are not visible, point with the cursor these areas.
  • Re-mesh (Main menu->Mesh->Re-mesh).
  • Delete the no needed faces
  • Duplicate the Electromagnetic Solution and assign the updated bodies. Make the necessary modifications (New motion LBC, etc.)
  • Solve the solution
Note: These steps outline the core process for replacing the initial geometry with the optimized one. Depending on the complexity of the geometry, additional steps or adjustments may be necessary (e.g. Mesh editing steps).