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

  1. Start HyperStudy.
  2. From the menu bar, click Tools > Editor.
    The Editor opens.
  3. In the File field, open the beam.fem file
  4. In the Find area, enter PSHELL and click until you find the PSHELL card.
  5. 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.

    Figure 1.
  6. Right-click on the highlighted fields and select Create Parameter from the context menu.
  7. In the Parameter: varname_1 dialog, define the Thickness parameter.
    1. In the Label field, enter Thickness.
    2. Change the Upper bound to 0.0022, the Nominal to 0.0020, and the Lower bound to 0.0018.
    3. Change Format to %8.5f.
    4. Click OK.

    Figure 2.
  8. 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

    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
  9. Click Save.
  10. In the Save Template dialog, save the file as beam.tpl.
  11. Close the Editor dialog.
  12. In your favorite text editor, edit the beam.tpl file.
    {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)}
    {elseif (varname_2==7E+10)}

Perform the Study Setup

  1. Start a new study in the following ways:
    • From the menu bar, click File > New.
    • On the ribbon, click .
  2. In the Add Study dialog, enter a study name, select a location for the study, and click OK.
  3. Go to the Define Models step.
  4. Add a Parameterized File model.
    1. From the Directory, drag-and-drop the beam.tpl file into the work area.

      Figure 3.
    2. In the Solver input file column, enter beam.fem.
      This is the name of the solver input file HyperStudy writes during any evaluation.
    3. In the Solver execution script column, select OptiStruct (os).

    Figure 4.
  5. Click Import Variables.
    Two input variables are imported from the beam.tpl resource file.
  6. Go to the Define Input Variables step.
  7. Click the Modes tab.
  8. For the input variable Thickness and Young, set Mode to Discrete.
  9. Define the number of points for Thickness.
    1. In the Values column for the input variable Thickness, click .
      A pop-up window opens.
    2. In the Number of Points field, enter 3.
    3. Click Set.
    4. Change the values in the table to the following: 0.002, 0.004, and 0.005.
    5. Click OK.

    Figure 5.
  10. Define the number of points for Young.
    1. In the Values column for the input variable Thickness, click .
      A pop-up window opens.
    2. In the Number of Points field, enter 2.
    3. Click Set.
    4. Change the values in the table to 7E+10 and 2.1E+11.
    5. Click OK.

Perform Nominal Run

  1. Go to the Test Models step.
  2. 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

In this step you will create one output response,

  1. Go to the Define Output Responses step.
  2. From the Directory, drag-and-drop the beam.out file, located in approaches/setup_1-def/run__00001/m_1, into the work area.
  3. In the File Assistant dialog, set the Reading technology to Altair® HyperWorks® and click Next.
  4. Select Single Item in a Time Series, then click Next.
  5. Define the following options, then click Next.
    1. Set Type to Mass.
    2. Set Request to Mass.
    3. Set Component to Value.

    Figure 6.
  6. Label the output response Mass.
  7. 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.
  8. Click Finish.

    Figure 7.
    The Mass output response is displayed in the work area.
  9. Click Evaluate to extract the response values.