School of Mechanical Aerospace and Civil Engineering CFD-1 T. J. Craft George Begg Building, C41 Msc CFD-1 Reading: J. Ferziger, M. Peric, Computational Methods for Fluid Dynamics H.K. Versteeg, W. Malalasekara, An Introduction to Computational Fluid Dynamics: The Finite Volume Method S.V. Patankar, Numerical Heat Transfer and Fluid Flow Notes: http://cfd.mace.manchester.ac.uk/tmcfd - People - T. Craft - Online Teaching Material Introduction: What is CFD? CFD: Computational Fluid Dynamics Many modern engineering systems require a detailed knowledge of fluid flow behaviour. Experiments provide useful data, but are often costly and time-consuming. It can also be difficult to measure the details required: Measurement probes may disturb the flow excessively, and/or optical access may not be convenient. Obtaining the correct parameter scaling may be difficult. Reproducing some flow conditions safely (eg. explosions) may be difficult. Empirical correlations can be useful for simple problems or first estimates but are usually not available or applicable for complex problems. CFD-1 2010/11 2 / 21 The equations governing fluid flows are a set of coupled, non-linear partial differential equations: Continuity: Momentum: ρui t ρ t + ρu i x i = 0 + ρu iu j = P + ( ) µ Ui x j x i x j x j Many real problems include additional terms and/or equations, governing heat-transfer, chemical species, turbulence models, etc. Analytic solutions are known only for a few very simple laminar flow cases. An alternative is to solve the governing equations numerically, on a computer. Computational Fluid Dynamics (CFD) is this process of obtaining numerical approximations to the solution of the governing fluid flow equations. CFD-1 2010/11 3 / 21 Note the use of the word approximations : all CFD solutions have some error associated with them. CFD does not remove the need for experiments: numerical models need to be validated to ensure they produce reliable and accurate results. With the growth of available computing power it has become possible to apply CFD even to very complex flowfields, giving detailed information about the velocity field, pressure, temperature, etc. The key to successful use of CFD is an understanding of where the errors come from; their implications, and how to ensure they are small enough to be acceptable in a particular application. The main aims of this course are thus to: Give an understanding of the processes involved in approximating differential equations by a set of algebraic (discretized) equations. Allow an appreciation of the accuracy and stability issues associated with different approximations. Provide an understanding of how the resulting set of equations are solved, and how coupled sets of equations are handled. CFD-1 2010/11 4 / 21
A number of commercial CFD codes are available (Fluent, Star-CD, CFX,... ). These may appear easy -to-use, but to do so reliably requires a good understanding of the above issues and of the numerical methods employed by the programs. Only with this can one select appropriate options for particular problems. For example, the default numerical approximations in such codes are often rather diffusive (a term that will be explained later). This makes the solution more stable, so an inexperienced user is more likely to get a converged result, but the errors in it may be large, so the result may not correspond closely to the true flow. Informed use of CFD codes also requires a good understanding of basic fluid mechanics so one can choose appropriate physical models for a particular problem and recognise whether solutions coming from simulations make sense or not. The CFD Process Grid Generation Structured, unstructured,... Depending on the numerical scheme, values of variables may be stored at cell centres, cell vertices, or a combination. CFD-1 2010/11 5 / 21 CFD-1 2010/11 6 / 21 Discretization Approximating the differential equations by a set of algebraic ones linking the variable nodal values. For example, a central difference scheme might use: 2 U x 2 (U E U P)/ x (U P U W)/ x x U U W U P E This process involves approximating derivatives, and often entails interpolating variable values. The methods employed for these approximations can affect both the accuracy and stability of the numerical scheme. The result is a (large) set of algebraic equations. Solution of Discretized Equations The discretized equations can be written in matrix form Ax = b x is the vector of unknowns (the nodal variable values). The values in A and b depend on the discretization method adopted. Different methods can be employed to solve this set of equations (usually in an iterative fashion). The choice of method depends on the particular type of problem, form of the matrix A, etc. Post-Processing CFD-1 2010/11 7 / 21 CFD-1 2010/11 8 / 21
Flow Over 2-D Hills Flow Over 3-D Hill Well-resolved LES by Temmerman & Leschziner (2001) Re U bh/ν = 10590 Separation from curved surface, followed by reattachment. Experiments by Simpson et al (2002). Complex separation and vortex pattern downstream of hill. Re = UH/ν = 130000 Few models return the correct separation and reattachment points. CFD-1 2010/11 9 / 21 CFD-1 2010/11 10 / 21 Flow Around Simplified Car Hatchback Experiments by Lienhart et al (2000). A rear slope angle of 25 o. Wing-Tip Vortex Development 1 Near-field development of the wing-tip vortex off a NACA 0012 aerofoil at 10 o incidence. Experiments by Chow et al (1994) show an accelerated core region. Linear and non-linear EVM s, and stress transport schemes have been tested (all with wall-functions over the wing surface). Adequate resolution of the downstream vortex requires grids of 5-6M cells (even with wall-functions on all walls). Strong vortices roll up off the corners of the upper roof. CFD-1 2010/11 11 / 21 CFD-1 2010/11 12 / 21
5 25 c 75 5 25 5 25 y/c 75 5 25 5 5 5 5 5 5 5 5 5 25 75 5 25 5 25 75 5 25 5 25 y/c 75 5 25 5 25 y/c 75 5 25 5 5 5 5 5 5 5 5 5 25 75 5 25 5 25 75 5 25 Wing-Tip Vortex Development 2 Transonic Afterbody Flows Streamwise Velocity at x/c = 0.678 Exptl Meas. Linear k Vortex Centre Development Measurements reported by Berrier (1988). Freestream M = 0.944 with nozzle pressure ratio 1.98. Surface Pressure coefficients θ=0 ο θ=45 ο θ=180 ο 0.6 0.4 Exp. MCL Computed with 1.4M nodes. 0.2 Non linear k TCL Cp 0.2 0.4 0 0.6 0.6 0.8 1.0 0.8 1.0 0.6 0.8 1.0 x/l x/l x/l Fine downstream grid required to resolve vortex development. Advanced stress transport scheme (TCL) does capture the flow development. CFD-1 2010/11 13 / 21 TCL scheme shows good agreement with the limited available data. CFD-1 2010/11 14 / 21 3-D Duct with Staggered Ribs Local heat transfer measurements taken on ribbed wall. Non-orthogonal grid of 76 64 30 cells. Important Concepts in CFD Accuracy This can be thought of as three issues: Modelling accuracy. How well do the differential equations represent the physical system. For single phase laminar flow this is not usually an issue, but may be once models are introduced for turbulence, etc. Discretization accuracy: How well does the discretized solution (the collection of velocity, pressure, temperature,... values at grid nodes) represent the true solution of the original differential equations. Solver Accuracy: How close does the matrix solver get to the true solution of the discretized system. The second is the accuracy question that will addressed in most detail in this course. Different approximation schemes and grid arrangements can have a significant effect on the accuracy of the solution. CFD-1 2010/11 15 / 21 CFD-1 2010/11 16 / 21
Stability Most CFD schemes employ an iterative solution procedure to solve the resulting system of discretized algebraic equations. Stability in this context refers to the convergence (or otherwise) of this process. In time-dependent problems stability refers to whether the method produces a bounded solution (assuming the exact solution should remain bounded). A stable scheme thus ensures that small errors (which inevitably appear in a numerical solution) do not get magnified. Stability of a scheme can be analysed analytically for very simple equations, but there are few such results for non-linear coupled systems. In practise, stability often places a restriction on the time step that can be used, or the level of under-relaxation applied. Stability vs. Accuracy In general, there is often a trade-off between accuracy and stability. A numerical scheme that is very diffusive, for example, can be very stable because it is effectively adding too much viscosity to the problem. However, by doing so it may be smoothing out steep gradients, and will not, therefore, be very accurate. Understanding these effects, and how to get the right balance between the two, is a crucial aspect of CFD. Consistency If the discretization scheme is consistent, then it should formally become exact as the grid spacing/time step tends to zero. Truncation errors (see later lectures) are generally proportional to ( x) n or ( t) n for some n (which depends on the discretization scheme); a consistent scheme will have n > 0. CFD-1 2010/11 17 / 21 CFD-1 2010/11 18 / 21 Conservation The equations being solved arise from physical conservation laws. A conservative numerical scheme will retain this property on both a local (cell) and global (domain) level. For example, in a steady state problem there should be a balance between mass inflow and outflow over each cell, and over the entire domain. Boundedness Ensures that the numerical solution lies within physical bounds. For example, in a heat conduction problem the minimum and maximum temperatures should occur on the domain boundaries. A bounded scheme would not produce spurious maxima/minima within the domain. Higher order discretization schemes can often produce unbounded solutions in the form of undershoots and overshoots, which can sometimes lead to stability and convergence problems. CFD-1 2010/11 19 / 21 Course Structure Content: Basic numerical solution techniques Finite difference methods Finite volume methods Solving sets of linear equations Handling coupled sets of equations Time dependent problems Body-fitted grids for complex geometries Considerations in turbulent flows Two laboratory exercises. Suggested Reading: J. Ferziger, M. Peric, Computational Methods for Fluid Dynamics H.K. Versteeg, W. Malalasekara, An Introduction to Computational Fluid Dynamics: The Finite Volume Method S.V. Patankar, Numerical Heat Transfer and Fluid Flow CFD-1 2010/11 20 / 21
Course Delivery and Assessment Lectures given by Dr Tim Craft and Prof Dominique Laurence. Monday 11:00-13:00 SSB/G41 Thursday 11:00-12:00 R/F1 Two lab sessions to be arranged. Assessment: Three hour examination in January (80%) Reports on lab exercises (20%) CFD-1 2010/11 21 / 21