Finite Difference Method (FDM) Integral Finite Difference Method (IFDM) home/lehre/vl-mhs-1-e/cover sheet.tex. p.1/29
Table of contents 1. Finite Difference Method (FDM) 1D-Example (a) Problem and Governing Equation (b) Finite Difference-Approximation (c) Formulation for each node (d) Stiffness Matrix 2. Integral Finite Difference Method (IFDM) 1D-Example (a) Problem Governing Equation (b) Equilibrium of a control volume (c) Averaging technique (d) Stiffness Matrix (e) Boundary Conditions (f) Solution home/lehre/vl-mhs-1-e/table of contents.tex. p.2/29
1D-Example - Finite Difference Method ments H left Q right x 1. Geometry A = 1 m 2 x = 1 m k f 2. Permeability = 10 5 m/s y 4m 3. Boundary Conditions Q right = 10 4 m 3 /s H left = 50 m 1 2 3 4 5 x x x x home/lehre/vl-mhs-1-e/problem.tex. p.3/29
1D-Example - FDM Continuity equation (mass balance equation for an incompressible fluid): v q = 0 Momentum balance equation Darcy equation (with all necessary assumptions): v = k f h with h = p ρg + z home/lehre/vl-mhs-1-e/governing equation.tex. p.4/29
1D-Example - FDM If we insert the Darcy equation into the continuity equation and then rewrite it in a one dimensional form, we get ( k f h) q = 0 and 1D x ( k f Assumptions: No sinks or sources inside the tube, incompressible flow, and (Re 10). h x ) q = 0. home/lehre/vl-mhs-1-e/governing equation2.tex. p.5/29
1D-Example - FDM Goal: Direct transfer from the partial differential equation to the difference equation (algebraic equation). Finite Difference Approximation h PSfrag replacements ĥ i ĥ i+1 (1) ĥ i 1 (2) (3) = 1.0[m] i 1 i i+1 x home/lehre/vl-mhs-1-e/fd_approx1.tex. p.6/29
1D-Example - FDM We can write the finite difference formulation for the first derivative in three different ways. These can be deducted from a Taylor series expansion. ( ) dh dx i+ ( ) dh dx i ) ( dh dx i = h i+1 h i = h i h i 1 = h i+1 h i 1 2 forward difference (1) backward difference (2) central difference (3) home/lehre/vl-mhs-1-e/fd_approx2.tex. p.7/29
1D-Example - FDM The approximation for the second derivative can be gained through the summation of the forward and the backward Taylor series, thus eliminating the first derivative or as shown below by combining the first order terms. d 2 h dx 2 = d dx d 2 h dx 2 = 1 ( ) dh dx ( hi+1 h i = 1 h i h i 1 [( ) dh dx i+ ) ( ) ] dh dx i = h i+1 2h i + h i 1 2 home/lehre/vl-mhs-1-e/fd_approx3.tex. p.8/29
1D-Example - FDM We each unknown quantity we need one equation: Node 1 is our known boundary condition H left H left = h 1 or k f h 2 h 1 = q 1. Node 2 is calculated according to the presented scheme k f h i+1 2h i + h i 1 2 q 2 = 0 k f h 1 2h 2 + h 3 2 q 2 = 0, with q 2 = 0 we get, k f 1 2 (1, 2, 1) (h 1, h 2, h 3 ) T = 0, where h 1 is the b.c. home/lehre/vl-mhs-1-e/bal_eqn_node1.tex. p.9/29
1D-Example - FDM Node 3 and node 4 are calculated accordingly: k f 1 2 (1, 2, 1) (h 2, h 3, h 4 ) T = 0, k f 1 2 (1, 2, 1) (h 3, h 4, h 5 ) T = 0. Node 5 is a boundary node with the prescribed flux Q right. This boundary condition will be used directly as the last equation k f h 5 h 4 = Q right A k f 1 (1, 1) ((h 4, h 5 ) T = Q right A. home/lehre/vl-mhs-1-e/bal_eqn_node2.tex. p.10/29
1D-Example - FDM Assemble the equations for the piezometric heads in matrix form 1 1 0 0 0 1 2 1 0 0 0 1 2 1 0 0 0 1 2 1 0 0 0 1 1 h 1 h 2 h 3 h 4 h 5 = k f q 1 0 0 0 k f q right. Here we use q right as boundary condition. q indicates specific discharges [m/s], while Q is discharge [m 3 /s]. home/lehre/vl-mhs-1-e/stiff_matrix1.tex. p.11/29
1D-Example - FDM As h 1 is known, we can delete the corresponding row and column and transfer h 1 to the right hand side of the equation. 2 1 0 0 1 2 1 0 0 1 2 1 0 0 1 1 h 2 h 3 h 4 h 5 = h left 0 0 k f q right This matrix can then be solved using for example a Gausselimination. You can try this at home! home/lehre/vl-mhs-1-e/stiff_matrix2.tex. p.12/29
Integral Finite Difference Method (IFDM) ents h 2 H left A 4 m CV A Q right x Given: 1. Geometry A = z y = 1 m 2 x = 1 m 2. Permeability k f = 10 5 m/s 3. Boundary conditions Q right = 10 4 m 3 /s H left = 50 m 1 2 3 4 z y x x x x x home/lehre/vl-mhs-1-e/ifdm_1d_prob.tex. p.13/29
Governing equations (IFDM 1D) Continuity equation: A (v n) da CV q dω = 0 Momentum equation (Darcy equation): v = k f h Inserting the momentum equation into the continuity equation yields: ( k f h) n da q dω = 0. A CV home/lehre/vl-mhs-1-e/gov_eqn_ifdm.tex. p.14/29
Governing equations (IFDM 1D) If only one control volume is considered one obtains ( ) ( k f h) n da q dω = 0 A CV CV CV CV. Writing the integral over the boundary of the control volume as the sums over the interfaces, the first term can be written as: ( k f h) n da = ( k fi h i )A i n = Q i n A CV i i with i = 1, 2 for 1D. home/lehre/vl-mhs-1-e/gov_eqn_ifdm2.tex.tex. p.15/29
A single control volume (IFDM 1D) In a 1D problem each control volume has two interfaces and we therefore have to take two fluxes into account. The sourceand sinkterm q dω, which describes extraction or injection CV of water inside of the domain, e.g. by a well, equals zero, as no water is extracted or injected inside of the second control volume. PSfrag replacements n 2 n x ( k fi h i )A i n = Q 1 2 n + Q 2 3 n = 0 i Attention: The normal vector n points in two different directions. home/lehre/vl-mhs-1-e/one_contr_vol.tex. p.16/29
Flux approximation (IFDM 1D) The fluxes can be approximated in the following way. Q 1 2 is the flux over the boundary from control volume one (CV 1) into control volume two (CV 2). Q 1 2 = h 2 h 1 Q 2 3 = h 3 h 2 k fa k fa Inserting these fluxes into the balance equation for CV 2 with the right normal vectors yields ( ) h1 2h 2 + h 3 1 Q 1 2 + 1 Q 2 3 = k f A = 0. home/lehre/vl-mhs-1-e/fluxes.tex. p.17/29
Stiffness matrix I (IFDM 1D) In order to determine the unknowns, in this case the piezometric heads, all equations (one for each control volume) have to be solved simultaneously. This leads to a system of equations, which can be written in the form of a matrix - vector product. The matrix is called stiffness matrix in analogy to structural mechanics. It consists of the factors in front of the piezometric heads and the structural parameters, such as cross sectional area and permeability (1). The solution vector (2) contains the piezometric heads and on the right hand side (3) are all the known values as well as the inflow and outflow of the system. S ij }{{} 1 h i }{{} 2 = q }{{} j. 3 home/lehre/vl-mhs-1-e/stiff_mat_ifdm.tex. p.18/29
Stiffness matrix II (IFDM 1D) The matrix form of the equation for the second control volume has the following shape: 1 (h 1 2h 2 + h 3 )k f A = 1 k fa(h 1 2h 2 + h 3 ) = 1 ( ) k fa 1, 2, 1 = 1 k fa S CV h T CV h 1 h 2 h 3 home/lehre/vl-mhs-1-e/stiff_mat_ifdm2.tex. p.19/29
Stiffness matrix III (IFDM 1D) Depending on the system, the different permeabilities are included into the stiffness matrix or, in case they are identical, they can be factorized and moved to the right hand side. In our example this is the case: S ij h T i = k f A Q j. home/lehre/vl-mhs-1-e/stiff_mat_ifdm3.tex. p.20/29
Stiffness matrix IV (IFDM 1D) If we assemble all the equations in the system matrix, we yield the following result: 3 1 0 0 1 2 1 0 0 1 2 1 0 0 1 1 h 1 h 2 h 3 h 4 = 2H left 0 0 Q right k f A. In no control volume water is extracted or injected. In the first row the known piezometric head is moved to the boundary conditions on the right hand side. In the last row we can insert the other boundary condition directly into the flow equation. As it is known, it can be moved to the right hand side. On the next pages there will be further explanation about including boundary conditions. home/lehre/vl-mhs-1-e/stiff_mat_ifdm4.tex. p.21/29
Boundary conditions I (IFDM 1D) Dirichlet boundary condition: PSfrag replacements 0 H left 1 A further unknown (h 0 ) enters the balance equation for the CV 1. In this case h 0 is coupled with h 1 via the boundary condition. As H left has to be constant, and we assume a linear piezometric head distribution, we can express H left as the arithmetic mean of the neighbouring piezometric heads. H left = h 1 + h 0 2 h 0 = 2H left h 1 home/lehre/vl-mhs-1-e/dir_bc_ifdm.tex. p.22/29
Boundary conditions II (IFDM 1D) If we put this into our balance equation for CV 1, we get ( ) ( ) h0 2h 1 + h 2 2Hleft 3h 1 + h 2 Q 1 0 + Q 1 2 = k f A = k f A = 0. This yields for the flux: ( ) h 1 (2H left h 1 ) Q 0 1 = k f A = ( ) 2h 1 2H left k f A We obtain for the flow equation for the first element: ( ) 2Hleft 3h 1 + h 2 A k f = 0 home/lehre/vl-mhs-1-e/dir_bc_ifdm2.tex. p.23/29
Boundary conditions III (IFDM 1D) Dirichlet boundary conditions are in general included by cancelling the row and columns, while taking the influence of this parameter on the neighbouring element into account. In this case row and column 0 are cancelled, as they can be described by H left. This known value can be moved to the right hand side. Neumann boundary conditions are included directly into the equation for the element (CV). As Q is know and the quations are formulated for fluxes, it can be moved to the right hand side directly. home/lehre/vl-mhs-1-e/bc_ifdm3.tex. p.24/29
Solution I (IFDM 1D) The system of equations could be solved e.g. using the Thomasalgorithm or the so-called double sweep procedure. On the next two slides the depenencies of the variables will be set up on the left hand side. On the right hand side we will insert the values back, and the values will be calculated from bottom to top. home/lehre/vl-mhs-1-e/sol_ifdm.tex. p.25/29
Solution II (IFDM 1D) 3h 1 + h 2 = 2H left h 1 = 2H left h 2 3 h 1 = 2 3 H left + 1 3 h 2 1 h 1 2h 2 + h 3 = 0 h 1 = 45m h 1 = 2 3 50m + 1 3 35m 7 h 2 = 35m h 2 = h 1 h 3 2 = 2 6 H left + 1 6 h 2 + 1 2 h 3 h 2 = 2 5 H left + 3 5 h 3 h 2 = 2 5 50m + 3 5 25m home/lehre/vl-mhs-1-e/sol_ifdm2.tex. p.26/29
Solution III (IFDM 1D) 2 h 2 2h 3 + h 4 = 0 h 3 = 1 5 H left + 3 10 h 3 + 1 2 h 4 h 3 = 2 7 H left + 5 7 h 4 3 h 3 h 4 = Q k f A h 4 = Q k f A + 5 7 h 4 + 2 7 H left 6 h 3 = 25m h 3 = 2 7 50m + 5 7 15m 5 h 4 = 15m h 4 = 7 Q 2 k f A + H left = 4 h 4 = 7 10 4 m 3 /s 1m 2 10 5 m/s 1m 2 + 50m home/lehre/vl-mhs-1-e/sol_ifdm3.tex. p.27/29
Solution IV (IFDM 1D) This yields the following distribution of piezometric heads: h 1 = 45m ; h 2 = 35m ; h 3 = 25m ; h 4 = 15m. home/lehre/vl-mhs-1-e/sol_ifdm4.tex. p.28/29
On the side: Averaging (IFDM 1D) What happens if k f1 k f2? How can k f2 1 be determined? 1 2 x In principle there are two possibilities arithmetic mean k f1 +k f2 2, 2k f1 k f2 k f1 +k f2. harmonic mean It stands to reason to proceed from the extreme case. What would happen if one of the permeabilities would be zero, which means one domain would be impermeable? As the system is one-dimensional, this domain would be a barrier and there would be no flow. home/lehre/vl-mhs-1-e/averaging.tex. p.29/29