Basic Aspects of Discretization

Similar documents
8. Introduction to Computational Fluid Dynamics

Basics of Discretization Methods

Finite Difference Methods for

5. FVM discretization and Solution Procedure

Partial Differential Equations

Introduction to numerical schemes

ME Computational Fluid Mechanics Lecture 5

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 13

Scientific Computing: An Introductory Survey

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Introduction to Computational Fluid Dynamics

PDE Solvers for Fluid Flow

Tutorial 2. Introduction to numerical schemes

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

2.29 Numerical Fluid Mechanics Fall 2009 Lecture 13

A Study of Transonic Flow and Airfoils. Presented by: Huiliang Lui 30 th April 2007

FINITE VOLUME METHOD: BASIC PRINCIPLES AND EXAMPLES

Finite Difference Methods (FDMs) 2

Draft Notes ME 608 Numerical Methods in Heat, Mass, and Momentum Transfer

Partial differential equations

The Finite Difference Method

Numerical methods for the Navier- Stokes equations

Additive Manufacturing Module 8

Partial Differential Equations

Chapter 1. Introduction to Nonlinear Space Plasma Physics

General Solution of the Incompressible, Potential Flow Equations

Self-similar solutions for the diffraction of weak shocks

Classification of partial differential equations and their solution characteristics

Module 3: BASICS OF CFD. Part A: Finite Difference Methods

FDM for parabolic equations

Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur

2.2. Methods for Obtaining FD Expressions. There are several methods, and we will look at a few:

Lecture 4: Numerical solution of ordinary differential equations

PDEs, part 1: Introduction and elliptic PDEs

CS 542G: The Poisson Problem, Finite Differences

Is My CFD Mesh Adequate? A Quantitative Answer

Preliminary Examination in Numerical Analysis

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Chapter 5 Types of Governing Equations. Chapter 5: Governing Equations

Notes for Lecture 10

Introduction to Heat and Mass Transfer. Week 9

Lecture 4.2 Finite Difference Approximation

HIGH-ORDER ACCURATE METHODS BASED ON DIFFERENCE POTENTIALS FOR 2D PARABOLIC INTERFACE MODELS

Finite Difference Methods for Boundary Value Problems

Intro to Research Computing with Python: Partial Differential Equations

Numerical Solutions to Partial Differential Equations

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

12 The Heat equation in one spatial dimension: Simple explicit method and Stability analysis

2.20 Fall 2018 Math Review

Partial Differential Equations II

Efficient solution of stationary Euler flows with critical points and shocks

Finite Difference Methods (FDMs) 1

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 9

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Introduction to Partial Differential Equations

Marching on the BL equations

Finite Differences: Consistency, Stability and Convergence

SOE3213/4: CFD Lecture 3

Open boundary conditions in numerical simulations of unsteady incompressible flow

A Study on Numerical Solution to the Incompressible Navier-Stokes Equation

Parabolic Flow in Parallel Plate Channel ME 412 Project 4

HIGH-ORDER ACCURATE METHODS BASED ON DIFFERENCE POTENTIALS FOR 2D PARABOLIC INTERFACE MODELS

PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9.

Local Time Step for a Finite Volume Scheme I.Faille F.Nataf*, F.Willien, S.Wolf**

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

Partial Differential Equations

Lecture 16: Relaxation methods

7 Hyperbolic Differential Equations

Project 4: Navier-Stokes Solution to Driven Cavity and Channel Flow Conditions

A very short introduction to the Finite Element Method

Solution Methods. Steady State Diffusion Equation. Lecture 04

Practical in Numerical Astronomy, SS 2012 LECTURE 9

Numerical Solution Techniques in Mechanical and Aerospace Engineering

AE/ME 339. K. M. Isaac. 9/22/2005 Topic 6 FluidFlowEquations_Introduction. Computational Fluid Dynamics (AE/ME 339) MAEEM Dept.

Chapter 5 FINITE DIFFERENCE METHOD (FDM)

Computation Fluid Dynamics

Lecture 5: Single Step Methods

The method of lines (MOL) for the diffusion equation

Lecture Notes on Numerical Schemes for Flow and Transport Problems

NUMERICAL SOLUTION OF ODE IVPs. Overview

Chapter 3. Finite Difference Methods for Hyperbolic Equations Introduction Linear convection 1-D wave equation

FUNDAMENTALS OF FINITE DIFFERENCE METHODS

Block-Structured Adaptive Mesh Refinement

Reading: P1-P20 of Durran, Chapter 1 of Lapidus and Pinder (Numerical solution of Partial Differential Equations in Science and Engineering)

Finite difference methods for the diffusion equation

A Hybrid Method for the Wave Equation. beilina

In this chapter we study elliptical PDEs. That is, PDEs of the form. 2 u = lots,

Review for Exam 2 Ben Wang and Mark Styczynski

2. Getting Ready for Computational Aerodynamics: Fluid Mechanics Foundations

Foliations of hyperbolic space by constant mean curvature surfaces sharing ideal boundary

Zonal modelling approach in aerodynamic simulation

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

Elliptic Problems / Multigrid. PHY 604: Computational Methods for Physics and Astrophysics II

difference operators.

Lecture 3: Hamilton-Jacobi-Bellman Equations. Distributional Macroeconomics. Benjamin Moll. Part II of ECON Harvard University, Spring

2.3. Quantitative Properties of Finite Difference Schemes. Reading: Tannehill et al. Sections and

Numerical Methods I Solving Nonlinear Equations

Before we look at numerical methods, it is important to understand the types of equations we will be dealing with.

Transcription:

Basic Aspects of Discretization

Solution Methods Singularity Methods Panel method and VLM Simple, very powerful, can be used on PC Nonlinear flow effects were excluded Direct numerical Methods (Field Methods) Finite difference approach Direct numerical solution of differential equations Finite volume approach Direct approximations to the integral form of the governing equations

Area of CFD Grid generation Flowfield discretization algorithms Efficient solution of large systems of equations Massive data storage and transmission technology methods Computational flow visualization

Outline Approximations to partial derivatives Finite difference representation of Partial Differential Equations Discretization Consistency Stability Convergence Explicit and implicit approaches The finite volume technique Boundary conditions Stability analysis

Approximations to partial derivatives Mathematic basis Taylor series expansions 2 2 3 3 df ( x) d f ( x) d f 0 0 2 3 x 2 6 x x f( x + x) = f( x ) + x + + + dx dx dx 0 0 0

The ways to obtain finite difference representations of derivatives Forward difference Backward difference Central difference

Forward difference first order accurate one-sided difference approximation 2 2 3 3 df ( x) d f ( x) d f 0 0 2 3 x 2 6 x x f( x + x) = f( x ) + x + + + dx dx dx 0 0 0 df f( x + x) f( x ) 1 dx x dx x 2 0 0 d f = x 2 2 x 0 0 df dx x 0 f( x + x) f( x ) x O( x) 0 0 = + Truncation Error

Backward difference 2 2 3 3 df ( x) d f ( x) d f 0 0 2 3 x 2 6 x x f( x x) = f( x ) x + + dx dx dx 0 0 0 df dx x 0 f( x x) f( x ) x O( x) 0 0 = + first order accurate one-sided difference approximation

Central difference 2 2 3 3 df ( x) d f ( x) d f 0 0 2 3 x 2 6 x x f( x + x) = f( x ) + x + + + dx dx dx 0 0 0 2 2 3 3 df ( x) d f ( x) d f 0 0 2 3 x 2 6 x x f( x x) = f( x ) x + + dx dx dx 0 0 0 3 3 df ( x) d f 0 0 3 x 3 f( x + x) f( x x) =+ 2 x + + dx dx 0 0 x df dx x 0 f( x + x) f( x x) 2 x 0 0 = + O( x) 2 Second order accurate Two-sided difference approximation

The finite difference approximation to the second derivative Adding the Taylor series expressions for the forward and backward expansions results in the following expression. d f f( x+ x ) + f( x x) = 2 f( x ) + ( x) + O( x) 2 2 4 0 0 0 2 dx x 0 2 d f 0 0 0 2 2 dx ( x) x 0 f( x + x) 2 f( x ) + f( x x) = + O( x) 2

Shorthand Notation Nomenclature for use in partial differential equation difference expressions

Shorthand Notation f fi+ 1, j f = i, j + O( x) x x 1st order forward difference f fi, j fi 1, j = + O( x) x x 1st order backward difference f fi+ 1, j f = i 1, j + 2 O( x) x 2 x 2nd order central difference 2 f x f 2 f + f = + O( x) 2nd order central difference ( x) i+ 1 i, j i 1, j 2 2 2

Finite difference representation of Partial Differential Equations Steps and Requirements to Obtain a Valid Numerical Solution

On the selection of a finite difference approximation Depends on the physics of the problem being studied Any scheme that fails to represents the physics correctly will fail when you attempt to obtain a solution Connection between grid points used in numerical method and equation type

Example of Finite difference representation of PDE Heat equation u t 2 u = α 2 x Using a forward difference in time, and a central difference in space Grid nomenclature for discretization

Discussion on Steps of Numerical Solution Discretization Consistency Stability Convergence

Discretization This is the process of replacing derivatives by finite difference approximations. This introduces an error due to the truncation error arising from the finite difference approximation and any errors due to treatment of BC s. The size of the truncation error will depend locally on the solution. In most cases we expect the discretization error to be larger than round-off error.

Consistency A finite-difference representation of a PDE is consistent if the difference between the PDE and its difference representation vanishes as the mesh is refined, i.e., Consider a case where the truncation error is O( t / x). In this case we must let the mesh go to zero just such that:

Stability A stable numerical scheme is one for which errors from any source (round-off, truncation) are not permitted to grow in the sequence of numerical procedures as the calculation proceeds from one marching step, or iteration, to the next, thus: errors grow unstable errors decay stable Comments Stability is normally thought of as being associated with marching problems Stability requirements often dictate allowable step sizes In many cases a stability analysis can be made to define the stability requirements.

Convergence The solution of the FDE s should approach the solution of the PDE as the mesh is refined. Lax Equivalence Theorem (linear, initial value problem): For a properly posed problem, with a consistent finite difference representation, stability is the necessary and sufficient condition for convergence. In practice, numerical experiments must be conducted to determine if the solution appears to be converged with respect to mesh size.

Two Different Approaches There are many difference techniques used in CFD, you will find that any technique falls into one or the other of following two different general approaches: Explicit approach Implicit approach

Explicit Scheme Heat equation u t 2 u = α 2 x Finite difference equation u n+ 1 i u t n i α = + ( x) ( n 2 n n u ) 2 i+ 1 ui ui 1 The solution at time step n is known. At time n+1 there is only one unknown.

Grid points used in typical explicit calculation the value of u at i and the n+1 time step: n+ 1 n α t ( n 2 n n u ) i = ui + u 2 i+ 1 ui + ui 1 ( x) we can solve for each new value explicitly without solving a system of equations in terms of known values from the previous time step.

Discussions on explicit scheme Advantages: Relative simple to set up and program This scheme is easily vectorized and a natural for massively parallel computation Disadvantage: Stability requirements require very small steps sizes

Implicit Scheme Grid points used in typical implicit calculation The finite difference representation u n+ 1 i u t n i α = + ( x) ( n+ 1 2 n+ 1 n+ 1 u ) 2 i+ 1 ui ui 1 we need to find the values along n+1 simultaneously.

This leads to a system of algebraic equations that must be solved. Defining n+ 1 i The finite difference equation became: u u t n i α = + ( x) ( n+ 1 2 n+ 1 n+ 1 u ) 2 i+ 1 ui ui 1

The approach that leads to the formulation of a problem requiring the simultaneous solution of a system of equations is known as an implicit scheme. Advantage: Stability requirements allow a large step size Disadvantages: More complicated to set up and program This scheme is harder to vectorize or parallelize Since the solution of a system of equations is required at each step, the computer time per step is much larger than in the explicit approach.

Example - Elliptic PDE Using Laplace s equation as the model problem φ xx + φ yy = 0 Grid points used in a typical representation of an elliptic equation

Use the second order accurate central difference formulas at i,j: 2 2 1,, 1, ) ( ) ( 2 x O x j i j i j i xx + + = + φ φ φ φ 2 2 1,, 1, ) ( ) ( 2 y O y j i j i j i yy + + = + φ φ φ φ 0 ) ( 2 ) ( 2 2 1,, 1, 2 1,, 1, = + + + + + y x j i j i j i j i j i j i φ φ φ φ φ φ If x = y, solve this equation for φ ij : ( 1 ), 1, 1, 1, 4 1, + + + + + = j i j i j i j i j i φ φ φ φ φ

φ 1 i, j = 4 i+ 1, j i 1, j i, j+ 1 + i, j ( φ + φ + φ φ 1 ) This expression illustrates the essential physics of flows governed by elliptic PDE s: φ ij depends on all the values around it all values of φ must be found simultaneously computer storage requirements are much greater than those required for parabolic and hyperbolic PDE s

Solution schemes Because of the large number of mesh points, it is generally not practical to solve the system of equations Instead, an iterative procedure is usually employed. Initial guess for the solution is made and then each mesh point in the flow field is updated repeatedly until the values satisfy the governing equation. This iterative procedure can be thought of as having a time-like quality

A Note on Conservation Form Care must be taken if the flow field has discontinuities (shocks) The correct solution of the partial differential equation will only be obtained if the conservative forms of the governing equations are used. 2D steady x-momentum equation the classical standard forms the conservative forms

The Finite Volume Technique Each conservation law had both differential and integral statements. The integral form is more fundamental, not depending on continuous partial derivatives. The finite volume method discretize the the integral form of the equations.

Example of Finite Volume Approach Conservation of mass in the integral statement t ρdv Introducing the specific notation and assuming 2-D flow, the conservation law can be rewritten as: t qdv Where H=( F, G) = ρv, q = ρ = ρvn i ds + HindS = H x = F = ρu, H y = G = ρv 0

Basic nomenclature for finite volume analysis Using the definition of n in Cartesian coordinates, and considering for illustration the Cartesian system given above along AB, n = -j, ds = dx, and: H n dx = - Gdx along BC, n = i, ds = dy, and: H n dy = Fdy in general: H n ds = Fdy- Gdx

Define the quantities over each face (AB) : Using the general grid the integral statement, can be written as: dv + ds = 0 t q Hin Similarly for faces BC, CD and AD t ( Aq ) + ( F y G x) = 0 jk, DA AB Here A is the area of the quadrilateral ABCD, and q i,j is the average value of q over ABCD.

Assuming A is not a function of time, and combining: Along AB Along BC Along CD Along DA

Supposing the grid is regular Cartesian as shown above. Then A = x y, and along:

Comments on Finite Volume Method Differences between finite difference and finite volume method Finite difference Approximates the governing equation at a point Finite difference methods were developed earlier, the analysis of methods is easier and further developed Finite volume Approximates the governing equation over a volume Finite volume is the most physical in fluid mechanics codes, and is actually used in most codes.

Comments on Finite Volume Method The advantages of the finite volume method Good conservation of mass, momentum, and energy using integrals when mesh is finite size Easier to treat complicated domains integral discretization [averaging] easier to figure out, implement, and interpret Average integral concept much better approach when the solution has shock waves (i.e. the partial differential equations assume continuous partial derivatives).

Boundary Conditions We have obtained expressions for interior points on the mesh. What about expressions for points on the boundary? Far-field BC Near-field BC

Handle the Far-field BC (1) Go out far enough and set φ = 0 for φ 0, as the distance from the body goes to infinity Advantage Simple and frequently used Disadvantage Require excessive use of grid points in regions where we normally aren t interested in the details of the solution.

Handle the Far-field BC (2) Transform the equation to another coordinate system, and satisfy the boundary condition explicitly at infinity

Handle the Far-field BC (3) Blocks of Grids The grid points are used efficiently in the region of interest. a dense inner grid a coarse outer grid. Adaptive Grid The grid will adjust automatically to concentrate points in regions of large flow gradients.

Handle the Far-field BC (4) Match the numerical solution to an analytic approximation for the farfield boundary condition. The boundary numerical solution reflects the correct physics at the boundary It allows the outer boundary to be placed at a reasonable distance from the body, and properly done. Particularly important in the solution of the Euler equations. Effort is still underway to determine the best way to implement this approach.

Handle the Far-field BC Comments BC s on the FF boundary are important, and can be especially important for Euler codes which march in time to a steady state final solution. How to best enforce the FF BC is still under study - research papers are still being written describing new approaches. 0 0 0 = + + + + = + + + + = + + + + z p z w w y w v x w u t w y p z v w y v v x v u t v x p z u w y u v x u u t u ρ ρ ρ

Handle the Near-field BC (1) Using a standard grid and allow the surface to intersect grid lines in an irregular manner

Handle the Near-field BC (2) Using the surface of the body as a coordinate surface Body conforming grid for easy application of BCs on curved surfaces

Handle the Near-field BC (3) Using thin airfoil theory boundary conditions Approximate approach to boundary condition specification

Finite difference representation of the BC's (1) Using Laplace s Equation as an example φ xx + φ yy = 0 Two types of boundary conditions associated with the boundary: The Dirichlet problem The value φ on the boundary is simply specified, and no special difference formulas are required. The Neumann problem φ/n is specified, and special difference formulas are required.

Finite difference representation of the BC's (2) The normal velocity, v, is zero at the outer boundary Dummy Row Outer Boundary The required boundary condition at j = NY is: The equations are then solved up to Y NY, and whenever you need φ at NY+1, simply use the value at NY-1.

Finite difference representation of the BC's (3) Thin airfoil theory boundary conditions at the surface ( nondimensionalized by U ) Dummy Row Using central differences at j =2

Introduction Stability Analysis In many cases some finite difference representation proved impossible to obtain solutions. Frequently the reason was the choice of an inherently unstable numerical algorithm. In this section we present one of the classical approaches to the determination of stability criteria for use in CFD. These types of analysis provide insight into grid and step size requirements Step size : time steps Grid size : spatial size

Von Neumann Stability Analysis for parabolic equation (heat equation) Assume at t = 0, that an error, possibly due to finite length arithmetic, is introduced in the form: Using the explicit finite difference representation

Substitute Eq. (1) into (2), and solve for ψ (t + t)