HS-1070: Define Discrete Size Variables with Conditional Linking for use in HyperStudy
Learn how to define discrete input variables that are conditionally linked.
Before you begin, copy the model files used in
this tutorial from <hst.zip>/HS-1070/ to your working
directory.
In this tutorial, beam thickness and material model values are used as variables. Material model values are linked to the selection of the material to be used. The variables you will use in this tutorial include: Shell Thickness, Young's Modulus, Poisson's, Ratio, and Density. The output responses you will use in this tutorial includes: Mass.
Create the Base Import Template
- Start HyperStudy.
-
From the menu bar, click Tools > Editor.
The Editor opens.
- In the File field, open the beam.fem file
- In the Find area, enter PSHELL and click until you find the PSHELL card.
-
In the same line as PSHELL, highlight the value 0.002 for the PSHELL thickness
as indicated in Figure 1.
Note: In an OptiStruct deck, each field within a card is 8 characters long. Properly select the value for the PSHELL thickness by selecting 0.002 and the three spaces that follow.
- Right-click on the highlighted fields and select Create Parameter from the context menu.
-
In the Parameter: varname_1 dialog, define the Thickness
parameter.
- In the Label field, enter Thickness.
- Change the Upper bound to 0.0022, the Nominal to 0.0020, and the Lower bound to 0.0018.
- Change Format to %8.5f.
- Click OK.
-
Add three more input variables to the template file from the MAT1 card using
the information provided in Table 1.
Tip: Quickly highlight 8-character fields by pressing Ctrl to activate the Selector (set to 8 characters) and then clicking the value.
Table 1. Parameter Selection Notification Selection Input Variable Label Lower Bound & Upper Bound Format Young's Modulus Line number: 8267 Fields: 16 to 24
2.1E+11 & 1 space Young Lower Bound: 7E+10 Upper Bound: 2.1E+11
%8.1e Poisson's Ratio Line number: 8267 Fields: 32 to 40
0.3 + 5 spaces Poisson Keep default values %8.5f Density Line number: 8267 Fields: 40 to 48
7820.0 + 2 spaces Density Keep default values %8.3f - Click Save.
- In the Save Template dialog, save the file as beam.tpl.
- Close the Editor dialog.
-
In your favorite text editor, edit the beam.tpl
file.
Replace:
With:{parameter(varname_3, "Poisson", 0.30000, 0.27000, 0.33000)} {parameter(varname_4, "Density", 7820.000, 7038.000, 8602.000)}
{if (varname_2==2.1E+11)} {varname_3=0.3} {varname_4=7820} {elseif (varname_2==7E+10)} {varname_3=0.33} {varname_4=2700} {endif}
Perform the Study Setup
-
Start a new study in the following ways:
- From the menu bar, click File > New.
- 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 Parameterized File model.
-
From the Directory, drag-and-drop the
beam.tpl file into the work area.
-
In the Solver input file column, enter
beam.fem.
This is the name of the solver input file HyperStudy writes during any evaluation.
- In the Solver execution script column, select OptiStruct (os).
-
From the Directory, drag-and-drop the
beam.tpl file into the work area.
-
Click Import Variables.
Two input variables are imported from the beam.tpl resource file.
- Go to the Define Input Variables step.
- Click the Modes tab.
- For the input variable Thickness and Young, set Mode to Discrete.
-
Define the number of points for Thickness.
-
In the Values column for the input variable Thickness, click .
A pop-up window opens.
- In the Number of Points field, enter 3.
- Click Set.
- Change the values in the table to the following: 0.002, 0.004, and 0.005.
- Click OK.
-
In the Values column for the input variable Thickness, click .
-
Define the number of points for Young.
-
In the Values column for the input variable Thickness, click .
A pop-up window opens.
- In the Number of Points field, enter 2.
- Click Set.
- Change the values in the table to 7E+10 and 2.1E+11.
- Click OK.
-
In the Values column for the input variable Thickness, click .
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 beam.out file, located in approaches/setup_1-def/run__00001/m_1, into the work area.
- In the File Assistant dialog, set the Reading technology to Altair® HyperWorks® and click Next.
- Select Single Item in a Time Series, then click Next.
-
Define the following options, then click Next.
- Set Type to Mass.
- Set Request to Mass.
- Set Component to Value.
- Label the output response Mass.
-
Set Expression to First Element.
Note: Because there is only a single value in this data source, [0] is inserted after m_1_ds_1, thereby choosing the first (and only) entry in the data source.
-
Click Finish.
The Mass output response is displayed in the work area.
- Click Evaluate to extract the response values.