HS-1540: Set Up a Shape Optimization Study Using HyperMesh and ANSYS
Learn how to perform a shape Optimization started from inside HyperMesh using the direct link to HyperStudy.
The finite element solver is ANSYS. HyperMorph is used to do the shape parameterization. The objective is to minimize the maximum stress of a plate with a hole. The solution can be expected to be some kind of ellipse. Hence, the input variables are the half-axes of the hole.
Set Up Model in HyperMesh
- From the Startup dialog, start a new session and verify that HyperMesh is selected.
- For Profile, select Ansys.
- Click Create Session.
- In the User Profiles dialog, set the user profile to Ansys.
- From the menu bar, click .
- Set File type to Ansys.
- In the File field, open the plate.cdb file.
-
In the Solver Import Options dialog, click
Import.
A finite element model appears in the graphics area.
Parametrize Shapes in HyperMorph
-
If necessary, enable the HyperMorph panel.
-
Generate the domains and handles that you will use to manipulate the shape of
the mesh and to generate shape perturbations for shape optimization.
- Click return.
- In the panel area, click morph.
-
Alter dimensions.
-
Click morph.
The first shape is generated.
-
Save shape, sh1.
- In the alter dimension subpanel, click undo to prepare for the generation of the next shape.
-
Generate second shape.
- Save shape by repeating step 7, but rename the shape as sh2.
- In the move handles subpanel, click undo to prepare for the generation of the next shape.
-
Generate third shape.
- Save shape by repeating step 7, but rename the shape as sh3.
- Click undo all to restore the initial mesh.
-
Save HyperMesh model.
- From the menu bar, click .
- In the Save File As dialog, save the file as plateDV.hm.
- Close HyperMesh Desktop.
Register ANSYS as a Solver
- Start HyperStudy.
-
From the menu bar, click .
The Register Solver Script dialog opens.
-
Add solver script.
- In the Path column of the script Ansys, click .
-
In the Open dialog, open the
ansys.bat file.
The script ansys.bat is a sample of an execution script for Ansys on Windows. Copy ansys.bat to your working directory to use it.
- Click OK.
Perform the Study Setup
-
Start a new study in the following ways:
- From the menu bar, click .
- On the ribbon, click .
- In the Add Study dialog, enter a study name, select a location for the study, and click OK.
- Go to the Define Models step.
-
Add a HyperMesh model.
-
Import variables.
- Go to the Define Input Variables step.
-
Review the input variable's lower, initial, and upper bounds.
Perform Nominal Run
- Go to the Test Models step.
-
Click Run Definition.
An approaches/setup_1-def/ directory is created inside the study Directory. The approaches/setup_1-def/run__00001/m_1 directory contains the input file, which is the result of the nominal run.
Create and Evaluate Output Responses
- Go to the Define Output Responses step.
- From the Directory, drag-and-drop the plate.rst file, located in the approaches/setup_1-def/run__00001/m_1 directory, into the work area.
- In the File Assistant dialog, set the Reading technology to Altair® HyperWorks® and click Next.
- Select Multiple Items at Multiple Time Steps (readsim), then click Next.
-
Define the following options and click Next.
- Set Subcase to Step 1.
- Set Type to Stress (2D).
- Set Request to First - Last.
- Set Component to vonMises.
- Optional: Enter labels for the data source and output response.
- Set Expression to Maximum.
-
Click Finish.
Output response 1 is added to the work area.
- Click Evaluate to extract the response values.
Run Optimization
-
Add an Optimization.
- In the Explorer, right-click and select Add from the context menu.
- In the Add dialog, select Optimization.
- For Definition from, select Setup and click OK.
- Go to the step.
- Click the Objectives/Constraints - Goals tab.
-
Add an objective to Response 1.
- Click Add Goal.
- In the Type column, select Minimize.