ENGR 314: Computational Fluid Dynamics Summary
What is Computational Fluid Dynamics (CFD)?
- Computational Fluid Dynamics (CFD) is a branch of Fluid Dynamics that studies fluid flow physics.
- CFD uses computer simulations to predict fluid flow phenomena.
- CFD can provide a tremendous amount of valuable data at a fraction of the cost of experiments.
- CFD aims at achieving simulation-based design, replacing the "build & test" approach.
- Governing Partial Differential Equations (PDEs) for CFD are often the Navier-Stokes equations.
- Examples of PDEs include:
- Linear advection equation
- Nonlinear advection equation
- Unsteady heat transfer equation
- Caution: CFD can sometimes be unreliable because of human/numerical/modelling errors.
Analytical Fluid Dynamics
- Good for predicting trends, e.g., δ∼Re−1/2, where δ is the laminar boundary layer thickness, and Re is the Reynolds number. This shows the boundary layer thickness decreases as the Reynolds number increases.
- Can yield useful information using simplifying assumptions.
- It usually cannot be used for detailed analysis and design.
Experimental Fluid Dynamics
- It is usually costly.
- Sometimes it is difficult to achieve exact conditions, isolate effects, and assess errors (uncertainty).
- Repeatability issues may arise.
- In several cases, it is the only way to obtain reliable data.
Why use CFD?
- Analysis and Design:
- Simulation-based design is cheaper and more rapid than experimental testing.
- Provides more comprehensive high-fidelity information.
- Simulation of fluid phenomena difficult to measure with experiments:
- Phenomena involving explosions, radiation, pollution.
- Weather, planetary boundary layer flows, ocean currents.
- Scale simulations (e.g., floating wind turbines).
- Research:
- Knowledge and exploration of new flow physics.
Engineering CFD
- In Engineering CFD, one needs particular flow properties in regions of interest to predict the behavior of systems and/or improve their design.
- Fluid flow information includes:
- Surface pressure and viscous stresses: Optimization of lift and drag on aircraft wings, Formula 1 cars, and wind turbines.
- Velocity field: Aerodynamic design of car bodies relying on streamline information.
- Temperature field: Thermal and hydraulic design of tube bundles in heat exchangers and nuclear reactors.
- Multi-disciplinarity: couple CFD to other disciplines such as:
- Aerostructural and aeroelastic design of slender structures (wind turbine blades, aircraft wings, bridge decks, etc.). Aerodynamic, heat transfer, and structure mechanics in energy conversion systems (aircraft engines, heat exchangers, etc.).
Physics in CFD
- CFD codes are designed for analyzing one or more specific flow phenomena.
- Many diverse modeling options exist:
- Viscous vs. inviscid (no viscous stresses)
- Turbulent vs. laminar
- Incompressible vs. compressible
- Single- vs. multi-phase
- Thermal/density effects
- Free-surface flow and surface tension
- Chemical reactions, mass transfer
- Some dimensionless parameters help in choosing the best-suited model:
- Reynolds number
- Mach number
- Froude number
- External (aircraft, ship), Internal (pipe, valve).
Modelling
- Mathematical representation of the physical problem.
- Analytical solutions of the Navier-Stokes (NS) equations only exist for some very simple cases.
- In most real-life fluid problems, NS equations have to be solved numerically with a CFD code.
- Turbulent flows are solved by CFD codes using additional semi-empirical relations, e.g., k-ε, k-ω turbulence models.
- Most CFD codes solve NS equations as an Initial-Boundary Value Problem (IBVP). This includes:
- Governing Partial Differential Equations (PDEs)
- Initial Conditions (ICs)
- Boundary Conditions (BCs)
Numerics
- A CFD code solves the IBVP numerically. The solution (e.g., velocity, pressure, etc.) is obtained only at the centers or vertices of a user-given grid.
- To obtain numerical solutions, PDEs are discretized on a grid using:
- Finite-difference method
- Finite volume method
- Finite Element method
- Grid discretization yields a very large system of equations made up of 105 to 1010 equations, and solving which yields the sought flow field.
How do CFD analyses work?
- Geometry definition (e.g., SolidWorks)
- Grid generation (e.g., ANSYS Meshing or ICEM CFD)
- Specification of flow conditions and properties
- Steady/unsteady, single-/multi-phase, inviscid/viscous, laminar/turbulent, compressible/incompressible, …
- Selection of models
- Direct Numerical Simulation (DNS) or turbulence model: RANS/LES/DES/…
- Specification of initial and boundary conditions:
- Initial condition needed for the iterative solution process
- BCs: no-slip at viscous walls, prescribed velocity/pressure on far-field boundaries, …
- Specification of numerical parameters
- Maximum number of iterations, time-step of iterative solution, level of convergence, …
- Flow solution:
- Post-processing:
- Analysis, visualization, calculation of body forces and temperatures, …
- Uncertainty assessment
- Mesh sensitivity analysis
- Analysis of output sensitivity to uncertain boundary data
- Check convergence levels and solution quality and feasibility.
Good General CFD Practice
- Verification:
- Do results make sense? Are the trends right? Does it agree with previous calculations of similar configurations?
- Validation:
- Do results (or aspects thereof) agree with theory/experiment?
- At every step, a good understanding of basic fluid dynamics is essential!
Learning Outcomes
- Set up and solve fluid dynamics problems with CFD.
- Choose adequate physical and numerical models for CFD simulations of complex fluid flow problems.
- Know key rules of good CFD practice:
- How to choose and set boundary conditions.
- How to generate high-quality computational grids.
- How to validate the adopted method and assess the validity of the computed solution.
- How to extract output of engineering interest from computed solutions.
- Acquire foundations of finite-difference and finite volume methods.
- Master the concepts of truncation and round-off errors, numerical stability, consistency, and convergence.
- Analyze stability of a wide range of simple mathematical models representative of Navier-Stokes equations.
- Design and implement basic numerical methods for the solution of problems arising in engineering applications.
- Get acquainted with boundary layer theory, turbulence modeling, and optimal near-wall grid generation.
Important Notes
- Lectures and laboratory sessions are strongly coupled.
- This course aims at:
- Teaching you how to properly use state-of-the-art commercial CFD for solving engineering problems.
- Providing you with theoretical foundations required to correctly use CFD, interpret its results, assess its reliability, and get started with CFD R&D.
- Stability and error analyses and seemingly more theoretical part of the course are based on simple model equations rather than NS equations for simplicity reasons.
- Nevertheless, all findings are directly and strongly relevant to the NS equations solved by the CFD codes we use in Engineering Design.
Teaching and Learning
- Weeks 1-9: 17 Lectures: up to 2 lectures per week.
- Weeks 3-6: 4 Laboratory Sessions: training and hands-on work on grid generation, analysis set-up, and post-processing with ANSYS FLUENT. Introduction to TECPLOT flow visualization and post-processing.
- Weeks 7-10: 4 Laboratory Sessions: surgery sessions in support of the module project.
- Lent/Summer term: Revision session before the exam.
- Office hours:
- Michaelmas Term 11:00-12:00 on Tuesdays.
- In person in B096 of FST Building OR MS Teams at the same time.
- Advisable to read notes and excerpts and look up suggested textbooks (see below) to complement lectures.
- ENGR314 is 15 credits → 150 learning hours.
- All course material is/will be on the ENGR314 Moodle page.
- Weekly lecture slides & some pre-recordings.
- Folder Basic Aerodynamics, particularly important for the ENGR314 project.
- Folder Theory: Excerpts from Textbooks, supporting the theoretical part of the module.
- Folder Past Exam Papers with Numerical Answers …
- Folder Lab and Project files: material to enable you carrying out lab exercises and projects.
Laboratory Sessions and Project
- In laboratory sessions, you will be shown/taught how to use ANSYS FLUENT Software, needed to perform course project.
- A project brief with project descriptions and guidelines on writing project report, and a zip archive with grid and other files are in Moodle folder Lab and project files / Project.
- Course Project report has to be submitted only via Moodle.
- Deadline to submit: Friday 13 December at 12:00.
Assessment
- Final exam (70 %) in Summer term.
- Course project report (30 %).
Reading List
- CFD is a VAST field. Course material comes from personal research experience and a wide range of textbooks, including:
- T. Xing, F. Stern, Introduction to Computational Fluid Dynamics, University of Iowa, PPT.
- R. Pletcher, J. Tannehill, D. Anderson, Computational Fluid Mechanics and Heat Transfer (3rd edition), CRC Press, ISBN 978-1-59169-037-5.
- J. Tannehill, D. Anderson, R. Pletcher, Computational Fluid Mechanics and Heat Transfer, Taylor and Francis, 1997.
- C. Hirsch, Numerical Computation of internal and external flows, Volumes 1 and 2, Wiley, 1987.
- J.H. Ferziger, M. Peric, Computational Methods for Fluid Dynamics (3rd edition), Springer, 2002.
- J. Blazek. Computational Fluid Dynamics: Principles and Applications, Elsevier, 2001.
- H K Versteeg, W Malalasekera, Computational Fluid Dynamics The Finite Volume Method, (2nd edition), 2005, Pearson.
- P. Kundu, M. Cohen, Fluid Mechanics, (2 nd Ed.), Academic Press, 2002.
Next Lecture
- Basic definitions of differential equations.
- Physical classification of fluid dynamics and heat transfer problems.
- Mathematical classification of PDEs governing fluid flow and heat transfer problems.
Basic Definitions of Differential Equations
- What is an Ordinary Differential Equation (ODE)? Provide an example of one ODE you already encountered.
- What is a partial derivative of f(x,y) with respect to x at (x,y)=(x0,y0)?
- Example: Laplace equation:
- ∂x2∂2f+∂y2∂2f=0
- Partial Differential Equation (PDE).
Equilibrium and Marching Problems
- A physical process can be an Equilibrium or Marching problem.
Equilibrium Problems
- Steady-state problems.
- Examples:
- Steady-state distribution of temperature in a rod of solid material.
- Equilibrium stress distribution of loaded structure.
- Steady fluid flows.
- Governed by elliptic PDEs.
Marching Problems
- Include transient heat transfer, all unsteady flows, and wave phenomena.
- Governed by parabolic or hyperbolic PDEs.
Elliptic PDEs - 1
- Model elliptic PDE: Laplace equation.
- ∂x2∂2φ+∂y2∂2φ=0
- Complete solution of the PDE in a rectangular subdomain of the (x,y) plane requires providing data on domain boundaries, for example, the value of the sought function φ on all four boundaries.
- Elliptic PDE solutions are found by imposing conditions on the unknown function on ALL boundaries: boundary-value problems.
Elliptic PDEs - 2
- Example: 1D steady heat transfer in a rod of length L. Find φ(x)=T(x).
- Perturbation at one point affects the solution of the entire domain.
- Solutions of elliptic PDEs are determined by imposing conditions on the unknown function on ALL domain boundaries.
- Elliptic PDEs describe steady-state conductive heat transfer, inviscid incompressible irrotational flow, etc.
Parabolic PDEs - 1
- Describe time-dependent problems involving significant amounts of diffusion: unsteady viscous flows, unsteady heat conduction, etc.
- Prototype parabolic PDE: diffusion equation.
- ∂t∂T=α∂x2∂2T
- Sample problem: unsteady heat transfer in a rod of length L. Determine T(x,t).
- Boundary conditions.
- Initial condition.
Parabolic PDEs - 2
- Disturbance at a point x1 in the solution region interior (0 < x1 < L) and time t1 can only influence events at later times (t > t1).
- Solutions of parabolic PDEs are determined by imposing boundary conditions on all domain boundaries and initial conditions on the interior domain. Therefore, these are initial-boundary-value problems (IBVPs).
Hyperbolic PDEs
- Appear in time-dependent processes with negligible amounts of energy dissipation: small amplitude vibrations, sound propagation, etc.
- Model hyperbolic PDE: wave equation (c is wave speed).
- ∂t2∂2φ=c2∂x2∂2φ
- Hyperbolic PDEs also yield initial-boundary-value problems.
- Hyperbolic PDEs of CFD are key to solving and studying shock discontinuities occurring in transonic and supersonic flows (aircraft and missile aerodynamics, gas turbines, ramjets and scramjets, …).
Domain of Dependence
- Domain of dependence: Region of the (x,t) plane on which the solution at any given point (x0,t*) depends.
- PARABOLIC PDE: The solution at point (x,t) depends on data at
- ELLIPTIC PDE: The solution at point (x,t) depends on data at all points.
Summary of PDE Types
- Equilibrium problems: steady physical processes.
- Governed by elliptic PDEs.
- Solution depends on boundary data only.
- Marching problems: most transient physical processes.
- Governed by parabolic and hyperbolic PDEs.
- Solution depends on BOTH boundary data AND initial conditions.
Next Lecture
- Hyperbolic PDEs and characteristics.
- Key links between model PDEs and CFD PDEs.
Outline of Lecture 3
- Equilibrium and marching problems (recap!)
- Hyperbolic PDEs
- characteristics of wave equation
- D’Alambert’s solution to the wave equation
- domain of dependence and domain of influence
- examples
- Key links between model and CFD PDEs
Hyperbolic PDEs (Recap)
- Appear in time-dependent processes with negligible amounts of energy dissipation: small amplitude vibrations, sound propagation, …
- Model hyperbolic PDE: wave equation (c is wave speed).
- ∂t2∂2φ=c2∂x2∂2φ
- Disturbances at a point can only influence a limited region in space.
- Hyperbolic PDEs also yield initial-boundary-value problems.
- Hyperbolic PDEs are key to solving and studying shock discontinuities occurring in transonic and supersonic flows (aircraft and missile aerodynamics, gas turbines, ramjets and scramjets,…).
Variable Change to Solve Wave Equation
- Consider again wave equation:
- ∂t2∂2φ=c2∂x2∂2φ
- Using variable transformations
- ξ=x+ct
- η=x−ct
- Applying repeatedly chain rule, the PDE becomes:
- ∂x∂=∂ξ∂+∂η∂
Characteristics of Wave Equation
- Functions F1 and F2 are simple wave solutions, i.e., traveling waves of speed propagating with no change of shape or amplitude.
- Eq. (5) tells us that, in x-t plane:
- F1 is constant along lines of slope dxdt=c1 and
- F2 is constant along lines of slope dxdt=−c1.
- Lines ξ=constant and η=constant are called characteristics.
D’Alambert’s Solution to Wave Equation
- Functions F1 and F2 depend on initial conditions for the sought function φ:
- φ(x,0)=f(x)
- ∂t∂φ(x,0)=g(x)
- Enforcing initial conditions, the complete solution is found to be:
- φ(x,t)=21[f(x+ct)+f(x−ct)]+2c1∫x−ctx+ctg(s)ds
- Equation due to D’Alambert, shows that φ at point (x, t) depends only on data within interval (x−ct, x+ct), interval extremes included.
Domain of Dependence of Hyperbolic PDEs
- Characteristics through point (x′,t′) intersect x-axis at points (x′−ct′, 0) and (x′+ct′, 0).
- Changes at point (x′,t′) influence events at later times within zone of influence, which is again bounded by characteristics.
- Region in x–t plane enclosed by x- axis and two characteristics for t<t’ is termed domain of dependence.
- The solution at (x′,t′) is influenced only by events inside the domain of dependence, not those outside.
Key Links Between Model and CFD PDEs
- Time-dependent Navier-Stokes (NS) equations form a system of parabolic PDEs and are solved as IBVP, as unsteady heat PDE. In both cases, we must specify:
- Initial conditions AND boundary conditions
- Steady NS solutions form a system of elliptic PDEs, but their solution is obtained as an asymptotic state of the unsteady problem (so, need initial data also for the steady problem!).
- Compressible time-dependent Euler equations (obtained by removing viscous terms in NS eqs.) form a system of hyperbolic PDEs.
- CFL (time-step) constraints of both NS and Euler CFD analyses only understood with characteristic of wave equations just discussed.
Finite-Differences
- Consider Taylor series centered at x to determine u at x+Δx
- u(x+Δx)=u(x)+∂x∂uΔx+∂x2∂2u2!Δx2+∂x3∂3u3!Δx3+…
- Truncation Error (TE): difference between a continuous derivative and its FD approximation.
- TE is denoted by O(Δxl), and l denotes the order of accuracy of FD.
- Forward 1st order FD can thus be written as:
- ∂x∂u=Δxu(x+Δx)−u(x)+O(Δx)
- Central 2nd order FD approximation to ux is obtained by subtracting Eq. (3) to Eq. (1) and dividing the result by 2Δx
- Central 2nd order FD yields exact 1st derivative estimates ux of functions u with 3rd and higher derivatives equal to zero, i.e., quadratic functions. WHY?
- Central 2nd order FD approximation to uxx is obtained by adding Eqs. (1) and (3) and dividing the result by Δx2
- Central 2nd order FD yields exact 2nd derivative estimates uxx of functions u with 4th and higher derivatives equal to zero, i.e., cubic polynomials. WHY?
Learning Outcomes
- Set up and solve fluid dynamics problems with CFD.
- Choose adequate physical and numerical models for CFD simulations of complex fluid flow problems.
- Know key rules of good CFD practice:
- how to choose and set boundary conditions,
- how to generate high-quality computational grids,
- how to validate the adopted method and assess the validity of the computed solution,
- how to extract output of engineering interest from computed solutions.
- Acquire foundations of finite-difference and finite volume methods.
- Master the concepts of truncation and round-off errors, numerical stability, consistency, and convergence.
- Analyze stability of a wide range of simple mathematical models representative of Navier-Stokes equations.
- Design and implement basic numerical methods for the solution of problems arising in engineering applications.
- Get acquainted with boundary layer theory, turbulence modeling, and optimal near-wall grid generation.
- Obtain the expression of the leading term of the TE of FDs (2) and (6), and explain why these two FDs are 1st and 2nd order accurate respectively.
- Explain why FD (2) yields exact 1st derivative estimates ux of functions u with 2nd and higher derivatives equal to zero, and why FD (6) yields exact 2nd derivative estimates uxx of functions u with 4th and higher derivatives equal to zero.
Finite-Difference Equations (FDEs)
- Consider 1D unsteady heat transfer equation:
- ∂t∂u=α∂x2∂2u
- Replace 1st time-derivative with forward FD and 2nd space derivative with central FD. Both FDs are centered at (xj,tn); include FD TEs:
- ΔtU<em>jn+1−U</em>jn=αΔx2U<em>j+1n−2U</em>jn+Uj−1n+O(Δt,Δx2)
FDE Truncation Error
- Computer code solves FDE: numerical solution is affected by TE!
- FDE embedded in Eq. (2) is 1st order accurate in time and 2nd order accurate in space!
- FDE TE is the difference between PDE and FDE: FDE TE is the sum of TEs of all FDs used to replace PDE continuous derivatives.
Discretization Error (DE) of FDE Solution
- Discretization error (DE): error affecting PDE solution due to replacing continuous problem with a discrete one.
- DE is related to TE of finite-differences used in FDE: dependence of DE on Δx and Δt is similar to that of TE, in simple cases.
Round-Off Error
- Once the numerical method is designed, the system of algebraic equations must be solved with a computer.
- Any computed FDE solution is affected by rounding to a finite number of digits in arithmetic operations.
- Errors associated with finite precision computer arithmetics form so-called ROUND-OFF error.
Explicit and Implicit Schemes
- An Explicit scheme for the heat equation:
- The PDE (1) is parabolic (marching problem)
- Δtu<em>in+1−u</em>in=αΔx2u<em>i+1n−2u</em>in+ui−1n
- An Implicit scheme for the heat equation:
- Numerical scheme (5) is called implicit because the new solution at a particular position (i=i) CANNOT be determined explicitly, i.e., independently of all other.
- Δtu<em>in+1−u</em>in=αΔx2u<em>i+1n+1−2u</em>in+1+ui−1n+1
Stability, Consistency, and Convergence - 1
- Many different FDEs to solve a given PDE exist. For each considered FDE, however, a few fundamental questions need to be addressed.
- A. How to verify that FDE is an acceptable representation of the considered PDE? (Consistency)
- B. What guarantees that the marching solution process will work? (Stability)
- C. What guarantees that the computed FDE solution is good approximation to the given PDE? (Convergence)
Consistency
- Requires that the difference between PDE and FDE (i.e., truncation error) vanishes as grid refinement increases:
- limΔx,Δt→0Truncation Error=0
Convergence
- Requires that, for given boundary and initial conditions, the solution of FDE tends to exact the solution of PDE as grid refinement increases:
- limΔx,Δt→0FDE Solution=PDE Exact Solution
Stability
- From one iteration to the next, all errors (truncation, round-off, …) are not allowed to grow unboundedly.
Lax Equivalence Theorem
- Given well-posed initial-value problem and CONSISTENT approximating FDE, STABILITY is a necessary and sufficient condition for CONVERGENCE.
Von Neumann Stability Analysis
- Lax equivalence theorem states that CONSISTENCY and STABILITY of the numerical scheme guarantee CONVERGENCE.
- Von Neumann analysis enables one to:
- Understand how numerical errors propagate during the iterative solution of marching problems.
- Determine whether such errors grow unboundedly or decay in amplitude.
- Determine the range of time-step in which the numerical solution process remains stable (CFL condition).
Problem 1: Explicit Central Scheme (Advection)
- Using the expression of the jth error harmonic of Eq. (1) gives:
- ∂t∂u+c∂x∂u=0
- Explicit central scheme is UNCONDITIONALLY UNSTABLE.
Problem 2: Explicit Upwind Scheme (Advection)
- Consider the linear advection equation (c > 0):
- ∂t∂u+c∂x∂u=0
- Then the explicit upwind scheme is:
- u<em>in+1=u</em>in−σ(u<em>in−u</em>i−1n)
- Condition for stability is that modulus of G be less than 1:
- |c \frac{\Delta t}{\Delta x}| < 1
- Explicit upwind scheme is CONDITIONALLY STABLE.
Von Neumann Stability Analysis - Summary
- Consider linear advection1 PDE over interval :
- ∂t∂u+c∂x∂u=0
Sample Problems:
- Prob. 1: stability analysis of explicit Euler scheme
- Prob. 2: stability analysis of explicit upwind scheme
- Prob. 3: finite-differences and truncation error analysis.
Navier-Stokes CFD
- Drag and lift forces on aircraft and racing car wings.
- Surface and bulk temperatures in combustors.
- Mass flows and pressure drops in processing plant pipeline networks, etc
- Flow and/or heat transfer fields past/within structures must be determined.
Using NS CFD
- What are the steps needed when solving problems with CFD?
- Define domain geometry (CAD may be required).
- Mesh domain of interest (using CFD grid generator).
- Impose boundary (inflow, outflow, wall, …) and initial conditions.
- Select physical model (NS, Euler, comp./incomp.) and numerical control parameters (CFL number, number of iterations, …).
- Run job.
- Check solution quality and feasibility, and convergence data.
- Analyse results
Structured and Unstructured Grids
- Structured grid:
- Unstructured grid:
- Connectivity provided explicitly
Structured verses Unstructured Grid CFD
- Structured grids are more accurate for boundary layers, but hybrid grids enable incorporating this into unstructured CFD
- Hybrid grids better handle geometric complexity, but structured multi-block grids get close to unstructured on this.
Turbulence - 1
- Reynolds number Re=UL/ν gives the ratio of inertial and viscous forces. Above critical value Recr, most flows become unstable.
- ReRecr: chaotic and random motion state develops, velocity and pressure change continuously with time: turbulent flow.
- Engineers need computational tools capable of accounting for turbulence.
Turbulence - 2
- Reynolds decomposition: all variables written as the sum of mean and fluctuating components
- Turbulence yields rotational flow structures (turbulent eddies), with wide ranges of length and time scales.
- In turbulent flows, heat, mass, and momentum are very effectively exchanged (mixing).
RANS equations: How do they look like?
- What does Reynolds stress look like
- Most common approach to account for turbulence effects on mean flow is Reynolds-averaged Navier-Stokes (RANS) approach
- Reynolds-averaged equation using time averaging
Reynolds stress tensor looks like this: Components of Reynolds are time-averaging, and the superscript denote fluctuations about mean value
Boussinesq approximation
- Boussinesq’s approximation: unknown is now μt and k.
- The equation is for incompressible slow
- The most wide spread approximation
A set of dimensional used with two equations
Boundary Layers - 1
- For given Reynolds number and geometry, turbulent boundary layer (BL) is thicker than laminar BL, and the wall stress is much higher for a turbulent BL
- The purpose is to correctly predict the boundary Layers Characteristics
- Some general steps also need to be considered
Turbulent BL Characteristics
- Boundary layer thickness. According to semi-empirical solution, BL thickness is:
- δ≈Rex0.20.37x
- Skin friction coefficient
- c<em>f≈Re</em>x0.20.0576