METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert 1 Middle East Technical University Mechanical Engineering Department ME 485 CFD with Finite Volume Method Fall 2017 (Dr. Sert) ANSYS Fluent Tutorial – Developing Laminar Flow in a 2D Channel 1 How to use This Tutorial? As you read it also perform each step on your own computer. Do not skip any detail. You are advised to finish all the steps in one sitting so start working on it when you have enough time to finish. Take notes about things that you cannot follow and let the course instructor know about them. Also let him know if you notice any mistakes. Do not forget that the aim of the tutorial is not really solving the selected problem in the most accurate and efficient way. The aim is to show you how to setup and solve a problem in ANSYS Fluent. The typical three stage procedure (pre-processing, solution, post-processing) is also not that different in other commercial software. When you finish all the steps you can go back and try changing problem definition parameters, try different mesh generation or solution settings, perform extra post-processing, etc. Choices are endless. You’ll also see many general CFD related discussion, important notes, questions and “to do” items inside the tutorial. Problem Definition Consider a 2D channel of length 1 m and height 0.1 m. A fluid with density 1 kg/m 3 and viscosity 0.0001 Pa-s enters the channel at a uniform speed of 0.025 m/s. We want to simulate the developing laminar flow in the channel. We are interested in how the velocity profile and the pressure changes as the flow develops. Reynolds number based on the inlet speed and channel height is = = (1)(0.025)(0.1) 0.0001 = 25 which is a very low value making the flow definitely laminar. Question: Why do we define the Reynolds number based on channel height, but not channel length? When will this flow turn into turbulent? 1 ANSYS 18.2 student version is used to prepare this tutorial. Some screenshots show 14.5 as the version. Do not get confused by that. Those are the parts where there is not much difference between different versions, so I used old screenshots that I took previously. 1 m 0.1 m 0.025 m/s No slip p = 0
47

FLUENT Tutorial 1

Feb 10, 2017

Documents

NguyễnHạnh
Welcome message from author
Transcript

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

1

Middle East Technical University Mechanical Engineering Department

ME 485 CFD with Finite Volume Method Fall 2017 (Dr. Sert)

ANSYS Fluent Tutorial – Developing Laminar Flow in a 2D Channel1

How to use This Tutorial?

As you read it also perform each step on your own computer. Do not skip any detail. You are advised to finish

all the steps in one sitting so start working on it when you have enough time to finish. Take notes about things

that you cannot follow and let the course instructor know about them. Also let him know if you notice any

mistakes.

Do not forget that the aim of the tutorial is not really solving the selected problem in the most accurate and

efficient way. The aim is to show you how to setup and solve a problem in ANSYS Fluent. The typical three stage

procedure (pre-processing, solution, post-processing) is also not that different in other commercial software.

When you finish all the steps you can go back and try changing problem definition parameters, try different

mesh generation or solution settings, perform extra post-processing, etc. Choices are endless. You’ll also see

many general CFD related discussion, important notes, questions and “to do” items inside the tutorial.

Problem Definition

Consider a 2D channel of length 1 m and height 0.1 m. A fluid with density 1 kg/m3 and viscosity 0.0001 Pa-s

enters the channel at a uniform speed of 0.025 m/s. We want to simulate the developing laminar flow in the

channel.

We are interested in how the velocity profile and the pressure changes as the flow develops.

Reynolds number based on the inlet speed and channel height is

𝑅𝑒 =𝜌𝑈𝑖𝑛𝐻

𝜇=(1)(0.025)(0.1)

0.0001= 25

which is a very low value making the flow definitely laminar.

Question: Why do we define the Reynolds number based on channel height, but not channel length? When

will this flow turn into turbulent?

1 ANSYS 18.2 student version is used to prepare this tutorial. Some screenshots show 14.5 as the version. Do not get confused by that. Those are the parts where there is not much difference between different versions, so I used old screenshots that I took previously.

1 m

0.1 m

0.025 m/s No slip

p = 0

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

2

Step 1:

Start ANSYS Workbench. You’ll see 2 tabs as

Toolbox

Project Schematic

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

3

Step 2:

In the “Toolbox” tab, under Analysis Systems, find “Fluid Flow (Fluent)” and drag and drop it to the “Project

Schematic” tab.

Change the name of the analysis to “Tutorial 1”.

A Fluent analysis is composed of 5 parts

Geometry: To draw or export the problem domain

Mesh: To generate the computational mesh

Setup: To define the problem physics, boundary conditions, solver settings, etc.

Solution: To run the analysis

Results: To post-process the solution

In this tutorial we’ll be using the first three, i.e. Geometry, Mesh and Setup.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

4

Step 3:

In the View menu of the Workbench select “Properties” to see the Properties tab.

In the Project Schematic select “Geometry”.

In the “Properties” tab change “Analysis Type” from 3D to 2D.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

5

Step 4:

To generate the problem geometry, we have three options;

Draw it in Space Claim

Draw it in Design Modeler

Space claim is a full featured CAD software. Design Modeler is a simpler tool. We’ll use the Design Modeler for

our simple rectangular problem domain.

In the Project Schematic right click on “Geometry” and select “New DesignModeler Geometry”.

This will open the Design Modeler window. It has 3 main tabs

Tree Outline (Under it there are Sketching and Modeling tabs)

Details View

Graphics

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

6

Step 5:

At the lower right corner of the Graphics tab find the X, Y, Z arrows and click on the Z arrow to look directly at

the XY plane from -Z direction.

Step 6:

In the “Tree Outline” tab select the Sketching tab and under Draw select Rectangle.

Draw a rectangle of arbitrary size by locating its lower left corner at the origin.

Right click on the Graphics tab and select “Zoom to Fit”. There is also a button for this in the toolbar ( )

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

7

Step 7:

In the Sketching tab select Dimensions.

Select Horizontal and insert a horizontal dimension by selecting left and right sides of the rectangle.

Select Vertical and insert a vertical dimension by selecting upper and lower sides of the rectangle.

In the “Details View” tab set the values of horizontal and vertical dimensions to 1 m and 0.1 m, respectively.

Select “Zoom to Fit”.

Important Note: Depending on the regional settings of your computer real numbers may require either “,” or

the “.” as the decimal point. In my computer I need to use “,”.

Note: You may need to adjust the positions of H1 and V1 dimensions. To do this in the sketching tab, select

Dimensions and Move.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

8

Step 8:

From the Concept menu select “Surfaces from Sketches”.

In the Modeling tab, select “Sketch 1” under XYPlane.

In the “Details View” tab, press “Apply” button to set the “Base Objects”.

Click the Generate button of the toolbar to generate a 2D part that will be seen in gray color in the Graphics

view.

The Tree Outline should look like this, showing the part that we just generated.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

9

Step 9:

In the Modeling tab you’ll see “1 Part, 1 Body” under which there is “Surface Body”.

Right click on “Surface Body” and change its name to “Channel”.

In the “Details View” change Fluid/Solid to Fluid.

Use Ctrl-S to save the project and close the DesignModeler window to go back to the Workbench window.

Important Note: When saving your project make sure that the file name and the whole PATH do not contain any

Turkish characters.

If you go to the folder where you saved the project you will see the Workbench file and two folders. The 2D

drawing we created is at Tutorial 1_files > dp0 > FFF > DM > FFF. Very weird names, I know.

Note: As you may have noticed, working in the Design Modeler is not very comfortable. You can try Space Claim

if you want. It is a more modern CAD software.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

10

Step 10

In the Problem Schematic tab of the Workbench double click on “Mesh” to

start the Meshing application

Meshing application has 3 main tabs

Outline

Details of Model

Geometry

Note: When first started Meshing application comes with many Toolbars at the top. You can close the ones that

you do not use often from View > Toolbars menu.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

11

Step 11:

If necessary click on the Z arrow of the Geometry tab to see the channel from -Z direction and select “Zoom to

Fit”.

First we’ll give names to the inlet, exit and upper/lower walls so that later these names can be used to define

boundary conditions and to perform post-processing.

Click on the Edge button ( ) of the toolbar in order to be able to select edges.

Using the mouse and the Ctrl key select upper and lower walls of the rectangular domain. In the Geometry tab,

right click and select “Create Named Selection”. Give a name “Walls” to this selection.

Select the left side of the rectangular domain, right click and select “Create Named Selection”. Give a name

“Inlet” to this selection.

Select the right side of the rectangular domain, right click and select “Create Named Selection”. Give a name

“Outlet” to this selection.

In the Outline tab, click on the created “Named Selections” and see if the correct parts of the problem domain

are highlighted or not. If not, delete and recreate them.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

12

Step 12a:

Select Mesh in the Outline tab.

Press the “Generate Mesh” button of the toolbar.

With the default parameters, the following coarse structured mesh will be generated.

In the Statistics part of the Details tab you can see that the mesh has 63 nodes (cell corners are called nodes)

and 40 elements (cells).

Note: If you cannot see the mesh, make sure that Mesh is selected in the Outline tab.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

13

Step 12b:

The mesh generated with the default options seems too coarse to capture correct velocity and pressure

variations across and along the channel. The expected fully developed parabolic velocity profile may require

more than two cells across the channel to be resolved correctly.

It is possible to control the mesh details in many different ways. There are official ANSYS tutorials for mesh

generation.

A quick way to make the mesh finer in the whole problem domain is to change the change the “Relevance

Center” in the Details tab. Change it to Fine. Press the Update button of the toolbar. A new mesh of 476 elements

will be created. Now there are 6 cells across the channel. This may be enough for this simple laminar flow.

Note: “Relevance Center” is a global mesh control parameter, i.e. it affects the whole mesh. It can take three

values; Coarse, Medium and Fine. It’s also possible to change the mesh locally, e.g. make it fine close to the inlet

only, or make it fine close to the top and bottom walls.

Note: How can we make sure that a generated mesh is good for a given problem? That’s a very good, but hard

to answer question. It is the million dollar question of CFD. As you work on different problems and get

experienced, you’ll start developing a feeling of mesh requirements.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

14

Step 12c:

If you want to refine the mesh further, change the Relevance parameter to its maximum possible value of 100

and press the Update button. This is another quick way of changing the cell numbers globally.

This new mesh has 1000 elements. It has 10 cells across the channel.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

15

Step 12d:

If you want to make the mesh even finer, right click on Mesh in the Outline tab and select Insert->Refinement.

In the Geometry tab select the rectangular domain and press Apply button on the Details tab.

Leave the Refinement value at its default value of 1. You can increase it to have more cells.

Press the Update button. The new mesh has 4000 cells. It has 20 cells across the channel.

There are many other ways to control the cell sizes both locally and globally. But we’ll stop here and use this last

mesh of 4000 cells.

Save the project and close the Meshing window to go back to the Workbench.

To Do: After finishing this tutorial you can come back to this step and try to solve it with a coarser mesh (e.g.

one of the coarser ones that we generated above) and see how the results are affected by this.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

16

Step 13

In the Workbench window double click on Setup to start Fluent.

In the Fluent Launcher window, check Double Precision option. With this option floating point numbers are kept

in computer’s memory in double precision, instead of single precision. This will result in less round-off errors

and may improve accuracy and convergence, but also increases memory usage. We almost always use Fluent in

double precision.

Press OK.

Important Note: As far as I could notice, ANSYS software constantly communicates with ANSYS (the company)

about licensing. When I tried to launch Fluent I got an error saying “The FLUENT application failed to validate

the connection” and Fluent stopped responding. After I installed all Windows updates, everything turned to

normal.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

17

In Fluent you can either use the Menu or the Tree tab to setup and solve the problem. I usually use the latter

and to save some screen space I minimize the Menu using the “Minimize ribbon” button ( ).

Note: As seen above, “Gravity” option is not checked. Therefore, weight of the fluid will not be included in the

momentum equations. You need to determine whether fluid weight is important or not in a given problem.

What do you think, is it important in this case? Why/Why not?

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

18

Step 14:

Inside the Tree, double click on General under Setup.

We’ll not change the default settings here. Pressure-based solver is preferred for incompressible flows and

density based one is used for compressible cases. This problem is time independent (steady). And it is a 2D

planar problem.

You can click on the Help button to read the technical details about these options. ANSYS Fluent has a good

Help.

Note: “Report Quality” button calculates quality measures (such as orthogonality or aspect ratio) of the mesh.

For the mesh we created quality is of no concern.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

19

Step 15:

Double click on Models.

Again we do not need to change anything.

This is a single phase flow with no heat transfer. Therefore, we do not need to solve for the energy equation.

Also the flow is in the laminar regime. All other model settings are “Off”.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

20

Step 16a:

Double click on Materials.

Fluent uses air as default fluid and aluminum as the default solid.

In this problem we do not have any solid domain. But the fluid is not air, its properties are given in the first page

of this tutorial.

Double click on “air” to change the fluid properties.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

21

Step 16b:

Fluent comes with a database of different fluids. But the one we use in this problem is none of those. So let’s

create a new fluid.

Change Name to myfluid.

Enter 1 for density and 0.0001 for viscosity.

Press the Change/Create button.

Press Yes in the dialog box that asks for “Change/Create mixture and Overwrite air”? This will replace the

default air with the newly defined myfluid.

Press Close to close the “Create/Edit Materials” window.

Important Note: Previously in Step 7 we used “,” as the decimal point. But here in Fluent we need to use “.”.

This is an inconsistency. Beware of that.

Important Note: While working in Fluent save your work from time to time. Fluent has no autosave capability.

All your unsaved work will be lost in case of power outage or a software crash.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

22

Step 17:

Double click “Cell Zone Conditions”

There is only one zone here, the channel. It is the name we gave to it in Step 9. Its type is fluid.

Double click on “channel” and make sure that its material is the newly created myfluid.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

23

Step 18a:

Double click “Boundary Conditions”.

There are four items; inlet, interior-channel, outlet and walls. Interior-channel is the one automatically created

by Fluent. The other three are the ones we named previously in Step 11.

Select “inlet” and make sure that its type is “velocity-inlet”.

Note: If you give meaningful names to boundaries of your domain, Fluent can automatically assign correct

boundary condition types to them. For example, when Fluent sees the word “inlet” in a name, it automatically

assigns “velocity-inlet” type to it, which is most probably what you want. But still it is always a good idea to

check whether correct boundary condition types are assigned or not.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

24

Double click on “inlet” and change Velocity Magnitude to 0.025 (the value given in the first page of the tutorial).

Step 18b:

Select “outlet” and make sure that its type is “pressure-outlet”.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

25

Double click “outlet” and set Gauge Pressure to 0. Default value is already zero.

Note: Fluent works with gauge pressures. As seen below in the “Operating Conditions” window that is accessed

from “Cell Zone Conditions”, operating pressure is set to 101325 Pa by default, which is 1 atm. When we specify

0 gauge pressure at an outlet, it is with respect to this operating pressure.

For incompressible flows the actual pressure values are not important, only the space derivatives of pressure

are important. Therefore, selecting another operating pressure or a different exit gauge pressure will only shift

all pressure values of the final result up or down by a certain constant. But this will not affect the velocity field

at all. But for compressible flows, pressure is a thermodynamic property and its actual value is important. We

cannot arbitrarily specify a zero gauge pressure at an outlet of a compressible flow.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

26

Step 18c:

Select “walls” and make sure that its Type is wall.

Double click on “walls”. By default it is a stationary wall with no-slip boundary condition. Do not change them.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

27

Step 19:

We’ll skip the “Dynamic Mesh” and “Reference Values” parts of Setup. They are not used for this problem.

“Dynamic Mesh” part is used when the boundaries of a problem domain are moving and therefore the mesh

inside is also moving.

“Reference Values” part is used to set the reference quantities for computing normalized flow field variables.

For example, to calculate the drag force coefficient over a body we need a reference velocity, a reference density

and a reference area.

This is the end of the Setup process in Fluent.

Save the project.

No need to change anything under these.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

28

Step 20:

Under the “Solution” title double click on Methods.

We’ll not change the default options.

Notes: The default scheme is SIMPLE, which stands for “Semi Implicit Method for Pressure Linked Equations”. It

is one of the most commonly used techniques to solve incompressible flows. We’ll study it in our course. The

alternatives SIMPLEC and PISO are variations of SIMPLE. PISO is usually preferred for unsteady flows. These three

are “segregated (sequential)” solvers, i.e. continuity and scalar momentum equations are solved one-by-one. In

the last alternative “Coupled”, all governing equations are discretized into a single system of linear algebraic

equations and solved at once. It usually consumes more memory, but provides faster solutions. You are advised

to use “Coupled” solver if your computer has enough memory. For the 2D simple problem that we are working

on with only 4000 elements Coupled solver will not create any memory issues, but we’ll go with the default

SIMPLE scheme.

Other settings are about how different terms of the governing equations are discretized. As you get more

experienced in CFD, you are advised to read the details from the Help.

To Do: After finishing this tutorial, you can come back to this step and change the Scheme to Coupled, initialize

the problem and solve it again to see how the number of iterations necessary for convergence will be affected

by this. This is a small 2D problem and run-time is very short anyway, I know, but that’s not the issue here. The

issue is to understand how different settings affect the solution.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

29

Step 21:

Double click on “Controls”. We’ll not change the default settings.

Here we set the under-relaxation factors. Navier-Stokes equations are non-linear and they need to be linearized

during the discretization step. This linearization makes the whole solution iterative. Conceptually, it is different

than the iterative solution of a linear algebraic equation system. But the possibility of divergence and the cure

of it are similar. Remember the iterative linear algebraic equation system solution techniques, such as Gauss-

Seidel, from ME 310 course. Those techniques work iteratively and there is the possibility of divergence. To

reduce that possibility, we can use under-relaxation. What we do here is similar to that.

Note: If you face convergence problems, i.e. residuals are not dropping or if the solution totally blows up, you

can consider lowering these relaxation values. Lowering them will decrease the possibility of divergence, but

will also reduce the rate of convergence, i.e. the residuals will drop slower.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

30

Step 22:

Under Monitors, double click Residual.

Here we can control how the residuals are printed and plotted on the screen. Also we can set the tolerance

values for the convergence of each scalar differential equation that we solve. In this 2D problem we solve for

continuity, x-momentum and y-momentum equations. By default, tolerance is set to 0.001 for all. It is usually a

good idea to reduce these values at least one order of magnitude, i.e. to 0.0001. As you decrease the tolerances,

the converged approximate numerical solution that you’ll calculate will satisfy the conservation equations

better. But lower tolerances will result in doing more iterations to get a converged result and therefore will take

more time.

Here we’ll not change the defaults.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

31

Step 23:

Other than the residual plot that is created by default, it is also advised to watch the progress of a solution by

creating monitor points. Fluent calls this “reporting”.

In our problem the flow will develop from inlet to exit. If the exit velocity profile is not changing anymore during

the iterations, we can take it as an indication of a converged steady solution.

So we’ll monitor the x-velocity component at the mid-point of the exit boundary, i.e. at point (1, 0.05).

Double click on “Report Definitions” and press the New button. Select “Surface Report” and “Vertex Average”.

Note that Fluent’s reporting related terminology is a bit strange.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

32

Change the name of this report to exit-velocity.

Change the Field Variable to “Velocity…” and select “X Velocity”.

Select “Report Plot” to generate a plot of the monitored data during the solution. Also select “Print to Console”

so that the monitored data can also be seen as numbers.

To select the monitoring point press the New Surface button and select Point.

Note: As seen above it is also possible to select “Report File” to write the monitored data to a file. This way we

can open and work on it in any way we want. We’re not doing it now.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

33

Enter the coordinates as (1, 0.05) and name the point as “exit-mid-point”.

Press Create and close the window.

Now you are back to the Report Definition window and under “Surfaces”, the newly created exit-mid-point

appeared. Select it and press OK.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

34

Since we selected the “Report Plot” option while setting up the monitoring details, a new “Report Plot” called

“exit-velocity-rplot” appeared under Monitors -> Report Plots.

If you want, double click on it change its properties, such how it will appear on the screen, e.g. how many digits

the axes numbers will use or how thick and in what color the plotted curve will be.

We’ll not change the defaults.

Notes: In Fluent it is possible to generate monitors not only for points, but also for areas and volumes. For

example, you can monitor the mass flow rate at the exit. There are also many built-in monitors, such as those

for lift and drag coefficient acting on a body or heat transfer rate passing through a part of the boundary.

It is possible to define new stopping criteria for iterations based on the

monitored data. To do that you can use “Convergence Conditions”,

seen on the right. We’ll not do that here.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

35

Step 24:

Before we solve the problem we need to initialize the unknowns. This is necessary also for steady problems

because the solution procedure is iterative and it needs initial guesses to stat the iterations.

Double click Initialization.

Keep the default Hybrid Initialization option and press the Initialize button.

Save the project.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

36

Step 25:

In the Run Calculation tab set Number of Iterations to 1000 and press the Calculate button.

Note: The value 1000 is selected somewhat arbitrarily. If, after the solution, it turns out to be not enough, we

can always perform additional iterations, so it is not a problem.

During the solution residuals and monitored data will be written in the Console tab as seen below.

For this simple 2D problem the solution finished in only a few seconds. It converged in 43 iterations (Iteration

numbers can be a bit different if you use a different version of ANSYS). As soon as the residuals of all three

equations (continuity, x-velocity and y-velocity) drop below the specified tolerance (0.001), solution is

considered to be converged and stopped. The final value of the x-velocity at the mid-point of the exit plane is

reported as 0.0368 m/s.

Residuals Monitored data at the exit-mid-point

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

37

During the solution two plots are generated, one for the residuals and one for the monitored data.

Residual plot looks like this. Note that these are scaled (normalized) residuals. See Fluent’s Help to see what

exactly they correspond to. At this point it is enough to know that they are a measure of how good the calculated

approximate solution satisfies the equations that are solved.

There is one curve for each of the solved equations. White curve is for continuity equation and it is the one that

converges slowest.

The plot for the monitored velocity at the exit plane is given below. Although it is hard to read the numbers in

this view, it starts from an initial value of ~0.025 (which is the inlet speed. Fluent used it to initialize all velocities)

and reaches a value of ~0.037. But looks like that the curve is still in rise, that’s it did not reach steady state yet.

It’s almost there, but not exactly.

Tolerance

that we set

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

38

Step 26:

To make sure that steady state is reached at convergence, let’s decrease the convergence tolerances and

Go back to the following Residuals Monitor window and reduce the tolerances by 100 times, to 10-5.

Under “Run Calculation” press Calculate. Note that we did not initialize the problem, meaning that the new

solution will continue from where the previous one stopped. This is what we want.

The new solution will converge in a few seconds with a total of 132 iterations. All residuals will drop down to

the specified tolerance and the new monitored data plot will be as follows, which shows a better steady state

convergence. The converged x-velocity at the mid-point of the exit plane is now 0.0373 m/s (as seen in the

Console tab), not that much different than the previously calculated one.

Not changing anymore.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

39

Step 27:

We have two options to do post-processing and generate plots.

Do it inside Fluent. That’s what we’ll do here. Fluent’s built in visualization capabilities are enough for us

for this problem.

Use the CFD-Post application that comes with Fluent. For this, close Fluent, go back to ANSYS Workbench

and double click on the Results part of the analysis. You can perform more advanced visualizations and

generate better looking plots with CFD-Post, but it has its own learning curve.

Let’s draw some contour plots.

Under Results, double click Contours.

In the Contours window check the Filled option, set “Contours of” parameter to Velocity and Velocity Magnitude

and deselect all the Surfaces.

Press the Save/Display button to see the velocity magnitude contours.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

40

Following velocity magnitude contour will be generated. Developing and fully developed regions can be

distinguished. The legend is not shown here, but red color shows high speed and blue shows low speed. As the

flow develops, fluid particles close to the walls slow down (blue color) due to the no-slip boundary condition

and those close to the channel centerline speed up (red color) to conserve mass.

Notes: To zoom in/out use the mouse wheel. To zoom into a specific region use “Ctrl + Left mouse button”. To

pan (move the plot around) use “Ctrl + Right mouse button”.

Important Note: You can save the generated plots using the “Save Picture” button ( ) on the left of the contour

plot. While doing this make sure that “White Background” option is checked. When you put post-processing

images in your homework report, do it this way and if necessary open the saved image in an image editor

software (simplest is Microsoft Paint) and crop unwanted details.

Let’s also see what the pressure is doing by creating another contour plot. Double click Contours and this time

select Pressure and Static Pressure. Contour plot is given below. In the developing region iso-contour lines are

curved but in the fully developed part they are straight and vertical. This is expected because in the fully

developed region streamlines are straight and parallel and from Me 305 course we know that pressure variation

across such straight lines are hydrostatic (as if the fluid is not moving). When the fluid weight is not accounted

for this means at each cross section pressure need to be constant, and it is.

Note: If you do not check the “Filled” option when creating a contour plot, iso-contour lines will be shown. It

might be a better option for the above pressure plot.

Developing region

(roughly)

Fully developed region

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

41

Step 28:

To plot the streamlines double click “Pathlines”. For this steady problem streamlines and pathlines are the same.

To release the streamlines from the inlet select inlet as shown below. Press Save/Display.

Streamline plot is as follows.

Following version shows a close up view of the inlet part. Close to the inlet there are nonzero 𝑣 velocity

components as expected. As the fluid slows down due to no-slip at the walls it rushes into the centerline,

increasing the centerline speed.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

42

To Do: In many plots including the above one, we do not want to see the default blue background color of

Fluent. Can you change it to white?

To Do: At the bottom left corner of the Pathlines window there is a “Pulse Mode” option. If you change it to

Continuous and Press the Pulse button, you can see a nice animation of pulsed streamlines. Try it.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

43

Step 29:

Let’s have a look at how the centerline velocity changes.

Under Plots double click “XY Plot”.

First let’s generate a line that’ll represent the centerline. Press New Surface button and select Line/Rake.

In the “Line/Rake Surface” window enter the end points of the centerline as (0.0, 0.05) and (1.0, 0.05).

Rename the line as “center-line” and press the Create button. Close the window

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

44

Now you are back at the “Solution XY Plot” window

Select Velocity and X Velocity for the variable to be plotted.

Select center-line from the Surface list. Press Save/Plot.

𝑥 velocity changes along the centerline as follows. It starts from the inlet value of 0.025 m/s and smoothly rises

to the fully developed value of 0.073 m/s (it is hard to read it from this plot but we monitored for that value

previously and we know it precisely). Entrance length is roughly about 0.3 m, i.e. 3 times the channel height.

Developing region (roughly) Fully developed region

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

45

Let’s also plot the pressure variation along the centerline.

Double click “XY Plot” and this time select Pressure and “Static Pressure”. Also select the already available

center-line.

The result is shown below. Other than the short region close to the entrance pressure drop is linear. It is expected

based on the known analytical solution of this laminar 2D problem (see your ME 305 notes/book).

Note: The total pressure drop along the centerline is 0.003 Pa. It is a very small value due to the short channel

length, low speeds and low viscosity value.

To Do: Calculate the slope of the pressure drop (𝑑𝑝/𝑑𝑥) in the fully developed region and see if it matches with

the analytical solution or not?

To Do: Analytical solution is available only for the fully developed region, not the developing part. What is so

difficult in the developing part that it is hard to solve (if possible at all) analytically?

Important Note: In most of the visualization plots given of this document, axes numbers are hard to read. In

your homework reports you need to include figures with readable text. Pay attention to this detail.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

46

Step 30:

As a final visualization let’s plot the x-velocity profile at the exit plane.

Double click “XY Plot”.

Select Velocity and “X Velocity” for the variable to be plotted.

Select the already available “outlet” from the Surface list.

Change the “Plot Direction” as shown below (this is necessary because now we plot something against the

vertical 𝑦 axis. Kind of puzzling, I know)

Press Save/Plot.

Note: As seen above there is the “Write to File”. With this option you can write the numerical values of the

extracted data and study it whenever you want. If you want, you can plot it with another software like Excel or

MATLAB.

METU Mechanical Eng. Dept. - ME 485 CFD with Finite Volume Method Prepared by Dr. C. Sert

47

The generated exit velocity profile is shown below. As expected the fully developed velocity profile is parabolic.

Analytical solution of the fully developed part of this problem would give the maximum centerline value of the

parabolic profile as 1.5𝑈𝑖𝑛𝑙𝑒𝑡 = (1.5)(0.025) = 0.0375 m/s. What we calculated here is 0.0373 m/s, which is

only 0.5% off.

To Do: The horizontal axis name shown above is “Position (m)”, which is not very informative. It would be better

if it says “y (m)”. Can you change that? Also it would be better if we interchange horizontal and vertical axes

variables of this plot, i.e. velocity on the horizontal axes and 𝑦 coordinate on the vertical axes. Can you change

that?

Note: All the plots we generated can be seen under Results. You can right click and edit them as you want.