Tutorial 26. Parallel Processing
Tutorial 26. Parallel Processing
Tutorial 26. Parallel Processing
Parallel Processing
Introduction
This tutorial illustrates the setup and solution of a simple 3D problem using the parallel
processing capabilities of ANSYS FLUENT. In order to be run in parallel, the mesh must
be divided into smaller, evenly sized partitions. Each ANSYS FLUENT process, called a
compute node, will solve on a single partition, and information will be passed back and
forth across all partition interfaces. The solver of ANSYS FLUENTallows parallel pro-
cessing on a dedicated parallel machine, or a network of workstations running Windows,
UNIX, or Linux.
The tutorial assumes that both ANSYS FLUENT and network communication software
have been correctly installed (see the separate installation instructions and related infor-
mation for details). The case chosen is the mixing elbow problem you solved in Tutorial 1.
This tutorial demonstrates how to do the following:
Prerequisites
This tutorial is written with the assumption that you have completed Tutorial 1, and
that you are familiar with the ANSYS FLUENT navigation pane and menu structure.
Some steps in the setup and solution procedure will not be shown explicitly.
Problem Description
The problem to be considered is shown schematically in Figure 26.1. A cold fluid at
20 C flows into the pipe through a large inlet, and mixes with a warmer fluid at 40 C
that enters through a smaller inlet located at the elbow. The pipe dimensions are in
inches, and the fluid properties and boundary conditions are given in SI units. The
Reynolds number for the flow at the larger inlet is 50,800, so a turbulent flow model will
be required.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-1
Parallel Processing
4"
Ux = 0.4 m/s
1"
T = 20oC 4" Dia.
I = 5%
3"
1" Dia.
8"
Uy = 1.2 m/s
T = 40oC
I = 5%
2. Unzip parallel_process.zip.
The case file elbow3.cas.gz can be found in the parallel process folder created
after unzipping the file.
You can partition the mesh before or after you set up the problem (define models,
boundary conditions, etc.). It is best to partition after the problem is set up, since
partitioning has some model dependencies (e.g., sliding-mesh and shell-conduction
encapsulation). Since you have already followed the procedure for setting up the
mixing elbow in Tutorial 1, elbow3.cas.gz is provided to save you the effort of
redefining the models and boundary conditions.
4. Click OK.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-3
Parallel Processing
To start ANSYS FLUENT on a Linux or UNIX machine, type at the command prompt
fluent 3d -t2
If you type fluent at the command prompt, then FLUENT Launcher will appear.
For additional information about parallel command line options, see Chapter 32 in the
separate Users Guide.
1. In FLUENT Launcher, restore the default settings by clicking the Default button.
5. Click the Show More >> button and select the Parallel Settings tab.
Retain the selection of default in the Interconnects and MPI Types drop-down
lists.
Select Distributed Memory on a Cluster.
Make sure that File Containing Machine Names is selected to specify the file.
Type the name and location of the hosts text file in the text box below File
Containing Machine Names, or browse and select it using the Browsing Machine
File dialog box.
Alternatively, you can select Machine Names and type the names of the ma-
chines in the text box.
6. Click OK.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-5
Parallel Processing
You can also start parallel ANSYS FLUENT by typing the following at the command
prompt:
fluent 3d -t2 -cnf=fluent.hosts
where -cnf indicates the location of the hosts text file. The hosts file is a text file
that contains a list of the computers on which you want to run the parallel job.
If the hosts file is not located in the directory where you are typing the startup
command, you will need to supply the full pathname to the file.
For example, the fluent.hosts file may look like the following:
my_computer
another_computer
For additional information about hosts files and parallel command line options, see
Chapter 32 in the separate Users Guide.
------------------------------------------------------------------------------
ID Comm. Hostname O.S. PID Mach ID HW ID Name
------------------------------------------------------------------------------
n1 mpich2 another_computer Windows-32 21240 1 1 Fluent Node
host net my_computer Windows-32 1204 0 3 Fluent Host
n0* mpich2 my_computer Windows-32 1372 0 0 Fluent Node
------------------------------------------------------------------------------
Release 12.0
c ANSYS, Inc. March 12, 2009 26-7
Parallel Processing
If the Case File option is enabled (the default setting), and there exists a valid par-
tition section in the case file (i.e., one where the number of partitions in the case
file divides evenly into the number of compute nodes), then that partition informa-
tion will be used rather than repartitioning the mesh. You need to disable the Case
File option only if you want to change other parameters in the Auto Partition Mesh
dialog box.
(a) Retain the Case File option.
When the Case File option is enabled, ANSYS FLUENT will automatically select
a partitioning method for you. This is the preferred initial approach for most
problems. In the next step, you will inspect the partitions created and be able
to change them, if required.
(b) Click OK to close the Auto Partition Mesh dialog box.
3. Examine the front view of the symmetry mesh zone (Figure 26.2).
Note: Since the Display Options were enabled by default in the launcher, the mesh
was displayed in the embedded graphics window after reading in the case.
Figure 26.2: Mesh Along the Symmetry Plane for the Mixing Elbow
Release 12.0
c ANSYS, Inc. March 12, 2009 26-9
Parallel Processing
ANSYS FLUENT will print the active partition statistics in the console.
----------------------------------------------------------------------
Collective Partition Statistics: Minimum Maximum Total
----------------------------------------------------------------------
Cell count 10414 10417 20831
Mean cell count deviation -0.0% 0.0%
Partition boundary cell count 173 177 350
Partition boundary cell count ratio 1.7% 1.7% 1.7%
Note: ANSYS FLUENT distinguishes between two cell partition schemes within
a parallel problemthe active cell partition, and the stored cell partition.
Here, both are set to the cell partition that was created upon reading the
case file. If you repartition the mesh using the Partition Mesh dialog box,
the new partition will be referred to as the stored cell partition. To make it
the active cell partition, you need to click the Use Stored Partitions button
in the Partition Mesh dialog box. The active cell partition is used for the
current calculation, while the stored cell partition (the last partition per-
formed) is used when you save a case file. This distinction is made mainly
to allow you to partition a case on one machine or network of machines
and solve it on a different one.
For details, see Chapter 32 in the separate Users Guide.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-11
Parallel Processing
As shown in Figure 26.3, the cell partitions are acceptable for this problem.
The position of the interface reveals that the criteria mentioned earlier will be
matched. If you are dissatisfied with the partitions, you can use the Partition
Mesh dialog box to repartition the mesh. Recall that, if you wish to use the
modified partitions for a calculation, you will need to make the Stored Cell
Partition the Active Cell Partition by either clicking the Use Stored Partitions
button in the Partition Mesh dialog box, or saving the case file and reading it
back into ANSYS FLUENT.
For details about the procedure and options for manually partitioning a mesh,
see Section 32.5.4 in the separate Users Guide.
Step 3: Solution
1. Initialize the flow field using the boundary conditions set at velocity-inlet-5.
Solution Initialization
Release 12.0
c ANSYS, Inc. March 12, 2009 26-13
Parallel Processing
The most accurate way to evaluate parallel performance is by running the same par-
allel problem on 1 CPU and on n CPUs, and comparing the Total wall-clock time
(elapsed time for the iterations) in both cases. Ideally you would want to have the Total
wall-clock time with n CPUs be 1/n times the Total wall-clock time with 1 CPU.
In practice, this improvement will be reduced by the performance of the communication
subsystem of your hardware, and the overhead of the parallel process itself. As a rough
estimate of parallel performance, you can compare the Total wall-clock time with
the Total CPU time. In this case, the CPU time was approximately twice the Total
wall-clock time. For a parallel process run on two compute nodes, this reveals very
good parallel performance, even though the advantage over a serial calculation is small,
as expected for this simple 3D problem.
Note: The wall clock time, the CPU time, and the ratio of iterations to convergence time
may differ depending on the type of computer you are running (e.g., Windows32,
Linux 64, etc.).
Step 5: Postprocessing
See Tutorial 1 for complete postprocessing exercises for this example. Here, two plots are
generated so that you can confirm that the results obtained with the parallel solver are the
same as those obtained with the serial solver.
(a) Select Temperature... and Static Temperature from the Y Axis Function drop-
down lists.
(b) Select pressure-outlet-7 from the Surfaces selection list.
(c) Click Plot and close the Solution XY Plot dialog box.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-15
Parallel Processing
2. Display filled contours of the custom field function dynamic-head (Figure 26.5).
Graphics and Animations Contours Set Up...
(a) Select Custom Field Functions... from the Contours of drop-down list.
The custom field function you created in Tutorial 1 (dynamic-head) will be
selected in the lower drop-down list.
(b) Enter 80 for Levels.
(c) Select symmetry from the Surfaces selection list.
(d) Click Display and close the Contours dialog box.
Summary
This tutorial demonstrated how to solve a simple 3D problem using the parallel solver of
ANSYS FLUENT. Here, the automatic mesh partitioning performed by ANSYS FLUENT
when you read the mesh into the parallel version was found to be acceptable. You also
learned how to check the performance of the parallel solver to determine if optimizations
are required.
For additional details about using the parallel solver, see Section 32.7 in the separate
Users Guide.
Release 12.0
c ANSYS, Inc. March 12, 2009 26-17
Parallel Processing