HyperStudy

HS-1580: DOE Study Using CATIA

HS-1580: DOE Study Using CATIA

Previous topic Next topic Expand/collapse all hidden text  

HS-1580: DOE Study Using CATIA

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

This tutorial demonstrates how to do a design of experiments study of an I-beam modeled in CATIA. The overall beam width and height are the input variables; volume and maximum x-displacement are the output responses.

In this tutorial you will create a macro in CATIA which will be used to update the CATIA model in batch mode; mesh it using BatchMesher, and run the model in OptiStruct to solve for the output responses of interest. You will perform a DOE study using HyperStudy to understand the relationships between the input variables and output responses.

The files used in this tutorial can be found in <hst.zip>/HS-1580/. Copy the files from this directory to your working directory. Modify the batch script (.bat) file for the current CATIA install path.

There are two process environment variables used in the batch script (.bat) files:

%STUDY_DIR_PATH%: Holds the study directory, where the study (.xml) file resides.
%HST_APPROACH_MODEL_PATH%: Holds the full path of the current run directory on Windows.
hmtoggle_plus1greyStep 1: Record a Macro in CATIA

Recording a macro in CATIA produces a .txt file that can be converted to a .tpl file and used to perform a batch mesh operation in HyperStudy. The objective of the following steps is to optimize the height and width on one side of this simple beam model.

1.Open CATIA and load the model, Beam.CATPart.
2.In the CATIA tree, expand Parameters to reveal Height and Width.
3.Optional. If Parameters is not visible in the tree, activate it by selecting the Parameters checkbox in the Options dialog (the Options dialog can be accessed by clicking Tools > Options > Infrastructure > Part infrastructure > Display from the menu bar).
Note:A macro is needed to drive the parameter modification.
4.From the menu bar, click Tools > Macro > Recording.
5.In the Record macro dialog, save the macro as Marco.catvbs.
6.Click Start.
7.Click Height.
8.In the Edit Parameter dialog, enter 100mm in the Height field.
9.Click OK.
10.In the Width field, enter 50mm.
11.Click Save.
12.Stop recording. CATIA creates a macro that is able to drive the geometry.
13.Close CATIA.

 

hmtoggle_plus1greyStep 2: Create The Base Input Template in HyperStudy
1.Start HyperStudy.
2.From the menu bar, click Tools > Editor. The Editor opens.
3.In the File field, open the CATIAHST.catvbs file.
4.Under the parameter Height, highlight the length1.Value, 100.000000.

hs_3080_highlight

5.Right-click on the highlighted fields and select Create Parameter from the context menu.
6.In the Parameter-varname_1 dialog, enter Height in the Label field.
7.Set the Lower Bound to 50, the Initial to 100, and the Upper Bound to 200.
8.Set the Format to %8.5f.
9.Click OK.

hs_3080_dvp

10.Under the parameter Width, highlight the length2.Value, 50.000000.
11.Right-click on the highlighted fields and select Create Parameter from the context menu.
12.In the Parameter-varname_2 dialog, enter Width in the Label field.
13.Set the Lower Bound to 25, the Initial to 50, and the Upper Bound to 100.
14.Set the Format to %8.5f.
15.Click OK.
16.Click Save.
17.In the Save Template dialog, save the file as 12.0Macro.tpl.
18.Click OK.

 

hmtoggle_plus1greyStep 3: Register a Solver Script
1.From the menu bar, click Edit > Register Solver Script.
2.In the Register Solver Script dialog, click Add Solver Script.
3.In the HyperStudy - Add dialog, accept the default settings and click OK.

hs_3080_register_solver_script

4.In the Path column of Script 10, click file_selection_icon.
5.In the Open dialog, open the script_win64.bat file.
6.Click Save.
7.In the Save Preferences dialog, navigate to your working directory.
Note:On UNIX, the preference file can also be saved in your home directory or in the working directory from which you launched HyperStudy.
8.In the File name field, enter a label for a new user preference file (example userprefs.mvw).
9.Click Save.
Note:Do not overwrite the system preferences file, which is located in <install_directory>/hw by default.
10.Click Close.
11.From the menu bar, click File > Set Preferences.
12.In the HyperStudy - Set Preference File dialog, open the preferences file that you just saved.

The default preferences file in the installation directory will be read, followed by the preference file that you specify. This ensures that all solvers, readers, and import templates are available.

Append the current user preferences file by clicking Append, or exit solver registration by clicking Close. In the last case, the solver will only be registered for the current study.

 

hmtoggle_plus1greyStep 4: Perform the Study Setup
1.To start a new study, click File > New from the menu bar, or click files_new_hst2 on the toolbar.
2.In the HyperStudy – Add 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.
a.From the Directory, drag-and-drop the 12.0Macro.tpl file into the work area.

hs_1580_drag_drop_model

b.In the Solver input file column, enter CATIAHST.catvbs. This is the name of the solver input file HyperStudy writes during any evaluation.
c.In the Solver execution script column, select Script 10 (scr_10).

hs_3080_define_model

5.Click Import Variables. Two input variables are imported from the 12.0Macro.tpl file.
6.Go to the Define Input Variables step.
7.Review the input variable's lower and upper bound ranges.
8.Go to the Specifications step.

 

hmtoggle_plus1greyStep 5: Perform the Nominal Run
1.In the work area, set the Mode to Nominal Run.
2.Click Apply.
3.Go to the Evaluate step.
4.Click Evaluate Tasks. An approach/nom_1/ directory is created inside the study directory. The approaches/nom_1/run__00001/m_1 directory contains the beam.out, beam.oslog, and beam.h3d files, which are the result of the nominal run. 
5.Go to the Define Output Responses step.

 

hmtoggle_plus1greyStep 6: Create and Define Output Responses
1.Click Add Output Response.
2.In the HyperStudy - Add dialog, add three output responses.
3.In the Expression column of Response 1, click hs_popupdialogicon.
4.In the Expression Builder, click the File Sources tab.
5.Click Add File Source.
6.In the HyperStudy - Add dialog, add one solver output file.

solver_output_file

7.In the File column of Vector 1, click hs_popupdialogicon.
8.In the Vector Source dialog, File field, navigate to the approaches/nom_1/run__00001/m_1 directory and open the Beam.out file.
9.From the Type, Request, and Component fields, select the options indicated in the image below.

hs_1580_vector1

10.Click OK.
11.Click Insert Varname. The expression v_1[0] appears in the Evaluate Expression field.
Note:Because there is only a single value in this vector, [0] is inserted after v_1, thereby choosing the first (and only) entry in the vector. 
12.Click Evaluate Expression. The expression v_1[0] changes to 2000000.

hs_1580_vector1eval

13.Click OK.
14.In the Expression column of Response 2, click hs_popupdialogicon.
15.In the Expression Builder, click the ASCII Extracts tab.
16.Click Add Extract Source.
17.In the HyperStudy - Add dialog, add one extract source.
18.In the File Path column of FileParser1, click hs_popupdialogicon.
19.In the Extract file dialog, navigate to the approaches/nom_1/run__00001/m_1 directory and open the Beam.out file.
20.Select the Keyword checkbox and enter Total # of Grids (Structural).
21.Click Next. The phrase Total # of Grids (Structural) is highlighted.

hs_1580_highlighted words

22.Right-click on the highlighted fields and select Keyword from the context menu. The keyword Total # of Grids (Structural) is created.
23.Highlight the value 4141 to the right of Total # of Grids (Structural).
24.Right-click on the highlighted fields and select Value from the context menu. This number gives you the total number of grids.
Note:You will need this number because the number of grids will change for each design as they are re-meshed, therefore the index for searching the maximum x-displacement among all the grids.
25.Click OK.
26.Click Insert Varname. The expression f_1[0] appears in the Evaluate Expression field.
Note:Because there is only a single value in this vector, [0] is inserted after f_1, thereby choosing the first (and only) entry in the vector.
27.Click Evaluate Expression. The expression f_1[0] changes to 4141.

hs_1580_res2

28.Click OK.
29.In the Expression column of Response 3, click hs_popupdialogicon.
30.In the Expression Builder, click the Functions tab.
31.From the list of functions, select max.
32.Click Insert Varname. The function max() appears in the Evaluate Expression field.

hs_1580_res3

33.From the list of functions, select ResVector.
34.Click Insert Varname.
35.In the resvector - Builder dialog, File field, navigate to the approaches/nom_1/run__00001/m_1 directory and open the Beam.h3d file.
36.From the Subcase, Type, Request, and Component fields, select the options indicated in the image below.

hs_1580_resvector

37.Click OK. The expression changes to max(resvector(getenv("HST_APPROACH_RUN_PATH") + "/m_1/Beam.h3d",1,0,4140,3,3,0,0)).
38.In the expression, replace 4140 with r_2-1.
39.Click Evaluate Expression. The expression max(resvector(getenv("HST_APPROACH_RUN_PATH") + "/m_1/Beam.h3d",1,0,r_2-1,3,3,0,0)) changes to 0.16365569829940796.

hs_1580_res3eval

40.Click OK.

 

hmtoggle_plus1greyStep 7: Run a DOE Study
1.In the Explorer, right-click and select Add Approach from the context menu.
2.In the HyperStudy - Add dialog, select Doe and click OK.
3.Go to the Specifications step.
4.In the work area, set the Mode to Fractional Factorial.
5.Click the Levels tab, and verify that the number of levels is 2.

hs_1580_levels_tab

6.Click Apply.
7.Go to the Evaluate step.
8.Click Evaluate Tasks.
18.After the results are extracted, go to the Post processing step.

 

 

 

See Also:

HyperStudy Tutorials