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

In this tutorial you will perform a shape optimization on a cantilever beam modeled with shell elements.

You will use a structural model with loads and constraints. 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 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.

Launch HyperMesh and Set the OptiStruct User Profile

  1. Launch HyperMesh.
    The User Profile dialog opens.
  2. Select OptiStruct 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.

Open the Model

  1. Click File > Open > Model.
  2. Select the beamshape.hm file you saved to your working directory from the optistruct.zip file. Refer to Access the Model Files.
  3. Click Open.
    The beamshape.hm database is loaded into the current HyperMesh session, replacing any existing data.

Set Up the Optimization

Create Shapes using HyperMorph

In this step you will use HyperMorph to create shapes.
  1. From the Analysis page, click the optimization panel.
  2. Click the HyperMorph panel.
  3. Create domain handles.
    1. Click the domains panel.
    2. Select the create subpanel.
    3. Switch from global domains to auto functions and keep the default settings.
    4. Click generate.
    5. Click return to return to the HyperMorph panel.

    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.

  4. Move handles.
    1. Select the morph panel.
    2. Select the move handles subpanel.
    3. Switch interactive to move to node.
    4. Using the handles selector, select the top right local handle (where the force is applied).

      4001-fig2
      Figure 2.
    5. Using the nodes selector, select the node in the middle of the right-hand side of the beam.
    The beam changes shape, so that the handle you selected moved to the location of the node you selected. Notice how the mesh adjusted to this change in shape.

    4001-fig3
    Figure 3. Morphed Shape 1
  5. Save the shape.
    1. Select the save shape subpanel.
    2. In the shape= field, enter shape1.
    3. Click the color button to select a new color for the shape vectors.
    4. Under shape=, set the toggle to as node perturbations.
    5. Click save.
    6. Click Yes.
    This shape has been saved and can be associated with a design variable later.
  6. Click undo all.
    The model returns to the original shape.
  7. Click return to return to the HyperMorph panel.
  8. Create handles.
    1. Select the handles panel.
    2. Select the create subpanel.
    3. In the name = field, enter aux1.
    4. Using the domain selector, select the top edge domain.
      Tip: 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.
    5. Set the toggle to by nodes.
    6. Using the nodes selector, select the node at the center of the top edge of the beam.
    7. Click create.
    8. Click return to return to the HyperMorph panel.
    A new handle, 'aux1', is created at the center of the top edge of the beam.

    4001-fig4
    Figure 4.
  9. Move the handles.
    1. Click the morph panel.
    2. Select the move handles subpanel.
    3. Switch from move to nodes to interactive.
    4. Using the handles selector, select the yellow handle you just created.
      A manipulator axis is created on the selected handle.
    5. 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. Pull down approximately until the center of the beam and release the mouse button.
      Note: The mesh morphs interactively as the handle moves along the axis.

    os5000_morph_shape2
    Figure 5. Morphed Shape 2
  10. Set biasing.
    1. Select the set biasing subpanel.
    2. Using the handles selector, select aux1.
    3. Select make retroactive.
    4. Switch bias to screen edit.
      The number 1.000 appears next to the handle 'aux1'.
    5. Click the number and hold the mouse button down until the value reads 1.500.
      Tip: If you move the mouse upwards the number increases, if you move the mouse downwards the number decreases.
    6. Click update.
    The curvature of the top edge has altered.

    4001-fig6
    Figure 6. Morphed Shape 3
  11. Save the shape.
    1. Select the save shape subpanel.
    2. In the shape= field, enter shape2.
    3. Click the color button to select a new color for the shape vectors.
    4. Under shape=, set the toggle to as node perturbations.
    5. Click save.
    6. Click Yes if you wan 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.
  12. Click undo all.
    The model returns to its original shape.
  13. Click return twice to return to the Optimization panel.

Create Shape Design Variables

  1. Click the shape panel.
  2. Select the desvar subpanel.
  3. Switch the design variable option from single desvar to multiple desvars.
  4. Using the shapes selector, select shape1 and shape2.
  5. Click create.
  6. Click return to return to the Optimization panel.
Two shape design variables are created using the shapes that were saved earlier.

Create Optimization Responses

  1. From the Analysis page, click optimization.
  2. Click Responses.
  3. Create the volume response, which defines the volume fraction of the design space.
    1. In the responses= field, enter vol.
    2. Below response type, select volume.
    3. Set regional selection to total and no regionid.
    4. Click create.
  4. Create the displacement response.
    1. In the response= field, enter disp.
    2. Below response type, select static displacement.
    3. Click nodes > by id, then enter 1115 in the id= field.
    4. Set the displacement type to dof1.
      dof1, dof2, dof3
      Translation in the X, Y, and Z directions.
      dof4, dof5, dof6
      Rotation about the X, Y, and Z axes.
      total disp
      Resultant of the translational displacements in x, y, and z directions.
      total rotation
      Resultant of the rotational displacements in x, y, and z directions.
    5. Click create.
  5. Click return to go back to the Optimization panel.

Create Design Constraints

  1. Click the dconstraints panel.
  2. In the constraint= field, enter constr.
  3. Click response = and select disp.
  4. Check the box next to upper bound, then enter 3.0.
  5. Using the loadsteps selector, select Load.
  6. Click create.
  7. Click return to go back to the Optimization panel.

Define the Objective Function

  1. Click the objective panel.
  2. Verify that min is selected.
  3. Click response and select vol.
  4. Click create.
  5. Click return twice to exit the Optimization panel.

Define the SHAPE Card

Only displacement and stress results are available in the _s#.h3d file by default. To obtain analysis results (displacement/stress/temperature) 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, click the control cards panel.
  2. In the Card Image dialog, click SHAPE.
  3. Set FORMAT to H3D.
  4. Set TYPE to ALL.
  5. Set OPTION to ALL.
  6. Click return twice to go back to the main menu.

Run the Optimization

  1. From the Analysis page, click OptiStruct.
  2. Click save as.
  3. In the Save As dialog, specify location to write the OptiStruct model file and enter beamshape for filename.
    For OptiStruct input decks, .fem is the recommended extension.
  4. Click Save.
    The input file field displays the filename and location specified in the Save As dialog.
  5. Set the export options toggle to all.
  6. Set the run options toggle to optimization.
  7. Set the memory options toggle to memory default.
  8. Click OptiStruct to run the optimization.
    The following message appears in the window at the completion of the job:
    OPTIMIZATION HAS CONVERGED.
    FEASIBLE DESIGN (ALL CONSTRAINTS SATISFIED).
    OptiStruct also reports error messages if any exist. The file beamshape.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.
  9. Click Close.

View the Results

View the Shape Results

  1. From the OptiStruct panel, click HyperView.
    HyperView launches within the HyperMesh Desktop and loads beamshape_des.h3d on page 1 and beamshape_s2.h3d opens on page 2.
  2. Use the navigations buttons to navigate to Design History on page 1.

    page_nav
    Figure 7.
  3. In the Results Browser, select the iteration.

    os5000_iteration5
    Figure 8.
  4. On the Results toolbar, click resultsContour-24 to open the Contour panel.
  5. Set the Result type: to Shape change (v) and Mag.
  6. Click Apply.
Shape optimization results are applied to the model.

5000_shape_opt_results
Figure 9.

View a Contour Plot of the Displacement

  1. In the top, right of the application use the navigation buttons to move to page 2.
  2. In the Results Browser, select the last iteration.

    os5000_iteration5A
    Figure 10.
  3. On the Results toolbar, open the Deformed panel.
  4. Set the Result type: to Shape Change (v).
  5. Click Apply.
    The optimized shape of the beam displays.
  6. On the Results toolbar, click resultsContour-24 to open the Contour panel.
  7. Set the Result type: to Displacement (v) and Mag.
  8. Click Apply.
  9. On the Annotations toolbar, click measure to open the Measures panel.
  10. Select Static MinMax Result.
Node 1115 has a displacement which is within the constraint value.

5000_final
Figure 11.