A Mixed RT0 − P0 Raviart-Thomas Finite Element Implementation Of

A Mixed RT0 − P0 Raviart-Thomas Finite Element Implementation Of

1 PREPRINT 2 A mixed RT0 − P0 Raviart-Thomas finite element implementation of 3 Darcy Equation in GNU Octave 1 1;y 4 Agah D. Garnadi , C. Bahriawati 1 5 Jurusan Matematika, Fakultas MIPA, Institut Pertanian Bogor, Indonesia, e-mail: 6 [email protected] 7 Abstrak In this paper we shall describe mixed formulations -differential and variational- of Darcys flow equation, an important model of elliptic problem. We describe * 8 Galerkin method with finite dimensional spaces; * Local matrices and assembling; * Raviart-Thomas RT0 − P0 elements; * Edge basis and local matrices for RT0 − P0 FEM; * Model problem with corresponding local matrices, right hand side and treatment of boundary conditions. A simple demo written in GNU Octave is given. Kata kunci: Persamaan Darcy, Aliran di bahan berpori, Flux, Kekekalan Local, 9 Metode Elemen Hingga Campuran Abstract In this paper we shall describe mixed formulations -differential and variational- of Darcys flow equation, an important model of elliptic problem. We describe * 10 Galerkin method with finite dimensional spaces; * Local matrices and assembling; * Raviart-Thomas RT0 − P0 elements; * Edge basis and local matrices for RT0 − P0 FEM; * Model problem with corresponding local matrices, right hand side and treatment of boundary conditions. A simple demo written in GNU Octave is given. Keywords: Darcy flow, Flow in porous media, Flux, Local conservation, Mixed finite 11 element methods 12 Contents 13 1 Introduction 1 14 2 Problem formulation 1 15 3 Galerkin method -Mixed FEM 2 16 4 Local matrices and assembling 3 17 5 Lowest order Raviart-Thomas finite elements 3 18 6 Local properties and local edge basis for RT(0) elements 4 19 7 Local matrices 5 20 8 Model problem 7 21 9 Assembling 9 22 1. Introduction 23 This report describes basis of RT1 code, which can be characterized as a code for test- 24 ing solvers and preconditioners for FEM systems arising from lowest order Raviart-Thomas 25 discretization of Darcy flow problems, see also [2] [1] 26 The code is characterized by simplicity and possibility of easy modifications, 2000 Mathematics Subject Classification: 65N15; 65M30 Received: dd-03-2020, accepted: dd-mm-yyyy. 1 2 Garnadi & Bahriawati, PREPRINT 27 • directly solving model problems on square domains (generalization possible), 28 • stochastic generation of heterogeneity, 29 • fast system assembling using vectorization and sparse reconstruction, 30 • possible testing of Krylov type solvers with both (block) matrix and matrix free (vari- 31 able) preconditioners. 32 This report describes the finite element system generation, experiments are involved in 33 papers, e.g. [3]. 34 2. Problem formulation 35 Let us consider Darcy flow elliptic problem in the form −div(k(−g + grad p) = f in Ω p =p ^ on ΓD (−k grad p) · n =u ^ on ΓN 36 where g 6= 0 if we consider elevation changes. It can be also written in a two field form 1 n 37 with two basic variables p :Ω ! R and u :Ω ! R ; k−1u + grad p = g in Ω div(u) = f 38 p =p ^ on ΓD (−k grad p) · n =u ^ on ΓN 39 The variational formulation uses test functions v and q to get R k−1u · vdx + R rp · vdx = R g · vdx RΩ Ω RΩ Ω div(u)q = Ω fqdx 40 Transformation of one mixed term then provides R R P @p P R R @vk rp · v = vkdx = f pvk · nk − p dxg Ω RΩ k @xk R k @Ω Ω @xk = @Ω p(v · n) − Ω pdiv(v)dx 41 Then the variational formulation gets the form R k−1u · v − R div(v) · p = R g · vdx − R p^(v · n) − R p(v · n) 8v RΩ Ω RΩ ΓD ΓN Ω div(u)q = Ω fq 8q 42 {or in abstract form: find (u; p) 2 UN × P m(u; v) + b(v; p) = G(v) 8v 2 U0 b(u; q) = F (v) 8q 2 P 43 where n U = fv 2 L2(Ω) : div(v) 2 L2(Ω)g ! H(div) U0 = fv 2 U : v · n = 0 on ΓN g UN = fv 2 U : v · n =u ^ on ΓN g P = fq 2 L2(Ω)g R 44 Note that pressure BC enters G(v) = ::: − p^(v · n) whereas velocity BC are included Γ0 45 in UN : Darcy - Raviart-Thomas Element 3 46 3. Galerkin method -Mixed FEM 47 We start with introducing FEM spaces Uh ⊂ U; UNh ⊂ UN ;U0h ⊂ U0 and Ph ⊂ P: 48 Then the Galerkin method is to find (uh; ph) ⊂ UhN × Ph m(uh; vh) + b(vh; ph) = G(vh) 8vh 2 U0h b(uh; qh) = F (qh) 8ph 2 Ph 49 After a choice of bases Uh = linfΦi; i 2 Ig;Ph = linfΨj : j 2 Jg UNh = uN + u; u 2 U0h U0h = linfΦi : i 2 I0g X uN 2 linfΦi : i 2 InI0g; uN = (^u · n)(xi)Φi 50 the discrete mixed problem can be written as -find (uh; ph) 2 UhN × Ph; uh = uN + P P 51 α Φ ; p = β Ψ i2I0 i i h j2J j j P α m(Φ ; Φ ) + P β b(Φ ; Ψ ) = G(Φ ) − m(u ; Φ ) 8k 2 I i2I0 i i k j2J j k j k N k 0 P α b(Φ ; Ψ ) = F (Ψ ) − b(u ; Ψ ) 8l 2 J i2I0 i i l l N l 52 Rewriting to matrix form provides T n1 Bα + B β = G; α 2 R ; n1 = #I0 n2 Bα = F; β 2 R ; n2 = #J n1×n1 n2×n1 T n1×n2 T 53 where M 2 R ;Mij = m(Φj; Φi);B 2 R ;Bij = b(Φj; Ψi);B 2 R ;Bij = 54 b(Φi; Ψj) = Bji;G = (Gi);Gi = G(Φi);F = (Fk);Fk = F (Ψk): 55 4. Lowest order Raviart-Thomas finite elements 2 56 Let Ω 2 R be a 2D polygonal domain, Th be its triangulation, Eh be set of edges of all 57 elements T 2 Th see the situation in the following Figure 1. 58 Then, we can define 2 T T RT0(T ) = fv : T ! R ; v(x) = ξ[x1 x2] + [η1 η2] ; ξ; η1; η2 2 Rg 59 2 Uh = fv :Ω 2 R ; vjT 2 RT0(T ) 8T 2 Th; v · nE is continuous over E 2 Ehg 1 Ph = fq :Ω 2 R ; qjT is constant 8T 2 Thg: 60 Continuity of ν · nE guarantees Uh 2 U; Ph 2 P is obvious. Note that 8E 2 Eh we define 61 nE (unit normal vector), independently of relation to triangles and consequently in possibly 62 inner or outer direction, see Figure 2. 63 6 Local properties and local edge basis for RT(0) elements 64 Lemma 4.1. Let T 2 Th; v 2 RT0(T ): Then 8E 2 Eh [ @T : v · njE = const. ∗ 65 Proof. Let E 2 Eh [ @T; nE be normal to E (can be either outer or inner to T ), x 2 E be 66 arbitrary point at E: Then ∗ ∗ ∗ x 2 E ) (x − x ) · nE = 0; nE = (n1; n2) ) x1n1 + x2n2 = x1n1 + x2n2 = const: ) 67 ∗ ∗ v(x) · n = ξx1n1 + ξx2n2 + η1n1 + η2n2 = ξ(x1n1 + x2n2) + η1n1 + η2n2 = const : 68 4 Garnadi & Bahriawati, PREPRINT (i) (j) Gambar 1. fx g set of centres of Ei 2 Eh; fy g barycentres of Tj 2 Th Gambar 2. Prescribed normal nE: Possible definition of nE;E 2 Eh: Gambar 3. Triangle T 2 Th: Darcy - Raviart-Thomas Element 5 69 Lemma 4.2. (Expression for local basis functions.) Let E Φ (x) = σ i (x − P ); σ = n n(i); i i 2jT j i i Ei (i) 70 where nEi are global prescribed normals and n are outer normals for T 2 Th; see Figure 71 3. Then 72 (i)Φ j(x) · nEi = δij; 73 (ii)Φ i 2 RT0(T ); 74 (iii)Φ 1; Φ2; Φ3 create a basis of RT0(T ); Ei 75 (iv) divΦi = σi jT j : 76 Proof. (i) If i 6= j; then Pi 2 Ej and (x − Pi) · nEj = 0 for x 2 Ej: If i = j then for 77 x 2 Ei the value (x − Pi) · nEi appears in the projection of (x − Pi) to the height of 1 78 T passing through Pi and therefore j(x − Pi) · nEi j = hi: Moreover, 2 hijEij = jT j and (i) 79 hi = 2jT j=jEij; (x − Pi) · n ≥ 0 -both vectors have outward direction w.r.t. T: Finally 2jT j (x − Pi) · nEi = σi jEij 80 (ii) obvious 3 81 P (iii) u 2 RT0(T ); w = u − 1(u · nEi )Φi: Obviously w · nEi = 08Ei: Therefore 8Pj : 82 w(Pj) · nEi = 0 and because 8Ei : Pj 2 Ei; it holds w(Pj) = 08j = 1; 2; 3: As w is 83 linear polynomial, w = 0: Proof of uniqueness: 3 X w = αiΦi = 0 ) wnEj = αjΦjnEj = αj = 08j: 1 84 (iv) obvious 85 86 5. Local matrices and assembling 87 Assume that Φi and Ψi are constructed as finite element basis functions above some 88 triangulation Th; i:e:T 2 Th ΦijT 2 fΦ1; :::; Φρ; 0 = Φ0g 89 ΨjjT 2 fΨ1; :::Ψs; 0 = Ψ0g: 90 Then R −1 m(Φi; Φk) = Ω k ΦiΦkdx = P R k−1Φ Φ dx T 2Th T i k = P R k−1Φ Φ dx T 2Th T loc(i) loc(k) R b(Φi; Ψj) = Ω(divΦi)Ψjdx = P R (divΦ )Ψ dx T 2Th T loc(i) loc(j) 91 where lock(i) = lock(i; T ) is a transformation from global index to local index of basis 92 function on T: It can be also zero.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us