Fox Presentation Fall 1995 CPS 615 -- Computational Science in Simulation Track Background on Partial Differential Equations and Their Applications with emphasis on CFD Fall Semester 1995 Geoffrey Fox NPAC Syracuse University 111 College Place Syracuse NY 13244-4100 Abstract of PDE and CFD Background Presentation This presentation gives the application perspective on PDE's and their role in simulation compared to particle dynamics and Monte Carlo Methods We derive Navier Stokes equations and discuss immense computational requirements needed in aerospace simulations The importance of small viscosity and emergence of boundary layers is discussed Approximations used in practical CFD such as Euler's equation and Reynold's averaging are presented Field Simulations and The Use of Partial Differential Equations (PDE's) Four Descriptions of Matter -- Quantum,Particle,Statistical, Continuum Quantum Physics Particle Dynamics Statistical Physics Continuum Physics These give rise to different algorithms and in some cases, one will mix these different descriptions. We will briefly describe these with a pointer to types of algorithms used. These descriptions underly several different fields such as physics, chemistry, biology, environmental modeling, climatology. - indeed any field that studies physical world from a reasonably fundamental point of view. For instance, they directly underly weather prediction as this is phrased in terms of properties of atmosphere. However, if you simulate a chemical plant, you would not phrase this directly in terms of atomic properties but rather in terms of phenomenological macroscopic artifacts - "pipes", "valves", "machines", "people" etc. General Relativity and Quantum Gravity These describe space-time at the ultimate level but are not needed in practical real world calculations. There are important academic computations studying these descriptions of matter. Quantum Physics and Examples of Use of Computation This is a fundamental description of the microscopic world. You would in principle use it to describe everything but this is both unnecessary and too difficult both computationally and analytically. Quantum Physics problems are typified by Quantum Chromodynamics (QCD) calculations and these end up looking identical to statistical physics problems numerically. There are also some chemistry problems where quantum effects are important. These give rise to several types of algorithms. Solution to Schrodinger's equation (a partial differential equation). This can only be done exactly for simple 2-->4 particle systems Formulation of a large matrix whose rows and columns are the distinct states of the system. This is followed by typical matrix operations (diagonalization, multiplication, inversion) Statistical methods which can be thought of as Monte Carlo evaluation of integrals gotten in integral equation formulation of problem Particle Dynamics and Examples of Use of Computation Quantum effects are only important at small distances (10-13 cms for the so called strong or nuclear forces, 10-8 cm for electromagnetically interacting particles). Often these short distance effects are unimportant and it is sufficient to treat physics classically. Then all matter is made up of particles - which are selected from set of atoms (electrons etc.). The most well known problems of this type come from biochemistry. Here we study biologically interesting proteins which are made up of some 10,000 to 100,000 atoms. We hope to understand the chemical basis of life or more practically find which proteins are potentially interesting drugs. Particles each obey Newton's Law and study of proteins generalizes the numerical formulation of the study of the solar system where the sun and planets are evolved in time as defined by Gravity's Force Law Particle Dynamics and Example of Astrophysics Astrophysics has several important particle dynamics problems where new particles are not atoms but rather stars, clusters of stars, galaxies or clusters of galaxies. The numerical algorithm is similar but there is an important new approach because we have a lot of particles (currently over N=107) and all particles interact with each other. This naively has a computational complexity of O(N2) at each time step but a clever numerical method reduces it to O(N) or O (NlogN). Physics problems addressed include: Evolution of early universe structure of today Why are galaxies spiral? What happens when galaxies collide? What makes globular clusters (with O(106) stars) like they are? Statistical Physics and Comparison of Monte Carlo and Particle Dynamics Large systems reach equilibrium and ensemble properties (temperature, pressure, specific heat, ...) can be found statistically. This is essentially law of large numbers (central limit theorem). The resultant approach moves particles "randomly" asccording to some probability and NOT deterministically as in Newton's laws Many properties of particle systems can be calculated either by Monte Carlo or by Particle Dynamics. Monte Carlo is harder as cannot evolve particles independently. This can lead to (soluble!) difficulties in parallel algorithms as lack of independence implies that synchronization issues. Many quantum systems treated just like statistical physics as quantum theory built on probability densities Continuum Physics as an approximation to Particle Dynamics Replace particle description by average. 1023 molecules in a molar volume is too many to handle numerically. So divide full system into a large number of "small" volumes dV such that: Macroscopic Properties: Temperature, velocity, pressure are essentially constant in volume In principle, use statistical physics (or Particle Dynamics averaged as "Transport Equations") to describe volume dV in terms of macroscopic (ensemble) properties for volume Volume size = dV must be small enough so macroscopic properties are indeed constant; dV must be large enough so can average over molecular motion to define properties As typical molecule is 10-8 cm in linear dimension, these constraints are not hard Breaks down sometimes e.g. leading edges at shuttle reentry etc. Then you augment continuum approach (computational fluid dynamics) with explicit particle method Computational Fluid Dynamics (CFD) as an an Example of Continuum Physics Computational Fluid Dynamics is dominant numerical field for Continuum Physics There are a set of partial differential equations which cover liquids gases (airflow) gravitational waves We apply computational "fluid" dynamics most often to a gas - air. Gases are really particles But if a small number (<106) of particles, use "molecular dynamics" and if a large number (1023) use computational fluid dynamics. Detailed Discussion of CFD and Navier Stokes Equations First Four Variables of CFD: Derivation of the Continuity Equation Travelling Time Derivatives (D/ Dt) versus local time derivatives in continuity equation Newton's Laws or the Momentum Equation in CFD The Last (Energy) Equation of CFD: Features of the Full Navier Stokes Equation There are other equations describing "Energy" which involve Temperature Heat Flux and final equation is Equation of state This is pV = RT for an Ideal Gas Features of Navier-Stokes Equations SECOND ORDER PARTIAL (= derivatives with >1 variable) DIFFERENTIAL equations With SEVERAL DEPENDENT variables e.g. five for "simple" CFD r, E, v About twenty for gravitational waves Nonlinear as product r v in momentum equation and square term v2 in energy equation Discretization of CFD in 2 or 3 Dimensions -- Regular Example You solve these problems by discretizing mesh in x, y and z. Typically one might imagine some 100 points in each dimension. i.e. 106 grid points in three dimensions This is a typical non-uniform grid used to define an aircraft NASA Estimates of Computational Needs 1994 NASA's Estimate of Computing Needs for Reynolds Averaged Approximation (1994) Flow Simulation ( Reynolds Averaged Approximation ): 5x106 grid points 5x104 iterations 5x103 operations/iterations 1015 operations (flops) / problem 2x108 words of memory Hours GigaFlops Proof of concept 1000-->100 0.3-->3 Design 10-->1 30-->300 Automated Design 0.1-->0.01 3000-->30,000 Results for the LU Simulated CFD Application of NAS Benchmark for Cray YMP, iPSC860, CM2 System No. Proc. Time/Iter.(secs) MFLOPS (Y-MP) Y-MP 1 1.73 246 8 0.25 1705 iPSC/860 64 3.05 139 128 1.90 224 CM-2 8K 5.23 82 16K 3.40 125 32K 2.29 186 Results for the SP Simulated CFD Application of NAS Benchmarks for Cray YMP, iPSC860 and CM2 System No. Proc. Time/Iter.(secs) MFLOPS (Y-MP) Y-MP 1 1.18 250 8 0.16 1822 iPSC/860 64 2.42 122 CM-2 8K 9.75 30 16K 5.26 56 32K 2.70 109 Results for the BT Simulated CFD Application of NAS Benchmarks for Cray YMP, iPSC860 and CM2 System No. Proc. Time/Iter.(secs) MFLOPS (Y-MP) Y-MP 1 3.96 224 8 0.57 1554 iPSC/860 64 4.54 199 CM-2 16K 16.64 54 32K 9.57 94 Multidisciplinary Simulations: Structures, Propulsion,Controls, Acoustics Increase in memory and CPU requirements over baseline CFD simulation Discipline Memory Increase CPU Time Increase Structural Dynamics modal analysis x1 x2 FEM analysis x2 x2 thermal analysis x2 x2 Propulsion inlet/nozzle simulation x2 x2 engine performance deck x2 x2 combusion model, e.g. scamjet x4 x10-100 turbojet engine (full sim.) x10-100 x10-100 Controls control law integration x1 x1 control surface aerodynamics x2 x2 thrust vector control x2 x2 control jets x2 x2 Acoustics x10 x10 Numerical Optimization Design x2 x10-100 Base CFD Requirements for GigaFlops and Run-time Memory Megawords to give a 5 hour Execution Time and Increase needed for Multidisciplinary Simulations: Structures, Propulsion and Controls Mwords GFLOPS Base CFD 200 60 Structural thermal analysis X2 X2 Propulsion inlet/nozzle simulations X2 X2 engine performance deck X2 X2 Controls control law integration X1 X1 thrust vector control X2 X2 TOTAL 2000 600 Features of Navier Stokes Equations and role of (small) viscosity Simple Model CFD-like Equation in Dimensionless Form What sort of equations does CFD give ? Put x component of velocity u = v x and let r be density and p pressure Take the case of incompressible flow where the density of fluid is constant r ¶u/ ¶t + r ( v .Ñ) u = - ¶p/ ¶x + m Ñ 2u Make dimensionless with scaling transformations x ® x / L t ® t / T v ® v / V u ® u / V p ® p / ( r V2 ) The Reynolds Number R and Discussion of Interesting R and Viscosity Regimes Viscosity is "resistance" to flow Air has low viscosity Treacle has high viscosity Various Limits High Viscosity (Low Reynolds number) Low Viscosity (High Reynolds number) and each has Sample Equations Approximation levels for CFD (from Hirsch, Numerical Computation of Internal and External Flows, Wiley) What is so Strange about Large Reynolds Number? The second derivative Anomaly Laminar Flow Compared to Turbulent Flow Pictorially Eddy's, vortices etc produced in otherwise smooth flow. Happens near boundaries but vortices can be created at boundary but move off into "fluid volume". Why are boundaries important in the discontinuous limit of zero viscosity ? when viscosity m = 0 Boundary condition is that velocity must // to surface when m is nonzero Boundary condition is full v = 0 at surface (parallel and perpendicular components zero) Note: As equation goes from first to second order when m = 0, need an extra boundary condition Approximations to Navier Stokes Equations used in practical CFD Length scales and Averaging used in the Reynolds Averaged Equations or Reynolds Equation Very small length scales dL are present in "turbulent regions" maybe need to resolve a size dL ~ 10-3L If dL covered by 10 grid points then leads to 104 grid points in each linear dimension L which is impossible So "average" over fine length scales (~10-3 cm) and write a new set of macroscopic equations. Turbulence Modeling and the Nature of Reynolds Averaging in Continuum Physics Note: We have already averaged to get Navier-Stokes. There we used "fundamental physics" and 10-8 cm basic dL. ( actually this "fundamental average" averages over quantum effects over length scales of 10-13 cm ) So Reynolds averaging is a "new average" The Reynolds averaged equations need TURBULENCE MODELING done by mix of the theoretical analysis and experimental observations. The Reynolds Averaging Procedure at its simplest gives back the Navier-Stokes Equations with changed parameters (such as viscosity) and additional external force terms. These are estimated by turbulence modelling. The most sophisticated treatments add one or two additional differential equations to be solved. Euler's Equations Should Hold far from the Vehicle in Large Reynolds Number R Limit When R is large (small m) and quantities vary slowly (far from "aircraft"), then we can use Euler equations which put m=0 in Navier-Stokes equation. Even these equations are nontrival and can be either be elliptic or parabolic Euler's equations can lead to potential flow because Large R Region - Boundary Layer Analysis To Extrapolate from Euler Equation Regime to the Boundary Inviscid Euler Equation outside boundary layer Importance of Boundary Layer in Computation of Drag Calculation of Drag - needed by aircraft manufacturers such as Boeing to maximize speed and fuel efficiency of aircraft. Requires understanding of boundary layer as this governs force on aircraft ! Either "direct simulation of turbulence" (i.e. full Navier-Stokes equations) or accurate approximate (i.e. model turbulence) methods are needed. At present They cannot accurrately calculate absolute size of drag They can compare different designs to see which has smaller drag Approximations used in derivation of Thin-Layer and Parabolized Navier-Stokes Equations These are derived from full NS (Navier-Stokes) equations with a set of approximations. Boundary Layer = "leading order 1/R1/2 " Thin Layer and PNS are more accurate expansions in 1/R1/2 PNS drops ¶/¶(flow direction) viscous stress terms TLNS drops these derivatives in both surface directions High Viscosity Limit: Stokes Equation and its Steady and Unsteady Forms Euler's Equation and its Solution by Potential Methods The Burger's Equation: A One Dimensional Approximation to the Navier Stokes Equations which Neglects Pressure Gradients Viscous Burger's Equation Inviscid Burger's Equation General Issues in CFD Relative Role of Computer Scientists and CFD(Aerospace Engineers) or PDE Domain Experts The appropriate approximation scheme clearly requires sophisticated expertise. Also a given problem could well imply mixing different solution methods and joining them at boundary. Here the physicist must be involved. The computational scientist needs to provide physicists with a set of "tools" Choice of Discretization Methods grid generator PDE solvers for various types etc. This is the PDE Toolkit or Problem Solving Environment which we are trying to develop for CFD and Numerical Relativity as part of NSF Grand Challenge Computational Issues in PDE Solution in CFD and Related Fields Method of Discretization Time: Explicit, Implicit Space Finite Difference Finite Volume Finite Element Grid Generation Solvers: Direct Basic Iterative Preconditioners Multigrid Domain Decomposition