HyperWorks Solvers

OS-5000: 2D Shape Optimization of a Cantilever Beam

OS-5000: 2D Shape Optimization of a Cantilever Beam

Previous topic Next topic No expanding text in this topic  

OS-5000: 2D Shape Optimization of a Cantilever Beam

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

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.

5001-1

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 determines 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 learn to:

Setup 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 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 can also be accessed from the Preferences menu on the toolbar.

3.From the File menu, select Open > Model.
4.Select the beamshape.hm file you saved to your working directory from the optistruct.zip file. Refer to Accessing the Model Files.
5.Click Open. The beamshape.hm is loaded into the current HyperMesh session, replacing any existing data. The database only contains geometric data.

The location of beamshape.hm displays in the file: field.

 

Setting Up the Shape Optimization Problem in HyperMesh


Step 2: Create Shapes using HyperMorph

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

1.From the Analysis page, enter 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; and 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.

4001-fig2

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.

4001-fig3

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.
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 name = and enter aux1.
26.Click 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 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.

4001-fig4

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 handles button should be highlighted. If not, click on it.
36.Select the yellow handle you just created by clicking on it in the graphics window.
37.A manipulator axis is created on the selected handle.
38.Left-click and hold down the mouse button on the manipulator axis pointing in the positive X direction. While holding the mouse button down, pull the selected axis in the positive X direction.
39.Pull down approximately until the center of the beam and release the mouse button. Note how the mesh morphs interactively as the handle moves along the axis.

os5000_morph_shape2

Figure 5. Morphed shape 2.

40.Select the set biasing subpanel using the radio buttons on the left-hand side of the panel.
41.Click handles.
42.Check the box next to aux1 and click select.
43.Verify that the box next to make retroactive is checked.
44.Switch the bias to screen edit.
45.Click screen edit. The number 1.000 appears next to the handle 'aux1'.
46.Click the number and hold the mouse button down.

If you move the mouse upwards the number increases, if you move the mouse downwards the number decreases.

47.Move the mouse upwards until the value reads 1.500, then release the button and click update.
48.Note how the curvature of the top edge has altered. See Figure 6.

4001-fig6

Figure 6. Morphed shape 3.

49.Select the save shape subpanel using the radio buttons on the left-hand side of the panel.
50.Click shape = and enter shape2.
51.Select a color or leave the default.
52.Set the toggle under shape= to as node perturbations.
53.Click save.
54.Click Yes in the dialog box that prompts if you want to Save perturbations for nodes at global and morph volume handles.

This shape is now saved, later it can be associate to a design variable.

55.Click undo all. The model returns to its original shape.
56.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.

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 appears 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'.
9.Click return to go to the optimization panel.

Step 6: Define the Objective Function

In this step, 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.Click next to see more cards.
4.Set FORMAT to H3D. 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, select 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.

The name and location of the beamshape.fem file displays 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. 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 HyperView.
2.The beamshape_des.h3d opens on page 1 and beamshape_s2.h3d opens on page 2 of HyperView.
3.Use the navigations icons, seen in the figure below, to navigate to Design History (page 1), if HyperView opens on page 2.

page_nav

4.Select last iteration from Simulation using the drop-down selection, as seen in the figure below.

os5000_iteration5

5.Go to the Contour panel resultsContour-24.
6.Set the Result type: to Shape change (v).
7.Select Mag.
8.Click Apply.

5000_shape_opt_results

Shape optimization results applied to the model.

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

1.Click the Next Page arrow to move to page 2 using the page navigation arrow icon.
2.Select the last iteration from Simulation using the drop-down selection, as seen in the image below.

os5000_iteration5A

3.Go to the Deformed panel and set Result type: to Shape Change (v).
4.Click Apply. The optimized shape of the beam is shown on the screen now.
5.Go to the Contour panel and set Result type: to Displacement (v).
6.Select Mag using the toggle.
7.Click Apply.
8.Click the Measure panel toolbar icon measure.
9.Check the box in front of Static MinMax Result.
10.Notice that node 1115 has a displacement which is within the constraint value.

5000_final

See Also:

OptiStruct Tutorials