About the FLUENT Tutorials What is FLUENT?
How to use these tutorials System requirements Conventions used
Please send us feedback
List of Tutorials
These tutorials progress from simple to more complex. If you are unfamiliar with FLUENT, please begin with the first module.
Introduction to CFD Basics
Laminar Pipe Flow Turbulent Pipe Flow
Compressible Flow in a Nozzle
Flow over an airfoil
Forced Convection over a Flat Plate
About the FLUENT Tutorials
This FLUENT short course consists of a set of tutorials on using FLUENT to solve problems in fluid mechanics. The tutorials lead the user through the steps
involved in solving a selected set of problems using GAMBIT (the preprocessor) and FLUENT. We not only provide the solution steps but also the rationale
behind them. It is worthwhile for the user to understand the underlying
concepts as she goes through the tutorials in order to be able to correctly apply FLUENT to other problems. The user would be ill-served by clicking through the tutorials in zombie-mode. Each tutorial is followed by problems which are
geared towards strengthening and reinforcing the knowledge and
understanding gained in the tutorials. Working through the problem sets is an intrinsic part of the learning process and shouldn't be skipped.
These tutorials have been developed by the Swanson Engineering Simulation
Program in the Sibley School of Mechanical and Aerospace Engineering at
Cornell University. The Swanson Engineering Simulation Program has been established with the goal of integrating computer-based simulations into the mechanical engineering curriculum. The development of these tutorials is being supported by a Faculty Innovation in Teaching award from Cornell University.
What is FLUENT
FLUENT is a computational fluid dynamics (CFD) software package to simulate fluid flow problems. It uses the finite-volume method to solve the governing equations for a fluid. It provides the capability to use different physical models such as incompressible or compressible, inviscid or viscous, laminar or
turbulent, etc. Geometry and grid generation is done using GAMBIT which is the preprocessor bundled with FLUENT.
How to use these tutorials
These tutorials are designed to be used online and run side-by-side with the FLUENT software. After you launch the web tutorials and FLUENT, you will have to drag the browser window to the width of the largest image (about 350
pixels). To make best use of screen real estate, move the windows around and resize them so that you approximate this screen arrangement.
● System: Any system that can run GAMBIT, FLUENT, and a web browser.
● Screen: Resolution should be at least 1280 x 1024 pixels for optimal
viewing. A 17" monitor or larger is recommended.
● GAMBIT version 2.0. These tutorials were created using GAMBIT 2.0.
● FLUENT version 6.0. These tutorials were created using FLUENT 6.0.
● Web Browser: These tutorials work best in 5.0 or higher versions of
Internet Explorer and Netscape because style sheet support is needed. These tutorials can be used with Netscape 4.x but may not render correctly.
Choose a tutorial by selecting from the list at the top of this page
Conventions used
Each tutorial begins with a problem specification. A solution can be obtained by following these nine steps:
1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT 3. Set Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh
These steps appear at the top of each page of the tutorial with the current step highlighted in red.
GAMBIT and FLUENT uses cascading menus which are represented as follows:
Main Menu > File > Export > Mesh...
This means that in the Main Menu, click on File. Then, in the File menu that comes up, click on Export and so on.
Names of windows are in italics.
Items and options appearing within menus and dialog boxes are purple, italic, and bold.
Text and numbers that need to be entered are indicated in Courier font.
Additional explanations and related discussions are enclosed in a box.
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering
Feedback .
Introduction to CFD Basics
Author: Rajesh Bhaskaran
E-mail: [email protected]
Introduction to CFD Basics
You can download the following tutorials in PDF format. You will need Adobe
Acrobat to read these files.
Introduction to CFD Basics Problem set on CFD Basics
Back to: FLUENT Home Page
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Introduction to CFD Basics
Rajesh Bhaskaran Lance Collins
Jan. 2003
This is a quick introduction to the basic concepts underlying CFD. The concepts are illustrated by applying them to a simple 1D example. We discuss the following topics briefly:
1. The Need for CFD 2. Applications of CFD 3. The Strategy of CFD
4. Discretization Using the Finite-Difference Method 5. Discretization Using The Finite-Volume Method
6. Assembly of Discrete System and Application of Boundary Conditions 7. Solution of Discrete System
8. Grid Convergence
9. Dealing with Nonlinearity 10. Direct and Iterative Solvers 11. Iterative Convergence 12. Numerical Stability
its use in industry. The simulations shown below have been performed using the FLUENT software.
CFD can be used to simulate the flow over a vehicle. For instance, it can be used to study the interaction of propellers or rotors with the aircraft fuselage The following figure shows the prediction of the pressure field induced by the interaction of the rotor with a helicopter fuselage in forward flight. Rotors and propellers can be represented with models of varying complexity.
The temperature distribution obtained from a CFD analysis of a mixing manifold is shown below. This mixing manifold is part of the passenger cabin ventilation system on the Boeing 767. The CFD analysis showed the effectiveness of a simpler manifold design without the need for field testing.
Bio-medical engineering is a rapidly growing field and uses CFD to study the circulatory and respiratory systems. The following figure shows pressure contours and a cutaway view that reveals velocity vectors in a blood pump that assumes the role of heart in open-heart surgery.
CFD is attractive to industry since it is more cost-effective than physical testing. However, one must note that complex flow simulations are challenging and error-prone and it takes a lot of engineering expertise to obtain validated solutions.
Broadly, the strategy of CFD is to replace the continuous problem domain with a discrete domain using a grid. In the continuous domain, each flow variable is defined at every point in the domain. For instance, the pressure p in the continuous 1D domain shown in the figure below would be given as
p = p(x), 0 < x < 1
In the discrete domain, each flow variable is defined only at the grid points. So, in the discrete domain shown below, the pressure would be defined only at the N grid points.
pi = p(xi), i = 1, 2, . . . , N
Continuous Domain Discrete Domain
x=0 x=1 x1 xi x
N
0 ≤ x ≤ 1 x = x
1, x2, …,xN
Grid point Coupled PDEs + boundary
conditions in continuous variables
Coupled algebraic eqs. in discrete variables
In a CFD solution, one would directly solve for the relevant flow variables only at the grid points. The values at other locations are determined by interpolating the values at the grid points.
The governing partial differential equations and boundary conditions are defined in terms of the continuous variables p, ~V etc. One can approximate these in the discrete domain in terms of the discrete variables pi, ~Vi etc. The discrete system is a large set of coupled,
algebraic equations in the discrete variables. Setting up the discrete system and solving it (which is a matrix inversion problem) involves a very large number of repetitive calculations and is done by the digital computer.
This idea can be extended to any general problem domain. The following figure shows the grid used for solving the flow over an airfoil.
applying them to the following simple 1D equation: du
dx + u
m = 0; 0 ≤ x ≤ 1; u(0) = 1 (1)
We’ll first consider the case where m = 1 when the equation is linear. We’ll later consider the m = 2 case when the equation is nonlinear.
We’ll derive a discrete representation of the above equation with m = 1 on the following grid:
x
1=0 x2=1/3 x3=2/3 x4=1
∆x=1/3
This grid has four equally-spaced grid points with ∆x being the spacing between successive points. Since the governing equation is valid at any grid point, we have
à du dx ! i + ui = 0 (2)
where the subscript i represents the value at grid point xi. In order to get an expression for
(du/dx)i in terms of u at the grid points, we expand ui−1 in a Taylor’s series:
ui−1= ui− ∆x à du dx ! i + O(∆x2) Rearranging gives à du dx ! i = ui − ui−1 ∆x + O(∆x) (3) The error in (du/dx)i due to the neglected terms in the Taylor’s series is called the truncation
error. Since the truncation error above is O(∆x), this discrete representation is termed first-order accurate.
Since the error in (du/dx)i due to the neglected terms in the Taylor’s series is of O(∆x),
this representation is termed as first-order accurate. Using (3) in (2) and excluding higher-order terms in the Taylor’s series, we get the following discrete equation:
ui− ui−1
∆x + ui = 0 (4) Note that we have gone from a differential equation to an algebraic equation!
This method of deriving the discrete equation using Taylor’s series expansions is called the finite-difference method. However, most commercial CFD codes use the finite-volume or finite-element methods which are better suited for modeling flow past complex geometries. For example, the FLUENT code uses the finite-volume method whereas ANSYS uses the finite-element method. We’ll briefly indicate the philosophy of the finite-volume method next but will keep using the finite-difference approach to illustrate the underlying concepts since they are very similar between the different approaches with the finite-difference method being easier to understand.
If you look closely at the airfoil grid shown earlier, you’ll see that it consists of quadrilaterals. In the finite-volume method, such a quadrilateral is commonly referred to as a “cell” and a grid point as a “node”. In 2D, one could also have triangular cells. In 3D, cells are usually hexahedrals, tetrahedrals, or prisms. In the finite-volume approach, the integral form of the conservation equations are applied to the control volume defined by a cell to get the discrete equations for the cell. For example, the integral form of the continuity equation was given earlier. For steady, incompressible flow, this equation reduces to
Z S
~
V · ˆn dS = 0 (5) The integration is over the surface S of the control volume and ˆn is the outward normal at the surface. Physically, this equation means that the net volume flow into the control volume is zero.
Consider the rectangular cell shown below.
face 1 (u 1,v1) face 2 face 3 face 4 (u 2,v2) (u 3,v3) (u 4,v4) Cell center ∆x x y ∆y
The velocity at face i is taken to be ~Vi = uiˆi + viˆj. Applying the mass conservation
equation (5) to the control volume defined by the cell gives −u1∆y − v2∆x + u3∆y + v4∆x = 0
This is the discrete form of the continuity equation for the cell. It is equivalent to summing up the net mass flow into the control volume and setting it to zero. So it ensures that the net mass flow into the cell is zero i.e. that mass is conserved for the cell. Usually the values at the cell centers are stored. The face values u1, v2, etc. are obtained by suitably interpolating
the cell-center values for adjacent cells.
Similarly, one can obtain discrete equations for the conservation of momentum and energy for the cell. One can readily extend these ideas to any general cell shape in 2D or 3D and any conservation equation. Take a few minutes to contrast the discretization in the finite-volume approach to that in the finite-difference method discussed earlier.
Look back at the airfoil grid. When you are using FLUENT or another finite-volume code, it’s useful to remind yourself that the code is finding a solution such that mass, momentum, energy and other relevant quantities are being conserved for each cell.
Recall that the discrete equation that we obtained using the finite-difference method was ui− ui−1
∆x + ui = 0 Rearranging, we get
−ui−1+ (1 + ∆x)ui = 0
Applying this equation to the 1D grid shown earlier at grid points i = 2, 3, 4 gives
−u1+ (1 + ∆x) u2 = 0 (i = 2) (6)
−u2+ (1 + ∆x) u3 = 0 (i = 3) (7)
−u3+ (1 + ∆x) u4 = 0 (i = 4) (8)
The discrete equation cannot be applied at the left boundary (i=1) since ui−1 is not defined
here. Instead, we use the boundary condition to get
u1 = 1 (9)
Equations (6)-(9) form a system of four simultaneous algebraic equations in the four unknowns u1, u2, u3 and u4. It’s convenient to write this system in matrix form:
1 0 0 0 −1 1 + ∆x 0 0 0 −1 1 + ∆x 0 0 0 −1 1 + ∆x u1 u2 u3 u4 = 1 0 0 0 (10)
In a general situation, one would apply the discrete equations to the grid points (or cells in the finite-volume method) in the interior of the domain. For grid points (or cells) at or near the boundary, one would apply a combination of the discrete equations and boundary conditions. In the end, one would obtain a system of simultaneous algebraic equations with the number of equations being equal to the number of independent discrete variables. The process is essentially the same as above with the details being much more complex.
FLUENT, like other commercial CFD codes, offers a variety of boundary condition op-tions such as velocity inlet, pressure inlet, pressure outlet, etc. It is very important that you specify the proper boundary conditions in order to have a well-defined problem. Also, read through the documentation for a boundary condition option to understand what it does before you use it (it might not be doing what you expect). A single wrong boundary condition can give you a totally wrong result.
The discrete system (10) for our own humble 1D example can be easily inverted to obtain the unknowns at the grid points. Solving for u1, u2, u3 and u4 in turn and using ∆x = 1/3,
we get
u1 = 1 u2 = 3/4 u3 = 9/16 u4 = 27/64
The exact solution for the 1D example is easily calculated to be uexact= exp(−x)
The figure below shows the comparison of the discrete solution obtained on the four-point grid with the exact solution. The error is largest at the right boundary where it is equal to 14.7%. 0 0.2 0.4 0.6 0.8 1 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x u Numerical solution Exact solution
In a practical CFD application, one would have thousands to millions of unknowns in the discrete system and if one uses, say, a Gaussian elimination procedure naively to invert the matrix, it would be take the computer forever to perform the calculation. So a lot of work goes into optimizing the matrix inversion in order to minimize the CPU time and memory required. The matrix to be inverted is sparse i.e. most of the entries in it are zeros since the discrete equation at a grid point or cell will contain only quantities from the neighboring points or cells. A CFD code would store only the non-zero values to minimize memory usage. It would also generally use an iterative procedure to invert the matrix; the longer one iterates, the closer one gets to the true solution for the matrix inversion.
truncation error in our discrete system is O(∆x). So one expects that as the number of grid points is increased and ∆x is reduced, the error in the numerical solution would decrease and the agreement between the numerical and exact solutions would get better.
Let’s consider the effect of increasing the number of grid points N on the numerical solution of the 1D problem. We’ll consider N = 8 and N = 16 in addition to the N = 4 case solved previously. We can easily repeat the assembly and solution steps for the discrete system on each of these additional grids. The following figure compares the results obtained on the three grids with the exact solution. As expected, the numerical error decreases as the number of grid points is increased.
0 0.2 0.4 0.6 0.8 1 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x u N=4 N=8 N=16 Exact solution
When the numerical solutions obtained on different grids agree to within a level of tolerance specified by the user, they are referred to as “grid converged” solutions. The concept of grid convergence applies to the finite-volume approach also where the numerical solution, if correct, becomes independent of the grid as the cell size is reduced. It is very important that you investigate the effect of grid resolution on the solution in every CFD problem you solve. Never trust a CFD solution unless you have convinced yourself that the solution is grid converged to an acceptance level of tolerance (which would be problem dependent).
The momentum conservation equation for a fluid is nonlinear due to the convection term (~V · ∇)~V . Phenomena such as turbulence and chemical reaction introduce additional non-linearities. The highly nonlinear nature of the governing equations for a fluid makes it challenging to obtain accurate numerical solutions for complex flows of practical interest.
We will demonstrate the effect of nonlinearity by setting m = 2 in our simple 1D exam-ple (1):
du dx + u
2 = 0; 0 ≤ x ≤ 1; u(0) = 1
A first-order finite-difference approximation to this equation, analogous to that in (4) for m = 1, is
ui− ui−1
∆x + u
2
i = 0 (11)
This is a nonlinear algebraic equation with the u2
i term being the source of the nonlinearity.
The strategy that is adopted to deal with nonlinearity is to linearize the equations about a guess value of the solution and to iterate until the guess agrees with the solution to a specified tolerance level. We’ll illustrate this on the above example. Let ugi be the guess for
ui. Define
∆ui = ui− ugi
Rearranging and squaring this equation gives
u2i = u2gi+ 2ugi∆ui+ (∆ui)
2
Assuming that ∆ui ¿ ugi, we can neglect the ∆u2i term to get
u2i ' u2gi + 2ugi∆ui = u 2 gi + 2ugi(ui− ugi) Thus, u2 i ' 2ugiui− u 2 gi
The finite-difference approximation (11) after linearization becomes ui− ui−1
∆x + 2ugiui− u
2
gi = 0 (12)
Since the error due to linearization is O(∆u2), it tends to zero as u
g → u.
In order to calculate the finite-difference approximation (12), we need guess values ug at
the grid points. We start with an initial guess value in the first iteration. For each subsequent iteration, the u value obtained in the previous iteration is used as the guess value.
Iteration 1: u(1) g = Initial guess Iteration 2: u(2) g = u(1) ... Iteration l: u(l) g = u(l−1)
The superscript indicates the iteration level. We continue the iterations until they converge. We’ll defer the discussion on how to evaluate convergence until a little later.
This is essentially the process used in CFD codes to linearize the nonlinear terms in the conservations equations, with the details varying depending on the code. The important points to remember are that the linearization is performed about a guess and that it is necessary to iterate through successive approximations until the iterations converge.
equations. We next discuss another factor that makes it necessary to carry out iterations in practical CFD problems.
Verify that the discrete equation system resulting from the finite-difference approxima-tion (12) on our four-point grid is
1 0 0 0 −1 1 + 2∆x ug2 0 0 0 −1 1 + 2∆x ug3 0 0 0 −1 1 + 2∆x ug4 u1 u2 u3 u4 = 1 ∆x u2 g2 ∆x u2 g3 ∆x u2 g4 (13)
In a practical problem, one would usually have millions of grid points or cells so that each dimension of the above matrix would be of the order of a million (with most of the elements being zeros). Inverting such a matrix directly would take a prohibitively large amount of memory. So instead, the matrix is inverted using an iterative scheme as discussed below.
Rearrange the finite-difference approximation (12) at grid point i so that ui is expressed
in terms of the values at the neighboring grid points and the guess values: ui =
ui−1+ ∆x u2gi
1 + 2 ∆x ugi
If a neighboring value at the current iteration level is not available, we use the guess value for it. Let’s say that we sweep from right to left on our grid i.e. we update u4, then u3 and
finally u2 in each iteration. In the mth iteration, u(l)i−1 is not available while updating umi and
so we use the guess value u(l)
gi−1 for it instead:
u(l)i = u (l) gi−1 + ∆x u (l)2 gi 1 + 2 ∆x u(l)gi (14) Since we are using the guess values at neighboring points, we are effectively obtaining only an approximate solution for the matrix inversion in (13) during each iteration but in the process have greatly reduced the memory required for the inversion. This tradeoff is good strategy since it doesn’t make sense to expend a great deal of resources to do an exact matrix inversion when the matrix elements depend on guess values which are continuously being refined. In an act of cleverness, we have combined the iteration to handle nonlinear terms with the iteration for matrix inversion into a single iteration process. Most importantly, as the iterations converge and ug → u, the approximate solution for the matrix inversion tends
towards the exact solution for the inversion since the error introduced by using ug instead
of u in (14) also tends to zero.
Thus, iteration serves two purposes:
1. It allows for efficient matrix inversion with greatly reduced memory requirements. 2. It is necessary to solve nonlinear equations.
In steady problems, a common and effective strategy used in CFD codes is to solve the unsteady form of the governing equations and “march” the solution in time until the solution converges to a steady value. In this case, each time step is effectively an iteration, with the the guess value at any time level being given by the solution at the previous time level.
Recall that as ug → u, the linearization and matrix inversion errors tends to zero. So we
continue the iteration process until some selected measure of the difference between ug and
u, refered to as the residual, is “small enough”. We could, for instance, define the residual R as the RMS value of the difference between u and ug on the grid:
R ≡ v u u u u t N X i=1 (ui− ugi) 2 N
It’s useful to scale this residual with the average value of u in the domain. An unscaled residual of, say, 0.01 would be relatively small if the average value of u in the domain is 5000 but would be relatively large if the average value is 0.1. Scaling ensures that the residual is a relative rather than an absolute measure. Scaling the above residual by dividing by the average value of u gives
R = v u u u u t N X i=1 (ui− ugi) 2 N N N X i=1 ui = v u u tNXN i=1 (ui− ugi) 2 N X i=1 ui (15)
For the nonlinear 1D example, we’ll take the initial guess at all grid points to be equal to the value at the left boundary i.e. u(1)
g = 1. In each iteration, we update ug, sweep
from right to left on the grid updating, in turn, u4, u3 and u2 using (14) and calculate
the residual using (15). We’ll terminate the iterations when the residual falls below 10−9
(which is referred to as the convergence criterion). Take a few minutes to implement this procedure in MATLAB which will help you gain some familiarity with the mechanics of the implementation. The variation of the residual with iterations obtained from MATLAB is shown below. Note that logarithmic scale is used for the ordinate. The iterative process converges to a level smaller than 10−9 in just 6 iterations. In more complex problems, a lot
more iterations would be necessary for achieving convergence.
1 2 3 4 5 6 10−10 10−8 10−6 10−4 10−2 100 Iteration number Residual 11
uexact =
1 x + 1
The solutions for iterations 4 and 6 are indistinguishable on the graph. This is another indication that the solution has converged. The converged solution doesn’t agree well with the exact solution because we are using a coarse grid for which the truncation error is relatively large. The iterative convergence error, which is of order 10−9, is swamped out
by the truncation error of order 10−1. So driving the residual down to 10−9 when the
truncation error is of order 10−1 is a waste of computing resources. In a good calculation,
both errors would be of comparable level and less than a tolerance level chosen by the user. The agreement between the numerical and exact solutions should get much better on refining the grid as was the case for m = 1.
0 0.2 0.4 0.6 0.8 1 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 x u Iteration 2 Iteration 4 Iteration 6 Exact
Some points to note:
1. Different codes use slightly different definitions for the residual. Read the documenta-tion to understand how the residual is calculated.
2. In the FLUENT code, residuals are reported for each conservation equation. A discrete conservation equation at any cell can be written in the form LHS = 0. For any iteration, if one uses the current solution to compute the LHS, it won’t be exactly equal to zero, with the deviation from zero being a mesaure of how far one is from achieving convergence. So FLUENT calculates the residual as the (scaled) mean of the absolute value of the LHS over all cells.
3. The convergence criterion you choose for each conservation equation is problem- and code-dependent. It’s a good idea to start with the default values in the code. One may then have to tweak these values.
In our previous 1D example, the iterations converged very rapidly with the residual falling below the convergence criterion of 10−9 in just 6 iterations. In more complex problems, the
iterations converge more slowly and in some instances, may even diverge. One would like to know a priori the conditions under which a given numerical scheme converges. This is determined by performing a stability analysis of the numerical scheme. A numerical method is referred to as being stable when the iterative process converges and as being unstable when it diverges. It is not possible to carry out an exact stability analysis for the Euler or Navier-Stokes equations. But a stability analysis of simpler, model equations provides useful insight and approximate conditions for stability. As mentioned earlier, a common strategy used in CFD codes for steady problems is to solve the unsteady equations and march in time until the solution converges to a steady state. A stability analysis is usually performed in the context of time-marching.
While using time-marching to a steady state, we are only interested in accurately obtain-ing the asymptotic behavior at large times. So we would like to take as large a time-step ∆t as possible to reach the steady state in the least number of time-steps. There is usually a maximum allowable time-step ∆tmax beyond which the numerical scheme is unstable. If
∆t > ∆tmax, the numerical errors will grow exponentially in time causing the solution to
diverge from the steady-state result. The value of ∆tmax depends on the numerical
dis-cretization scheme used. There are two classes of numerical shemes, explicit and implicit, with very different stability characteristics which we’ll briefly discuss next.
Explicit and Implicit Schemes
The difference between explicit and implicit schemes can be most easily illustrated by ap-plying them to the wave equation
∂u ∂t + c
∂u ∂x = 0
where c is the wavespeed. One possible way to discretize this equation at grid point i and time-level n is un i − un−1i ∆t + c un−1 i − un−1i−1 ∆x = O(∆t, ∆x) (16) The crucial thing to note here is that the spatial derivative is evaluated at the n−1 time-level. Solving for un i gives uni = · 1 − µc∆t ∆x ¶¸ un−1i + µc∆t ∆x ¶ un−1i−1 (17) This is an explicit expression i.e. the value of un
i at any grid point can be calculated directly
from this expression without the need for any matrix inversion. The scheme in (16) is known as an explicit scheme. Since un
i at each grid point can be updated independently, these
schemes are easy to implement on the computer. On the downside, it turns out that this scheme is stable only when
C ≡ c∆t ∆x ≤ 1
where C is called the Courant number. This condition is refered to as the Courant-Friedrichs-Lewy or CFL condition. While a detailed derivation of the CFL condition through stability analysis is outside the scope of the current discussion, it can seen that the coefficient of un−1
i
In an implicit scheme, the spatial derivative term is evaluated at the n time-level: un i − un−1i ∆t + c un i − uni−1 ∆x = O(∆t, ∆x) In this case, we can’t update un
i at each grid point independently. We instead need to solve a
system of algebraic equations in order to calculate the values at all grid points simultaneously. It can be shown that this scheme is unconditionally stable so that the numerical errors will be damped out irrespective of how large the time-step is.
The stability limits discussed above apply specifically to the wave equation. In general, explicit schemes applied to the Euler or Navier-Stokes equations have the same restriction that the Courant number needs to be less than or equal to one. Implicit schemes are not unconditonally stable for the Euler or Navier-Stokes equations since the nonlinearities in the governing equations often limit stability. However, they allow a much larger Courant number than explicit schemes. The specific value of the maximum allowable Courant number is problem dependent.
Some points to note:
1. CFD codes will allow you to set the Courant number (which is also referred to as the CFL number) when using time-stepping. Taking larger time-steps leads to faster convergence to the steady state, so it is advantageous to set the Courant number as large as possible within the limits of stability.
2. You may find that a lower Courant number is required during startup when changes in the solution are highly nonlinear but it can be increased as the solution progresses. 3. Under-relaxation for non-timestepping
There are two radically different states of flows that are easily identified and distinguished: laminar flow and turbulent flow. Laminar flows are characterized by smoothly varying ve-locity fields in space and time in which individual “laminae” (sheets) move past one another without generating cross currents. These flows arise when the fluid viscosity is sufficiently large to damp out any perturbations to the flow that may occur due to boundary imper-fections or other irregularities. These flows occur when at low-to-moderate values of the Reynolds number. In contrast, turbulent flows are characterized by large, nearly random fluctuations in velocity and pressure in both space and time. These fluctuations arise from instabilities that grow until nonlinear interactions cause them to break down into finer and finer whirls that eventually are dissipated (into heat) by the action of viscosity. Turbulent flows occur in the opposite limit of high Reynolds numbers.
2.3 2.2 2.1 2.0 1.9 1.8 1.7 ylabel 100 80 60 40 20 0 xlabel (a) PSfrag replacements u t -0.4 -0.2 0.0 0.2 ylabel 100 80 60 40 20 0 xlabel (b) PSfrag replacements u t u0 t 0.12 0.10 0.08 0.06 0.04 0.02 0.00 ylabel 100 80 60 40 20 0 xlabel (c) PSfrag replacements u02 t
Figure 1: Example of a time history of a component of a fluctuating velocity at a point in a turbulent flow. (a) Shows the velocity, (b) shows the fluctuating component of velocity u0 ≡ u − u and (c) shows the square of the fluctuating velocity. Dashed lines in (a) and (c)
indicate the time averages.
A typical time history of the flow variable u at a fixed point in space is shown in Fig. 1(a). The dashed line through the curve indicates the “average” velocity. We can define three types of averages:
1. Time average
The most mathematically general average is the ensemble average, in which you repeat a given experiment a large number of times and average the quantity of interest (say velocity) at the same position and time in each experiment. For practical reasons, this is rarely done. Instead, a time or volume average (or combination of the two) is made with the assumption that they are equivalent to the ensemble average. For the sake of this discussion, let us define the time average for a stationary flow1 as
u(y) ≡ lim τ →∞ 1 2τ Z τ −τu(y, t)dt (18)
The deviation of the velocity from the mean value is called the fluctuation and is usually defined as
u0 ≡ u − u (19)
Note that by definition u0 = 0 (the average of the fluctuation is zero). Consequently, a
better measure of the strength of the fluctuation is the average of the square of a fluctuating variable. Figures 1(b) and 1(c) show the time evolution of the velocity fluctuation, u0, and
the square of that quantity, u02. Notice that the latter quantity is always greater than zero
as is its average.
The equations governing a turbulent flow are precisely the same as for a laminar flow; however, the solution is clearly much more complicated in this regime. The approaches to solving the flow equations for a turbulent flow field can be roughly divided into two classes. Direct numerical simulations (DNS) use the speed of modern computers to numerically integrate the Navier Stokes equations, resolving all of the spatial and temporal fluctuations, without resorting to modeling. In essence, the solution procedure is the same as for laminar flow, except the numerics must contend with resolving all of the fluctuations in the velocity and pressure. DNS remains limited to very simple geometries (e.g., channel flows, jets and boundary layers) and is extremely expensive to run.2 The alternative to DNS found in
most CFD packages (including FLUENT) is to solve the Reynolds Averaged Navier Stokes (RANS) equations. RANS equations govern the mean velocity and pressure. Because these quantities vary smoothly in space and time, they are much easier to solve; however, as will be shown below, they require modeling to “close” the equations and these models introduce significant error into the calculation.
To demonstrate the closure problem, we consider fully developed turbulent flow in a channel of height 2H. Recall that with RANS we are interested in solving for the mean velocity u(y) only. If we formally average the Navier Stokes equations and simplify for this geometry we arrive at the following
du0v0 dy + 1 ρ dp dx = ν d2u(y) dy2 (20)
1A stationary flow is defined as one whose statistics are not changing in time. An example of a stationary
flow is steady flow in a channel or pipe.
2The largest DNS to date was recently published by Kaneda et al., Phys. Fluids 15(2):L21–L24 (2003);
they used 40963grid point, which corresponds roughly to 0.5 terabytes of memory per variable!
y = 0 du
dy = 0 , (21) y = H u = 0 , (22) The quantity u0v0, known as the Reynolds stress,3 is a higher-order moment that must
be modeled in terms of the knowns (i.e., u(y) and its derivatives). This is referred to as the “closure” approximation. The quality of the modeling of this term will determine the reliability of the computations.4
Turbulence modeling is a rather broad discipline and an in-depth discussion is beyond the scope of this introduction. Here we simply note that the Reynolds stress is modeled in terms of two turbulence parameters, the turbulent kinetic energy k and the turbulent energy dissipation rate ² defined below
k ≡ 1 2 ³ u02+ v02+ w02´ (23) ² ≡ ν Ã ∂u0 ∂x !2 + Ã ∂u0 ∂y !2 + Ã ∂u0 ∂z !2 + Ã ∂v0 ∂x !2 + Ã ∂v0 ∂y !2 + Ã ∂v0 ∂z !2 + Ã ∂w0 ∂x !2 + Ã ∂w0 ∂y !2 + Ã ∂w0 ∂z !2 (24)
where (u0, v0, w0) is the fluctuating velocity vector. The kinetic energy is zero for laminar
flow and can be as large as 5% of the kinetic energy of the mean flow in a highly turbulent case. The family of models is generally known as k–² and they form the basis of most CFD packages (including FLUENT). We will revisit turbulence modeling towards the end of the semester.
3Name after the same Osborne Reynolds from which we get the Reynolds number.
4Notice that if we neglect the Reynolds stress the equations reduce to the equations for laminar flow;
thus, the Reynolds stress is solely responsible for the difference in the mean profile for laminar (parabolic) and turbulent (blunted) flows.
Consider the following differential equation d2u
dx2 − 2 u
3 = 0; 0 ≤ x ≤ 9; u(0) = 1, u(9) = 0.1
• Apply the finite-difference method to this equation to get a linearized difference equa-tion at grid point i away from the boundary. Note that a second-order difference approximation for the second-derivative is
à d2u dx2 ! i = ui−1− 2ui+ ui+1 ∆x2 + O ³ ∆x2´
• Assemble the discrete system of equations for a four-point grid into a matrix system of the form
[A]{u} = {b} where
{u} = {u1 u2 u3 u4}T
• Develop a MATLAB program to solve the finite-difference equations on a grid with N points. Apply this code to obtain the solution on a 4-point grid (∆x = 3). For the initial guess, use a linear variation between the two boundary values. Converge your solution until the residual is below 10−6. Plot the residuals vs. iteration number.
Hint: In MATLAB, initialize all elements of [A] to zero. For row i of [A] when 2 ≤ i ≤ N − 1, you need to set only the elements Ai,i−1, Ai,i and Ai,i+1.
• Plot the finite-difference solution obtained on the 4-point grid and compare it with the exact solution
uexact=
1 x + 1
• Use your MATLAB program to obtain the solution on a 7-point grid (∆x = 1.5). Plot the solution and compare it with the solution for the 4-point grid and the exact solution.
Laminar Pipe Flow
Author: Rajesh Bhaskaran
E-mail: [email protected]
Problem Specification
1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve! 6. Analyze Results 7. Refine Mesh Problem 1 Problem 2
Problem Specification
Consider fluid flowing through a circular pipe of contant cross-section. The pipe diameter D=0.2 m and length L=8 m. The inlet velocity Vin=1 m/ s. Consider the
velocity to be constant over the inlet cross-section. The fluid exhausts into the ambient atmosphere which is at a pressure of 1 atm. Take density ρ=1 kg/ m3
and coefficient of viscosity µ= 2 x 10-3 kg/(ms). The Reynolds number Re based
on the pipe diameter is
where Vavg is the average velocity at the inlet, which is 1m/s in this case.
Solve this problem using FLUENT. Plot the centerline velocity, wall skin-friction
Note: The values used for the inlet velocity and flow properties are chosen for convenience rather than to reflect reality. The key parameter value to focus on is the Reynolds no.
Preliminary Analysis
We expect the viscous boundary layer to grow along the pipe starting at the inlet. It will eventually grow to fill the pipe completely (provided that the pipe is long enough). When this happens, the flow becomes fully-developed and there is no variation of the velocity profile in the axial direction, x (see figure below). One can obtain a closed-form solution to the governing equations in the
fully-developed region. You should have seen this in the Introduction to Fluid
Mechanics course. We will compare the numerical results in the fully-developed
region with the corresponding analytical results. So it's a good idea for you to go back to your textbook in the Intro course and review the fully-developed flow analysis. What are the values of centerline velocity and friction factor you expect in the fully-developed region based on the analytical solution? What is the
solution for the velocity profile?
We'll create the geometry and mesh in GAMBIT which is the preprocessor for FLUENT, and then read the mesh into FLUENT and solve for the flow solution.
Go to Step 1: Create Geometry in GAMBIT
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh Problem 1 Problem 2
Step 1: Create Geometry in GAMBIT
If you would prefer to skip the mesh generation steps, you can create a
working directory (see below), download the mesh from here (right click and save as pipe.msh) into the working directory and go straight to step 4.
Strategy for Creating Geometry
In order to create the rectangle, we will first create the vertices at the four
corners. We'll then join adjacent vertices by straight lines to form the "edges" of the rectangle. Lastly, we'll create a "face" corresponding to the area enclosed by the edges. In Step 2, we'll mesh the face i.e. the rectangle. Note that in 3D
problems, you'll have to form a "volume" from faces. So the hierarchy of geometric objects in GAMBIT is vertices -> edges -> faces -> volumes.
Create a Working Directory
Create a folder called pipe in a convenient location. We'll use this as the working folder in which files created during the session will be stored.
Note for ACCEL computer lab users: Each user gets his/her own 100 MB of
disk space under S: at ACCEL. You can put your files in S: and it'll be accessible from any computer. This is where you should put files that you want to keep and access later on.
Start GAMBIT
Start your command prompt.
Start > Run
In Windows NT/2000/XP: Type cmd and press enter. In Windows 95/98/ME: Type command and press enter.
Navigate your way to your working folder. For example, if you created a folder named fluent on drive S: in Windows, type cd S:\fluent at the command prompt and press Enter.
Start GAMBIT by typing gambit -id pipe at the command prompt and pressing Enter.
If this doesn't work, try typing the full pathname to the GAMBIT executable: c:\fluent.inc\ntbin\ntx86\gambit -id pipe
This brings up the GAMBIT interface and tells GAMBIT to use pipe as the default prefix for all files created during the session. In Windows, the Exceed X-server starts up before the GAMBIT interface comes up. Exceed is a third-party
application needed to render the interface in Windows (GAMBIT was originally developed under Unix). To make best use of screen real estate, move the
windows and resize them so that you approximate this screen arrangement. This way you can read instructions in the browser window and implement them in
GAMBIT.
You can resize the text in the browser window to your taste and comfort:
In Internet Explorer: Menubar > View > Text Size, then choose the appropriate font size.
In Netscape: Menubar > View > Increase Font or Menubar > View > Decrease Font.
The GAMBIT Interface consists of the following:
● Main Menu Bar:
Note that the job name pipe appears after ID: in the title bar of the Utility Menu.
● Operation Toolpad:
We'll more or less work our way across the Operation Toolpad as we go through the solution steps. Notice that as each of the top buttons is
selected, a different "sub-pad" appears. The Geometry sub-pad is shown in the above snaphot.
● Global Control Toolpad:
The Global Control Toolpad has options such as Fit to Screen and
Undo that are very handy during the course of geometry and mesh
creation.
● GAMBIT Graphics:
This is the window where the graphical results of operations are displayed.
● GAMBIT Description Panel:
The Description Panel contains descriptions of buttons or objects that the mouse is pointing to. Move your mouse over some buttons and notice the corresponding text in the Description Panel.
● GAMBIT Transcript Window:
This is the window to which output from GAMBIT commands is written and which provides feedback on the actions taken by GAMBIT as you perform operations. If, at some point, you are not sure you clicked the right button or entered a value correctly, this is where to look to figure out what you just did. You can click on the arrow button in the upper right hand corner to make the Transcript window full-sized. You can click on the arrow again to return the window to its original size. Go ahead, give this a try.
Select Solver
Specify that the mesh to be created is for use with FLUENT 6.0:
Main Menu > Solver > FLUENT 5/6
Verify this has been done by looking in the Transcript Window where you should see:
The boundary types that you'll be able to select in the third step depends on the solver selected.
We can assume that the flow is axisymmetric. The problem domain is:
where r and x are the radial and axial coordinates, respectively.
Strategy for creating geometry
We will put the origin of the coordinate system at the lower left corner of the rectangle. The coordinates of the corners are shown in the figure below:
We will first create four vertices at the four corners and join adjacent vertices to get the edges of the rectangle. We will then form a face that covers the area of the rectangle.
Create Vertices
Find the buttons described below by pointing the mouse at each of the buttons and reading the Description Window.
Operation Toolpad > Geometry Command Button > Vertex Command Button > Create Vertex
Notice that the Create Vertex button has already been selected by default. After you select a button under a sub-pad, it becomes the default when you go to a different sub-pad and then come back to the sub-pad.
Create the vertex at the lower-left corner of the rectangle:
Next to x:, enter value 0. Next to y:, enter value 0. Next to z:, enter value 0 (these values should be defaults). Click Apply. This creates the vertex (0,0,0) which is displayed in the graphics window.
In the Transcript window, GAMBIT reports that it "Created vertex: vertex.1". The vertices are numbered vertex.1, vertex.2 etc. in the order in which they are created.
Repeat this process to create three more vertices:
Vertex 2: (0,0.1,0) Vertex 3: (8,0.1,0) Vertex 4: (8,0,0)
Note that for a 2D problem, the z-coordinate can always be left to the default value of 0.
Operation Toolpad > Global Control > Fit to Window Button
This fits the four vertices of the rectangle we have created to the size of the
Graphics Window.
(Click picture for larger image)
Create Edges
We'll now connect appropriate pairs of vertices to form edges. To select any entity in GAMBIT, hold down the Shift key and click on the entity.
Operation Toolpad > Geometry Command Button > Edge Command Button > Create Edge
Select two vertices that make up an edge of this rectangle by holding down the
Shift button and clicking on the corresponding vertices. As each vertex is picked, it will appear red in the Graphics Window. Then let go of the Shift button. We can check the selected vertices by clicking on the up-arrow next to Vertices:.
This will bring up a window containing the vertices that have been selected. Vertices can be moved from the Available and Picked lists by selecting them and then pressing the left or right arrow buttons.
After the correct vertices have been selected, click Close, then click Apply in the
Create Straight Edge window.
Repeat this process to create a rectangle.
(Click picture for larger image)
Create Face
Operation Toolpad > Geometry Command Button > Face Command Button > Form Face
To form a face out of the area enclosed by the four lines, we need to select the four ledges that enclose this area. This can be done by holding down the Shift key, clicking on each line (notice that the currently selected line appears red), and then releasing the Shift key after all four lines have been selected.
Alternatively, an easier way to do this would be to click on the up arrow next to edges:
This will bring up the Edge List window. Click on All-> to select all of the edges at once. Click Close.
Click Apply to create the face.
Go to Step 2: Mesh Geometry in GAMBIT
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh Problem 1 Problem 2
Step 2: Mesh Geometry in GAMBIT
We'll now create a mesh on the rectangular face with 100 divisions in the axial direction and 5 divisions in the radial direction. We'll first mesh the four edges and then the face. The desired grid spacing is specified through the edge mesh.
Mesh Edges
Operation Toolpad > Mesh Command Button > Edge Command Button > Mesh Edges
Shift-click or bring up the Edge List window and select both the vertical lines. If this is difficult, one can zoom in on an edge by holding down the Ctrl button, clicking and dragging the mouse to specify an area to zoom in on, and releasing the Ctrl button. To return to the main view, click on the Global Control Toolpad > Fit to Window Button again.
Once a vertical edge has been selected, select Interval Count from the drop down box that says Interval Size in the Mesh Edges Window. Then, in the box to the left of this combo box, enter 5 for the interval count.
Click Apply. Nodes appear on the edges showing that they are divided into 5.
(Click picture for larger image)
Repeat the same process for the horizontal edges, but with an interval count of 100.
Now that the edges are meshed, we are ready to create a 2-D mesh for the face.
Mesh Face
Operation Toolpad > Mesh Command Button > Face Command Button > Mesh Faces
Shift left-click on the face or use the up arrow next to Faces to select the face. Click Apply.
(Click picture for larger image)
Go to Step 3: Specify Boundary Types in GAMBIT
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh Problem 1
Problem 2
Step 3: Specify Boundary Types in GAMBIT
Create Boundary Types
We'll next set the boundary types in GAMBIT. The left edge is the inlet of the pipe, the right edge the outlet, the top edge the wall, and the bottom edge the axis.
Operation Toolpad > Zones Command Button > Specify Boundary Types Command Button
This will bring up the Specify Boundary Types window on the Operation Panel. We will first specify that the left edge is the inlet. Under Entity:, pick Edges so that GAMBIT knows we want to pick an edge (face is default).
Now select the left edge by Shift-clicking on it. The selected edge should
appear in the yellow box next to the Edges box you just worked with as well as the Label/Type list right under the Edges box.
Next to Name:, enter inlet.
For Type:, select VELOCITY_INLET.
Click Apply. You should see the new entry appear under Name/Type box near the top of the window.
Repeat this process for the other three edges according to the following table:
Edge
Position Name Type
Left inlet VELOCITY_INLET
Right outlet PRESSURE_OUTLET
Top wall WALL
Bottom centerline AXIS
You should have the following edges in the Name/Type list when finished:
Save and Export
Main Menu > File > Save
Main Menu > File > Export > Mesh...
Type in pipe.msh for the File Name:. Select Export 2d Mesh since this is a 2 dimensional mesh. Click Accept.
Check pipe.msh has been created in your working directory.
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh Problem 1 Problem 2
Step 4: Set Up Problem in FLUENT
Launch Fluent 6.0Start > Programs > Fluent Inc > FLUENT 6.0
Select 2ddp from the list of options and click Run.
The "2ddp" option is used to select the 2-dimensional, double-precision solver. In the double-precision solver, each floating point number is
represented using 64 bits in contrast to the single-precision solver which uses 32 bits. The extra bits increase not only the precision but also the range of magnitudes that can be represented. The downside of using double precision is that it requires more memory.
Import Grid
Main Menu > File > Read > Case...
Navigate to the working directory and select the pipe.msh file. This is the mesh file that was created using the preprocessor GAMBIT in the previous step.
FLUENT reports the mesh statistics as it reads in the mesh:
Check the number of nodes, faces (of different types) and cells. There are 500 quadrilateral cells in this case. This is what we expect since we used 5 divisions in the radial direction and 100 divisions in the axial direction while generating the grid. So the total number of cells is 5*100 = 500.
Also, take a look under zones. We can see the four zones inlet, outlet, wall, and centerline that we defined in GAMBIT.
Check and Display Grid
First, we check the grid to make sure that there are no errors.
Main Menu > Grid > Check
Any errors in the grid would be reported at this time. Check the output and make sure that there are no errors reported. Check the grid size:
Main Menu > Grid > Info > Size
The following statistics should appear:
Display the grid:
Main Menu > Display > Grid...
Make sure all 5 items under Surfaces is selected. Then click Display. The
graphics window opens and the grid is displayed in it. You can now click Close in the Grid Display menu to get back some desktop space. The graphics window will remain.
Some of the operations available in the graphics window are:
Translation: The grid can be translated in any direction by holding down the Left Mouse Button and then moving the mouse in the desired direction.
Zoom In: Hold down the Middle Mouse Button and drag a box from the Upper Left Hand Corner to the Lower Right Hand Corner over the area you want to zoom in on.
Zoom Out: Hold down the Middle Mouse Button and drag a box anywhere from the Lower Right Hand Corner to the Upper Left Hand Corner.
Use these operations to zoom into the grid to obtain the view shown below.
Note: The zooming operations cannot be performed without a middle mouse button.
(Click picture for larger image)
You can also look at specific parts of the grid by choosing the boundaries you wish to view under Surfaces (click to select and click again to deselect a specific boundary). Click Display again when you have selected your boundaries. For example, the wall, outlet, and centerline boundaries have been selected in the following view:
These options will display the graph:
(Click picture for larger image)
For convenience, the button next to Surfaces selects all of the boundaries while the deselects all of the boundaries at once.
Close the Grid Display Window when you are done.
Define Solver Properties
Main Menu > Define > Models > Solver
Choose Axisymmetric under Space. We'll use the defaults of segregated solver, implicit formulation, steady flow and absolute velocity formulation. Click OK.
Main Menu > Define > Models > Viscous
Laminar flow is the default. So we don't need to change anything in this menu. Click Cancel.
Main Menu > Define > Models > Energy
For incompressible flow, the energy equation is decoupled from the continuity and momentum equations. We need to solve the energy equation only if we are
interested in determining the temperature distribution. We will not deal with temperature in this example. So leave the Energy Equation unselected and click Cancel to exit the menu.
Define Material Properties
Main Menu > Define > Materials...
Change Density to 1.0 and Viscosity to 2e-3. These are the values that we specified under Problem Specification. We'll take both as constant.
Click Change/Create.
Define Operating Conditions
Main Menu > Define > Operating Conditions...
For all flows, FLUENT uses gauge pressure internally. Any time an absolute pressure is needed, it is generated by adding the operating pressure to the gauge pressure. We'll use the default value of 1 atm (101,325 Pa) as the Operating Pressure.
Click Cancel to leave the default in place.
Define Boundary Conditions
We'll now set the value of the velocity at the inlet and pressure at the outlet.
Main Menu > Define > Boundary Conditions...
We note here that the four types of boundaries we defined are specified as zones on the left side of the Boundary Conditions Window. The centerline zone should be selected by default. Make sure it is, then make sure the Type of this
boundary is selected as axis and click Set.... Notice that there is nothing to set for the axis. Click OK.
Move down the list and select inlet under Zone. Note that FLUENT indicates that the Type of this boundary is velocity-inlet. Recall that the boundary type for the "inlet" was set in GAMBIT. If necessary, we can change the boundary type set previously in GAMBIT in this menu by selecting a different type from the list on the right.
Click on Set.... Enter 1 for Velocity Magnitude. Click OK. This sets the velocity of the fluid entering at the left boundary.
The (absolute) pressure at the outlet is 1 atm. Since the operating pressure is set to 1 atm, the outlet gauge pressure = outlet absolute pressure - operating pressure = 0. Choose outlet under Zone. The Type of this boundary is
pressure-outlet. Click on Set.... The default value of the Gauge Pressure is 0. Click Cancel to leave the default in place.
Lastly, click on wall under Zones and make sure Type is set as wall. Click on each of the tabs and note that only momentum can be changed under the
current conditions. This will not be so under later exercises so make a note of the location of these options. Click OK.
Click Close to close the Boundary Conditions menu.
Go to Step 5: Solve!
Copyright 2002. Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve! 6. Analyze Results 7. Refine Mesh Problem 1 Problem 2
Step 5: Solve!
We'll use a second-order discretization scheme.
Main Menu > Solve > Controls > Solution...
Change Momentum to Second Order Upwind.
Click OK.
Set Initial Guess
Initialize the flow field to the values at the inlet:
Main Menu > Solve > Initialize > Initialize...
In the Solution Initialization menu that comes up, choose inlet under Compute From. The Axial Velocity for all cells will be set to 1 m/s, the Radial Velocity to 0 m/s and the Gauge Pressure to 0 Pa. These values have been taken from the inlet boundary condition.
Click Init. This completes the initialization.
Set Convergence Criteria
FLUENT reports a residual for each governing equation being solved. The residual is a measure of how well the current solution satisfies the discrete form of each governing equation. We'll iterate the solution until the residual for each equation falls below 1e-6.
Main Menu > Solve > Monitors > Residual...
Change the residual under Convergence Criterion for continuity, x-velocity, and y-velocity, all to 1e-6.
Also, under Options, select Plot. This will plot the residuals in the graphics window as they are calculated.
Click OK.
This completes the problem specification. Save your work:
Main Menu > File > Write > Case...
Type in pipe.cas for Case File. Click OK. Check that the file has been created in your working directory. If you exit FLUENT now, you can retrieve all your work at any time by reading in this case file.
Iterate Until Convergence
Start the calculation by running 100 iterations:
Main Menu > Solve > Iterate...
In the Iterate Window that comes up, change the Number of Iterations to 100. Click Iterate.
The residuals for each iteration is printed out as well as plotted in the graphics
window as they are calculated.
(Click picture for larger image)
The residuals fall below the specified convergence criterion of 1e-6 in 46 iterations.
Save the solution to a data file:
Main Menu > File > Write > Data...
Enter pipe.dat for Data File and click OK. Check that the file has been created in your working directory. You can retrieve the current solution from this data file at any time.
Go to Step 6: Analyze Results
Cornell University
Sibley School of Mechanical and Aerospace Engineering.
Fluent Short Course-Tutorial List | Feedback
Laminar Pipe Flow
Problem Specification1. Create Geometry in GAMBIT 2. Mesh Geometry in GAMBIT
3. Specify Boundary Types in GAMBIT 4. Set Up Problem in FLUENT
5. Solve!
6. Analyze Results 7. Refine Mesh
Problem 1 Problem 2
Step 6: Analyze Results
Centerline VelocityWe'll plot the variation of the axial velocity along the centerline.
Main Menu > Plot > XY Plot...
Make sure that Position on X Axis is set under Options, and X is set to 1 and Y to 0 under Plot Direction. This tells FLUENT to plot the x-coordinate value on the abscissa of the graph.
Under Y Axis Function, pick Velocity... and then in the box under that, pick Axial Velocity.
Please note that X Axis Function and Y Axis Function describe the x and y axes of the graph, which should not be confused with the x and y directions of the pipe.
Finally, select centerline under Surfaces since we are plotting the axial velocity along the centerline. This finishes setting up the plotting parameters.