Presentation is loading. Please wait.

Presentation is loading. Please wait.

MA/CS471 Lecture 8 Fall 2003 Prof. Tim Warburton

Similar presentations


Presentation on theme: "MA/CS471 Lecture 8 Fall 2003 Prof. Tim Warburton"— Presentation transcript:

1 MA/CS471 Lecture 8 Fall 2003 Prof. Tim Warburton timwar@math.unm.edu

2 Today Today we are going to discuss implementation of the simplest possible partial differential equations: Example domain discretization (L-shape domain with 3 cells):

3 Traveling Wave Solutions in 1D and 2D This PDE is the two-dimensional analogue to the PDE we saw last time: 2D 1D Solutions: t=0: Later t:

4 In Words The initial condition is translated with velocity: i.e. the density does not change shape – it simply translates with a constant velocity.

5 Conservation Law We first divide the full domain into quadrilateral cells. For each cell e the following conservation law holds: i.e. the total density change in a cell e is equal to the flux of density through the boundary of e -- or – the rate of change of material in the cell e is equal to the amount “translated” through the boundary.

6 Boundary Conditions Where do we need to apply boundary conditions: Hint – which way is the solution translating?

7 Boundary Conditions Where do we need to apply external boundary conditions ?: i.e. wherever where is the outwards facing normal for the cell e at the face f : e

8 Definition of Cell Average and Area

9 Use Upwinding At Boundary of e The tau variable acts as a switch. If tau=1 at a face then rho is approximated by the local cell average at the face If tau=0 at a face then rho is approximated by the neighbor cell average.

10 Upwind Switch In this case so i.e. for the surface flux term we should use the cell average density from the neighbor cell. rho e,1+ rho e

11 Euler Forward In Time For each cell we now have a discrete space in time and space which will compute approximations the cell average density at a given time level. We do need to specify an initial value at each cell for the cell average density We also need to specify boundary conditions at “inflow” edges.

12 Summary of Scheme

13 The time rate of change of total density in the cell e The flux through the boundary of the four faces of cell e

14 Implementation What do we need for the implementation: (1) A list of vertex locations (x0,y0,x1,y1…) (2) For each cell e a list of the four vertices (3) A routine to calculate the area of each cell {A e } (4) A routine to calculate the length of each cell edge {A e,f } (5) A routine to calculate the outwards facing normal to each cell edge (6) A routine to calculate the inflow switch tau for each cell edge. (7) A routine to calculate the initial density profile. (8) A routine to calculate dt in the following way (9) A routine to figure out which cells connect to each cell.

15 Details 1)Compute cell area by dividing each cell into two triangles, find their areas, and sum up. 2)Do not assume cells are right-angled quadrilaterals (can be deformed). 3)To compute normal to a face:

16 16 Project 2: continued Create a serial version of the 2d finite volume scheme for the above one way wave equation. Make it parallel.

17 17


Download ppt "MA/CS471 Lecture 8 Fall 2003 Prof. Tim Warburton"

Similar presentations


Ads by Google