Shape optimization requires you to have knowledge of the kind of shape you would like to change in the structure. This may include finding the optimum shape to reduce stress concentrations to changing the cross-sections to meet specific design requirements. Therefore, you need to define the shape modifications and the nodal movements to reflect the shape changes. Shape optimization requires the use of two cards DESVAR and DVGRID. They can be defined using HyperMorph. Then these cards are included in the OptiStruct input file along with the objective function and constraints to run the shape optimization.
In this exercise you perform a shape optimization on a rail-joint. The rail-joint is made of shell elements and has one load case. The shape of the joint is modified to satisfy stress constraints while minimizing mass.
Rail joint
Problem Statement
Objective:
|
Minimize mass
|
Constraint:
|
Maximum von Mises stress of the joint < 200 MPa
|
Design variables:
|
Shape variables
|
In this tutorial, you will learn to:
• | Perform an analysis of the initial design |
• | Post-process the initial design results in HyperView |
• | Setup a shape optimization problem in HyperMesh |
• | Post-process the optimization results in HyperView |
Exercise
Step 1: Launch HyperMesh Desktop, Set the User Profile and Retrieve the File
1. | Launch HyperMesh Desktop. |
2. | Choose OptiStruct in the User Profiles dialog and 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. |
User Profiles GUI can also be accessed from the Preferences menu on the toolbar.
3. | From the File menu on the toolbar, select Open > Model. |
4. | Select the rail_joint_original.hm file you saved to your working directory from the optistruct.zip file. Refer to Accessing the Model Files. |
Performing an Analysis of the Initial Design
Step 2: Run the Baseline Analysis
1. | From the Analysis page, click OptiStruct. |
2. | Click save as, enter rail_joint_original.fem as the file name, and click Save. |
3. | Set the export options: toggle to all. |
4. | Set the run options: toggle to analysis. |
5. | Set the memory options: toggle to memory default. |
6. | The options: field may be blank. |
The message Processing complete appears in the window at the completion of the job. The file rail_joint_original.out can be opened in a text editor to find details regarding any errors. This file is written to the same directory as the .fem file.
8. | Close the DOS window or shell and click return. |
Post-processing Baseline Results in HyperView
Step 3: View the Maximum von Mises Stress
This section describes how to view the results in HyperView which will be launched from within the OptiStruct panel of HyperMesh.
HyperView is a complete post-processing and visualization environment for finite element analysis (FEA), multi-body system simulation, video and engineering data.
1. | When the message Process completed successfully is received in the command window, click the HyperView button. |
HyperView will launch and the results will be loaded. A message window appears to inform about the successful loading of the model and result files into HyperView.
2. | Click Close to close the message window. |
3. | Click the Contour toolbar icon . |
4. | Select the first drop-down menu below Result type: and select Element Stresses [2D & 3D] (t). |
5. | Select the second drop-down and select von Mises. |
von Mises stress for the intial design.
7. | Take note of the Maximum von Mises Stress of the joint and use the Delete Page icon to delete the page with the HyperView client. |
This should return you to Page 1 and the HyperMesh client.
8. | Back in HyperMesh, click return to exit the panel. |
Step 4: Display Node Numbers
1. | From Tool page, select numbers panel. |
2. | Click nodes and select by sets. |
3. | Select node set by clicking the check box to the left of node. |
4. | Click select. Sixteen (16) nodes are highlighted on screen. |
5. | Click on to display node IDs. |
Step 5: Build 2D Domains on the Rail
1. | In the Model browser, expand the Component list. |
2. | Right-click on the component PSHELL and click Isolate. All other components are turned off for ease of visualization. |
3. | From the Analysis page, select the optimization panel. |
4. | Go to the HyperMorph panel and select domains. |
5. | Select the radio button on the left of partitioning. |
6. | Verify that domain angle = 50. |
7. | Verify that curve tolerance = 8.0000. |
8. | Toggle back the radio button to create. |
9. | Click the switch (small triangle) and select 2D domains. |
10. | Toggle all elements to elems. |
11. | Click elems and select by sets from the pop-up window. |
12. | Check the boxes for rail_set1 and rail_set2. |
Rail domains
Step 6: Split the Circular Edge Domains Around the Opening of the Rail
The following steps show the procedure to split each of the two circular domains (as seen in the previous figure) into four curved edge domains.
1. | Select the radio button to edit edges subpanel. |
2. | Verify the top selector is split. |
3. | Click domain and select the circular edge-domain passing through nodes 1300, 1305, 1311, and 1316. |
4. | Click node and select node 1311 from the display. Refer to the previous figure. |
The circular domain is split at Node 1311 and a new handle is created at node 1311.
6. | Select the circular edge between node 1311 and the other handle. The edge is highlighted. |
7. | Click node 1316 to split the domain. |
8. | Similarly (as in step 6.7), split the curved edge at nodes 1305 and 1300, respectively. Refer to the previous figure. |
A similar process is followed to split the circular domain using the four nodes on the other side of the rail.
9. | Click domain and select the circular domain passing through nodes 931, 926, 937 and 942. |
10. | Click node and select node 931 on screen. |
12. | Select the circular edge between node 931 and the other handle. The edge is highlighted. |
13. | Click node 926 to split the domain. |
14. | Similarly (as in steps 6.11 to 6.14), split the curved edge at nodes 937 and 942, respectively. The following figure shows the image after the circular edge domains are split. |
Rail domains after the circular edge have been split
Step 7: Merge Edge Domains
Each circular domain on the rail has been split at four nodes and four new handles have been added to each circular domain. This operation results in five curved edge domains on each circular edge on the rail. The objective is to have only four domains. The following steps show the procedure to merge domains.
1. | Toggle the left switch and select to merge edges. |
2. | Click the left domain, below merge and select the outer red curve from node 926 to pre-existing handle (refer to previous figure). |
3. | Click the right domain and select the outer red curve from pre-existing handle to node 942. |
4. | Verify that retain handles is unchecked. |
5. | Click merge. Notice the pre-existing handle is removed. |
6. | Repeat steps 7.1 through 7.5 to merge two edge domains between node 1316 and node 1300 on the other side of the rail. |
Rail domains after few domains are merged
Step 8: Build 2D Domains on the Tube
1. | In the Model browser, expand the Component list. |
2. | Right-click on the component PSHELL.1 and click Show. |
3. | Select the radio button create. |
4. | Make sure the switch (small triangle) is selected to 2D domains. |
5. | Click elems and select by sets from the pop-up window. |
6. | Check the boxes for elem_set1. |
9. | Repeat steps 8.5 through 8.8 to create three more 2D domains for elements in sets elem_set2, elem_set3, and elem_set4, respectively. |
10. | Click return and go back to the HyperMorph module. |
Domains on Rail and Tube Joint
Step 9: Create Shapes
In this step, three shapes using the created domains and handles are created.
Use the alter dimensions feature in HyperMorph to modify the curvatures of selected edge domains.
2. | Toggle to alter dimensions. |
3. | Toggle the right switch and select curvature. |
4. | Toggle center calculation and change the setting to by edges. |
5. | Toggle the switch below and select hold ends. |
Holding two ends of a selected edge domain allows a change of curvature of the selected edge without altering its end points.
6. | Leave the other settings with the defaults. |
7. | Under edges only, click domains and select red edge-domains, as shown in the following figure. You might need to zoom in for easier picking operation. |
8. | Verify that a total of eight edge domains are selected and highlighted on screen. |
Morph edge domains
9. | Click curve ratio = and enter 20. |
10. | Click morph. A new curvature is applied to the selected eight edge domains. See the following figure below. |
11. | Select the radio button to save shape. |
12. | Click shape =, enter the name sh1. |
13. | Toggle as handle perturbation to as node perturbation. |
14. | Click color and change the color of the shape vectors or leave the default color. |
15. | Click save. Shape vectors (arrows) are created of the selected color. |
16. | Click undo all to prepare for the generation of the next shape. |
17. | In the Model browser, right-click Shape and select Hide. |
First shape variable, sh1.
18. | Select the radio button alter dimensions. |
19. | Under edges only, click reset . This will clean up previous selection from buffer. |
20. | Click domains and select the red edge curves, as shown the following figure. |
Morph edge domains for the second shape.
21. | Click morph. A new curvature is applied to the selected eight edge domains. See the following figure below. |
22. | Select the radio button save shape. |
23. | Click shape =, enter the name sh2. |
24. | Toggle as handle perturbation to as node perturbation. |
25. | Click color and change the color of the shape vectors or leave the default color. |
26. | Click save. Shape vectors (arrows) are created of the selected color. |
27. | Click undo all to prepare for the generation of the next shape. |
28. | In the Model browser, right-click Shape and select Hide. |
Refer to the following figure for the new shape changes.
Second shape variable, sh2.
29. | Select the radio button apply shapes. In HyperMorph, a new shape can be created as a linear combination of existing shapes. |
30. | Click shapes and select both sh1 and sh2. |
32. | Verify that the multiplier is 1.0. |
34. | Select the radio button save shapes. |
35. | Click shape = and enter sh3. |
36. | Make sure that the toggle is set to node perturbations. The new shape sh3 includes influences from both sh1 and sh2 shapes, as shown in the next figure. |
38. | In the Model browser, right-click Shape and select Hide. |
Do NOT click undo all at this moment, because one more shape based on this third shape change will be created.
The third shape variable, sh3, converts the tube to a square cross-section
An additional shape variable is created using the shape created in the previous step.
39. | In the Model browser, right-click on the component PSHELL and click Hide. These components are turned off for ease of visualization. |
40. | Toggle the radio button to alter dimensions. |
41. | Under edges only, click reset . This will clean up previous selection from buffer. |
42. | Switch the top selector from curve ratio to distance =. This feature allows you to shorten the distance between selected domains. |
43. | Switch the end a: selector from two handles to nodes and handles. |
44. | Click node a and pick node, as shown in the next figure. |
45. | Click node b and pick node, as shown in the next figure. |
Setup for the fourth shape variable, sh4
Once nodes a and b are selected, the distance between node a and node b is measured automatically and appears in distance = field.
The distance between node a and node b is about 43.
46. | Click handles under node a and select the 8 handles shown by the downward pointing arrows in the previous figure. |
To select, click the handles on the screen until they are highlighted.
47. | Click handles under node b and similarly as in the previous step, select the 8 handles near the opposite face of the tube. |
48. | Toggle the bottom selector and select hold middle. These components are turned on for ease of visualization |
49. | Click distance = and enter 20. |
50. | Click morph. A rectangular shape appears to the joint, as shown in the next figure. |
51. | Toggle the button to save shape. |
52. | Click shape = and enter sh4. |
53. | Make sure that the toggle is set to node perturbations. |
55. | Click undo all to restore the mesh to the baseline configuration. |
56. | In the Model browser, right-click Shape and select Hide. |
57. | Click return three times to go the main menu. |
Fourth shape variable, sh4
Step 10: Define the Shape Design Variables and Review by Animation
1. | From the Analysis page, select the optimization panel. |
3. | Make sure the radio button is set to desvar and create. |
4. | Toggle the switch to select multiple desvars. |
5. | Click shape = and select sh1, sh2, sh3 and sh4. |
7. | Click initial value = and enter 0.0. |
8. | Click lower bound = and enter -1.0. |
9. | Click upper bound = and enter 1.0. |
This creates four design variables with the same initial value, lower bound, and upper bound. HyperMesh automatically links the design variables to each shape, respectively and assigns names to each design variable the same as its associated shapes.
12. | Click simulation = SHAPE – sh1 (1). |
13. | Make sure that data type = is set to Perturbation vector. |
14. | Click modal to animate the first shape variable. |
15. | Click next and then animate to see the next shape variable, and so forth. |
16. | Click return three times to go back to the optimization panel. |
Setting Up the Shape Optimization Problem in HyperMesh
Step 11: Create the Mass and Static Stress Response
1. | Enter the responses panel. |
2. | Click response = and enter Mass. |
3. | Click the response type switch and select mass from the pop-up menu. |
4. | Ensure the regional selection is set to total (this is the default). |
5. | Click create. A response, mass, is defined for the total mass of the model. |
6. | Click response = and enter Stress. |
7. | Click the response type switch and select static stress from the pop-up menu. |
8. | Click props and select the PSHELL.1 component which contains skin shells. |
9. | Do NOT select any element under excluding:. |
10. | Make sure that the toggle is selected to von Mises. |
11. | Toggle the bottom switch to select both surfaces. |
12. | Click create. A response, Stress, is defined for the model. |
13. | Click return to go back to the optimization panel. |
Step 12: Define the Objective
1. | Enter the objective panel. |
2. | The switch on the left should be set to min. |
3. | Click response= and select Mass. |
5. | Click return to exit the optimization panel. |
Step 13: Create Constraints on Stress Response
In this step, the upper and lower bound constraint criteria for this analysis will be set.
1. | Enter the dconstraints panel. |
2. | Click constraint= and enter con. |
3. | Check the box for upper bound only. |
4. | Click upper bound= and enter 200. |
5. | Select response= and set it to Stress. |
6. | Click loadsteps and check STEP. |
9. | Click return to the main menu. |
Step 14: Define Control Cards Required for Shape Optimization
Without this control card defined, optimization gets terminated by quality check and you do not get the converged results.
1. | From the Analysis page, click the control cards panel. |
2. | Click next twice and choose the PARAM card. |
3. | Check the box next to CHECKEL. |
4. | Click YES under CHECKEL_V1 and change to NO. |
Step 15: Run the Optimization Problem
1. | From the Analysis page, enter the OptiStruct panel. |
2. | Click save as, enter rail_joint_opt.fem as the file name, and click Save. |
3. | Set the export options: toggle to All. |
4. | Set the run options: toggle to optimization. |
5. | Set the memory options: toggle to memory default. |
6. | Click OptiStruct to run the optimization. |
The message Processing complete appears in the window at the completion of the job. OptiStruct also reports error messages if any exist. The file carm_complete.out can be opened in a text editor to find details regarding any errors. This file is written to the same directory as the .fem file.
7. | Close the DOS window or shell. |
Post-processing the Optimization Results in HyperView
This section describes how to view the results in HyperView which will be launched from within the OptiStruct panel of HyperMesh.
Step 16: Review the Shape Optimization Results
1. | When the message Process completed successfully is received in the command window, click HyperView. The HyperView client is launched and the results are loaded into a new page. |
A message window appears to inform about the successful loading of the model and result files into HyperView. Notice that all three .h3d files get loaded, each in a different page of HyperView.
2. | Click Close to close the message window. Rail_joint_opt_des.h3d will be opened in page 2 and Rail_joint_opt.h3d will be opened in page 3 of HyperView. |
3. | Click the Contour toolbar icon. |
Note the Result type: is Shape Change [v]; this should be the only results type in the “file_name”_des.h3d file. The second drop-down menu select mag.
4. | Click Apply to display the shape change. |
Note the contour is all blue this is because your results are on the first design step or Iteration 0.
5. | At the bottom of the GUI, click the name Design <> Iteration 0 to activate the Load Case and Simulation Selection dialog. |
6. | Select the last iteration by double-clicking on the last Iteration listed. |
Each element of the model is assigned a legend color, indicating the density of each element for the selected iteration.
Shape optimization results are applied to the model.
Shape change converged (Scale 2x)
Step 17: View a Contour Plot of the Stress on Top of the Shape Optimized Model
1. | Click the Next arrow to move to page 2. |
2. | Click the Contour toolbar icon. |
The Result type: is Element Stresses [2D & 3D] [t]. The second drop-down menu shows von Mises.
3. | At the bottom of the GUI, click the name Subcase 1 (STEP) <> Model Step to activate the Load Case and Simulation Selection dialog. |
4. | Select the last iteration by double-clicking on the last Iteration listed. |
The stress contour shows on top of the shape changes applied to the model. Verify that this value is around the constraint value specified.
von Mises stress for the last iteration (Max < 200 MPa)
Reviewing the Results
Is your design objective of minimizing the volume obtained? If not, can you explain why?
Are your design constraints satisfied?
Which shape has the most influence in this problem setup?
What is the percentage decrease in compliance?
Can size optimization be introduced to the joint?
See Also:
OptiStruct Tutorials