Download presentation
Presentation is loading. Please wait.
Published byAntony Newman Modified over 8 years ago
1
Implementing Finite Volume Methods 1
2
Continue on Finite Volume Methods for Elliptic Equations Finite Volumes in Two-Dimensions Poisson’s Equation Boundary Conditions ◦ Neumann ◦ Dirichlet Using Excel 2
3
2-Dimensional grid development same as 1D. Note that the boundaries are on the control volume surfaces. [In the pictures, dotted lines represent control volumes, solid lines represent node adjacencies/data dependencies.] 3 Control Volumes Nodes placed at centre of control volumes
4
Grid Generation - Similar as One-Dimension Use grid spacing h (=Dx) in x direction and k (= Dy) in y Consider Poisson's Equation 4 Control Volume P S W N E e w s n h k
5
For an area A enclosed by the surface S, and vector field variable v, the DIVERGENCE theorem states: Let The Divergence theorem can be used on the Laplace equation for the scalar field u. Or 5 S A
6
Using the divergence theorem it can be shown that: The first order derivatives can be approximated by: 6 P S W N E e w s n
7
Therefore at each node we have the following algebraic equations that represent the Poisson equation. 7 P S W N E e w s n h k
8
The equation on the previous slide is in the standard form for finite volumes schemes It is normal to write Ap in this way, rather than, say This is because, if you use other volume shapes, such as triangles, rectangles or a mixture, the same sort of results (e.g. that Ap is the sum of the other coefficients) still hold 8
9
The divergence theorem gives: Example: at north boundary 9
10
Therefore at each node on the north boundary we have 10
11
Similarly at each node on the east boundary, if Similar on other boundaries, but the signs are reversed (south) (west) 11
12
The divergence theorem gives: Example: at east boundary 12 Boundary P h k
13
Therefore at each node on the east boundary we have 13
14
Similarly at each node on the north boundary, if 14
15
At each internal node 15 P S W N E e w s n h k
16
Can use transformations of source term to calculate BCs Remove the boundary term(s) A [B] =0 where [B]=N,S,E or W Neumann (+east or –west) (+north or –south) Dirichlet ( u = U B ) (east or west) (north or south) 16 Boundary P h k
17
Finite Difference: ◦ Approximate derivatives at each node via a difference formula derived from Taylor series expansions on a regular grid. ◦ Advantages: Easy to implement. Easy to obtain higher order derivatives. ◦ Disadvantages: Need to use structured mesh. May not be conservative. Finite Volume: ◦ Approximate first order derivatives on the faces of each control volume. ◦ Advantages: Can use unstructured meshes. Conservative. ◦ Disadvantage: Difficult to obtain higher order derivatives. 17
18
Mesh nodes are at the centre of each cell (e.g. for at ) There are no known boundary cell values (even if a boundary value for u is known – different from Finite Differences) Work out general formula, copy to all cells and apply boundary transformations 18
19
Consider the Poisson equation on the following domain: Using h = k = 0.5, g = 2, program the FV method in Excel [class demo] 19 (0,0) (0,5) (3,2) (3,3) (7,2) (7,3) (10,0) (10,5)
20
At each internal node (see slide 15) So in general However, may be sensible to retain g, h, k in the formula so we can modify the Excel file easily (see example) 20
21
At the West boundary we have Neumann BCs Use general formula (slide 15) but apply boundary transformations (slide 16) but (transformation) (transformation) So in general on West boundary 21
22
At the East boundary we have Dirichlet BCs u=50 Use general formula (slide 15) but apply boundary transformations (slide 16) but (transformation) (transformation) So in general on East boundary 22
23
At the East boundary we have Dirichlet BCs u =50 At the South boundary we have Neumann BCs but (S & E transformation) (E transformation) (S transformation) So for bottom right hand corner 23
24
24
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.