Lecture 1: Introduction
CFD for Energy Engineering
F. Inzoli
Department of Energy
Course introduction 2
Teaching staff:
Fabio Inzoli Lesson – Computer Lab
Giorgio Besagni Computer Lab
Claudio Basilico Computer Lab
Gael Guedon Computer Lab
Campus Bovisa Lambruschini – Bovisa Durando
• Lessons Wednesday CT.49 13:15-15:15
Thursday BL27.14 15:15-17:15
• Computer Lab Tuesday L1.3 14:15-18:15
• Tutoring TBD November 2015 – February 2016
CFD for Energy Engineering
1
Course introduction 3
Reference
H.K. Versteeg, W. Malalasekera,
An introduction to computational fluid
dynamics: the Finite Volume Method
Ed. Pearson Prentice Hall, 2° edition, 2007
CFD for Energy Engineering
Course introduction 4
Other References
• G. Comini, G. Croce, E. Nobile, Fondamenti di Termofluidodinamica
Computazionale, SGE editoriali, Padova, 2014
• J.H. Ferziger, M. Perić, Computational Methods for Fluid Dynamics, Springer,
1999
Fluid mechanics and heat transfer
• J.D. Anderson, Fundamentals of Aerodynamics, Mc Graw Hill, New York, 1984
• A. Bejan, Heat Transfer, J. Wiley & Sons, New York, 1993
Numerical methods and modelling for CFD
• D.C. Wilcox, Turbulence Modelling for CFD, 1998, DCW Industries
CFD for Energy Engineering
2
Course introduction 5
Software facilities are based on FLUENT-ANSYS code
• Solver: FLUENT vers. 16
• Programming language: C++
Hardware facilities
• Personal computer
• Windows OS or Linux
Course documents are published on Web
• Beep Web portal
Competence and knowledge
• Fluid mechanics (mandatory)
• Heat and Mass Transfer
• Numerical methods
CFD for Energy Engineering
Course introduction 6
Software facilities
Download from www.ansys.com/student
CFD for Energy Engineering
3
Course introduction 7
Course subject: lecture
• Governing equations
• Finite Volume Method
• Numerics and calculus
• Physical modeling: Turbulence, Heat transfer
• Research topics: combustion, multiphase flow
• CFD procedure and protocol
Aim
• The aim of the course is to supply scientific knowledge useful to
manage critically computational fluid dynamics modeling
Course subject: computer sessions
• The aim of the course is to introduce to critical and conscious
usage of CFD codes
CFD for Energy Engineering
Course introduction 8
Evaluation criteria
The exam is based on two different tests:
Theory (mandatory): (written) + oral
Practice (optional): computer test
To participate in the practice session you must have sustained the
theory test (in the same session or in a previous one)
The rating is a weighted average between theory (T) and practice (P).
25
Rating T R
30
More details are reported in Beep Web portal
CFD for Energy Engineering
4
An introduction to CFD 9
What is and how it works
Summary
1. An introduction to CFD
• What is CFD
• Possible Applications up to date
• Theoretical Background
• Step by step approach
2. The CFD as an advanced tool for engineering analysis
• CFD applied to Industrial needs
• CFD applied to Academic needs
• Advantages of CFD
• Limitations of CFD
• Concluding Remark
NB: These slides represent a summary of the course content
Please refer to chapter 1 of textbook (Versteeg and Malalasekera)
for the complete discussion on the specific subject
CFD for Energy Engineering
An introduction to CFD 10
What is and how it works
1. CFD is the “science” of predicting fluid behaviour
• Flow field, heat transfer, mass transfer, chemical
reactions, etc…
• By solving the governing equations of fluid flow using a numerical
approach (computer based simulation)
2. The results of CFD analyses
• Represent valid engineering data that may be used for
• Conceptual studies of new designs (with reduction of lead time and
costs)
• Studies where controlled experiments are difficult to perform
• Studies with hazardous operating conditions
• Redesign engineering
3. CFD analyses represent a valid
• Complement to experimental tests
• Reducing the total effort required in laboratory tests
CFD for Energy Engineering
5
An introduction to CFD 11
Possible application up to date
Applications of CFD are numerous and in different fields!
Temperature distribution in
an automotive engine
Droplets trajectories from spray
headers in a scrubber tower of a
power plant
CFD for Energy Engineering
An introduction to CFD 12
Possible application up to date
Applications of CFD are numerous and in different fields!
Inverse Die Design:
Determines die geometry based
upon desired extruded shape.
Wind turbine simulation
CFD for Energy Engineering
6
An introduction to CFD 13
Possible application up to date
Applications of CFD are numerous and in different fields!
Internal combustion engine
Mitral heart valve
CFD for Energy Engineering
An introduction to CFD 14
Possible application up to date
Applications of CFD are numerous and in different fields!
Temperature O2 OH
Combustion: Laminar diffusion flame
CFD for Energy Engineering
7
An introduction to CFD 15
Possible application up to date
Applications of CFD are numerous and in different fields!
Optimization of low-NOx burners for
power generation
Visualization of the pressure contours and
pathlines on a sport car
CFD for Energy Engineering
An introduction to CFD 16
Possible application up to date
Some typical areas of application of FIDAP are summarized below:
• Electronics industry-flow and thermal fields in cabinets and chassis or arrays of components and circuit boards, conjugate heat transfer
problems, air flow in disk drives, clean room analysis.
• Automotive industry-flow distributions along external curved surfaces, lift and drag calculations, flow in ducts and manifolds, coolant flow
around radiator blocks, radiator design, flow through pumps and valves, flow through filters, climate control in passenger compartments,
catalytic converters, shock absorbers.
• Metal forming industry-continuous casting, extrusion, convection in tundishes, solidification in castings, phase change.
• HVAC industry-heat exchangers, regenerators, room ventilation flows, analysis of air-conditioning and heating systems, spray cooling.
• Plastics industry-analysis of injection molding runner systems; extrusion, sheet, coat-hanger, spiral, profile dies; blow molding dies.
• Food and beverage industry-flow and temperature distributions in containers, ovens, food processing equipment.
• Materials processing industries-semiconductor crystal growth, chemical vapor deposition and infiltration, flows of molten glass, furnace
design, microgravity processing in space.
• Chemical industries-flow, heat and mass transfer in chemical reactors, exothermic and endothermic reactions, chemical mixing, separation
processes, drying, evaporation and condensation.
• Biomedical industries-blood flow in natural and artificial organs, flows in biomedical devices, tubes with and without constrictions,
extrusion processes in product manufacture, modeling of cleansing processes, sprays and atomizers.
• Environmental studies-flow distributions around buildings, atmospheric thermal plumes, solar ponds.
• Aerospace/defense industries-vehicle aerodynamics and hydrodynamics, defense electronics, variable gravity effects, cabin ventilation,
flows in fuel lines and tanks
The
• Nuclear industry-flow and thermal distribution above list is by no means exhaustive
of coolants.
• Thin film technology-coating flows of polymeric fluids, slot coaters, roll coaters, curtain coaters, optical fiber coating.
• Printing industry-modeling of ink jets.
• Crystal growth-single crystal production from a melt.
• Lubrication-film flows.
• Machinery/appliances-flow around impellers and propellers and in water turbines.
• Instrumentation and control-flow and thermal fields around sensing devices, vortex shedding, flows and pressure distributions in valves and
control devices, choked flows in nozzles and valves.
The above list is by no means exhaustive. Any flow which is adequately modeled by the compressible or incompressible flow equations solved by
FIDAP can be simulated.
CFD for Energy Engineering
8
An introduction to CFD 17
Theoretical background
CFD solvers are based on numerical methods
CFD applies numerical methods (called discretization)
To approximate the fluid region to be studied
• The collection of cells is called “grid” or “mesh”
To approximate the governing equations of fluid
mechanics
• Governing differential equations => algebraic
The set of approximated equations is solved numerically
for the flow field variables at each node or cell
The solution is post-processed to extract quantities of
interest
e.g. lift, drag, heat transfer, separation points,
pressure loss, etc.
CFD for Energy Engineering
An introduction to CFD 18
Theoretical background
CFD solvers are based on numerical methods
• Commercial CFD. General purposes
• FLUENT (ANSYS, USA)
• CFX (ANSYS, UK)
• STAR CD (Computational Dynamics Ltd., UK)
•COMSOL Multiphisics
•In house code
• Confidentiality
• Internal know how
• Specific applications
•Academic Code
• Natural location in which CFD commercial codes were born
• Main Interests: development of new models
•Open Source code
• OpenFoam (www.openfoam.com)
•…. probably the future
CFD for Energy Engineering
9
An introduction to CFD 19
Theoretical background
Numerical methods
Finite difference methods describe the unknowns of the flow problem by
means of point samples at the node points of a grid of co-ordinate lines.
Truncated Taylor series expansions are often used to generate finite difference
approximations of derivatives of in terms of point samples of at each grid
point and its immediate neighbors. Those derivatives appearing in the governing
equations are replaced by finite differences yielding an algebraic equation for
the values of at each grid point.
Finite Element Methods use simple piecewise functions (e.g. linear or quadratic)
valid on elements to describe the local variations of unknown flow variables .
The governing equation is precisely satisfied by the exact solution . If the
piecewise approximating functions for are substituted into the equation it will
not hold exactly and a residual is defined to measure the errors. Next the
residuals (and hence the errors) are minimized in some sense by multiplying
them by a set of weighting functions and integrating. As a result we obtain a set
of algebraic equations for the unknown coefficients of the approximating
functions. The theory of finite elements has been developed initially for
structural stress analysis.
CFD for Energy Engineering
An introduction to CFD 20
Theoretical background
Numerical methods
Spectral methods approximate the unknowns by means of truncated Fourier
series or series of Chebyshev polynomials. Unlike the finite difference or finite
element approach the approximations are not local but valid throughout the
entire computational domain. Again we replace the unknowns in the governing
equation by the truncated series. The constraint that leads to the algebraic
equations for the coefficients of the Fourier or Chebyshev series is provided by a
weighted residuals concept similar to the finite element method or by making
the approximate function coincide with the exact solution at a number of grid
points.
Lattice Boltzman method solve the discrete Boltzmann equation to simulate the
flow of a Newtonian fluid with collision models. By simulating streaming and
collision processes across a limited number of particles, the intrinsic particle
interactions evince a microcosm of viscous flow behavior applicable across the
greater mass.
The finite volume method was originally developed as a special finite difference
formulation. The main commercially available CFD codes are FVM based.
CFD for Energy Engineering
10
An introduction to CFD 21
Theoretical background
Finite Volume methods
Domain is discretized into a finite Fluid region of pipe
set of control volumes or cells. flow discretized into
finite set of control
volumes (mesh).
control
General conservation (transport) volume
equation for mass, momentum,
energy, etc.,
Equation
continuity 1
t dV V d A d A S dV
V A A V
x-mom.
y-mom.
u
v
z-mom. w
unsteady convection diffusion generation energy h
are
=> discretized into a system of algebraic equations (numerical methods)
The system of (linear) algebraic equation is solved (algebraic method) by
iterative methods
CFD for Energy Engineering
An introduction to CFD 22
Theoretical background
General consideration (FV method)
The solution to a flow problem (velocity, pressure, temperature etc.) is
defined at nodes inside each cell.
The accuracy of a CFD solution is governed by the number of cells
in the grid.
Both the accuracy of a solution and its cost in terms of necessary
computer hardware and calculation time are dependent on the
fineness of the grid.
At present it is still up to the skills of the CFD user to design a grid that
is a suitable compromise between desired accuracy and solution
cost.
CFD for Energy Engineering
11
CFD as an advanced tools 23
For engineering applications
How an engineering problem has to be addressed?
I. There is a Physical or Engineering Problem to solve
IV. Verify the project II. Problem Identification
requirements
III. Identify a solution
CFD for Energy Engineering
CFD as an advanced tools 24
For engineering applications
How an engineering problem has to be addressed with CFD?
I. There is a Physical or Engineering Problem to solve
Consider quality of the
numerical and mathematical From the Continuum and
model (as VIRTUAL model of a Real Problem to a Simplified
REAL problem): Accuracy Mathematical model
IV. Results Analysis and II. Problem Identification
Post-processing and Pre-processing
Consider quality of From Simplified
the numerical model: Mathematical model to the
convergence Discrete and Virtual
Numerical Model
III. Model Setting and Solver Execution
CFD is a tool that require you switch on your brain… and your fantasy!
CFD for Energy Engineering
12
An introduction to CFD 25
Step by step approach
1. Problem Identification: Pre-processing
1. Clarify the GOALS and the CONSTRAINS of the project
2. Identify the domain you will model.
3a. Design the domain
3b. Generate the mesh
2. Model setting and Solver Execution
4. Identify the equations required to the model
• Define the BC, the materials properties and the numerical setting
• Set up a solution monitoring
5. Initialise and (ask the solver to) compute solution
3. Result analysis and review: Post-Processing
6. Result analysis from qualitative and quantitative points of view
7. Critical revision to the model
CFD for Energy Engineering
CFD as an advanced tools 26
For engineering applications
Advantages
• Costs
• Time to market
• Capability to Simulate Real Conditions
• Ability to Simulate Ideal Conditions
• Comprehensive Information
Limitations
• Physical models
• Numerical Error
• Boundary conditions
CFD for Energy Engineering
13
CFD as an advanced tools 27
For engineering applications
Concluding remark
• Computational Fluid Dynamics is a powerful way of modelling
fluid flow, heat transfer, and related processes for a wide
range of important scientific and engineering problems.
• The cost and the time of doing CFD has decreased
• while computers become more and more powerful.
But
• CFD represents also the easy way to make “nice” mistakes
• Providing meaningless results
• With zero engineering interests
CFD for Energy Engineering
CFD as an advanced tools 28
For engineering applications
Concluding remark
Prior to setting up and running a CFD simulation there is a stage of
identification and formulation of the flow problem in terms of the
physical phenomena that need to be considered.
To make the right choices requires good modelling skills, because in all
but the simplest problems we need to make assumptions to reduce
the complexity to a manageable level whilst preserving the salient
features of the problem in hand.
It is the appropriateness of the simplifications introduced at this stage
that at least partly governs the quality of the information generated
by CFD, so the analyst must continually stay aware of all the
assumptions, clear-cut and tacit ones, that have been made.
A good understanding of the numerical solution algorithm is also crucial.
CFD for Energy Engineering
14
CFD as an advanced tools
For engineering applications
Common pathology of CFD man!
•calcolo ergo sum?:
To be not fully conscious, false feeling of facility, trend to neglect
quantitative results in qualitative results’ favour, trend to underestimate the
discretization procedure, to accept not converging results;
•Ego sum Deus!:
Trend to full the hw resources, risk to calculate a lot, more and more, and
understand few, less and less, risk to accept as “true” a solution because
the simulation converge!
However you have the more robust and efficient code it is always
important to estimate each point of view of the project if you want to
obtain a result.
Therefore take CARE and switch always your brain and your judging
capability on when evaluating results form CFD codes.
CFD for Energy Engineering
CFD as an advanced tools 30
For engineering applications
What actually is CFD? And can it change these beliefs?
Various Definitions
Officially stands for… Computational Fluid Dynamics
Is accused of being… Colourful Fluid Dynamics
Is often (ab)used as… Colours For Directors
Or worse… Colourful Fantasy Dreams
Begins to be… Credible Fluid Dynamics
But is not always… Cost-effective Fluid Dynamics
But what these acronyms have actually come to mean is:
Commercial Fluid Dynamics
CFD for Energy Engineering
15
CFD as an advanced tools 31
For engineering applications
CFD: Computational Fluid Dynamics
or Colorful Fluid Dynamics?
In solving fluid flow problems we need to be aware that the underlying physics
is complex and the results generated by a CFD code are at best as good
as the physics embedded in it and at worst as good as its operator.
No one believes the CFD results except the one who performed the calculation,
and everyone believes the experimental results except the one who performed
the experiment. (P.J. Roache)
The greatest disaster one can encounter in computation is not instability or lack
of convergence but results that are simultaneously good enough to be believable
but bad enough to cause trouble. (J.H. Ferziger)
Essentially, all models are wrong, but some are useful
George E. P. Box (1919–2013)
Se t'avviene di trattar delle acque, consulta prima l'esperienza e poi la ragione
Leonardo da Vinci (1452-1519))
CFD for Energy Engineering
16