OS-T: 5050 4 Bar Linkage

In this tutorial you will set up the structural optimization problem of MBD systems with HyperMesh, and run the shape optimization job in OptiStruct.

The mass of the system is to be minimized by controlling 12 shape design variables while the stress should be less than an allowable value. Left link is a driving link whose angular velocity is 50 rad/sec. Units (kg, N, cm, s).

linkage
Figure 1. 4 Bar Linkage
The optimization problem for this tutorial is stated as:
Objective
Minimize mass.
Constraints
Upper bound on stress.
Design Variables
Shape design variables of the three flexible bodies.

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 4bar_design.hm file you saved to your working directory from the optistruct.zip file. Refer to Access the Model Files.
  3. Click Open.
    The 4bar_design.hm database is loaded into the current HyperMesh session, replacing any existing data.

Set Up the Model

Define a Driving Motion

In this tutorial, the driving motion at a joint, MOTNJ is defined. However, MOTNJ is not currently supported by HyperMesh, so the card needs to be entered manually.
  1. From the Analysis page, click the control cards panel.
  2. In the Card Image dialog, click BULK_UNSUPPORTED_CARDS.
  3. In the Control Card dialog, enter the following and click OK.

    5050_control_card

    5050_rev_66299
    Figure 2. Constant velocity (50 Rad/s) applied to the joint 66299
  4. Click return.

Update Boundary Conditions and MOTION

  1. In the Model Browser, Load Steps folder, click SUBCASE1.
    The Entity Editor opens and displays the load steps card details.
  2. Set the Analysis type to Multibody dynamics.
  3. For MBSIM, select MBSIM1.
  4. Select SUBCASE_UNSUPPORTED.
  5. Click table_pencil and enter MOTION = 1.

Submit the Job

  1. From the Analysis page, click the OptiStruct panel.

    OS_1000_13_17
    Figure 3. Accessing the OptiStruct Panel
  2. Click save as.
  3. In the Save As dialog, specify location to write the OptiStruct model file and enter 4bar_design_analysis 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 analysis.
  7. Set the memory options toggle to memory default.
  8. Click OptiStruct to launch the OptiStruct job.
If the job is successful, new results files should be in the directory where the 4bar_design_analysis.fem was written. The 4bar_design_analysis.out file is a good place to look for error messages that could help debug the input deck if any errors are present.

View the Results

  1. From the OptiStruct panel, click HyperView.
    HyperView is launched and the results are loaded. A message window appears to inform of the successful model and result files loading into HyperView.
  2. On the Results toolbar, click resultsContour-16 to open the Contour panel.
  3. Set the Result type to Element Stresses (2D & 3D) (t).
  4. Click Apply.
  5. Click the Legend tab.
  6. Click Edit Legend.
  7. Set the Type to Dynamic scale.
    Other properties can be changed here to created the desired legend.
  8. On the Page Controls toolbar, set the page layout to pageLayout2Vertical-24, which create two vertical windows.
  9. Click the second window to make it active.
  10. From the client selector, select clientHyperGraph-24 (HyperGraph 2D).
  11. Click the first window to make it active.
  12. On the Annotations toolbar, click annotateMeasures-24 to open the Measure panel.
  13. In the Measure Groups list, select Dynamic MinMax Result.
  14. From the list below Resolved in , click Max.
  15. Click Create Curve.
  16. Set Place curve on: to Existing Plot.
    A list of plot windows on this report are exposed.
  17. Select Live link.
  18. Click window 2 to make it active.
  19. Click Apply.
    The Maximum von Mises stress (t) is plotted.

    5050_mbd_stress
    Figure 4. MBD Stress results (Max = 56996 N/cm2)
  20. Save the file as a template to be applied on the optimization results.
    1. From the menu bar, click File > Save As > Session.
    2. In the Save Session As dialog, save the file as Stress_report.tpl.
  21. In the top, right of the application, click pagePrevious-24/pageNext-24 to return to Page 1 and the HyperMesh client.

Set Up the Optimization

Create 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 the load collector, BCforOpt.
    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. For Name, enter BCforOpt.
    3. Click Color and select a color from the color palette.
    4. Set Card Image to None.
  2. Enable coincident picking.
    1. From the menu bar, click Preferences > Graphics.
    2. Select coincident picking.
    3. Click return.
  3. Create constrains.
    1. From the analysis page, click the constraints panel.
    2. Select all dofs (1 through 6).
      All of the dofs (1 through 6) should be fixed to remove the 6 rigid body motion of each flexible body. Make sure that dof1 through dof6 are all checked in the constraints panel.
    3. Click the center of the lower spider of the component Left. You should see two node numbers at one location; choose node 288.
    4. Click the center of the left spider of the component Middle and choose node 143.
    5. Click the center of the lower spider of the component Right and choose node 441.
    6. Set load type to SPC.
    7. Click create.

    6dof
    Figure 5. Nodes to be constrained to arrest rigid body motions

Update Boundary Condition and MOTION in the Predefined MBD Subcase

  1. In the Model Browser, Load Steps folder, select SUBCASE1.
    The Entity Editor opens and displays the load steps card details.
  2. Set the Analysis type to Multi-body dynamics.
  3. For MBSIM, select MBSIM1.
  4. For SPC, select BCforOpt.

Define Shape Design Variables

The shape perturbation vectors already have been created in this database. For more details about creating shape perturbation vectors, refer to other tutorials related to HyperMorph. In this step, you will define shape design variables with the predefined shape perturbation vectors.
  1. From the Analysis page, click the optimization panel.
  2. Click the shape panel.
  3. Select the desvar subpanel.
  4. Switch from single desvar to multiple desvars.
  5. Using the shapes selector, select all shapes.
  6. In the lower bound= field, enter -1.0.
  7. In the upper bound= field, enter 1.2.

    5050_bounds
    Figure 6.
  8. Click create.
  9. Click return to go to the optimization panel.
12 shape design variables are created.

Create Optimization Responses

  1. From the Analysis page, click optimization.
  2. Click Responses.
  3. Create the mass response, which is defined for the total volume of the model.
    1. In the responses= field, enter mass.
    2. Below response type, select mass.
    3. Set regional selection to total and no regionid.
    4. Click create.
  4. Create a static stress response.
    1. In the response= field, enter Stress.
    2. Set the response type to static stress.
    3. Using the props selector, select Middle, Left, Right.
    4. Set the response selector to von mises.
    5. Under von mises, select both surfaces.
    6. Click create.
  5. 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 Mass.
  4. Click create.
  5. Click return twice to exit the Optimization panel.

Create Design Constraints

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

A constraint is defined on the response Stress. The constraint will force the maximum stress on SUBCASE1 to be less than 30000.0 N/cm2.

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 4bar_design_opt 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 4bar_design_opt.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 Stress Results

  1. From the OptiStruct panel, click HyperView.
    HyperView is launched and the results are loaded. A message window appears to inform of the successful model and result files loading into HyperView.
  2. Open the report template, Stress_report.tpl.
    1. From the menu bar, click File > Open > Report Template.
    2. In the Open Report File dialog, open the Stress_report.tpl file.
  3. For GRAPHIC_FILE_1 and RESULT_FILE_1, select 4bar_design_opt_mbd_0#.h3d from where the optimization was run (the highest # should be the final iteration).
    A message appears explaining that the Element Stresses (2D & 3D) results do not exist - this is because the stress results on MBD simulations are just named Stress.
  4. Close the Message Log window.
  5. Click on window 1 to make it current.
  6. On the Results toolbar, click resultsContour-16 to open the Contour panel.
  7. Set the Result type: to Stress (t).
  8. Click the traffic light icon to start the animation.

5050_von_mises_contour
Figure 7. von Mises stress contour (Max < 30000 N/cm2)

Contour the Shape Change

  1. On the Page Controls toolbar, click pageNew-24 to add a new page to the session.
  2. On the Standard toolbar, click fileOpenResults-24 and open the last iteration (highest) number result file of 4bar_design_opt_des_0#.h3d from where the optimization was run.
  3. Click Apply.
  4. On the Results toolbar, click resultsContour-16 to open the Contour panel.
  5. Set the Result type: to Shape Change (v).
  6. Click Apply.

5050_shape_change_contour
Figure 8. Shape changing contour

Open the file 4bar_design_opt.dsvar to see how OptiStruct changed the DVs during the optimization process.

This will show that all DVs for the right and mid arms went to the limit of 1.2, showing that minimizing the mass of these two arms are key to reducing the Stress.