OS-T: 5040 Rail Joint

In this tutorial you will perform a shape optimization on a rail-joint. The rail-joint is made of shell elements and has one load case. The shape of the joint is modified to satisfy stress constraints while minimizing mass.

Shape optimization requires you to have knowledge of the kind of shape you would like to change in the structure. This may include finding the optimum shape to reduce stress concentrations to changing the cross-sections to meet specific design requirements. Therefore, you need to define the shape modifications and the nodal movements to reflect the shape changes. Shape optimization requires the use of two cards DESVAR and DVGRID. They can be defined using HyperMorph. Then these cards are included in the OptiStruct input file along with the objective function and constraints to run the shape optimization.

rail_joint
Figure 1. Rail Joint
The optimization problem for this tutorial is stated as:
Objective
Minimize mass.
Constraints
Maximum von Mises stress of the joint < 200 MPa.
Design Variables
Shape variables.

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

Submit the Job

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

    OS_1000_13_17
    Figure 2. Accessing the OptiStruct Panel
  2. Click save as.
  3. In the Save As dialog, specify location to write the OptiStruct model file and enter rail_joint_original 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 rail_joint_original.fem was written. The rail_joint_original.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

HyperView is a complete post-processing and visualization environment for finite element analysis (FEA), multibody system simulation, video and engineering data.
  1. From the OptiStruct panel, click HyperView.
    HyperView launches within the HyperMesh Desktop and loads the result file(s).
  2. On the Results toolbar, click resultsContour-24 to open the Contour panel.
  3. Set the Result type to Element Stresses [2D & 3D] (t) and von Mises.
  4. Click Apply.
    Take note of the Maximum von Mises Stress of the joint.

    5040_von_mises
    Figure 3. von Mises Stress for the Intial Design
  5. From the Page Controls toolbar, click pageDelete-24 to delete the page within the HyperView client.
    You should now be on Page 1 in the HyperMesh client.
  6. Click return to exit the panel.

Set Up the Model

Display Node IDs

  1. From the Tool page, click the numbers panel.
  2. Click nodesby sets.
  3. Select node set.
  4. Click select.
    Sixteen (16) nodes are highlighted.
  5. Click on to display node IDs.
  6. Click return.

Build 2D Domains on the Rail

  1. In the Model Browser, Component folder, right-click on PSHELL and select Isolate from the context menu.
    All components except PSHELL are turned off for ease of visualization.
  2. From the Analysis page, click the optimization panel.
  3. Click the HyperMorph panel.
  4. Click the domains panel.
  5. Edit partitioning settings.
    1. Select the partitioning subpanel.
    2. For domain angle =, enter 50.
    3. For curve tolerance =, enter 8.0000.
  6. Create domains.
    1. Select the create subpanel.
    2. Switch from global domains to 2D domains.
    3. Switch all elements to elems.
    4. Click elems > by sets.
    5. Select rail_set1 and rail_set2, then click select.
    6. Click create.

    rail_domains
    Figure 4. Rail Domains

Split the Circular Edge Domains Around the Opening of the Rail

In this step you will split each of the two circular domains into four curved edge domains.
  1. Select edit edges subpanel.
  2. Set the top selector to split.
  3. Split the first circular edge-domain.
    1. Using the domain selector, select the circular edge-domain passing through nodes 1300, 1305, 1311, and 1316.
    2. Using the node selector, select node 1311.
    3. Click split.
      The circular domain is split at node 1311 and a new handle is created at node 1311.
    4. Using the domains selector, select the circular edge between node 1311 and the other handle.
    5. Using the node selector, select node 1316.
    6. Click split.
    7. Split the curved edge at nodes 1305 and 1300, respectively.
  4. Split the circular domain using the four nodes on the other side of the rail.
    1. Using the domain selector, select the circular edge-domain passing through nodes 931, 926, 937 and 942.
    2. Using the node selector, select node 931.
    3. Click split.
    4. Using the domain selector, select the circular edge between node 931 and the other handle.
    5. Using the node selector, select node 926.
    6. Click split.
    7. Split the curved edge at nodes 937 and 942, respectively.

rail_circular
Figure 5. Rail Domains After The Circular Edge Have Been Split

Merge Edge Domains

Each circular domain on the rail has been split at four nodes and four new handles have been added to each circular domain. This operation results in five curved edge domains on each circular edge on the rail. The objective is to have only four domains. In this step you will merge domains.
  1. In the edit edges subpanel, switch from split to merge.
  2. Merge the domains between nodes 926 and 924.
    1. Using the domain selector, select the outer red curve from node 926 to pre-existing handle.
    2. Select the outer red curve from pre-existing handle to node 942.
    3. Uncheck retain handles.
    4. Click merge.
    The pre-existing handle is removed.
  3. Merge the domains between nodes 1316 and 1300.

rail_merged
Figure 6. Rail Domains After Few Domains Are Merged

Build 2D Domains on the Tube

  1. In the Model Browser, Component folder, right-click on PSHELL.1 and select Show from the context menu.
  2. In the domains panel, select the create subpanel.
  3. Set the top selector to 2D domains.
  4. Create a domain for the element set, elem_set1.
    1. Click elems > by sets.
    2. Select elem_set1, then click select.
    3. Click create.
  5. Create three more 2D domains for elements in sets elem_set2, elem_set3, and elem_set4.
  6. Click return and go back to the HyperMorph module.

domains_rail
Figure 7. Domains on Rail and Tube Joint

Create Shapes

In this step you will create shapes using the created domains and handles.
  1. Click the morph panel.
  2. Modify the curvatures of selected edge domains for the first shape.
    1. Select the alter dimensions subpanel.
      The alter dimensions subpanel can be used to modify the curvatures of selected edge domains.
    2. Set the first switch to curve ratio.
    3. Set center calculation to by edges.
    4. Under the edges only: domains selector, set the switch to hold ends.
      Holding two ends of a selected edge domain allows a change of curvature of the selected edge without altering its end points.
    5. Leave the other settings with the defaults.
    6. Using the domains selector, select the red edge-domains.
      Tip: You might need to zoom in for easier picking operation.
      A total of eight edge domains are selected and highlighted.

      morph_edge
      Figure 8. Morph edge Domains
    7. In the curve ratio = and enter 20.
    8. Click morph.
    A new curvature is applied to the selected eight edge domains.
  3. Save the shape, sh1.
    1. Select the save shape subpanel.
    2. In the shape= field, enter sh1.
    3. Toggle as handle perturbation to as node perturbation.
    4. Click color and change the color of the shape vectors or leave the default color.
    5. Click save.
    Shape vectors (arrows) are created of the selected color.

    rail_sh1
    Figure 9. Shape Variable, sh1.
  4. Click undo all to prepare for the generation of the next shape.
  5. In the Model Browser, right-click on Shape and select Hide from the context menu.
  6. Select the alter dimensions subpanel.
  7. Next to the domains selector, click reset to reset and remove any previous selections.
  8. Modify the curvatures of selected edge domains for the first shape.
    1. Using the domains selector, select the red edge curves.

      morph_2nd
      Figure 10. Morph Edge Domains For The Second Shape
    2. Click morph.
    A new curvature is applied to the selected eight edge domains.
  9. Save the shape, sh2.
    1. Select the save shape subpanel.
    2. In the shape= field, enter sh2.
    3. Toggle as handle perturbation to as node perturbation.
    4. Click color and change the color of the shape vectors or leave the default color.
    5. Click save.

    rail_sh2
    Figure 11. Shape Variable, sh2
  10. Click undo all to prepare for the generation of the next shape.
  11. In the Model Browser, right-click on Shape and select Hide from the context menu.
  12. Create a new shape as a linear combination of existing shapes.
    1. Select the apply shapes subpanel.
    2. Using the shapes selector, select sh1 and sh2.
    3. In the multiplier= field, enter 1.0.
    4. Click apply.
  13. Save the shape, sh3.
    1. Select the save shape subpanel.
    2. In the shape= field, enter sh3.
    3. Toggle as node perturbation to as handle perturbation.
    4. Click color and change the color of the shape vectors or leave the default color.
    5. Click save.
    The new shape, sh3, includes influences from both sh1 and sh2 shapes.

    rail_sh3
    Figure 12. Shape Variable, sh3. This shape variable converts the tube to a square cross-section.

CAUTION:
Do not click undo all at this moment, because one more shape based on this third shape change will be created.

  1. In the Model Browser, right-click on Shape and select Hide from the context menu.
  2. In the Model Browser, Component folder, right-click PSHELL and click Hide from the context menu.
    The component is turned off for ease of visualization.
  3. Modify the curvatures of selected edge domains for the first shape.
    1. Select the alter dimensions subpanel.
    2. Next to the domains selector, click reset to reset and remove any previous selections.
    3. Switch the top selector from curve ratio to distance.
      This feature allows you to shorten the distance between selected domains.
    4. Set end a to nodes and handles.
    5. Using the node a and node b selectors, select the nodes indicated in Figure 13.

      set_up_4
      Figure 13.
      Once nodes a and b are selected, the distance between node a and node b is measured automatically and appears in distance = field. The distance between node a and node b is about 43.
    6. Under followers (end a), use the handles selector to select the eight handles shown by the downward pointing arrows in Figure 13.
    7. Under followers (end b), use the handles selector to select the eight handles near the opposite face of the tube.
    8. Set the bottom selector to hold middle.
      These components are turned on for ease of visualization.
    9. In the distance= field, enter 20.
    10. Click morph.
    A rectangular shape appears to the joint.
  4. Save the shape, sh4.
    1. Select the save shape subpanel.
    2. In the shape= field, enter sh4.
    3. Toggle as handle perturbation to as node perturbation.
    4. Click color and change the color of the shape vectors or leave the default color.
    5. Click save.

    rail_4
    Figure 14. Shape Variable, sh4
  5. Click undo all to restore the mesh to the baseline configuration.
  6. In the Model Browser, right-click on Shape and select Hide from the context menu.
  7. Click return three times to go the main menu.

Set Up the Optimization

Define the Shape Design Variables and Review Animation

  1. From the Analysis page, click the optimization panel.
  2. Click the shape panel.
  3. Select the desvar and create subpanels.
  4. Set single desvar to multiple desvars.
  5. Create shape design variables.
    1. Using the shapes selector, select sh1, sh2, sh3 and sh4.
    2. In the initial value = field, enter 0.0.
    3. In the lower bound = field, enter -1.0.
    4. In the upper bound = field, enter 1.0.
    5. Click create.
    Four design variables are created with the same initial value, lower bound, and upper bound. HyperMesh automatically links the design variables to each shape, respectively and assigns names to each design variable the same as its associated shapes.
  6. Animate the shapes.
    1. Click animate.
    2. Click simulation= and select SHAPE-sh1(1).
    3. Set data type= to Perturbation vector.
    4. Click modal.
    5. Click next and then animate to see the next shape variable, and so forth.
  7. Click return three times to go back to the Optimization panel.

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 PSHELL.1.
    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 con.
  3. Click response = and select Stress.
  4. Check the box next to upper bound, then enter 200.
  5. Using the loadsteps selector, select STEP.
  6. Click create.
  7. Click return to go back to the Optimization panel.

Define Control Cards for Shape Optimization

Without this control card defined, optimization gets terminated by quality check and you do not get the converged results.
  1. From the Analysis page, click the control cards panel.
  2. In the Card Image dialog, click PARAM.
  3. Select CHECKEL.
  4. Set CHECKEL_V1 to NO.
  5. Click return twice.

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 rail_joint_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 rail_joint_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

Review the Shape Optimization 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 Shape Change [v] and mag.
    Shape Change [v] should be the only results type in the rail_joint_opt_des.h3d file.
  4. Click Apply.
    The shape change displays. The contour is all blue because your results are on the first design step or Iteration 0.
  5. In the Results Browser, select the last iteration.
    Each element of the model is assigned a legend color, indicating the density of each element for the selected iteration. Shape optimization results are applied to the model.

    5040_converged
    Figure 15.

    5040_converged2
    Figure 16. Shape Change Converged (Scale 2x)

View a Contour Plot of the Stress

  1. In the top, right of the application, click to proceed to page 2.
  2. On the Results toolbar, click resultsContour-16 to open the Contour panel.
  3. Set the Result type to Element Stresses [2D & 3D] [t] and von Mises.
  4. In the Results Browser, select the last iteration.
  5. Click Apply.
The stress contour shows on top of the shape changes applied to the model. Verify that this value is around the constraint value specified.

5040_von_mises_last_iter

5040_von_mises_max
Figure 17. von Mises Stress for the Last Iteration (Max < 200 MPa)

Review the Results

Is your design objective of minimizing the volume obtained? If not, can you explain why?

Are your design constraints satisfied?

Which shape has the most influence in this problem setup?

What is the percentage decrease in compliance?

Can size optimization be introduced to the joint?