Numerical Methods in Fluid Flow and Heat Transfer Z Dr
Total Page:16
File Type:pdf, Size:1020Kb
Numerical Methods in Fluid Flow and Heat Transfer z Dr. Hasan Gunes z [email protected] z http://atlas.cc.itu.edu.tr/ ~guneshasa INTRODUCTION The Scientific Method and Mathematical Modeling The mathematical formulation of the problem is the reduction of the physical problem to a set of either algebraic or differential equations subject to certain assumptions. The process of modeling of physical systems in the real world should generally follow the path illustrated schematically in the chart below: Numerical Solution Procedure Physical System i.e. Reality Physical Laws + 1 Models Mathematical Model i.e. Governing Equations Analytical Solution (Fluid Dynamics Æ PDEs) 2 Discretization System of Algebraic Equations (or ODEs) 3 Matrix Solver Numerical Solution Physical World Physical Properties Assumptions •Algebraic eqs. •Differential eqs. oOrdinary diff. eqs. Mathematical Model oPartial diff.eqs. (Equations) Conservation Laws Linear Non linear Iterations Linearized Non linear Approximation (Exact or approximate) Nonlinear Linear solution solution (Analytical, Numerical) •FORTRAN •C Test solution •MATLAB •MAPLE •TECPLOT Solution Approaches Three approaches or methods are used to solve a problem in fluid mechanics & heat transfer 1. Experimental methods: capable of being most realistic, experiment required, scaling problems, measurement difficulties, operating costs. 2. Theoretical (analytical) methods: clean, general information in formula form, usually restricted to simple geometry &physics, usually restricted to linear problems. 3. Numerical (CFD) (computational) methods (Simulation): No restriction to linearity Complicated physics can be treated Time evolution of flow Large Re flow Disadvantages: Truncation errors Boundary condition problems Computer costs Need mathematical model for certain complex phenomena Simulation: The Third Pillar of Science z Traditional scientific and engineering paradigm: 1) Do theory or paper design. 2) Perform experiments or build system. z Limitations: z Too difficult -- build large wind tunnels. z Too expensive -- build a throw-away passenger jet. z Too slow -- wait for climate or galactic evolution. z Too dangerous -- weapons, drug design, climate experimentation. z Computational science paradigm: 3) Use high performance computer systems to simulate the phenomenon z Base on known physical laws and efficient numerical methods. Some Particularly Challenging Computations z Science z Global climate modeling z Astrophysical modeling z Biology: Genome analysis; protein folding (drug design) z Engineering z Crash simulation z Semiconductor design z Earthquake and structural modeling z Business z Financial and economic modeling z Transaction processing, web services and search engines z Defense z Nuclear weapons -- test by simulations z Cryptography Economic Impact of HPC z Airlines: z System-wide logistics optimization systems on parallel systems. z Savings: approx. $100 million per airline per year. z Automotive design: z Major automotive companies use large systems (500+ CPUs) for: z CAD-CAM, crash testing, structural integrity and aerodynamics. z One company has 500+ CPU parallel system. z Semiconductor industry: z Semiconductor firms use large systems (500+ CPUs) for z device electronics simulation and logic validation z A lot of Savings!! Global Climate Modeling Problem z Problem is to compute: f(latitude, longitude, elevation, time) Æ temperature, pressure, humidity, wind velocity z Approach: z Discretize the domain, e.g., a measurement point every 1km z Devise an algorithm to predict weather at time t+1 given t • Uses: - Predict major events, e.g., Katrina - investigate climate change sea surface temperature output from an eddy resolving ocean model Source: http://www.epm.ornl.gov/chammp/chammp.html Global Climate Modeling Computation z One piece is modeling the fluid flow in the atmosphere z Solve Navier-Stokes problem z Roughly 100 Flops per grid point with 1 minute timestep z Computational requirements: z To match real-time, need 5x 1011 flops in 60 seconds = 8 Gflop/s z Weather prediction (7 days in 24 hours) Æ 56 Gflop/s z Climate prediction (50 years in 30 days) Æ 4.8 Tflop/s z To use in policy negotiations (50 years in 12 hours) Æ 288 Tflop/s z To double the grid resolution, computation is at least 8x z Current models are coarser than this z flops: floating-point operations per second Heart Simulation z Problem is to compute blood flow in the heart z Approach: z Modeled as an elastic structure in an incompressible fluid. z The “immersed boundary method” due to Peskin and McQueen. z 20 years of development in model z Many applications other than the heart: blood clotting, inner ear, paper making, embryo growth, and others z Uses z Current model can be used to design artificial heart valves z Can help in understand effects of disease (leaky valves) z Related projects look at the behavior of the heart during a heart attack z Ultimately: real-time clinical work Heart Simulation Calculation The involves solving Navier-Stokes equations zDone on a Cray C90 -- 100x faster and 100x more memory zUntil recently, limited to vector machines - Needs more features: - Electrical model of the heart, and details of muscles, E.g., - Chris Johnson - Andrew McCulloch - Lungs, circulatory systems Vehicle Aerodynamics Flow around a moving truck in a wind tunnel. z Need to fix the model & blow air at it. z Floor also has to move at the air speed a difficult task. Vehicle Aerodynamics Flow around a moving car in a wind tunnel. z Drag coefficient, lift coefficient, moment coefficient z Pathlines/streamlines/streaklines Turbomachinery analysis Flow in an inline duct fan z Need to consider rotating fluid zone. z Absolute & Relative velocities CFD: obtain approximate solutions to complex problems numerically. Need to use a discretization method which approximates the differential equations by a system for algebraic equations, which can then be solved on a computer. Accuracy of numerical solutions quality of discretization Components of a numerical solution method 1. Mathematical Model: Set of PDEs or integro-differantial eqs. and the corresponding boundary conditions. 2. Discretization Method: • Finite difference • Finite volume • Finite element • Spectral (element) methods • Boundary element PDE’s (continuous) discrete equations (FDE's) 3. Coordinate &Basic Vector System 4. Numerical Grid: grid generation • Structured (regular) grid • Block structured grid • Unstructured grid Discrete locations at which the variables are to be calculated are defined by the numerical grid, or mesh. 5. Finite Approximations: approx. used in discretization process is selected e.g. Finite difference: approximations for the derivatives at the grid points need to be selected The choice influences: • Accuracy of approximation • Developing the solution method • Coding, debugging, speed of code Compromise between simplicity easy of implementation,accuracy and computational efficiency has to be made • Second order methods in general are used. 6. Solution Method Discretization yields a large system of linear/non-linear algebraic equations. Linear equations Algebraic equation solvers Non-linear equations iteration scheme used i.e. linearize the equations & resulting linear systems are solved by iterative techniques. Unsteady flows: methods based on marching in time Steady flows: usually by pseudo-time-marching or equivalent iteration scheme 7. Convergence criteria (for iterative procedures) Need to set convergence for the iterative method. Accuracy & efficiency is important Absolute convergence: a − a* <ε()tolerance a− a* Relative convergence: < ε a FINITE DIFFERENCE METHODS Definitions & Remarks Derivatives in a given PDE are approximated by finite difference relations (using Taylor series expansions) Resulting approximate eqs. which represent the original PDE, is called a Finite Difference Equation . (FDE) STENCIL Y i, j+1 i-1, j i+1, j i,j J=1 i, j-1 X i=1 i=N FDE algebraic eq. (written for each grid point within the domain) Objectives: • study the various schemes to approximate the PDE s by FDE • explore numerical techniques for solving resulting FDE Additional Terminology: 1. Consistency: a finite dif. approx. of PDE is consistent if the FDE approaches the PDE as the grid size approaches zero. 2. Stability: a numerical scheme is said to be stable if any error introduced in the FDE does not grow with the solution of the finite difference equations. Von Neumann’s method : without boundary conditions (BCs) Conditional stability on some schemes Time step be smaller than a certain limit. Under-relaxation needs to be used i. Temporal problems: stability guaranties that method produces a bounded solution ii. Iterative methods: stable method does not diverge It is difficult to do the stability analysis when BCs & non-linearities are present 3. Convergence: a finite difference scheme is convergent if the solution of the FDE approaches that of the PDE as the grid size approaches zero 4. Lax’s equivalent theorem : for a FDE which approximates a well-posed, linear initial value problem, the necessary & sufficient condition for convergence is that the FDE must be stable and consistent. For linear problems which are strongly influenced by BCs. Stability & convergence of a method are difficult to demonstrate Thus, we check via numerical experiments (grid refinement) Grid-independent solutions Boundedness Realizability Accuracy: Numerical solutions of fluid flow & heat transfer problems are only approximate solutions. Involve some kind