OS-T: 4030 Discrete Size Optimization of a Welded Bracket

In this tutorial you will perform a size optimization on a welded bracket modeled with shell elements using discrete design variables.

Before you begin, copy the file(s) used in this tutorial to your working directory.
A structural model with loads and constraints is used in this tutorial. The objective is to minimize the amount of material used in the model subject to certain stress specifications.

4030_original_model
Figure 1.

You will load the structural model into HyperMesh. The constraints, loads, material properties, and subcases (loadsteps) are already defined in the model. Size design variables and optimization parameters are defined, and OptiStruct determines the optimal gauges. The results are then reviewed in HyperView.

The optimization problem is stated as:
Objective
Minimize volume.
Constraints
Maximum von Mises stress of the brackets < 120 MPa.
Design Variables
Gauges of the brackets.

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 bracket_size.hm file you saved to your working directory.
  3. Click Open.
    The bracket_size.hm database is loaded into the current HyperMesh session, replacing any existing data.

Set Up the Optimization

Create Discrete Design Variables

  1. From the Analysis page, click the optimization panel.
  2. Click the discrete dvs panel.
  3. Create the discrete design variable, DDV1.
    1. In the name= field, enter DDV1.
    2. In the from= field, enter 0.5.
    3. In the to= field, enter 3.0.
    4. In the increment= field, enter 0.1.
    5. Click create.
    A discrete design variable is created with a starting value of 0.5 and ending value of 3.0. The variables are incremented by 0.1, making the possible values as 0.5, 0.6, 0.7, and so on until 3.0.
  4. Create the discrete design variable, DDV2, with the same discrete values as DDV1.
  5. Click return to go back to the optimization panel.

Create Size Design Variables

  1. From the Analysis page, click the optimization panel.
  2. Click the size panel.
  3. Select the desvar subpanel.
  4. Create the design variable, part1.
    1. In the desvar = field, enter part1.
    2. In the initial value = field, enter 2.5.
    3. In the lower bound = field, enter 0.5.
    4. In the upper bound = field, enter 3.0.
    5. Set the move limit toggle to move limit default.
    6. Set the discrete design variable (ddval) toggle to ddval=, then click ddval and select DDV1.
      This links the design variable to the DDVAL (Discrete Design Variable Value) DDV1.
    7. Click create.
  5. Create the design variable, part2.
    1. In the desvar = field, enter part2.
    2. In the initial value = field, enter 2.5.
    3. In the lower bound = field, enter 0.5.
    4. In the upper bound = field, enter 3.0.
    5. Set the move limit toggle to move limit default.
    6. Set the discrete design variable (ddval) toggle to ddval=, then click ddval and select DDV2.
    7. Click create.
  6. Select the generic relationship subpanel.
  7. Create a design variable property relationship, part1_th.
    1. In the name = field, enter part1_th.
    2. Using the prop selector, select part1.
    3. Under the props selector, select Thickness T.
    4. Click designvars.
    5. Select part1.
      Note: The linear factor is automatically set to 1.000.
    6. Click return.
    7. Click create.
    A design variable property relationship, part1_th, has been created relating the design variable part1 to the thickness entry on the PSHELL card for the property part1.
  8. Create a design variable property relationship, part2_th.
    1. In the name = field, enter part2_th.
    2. Using the prop selector, select part2.
    3. Under the props selector, select Thickness T.
    4. Click designvars.
    5. Select part2.
    6. Click return.
    7. Click create.
    A design variable property relationship, part2_th, has been created relating the design variable part2 to the thickness entry on the PSHELL card for the property part2.
  9. Click return to go to the Optimization panel.

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 volume.
    2. Below response type, select volume.
    3. Set regional selection to total and no regionid.
    4. Click create.
  4. Create a static stress response.
    1. In the response= field, enter stress1.
    2. Set the response type to static stress.
    3. Using the props selector, select part1.
    4. Set the response selector to von mises.
    5. Under von mises, select both surfaces.
    6. Click create.
  5. Create another static stress response named stress2, which is defined for the von Mises stress of the elements in the component part2.
  6. Click return to go back to the Optimization panel.

Create Constraints

A response defined as the objective cannot be constrained. In this case, you cannot constrain the response volume.

Upper bound constraints are to be defined for the responses stress1 and stress2.

  1. Click the dconstraints subpanel.
  2. Define a constraint on the response stress1.
    1. In the constraints= field, enter stress1.
    2. Check the box next to upper bound, then enter 100.
    3. Click response = and select stress1.
    4. Using the loadsteps selector, select STEP.
    5. Click create.
    The constraint is an upper bound with a value of 100. The constraint applies to the subcase STEP.
  3. Define a constraint on the response stress2.
    1. In the constraints= field, enter stress2.
    2. Check the box next to upper bound, then enter 120.
    3. Click response = and select stress2.
    4. Using the loadsteps selector, select STEP.
    5. Click create.
    The constraint is an upper bound with a value of 120. The constraint applies to the subcase STEP.
  4. Click return to go to the Optimization panel.

Define the Objective Function

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

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 discrete_bracket_size 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 discrete_bracket_size.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

After the size optimization, the stress value should be reviewed to make sure that the stress constraints are not violated. The analysis results are available on page 3 (the second page has the optimization results).
  1. From the OptiStruct panel, click HyperView.
    HyperView launches within the HyperMesh Desktop and loads the result files. All of the .h3d files get loaded into a different page in HyperView. The files discrete_bracket_size_des.h3d and discrete_bracket_size_s2.h3d get loaded in page 2 and page 3, respectively.
  2. Click the Next Pagetoolbar icon pageNext-24to move to the third page.
    The third page has the results loaded from the discrete_bracket_size_s1.h3d file. The name of the page is displayed as Subcase 1 - STEP to indicate that the results correspond to subcase 1.
  3. On the Results toolbar, click resultsContour-24 to open the Contour panel.
  4. Set the Result type to Element Stresses [2D & 3D] (t) and vonMises.
  5. Set the Averaging method to None.
  6. Click Apply.
    A contoured image representing von Mises stresses should be visible. Each element in the model is assigned a legend color, indicating the von Mises stress value for that element resulting from the applied loads and boundary conditions. If you did not change the Iteration step you should be contouring the stress of the initial step.

    4030_von_mises
    Figure 2. von Mises contour for the initial design
  7. On the Animation toolbar, click animationFastForwardEnd-24 to set the last iteration of that loadcase and contour the final step.

    Only two iterations are displayed; the First and Last (FL) is the default setting for optimization runs. To change this setting, add an OUTPUT control card with a frequency setting of ALL.

    This will now contour your final iteration of that loadcase. Review the stress to see that it is under the proper constraints.

    4030_von_mises_optimum
    Figure 3.
Review
The .out file contains a summary of the optimization process. From the information in the.out file, you can see how the objective, constraints, and design variables are changing from one iteration to the next.
Has the volume been minimized for the given constraints?
Have the stress constraints been met?
What are the resulting gauges for the two parts?
Hints
Go to the des.h3d page, clear the contour if one was applied, set to the last simulation step and apply the Element Thickness contour.
Append discrete_bracket_size.mvw to review objective, constraints, and other information.