You are on page 1of 22

19.

0 Release

Workshop 01: Fluid Flow Around the NACA0012 Airfoil


ANSYS CFX Customization Course

1 © 2018 ANSYS, Inc. May 25, 2018


Introduction
Workshop Description:
The flow simulated is an external aerodynamics application for the two-dimensional
flow around a NACA0012 airfoil
Learning Aims:
• Writing CEL expressions for the Lift and Drag forces using a local coordinate system
• Monitoring these expressions
• Reading in and plotting experimental data alongside CFD results
• Rewriting those CEL expressions in the global coordinate system to enable a
parameterization
Learning Objectives:
How to write CEL expressions in various coordinate systems and how to parameterize
the setup

2 © 2018 ANSYS, Inc. May 25, 2018


Import the Supplied Mesh File
Start ANSYS Workbench 19.0
• Drag and drop a CFX Analysis System into the Project Schematic.
• Import the mesh naca0012coarse.cfx5 Provided with the workshop inputs.
• The mesh was created with ICEM CFD, choose the right filter.
• Launch CFX Pre.

3 © 2018 ANSYS, Inc. May 25, 2018


Case Setup: Boundary Condition Values

It is important to place the far field (inlet and outlet) po    − 1  2  −1

= 1 +  M 
boundaries far enough from the object of interest. p   2  
→ For example, in lifting airfoil calculations, it is not uncommon for the where
po = total pressure = 101325 Pa
far-field boundary to be a circle with a radius of 20 chord lengths.
p = static pressure
 = 1.4 for air
M = Mach No. = 0.7
This workshop will compare CFD with wind-tunnel test data at po
= 1.3871  p = 73048 Pa
p
Ma = 0.7. Therefore we need to calculate the static conditions
at the far-field boundary for T and p. To    − 1  2 
= 1 +  M 
→ We calculate this from the total pressure, which is atmospheric at T   2  
101325 Pa. where
To = total temp. = 311K
→ The wind tunnel operating conditions for validation test data give the
T = static temp.
total temperature as T0 = 311 K.
To
= 1.098  T = 283.24 K
T

4 © 2018 ANSYS, Inc. May 25, 2018


Case Setup: Basic Settings
Edit the domain so that:
• Air Ideal Gas is used as material,
• The SST turbulence model, and
• Total Energy model are applied.
Set the Reference Pressure of your domain
• pRef = 73048 [Pa]

The SST turbulence model is a very powerful model for aerodynamic, external flows.
The Total Energy model is needed for compressible flows where the Ma > 0.3
Since the fluid is compressible, density depends on Absolute Pressure. The Reference Pressure chosen ensures
that the values of static pressure in the solution are not too large compared with the differences, so
minimising round-off errors.
5 © 2018 ANSYS, Inc. May 25, 2018
Case Setup: Coordinate Frame
The angle of attack is 1.55 degrees (α).
One way of accounting for this angle is to create a new coordinate system whose z-
axis is in line with the flow direction.
We will use this new coordinate system when applying boundary conditions.
→Create a new coordinate frame: y

→Insert → Coordinate Frame → Name = Coord 1


→Option = Axis Points
→Origin = 0, 0, 0
→Z axis = 0.999634, 0.027049, 0 (cos1.55°, sin1.55°, 0)
→X-Z Plane Pt = 1, 1, 0 (a point on the plane) α
x
Original Coordinate Frame

An alternative way of accounting for this angle of attack would be to rotate the
velocities at the inlet via expressions. This is shown in the Appendix, slides 20-22
6 © 2018 ANSYS, Inc. May 25, 2018
Case Setup: Boundary Conditions
Create a boundary condition for the inlet:
→ Set Cartesian velocity components based on the new coordinate system, Coord 1:
(U,V,W) = (0, 0, 0.7*340.29) [m/s]
340.29[m/s] equals Ma = 1.0 for the given free stream values,
i.e. it is the speed of sound under the prevailing conditions.
→ Set values for turbulence intensity and eddy viscosity ratio:
Fractional Intensity = 0.01, Eddy Viscosity Ratio = 1.0
→ Set the Static Temperature at the inlet:
T = 283.24 [K]
This will create an inlet boundary condition with air flowing at a speed flow with Ma =
0.7 at an angle of attack (α) of 1.55 deg.
7 © 2018 ANSYS, Inc. May 25, 2018
Case Setup: Boundary Conditions
Create a boundary condition for the outlet:
→ Set a relative average pressure of 0 [Pa].

Create a no-slip, adiabatic wall boundary,


called airfoil, containing the upper and
lower surfaces of the airfoil.

Create two symmetry boundary conditions


for the bottom (low z) and the top (high z) of
the domain.

8 © 2018 ANSYS, Inc. May 25, 2018


Case Setup: Solution Monitors
To help check convergence you will monitor the
lift and drag coefficients.
• The drag coefficient, for example, is calculated as
cD = 2F/(Av²).
– Density and velocity refer to free stream values and A is
the area of the airfoil calculated as chord * span of the
airfoil, the chord being a straight line between the
leading and trailing edges.
• In CEL this is defined as:
2*force_z_Coord 1()@airfoil /
(0.6[m^2]*massFlowAve(Density)@inlet
*(massFlowAve(Velocity)@inlet)^2)
• Use the above expression to create a Monitor
Point for the drag coefficient.

9 © 2018 ANSYS, Inc. May 25, 2018


Case Setup: Solution Monitors
• The lift coefficient (and its Monitor Point) is defined analogously for the x component of
force in the local coordinate frame.

– Duplicate the drag Expression (right click on drag under Expressions), rename it to lift and edit the
definiton in the details of lift (change force_z to force_x)

Use the above expression to create a Monitor Point for the lift coefficient.

10 © 2018 ANSYS, Inc. May 25, 2018


Run Calculation
• Close CFX-Pre.
• Save the project to airfoil.wbpj in your working
directory.
• Start the run.
• Review the convergence plots.
• Click User Points to review the lift and drag
coefficient convergence.
– From Reference [1], cl = 0.241 and cd = 0.0079
– Compare with the simulation results and determine the
relative error for these quantities.
– Later we will see how to improve the results in a Best
Practice Study.

• Close the CFX-Solver Manager and import the results


to CFD Post.
11 © 2018 ANSYS, Inc. May 25, 2018
Post Processing - Check the mesh (Y+)
• The correct modeling of the turbulence is a crucial
task in most CFD simulations.
• The reliability of the turbulence models strongly
depends on the correct prediction of the flow
behaviour near the walls.
• The SST model uses the automatic wall function
which allows for integration of the governing
equations directly to the wall (a low Reynolds
number treatment) and so can better predict
boundary layer separation.
The above graph shows non-dimensional velocity versus
– For this to happen, the first grid point should lie within the non-dimensional distance from the wall, y+.
viscous sub-layer (y+ ≤ 2).
– Otherwise the Universal Law of The Wall for turbulence is y  W all / 
y+ =
used. 

12 © 2018 ANSYS, Inc. May 25, 2018


Post Processing - Check the mesh (Y+)

• In CFD-Post y+ values can be accessed at all


wall boundary conditions.

• Check the global range of y+.

13 © 2018 ANSYS, Inc. May 25, 2018


Post Processing – y+ chart
• Plot the y+ values along the
airfoil surfaces.
– Create a Location > Polyline which
represents the pressure and
suction sides of the air foil.
• Use the Boundary Intersection
method.
– Create a chart based on this
polyline which plots the y+ as
function of the x-coordinate.
• Create another chart for the
pressure distribution along the
airfoil.

14 © 2018 ANSYS, Inc. May 25, 2018


Post Processing – Pressure Coefficient (cP)

We will compare the simulation results with experimental data for the pressure
coefficient, cP, on the upper and lower surfaces of the airfoil.
The pressure coefficient is a dimensionless quantity representing the ratio of static
to dynamic pressure, calculated as:
cP = 2(p-p)/(u²)
where  indicates free stream values.
It is used to assess pressure distribution for different designs.

15 © 2018 ANSYS, Inc. May 25, 2018


Post Processing – Pressure Coefficient (cP)
To plot the pressure coefficient you will need to create a new variable.
• On the Variables tab, right-click anywhere in the window and select New…
• Provide a name for the variable, e.g. cp. Do not call it Cp as this is reserved for
specific heat at constant pressure - names of system variables must not be used for
expressions or user variables.
• Enter the expression shown below:

Here the relative static pressure, p, is assumed to be 0 [Pa].


16 © 2018 ANSYS, Inc. May 25, 2018
Post Processing – cP chart
• Create a chart to plot the pressure
coefficient against X on the polyline.
– It shows the expected shape with a
value just above 1 at the stagnation
point (typical for compressible flow)
and a recovery to a slightly positive
value at the trailing edge.
• Import the experimental data by
editing the details of the graph to
include another data series:
– Data Series → New → Name =
Experimental
– Data Source → File → Browse →
ExperimentalData.csv
– Apply.
17 © 2018 ANSYS, Inc. May 25, 2018
Post Processing – Contour Plots
• Examine the contours of
static pressure.

→ Note the high pressure at the


nose and low pressure on the
upper (suction) surface. The
latter is expected as the airfoil
wing is generating lift.

18 © 2018 ANSYS, Inc. May 25, 2018


Post Processing – Contour Plots
• Examine the contours
of Mach Number.

→ Notice that the flow is


locally supersonic (Mach
Number > 1) as the flow
accelerates over the upper
surface of the wing.

19 © 2018 ANSYS, Inc. May 25, 2018


Appendix: Alternative Parametric Defintion for Angle of Attack
1. Add the following CEL Expressions:
AngleOfAttack=1.55 [degree]
DynHead=0.5*massFlowAve(Density)@inlet*(massFlowAve(Velocity)@inlet)^2
U normal= 0.7*340.29 [m/s] * sin (AngleOfAttack)
U parallel=0.7*340.29 [m/s] * cos (AngleOfAttack)
drag= (force_x()@airfoil * cos(AngleOfAttack)
+force_y()@airfoil * sin(AngleOfAttack))/(0.6[m^2]*DynHead)
lift=(-force_x()@airfoil * sin(AngleOfAttack)
+force_y()@airfoil * cos(AngleOfAttack)) /(0.6[m^2]*DynHead)

20 © 2018 ANSYS, Inc. May 25, 2018


Appendix: Inlet Boundary Condition
2. Modify the boundary condition for the inlet:
→ Do not use local coordinate system, Coord 1:
→ Set U = U parallel, V = U normal, W = 0.0

21 © 2018 ANSYS, Inc. May 25, 2018


Appendix: Define Input and Output WB Parameters

3. In CFX-Pre: 5. The parameter Set is added to the


AngleOfAttack project schematic & parameter Manager:

4. In CFD-Post:
drag and lift

22 © 2018 ANSYS, Inc. May 25, 2018

You might also like