OS-T: 2040 Spot Weld Reduction using CWELD and 1D

In this tutorial you will perform a 1D topology optimization. The model used in this tutorial is a simple welded hat section. The welding is modeled using CWELD elements.

The objective of this tutorial is to minimize the weighted compliance through all three load cases. The volume fraction of the weld component is limited to 0.3. The design space is the spot weld component.

2040_initial_model
Figure 1.

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

Set Up the Optimization

Create Topology Design Variables

  1. From the Analysis page, click optimization.
  2. Click topology.
  3. Select the create subpanel.
  4. In the desvar= field, enter tpl.
  5. Set type: to PWELD.
  6. Using the props selector, select PWELD_500.
  7. Click create.
  8. Click return.

Create Optimization Responses

  1. From the Analysis page, click optimization.
  2. Click Responses.
  3. Create the volume fraction response.
    1. In the responses= field, enter Volfrac.
    2. Below response type, select volumefrac.
    3. Set regional selection to by entity and no regionid.
    4. Using the props selector, select PWELD_500.
    5. Click create.
  4. Create the weighted component response.
    1. In the responses= field, enter wcomp.
    2. Below response type, select weighted comp.
    3. Click loadsteps, then select all loadsteps.
    4. Change the weighting factors for SUBCASE200 and SUBCASE300 to 100.0.
      This increases the influence of the two bending load cases vs. the torsion load case SUBCASE1, which remains at 1.0.
    5. Click return.
    6. 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 volfrac.
  3. Click response = and select Volfrac.
  4. Check the box next to upper bound, then enter 0.3.
  5. Click create.
  6. 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 wcomp.
  4. Click create.
  5. Click return twice to exit the Optimization panel.

Modify Optimization Parameters

To achieve good results, some optimization parameters need to be modified.
  1. Click the opti control subpanel.
  2. Check the box next to DISCRT1D =, then enter 20.0.
    This increases the penalty factor in the density method only for the 1D elements to achieve a discrete result.
  3. Check the check box next to OBJTOL =, then enter 1.e-5.
    This reduces the objective tolerance that is checked for convergence.
  4. 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 hut_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 hut_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

In this step you will visualize the new spot weld configuration. To post-process the results, the weld elements will be sorted by density into different components.
  1. From the menu bar, click File > Run > Command File.
  2. In the Open Command File dialog, open the hut_opt.HM.comp.tcl output file from your OptiStruct run.
    Four of the welds are in the DENS 0.9-1.0 component; all others are in the DENS 0.0-0.1 component.
  3. To do a re-analysis with the new weld configuration, undisplay the components with low density (DENS 0.0-0.1 to DENS 0.8-0.9) and rerun the analysis with export options: set to displayed in the OptiStruct panel.

    2040_final_model
    Figure 2. Final Configuration