Example application – Finite Volume Discretization Numerical Methods for PDEs Spring 2007 Jim E. Jones
Flow in porous media Darcy’s Law: experimentally derived law relating flow velocity to pressure drop Conservation Law: Net flow is balanced by source/sinks
Putting together yields pressure equation If K is constant Can solve like programming assignment #1 Use finite difference discretization Solve linear system using Gauss-Seidel Solving the pressure equation for porous media flow
Finite Volume discretization: an alternative to finite differences Construct a dual grid by cutting each grid line. h
Finite Volume discretization: an alternative to finite differences h Construct a dual grid by cutting each grid line.
Finite Volume discretization equations p i,j p i-1,j Each unknown lies at the center of a cell on the dual grid.
Finite Volume discretization equations p i,j p i-1,j Get an equation for i,j by integrating the PDE over the volume V i,j
Divergence Theorem V S The volume integral of the divergence of a vector field is equal to the surface integral of its component in the normal direction
Finite Volume discretization equations p i,j p i-1,j Apply divergence theorem. V i,j
Finite Volume discretization equations p i,j p i-1,j V i,j
Finite Volume discretization equations p i,j p i-1,j V i,j Length of boundary = h
Finite Volume discretization equations p i,j p i-1,j V i,j
Finite Volume discretization equations p i,j p i-1,j V i,j
Finite Volume discretization equations p i,j p i-1,j Get an equation for i,j by integrating the PDE over the volume V i,j
Finite Volume discretization equations p i,j p i-1,j Get an equation for i,j by integrating the PDE over the volume V i,j Integrating source term over the volume
Quick Check: what if K=1? Same as finite differences for
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 How do we define K West at the interface?
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 How do we define K West at the interface? Lets make the normal component of velocity continuous across the interface.
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 pipi p West p i-1
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 pipi p West p i-1 Equate V left and V right and solve for p West
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 pipi p West p i-1
If K’s constant, get matrix from assignment #1, otherwise … KiKi K i-1 pipi p West p i-1 The effective diffusion coefficient is the harmonic average of the 2.
Programming Assignment #3 Will be like assignment #1, except –The diffusion coefficient will vary and the discretization will be done by finite volume method –We’ll replace the Gauss-Seidel solver for the linear system with something more effective To get a head start, modify your code (or mine) from assignment #1 to solve the PDE …
Use finite volumes and Gauss-Seidel. Solving the pressure equation for porous media flow Keep problem size as input. I’m showing a small problem for illustration.
Use finite volumes and Gauss-Seidel. Solving the pressure equation for porous media flow
Assume that K is defined by a function on x & y Solving the pressure equation for porous media flow
Use the K value at volume centers in defining the finite volume equations Solving the pressure equation for porous media flow
Upcoming Schedule March M W April M W Programming assignment #3 due March 21 Take home portion of exam handed out March 28 Take home due and in class exam April 2 Programming assignment #4 due April 9 Final Project presentations April 23 & 25