Ansys Chapter 5
Ansys Chapter 5
5.1. Introduction
The purpose of this tutorial is to compute the turbulent flow past a transonic airfoil at a nonzero angle
of attack. You will use the Spalart-Allmaras turbulence model.
• Model compressible flow (using the ideal gas law for density).
• Use Full Multigrid (FMG) initialization to obtain better initial field values.
• Calculate a solution using the pressure-based coupled solver with the pseudo transient option.
5.2. Prerequisites
This tutorial is written with the assumption that you have completed one or more of the introductory
tutorials found in this manual:
• Introduction to Using ANSYS Fluent in ANSYS Workbench: Fluid Flow and Heat Transfer in a Mixing El-
bow (p. 1)
• Introduction to Using ANSYS Fluent: Fluid Flow and Heat Transfer in a Mixing Elbow (p. 121)
and that you are familiar with the ANSYS Fluent tree and ribbon structure. Some steps in the setup and
solution procedure will not be shown explicitly.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 229
Modeling External Compressible Flow
5.4.1. Preparation
To prepare for running this tutorial:
Note
If you do not have a login, you can request one by clicking Customer Registration on
the log in page.
4. Narrow the results by using the filter on the left side of the page.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
230 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
The file airfoil.msh can be found in the external_compressible folder created after unzipping
the file.
Fluent Launcher displays your Display Options preferences from the previous session.
For more information about Fluent Launcher, see starting ANSYS Fluent using the Fluent Launcher
in the Fluent Getting Started Guide.
9. Ensure that the Display Mesh After Reading and Workbench Color Scheme options are enabled.
5.4.2. Mesh
1. Read the mesh file airfoil.msh.
ANSYS Fluent will perform various checks on the mesh and will report the progress in the console. Make
sure that the reported minimum volume is a positive number.
3. Examine the mesh (Figure 5.2: The Entire Mesh (p. 232) and Figure 5.3: Magnified View of the Mesh Around
the Airfoil (p. 233)).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 231
Modeling External Compressible Flow
Quadrilateral cells were used for this simple geometry because they can be stretched easily to account
for different flow gradients in different directions. In the present case, the gradients normal to the airfoil
wall are much greater than those tangent to the airfoil. Consequently, the cells near the surface have
high aspect ratios. For geometries that are more difficult to mesh, it may be easier to create a hybrid
mesh composed of quadrilateral and triangular cells.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
232 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
A parabola was chosen to represent the far-field boundary because it has no discontinuities in slope,
enabling the construction of a smooth mesh in the interior of the domain.
Extra
You can use the right mouse button to probe for mesh information in the graphics win-
dow. If you click the right mouse button on any node in the mesh, information will be
displayed in the ANSYS Fluent console about the associated zone, including the name of
the zone. This feature is especially useful when you have several zones of the same type
and you want to distinguish between them quickly.
5.4.3. Solver
1. Set the solver settings.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 233
Modeling External Compressible Flow
The pressure-based solver with the Coupled option for the pressure-velocity coupling is a good altern-
ative to density-based solvers of ANSYS Fluent when dealing with applications involving high-speed
aerodynamics with shocks. Selection of the coupled algorithm is made in the Solution Methods task
page in the Solution step.
5.4.4. Models
1. Select the Spalart-Allmaras turbulence model.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
234 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Note
The Spalart-Allmaras model is a relatively simple one-equation model that solves a modeled
transport equation for the kinematic eddy (turbulent) viscosity. This embodies a relatively
new class of one-equation models in which it is not necessary to calculate a length scale
related to the local shear layer thickness. The Spalart-Allmaras model was designed spe-
cifically for aerospace applications involving wall-bounded flows and has been shown to
give good results for boundary layers subjected to adverse pressure gradients.
5.4.5. Materials
The default Fluid Material is air, which is the working fluid in this problem. The default settings need to be
modified to account for compressibility and variations of the thermophysical properties with temperature.
b. Select sutherland from the Viscosity drop-down list to open the Sutherland Law dialog box.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 235
Modeling External Compressible Flow
i. Retain the default selection of Three Coefficient Method in the Methods list.
The Sutherland law for viscosity is well suited for high-speed compressible flows.
While Density and Viscosity have been made temperature-dependent, Cp (Specific Heat) and Thermal
Conductivity have been left constant. For high-speed compressible flows, thermal dependency of the
physical properties is generally recommended. For simplicity, Thermal Conductivity and Cp (Specific
Heat) are assumed to be constant in this tutorial.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
236 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 237
Modeling External Compressible Flow
Note
The gauge pressure in ANSYS Fluent is always relative to the operating pressure, which
is defined in a separate input (see below).
c. Enter 0.997564 and 0.069756 for the X-Component of Flow Direction and Y-Component of Flow
Direction, respectively.
d. Retain Turbulent Viscosity Ratio from the Specification Method drop-down list in the Turbulence
group box.
f. Click the Thermal tab and retain the default value of 300 K for Temperature.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
238 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
The Operating Conditions dialog box can also be accessed from the Cell Zone Conditions task page.
The operating pressure should be set to a meaningful mean value in order to avoid round-off errors.
The absolute pressure must be greater than zero for compressible flows. If you want to specify
boundary conditions in terms of absolute pressure, you can make the operating pressure zero.
For information about setting the operating pressure, see the Fluent User's Guide.
5.4.8. Solution
1. Set the solution parameters.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 239
Modeling External Compressible Flow
a. Select Coupled from the Scheme drop-down list in the Pressure-Velocity Coupling group box.
b. Retain the default selection of Least Squares Cell Based from the Gradient drop-down list in the
Spatial Discretization group box.
c. Retain the default selection of Second Order from the Pressure drop-down list.
d. Select Second Order Upwind from the Modified Turbulent Viscosity drop-down list.
The Pseudo Transient option enables the pseudo transient algorithm in the coupled pressure-based
solver. This algorithm effectively adds an unsteady term to the solution equations in order to improve
stability and convergence behavior. Use of this option is recommended for general fluid flow problems.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
240 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
a. Enter 0.5 for Density in the Pseudo Transient Explicit Relaxation Factors group box.
Larger under-relaxation factors (that is, closer to 1) will generally result in faster convergence. However,
instability can arise that may need to be eliminated by decreasing the under-relaxation factors.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 241
Modeling External Compressible Flow
a. Ensure that Plot is enabled in the Options group box and click OK to close the Residual Monitors
dialog box.
a. Retain the default selection of Hybrid Initialization from the Initialization Methods group box.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
242 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
FMG initialization often facilitates an easier start-up, where no CFL (Courant Friedrichs Lewy) ramping
is necessary, thereby reducing the number of iterations for convergence.
ii. Enter the text commands and input responses as shown in the boxes. Accept the default values by
pressing Enter when no input response is given:
solve/initialize/set-fmg-initialization
solve/initialize/fmg-initialization
Enable FMG initialization? [no] yes
Note
It is good practice to save the case and data files during several stages of your case setup.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 243
Modeling External Compressible Flow
b. Click Calculate.
By performing some iterations before setting up the force reports, you will avoid large initial transients
in the report plots. This will reduce the axes range and make it easier to judge the convergence.
7. Set the reference values that are used to compute the lift, drag, and moment coefficients.
The reference values are used to non-dimensionalize the forces and moments acting on the airfoil. The
dimensionless forces and moments are the lift, drag, and moment coefficients.
ANSYS Fluent will update the Reference Values based on the boundary conditions at the far-field
boundary.
8. Create a force report definition to plot and write the drag coefficient for the walls of the airfoil.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
244 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
b. Make sure that Drag Coefficient is selected in the Report Output Type group box.
Note
If you do not enable the Report File option, the history information will be lost when
you exit ANSYS Fluent.
f. Enter 0.9976 for X and 0.06976 for Y in the Force Vector group box.
These X and Y values ensure that the drag coefficient is calculated parallel to the free-stream flow,
which is off of the global coordinates.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 245
Modeling External Compressible Flow
Enter the values for X and Y shown in the Lift Report Definition dialog box.
The X and Y values shown ensure that the lift coefficient is calculated normal to the free-stream flow,
which is off of the global coordinates.
10. In a similar manner, create a force report definition for the moment coefficient.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
246 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Enter the values for the Moment Center and Moment Axis shown in the Moment Report Definition
dialog box.
11. Display filled contours of pressure overlaid with the mesh in preparation for creating a surface report
definition (Figure 5.4: Pressure Contours After 50 Iterations (p. 249) and Figure 5.5: Magnified View of Pressure
Contours Showing Wall-Adjacent Cells (p. 250)).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 247
Modeling External Compressible Flow
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
248 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
The shock is clearly visible on the upper surface of the airfoil, where the pressure jumps to a higher
value downstream of the low pressure area.
Note
The color indicating a high pressure area near the leading edge of the airfoil is ob-
scured by the overlaid green mesh. To view this contour, simply disable the Draw
Mesh option in the Contours dialog box and click Display.
d. Zoom in on the shock wave, until individual cells adjacent to the upper surface (wall-top boundary)
are visible, as shown in Figure 5.5: Magnified View of Pressure Contours Showing Wall-Adjacent
Cells (p. 250).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 249
Modeling External Compressible Flow
The magnified region contains cells that are just downstream of the shock and adjacent to the upper
surface of the airfoil. In the following step, you will create a point surface inside a wall-adjacent cell,
which you will use to create a surface report definition.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
250 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
a. Enter 0.53 m for x0 and 0.051 m for y0 in the Coordinates group box.
Note
You have entered the exact coordinates of the point surface so that your convergence
history will match the plots and description in this tutorial. In general, however, you will
not know the exact coordinates in advance, so you will need to select the desired location
in the graphics window. You do not have to apply the following instructions at this point
in the tutorial; they are added here for your information:
a. In the Point Surface dialog box, click the Select Point with Mouse button. A Working
dialog box will open telling you to “Click on a location in the graphics window with the
MOUSE-PROBE mouse button.”
b. Position the mouse pointer at a point located inside one of the cells adjacent to the upper
surface (wall-top boundary), downstream of the shock (see Figure 5.6: Pressure Contours
after Creating a Point with the Mouse (p. 252)).
d. Click Create to create the point surface and then close the Point Surface dialog box.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 251
Modeling External Compressible Flow
Figure 5.6: Pressure Contours after Creating a Point with the Mouse
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
252 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
b. Select none from the Convergence Criterion drop-down list so that automatic convergence checking
does not occur.
14. Create a surface report definition for tracking the velocity magnitude value at the point created in the
previous step.
Since the drag, lift, and moment coefficients are global variables, indicating certain overall conditions,
they may converge while local conditions at specific points are still varying from one iteration to the
next. To account for this, create a report definition at a point (just downstream of the shock) where there
is likely to be significant variation, and monitor the value of the velocity magnitude.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 253
Modeling External Compressible Flow
b. Select Velocity... and Velocity Magnitude from the Field Variable drop-down list.
d. In the Create group box, enable Report File, Report Plot and Print to Console.
15. Save the case and data files (airfoil-1.cas.gz and airfoil-1.dat.gz).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
254 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
The force reports (Figure 5.8: Drag Coefficient Convergence History (p. 256) and Figure 5.9: Lift Coefficient
Convergence History (p. 257)) show that the case is converged after approximately 200 iterations.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 255
Modeling External Compressible Flow
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
256 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 257
Modeling External Compressible Flow
17. Save the case and data files (airfoil-2.cas.gz and airfoil-2.dat.gz).
5.4.9. Postprocessing
1. Plot the distribution on the airfoil (Figure 5.11: XY Plot of y+ Distribution (p. 260)).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
258 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
b. Select Turbulence... and Wall Yplus from the Y Axis Function drop-down list.
Note
The values of are dependent on the resolution of the mesh and the Reynolds number
of the flow, and are defined only in wall-adjacent cells. The value of in the wall-adjacent
cells dictates how wall shear stress is calculated. When you use the Spalart-Allmaras
model, you should check that of the wall-adjacent cells is either very small (on the
order of ), or approximately 30 or greater. Otherwise, you should modify your mesh.
Figure 5.11: XY Plot of y+ Distribution (p. 260) indicates that, except for a few small regions
(notably at the shock and the trailing edge), and for much of these regions it does
not drop significantly below 30. Therefore, you can conclude that the near-wall mesh
resolution is acceptable.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 259
Modeling External Compressible Flow
2. Display filled contours of Mach number (Figure 5.12: Contour Plot of Mach Number (p. 261)).
b. Select Velocity... and Mach Number from the Contours of drop-down list.
d. Zoom in on the region around the airfoil, as shown in Figure 5.12: Contour Plot of Mach Number (p. 261).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
260 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
Note the discontinuity, in this case a shock, on the upper surface of the airfoil in Figure 5.12: Contour
Plot of Mach Number (p. 261) at about .
3. Plot the pressure distribution on the airfoil (Figure 5.13: XY Plot of Pressure (p. 262)).
b. Select Pressure... and Pressure Coefficient from the Y Axis Function drop-down lists.
c. Click Plot.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 261
Modeling External Compressible Flow
Notice the effect of the shock wave on the upper surface in Figure 5.13: XY Plot of Pressure (p. 262).
4. Plot the component of wall shear stress on the airfoil surface (Figure 5.14: XY Plot of x Wall Shear
Stress (p. 263)).
b. Select Wall Fluxes... and X-Wall Shear Stress from the Y Axis Function drop-down lists.
As shown in Figure 5.14: XY Plot of x Wall Shear Stress (p. 263), the large, adverse pressure gradient induced
by the shock causes the boundary layer to separate. The point of separation is where the wall shear stress
vanishes. Flow reversal is indicated here by negative values of the x component of the wall shear stress.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
262 of ANSYS, Inc. and its subsidiaries and affiliates.
Setup and Solution
5. Display filled contours of the component of velocity (Figure 5.15: Contour Plot of x Component of Velo-
city (p. 264)).
Note the flow reversal downstream of the shock in Figure 5.15: Contour Plot of x Component of Velo-
city (p. 264).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 263
Modeling External Compressible Flow
6. Plot velocity vectors (Figure 5.16: Plot of Velocity Vectors Downstream of the Shock (p. 265)).
c. Zoom in on the flow above the upper surface at a point downstream of the shock, as shown in Fig-
ure 5.16: Plot of Velocity Vectors Downstream of the Shock (p. 265).
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
264 of ANSYS, Inc. and its subsidiaries and affiliates.
Further Improvements
Flow reversal is clearly visible in Figure 5.16: Plot of Velocity Vectors Downstream of the Shock (p. 265).
5.5. Summary
This tutorial demonstrated how to set up and solve an external aerodynamics problem using the pressure-
based coupled solver with pseudo transient under-relaxation and the Spalart-Allmaras turbulence
model. It showed how to monitor convergence using force and surface report definitions, and demon-
strated the use of several postprocessing tools to examine the flow phenomena associated with a shock
wave.
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 265
Release 18.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
266 of ANSYS, Inc. and its subsidiaries and affiliates.