In this tutorial, an existing finite element model of a simple cantilever beam is used to demonstrate how to reduce the finite element model using static reduction and also how to perform topology optimization on that reduced model. The full cantilever beam model without static reduction is shown here.
Cantilever beam model.
The optimization problem may be stated as:
Objective:
|
Minimize compliance.
|
Constraints:
|
Upper bound constraint of 40% for the designable volume.
|
Design variables:
|
The density for each element in the design space.
|
Topology optimization results for the full cantilever beam model.
The part to be reduced out of the model through the static reduction model reduction technique is referred to as a superelement. In OptiStruct, ASET or ASET1 bulk data entries are required to indicate the boundary degrees of freedom of a superelement, meaning the set of degrees-of-freedom where the component (being replaced by direct matrix input) connects to the modeled structure. Both the accuracy and the cost of static reduction increase as the number of ASET entries is increased. For example, by using static reduction, the size of the matrix to solve will become smaller, but if the reduced matrix (DMIG) is very dense, then the solution time will become larger than the solution time for the full model where the matrix may be sparse. Hence, the selection of ASET entries is very important in performing an efficient analysis using DMIG.
In order to prevent the reduced matrix from being too dense, ASET entries are chosen carefully (see the next figure) instead of creating ASET entries for all of the boundary nodes between the design and non design spaces. Due to the small size of the problem used for this tutorial, the selection of ASET entries may not affect the solution time.
ASET for the cantilever beam model.
In this tutorial, you will learn to:
• | Include the superelement in the model |
• | Set up the optimization in a model with a superelement |
• | Post-process the optimized results in HyperView |
Exercise
Step 1: Launch HyperMesh and Set the User Profile
1. | Launch HyperMesh Desktop. |
2. | A User Profiles dialog will appear, select OptiStruct. |
3. | Click OK. This loads the user profile. It includes the appropriate template, macro menu, and import reader, paring down the functionality of HyperMesh to what is relevant for generating models for OptiStruct. |
Step 2: Retrieve the cantilever_full.hm File
1. | Click the Open Model icon and load the cantilever_full.hm file you saved to your working directory from the optistruct.zip file. Refer to Accessing the Model Files. |
Complete model.
Generate a Superelement
Step 3: Create ASETs (specifying boundary degrees of freedom of the superelement assembly)
1. | In the Model browser, right-click and select Create > Load Collector. |
3. | For Card Image, select None. |
4. | From the Analysis page, select constraints. |
5. | Select the create subpanel using the radio buttons on the left-hand side of the panel. |
6. | Select the boundary nodes (as shown in the image before step 1) by clicking in the graphics window. |
7. | Make sure dofs 1 through 6 are checked. |
Dofs with a check will be assigned to the ASET.
Dofs 1, 2, and 3 are x, y, and z translation degrees of freedom.
Dofs 4, 5, and 6 are x, y, and z rotational degrees of freedom.
8. | Click Load Type= and select ASET. |
10. | Click return to go to the main menu. |
Step 4: Delete Elements Which will be Retained in the Subsequent Optimization
The reduced stiffness matrix and load vector will be generated for only those elements that will be reduced out (superelement). Therefore, a new model needs to be created containing just the superelement part and the loads and boundary conditions applied directly to that part.
1. | Press F2 to open the Delete panel. |
2. | Click the entity selection switch and select elems from the pop-up menu. |
3. | Click elems and select by window from the pop-up menu. |
4. | Move the mouse over to the graphics area and draw a window around the elements, as shown in the figure below. |
Elements to be deleted.
6. | Click return to go to the main menu. |
Step 5: Define a Parameter to Write out Reduced Matrices to an External File
The PARAM,EXTOUT bulk data entry is required to activate the matrix save process. Without this parameter, the run will proceed as normal. This parameter has two options: DMIGPCH, which will save the matrices in an ASCII format to a .pch file and DMIGBIN, which will save the matrices in a binary format to a .dmg file. DMIGPCH is used for this tutorial.
1. | On the Analysis page, select the control cards panel. |
2. | Click next twice to be able to select PARAM, check the box next to EXTOUT. |
4. | Click return to exit PARAM. |
5. | Click return to get back to the main menu. |
Step 6: Save the DMIG Database
1. | Click File > Save As > Model, set the directory in which to save the file and, in File name:, enter cantilever_dmig.hm. |
Step 7: Run the Analysis
1. | From the Analysis page, select the OptiStruct panel. |
2. | Click save as following the input file: field. |
3. | Select the directory where you would like to write the file and enter the name cantilever_dmig.fem in the File name: field. |
The name and location of the cantilever_dmig.fem file displays in the input file: field.
5. | Set the export options: toggle to all. |
6. | Set the run options: toggle to analysis. |
7. | Set the memory options: toggle to memory default. |
8. | Click OptiStruct. This launches the OptiStruct job. |
If the analysis is successful, no error messages are reported to the shell. The analysis is complete when the message Processing completed successfully appears in the shell. The new results files can be seen in the directory where the OptiStruct model file was written. The cantilever_dmig.out file is a good place to look for error messages that will help to debug the input deck if any errors are present.
The default files written to the directory are:
cantilever_dmig.out
|
OptiStruct output file containing specific information on the file set up, the set up of your optimization problem, estimates for the amount of RAM and disk space required for the run, information for each optimization iteration, and compute time information. Review this file for warnings and errors.
|
cantilever_dmig_AX.pch
|
Reduced matrices (DMIG) file.
|
cantilever_dmig.stat
|
Summary of analysis process, providing CPU information for each step during analysis process.
|
The matrices are written to the .pch file with the same format as the DMIG bulk data entry. They are defined by a single header entry and one or more column entries. By default, the name of the stiffness matrix is KAAX, the mass is MAAX, and the load is PAX. Since mass matrix is not used in this tutorial, it is not written to .pch file.
The I/O Option entry, DMIGNAME, provides you with control over the name of the matrices.
Step 8: Clear the HyperMesh Database
1. | From the File menu, click New. |
This will clear the existing HyperMesh database.
Include the Superelement in the Model
Step 9: Re-retrieve the cantilever_full.hm file
1. | Click File > Open > Models. |
2. | Browse to locate the file cantilever_full.hm. |
The cantilever_full.hm database is loaded into the current HyperMesh session, replacing any existing data.
Step 10: Delete the Superelement Part Reduced out Using DMIG
Since the matrices for the superelement part will be replaced by DMIG, the bulk data entries for the nodes and elements, as well as all loads and boundary conditions that are in the superelement, should be deleted.
1. | Press F2 to open the Delete panel. |
2. | Click the entity selection switch and select elems from the pop-up menu. |
3. | Click elems and select by window from the pop-up menu. |
4. | Move the mouse over to the graphics area and draw a window around the elements, as shown in the following figure. |
The elements to be deleted.
All of the loads and boundary conditions associated with those elements will be deleted automatically.
6. | Click return to go to the main menu. |
Step 11: Set up the Topology Optimization with DMIG
1. | On the Analysis page, select the control cards panel. |
3. | Enter the file name cantilever_dmig_AX.pch. |
The reduced matrices (DMIG) will be included in OptiStruct input deck. Here you are assuming that the topology optimization will be run in the same folder as the cantilever_dmig_AX.pch file. If you plan to run it in a different folder, then define the full path of this file.
4. | Click return to exit INCLUDE_BULK. |
6. | Enter KAAX in the K2GG= field. This specifies that the reduced stiffness matrix with the name KAAX has to be used (stored in the cantilever_ dmig_AX.pch file). |
7. | Click return to exit K2GG subpanel. |
8. | Select the P2G subpanel. |
9. | Enter PAX in the P2G= field. |
10. | Click return to exit P2G. |
11. | Click return to go to the main menu. |
Set up the Optimization in a Model with a Superelement
Step 12: Define Design Variables for Topology Optimization
1. | On the Analysis page, select the optimization panel. |
2. | Go to the topology panel. |
3. | Select the create subpanel using the radio buttons on the left-hand side of the panel. |
4. | Click desvar = and enter topo. |
6. | Check the box next to design. |
8. | Set the type toggle to PSHELL. |
11. | Toggle minmemb off to mindim = and enter 1.2. |
13. | Click return to go back to the optimization page. |
Step 13: Create Volume Fraction and Compliance Responses
2. | Enter Volfrac in the response = field. |
3. | Set the switch below response type to volumefrac. |
5. | Enter Compl in the response = field. |
6. | Turn the response type selector to compliance. |
Just eight characters can be used here, since the name is used, a label is needed for the response.
8. | Click return to go back to the optimization panel. |
Step 14: Create Constraints on Volume Fraction
1. | Click dconstraints to define the constraints. |
2. | Enter VFrac in the constraint = field. Only eight characters can be used here. Since the name is used, a label is needed for the response. |
3. | Click response = and select Volfrac. |
4. | Select upper bound = by clicking in the box preceding it. |
5. | Click in the text box and enter the value 0.4. |
6. | Click create. The volume fraction constraint is now created. |
7. | Click return to go back to the optimization panel. |
Step 15: Define Minimize Compliance as Objective
1. | Click objective to define the objective function. |
2. | Set the switch in the upper left corner to min. |
3. | Click response and select Compl. |
5. | Select the loadstep step. |
7. | Click return twice. This completes your optimization problem setup. |
Step 16: Save the Database
1. | Click File > Save As > Model. |
2. | Set the directory in which to save the file and, in File name:, enter cantilever_opti.hm. |
Step 17: Run the Optimization
1. | From the Analysis page, select the OptiStruct panel. |
2. | Click save as following the input file: field. |
3. | Select the directory where you would like to write the file and enter the name cantilever_opti.fem in the File name: field. |
The name and location of the cantilever_opti.fem file displays in the input file: field.
5. | Set the export options: toggle to all. |
6. | Click the run options: switch and select optimization. |
7. | Set the memory options: toggle to memory default. |
8. | Click OptiStruct. This launches the OptiStruct job. |
If the job was successful, new results files can be seen in the directory where the OptiStruct model file was written. The cantilever_opti.out file is a good place to look for error messages that will help to debug the input deck if any errors are present.
The default files written to the directory are:
cantilever_opti.hgdata
|
HyperGraph file containing data for the objective function, percent constraint violations, and constraint values for each iteration.
|
cantilever_opti.HM.comp.cmf
|
HyperMesh command file used to organize elements into components based on their density result values.
|
cantilever_opti.HM.ent.cmf
|
HyperMesh command file used to organize elements into entity sets based on their density result values.
|
cantilever_opti.html
|
HTML report of the optimization giving a summary of the problem formulation and the results from the final iteration.
|
cantilever_opti.oss
|
OSSmooth file with a default density threshold of 0.3. You may edit the parameters in the file to obtain the desired results.
|
cantilever_opti.out
|
OptiStruct output file containing specific information on the file set up, the set up of the optimization problem, estimates for the amount of RAM and disk space required for the run, information for all optimization iterations, and compute time information. Review this file for warnings and errors.
|
cantilever_opti.res
|
HyperMesh binary results file.
|
cantilever_opti_des.h3d
|
HyperView binary results file to post-process element density for topology optimization.
|
cantilever_opti_s1.h3d
|
HyperView binary results file to post-process anything from displacement to stress results.
|
cantilever_opti.sh
|
Shape file for the final iteration. It contains the material density, void size parameters, and void orientation angle for each element in the analysis. The .sh file may be used to restart a run and, if necessary, run OSSmooth files for topology optimization.
|
cantilever_opti.stat
|
Summary of analysis process providing CPU information for each step during analysis process.
|
Post-process the Optimized Results in HyperView
Element density and element thickness results are output from OptiStruct for all iterations. In addition, displacement and stress results are output for the first and last iteration by default. This section describes how to view those results in HyperView.
Step 18: Contour Plot of Element Densities
1. | From the OptiStruct panel, click HyperView. |
2. | Click the Contour panel toolbar icon . |
3. | Under Result type:, select Element densities (s) from the drop-down list and review the Density component. |
4. | In the Averaging method: field, select Simple. |
6. | Click to choose the last iteration from the Simulation list. |
The resulting contours represent the element densities field resulting from the applied loads and boundary conditions.
Step 19: Add an Iso Surface Plot of the Densities
The iso surface feature can be a very useful tool for post-processing density results from OptiStruct. For models with solid design regions, this feature becomes a vital tool for analyzing density results.
1. | Click the Iso toolbar icon . |
2. | Set the Result type: to Element densities (s). |
3. | Make sure that Show is set to Above. |
5. | Also check the boxes next to Features and Transparent. |
6. | The current value can be changed to see more material. Enter a value of 0.3 in the Current value: field. |
You can also move the slider bar to change current value of Element densities.
The isosurface post-processing feature in HyperView is an excellent tool for viewing the density results from OptiStruct.
Click and move the slider bar (currently pointing to a value representing 0.3) for your density to change the isosurface.
The isosurface is available in the graphics window interactively update when you change it to a new value. Use this tool to get a better look at the material layout and the load paths from OptiStruct.
See Also:
OptiStruct Tutorials