OS-T: 4080 Minimization of the Maximum Stress of a Rotating Bar

In this tutorial you will set up and run a multibody dynamics (MBD) size optimization of a rotating bar.

Before you begin, copy the file(s) used in this tutorial to your working directory.
Angular velocity at the revolute joint defined left end of the bar is 10*SIN(2*TIME) rad/sec. The objective is to minimize the maximum stress of the structure subject to certain mass specifications. The bar consists of five bar elements with a solid circle cross section (each element has its own PBARL with ROD cross section). The design variables are the radius of each bar property.

4080_bar
Figure 1. Structural Model of a Rotating Bar
The optimization problem is stated as:
Objective
Minimize maximum normal stress.
Constraints
Mass < 10kg.
Design Variables
Radius of each bar properties (PBARL).

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

Set Up the Model

Define Boundary Conditions for Structural Analysis

Structural analysis and optimization of the flexible bodies of this model are performed in ESL optimization. Thus, the boundary condition for the flexible bodies needs to be defined.
  1. Create a load collector.
    1. In the Model Browser, right-click and select Create > Load Collector from the context menu.
      A default load collector displays in the Entity Editor.
    2. In the Name field, enter BCforOpt.
  2. Enable coincident picking.
    1. From the menu bar, click Preferences > Graphics.
    2. Select the graphics subpanel.
    3. Select coincident picking.
    4. Click return.

    4070_coincident
    Figure 2.
  3. In the Model Browser, click tabProperties-24 to display the properties view.
  4. Create constraints.
    Only 6 dof per flexible body should be fixed to remove 6 rigid body motion of each flexible body.
    1. From the Analysis page, click the constraints panel.
    2. Click the left end of the model.
      Two node numbers display.
    3. Select node number 1.

      4080_node1
      Figure 3.
    4. Select all dofs (dof1 to dof6), and verify that their values are set to 0.0.
    5. Click create.
    6. Click return.

Define a Driving Motion Not Supported by HyperMesh

In this tutorial, the driving motion at a joint, MOTNJE is defined. However, MOTNJE is currently not supported by HyperMesh. Thus, you need to enter this card and a corresponding MBVAR card manually.
  1. From the Analysis page, click the control cards panel.
  2. Click BULK_UNSUPPORTED_CARDS.
  3. Verify the following two cards are listed. If they are not listed, enter the cards.

    4080_controlcard_manual
    Figure 4.
  4. Click OK.
  5. Click return.

Edit the Load Step

  1. In the Model Browser, click SUBCASE1.
    The load step's data displays in the Entity Editor.
  2. In the Name field, enter Dynamic.
  3. Set the Analysis type to multi-body dynamics.
  4. Define SPC.
    1. For SPC, click Unspecified > Loadcol.
    2. In the Select Loadcol dialog, select BCforOpt and click OK.
  5. Define MBSIM.
    1. For MBSIM, click Unspecified > Loadcol.
    2. In the Select Loadcol dialog, select MBSIM1 and click OK.
  6. Define MOTION.
    1. For MOTION, click Unspecified > Loadcol.
    2. In the Select Loadcol dialog, select MBSIM1 and click OK.

Set Up the Optimization

Define the Size Optimization 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, rad1.
    1. In the desvar = field, enter rad1.
    2. In the initial value = field, enter 10.
    3. In the lower bound = field, enter 0.05.
    4. In the upper bound = field, enter 100.
    5. Set the move limit toggle to move limit default.
    6. Set the discrete design variable (ddval) toggle to no ddval.
    7. Click create.
    A design variable, rad1, has been created. The design variable has an initial value of 10, a lower bound of 0.05, and an upper bound of 100.
  5. Create the design variable rad2, rad3, rad4, and rad5 using the same initial value, lower, and upper bounds as rad1.
  6. Select the generic relationship subpanel.
  7. Create a design variable property relationship, bar1_rad1.
    1. In the name = field, enter bar1_rad1.
    2. Using the prop selector, select PBARL_1.
    3. Under the props selector, select Dimension 1.
    4. Click designvars.
    5. Select rad1.
      Note: The linear factor is automatically set to 1.000.
    6. Click return.
    7. Click create.
    A design variable to property relationship, bar1_rad1, has been created relating the design variable rad1 to the radius entry on the PBARL card for property PBARL_1.
  8. Create the design variable to property relationship bar2_rad2, bar3_rad3, bar4_rad4, and bar5_rad5 relating the design variables to the radius entry on the PBARL cards for the property PBARL_2, PBARL_3, PBARL_4, and PBARL_5.
  9. Click return to go to the optimization panel.

Create the Mass and Stress Responses

  1. Create the response, Mass.
    1. Click the responses panel.
    2. In the response = field, enter Mass.
    3. Set the response type to mass.
    4. Set the regional selection to total (this is the default).
    5. Click create.
    A response, mass, is defined for the total mass of the model.
  2. Create the response, Stress.
    1. Click the responses panel.
    2. In the response = field, enter Stress.
    3. Set the response type to static stress.
    4. Click props.
    5. Select all of the properties in the list and click select.
    6. Set the stress to normal.
    7. Set the stress recovery point to all.
    8. Click create.

    4080_normal_all
    Figure 5.
  3. Click return to go to the optimization panel.

Create Design Constraints

  1. Click the dconstraints panel.
  2. In the constraint= field, enter Mass.
  3. Click response = and select Mass.
  4. Check the box next to upper bound, then enter 10.0.
  5. Click create.
  6. Click return to go back to the Optimization panel.

Define the Objective Function

The objective of this tutorial is to minimize the maximum stress of the model while the model rotates.
  1. Create an objective reference.
    1. Click the obj reference panel.
    2. In the dobjref= field, enter MaxStress.
    3. Click response= and select Stress.
    4. Select neg reference= and pos reference=.
    5. Switch the toggle from all to loadsteps, then use the loadsteps selector to select Dynamic.
    6. Click create.
    7. Click return to go back to the Optimization panel.
  2. Define the objective.
    1. Click the objective panel.
    2. Select minmax.
    3. Using the dobjrefs= selector, select MaxStress.
    4. Click create.
    5. Click return to go back to the Optimization panel.

Save the Database

  1. From the menu bar, click File > Save As > Model.
  2. In the Save As dialog, enter rotating_bar_design.hm for the file name and save it to your working directory.

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 rotating_bar_design 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.
  9. Click Close.

If the optimization was successful, no error messages are reported to the shell. The optimization is complete when the message Processing completed successfully appears in the shell.

If the job was successful, the new results file can be seen in the directory where the input file was saved. In addition to ordinary output files, you can see a text file with the name rotating_bar_design.eslout. This file is a good source to see the process of the ESL optimization.

After ~ 7 interations, the model should converge to the descending values shown in Figure 6.


Figure 6.