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 processing 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 information for details). The case chosen is the mixing elbow problem you solved in Tutorial 1.
This tutorial demonstrates how to do the following:
Start the parallel version of ANSYS FLUENTusing either Windows or Linux/UNIX.
Partition a mesh for parallel processing.
Use a parallel network of workstations.
Check the performance of the parallel solver.
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.
26-1
Parallel Processing
Density:
Viscosity:
Conductivity:
Specific Heat:
= 1000 kg/m3
= 8 x 10 4 Pas
k = 0.677 W/mK
Cp = 4216 J/kgK
8"
4"
Ux = 0.4 m/s
T = 20oC
I = 5%
1"
4" Dia.
3"
1" Dia.
8"
Uy = 1.2 m/s
T = 40oC
I = 5%
26-2
Parallel Processing
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.
26-4
Parallel Processing
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.
26-6
Parallel Processing
26-7
Parallel Processing
If the Case File option is enabled (the default setting), and there exists a valid partition 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 information 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.
2. Read the case file elbow3.cas.gz.
File Read Case...
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.
26-8
Parallel Processing
Figure 26.2: Mesh Along the Symmetry Plane for the Mixing Elbow
26-9
Parallel Processing
ANSYS FLUENT will print the active partition statistics in the console.
>> 2 Active Partitions:
P
Cells I-Cells Cell Ratio
0
10414
177
0.017
1
10417
173
0.017
34000
-0.9%
209
0.6%
34646
0.9%
209
0.6%
68437
209
0.3%
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 performed) 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.
26-10
Parallel Processing
26-11
Parallel Processing
26-12
Parallel Processing
Step 3: Solution
1. Initialize the flow field using the boundary conditions set at velocity-inlet-5.
Solution Initialization
Residuals Edit...
26-13
Parallel Processing
24.866 sec
49.813 sec
The most accurate way to evaluate parallel performance is by running the same parallel 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.
26-14
Parallel Processing
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.
1. Display an XY plot of temperature across the exit (Figure 26.4).
Plots
(a) Select Temperature... and Static Temperature from the Y Axis Function dropdown lists.
(b) Select pressure-outlet-7 from the Surfaces selection list.
(c) Click Plot and close the Solution XY Plot dialog box.
26-15
Parallel Processing
26-16
Parallel Processing
(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.
26-17
Parallel Processing
26-18