modeFRONTIER / NASTRAN-PATRAN: optimization of a plane stress plate

Previous Index Next

3.1.3. Applications




Click on the External Script icon External Script icon and put it into the Work Flow canvas (see Fig.1).

Fig. 1: <I>Work Flow</I> - External Script
Fig. 1: Work Flow - External Script

Enter the External Script properties window.
Name it as PATRAN_PRE. Do the same with the External Scripts NASTRAN and PATRAN_POST, so that we'll get to a Work Flow like Fig.2.

Fig. 2: External Scripts
Fig. 2: External Scripts

Click on PATRAN_PRE node, and select the node patran_pre.ses as Possible Input nodes (it means that the Input File patran_pre.ses will be copied into the current working directory of this External Script)(Fig.3).

Fig. 3: <B>PATRAN_PRE</B> External Script Properties
Fig. 3: PATRAN_PRE External Script Properties

Then Click on NASTRAN and select the node PATRAN_PRE as Possible Input nodes.
Select nodes mises.dat, mass.dat and displacement.dat as Possible Output nodes (it means modeFRONTIER will extract the Output Variables from three Output Files, named mises.dat, mass.dat and displacement.dat, that are written in the current working directory of this External Script.
Furthermore, select the External Script PATRAN_POST as last output node. Write =0 into the Condition field for each Output File (it means that Output Variables will be extracted from Output Files only if the exit condition of this External Script is 0: remind that the default exit condition is 0 if there are not errors) , (see Fig.4).

Fig. 4: <B>NASTRAN</B> External Script Properties
Fig. 4: NASTRAN External Script Properties

Enter the PATRAN_POST External Script proprieties window and select the node NASTRAN as Possible Input nodes(see Fig.5).

Fig. 5:   <B>PATRAN_POST</B> External Script Properties
Fig. 5: PATRAN_POST External Script Properties

For each External Script node, a script file is needed to launch the application, it can be very simple or more sophisticated according to the user needs.
We can write the script from scratch or load a previously created script. Starting from PATRAN_PRE node, to load a script select the Browse button and search the script file PATRAN_PRE in the file system (see Fig.6).

Fig. 6: Load an External Script
Fig. 6: Load an External Script

After we have selected the script file, it's edited in the External Script Editor as we can see in (Fig.7).

Fig. 7: External Script Editor
Fig. 7: External Script Editor

Click on Ok button to accept all changes and save the file.

Do the same with NASTRAN and PATRAN_POST nodes, loading the NASTRAN and PATRAN_POST script files again.

At this point the Data Flow of the project is completed. Now we have to define the Logic Flow.
The Logic Flow is the event sequence that gives the complete evaluation of each parametric model and the External Script node is the point where the Data Flow intersects Logic Flow.

It's mandatory to set a pre-analysis condition for the input variables, because the full parametrization of the metal sheet requires to evict any overlap between the geometrical lines belonging to the inner hole and to the external square. For this purpose, select the Logic icon logic icon from the tool bar on the left and put it in the Work Flow canvas. Then do the same with the Switch Node External Script icon icon. The Work Flow should look like in Fig.8.
Open the Switch Node properties window and mark the PATRAN_PRE and the Logic node as Possible Output nodes. Write <0.098 into the Condition field for the PATRAN_PRE and >=0.098 into the Condition field for the Logic node in order to check the geometry of the model.

Fig. 8: Switch Node Properties
Fig. 8: Switch Node Properties

We need to define a starting point for the Logic Flow. Select from the tool bar a Scheduler item Scheduler icon, which define the starting point of the Logic Flow as well as holding the scheduler parameters. Place it on the Work Flow canvas, it causes two linked components to appear: the DOE icon DOE icon and the Scheduler icon Scheduler icon, see Fig.9.

Fig. 9: DOE and Scheduler
Fig. 9: DOE and Scheduler

Open the D.O.E. Properties window (double clicking on the icon in the Work Flow canvas or RMB click on the icon and select Edit Node Properties item from the pop-up menu) and select Random as D.O.E. algorithm.
Set Number of Random design equal to 16 , define the seed equal to 1 ( the seed is a positive integer number, used for sequence repeatability, if two Random Sequences are created with the same seed, they will generate and return identical sequences of numbers, if the seed value is 0, the sequence is automatically seeded to a value based on the current time).
Mark the Reject Unfeasible Semples check box (it means designs brake any constraints built using only Input Variables will be removed from the D.O.E.).
Click on Add DOE Sequence to create a list of 16 different designs and the D.O.E. Properties window looks like in Fig.9a.
Click on Ok button to store the DOE settings and we see the DOE icon DOE icon has changed its name from None to DOE.

Fig. 9b: DOE Properties
Fig. 9a: DOE Properties

Open the Scheduler Properties window and select M.O.G.A. as scheduler. Set the Number of Generation to 20 and click on Apply Scheduler and the Scheduler Properties window looks like in Fig.9b.
Click on Ok button to store the Scheduler settings and we see the Scheduler icon DOE icon has changed its name from None to MOGA.

Fig. 9b: Scheduler Properties
Fig. 9b: Scheduler Properties

Select the Logic icon logic icon from the tool bar on the left and put it in the Work Flow canvas (see Fig.10).
Open the Logic End properties window and mark the PATRAN_POST as Possible Input nodes and write =0 into the Condition field for the PATRAN_POST (it means that the current Design will be considered successfully evaluated only if the exit condition of this External Script is 0).

Note: the default successful exit value of a script is 0.

Fig. 10: the Logic node
Fig. 10: the Logic node

The External scripts need to move some files from one to each other node, as the files created by PATRAN_PRE are read by NASTRAN, and the NASTRAN output files are requested by PATRAN_POST. To carry out this operation, we can use the Transfer File node. Select the Transfer File icon logic icon from the tool bar on the left and put it in the Work Flow canvas. Open the Transfer File properties window (see Fig.11) and mark the PATRAN_PRE as Possible Input nodes and write =0 into the Condition field , then write prova1.bdf in the main window and mark the NASTRAN as Possible Output node (it means that file prova1.bdf will be successfully transferred from PATRAN_PRE to NASTRAN only if the exit condition of this PATRAN_PRE is 0).

Fig. 11: File Transfer node
Fig. 11: File Transfer node

Afterwards, insert two more Transfer File nodes, following the previous procedure, as showed in Fig.12 and Fig.13.

Fig. 12: File Transfer node
Fig. 12: File Transfer node

Fig. 13: File Transfer node
Fig. 13: File Transfer node

To perform a first post-processing of the analysis results stored in the NASTRAN output file prova1.f06, the script file mises.sh must be placed in the current working directory. There are several way to put a file in the current working directory (using Support File, explicitly copy the file using the cp command into the External Script Editor, creating a Template Input file without any Input Variable linked,....).
We prefer to define one more Input File and load the mises.sh as Template Input File. To do this put an Input File node in the Work Flow canvas (see Fig.14) and load the Template Input File.

Fig. 13: File Transfer node
Fig. 14: mises.sh script file

Open the Properties window of an Input File, mark checked the External Script name you want to link to as a possible output node and click on Browse to select the mises.sh file (see Fig.15).

Fig. 15: mises.sh script file properties<
Fig. 15: mises.sh script file properties

The graphic post-processing within PATRAN_POST node is carried out with the session file post.ses, so we have to place this file in the current working directory as we made for the mises.sh file (see Fig.16 and Fig.17).

Fig. 16: post.ses script file
Fig. 16: post.ses script file

Fig. 15: post.ses script file properties<
Fig. 17: post.ses script file properties

Note: remember to name the Template Input files respectively mises.sh and post.ses, because they are copied into the current working directory with the names you give them.

Now the Logic is completed and we can see in the Logic Log, at the bottom of the Work Flow window, there are neither erros nor warnings.
At this point modeFRONTIER is ready to generate a model, simulate it and mine results.
The next step is to define objectives and constraints of our optimization.


Previous Top Next

© ES.TEC.O. S.r.l.- ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

Return to modeFRONTIER Index