Introduction FEM, 1D-Example home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/cover_sheet.tex page 1 of 25. p.1/25
Table of contents 1D Example - Finite Element Method 1. 1D Setup Geometry 2. Governing equation 3. General Derivation of Finite Element Method 4. Shape functions 5. Assembling the matrix 6. Calculation of the matrix entries 7. Solving the set of equations home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/toc_fem_intro.tex page 2 of 25. p.2/25
1D-Example: Finite Element Method Given : H left 1. Geometry x = 1 m cements 1 4 m 2 3 4 5 Q x 2. 3. 4. Permeability k f = 10 5 m/s Boundary conditions Q = 10 4 m 3 /s H left = 50 m Notation 1 denotes node 1 1 denotes element 1 1 2 3 4 x x x x home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/1d_setup_fem.tex page 3 of 25. p.3/25
Governing Equations (FEM 1D) Continuity equation v q = 0 Momentum equation (Darcy equation) v = k f h ( k f h) q = 0 1D x ( k f Assumption: No sinks or sources h x ) q = 0 k f 2 h x 2 = 0 (Laplace-Equation) home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/gov_eqn_fem1.tex page 4 of 25. p.4/25
The weighting function (FEM 1D) We now introduce an approximate function h(x) Inserting this approximation into the Laplace equation yields a residuum (error) ε: ( k f h) q = ε We introduce a weighting function W. This function is multiplied with our residual and integrated over the whole domain. We choose this weighting function such, that the integral is zero. { } W ε d = W ( k f h) q d = 0 = W { } ( k f h) d W q d = 0 home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/starting_equ.tex page 5 of 25. p.5/25
Starting equation II (FEM 1D) Use the product rule of differentiation in the reverse way { } W ( k f h) d = [W ( k f h)]d [ W ] T ( k f h)d, and apply Gauss theorem on the first term of the right hand side [W ( k f h)]d = W ( k f h) n dγ. Γ home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/starting_equ2.tex page 6 of 25. p.6/25
Starting equation III (FEM 1D) We collect all the terms W ( k f h) n dγ [ W ] T ( k f h)d W q d = 0 Γ and rearrange them. On the left hand side, we have our unknowns on the right hand side we have the boundary conditions and the source and sink terms [ W ] T (k f h)d = W (k f h) n dγ + W q d. Γ Please note, that at this point, we are still looking at the domain as a whole. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/starting_equ3.tex page 7 of 25. p.7/25
Starting equation IV (FEM 1D) Finally we can rewrite our boundary term, by introducing the velocity again [v o = ( k f h)] and get the weak formulation: [ W ] T k f [ h] d = W v o n dγ + W q d Γ Weak formulation (mathematical concept): We reduced as in the IFDM the order of the differentiation. Derivatives don t have to be available everywhere, because every term is an integral term. Existence and uniqueness of the problems can be shown. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/starting_equ4.tex page 8 of 25. p.8/25
Shape functions (FEM 1D) We now have to choose how our approximate solution shall look like. We choose it such, that it can be constructed from the shape functions and node values h(x) = n j=1 ĥ j N j (x). At this point we also introduce our discretization. We choose our elements and with that our nodes. n is here the number of nodes we have chosen. In the setting which is either called standard Galerkin method or Bubnov-Galerkin method the shape functions N i are also used as the weighting functions W i W i = N i. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/ansatz_funct.tex page 9 of 25. p.9/25
Equation in matrix from (FEM 1D) [ ] n [ N i ] T k f ĥ j N j (x) d = N i v o n dγ N i q d j=1 Γ As n j=1 ĥj is not a function, we can take it out of the integral. n ĥ j [ N i ] T k f [ N j (x)] d = } {{ } A ij j=1 home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/stiffnessmat.tex page 10 of 25 Γ N i v o n dγ N i q d } {{ } b i The equation has a vector-matrix structure representing a system of equations. The solution is our approximate function. n ĥ j A ij = b i A ĥ = b j=1. p.10/25
Shape functions (FEM 1D) ements Construction of the local shape functions N 1 and N 2. We can use linear functions, as we have only first order derivatives in the weak approximation. x Element 1: ĥ 1 ĥ 2 N 1 1 2 x=0 x=1 x = 1 m x (1) 1 N (1) 2 y=1 y=1 1 1 2 x=0 x=1 x = 1 m x N (1) 1 = 1 x N (1) 2 = x 1 : Element 1 1,2 : nodes home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/shape_funct.tex page 11 of 25. p.11/25
Shape functions II (FEM 1D) Construction of the local shape functions N 1 and N 2, which are also called trial functions, interpolation functions or basis functions. We can use linear functions, as we have only first order derivatives in the weak approximation. These shape functions need to be adjusted for the other elements. The slope remains the same but the y-intercept changes. Element 2 for example has the following shape functions N (2) 2 = 2 x N (2) 3 = x 1. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/shape_funct2.tex page 12 of 25. p.12/25
Shape functions III (FEM 1D) By adding the products of piezometric head at the nodes ĥj and the local ansatz functions N j one gets an approximate solution h(x) between the nodes Element 1: h i (x) = n PSfrag ĥ j Nj(x) i replacements j=1 ĥ 1 h (1) ĥ2 h (1) (x) = h 1 (1 x) + h 2 x h (1) (x) = h 1 + (h 2 h 1 )x 1 1 2 x=0 x=1 x In this case we have a linear interpolation. x x = 1 m home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/shape_funct3.tex page 13 of 25. p.13/25
System of equations (FEM 1D) A 11 A 12 A 13 A 14 A 15 A 21 A 22 A 23 A 24 A 25 A 31 A 32 A 33 A 34 A 35 A 41 A 42 A 43 A 44 A 45 A 51 A 52 A 53 A 54 A 55 h 1 h 2 h 3 h 4 h 5 = Q (2) Q (3) Q (4) Q (1) 1 2 Q (1) 2 3 Q (2) 3 4 Q (3) 4 Q (4) 5 h 1 is known (Dirichlet boundary conditions). Delete the corresponding row and column. A 22 A 23 A 24 A 25 h 2 h 1 K (1) 21 A 32 A 33 A 34 A 35 h 3 A 42 A 43 A 44 A 45 h 4 = 0 0 A 52 A 53 A 54 A 55 h 5 Q 5 home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/set_of_eqn.tex page 14 of 25. p.14/25
Calculating matrix entries (FEM 1D) Example 1: Calculation of the matrix entry A 23 (weighting function of node 2, shape function of node 3). The stiffness integral can be divided into different parts. At each element of A 23, except for element 2, the shape function or the weighting function equals zero. A 23 = K (1) 23 + K (2) 23 + K (3) 23 K (1) 23 = K (3) 23 = 0 = A 23 = K (2) 23 A 23 = K (2) 23 = 2m 1m N (2) 2 x k f N (2) 3 x home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_23a.tex.tex page 15 of 25 dx. p.15/25
Calculating matrix entries II (FEM 1D) A 23 = K (2) 23 = 2m 1m (2 x) x k f (x 1) x dx A 23 = K (2) 23 = A 23 has the units [ m2 s ]. 2m 1m 1 k f 1 dx = k f [ x] 2m 1m A 23 = K (2) 23 = k f [ (2m 1m)] = k f 1m home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_23b.tex page 16 of 25. p.16/25
Calculating matrix entries III (FEM 1D) Example 2: Calculation of the matrix entry A 55. The stiffness integral can be divided into different parts. A 55 = K (1) 55 + K (2) 55 + K (3) 55 + K (4) 55 K (1) 55 = K (2) 55 = K (3) 55 = 0 = A 55 = K (4) 55 A 55 = K (4) 55 = 4 3 N (4) 5 x k f N (4) 5 x dx home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_55a.tex page 17 of 25. p.17/25
Calculating matrix entries IV (FEM 1D) A 55 = K (4) 55 = 4 3 (x 3) x k f (x 3) x dx A 55 = K (4) 55 = 4 3 1 k f 1 dx = k f [x] 4 3 A 55 = K (4) 55 = k f [(4 3)] = k f home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_55b.tex page 18 of 25. p.18/25
Calculating matrix entries V (FEM 1D) Example 3: Calculation of the matrix entry A 22. The stiffness integral can be divided into different parts. In this case, only the weighting function and the shape function in element 3 and 4 equal zero. A 22 = K (1) 22 + K (2) 22 + K (3) 22 + K (4) 22 K (3) 22 = K (4) 22 = 0 = A 22 = K (1) 22 + K (2) 22 K (1) 22 = 1 0 K (1) 22 = N (1) 2 x k f 1 0 N (1) 2 x x x k f x x dx dx home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_22a.tex page 19 of 25. p.19/25
Calculating matrix entries VI (FEM 1D) K (1) 22 = 1 0 1 k f 1 dx = k f [x] 1 0 K (1) 22 = k f [1 0] = k f K (2) 22 = K (2) 22 = 2 1 2 1 N (2) 2 x k f (2 x) x k f N (2) 2 x dx (2 x) x dx home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_22b.tex page 20 of 25. p.20/25
Calculating matrix entries VII (FEM 1D) K (2) 22 = 2 1 1 k f 1 dx = k f [x] 2 1 K (2) 22 = k f [(2 1)] = k f A 22 = K (1) 22 + K (2) 22 = 2k f All other matrix entries can be calculated analogously. A 32 = A 34 = A 43 = A 45 = A 54 = k f A 33 = A 44 = 2k f A 21 = A 12 = k f ; A 11 = k f home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/matr_entr_22c.tex page 21 of 25. p.21/25
Inserting values in matrix (FEM 1D) Inserting these values one obtains the following system of equations: k f 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 1 k f 0 0 Q 5 Q 2 = Q 3 = Q 4 equal zero, as there are no sinks and sources in the domain. Q 5 is the known Neumann boundary condition. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/values_matrix.tex page 22 of 25. p.22/25
Solving the set of equations (FEM 1D) By transforming the vector representation one obtains a linear system of equations. Inserting the boundary conditions we have four equations for four unknowns. 2h 2 h 3 = 50m h 2 + 2h 3 h 4 = 0 h 3 + 2h 4 h 5 = 0 h 4 + h 5 = 10 4 m3 s k f 1m k f has the unit m s, but there is also the unit m from the integration. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/lgse.tex page 23 of 25. p.23/25
Solving the set of equations (FEM 1D) With k f = 10 5 and using the Thomas algorithm, we express our unknown in terms of one other unknown and the left boundary condition. h 2 = 50 2 + 1 2 h 3 h 3 = 50 3 + 2 3 h 4 h 5 = 4 h 4 = 25 2 + 3 4 h 5 [ 10 4 10 5 + 25 2 ]. Substituting back yields the following result h 1 = 50m ; h 2 = 40m ; h 3 = 30m ; h 4 = 20m ; h 5 = 10m. home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/lgse2.tex page 24 of 25. p.24/25
Test of the solution (FEM 1D) Test: Q 1 = Q 5 has to be fulfilled. h 1 A (1) 11 + h 2 A (1) 12 = Q 1 50 k f 1m + 40 ( k f ) 1m = Q 1 = Q 1 = 10 4 m/s 4 m3 = 10 s m3 = 10 4 s home/lehre/vl-mhs-1-e/folien/vorlesung/3_fem_intro/lgse2a.tex page 25 of 25. p.25/25