Presentation is loading. Please wait.

Presentation is loading. Please wait.


Similar presentations

Presentation on theme: "AN INTRODUCTION TO COMPUTATIONAL FLUID DYNAMICS"— Presentation transcript:

Shuisheng He School of Engineering The Robert Gordon University Introduction to CFD (Pisa, 30/09/2005)

2 Introduction to CFD (Pisa, 30/09/2005)
OBJECTIVES The lecture aims to convey the following information/ message to the students: What is CFD The main issues involved in CFD, including those of Numerical methods Turbulence modelling The limitations of CFD and the important role of validation and expertise in CFD Introduction to CFD (Pisa, 30/09/2005)

3 Introduction to CFD (Pisa, 30/09/2005)
OUTLINE OF LECTURE Introduction What is CFD What can & cannot CFD do What does CFD involve … Issues on numerical methods Mesh generation Discretization of equation Solution of discretized equations Turbulence modelling Why are turbulence models needed? What are available? What model should I use? Demonstration Use of Fluent Introduction to CFD (Pisa, 30/09/2005)

4 Introduction to CFD (Pisa, 30/09/2005)

5 Introduction to CFD (Pisa, 30/09/2005)
What is CFD? Computational fluid dynamics (CFD): CFD is the analysis, by means of computer-based simulations, of systems involving fluid flow, heat transfer and associated phenomena such as chemical reactions. CFD involves ... Introduction to CFD (Pisa, 30/09/2005)

6 Introduction to CFD (Pisa, 30/09/2005)
What does CFD involve? Specification of the problem Development of the physical model Development of the mathematical model Governing equations Boundary conditions Turbulence modelling Mesh generation Discretization of the governing equations Solution of discretized equations Post processing Interpretation of the results Introduction to CFD (Pisa, 30/09/2005)

7 Introduction to CFD (Pisa, 30/09/2005)
An example Initiation of the problem DP Offshore Ltd is keen to know what (forces ) caused the damage they recently experienced with their offshore pipelines. Development of the physical model After a few meetings with the company, we have finally agreed a specification of the problem (For me, it defines the physical model of the problem to be solved): Tidal current: to 20m/s Waves (unsteady): -5m/s to +5m/s Diameters: 150~200mm Gap above sea bed: 10mm Depth of sea: 500m ~ 1000m Introduction to CFD (Pisa, 30/09/2005)

8 Introduction to CFD (Pisa, 30/09/2005)
An example (cont.) Development of the mathematical model Governing equations Equations: momentum, thermal (x), multiphase (x), … Phase 1: 2D, steady; Phase 2: unsteady, …, The flow is turbulent! Boundary conditions Decide the computational domain Specify boundary conditions 10D Inlet: Flat inlet profiles V=25m/s Turbulence=5% Smooth wall Symmetry Outlet: fully developed zero gradient 20D Flow Introduction to CFD (Pisa, 30/09/2005)

9 Introduction to CFD (Pisa, 30/09/2005)
An example (cont.) Development of the mathematical model (cont.) Turbulence model Initially, a standard 2-eq k-ε turbulence model is chosen for use. Later, to improve simulation of the transition, separation & stagnation region, I would like to consider using a RNG or a low-Re model Mesh generation Finer mesh near the wall but not too close to wall Finer mesh behind the pipe Introduction to CFD (Pisa, 30/09/2005)

10 Introduction to CFD (Pisa, 30/09/2005)
An example (cont.) Discretization of the equations Start with 1st order upwind, for easy convergence Consider to use QUICK for velocities, later. There is no reason for not using the default SIMPLER for pressure. Solver Use Uncoupled rather than coupled method Use default setup on under-relaxation, but very likely, this will need to be changed later Convergence criterion: choose 10-5 initially: check if this is ok by checking if 10-6 makes any difference. Iteration Start iteration Failed Plot velocity or other variable to assist identifying the reason(s) Potential changes in: relaxation factors, mesh, initial guess, numerical schemes, etc. Converged solution Eventually, solution converged. Introduction to CFD (Pisa, 30/09/2005)

11 Introduction to CFD (Pisa, 30/09/2005)
An example (cont.) Post processing Interpretation of results Force vector: (1 0 0) pressure viscous total pressure viscous total zone name force force force coefficient coefficient coefficient n n n pipe net Introduction to CFD (Pisa, 30/09/2005)

12 CFD road map Pre-processor Solver Post-processor Specify the problem
Select turbulence model Generate Mesh Discretize equations Solve discretized equations Post processing Pre-processor Solver Post-processor Introduction to CFD (Pisa, 30/09/2005)

13 Introduction to CFD (Pisa, 30/09/2005)
Why CFD? Continuity and Navier-Stokes equations for incompressible fluids: Introduction to CFD (Pisa, 30/09/2005)

14 Introduction to CFD (Pisa, 30/09/2005)
Why CFD? (cont.) Flow in a pipe For laminar flow: ? Or For turbulent flow: Important conclusion: There is no analytical solution even for a very simple application, such as, a turbulent flow in a pipe. Analytical solutions are available for only very few problems. Experiment combined with empirical correlations have traditionally been the main tool - an expensive one. CFD potentially provides an unlimited power for solving any flow problems Introduction to CFD (Pisa, 30/09/2005)

15 Introduction to CFD (Pisa, 30/09/2005)
CFD applications Aerospace Automobile industry Engine design and performance The energy sector Oil and gas Biofluids Many other sectors Introduction to CFD (Pisa, 30/09/2005)

16 CFD applications (cont.)
As a design tool, CFD can be used to perform quick evaluation of design plans and carry out parametric investigation of these designs. As a research tool, CFD can provide detailed information about the flow and thermal field and turbulence, far beyond these provided by experiments. Introduction to CFD (Pisa, 30/09/2005)

17 Introduction to CFD (Pisa, 30/09/2005)
What can CFD do? Flows problems in complex geometries Heat transfer Combustions Chemical reactions Multiphase flows Non-Newtonian fluid flow Unsteady flows Shock waves Introduction to CFD (Pisa, 30/09/2005)

18 Introduction to CFD (Pisa, 30/09/2005)
What can’t CFD do? CFD is still struggling to predict even the simplest flows reliably, for example, A jet impinging on a wall Heat transfer in a vertical pipe Flow over a pipe Combustion in an engine Important conclusions: Validation is of vital importance to CFD. Use of CFD requires more expertise than many other areas CFD solutions beyond validation are often sought and expertise plays an important role here. Introduction to CFD (Pisa, 30/09/2005)

19 Validation of CFD modelling
Errors involved in CFD results Discretization errors Depending on ‘schemes’ used. Use of higher order schemes will normally help to reduce such errors Also depending on mesh size – reducing mesh size will normally help to reduce such errors. Iteration errors For converged solutions, such errors are relatively small. Turbulence modelling Some turbulence models are proved to produce good results for certain flows Some models are better than others under certain conditions But no turbulence model can claim to work well for all flows Physical problem vs mathematical model Approximation in boundary conditions Use of a 2D model to simplify calculation Simplification in the treatment of properties Introduction to CFD (Pisa, 30/09/2005)

20 Validation of CFD modelling (cont.)
CFD results always need validation. They can be Compared with experiments Compared with analytical solutions Checked by intuition/common sense Compared with other codes (only for coding validation!) Introduction to CFD (Pisa, 30/09/2005)

21 Commercial CFD packages
Phoenix Fluent Star-CD CFX (FLOW3D) Many others Computer design tools – integrating CFD into a design package Introduction to CFD (Pisa, 30/09/2005)

22 Introduction to CFD (Pisa, 30/09/2005)
How to use a CFD package? Specify the problem Generate Mesh Select equations to solve Select turbulence models Define boundary conditions Select numerical methods Iterate – solve equations Fail – calculation does not converge or converges too slowly Improve model: Physical model Mesh Better initial guess Numerical methods (e.g., solver, convection scheme) Under-relaxations Post processing Interpretation of results – Always question the results Introduction to CFD (Pisa, 30/09/2005)

23 How to use a CFD package? (cont.)
Important issues involved in using CFD: Mesh independence check Selection of an appropriate turbulence model Validation of the solution based on a simplified problem (which contains the important features similar to your problem) Careful interpretation of your results Introduction to CFD (Pisa, 30/09/2005)

24 How to use a CFD package? (cont.)
The commercial packages are so user friendly and robust, why do we still need CFD experts? Because they can provide: Appropriate interpretation of the results and knowledge on the limitations of CFD More accurate results (by choosing the right turbulence model & numerical methods) Ability to obtain results (at all) for complex problems Speed: both in terms of the time used to generate the model and the computing time Introduction to CFD (Pisa, 30/09/2005)

25 Introduction to CFD (Pisa, 30/09/2005)
Basic CFD strategies Finite difference (FD) Starting from the differential form of the equations The computational domain is covered by a grid At each grid point, the differential equations (partial derivatives) are approximated using nodal values Only used in structured grids and normally straightforward Disadvantage: conservation is not always guaranteed Disadvantage: Restricted to simple geometries. Finite Volume (FV) Finite element (FE) Introduction to CFD (Pisa, 30/09/2005)

26 Basic CFD strategies (cont.)
Finite difference (FD) Finite Volume (FV) Starting from the integral form of the governing equations The solution domain is covered by control volumes (CV) The conservation equations are applied to each CV The FV can accommodate any type of grid and suitable for complex geometries The method is conservative (as long as surface integrals are the same for CVs sharing the boundary) Most widely used method in CFD Disadvantage: more difficult to implement higher than 2nd order methods in 3D. Finite element (FE) Introduction to CFD (Pisa, 30/09/2005)

27 Basic CFD strategies (cont.)
Finite difference (FD) Finite Volume (FV) Finite element (FE) The domain is broken into a set of discrete volumes: finite elements The equations are multiplied by a weight function before they are integrated over the entire domain. The solution is to search a set of non-linear algebraic equations for the computational domain. Advantage: FE can easily deal with complex geometries. Disadvantage: since unstructured in nature, the resultant matrices of linearized equations are difficult to find efficient solution methods. Not often used in CFD Introduction to CFD (Pisa, 30/09/2005)

Introduction to CFD (Pisa, 30/09/2005)

29 Mesh generation Why do we care? 50% time spent on mesh generation
Specify the problem Select turbulence model Generate Mesh Discretize equations Solve discretized equations Post processing CFD Road Map Why do we care? 50% time spent on mesh generation Convergence depends on mesh Accuracy depends on mesh Main topics Structured/unstructured mesh Multi-block body fitted Adaptive mesh generation Introduction to CFD (Pisa, 30/09/2005)

30 - MESH GENERATION - Computational domain and mesh structure
Carefully select your computational domain The mesh needs to be able to resolve the boundary layer to be appropriate for the Reynolds number to suit the turbulence models selected to be able to model the complex geometry Introduction to CFD (Pisa, 30/09/2005)

31 - MESH GENERATION - Structure/unstructured mesh
Structured grid A structured grid means that the volume elements (quadrilateral in 2D) are well ordered and a simple scheme (e.g., i-j-k indices) can be used to label elements and identify neighbours. Unstructured grid In unstructured grids, volume elements (triangular or quadrilateral in 2D) can be joined in any manner, and special lists must be kept to identify neighbouring elements Introduction to CFD (Pisa, 30/09/2005)

32 - MESH GENERATION - Structure/unstructured mesh
Structured grid Advantages: Economical in terms of both memory & computing time Easy to code/more efficient solvers available The user has full control in grid generation Easy in post processing Disadvantages Difficult to deal with complex geometries Unstructured grid Advantages/disadvantages: opposite to above points! Introduction to CFD (Pisa, 30/09/2005)

33 - MESH GENERATION - Multi-Block and Overset Mesh
Introduction to CFD (Pisa, 30/09/2005)

34 - MESH GENERATION - Body fitted mesh - transformation
Regular mesh Body fitted mesh Introduction to CFD (Pisa, 30/09/2005)

35 - MESH GENERATION - Adaptive mesh generation
The mesh is modified according to the solution of the flow Two types of adaptive methods Local mesh refinement Mesh re-distribution Dynamic adaptive method Mesh refinement/redistribution are automatically carried out during iterations Demonstration – flow past a cylinder Introduction to CFD (Pisa, 30/09/2005)

36 Equation discretization
Relevant issues Convergence strongly depends on numerical methods used. Accuracy – discretization errors Main topics Staggered/collocated variable arrangement Convection schemes Accuracy Artificial diffusion Boundedness Choice of many schemes Pressure-velocity link Linearization of source terms Boundary conditions Specify problem Select turbulence model Generate Mesh Discretize equations Solve discretized equations Post processing CFD Road Map Introduction to CFD (Pisa, 30/09/2005)

37 - EQUATION DISCRETIZATION - Staggered/collocated variable arrangement
All variables are defined at nodes Staggered variable arrangement Velocities are defined at the faces and scalars are defined as the nodes U V P,T U,V,P,T Collocated Arrangement Staggered Arrangement Introduction to CFD (Pisa, 30/09/2005)

38 - EQUATION DISCRETIZATION - Staggered/collocated variable arrangement
The problem: Unless special measures are taken, the collocated arrangement often results in oscillations The reason is the weak coupling between velocity & pressure Staggered variable arrangement Almost always been used between 60’s and early 80’s Still most often used method for Cartesian grids Disadvantage: difficult to treat complex geometry Collocated variable arrangement Methods have been developed to over-come oscillations in the 80’s and such methods are often being used since. Used for non-orthogonal, unstructured grids, or, for multigrid solution methods Introduction to CFD (Pisa, 30/09/2005)

39 - EQUATION DISCRETIZATION - Convection schemes
The problem To discretize the equations, convections on CV faces need to be calculated from variables stored on nodal locations When the 2nd order-accurate linear interpolation is used to calculate the convection on the CV faces, undesirable oscillation may occur. Development/use of appropriate convection schemes have been a very important issue in CFD There are no best schemes. A choice of schemes is normally available in commercial CFD packages to be chosen by the user. Introduction to CFD (Pisa, 30/09/2005)

40 - EQUATION DISCRETIZATION - Convection schemes (cont.)
The requirements for convection schemes: Accuracy: Schemes can be 1st, 2nd, 3rd...-order accurate. Conservativeness: Schemes should preserve conservativeness on the CV faces Boundedness: Schemes should not produce over-/under-shootings Transportiveness: Schemes should recognize the flow direction Introduction to CFD (Pisa, 30/09/2005)

41 - EQUATION DISCRETIZATION - Convection schemes (cont.)
Examples of convection schemes 1st order schemes: Upwind scheme (UW): most often used scheme! Power law scheme Skewed upwind Higher order schemes Central differencing scheme (CDS) – 2nd order Quadratic Upwind Interpolation for Convective Kinematics (QUICK) – 3rd order and very often used scheme Bounded higher-order schemes Total Variation Diminishing (TVD) – a group of schemes SMART Introduction to CFD (Pisa, 30/09/2005)

42 - EQUATION DISCRETIZATION - Pressure-velocity link
The problem The pressure appears in the momentum equation as the driving force for the flow. But for incompressible flows, there is no transport equation for the pressure. In stead, the continuity equation will be satisfied if the appropriate pressure field is used in the momentum equations The non-linear nature of and the coupling between, the various equations also pose problems that need care. The remedy Iterative guess-and-correct methods have been proposed – see next slide. Introduction to CFD (Pisa, 30/09/2005)

43 - EQUATION DISCRETIZATION - Pressure-velocity link (cont.)
Most widely used methods SIMPLE (Semi-implicit method for pressure-linked equations) A basic guess-and-correct procedure SIMPLER (SIMPLE-Revised): used as default in many commercial codes Solve an extra equation for pressure correction (30% more effort than SIMPLE). This is normally better than SIMPLE. SIMPLEC (SIMPLE-Consistent): Generally better than SIMPLE. PISO (Pressure Implicit with Splitting of Operators) Initially developed for unsteady flow Involves two correction stages Introduction to CFD (Pisa, 30/09/2005)

44 - EQUATION DISCRETIZATION - Linearization of source terms
This slide is only relevant to those who develops CFD codes. The treatment of source terms requires skills which can significantly increase the stability and convergence speed of the iteration. The basic rule is that the source term should be linearizated and the linear part can the be solved directly. An important rule is that only those of linearization which result in a negative gradient can be solved directly Introduction to CFD (Pisa, 30/09/2005)

45 - EQUATION DISCRETIZATION - Boundary conditions
Specification of boundary conditions (BC) is a very important part of CFD modelling In most cases, this is straightforward but, in some cases, it can be very difficult ..., Typical boundary conditions: Inlet boundary conditions Outlet boundary conditions Wall boundary conditions Symmetry boundary conditions Periodic boundary conditions Introduction to CFD (Pisa, 30/09/2005)

46 Solution of discretized equations
Specify problem Select turbulence model Generate Mesh Discretize equations Solve discretized equations Post processing CFD Road Map Relevant issues Cost/speed Stability/Convergence Main topics Solver – solution of the discretized equation system Convergence criteria Under-relaxation Solution of coupled equations Unsteady flow solvers Introduction to CFD (Pisa, 30/09/2005)

Discretized Equations – large linearized sparse matrix AW AS AP AN AE ΦN ΦS Φp Qp = * Introduction to CFD (Pisa, 30/09/2005)

The discretized governing equations are always sparse, non-linear but linearizated, algebraic equation systems The ‘matrix’ from structured mesh is regular and easier to solve. A non-structured mesh results in an irregular matrix. Number of equations = number of nodes Number of molecules in each line: Upwind, CDS for 1D results in a tridiagonal matrix QUICK for 1D results in a penta-diagonal matrix 2D problems involves 5 & more molecules 3D problems involves 7 & more molecules Introduction to CFD (Pisa, 30/09/2005)

Direct methods Gauss elimination: Tridiagonal Matrix Algorithm (TDMA): Indirect methods Basic methods: Jacobi Gauss-Seidel Successive over-relaxation (SOR) ADI-TDMA Strongly implicit procedure (SIP) Conjugate Gradient Methods (CGM) Multigrid Methods Very expensive! Very effective method used for tridiagonal matrix Simple and probably most often used method Used for more ‘complex’ problems Effective method for more ‘complex’ problems Introduction to CFD (Pisa, 30/09/2005)

Two basic methods: Changes between any two iterations are less than a given level Residuals in the transport equations are less than a given value Criteria can be specified using absolute or relative values Introduction to CFD (Pisa, 30/09/2005)

Under almost all circumstances, iterations will not converge unless under-relaxation is used, because The governing equations are very non-linear And the equations are closely coupled Under-relaxation (α): Different variables often require different levels of under-relaxation Iteration diverged? Relaxation is the first thing to look at Introduction to CFD (Pisa, 30/09/2005)

52 - SOLUTION OF DISCRETIZED EQUATIONS - Solution of coupled equations
Governing equations for flow/heat transfer are almost always coupled The primary variable of one equation also appear in equations for other variables Simultaneous solution – Method 1 Used when equations are linear and tightly coupled Can be very expensive Sequential solution – Method 2 Solve equations one by one - temporarily treat other variables as known Iterations include Inner cycles: Solve each equation Outer cycles: cycle between equations Introduction to CFD (Pisa, 30/09/2005)

53 - SOLUTION OF DISCRETIZED EQUATIONS - Unsteady flow solvers
Explicit method use only the values of the variable Φ from last time step. Conditionally stable, first order Implicit method Mainly use the values of the variable Φ from the current time step Unconditionally stable, first order Crank-Nicolson method Use a mixture of values of the variable Φ at the last and current steps Unconditionally stable, second order Predictor-Corrector method Predictor: Explicit method Corrector: (Pseudo-) Crank-Nicolson method Introduction to CFD (Pisa, 30/09/2005)

54 Introduction to CFD (Pisa, 30/09/2005)
3. Turbulence modelling Introduction to CFD (Pisa, 30/09/2005)

55 Turbulence modelling Turbulence models
Specify the problem Select turbulence model Generate Mesh Discretize equations Solve discretized equations Post processing CFD Road Map Turbulence models These are semi-empirical mathematical models introduced to CFD to describe the turbulence in the flow Main topics Three levels of CFD simulations Classification of turbulence models Examples of popular models Special considerations General remarks about turbulence modelling Introduction to CFD (Pisa, 30/09/2005)

56 The governing equations
Continuity and Navier-Stokes equations for incompressible fluids: Introduction to CFD (Pisa, 30/09/2005)

57 The Reynolds averaged Navier-Stokes Equation
The Reynolds averaged Navier-Stokes equations (RANS): NOTES: The extra terms, Reynolds (turbulent) shear stresses, have the effect of mixing, similar to molecular mixing (diffusion) These terms need to be modelled Introduction to CFD (Pisa, 30/09/2005)

58 The three level simulations
Direct Numerical Simulations (DNS) DNS directly solves the NS equations There is no ‘modelling’ in it, so the solution can be considered as the true representation of the flow. It always solves the unsteady form It can only be used for very simple flows at the moment due to its huge requirement on computer power. Large Eddy Simulations (LES) LES directly solves the NS flow for ‘large eddies’ but uses models to simulate the ‘small scale’ flows The solution is again always in unsteady form LES can only be used for relatively simple flows Reynolds Averaged Navier-Stokes approach (RANS) Turbulence models are used to simulate the effect of turbulence RANS has been widely used in designs and research since the 70’s Almost all commercial CFD packages are RANS based. Introduction to CFD (Pisa, 30/09/2005)

59 Classification of turbulence models
Eddy viscosity turbulence models Model Reynolds stresses as a product of velocity gradient and an eddy viscosity Solve 0 to 2 transport equations for turbulence Reynolds stress turbulence models Solve the transport equations of the Reynolds stresses Solve 7 transport equations for turbulence Introduction to CFD (Pisa, 30/09/2005)

60 Classification of turbulence models
Eddy viscosity turbulence models The key issue is to model the eddy viscosity νt Three types of eddy viscosity models Algebraic models (e.g., mixing length model) One-equation models: solve one transport equation (normally one for turbulence kinetic energy, k) Two equation models: solve two transport equations K-ε, k-ω, k-τ models Introduction to CFD (Pisa, 30/09/2005)

61 An example of the two-equation model
Jones and Launder (1972) k-ε two equation model Eddy viscosity Turbulence kinetic energy Dissipation rate Closure coefficients Introduction to CFD (Pisa, 30/09/2005)

62 An example of the Reynolds stress model
The Launder-Reece-Rodi (1975) Reynolds stress model Reynolds-stress tensor (six independent equations) Dissipation rate Pressure-strain correlation Auxiliary relations Closure coefficients [Launder (1992)] Introduction to CFD (Pisa, 30/09/2005)

63 Special turbulence models
‘Standard’ models and wall functions Standard turbulence models are designed only for the core region. Wall Functions are used to bridge the near-wall region for a wall shear flow. Standard models are used beyond roughly y+=50. Low-Reynolds number (LRN) turbulence model LRN models are designed to be used in the near-wall region as well as the core region. LRN models are much more expensive – they require much finer grid than used for standard models Two-layer models In some cases, separate models are used for the wall and core regions The wall region model can be a ‘simpler’ model, such as, one-equation model This practice can be more economical than using LRN models. Other special models Realizable models Non-linear eddy viscosity models Renormalized Group (RNG) models Introduction to CFD (Pisa, 30/09/2005)

64 Introduction to CFD (Pisa, 30/09/2005)
What model should I use? Algebraic models Main models used until early 70’s, and still in use. Advantages: simple Disadvantages: lack of generality, νt vanishes when du/dy=0, etc. Two-equation models (especially k-ε models) Most widely used models, standard model in commercial packages Advantages: best compromise between cost and capability Disadvantages: no account of individual components of turbulent stresses; νt vanishes when du/dy=0. Reynolds shear stress models Only recently been included in commercial CFD codes; and still not widely used yet. Advantages: provide the potential of modelling more complex flows Disadvantages: have to solve up to 7 more differential equations Introduction to CFD (Pisa, 30/09/2005)

65 General remarks on turbulence models
There are no generically best models. Near wall treatment is generally a very important issue. A good mesh is important to get good accurate results. Different models may have different requirement on the mesh. Expertise/validation are of great importance to CFD. Introduction to CFD (Pisa, 30/09/2005)

66 Introduction to CFD (Pisa, 30/09/2005)
References Numerical Heat Transfer and Fluid Flow S.V. Patankar, 1980, Hemisphere Publishing Corporation, Taylor & Francis Group, New York. An Introduction to Computational Fluid Dynamics H.K. Versteeg & W. Malalasekera, 1995, Longman group Limited, London Computational Methods for Fluid Dynamics J.H. Ferziger & M. Peric, 1996, Springer-Verlag, Berlin. Computational Fluid Dynamics J.D. Anderson, Jr, 1995, McGraw-Hill, Singapore Introduction to CFD (Pisa, 30/09/2005)


Similar presentations

Ads by Google