Вы находитесь на странице: 1из 7

HW-PTC-India

Professional Training Centre


Tutorial – 15: Shape Optimization - of a Cantilever Beam.
In this tutorial, a shape optimization on a cantilever beam modeled with shell elements will be performed. The
structural model with loads and constraints applied is shown in Figure 1. The deflection at the lower right corner
should be limited to 3mm. The optimal design would use as little material as possible

Figure 1. Cantilever beam, structural model.

The structural model, shown in figure 1, is loaded into HyperMesh and is used to generate and run a shape
optimization of the cantilever beam. Shape perturbation vectors are generated using HyperMorph, which is
accessed, through the HyperMesh interface. The OptiStruct software is used to determine the optimal shape. The
results are then reviewed in HyperView.

The optimization problem for this tutorial is stated as:

Objective: Minimize volume.

Constraints: Given maximum nodal displacement at the end of the beam < 3.0 mm.

Design variables: Shape variables defined with HyperMorph.

In this tutorial, you will:

 Set up the shape optimization problem in HyperMesh.


 Post-process the results in HyperView

Exercise
Step 1: Load the OptiStruct User Profile and Retrieve the Geometry.

1. Launch HyperMesh Desktop.


2. Choose OptiStruct as the User Profile 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 in Bulk Data Format for
RADIOSS and OptiStruct.
User Profiles… can also be accessed from the Preferences pull-down menu on the toolbar.
3. From the File menu, select Open > Model.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 1
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
4. Select the beamshape.hm file.
5. Click Open.
The beamshape.hm is loaded into the current HyperMesh session, replacing any existing data. The
database only contains geometric data.
Note the location of beamshape.hm now displays in the file: field.

Setting up the shape optimization problem in HyperMesh.

Step 2: Create Shapes using HyperMorph

This section makes use of HyperMorph. For a more detailed description of the functionality of HyperMorph,
please refer to the HyperMorph section of the HyperMesh documentation.

1. From the Analysis page, click on the optimization panel.


2. Select the HyperMorph panel.
3. Select the domains panel.
4. Select the create subpanel using the radio buttons on the left side of the panel.
5. Change the switch subpanel to auto functions and keep the default settings.
6. Click generate.
A number of domains and handles are created which will enable us to morph the shape of the beam.
There are two types of handles: global handles, which are represented by larger red balls; local handles,
which are represented by smaller yellow balls. Only local handles will be covered in this tutorial.
7. Click return to return to the HyperMorph panel.
8. Select the morph panel.
9. Select the move handles subpanel.
10. Click the right-hand switch and select move to node from the pop-up menu.
11. If the handle button is not highlighted, click on it.
12. Select the top right local handle (where the force is applied) by clicking on it in the graphics window.
Figure 2 shows the node to be selected in black.

Figure 2. Selecting a local handle for morphing.


13. If the nodes button is not highlighted, click on it.
14. Select the node in the middle of the right-hand side of the beam.
The beam instantly changes shape, so that the handle you selected moved to the location of the node
you selected. See figure 3 below. Note how the mesh adjusted to this change in shape.

.
Figure 3. Morphed shape 1.
15. Select the save shape subpanel.
16. Click shape = and enter shape1.
17. You can select the color button and change the color of the shape vectors or leave the default color set.
18. Set the toggle under shape = to as node perturbations.
19. Click save.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 2
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
20. Click Yes.
This shape has been saved, and can be associated with a design variable later.
21. Click undo all.
The model returns to its original shape.
22. Click return to return to the HyperMorph panel.
23. Select the handles panel.
24. Select the create subpanel using the radio buttons on the left-hand side of the panel.
25. Click on name = and enter aux1.
26. Click on domain and select the top edge domain by clicking on the top edge in the graphics window.
27. To ensure that you select the top edge domain, hold down the left mouse button and move the mouse
over the top edge of the beam until the edge is highlighted (white), then release the mouse button.
28. Set the toggle to by nodes.
29. Click on nodes and select the node at the center of the top edge of the beam by clicking on it in the
graphics window.
30. Click create.
A new handle, 'aux1', is created at the center of the top edge of the beam, see figure 4.

Figure 4. New handle added at the center of the top edge of the beam
31. Click return to return to the HyperMorph panel.
32. Select the morph panel.
33. Select the move handles subpanel.
34. Click the switch beside move to node and select interactive from the pop-up menu.
35. The handle button should be highlighted. If not, click on it.
36. Select the handle you just created by clicking on it in the graphics window.
37. Click morph.
38. Click the new handle in the graphics window and keep the mouse button held down.
39. Move the mouse downwards in a straight line.
40. Note how the mesh morphs interactively as you move the handle.
41. When the handle is roughly at what was the center of the beam, release the mouse button.

Figure 5. Morphed shape 2.


42. Select the set biasing subpanel using the radio buttons on the left-hand side of the panel.
43. Click on handles.
44. Check the box next to aux1 and click select.
45. Verify that the box next to make retroactive is checked.
46. Switch the bias to screen edit.
47. Click screen edit.
The number 1.000 appears next to the handle 'aux1'.
48. Click the number and keep the mouse button held down.
If you move the mouse upwards the number increases, if you move the mouse downwards the number
decreases.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 3
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
49. Move the mouse upwards until the value reads 1.500, then release the button and click update.
50. Note how the curvature of the top edge has altered. See Figure 6..

Figure 6. Morphed shape 3.


51. Select the save as shape subpanel using the radio buttons on the left-hand side of the panel.
52. Click shape = and enter shape2.
53. Select a color or leave the default.
54. Set the toggle under shape= to as node perturbations.
55. Click save.
56. Click Yes in the dialog box that asks if you want to Save perturbations for nodes at global and morph
volume handles.
We have now saved this shape, later we can associate it to a design variable.
57. Click undo all.
The model returns to its original shape.
58. Click return twice to return to the OptiStruct panel.

Step 3: Define the Shape Design Variables.

1. Select the shape panel.


2. Select the desvar subpanel.
3. Switch the design variable option from single desvar to multiple desvars.
4. Click shapes.
5. Check the boxes next to shape1 and shape2 and click select.
6. Click create.
Two shape design variables are created using the shapes that were saved earlier.
7. Click return to return to the optimization panel.

Step 4: Define Responses.

Two responses are defined in this tutorial; a volume response for the objective function and a displacement
response for the constraint. A detailed description can be found in the OptiStruct User's Guide under Responses.

1. Select the responses panel.


2. Click response = and enter vol.
3. Click the response type switch and select Volume from the pop-up menu.
4. Click create.
A response, 'vol', is defined for the total volume of the model.
5. Click response = and enter disp.
6. Click the response type switch and select static displacement from the pop-up menu.
7. Click nodes and select by id from the extended entity selection menu.
8. Enter 1115 and press Enter.
9. Select dof1.
Dofs 1, 2, and 3 refer to translation in the X, Y, and Z directions.
Dofs 4, 5, and 6 refer to rotation about the X, Y, and Z axes.
10. Click create.
A response, 'disp', is defined for the x-displacement of the node 1115.
11. Click return to go to the optimization panel.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 4
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
Step 5: Define a Constraint

A constraint with upper bound is to be defined for the displacement response defined in the previous section.

1. Select the dconstraints panel.


2. Click constraint = and enter constr.
3. Click response = and select disp from the list of responses.
A loadstep button should appear in the panel.
4. Click loadstep.
5. Check the box next to Load and click select.
6. Check the box next to upper bound =..
7. Click upper bound= and enter 3.0..
8. Click create.
A constraint is defined on the response 'disp'. The constraint is an upper bound with a value of 3.0. The
constraint applies to the subcase 'Load'.

Step 6: Define the Objective Function.

In this example, the objective is to minimize the volume response defined in the previous section.

1. Select the objective panel.


2. Click the switch in the upper left corner of the panel, and select min from the pop-up menu.
3. Click response = and select vol from the response list.
4. Click create.
The objective function is now defined.
5. Click return twice to go to the main menu.

Step 7: Define the SHAPE Card

Only displacement and stress results are available in the _s#.h3d file by default. In order to look at
displacement/stress results on top of a shape change that was applied to the model in HyperView, a SHAPE card
needs to be defined.

1. From the Analysis page, select the control cards panel.


2. Select SHAPE.
3. Use the green next button to see more cards.
4. Set both TYPE and OPTION to ALL.
5. Click return twice to go back to the main menu.

Step 8: Launch OptiStruct


1. From the Analysis page, click on the OptiStruct panel.
2. Click save as… following the input file: field.
3. Select the directory where you would like to write the OptiStruct model file and enter the name for the
model, beamshape.fem, in the File name: field.
The .fem extension is suggested for OptiStruct input decks.
4. Click Save.
Note that the name and location of the beamshape.fem file is now displayed in the input file: field.
5. Set the memory options: toggle to memory default.
6. Click the run options: switch and select optimization.
7. Set the export options: toggle to all.
8. Click OptiStruct.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 5
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
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 beamshape.out file is a good place to look for error
messages that will help to debug the input deck if any errors are present. Make sure the process is
complete before checking the results files.

Post-processing the Results in HyperView


This section describes how to view results in HyperView, which will be launched from within the OptiStruct panel
of HyperMesh.
HyperView is a comprehensive post-processing and visualization environment for finite element analysis (FEA),
multi-body system simulation, video and engineering data.

Step 9: View the Shape Results


1. While in the OptiStruct panel of the Analysis page, click the green HyperView button.
Note that a message window pops up to indicate that beamshape_des.h3d and beamshape_s1.h3d
are loaded.
2. Click Close to close the Message Log window.
beamshape_des.h3d will be opened on page 2 and beamshape_s1.h3d will be opened on page 3 of
HyperView.
3. From the Graphics pull-down menu, choose the Select Load Case option.
This will bring up the Load Case and Simulation Selection dialog (which is also accessible from the
lower right portion of the status bar).
4. Select last iteration from Simulation (load final iteration results).
5. Click OK.

6. Go to the Contour panel .


7. Set the Result type: to Shape change (v).
8. Select Mag.
9. Click Apply.

Shape optimization results applied to the model.

Step 10: View a Contour Plot of the Displacement on Top of the Shape Optimized
Model.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 6
HW-PTC-India
Professional Training Centre
Tutorial – 15: Shape Optimization - of a Cantilever Beam.
1. Click the Next Page arrow to move to page 2.
2. From the Graphics pull-down menu, choose the Select Load Case option.
3. In the Load Case and Simulation Selection dialog, select the last iteration from Simulation (load final
iteration results).
4. Click OK.
5. Go to the Deformed panel and set Shape Change (v) as the Result type:.
6. Click Apply.
The optimized shape of the beam is shown on the screen now.
7. Go to the Contour panel and select Displacement (v) as the Result type:.
8. Select Mag using the toggle.
9. Click Apply.

10. Click the Measure panel toolbar button .


11. Check the box in front of Static MinMax Result.
12. Notice that node 1115 has a displacement which is within the constraint value.

Rev 1.0 : Created on March 15, 2013, using HyperWorks Student Edition 11.0 Page 7