Chapter 9: Batch Mode Studies: 9.1. Before You Begin
Chapter 9: Batch Mode Studies: 9.1. Before You Begin
Note
This tutorial requires using ANSYS TurboGrid in batch mode, which is not possible from ANSYS
Workbench.
Part 1 of this tutorial demonstrates one basic way of performing a parametric study using ANSYS Tur-
boGrid in batch mode: using a script loop to repeatedly modify and run a session file with ANSYS Tur-
boGrid. Each modified session file loads a baseline state file, reloads the blade geometry from a different
file, and generates and saves output (including a mesh).
Part 2 of this tutorial demonstrates a grid refinement study using a method similar to part 1. The main
difference in part 2 is the use of the “end ratio” option throughout the mesh data specification to allow
the grid refinement to occur evenly through the mesh.
Variations of the algorithm described in this tutorial are possible. For example:
• You could modify the state file instead of the session file.
• You could use a loop within a session file (written in Perl) to avoid loading and closing ANSYS TurboGrid
repeatedly, which should improve efficiency.
Such variations are beyond the scope of this tutorial. You are encouraged to try the algorithm used in
this tutorial and then explore other methods as required in order to meet your specific requirements.
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 71
Batch Mode Studies
For details, see Setting the Working Directory and Starting ANSYS TurboGrid (p. 1).
9. Click Apply.
This provides access to the legacy topology methods. The other option, ATM Optimized, provides
access to the newest topology method.
7. Double-click Mesh Data to open it for editing. All settings will be changed to use explicit node counts.
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
72 of ANSYS, Inc. and its subsidiaries and affiliates.
Part 1: Parametric Study
9. Click Apply.
You now have a state file that sets up a mesh based on profile.1.curve.
The particular blade geometry used by the state file needs only to be representative of the geometries
that will be used in the study because it will be overridden by what is specified in the session file, which
is produced next.
2. Select Session > New Session from the menu bar to create a new session named generate_mesh.tse.
The session is now at the point where you would typically make a change to the state. In this case,
the change will be to select a new blade curve file. To be able to load a new file, the CCL (CFX
Command Language) block responsible for loading the geometry will be included in the session
file at this point; you will create this CCL block in the next step. With that block created, you can
create a script to control which blade geometry file is loaded by changing the name of the file
within the CCL block. (The script creation is in the next section.)
5. Open Geometry > Blade Set > Blade 1 for editing and click Apply without changing any settings.
7. Select File > Save Mesh As and save the mesh with filename mesh.1.gtm with File type set to ANSYS
CFX and Export Units set to cm.
8. Select Tools > Command Editor and enter the following lines in the Command Editor dialog box:
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 73
Batch Mode Studies
9. Click Process, then Close. This adds Power Syntax commands that cause Minimum Face Angle to
be written to a file.
A prompt will suggest that you save the state. You do not have to save the state since this was
done earlier.
You now have a session file that loads the baseline state file, reloads the blade geometry, creates a
mesh, saves the mesh, and generates statistical output for the mesh.
Note
This script defines and uses a variable, turbogrid, which must be defined as the full
path name to the cfxtg.exe in the bin directory of the ANSYS TurboGrid installation.
#!/usr/bin/perl
# Point to the location of the cfxtg.exe (full pathname),
# usually in <CFXROOT>/bin/
$turbogrid = "C:/Program Files/ANSYS Inc/v145/TurboGrid/bin/cfxtg.exe";
# Initialize the input and output session filenames.
$base_tse = "generate_mesh.tse";
$output_tse = "gen_mesh.tse";
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
74 of ANSYS, Inc. and its subsidiaries and affiliates.
Part 2: Grid Refinement
2. Run the script shown above by opening a command prompt from the ANSYS TurboGrid Launcher (with
the correct working directory set) and entering the line:
perl <scriptname>
The script will take a few minutes to run. When it completes, it will have written two .gtm files to your
working directory, as well as two text files containing the value of the minimum face angle.
For details, see Setting the Working Directory and Starting ANSYS TurboGrid (p. 1).
6. Click Apply.
This provides access to the legacy topology methods. The other option, ATM Optimized, provides
access to the newest topology method.
11. Right-click Topology Set and turn off Suspend Object Updates.
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 75
Batch Mode Studies
You now have a state file that sets up a mesh based on the default value of the target mesh node
count.
The particular mesh node count target used by the state file will be overridden by what is specified in
a session file, which is produced next.
The session is now at the point where you would typically make a change to the state. In this case,
the change will be to select a different target mesh node count. To be able to change the target
mesh node count, the CCL (CFX Command Language) block responsible for specifying the mesh
data settings will be included at this point in the session file; you will do this in the next step. With
that block created, you can create a script to control the target mesh node count by changing the
Target Mesh Node Count CCL parameter in the CCL block. (The script creation is in the next
section.)
5. Double-click Mesh Data to open it and click Apply without changing any settings.
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
76 of ANSYS, Inc. and its subsidiaries and affiliates.
Part 2: Grid Refinement
7. Select File > Save Mesh As and save the mesh as outputmesh.1.gtm with File type set to ANSYS
CFX and Export Units set to cm.
8. Select Tools > Command Editor and enter the following lines in the Command Editor dialog box:
9. Click Process, then Close. This adds Power Syntax commands that cause Minimum Face Angle and
the node count to be written to a file.
A prompt will suggest that you save the state. You do not have to save the state since this was
done earlier.
You now have a session file that loads the baseline mesh state file, reapplies the Mesh Data settings,
creates a mesh, saves the mesh, and generates statistical output for the mesh.
Note
In the following script, the two lines following the commented line
#### The next two lines ... #### are meant to be entered as a single line.
Also, this script defines and uses a variable, turbogrid, which must be defined as the
full pathname to the cfxtg (cfxtg.exe) file in the bin directory of the installation.
#!/usr/bin/perl
# Point to the location of the cfxtg.exe (full pathname),
# usually in <CFXROOT>/bin/cfxtg.exe
$turbogrid = "C:/Program Files/ANSYS Inc/v145/TurboGrid/bin/cfxtg.exe";
# Initialize the input and output session filenames.
$base_tse = "generate_mesh.tse";
$output_tse = "gen_mesh.tse";
# This is a list of the target node values to be used.
@target_nodes = (50000, 100000, 200000);
# Get the baseline session file data.
open(BASE_FH, "<$base_tse")
or die "Can't open file (${base_tse}) for input: $!";
@session_data = <BASE_FH>;
close(BASE_FH);
# Loop over each target node value.
$loopindex = 1;
foreach $target (@target_nodes) {
# Make a copy of the baseline session file
# so we don't destroy the original template.
@copy_data = @session_data;
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 77
Batch Mode Studies
2. Run the script shown above by opening a command prompt from the ANSYS TurboGrid Launcher (with
the correct working directory set) and entering the line:
perl <scriptname>
The script will take a few minutes to run. When it completes, it will have written some .gtm files to
your working directory, as well as some text files containing the value of the minimum face angle and
the number of nodes in the mesh.
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
78 of ANSYS, Inc. and its subsidiaries and affiliates.