Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE]

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

Lecture Notes on Numerical Schemes for Flow and Transport Problems

Lecture Notes on Numerical Schemes for Flow and Transport Problems

HOMEWORK 4: Numerical solution of PDEs for Mathmatical Models, Analysis and Simulation, Fall 2011 Report due Mon Nov 12, Maximum score 6.0 pts.

Finite Difference Methods for Boundary Value Problems

Numerical Hydraulics

Finite difference methods for the diffusion equation

Finite difference method for elliptic problems: I

Finite Volume Method

FINITE VOLUME METHODS FOR ONE-DIMENSIONAL SCALAR CONSERVATION LAWS

Numerical Methods for PDEs

Tutorial 2. Introduction to numerical schemes

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

7 Hyperbolic Differential Equations

Advection / Hyperbolic PDEs. PHY 604: Computational Methods in Physics and Astrophysics II

A positivity-preserving high order discontinuous Galerkin scheme for convection-diffusion equations

Math 660-Lecture 23: Gudonov s method and some theories for FVM schemes

FDM for parabolic equations

Chapter 10 Exercises

ENO and WENO schemes. Further topics and time Integration

Space-time XFEM for two-phase mass transport

Numerical Methods for Conservation Laws WPI, January 2006 C. Ringhofer C2 b 2

Info. No lecture on Thursday in a week (March 17) PSet back tonight

Introduction to numerical schemes

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

Math 46, Applied Math (Spring 2008): Final

The method of lines (MOL) for the diffusion equation

FDM for wave equations

Numerical Solution Techniques in Mechanical and Aerospace Engineering

Scientific Computing: An Introductory Survey

Positivity-preserving high order schemes for convection dominated equations

DOING PHYSICS WITH MATLAB WAVE MOTION

Outline. 1 Boundary Value Problems. 2 Numerical Methods for BVPs. Boundary Value Problems Numerical Methods for BVPs

Selected HW Solutions

Bound-preserving high order schemes in computational fluid dynamics Chi-Wang Shu

Finite Volume Schemes: an introduction

25 Self-Assessment. 26 Eigenvalue Stability for a Linear ODE. Chapter 7 Eigenvalue Stability

Applied Math Qualifying Exam 11 October Instructions: Work 2 out of 3 problems in each of the 3 parts for a total of 6 problems.

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

Lecture 17: Initial value problems

Numerical Solutions to Partial Differential Equations

30 crete maximum principle, which all imply the bound-preserving property. But most

Chapter 9 Implicit Methods for Linear and Nonlinear Systems of ODEs

AMS 212A Applied Mathematical Methods I Lecture 14 Copyright by Hongyun Wang, UCSC. with initial condition

2 2 + x =

Finite Difference Method

Introduction to Differentials

The one-dimensional equations for the fluid dynamics of a gas can be written in conservation form as follows:

Lecture 42 Determining Internal Node Values

PDEs in Image Processing, Tutorials

13 PDEs on spatially bounded domains: initial boundary value problems (IBVPs)

MATH 6B Spring 2017 Vector Calculus II Study Guide Final Exam Chapters 8, 9, and Sections 11.1, 11.2, 11.7, 12.2, 12.3.

Strauss PDEs 2e: Section Exercise 1 Page 1 of 6

Curved grid generation and DG computation for the DLR-F11 high lift configuration

Numerical Analysis Comprehensive Exam Questions

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES)

An Introduction to the Discontinuous Galerkin Method

Scientific Computing I

PDE Solvers for Fluid Flow

h(x) lim H(x) = lim Since h is nondecreasing then h(x) 0 for all x, and if h is discontinuous at a point x then H(x) > 0. Denote

Fixed point iteration and root finding

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

A review of stability and dynamical behaviors of differential equations:

A Very Brief Introduction to Conservation Laws

The Discontinuous Galerkin Method for Hyperbolic Problems

5. FVM discretization and Solution Procedure

A High-Order Discontinuous Galerkin Method for the Unsteady Incompressible Navier-Stokes Equations

Convergence and Error Bound Analysis for the Space-Time CESE Method

AM 205: lecture 14. Last time: Boundary value problems Today: Numerical solution of PDEs

The Fast Sweeping Method. Hongkai Zhao. Department of Mathematics University of California, Irvine

Discontinuous Galerkin Methods

Comparison of Approximate Riemann Solvers

LibMesh Experience and Usage

LibMesh Experience and Usage

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

Part 1. The diffusion equation

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

Finite Difference Methods for

Fundamentals Physics

Basic Aspects of Discretization

AProofoftheStabilityoftheSpectral Difference Method For All Orders of Accuracy

Question 9: PDEs Given the function f(x, y), consider the problem: = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1. x 2 u. u(x, 0) = u(x, 1) = 0 for 0 x 1

Numerical Solutions to PDE s

Finite difference method for heat equation

Math 4263 Homework Set 1

Examples of the Fourier Theorem (Sect. 10.3). The Fourier Theorem: Continuous case.

Generalised Summation-by-Parts Operators and Variable Coefficients

Power Series and Analytic Function

Numerical Solutions to Partial Differential Equations

Partitioned Methods for Multifield Problems

2 A brief interruption to discuss boundary value/intial value problems

Well-balanced central finite volume methods for the Ripa system

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

BTCS Solution to the Heat Equation

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

Finite Difference and Finite Element Methods

AN OPTIMALLY ACCURATE SPECTRAL VOLUME FORMULATION WITH SYMMETRY PRESERVATION

Math 46, Applied Math (Spring 2009): Final

Numerical Solutions to Partial Differential Equations

Semi-Lagrangian Formulations for Linear Advection Equations and Applications to Kinetic Equations

Transcription:

Chapter 6 Finite Volume Methods In the previous chapter we have discussed finite difference methods for the discretization of PDEs. In developing finite difference methods we started from the differential form of the conservation law and approximated the partial derivatives using finite difference approximations. In the finite volume method we will work directly with the integral form of the conservation law 75. 57 Self-Assessment Before reading this chapter, you may wish to review... Integral form of conservation laws Convection Equation Upwinding 3 After reading this chapter you should be able to... Understand the difference between finite difference and finite volume methods Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE] 58 Finite Volume Method in -D The basis of the finite volume method is the integral conservation law. The essential idea is to divide the domain into many control volumes (or cells) and approximate the integral conservation law on each of the control volumes. Figure 8 shows an example of a partition of a one-dimensional domain into cells. By convention cell i lies between the points x i and x i+. (Notice that the cells do not need to be of equal size.) i i i+ N x x x 3 x i x i+ x Nx x Nx+ Fig. 8 Mesh and notation for one-dimensional finite volume method. Recall the integral form of the conservation law (i.e. Equation 75). The one-dimensional form of Equation 75 is 89

U U i U i U i+ U Nx 90 d xr xr U dx+ F(U) xr F(U) xl = S(U,t)dx. () x L x L Thus, applying this to control volume i gives, and for now assuming S=0, Next, we define the mean value of U in control volume i as, Then, Equation becomes, d xi+ U dx+ F(U) xi+ F(U) xi = 0. () x i U i xi+ U dx, where x i x x i+ x i x i. (3) i x i du i + F(U) xi+ F(U) xi = 0. (4) At this point, no approximations have been made thus Equation 4 is exact. Now, we make the first approximation. Specifically, we assume that the solution in each control volume is constant, U(x,t)= U i (t) for x i < x<x i+. (5) Thus, the finite volume approximation will be piecewise constant as shown in Figure 9. x x 3 x i x i+ x Nx x Nx+ Fig. 9 Piecewise constant solution for one-dimensional finite volume method. With this assumed form of the solution, the next issue is to determine the flux at x i± at time t. Notice that the finite volume approximation is discontinuous at the interface between any two cells. Namely, as we approach x i+ from the left our numerical solution gives lim ε 0 U(t) xi+ +ε = U i (t), but if we approach from the right then we have lim ε 0 + U(t) xi+ +ε = U i+ (t). In order for our numerical scheme to be successful we must ensure that the numerical flux we use is consistent with the behavior of the underlying PDE problem. In particular we want to choose F as the instantaneous flux obtained from solving the conservation law exactly with initial condition at time t corresponding to our numerical approximation. Consider first the case of one-dimensional convection equation. Recall from Chapter that the solution convects with velocity u(t). Thus, for the initial instant after t (which we denote as t + = t+ ε where ε is an infinitesimal, positive number): { U(x i+,t + Ui (t) if u(t)>0 )= U i+ (t) if u(t)<0 (6) The corresponding flux can be calculated directly from this value of U,

9 { F(x i+,t + u(t)ui (t) if u(t)>0 )= u(t)u i+ (t) if u(t)<0 (7) An alternative way to write this flux which is valid regardless of the sign of u(t) is, F(x i+,t + )= u(t)(u i+(t)+u i (t)) u(t) (U i+(t) U i (t)). (8) This flux, which uses the upstream value of U to determine the flux, is known as an upwind flux. The final step in arriving at a full-discrete approximation for one-dimensional convection is to discretize Equation 4 in time. This can be done choosing any of the ODE integration methods we studied previously. For simplicity, we choose the forward Euler method so that the final fully-discrete form of the finite volume method is, where we use the notation, Ui n+ x i t F n i+ = un( U n U n i i+ +Un i + F n i+ F n i = 0, (9) ) un ( U n i+ Un i ). (30) Example (Finite Volume Method applied to -D Convection). The following Matlab script solves the one-dimensional convection equation using the finite volume algorithm given by Equation 9 and 30. The problem is assumed to be periodic so that whatever leaves the domain at x=x R re-enters it at x=x L. % This Matlab script solves the one-dimensional convection % equation using a finite volume algorithm. The 3 % discretization forward Euler in time. 4 5 clear all; 6 close all; 7 8 % Number of points 9 Nx = 50; 0 x = linspace(0,,nx+); dx = /Nx; 3 % Calculate midpoint values of x in each control volume 4 xmid = 0.5*(x(:Nx) + x(:nx+)); 5 6 % Set velocity 7 u = ; 8 9 % Set final time 0 tfinal = ; % Set timestep 3 CFL = 0.5; 4 = CFL*dx/abs(u); 5 6 % Set initial condition to U0 = exp(-xˆ) 7 % Note: technically, we should average the initial 8 % distribution in each cell but I chose to just set 9 % the value of U in each control volume to the midpoint 30 % value of U0. 3 U = 0.75*exp(-((xmid-0.5)/0.).ˆ)'; 3 t = 0; 33 34 % Loop until t > tfinal 35 while (t < tfinal), 36

9 37 Ubc = [U(Nx); U; U()]; % This enforces the periodic bc 38 39 % Calculate the flux at each interface 40 F = 0.5* u *( Ubc(:Nx+) + Ubc(:Nx+))... 4-0.5*abs(u)*( Ubc(:Nx+) - Ubc(:Nx+)); 4 43 % Calculate residual in each cell 44 R = F(:Nx+) - F(:Nx); 45 46 % Forward Euler step 47 U = U - (/dx)*r; 48 49 % Increment time 50 t = t + ; 5 5 % Plot current solution 53 stairs(x,[u; U(Nx)]); 54 axis([0,, -0.5,.5]); 55 grid on; 56 drawnow; 57 58 end 59 60 % overlay exact solution 6 U = 0.75*exp(-((xmid-0.5)/0.).ˆ)'; 6 hold on; 63 stairs(x,[u; U(Nx)], 'r-'); 58. Finite Volume Method in -D The finite volume discretization can be extended to higher-dimensional problems. Suppose the physical domain is divided into a set of triangular control volumes, as shown in Figure 30. Application of Equation 75 to control volume C A B 3 D Fig. 30 Triangular mesh and notation for finite volume method.

93 A gives, d U da+ F(U) nds= S(U,t)dA, (3) Ω A Ω A Ω A where Ω A is the interior and Ω A is the boundary of control volume A. As in the one-dimensional case, we define the cell average, where A A is the area of control volume A. Thus, Equation 3 becomes, A A du A U A U da, (3) A A Ω A + F(U) nds= S(U,t)dA. (33) Ω A Ω A In the case of convection, we again assume S=0. Also, we expand the surface integral into the contributions for the three edges, A A du A 3 + H(U,n AB )ds+ H(U,n AC )ds+ H(U,n AD )ds=0, (34) 3 where H(U,n)=F(U) n and n AB is the unit normal pointing from cell A to cell B, and similarly for n AC and n AD. As in one-dimensional case, we assume that the solution everywhere in the control volume is equal to the cell average value. Finally, the flux at each interface is determined by the upwind value using the velocity component normal to the face. For example, at the interface between cell A and B, H(U,n AB ) Ĥ(U A,U B,n AB ) v AB n AB (U B +U A ) v AB n AB (U B U A ), (35) where v AB is the velocity between the control volumes. Thus, when v AB n AB > 0, the flux is determined by the state from cell A, i.e. U A. Likewise, when v AB n AB < 0, the flux is determined by the state from cell B, i.e. U B. The velocity, v AB is usually approximated as the velocity at the midpoint of the edge (note: v can be a function of x in two-dimensions even though the velocity is assumed to be divergence free, i.e. u x + v = 0). We use the notation Ĥ y to indicate that the flux is an approximation to the true flux when v is not constant. Thus, the finite volume algorithm prior to time discretization would be given by, A A du A + Ĥ(U A,U B,n AB ) s AB + Ĥ(U A,U C,n AC ) s AC + Ĥ(U A,U D,n AD ) s AD = 0. (36) The final step is to integrate in time. As in the one-dimensional case, we might use a forward Euler algorithm which would result in the final fully discrete finite volume method, UA n+ UA n A A + Ĥ(UA n t,u B,n n AB ) s AB + Ĥ(UA n,u C n,n AC) s AC + Ĥ(UA n,u D,n n AD ) s AD = 0. (37) Example (Finite Volume Method for -D Convection on a Rectangular Mesh). The following Matlab script solves the two-dimensional convection equation using a two-dimensional finite volume algorithm on rectangular cells. The algorithm is the extension of Equation 37 from triangular to rectangular cells. The problem is assumed to be periodic and have a constant velocity. % This Matlab script solves the one-dimensional convection % equation using a finite volume algorithm. The 3 % discretization forward Euler in time. 4 5 clear all; 6 close all;

94 7 8 % Number of points 9 Nx = 50; 0 x = linspace(0,,nx+); dx = /Nx; 3 % Calculate midpoint values of x in each control volume 4 xmid = 0.5*(x(:Nx) + x(:nx+)); 5 6 % Set velocity 7 u = ; 8 9 % Set final time 0 tfinal = ; % Set timestep 3 CFL = 0.5; 4 = CFL*dx/abs(u); 5 6 % Set initial condition to U0 = exp(-xˆ) 7 % Note: technically, we should average the initial 8 % distribution in each cell but I chose to just set 9 % the value of U in each control volume to the midpoint 30 % value of U0. 3 U = 0.75*exp(-((xmid-0.5)/0.).ˆ)'; 3 t = 0; 33 34 % Loop until t > tfinal 35 while (t < tfinal), 36 37 Ubc = [U(Nx); U; U()]; % This enforces the periodic bc 38 39 % Calculate the flux at each interface 40 F = 0.5* u *( Ubc(:Nx+) + Ubc(:Nx+))... 4-0.5*abs(u)*( Ubc(:Nx+) - Ubc(:Nx+)); 4 43 % Calculate residual in each cell 44 R = F(:Nx+) - F(:Nx); 45 46 % Forward Euler step 47 U = U - (/dx)*r; 48 49 % Increment time 50 t = t + ; 5 5 % Plot current solution 53 stairs(x,[u; U(Nx)]); 54 axis([0,, -0.5,.5]); 55 grid on; 56 drawnow; 57 58 end 59 60 % overlay exact solution 6 U = 0.75*exp(-((xmid-0.5)/0.).ˆ)'; 6 hold on; 63 stairs(x,[u; U(Nx)], 'r-');

95 58. Finite Volume Method for Nonlinear Systems The basic finite volume approach can be extended to nonlinear systems of equations such as the Euler equations (see Example ). The main issue in this extension is how to calculate an upwind flux when there is a system of equations. In one dimension, the basic finite volume discretization remains the same as given by Equation 30, Ui n+ x i t U n i + F n i+ F n i = 0. (38) The flux, however, must upwind (to some degree) all of the states in the equation. One relatively simple way in which this can be done is using what is known as the local Lax-Friedrichs flux. In this case, the flux is given by, F i+ (U i,u i+ )= [F(U i+)+f(u i )] s max(u i+ U i ), (39) where s max is the maximum speed of propagation of any small disturbance for either state U i or U i+. Example 3 (Lax-Friedrichs Flux for -D Euler Equations). For the one-dimensional Euler equations, there are three equations which are approximated, i.e. conservation of mass, conservation of x-momentum, and conservation of energy. A small perturbation analysis can be performed which shows that the three speeds of propagation for this set of equations are u, u a, and u+a where u is the flow velocity and a is the speed of sound. Thus, the maximum speed will always be u +a and the corresponding value of s max for the Lax-Friedrichs flux is, s max = max( u i + a i, u i+ + a i+ ). (40)