HS-1080: Set Up an Operator Model
Learn how to use the Operator model type to run a script that uses a combination of HyperView and HVTrans to split the solver result file in multiple result files, one for each component in the model.
This tutorial uses a model which consists of a plate with a hole which is loaded in plane. The design has three thickness variables; one for each zone. The output responses of interest are the maximum stress in each of the three zones.
Perform the Study Setup
- Start HyperStudy.
-
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 Parameterized File model.
Figure 2.
-
Click Import Variables.
Three input variables are imported from the plate.tpl resource file.
- Go to the Define Input Variables step.
- Review the input variable's lower and upper bound ranges.
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.
Set Up the Operator Model
- Go to the Define Models step.
-
Add an Operator model.
- Click Add Model.
- In the Add - HyperStudy dialog, select Operator and click OK.
- Set the Solver execution script in the following ways:
Option Description Python based model - Set the Solver Execution Script to Python (py).
- In the Solver Input Arguments column, enter
${m_2.file_2} ${m_2.file_4}.
The input arguments are references to the model resources' varnames. The first argument (m_2.file_2) is a reference to the model resource’s varname, and tells python which script to run. The second argument (m_2.file_4) is the varname to the target result file to split, and will be the first argument to the python script.
See Figure 3.
Direct Solver (hw.exe) Model - Set the Solver Execution Script to HyperWorks (hw.exe).
- In the Solver Input Arguments column, enter -tcl
${m_2.file_2} -b -result ${m_2.file_3}.
The input arguments are references to the model resources' varnames. The first argument (m_2.file_2) is a reference to the model resource’s varname, and tells hw.exe which tcl script to run. The second argument (m_2.file_3) is the varname to the target result file to split.
See Figure 4.
Figure 3.
Figure 4.
-
Click Model Resources.
The Model Resources dialog opens.
-
Define a model dependency that references the python script that will be used
as the solver script.
This is a reference to a file that is not generated during a solver run, therefore it is of type Normal. This file does not need to be in the run directory.
- Select Operator 1 (m_2).
- Click .
- In the Select File dialog, navigate to your working directory and open the corresponding file:
Option Description Python based model hv_resultsbyComp.py Direct Solver (hw.exe) Model hv_resultsbyComp.tcl - Set Operation to None.
-
Define a model dependency that references the corresponding script:
Option Description Python based model - Define a model dependency that references the
tcl script that will be used to run
HyperView and HvTrans in batch.
This is a reference to a file that is called by the python script and not by a solver, therefore it is of type Normal. This file is required to be in the run directory.
- Select Operator 1 (m_2).
- Click .
- In the Select File dialog, navigate to your working directory and open the hv_resultsbyComp.tcl file.
- Set Operation to Copy.
Direct Solver (hw.exe) Model - Define a model dependency that HyperWorks executable directly
consumes the automation script.
This is a reference to a file that is not generated during a solver run, therefore it is of type Normal. This file does not need to be in the run directory.
- Select Operator 1 (m_2).
- Click .
- In the Select File dialog, navigate to your working directory and open the hv_resultsbyComp.tcl file.
- Set Operation to None.
- Define a model dependency that references the
tcl script that will be used to run
HyperView and HvTrans in batch.
-
Define a model dependency that will be used as a link to the result file from
the first model.
This file is the target file for the tcl script, and it is required to be in the run directory. It is a file that changes for each run, therefore it is a linked file and it is copied in the run directory.Note: The file can be moved.
- Select Operator 1 (m_2).
- Click .
- In the Select File dialog, navigate to the approaches/setup_1-def/run__00001/m_1 directory and open the plate.h3d file.
- Click OK.
- Click Close to exit the Model Resources dialog.
Perform Nominal Run
- Go to the Test Models step.
- Click Run Definition.
-
In the Altair HyperStudy dialog, click
Overwrite.
The m_1 and m_2 directories are created inside the approaches/setup_1-def/run__00001/ directory.
Create and Evaluate Output Responses
In this step you will create four output responses: maxStressPart2, maxStressPart4, maxStress3, Volume.
- Go to the Define Output Responses step.
-
Create the maxStressPart2 output response.
-
Create the maxStressPart4 output response.
-
Create the maxStress3 output response.
-
Create the Volume output response.
The Volume output response is added to the work area.
- Click Evaluate to extract the response values.
![](../../../images/tutorials/hst/hs_1080_output_response_evaluate.png)
Run DOE
-
Add a DOE.
- Go to the step.
- In the work area, set the Mode to Modified Extensible Lattice Sequence.
- Click Apply.
- Go to the step.
- Click Evaluate Tasks.
- Go to the step.
-
Click the Pareto Plot tab to plot the effects of
variables on output responses in hierarchical order (highest to lowest).
Each variable contributes nearly equally to volume. A positive hashing indicates that the relationship is positive: as the variable increases, mass increases. For the three stress output responses, the maximum stress in each zone is dominated by the thickness of that zone.
Figure 9.