# OS-T: 2030 Control Arm with Draw Direction Constraints

In this tutorial you will perform a topology optimization using draw direction constraints on a control arm.

The finite element mesh contains designable (brown) and non-designable regions (blue) is shown in 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 controlarm.hm file you saved to your working directory from the optistruct.zip file. Refer to Access the Model Files.
3. Click Open.
The controlarm.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 dv1.
5. Set type: to PSOLID.
6. Using the props selector, select Design.
7. Click create.

### Create Draw Direction Constraints

The draw direction constraints allow the casting feasibility of the design so that the topology determined will allow the die to slide in a given direction. These constraints are defined using the DTPL card. Two DRAW options are available. The option 'SINGLE' assumes that a single die will be used. The option 'SPLIT' assumes that two dies splitting apart in the given draw direction will be used to cast the part.
1. Select the draw subpanel.
2. Set draw type: to single.
The option 'SINGLE' assumes that a single die will be used and it slides in the given drawing direction.
3. Define the drawing direction.
1. Click anchor node, and enter 3209 in the id= field.
2. Click first node, and enter 4716 in the id= field.
4. Using the props selector, select the Non-design property.
The non-designable parts are selected as obstacles for the casting process on the same DTPL card, and the casting feasibility of the final structure is persevered.
5. Click update.
6. Click return to go back to the Optimization panel.

### 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. Click create.
4. Create the weighted component response.
1. In the responses= field, enter Comp1.
2. Below response type, select weighted comp.
3. Click loadsteps, then select all loadsteps.
4. Click return.
5. 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 Constr.
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 Compl.
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 controlarm_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 controlarm_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.
The default files that get written to your run directory include:
controlarm_opt.hgdata
HyperGraph file containing data for the objective function, percent constraint violations, and constraint for each iteration.
controlarm_opt.hist
The OptiStruct iteration history file containing the iteration history of the objective function and of the most violated constraint. Can be used for a xy plot of the iteration history.
controlarm_opt.HM.comp.tcl
HyperMesh command file used to organize elements into components based on their density result values. This file is only used with OptiStruct topology optimization runs.
controlarm_opt.HM.ent.tcl
HyperMesh command file used to organize elements into entity sets based on their density result values. This file is only used with OptiStruct topology optimization runs.
controlarm_opt.html
HTML report of the optimization, giving a summary of the problem formulation and the results from the final iteration.
controlarm_opt.mvw
HyperView session file.
controlarm_opt.oss
OSSmooth file with a default density threshold of 0.3. You may edit the parameters in the file to obtain the desired results.
controlarm_opt.out
OptiStruct output file containing specific information on the file setup, the setup of the optimization problem, estimates for the amount of RAM and disk space required for the run, information for all optimization iterations, and compute time information. Review this file for warnings and errors that are flagged from processing the controlarm_opt.fem file.
controlarm_opt.res
HyperMesh binary results file.
controlarm_opt.sh
Shape file for the final iteration. It contains the material density, void size parameters and void orientation angle for each element in the analysis. This file may be used to restart a run.
controlarm_opt.stat
Contains information about the CPU time used for the complete run and also the break-up of the CPU time for reading the input deck, assembly, analysis, convergence, and so on.
controlarm_opt_des.h3d
HyperView binary results file that contain optimization results.
controlarm_opt_frame.html
HTML file used to post-process the .h3d with HyperView Player using a browser. It is linked with the _menu.html file.
controlarm_opt_hist.mvw
Contains the iteration history of the objective, constraints, and the design variables. It can be used to plot curves in HyperGraph, HyperView, and MotionView.
HTML file used to post-process the .h3d with HyperView Player using a browser.
controlarm_opt_s#.h3d
HyperView binary results file that contains from linear static analysis, and so on.

## View the Results

Element density results are output to the controlarm_opt_des.h3d file from OptiStruct for all iterations. In addition, Displacement and Stress results are output for each subcase for the first and last iterations by default into controlarm_opt_s#.h3d files, where # specifies the sub case ID.

### Review the Contour Plot of Element Densities

1. From the OptiStructpanel, click HyperView.
2. In the Results Browser, select the last iteration.
3. From the Results toolbar, click to open the Contour panel.
4. Under Result type, select Element densities (s) and Density.
5. Set the Averaging method: to Simple.
6. Click Apply.

The resulting contours represent the displacement field resulting from the applied loads and boundary conditions.

In this model, refining the mesh should provide a more discrete solution; however, for the sake of this tutorial, the current mesh and results are sufficient.

### Set Iso Plot of Densities

The iso surface feature can be a very useful tool for post-processing density results from OptiStruct. For models with solid design regions, this feature becomes a vital tool for analyzing density results.
1. In the Results Browser, verify the last iteration is still selected.
2. From the Results toolbar, click to open the Iso Value panel.
3. Set the Result type: to Element Densities (s).
4. Click Apply.
5. Change the density threshold.
• In the Current value field, enter 0.3.
• Under Current value, move the slider.
6. Set Show values to Above.
7. Under Clipped geometry, select Features and Transparent.

### View Contour Plot of Displacements and Stresses

1. In the top, right of the application, click to proceed to the results of Load Case 1 on page 3.
2. On the Animation toolbar, set the animation mode to (Linear Static).
3. On the Results toolbar, click to open the Contour panel.
4. Set the Result type: to Displacements (v).
5. Click Apply.
The displacement plot for Iteration 0 displays.
6. In the Results Browser, set the iteration to the last iteration.
A displacement plot for the last iteration displays. The stress results are also available for the respective iterations.
7. Similarly, view the results for Load Case 2 on page 4.