Vous êtes sur la page 1sur 38

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

Tutorial

OPTIMIZATION
COUPLING ANSA/ETA to OPTIMUS
Table of Contents
1. Introduction ...................................................................................................................................2 1.1 Prerequisites........................................................................................................................2 1.2 Problem Description ............................................................................................................2 1.3 Data Files ............................................................................................................................3 2. Defining the Optimization Task .....................................................................................................4 2.1 Definition of Design Variables ................................................................................................6 2.2 User Script for Mass Output ...................................................................................................9 2.3 The Design Variables Input file ............................................................................................11 2.4 The FE output file.................................................................................................................13 3. Run the Optimization Task..........................................................................................................15 4. Set up the ANSA Settings...........................................................................................................16 5. DOE Study..................................................................................................................................18 6. Define Responses ......................................................................................................................20 6.1 Define the Mass of the model...............................................................................................20 6.2 Define the Maximum Displacement......................................................................................21 7. Set up OPTIMUS ........................................................................................................................27 8. Results........................................................................................................................................37

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS 1. Introduction


This tutorial presents the coupling of ANSA with Optimus, through a property thickness optimization example. In general there are four steps to connect ANSA with an optimizer. Model definition Task manager sequence definition TA set up Optimizer set up

1.1 Prerequisites The user must be familiar with the basic keywords of NASTRAN for Solution 111 since the model has been prepared for a Modal Frequency Response analysis in NASTRAN. If another solver is to be used, the user has to update the model properly. 1.2 Problem Description A body in white model is tested in a Modal Frequency Response analysis. (Sol 111 in Nastran). The model is being subjected to a harmonic excitation in the front left shock housing, which represents a road induced load, while being constraint in all 6 degrees of freedom in the rest 3 shock housings. The purpose of the optimization is to minimize the weight while constraining the displacement under the drivers seat which is produced from the harmonic load. The design variables are the thicknesses of 4 sheet metal parts. In order not to have very long run times and since this study is performed only for training purposes, only 4 design variables have been used. The 4 design variables are the thicknesses of the parts that appear on the left, namely the firewall, the upper firewall, the toe pan and the toe pan reinforcements.

The total weight of the model is 382.5 kg while the harmonic force has a magnitude of one fourth the models weight which is approximately 95.6 kg or 940 Newton. The model is tested under this load in a range of up to 50 Hertz.

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


An initial run of the model gives an estimation of the road induced displacement, of the initial models configuration.

The maximum displacement under drivers seat, appears when the model is being excited with a load having a frequency of 18 Hertz and have the value of 4.95 mm. This value is going to be used as constraint in the optimization and the goal is to be lower than 4 mm.

The above can be summarized in the following table. It must be noted that the thicknesses can take specific values, so the design variables have been specified to take the discrete values between the minimum and the maximum allowed value, with a step of 0.1 mm. Design Variables Firewall Upper Firewall Toe Pan Toe Pan Reinforcement Constraints Maximum Displacement Objective Weight 1.3 Data Files The files of this tutorial are located at the directory where this document is located under the /tutorial_files/. The user should copy these files in the directory where ANSA, ETA and OPTIMUS will run. The files are:
biw_initial.ansa biw.ansa biw.nas biw.txt mass.bs Max_displacement.ses Max_displacement.ses.results biw.opt

Initial Value 0.75 mm 0.85 mm 1.9 mm 2.5 mm 4.95 mm 382.5 kg

Mimimum Value 0.5 0.5 0.5 0.5

Maximum Value 2 2 4 4 4

initial ANSA database the resulting ANSA database the initial NASTRAN output file design variables file script file the ETA session file the responses file OPTIMUS project file

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

2. Defining the Optimization Task


In this section will be defined the pre-processing sequence that will be connected to the optimizer. This sequence of actions will be invoked in every optimization loop and every action of it, will be executed in the defined order. All these actions take place before the run of the solver. When the sequence runs the following tasks are executed: Reading Design Variable values from an ascii file Modify the model according to the values of the ascii file Output the model in NASTRAN format

Open file: biw_initial.ansa The optimization sequence will be defined through the Task Manager Tool. This sequence will be saved in the ANSA database when the user saves the database. Use the button of the main menu to open the Task Manager. To create a new Optimization Task pick on the Tasks button and select the Optimization Task from the pull-down menu that appears.

A default Optimization Task is defined which contains the following Task Items: DV file : the ASCII design variables input file Design Variable : a design variable FE_output : output command for the FE model. At this time the Optimization Task is at Definition mode. In this mode the user is able to define and modify the Task. This is the default mode when an Optimization Task is created. To run the Optimization Task the user should switch to the Execution mode. This action is described in a later section.

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


The Optimization Task appears also in the Database Browser. Switch to the corresponding tab and double click to the OPTIMIZATION_TASK item.

The Optimization Task list opens. The by default created design variable is listed under the task. Select it and press the Delete button in order to delete it. At the same time it will be deleted also from the Optimization Task. Note that if the Option Buttons in the end of the window are not visible, you have to press the little arrow on the left down corner of the window to make them visible. The same options are also appearing as a list if you select the Design Variable item and press the right mouse button.

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

2.1 Definition of Design Variables In order to create design variables which will be connected to the thickness of the desired Parts, select the Optimization Task item and press the right mouse button. Select the option New > DV from entity

The Database Browser opens. Here you can select whatever ANSA entity you want in order to connect a characteristic of this entity with a design variable. Select the PSHELL listed under the PROPERTY item. The corresponding list appears, containing all the Pshell Properties of the model. Select these with Id 2000085, 2000088, 2000095 and 2000096, which correspond to the before mentioned parts.

The red number in the list indicates the number of selected entities. When all the desired properties are selected press the OK button. Note that you can select entities of different type. For example after the Properties selection you can pick also the MATERIAL item in order to select Materials from the list.

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


In the window that that appears, all the characteristics of the selected entities are listed. Select the ones that you want to create a design variable for, the thickness (T) in our case, and press the OK button.

4 ANSA Parameters are automatically created and connected with the Thickness of the selected properties. The value of each ANSA Parameter is controlled by a Design Variable.

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

At the same time the new Design Variables are listed also in the Optimization Task in the Task Manager. The next step is to define the possible values that the design variables can take. Have also in mind that the thickness of the sheet metal parts can take only discrete values Select the design variable connected to the Property with id 2000085, press the right mouse button and in the list that appears select the Edit option.

The design variables possible values can have a range of three types. The BOUNDS type, where the design variables can take all the values between the minimum and the maximum, the STEP type where you specify a step and the LIST type where you specify specific values in a list form. In the design variables card that appears switch the RANGE pull down menu to the STEP option and give the value 0.1 in the Step Value field. Specify also the minimum and maximum values 0.5 and 2 respectively. Press OK to confirm. Follow the same procedure for the rest three design variables. The corresponding values are presented in the following table: PSHELL 2000088 TYPE RANGE Min Value Current Value Max Value Step Value REAL STEP 0.5 1.7 2 0.1 PSHELL 2000095 TYPE RANGE Min Value Current Value Max Value Step Value REAL STEP 0.5 1.9 4 0.1 PSHELL 2000096 TYPE RANGE Min Value Current Value Max Value Step Value REAL STEP 0.5 2.5 4 0.1

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

2.2 User Script for Mass Output User scripts can be added to the optimization sequence to perform a specific operation. The user scripts can be added under a Design Variable Task Item or directly at the main root of the Optimization Task. In this example the objective of the optimization is to minimize the mass. So the models mass should be output from ANSA and should be read from the Optimus parser tool. The mass output can be performed either through a session command or using a user script. In this case a user script has been used. Note that the most important and commonly used functionalities of ANSA are available also as script functions, while the case is not the same for the session commands. For this reason the user scripts are strongly recommended. So, the mass output should be performed just before the FE output and after the change of the design variables value. Select the Optimization Task right click on it and pick the New > User Script option.

A new Task Item is defined at the end of the optimization task. Drag and Drop it one step above, just before the FE_output command.

drag & drop

BETA CAE Systems S.A.

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


Right click on the User Script task item and press Edit from the list.

The Select script function window appears. Through this window the user can select the script file that will be associated to the User Script task item in the Optimization Task. Pick the Load module button to open the file manager and select the script file to be used

This is the mass.bs that is located in the tutorial folder of the installation directory.. The file is considered as a module. This means that every function inside this file will be loaded and will be available for use. Note that the modules are stored in the ANSA database, so they can be used at any time without the need of loading them in every session and having them in a specific directory.

From the pull-down menu select the loaded module. All the scripts of the module are listed below in the Function list. In this example only one function is available, the main(). Select the function and press OK to confirm. The selected script function has been associated to the User Script item.

BETA CAE Systems S.A.

10

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


Optionally change the name of the task item to Mass_output by clicking on it twice. Note that to change the value of an ANSA field directly as in this case, you have to click on it twice. Not double click but twice. The mass.bs script uses the D.UTIL > D.INFO function that is located in the General Buttons of ANSA. The script is the following: def main() { m = DeckInfo("./mass.log", "WHOLE DB", "TEXT"); return m; } The first argument is the path and name of the output file, the second one means that the data that will be output, refer to the whole database and the third one is the format of the output file. The ./ in the first argument means the current directory which refers to the directory that ANSA runs from. So the file will be output to the current directory with the name mass.log. NOTE: Before running the optimization sequence there is the need to make some adjustments in the ANSA.defaults file in order to correctly define the Deck Info report file. These actions are described in the section 4. 2.3 The Design Variables Input file The DV File is an ascii file which contains all the data specified in the design variable ANSA cards. Through this file, the Optimization Task and consequently ANSA, is connected to the optimizer. During the optimization loop, the Optimizer will change the values of the Design Variables and will write these new values in this file. Next, this file will be input in ANSA and will update the Current Values of the Design Variables that are defined in the Optimization Task. So when the process runs, every action that is defined in the Optimization Task under a Design Variable task item, will be executed using these new values. Right click on the DV file task item and select the Edit option from the list.

BETA CAE Systems S.A.

11

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


In the file manager that appears enter the path where the DV File should be saved and will be input from, during the optimization.

The specified path and the name are appearing in the DV file task item. You can specify also the current directory as the one where the DV file will be saved. To do so, rename the DV file to ./biw.txt by clicking on it twice. The ./ means the current directory which refers to the directory where ANSA runs from, as mentioned before. The DV File Task item is defined and the path is indicated to the Task Item name. However the file is not yet created and saved. The file will be saved as soon as the user switches the Optimization Task from Definition to Execution mode. The DV file is shown bellow:

# # ANSA_VERSION: 13.1.1 # # file created by A N S A Tue Nov 30 14:25:25 2010 # # Output from: # /home/demo/Desktop/Optimus_Tutorial/biw.ansa Min values # Current values Max values # DESIGN VARIABLES #-----------------------------------------------------------------------# ID | DESIGN VARIABLE NAME | TYPE | RANGE | CURRENT VALUE | MIN VALUE -> MAX VALUE | STEP #-----------------------------------------------------------------------2, PSHELL_2000088_T, REAL, STEP, 1.7, 0.5, 2., 0.1 3, PSHELL_2000095_T, REAL, STEP, 1.9, 0.5, 4., 0.1 4, PSHELL_2000096_T, REAL, STEP, 2.5, 0.5, 4., 0.1 5, PSHELL_2000085_T, REAL, STEP, 1.7, 0.5, 2., 0.1 #-----------------------------------------------------------------------Step values

BETA CAE Systems S.A.

12

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

2.4 The FE output file The last Task Item of the optimization sequence creates an FE output of the model in the format of the desired solver. Right click on the FE Output Task Item and select the Edit button.

The OUTPUT DECK window appears. Select the NASTRAN option from the pull-down menu to output the model in this format. Press OK to confirm.

The file manager window opens. Enter the path where the file will be output and a name and confirm. In this example the name of the file is biw.nas. In every iteration of the optimization process, the Fe output file will be output in the specified directory.

BETA CAE Systems S.A.

13

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


The OUTPUT PARAMETERS window opens. Select the options for the NASTRAN file and confirm. In this example you can use the All option to output the whole model.

The FE Output Task item is defined and the path is indicated to the Task Item name. You can rename the file and specify the current directory as the output directory. Click on the task item twice and give the name ./biw.nas. Note that the file is not yet created and saved. The file will be created when the Optimization Task runs in the Execution mode.

The result model is: biw.ansa

BETA CAE Systems S.A.

14

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

3. Run the Optimization Task


Before running the optimization sequence and connect it with the optimizer the user is able to simulate the actions that will take place in each loop. In this way the user can check the model validity for different values of the design variables. The simulate tool can open by right click on the Optimization Task and selecting the Simulate function. This option is useful when the design variables induce a shape change in the model, when they are connected with morphing parameters for example. So the user can check the different shapes which various combinations of design variables values produce. For more information about the simulate tool see the section 2.3.2. of the Optimization_with_ANSA.pdf located at <ANSA installation directory>/docs/ In addition the user is able to create a Design Of Experiments (DOE). Using this ANSA functionality, it is possible to create separate experiments, based on user defined values for the Design Variables. In the section 5 of this tutorial a DOE study will be presented. In addition more information about the DOE, can be found in the section 4 of the Optimization_with_ANSA.pdf located at <ANSA installation directory>/docs/ After the definition of the Optimization Task and the model checking, the ANSA file should be saved with the Optimization Task in Execution mode. Right click on the Optimization Task and select Edit.

The Optimization Task card appears. Switch the Run Mode pull-down menu to Execution and pick OK to confirm. As it is mentioned before the ANSA file should be saved with the Optimization Task in execution mode in order to perform the defined sequence during the optimization procedure.

BETA CAE Systems S.A.

15

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


At this time the DV File is created. In case that the DV File already exists a warning window appears. Pick OK to overwrite the DV File.

NOTES: If the Cancel button is picked, the Optimization Task will remain in Definition mode. This ensures that the Optimization Task wont run using a non compatible DV File. The Optimization Task is able to be switched to Execution mode only if all Task Items are defined properly. To check this, select the Optimization task when in definition mode, right click on it and pick the Update button. All the correctly defined items will be ticked. The symbol indicates that Execution. of the Optimization Task the current mode is the

Now, save the ANSA file. The model is ready to be connected to the OPTIMUS workflow.

4. Set up the ANSA Settings


Every time ANSA runs, the default settings and GUI settings are read from the ANSA.defaults and ANSA.xml files. Before connect ANSA with the optimizer the user should ensure that the correct settings will be applied to ANSA when running in batch mode. For example, the visibility of entities to be output, the current deck or the options of the D.INFO function should need to be set up. Set the current Deck - Open ANSA - Switch to NASTRAN Deck This change will be saved to the ANSA.xml file, so when ANSA opens it will be set by default to Nastran deck.

BETA CAE Systems S.A.

16

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


Set up the Deck Info Report - Activate the D.INFO function from the D.UTIL menu - In the DECK INFORMATION window that appears make active only the Masses flag. - Deactivate any other flag of the Shells and Solids TABS. - Pick OK to proceed.

- The DECK REPORT window appears. - Switch the pull-down menu on the top to As Text in order to save the report as a text file. - Press ESC to exit.

Save settings Open the MENUBAR>Windows> Options and pick the Save Settings and Save GUI Settings buttons to save the changes to the ANSA.defaults and ANSA.xml files respectively.

BETA CAE Systems S.A.

17

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

5. DOE Study
A simple Design of Experiments algorithm can be performed through ANSA for the validation of the model for all combinations of the design variable values. The available DOE algorithm is the Full Factorial. The user can produce experiments either to validate the model before coupling with an optimizer or to run a simple optimization process where only the definition of experiments is needed. Run the DOE Activate the function by right clicking on the Optimization Task and selecting the DOE Study option. NOTE: To run a DOE Study the Optimization Task should be saved in Execution mode. For this reason a warning window pops up when a DOE Study is requested. Press OK to save the ANSA file.

The DOE Study window opens in which all the design variables of the Optimization Task are listed. Make active the design variables that will take place to the experiments calculation by picking on the relative flags. The discrete values of the Design Variables can be selected from the corresponding List option. Pick it with the left mouse button.

BETA CAE Systems S.A.

18

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


In the left column there are all the values the Design Variable can take. Select the ones that you want to perform a DOE with, and pick the arrow that shows to the right. The selected values are moving to the Experiment Values field. You can always add or remove any value by using the arrows. Press OK to confirm. The selected values appear in the Discrete Values field of the DOE Study window, and are going to be used for the experiment. Follow the same procedure for the rest three design variables and press the Run Task button to perform the DOE.

The file manager appears. Specify the directory where the DOE files will be output and press OK. The DOE starts.

For each experiment all the actions defined at the Optimization Task will run starting from the initial model. For each run, a directory will be created at the directory that will be specified in the File manager. The name of the directory will be the name of the ANSA file, plus the current values of the design variables. The DV file and the FE output that are created during the run will be saved in these directories. In the same mother directory, a .txt file will be saved, named combinations.txt that contains the values of the design variables for each experiment. More information about the DOE Study you can find in the Optimization_with_ANSA.pdf at <ANSA installation directory>/docs/

BETA CAE Systems S.A.

19

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS 6. Define Responses


The design responses of the optimization problem, meaning the constraints and the objective, can be extracted directly from the result files of the solver. Such values can be for example the stress or strain of selected elements. However when calculations are needed in order to extract the responses from the result files, ETA Post-Processor can be used. So, the user opens ETA and follows some steps to extract the desired responses. These steps will be recorded in a session file and will be executing automatically whenever ETA is called from the optimizer during the optimization loop. Also response parameters that refer to the geometry of the model (for example the mass) can be directly extracted from the ANSA database. 6.1 Define the Mass of the model Using the already defined Optimization Task and more specific the mass_output user script, the models mass will be extracted and saved to the mass.log file using the D.INFO functionality. When the Optimization Task runs, the user script is executed and the text file is created. However, there is the need to create the mass output file before running the optimization task, in order to use it with the optimizers parser tool , to specify where exactly in the file there is the mass value. To do so, use the Update function while the Optimization Task is in Execution mode. This function runs only the selected Task Item, so the mass.log file will be created. The mass.log file is shown below.
ANSA 's DECK INFORMATION from file: /home/demo/Desktop/Optimus_Tutorial/biw.ansa A N S A DECK REPORT MASS INFORMATION TYPE,NET MASS,NSM MASS,TOTAL MASS, SHELLs,0.382532,0,0.382532, TOTAL,0.382532,0,0.382532, C.O.G. Cartesian coordinates (x,y,z),-2246.51,0.599959,572.391, INERTIA TENSOR, 156543,1602.95,-43571.6, 1602.95,750265,-634.457, -43571.6,-634.457,814726, PRINCIPAL INERTIAS, 817602,0,0, 0,750266,0, 0,0,153667, PRINCIPAL DIRECTIONS, 0.0657482,0.0032603,0.997831, 0.00783629,-0.999965,0.00275093, 0.997805,0.00763843,-0.0657715, NSM MASS PER SUBCASE SUBCASE ID,NSM MASS, COMMON,0, A N S A DECK REPORT

BETA CAE Systems S.A.

20

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

6.2 Define the Maximum Displacement The maximum displacement under the drivers seat, will be used as a design constraint. The value of this response will be extracted from eta Post Processor version 6.6.2, using the results of the initial solution.

1. 2. 3.

Open ETA at the directory where the optimization will be set up. Pick the Read of the Geometry tab to open the file manager. Read the biw.nas file.

4.

Switch to the Results tab to read solver results. The biw.op2 file which is located in the same directory is automatically selected. At the Scalar tab select Displacements> Transalational >Centroid >Magnitude. Pick the Read button to read the results.

BETA CAE Systems S.A.

21

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

5. 6. 7.

Activate the Wire flag button Select the iNode selection option. Pick a Node of the cross member under the drivers seat. This would be the node, the maximum displacement of which will be used as design constraint. Note that in this way ETA will store the coordinates of the click in the session file, and not the id of the node itself.

BETA CAE Systems S.A.

22

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

8.

Pick the Windows > Create 2d plot option. A new window opens

9 10

9. Switch to the Pick from model tab 10. Press the adv. filter option in order to select the identified node for a 2d plot creation. 11. In the Advanced Filter window specify the options add, Nodes and identified as shown in the picture and press OK to confirm. The id of the identified node appears in the respective window.

BETA CAE Systems S.A.

23

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

12

12. Select the identified node, pick the Total Node Data from the available results tab, switch the Select x axis pull down menu to Frequency and press the Create button. The plot which represents the displacement of the identified node in respect with frequency is created.

13

13. Pick the Tools>Annotations of the main menu to open the annotation tool.

BETA CAE Systems S.A.

24

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


The Annotations window appears. 14. Pick the New button to create a new annotation. 15. Select the On Curve option. 16. Select the Curve Max from the Function field to get the maximum value of the curve. 17. Select the Pick button and select the curve from the screen.

14

15

16 17

18. An annotation is created with the maximum value of the curve. The arrow points at the position with the maximum displacement. In general, to extract responses from result files the Annotations tool of ETA is used.

BETA CAE Systems S.A.

25

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


19. Select the User Toolbars>OptimizerSetup from the main menu. The toolbar for response extraction opens. 20. Pick the Add>Pick Annotations and select the defined annotation from the screen. 21. Rename the response if needed. At the relative field enter the name (max_displacement) and hit ENTER to confirm. 22. Pick the Export Session button to export the response file.

20

21

22

23. The file manager opens. Enter the response name (Max_displacemet.ses) and press Save to confirm. This file contains all the actions that have been made in ETA since it was opened. This file will be read in every optimizations iteration and the sequence of actions will be repeated, using the respective solver results. So in this way, in each iteration the corresponding response value will be output. Upon confirmation another window opens, containing all the paths from which solver files have been read. (In this case there is only one path, the one that contains the .nas and the .op2 files which have been used.) 24. Select the path for the imported files that will be identified as the working directory. This is helpful when many solver results have been imported from different locations. 25. Pick OK to confirm. Two files will be created. The Max_displacement.ses which is the session file of ETA and the Max_displacement.ses.results that contains the value of the defined response.

BETA CAE Systems S.A.

26

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

7. Set up OPTIMUS
In this step it is demonstrated the connection of ANSA and ETA with OPTIMUS Rev 9 SL1 and the set up of the optimization problem run. Four special components, two for ANSA and two for ETA have been enhanced in OPTIMUS for the easy connection of the softwares with each other. The optimization sequence that has been defined through the Optimization Task is controlled from the ANSA component while the ETA actions from the ETA component. The OPTIMUS workflow is presented in the following picture.

It is composed of three input files ( biw.txt, biw.ansa and Max_displacement.ses ) three actions (ANSA, Nastran, ) and two output files (the mass value and the maximum displacement value). The set up of each node in the workflow, will be presented in the following pages.

BETA CAE Systems S.A.

27

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


Invoke OPTIMUS and pick the FILE > NEW in order to specify the directory where the OPTIMUS and the Optimization run output files will be saved.

output variable insert file insert action insert connection

All the components of the workflow can be found in the right side of OPTIMUS window. Pick a component, move the cursor to the position you want to place it and press the left mouse button. The component has been added to the workflow. Insert all the necessary components to create the workflow that appears in the picture and connect them with each other.

ANSA & ANSA DV file Extraction of results

BETA CAE Systems S.A.

28

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


1. Edit the ANSA DV file component by double clicking on it, or right click and press Edit. In the window that appears press the Select button and pick from the file manager the biw.txt file. It is the DV file that has been created by ANSA. The Design Variables appear in the Possible Inputs field. Select all of them from the list and press the Add button. They are listed under the UCI and OPTIMUS Parameter fields. Optionally give a name and press OK to confirm. An input variable array is automatically being inserted in the workflow and connected to the ANSA DV component. Double click on it to edit it.

2
2.

3. 4.

5.

6.

The Input variable array window opens. It contains all the information for the design variables. Activate the Relaxed option in the respective field as appears in the picture. This has to be done since the initial values, give a non feasible solution, which means a solution that doesnt satisfy the design constraints. You can find more information about the relaxation of Design Variables in the OPTIMUS Theoretical Backroud.pdf at section 2.2.1.4. Press OK to confirm.

BETA CAE Systems S.A.

29

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


7. Edit the File1 component that is going to be input to the ANSA node. Give the name biw.ansa and press OK to confirm.

8.

Edit the File2 component, the one that is connected with the output variable. Press the Load button and select the mass.log file. The contents of the file appear in the window. Here you will specify where exactly in the file there is the mass value. So, OPTIMUS will read this value every time that is needed during the optimization loop.

11 8

10

9. Specify the value 8 in the Offset field since the mass value is 8 lines bellow the first one. 10. In the Extraction field leave the option to Word Nr and give the value 4. This is because the mass value is the fourth word in the line. (words are separated by comma). 11. In the end press the Verify button.

BETA CAE Systems S.A.

30

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

12

12. The mass value is highlighted. Press the Return button and OK to confirm. 13. Edit the Output1 component. The identified mass value appears in the Value field. Optionally rename the output variable and press OK to confirm.

BETA CAE Systems S.A.

31

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


14. Edit the File3 component which is the one that is being output from ANSA. Press the Load button and select the biw.nas file which is located in the tutorial folder. This is the output file of the initial configuration of the model. The contents of the file appear in the respective field. Press OK to confirm.

15. Edit the ANSA component. The input and output files of the component are listed under the Inputs and Outputs fields. There are also three main fields, the Model database, the Input file and the Output file. Specify the biw.ansa, the biw.txt and the biw.nas respectively as value of these fields, by clicking in each value field and then selecting the respective file. Press OK to confirm.

BETA CAE Systems S.A.

32

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


16. Edit the Action1 component. This action will be specified to be the Nastran run action. The input and output files are listed under the Inputs and Outputs field respectively. In the Commands field, give the command to run nastran. To enter the name of the file to be solved, press the biw.nas object of the Inputs field. It is appended to the command. Press OK to confirm.

17. Edit the File4 component. This is the nastran output file. Enter the name biw.op2 and press OK to confirm.

BETA CAE Systems S.A.

33

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


18. Edit the File5 component. This will be the session file. Press the Load button and select the Max_displacement.ses file located in the tutorial folder. Press OK to confirm.

19. Edit the results component. Pick the Select button and specify the Max_displacement.ses.results file located in the tutorial folder. 20. The maximum displacement value appears in the Possible Results field. Select it and press the Add button. Now it appears also under the UCI Parameter and OPTIMUS Parameter fields. 21. Press OK to confirm.

19

20

21

BETA CAE Systems S.A.

34

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


Note that by pressing OK, an output variable component is automatically created and connected with the results component. This node contains the maximum displacement value that has been identified from the Max_displacement.ses.results file. 22. Edit the output component. The maximum displacement value appears in the Value field. The design constraint of the optimization problem will be the maximum displacement. The maximum allowed value will be 4 mm. So activate the High option of the Target field and give the value 4. Press OK to confirm.

23. Edit the component. Click in the Value field of the Session file option and select the Max_displacement.ses file from the Inputs list. Do the same with the Output file option by specifying the Max_displacement.ses.results file. Press OK to confirm.

BETA CAE Systems S.A.

35

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


The OPTIMUS workflow is ready to run. Save the Optimus file. Now you have to specify the optimization method and the corresponding options. Right click on the Graph option and select the New method > Optimization option.

The Optimization method window pops up. The Mixed Integer Programming algorithm is automatically selected, since this algorithm deals with discrete design variable values. Set the objective function to be the minimization of mass by selecting the mass_value output from the respective pull down menu and press the Apply button.

In the Start calculation window that appears, select the Save project and Run option and press OK. The optimization run starts.

BETA CAE Systems S.A.

36

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS

8. Results
In the optimum design the weight of the four sheet metal parts have been increased by 7kg but at the same time a decrease of 40.9% at the maximum displacement has been achieved. It must be noted that this study case has been performed only for training purposes and the results are not of great importance. Furthermore if more design variables had been used, a weight reduction might have been achieved also. Many Post-process plots can be extracted directly form OPTIMUS. In the picture on the left, the values of the optimization parameters in the initial and final run are presented. In the plot that follows, the progress of these values during the optimization procedure is presented.

BETA CAE Systems S.A.

37

ANSA v.13.1.x Tutorials

OPTIMIZATION Coupling ANSA / ETA to OPTIMUS


A Correletion Scatter diagramm .

A 2d plot of the initial and final displacement in respect with frequency created in .

BETA CAE Systems S.A.

38

ANSA v.13.1.x Tutorials

Vous aimerez peut-être aussi