-
Introducing CFD in Introducing CFD in Undergraduate Fluid
MechanicsUndergraduate Fluid MechanicsJohn Cimbala, Mechanical
Engr., Penn State Univ.
ISTEC Meeting, Cornell UniversityJuly 25-26, 2008, Ithaca,
NY
with collaboration from:Shane Moeykens, Strategic Partnerships
Manager, ANSYS.Ajay Parihar, FlowLab Support Engineer, ANSYS.
Sujith Sukumaran, FlowLab Support Engineer, ANSYSSatyanarayana
Kondle, FlowLab Support Engineer, ANSYS.
-
IntroductionIntroductionz It has become important in recent
years to
introduce the fundamentals of CFD in intro-level undergraduate
fluid mechanics classes due to the changing requirements of the job
market for graduating engineers
z At a minimum, it is desirable to teach the fundamental steps
required to obtain a useful CFD solution
zMany instructors want to include CFD in their undergrad fluids
course, but dont know how and/or think they cant afford the class
time
Many of them will use CFD in their jobs, whether they know
anything
about CFD or not!
-
z Undergraduate fluid mechanics textbook, Fluid Mechanics:
Fundamentals and Applications, by Y. A. engel and J. M. Cimbala,
McGraw-Hill, 2006
z Chapter 15: Introduction to CFD
Our first attempt to Our first attempt to introduce CFD to
introduce CFD to
undergradsundergrads
-
zThe CFD chapter introduces: grids boundary
conditions residuals etc.
engelengel--CimbalaCimbala textbooktextbook
-
zThe CFD chapter introduces: grids boundary
conditions residuals etc.
engelengel--CimbalaCimbala textbooktextbook
-
zThe CFD chapter introduces: grids boundary
conditions residuals etc.
engelengel--CimbalaCimbala textbooktextbook
-
zThe CFDchapterintroduces: grids boundary
conditions residuals etc. just the basics, not anything
about
numerical algorithms, stability, etc. how to use CFD as a
tool.
engelengel--CimbalaCimbala textbooktextbook
-
z The engel-Cimbala book includes FlowLabas a textbook
companion, where CFD exercises are employed to convey important
concepts to the student
z 46 FlowLab end-of-chapter problems are included in Ed. 1,
Chapter 15 (Intro to CFD)
z FlowLab exercises jointly developed by John Cimbala and Fluent
Inc. (now part of ANSYS).
z FlowLab & these FlowLab templates are free to students who
use the engel-Cimbala book
Intro to CFD using Intro to CFD using FlowLabFlowLab
-
What is What is FlowLabFlowLab??zA virtual (CFD) fluids
laboratoryz Simple to use with a very fast learning curvez Runs
pre-defined exercises (templates)z Setup, solution, and
post-processing are all
performed in the same interfacez Students vary only one or two
parameters in
each template (to look at trends, compare boundary conditions,
grid resolution, etc.)
-
zEach homework problem, along with its corresponding FlowLab
template, has been carefully designed with two major learning
objectives in mind: Enhance the students understanding of a
specific fluid mechanics concept Introduce the student to a
specific
capability and/or limitation of CFD through hands-on
practice
FlowLabFlowLab TemplatesTemplates
-
Original Templates for Ed. 1Original Templates for Ed. 1z
FlowLab HW problems only in CFD chapterzMost templates are too
complex to compare
with analytical calculations (e.g., flow over cylinders, flow
through diffusers, etc.)
z Emphasis mostly on CFD grid resolution, extent of
computational domain, BCs, etc.
z In the first edition, the primary emphasis of the FlowLab
templates was as a CFD learning tool, with only a secondary
emphasis on learning fluid mechanics
-
New Templates for Ed. 2New Templates for Ed. 2zNew FlowLab
templates in almost all chapters
goal is to introduce students to CFD early onzMost new templates
compare CFD calculations
with analytical calculationsz The primary emphasis is learning
fluid
mechanics, with a secondary emphasis on CFDzNew templates are
intentionally more simplezHomework problems show a progression
in
difficulty and level of sophistication, often based on the same
base problem or theme
-
Examples: New homework & templates, Ed. 2Examples: New
homework & templates, Ed. 2z End-of-chapter homework problem,
Chap. 2
2-89 A rotating viscometer consists of two concentric cylinders
an inner cylinder of radius Ri rotating at angular velocity
(rotation rate) i , and a stationary outer cylinder of inside
radius Ro . In the tiny gap between the two cylinders is the fluid
of viscosity . The length of the cylinders (into the page in the
sketch) is L. L is large such that end effects are negligible (we
can treat this as a two- dimensional problem). Torque (T) is
required to rotate the inner cylinder at constant speed.
(a) Showing all your work and algebra, generate an approximate
expression for T as a function of the other variables. (b) Explain
why your solution is only an approximation. In particular, do you
expect the velocity profile in the gap to remain linear as the gap
becomes larger and larger (i.e., if the outer radius Ro were to
increase, all else staying the same)?
Fluid: ,
i
Rotating inner cylinder Stationary outer cylinder
Ro Ri This is a standard analytical problem as
found in most undergraduate fluids books.
They are able to obtain an analytical (approximate) solution for
a small gap.
-
z Solution (from solutions manual)2-89 (a) We assume a linear
velocity profile between the two walls as sketched the inner wall
is moving at speed V = i Ri and the outer wall is stationary. The
thickness of the gap is h, and we let y be the distance from the
outer wall into the fluid (towards the inner wall). Thus,
where
Since shear stress has dimensions of force/area, the clockwise
(mathematically negative) tangential force acting along the surface
of the inner cylinder by the fluid is
But the torque is the tangential force times the moment arm Ri .
Also, we are asked for the torque required to turn the inner
cylinder. This applied torque is counterclockwise (mathematically
positive). Thus,
and y du Vu Vh dy h
= = =- and o i i ih R R V R= =
2 2i ii io i
RVF A R L R Lh R R
= = =
3 32 2T i i i iio i
L R L RFRR R h = = =
V
Outer cylinder
h
Inner cylinder
y u
Analytical solution for a
small gap
-
2-90
z Another end-of-chapter homework problem, Chap. 2
Consider the rotating viscometer of the previous problem. We
make an approximation that the gap (distance between the inner and
outer cylinders) is very small. Consider an experiment in which the
inner cylinder radius is Ri = 0.0600 m, the outer cylinder radius
is Ro = 0.0602 m, the fluid viscosity is 0.799 kg/ms, and the
length L of the viscometer is 1.00 m. Everything is held constant
in the experiment except that the rotation rate of the inner
cylinder varies. (a) Calculate the torque in Nm for several
rotation rates in the range -700 to 700 rpm. Discuss the
relationship between T and i (is the relationship linear,
quadratic, etc.?). (b) Run FlowLab with the template
Concentric_inner. Set the rotation rate to the same values as in
Part (a), and calculate the torque on the inner cylinder for all
cases. Compare to the approximate values of Part (a), and calculate
a percentage error for each case, assuming that the CFD results are
exact. Discuss. In particular, how good is the small-gap
approximation? Note: Be careful with the sign (+ or -) of the
torque.
This is one of their first exposures to CFD through FlowLab
They calculate torque as a function of rpm
-
z Solution (from solutions manual)2-90 (a) Note that we must
convert the rotation rate from rpm to radians per second so that
the units are proper. When i is -700 rpm, we get
For h = 0.0002 m, the torque is calculated (using the equation
derived in the previous problem). Note, however, that since we are
calculating the torque of the fluid acting on the cylinder, the
sign is opposite to that of the previous problem,
where we have rounded to three significant digits. We repeat for
various other values of rotation rate, and summarize the results in
the table below.(b) The FlowLab template was run with the same
values of i . The results are compared with the manual calculations
in the table. The agreement between manual and CFD calculations is
excellent for all rotation rates. The relationship between torque
and rotation rate is linear, as predicted by theory.
rot 2 rad 1 min rad700 73.304min rot 60 s si
= =
( )( ) ( )
3 3
3
2
2 2T
rad2 1.00 m 0.799 kg/m s 73.304 0.0600 mNs
0.0002 m kg m/s 397.445 N m 397. N m
i i i i
o i
L R L RR R h
= = =
=
We run various rpm cases, both manually and with CFD
-
z Solution (from solutions manual - continued)
Discussion Since the gap here is very small compared to the
radii of the cylinders, the linear velocity profile approximation
is actually quite good, yielding excellent agreement between theory
and CFD. However, if the gap were much larger, the agreement would
not be so good.
Agreement between analytical and CFD results is excellent
Analytical FlowLab
-
2-91
z Another end-of-chapter homework problem, Chap. 2
Consider the rotating viscometer of the previous problem. We
make an approximation that the gap (distance between the inner and
outer cylinders) is very small. Consider an experiment in which the
inner cylinder radius is Ri = 0.0600 m, rotating at a constant
angular rotation rate of 300 rpm. The fluid viscosity is 0.799
kg/ms, and the length L of the viscometer is 1.00 m. Everything is
held constant in the experiment except that different diameter
outer cylinders are used. The gap distance between inner and outer
cylinders is h = Ro Ri . (a) Calculate the torque in Nm for the
following gaps: 0.0002, 0.0015, 0.0075, 0.02, and 0.04 m. (b) Run
FlowLab with the template Concentric_gap. Set the gap to the same
values as in Part (a), and calculate the torque on the inner
cylinder for all cases. Compare to the approximate values of Part
(a), and calculate a percentage error for each case, assuming that
the CFD results are exact. Discuss. In particular, how good is the
small-gap approximation? Note: Use absolute value of torque to
avoid sign inconsistencies.
This is the next problem in this series
This time we vary gap size at a fixed rpm
-
z Solution (from solutions manual)2-91 (a) First we convert the
rotation rate from rpm to radians per second so that the units are
proper,
When h = 0.0002 m, the torque is calculated (using the equation
derived in the previous problem). Note, however, that since we are
calculating the torque of the fluid acting on the cylinder, the
sign is opposite to that of the previous problem,
where we have rounded to three significant digits. We repeat for
various other values of gap distance h, and summarize the results
in the table below.
(b) The FlowLab template was run with the same values of h. The
results are compared with the manual calculations in the table and
plot shown below. Note: We use absolute value of torque for
comparison without worrying about the sign.
rot 2 rad 1 min rad300 31.416min rot 60 s si
= =
( )( ) ( )
3 3
3
2
2 2T
rad2 1.00 m 0.799 kg/m s 31.416 0.0600 mNs
0.0002 m kg m/s 170.336 N m 170. N m
i i i i
o i
L R L RR R h
= = =
=
We run various gap size cases, both manually and with CFD
-
z Solution (from solutions manual - continued)
The agreement between analysis and CFD is
great for small gap sizes
But the agreement is not so good for the larger gap sizes
-
z Solution (from solutions manual - continued)The agreement
between manual and CFD calculations is excellent for very small
gaps (the percentage error is less than half a percent for the
smallest gap). However, as the gap thickness increases, the
agreement gets worse. By the time the gap is 0.04 m, the agreement
is worse than 50%. Why such disagreement? Remember that we are
assuming that the gap is very small and are approximating the
velocity profile in the gap as linear. Apparently, the linear
approximation breaks down as the gap gets larger.
Discussion We used a log scale for torque so that the
differences between manual calculations and CFD could be more
clearly seen.
Students realize that their simple small-gap approximation
breaks down as the gap gets larger. At this point in their
study
of fluid mechanics, they do not know how to calculate this flow
exactly for arbitrary gap size and rpm that is not
learned until Chapter 9, the differential equations chapter.
-
Examples: New homework & templates, Ed. 2Examples: New
homework & templates, Ed. 2z End-of-chapter homework problem,
Chap. 9
Fluid: ,
i
Rotating inner cylinder Stationary outer cylinder
Ro Ri
9-92 An incompressible Newtonian liquid is confined between two
concentric circular cylinders of infinite length a solid inner
cylinder of radius Ri and a hollow, stationary outer cylinder of
radius Ro . (see figure; the z axis is out of the page.) The inner
cylinder rotates at angular velocity i . The flow is steady,
laminar, and two- dimensional in the r- plane. The flow is also
rotationally symmetric, meaning that nothing is a function of
coordinate (u
and P are functions of radius r only). The flow is also
circular, meaning that velocity component ur = 0 everywhere.
Generate an exact expression for velocity component u
as a function of radius r and the other parameters in the
problem. You may ignore gravity. Hint: The result of Problem 9-91
is useful.
Now we advance to Chapter 9 problems
This is a follow-up problem to those of Chapter 2 just
discussed
First, an analytical solution
-
z Solution (from solutions manual)9-92 The solution is fairly
long and not repeated in its entirety here. The Navier- Stokes
equations are solved analytically for this simple geometry, and the
boundary conditions are applied. Here are the last few lines of the
solution:
The solution:
Apply one boundary condition:
Apply another boundary condition:
Solve for the constants of integration:
The final equation is
This is a closed-form analytical solution. In the next problem,
we compare with CFD.
21 2
Cru Cr
= +2
21 2 10 or 2 2
o o
o
R RCC C CR
= + = 2
21 1 12 2 2
i i oi i
i i
R R RCR C C CR R
= + = 2 2 2
1 22 2 2 2
2 i i o i i
o i o i
R R RC CR R R R
= = 2 2
2 2i i o
o i
R Ru r
rR R =
Analytical solution for any
size gap
-
9-93
z Another end-of-chapter homework problem, Chap. 9
Glycerin ( = 1259.9 kg/m3, and = 0.799 kg/ms) flows between two
concentric cylinders as in the previous problem. The inner radius
is 0.060 m, and the inner cylinder rotates at 300 rpm. The outer
cylinder is stationary. Recall from Chapter 2 that when the gap
between the cylinders is small, the tangential velocity of the
fluid in the gap is nearly linear. When the gap is large, however,
we expect the linear approximation to fail. Run FlowLab with the
template Concentric_gap. Run two cases: (a) a small gap of 0.001 m
and (b) a large gap of 0.060 m. For each case, plot and save the
velocity profile data. Compare to the analytical prediction for
both cases. Is there good agreement? How good is the linear
approximation? Discuss.
This is the next problem in this series
Now we use FlowLab (actually the same template as in Chapter 2)
to compare CFD-generated velocity profiles to those generated
analytically. We do this for two gaps, a small gap and a large
gap.
-
9-93 (a) Small gap (gap = 0.001 m): We apply the equation from
the previous problem to calculate the tangential velocity as a
function of radius,
and we plot the velocity profile, u
as a function of r, in the plot below. We run FlowLab for the
same geometry and conditions, and plot the velocity profile on the
same plot for comparison. The agreement is excellent (less than
0.02% error at any radius). This is not surprising since the flow
is laminar, steady, etc. CFD does a very good job in this kind of
situation. The small errors are due to lack of complete convergence
and a mesh that could be a little finer. The profile is nearly
linear as expected since the gap is small.
z Solution (from solutions manual)
2 2
2 2i i o
o i
R Ru r
rR R =
Students compare the analytical (exact) solutions to those
obtained by FlowLab for both cases, small gap and large gap.
-
z Solution (from solutions manual - continued)
The small gap results show excellent agreement as expected, and
the velocity profile is nearly linear since the gap is so
small.
-
z Solution (from solutions manual - continued)(b) Large gap (gap
= 0.06 m): We repeat for the larger gap case. The plot is shown
below. Again the agreement is excellent, with errors less than 0.1%
for all radii, but the profile is not linear the linear
approximation breaks down when the gap can no longer be considered
small.
This time, the large gap results show excellent agreement as
well since we have not made a small-gap approximation; but
the profile is not linear.
-
z Solution (from solutions manual - continued)Discussion
Problems such as this in which a known analytical solution exists
are great for testing CFD codes. The fluid properties did not enter
into the calculations viscosity affects only the transient
solution, not the final flow field.
Note how this one simple problem yields several homework
problems even across chapters.
Students get a feel for using CFD and compare the results with
analytical analysis.
They see where their simplified analysis works well and where it
breaks down (e.g., small gap approximation breaks down when the gap
is too large).
These types of analytical/FlowLab problems have been added to
nearly all the chapters in Ed. 2.
-
Here is the mesh that FlowLab generates for the same geometry as
in the exact analysis.
FlowLab Details for this problem
-
Residual plot (iteration takes only a couple minutes)
-
They look at velocity magnitude contours
-
They plot velocity magnitude vs. radial position.
They save these data points to an Excel file.
-
Live Live FlowLabFlowLab DemonstrationDemonstrationWe will
demonstrate the templates called
Concentric_gap
and Submerged_plate_angle
[These templates will have corresponding end- of-chapter
homework problems in Ed. 2 of the
engel-Cimbala undergraduate fluids textbook.]
If time, also show some other templates live.
-
SummarySummaryz It is possible to introduce the fundamentals of
CFD
into an undergraduate fluids course(I do it in only one class
period, plus homework)zFlowLab software enables students to
experience
CFD without getting bogged down in the detailszEach FlowLab
exercise has two objectives:
Enhance understanding of fluid mechanics Teach the capabilities
and limitations of CFD
zMost of the new templates in Ed. 2 of the fluids textbook by
engel and Cimbala compare analytical solutions to those obtained
with CFD for enhanced learning and good exposure to CFD
Homework is the key can introduce students to CFD
without taking much class time
-
How to Integrate CFD into an How to Integrate CFD into an
Undergraduate Fluids CourseUndergraduate Fluids CoursezDevelop the
continuity and Navier-Stokes
equations for fluid flow, as usualzShow how to solve simple
problems
analytically (solve N-S equations): Couette flow between plates
Fully developed pipe flow Etc.zThen, introduce CFD as a way to do
the
same thing, but with a computer.
This is what is normally done in an introductory fluid mechanics
course.
This is what is new added to the course.
-
How to Integrate CFD into an How to Integrate CFD into an
Undergraduate Fluids CourseUndergraduate Fluids CoursezThe CFD
lecture takes only about one
class period, where we briefly explain: Computational domain and
types of grids Boundary conditions and initial guesses The concept
of residuals and iteration Post-processing (contour plots,
etc.)
zIn-class live demonstration of FlowLabzAssign homework
requiring FlowLabThe homework is where students get hands-on CFD
practice
-
Sample lecture notes fromSample lecture notes fromFall 2005,
Penn StateFall 2005, Penn State
(the lecture where CFD was (the lecture where CFD was presented
for the first time)presented for the first time)
These notes are directly from my lecture notes, given using a
tablet PC, and posted on the Internet for students to download
-
StillStill--Slide BackSlide Back--Up toUp to Live Demonstration
of Live Demonstration of
FlowLabFlowLab templatetemplate Diffuser_angleDiffuser_angle
-
Example: Flow through a conical Example: Flow through a conical
diffuserdiffuser
z Fluid Mechanics Learning Objective: Compare pressure recovery
in conical diffusers of half-angle 5 to 90
z CFD Objective: Observe streamline patterns and flow separation
as diffuser half-angle increases; compute pressure recovery for all
cases
-
Flow through a conical diffuser Flow through a conical
diffuser
V
x
D1
L1
D2
L2
V Axis x
Pin Pout
Wall Wall
Geometry and dimensions
Computational domain, assuming axisymmetric flow
-
User Interface for User Interface for FlowLabFlowLab
Graphical display window
Main working window
Overview window
Result table
Display options
Operation options
-
Flow through a conical diffuserFlow through a conical
diffuser
Diffuser section x
Hybrid mesh for the 5o half-angle conical diffuser
-
Flow through a conical diffuser (continued)Flow through a
conical diffuser (continued)
X-Y plot of residuals for the conical diffuser case, = 5o
-
Flow through a conical diffuserFlow through a conical
diffuser
x (a) = 5o
x(b) = 7.5o
x (c) = 10o
x(d) = 12.5o
x (e) = 15o
x(f) = 17.5o
x (g) = 20o
x(h) = 25o
x(i) = 30o
x(j) = 45o
x(k) = 60o
x(l) = 90o
Streamlines through conical diffusers of various half-angles
-
Flow through a conical diffuserFlow through a conical diffuser P
5 -49.1371
7.5 -47.7787 10 -44.9927
12.5 -42.4013 15 -39.6981
17.5 -37.6431 20 -36.0981 25 -32.7173 30 -29.9919
32.5 -23.2118 35 -21.6434
37.5 -21.0490 45 -19.6571 60 -18.7252 75 -18.1364 90
-18.3018
Pressure difference from inlet to outlet of a conical diffuser
as a function of diffuser half-angle
-
Flow through a conical diffuserFlow through a conical
diffuser
-50.0
-40.0
-30.0
-20.0
-10.0
0 50 100 (degrees)
P (Pa)
Pressure difference from inlet to outlet
of a conical diffuser as a function of
diffuser half-angle
-
Flow through a conical diffuserFlow through a conical
diffuser
(a) = 5o
(b) = 30o
(c) = 45o Pressure contours through a conical diffuser of three
different half-angles. Colors range from dark blue at
-60 Pa to bright red at 0 Pa gage pressure.
-
Flow through a conical diffuserFlow through a conical
diffuser
(a) = 5o
(b) = 30o
(c) = 45o Contours of turbulent kinetic energy through a
conical
diffuser of three different half-angles. Colors range from dark
blue at 0 m2/s2 to bright red at 3.5 m2/s2
-
StillStill--Slide BackSlide Back--Up toUp to Live Demonstration
of Live Demonstration of
FlowLabFlowLab templatetemplate Block_meshBlock_mesh
-
Example: Flow over a rectangular blockExample: Flow over a
rectangular block
z Fluid Mechanics Learning Objective: Compare drag coefficient
with empirical results
z CFD Objective: Learn to refine a mesh until grid independence
is achieved
-
Introducing CFD in Undergraduate Fluid MechanicsIntroductionOur
first attempt to introduce CFD to
undergradsengel-Cimbalatextbookengel-Cimbalatextbookengel-Cimbalatextbookengel-CimbalatextbookIntro
to CFD using FlowLabWhat is FlowLab?FlowLab TemplatesOriginal
Templates for Ed. 1New Templates for Ed. 2Examples: New homework
& templates, Ed. 2Slide Number 14Slide Number 15Slide Number
16Slide Number 17Slide Number 18Slide Number 19Slide Number 20Slide
Number 21Examples: New homework & templates, Ed. 2Slide Number
23Slide Number 24Slide Number 25Slide Number 26Slide Number 27Slide
Number 28Slide Number 29Slide Number 30Slide Number 31Slide Number
32Slide Number 33SummarySlide Number 35Slide Number 37Slide Number
38Slide Number 39Slide Number 40Slide Number 41Slide Number 42Slide
Number 43Slide Number 44Slide Number 45Slide Number 46Slide Number
47Slide Number 48Slide Number 49Still-Slide Back-Up toLive
Demonstration of FlowLab templateDiffuser_angleExample: Flow
through a conical diffuserFlow through a conical diffuser User
Interface for FlowLabFlow through a conical diffuserFlow through a
conical diffuser (continued)Flow through a conical diffuserFlow
through a conical diffuserFlow through a conical diffuserFlow
through a conical diffuserFlow through a conical
diffuserStill-Slide Back-Up toLive Demonstration of FlowLab
templateBlock_meshExample: Flow over a rectangular blockSlide
Number 63Slide Number 64Slide Number 65Slide Number 66Slide Number
67Slide Number 68Slide Number 69Slide Number 70Slide Number 71Slide
Number 72Slide Number 73Slide Number 74Slide Number 75Slide Number
76Slide Number 77Slide Number 78