Manual
User Manual:
Open the PDF directly: View PDF .
Page Count: 216
Download | |
Open PDF In Browser | View PDF |
The Finite Element Method in Geodynamics C. Thieulot April 8, 2019 Contents 1 Introduction 1.1 Philosophy . . . . . . . . . . . . 1.2 Acknowledgments . . . . . . . . . 1.3 Essential literature . . . . . . . . 1.4 Installation . . . . . . . . . . . . 1.5 What is a fieldstone? . . . . . . . 1.6 Why the Finite Element method? 1.7 Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 List of tutorials 3 The 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 6 6 6 6 6 6 7 7 8 physical equations The heat transport equation - energy conservation equation The momentum conservation equations . . . . . . . . . . . The mass conservation equations . . . . . . . . . . . . . . . The equations in ASPECT manual . . . . . . . . . . . . . . the Boussinesq approximation: an Incompressible flow . . . Stokes equation for elastic medium . . . . . . . . . . . . . . The strain rate tensor in all coordinate systems . . . . . . . 3.7.1 Cartesian coordinates . . . . . . . . . . . . . . . . . 3.7.2 Polar coordinates . . . . . . . . . . . . . . . . . . . . 3.7.3 Cylindrical coordinates . . . . . . . . . . . . . . . . 3.7.4 Sperical coordinates . . . . . . . . . . . . . . . . . . Boundary conditions . . . . . . . . . . . . . . . . . . . . . . 3.8.1 The Stokes equations . . . . . . . . . . . . . . . . . . 3.8.2 The heat transport equation . . . . . . . . . . . . . Meaningful physical quantities . . . . . . . . . . . . . . . . 4 The building blocks of the Finite Element Method 4.1 Numerical integration . . . . . . . . . . . . . . . . . . . . 4.1.1 in 1D - theory . . . . . . . . . . . . . . . . . . . . 4.1.2 in 1D - examples . . . . . . . . . . . . . . . . . . . 4.1.3 in 2D/3D - theory . . . . . . . . . . . . . . . . . . 4.2 The mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 A bit of FE terminology . . . . . . . . . . . . . . . . . . . 4.4 Elements and basis functions in 1D . . . . . . . . . . . . . 4.4.1 Linear basis functions (Q1 ) . . . . . . . . . . . . . 4.4.2 Quadratic basis functions (Q2 ) . . . . . . . . . . . 4.4.3 Cubic basis functions (Q3 ) . . . . . . . . . . . . . 4.5 Elements and basis functions in 2D . . . . . . . . . . . . . 4.5.1 Bilinear basis functions in 2D (Q1 ) . . . . . . . . . 4.5.2 Biquadratic basis functions in 2D (Q2 ) . . . . . . . 4.5.3 Eight node serendipity basis functions in 2D (Qs2 ) 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 10 11 11 12 13 14 15 15 15 15 15 16 16 16 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 19 19 21 22 22 22 23 23 23 24 26 27 29 30 . . . . . . . 31 32 32 33 34 34 35 5 Solving the flow equations with the FEM 5.1 strong and weak forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Which velocity-pressure pair for Stokes? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 The compatibility condition (or LBB condition) . . . . . . . . . . . . . . . . . . . . 5.2.2 The bi/tri-linear velocity - constant pressure element (Q1 × P0 ) . . . . . . . . . . . 5.2.3 The bi/tri-quadratic velocity - discontinuous linear pressure element (Q2 × P−1 ) . 5.2.4 The bi/tri-quadratic velocity - bi/tri-linear pressure element (Q2 × Q1 ) . . . . . . 5.2.5 The stabilised bi/tri-linear velocity - bi/tri-linear pressure element (Q1 × Q1 -stab) 5.2.6 The MINI triangular element (P1+ × P1 ) . . . . . . . . . . . . . . . . . . . . . . . . 5.2.7 The quadratic velocity - linear pressure triangle (P2 × P1 ) . . . . . . . . . . . . . . 5.2.8 The Crouzeix-Raviart triangle (P2+ × P−1 ) . . . . . . . . . . . . . . . . . . . . . . 5.3 Other elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 The penalty approach for viscous flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 The mixed FEM for viscous flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.1 in three dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2 Going from 3D to 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Solving the elastic equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Solving the heat transport equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 36 36 36 36 36 36 37 37 37 37 37 38 40 40 46 47 47 6 Additional techniques and features 6.1 Picard and Newton . . . . . . . . . . . . . . . . . . . . 6.2 The SUPG formulation for the energy equation . . . . 6.3 Tracking materials and/or interfaces . . . . . . . . . . 6.4 Dealing with a free surface . . . . . . . . . . . . . . . . 6.5 Convergence criterion for nonlinear iterations . . . . . 6.6 Static condensation . . . . . . . . . . . . . . . . . . . . 6.7 The method of manufactured solutions . . . . . . . . . 6.7.1 Analytical benchmark I . . . . . . . . . . . . . 6.7.2 Analytical benchmark II . . . . . . . . . . . . 6.7.3 Analytical benchmark III . . . . . . . . . . . . 6.7.4 Analytical benchmark IV . . . . . . . . . . . . 6.8 Assigning values to quadrature points . . . . . . . . . 6.9 Matrix (Sparse) storage . . . . . . . . . . . . . . . . . 6.9.1 2D domain - One degree of freedom per node . 6.9.2 2D domain - Two degrees of freedom per node 6.9.3 in fieldstone . . . . . . . . . . . . . . . . . . . . 6.10 Mesh generation . . . . . . . . . . . . . . . . . . . . . 6.11 Visco-Plasticity . . . . . . . . . . . . . . . . . . . . . . 6.11.1 Tensor invariants . . . . . . . . . . . . . . . . . 6.11.2 Scalar viscoplasticity . . . . . . . . . . . . . . . 6.11.3 about the yield stress value Y . . . . . . . . . . 6.12 Pressure smoothing . . . . . . . . . . . . . . . . . . . . 6.13 Pressure scaling . . . . . . . . . . . . . . . . . . . . . . 6.14 Pressure normalisation . . . . . . . . . . . . . . . . . . 6.15 The choice of solvers . . . . . . . . . . . . . . . . . . . 6.15.1 The Schur complement approach . . . . . . . . 6.16 The GMRES approach . . . . . . . . . . . . . . . . . . 6.17 The consistent boundary flux (CBF) . . . . . . . . . . 50 50 50 50 50 50 50 51 51 52 53 54 55 58 58 59 60 61 64 64 65 65 66 68 69 70 70 74 75 4.6 4.5.4 Bicubic basis functions in 2D (Q3 ) . . . . . . . . 4.5.5 Linear basis functions for triangles in 2D (P1 ) . . 4.5.6 Quadratic basis functions for triangles in 2D (P2 ) 4.5.7 Cubic basis functions for triangles (P3 ) . . . . . Elements and basis functions in 3D . . . . . . . . . . . . 4.6.1 Linear basis functions in tetrahedra (P1 ) . . . . . 4.6.2 Triquadratic basis functions in 3D (Q2 ) . . . . . 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.18 6.19 6.20 6.21 6.22 6.23 6.24 6.25 6.26 6.27 6.17.1 applied to the Stokes equation . . . . . . . . . . . . . . 6.17.2 applied to the heat equation . . . . . . . . . . . . . . . . 6.17.3 implementation - Stokes equation . . . . . . . . . . . . . The value of the timestep . . . . . . . . . . . . . . . . . . . . . mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exporting data to vtk format . . . . . . . . . . . . . . . . . . . Runge-Kutta methods . . . . . . . . . . . . . . . . . . . . . . . Am I in or not? . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.22.1 Two-dimensional space . . . . . . . . . . . . . . . . . . . 6.22.2 Three-dimensional space . . . . . . . . . . . . . . . . . . Error measurements and convergence rates . . . . . . . . . . . The initial temperature field . . . . . . . . . . . . . . . . . . . . 6.24.1 Single layer with imposed temperature b.c. . . . . . . . Single layer with imposed heat flux b.c. . . . . . . . . . . . . . Single layer with imposed heat flux and temperature b.c. . . . 6.26.1 Half cooling space . . . . . . . . . . . . . . . . . . . . . 6.26.2 Plate model . . . . . . . . . . . . . . . . . . . . . . . . . 6.26.3 McKenzie slab . . . . . . . . . . . . . . . . . . . . . . . Kinematic boundary conditions . . . . . . . . . . . . . . . . . . 6.27.1 In-out flux boundary conditions for lithospheric models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 75 76 79 80 81 83 84 84 84 87 88 88 89 89 89 89 89 90 90 7 fieldstone 01: simple analytical solution 91 8 fieldstone 02: Stokes sphere 93 9 fieldstone 03: Convection in a 2D box 94 10 fieldstone 04: The lid 10.1 the lid driven cavity 10.2 the lid driven cavity 10.3 the lid driven cavity 97 97 97 97 driven cavity problem (ldc=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . problem - regularisation I (ldc=1) . . . . . . . . . . . . . . . . . . . . problem - regularisation II (ldc=2) . . . . . . . . . . . . . . . . . . . 11 fieldstone 05: SolCx benchmark 99 12 fieldstone 06: SolKz benchmark 101 13 fieldstone 07: SolVi benchmark 102 14 fieldstone 08: the indentor benchmark 104 15 fieldstone 09: the annulus benchmark 106 16 fieldstone 10: Stokes sphere (3D) - penalty 108 17 fieldstone 11: stokes sphere (3D) - mixed formulation 109 18 fieldstone 12: consistent pressure recovery 110 19 fieldstone 13: the Particle in Cell technique (1) - the effect of averaging 112 20 fieldstone f14: solving the full saddle point problem 116 21 fieldstone f15: saddle point problem with Schur complement approach - benchmark 118 22 fieldstone f16: saddle point problem with Schur complement approach - Stokes sphere 121 3 23 fieldstone 17: solving the full saddle point problem in 3D 123 23.0.1 Constant viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 23.0.2 Variable viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 24 fieldstone 18: solving the full saddle point problem with Q2 × Q1 elements 128 25 fieldstone 19: solving the full saddle point problem with Q3 × Q2 elements 130 26 fieldstone 20: the Busse benchmark 132 27 fieldstone 21: The non-conforming Q1 × P0 element 134 28 fieldstone 22: The stabilised Q1 × Q1 element 135 29 fieldstone 23: compressible flow (1) - analytical benchmark 137 30 fieldstone 24: compressible flow (2) - convection box 30.1 The physics . . . . . . . . . . . . . . . . . . . . . . . . . 30.2 The numerics . . . . . . . . . . . . . . . . . . . . . . . . 30.3 The experimental setup . . . . . . . . . . . . . . . . . . 30.4 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30.5 Conservation of energy 1 . . . . . . . . . . . . . . . . . . 30.5.1 under BA and EBA approximations . . . . . . . 30.5.2 under no approximation at all . . . . . . . . . . . 30.6 Conservation of energy 2 . . . . . . . . . . . . . . . . . . 30.7 The problem of the onset of convection . . . . . . . . . . 30.8 results - BA - Ra = 104 . . . . . . . . . . . . . . . . . . 30.9 results - BA - Ra = 105 . . . . . . . . . . . . . . . . . . 30.10results - BA - Ra = 106 . . . . . . . . . . . . . . . . . . 30.11results - EBA - Ra = 104 . . . . . . . . . . . . . . . . . 30.12results - EBA - Ra = 105 . . . . . . . . . . . . . . . . . 30.13Onset of convection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 140 140 142 142 143 143 144 144 145 147 149 150 151 153 154 31 fieldstone 25: Rayleigh-Taylor instability (1) - instantaneous 156 32 fieldstone 26: Slab detachment benchmark (1) - instantaneous 158 33 fieldstone 27: Consistent Boundary Flux 160 34 fieldstone 28: convection 2D box - Tosi et al, 2015 34.0.1 Case 0: Newtonian case, a la Blankenbach et al., 1989 34.0.2 Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.0.3 Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.0.4 Case 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.0.5 Case 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.0.6 Case 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 fieldstone 29: open boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 165 166 168 170 172 174 176 36 fieldstone 30: conservative velocity interpolation 179 36.1 Couette flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 36.2 SolCx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 36.3 Streamline flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 37 fieldstone 31: conservative velocity interpolation 3D 4 180 38 fieldstone 32: 2D analytical sol. from stream function 181 38.1 Background theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 38.2 A simple application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 39 fieldstone 33: Convection in an annulus 185 40 fieldstone 34: the Cartesian geometry elastic aquarium 187 41 fieldstone 35: 2D analytical sol. 41.1 Linking with our paper . . . . . 41.2 No slip boundary conditions . . 41.3 Free slip boundary conditions . in . . . . . . annulus from . . . . . . . . . . . . . . . . . . . . . . . . . . . stream function 189 . . . . . . . . . . . . . . . . . . . . . . 192 . . . . . . . . . . . . . . . . . . . . . . 192 . . . . . . . . . . . . . . . . . . . . . . 193 42 fieldstone 36: the annulus geometry elastic aquarium 195 43 fieldstone 37: marker advection and population control 198 44 fieldstone 38: Critical Rayleigh number 199 45 fieldstone: Gravity: buried sphere 201 46 Projects for guided research/MSc thesis 203 A Three-dimensional applications 205 5 WARNING: this is work in progress 1 Introduction 1.1 Philosophy This document was writing with my students in mind, i.e. 3rd and 4th year Geology/Geophysics students at Utrecht University. I have chosen to use jargon as little as possible unless it is a term that is commonly found in the geodynamics literature (methods paper as well as application papers). There is no mathematical proof of any theorem or statement I make. These are to be found in generic Numerical Analysic, Finite Element and Linear Algebra books. The codes I provide here are by no means optimised as I value code readability over code efficiency. I have also chosen to avoid resorting to multiple code files or even functions to favour a sequential reading of the codes. These codes are not designed to form the basis of a real life application: Existing open source highly optimised codes shoud be preferred, such as ASPECT [79, 65], CITCOM, LAMEM, PTATIN, PYLITH, ... All kinds of feedback is welcome on the text (grammar, typos, ...) or on the code(s). You will have my eternal gratitude if you wish to contribute an example, a benchmark, a cookbook. All the python scripts and this document are freely available at https://github.com/cedrict/fieldstone 1.2 Acknowledgments I have benefitted from many discussions, lectures, tutorials, coffee machine discussions, debugging sessions, conference poster sessions, etc ... over the years. I wish to name these instrumental people in particular and in alphabetic order: Wolfgang Bangerth, Jean Braun, Rens Elbertsen, Philippe Fullsack, Menno Fraters, Anne Glerum, Timo Heister, Robert Myhill, John Naliboff, E. Gerry Puckett, Lukas van de Wiel, Arie van den Berg, Tom Weir, and the whole ASPECT family/team. 1.3 Essential literature http://www-udc.ig.utexas.edu/external/becker/Geodynamics557.pdf 1.4 Installation python3.6 -m pip install --user numpy scipy matplotlib 1.5 What is a fieldstone? Simply put, it is stone collected from the surface of fields where it occurs naturally. It also stands for the bad acronym: finite element deformation of stones which echoes the primary application of these codes: geodynamic modelling. 6 1.6 Why the Finite Element method? There are other methods, such as the Discrete Element Method (DEM) [46, 47, 55], or the Element Free Galerkin Method (EFGM) [63]. 1.7 Notations Scalars such as temperature, density, pressure, etc ... are simply obtained in LATEXby using the math mode: T , ρ, p. Although it is common to lump vectors and matrices/tensors together by using bold fonts, I have decided in the interest of clarity to distinguish between those: vectors are denoted by an arrow atop the quantity, e.g. ~ν, ~g , while matrices and tensors are in bold M , σ, etc ... Also I use the · notation between two vectors to denote a dot product ~u · ~v = ui vi or a matrix-vector multiplication M · ~a = Mij aj . If there is no · between vectors, it means that the result ~a~b = ai bj is a matrix. 7 8 23 24 full matrix Schur comp. CG Schur comp. PCG full matrix full matrix full matrix full matrix mixed mixed analytical benchmark convection box † † † † † † † † † † † † † elastomechanics mixed mixed mixed mixed mixed mixed penalty penalty mixed † numerical benchmark Q1 × P0 Q1 × P0 Q1 × P0 Q2 × Q1 Q2 × Q1 Q3 × Q2 Q1 × P0 Q1 × P0 R-T Q1 × Q1 stab Q1 × P0 Q1 × P0 penalty analytical benchmark 14 15 16 17 18 19 20 21 22 physical problem analytical benchmark Stokes sphere Blankenbach et al., 1989 Lid driven cavity SolCx benchmark SolKz benchmark SolVi benchmark Indentor annulus benchmark Stokes sphere Stokes sphere analytical benchmark + consistent press recovery Stokes sphere + markers averaging analytical benchmark analytical benchmark Stokes sphere Burstedde benchmark analytical benchmark analytical benchmark Busse et al., 1993 analytical benchmark analytical benchmark compressible Q1 × P0 full matrix formulation penalty penalty penalty penalty penalty penalty penalty penalty penalty penalty mixed penalty nonlinear 13 outer solver time stepping 1 2 3 4 5 6 7 8 9 10 11 12 element Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 temperature List of tutorials 3D tutorial number 2 elastomechanics numerical benchmark analytical benchmark compressible nonlinear physical problem Rayleigh-Taylor instability Slab detachment CBF benchmarks Tosi et al, 2015 Open Boundary conditions Cons. Vel. Interp (cvi) Cons. Vel. Interp (cvi) analytical benchmark convection in annulus elastic Cartesian aquarium time stepping formulation mixed mixed mixed mixed mixed X X mixed penalty temperature outer solver full matrix full matrix full matrix full matrix full matrix X X full matrix 3D tutorial number 9 element Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 × P0 Q1 , Q2 Q1 , Q2 Q1 × P0 Q1 × P0 Q1 25 26 † 27 † † 28 † † † † 29 † 30 † † 31 † † † 32 † 33 † † † 34 † † † 35 36 Q1 elastic annulus aquarium † † † 37 Q1 , Q2 X X population control, bmw test † † 38 Critical Rayleigh number XX Analytical benchmark means that an analytical solution exists while numerical benchmark means that a comparison with other code(s) has been carried out. 3 The physical equations Symbol t x, y, z r, θ r, θ, z r, θ, φ ~ν ρ η λ T ~ ∇ ~ ∇· p ε̇(~ν) α k Cp H βT τ σ 3.1 meaning Time Cartesian coordinates Polar coordinates Cylindrical coordinates Spherical coordinates velocity vector mass density dynamic viscosity penalty parameter temperature gradient operator divergence operator pressure strain rate tensor thermal expansion coefficient thermal conductivity Heat capacity intrinsic specific heat production isothermal compressibility deviatoric stress tensor full stress tensor unit s m m,m,-,m m,-,m· s−1 kg/m3 Pa· s Pa· s K m−1 m−1 Pa s−1 K−1 W/(m · K) J/K W/kg Pa−1 Pa Pa The heat transport equation - energy conservation equation Let us start from the heat transport equation as shown in Schubert, Turcotte and Olson [119]: ρCp Dp DT ~ · k ∇T ~ + Φ + ρH − αT =∇ Dt Dt with D/Dt being the total derivatives so that ∂T DT ~ = + ~ν · ∇T Dt ∂t Dp ∂p ~ = + ~ν · ∇p Dt ∂t Solving for temperature, this equation is often rewritten as follows: ρCp DT ~ · k ∇T ~ = αT Dp + Φ + ρH −∇ Dt Dt ~ ν. A note on the shear heating term Φ: In many publications, Φ is given by Φ = τij ∂j ui = τ : ∇~ 10 Φ = τij ∂j ui = = = = = 2η ε̇dij ∂j ui 1 2η ε̇dij ∂j ui + ε̇dji ∂i uj 2 1 d 2η ε̇ij ∂j ui + ε̇dij ∂i uj 2 1 2η ε̇dij (∂j ui + ∂i uj ) 2 2η ε̇dij ε̇ij 2η ε̇d : ε̇ 1 ~ = 2η ε̇d : ε̇d + (∇ · ~ν)1 3 d d ~ · ~ν) = 2η ε̇ : ε̇ + 2η ε̇d : 1(∇ = = 2η ε̇d : ε̇d (1) Finally ~ ν = 2η ε̇d : ε̇d = 2η (ε̇dxx )2 + (ε̇dyy )2 + 2(ε̇dxy )2 Φ = τ : ∇~ 3.2 The momentum conservation equations Because the Prandlt number is virtually zero in Earth science applications the Navier Stokes equations reduce to the Stokes equation: ~ · σ + ρ~g = 0 ∇ Since σ = −p1 + τ it also writes ~ +∇ ~ · τ + ρ~g = 0 −∇p Using the relationship τ = 2η ε̇d we arrive at ~ +∇ ~ · (2η ε̇d ) + ρ~g = 0 −∇p 3.3 The mass conservation equations The mass conservation equation is given by Dρ ~ · ~ν = 0 + ρ∇ Dt or, ∂ρ ~ + ∇ · (ρ~ν) = 0 ∂t ~ = 0, i.e. Dρ/Dt = 0 and the remaining In the case of an incompressible flow, then ∂ρ/∂t = 0 and ∇ρ equation is simply: ~ · ~ν = 0 ∇ 11 3.4 The equations in ASPECT manual The following is lifted off the ASPECT manual. We focus on the system of equations in a d = 2- or d = 3-dimensional domain Ω that describes the motion of a highly viscous fluid driven by differences in the gravitational force due to a density that depends on the temperature. In the following, we largely follow the exposition of this material in Schubert, Turcotte and Olson [119]. Specifically, we consider the following set of equations for velocity u, pressure p and temperature T : ~ · ~ν)1 + ∇p ~ = ρ~g ~ · 2η ε̇(~ν) − 1 (∇ in Ω, (2) −∇ 3 ~ · (ρ~v ) = 0 ∇ in Ω, (3) ∂T ~ ~ · k ∇T ~ = ρH ρCp + ~ν · ∇T −∇ ∂t 1 ~ 1 ~ + 2η ε̇(v) − (∇ · ~ν)1 : ε̇(v) − (∇ · ~ν)1 (4) 3 3 ~ + αT v · ∇p in Ω, ~ ν + ∇~ ~ νT ) is the symmetric gradient of the velocity (often called the strain rate). where ε̇(~ν) = 21 (∇~ In this set of equations, (253) and (254) represent the compressible Stokes equations in which v = v(x, t) is the velocity field and p = p(x, t) the pressure field. Both fields depend on space x and time t. Fluid flow is driven by the gravity force that acts on the fluid and that is proportional to both the density of the fluid and the strength of the gravitational pull. Coupled to this Stokes system is equation (255) for the temperature field T = T (x, t) that contains heat conduction terms as well as advection with the flow velocity v. The right hand side terms of this equation correspond to • internal heat production for example due to radioactive decay; • friction (shear) heating; • adiabatic compression of material; In order to arrive at the set of equations that ASPECT solves, we need to • neglect the ∂p/∂t. WHY? • neglect the ∂ρ/∂t . WHY? from equations above. —————————————Also, their definition of the shear heating term Φ is: Φ = kB (∇ · v)2 + 2η ε̇d : ε̇d For many fluids the bulk viscosity kB is very small and is often taken to be zero, an assumption known as the Stokes assumption: kB = λ + 2η/3 = 0. Note that η is the dynamic viscosity and λ the second viscosity. Also, τ = 2η ε̇ + λ(∇ · v)1 but since kB = λ + 2η/3 = 0, then λ = −2η/3 so 2 τ = 2η ε̇ − η(∇ · v)1 = 2η ε̇d 3 12 3.5 the Boussinesq approximation: an Incompressible flow [from aspect manual] The Boussinesq approximation assumes that the density can be considered constant in all occurrences in the equations with the exception of the buoyancy term on the right hand side of (253). The primary result of this assumption is that the continuity equation (254) will now read ∇·v =0 This implies that the strain rate tensor is deviatoric. Under the Boussinesq approximation, the equations are much simplified: −∇ · [2η ε̇(v)] + ∇p = ρg ∇ · (ρv) = 0 ∂T + v · ∇T − ∇ · k∇T = ρH ρ0 C p ∂t in Ω, in Ω, (5) (6) in Ω (7) Note that all terms on the rhs of the temperature equations have disappeared, with the exception of the source term. 13 3.6 Stokes equation for elastic medium What follows is mostly borrowed from Becker & Kaus lecture notes. The strong form of the PDE that governs force balance in a medium is given by ∇·σ+f =0 where σ is the stress tensor and f is a body force. The stress tensor is related to the strain tensor through the generalised Hooke’s law: X σij = Cijkl kl (8) kl where C is the fourth-order elastic tensor. In the case of an isotropic material, this relationship simplifies to σij = λkk δij + 2µij or, σ = λ(∇ · u)1 + 2µ (9) where λ is the Lamé parameter and µ is the shear modulus1 . The term ∇ · u is the isotropic dilation. The strain tensor is related to the displacement as follows: = 1 (∇u + ∇uT ) 2 The incompressibility (bulk modulus), K, is defined as p = −K∇ · u where p is the pressure with p 1 = − T r(σ) 3 1 = − [λ(∇ · u)T r[1] + 2µT r[]] 3 1 = − [λ(∇ · u)3 + 2µ(∇ · u)] 3 2 = −[λ + µ](∇ · u) 3 (10) so that K = λ + 23 µ. Remark : Eq. (8) and (9) are analogous to the ones that one has to solve in the context of viscous flow using the penalty method. In this case λ is the penalty coefficient, u is the velocity, and µ is then the dynamic viscosity. The Lamé parameter and the shear modulus are also linked to ν the poisson ratio, and E, Young’s modulus: 2ν νE λ=µ = with E = 2µ(1 + ν) 1 − 2ν (1 + ν)(1 − 2ν) The shear modulus, expressed often in GPa, describes the material’s response to shear stress. The poisson ratio describes the response in the direction orthogonal to uniaxial stress. The Young modulus, expressed in GPa, describes the material’s strain response to uniaxial stress in the direction of this stress. 1 It is also sometimes written G 14 3.7 The strain rate tensor in all coordinate systems The strain rate tensor ε̇ is given by ε̇ = 3.7.1 3.7.2 3.7.3 1 ~ ~ νT ) (∇~ν + ∇~ 2 (11) Cartesian coordinates ε̇xx = ε̇yy = ε̇zz = ε̇yx = ε̇xy = ε̇zx = ε̇xz = ε̇zy = ε̇yz = ∂u ∂x ∂v ∂y ∂w ∂z 1 ∂u ∂v + 2 ∂y ∂x 1 ∂u ∂w + 2 ∂z ∂x 1 ∂v ∂w + 2 ∂z ∂y (12) (13) (14) (15) (16) (17) Polar coordinates ε̇rr = ε̇θθ = ε̇θr = ε̇rθ = ∂vr ∂r vr 1 ∂vθ + r r ∂θ 1 ∂vθ vθ 1 ∂vr − + 2 ∂r r r ∂θ (18) (19) (20) Cylindrical coordinates http://eml.ou.edu/equation/FLUIDS/STRAIN/STRAIN.HTM 3.7.4 Sperical coordinates ε̇rr = ε̇θθ = ε̇φφ = ε̇θr = ε̇rθ = ε̇φr = ε̇rφ = ε̇φθ = ε̇θφ = ∂vr ∂r vr 1 ∂vθ + r r ∂θ 1 ∂vφ r sin θ ∂φ 1 ∂ vθ 1 ∂vr r ( )+ 2 ∂r r r ∂θ 1 1 ∂vr ∂ vφ +r ( ) 2 r sin θ ∂φ ∂r r 1 sin θ ∂ vφ 1 ∂vθ ( )+ 2 r ∂θ sin θ r sin θ ∂φ 15 (21) (22) (23) (24) (25) (26) 3.8 Boundary conditions In mathematics, the Dirichlet (or first-type) boundary condition is a type of boundary condition, named after Peter Gustav Lejeune Dirichlet. When imposed on an ODE or PDE, it specifies the values that a solution needs to take on along the boundary of the domain. Note that a Dirichlet boundary condition may also be referred to as a fixed boundary condition. The Neumann (or second-type) boundary condition is a type of boundary condition, named after Carl Neumann. When imposed on an ordinary or a partial differential equation, the condition specifies the values in which the derivative of a solution is applied within the boundary of the domain. It is possible to describe the problem using other boundary conditions: a Dirichlet boundary condition specifies the values of the solution itself (as opposed to its derivative) on the boundary, whereas the Cauchy boundary condition, mixed boundary condition and Robin boundary condition are all different types of combinations of the Neumann and Dirichlet boundary conditions. 3.8.1 The Stokes equations You may find the following terms in the computational geodynamics literature: • free surface: this means that no force is acting on the surface, i.e. σ · ~n = ~0. It is usually used on the top boundary of the domain and allows for topography evolution. • free slip: ~ν · ~n = 0 and (σ · ~n) × ~n = ~0. This condition ensures a frictionless flow parallel to the boundary where it is prescribed. • no slip: this means that the velocity (or displacement) is exactly zero on the boundary, i.e. ~ν = ~0. • prescribed velocity: ~ν = ~νbc • stress b.c.: • open .b.c.: see fieldstone 29. 3.8.2 The heat transport equation There are two types of boundary conditions for this equation: temperature boundary conditions (Dirichlet boundary conditions) and heat flux boundary conditions (Neumann boundary conditions). 16 3.9 Meaningful physical quantities • Velocity (m/s): • Root mean square velocity (m/s): R νrms = |~ν|2 dΩ dΩ Ω ΩR 1/2 = 1 VΩ Z 1/2 2 |~ν| dΩ (27) Ω In Cartesian coordinates, for a cuboid domain of size Lx × Ly × Lz, the vrms is simply given by: νrms = 1 Lx Ly Lz Z Lx Ly Z !1/2 Lz Z 2 2 2 (u + v + w )dxdydz 0 (28) 0 0 In the case of an annulus domain, although calculations are carried out in Cartesian coordinates, it makes sense to look at the radial velocity component vr and the tangential velocity component vθ , and their respective root mean square averages: vr |rms = vθ |rms = 1 VΩ Z 1 VΩ Z vr2 1/2 (29) dΩ Ω vθ2 dΩ 1/2 (30) Ω • Pressure (Pa): • Stress (Pa): • Strain (X): • Strain rate (s−1 ): • Rayleigh number (X): • Prandtl number (X): • Nusselt number (X): the Nusselt number (Nu) is the ratio of convective to conductive heat transfer across (normal to) the boundary. The conductive component is measured under the same conditions as the heat convection but with a (hypothetically) stagnant (or motionless) fluid. In practice the Nusselt number Nu of a layer (typically the mantle of a planet) is defined as follows: Nu = q qc (31) where q is the heat transferred by convection while qc = k∆T /D is the amount of heat that would be conducted through a layer of thickness D with a temperature difference ∆T across it with k being the thermal conductivity. For 2D Cartesian systems of size (Lx ,Ly ) the Nu is computed [15] Nu = 1 Lx R Lx 0 R Lx 1 − Lx 0 k ∂T ∂y (x, y = Ly )dx kT (x, y = 0)/Ly dx R Lx 0 ∂T ∂y = −Ly R Lx 0 (x, y = Ly )dx T (x, y = 0)dx i.e. it is the mean surface temperature gradient over the mean bottom temperature. finish. not happy with definition. Look at literature Note that in the case when no convection takes place then the measured heat flux at the top is the one obtained from a purely conductive profile which yields Nu=1. Note that a relationship Ra ∝ Nuα exists between the Rayleigh number Ra and the Nusselt number Nu in convective systems, see [142] and references therein. 17 Turning now to cylindrical geometries with inner radius R1 and outer radius R2 , we define f = R1 /R2 . A small value of f corresponds to a high degree of curvature. We assume now that R2 − R1 = 1, so that R2 = 1/(1 − f ) and R1 = f /(1 − f ). Following [72], the Nusselt number at the inner and outer boundaries are: Nuinner = Nuouter = f ln f 1 1 − f 2π Z ln f 1 1 − f 2π Z 2π 0 2π 0 ∂T ∂r ∂T ∂r dθ (32) dθ (33) r=R1 r=R2 Note that a conductive geotherm in such an annulus between temperatures T1 and T2 is given by Tc (r) = ln(r/R2 ) ln(r(1 − f )) = ln(R1 /R2 ) ln f so that ∂Tc 1 1 = ∂r r ln f We then find: Nuinner Nuouter = = f ln f 1 1 − f 2π Z ln f 1 1 − f 2π Z 2π ∂Tc ∂r ∂Tc ∂r 0 0 2π dθ = f ln f 1 1 =1 1 − f R1 ln f (34) dθ = ln f 1 1 =1 1 − f R2 ln f (35) r=R1 r=R2 As expected, the recovered Nusselt number at both boundaries is exactly 1 when the temperature field is given by a steady state conductive geotherm. derive formula for Earth size R1 and R2 • Temperature (K): • Viscosity (Pa.s): • Density (kg/m3 ): • Heat capacity cp (J.K −1 .kg −1 ): It is the measure of the heat energy required to increase the temperature of a unit quantity of a substance by unit degree. • Heat conductivity, or thermal conductivity k (W.m−1 .K −1 ). It is the property of a material that indicates its ability to conduct heat. It appears primarily in Fourier’s Law for heat conduction. • Heat diffusivity: κ = k/(ρcp ) (m2 .s−1 ). Substances with high thermal diffusivity rapidly adjust their temperature to that of their surroundings, because they conduct heat quickly in comparison to their volumetric heat capacity or ’thermal bulk’. • thermal expansion α (K−1 ): it is the tendency of a matter to change in volume in response to a change in temperature. 18 4 The building blocks of the Finite Element Method 4.1 Numerical integration As we will see later, using the Finite Element method to solve problems involves computing integrals which are more often than not too complex to be computed analytically/exactly. We will then need to compute them numerically. [wiki] In essence, the basic problem in numerical integration is to compute an approximate solution to a definite integral Z b f (x)dx a to a given degree of accuracy. This problem has been widely studied [?] and we know that if f (x) is a smooth function, and the domain of integration is bounded, there are many methods for approximating the integral to the desired precision. There are several reasons for carrying out numerical integration. • The integrand f (x) may be known only at certain points, such as obtained by sampling. Some embedded systems and other computer applications may need numerical integration for this reason. • A formula for the integrand may be known, but it may be difficult or impossible to find an antiderivative that is an elementary function. An example of such an integrand is f (x) = exp(−x2 ), the antiderivative of which (the error function, times a constant) cannot be written in elementary form. • It may be possible to find an antiderivative symbolically, but it may be easier to compute a numerical approximation than to compute the antiderivative. That may be the case if the antiderivative is given as an infinite series or product, or if its evaluation requires a special function that is not available. 4.1.1 in 1D - theory The simplest method of this type is to let the interpolating function be a constant function (a polynomial of degree zero) that passes through the point ((a + b)/2, f ((a + b)/2)). This is called the midpoint rule or rectangle rule. b Z f (x)dx ' (b − a)f ( a a+b ) 2 insert here figure The interpolating function may be a straight line (an affine function, i.e. a polynomial of degree 1) passing through the points (a, f (a)) and (b, f (b)). This is called the trapezoidal rule. Z b f (x)dx ' (b − a) a f (a) + f (b) 2 insert here figure For either one of these rules, we can make a more accurate approximation by breaking up the interval [a, b] into some number n of subintervals, computing an approximation for each subinterval, then adding up all the results. This is called a composite rule, extended rule, or iterated rule. For example, the composite trapezoidal rule can be stated as ! Z b n−1 b − a f (a) X b−a f (b) f (x)dx ' + f (a + k )+ n 2 n 2 a k=1 where the subintervals have the form [kh, (k + 1)h], with h = (b − a)/n and k = 0, 1, 2, . . . , n − 1. 19 a) b) The interval [−2, 2] is broken into 16 sub-intervals. The blue lines correspond to the approximation of the red curve by means of a) the midpoint rule, b) the trapezoidal rule. There are several algorithms for numerical integration (also commonly called ’numerical quadrature’, or simply ’quadrature’) . Interpolation with polynomials evaluated at equally spaced points in [a, b] yields the NewtonCotes formulas, of which the rectangle rule and the trapezoidal rule are examples. If we allow the intervals between interpolation points to vary, we find another group of quadrature formulas, such as the Gauss(ian) quadrature formulas. A Gaussian quadrature rule is typically more accurate than a NewtonCotes rule, which requires the same number of function evaluations, if the integrand is smooth (i.e., if it is sufficiently differentiable). An n−point Gaussian quadrature rule, named after Carl Friedrich Gauss, is a quadrature rule constructed to yield an exact result for polynomials of degree 2n − 1 or less by a suitable choice of the points xi and weights wi for i = 1, . . . , n. The domain of integration for such a rule is conventionally taken as [−1, 1], so the rule is stated as Z +1 f (x)dx = −1 n X wiq f (xiq ) iq =1 In this formula the xiq coordinate is the i-th root of the Legendre polynomial Pn (x). It is important to note that a Gaussian quadrature will only produce good results if the function f (x) is well approximated by a polynomial function within the range [−1, 1]. As a consequence, the method is not, for example, suitable for functions with singularities. Gauss-Legendre points and their weights. As shown in the above table, it can be shown that the weight values must fulfill the following condition: X wiq = 2 (36) iq and it is worth noting that all quadrature point coordinates are symmetrical around the origin. Since most quadrature formula are only valid on a specific interval, we now must address the problem of their use outside of such intervals. The solution turns out to be quite simple: one must carry out a change of variables from the interval [a, b] to [−1, 1]. We then consider the reduced coordinate r ∈ [−1, 1] such that r= 2 (x − a) − 1 b−a 20 This relationship can be reversed such that when r is known, its equivalent coordinate x ∈ [a, b] can be computed: b−a (1 + r) + a x= 2 From this it follows that b−a dx = dr 2 and then Z Z b n b−a X b − a +1 f (r)dr ' f (x)dx = wi f (riq ) 2 2 i =1 q −1 a q 4.1.2 in 1D - examples example 1 Since we know how to carry out any required change of variables, we choose for simplicity a = −1, b = +1. Let us take for example f (x) = π. Then we can compute the integral of this function over the interval [a, b] exactly: Z +1 Z +1 f (x)dx = π dx = 2π I= −1 −1 We can now use a Gauss-Legendre formula to compute this same integral: Z +1 f (x)dx = Igq = −1 nq X wiq f (xiq ) = iq =1 nq X wiq π = π iq =1 nq X wiq = 2π iq =1 | {z } =2 where we have used the property of the weight values of Eq.(36). Since the actual number of points was never specified, this result is valid for all quadrature rules. example 2 Let us now take f (x) = mx + p and repeat the same exercise: Z +1 Z +1 1 I= f (x)dx = (mx + p)dx = [ mx2 + px]+1 −1 = 2p 2 −1 −1 Z +1 Igq = f (x)dx = −1 nq X wiq f (xiq ) = iq =1 nq X nq X wiq (mxiq + p) = m iq =1 wiq xiq +p iq =1 | nq X wiq = 2p iq =1 {z =0 } | {z } =2 since the quadrature points are symmetric w.r.t. to zero on the x-axis. Once again the quadrature is able to compute the exact value of this integral: this makes sense since an n-point rule exactly integrates a 2n − 1 order polynomial such that a 1 point quadrature exactly integrates a first order polynomial like the one above. example 3 Let us now take f (x) = x2 . We have Z +1 Z +1 1 2 I= f (x)dx = x2 dx = [ x3 ]+1 −1 = 3 3 −1 −1 and Z +1 Igq = f (x)dx = −1 nq X iq =1 nq X wiq f (xiq ) = iq =1 (1) • nq = 1: xiq = 0, wiq = 2. Igq = 0 √ √ (1) (2) (1) (2) • nq = 2: xq = −1/ 3, xq = 1/ 3, wq = wq = 1. Igq = • It also works ∀nq > 2 ! 21 2 3 wiq x2iq 4.1.3 in 2D/3D - theory Let us now turn to a two-dimensional integral of the form Z +1 Z +1 f (x, y)dxdy I= −1 −1 The equivalent Gaussian quadrature writes: Igq ' nq nq X X f (xiq , yjq )wiq wjq iq =1 jq 4.2 The mesh 4.3 A bit of FE terminology We introduce here some terminology for efficient element descriptions [60]: • For triangles/tetrahedra, the designation Pm × Pn means that each component of the velocity is approximated by continuous piecewise complete Polynomials of degree m and pressure by continuous piecewise complete Polynomials of degree n. For example P2 × P1 means u ∼ a1 + a2 x + a3 y + a4 xy + a5 x2 + a6 y 2 with similar approximations for v, and p ∼ b1 + b2 x + b3 y Both velocity and pressure are continuous across element boundaries, and each triangular element contains 6 velocity nodes and three pressure nodes. • For the same families, Pm × P−n is as above, except that pressure is approximated via piecewise discontinuous polynomials of degree n. For instance, P2 × P−1 is the same as P2 P1 except that pressure is now an independent linear function in each element and therefore discontinuous at element boundaries. • For quadrilaterals/hexahedra, the designation Qm × Qn means that each component of the velocity is approximated by a continuous piecewise polynomial of degree m in each direction on the quadrilateral and likewise for pressure, except that the polynomial is of degree n. For instance, Q2 × Q1 means u ∼ a1 + a2 x + a3 y + a4 xy + a5 x2 + a6 y 2 + a7 x2 y + a8 xy 2 + a9 x2 y 2 and p ∼ b1 + b2 x + b3 y + b4 xy • For these same families, Qm × Q−n is as above, except that the pressure approximation is not continuous at element boundaries. • Again for the same families, Qm × P−n indicates the same velocity approximation with a pressure approximation that is a discontinuous complete piecewise polynomial of degree n (not of degree n in each direction !) + • The designation Pm or Q+ m means that some sort of bubble function was added to the polynomial approximation for the velocity. You may also find the term ’enriched element’ in the literature. • Finally, for n = 0, we have piecewise-constant pressure, and we omit the minus sign for simplicity. Another point which needs to be clarified is the use of so-called ’conforming elements’ (or ’nonconforming elements’). Following again [60], conforming velocity elements are those for which the basis functions for a subset of H 1 for the continuous problem (the first derivatives and their squares are integrable in Ω). For instance, the rotated Q1 × P0 element of Rannacher and Turek (see section ??) is such that the velocity is discontinous across element edges, so that the derivative does not exist there. Another typical example of non-conforming element is the Crouzeix-Raviart element [34]. 22 4.4 4.4.1 Elements and basis functions in 1D Linear basis functions (Q1 ) Let f (r) be a C 1 function on the interval [−1 : 1] with f (−1) = f1 and f (1) = f2 . Let us assume that the function f (r) is to be approximated on [−1, 1] by the first order polynomial f (r) = a + br (37) Then it must fulfill f (r = −1) = a − b = f1 f (r = +1) = a + b = f2 This leads to 1 1 (f1 + f2 ) b = (−f1 + f2 ) 2 2 and then replacing a, b in Eq. (37) by the above values on gets 1 1 f (r) = (1 − r) f1 + (1 + r) f2 2 2 a= or f (r) = 2 X Ni (r)f1 i=1 with 4.4.2 N1 (r) = N2 (r) = 1 (1 − r) 2 1 (1 + r) 2 (38) Quadratic basis functions (Q2 ) Let f (r) be a C 1 function on the interval [−1 : 1] with f (−1) = f1 , f (0) = f2 and f (1) = f3 . Let us assume that the function f (r) is to be approximated on [−1, 1] by the second order polynomial f (r) = a + br + cr2 (39) Then it must fulfill f (r = −1) f (r = 0) f (r = +1) = a − b + c = f1 = a = f2 = a + b + c = f3 23 This leads to 1 1 (−f 1 + f 3) c = (f1 + f3 − 2f2 ) 2 2 and then replacing a, b, c in Eq. (39) by the above values on gets 1 1 2 f (r) = r(r − 1) f1 + (1 − r )f2 + r(r + 1) f3 2 2 a = f2 b= or, f (r) = 3 X Ni (r)fi i=1 with 4.4.3 N1 (r) = N2 (r) = N3 (r) = 1 r(r − 1) 2 (1 − r2 ) 1 r(r + 1) 2 (40) Cubic basis functions (Q3 ) The 1D basis polynomial is given by f (r) = a + br + cr2 + dr3 with the nodes at position -1,-1/3, +1/3 and +1. = a − b + c − d = f1 c d b = f2 f (−1/3) = a − + − 3 9 27 b c d f (+1/3) = a − + − = f3 3 9 27 f (+1) = a + b + c + d = f4 f (−1) Adding the first and fourth equation and the second and third, one arrives at f1 + f4 = 2a + 2c f2 + f3 = 2a + 2c 9 and finally: 1 (−f1 + 9f2 + 9f3 − f4 ) 16 9 c= (f1 − f2 − f3 + f4 ) 16 Combining the original 4 equations in a different way yields a= 2b 2d + = f3 − f2 3 27 2b + 2d = f4 − f1 so that 1 (f1 − 27f2 + 27f3 − f4 ) 16 9 d= (−f1 + 3f2 − 3f3 + f4 ) 16 b= Finally, 24 = a + b + cr2 + dr3 1 = (−1 + r + 9r2 − 9r3 )f1 16 1 + (9 − 27r − 9r2 + 27r3 )f2 16 1 + (9 + 27r − 9r2 − 27r3 )f3 16 1 + (−1 − r + 9r2 + 9r3 )f4 16 4 X = Ni (r)fi f (r) i=1 where N1 = N2 = N3 = N4 = 1 (−1 + r + 9r2 − 9r3 ) 16 1 (9 − 27r − 9r2 + 27r3 ) 16 1 (9 + 27r − 9r2 − 27r3 ) 16 1 (−1 − r + 9r2 + 9r3 ) 16 Verification: • Let us assume f (r) = C, then fˆ(r) = X Ni (r)fi = X i Ni C = C X Ni = C i so that a constant function is exactly reproduced, as expected. • Let us assume f (r) = r, then f1 = −1, f2 = −1/3, f3 = 1/3 and f4 = +1. We then have X fˆ(r) = Ni (r)fi 1 1 = −N1 (r) − N2 (r) + N3 (r) + N4 (r) 3 3 = [−(−1 + r + 9r2 − 9r3 ) 1 − (9 − 27r − 9r2 − 27r3 ) 3 1 + (9 + 27r − 9r2 + 27r3 ) 3 +(−1 − r + 9r2 + 9r3 )]/16 = [−r + 9r + 9r − r]/16 + ...0... = r (41) The basis functions derivative are given by 25 ∂N1 ∂r ∂N2 ∂r ∂N3 ∂r ∂N4 ∂r = = = = 1 (1 + 18r − 27r2 ) 16 1 (−27 − 18r + 81r2 ) 16 1 (+27 − 18r − 81r2 ) 16 1 (−1 + 18r + 27r2 ) 16 Verification: • Let us assume f (r) = C, then ∂ fˆ ∂r X ∂Ni = i = C fi ∂r X ∂Ni ∂r i C [(1 + 18r − 27r2 ) 16 +(−27 − 18r + 81r2 ) = +(+27 − 18r − 81r2 ) +(−1 + 18r + 27r2 )] = 0 • Let us assume f (r) = r, then f1 = −1, f2 = −1/3, f3 = 1/3 and f4 = +1. We then have ∂ fˆ ∂r = X ∂Ni i ∂r fi 1 [−(1 + 18r − 27r2 ) 16 1 − (−27 − 18r + 81r2 ) 3 1 + (+27 − 18r − 81r2 ) 3 +(−1 + 18r + 27r2 )] 1 [−2 + 18 + 54r2 − 54r2 ] = 16 = 1 = 4.5 Elements and basis functions in 2D Let us for a moment consider a single quadrilateral element in the xy-plane, as shown on the following figure: 26 Let us assume that we know the values of a given field u at the vertices. For a given point M inside the element in the plane, what is the value of the field u at this point? It makes sense to postulate that uM = u(xM , yM ) will be given by uM = φ(u1 , u2 , u3 , u4 , xM , yM ) where φ is a function to be determined. Although φ is not unique, we can decide to express the value uM as a weighed sum of the values at the vertices ui . One option could be to assign all four vertices the same weight, say 1/4 so that uM = (u1 + u2 + u3 + u4 )/4, i.e. uM is simply given by the arithmetic mean of the vertices values. This approach suffers from a major drawback as it does not use the location of point M inside the element. For instance, when (xM , yM ) → (x2 , y2 ) we expect uM → u2 . In light of this, we could now assume that the weights would depend on the position of M in a continuous fashion: 4 X u(xM , yM ) = Ni (xM , yM ) ui i=1 where the Ni are continous (”well behaved”) functions which have the property: Ni (xj , yj ) = δij or, in other words: N3 (x1 , y1 ) = 0 (42) N3 (x2 , y2 ) = 0 (43) N3 (x3 , y3 ) = 1 (44) N3 (x4 , y4 ) = 0 (45) The functions Ni are commonly called basis functions. Omitting the M subscripts for any point inside the element, the velocity components u and v are given by: û(x, y) = 4 X Ni (x, y) ui (46) Ni (x, y) vi (47) i=1 v̂(x, y) = 4 X i=1 Rather interestingly, one can now easily compute velocity gradients (and therefore the strain rate tensor) since we have assumed the basis functions to be ”well behaved” (in this case differentiable): 4 ˙xx (x, y) = ∂u X ∂Ni = ui ∂x ∂x i=1 ˙yy (x, y) = ∂v X ∂Ni = vi ∂y ∂y i=1 = 1 ∂u 1 ∂v 1 X ∂Ni 1 X ∂Ni + = ui + vi 2 ∂y 2 ∂x 2 i=1 ∂y 2 i=1 ∂x (48) 4 (49) 4 ˙xy (x, y) 4 (50) How we actually obtain the exact form of the basis functions is explained in the coming section. 4.5.1 Bilinear basis functions in 2D (Q1 ) In this section, we place ourselves in the most favorables case, i.e. the element is a square defined by −1 < r < 1, −1 < s < 1 in the Cartesian coordinates system (r, s): 27 3===========2 | | | | | | | | | | 0===========1 (r_0,s_0)=(-1,-1) (r_1,s_1)=(+1,-1) (r_2,s_2)=(+1,+1) (r_3,s_3)=(-1,+1) This element is commonly called the reference element. How we go from the (x, y) coordinate system to the (r, s) once and vice versa will be dealt later on. For now, the basis functions in the above reference element and in the reduced coordinates system (r, s) are given by: N1 (r, s) = 0.25(1 − r)(1 − s) N2 (r, s) = 0.25(1 + r)(1 − s) N3 (r, s) = 0.25(1 + r)(1 + s) N4 (r, s) = 0.25(1 − r)(1 + s) The partial derivatives of these functions with respect to r ans s automatically follow: ∂N1 (r, s) = −0.25(1 − s) ∂r ∂N2 (r, s) = +0.25(1 − s) ∂r ∂N3 (r, s) = +0.25(1 + s) ∂r ∂N4 (r, s) = −0.25(1 + s) ∂r ∂N1 (r, s) = −0.25(1 − r) ∂s ∂N2 (r, s) = −0.25(1 + r) ∂s ∂N3 (r, s) = +0.25(1 + r) ∂s ∂N4 (r, s) = +0.25(1 − r) ∂s Let us go back to Eq.(47). And let us assume that the function v(r, s) = C so that vi = C for i = 1, 2, 3, 4. It then follows that v̂(r, s) = 4 X Ni (r, s) vi = C 4 X Ni (r, s) = C[N1 (r, s) + N2 (r, s) + N3 (r, s) + N4 (r, s)] = C i=1 i=1 This is a very important property: if the v function used to assign values at the vertices is constant, then the value of v̂ anywhere in the element is exactly C. If we now turn to the derivatives of v with respect to r and s: 4 4 4 4 X ∂Ni X ∂Ni ∂v̂ (r, s) = (r, s) vi = C (r, s) = C [−0.25(1 − s) + 0.25(1 − s) + 0.25(1 + s) − 0.25(1 + s)] = 0 ∂r ∂r ∂r i=1 i=1 X ∂Ni X ∂Ni ∂v̂ (r, s) = (r, s) vi = C (r, s) = C [−0.25(1 − r) − 0.25(1 + r) + 0.25(1 + r) + 0.25(1 − r)] = 0 ∂s ∂s ∂s i=1 i=1 We reassuringly find that the derivative of a constant field anywhere in the element is exactly zero. 28 If we now choose v(r, s) = ar + bs with a and b two constant scalars, we find: v̂(r, s) = 4 X Ni (r, s) vi (51) Ni (r, s)(ari + bsi ) (52) i=1 = 4 X i=1 = a 4 X Ni (r, s)ri +b 4 X (53) Ni (r, s)si i=1 i=1 {z | } r | {z s } = a [0.25(1 − r)(1 − s)(−1) + 0.25(1 + r)(1 − s)(+1) + 0.25(1 + r)(1 + s)(+1) + 0.25(1 − r)(1 + s)(−1)] + b [0.25(1 − r)(1 − s)(−1) + 0.25(1 + r)(1 − s)(−1) + 0.25(1 + r)(1 + s)(+1) + 0.25(1 − r)(1 + s)(+1)] = a [−0.25(1 − r)(1 − s) + 0.25(1 + r)(1 − s) + 0.25(1 + r)(1 + s) − 0.25(1 − r)(1 + s)] + b [−0.25(1 − r)(1 − s) − 0.25(1 + r)(1 − s) + 0.25(1 + r)(1 + s) + 0.25(1 − r)(1 + s)] = ar + bs (54) verify above eq. This set of bilinear shape functions is therefore capable of exactly representing a bilinear field. The derivatives are: ∂v̂ (r, s) ∂r = 4 X ∂Ni i=1 = a ∂r (r, s) vi 4 X ∂Ni i=1 ∂r (r, s)ri + b (55) 4 X ∂Ni i=1 ∂r (r, s)si = a [−0.25(1 − s)(−1) + 0.25(1 − s)(+1) + 0.25(1 + s)(+1) − 0.25(1 + s)(−1)] + b [−0.25(1 − s)(−1) + 0.25(1 − s)(−1) + 0.25(1 + s)(+1) − 0.25(1 + s)(+1)] a [(1 − s) + (1 − s) + (1 + s) + (1 + s)] 4 b [(1 − s) − (1 − s) + (1 + s) − (1 + s)] 4 a = + = (56) (57) Here again, we find that the derivative of the bilinear field inside the element is exact: ∂∂rv̂ = ∂v ∂r . However, following the same methodology as above, one can easily prove that this is no more true for polynomials of degree strivtly higher than 1. This fact has serious consequences: if the solution to the problem at hand is for instance a parabola, the Q1 shape functions cannot represent the solution properly, but only by approximating the parabola in each element by a line. As we will see later, Q2 basis functions can remedy this problem by containing themselves quadratic terms. 4.5.2 Biquadratic basis functions in 2D (Q2 ) This element is part of the so-called LAgrange family. citation needed Inside an element the local numbering of the nodes is as follows: 3=====6=====2 | | | | | | 7=====8=====5 | | | | | | 0=====4=====1 (r_0,s_0)=(-1,-1) (r_1,s_1)=(+1,-1) (r_2,s_2)=(+1,+1) (r_3,s_3)=(-1,+1) (r_4,s_4)=( 0,-1) (r_5,s_5)=(+1, 0) (r_6,s_6)=( 0,+1) (r_7,s_7)=(-1, 0) (r_8,s_8)=( 0, 0) The basis polynomial is then f (r, s) = a + br + cs + drs + er2 + f s2 + gr2 s + hrs2 + ir2 s2 29 The velocity shape functions are given by: N0 (r, s) = N1 (r, s) = N2 (r, s) = N3 (r, s) = N4 (r, s) = N5 (r, s) = N6 (r, s) = N7 (r, s) = N8 (r, s) = 1 1 r(r − 1) s(s − 1) 2 2 1 1 r(r + 1) s(s − 1) 2 2 1 1 r(r + 1) s(s + 1) 2 2 1 1 r(r − 1) s(s + 1) 2 2 1 (1 − r2 ) s(s − 1) 2 1 r(r + 1)(1 − s2 ) 2 1 (1 − r2 ) s(s + 1) 2 1 r(r − 1)(1 − s2 ) 2 (1 − r2 )(1 − s2 ) and their derivatives by: ∂N0 ∂r ∂N1 ∂r ∂N2 ∂r ∂N3 ∂r ∂N4 ∂r ∂N5 ∂r ∂N6 ∂r ∂N7 ∂r ∂N8 ∂r 4.5.3 1 1 (2r − 1) s(s − 1) 2 2 1 1 = (2r + 1) s(s − 1) 2 2 1 1 = (2r + 1) s(s + 1) 2 2 1 1 = (2r − 1) s(s + 1) 2 2 1 = (−2r) s(s − 1) 2 1 = (2r + 1)(1 − s2 ) 2 1 = (−2r) s(s + 1) 2 1 = (2r − 1)(1 − s2 ) 2 ∂N0 ∂s ∂N1 ∂s ∂N2 ∂s ∂N3 ∂s ∂N4 ∂s ∂N5 ∂s ∂N6 ∂s ∂N7 ∂s ∂N8 ∂s = = (−2r)(1 − s2 ) 1 1 r(r − 1) (2s − 1) 2 2 1 1 = r(r + 1) (2s − 1) 2 2 1 1 = r(r + 1) (2s + 1) 2 2 1 1 = r(r − 1) (2s + 1) 2 2 1 = (1 − r2 ) (2s − 1) 2 1 = r(r + 1)(−2s) 2 1 = (1 − r2 ) (2s + 1) 2 1 = r(r − 1)(−2s) 2 = = (1 − r2 )(−2s) Eight node serendipity basis functions in 2D (Qs2 ) Inside an element the local numbering of the nodes is as follows: 3=====6=====2 | | | | | | 7=====+=====5 | | | | | | 0=====4=====1 (r_0,s_0)=(-1,-1) (r_1,s_1)=(+1,-1) (r_2,s_2)=(+1,+1) (r_3,s_3)=(-1,+1) (r_4,s_4)=( 0,-1) (r_5,s_5)=(+1, 0) (r_6,s_6)=( 0,+1) (r_7,s_7)=(-1, 0) The main difference with the Q2 element resides in the fact that there is no node in the middle of the element The basis polynomial is then f (r, s) = a + br + cs + drs + er2 + f s2 + gr2 s + hrs2 30 Note that absence of the r2 s2 term which was previously associated to the center node. We find that N0 (r, s) = N1 (r, s) = N2 (r, s) = N3 (r, s) = N4 (r, s) = N5 (r, s) = N6 (r, s) = N7 (r, s) = 1 (1 − r)(1 − s)(−r − s − 1) 4 1 (1 + r)(1 − s)(r − s − 1) 4 1 (1 + r)(1 + s)(r + s − 1) 4 1 (1 − r)(1 + s)(−r + s − 1) 4 1 (1 − r2 )(1 − s) 2 1 (1 + r)(1 − s2 ) 2 1 (1 − r2 )(1 + s) 2 1 (1 − r)(1 − s2 ) 2 (58) (59) (60) (61) (62) (63) (64) (65) The shape functions at the mid side nodes are products of a second order polynomial parallel to side and a linear function perpendicular to the side while shape functions for corner nodes are modifications of the bilinear quadrilateral element: verify those 4.5.4 Bicubic basis functions in 2D (Q3 ) Inside an element the local numbering of the nodes is as follows: 12===13===14===15 || || || || 08===09===10===11 || || || || 04===05===06===07 || || || || 00===01===02===03 (r,s)_{00}=(-1,-1) (r,s)_{01}=(-1/3,-1) (r,s)_{02}=(+1/3,-1) (r,s)_{03}=(+1,-1) (r,s)_{04}=(-1,-1/3) (r,s)_{05}=(-1/3,-1/3) (r,s)_{06}=(+1/3,-1/3) (r,s)_{07}=(+1,-1/3) (r,s)_{08}=(-1,+1/3) (r,s)_{09}=(-1/3,+1/3) (r,s)_{10}=(+1/3,+1/3) (r,s)_{11}=(+1,+1/3) (r,s)_{12}=(-1,+1) (r,s)_{13}=(-1/3,+1) (r,s)_{14}=(+1/3,+1) (r,s)_{15}=(+1,+1) The velocity shape functions are given by: N1 (r) = (−1 + r + 9r2 − 9r3 )/16 N1 (t) = (−1 + t + 9t2 − 9t3 )/16 N2 (r) = (+9 − 27r − 9r2 + 27r3 )/16 N2 (t) = (+9 − 27t − 9t2 + 27t3 )/16 N3 (r) = (+9 + 27r − 9r2 − 27r3 )/16 N3 (t) = (+9 + 27t − 9t2 − 27t3 )/16 N4 (r) = (−1 − r + 9r2 + 9r3 )/16 N4 (t) = (−1 − t + 9t2 + 9t3 )/16 31 4.5.5 N01 (r, s) = N1 (r)N1 (s) = (−1 + r + 9r2 − 9r3 )/16 ∗ (−1 + t + 9s2 − 9s3 )/16 N02 (r, s) = N2 (r)N1 (s) = (+9 − 27r − 9r2 + 27r3 )/16 ∗ (−1 + t + 9s2 − 9s3 )/16 N03 (r, s) = N3 (r)N1 (s) = (+9 + 27r − 9r2 − 27r3 )/16 ∗ (−1 + t + 9s2 − 9s3 )/16 N04 (r, s) = N4 (r)N1 (s) = (−1 − r + 9r2 + 9r3 )/16 ∗ (−1 + t + 9s2 − 9s3 )/16 N05 (r, s) = N1 (r)N2 (s) = (−1 + r + 9r2 − 9r3 )/16 ∗ (9 − 27s − 9s2 + 27s3 )/16 N06 (r, s) = N2 (r)N2 (s) = (+9 − 27r − 9r2 + 27r3 )/16 ∗ (9 − 27s − 9s2 + 27s3 )/16 N07 (r, s) = N3 (r)N2 (s) = (+9 + 27r − 9r2 − 27r3 )/16 ∗ (9 − 27s − 9s2 + 27s3 )/16 N08 (r, s) = N4 (r)N2 (s) = (−1 − r + 9r2 + 9r3 )/16 ∗ (9 − 27s − 9s2 + 27s3 )/16 N09 (r, s) = N1 (r)N3 (s) = (66) N10 (r, s) = N2 (r)N3 (s) = (67) N11 (r, s) = N3 (r)N3 (s) = (68) N12 (r, s) = N4 (r)N3 (s) = (69) N13 (r, s) = N1 (r)N4 (s) = (70) N14 (r, s) = N2 (r)N4 (s) = (71) N15 (r, s) = N3 (r)N4 (s) = (72) N16 (r, s) = N4 (r)N4 (s) = (73) Linear basis functions for triangles in 2D (P1 ) 2 |\ | \ | \ | \ 0=======1 (r_0,s_0)=(0,0) (r_1,s_1)=(1,0) (r_2,s_2)=(0,2) The basis polynomial is then f (r, s) = a + br + cs and the shape functions: 4.5.6 1−r−s N0 (r, s) = N1 (r, s) = r (75) N2 (r, s) = s (76) Quadratic basis functions for triangles in 2D (P2 ) 2 |\ | \ 5 4 | \ | \ 0===3===1 (r_0,s_0)=(0,0) (r_3,s_3)=(1/2,0) (r_1,s_1)=(1,0) (r_4,s_4)=(1/2,1/2) (r_2,s_2)=(0,1) (r_5,s_5)=(0,1/2) The basis polynomial is then f (r, s) = c1 + c2 r + c3 s + c4 r2 + c5 rs + c6 s2 32 (74) We have f1 = f (r1 , s1 ) = c1 f2 = f (r2 , s2 ) = c1 + c2 + c4 f3 = f (r3 , s3 ) = c1 + c3 + c6 f4 = f (r4 , s4 ) = c1 + c2 /2 + c4 /4 f5 = f (r5 , s5 ) = c1 + c2 /2 + c3 /2 + c4 /4 + c5 /4 + c6 /4 f6 = f (r6 , s6 ) This can be cast as f = A · c where A 1 1 1 A= 1 1 1 = c1 + c3 /2 + c6 /4 is a 6x6 matrix: 0 0 0 1 0 1 0 1 0 1/2 0 1/4 1/2 1/2 1/4 0 1/2 0 0 0 0 0 1/4 0 0 0 1 0 1/4 1/4 It is rather trivial to compute the inverse of this matrix: 1 0 0 0 0 0 −3 −1 0 4 0 0 −3 0 −1 0 0 4 A−1 = 2 2 0 −4 0 0 4 0 0 −4 4 −4 2 0 2 0 0 −4 In the end, one obtains: f (r, s) = f1 + (−3f1 − f2 + 4f4 )r + (−3f1 − f3 + 4f6 )s +(2f1 + 2f2 − 4f4 )r2 + (4f1 − 4f4 + 4f5 − 4f6 )rs +(2f1 + 2f3 − 4f6 )s2 = 6 X Ni (r, s)fi (77) i=1 with 4.5.7 1 − 3r − 3s + 2r2 + 4rs + 2s2 N1 (r, s) = N2 (r, s) = −r + 2r2 N3 (r, s) = −s + 2s2 N4 (r, s) = 4r − 4r2 − 4rs N5 (r, s) = 4rs N6 (r, s) = 4s − 4rs − 4s2 Cubic basis functions for triangles (P3 ) 2 |\ | \ 7 6 | \ 8 9 5 | \ 0==3==4==1 (r_0,s_0)=(0,0) (r_1,s_1)=(1,0) (r_2,s_2)=(0,1) (r_3,s_3)=(1/3,0) (r_4,s_4)=(2/3,0) (r_5,s_5)=(2/3,1/3) (r_6,s_6)=(1/3,2/3) (r_7,s_7)=(0,2/3) (r_8,s_8)=(0,1/3) (r_9,s_9)=(1/3,1/3) 33 The basis polynomial is then f (r, s) = c1 + c2 r + c3 s + c4 r2 + c5 rs + c6 s2 + c7 r3 + c8 r2 s + c9 rs2 + c10 s3 N0 (r, s) N1 (r, s) N2 (r, s) N3 (r, s) N4 (r, s) N5 (r, s) N6 (r, s) N7 (r, s) N8 (r, s) N9 (r, s) 9 (1 − r − s)(1/3 − r − s)(2/3 − r − s) 2 9 = r(r − 1/3)(r − 2/3) 2 9 = s(s − 1/3)(s − 2/3) 2 27 = (1 − r − s)r(2/3 − r − s) 2 27 (1 − r − s)r(r − 1/3) = 2 27 rs(r − 1/3) = 2 27 = rs(r − 2/3) 2 27 = (1 − r − s)s(s − 1/3) 2 27 = (1 − r − s)s(2/3 − r − s) 2 = 27rs(1 − r − s) = (78) (79) (80) (81) (82) (83) (84) (85) (86) (87) verify those 4.6 4.6.1 Elements and basis functions in 3D Linear basis functions in tetrahedra (P1 ) (r_0,s_0) (r_1,s_1) (r_2,s_2) (r_3,s_3) = = = = (0,0,0) (1,0,0) (0,2,0) (0,0,1) The basis polynomial is given by f (r, s, t) = c0 + c1 r + c2 s + c3 t f1 = f (r1 , s1 , t1 ) = c0 (88) f2 = f (r2 , s2 , t2 ) = c0 + c1 (89) f3 = f (r3 , s3 , t3 ) = c0 + c2 (90) f4 = f (r4 , s4 , t4 ) = c0 + c3 (91) which yields: c0 = f1 f (r, s, t) c1 = f2 − f1 c2 = f3 − f1 c3 = f4 − f1 = c0 + c1 r + c2 s + c3 t = f1 + (f2 − f1 )r + (f3 − f1 )s + (f4 − f1 )t = f1 (1 − r − s − t) + f2 r + f3 s + f4 t X = Ni (r, s, t)fi i Finally, 34 4.6.2 1−r−s−t N1 (r, s, t) = N2 (r, s, t) = r N3 (r, s, t) = s N4 (r, s, t) = t Triquadratic basis functions in 3D (Q2 ) N1 = 0.5r(r − 1) 0.5s(s − 1) 0.5t(t − 1) N2 = 0.5r(r + 1) 0.5s(s − 1) 0.5t(t − 1) N3 = 0.5r(r + 1) 0.5s(s + 1) 0.5t(t − 1) N4 = 0.5r(r − 1) 0.5s(s + 1) 0.5t(t − 1) N5 = 0.5r(r − 1) 0.5s(s − 1) 0.5t(t + 1) N6 = 0.5r(r + 1) 0.5s(s − 1) 0.5t(t + 1) N7 = 0.5r(r + 1) 0.5s(s + 1) 0.5t(t + 1) N8 = 0.5r(r − 1) 0.5s(s + 1) 0.5t(t + 1) N9 = (1. − r2 ) 0.5s(s − 1) 0.5t(t − 1) N10 = 0.5r(r + 1) (1 − s2 ) 0.5t(t − 1) N11 N12 = (1. − r2 ) 0.5s(s + 1) 0.5t(t − 1) = 0.5r(r − 1) (1 − s2 ) 0.5t(t − 1) N13 = (1. − r2 ) 0.5s(s − 1) 0.5t(t + 1) N14 = 0.5r(r + 1) (1 − s2 ) 0.5t(t + 1) N15 = (1. − r2 ) 0.5s(s + 1) 0.5t(t + 1) N16 = 0.5r(r − 1) (1 − s2 ) 0.5t(t + 1) N17 = 0.5r(r − 1) 0.5s(s − 1) (1 − t2 ) N18 = 0.5r(r + 1) 0.5s(s − 1) (1 − t2 ) N19 = 0.5r(r + 1) 0.5s(s + 1) (1 − t2 ) N20 = 0.5r(r − 1) 0.5s(s + 1) (1 − t2 ) N21 = (1 − r2 ) (1 − s2 ) 0.5t(t − 1) N22 = (1 − r2 ) 0.5s(s − 1) (1 − t2 ) N23 = 0.5r(r + 1) (1 − s2 ) (1 − t2 ) N24 = (1 − r2 ) 0.5s(s + 1) (1 − t2 ) N25 = 0.5r(r − 1) (1 − s2 ) (1 − t2 ) N26 = (1 − r2 ) (1 − s2 ) 0.5t(t + 1) N27 = (1 − r2 ) (1 − s2 ) (1 − t2 ) 35 5 Solving the flow equations with the FEM In the case of an incompressible flow, we have seen that the continuity (mass conservation) equation takes ~ · ~v = 0. In other word flow takes place under the constraint that the divergence of its the simple form ∇ velocity field is exactly zero eveywhere (solenoidal constraint), i.e. it is divergence free. We see that the pressure in the momentum equation is then a degree of freedom which is needed to satisfy the incompressibilty constraint (and it is not related to any constitutive equation) [42]. In other words the pressure is acting as a Lagrange multiplier of the incompressibility constraint. Various approaches have been proposed in the literature to deal with the incompressibility constraint but we will only focus on the penalty method (section 5.4) and the so-called mixed finite element method 5.5. 5.1 strong and weak forms The strong form consists of the governing equation and the boundary conditions, i.e. the mass, momentum and energy conservation equations supplemented with Dirichlet and/or Neumann boundary conditions on (parts of) the boundary. To develop the finite element formulation, the partial differential equations must be restated in an integral form called the weak form. In essence the PDEs are first multiplied by an arbitrary function and integrated over the domain. 5.2 Which velocity-pressure pair for Stokes? The success of a mixed finite element formulation crucially depends on a proper choice of the local interpolations of the velocity and the pressure. 5.2.1 The compatibility condition (or LBB condition) 5.2.2 The bi/tri-linear velocity - constant pressure element (Q1 × P0 ) 5.2.3 The bi/tri-quadratic velocity - discontinuous linear pressure element (Q2 × P−1 ) 5.2.4 The bi/tri-quadratic velocity - bi/tri-linear pressure element (Q2 × Q1 ) This element, implemented in penalised form, is discussed in [12] and the follow-up paper [13]. CHECK Biquadratic velocities, bilinear pressure. See Hood and Taylor. The element satisfies the inf-sup condition [66]p215. 36 5.2.5 The stabilised bi/tri-linear velocity - bi/tri-linear pressure element (Q1 × Q1 -stab) 5.2.6 The MINI triangular element (P1+ × P1 ) 5.2.7 The quadratic velocity - linear pressure triangle (P2 × P1 ) From [120]. Taylor-Hood elements (Taylor and Hood 1973) are characterized by the fact that the pressure is continuous in the region Ω. A typical example is the quadratic triangle (P2P1 element). In this element the velocity is approximated by a quadratic polynomial and the pressure by a linear polynomial. One can easily verify that both approximations are continuous over the element boundaries. It can be shown, Segal (1979), that this element is admissible if at least 3 elements are used. The quadrilateral counterpart of this triangle is the Q2 × Q1 element. 5.2.8 The Crouzeix-Raviart triangle (P2+ × P−1 ) From [36]: seven-node Crouzeix-Raviart triangle with quadratic velocity shape functions enhanced by a cubic bubble function and discontinuous linear interpolation for the pressure field [e.g., Cuvelier et al., 1986]. This element is stable and no additional stabilization techniques are required [Elman et al., 2005]. From [120]. These elements are characterized by a discontinuous pressure; discontinuous on element boundaries. For output purposes (printing, plotting etc.) these discontinuous pressures are averaged in vertices for all the adjoining elements. The most simple Crouzeix-Raviart element is the non-conforming linear triangle with constant pressure (P1 × P0 ). 5.3 Other elements P1P0 P1P1 Q2Q2 P2P2 37 5.4 The penalty approach for viscous flow In order to impose the incompressibility constraint, two widely used procedures are available, namely the Lagrange multiplier method and the penalty method [9, 66]. The latter is implemented in elefant, which allows for the elimination of the pressure variable from the momentum equation (resulting in a reduction of the matrix size). Mathematical details on the origin and validity of the penalty approach applied to the Stokes problem can for instance be found in [35], [108] or [62]. The penalty formulation of the mass conservation equation is based on a relaxation of the incompressibility constraint and writes ~ · ~ν + p = 0 (92) ∇ λ where λ is the penalty parameter, that can be interpreted (and has the same dimension) as a bulk viscosity. It is equivalent to say that the material is weakly compressible. It can be shown that if one ~ · ~ν = 0 will be approximately chooses λ to be a sufficiently large number, the continuity equation ∇ satisfied in the finite element solution. The value of λ is often recommended to be 6 to 7 orders of magnitude larger than the shear viscosity [44, 67]. Equation (92) can be used to eliminate the pressure in Eq. (??) so that the mass and momentum conservation equations fuse to become : ~ · (2η ε̇(~ν)) + λ∇( ~ ∇ ~ · ~ν) = ρg = 0 ∇ (93) [90] have established the equivalence for incompressible problems between the reduced integration of the penalty term and a mixed Finite Element approach if the pressure nodes coincide with the integration points of the reduced rule. In the end, the elimination of the pressure unknown in the Stokes equations replaces the original saddle-point Stokes problem [10] by an elliptical problem, which leads to a symmetric positive definite (SPD) FEM matrix. This is the major benefit of the penalized approach over the full indefinite solver with the velocity-pressure variables. Indeed, the SPD character of the matrix lends itself to efficient solving stragegies and is less memory-demanding since it is sufficient to store only the upper half of the matrix including the diagonal [59] . list codes which use this approach The stress tensor σ is symmetric (i.e. σij = σji ). For simplicity I will now focus on a Stokes flow in two dimensions. Since the penalty formulation is only valid for incompressible flows, then ˙ = ˙ d so that the d superscript is ommitted in what follows. The stress tensor can also be cast in vector format: σxx −p ˙xx σyy = −p + 2η ˙yy σxy 0 ˙xy ˙xx + ˙yy ˙xx = λ ˙xx + ˙yy + 2η ˙yy ˙xy 0 ∂u ∂x 1 1 0 2 0 0 ∂v 1 1 0 0 2 0 · = λ +η ∂y 0 0 1 0 0 0 | {z } | {z } ∂v ∂u + K Remember that C 4 4 ∂u X ∂Ni = ui ∂x ∂x i=1 ∂v X ∂Ni = vi ∂y ∂y i=1 4 4 X X ∂u ∂v ∂Ni ∂Ni + = ui + vi ∂y ∂x ∂y ∂x i=1 i=1 38 ∂y ∂x so that ∂u ∂x ∂v ∂y ∂u ∂y + ∂v ∂x = ∂N1 ∂x 0 ∂N2 ∂x 0 ∂N3 ∂x 0 ∂N4 ∂x 0 0 ∂N1 ∂y 0 ∂N2 ∂y 0 ∂N3 ∂y 0 ∂N4 ∂y ∂N1 ∂y ∂N1 ∂x ∂N2 ∂y ∂N2 ∂x ∂N3 ∂y ∂N3 ∂x ∂N3 ∂y ∂N4 ∂x | {z B · } | u1 v1 u2 v2 u3 v3 u4 v4 {z V } Finally, σxx ~σ = σyy = (λK + ηC) · B · V σxy We will now establish the weak form of the momentum conservation equation. We start again from ~ · σ + ~b = ~0 ∇ For the Ni ’s ’regular enough’, we can write: Z Z ~ · σdΩ + Ni ∇ Ωe Ni bdΩ = 0 Ωe We can integrate by parts and drop the surface term2 : Z Z ~ i · σdΩ = ∇N Ni bdΩ Ωe Ωe or, Z ∂Ni ∂x 0 ∂Ni ∂y 0 ∂Ni ∂y ∂Ni ∂x Ωe Z σxx · σyy dΩ = Ni bdΩ Ωe σxy Let i = 1, 2, 3, 4 and stack the resulting four equations on top of one another. Z ∂N1 ∂x Ωe Z 0 ∂N1 ∂y ∂N2 ∂x 0 Ωe Z Z ∂N2 ∂y ∂N3 ∂x 0 0 ∂N3 ∂y ∂N4 ∂x 0 ∂N3 ∂x ∂N4 ∂y 0 ∂N4 ∂y ∂N4 ∂x Ωe ∂N1 ∂x ∂N2 ∂y 0 Ωe ∂N1 ∂y 0 ∂N2 ∂x ∂N3 ∂y σxx · σyy dΩ σxy σxx · σyy dΩ σxy σxx · σyy dΩ σxy σxx · σyy dΩ σxy N1 Ωe Ni Ωe 39 Z = N3 Ωe Z = N4 Ωe NbT = (N1 bx , N1 by , ...N4 bx , N4 by ) will come back to this at a later stage Z = We easily recognize B T inside the integrals! Let us define 2 We Z = bx by bx by bx by bx by dΩ (94) dΩ (95) dΩ (96) dΩ (97) then we can write Z σxx B T · σyy dΩ = Nb dΩ Ωe Ωe σxy Z and finally: Z Z T B · [λK + ηC] · B · V dΩ = Ωe Nb dΩ Ωe Since V contains the velocities at the corners, it does not depend on the x or y coordinates so it can be taking outside of the integral: Z Z V = Nb dΩ B T · [λK + ηC] · BdΩ · |{z} Ωe Ωe {z } (8x1) | {z } | Ael (8×8) Bel (8×1) or, Z Z Z T T λB · K · BdΩ + V = ηB · C · BdΩ · |{z} Nb dΩ Ω Ω | Ωe {z } | e {z } (8x1) | e {z } Aη el (8×8) Aλ el (8×8) Bel (8×1) INTEGRATION - MAPPING reduced integration [67] 1. partition domain Ω into elements Ωe , e = 1, ...nel . 2. loop over elements and for each element compute Ael , Bel 3. a node belongs to several elements → need to assemble Ael and Bel in A, B 4. apply boundary conditions 5. solve system: x = A−1 · B 6. visualise/analyse x 5.5 5.5.1 The mixed FEM for viscous flow in three dimensions In what follows the flow is assumed to be incompressible, isoviscous and isothermal. The methodology to derive the discretised equations of the mixed system is quite similar to the one we have used in the case of the penalty formulation. The big difference comes from the fact that we are now solving for both velocity and pressure at the same time, and that we therefore must solve the mass and momentum conservation equations together. As before, velocity inside an element is given by ~νh (~r) = mv X i=1 40 Niν (~r) ~νi (98) where Niv are the polynomial basis functions for the velocity, and the summation runs over the mv nodes composing the element. A similar expression is used for pressure: ph (~r) = mp X Nip (~r) pi (99) i=1 Note that the velocity is a vector of size while pressure (and temperature) is a scalar. There are then ndofv velocity degrees of freedom per node and ndofp pressure degrees of freedom. It is also very important to remember that the numbers of velocity nodes and pressure nodes for a given element are more often than not different and that velocity and pressure nodes need not be colocated. Indeed, unless co-called ’stabilised elements’ are used, we have mv > mp , which means that the polynomial order of the velocity field is higher than the polynomial order of the pressure field (usually by value 1). insert here link(s) to manual and literature Other notations are sometimes used for Eqs.(98) and (99): ~ ν · ~u uh (~r) = N ~ ν · ~v v h (~r) = N ~ν ·w wh (~r) = N ~ ~ p · p~ ph (~r) = N ~ ν is the vector containing all basis functions evaluated at location ~r: where ~ν = (u, v, w) and N ~ v = N ν (~r), N ν (~r), N ν (~r), . . . N ν (~r) N 1 2 3 mv p ~p = N N1p (~r), N2p (~r), N3p (~r), . . . Nm (~ r ) p (100) (101) (102) and with ~u = (u1 , u2 , u3 , . . . umv ) (103) ~v = (v1 , v2 , v3 , . . . vmv ) (104) w ~ = (w1 , w2 , w3 , . . . wmv ) p~ = p1 , p2 , p3 , . . . pmp (105) (106) We will now establish the weak form of the momentum conservation equation. We start again from ~ · σ + ~b ∇ ~ · ~v ∇ = ~0 (107) = (108) 0 For the Niν ’s and Nip ’regular enough’, we can write: Z Z ~ · σdΩ + Niν ∇ Niν~b dΩ Ωe Ωe Z ~ · ~v dΩ Nip ∇ = ~0 (109) = (110) 0 Ωe We can integrate by parts and drop the surface term3 : Z Z ~ iν · σdΩ = ∇N Ωe Z Niν~bdΩ (111) Ωe ~ · ~v dΩ Nip ∇ = 0 (112) Ωe or, Ωe 0 ∂Niν ∂y 0 ∂Niν ∂y 0 0 ∂Niν ∂x 0 Z 3 We ∂Niν ∂z 0 0 ∂Niν ∂x 0 ∂Niν ∂z ∂Niν ∂z 0 ∂Niν ∂x ∂Niν ∂y will come back to this at a later stage 41 · σxx σyy σzz σxy σxz σyz Z dΩ = Niν~b dΩ Ωe (113) As before (see section XXX) the above equation can ultimately be written: σxx σyy Z Z T σzz ~ b dΩ N B · dΩ = Ωe Ωe σxy σxz σyz We have previously established that the strain rate vector ~ε̇ is: P ∂Niν ∂x ui ∂N1ν i 0 ∂u ∂x ∂x ν P ∂Ni ∂y vi ∂N1ν 0 ∂v i ∂y ∂y ν P ∂Ni ∂w ∂z wi 0 0 i ∂z ~ε̇ = = = P ∂Niν ∂u ∂v ∂Niν ∂N1ν ∂N1ν ∂y + ∂x ( u + v ) i i ∂x ∂y ∂x i ∂y ∂u ∂w ∂N ν ∂z + ∂x P ∂Niν 1 ∂Niν 0 ∂z u + w ) ( i i ∂z ∂x i ∂v ∂w ∂N1ν ∂z + ∂y 0 P ∂N ν ν ∂z ∂Ni i ( ∂z vi + ∂y wi ) | 0 (114) ··· ν ∂Nm v ∂x 0 0 0 0 ··· 0 ν ∂Nm v ∂y ∂N1ν ∂z ··· 0 0 ν ∂Nm v ∂z 0 ··· ν ∂Nm v ∂x ν ∂Nm v ∂x 0 ∂N1ν ∂x ··· ν ∂Nm v ∂z 0 ν ∂Nm v ∂x 0 ν ∂Nm v ∂z ν ∂Nm v ∂y ∂N1ν ∂y i ··· {z B · }| (115) ~ where B is the gradient matrix and V ~ is the vector of all vector degrees of freedom for the or, ~ε̇ = B · V ~ is mv long. we have element. The matrix B is then of size 3 × mv and the vector V σxx = −p + 2η ε̇dxx (116) σyy = −p + 2η ε̇dyy (117) σzz = −p + 2η ε̇dzz (118) σxy = 2η ε̇dxy (119) σxz = (120) σyz = 2η ε̇dxz 2η ε̇dyz (121) Since we here only consider incompressible flow, we have ε̇d = ε̇ so 1 1 1 1 1 1 ~ ~p ~ ~ ~σ = − p + C · ε̇ = − 0 N · P + C · B · V 0 0 0 0 0 with C = η 2 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 42 ~ε̇ = ε̇xx ε̇yy ε̇zz 2ε̇xy 2ε̇xz 2ε̇yz (122) (123) u1 v1 w1 u2 v2 w2 u3 v3 ... umv vm v wmv {z ~ V } Let us define matrix N p of size 6 × mp : Np = 1 1 1 0 0 0 ~p N N~ p N~ p = N~ p 0 0 0 (124) so that ~ ~σ = −N p · P~ + C · B · V (125) finally Z ~ ] dΩ = B T · [−N p · P~ + C · B · V Ωe Z Nb dΩ (126) Ωe or, Z Z Z T p T ~ ~ ~ b dΩ − B · N dΩ ·P + B · C · B dΩ ·V = N Ωe Ωe Ωe | {z } | {z } | {z } G K (127) f~ where the matrix K is of size (mv ∗ ndofv × mv ∗ ndofv ), and matrix G is of size (mv ∗ ndofv × mp ∗ ndofp ). 43 Turning now to the mass conservation equation: Z ~ p∇ ~ · ~v dΩ 0 = N Ωe Z = ~p N Ωe mv X ∂N ν ∂Niν ∂Niν ui + vi + wi dΩ ∂x ∂y ∂z i i=1 N1p m Pv ∂Niν ∂x ui m Pv ∂Niν ∂y vi m Pv ∂Niν ∂z wi + + i=1 i=1 i=1 m m m v v v ν ν ν P P P ∂Ni ∂Ni ∂Ni p Z N2 i=1 ∂x ui + i=1 ∂y vi + i=1 ∂z wi m m m v v v dΩ ν ν ν P P P = ∂Ni ∂Ni ∂Ni Np 3 Ωe ∂x ui + ∂y vi + ∂z wi i=1 i=1 i=1 . . . m m m p Pv ∂Niν Pv ∂Niν Pv ∂Niν Nmp ∂x ui + ∂y vi + ∂z wi i=1 i=1 i=1 P ∂Niν ∂x ui i P ∂Niν p p p N1 0 0 0 N1 N1 ∂y vi i N2p N2p N2p 0 0 0 P ∂Niν ∂z wi Z i p p N3p N3 N3 0 0 0 · = P ∂Niν ∂N ν Ωe ( ∂y ui + ∂xi vi ) .. .. .. .. .. .. i . . . . . . P ∂Niν ∂N ν ( u+ i w) p p p Nmp Nmp Nmp 0 0 0 i ∂z i ∂x i P ∂N ν ∂N ν ( ∂zi vi + ∂yi wi ) i p p p N1 N1 N1 0 0 0 p p p N N N 0 0 0 Z 2 2 2 p p p N3 N3 N3 0 0 0 = ·~ε̇ dΩ .. .. .. .. .. .. Ωe . . . . . . p Nm p p Nm p | Z = p Nm p {z 0 0 dΩ 0 } Np ~ N · B dΩ · V p ~ = −GTe · V (128) say something about minus sign? Ultimately we obtain the following system for each element: ~ Ke Ge V f~e · = −GTe 0 0 P~ Such a matrix is then generated for each element and then must me assembled into the global F.E. matrix. Note that in this case the elemental Stokes matrix is antisymmetric. One can also define the following symmetric modified Stokes matrix: ~ Ke Ge V f~e · = GTe 0 0 P~ This matrix is symmetric, but indefinite. It is non-singular if ker(GT ) = 0, which is the case if t he compatibility condition holds. 44 CHECK: Matrix K is the viscosity matrix. Its size is (ndofv ∗ Nv ) × (ndofv ∗ Nv ) where ndofv is the number of velocity degrees of freedom per node (typically 1,2 or 3) and Nv is the number of velocity nodes. The size of matrix G is (ndofv ∗ Nv ) × (ndofp ∗ Np ) where ndofp (= 1) is the number of velocity degrees of freedom per node and Np is the number of pressure nodes. Conversely, the size of matrix GT is (ndofp ∗ Np ) × (ndofv ∗ Nv ). The size of the global FE matrix is N = ndofv ∗ Nv + ndofp ∗ Np Note that matrix K is analogous to a discrete Laplacian operator, matrix G to a discrete gradient operator, and matrix GT to a discrete divergence operator. On the physical dimensions of the Stokes matrix blocks ~ +∇ ~ · (2η ε̇) + ρg = −∇p ~ · ~ν = ∇ We start from the Stokes equations: 0 (129) 0 (130) The dimensions of the terms in the first equation are: M L−2 T −2 . The blocks K and G stem from the weak form which obtained by multiplying the strong form equations by the (dimensionless) basis funstions and integrating over the domain, so that it follows that ~ ] = [G · P~ ] = [f~] = M L−2 T −2 L3 = M LT −2 [K · V We can then easily deduce: [K] = M T −1 [G] = L2 On elemental level mass balance. Note that in what is above no assumption has been made about whether the pressure basis functions are continuous or discontinuous from one element to another. Indeed, as mentioned in [60], since the weak formulation of the momentum equation involves inte~ the resulting weak form contains no derivatives of pressure. This introduces the gration by parts of ∇p, possibility of approximating it by functions (piecewise polynomials, of course) that are not C 0 -continuous, and indeed this has been done and is quite popular/useful. It is then worth noting that only discontinuous pressure elements assure an element-level mass balance [60]: if for instance Nip is piecewise-constant on element e (of value 1), the elemental weak form of the mass conservervation equation is Z Z Z ~ · ~ν = ~ · ~ν = ~n · ~ν = 0 ∇ Nip ∇ Ωe Γe Ωe One potentially unwelcome consequence of using discontinuous pressure elements is that they do not possess uniquely defined pressure on the element boundaries; they are dual valued there, and often multi-valued at certain velocity nodes. On the C matrix τ The relationship between deviatoric stress and deviatoric strain rate tensor is 2η ε̇d 1 ~ · ~v )1 = 2η ε̇ − (∇ 3 ε̇xx ε̇xy ε̇xz 1 0 0 1 = 2η ε̇yx ε̇yy ε̇yz − (ε̇xx + ε̇yy + ε̇zz ) 0 1 0 3 0 0 1 ε̇zx ε̇zy ε̇zz 2ε̇ − ε̇yy − ε̇zz 3ε̇xy 3ε̇xz 2 xx 3ε̇yx −ε̇yy + 2ε̇yy − ε̇yy 3ε̇yz = η 3 3ε̇zx 3ε̇zy −ε̇xx − ε̇yy 2ε̇zz = 45 (131) (132) (133) (134) so that 2 ~τ = η 3 2ε̇xx − ε̇yy − ε̇zz −ε̇yy + 2ε̇yy − ε̇yy −ε̇xx − ε̇yy + 2ε̇zz 3ε̇xy 3ε̇xz 3ε̇yz η = 3 4 −2 −2 0 0 0 −2 4 −2 0 0 0 −2 0 −2 0 4 0 0 3 0 0 0 0 {z | 0 0 0 0 3 0 0 0 0 0 0 3 · C = C d · ~ε̇ (135) } Cd In the case where we assume incompressible flow 2 0 0 0 0 2 0 0 0 0 2 0 ~τ = η 0 0 0 1 0 0 0 0 0 0 0 0 | {z ε̇xx ε̇yy ε̇zz 2ε̇xy 2ε̇xz 2ε̇yz from the beginning, i.e. ε = εd , then 0 0 ε̇xx 0 0 ε̇yy 0 0 ε̇zz = C · ~ε̇ · 0 0 2ε̇xy 1 0 2ε̇xz 0 1 2ε̇yz } (136) On the ’forgotten’ surface terms 5.5.2 Going from 3D to 2D The world is three-dimensional. However, for many different reasons one may wish to solve problems which are two-dimensional. Following ASPECT manual, we will think of two-dimensional models in the following way: • We assume that the domain we want to solve on is a two-dimensional cross section (in the x − y plane) that extends infinitely far in both negative and positive z direction. • We assume that the velocity is zero in the z direction and that all variables have no variation in the z direction. As a consequence, two-dimensional models are three-dimensional ones in which the z component of the velocity is zero and so are all z derivatives. This allows to reduce the momentum conservation equations from 3 equations to 2 equations. However, contrarily to what is often seen, the 3D definition of the deviatoric strain rate remains, i.e. in other words: 1 ~ · ~v )1 ε̇d = ε̇ − (∇ 3 (137) and not 1/2. In light of all this, the full strain rate tensor and the deviatoric strain rate tensor in 2D are given by: ε d ε̇ = = ε̇xx ε̇yx ε̇zx 1 3 ε̇xy ε̇yy ε̇zy ε̇xz ε̇yz = ε̇zz 2 ∂u − ∂v ∂x ∂y 1 ∂u ∂v 2 ∂y + ∂x 0 1 2 ∂u ∂y − ∂u ∂x 1 2 ∂u ∂x 1 2 + + ∂u ∂y ∂v ∂x + 0 ∂v ∂x + 0 0 − ∂u ∂x ∂u ∂y ∂v ∂y 0 ∂v 2 ∂y 0 − ∂v ∂y ∂v ∂x 0 0 0 (138) (139) Although the bottom right term may be surprising, it is of no consequence when this expression of the deviatoric strain rate is used in the Stokes equation: ~ · 2η ε̇d = ∇ 46 FINISH! In two dimensions the velocity is then ~ν = (u, v) and the FEM building blocks and matrices are simply: ε̇xx ~ε̇ = ε̇yy 2ε̇xy ∂u ∂x = ∂v ∂y ∂u ∂y + ∂v ∂x = ∂N1ν ∂x 0 ∂N2ν ∂x 0 ∂N3ν ∂x 0 ... ν ∂Nm v ∂x 0 0 ∂N1ν ∂y 0 ∂N2ν ∂y 0 ∂N3ν ∂y ... 0 ν ∂Nm v ∂x ∂N1ν ∂y ∂N1ν ∂x ∂N2ν ∂y ∂N2ν ∂x ∂N3ν ∂y ∂N3ν ∂x ... ν ∂Nm v ∂y ν ∂Nm v ∂x | {z B · } | (140) we have so σxx = −p + 2η ε̇xx (141) σyy = −p + 2η ε̇yy (142) σxy = +2η ε̇xy (143) 1 1 ~ ~σ = − 1 p + C · ~ε̇ = − 1 N~ p · P~ + C · B · V 0 0 with 2 C = η 0 0 0 2 0 0 0 1 or 4 η −2 C= 3 0 −2 4 0 0 0 3 (144) (145) check the right C Finally the matrix N p is of size 3 × mp : 1 N p = 1 N~ p = 0 5.6 Solving the elastic equations 5.7 Solving the heat transport equation N~ p N~ p 0 We start from the ’bare-bones’ heat transport equation (source terms are omitted): ∂T ~ ~ · k ∇T ~ ρcp + ~ν · ∇T = ∇ ∂t (146) (147) In what follows we assume that the velocity vield ~ν is known so that temperature is the only unknwon. Let N θ be the temperature basis functions so that the temperature inside an element is given by4 : h T (~r) = mT X ~ θ · T~ N θ (~r)Ti = N (148) i=1 where T~ is a vector of length mT The weak form is then Z Z ∂T θ ~ ~ · k ∇T ~ dΩ ~ + ν · ∇T dΩ = Niθ ∇ Ni ρcp ∂t Ω Ω 4 the θ superscript has been chosen to denote temperature so as to avoid confusion with the transpose operator 47 (149) u1 v1 u2 v2 u3 v3 ... umv vmv {z ~ V } Z Z ∂T ~ dΩ = ~ · k ∇T ~ dΩ dΩ + Niθ ρcp~ν · ∇T Niθ ∇ Niθ ρcp ∂t Ω Ω Ω | {z } | {z } | {z } Z I II i = 1, mT III Looking at the first term: Z Niθ ρcp Ω Z ∂T dΩ ∂t = ~ θ · T~˙ dΩ Niθ ρcp N (150) Ω (151) so that when we assemble all contributions for i = 1, mT we get: Z Z ˙ ˙ θ θ ~˙ θ ~θ ~ ~ ~ I= N ρcp N · T dΩ = ρcp N N dΩ · T~ = M T · T~ Ω Ω where M T is the mass matrix of the system of size (mT × mT ) with Z T Mij = ρcp Niθ Njθ dΩ Ω Turning now to the second term: Z ~ dΩ Niθ ρcp~ν · ∇T Z ∂T ∂T +v )dΩ ∂x ∂y Ω Z ~θ ~θ ∂N ∂N = Niθ ρcp (u +v ) · T~ dΩ ∂x ∂y Ω Niθ ρcp (u = Ω (152) (153) (154) so that when we assemble all contributions for i = 1, mT we get: ! Z ~θ ~θ ∂N ∂N θ ~ II = ρcp N (u +v )dΩ · T~ = Ka · T~ ∂x ∂y Ω where Ka is the advection term matrix of size (mT × mT ) with Z ρcp Niθ (Ka )ij = Ω ∂Njθ ∂Njθ +v u ∂x ∂y ! dΩ Now looking at the third term, we carry out an integration by part and neglect the surface term for now, so that Z Z ~ · k ∇T ~ dΩ = − ~ iθ · ∇T ~ dΩ Niθ ∇ k ∇N (155) Ω Ω Z ~ iθ · ∇( ~ N ~ θ · T~ )dΩ = − k ∇N (156) Ω (157) with ~N ~θ = ∇ ∂x N1θ ∂x N2θ ... θ ∂x Nm T ∂y N1θ ∂y N2θ ... θ ∂ y Nm T so that finally: Z III = − θ T ~ ~θ ~ ~ k(∇N ) · ∇N dΩ · T~ = −Kd · T~ Ω where Kd is the diffusion term matrix: Z Kd = ~N ~ θ )T · ∇ ~N ~ θ dΩ k(∇ Ω 48 Ultimately terms I, II, III together yield: ˙ M θ · T~ + (Ka + Kd ) · T~ = ~0 What now remains to be done is to address the time derivative on the temperature vector. The most simple approach would be to use an explicit Euler one, i.e.: ∂ T~ T~ (k) − T~ (k−1) = ∂t δt where T~ (k) is the temperature field at time step k and δt is the time interval between two consecutive time steps. In this case the discretised heat transport equation is: M θ + (Ka + Kd )δt · T~ (k) = M θ · T~ (k−1) other time discr schemes! 49 6 Additional techniques and features 6.1 Picard and Newton 6.2 The SUPG formulation for the energy equation 6.3 Tracking materials and/or interfaces 6.4 Dealing with a free surface 6.5 Convergence criterion for nonlinear iterations 6.6 Static condensation 50 6.7 The method of manufactured solutions The method of manufactured solutions is a relatively simple way of carrying out code verification. In essence, one postulates a solution for the PDE at hand (as well as the proper boundary conditions), inserts it in the PDE and computes the corresponding source term. The same source term and boundary conditions will then be used in a numerical simulation so that the computed solution can be compared with the (postulated) true analytical solution. Examples of this approach are to be found in [42, 25, ?]. . python codes/fieldstone . python codes/fieldstone saddlepoint . python codes/fieldstone saddlepoint q2q1 . python codes/fieldstone saddlepoint q3q2 . python codes/fieldstone burstedde 6.7.1 Analytical benchmark I Taken from [44]. We consider a two-dimensional problem in the square domain Ω = [0, 1] × [0, 1], which possesses a closed-form analytical solution. The problem consists of determining the velocity field ~ν = (u, v) and the pressure p such that ~ + ~b = ~0 −η∆~ν + ∇p ∇·v =0 in Ω in Ω v=0 on Γ where the fluid viscosity is taken as η = 1. The components of the body force b are prescribed as bx = (12 − 24y)x4 + (−24 + 48y)x3 + (−48y + 72y 2 − 48y 3 + 12)x2 +(−2 + 24y − 72y 2 + 48y 3 )x + 1 − 4y + 12y 2 − 8y 3 by = (8 − 48y + 48y 2 )x3 + (−12 + 72y − 72y 2 )x2 +(4 − 24y + 48y 2 − 48y 3 + 24y 4 )x − 12y 2 + 24y 3 − 12y 4 With this prescribed body force, the exact solution is Note that the pressure obeys u(x, y) = x2 (1 − x)2 (2y − 6y 2 + 4y 3 ) v(x, y) = −y 2 (1 − y)2 (2x − 6x2 + 4x3 ) p(x, y) = x(1 − x) − 1/6 R Ω p dΩ = 0 One can turn to the spatial derivatives of the fields: ∂u ∂x ∂v ∂y = (2x − 6x2 + 4x3 )(2y − 6y 2 + 4y 3 ) (158) = −(2x − 6x2 + 4x3 )(2y − 6y 2 + 4y 3 ) (159) ~ · ~ν = 0 and with of course ∇ ∂p ∂x ∂p ∂y = 1 − 2x (160) = 0 (161) The velocity and pressure fields look like: 51 http://ww2.lacan.upc.edu/huerta/exercises/Incompressible/Incompressible Ex1.htm As shown in [44], If the LBB condition is not satisfied, spurious oscillations spoil the pressure approximation. Figures below show results obtained with a mesh of 20x20 Q1P0 (left) and P1P1 (right) elements: ]] http://ww2.lacan.upc.edu/huerta/exercises/Incompressible/Incompressible Ex1.htm Taking into account that the proposed problem has got analytical solution, it is easy to analyze convergence of the different pairs of elements: http://ww2.lacan.upc.edu/huerta/exercises/Incompressible/Incompressible Ex1.htm 6.7.2 Analytical benchmark II Taken from [41]. It is for a unit square with ν = µ/ρ = 1 and the smooth exact solution is u(x, y) = x + x2 − 2xy + x3 − 3xy 2 + x2 y v(x, y) 2 p(x, y) 2 3 = −y − 2xy + y − 3x y + y − xy 3 2 = xy + x + y + x y − 4/3 52 (162) 2 (163) (164) Note that the pressure obeys R Ω p dΩ = 0 bx by 6.7.3 −(1 + y − 3x2 y 2 ) = 3 −(1 − 3x − 2x y) = (165) (166) Analytical benchmark III This benchmark begins by postulating a polynomial solution to the 3D Stokes equation [41]: x + x2 + xy + x3 y y + xy + y 2 + x2 y 2 v= −2z − 3xz − 3yz − 5x2 yz (167) and p = xyz + x3 y 3 z − 5/32 (168) While it is then trivial to verify that this velocity field is divergence-free, the corresponding body force of the Stokes equation can be computed by inserting this solution into the momentum equation with a given viscosity µ (constant or position/velocity/strain rate dependent). The domain is a unit cube and velocity boundary conditions simply use Eq. (229). Note that the pressure fulfills Z p(~r)dΩ = 0. Ω Constant viscosity In this case, the right hand side writes: 2 + 6xy f = −∇p + µ 2 + 2x2 + 2y 2 −10yz 2 3 yz + 3x y z 2 + 6xy = − xz + 3x3 y 2 z + µ 2 + 2x2 + 2y 2 xy + x3 y 3 −10yz We can compute the components of the strainrate tensor: ε̇xx = 1 + 2x + y + 3x2 y 2 (169) ε̇yy = 1 + x + 2y + 2x y (170) ε̇zz = (171) ε̇xy = ε̇xz = ε̇yz = −2 − 3x − 3y − 5x2 y 1 (x + y + 2xy 2 + x3 ) 2 1 (−3z − 10xyz) 2 1 (−3z − 5x2 z) 2 (172) (173) (174) Note that we of course have ε̇xx + ε̇yy + ε̇zz = 0. Variable viscosity In this case, the right hand side is obtains through 2 + 6xy f = −∇p + µ 2 + 2x2 + 2y 2 −10yz 2ε̇xx 2ε̇xy 2ε̇xz ∂µ ∂µ ∂µ + 2ε̇xy + 2ε̇yy + 2ε̇yz ∂x ∂y ∂z 2ε̇xz 2ε̇yz 2ε̇zz 53 (175) The viscosity can be chosen to be a smooth varying function: µ = exp(1 − β(x(1 − x) + y(1 − y) + z(1 − z))) (176) Choosing β = 0 yields a constant velocity µ = e1 (and greatly simplifies the right-hand side). One can easily show that the ratio of viscosities µ? in the system follows µ? = exp(−3β/4) so that choosing β = 10 yields µ? ' 1808 and β = 20 yields µ? ' 3.269 × 106 . In this case ∂µ ∂x ∂µ ∂y ∂µ ∂z = −4β(1 − 2x)µ(x, y, z) (177) = −4β(1 − 2y)µ(x, y, z) (178) = −4β(1 − 2z)µ(x, y, z) (179) [25] has carried out this benchmark for β = 4, i.e.: µ(x, y, z) = exp(1 − 4(x(1 − x) + y(1 − y) + z(1 − z))) In a unit cube, this yields a variable viscosity such that 0.1353 < µ < 2.7182, i.e. a ratio of approx. 20 within the domain. We then have: ∂µ ∂x ∂µ ∂y ∂µ ∂z = −4(1 − 2x)µ(x, y, z) (180) = −4(1 − 2y)µ(x, y, z) (181) = −4(1 − 2z)µ(x, y, z) (182) sort out mess wrt Eq 26 of busa13 6.7.4 Analytical benchmark IV From [12]. The two-dimensional domain is a unit square. The body forces are: fx = 128[x2 (x − 1)2 12(2y − 1) + 2(y − 1)(2y − 1)y(12x2 − 12x + 2)] fy = 128[y 2 (y − 1)2 12(2x − 1) + 2(x − 1)(2x − 1)y(12y 2 − 12y + 2)] (183) The solution is u = −256x2 (x − 1)2 y(y − 1)(2y − 1) v = 256x2 (y − 1)2 x(x − 1)(2x − 1) p = 0 (184) Another choice: fx = 128[x2 (x − 1)2 12(2y − 1) + 2(y − 1)(2y − 1)y(12x2 − 12x + 2)] + y − 1/2 fy = 128[y 2 (y − 1)2 12(2x − 1) + 2(x − 1)(2x − 1)y(12y 2 − 12y + 2)] + x − 1/2 (185) The solution is u = −256x2 (x − 1)2 y(y − 1)(2y − 1) v = 256x2 (y − 1)2 x(x − 1)(2x − 1) p = (x − 1/2)(y − 1/2) 54 (186) 6.8 Assigning values to quadrature points As we have seen in Section ??, the building of the elemental matrix and rhs requires (at least) to assign a density and viscosity value to each quadrature point inside the element. Depending on the type of modelling, this task can prove more complex than one might expect and have large consequences on the solution accuracy. Here are several options: • The simplest way (which is often used for benchmarks) consists in computing the ’real’ coordinates (xq , yq , zq ) of a given quadrature point based on its reduced coordinates (rq , sq , tq ), and passing these coordinates to a function which returns density and/or viscosity at this location. For instance, for the Stokes sphere: def rho(x,y): if (x-.5)**2+(y-0.5)**2<0.123**2: val=2. else: val=1. return val def mu(x,y): if (x-.5)**2+(y-0.5)**2<0.123**2: val=1.e2 else: val=1. return val This is very simple, but it has been shown to potentially be problematic. In essence, it can introduce very large contrasts inside a single element and perturb the quadrature. Please read section 3.3 of [65] and/or have a look at the section titled ”Averaging material properties” in the ASPECT manual. • another similar approach consists in assigning a density and viscosity value to the nodes of the FE mesh first, and then using these nodal values to assign values to the quadrature points. Very often ,and quite logically, the shape functions are used to this effect. Indeed we have seen before that for any point (r, s, t) inside an element we have fh (r, s, t) = m X fi Ni (r, s, t) i where the fi are the nodal values and the Ni the corresponding basis functions. In the case of linear elements (Q1 basis functions), this is straightforward. In fact, the basis functions Ni can be seen as moving weights: the closer the point is to a node, the higher the weight (basis function value). However, this is quite another story for quadratic elements (Q2 basis functions). In order to illustrate the problem, let us consider a 1D problem. The basis functions are N1 (r) = 1 r(r − 1) 2 N2 (r) = 1 − r2 N3 (r) = 1 r(r + 1) 2 Let us further assign: ρ1 = ρ2 = 0 and ρ3 = 1. Then ρh (r) = m X ρi Ni (r) = N3 (r) i There lies the core of the problem: the N3 (r) basis function is negative for r ∈ [−1, 0]. This means that the quadrature point in this interval will be assigned a negative density, which is nonsensical and numerically problematic! use 2X Q1. write about it ! 55 The above methods work fine as long as the domain contains a single material. As soon as there are multiple fluids in the domain a special technique is needed to track either the fluids themselves or their interfaces. Let us start with markers. We are then confronted to the infernal trio (a menage a trois?) which is present for each element, composed of its nodes, its markers and its quadrature points. Each marker carries the material information (density and viscosity). This information must ultimately be projected onto the quadrature points. Two main options are possible: an algorithm is designed and projects the marker-based fields onto the quadrature points directly or the marker fields are first projected onto the FE nodes and then onto the quadrature points using the techniques above. ————————– At a given time, every element e contains ne markers. During the FE matrix building process, viscosity and density values are needed at the quadrature points. One therefore needs to project the values carried by the markers at these locations. Several approaches are currently in use in the community and the topic has been investigated by [40] and [45] for instance. elefant adopts a simple approach: viscosity and density are considered to be elemental values, i.e. all the markers within a given element contribute to assign a unique constant density and viscosity value to the element by means of an averaging scheme. While it is common in the literature to treat the so-called arithmetic, geometric and harmonic means as separate averagings, I hereby wish to introduce the notion of generalised mean, which is a family of functions for aggregating sets of numbers that include as special cases the arithmetic, geometric and harmonic means. If p is a non-zero real number, we can define the generalised mean (or power mean) with exponent p of the positive real numbers a1 , ... an as: n Mp (a1 , ...an ) = 1X p a n i=1 i !1/p (187) and it is trivial to verify that we then have the special cases: M−∞ = M−1 = M0 = lim Mp = min(a1 , ...an ) p→−∞ (minimum) n (harm. avrg.) + + · · · + a1n Y 1/n n ai lim Mp = (geom. avrg.) 1 a1 1 a2 p→0 (188) (189) (190) i=1 n M+1 M+2 M+∞ 1X ai n i=1 v u n u1 X = t a2 n i=1 i = = (arithm. avrg.) (191) (root mean square) (192) lim Mp = max(a1 , ...an ) p→+∞ (maximum) (193) Note that the proofs of the limit convergence are given in [23]. An interesting property of the generalised mean is as follows: for two real values p and q, if p < q then Mp ≤ Mq . This property has for instance been illustrated in Fig. 20 of [117]. One can then for instance look at the generalised mean of a randomly generated set of 1000 viscosity values within 1018 P a.s and 1023 P a.s for −5 ≤ p ≤ 5. Results are shown in the figure hereunder and the arithmetic, geometric and harmonic values are indicated too. The function Mp assumes an arctangentlike shape: very low values of p will ultimately yield the minimum viscosity in the array while very high values will yield its maximum. In between, the transition is smooth and occurs essentially for |p| ≤ 5. 56 1e+23 arithm. M(p) 1e+22 1e+21 geom. 1e+20 harm. 1e+19 1e+18 -4 -2 0 2 p . python codes/fieldstone markers avrg 57 4 6.9 Matrix (Sparse) storage The FE matrix is the result of the assembly process of all elemental matrices. Its size can become quite large when the resolution is being increased (from thousands of lines/columns to tens of millions). One important property of the matrix is its sparsity. Typically less than 1% of the matrix terms is not zero and this means that the matrix storage can and should be optimised. Clever storage formats were designed early on since the amount of RAM memory in computers was the limiting factor 3 or 4 decades ago. [112] There are several standard formats: • compressed sparse row (CSR) format • compressed sparse column format (CSC) • the Coordinate Format (COO) • Skyline Storage Format • ... I focus on the CSR format in what follows. 6.9.1 2D domain - One degree of freedom per node Let us consider again the 3 × 2 element grid which counts 12 nodes. 8=======9======10======11 | | | | | (3) | (4) | (5) | | | | | 4=======5=======6=======7 | | | | | (0) | (1) | (2) | | | | | 0=======1=======2=======3 In the case there is only a like this: X X X X single degree of freedom per node, the assembled FEM matrix will look X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X where the X stand for non-zero terms. This matrix structure stems from the fact that • node 0 sees nodes 0,1,4,5 • node 1 sees nodes 0,1,2,4,5,6 • node 2 sees nodes 1,2,3,5,6,7 • ... 58 • node 5 sees nodes 0,1,2,4,5,6,8,9,10 • ... • node 10 sees nodes 5,6,7,9,10,11 • node 11 sees nodes 6,7,10,11 In light thereof, we have • 4 corner nodes which have 4 neighbours (counting themselves) • 2(nnx-2) nodes which have 6 neighbours • 2(nny-2) nodes which have 6 neighbours • (nnx-2)×(nny-2) nodes which have 9 neighbours In total, the number of non-zero terms in the matrix is then: N Z = 4 × 4 + 4 × 6 + 2 × 6 + 2 × 9 = 70 In general, we would then have: N Z = 4 × 4 + [2(nnx − 2) + 2(nny − 2)] × 6 + (nnx − 2)(nny − 2) × 9 Let us temporarily assume nnx = nny = n. Then the matrix size (total number of unknowns) is N = n2 and N Z = 16 + 24(n − 2) + 9(n − 2)2 A full matrix array would contain N 2 = n4 terms. The ratio of N Z (the actual number of reals to store) to the full matrix size (the number of reals a full matrix contains) is then R= 16 + 24(n − 2) + 9(n − 2)2 n4 It is then obvious that when n is large enough R ∼ 1/n2 . CSR stores the nonzeros of the matrix row by row, in a single indexed array A of double precision numbers. Another array COLIND contains the column index of each corresponding entry in the A array. A third integer array RWPTR contains pointers to the beginning of each row, which an additional pointer to the first index following the nonzeros of the matrix A. A and COLIND have length NZ and RWPTR has length N+1. In the case of the here-above matrix, the arrays COLIND and RWPTR will look like: COLIN D = (0, 1, 4, 5, 0, 1, 2, 4, 5, 6, 1, 2, 3, 5, 6, 7, ..., 6, 7, 10, 11) RW P T R = (0, 4, 10, 16, ...) 6.9.2 2D domain - Two degrees of freedom per node When there are now two degrees of freedom per node, such as in the case of the Stokes equation in two-dimensions, the size of the K matrix is given by NfemV=nnp∗ ndofV In the case of the small grid above, we have NfemV=24. Elemental matrices are now 8 × 8 in size. We still have • 4 corner nodes which have 4 ,neighbours, • 2(nnx-2) nodes which have 6 neighbours • 2(nny-2) nodes which have 6 neighbours 59 • (nnx-2)x(nny-2) nodes which have 9 neighbours, but now each degree of freedom from a node sees the other two degrees of freedom of another node too. In that case, the number of nonzeros has been multiplied by four and the assembled FEM matrix looks like: X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X Note that the degrees of freedom are organised as follows: (u0 , v0 , u1 , v1 , u2 , v2 , ...u11 , v11 ) In general, we would then have: N Z = 4 [4 × 4 + [2(nnx − 2) + 2(nny − 2)] × 6 + (nnx − 2)(nny − 2) × 9] and in the case of the small grid, the number of non-zero terms in the matrix is then: N Z = 4 [4 × 4 + 4 × 6 + 2 × 6 + 2 × 9] = 280 In the case of the here-above matrix, the arrays COLIND and RWPTR will look like: COLIN D = (0, 1, 2, 3, 8, 9, 10, 11, 0, 1, 2, 3, 8, 9, 10, 11, ...) RW P T R = (0, 8, 16, 28, ...) 6.9.3 in fieldstone The majority of the codes have the FE matrix being a full array a mat = np . z e r o s ( ( Nfem , Nfem ) , dtype=np . f l o a t 6 4 ) and it is converted to CSR format on the fly in the solve phase: s o l = s p s . l i n a l g . s p s o l v e ( s p s . c s r m a t r i x ( a mat ) , r h s ) Note that linked list storages can be used (lil matrix). Substantial memory savings but much longer compute times. 60 6.10 Mesh generation Before basis functions can be defined and PDEs can be discretised and solved we must first tesselate the domain with polygons, e.g. triangles and quadrilaterals in 2D, tetrahedra, prisms and hexahedra in 3D. When the domain is itself simple (e.g. a rectangle, a sphere, ...) the mesh (or grid) can be (more or less) easily produced and the connectivity array filled with straightforward algorithms [131]. However, real life applications can involve etremely complex geometries (e.g. a bridge, a human spine, a car chassis and body, etc ...) and dedicated algorithms/softwares must be used (see [134, 53, 143]). We usually distinguish between two broad classes of grids: structured grids (with a regular connectivity) and unstructured grids (with an irregular connectivity). On the following figure are shown various triangle- tetrahedron-based meshes. These are obviously better suited for simulations of complex geometries: add more examples coming from geo Let us now focus on the case of a rectangular computational domain of size Lx × Ly with a regular mesh composed of nelx×nely=nel quadrilaterals. There are then nnx×nny=nnp grid points. The elements are of size hx×hy with hx=Lx/nelx. We have no reason to come up with an irregular/ilogical node numbering so we can number nodes row by row or column by column as shown on the example hereunder of a 3×2 grid: 8=======9======10======11 | | | | | (3) | (4) | (5) | | | | | 4=======5=======6=======7 | | | | | (0) | (1) | (2) | | | | | 0=======1=======2=======3 2=======5=======8======11 | | | | | (1) | (3) | (5) | | | | | 1=======4=======7======10 | | | | | (0) | (2) | (4) | | | | | 0=======3=======6=======9 "row by row" "column by column" The numbering of the elements themselves could be done in a somewhat chaotic way but we follow the numbering of the nodes for simplicity. The row by row option is the adopted one in fieldstoneand the coordinates of the points are computed as follows: x = np . empty ( nnp , dtype=np . f l o a t 6 4 ) y = np . empty ( nnp , dtype=np . f l o a t 6 4 ) 61 counter = 0 f o r j i n r a n g e ( 0 , nny ) : f o r i i n r a n g e ( 0 , nnx ) : x [ c o u n t e r ]= i ∗hx y [ c o u n t e r ]= j ∗hy c o u n t e r += 1 The inner loop has i ranging from 0 to nnx-1 first for j=0, 1, ... up to nny-1 which indeed corresponds to the row by row numbering. We now turn to the connectivity. As mentioned before, this is a structured mesh so that the so-called connectivity array, named icon in our case, can be filled easily. For each element we need to store the node identities of its vertices. Since there are nel elements and m=4 corners, this is a m×nel array. The algorithm goes as follows: i c o n =np . z e r o s ( (m, n e l ) , dtype=np . i n t 1 6 ) counter = 0 f o r j in range (0 , nely ) : f o r i in range (0 , nelx ) : i c o n [ 0 , c o u n t e r ] = i + j ∗ nnx i c o n [ 1 , c o u n t e r ] = i + 1 + j ∗ nnx i c o n [ 2 , c o u n t e r ] = i + 1 + ( j + 1 ) ∗ nnx i c o n [ 3 , c o u n t e r ] = i + ( j + 1 ) ∗ nnx c o u n t e r += 1 In the case of the 3×2 mesh, the icon is filled as follows: element id→ node id↓ 0 1 2 3 0 1 2 3 4 5 0 1 5 4 1 2 6 5 2 3 7 6 4 5 9 8 5 6 10 9 6 7 11 10 It is to be understood as follows: element #4 is composed of nodes 5, 6, 10 and 9. Note that nodes are always stored in a counter clockwise manner, starting at the bottom left. This is very important since the corresponding basis functions and their derivatives will be labelled accordingly. In three dimensions things are very similar. The mesh now counts nelx×nely×nelz=nel elements which represent a cuboid of size Lx×Ly×Lz. The position of the nodes is obtained as follows: x = np . empty ( nnp , dtype=np . f l o a t 6 4 ) y = np . empty ( nnp , dtype=np . f l o a t 6 4 ) z = np . empty ( nnp , dtype=np . f l o a t 6 4 ) c o u n t e r=0 f o r i i n r a n g e ( 0 , nnx ) : f o r j i n r a n g e ( 0 , nny ) : f o r k i n r a n g e ( 0 , nnz ) : x [ c o u n t e r ]= i ∗hx y [ c o u n t e r ]= j ∗hy z [ c o u n t e r ]=k∗ hz c o u n t e r += 1 The connectivity array is now of size m×nel with m=8: i c o n =np . z e r o s ( (m, n e l ) , dtype=np . i n t 1 6 ) counter = 0 f o r i in range (0 , nelx ) : f o r j in range (0 , nely ) : f o r k in range (0 , n e l z ) : i c o n [ 0 , c o u n t e r ]=nny∗ nnz ∗ ( i )+nnz ∗ ( j )+k i c o n [ 1 , c o u n t e r ]=nny∗ nnz ∗ ( i +1)+nnz ∗ ( j )+k i c o n [ 2 , c o u n t e r ]=nny∗ nnz ∗ ( i +1)+nnz ∗ ( j +1)+k i c o n [ 3 , c o u n t e r ]=nny∗ nnz ∗ ( i )+nnz ∗ ( j +1)+k i c o n [ 4 , c o u n t e r ]=nny∗ nnz ∗ ( i )+nnz ∗ ( j )+k+1 i c o n [ 5 , c o u n t e r ]=nny∗ nnz ∗ ( i +1)+nnz ∗ ( j )+k+1 i c o n [ 6 , c o u n t e r ]=nny∗ nnz ∗ ( i +1)+nnz ∗ ( j +1)+k+1 i c o n [ 7 , c o u n t e r ]=nny∗ nnz ∗ ( i )+nnz ∗ ( j +1)+k+1 c o u n t e r += 1 62 produce drawing of node numbering 63 6.11 Visco-Plasticity 6.11.1 Tensor invariants Before we dive into the world of nonlinear rheologies it is necessary to introduce the concept of tensor invariants since they are needed further on. Unfortunately there are many different notations used in the literature and these can prove to be confusing. Given a tensor T , one can compute its (moment) invariants as follows: • first invariant : TI |2D 3D TI | = T r[T ] = Txx + Tyy = T r[T ] = Txx + Tyy + Tzz • second invariant : TII |2D = 1 2 1X 1 2 2 T r[T 2 ] = Tij Tji = (Txx + Tyy ) + Txy 2 2 ij 2 TII |3D = 1 1 2 1X 2 2 2 2 2 T r[T 2 ] = Tij Tji = (Txx + Tyy + Tyy ) + Txy + Txz + Tyz 2 2 ij 2 • third invariant : TIII = 1X 1 T r[T 3 ] = Tij Tjk Tki 3 3 ijk The implementation of the plasticity criterions relies essentially on the second invariants of the (deviatoric) stress τ and the (deviatoric) strainrate tensors ε̇: τII |2D = = = τII |3D = = = εII |2D = = = εII |3D = = 1 2 2 2 (τ + τyy ) + τxy 2 xx 1 2 (σxx − σyy )2 + σxy 4 1 (σ1 − σ2 )2 4 1 2 2 2 2 2 2 (τ + τyy + τzz ) + τxy + τxz + τyz 2 xx 1 2 2 2 (σxx − σyy )2 + (σyy − σzz )2 + (σxx − σzz )2 + σxy + σxz + σyz 6 1 (σ1 − σ2 )2 + (σ2 − σ3 )2 + (σ1 − σ3 )2 6 1 d 2 (ε̇xx ) + (ε̇dyy )2 + (ε̇dxy )2 2 1 1 1 (ε̇xx − ε̇yy )2 + (ε̇yy − ε̇xx )2 + ε̇2xy 2 4 4 1 (ε̇xx − ε̇yy )2 + ε̇2xy 4 1 d 2 (ε̇xx ) + (ε̇dyy )2 + (ε̇dzz )2 + (ε̇dxy )2 + (ε̇dxz )2 + (ε̇dyz )2 2 1 (˙xx − ˙yy )2 + (˙yy − ˙zz )2 + (˙xx − ˙zz )2 + ˙2xy + ˙2xz + ˙2yz 6 Note that these (second) invariants are almost always used under a square root so we define: 64 τ II = √ τII ε̇II = p ε̇II Note that these quantities have the same dimensions as their tensor counterparts, i.e. Pa for stresses and s−1 for strain rates. 6.11.2 Scalar viscoplasticity This formulation is quite easy to implement. It is widely used, e.g. [141, 132, 121], and relies on the assumption that a scalar quantity ηp (the ’effective plastic viscosity’) exists such that the deviatoric stress tensor τ = 2ηp ε̇ (194) is bounded by some yield stress value Y . From Eq. (194) it follows that τ II = 2ηp ε̇II = Y which yields ηp = Y 2ε̇II This approach has also been coined the Viscosity Rescaling Method (VRM) [75]. insert here the rederivation 2.1.1 of spmw16 It is at this stage important to realise that (i) in areas where the strainrate is low, the resulting effective viscosity will be large, and (ii) in areas where the strainrate is high, the resulting effective viscosity will be low. This is not without consequences since (effective) viscosity contrasts up to 8-10 orders of magnitude have been observed/obtained with this formulation and it makes the FE matrix very stiff, leading to (iterative) solver convergence issues. In order to contain these viscosity contrasts one usually resorts to viscosity limiters ηmin and ηmax such that ηmin ≤ ηp ≤ ηmax Caution must be taken when choosing both values as they may influence the final results. . python codes/fieldstone indentor 6.11.3 about the yield stress value Y In geodynamics the yield stress value is often given as a simple function. It can be constant (in space and time) and in this case we are dealing with a von Mises plasticity yield criterion. . We simply assume YvM = C where C is a constant cohesion independent of pressure, strainrate, deformation history, etc ... Another model is often used: the Drucker-Prager plasticity model. A friction angle φ is then introduced and the yield value Y takes the form YDP = p sin φ + C cos φ and therefore depends on the pressure p. Because φ is with the range [0◦ , 45◦ ], Y is found to increase with depth (since the lithostatic pressure often dominates the overpressure). Note that a slightly modified verion of this plasticity model has been used: the total pressure p is then replaced by the lithostatic pressure plith . 65 6.12 Pressure smoothing It has been widely documented that the use of the Q1 × P0 element is not without problems. Aside from the consequences it has on the FE matrix properties, we will here focus on another unavoidable side effect: the spurious pressure checkerboard modes. These modes have been thoroughly analysed [61, 30, 113, 114]. They can be filtered out [30] or simply smoothed [81]. On the following figure (a,b), pressure fields for the lid driven cavity experiment are presented for both an even and un-even number of elements. We see that the amplitude of the modes can sometimes be so large that the ’real’ pressure is not visible and that something as simple as the number of elements in the domain can trigger those or not at all. b) a) c) a) element pressure for a 32x32 grid and for a 33x33 grid; b) image from [42, p307] for a manufactured solution; c) elemental pressure and smoothed pressure for the punch experiment [132] The easiest post-processing step that can be used (especially when a regular grid is used) is explained in [132]: ”The element-to-node interpolation is performed by averaging the elemental values from elements common to each node; the node-to-element interpolation is performed by averaging the nodal values element-by-element. This method is not only very efficient but produces a smoothing of the pressure that is adapted to the local density of the octree. Note that these two steps can be repeated until a satisfying level of smoothness (and diffusion) of the pres- sure field is attained.” In the codes which rely on the Q1 × P0 element, the (elemental) pressure is simply defined as p=np . z e r o s ( n e l , dtype=np . f l o a t 6 4 ) while the nodal pressure is then defined as q=np . z e r o s ( nnp , dtype=np . f l o a t 6 4 ) The element-to-node algorithm is then simply (in 2D): count=np . z e r o s ( nnp , dtype=np . i n t 1 6 ) f o r i e l in range (0 , nel ) : q [ i c o n [ 0 , i e l ]]+=p [ i e l ] q [ i c o n [ 1 , i e l ]]+=p [ i e l ] q [ i c o n [ 2 , i e l ]]+=p [ i e l ] q [ i c o n [ 3 , i e l ]]+=p [ i e l ] count [ i c o n [ 0 , i e l ]]+=1 count [ i c o n [ 1 , i e l ]]+=1 count [ i c o n [ 2 , i e l ]]+=1 count [ i c o n [ 3 , i e l ]]+=1 q=q/ count 66 Pressure smoothing is further discussed in [67]. produce figure to explain this link to proto paper link to least square and nodal derivatives 67 6.13 Pressure scaling As perfectly explained in the step 32 of deal.ii5 , we often need to scale the G term since it is many orders of magnitude smaller than K, which introduces large inaccuracies in the solving process to the point that the solution is nonsensical. This scaling coefficient is η/L. We start from K G V f · = P h GT 0 and introduce the scaling coefficient as follows (which in fact does not alter the solution at all): η V K f LG · = η η T L 0 ηP Lh LG We then end up with the modified Stokes system: K G V f · = P h GT 0 where G= η G L P= L P η After the solve phase, we recover the real pressure with P = 5 https://www.dealii.org/9.0.0/doxygen/deal.II/step 32.html 68 h= η 0 LP . η h L 6.14 Pressure normalisation When Dirichlet boundary conditions are imposed everywhere on the boundary, pressure is only present by its gradient in the equations. It is thus determined up to an arbitrary constant. In such a case, one commonly impose the average of the pressure over the whole domain or on a subsect of the boundary to be have a zero average, i.e. Z pdV = 0 Ω Another possibility is to impose the pressure value at a single node. Let us assume that we are using Q1 × P0 elements. Then the pressure is constant inside each element. The integral above becomes: Z XZ X Z X pdV = pdV = pe dV = p e Ae = Ω e Ωe e Ωe e where the sum runs over all elements e of area Ae . This can be rewritten LT P = 0 and it is a constraint on the pressure. As we have seen before ??, we can associate to it a Lagrange multiplier λ so that we must solve the modified Stokes system: K G 0 V f GT 0 L · P = h λ 0 0 LT 0 When higher order spaces are used for pressure (continuous or discontinuous) one must then carry out the above integration numerically by means of (usually) a Gauss-Legendre quadrature. . python codes/fieldstone stokes sphere 3D saddlepoint/ . python codes/fieldstone burstedde/ . python codes/fieldstone busse/ . python codes/fieldstone RTinstability1/ . python codes/fieldstone saddlepoint q2q1/ . python codes/fieldstone compressible2/ . python codes/fieldstone compressible1/ . python codes/fieldstone saddlepoint q3q2/ 69 6.15 The choice of solvers Let us first look at the penalty formulation. In this case we are only solving for velocity since pressure is recovered in a post-processing step. We also know that the penalty factor is many orders of magnitude higher than the viscosity and in combination with the use of the Q1 × P0 element the resulting matrix condition number is very high so that the use of iterative solvers in precluded. Indeed codes such as SOPALE [54], DOUAR [17], or FANTOM [130] relying on the penalty formulation all use direct solvers (BLKFCT, MUMPS, WSMP). The main advantage of direct solvers is used in this case: They can solve ill-conditioned matrices. However memory requirements for the storage of number of nonzeros in the Cholesky matrix grow very fast as the number of equations/grid size increases, especially in 3D, to the point that even modern computers with tens of Gb of RAM cannot deal with a 1003 element mesh. This explains why direct solvers are often used for 2D problems and rarely in 3D with noticeable exceptions [132, 144, 18, 88, 4, 5, 6, 140, 98]. In light of all this, let us start again from the (full) Stokes system: K G V f · = P h GT 0 We need to solve this system in order to obtain the solution, i.e. the V and P vectors. But how? Unfortunately, this question is not simple to answer and the ’right’ depends on many parameters. How big is the matrix ? what is the condition number of the matrix K ? Is it symmetric ? (i.e. how are compressible terms handled?). 6.15.1 The Schur complement approach Let us write the above system as two equations: KV + GP = f (195) GT V = h (196) The first line can be re-written V = K−1 (f − GP) and can be inserted in the second: GT V = GT [K−1 (f − GP)] = h or, GT K −1 GP = GT K−1 f − h The matrix S = GT K−1 G is called the Schur complement. It is Symmetric (since K is symmetric) and Postive-Definite6 (SPD) if Ker(G) = 0. look in donea-huerta book for details Having solved this equation (we have obtained P), the velocity can be recovered by solving KV = f − GP. For now, let us assume that we have built the S matrix and the right hand side f˜ = GT K−1 f − h. We must solve SP = f˜. Since S is SPD, the Conjugate Gradient (CG) method is very appropriate to solve this system. Indeed, looking at the definition of Wikipedia: In mathematics, the conjugate gradient method is an algorithm for the numerical solution of particular systems of linear equations, namely those whose matrix is symmetric and positive-definite. The conjugate gradient method is often implemented as an iterative algorithm, applicable to sparse systems that are too large to be handled by a direct implementation or other direct methods such as the Cholesky decomposition. Large sparse systems often arise when numerically solving partial differential equations or optimization problems. The Conjugate Gradient algorithm is as follows: 6M positive definite ⇐⇒ xT M x > 0 ∀ x ∈ Rn \ 0 70 Algorithm obtained from https://en.wikipedia.org/wiki/Conjugate_gradient_method Let us look at this algorithm up close. The parts which may prove to be somewhat tricky are those involving the matrix (in our case the Schur complement). We start the iterations with a guess pressure P0 ( and an initial guess velocity which could be obtained by solving KV0 = f − GP0 ). r0 = f˜ − SP0 T = G K −1 (197) T f − h − (G K −1 G)P0 = GT K−1 (f − GP0 ) − h T = G K −1 KV0 − h T = G V0 − h (198) (199) (200) (201) (202) We now turn to the αk coefficient: αk = rkT rk rkT rk rkT rk = = pk Spk pk GT K−1 Gpk (Gpk )T K−1 (Gpk ) We then define p̃k = Gpk , so that αk can be computed as follows: 1. compute p̃k = Gpk 2. solve Kdk = p̃k 3. compute αk = (rkT rk )/(p̃Tk dk ) Then we need to look at the term Spk : Spk = GT K−1 Gpk = GT K−1 p̃k = GT dk We can then rewrite the CG algorithm as follows [149]: • r0 = GT V0 − h • if r0 is sufficiently small, then return (V0 , P0 ) as the result • p0 = r0 • k=0 • repeat – compute p̃k = Gpk – solve Kdk = p̃k – compute αk = (rkT rk )/(p̃Tk dk ) 71 – Pk+1 = Pk + αk pk – rk+1 = rk − αk GT dk – if rk+1 is sufficiently small, then exit loop T – βk = (rk+1 rk+1 )/(rkT rk ) – pk+1 = rk+1 + βk pk – k =k+1 • return Pk+1 as result We see that we have managed to solve the Schur complement equation with the Conjugate Gradient method without ever building the matrix S. Having obtained the pressure solution, we can easily recover the corresponding velocity with KVk+1 = f − GPk+1 . However, this is rather unfortunate because it requires yet another solve with the K matrix. As it turns out, we can slightly alter the above algorithm to have it update the velocity as well so that this last solve is unnecessary. We have Vk+1 = K−1 (f −GPp+1 ) = K−1 (f −G(Pk +αk pk )) = K−1 (f −GPk )−αk K−1 Gpk = V−αk K−1 p̃k = Vk −αk dk and we can insert this minor extra calculation inside the algorithm and get the velocity solution nearly for free. The final CG algorithm is then solver cg: • compute V0 = K−1 (f − GP0 ) • r0 = GT V0 − h • if r0 is sufficiently small, then return (V0 , P0 ) as the result • p0 = r0 • k=0 • repeat – compute p̃k = Gpk – solve Kdk = p̃k – compute αk = (rkT rk )/(p̃Tk dk ) – Pk+1 = Pk + αk pk – Vk+1 = Vk − αk dk – rk+1 = rk − αk GT dk – if rk+1 is sufficiently small (|rk+1 |2 /|r0 |2 < tol), then exit loop T – βk = (rk+1 rk+1 )/(rkT rk ) – pk+1 = rk+1 + βk pk – k =k+1 • return Pk+1 as result This iterative algorithm will converge to the solution with a rate which depends on the condition number of the S matrix, which is not easily obtainable since S is never built. Also, we know that large viscosity contrasts in the domain will influence this too. Finally, we notice that this algorithm requires one solve with matrix K per iteration but says nothing about the method employed to do so. One thing we know improves the convergence of any iterative solver is the use of a preconditioner matrix and therefore use the Preconditioned Conjugate Gradient method: 72 Algorithm obtained from https://en.wikipedia.org/wiki/Conjugate_gradient_method In the algorithm above the preconditioner matrix M has to be symmetric positive-definite and fixed, i.e., cannot change from iteration to iteration. We see that this algorithm introduces an additional vector z and a solve with the matrix M at each iteration, which means that M must be such that solving M x = f where f is a given rhs vector must be cheap. Ultimately, the PCG algorithm applied to the Schur complement equation takes the form: solver pcg: • compute V0 = K−1 (f − GP0 ) • r0 = GT V0 − h • if r0 is sufficiently small, then return (V0 , P0 ) as the result • z0 = M −1 r0 • p0 = z0 • k=0 • repeat – compute p̃k = Gpk – solve Kdk = p̃k – compute αk = (rkT zk )/(p̃Tk dk ) – Pk+1 = Pk + αk pk – Vk+1 = Vk − αk dk – rk+1 = rk − αk GT dk – if rk+1 is sufficiently small (|rk+1 |2 /|r0 |2 < tol), then exit loop – zk+1 = M −1 rk+1 T – βk = (zk+1 rk+1 )/(zkT rk ) – pk+1 = zk+1 + βk pk – k =k+1 • return Pk+1 as result 73 how to compute M for the Schur complement ? 6.16 The GMRES approach 74 6.17 The consistent boundary flux (CBF) The Consistent Boundary Flux technique was devised to alleviate the problem of the accuracy of primary variables derivatives (mainly velocity and temperature) on boundaries, where basis function (nodal) derivatives do not exist. These derivatives are important since they are needed to compute the heat flux (and therefore the NUsselt number) or dynamic topography and geoid. The idea was first introduced in [94] and later used in geodynamics [147]. It was finally implemented in the CitcomS code [148] and more recently in the ASPECT code (dynamic topography postprocessor). Note that the CBF should be seen as a post-processor step as it does not alter the primary variables values. The CBF method is implemented and used in ??. 6.17.1 applied to the Stokes equation We start from the strong form: ∇·σ =b and then write the weak form: Z Z N ∇ · σdV = Ω N bdV Ω where N is any test function. We then use the two equations: Z ∇ · (N σ) = N ∇ · σ + ∇N · σ (chain rule) Z (∇ · f ) dV = f · n dS (divergence theorem) Ω Γ Integrating the first equation over Ω and using the second, we can write: Z Z Z N σ · n dS − ∇N · σ dV = N bdV Γ Ω Ω On Γ, the traction vector is given by t = σ · n: Z Z Z N tdS = ∇N · σdV + N bdV Γ Ω Ω Considering the traction vector as an unknown living on the nodes on the boundary, we can expand (for Q1 elements) 2 2 X X tx = tx|i Ni ty = ty|i Ni i=1 i=1 on the boundary so that the left hand term yields a mass matrix M 0 . Finally, using our previous experience of discretising the weak form, we can write: M 0 · T = −KV − GP + f where T is the vector of assembled tractions which we want to compute and V and T are the solutions of the Stokes problem. Note that the assembly only takes place on the elements along the boundary. Note that the assembled mass matrix is tri-diagonal can be easily solved with a Conjugate Gradient method. With a trapezoidal integration rule (i.e. Gauss-Lobatto) the matrix can even be diagonalised and the resulting matrix is simply diagonal, which results in a very cheap solve [147]. 6.17.2 applied to the heat equation We start from the strong form of the heat transfer equation (without the source terms for simplicity): ∂T + v · ∇T = ∇ · k∇T ρcp ∂t 75 The weak form then writes: Z Z Z ∂T dV + ρcp N ρcp N v · ∇T dV = N ∇ · k∇T dV ∂t Ω Ω Ω Using once again integration by parts and divergence theorem: Z Z Z Z ∂T dV + ρcp N v · ∇T dV = N k∇T · ndΓ − ∇N · k∇T dV N ρcp ∂t Ω Γ Ω Ω On the boundary we are interested in the heat flux q = −k∇T Z Z Z Z ∂T dV + ρcp N v · ∇T dV = − N q · ndΓ − N ρcp ∇N · k∇T dV ∂t Ω Γ Ω Ω or, Z Z N q · ndΓ = − Γ N ρcp Ω ∂T dV − ρcp ∂t Z Z N v · ∇T dV − Ω ∇N · k∇T dV Ω Considering the normal heat flux qn = q · n as an unknown living on the nodes on the boundary, qn = 2 X qn|i Ni i=1 so that the left hand term becomes a mass matrix for the shape functions living on the boundary. We have already covered the right hand side terms when building the FE system to solve the heat transport equation, so that in the end ∂T − Ka · T − Kd · T M 0 · Qn = −M · ∂t where Qn is the assembled vector of normal heat flux components. Note that in all terms the assembly only takes place over the elements along the boundary. Note that the resulting matrix is symmetric. 6.17.3 implementation - Stokes equation Let us start with a small example, a 3x2 element FE grid: 16 17 8 18 19 9 3 4 89 1213 5 1415 6 0 7 1 01 22 23 11 5 1011 4 0 20 21 10 2 23 45 1 2 67 3 Red color corresponds to the dofs in the x direction, blue color indicates a dof in the y direction. We have nnp=12, nel=6, NfemV=24. Let us assume that free slip boundary conditions are applied. The fix bc array is then: bc fix=[ T T T T T T T T T T T T T T T T T T T T T T T T ] Note that since corners belong to two edges, we effectively prescribed no-slip boundary conditions on those. We wish to compute the tractions on the boundaries, and more precisely for the dofs for which a Dirichlecht velocity boundary condition has been prescribed. The number of (traction) unknowns NfemTr is then the number of T in the bc fix array. In our specific case, we wave NfemTr= . This means that we need for each targeted dof to be able to find its identity/number between 0 and NfemTr-1. We therefore create the array bc nb which is filled as follows: 76 bc nb=[T T T T T T T T T T T T T T T T T T T T T T T T ] This translates as follows in the code: NfemTr=np . sum ( b c f i x ) bc nb=np . z e r o s ( NfemV , dtype=np . i n t 3 2 ) c o u n t e r=0 f o r i i n r a n g e ( 0 , NfemV) : if ( bc fix [ i ]) : bc nb [ i ]= c o u n t e r c o u n t e r+=1 Algorithm 1 dksjfhfjk ghdf 0: kjhg kf 0: gfhfk The algorithm is then as follows A Prepare two arrays to store the matrix Mcbf and its right hand side rhscbf B Loop over all elements C For each element touching a boundary, compute the residual vector Rel = −fel + Kel Vel + Gel Pel D Loop over the four edges of the element using the connectivity array E For each edge loop over the number of degrees of freedom (2 in 2D) F For each edge assess whether the dofs on both ends are target dofs. G If so, compute the mass matrix Medge for this edge H extract the 2 values off the element residual vector and assemble these in rhscbf I Assemble Medge into NfemTrxNfemTr matrix using bc nb M cbf = np . z e r o s ( ( NfemTr , NfemTr ) , np . f l o a t 6 4 ) r h s c b f = np . z e r o s ( NfemTr , np . f l o a t 6 4 ) # A for # B i e l in range (0 , nel ) : . . . compute e l e m e n t a l r e s i d u a l ... # C #boundary 0−1 f o r i i n r a n g e ( 0 , ndofV ) : i d o f 0 =2∗ i c o n [ 0 , i e l ]+ i i d o f 1 =2∗ i c o n [ 1 , i e l ]+ i i f ( b c f i x [ i d o f 0 ] and b c f i x [ i d o f 1 ] ) : i d o f T r 0=bc nb [ i d o f 0 ] i d o f T r 1=bc nb [ i d o f 1 ] r h s c b f [ i d o f T r 0 ]+= r e s e l [0+ i ] r h s c b f [ i d o f T r 1 ]+= r e s e l [2+ i ] M cbf [ i d o f T r 0 , i d o f T r 0 ]+=M edge [ 0 , 0 ] M cbf [ i d o f T r 0 , i d o f T r 1 ]+=M edge [ 0 , 1 ] M cbf [ i d o f T r 1 , i d o f T r 0 ]+=M edge [ 1 , 0 ] M cbf [ i d o f T r 1 , i d o f T r 1 ]+=M edge [ 1 , 1 ] # D # E #boundary 1−2 #[D] # F # H # # I # # ... #boundary 2−3 #[D] ... 77 #boundary 3−0 #[D] ... 78 6.18 The value of the timestep The chosen time step dt used for time integration is chosen to comply with the Courant-Friedrichs-Lewy condition [7]. h h2 δt = C min , max |v| κ where h is a measure of the element size, κ = k/ρcp is the thermal diffusivity and C is the so-called CFL number chosen in [0, 1[. In essence the CFL condition arises when solving hyperbolic PDEs . It limits the time step in many explicit time-marching computer simulations so that the simulation does not produce incorrect results. This condition is not needed when solving the Stokes equation but it is mandatory when solving the heat transport equation or any kind of advection-diffusion equation. Note that any increase of grid resolution (i.e. h becomes smaller) yields an automatic decrease of the time step value. 79 6.19 mappings The name isoparametric derives from the fact that the same (’iso’) functions are used as basis functions and for the mapping to the reference element. 80 6.20 Exporting data to vtk format This format seems to be the universally accepted format for 2D and 3D visualisation in Computational Geodynamics. Such files can be opened with free softwares such as Paraview 7 , MayaVi 8 or Visit 9 . Unfortunately it is my experience that no simple tutorial exists about how to build such files. There is an official document which describes the vtk format10 but it delivers the information in a convoluted way. I therefore describe hereafter how fieldstone builds the vtk files. I hereunder show vtk file corresponding to the 3x2 grid presented earlier 6.10. In this particular example there are: • 12 nodes and 6 elements • 1 elemental field: the pressure p) • 2 nodal fields: 1 scalar (the smoothed pressure q), 1 vector (the velocity field u,v,0) Note that vtk files are inherently 3D so that even in the case of a 2D simulation the z-coordinate of the points and for instance their z-velocity component must be provided. The file, usually called solution.vtu starts with a header:The solution.vtu file can then be opened with ParaView, MayaVi or Visit and the reader is advised to find tutorials online on how to install and use these softwares. 82 6.21 Runge-Kutta methods These methods were developed around 1900 by the German mathematicians Carl Runge and Martin Kutta. The RK methods are methods for the numerical integration of ODEs. These methods are well documented in any numerical analysis textbook and the reader is referred to [57, 69]. Any Runge-Kutta method is uniquely identified by its Butcher tableau. The following method is called the Runge-Kutta-Fehlberg method and is commonly abbreviated RKF45. Its Butcher tableau is as follows: 0 1/4 1/4 3/8 3/32 9/32 12/13 1932/2197 -7200/2197 7296/2197 439/216 -8 3680/513 -845/4104 1 1/2 -8/27 2 -3544/2565 1859/4104 -11/40 16/135 0 6656/12825 28561/56430 -9/50 2/55 25/216 0 1408/2565 2197/4104 -1/5 0 The first row of coefficients at the bottom of the table gives the fifth-order accurate method, and the second row gives the fourth-order accurate method. 83 6.22 Am I in or not? It is quite common that at some point one must answer the question: ”Given a mesh and its connectivity on the one hand, and the coordinates of a point on the other, how do I accurately and quickly determine in which element the point resides?” One typical occurence of such a problem is linked to the use of the Particle-In-Cell technique: particles are advected and move through the mesh, and need to be localised at every time step. This question could arise in the context of a benchmark where certain quantities need to be measured at specific locations inside the domain. 6.22.1 Two-dimensional space We shall first focus on quadrilaterals. There are many kinds of quadrilaterals as shown hereunder: I wish to arrive at a single algorithm which is applicable to all quadrilaterals and therefore choose an irregular quadrilateral. For simplicity, let us consider a Q1 element, with a single node at each corner. 3 2 M 1 0 Several rather simple options exist: • we could subdivide the quadrilateral into two triangles and check whether point M is inside any of them (as it turns out, this problem is rather straightforward for triangles. Simply google it.) • We could check that point M is always on the left side of segments 0 → 1, 1 → 2, 2 → 3, 3 → 0. • ... Any of these approaches will work although some might be faster than others. In three-dimensions all will however become cumbersome to implement and might not even work at all. Fortunately, there is an elegant way to answer the question, as detailed in the following subsection. 6.22.2 Three-dimensional space If point M is inside the quadrilateral, there exist a set of reduced coordinates r, s, t ∈ [−1 : 1]3 such that 4 X i=1 Ni (rM , s, t)xi = xM 4 X Ni (rM , s, t)yi = yM i=1 4 X i=1 84 Ni (rM , s, t)zi = zM This can be cast as a system of three equations and three unknowns. Unfortunately, each shape function Ni contains a term rst (as well as rs, rt, and st) so that it is not a linear system and standard techniques are not applicable. We must then use an iterative technique: the algorithm starts with a guess for values r, s, t and improves on their value iteration after iteration. The classical way of solving nonlinear systems of equations is Newton’s method. We can rewrite the equations above as F (r, s, t) = 0: 8 X Ni (r, s, t)xi − xM = 0 Ni (r, s, t)yi − yM = 0 Ni (r, s, t)zi − zM = 0 i=1 8 X i=1 8 X (203) i=1 or, Fr (r, s, t) = 0 Fs (r, s, t) = 0 Ft (r, s, t) = 0 so that we now have to find the zeroes of continuously differentiable functions F : R → R. The recursion is simply: rk+1 rk Fr (rk , sk , tk ) sk+1 = sk − JF (rk , sk , tk )−1 Fs (rk , sk , tk ) tk+1 tk Ft (rk , sk , tk ) where J the Jacobian matrix: JF (rk , sk , tk ) = = ∂Fr ∂r (rk , sk , tk ) ∂Fr ∂s (rk , sk , tk ) ∂Fr ∂t (rk , sk , tk ) ∂Fs ∂r (rk , sk , tk ) ∂Fs ∂s (rk , sk , tk ) ∂Fs ∂t (rk , sk , tk ) ∂Ft ∂Ft ∂Ft ∂r (rk , sk , tk ) ∂s (rk , sk , tk ) ∂t (rk , sk , tk ) 8 8 8 P ∂Ni P ∂Ni P (r , s , t )x (r , s , t )x k k k i k k k i ∂r ∂s i=1 i=1 i=1 8 8 8 P P P ∂Ni ∂Ni ∂r (rk , sk , tk )yi ∂s (rk , sk , tk )yi i=1 i=1 i=1 8 8 8 P P P ∂Ni ∂Ni ∂r (rk , sk , tk )zi ∂s (rk , sk , tk )zi i=1 i=1 i=1 ∂Ni ∂t (rk , sk , tk )xi ∂Ni ∂t (rk , sk , tk )yi ∂Ni ∂t (rk , sk , tk )zi In practice, we solve the following system: rk+1 rk Fr (rk , sk , tk ) JF (rk , sk , tk ) sk+1 − sk = − Fs (rk , sk , tk ) tk+1 tk Ft (rk , sk , tk ) Finally, the algorithm goes as follows: • set guess values for r, s, t (typically 0) • loop over k=0,... • Compute rhs= −F (rk , sk , tk ) • Compute matrix JF (rk , sk , tk ) 85 • solve system for (drk , dsk , dtk ) • update rk+1 = rk + drk , sk+1 = sk + dsk , tk+1 = tk + dtk • stop iterations when (drk , dsk , dtk ) is small • if rk , sk , tk ∈ [−1, 1]3 then M is inside. This method converges quickly but involves iterations, and multiple solves of 3 × 3 systems which, when carried out for each marker and at each time step can prove to be expensive. A simple modification can be added to the above algorithm: iterations should be carried out only when the point M is inside of a cuboid of size [min xi : max xi ] × [min yi : max yi ] × [min zi : max zi ] where the sums run over the vertices i i i i i i of the element. In 2D this translates as follows: only carry out Newton iterations when M is inside the red rectangle! 3 2 M 1 0 Note that the algorithm above extends to high degree elements such as Q2 and higher, even with curved sides. 86 6.23 Error measurements and convergence rates What follows is written in the case of a two-dimensional model. Generalisation to 3D is trivial. What follows is mostly borrowed from [129]. When measuring the order of accuracy of the primitive variables v and p, it is standard to report errors in both the L1 and the L2 norm. For a scalar quantity Ψ, the L1 and L2 norms are computed as sZ Z ||Ψ||1 = |Ψ|dV Ψ2 dV ||Ψ||2 = V V For a vector quantity k = (kx , ky ), the L1 and L2 norms are defined as: sZ Z ||k||1 = (|kx | + |ky |)dV (kx2 + ky2 )dV ||k||2 = V V To compute the respective norms the integrals in the above norms can be approximated by splitting them into their element-wise contributions. The element volume integral can then be easily computed by numerical integration using GaussLegendre quadrature. The respective L1 and L2 norms for the pressure error can be evaluated via v u ne nq nq ne X X uX X |ep (rq )|2 wq |Jq | ||ep ||1 = |ep (rq )|wq |Jq | ||ep ||2 = t i=1 q=1 i=1 q=1 where ep (rq ) = p(rq ) − pth (rq ) is the pressure error evaluated at the qth quadrature associated with the ith element. ne and nq refer to the number of elements and the number of quadrature points per element. wq and Jq are the quadrature weight of the Jacobian associated with point q. The velocity error ev is evaluated using the following two norms v u ne nq nq ne X X uX X [|eu (rq )| + |ev (rq )|]wq |Jq | ||ev ||2 = t ||ev ||1 = [|eu (rq )|2 + ev (rq )|2 ] wq |Jq | i=1 q=1 i=1 q=1 where eu (rq ) = u(rq ) − uth (rq ) ev (rq ) = v(rq ) − v th (rq ) We compute the different error norms for ep and ev for a set of numerical experiments with varying resolution h. We expect the error norms to follow the following relationships: 0 ||ev ||1 = Chrv ||ev ||2 = Chrv ||ep ||1 = Chrp ||ep ||2 = Chrp 0 where C is a resolution-independent constant and rp , rp0 and rv , rv0 are the convergence rates for pressure and velocity, respectively. Using linear regression on the logarithm of the respective error norm and the resolution, we compute the convergence rates of the numerical solutions. • For Q1 P0 , the theoretical lower bound for rv0 is 2 and for rp0 it is 1 • For Q2 P−1 , the theoretical lower bound for rv0 is 3 and for rp0 it is 2 We note that when using discontinuous pressure space (e.g., P0 , P−1 ), these bounds remain valid even when the viscosity is discontinuous provided that the element boundaries conform to the discontinuity. 87 6.24 6.24.1 The initial temperature field Single layer with imposed temperature b.c. Let us take a single layer of material characterised by a heat capacity cp , a heat conductivity k and a heat production term H. The Heat transport equation writes ρcp ( ∂T ~ )=∇ ~ · (k ∇T ~ ) + ρH + ~v · ∇T ∂t At steady state and in the absence of a velocity field, and assuming that the material properties to be independent of time and space, and that there is no heat production (H = 0), this equation simplifies to ∆T = 0 Assuming the layer to be parallel to the x-axis, this yields to write T (x, y) = T (y) = αT + β In order to specify the constants α and β, we need two constraints. At the bottom of the layer y = yb a temperature Tb is prescribed while a temperature Tt is prescribed at the top with y = yt . This ultimately yields a temperature field in the layer given by T (y) = Tt − Tb (y − yb ) + Tb yt − yb If now the heat production coefficient is not zero, the differential equation reads k∆T + H = 0 The temperature field is then expected to be of the form T (y) = − H 2 y + αy + β 2k Supplied again with the same boundary conditions, this leads to β = Tb + H 2 y − αyb 2k b ie, T (y) = − H 2 (y − yb2 ) + α(y − yb ) + Tb 2k and finally α= Tt − Tb H + (yb + yt ) yt − yb 2k or, H T (y) = − (y 2 − yb2 ) + 2k Tt − Tb H + (yb + yt ) (y − yb ) + Tb yt − yb 2k Taking H = 0 in this equation obviously yields the temperature field obtained previously. Taking k = 2.25, Tt = 0C, Tb = 550C, yt = 660km, yb = 630km yields the following temperature profiles and heat fluxes when the heat production H varies: 88 600 0.06 0.05 400 heat flux (W/m2) Temperature (C) 0.07 H=0.0e-6 H=0.8e-6 H=1.6e-6 500 300 200 100 0 625000 H=0.0e-6 H=0.4e-6 H=0.8e-6 H=1.0e-6 H=1.2e-6 H=1.6e-6 0.04 0.03 0.02 0.01 630000 635000 640000 645000 650000 655000 660000 0 625000 630000 y 635000 640000 645000 650000 655000 660000 y Looking at the values at the top, which are somewhat estimated to be about 55 − 65mW/m2 [73, table 8.6], one sees that value H = 0.8e − 6 yields a very acceptable heat flux. Looking at the bottom, the heat flux is then about 0.03W/m2 which is somewhat problematic since the heat flux at the Moho is reported to be somewhere between 10 and 20 mW/m2 in [73, table 7.1]. 6.25 Single layer with imposed heat flux b.c. Let us now assume that heat fluxes are imposed at the top and bottom of the layer: We start again from the ODE k∆T + H = 0 but only integrate it once: k dT + Hy + α = 0 dy At the bottom q = k(dT /dy)|y=yb = qb and at the top q = k(dT /dy)|y=yt = qt so that to finish 6.26 Single layer with imposed heat flux and temperature b.c. to finish 6.26.1 Half cooling space 6.26.2 Plate model 6.26.3 McKenzie slab 89 6.27 6.27.1 Kinematic boundary conditions In-out flux boundary conditions for lithospheric models The velocity on the side is given by u(y) = vext y < L1 vin − vext = (y − y1 ) + vext y2 − y1 = vin y > y2 u(y) u(y) y1 < y < y2 The requirement for volume conservation is: Z Ly Φ= u(y)dy = 0 0 Having chosen vin (the velocity of the plate), one can then compute vext as a function of y1 and y2 . Z Φ = y1 Z y2 u(y)dy + 0 Z Ly u(y)dy + y1 u(y)dy y2 1 = vext y1 + (vin + vext )(y2 − y1 ) + (Ly − y2 )vin 2 1 1 = vext [y1 + (y2 − y1 )] + vin [ (y2 − y1 ) + (Ly − y2 )] 2 2 1 1 = vext (y1 + y2 ) + vin [Ly − (y1 + y1 )] 2 2 and finally vext = −vin Ly − 21 (y1 + y1 ) 1 2 (y1 + y2 ) 90 7 fieldstone 01: simple analytical solution This fieldstone was developed in collaboration with Job Mos. From [42]. In order to illustrate the behavior of selected mixed finite elements in the solution of stationary Stokes flow, we consider a two-dimensional problem in the square domain Ω = [0, 1] × [0, 1], which possesses a closed-form analytical solution. The problem consists of determining the velocity field v = (u, v) and the pressure p such that −ν∆v + ∇p = b ∇·v =0 v=0 in Ω in Ω on Γ where the fluid viscosity is taken as ν = 1. features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (no-slip) • direct solver • isothermal • isoviscous • analytical solution 91 vx 1.0 vy 1.0 0.010 0.8 0.8 0.005 y y 0.4 0.2 x 0.6 0.8 0.01 x 0.6 0.8 1.0 0.000010 0.8 0.000005 0.6 yy 0.8 0.000010 0.000005 0.2 0.4 x 0.6 0.8 1.0 0.04 0.04 0.2 0.4 x 0.6 0.8 p pth 1.0 0.00010 0.00005 0.8 0.00000 0.00005 y 0.000005 0.2 0.0 0.0 0.00010 0.4 0.000010 0.2 0.4 x 0.6 0.8 0.100000 1.0 0.00015 0.2 0.0 0.0 0.00020 0.2 0.4 x 0.6 0.8 velocity pressure x2 x1 0.010000 error 0.001000 0.000100 0.000010 0.000001 1.0 0.6 y y 0.000010 xy 0.000000 0.4 0.000005 0.01 0.1 h Quadratic convergence for velocity error, linear convergence for pressure error, as expected. 92 0.15 0.00 0.0 0.0 1.0 0.8 1.0 0.02 vy tyth 1.0 0.8 0.2 0.03 0.6 0.6 0.4 0.02 x x 0.6 0.01 0.4 0.4 0.02 0.01 0.2 0.2 0.8 0.02 0.6 0.4 0.0 0.0 0.10 1.0 0.03 0.000000 0.2 0.2 0.0 0.0 1.0 0.00 0.0 0.0 vx txth 1.0 0.8 0.2 0.03 0.4 0.6 0.4 0.02 0.2 x 0.6 0.01 0.2 0.4 y y 0.00 0.4 0.2 0.8 0.02 0.6 0.010 1.0 0.03 0.8 0.0 0.0 0.0 0.0 1.0 xx 1.0 0.05 y 0.010 0.4 0.4 0.005 0.005 0.2 0.2 0.00 0.6 0.000 y 0.6 0.4 0.0 0.0 0.05 0.8 0.005 0.6 0.000 p 1.0 0.010 1.0 0.00025 8 fieldstone 02: Stokes sphere Viscosity and density directly computed at the quadrature points. features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (free-slip) • isothermal • non-isoviscous • buoyancy-driven flow • Stokes sphere vx 1.0 0.8 0.8 0.0005 0.6 0.4 0.0005 0.0010 0.2 0.4 x 0.6 0.8 1.0 xx 1.0 0.8 0.2 0.0 0.0 0.2 0.6 0.2 0.2 0.2 0.4 x 0.6 0.8 0.4 0.0 0.0 1.0 yy 0.2 0.010 0.0 0.0 1.0 y 0.0050 0.2 0.010 0.2 0.4 x 0.6 0.8 density 0.4 x 0.6 0.8 0.005 0.010 0.015 0.2 0.4 x 0.6 0.8 1.0 viscosity 2.0 1.0 0.8 1.8 0.8 80 0.6 1.6 0.6 60 0.4 1.4 0.4 40 0.2 1.2 0.2 20 1.0 0.0 0.0 0.0025 0.2 0.000 0.0 0.0 1.0 y 0.0125 0.0075 0.005 100 y 0.0150 0.4 0.010 0.2 1.0 0.0175 0.0100 0.015 0.005 0.2 0.6 xy 0.4 0.005 0.8 1.0 y 0.4 x 0.8 0.6 0.000 y y 0.4 0.8 x 0.6 0.8 0.6 0.6 0.4 0.005 0.6 0.4 0.2 1.0 0.010 0.8 0.2 0.0 0.4 0.002 0.005 0.000 p 0.4 0.001 1.0 0.010 0.8 0.0 0.0 0.001 0.000 0.4 0.2 1.0 y y 0.0000 0.002 y 0.6 0.0 0.0 vy 1.0 0.0010 0.0 0.0 0.2 0.4 93 x 0.6 0.8 1.0 0.2 0.4 x 0.6 0.8 1.0 9 fieldstone 03: Convection in a 2D box This benchmark deals with the 2-D thermal convection of a fluid of infinite Prandtl number in a rectangular closed cell. In what follows, I carry out the case 1a, 1b, and 1c experiments as shown in [15]: steady convection with constant viscosity in a square box. The temperature is fixed to zero on top and to ∆T at the bottom, with reflecting symmetry at the sidewalls (i.e. ∂x T = 0) and there are no internal heat sources. Free-slip conditions are implemented on all boundaries. The Rayleigh number is given by Ra = αgy ∆T h3 ρ2 cp αgy ∆T h3 = κν kµ (204) In what follows, I use the following parameter values: Lx = Ly = 1,ρ0 = cP = k = µ = 1, T0 = 0, α = 10−2 , g = 102 Ra and I run the model with Ra = 104 , 105 and 106 . The initial temperature field is given by T (x, y) = (1 − y) − 0.01 cos(πx) sin(πy) (205) The perturbation in the initial temperature fields leads to a perturbation of the density field and sets the fluid in motion. Depending on the initial Rayleigh number, the system ultimately reaches a steady state after some time. The Nusselt number (i.e. the mean surface temperature gradient over mean bottom temperature) is computed as follows [15]: R ∂T ∂y (y = Ly )dx (206) N u = Ly R T (y = 0)dx Note that in our case the denominator is equal to 1 since Lx = 1 and the temperature at the bottom is prescribed to be 1. Finally, the steady state root mean square velocity and Nusselt number measurements are indicated in Table ?? alongside those of [15] and [125]. (Note that this benchmark was also carried out and published in other publications [136, 3, 57, 37, 83] but since they did not provide a complete set of measurement values, they are not included in the table.) 4 Ra = 10 Ra = 105 Ra = 106 Vrms Nu Vrms Nu Vrms Nu Blankenbach et al 42.864947 ± 0.000020 4.884409 ± 0.000010 193.21454 ± 0.00010 10.534095 ± 0.000010 833.98977 ± 0.00020 21.972465 ± 0.000020 Tackley [125] 42.775 4.878 193.11 10.531 833.55 21.998 Steady state Nusselt number N u and Vrms measurements as reported in the literature. 94 features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (free-slip) • Boussinesq approximation • direct solver • non-isothermal • buoyancy-driven flow • isoviscous • CFL-condition 0.4 0.6 0.4 20 0.2 0.2 0.4 x 0.6 0.8 40 0.2 0.4 60 xx 1.0 100 0.8 x 0.6 0.8 1.0 yy 1.0 0 100 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.2 200 0.00.0 0.25 0.8 100 0.2 0.4 x 0.6 0.8 1.0 qy 1.0 1.00 0.4 3 0.2 1.25 0.2 2 y 4 0.4 0.4 x 0.6 0.8 1.0 1.50 0.0 0.0 1.75 1 0.2 0.4 x 0.6 0.8 1.0 0 95 0.6 0.4 0.4 0.8 0.0 400000 0.0 1.0 40 x 0.6 0.8 1.0 0.0 rho 0.998 0.996 0.6 0.4 0 0.994 10 0.2 0.2 0.4 x 0.6 0.8 1.0 20 0.0 0.0 30 80 7 70 6 0.2 0.4 x 0.6 0.8 1.0 0.992 5 50 40 30 4 3 20 2 10 0 0.4 0.8 20 10 0.2 0.2 1.0 30 60 5 0.75 0.6 0.2 x 0.6 xy 0.0 0.0 6 0.8 0.6 0.0 0.0 0.4 0.8 7 y 0.50 0.2 0.2 0.00 qx 1.0 0.0 0.0 0.4 0 0.6 200000 0.2 0.2 y 0.4 100 0.4 0.6 y y 60 0.6 0.4 0 200 1.0 0.8 0.6 0.6 20 0.2 40 0.0 0.0 1.0 0 0.8 2000000.8 Nu y 0 y 0.6 0.8 20 T y 0.8 20 1.0 40 400000 1.0 p y 0.8 0.0 0.0 1.0 40 vrms 1.0 1.0 60 vy y 60 vx 1 0.00 0.05 0.10 0.15 0.20 0.25 0.30 time 0.00 0.05 0.10 0.15 0.20 0.25 0.30 time ToDo: implement steady state criterion reach steady state do Ra=1e4, 1e5, 1e6 plot against blankenbach paper and aspect look at critical Ra number 96 10 fieldstone 04: The lid driven cavity The lid driven cavity is a famous Computational Fluid Dynamics test case and has been studied in countless publications with a wealth of numerical techniques (see [50] for a succinct review) and also in the laboratory [78]. It models a plane flow of an isothermal isoviscous fluid in a rectangular (usually square) lid-driven cavity. The boundary conditions are indicated in the Fig. ??a. The gravity is set to zero. 10.1 the lid driven cavity problem (ldc=0) In the standard case, the upper side of the cavity moves in its own plane at unit speed, while the other sides are fixed. This thereby introduces a discontinuity in the boundary conditions at the two upper corners of the cavity and yields an uncertainty as to which boundary (side or top) the corner points belong to. In this version of the code the top corner nodes are considered to be part of the lid. If these are excluded the recovered pressure showcases and extremely large checkboard pattern. This benchmark is usually dicussed in the context of low to very high Reynolds number with the full Navier-Stokes equations being solved (with the noticeable exception of [113, 114, 30, 48] which focus on the Stokes equation). In the case of the incompressible Stokes flow, the absence of inertia renders this problem instantaneous so that only one time step is needed. 10.2 the lid driven cavity problem - regularisation I (ldc=1) We avoid the top corner nodes issue altogether by prescribing the horizontal velocity of the lid as follows: u(x) = x2 (1 − x)2 . (207) In this case the velocity and its first derivative is continuous at the corners. This is the so-called regularised lid-driven cavity problem [102]. 10.3 the lid driven cavity problem - regularisation II (ldc=2) Another regularisation was presented in [39]. Here, a regularized lid driven cavity is studied which is consistent in the sense that ∇·v = 0 holds also at the corners of the domain. There are no-slip conditions at the boundaries x = 0, x = 1, and y = 0. The velocity at y = 1 is given by 2 x1 − x 1 − cos( π) x ∈ [0, x1 ] x1 u(x) = 1 x ∈ [x1 , 1 − x1 ] 2 x − (1 − x1 ) 1 1 − cos( π) x ∈ [1 − x1 , 1] u(x) = 1 − 4 x1 u(x) = 1− 1 4 Results are obtained with x1 = 0.1. features • Q1 × P0 element • incompressible flow • penalty formulation • isothermal • isoviscous 97 (208) A 100x100 element grid is used. No-slip boundary conditions are prescribed on sides and bottom. A zero vertical velocity is prescribed at the top and the exact form of the prescribed horizontal velocity is controlled by the ldc parameter. 200 ldc0 ldc1 ldc2 150 pressure 100 50 0 -50 -100 -150 -200 0 0.1 0.2 0.3 0.4 0.5 x 98 0.6 0.7 0.8 0.9 1 11 fieldstone 05: SolCx benchmark The SolCx benchmark is intended to test the accuracy of the solution to a problem that has a large jump in the viscosity along a line through the domain. Such situations are common in geophysics: for example, the viscosity in a cold, subducting slab is much larger than in the surrounding, relatively hot mantle material. The SolCx benchmark computes the Stokes flow field of a fluid driven by spatial density variations, subject to a spatially variable viscosity. Specifically, the domain is Ω = [0, 1]2 , gravity is g = (0, −1)T and the density is given by ρ(x, y) = sin(πy) cos(πx) (209) Boundary conditions are free slip on all of the sides of the domain and the temperature plays no role in this benchmark. The viscosity is prescribed as follows: 1 f or x < 0.5 µ(x, y) = (210) 106 f or x > 0.5 Note the strongly discontinuous viscosity field yields a stagnant flow in the right half of the domain and thereby yields a pressure discontinuity along the interface. The SolCx benchmark was previously used in [45] (references to earlier uses of the benchmark are available there) and its analytic solution is given in [146]. It has been carried out in [79] and [58]. Note that the source code which evaluates the velocity and pressure fields for both SolCx and SolKz is distributed as part of the open source package Underworld ([97], http://underworldproject.org). In this particular example, the viscosity is computed analytically at the quadrature points (i.e. tracers are not used to attribute a viscosity to the element). If the number of elements is even in any direction, all elements (and their associated quadrature points) have a constant viscosity(1 or 106 ). If it is odd, then the elements situated at the viscosity jump have half their integration points with µ = 1 and half with µ = 106 (which is a pathological case since the used quadrature rule inside elements cannot represent accurately such a jump). features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • analytical solution 99 1.0 0.0010 0.8 0.002 0.8 0.6 0.001 0.6 0.6 y 0.0000 0.4 y 0.0005 0.0005 0.0010 0.2 0.0 0.0 0.0015 0.0 0.0 0.4 x 0.6 0.8 1.0 xx 1.0 0.0075 0.8 0.0025 y 0.0000 0.4 0.0 0.0 0.0050 0.0075 0.2 0.4 x 0.6 0.8 1.0 vx txth 1.0 0.4 x 0.6 0.8 0.0100 yy 0.0050 0.0075 0.4 x 0.6 0.8 1.0 vy tyth 0.6 0.8 1.0 0.005 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 p pth 0.010 0.020 0.4 0.00000200.4 0.005 0.0000025 0.2 0.0000030 0.0 0.0 0.010 0.010 0.000 y 0.0 0.0 0.6 0.000 0.2 0.005 0.000003 0.0 0.0 x 0.0100 0.005 0.4 0.6 0.0000015 0.000002 0.2 0.4 0.010 0.6 0.2 0.2 0.020 0.015 y y 0.000001 0.025 0.0000005 0.8 0.0000010 0.000000 0.4 1.0 xy 0.0000000 1.0 0.000002 0.8 0.000001 0.8 0.6 0.0025 0.2 x 0.6 0.015 0.0025 0.2 0.4 0.8 0.0050 0.4 0.2 1.0 0.0100 0.0000 0.0 0.0 0.2 0.0 0.0 0.0075 0.000003 1.0 0.8 0.1 1.0 0.6 0.0025 0.2 0.2 y 0.6 0.0 0.4 0.002 0.8 0.0050 0.1 0.2 1.0 0.0100 0.2 0.001 0.2 0.2 0.000 0.4 p 1.0 0.003 y 0.8 vy 0.0015 y vx 1.0 0.2 0.4 x What we learn from this 100 0.6 0.8 1.0 0.015 0.2 0.4 x 0.6 0.8 1.0 0.020 12 fieldstone 06: SolKz benchmark The SolKz benchmark [109] is similar to the SolCx benchmark. but the viscosity is now a function of the space coordinates: µ(y) = exp(By) with B = 13.8155 (211) It is however not a discontinuous function but grows exponentially with the vertical coordinate so that its overall variation is again 106 . The forcing is again chosen by imposing a spatially variable density variation as follows: ρ(x, y) = sin(2y) cos(3πx) (212) Free slip boundary conditions are imposed on all sides of the domain. This benchmark is presented in [146] as well and is studied in [45] and [58]. 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 y 0.6 0.4 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 vx txth 1.0 x 0.6 0.8 0.2 101 0.4 x 0.6 0.8 1.0 0.6 0.8 0.4 0.2 x 0.6 0.8 1.0 error 0.00100000 0.00010000 0.00001000 0.00000100 0.00000010 0.00000001 0.01 0.6 0.8 1.0 p pth 0.2 0.4 x 0.6 0.8 1.0 0.0008 0.0006 0.0004 0.0002 0.0000 0.0002 0.0004 0.0006 0.0008 0.8 10 4 0.6 10 5 0.4 10 6 0.2 10 7 0.0 0.0 velocity pressure x2 x1 0.01000000 x 0.0004 0.0003 0.0002 0.0001 0.0000 0.0001 0.0002 0.0003 0.0004 1.0 0.6 0.10000000 0.0 0.0 0.75 0.50 0.25 0.00 0.25 0.50 0.75 0.4 0.4 0.2 density 0.2 0.2 0.4 1.0 0.8 0.0 0.0 xy 0.6 1.0 x 1.0 0.8 0.5 y y 102 0.2 1.0 0.5 0.4 0.8 0.2 1e 7 0.2 0.6 0.4 0.0 0.0 0.0 x 0.6 1.0 0.2 0.4 0.8 1.0 0.4 0.0 0.0 103 0.0 0.0 0.8 0.6 104 0.2 0.6 vy tyth 1.0 0.4 x 0.8 105 0.6 0.4 0.2 1.0 0.00075 0.00050 0.00025 0.00000 0.00025 0.00050 0.00075 1.0 1.0 y yy 0.2 1.0 0.8 1.0 0.4 2 4 6 0.2 0.8 y y 0.4 0.6 0.6 1e 7 0.6 0.4 0.0 0.0 x 0.8 1.0 0.8 0.2 0.2 0.00006 0.0 0.0 6 4 2 0 0.0 0.0 0.00004 0.0 0.0 0.4 0.075 0.050 0.025 0.000 0.025 0.050 0.075 0.4 0.00002 0.2 p 0.6 0.2 y 0.8 0.8 0.00000 0.4 1.0 0.00075 0.00050 0.00025 0.00000 0.00025 0.00050 0.00075 0.00004 0.00002 0.6 xx 1.0 1.0 y 0.4 0.8 0.00006 y y 0.6 vy 1.0 y 0.8 0.000100 0.000075 0.000050 0.000025 0.000000 0.000025 0.000050 0.000075 0.000100 y vx 1.0 0.1 h 101 0.2 0.4 x 0.6 0.8 1.0 13 fieldstone 07: SolVi benchmark Following SolCx and SolKz, the SolVi inclusion benchmark solves a problem with a discontinuous viscosity field, but in this case the viscosity field is chosen in such a way that the discontinuity is along a circle. Given the regular nature of the grid used by a majority of codes and the present one, this ensures that the discontinuity in the viscosity never aligns to cell boundaries. This in turns leads to almost discontinuous pressures along the interface which are difficult to represent accurately. [118] derived a simple analytic solution for the pressure and velocity fields for a circular inclusion under simple shear and it was used in [40], [124], [45], [79] and [58]. Because of the symmetry of the problem, we only have to solve over the top right quarter of the domain (see Fig. ??a). The analytical solution requires a strain rate boundary condition (e.g., pure shear) to be applied far away from the inclusion. In order to avoid using very large domains and/or dealing with this type of boundary condition altogether, the analytical solution is evaluated and imposed on the boundaries of the domain. By doing so, the truncation error introduced while discretizing the strain rate boundary condition is removed. A characteristic of the analytic solution is that the pressure is zero inside the inclusion, while outside it follows the relation µm (µi − µm ) ri2 cos(2θ) (213) pm = 4˙ µi + µm r2 where µi = 103 is the viscosity of the inclusion and µm = 1 is the viscosity of the background media, θ = tan−1 (y/x), and ˙ = 1 is the applied strain rate. [40] thoroughly investigated this problem with various numerical methods (FEM, FDM), with and without tracers, and conclusively showed how various averagings lead to different results. [45] obtained a first order convergence for both pressure and velocity, while [79] and [58] showed that the use of adaptive mesh refinement in respectively the FEM and FDM yields convergence rates which depend on refinement strategies. 102 vx 1.0 vy 1.0 0.0 0.2 0.8 0.6 0.6 0.6 0.4 0.6 0.4 0.4 0.4 0.6 0.4 0.2 0.2 0.2 0.8 0.2 0.0 0.0 0.0 0.0 0.0 0.8 1.0 xx 1.0 0.8 1.75 1.0 1.50 0.8 1.25 0.6 0.25 0.2 0.4 x 0.6 0.8 1.0 0.00 vx txth 1.0 0.000 0.4 x 0.6 1.50 0.2 0.0 0.0 1.75 0.0 0.0 0.8 103 1.0 x 0.6 0.8 density 102 y 0.6 y 0.4 0.4 101 0.2 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 100 0.0 0.0 10.00000000 0.2 0.4 x 0.6 velocity pressure x2 x1 1.00000000 0.10000000 0.01000000 0.00100000 0.00010000 0.00001000 0.00000100 0.00000010 0.00000001 0.01 0.1 h 103 0.8 0.0 0.0 1.0 1.100 1.075 1.050 1.025 1.000 0.975 0.950 0.925 0.900 0.4 x 0.6 0.8 1.0 p pth 1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00 15 10 5 0 5 0.2 1.0 0.8 0.6 0.2 15 1.0 0.4 0.000 0.4 0.8 0.6 0.005 0.2 0.6 0.8 0.015 0.010 x xy 1.0 0.020 1.0 0.8 error 0.8 vy tyth 0.0 0.0 1.0 1.0 0.6 y y 0.2 0.2 x 0.4 0.4 1.25 0.4 0.2 0.6 0.75 0.2 10 0.8 0.50 0.2 0.020 0.0 0.0 0.25 1.00 5 1.0 0.00 0.4 0.015 0.2 0.0 0.0 1.0 0.6 0.010 0.4 0.8 0.8 0.005 0.6 0.6 yy 1.0 0.8 x 0.4 0.50 0.0 0.0 0.4 y y 0.75 0.2 0.2 0.6 1.00 0.4 0 y 0.6 5 y x 10 10 0.2 0.4 x 0.6 0.8 1.0 1.0 15 100 0.8 0.6 10 1 10 2 10 3 y 0.4 15 y 0.8 y 0.8 y 0.8 0.2 p 1.0 0.4 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 14 fieldstone 08: the indentor benchmark The punch benchmark is one of the few boundary value problems involving plastic solids for which there exists an exact solution. Such solutions are usually either for highly simplified geometries (spherical or axial symmetry, for instance) or simplified material models (such as rigid plastic solids) [75]. In this experiment, a rigid punch indents a rigid plastic half space; the slip line field theory gives exact solutions as shown in Fig. ??a. The plane strain formulation of the equations and the detailed solution to the problem were derived in the Appendix of [132] and are also presented in [56]. The two dimensional punch problem has been extensively studied numerically for the past 40 years [153, 152, 33, 32, 68, 145, 22, 107] and has been used to draw a parallel with the tectonics of eastern China in the context of the India-Eurasia collision [127, 95]. It is also worth noting that it has been carried out in one form or another in series of analogue modelling articles concerning the same region, with a rigid indenter colliding with a rheologically stratified lithosphere [101, 38, 74]. Numerically, the one-time step punch experiment is performed on a two-dimensional domain of purely plastic von Mises material. Given that the von Mises rheology yield criterion does not depend on pressure, the density of the material and/or the gravity vector is set to zero. Sides are set to free slip boundary conditions, the bottom to no slip, while a vertical velocity (0, −vp ) is prescribed at the top boundary for nodes whose x coordinate is within [Lx /2 − δ/2, Lx /2 + δ/2]. The following parameters are used: Lx = 1, Ly = 0.5, µmin = 10−3 , µmax = 103 , vp = 1, δ = 0.123456789 and the yield value of the material is set to k = 1. The analytical solution predicts that the angle of the shear bands stemming from the sides of the punch is π/4, that the pressure √ right under the punch is 1 + π, and that the velocity of the rigid blocks on each side of the punch is vp / 2 (this is simply explained by invoking conservation of mass). 104 x 0.6 0.8 1.0 1.0 10.0 7.5 5.0 2.5 0.0 2.5 5.0 1.0 20.0 17.5 15.0 12.5 10.0 7.5 5.0 2.5 xx 0.2 0.4 0.2 0.4 x x 0.6 0.6 0.8 0.8 0.5 0.4 0.3 0.2 0.1 0.0 0.0 0.0 0.2 0.4 y y 0.2 vy 0.6 0.2 0.4 x 0.6 0.8 1.0 0.4 x 0.5 0.4 0.3 0.2 0.1 0.0 0.0 0.6 0.8 1.0 5.0 2.5 0.0 2.5 5.0 7.5 10.0 0.5 0.4 0.3 0.2 0.1 0.0 0.0 6 p 5 4 3 2 0.2 0.4 1.0 yy 0.2 0.8 y 0.4 0.5 0.4 0.3 0.2 0.1 0.0 0.0 x 0.6 0.8 1.0 xy 0.2 0.4 x 0.6 0.8 1.0 103 0.5 0.4 0.3 0.2 0.1 0.0 0.0 102 101 100 0.2 0.4 x 0.6 0.8 1.0 y 0.5 0.4 0.3 0.2 0.1 0.0 0.0 0.2 0.3 0.2 0.1 0.0 0.1 0.2 0.3 y 0.5 0.4 0.3 0.2 0.1 0.0 0.0 vx y y y y 0.5 0.4 0.3 0.2 0.1 0.0 0.0 10 1 10 2 10 3 0.5 0.4 0.3 0.2 0.1 0.0 0.0 1 20 15 10 5 0 5 10 15 20 5 p (nodal) 4 3 2 0.2 0.4 x 0.6 0.8 1.0 1 6 0.05 0.0 5 0.2 4 0.00 p 0.2 v u 0.4 0.10 0.4 3 0.6 0.05 2 0.8 0.10 1 1.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.0 0.2 ToDo: smooth punch features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (no-slip) • isothermal • non-isoviscous • nonlinear rheology 105 0.4 x 0.6 0.8 1.0 0.0 0.2 0.4 x 0.6 0.8 1.0 15 fieldstone 09: the annulus benchmark This fieldstone was developed in collaboration with Prof. E.G.P. Puckett. This benchmark is based on Thieulot & Puckett [Subm.] in which an analytical solution to the isoviscous incompressible Stokes equations is derived in an annulus geometry. The velocity and pressure fields are as follows: vr (r, θ) = g(r)k sin(kθ), (214) vθ (r, θ) = f (r) cos(kθ), (215) p(r, θ) = kh(r) sin(kθ), (216) ρ(r, θ) = ℵ(r)k sin(kθ), (217) with f (r) g(r) h(r) ℵ(r) A B = Ar + B/r, B C A r + ln r + , = 2 r r 2g(r) − f (r) = , r g f f0 g0 = g 00 − − 2 (k 2 − 1) + 2 + , r r r r 2(ln R1 − ln R2 ) = −C 2 , R2 ln R1 − R12 ln R2 R22 − R12 = −C 2 . R2 ln R1 − R12 ln R2 (218) (219) (220) (221) (222) (223) The parameters A and B are chosen so that vr (R1 ) = vr (R2 ) = 0, i.e. the velocity is tangential to both inner and outer surfaces. The gravity vector is radial and of unit length. In the present case, we set R1 = 1, R2 = 2 and C = −1. features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions • direct solver • isothermal • isoviscous • analytical solution • annulus geometry • elemental boundary conditions 106 10 velocity pressure x2 x1 1 error 0.1 0.01 0.001 0.0001 0.01 h 107 16 fieldstone 10: Stokes sphere (3D) - penalty features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • 3D • elemental b.c. • buoyancy driven resolution is 24x24x24 108 17 fieldstone 11: stokes sphere (3D) - mixed formulation This is the same setup as Section 16. features • Q1 × P0 element • incompressible flow • mixed formulation • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • 3D • elemental b.c. • buoyancy driven 109 18 fieldstone 12: consistent pressure recovery What follows is presented in [151]. The second part of their paper wishes to establish a simple and effective numerical method to calculate variables eliminated by the penalisation process. The method involves an additional finite element solution for the nodal pressures using the same finite element basis and numerical quadrature as used for the velocity. Let us start with: p = −λ∇ · v which lead to (q, p) = −λ(q, ∇ · v) and then Z Z N N dΩ · P = − λ N ∇N dΩ · V or, M · P = −D · V and finally P = −M −1 · D · V with M of size (np × np), D of size (np ∗ ndof × np ∗ ndof ) and V of size (np ∗ ndof ). The vector P contains the np nodal pressure values directly, with no need for a smoothing scheme. The mass matrix M is to be evaluated at the full integration points, while the constraint part (the right hand side of the equation) is to be evaluated at the reduced integration point. As noted by [151], it is interesting to note that when linear elements are used and the lumped matrices are used for the M the resulting algebraic equation is identical to the smoothing scheme based on the averaging method only if the uniform square finite element mesh is used. In this respect this method is expected to yield different results when elements are not square or even rectangular. ——q1 is smoothed pressure obtained with the center-to-node approach. q2 is recovered pressure obtained with [151].R All three fulfill the zero average condition: pdΩ = 0. 110 y 0.000 0.4 0.2 0.4 x 0.6 0.8 0.0 0.0 1.0 vx txth 1.0 0.000002 0.2 0.4 x 0.6 0.8 0.05 0.05 0.4 0.00 0.6 0.05 y y 0.6 0.4 0.10 0.2 0.10 0.2 0.0 0.0 0.15 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 q1 pth 0.8 y 0.6 0.4 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.007 0.006 0.005 0.004 0.003 0.002 0.001 0.000 0.4 x 0.6 0.8 1.0 q2 pth 1.0 0.00002 0.00000 0.00002 0.00004 0.00006 0.2 0.4 0.004 0.8 1.0 0.003 0.6 0.4 0.2 0.0 0.0 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0 1.0 0.8 0.002 0.6 0.4 0.001 0.4 0.2 0.000 0.2 0.2 0.4 x 0.6 0.8 1.0 0.001 0.0 0.0 velocity pressure (el) pressure (q1) pressure (q2) x2 x1.5 x1 0.010000 error 0.001000 0.000100 0.000010 0.01 0.8 0.8 0.6 0.0 0.0 0.100000 0.000001 x 0.6 y 1.0 0.15 0.2 0.15 1.0 0.05 0.8 0.00 1.0 p pth 0.0 0.0 1.0 q2 1.0 0.8 x 0.8 0.8 0.2 0.000002 0.6 0.6 0.4 0.000001 0.4 x 0.6 0.000000 0.2 0.4 0.8 0.000001 0.0 0.0 q1 1.0 0.000002 0.2 1.0 0.2 1.0 0.4 0.000002 0.0 0.0 1.0 0.6 0.000001 0.2 0.8 y y 0.000000 0.4 0.6 0.8 0.000001 0.6 x vy tyth 1.0 0.8 0.4 0.10 0.2 0.010 0.2 0.05 0.4 0.005 0.2 0.010 0.00 0.6 0.000 0.4 0.005 0.2 0.0 0.0 0.6 0.05 0.8 0.005 y 0.6 0.0 0.0 0.8 0.005 p 1.0 0.010 y 0.8 vy 1.0 0.010 y vx 1.0 0.1 h In terms of pressure error, q2 is better than q1 which is better than elemental. QUESTION: why are the averages exactly zero ?! TODO: • add randomness to internal node positions. • look at elefant algorithms 111 19 fieldstone 13: the Particle in Cell technique (1) - the effect of averaging This fieldstone is being developed in collaboration with BSc student Eric Hoogen. features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (no-slip) • isothermal • non-isoviscous • particle-in-cell After the initial setup of the grid, markers can then be generated and placed in the domain. One could simply randomly generate the marker positions in the whole domain but unless a very large number of markers is used, the chance that an element does not contain any marker exists and this will prove problematic. In order to get a better control over the markers spatial distribution, one usually generates the marker per element, so that the total number of markers in the domain is the product of the number of elements times the user-chosen initial number of markers per element. Our next concern is how to actually place the markers inside an element. Two methods come to mind: on a regular grid, or in a random manner, as shown on the following figure: In both cases we make use of the basis shape functions: we generate the positions of the markers (random or regular) in the reference element first (rim , sim ), and then map those out to the real element as follows: m m X X xim = Ni (rim , sim )xi yim = Ni (rim , sim )yi (224) i i where xi , yi are the coordinates of the vertices of the element. A third option consists in the use of the so-called Poisson-disc sampling which produces points that are tightly-packed, but no closer to each other than a specified minimum distance, resulting in a more natural pattern 11 . Note that the Poisson-disc algorithm fills the whole domain at once, not element after element. say smthg about avrg dist insert here theory and link about Poisson disc 11 https://en.wikipedia.org/wiki/Supersampling 112 Left: regular distribution, middle: random, right: Poisson disc. 16384 markers (32x32 grid, 16 markers per element). When using active markers, one is faced with the problem of transferring the properties they carry to the mesh on which the PDEs are to be solved. As we have seen, building the FE matrix involves a loop over all elements, so one simple approach consists of assigning each element a single property computed as the average of the values carried by the markers in that element. Often in colloquial language ”average” refers to the arithmetic mean: n 1X φi (225) hφiam = n k where < φ >am is the arithmetic average of the n numbers φi . However, in mathematics other means are commonly used, such as the geometric mean: ! n Y hφigm = φi (226) i and the harmonic mean: n hφihm = 1X 1 n i φi !−1 (227) Furthermore, there is a well known inequality for any set of positive numbers, hφiam ≥ hφigm ≥ hφihm (228) which will prove to be important later on. Let us now turn to a simple concrete example: the 2D Stokes sphere. There are two materials in the domain, so that markers carry the label ”mat=1” or ”mat=2”. For each element an average density and viscosity need to be computed. The majority of elements contains markers with a single material label so that the choice of averaging does not matter (it is trivial to verify that if φi = φ0 then hφiam = hφigm = hφihm = φ0 . Remain the elements crossed by the interface between the two materials: they contain markers of both materials and the average density and viscosity inside those depends on 1) the total number of markers inside the element, 2) the ratio of markers 1 to markers 2, 3) the type of averaging. This averaging problem has been studied and documented in the literature [117, 40, 129, 104] Nodal projection. Left: all markers inside elements to which the green node belongs to are taken into account. Right: only the markers closest to the green node count. 113 Let k be the green node of the figures above. Let (r, s) denote the coordinates of a marker inside its element. For clarity, we define the follow three nodal averaging schemes: • nodal type A: fk = sum of values carried by markers in 4 neighbour elements number of markers in 4 neighbour elements • nodal type B: fk = sum of values carried by markers inside dashed line number of markers in area delimited by the dashed line • nodal type C fk = sum of values carried by markers in 4 neighbour elements ∗ Np (r, s) sum of Np (r, s) where Np is the Q1 basis function corresponding to node p defined on each element. Since these functions are 1 on node k and then linearly decrease and become zero on the neighbouring nodes, this effectively gives more weight to those markers closest to node k. This strategy is adopted in [2, 93] (although it is used to interpolate onto the nodes of Q2 P−1 elements. It is formulated as follows: ”We assume that an arbitrary material point property f , is discretized via f (x) ' δ(x − xp )fp . We then utilize an approximate local L2 projection of fp onto a continuous Q1 finite element space. The corner vertices of each Q2 finite element define the mesh fp is projected onto. The local reconstruction for a node i is defined by R P Ni (x)f (x) p Ni (xp )fp Ωi ˆ R ' P fi = N (x) i p Ni (xp ) Ωi where the summation over p includes all material points contained within the support Ωi of the trilinear interpolant Ni ”. The setup is identical to the Stokes sphere experiment. The bash script script runall runs the code for many resolutions, both initial marker distribution and all four averaging types. The viscosity of the sphere has been set to 103 while the viscosity of the surrounding fluid is 1. The average density is always computed with an arithmetic mean. Conclusions: • With increasing resolution (h → 0) vrms values seem to converge towards a single value, irrespective of the number of markers. • At low resolution, say 32x32 (i.e. h=0.03125), vrms values for the three averagings differ by about 10%. At higher resolution, say 128x128, vrms values are still not converged. • The number of markers per element plays a role at low resolution, but less and less with increasing resolution. • Results for random and regular marker distributions are not identical but follow a similar trend and seem to converge to the same value. • elemental values yield better results (espcecially at low resolutions) • harmonic mean yields overal the best results 114 Root mean square velocity results are shown hereunder: random PD markers, elemental proj 0.008 0.007 vrms 0.006 0.005 0.004 0.003 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m regular markers, elemental proj 0.01 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.009 0.008 0.007 0.006 vrms am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.005 0.004 0.003 0.002 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.01 0.009 0.008 0.007 0.006 vrms random markers, elemental proj 0.01 0.009 0.005 0.004 0.003 0.002 0.001 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.02 0.03 0.04 0.05 0.06 h random markers, nodal proj A 0.008 0.007 vrms 0.006 0.005 0.004 0.003 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.007 0.006 0.005 0.004 0.003 0.001 0.06 0.07 0.08 0.09 0.1 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.007 vrms 0.006 0.005 0.004 0.003 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.007 0.006 0.005 0.004 0.003 0.01 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.008 0.007 0.006 0.005 0.004 0.003 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.08 0.09 0.1 0.03 0.04 0.05 0.06 vrms 0.006 0.005 0.004 0.003 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.08 0.09 0.06 0.06 0.07 0.08 0.09 0.006 0.005 0.004 0.003 0.1 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.1 0.006 0.005 0.004 0.003 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 regular markers, nodal proj C 0.007 0.001 0.09 0.007 0.01 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.008 0.002 0.08 h 0.01 0.001 0.07 0.008 0.1 0.009 0.002 0.05 0.05 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 m m m m m m m m m m m m m m m m m m 0.01 0.009 0.008 0.007 0.006 vrms 0.007 0.04 0.07 vrms 0.008 0.03 0.04 0.01 random markers, nodal proj C am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, m m m m m m m m m m m m m m m m m m 0.001 0.02 random markers, nodal proj C 0.01 0.02 0.03 h 0.009 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 0.002 0.01 h 0.01 0.02 0.009 0.001 0.07 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.1 0.008 0.002 0.06 0.09 regular markers, nodal proj B 0.01 0.001 0.08 h 0.009 0.002 0.07 0.01 0.1 vrms 0.008 0.05 0.06 0.009 random markers, nodal proj B am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.04 0.05 0.001 0.02 random markers, nodal proj B 0.01 0.03 0.04 h 0.009 0.02 0.03 0.002 0.01 h 0.01 0.02 regular markers, nodal proj A am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.008 0.002 0.05 0.01 h 0.01 0.001 0.04 0.1 0.009 0.002 0.03 0.09 vrms am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.02 0.08 random PD markers, nodal proj A 0.01 0.01 0.07 h 0.009 m m m m m m m m m m m m m m m m m m 0.001 0.01 vrms 0.03 vrms 0.02 09 16 25 36 48 64 09 16 25 36 48 64 09 16 25 36 48 64 0.002 0.001 0.01 am, am, am, am, am, am, gm, gm, gm, gm, gm, gm, hm, hm, hm, hm, hm, hm, 0.005 0.004 0.003 0.002 0.001 0.01 0.02 0.03 0.04 0.05 0.06 h 0.07 0.08 0.09 0.1 0.01 0.02 0.03 0.04 0.05 0.06 h 0.07 0.08 0.09 0.1 h Left column: random markers, middle column: Poisson disc, right column: regular markers. First row: elemental projection, second row: nodal 1 projection, third row: nodal 2 projection, fourth row: nodal 3 projection. 64 markers per element, arithmetic avrg 64 markers per element, geometric avrg 64 markers per element, harmonic avrg 0.01 0.01 0.01 0.009 0.009 0.009 0.008 0.008 0.008 0.007 vrms 0.005 0.004 0.003 0.002 0.001 0.01 0.02 0.03 0.04 0.05 0.06 h 0.07 0.08 0.09 0.1 0.007 reg, el rand, el pd, el reg, nodA rand, nodA pd, nodA reg, nodB rand, nodB pd, nodB reg, nodC rand, nodC pd, nodC 0.006 vrms reg, el rand, el pd, el reg, nodA rand, nodA pd, nodA reg, nodB rand, nodB pd, nodB reg, nodC rand, nodC pd, nodC 0.006 0.005 0.004 0.003 0.002 0.001 0.01 0.02 0.03 0.04 0.05 0.06 0.07 h 0.08 0.09 0.1 reg, el rand, el pd, el nodA nodA nodA nodB nodB nodB nodC nodC nodC 0.006 vrms 0.007 0.005 reg, rand, pd, reg, rand, pd, reg, rand, pd, 0.004 0.003 0.002 0.001 0.01 0.02 0.03 0.04 0.05 0.06 h Left to right: arithmetic, geometric, harmonic averaging for viscosity. 115 0.07 0.08 0.09 0.1 20 fieldstone f14: solving the full saddle point problem The details of the numerical setup are presented in Section ??. The main difference is that we no longer use the penalty formulation and therefore keep both velocity and pressure as unknowns. Therefore we end up having to solve the following system: K G V f · = or, A · X = rhs P h GT 0 Each block K, G and vector f , h are built separately in the code and assembled into the matrix A and vector rhs afterwards. A and rhs are then passed to the solver. We will see later that there are alternatives to solve this approach which do not require to build the full Stokes matrix A. Each element has m = 4 vertices so in total ndof V × m = 8 velocity dofs and a single pressure dof, commonly situated in the center of the element. The total number of velocity dofs is therefore N f emV = nnp × ndof V while the total number of pressure dofs is N f emP = nel. The total number of dofs is then N f em = N f emV + N f emP . As a consequence, matrix K has size N f emV, N f emV and matrix G has size N f emV, N f emP . Vector f is of size N f emV and vector h is of size N f emP . features • Q1 × P0 element • incompressible flow • mixed formulation • Dirichlet boundary conditions (no-slip) • direct solver (?) • isothermal • isoviscous • analytical solution • pressure smoothing 116 0.005 0.8 0.6 0.4 0.6 0.000 0.4 0.0050.2 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.05 0.00 0.005 0.8 y y 0.000 p 1.0 0.05 0.6 0.10 y 0.8 0.010 vy 1.0 0.0 0.010 0.0 0.4 0.15 0.0050.2 0.2 0.4 x 0.6 0.8 0.0 0.010 0.0 1.0 0.00 q 1.0 0.05 0.8 0.10 0.6 y 0.010 vx 1.0 0.20 0.2 0.4 x 0.6 0.8 1.0 0.15 0.4 0.20 0.2 0.25 0.00.0 0.2 0.4 x 0.6 0.8 0.06 0.01 0.6 0.01 0.6 0.00 y y 0.00 0.02 0.8 0.4 0.01 0.2 0.02 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.4 0.01 0.2 0.0 0.0 0.02 0.2 0.0000010 1.0 vx txth 1.0 0.03 1.0 0.4 x 0.6 0.8 1.0 0.03 0.8 0.0 0.0 0.6 0.0000000 0.4 0.0000005 0.2 0.2 0.4 x 0.6 0.8 1.0 0.0 0.0 0.0000010 0.2 0.4 x 0.6 0.8 1.0 0.4 x 0.6 0.8 1.0 0.04 0.6 0.03 0.0 0.0 0.0000010 0.4 0.02 0.2 0.04 0.0 0.0 0.2 0.00 p pth 0.02 0.04 0.06 0.08 0.0000005 0.2 0.2 0.05 0.8 0.4 0.06 y 0.6 0.0000000 0.4 y 0.6 y 0.8 0.0000005 0.0 0.0 0.02 0.2 0.8 0.0000005 0.2 0.00 0.4 0.8 0.4 0.02 0.6 0.0000010 1.0 vy tyth 0.06 0.04 1.0 y 0.02 0.8 1.0 xy x 0.6 0.8 1.0 q pth 1.0 0.01 0.00 0.02 0.8 0.04 0.6 0.06 y 1.0 0.03 yy y 0.03 xx 0.25 1.0 0.10 0.2 0.4 x 0.6 0.8 1.0 0.12 0.4 0.08 0.2 0.0 0.0 0.10 0.2 0.4 x 0.6 0.8 1.0 Unlike the results obtained with the penalty formualtion (see Section ??), the pressure showcases a very strong checkerboard pattern, similar to the one in [43]. Left: pressure solution as shown in [43]; Right: pressure solution obtained with fieldstone. Rather interestingly, the nodal pressure (obtained with a simple center-to-node algorithm) fails to recover a correct pressure at the four corners. 117 0.12 21 fieldstone f15: saddle point problem with Schur complement approach - benchmark The details of the numerical setup are presented in Section ??. The main difference resides in the Schur complement approach to solve the Stokes system, as presented in Section 6.15 (see solver cg). This iterative solver is very easy to implement once the blocks K and G, as well as the rhs vectors f and h have been built. 0.010 vx 1.0 0.010 vy 1.0 p 1.0 0.8 0.005 0.8 0.005 0.8 0.6 0.6 0.6 0.6 0.4 0.05 0.4 0.4 x 0.6 0.8 1.0 0.03 xx 1.0 0.0 0.010 0.0 0.02 0.8 0.01 0.6 0.4 x 0.6 0.8 0.03 yy 1.0 0.4 0.01 0.2 0.0 0.0 0.02 0.2 0.4 x 0.6 0.8 1.0 0.02 0.8 0.01 0.6 0.00 0.4 0.01 0.2 0.0 0.0 0.02 0.2 0.000010 1.0 vx txth 1.0 0.03 0.4 x 0.6 0.8 1.0 0.03 0.10 0.2 0.4 x 0.6 0.8 1.0 0.0 0.0 0.8 0.00 0.4 0.02 0.2 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 1.0 0.0 0.0000100.0 0.2 0.4 x 0.6 0.8 1.0 0.02 0.04 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.01 0.00010 p pth 0.014 q pth 0.000051.0 0.012 0.010 y 0.008 y y y 0.8 0.03 0.2 0.00005 0.6 0.6 0.15 0.4 0.6 0.000000 0.4 x 1.0 0.04 0.6 0.000000 0.4 0.4 0.8 0.6 0.6 0.2 x 0.6 0.8 0.02 0.6 0.000000.8 0.0 0.0 0.4 0.05 0.8 0.000005 0.000005 0.2 0.10 0.2 0.04 1.0 0.8 0.000005 0.2 0.05 0.2 0.8 0.4 0.00 0.15 xy 1.0 0.000010 1.0 vy tyth 0.8 y 0.0 0.010 0.0 1.0 y y 0.00 0.2 0.05 y 0.2 0.0050.2 y 0.0 0.0 0.4 0.0050.2 0.2 0.00 y 0.000 y y 0.000 0.4 q 0.05 1.0 0.00010 0.4 0.006 0.000005 0.2 0.00015 0.2 0.004 0.0 0.0000100.0 0.00020 0.0 0.0 0.00025 0.2 0.4 x 0.6 0.8 1.0 0.2 0.4 x 0.6 0.8 1.0 0.002 0.000 Rather interestingly the pressure checkerboard modes are not nearly as present as in Section ?? which uses a full matrix approach. Looking at the discretisation errors for velocity and pressure, we of course recover the same rates and values as in the full matrix case. 118 0.100000 velocity pressure x2 x1 0.010000 error 0.001000 0.000100 0.000010 0.000001 0.01 0.1 h Finally, for each experiment the normalised residual (see solver cg) was recorded. We see that all things equal the resolution has a strong influence on the number of iterations the solver must perform to reach the required tolerance. This is one of the manifestations of the fact that the Q1 × P0 element is not a stable element: the condition number of the matrix increases with resolution. We will see that this is not the case of stable elements such as Q2 × Q1 . 1.000000000 8x8 12x12 16x16 24x24 32x32 48x48 64x64 128x128 1e-8 0.100000000 normalised residual 0.010000000 0.001000000 0.000100000 0.000010000 0.000001000 0.000000100 0.000000010 0.000000001 0 10 20 30 40 50 # iteration 119 60 70 80 90 100 features • Q1 × P0 element • incompressible flow • mixed formulation • Schur complement approach • isothermal • isoviscous • analytical solution build S and have python compute its smallest and largest eigenvalues as a function of resolution? 120 22 fieldstone f16: saddle point problem with Schur complement approach - Stokes sphere We are revisiting the 2D Stokes sphere problem, but this time we use the Schur complement approach to solve the Stokes system, Because there are viscosity contrasts in the domain, it is advisable to use the Preconditioned Conjugate Gradient as presented in Section 6.15 (see solver pcg). 0.00075 0.00050 1.0 0.6 0.00000 0.4 0.4 0.8 0.0000 0.6 0.00025 0.2 0.2 0.0 0.0 0.0 0.0 0.00050 0.0010 0.0 0.0 0.4 x 0.6 0.8 1.0 0.2 0.4 x 0.6 0.8 1.0 0.0 0.2 0.6 0.0 0.4 0.2 0.2 0.2 0.4 x 0.6 0.8 1.0 0.0015 0.00075 q 1.0 0.8 0.4 0.0005 0.2 0.2 0.2 y 0.6 p 0.0005 1.0 y 0.8 0.00025 y 0.8 vy 0.4 0.4 y vx 1.0 0.0010 0.0 0.0 0.2 0.2 0.4 x 0.6 0.8 1.0 0.4 0.4 0.0020 0.015 0.015 0.010 0.010 xx 1.0 yy 1.0 0.02 0.020 xy 1.0 0.01 1.0 0.0050.8 0.8 0.6 0.6 0.000 0.4 0.6 0.4 0.6 0.000 0.4 0.2 0.2 0.005 0.2 0.005 0.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.0 0.0 0.010 0.2 0.4 x 0.6 0.8 1.0 0.0 0.0 0.010 0.015 0.015 0.015 y 0.00 y y 0.0050.8 y 0.8 0.4 0.010 0.2 0.2 0.4 x 0.6 0.8 1.0 0.010.0 0.0 0.2 0.4 x 0.6 0.8 1.0 0.005 0.02 The normalised residual (see solver pcg) was recorded. We see that all things equal the resolution has a strong influence on the number of iterations the solver must perform to reach the required tolerance. However, we see that the use of the preconditioner can substantially reduce the number of iterations inside the Stokes solver. At resolution 128x128, this number is halved. 121 1.000000000 32x32 (prec.) 32x32 (no prec.) 64x64 (prec.) 64x64 (no prec.) 128x128 (prec.) 128x128 (no prec.) 1e-8 0.100000000 normalised residual 0.010000000 0.001000000 0.000100000 0.000010000 0.000001000 0.000000100 0.000000010 0.000000001 0 50 100 150 200 # iteration features • Q1 × P0 element • incompressible flow • mixed formulation • Schur complement approach • isothermal • non-isoviscous • Stokes sphere 122 250 300 350 400 23 fieldstone 17: solving the full saddle point problem in 3D When using Q1 × P0 elements, this benchmark fails because of the Dirichlet b.c. on all 6 sides and all three components. However, as we will see, it does work well with Q2 × Q1 elements. . This benchmark begins by postulating a polynomial solution to the 3D Stokes equation [41]: x + x2 + xy + x3 y y + xy + y 2 + x2 y 2 v= (229) 2 −2z − 3xz − 3yz − 5x yz and p = xyz + x3 y 3 z − 5/32 (230) While it is then trivial to verify that this velocity field is divergence-free, the corresponding body force of the Stokes equation can be computed by inserting this solution into the momentum equation with a given viscosity µ (constant or position/velocity/strain rate dependent). The domain is a unit cube and velocity boundary conditions simply use Eq. (229). Following [25], the viscosity is given by the smoothly varying function µ = exp(1 − β(x(1 − x) + y(1 − y) + z(1 − z))) (231) One can easily show that the ratio of viscosities µ? in the system follows µ? = exp(−3β/4) so that choosing β = 10 yields µ? ' 1808 and β = 20 yields µ? ' 3.269 × 106 . We start from the momentum conservation equation: ˙ =f −∇p + ∇ · (2µ) The x-component of this equation writes fx ∂ ∂ ∂ ∂p + (2µ˙xx ) + (2µ˙xy ) + (2µ˙xz ) ∂x ∂x ∂y ∂z ∂p ∂ ∂ ∂ ∂µ ∂µ ∂µ = − + 2µ ˙xx + 2µ ˙xy + 2µ ˙xz + 2 ˙xx + 2 ˙xy + 2 ˙xz ∂x ∂x ∂y ∂z ∂x ∂y ∂z = − Let us compute all the block separately: ˙xx = 1 + 2x + y + 3x2 y ˙yy = 1 + x + 2y + 2x2 y ˙zz = −2 − 3x − 3y − 5x2 y 2˙xy = (x + x3 ) + (y + 2xy 2 ) = x + y + 2xy 2 + x3 2˙xz = (0) + (−3z − 10xyz) = −3z − 10xyz 2˙yz = (0) + (−3z − 5x2 z) = −3z − 5x2 z 123 (232) (233) In passing, one can verify that ˙xx + ˙yy + ˙zz = 0. We further have ∂ 2˙xx ∂x ∂ 2˙xy ∂y ∂ 2˙xz ∂z ∂ 2˙xy ∂x ∂ 2˙yy ∂y ∂ 2˙yz ∂z ∂ 2˙xz ∂x ∂ 2˙yz ∂y ∂ 2˙zz ∂z ∂p ∂x ∂p ∂y ∂p ∂z = 2(2 + 6xy) = 1 + 4xy = −3 − 10xy = 1 + 2y 2 + 3x2 = 2(2 + 2x2 ) = −3 − 5x2 = −10yz = 0 = 2(0) = yz + 3x2 y 3 z (234) = xz + 3x3 y 2 z (235) = xy + x3 y 3 (236) Pressure normalisation Here again, because Dirichlet boundary conditions are prescribed on all sides the pressure is known up to an arbitrary constant. This constant can be determined by (arbitrarily) choosing to normalised the pressure field as follows: Z p dΩ = 0 (237) Ω This is a single constraint associated to a single Lagrange multiplier λ and the global Stokes system takes the form K G 0 V GT 0 C P λ 0 CT 0 In this particular case the constraint matrix C is a vector and it only acts on the pressure degrees of freedom because of Eq.(237). Its exact expression is as follows: Z XZ XZ X p X X Z X p p dΩ = p dΩ = Ni pi dΩ = Ni dΩ pi = Ce · pe Ω e Ωe e Ωe e i i Ωe e where pe is the list of pressure dofs of element e. The elemental constraint vector contains the corresponding pressure basis functions integrated over the element. These elemental constraints are then assembled into the vector C. 124 23.0.1 Constant viscosity Choosing β = 0 yields a constant velocity µ(x, y, z) = exp(1) ' 2.718 (and greatly simplifies the righthand side) so that ∂ µ(x, y, z) = 0 ∂x ∂ µ(x, y, z) = 0 ∂y ∂ µ(x, y, z) = 0 ∂z and fx = = = fy = = = fz = = ∂p ∂ ∂ ∂ + 2µ ˙xx + 2µ ˙xy + 2µ ˙xz ∂x ∂x ∂y ∂z −(yz + 3x2 y 3 z) + 2(2 + 6xy) + (1 + 4xy) + (−3 − 10xy) − −(yz + 3x2 y 3 z) + µ(2 + 6xy) ∂ ∂ ∂ ∂p + 2µ ˙xy + 2µ ˙yy + 2µ ˙yz − ∂y ∂x ∂y ∂z −(xz + 3x3 y 2 z) + µ(1 + 2y 2 + 3x2 ) + µ2(2 + 2x2 ) + µ(−3 − 5x2 ) −(xz + 3x3 y 2 z) + µ(2 + 2x2 + 2y 2 ) ∂ ∂ ∂ ∂p + 2µ ˙xz + 2µ ˙yz + 2µ ˙zz − ∂z ∂x ∂y ∂z −(xy + x3 y 3 ) + µ(−10yz) + 0 + 0 = −(xy + x3 y 3 ) + µ(−10yz) Finally 2 + 6xy yz + 3x2 y 3 z f = − xz + 3x3 y 2 z + µ 2 + 2x2 + 2y 2 −10yz xy + x3 y 3 Note that there seems to be a sign problem with Eq.(26) in [25]. 125 (238) (239) (240) 0.01000 velocity pressure x3 x2 error 0.00100 0.00010 0.00001 0.1 h 23.0.2 Variable viscosity The spatial derivatives of the viscosity are then given by ∂ µ(x, y, z) ∂x ∂ µ(x, y, z) ∂y ∂ µ(x, y, z) ∂z = −(1 − 2x)βµ(x, y, z) = −(1 − 2y)βµ(x, y, z) = −(1 − 2z)βµ(x, y, z) 126 and thr right-hand side by yz + 3x2 y 3 z 2 + 6xy f = − xz + 3x3 y 2 z + µ 2 + 2x2 + 2y 2 xy + x3 y 3 −10yz 2˙xx 2˙xy 2˙xz −(1 − 2x)βµ(x, y, z) 2˙xy − (1 − 2y)βµ(x, y, z) 2˙yy − (1 − 2z)βµ(x, y, z) 2˙yz 2˙xz 2˙yz 2˙zz 2 3 yz + 3x y z 2 + 6xy = − xz + 3x3 y 2 z + µ 2 + 2x2 + 2y 2 xy + x3 y 3 −10yz 2 2 + 4x + 2y + 6x y x + y + 2xy 2 + x3 −3z − 10xyz −3z − 5x2 z − (1 − 2x)βµ x + y + 2xy 2 + x3 − (1 − 2y)βµ 2 + 2x + 4y + 4x2 y − (1 − 2z)βµ 2 −3z − 10xyz −3z − 5x z −4 − 6x − 6y − 10x Note that at (x, y, z) = (0, 0, 0), µ = exp(1), and at (x, y, z) = (0.5, 0.5, 0.5), µ = exp(1 − 3β/4) so that the maximum viscosity ratio is given by µ? = exp(1 − 3β/4) = exp(−3β/4) exp(1) By varying β between 1 and 22 we can get up to 7 orders of magnitude viscosity difference. features • Q1 × P0 element • incompressible flow • saddle point system • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • 3D • elemental b.c. • analytical solution 127 24 fieldstone 18: solving the full saddle point problem with Q2 × Q1 elements The details of the numerical setup are presented in Section ??. Each element has mV = 9 vertices so in total ndofV × mV = 18 velocity dofs and ndofP ∗ mP = 4 pressure dofs. The total number of velocity dofs is therefore N f emV = nnp × ndof V while the total number of pressure dofs is N f emP = nel. The total number of dofs is then N f em = N f emV + N f emP . As a consequence, matrix K has size N f emV, N f emV and matrix G has size N f emV, N f emP . Vector f is of size N f emV and vector h is of size N f emP . renumber all nodes to start at zero!! Also internal numbering does not work here features • Q2 × Q1 element • incompressible flow • mixed formulation • Dirichlet boundary conditions (no-slip) • isothermal • isoviscous • analytical solution 128 0.0100000 velocity pressure x3 x2 0.0010000 error 0.0001000 0.0000100 0.0000010 0.0000001 0.1 h 129 25 fieldstone 19: solving the full saddle point problem with Q3 × Q2 elements The details of the numerical setup are presented in Section ??. Each element has mV = 16 vertices so in total ndofV × mV = 32 velocity dofs and ndofP ∗ mP = 9 pressure dofs. The total number of velocity dofs is therefore N f emV = nnp × ndof V while the total number of pressure dofs is N f emP = nel. The total number of dofs is then N f em = N f emV + N f emP . As a consequence, matrix K has size N f emV, N f emV and matrix G has size N f emV, N f emP . Vector f is of size N f emV and vector h is of size N f emP . 60===61===62===63===64===65===66===67===68===70 || || || || 50 51 52 53 54 55 56 57 58 59 || || || || 40 41 42 43 44 45 46 47 48 49 || || || || 30===31===32===33===34===35===36===37===38===39 || || || || 20 21 22 23 24 25 26 27 28 29 || || || || 10 11 12 13 14 15 16 17 18 19 || || || || 00===01===02===03===04===05===06===07===08===09 Example of 3x2 mesh. nnx=10, nny=7, nnp=70, nelx=3, nely=2, nel=6 12===13===14===15 || || || || 08===09===10===11 || || || || 04===05===06===07 || || || || 00===01===02===03 06=====07=====08 || || || || || || 03=====04=====05 || || || || || || 00=====01=====02 Velocity (Q3) Pressure (Q2) (r,s)_{00}=(-1,-1) (r,s)_{01}=(-1/3,-1) (r,s)_{02}=(+1/3,-1) (r,s)_{03}=(+1,-1) (r,s)_{04}=(-1,-1/3) (r,s)_{05}=(-1/3,-1/3) (r,s)_{06}=(+1/3,-1/3) (r,s)_{07}=(+1,-1/3) (r,s)_{08}=(-1,+1/3) (r,s)_{09}=(-1/3,+1/3) (r,s)_{10}=(+1/3,+1/3) (r,s)_{11}=(+1,+1/3) (r,s)_{12}=(-1,+1) (r,s)_{13}=(-1/3,+1) (r,s)_{14}=(+1/3,+1) (r,s)_{15}=(+1,+1) (r,s)_{00}=(-1,-1) (r,s)_{01}=(0,-1) (r,s)_{02}=(+1,-1) (r,s)_{03}=(-1,0) (r,s)_{04}=(0,0) (r,s)_{05}=(+1,0) (r,s)_{06}=(-1,+1) (r,s)_{07}=(0,+1) (r,s)_{08}=(+1,+1) Write about 4 point quadrature. 130 features • Q3 × Q2 element • incompressible flow • mixed formulation • isothermal • isoviscous • analytical solution 0.0001 velocity pressure x4 x3 1x10-5 error 1x10-6 1x10-7 1x10-8 1x10-9 1x10-10 0.1 h velocity error rate is cubic, pressure superconvergent since the pressure field is quadratic and therefore lies into the Q2 space. 131 26 fieldstone 20: the Busse benchmark This three-dimensional benchmark was first proposed by [26]. It has been subsequently presented in [125, 136, 3, 100, 37, 79]. We here focus on Case 1 of [26]: an isoviscous bimodal convection experiment at Ra = 3 × 105 . The domain is of size a × b × h with a = 1.0079h, b = 0.6283h with h = 2700km. It is filled with a Newtonian fluid characterised by ρ0 = 3300kg.m−3 , α = 10−5 K−1 , µ = 8.0198 × 1023 Pa.s, k = 3.564W.m−1 .K−1 , cp = 1080J.K−1 .kg−1 . The gravity vector is set to g = (0, 0, −10)T . The temperature is imposed at the bottom (T = 3700◦ C) and at the top (T = 0◦ C). The various measurements presented in [26] are listed hereafter: • The Nusselt number N u computed at the top surface following Eq. (206): RR ∂T dxdy z=L ∂y N u = Lz R R z T dxdy z=0 • the root mean square velocity vrms and the temperature mean square velocity Trms • The vertical velocity w and temperature T at points x1 = (0, 0, Lz /2), x2 = (Lx , 0, Lz /2), x3 = (0, Ly , Lz /2) and x4 = (Lx , Ly , Lz /2); • the vertical component of the heat flux Q at the top surface at all four corners. The values plotted hereunder are adimensionalised by means of a reference temperature (3700K), a reference lengthscale 2700km, and a reference time L2z /κ. 0.0009 0.0008 0.0007 vrms 0.0006 0.0005 0.0004 0.0003 0.0002 0.0001 0 2x108 4x108 6x108 8x108 1x109 1.2x1091.4x1091.6x109 time/year 2124 2123 2122 We then proceed to write the node coordinates as follows:
NumberOfComponents= ’ 3 ’ Format= ’ a s c i i ’> 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 These are followed by the elemental field(s):
−1.333333 e+00 −3.104414 e −10 1 . 3 3 3 3 3 3 e+00 −1.333333 e+00 8 . 2 7 8 4 1 7 e −17 1 . 3 3 3 3 3 3 e+00 Nodal quantities are written next:To these informations we must append 3 more datasets. The first one is the connectivity, the second one is the offsets and the third one is the type. The first one is trivial since said connectivity is needed for the Finite Elements. The second must be understood as follows: when reading the connectivity information in a linear manneer the offset values indicate the beginning of each element (omitting the zero value). The third simply is the type of element as given in the vtk format document (9 corresponds to a generic quadrilateral with an internal numbering consistent with ours). 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 7 https://www.paraview.org/ 8 https://docs.enthought.com/mayavi/mayavi/ 9 https://wci.llnl.gov/simulation/computer-codes/visit/ 10 https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf 81 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 8 . 8 8 8 8 8 5 e −08 −8.278405 e −24 0 . 0 0 0 0 0 0 e+00 8 . 8 8 8 8 8 5 e −08 1 . 6 5 5 6 8 2 e −23 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 −1.333333 e+00 −6.666664 e −01 6 . 6 6 6 6 6 4 e −01 1 . 3 3 3 3 3 3 e+00 −1.333333 e+00 −6.666664 e −01 6 . 6 6 6 6 6 4 e −01 1 . 3 3 3 3 3 3 e+00 −1.333333 e+00 −6.666664 e −01 6 . 6 6 6 6 6 4 e −01 1 . 3 3 3 3 3 3 e+00 0 1 5 4 1 2 6 5 2 3 7 6 4 5 9 8 5 6 10 9 6 7 11 10 4 8 12 16 20 24 9 9 9 9 9 9 C e l l s > The file is then closed with2121 2120 2119 2118 2117 2116 2115 0 2x108 4x108 6x108 8x108 time/year 132 1x109 1.2x109 1.4x109 1.6x109 0.002 0.0015 w at Lz/2 0.001 0.0005 0 -0.0005 -0.001 -0.0015 -0.002 0 2x108 4x108 6x108 8x108 1x109 1.2x1091.4x1091.6x109 time/year 0 -0.5 heat flux -1 -1.5 -2 -2.5 -3 -3.5 1x108 1.5x108 2x108 2.5x108 3x108 3.5x108 time/year features • Q1 × P0 element • incompressible flow • mixed formulation • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • 3D • elemental b.c. • buoyancy driven ToDo: look at energy conservation. run to steady state and make sure the expected values are retrieved. 133 27 fieldstone 21: The non-conforming Q1 × P0 element features • Non-conforming Q1 × P0 element • incompressible flow • mixed formulation • isothermal • non-isoviscous • analytical solution • pressure smoothing try Q1 mapping instead of isoparametric. 134 28 fieldstone 22: The stabilised Q1 × Q1 element The details of the numerical setup are presented in Section ??. We will here focus on the Q1 × Q1 element, which, unless stabilised, violates the LBB stability condition and therefore is unusable. Stabilisation can be of two types: least-squares (see for example [44]) [128, 76, ?], or by means of an additional term in the weak form as first introduced in [41, 16]. It is further analysed in [99, 84]. Note that an equal-order velocity-pressure formulation that does not exhibit spurious pressure modes (without stabilisaion) has been presented in [110]. This element corresponds to Bilinear velocities, bilinear pressure (equal order interpolation for both velocity and pressure) which is very convenient in terms of data structures since all dofs are colocated. In geodynamics, it is used in the Rhea code [122, 25] and in Gale. It is also used in [83] in its stabilised form, in conjunction with AMR. The stabilisation term C enters the Stokes matrix in the (2,2) position: K G V f · = P h GT C Let us take a simple example: a 3x2 element grid. 16,17 8 18,19 9 3 8,9 20,21 10 4 5 10,11 5 4 0 12,13 6 1 0,1 14,15 7 2 2,3 0 22,23 11 4,5 1 2 6,7 3 The K matrix is of size N f emV × N f emV with N f emV = ndof V × nnp = 2 × 12 = 24. The G matrix is of size N f emV × N f emP with N f emP = ndof P × nnp = 1 × 12 = 12. The C matrix is of size N f emP × N f emP . A corner pdof sees 4 vdofs, a side pdof sees 12 vdofs and an inside pdof sees 18 vdofs, so that the total number of nonzeros in G can be computed as follows: N ZG = |{z} 4 + 2(nnx − 2) ∗ 12 + 2(nny − 2) ∗ 12 + (nnx − 2)(nny − 2) ∗ 18 | {z } | {z } | {z } corners 2hor.sides 2vert.sides Concretely, • pdof #0 sees vdofs 0,1,2,3,8,9,10,11 • pdof #1 sees vdofs 0,1,2,3,4,5,8,9,10,11,12,13 • pdof #5 sees vdofs 0,1,2,3,4,5,8,9,10,11,12,13,16,17,18,19,20,21 so that the GT matrix non-zero structure then is as follows: 135 insidenodes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 0 1 2 3 4 5 6 7 8 9 10 11 We will here use the formulation of [41], which is very appealing since it does not require any free (user-chosen) parameter. Furthermore the matrix C is rather simple to compute as we will see hereafter. R We also impose pdV = 0 which means that the following constraint is added to the Stokes matrix: K G 0 V f GT C L · P = h λ 0 0 LT 0 As in [41] we solve the benchmark problem presented in 6.7.2 1.00000 0.10000 velocity pressure x2 x1.5 x1 error 0.01000 0.00100 0.00010 0.00001 0.1 h 136 29 fieldstone 23: compressible flow (1) - analytical benchmark This work is part of the MSc thesis of T. Weir (2018). We first start with an isothermal Stokes flow, so that we disregard the heat transport equation and the equations we wish to solve are simply: 1 −∇ · 2η ε̇(v) − (∇ · v)1 + ∇p = ρg 3 ∇ · (ρv) = 0 in Ω, (242) in Ω (243) The second equation can be rewritten ∇ · (ρv) = ρ∇ · v + v · ∇ρ = 0 or, 1 ∇ · v + v · ∇ρ = 0 ρ Note that this presupposes that the density is not zero anywhere in the domain. We use a mixed formulation and therefore keep both velocity and pressure as unknowns. We end up having to solve the following system: K G V f · = or, A · X = rhs P h GT + Z 0 Where K is the stiffness matrix, G is the discrete gradient operator, GT is the discrete divergence operator, V the velocity vector, P the pressure vector. Note that the term ZV derives from term v · ∇ρ in the continuity equation. Each block K, G , Z and vectors f and h are built separately in the code and assembled into the matrix A and vector rhs afterwards. A and rhs are then passed to the solver. We will see later that there are alternatives to solve this approach which do not require to build the full Stokes matrix A. Remark: the term ZV is often put in the rhs (i.e. added to h) so that the matrix A retains the same structure as in the incompressible case. This is indeed how it is implemented in ASPECT. This however requires more work since the rhs depends on the solution and some form of iterations is needed. In the case of a compressible flow the strain rate tensor and the deviatoric strain rate tensor are no more equal (since ∇ · v 6= 0). The deviatoric strainrate tensor is given by12 1 1 ˙ = (v) ˙ ˙ − (∇ · v)1 ˙ d (v) = (v) − T r()1 3 3 In that case: ˙dxx = ˙dyy = 2˙dxy = ∂u 1 ∂u ∂v 2 ∂u 1 ∂v − + = − ∂x 3 ∂x ∂y 3 ∂x 3 ∂y ∂v 1 ∂u ∂v 1 ∂u 2 ∂v − + =− + ∂y 3 ∂x ∂y 3 ∂x 3 ∂y ∂u ∂v + ∂y ∂x and then ˙ d (v) = d From ~τ = 2η~ τxx τyy = 2η τxy we arrive at: ˙dxx 2/3 ˙dyy = 2η −1/3 0 ˙dxy 2 ∂u 3 ∂x 1 ∂u 2 ∂y −1/3 2/3 0 − 1 ∂v 3 ∂y 1 ∂u 2 ∂y + 1 ∂v 2 ∂x − 13 ∂u ∂x 0 0 · 1/2 + 1 ∂v 2 ∂x + 2 ∂v 3 ∂y ∂u ∂x ∂v ∂y ∂u ∂v ∂y + ∂x (246) 4/3 = η −2/3 0 ~τ = Cη BV the ASPECT manual for a justification of the 3 value in the denominator in 2D and 3D. 137 (245) or, 12 See (244) −2/3 4/3 0 0 0 · 1 ∂u ∂x ∂v ∂y ∂u ∂v ∂y + ∂x In order to test our implementation we have created a few manufactured solutions: • benchmark #1 (ibench=1)): Starting from a density profile of: ρ(x, y) = xy (247) We derive a velocity given by: vx (x, y) = With gx (x, y) = 1 x Cx Cy , vy (x, y) = x y (248) and gy (x, y) = y1 , this leads us to a pressure profile: 4Cy 4Cx + 2 + xy + C0 p = −η 3x2 3y (249) This gives us a strain rate: ˙xx = −Cx x2 ˙yy = −Cy y2 ˙xy = 0 In what follows, we choose η = 1 and Cx = Cy = 1 and for a unit square domain [1 : 2] × [1 : 2] we compute C0 so that the pressure is normalised to zero over the whole domain and obtain C0 = −1. • benchmark #2 (ibench=2): Starting from a density profile of: ρ = cos(x) cos(y) (250) We derive a velocity given by: Cy Cx , vy = cos(x) cos(y) 1 and gy = cos(x) , this leads us to a pressure profile: ! 4Cx sin(x) 4Cy sin(y) + + (sin(x) + sin(y)) + C0 p=η 3 cos2 (x) 3 cos2 (y) vx = With gx = 1 cos(y) (251) (252) sin(y) sin(x) ˙yy = Cy ˙xy = 0 2 cos (x) cos2 (y) We choose η = 1 and Cx = Cy = 1. The domain is the unit square [0 : 1] × [0 : 1] and we obtain C0 as before and obtain 1 C0 = 2 − 2 cos(1) + 8/3( − 1) ' 3.18823730 cos(1) ˙xx = Cx (thank you WolframAlpha) • benchmark #3 (ibench=3) • benchmark #4 (ibench=4) • benchmark #5 (ibench=5) features • Q1 × P0 element • incompressible flow • mixed formulation • Dirichlet boundary conditions (no-slip) • isothermal • isoviscous • analytical solution • pressure smoothing 138 ToDo: • pbs with odd vs even number of elements • q is ’fine’ everywhere except in the corners - revisit pressure smoothing paper? • redo A v d Berg benchmark (see Tom Weir thesis) 139 30 fieldstone 24: compressible flow (2) - convection box This work is part of the MSc thesis of T. Weir (2018). 30.1 The physics Let us start with some thermodynamics. Every material has an equation of state. The equilibrium thermodynamic state of any material can be constrained if any two state variables are specified. Examples of state variables include the pressure p and specific volume ν = 1/ρ, as well as the temperature T . After linearisation, the density depends on temperature and pressure as follows: ρ(T, p) = ρ0 ((1 − α(T − T0 ) + βT p) where α is the coefficient of thermal expansion, also called thermal expansivity: 1 ∂ρ α=− ρ ∂T p α is the percentage increase in volume of a material per degree of temperature increase; the subscript p means that the pressure is held fixed. βT is the isothermal compressibility of the fluid, which is given by 1 1 ∂ρ βT = = K ρ ∂P T with K the bulk modulus. Values of βT = 10−12 − 10−11 Pa−1 are reasonable for Earth’s mantle, with values decreasing by about a factor of 5 between the shallow lithosphere and core-mantle boundary. This is the percentage increase in density per unit change in pressure at constant temperature. Both the coefficient of thermal expansion and the isothermal compressibility can be obtained from the equation of state. The full set of equations we wish to solve is given by −∇ · 2η ˙ d (v) + ∇p = ρ0 ((1 − α(T − T0 ) + βT p) g in Ω 1 in Ω ∇ · v + v · ∇ρ = 0 ρ ∂T ∂p ρCp + v · ∇T − ∇ · k∇T = ρH + 2η ˙ d : ˙ d + αT + v · ∇p ∂t ∂t (253) (254) in Ω, (255) Note that this presupposes that the density is not zero anywhere in the domain. 30.2 The numerics We use a mixed formulation and therefore keep both velocity and pressure as unknowns. We end up having to solve the following system: K G+W V f · = or, A · X = rhs P h GT + Z 0 Where K is the stiffness matrix, G is the discrete gradient operator, GT is the discrete divergence operator, V the velocity vector, P the pressure vector. Note that the term ZV derives from term v · ∇ρ in the continuity equation. As perfectly explained in the step 32 of deal.ii13 , we need to scale the G term since it is many orders of magnitude smaller than K, which introduces large inaccuracies in the solving process to the point that the solution is nonsensical. This scaling coefficient is η/L. After building the G block, it is then scaled as follows: G0 = Lη G so that we now solve 13 https://www.dealii.org/9.0.0/doxygen/deal.II/step 32.html 140 K G0T + Z G0 + W 0 V f · = P0 h After the solve phase, we recover the real pressure with P = Lη P 0 . adapt notes since I should scale W and Z too. h should be caled too !!!!!!!!!!!!!!! Each block K, G , Z and vectors f and h are built separately in the code and assembled into the matrix A and vector rhs afterwards. A and rhs are then passed to the solver. We will see later that there are alternatives to solve this approach which do not require to build the full Stokes matrix A. Remark 1: the terms ZV and WP are often put in the rhs (i.e. added to h) so that the matrix A retains the same structure as in the incompressible case. This is indeed how it is implemented in ASPECT, see also appendix A of [82]. This however requires more work since the rhs depends on the solution and some form of iterations is needed. Remark 2: Very often the adiabatic heating term αT (v · ∇p) is simplified as follows: If you assume the vertical component of the gradient of the dynamic pressure to be small compared to the gradient of the total pressure (in other words, the gradient is dominated by the gradient of the hydrostatic pressure), then −ρg ' ∇p and then αT (v · ∇p) ' −αρT v · g. We will however not be using this approximation in what follows. We have already established that ~τ = Cη BV The following measurements are carried out: • The root mean square velocity (vrms): s 1 V Z 1 < T >= V Z vrms = v 2 dV V • The average temperature (Tavrg): T dV V • The total mass (mass): Z M= ρdV V • The Nusselt number (Nu): Nu = − 1 1 Lx ∆T Lx Z 0 ∂T (x, y = Ly ) dx ∂y • The kinetic energy (EK): Z EK = V 1 2 ρv dV 2 • The work done against gravity Z < W >= − ρgy vy dV V • The total viscous dissipation (visc diss) Z Z 1 < Φ >= ΦdV = 2η ε̇ : ε̇dV V • The gravitational potential energy (EG) Z ρgy (Ly − y)dV EG = V 141 • The internal thermal energy (ET) Z ET = ρ(0) Cp T dV V Remark 3: Measuring the total mass can be misleading: indeed because ρ = ρ0 (1 − αT ), then measuring the total mass amounts to measuring a constant minus the volume-integrated temperature, and there is no reason why the latter should be zero, so that there is no reason why the total mass should be zero...! 30.3 The experimental setup The setup is as follows: the domain is Lx = Ly = 3000km. Free slip boundary conditions are imposed on all four sides. The initial temperature is given by: πx πy Ly − y − 0.01 cos( ) sin( ) ∆T + Tsurf T (x, y) = Ly Lx Ly with ∆T = 4000K, Tsurf = T0 = 273.15K. The temperature is set to ∆T + Tsurf at the bottom and Tsurf at the top. We also set k = 3, Cp = 1250, |g| = 10, ρ0 = 3000 and we keep the Rayleigh number Ra and dissipation number Di as input parameters: Ra = From the second equation we get α = Ra = αg∆T L3 ρ20 Cp ηk DiCp gL , Di = αgL Cp which we can insert in the first one: DiCp2 ∆T L2 ρ20 ηk or, η= DiCp2 ∆T L2 ρ20 Ra k For instance, for Ra = 104 and Di = 0.75, we obtain α ' 3 · 10−5 and η ' 1025 which are quite reasonable values. 30.4 Scaling Following [77], we non-dimensionalize the equations using the reference values for density ρr , thermal expansivity αr , temperature contrast ∆Tr (refTemp), thermal conductivity kr , heat capacity Cp , depth of the fluid layer L and viscosity ηr . The non-dimensionalization for velocity, ur , pressure pr and time, tr become kr ur = (refvel) ρr Cp L pr = ηr kr ρr Cp L2 (refpress) tr = ρr Cp L2 kr (reftime) In the case of the setup described hereabove, and when choosing Ra = 104 and Di = 0.5, we get: alphaT 2.083333e-05 eta 8.437500e+24 reftime 1.125000e+19 refvel 2.666667e-13 refPress 7.500000e+05 142 30.5 Conservation of energy 1 30.5.1 under BA and EBA approximations Following [82], we take the dot product of the momentum equation with the velocity v and integrate over the whole volume14 : Z Z [−∇ · τ + ∇p] · vdV = ρg · vdV V V or, Z − Z Z (∇ · τ ) · vdV + V ∇p · vdV = V ρg · vdV V Let us look at each block separately: Z Z Z Z Z τ : ∇vdV = τ : ε̇dV = ΦdV − (∇ · τ ) · vdV = − τ |v{z · n} dS + V V V V S =0 (b.c.) which is the volume integral of the shear heating. Then, Z Z Z dS − ∇p · vdV = p v · n | {z } V V S =0 (b.c.) ∇ | {z· v} pdV = 0 =0 (incomp.) which is then zero in the case of an incompressible flow. And finally Z ρg · vdV = W V which is the work against gravity. Conclusion for an incompressible fluid: we should have Z Z ΦdV = ρg · vdV V (256) V This formula is hugely problematic: indeed, the term ρ in the rhs is the full density. We know that to the value of ρ0 corresponds a lithostatic pressure gradient pL = ρ0 gy. In this case one can write ρ = ρ0 + ρ0 and p = pL + p0 so that we also have Z Z [−∇ · τ + ∇p0 ] · vdV = ρ0 g · vdV V V which will ultimately yield Z Z ρ g · vdV = ΦdV = V Z 0 V (ρ − ρ0 )g · vdV (257) V Obviously Eqs.(256) and (257) cannot be true at the same time. The problem comes from the nature of the (E)BA approximation: ρ = ρ0 in the mass conservation equation but it is not constant in the momentum conservation equation, which is of course inconsistent. Since the mass conservation equation R is ∇ · v = 0 under this approximation then the term V ∇p · vdV is always zero for any pressure (full pressure p, or overpressure p − pL ), hence the paradox. This paradox will be lifted when a consistent set of equations will be used (compressible formulation). On a practical note, Eqs.(256) is not verified by the code, while (257) is. In the end: Z Z ΦdV = (ρ − ρ0 )g · vdV | V {z } | V {z } visc diss 14 Check: work grav this is akin to looking at the power, force*velocity, says Arie 143 (258) 30.5.2 under no approximation at all Z Z Z ∇p · vdV = V p v · n} dS − | {z S =0 (b.c.) Z = V ∇ · v pdV = 0 (259) V 1 v · ∇ρ pdV = 0 ρ (260) (261) ToDo:see section 3 of [82] where this is carried out with the Adams-Williamson eos. 30.6 Conservation of energy 2 Also, following the Reynold’s transport theorem [91],p210, we have for a property A (per unit mass) Z Z Z d ∂ AρdV = (Aρ)dV + Aρv · ndS dt V V ∂t S Let us apply to this to A = Cp T and compute the time derivative of the internal energy: Z Z Z Z Z ∂T ∂ ∂ρ d + ρCp ρCp T dV = (ρCp T )dV + Aρ v · n dS = C T dV dV (262) p | {z } dt V ∂t ∂t V V ∂t S V | {z } | {z } =0 (b.c.) I II In order to expand I, the mass conservation equation will be used, while the heat transport equation will be used for II: Z I= V ∂ρ Cp T dV ∂t Z II = ρCp V ∂T dV ∂t Z Z = − Cp T ∇ · (ρv)dV = − V V Z −ρCp v · ∇T V Z = −ρCp v · ∇T V Z = −ρCp v · ∇T V Z = −ρCp v · ∇T = V Z Cp T ρ v · n} dS + | {z =0 (b.c.) ρCp ∇T · vdV (263) V ∂p + ∇ · k∇T + ρH + Φ + αT + v · ∇p dV (264) ∂t Z ∂p + v · ∇p dV + ∇ · k∇T dV (265) + ρH + Φ + αT ∂t V Z ∂p + ρH + Φ + αT + v · ∇p dV + k∇T · ndS(266) ∂t S Z ∂p + v · ∇p dV − q · ndS (267) + ρH + Φ + αT ∂t S Finally: d I + II = dt Z |V ρCp T dV {z } Z Z ∂p = ρH + Φ + αT + v · ∇p dV − q · ndS ∂t V S (268) ET Z = V Z Z Z ∂p ρHdV + ΦdV + αT dV + αT v · ∇pdV − ∂t | V {z } | V {z } |V {z } visc diss extra adiab heating Z q · ndS (269) | S {z } heatflux boundary This was of course needlessly complicated as the term ∂ρ/∂t is always taken to be zero, so that I = 0 automatically. The mass conservation equation is then simply ∇ · (ρv) = 0. Then it follows that Z Z Z 0 = Cp T ∇ · (ρv)dV = − Cp T ρ v · n dS + ρCp ∇T · vdV (270) | {z } V V =0 (b.c.) V Z ρCp ∇T · vdV = (271) V so that the same term in Eq.(267) vanishes too, and then Eq.(269) is always valid, although one should be careful when computing ET in the BA and EBA cases as it should use ρ0 and not ρ. 144 30.7 The problem of the onset of convection [wiki] In geophysics, the Rayleigh number is of fundamental importance: it indicates the presence and strength of convection within a fluid body such as the Earth’s mantle. The mantle is a solid that behaves as a fluid over geological time scales. The Rayleigh number essentially is an indicator of the type of heat transport mechanism. At low Rayleigh numbers conduction processes dominate over convection ones. At high Rayleigh numbers it is the other way around. There is a so-called critical value of the number with delineates the transition from one regime to the other. This problem has been studied and approached both theoretically and numerically [137, e.g.] and it was found that the critical Rayleigh number Rac is Rac = (27/4)π 4 ' 657.5 in setups similar to ours. VERY BIG PROBLEM The temperature setup is built as follows: Tsurf is prescribed at the top, Tsurf + ∆T is prescribed at the bottom. The initial temperature profile is linear between these two values. In the case of BA, the actual value of Tsurf is of no consequence. However, for the EBA the full temperature is present in the adiabatic heating term on the rhs of the hte, and the value of Tsurf will therefore influence the solution greatly. This is very problematic as there is no real way to arrive at the surface temperature from the King paper. On top of this, the density uses a reference temperature T0 which too will influence the solution without being present in the controlling Ra and Di numbers!! In light thereof, it will be very difficult to recover the values of King et al for EBA! features • Q1 × P0 element • compressible flow • mixed formulation • Dirichlet boundary conditions (no-slip) • isoviscous • analytical solution • pressure smoothing Relevant literature: [11, 70, 126, 82, 77, 83, 87, 65] ToDo: • heat flux is at the moment elemental, so Nusselt and heat flux on boundaries measurements not as accurate as could be. 145 • implement steady state detection • do Ra = 105 and Ra = 106 • velocity average at surface • non dimensional heat flux at corners [15] • depth-dependent viscosity (case 2 of [15]) 146 results - BA - Ra = 104 30.8 These results were obtained with a 64x64 resolution, and CFL number of 1. Steady state was reached after about 1250 timesteps. 7x10-6 -7.73687x1023 7.67188x1022 6x10-6 -7.73687x1023 7.67188x1022 5x10-6 -7.73687x1023 7.67188x1022 4x10-6 -7.73687x1023 3x10-6 EG ET EK 7.67188x1022 7.67188x1022 -7.73687x1023 7.67188x1022 1x10-6 0 (a) -7.73687x1023 7.67188x1022 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) 7.67188x1022 (b) -7.73687x1023 0 100002000030000400005000060000700008000090000 100000 time (Myr) 2273.15 -7.73687x1023 -7.73687x1023 7.67188x1022 2x10-6 -7.73687x1023 4500 -7.73687x1023 (c) time (Myr) 0.0015 min(T) max(T) 4000 0 100002000030000400005000060000700008000090000 100000 2273.15 min(u) max(u) min(v) max(v) 0.001 3500 2273.15 2273.15 3000 0.0005 velocity Temperature 2273.15 2500 2000 1500 0 -0.0005 1000 2273.15 -0.001 500 2273.15 (d) 0 100002000030000400005000060000700008000090000100000 time (Myr) 0 (e) 90000 -10000 80000 80000 70000 70000 viscous dissipation -50000 60000 50000 40000 30000 20000 -70000 10000 -80000 0 (g) 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) (h) 60000 50000 40000 30000 20000 10000 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) 0 (i) 0.07 8 2x10-8 0.06 7 1x10-8 vrms (cm/yr) -2x10-8 -5x10-8 5 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) 3 8x10-7 0 (k) 2 1 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) 90000 0 HF dETdt 6x10-7 4 0.03 0.01 -4x10-8 4.88 0.04 0.02 -3x10-8 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 6 0.05 0 -1x10-8 0 time (Myr) 3x10-8 Nu adiabatic heating -40000 work against gravity 90000 -30000 0 100002000030000400005000060000700008000090000 100000 time (Myr) 0 -60000 heat flux (f) time (Myr) -20000 (j) -0.0015 0 100002000030000400005000060000700008000090000 100000 0 (l) 0 10000 20000 30000 40000 50000 60000 70000 80000 90000100000 time (Myr) VD WG 80000 70000 4x10-7 60000 2x10-7 50000 0 40000 30000 -2x10-7 20000 -4x10-7 -6x10-7 (l) 10000 0 0 1x1010 2x1010 3x1010 4x1010 5x1010 6x1010 7x1010 8x1010 9x1010 1x1011 0 1x10102x10103x10104x10105x10106x10107x10108x10109x10101x1011 time (Myr) (m) AH: adiabatic heating, VD: viscous dissipation, HF: heat flux, WG: work against gravity time (Myr) Eq.(269) is verified by (l) and Eq.(258) is verified by (m). 147 (a) (b) (c) (d) (e) (f) (g) (h) (i) 148 results - BA - Ra = 105 30.9 These results were obtained with a 64x64 resolution, and CFL number of 1. Steady state was reached after about 1250 timesteps. 0.0007 7.67188x1022 0.0006 7.67188x1022 0.0005 -7.73687x1023 -7.73687x1023 -7.73687x1023 7.67188x1022 -7.73687x1023 7.67188x1022 EG ET EK 0.0004 0.0003 7.67188x1022 0.0002 0 (a) 5000 10000 15000 20000 25000 30000 35000 time (Myr) 7.67188x1022 (b) 2273.150000001 4500 2273.150000001 4000 Temperature 2273.150000000 5000 10000 15000 20000 25000 30000 35000 3000 min(u) max(u) min(v) max(v) 0.005 2500 2000 1500 0 (e) 0 -0.005 0 5000 -0.015 10000 15000 20000 25000 30000 35000 (f) time (Myr) 0 -100000 800000 800000 -200000 700000 700000 -400000 -500000 -600000 600000 500000 400000 300000 -700000 200000 -800000 100000 -900000 0 5000 10000 15000 20000 25000 30000 35000 time (Myr) work against gravity 900000 -300000 (h) 0.8 2x10-6 0.7 vrms (cm/yr) 1x10-6 5x10-7 0 5000 10000 15000 20000 25000 30000 5000 10000 15000 20000 25000 30000 time (Myr) 1x10-5 35000 (k) 15000 20000 25000 30000 35000 10.53 12 10 8 6 4 2 0 5000 0 10000 15000 20000 25000 30000 35000 (l) time (Myr) 900000 700000 600000 2x10-6 500000 0 400000 -2x10-6 300000 -4x10-6 200000 -6x10-6 100000 0 5x109 1x1010 1.5x1010 2x1010 2.5x1010 3x1010 3.5x1010 0 5000 10000 15000 20000 25000 30000 35000 time (Myr) VD WG 800000 4x10-6 0 10000 14 6x10-6 -8x10-6 5000 16 0 HF dETdt 8x10-6 0 18 0.2 0 300000 time (Myr) 193.2150 0.3 -1x10-6 400000 (i) 0.4 0.1 500000 0 35000 0.5 -5x10-7 600000 100000 0 0.6 1.5x10-6 10000 15000 20000 25000 30000 35000 200000 time (Myr) 2.5x10-6 5000 time (Myr) 900000 viscous dissipation adiabatic heating time (Myr) 0.015 min(T) max(T) 0 0 10000 15000 20000 25000 30000 35000 -0.01 0 time (Myr) (g) 5000 500 2273.149999999 0 0 1000 2273.149999999 heat flux (c) Nu 2273.150000000 2273.150000000 (l) -7.73687x1023 10000 15000 20000 25000 30000 35000 0.01 2273.150000000 (d) 5000 3500 2273.150000000 2273.149999999 -7.73687x1023 0 time (Myr) 2273.150000001 (j) -7.73687x1023 velocity 0 -7.73687x1023 -7.73687x1023 7.67188x1022 0.0001 -7.73687x1023 0 5x109 1x1010 1.5x1010 2x1010 2.5x1010 3x1010 3.5x1010 time (Myr) (m) AH: adiabatic heating, VD: viscous dissipation, HF: heat flux, WG: work against gravity time (Myr) Eq.(269) is verified by (l) and Eq.(258) is verified by (m). 149 30.10 results - BA - Ra = 106 150 results - EBA - Ra = 104 30.11 These results were obtained with a 64x64 resolution, and CFL number of 1. Steady state was reached after about 2500 timesteps 8x10-7 7.7x1022 7.6x1022 6x10-7 -7.74x1023 7.55x1022 5x10-7 7.5x1022 -7.745x1023 7.45x1022 EG 4x10-7 ET EK -7.735x1023 7.65x1022 7x10-7 7.4x1022 3x10-7 -7.75x1023 7.35x1022 2x10-7 7.3x1022 1x10-7 -7.755x1023 7.25x1022 0 0 (a) 50000 100000 150000 200000 250000 time (Myr) 7.2x1022 (b) 0 50000 100000 150000 200000 250000 time (Myr) 2280 4500 2000 (d) 50000 100000 150000 200000 250000 (e) 0 50000 100000 150000 200000 -0.0004 250000 (f) time (Myr) 10000 10000 9000 9000 8000 8000 -3000 7000 -5000 -6000 -7000 6000 5000 4000 3000 -8000 2000 -9000 1000 -10000 0 (g) 0 50000 100000 150000 200000 250000 time (Myr) work against gravity 0 -2000 -4000 (h) 50000 100000 150000 200000 250000 250000 5000 4000 3000 0 50000 100000 150000 200000 250000 time (Myr) 2.4 2.2 0.02 5000 2 4000 3000 1.8 0.015 Nu vrms (cm/yr) 6000 heat flux 200000 6000 0 7000 0.01 1.2 0.005 1000 1.6 1.4 2000 1 0 0 50000 100000 150000 200000 250000 time (Myr) 0 (k) 1000 0 50000 100000 -1000 150000 200000 0.8 (l) 0 50000 100000 150000 200000 250000 time (Myr) 10000 VD WG 9000 8000 -2000 7000 -3000 6000 -4000 5000 -5000 4000 -6000 3000 -7000 -8000 2000 -9000 1000 -10000 250000 time (Myr) 0 AH+VD+HF dETdt 0 (l) 150000 7000 (i) 0.025 8000 (j) 100000 1000 0 9000 -1000 50000 2000 time (Myr) 10000 0 time (Myr) -1000 viscous dissipation adiabatic heating time (Myr) 0 0 -0.0003 500 0 min(u) max(u) min(v) max(v) -0.0002 1000 2140 250000 -0.0001 1500 2160 200000 0.0001 2500 2180 150000 0.0002 velocity 2200 100000 0.0003 3000 Temperature 2220 50000 0.0004 3500 2240 0 time (Myr) min(T) max(T) 4000 2260 -7.76x1023 (c) 0 50000 100000 150000 200000 0 250000 0 50000 100000 150000 200000 250000 time (Myr) (m) AH: adiabatic heating, VD: viscous dissipation, HF: heat flux, WG: work against gravity time (Myr) Eq.(269) is verified by (l) and Eq.(258) is verified by (m). 151 a) b) c) d) e) f) g) h) i) j) k) l) m) n) 152 results - EBA - Ra = 105 30.12 These results were obtained with a 64x64 resolution, and CFL number of 1. Simulation was stopped after about 4300 timesteps. 9x10-5 7.7x1022 8x10-5 7x10-5 6x10-5 0 20000 40000 60000 80000 100000 120000 time (Myr) 7.4x1022 (b) EG 20000 40000 60000 80000 100000 5000 2260 Temperature 2240 2230 -7.75x1023 (c) 0.003 3500 0.002 2000 20000 40000 60000 80000 100000 120000 time (Myr) -0.003 -0.004 0 20000 40000 60000 80000 100000 -0.005 120000 (f) time (Myr) 100000 viscous dissipation 120000 100000 -80000 -120000 (g) 80000 60000 40000 20000 0 20000 40000 60000 80000 100000 120000 time (Myr) 0 (h) 20000 40000 60000 80000 100000 120000 80000 100000 120000 60000 40000 0 0 20000 40000 60000 80000 100000 120000 time (Myr) 0.3 6 5.5 0.25 5 50000 4.5 0.2 30000 20000 10000 4 Nu vrms (cm/yr) 40000 heat flux 60000 80000 (i) 60000 0.15 3.5 3 2.5 0.1 2 0 1.5 0.05 -10000 -20000 40000 20000 0 time (Myr) 70000 20000 time (Myr) 120000 -100000 (j) 0 0 -60000 120000 min(u) max(u) min(v) max(v) -20000 -40000 100000 0 -0.002 (e) 80000 0.001 1000 500 0 60000 -0.001 1500 0 40000 0.004 2500 2210 20000 0.005 4000 3000 2220 0 time (Myr) velocity 2250 120000 min(T) max(T) 4500 2270 -7.748x1023 0 time (Myr) 2280 adiabatic heating -7.746x1023 7.45x1022 1x10-5 work against gravity EK ET 7.5x1022 2x10-5 (d) 7.55x1022 -7.744x1023 3x10-5 2200 -7.74x1023 -7.742x1023 4x10-5 (a) -7.738x1023 7.6x1022 5x10-5 0 -7.736x1023 7.65x1022 1 0 20000 40000 60000 80000 100000 120000 time (Myr) 20000 0 (k) 0 20000 40000 60000 100000 120000 0.5 (l) 0 20000 40000 60000 80000 100000 120000 time (Myr) 120000 0 AH+VD+HF dETdt 10000 80000 time (Myr) VD WG 100000 0 80000 -10000 -20000 60000 -30000 40000 -40000 20000 -50000 -60000 (l) 0 20000 40000 60000 80000 0 100000 120000 0 20000 40000 60000 80000 100000 120000 time (Myr) (m) AH: adiabatic heating, VD: viscous dissipation, HF: heat flux, WG: work against gravity time (Myr) 153 30.13 Onset of convection The code can be run for values of Ra between 500 and 1000, at various resolutions for the BA formulation. The value vrms (t) − vrms (0) is plotted as a function of Ra and for the 10 first timesteps. If the vrms is found to decrease, then the Rayleigh number is not high enough to allow for convection and the initial temperature perturbation relaxes by diffusion (and then vrms (t) − vrms (0) < 0. If the vrms is found to increase, then vrms (t) − vrms (0) > 0 and the system is going to showcase convection. The zero value of vrms (t) − vrms (0) gives us the critical Rayleigh number, which is found between 775 and 790. 8x10-15 16x16 32x32 48x48 64x64 6x10-15 vrms trend 4x10-15 2x10-15 0 -2x10-15 -4x10-15 1000 Ra 1.5x10-16 16x16 32x32 48x48 64x64 1x10-16 5x10-17 vrms trend 0 -5x10-17 -1x10-16 -1.5x10-16 -2x10-16 -2.5x10-16 -3x10-16 -3.5x10-16 770 775 780 Ra 154 785 790 Appendix: Looking for the right combination of parameters for the King benchmark. I run a quadruple do loop over L, ∆T , ρ0 and η0 between plausible values (see code targets.py) and write in a file only the combination which yields the required Rayleigh and Dissipation number values (down to 1% accuracy). a l p h a=3e−5 g=10 hcapa =1250 hcond=3 DTmin=1000 Lmin=1e6 rhomin =3000 etamin=19 ; ; ; ; DTmax=4000 Lmax=3e6 rhomax=3500 etamax=25 ; ; ; ; DTnpts=251 Lnpts =251 r h o n p t s =41 e t a n p t s =100 On the following plots the ’winning’ combinations of these four parameters are shown: 0.26 Di 0.255 0.25 0.245 0.24 9600 9800 10000 10200 10400 Ra 1.05x106 1.045x106 1.04x106 1.035x106 L 1.03x106 1.025x106 1.02x106 1.015x106 1.01x106 1.005x106 1x106 500 1000 1500 2000 2500 3000 3500 4000 4500 DT 9x1023 8x1023 7x1023 eta 6x1023 5x1023 4x1023 3x1023 2x1023 1x1023 2800 3000 3200 3400 3600 3800 4000 4200 rho We see that: • the parameter L (being to the 3rd power in the Ra number) cannot vary too much. Although it is varied between 1000 and 3000km there seems to be a ’right’ value at about 1040 km. (why?) • viscosities are within 1023 and 1024 which are plausible values (although a bit high?). • densities can be chosen freely between 3000 and 3500 • ∆T seems to be the most problematic value since it can range from 1000 to 4000K ... 155 31 fieldstone 25: Rayleigh-Taylor instability (1) - instantaneous This numerical experiment was first presented in [138]. It consists of an isothermal Rayleigh-Taylor instability in a two-dimensional box of size Lx = 0.9142 and Ly = 1. Two Newtonian fluids are present in the system: the buoyant layer is at the bottom of the box and the interface between both fluids placed πx The bottom fluid is parametrised by its mass density ρ1 and its is given by y(x) = 0.2 + 0.02 cos L x viscosity µ1 , while the layer above is parametrised by ρ2 and µ2 . No-slip boundary conditions are applied at the bottom and at the top of the box while free-slip boundary conditions are applied on the sides. In the original benchmark the system is run over 2000 units of dimensionless time and the timing and position of various upwellings/downwellings is monitored. In this present experiment only the root mean square velocity is measured at t = 0: the code is indeed not yet foreseen of any algorithm capable of tracking deformation. Another approach than the ones presented in the extensive literature which showcases results of this benchmark is taken. The mesh is initially fitted to the fluids interface and the resolution is progressively increased. This results in the following figure: 0.01000 vrms 0.00100 0.00010 0.00001 0.01 0.1 hx The green line indicates results obtained with my code ELEFANT with grids up to 2000x2000 with the exact same methodology. 156 features • Q1 × P0 element • incompressible flow • mixed formulation • isothermal • numerical benchmark 157 32 fieldstone 26: Slab detachment benchmark (1) - instantaneous As in [116], the computational domain is 1000km × 660km. No-slip boundary conditions are imposed on the sides of the system while free-slip boundary conditions are imposed at the top and bottom. Two materials are present in the domain: the lithosphere (mat.1) and the mantle (mat.2). The overriding plate (mat.1) is 80km thick and is placed at the top of the domain. An already subducted slab (mat.1) of 250km length hangs vertically under this plate. The mantle occupies the rest of the domain. The mantle has a constant viscosity η0 = 1021 P a.s and a density ρ = 3150kg/m3 . The slab has a density ρ = 3300kg/m3 and is characterised by a power-law flow law so that its effective viscosity depends on the second invariant of the strainrate I2 as follows: ηef f = 1 1 −1/ns 1/ns −1 1/n −1 1/n −1 1/n −1 (272) I2 = [(2 × 4.75×1011 )−ns ]−1/ns I2 s = 4.75×1011 I2 s = η0 I2 s A 2 2 with ns = 4 and A = (2 × 4.75×1011 )−ns , or η0 = 4.75 × 1011 . Fields at convergence for 151x99 grid. 1x1024 1x1022 1x1021 1x1020 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 1x1023 viscosity (Pa.s) 1x1023 viscosity (Pa.s) 1x1024 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 1x1022 1x1021 0 100 200 300 400 500 600 700 800 900 1x1020 400 1000 450 500 x (km) 1x1026 1x1024 normalised nonlinear residual viscosity (Pa.s) 1.0000000 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 1x1025 1x1023 1x1022 1x1021 1x1020 0 550 100 200 300 400 500 600 0.0100000 0.0010000 0.0001000 0.0000100 0.0000010 0.0000001 700 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 1e-7 0.1000000 0 5 10 15 20 y (km) 4x10-16 0 25 30 35 40 45 y (km) 1x10-15 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 2x10-16 600 x (km) 1.5x10-15 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 8x10-16 6x10-16 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 1x10-15 5x10-16 exy eyy exx 4x10-16 -2x10-16 0 2x10-16 -4x10-16 0 -6x10-16 -8x10-16 -5x10-16 -1x10-15 -2x10-16 0 100 200 300 400 500 x (km) 600 700 800 900 1000 -4x10-16 0 100 200 300 400 500 x (km) 158 600 700 800 900 1000 -1.5x10-15 0 100 200 300 400 500 x (km) 600 700 800 900 1000 Along the horizontal line 4x10-16 1x10-15 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 2x10-16 0 6x10-16 4x10-17 exy eyy 2x10-17 -4x10-16 2x10-16 0 -6x10-16 0 -2x10-17 -8x10-16 -2x10-16 -4x10-17 -1x10-15 -4x10-16 0 100 200 300 400 500 600 700 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 6x10-17 4x10-16 exx -2x10-16 8x10-17 nelx=32 nelx=48 nelx=51 nelx=64 nelx=100 nelx=128 nelx=151 8x10-16 0 100 200 300 y (km) 400 500 600 y (km) Along the vertical line features • Q1 × P0 element • incompressible flow • mixed formulation • isothermal • nonlinear rheology • nonlinear residual Todo: nonlinear mantle, pressure normalisation 159 700 -6x10-17 0 100 200 300 y (km) 400 500 600 700 33 fieldstone 27: Consistent Boundary Flux In what follows we will be re-doing the numerical experiments presented in Zhong et al. [147]. The first benchmark showcases a unit square domain with free slip boundary conditions prescribed on all sides. The resolution is fixed to 64 × 64 Q1 × P0 elements. The flow is isoviscous and the buoyancy force f is given by fx = 0 fy = ρ0 αT (x, y) with the temperature field given by T (x, y) = cos(kx)δ(y − y0 ) where k = 2π/λ and λ is a wavelength, and y0 represents the location of the buoyancy strip. We set gy = −1 and prescribe ρ(x, y) = ρ0 α cos(kx)δ(y − y0 ) on the nodes of the mesh. One can prove ([147] and refs. therein) that there is an analytic solution for the surface stress σzz 15 cos(kx) σyy [k(1 − y0 ) sinh(k) cosh(ky0 ) − k sinh(k(1 − y0 )) + sinh(k) sinh(ky0 )] = ραgh sinh2 (k) We choose ρ0 α = 64, η = 1 (note that in this case the normalising coefficient of the stress is exactly 1 (since h = Lx /nelx = 1/64) so it is not implemented in the code). λ = 1 is set to 1 and we explore 62 59 y0 = 63 64 , 64 , 64 and y0 = 32/64. Under these assumptions the density field for y0 = 59/64 is: We can recover the stress at the boundary by computing the yy component of the stress tensor in the top row of elements: σyy = −p + 2η ˙yy Note that pressure is by definition elemental, and that strain rate components are then also computed in the middle of each element. These elemental quantities can be projected onto the nodes (see section ??) by means of the C→N algorithm or a least square algorithm (LS). y0=32/64 y0=32/64 0.2 0.001 0.15 0.0008 0.0006 0.1 0.0004 σyy error σyy 0.05 0 -0.05 -0.15 -0.2 0 0.2 0.4 0.6 0.8 elemental C-N LS cbf 0. -0.0006 -0.0008 -0.001 1 x 15 Note 0 -0.0002 -0.0004 analytical elemental C-N LS cbf -0.1 0.0002 0 0.2 0.4 0.6 x that in the paper the authors use ραg which does not have the dimensions of a stress 160 0.8 1 y0=59/64 y0=59/64 1 0.003 0.8 0.002 0.6 0.4 0.001 σyy error σyy 0.2 0 -0.2 -0.4 -0.8 -1 -0.001 analytical elemental C-N LS cbf -0.6 0 0.2 0.4 0.6 0.8 0 elemental C-N LS cbf 0. -0.002 -0.003 1 0 0.2 0.4 x 0.6 0.8 1 x y0=62 y0=62 1.5 0.1 0.08 1 0.06 0.04 σyy error σyy 0.5 0 -0.5 -1.5 0 0.2 0.4 0.6 0.8 0 -0.02 -0.04 analytical elemental C-N LS cbf -1 0.02 elemental C-N LS cbf 0. -0.06 -0.08 -0.1 1 0 0.2 0.4 x 0.6 0.8 1 x y0=63/64 y0=63/64 1.5 0.2 0.15 1 0.1 σyy error σyy 0.5 0 -0.5 analytical elemental C-N LS cbf -1 -1.5 0 0.2 0.4 0.6 0.8 0.05 0 -0.05 elemental C-N LS cbf 0. -0.1 -0.15 -0.2 1 0 0.2 x 0.4 0.6 0.8 1 x The consistent boundary flux (CBF) method allows us to compute traction vectors t = σ · n on the boundary of the domain. On the top boundary, n = (0, 1) so that t = (σxy , σyy )T and ty is the quantity we need to consider and compare to other results. In the following table are shown the results presented in [147] alongside the results obtained with Fieldstone: Method Analytic solution Pressure smoothing [147] CBF [147] fieldstone: elemental fieldstone: nodal (C→N) fieldstone: LS fieldstone: CBF y0 = 63/64 0.995476 1.15974 0.994236 0.824554 (-17.17 %) 0.824554 (-17.17 %) 1.165321 ( 17.06 %) 0.994236 ( -0.13 %) y0 = 62/64 0.983053 1.06498 0.982116 0.978744 (-0.44%) 0.978744 (-0.44%) 1.070105 ( 8.86%) 0.982116 (-0.10%) y0 = 59/64 16 0.912506 0.911109 0.912157 0.909574 (-0.32 0.909574 (-0.32 0.915496 ( 0.33 0.912157 (-0.04 %) %) %) %) y0 = 32/64 0.178136 n.a. n.a. 0.177771 (-0.20 0.177771 (-0.20 0.178182 ( 0.03 0.177998 (-0.08 We see that we recover the published results with the same exact accuracy, thereby validating our implmentation. On the following figures are shown the velocity, pressure and traction fields for two cases y0 = 32/64 and y0 = 63/64. 161 %) %) %) %) Here lies the superiority of our approach over the one presented in the original article: our code computes all traction vectors on all boundaries at once. explain how Medge is arrived at! compare with ASPECT ??! gauss-lobatto integration? pressure average on surface instead of volume ? 162 features • Q1 × P0 element • incompressible flow • mixed formulation • isothermal • isoviscous • analytical solution • pressure smoothing • consistent boundary flux 163 34 fieldstone 28: convection 2D box - Tosi et al, 2015 This fieldstone was developed in collaboration with Rens Elbertsen. The viscosity field µ is calculated as the harmonic average between a linear part µlin that depends on temperature only or on temperature and depth d , and a non-linear, plastic part µplast dependent on the strain rate: ˙ =2 µ(T, z, ) 1 1 + ˙ µlin (T, z) µplast () −1 . (273) The linear part is given by the linearized Arrhenius law (the so-called Frank-Kamenetskii approximation [?]): µlin (T, z) = exp(−γT T + γz z), (274) where γT = ln(∆µT ) and γz = ln(∆µz ) are parameters controlling the total viscosity contrast due to temperature (∆µT ) and pressure (∆µz ). The non-linear part is given by [?]: σY ˙ = µ∗ + √ µplast () , ˙ : ˙ (275) where µ∗ is a constant representing the effective viscosity at high stresses [?] and σY is the yield stress, also assumed to be constant. In 2-D, the denominator in the second term of equation (275) is given explicitly by s 2 2 2 √ p ∂ux ∂uy 1 ∂ux ∂uy ˙ : ˙ = ˙ij ˙ij = + + + . (276) ∂x 2 ∂y ∂x ∂y The viscoplastic flow law (equation 273) leads to linear viscous deformation at low stresses (equation (274)) and to plastic deformation for stresses that exceed σY (equation (275)), with the decrease in viscosity limited by the choice of µ∗ [?]. In all cases that we present, the domain is a two-dimensional square box. The mechanical boundary conditions are for all boundaries free-slip with no flux across, i.e. τxy = τyx = 0 and u · n = 0, where n denotes the outward normal to the boundary. Concerning the energy equation, the bottom and top boundaries are isothermal, with the temperature T set to 1 and 0, respectively, while side-walls are assumed to be insulating, i.e. ∂T /∂x = 0. The initial distribution of the temperature field is prescribed as follows: T (x, y) = (1 − y) + A cos(πx) sin(πy), (277) where A = 0.01 is the amplitude of the initial perturbation. In the following Table ??, we list the benchmark cases according to the parameters used. Case 1 2 3 4 5a 5b Ra 102 102 102 102 102 102 ∆µT 105 105 105 105 105 105 ∆µy 1 1 10 10 10 10 µ∗ – 10−3 – 10−3 10−3 10−3 σY – 1 – 1 4 3–5 Convective regime Stagnant lid Mobile lid Stagnant lid Mobile lid Periodic Mobile lid – Periodic – Stagnant lid Benchmark cases and corresponding parameters. In Cases 1 and 3 the viscosity is directly calculated from equation (274), while for Cases 2, 4, 5a, and 5b, we used equation (273). For a given mesh resolution, Case 5b requires running simulations with yield stress varying between 3 and 5 In all tests, the reference Rayleigh number is set at the surface (y = 1) to 102 , and the viscosity contrast due to temperature ∆µT is 105 , implying therefore a maximum effective Rayleigh number of 107 for T = 1. Cases 3, 4, 5a, and 5b employ in addition a depth-dependent rheology with viscosity contrast ∆µz = 10. Cases 1 and 3 assume a linear viscous rheology that leads to a stagnant lid regime. 164 Cases 2 and 4 assume a viscoplastic rheology that leads instead to a mobile lid regime. Case 5a also assumes a viscoplastic rheology but a higher yield stress, which ultimately causes the emergence of a strictly periodic regime. The setup of Case 5b is identical to that of Case 5a but the test consists in running several simulations using different yield stresses. Specifically, we varied σY between 3 and 5 in increments of 0.1 in order to identify the values of the yield stress corresponding to the transition from mobile to periodic and from periodic to stagnant lid regime. 34.0.1 Case 0: Newtonian case, a la Blankenbach et al., 1989 90 80 7 7 6 6 5 5 4 4 50 Nu vrms 60 Nu 70 40 3 3 30 2 2 20 0 1 1 10 0 0.05 0.1 0.15 0.2 time 0.25 0.3 0.35 0 0 0 0.05 0.1 0.15 0.2 time 165 0.25 0.3 0.35 0 10 20 30 40 50 vrms 60 70 80 90 34.0.2 Case 1 In this case µ? = 0 and σY = 0 so that µplast can be discarded. The CFL number is set to 0.5 and the ˙ = µlin (T, z). And since ∆µz = 1 then γz = 0 so that µlin (T, z) = exp(−γT T ) viscosity is given by µ(T, z, ) 350 3.5 300 3 2.5 200 Nu vrms 250 2 150 1.5 100 ELEFANT, 32x32 ELEFANT, 48x48 ELEFANT, 64x64 ELEFANT, 100x100 243.872 50 0 0.001 0.01 0.1 1 0.5 1 3.3987 0.001 0.01 0.1 3.5 0.8 3 0.75 2.5 0.7 2 0.65 1.5 0.6 1 0.55 0.5 0 50 100 150 200 250 300 350 0.5 vrms 0.77368 0.001 0.01 1 1 1 1 0.9 0.8 0.8 0.8 0.7 0.7 0.6 0.6 y 0.5 0.4 y 0.6 y 0.1 time 0.9 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.2 0.1 0 1 time Nu time 0.1 0 0.1 0.2 0.3 0.4 0.5 T 0.6 0.7 0.8 0.9 1 0 0.00010 0.00100 0.01000 viscosity 166 0.10000 0 0 50 100 150 200 velocity 250 300 350 400 167 34.0.3 Case 2 600 14 12 500 10 8 Nu vrms 400 300 6 200 4 100 2 141.518 0 0.001 0.01 0.1 0 1 8.17154 0.001 0.01 0.1 time 1 time 14 0.62 12 0.6 10 0.58 Nu 8 6 0.56 4 0.54 2 0.52 0 0 100 200 300 400 500 600 0.5 vrms 0.60521 0.001 0.01 1 1 1 0.9 0.8 0.8 0.8 0.7 0.7 0.6 0.6 y 0.5 0.4 y 0.6 y 1 time 0.9 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.2 0.1 0 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 T 0.6 0.7 0.8 0.9 1 0 0.00010 0.00100 0.01000 viscosity 168 0.10000 0 0 50 100 150 200 velocity 250 300 350 400 169 34.0.4 Case 3 110 3.5 100 3 90 80 2.5 60 Nu vrms 70 50 2 40 1.5 30 20 1 10 100.018 0 0.001 0.01 0.1 0.5 1 3.03472 0.001 0.01 0.1 time 1 time 3.5 0.75 3 0.7 2.5 Nu 0.65 2 0.6 1.5 1 0.55 0.5 0 10 20 30 40 50 60 70 80 90 100 110 0.5 vrms 0.7277 0.001 0.01 1 1 1 0.9 0.8 0.8 0.8 0.7 0.7 0.6 0.6 y 0.5 0.4 y 0.6 y 1 time 0.9 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.2 0.1 0 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 T 0.6 0.7 0.8 0.9 1 0 0.00010 0.00100 0.01000 viscosity 170 0.10000 0 0 50 100 150 200 velocity 250 300 350 400 171 34.0.5 Case 4 500 16 450 14 400 12 350 10 Nu vrms 300 250 8 200 6 150 4 100 2 50 79.4746 0 0.001 0.01 0.1 6.40359 0 1 0.001 0.01 0.1 time 1 time 16 0.53 14 0.525 12 0.52 0.515 Nu 10 8 6 0.51 4 0.505 2 0 0.5 0 50 100 150 200 250 300 350 400 450 500 0.495 vrms 0.528634 0.001 0.01 1 1 1 0.9 0.8 0.8 0.8 0.7 0.7 0.6 0.6 y 0.5 0.4 y 0.6 y 1 time 0.9 0.4 0.5 0.4 0.3 0.3 0.2 0.2 0.2 0.1 0 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 T 0.6 0.7 0.8 0.9 1 0 0.00010 0.00100 0.01000 viscosity 172 0.10000 0 0 50 100 150 200 velocity 250 300 350 400 173 34.0.6 Case 5 8 100 7 6 80 5 Nu vrms 60 4 3 40 2 20 0 1 41.61 98.183 0 0.5 1 1.5 2 2.5 3 3.5 4 0 4.5 2.6912 7.0763 0 0.5 1 1.5 2 2.5 3 3.5 8 0.68 7 0.66 6 0.64 5 0.62 4 3 4.5 0.6 0.58 0.56 2 0.54 1 0.52 0 4 time Nu time 0 10 20 30 40 50 60 70 80 90 100 0.5 vrms 0.66971 0.65206 0 1 2 3 4 5 6 7 time 200 300 150 250 200 100 150 50 v u 100 0 50 -50 0 -100 -50 -150 -200 -100 min(u) max(u) 0 1 2 3 4 5 6 -150 7 time min(v) max(v) 0 1 2 3 4 time 174 5 6 7 175 35 fieldstone 29: open boundary conditions In what follows we will investigate the use of the so-called open boundary conditions in the very simple context of a 2D Stokes sphere experiment. We start with a domain without the sphere. Essentially, it is what people would call an aquarium. Free slip boundary conditions are prescribed on the sides and no-slip conditions at the bottom. The top surface is left free. The fluid has a density ρ0 = 1 and a viscosity η0 = 1. In the absence of any density difference in the domain there is no active buoyancy force so that we expect a zero velocity field and a lithostatic pressure field. This is indeed what we recover: If we now implement a sphere parametrised by its density ρs = ρ0 + 1, its viscosity ηs = 103 and its radius Rs = 0.123 in the middle of the domain, we see clear velocity field which logically shows the sphere falling downward and a symmetric return flow of the fluid on each side: Unfortunately it has been widely documented that the presence of free-slip boundary conditions affects the evolution of subduction [31], even when these are placed rather far from the subduction zone. A proposed solution to this problem is the use of ’open boundary conditions’ which are in fact stress boundary conditions. The main idea is to prescribe a stress on the lateral boundaries (instead of free slip) so that it balances out exactly the existing lithostatic pressure inside the domain along the side walls. Only pressure deviations with respect to the lithostatic are responsible for flow and such boundary conditions allow flow across the boundaries. We need the lithostatic pressure and compute it before hand (which is trivial in our case but can prove to be a bit more tedious in real life situations when for instance density varies in the domain as a function of temperature and/or pressure). p l i t h = np . z e r o s ( nnp , dtype=np . f l o a t 6 4 ) f o r i i n r a n g e ( 0 , nnp ) : p l i t h [ i ]=( Ly−y [ i ] ) ∗ rho0 ∗ abs ( gy ) Let us start with a somewhat pathological case: even in the absence of the sphere, what happens when no boundary conditions are prescribed on the sides? The answer is simple: think about an aquarium without side walls, or a broken dam. The velocity field indeed shows a complete collapse of the fluid left and right of the bottom. 176 Let us then continue (still with no sphere) but let us now switch on the open boundary conditions. Since the side boundary conditions match the lithostatic pressure we expect no flow at all in the absence of any density perturbation in the system. This is indeed what is recovered: Finally, let us reintroduce the sphere. This time flow is allowed through the left and right side boundaries: Finally, although horizontal velocity Dirichlet boundary conditions and open boundary conditions are not compatible, the same is not true for the vertical component of the velocity: the open b.c. implementation acts on the horizontal velocity dofs only, so that one can fix the vertical component to zero, as is shown hereunder: We indeed see that the in/outflow on the sides is perpendicular to the boundaries. Turning now to the actual implementation, we see that it is quite trivial, since all element edges are vertical, and all have the same vertical dimension hx . Since we use a Q0 approximation for the pressure 177 we need to prescribe a single pressure value in the middle of the element. Finally because of the sign of the normal vector projection onto the x-axis, we obtain: if o p e n b c l e f t and x [ i c o n [ 0 , i e l ]] < e p s : # l e f t s i d e pmid =0 .5∗( p l i t h [ i c o n [ 0 , i e l ] ] + p l i t h [ i c o n [ 3 , i e l ] ] ) f e l [ 0 ] + = 0 . 5 ∗ hy∗pmid f e l [ 6 ] + = 0 . 5 ∗ hy∗pmid i f o p e n b c r i g h t and x [ i c o n [ 1 , i e l ]] > Lx−e p s : # r i g h t s i d e pmid =0 .5∗( p l i t h [ i c o n [ 1 , i e l ] ] + p l i t h [ i c o n [ 2 , i e l ] ] ) f e l [2] −=0.5∗ hy∗pmid f e l [4] −=0.5∗ hy∗pmid These few lines of code are added after the elemental matrices and rhs are built, and before the application of other Dirichlet boundary conditions, and assembly. features • Q1 × P0 element • incompressible flow • mixed formulation • open boundary conditions • isoviscous 178 36 fieldstone 30: conservative velocity interpolation In this the Stokes equations are not solved. It is a 2D implementation of the cvi algorithm as introduced in [139] which deals with the advection of markers. Q1 and Q2 basis functions are used and in both cases the cvi algorithm can be toggled on/off. Markers can be distributed regularly or randomly at startup. Three velocity fields are prescribed on the mesh: • the so-called Couette flow of [139] • the SolCx solution [1] • a flow created by means of a stream line function (see fieldstone 32) 36.1 Couette flow 36.2 SolCx 36.3 Streamline flow 6 2.5 Q1, no cvi, RK1 Q1, cvi, RK1 Q2, no cvi, RK1 Q2, cvi, RK1 Q1, no cvi, RK1, ** 5 Q1, no Q1 , Q1, no Q1, no Q2, no Q2, no 2 nmarker nmarker 4 3 cvi, cvi, cvi, cvi, cvi, cvi, RK2 RK2 RK4 RK5 RK2 RK4 1.5 1 2 0.5 1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0 0 time 0.2 0.4 0.6 time In this case RK order seems to be more important that cvi. Explore why ?! features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions (free-slip) • direct solver • isothermal • non-isoviscous • analytical solution 179 0.8 1 37 fieldstone 31: conservative velocity interpolation 3D 180 38 38.1 fieldstone 32: 2D analytical sol. from stream function Background theory The stream function is a function of coordinates and time of an inviscid liquid. It allows to determine the components of velocity by differentiating the stream function with respect to the space coordinates. A family of curves Ψ = const represent streamlines, i.e. the stream function remains constant along a streamline. Although also valid in 3D, this approach is mostly used in 2D because of its relative simplicity REFERENCES. In two dimensions the velocity is obtained as follows: ∂Ψ ∂Ψ ,− (278) v= ∂y ∂x Provided the function Ψ is a smooth enough function, this automatically insures that the flow is incompressible: ∂u ∂v ∂2Ψ ∂2Ψ ∇·v = + = − =0 (279) ∂x ∂y ∂xy ∂xy Assuming constant viscosity, the Stokes equation writes: − ∇p + µ∆v = ρg (280) Let us introduce the vector W for convenience such that in each dimension: 2 ∂ u ∂2u ∂p +µ + = ρgx Wx = − ∂x ∂x2 ∂xy 2 ∂p ∂ v ∂2v Wy = − +µ + = ρgy ∂y ∂x2 ∂xy (281) (282) Taking the curl of the vector W and only considering the component perpendicular to the xy-plane: ∂Vx ∂ρgy ∂ρgx ∂Vy − = − ∂x ∂y ∂x ∂y (283) The advantage of this approach is that the pressure terms cancel out (the curl of a gradient is always zero), so that: 2 2 ∂ ∂ v ∂2v ∂ u ∂2u ∂ρgx ∂ ∂ρgy µ ( 2+ µ + − (284) − = ∂x ∂x ∂xy ∂y ∂x2 ∂xy ∂x ∂y and then replacing u, v by the their stream function derivatives yields (for a constant viscosity): 4 ∂ Ψ ∂4Ψ ∂ρgx ∂4Ψ ∂ρgy + + 2 = µ − ∂x4 ∂y 4 ∂x2 y 2 ∂x ∂y (285) or, 4 ∇ Ψ= ∂2 ∂2 + ∂x2 ∂y 2 ∂2 ∂2 + ∂x2 ∂y 2 Ψ= ∂ρgy ∂ρgx − ∂x ∂y (286) These equations are also to be found in the geodynamics literature, eee Eq. 1.43 of Tackley book, p 70-71 of Gerya book. 38.2 A simple application I wish to arrive at an analytical formulation for a 2D incompressible flow in the square domain [−1 : 1] × [−1 : 1] The fluid has constant viscosity µ = 1 and is subject to free slip boundary conditions on all sides. For reasons that will become clear in what follows I postulate the following stream function: Ψ(x, y) = sin(mπx) sin(nπy) 181 (287) We have the velocity being defined as: ∂Ψ ∂Ψ v = (u, v) = ,− = (nπ sin(mπx) cos(nπy), −mπ cos(mπx) sin(nπy)) ∂y ∂x (288) The strain rate components are then: ε̇xx = ε̇yy = 2ε̇xy = = = = ∂u = mnπ 2 cos(mπx) cos(nπy) ∂x ∂v = −mnπ 2 cos(mπx) cos(nπy) ∂y ∂u ∂v + ∂y ∂x 2 ∂ Ψ ∂2Ψ − ∂y 2 ∂x2 2 2 −n π Ψ + m2 π 2 Ψ (m2 − n2 )π 2 sin(mπx) sin(nπy) (289) (290) (291) (292) (293) (294) Note that if m = n the last term is identically zero, which is not desirable (flow is too ’simple’) so in what follows we will prefer m 6= n. It is also easy to verify that u = 0 on the sides and v = 0 at the top and bottom and that the term ε̇xy is nul on all four sides, thereby garanteeing free slip. Our choice of stream function yields: ∇4 Ψ = ∂4Ψ ∂4Ψ ∂2Ψ + + 2 2 2 = π 4 (m4 Ψ + n4 Ψ + 2m2 n2 Ψ) = (m4 + n4 + 2m2 n2 )π 4 Ψ 4 4 ∂x ∂y ∂x y We assume gx = 0 and gy = −1 so that we simply have (m4 + n4 + 2m2 n2 )π 4 Ψ = − ∂ρ ∂x (295) so that (assuming the integration constant to be zero): ρ(x, y) = m4 + n4 + 2m2 n2 3 π cos(mπx) sin(nπy) m The x-component of the momentum equation is − ∂p ∂ 2 u ∂ 2 u ∂p + + 2 =− − m2 nπ 3 sin(mπx) cos(nπy) − n3 π 3 sin(mπx) cos(nπy) = 0 2 ∂x ∂x ∂y ∂x so ∂p = −(m2 n + n3 )π 3 sin(mπx) cos(nπy) ∂x and the pressure field is then (once again neglecting the integration constant): p(x, y) = m 2 n + n3 2 π cos(πx) cos(πy) m R Note that in this case pdV = 0 so that volume normalisation of the pressure is turned on (when free slip boundary conditions are prescribed on all sides the pressure is known up to a constant and this undeterminacy can be lifted by adding an additional constraint to the pressure field). 182 Top to bottom: Velocity components u and v, pressure p, density ρ and strain rate ε̇xy . From left to right: (m, n) = (1, 1), (m, n) = (1, 2), (m, n) = (2, 1), (m, n) = (2, 2) 183 100 10 error 1 0.1 velocity pressure x2 x1 0.01 0.001 0.01 0.1 h Errors for velocity and pressure for (m, n) = (1, 1), (1, 2), (2, 1), (2, 2) Velocity arrows for (m, n) = (2, 1) 184 39 fieldstone 33: Convection in an annulus This fieldstone was developed in collaboration with Rens Elbertsen. This is based on the community benchmark for viscoplastic thermal convection in a 2D square box [135] as already carried out in ??. In this experiment the geometry is an annulus of inner radius R1 = 1.22 and outer radius R2 = 2.22. The rheology and buoyancy forces are identical to those of the box experiment. The initial temperature is now given by: R2 − r ∈ [0, 1] T (r, θ) = Tc (r) + A s(1 − s) cos(N0 θ) s= R2 − R1 where s in the normalised depth, A is the amplitude of the perturbation and N0 the number of lobes. In this equation Tc (r) stands for the steady state purely conductive temperature solution which is obtained by solving the Laplace’s equation in polar coordinates (all terms in θ are dropped because of radial symmetry) supplemented with two boundary conditions: ∂T 1 ∂ r =0 T (r = R1 ) = T1 = 1 T (r = R2 ) = T2 = 0 ∆Tc = r ∂r ∂r We obtain Tc (r) = log(r/R2 ) log(R1 /R2 ) Note that this profile differs from the straight line that is used in [135] and in section 34. Examples of initial temperature fields for N0 = 3, 5, 11 Boundary conditions can be either no-slip or free-slip on both inner and outer boundary. However, when free-slip is used on both a velocity null space exists and must be filtered out. In other words, the solver may be able to come up with a solution to the Stokes operator, but that solution plus an arbitrary rotation is also an equally valid solution. This additional velocity field can be problematic since it is used for advecting temperature (and/or compositions) and it also essentially determines the time step value for a chosen mesh size (CFL condition). For these reasons the nullspace must be removed from the obtained solution after every timestep. There are two types of nullspace removal: removing net angular momentum, and removing net rotations. We calculate the following output parameters: • the average temperature < T > R Z T dΩ 1 Ω R = T dΩ hT i = VΩ Ω dΩ Ω (296) • the root mean square velocity vrms as given by equation (27). • the root mean square of the radial and tangential velocity components as given by equations (29) and (30). 185 • the heat transfer through both boundaries Q: Z q · n dΓ Qinner,outer = (297) Γi,o • the Nusselt number at both boundaries N u as given by equations (32) and (33). • the power spectrum of the temperature field: Z P Sn (T ) = Ω features • Q1 × P0 element • incompressible flow • penalty formulation • Dirichlet boundary conditions • non-isothermal • non-isoviscous • annulus geometry 186 2 T (r, θ)einθ dΩ . (298) 40 fieldstone 34: the Cartesian geometry elastic aquarium This fieldstone was developed in collaboration with Lukas van de Wiel. The setup is as follows: a 2D square of elastic material of size L is subjected to the following boundary conditions: free slip on the sides, no slip at the bottom and free at the top. It has a density ρ and is placed is a gravity field g = −gey . For an isotropic elastic medium the stress tensor is given by: σ = λ(∇ · u)1 + 2µε where λ is the Lamé parameter and µ is the shear modulus. The displacement field is u = (0, uy (y)) because of symmetry reasons (we do not expect any of the dynamic quantities to depend on the x coordinate and also expect the horizontal displacement to be exactly zero). The velocity divergence is then ∇ · u = ∂uy /∂y and the strain tensor: ! 0 0 ε= ∂u 0 ∂yy so that the stress tensor is: σ= ∇ · σ = (∂x ∂y ) · λ ∂uy ∂y 0 λ ∂uy ∂y 0 0 ∂u (λ + 2µ) ∂yy ! 0 ∂u (λ + 2µ) ∂yy = ! 0 ∂2u (λ + 2µ) ∂y2y ! = 0 ρg so that the vertical displacement is then given by: uy (y) = 1 ρg y 2 + αy + β 2 λ + 2µ where α and β are two integration constants. We need now to use the two boundary conditions: the first one states that the displacement is zero at the bottom, i.e. uy (y = 0) = 0 which immediately implies β = 0. The second states that the stress at the top is zero (free surface), which implies that ∂uy /∂y(y = L) = 0 which allows us to compute α. Finally: uy (y) = ρg y2 ( − Ly) λ + 2µ 2 The pressure is given by λ + 32 µ 1 + 2µ 2 2 ρg 3λ p = −(λ + µ)∇ · u = (λ + µ) (L − y) = ρg(L − y) = ρg(L − y) 3 3 λ + 2µ λ + 2µ 1 + 2µ/λ In the incompressible limit, the poisson ratio is ν ∼ 0.5. Materials are characterised by a finite Young’s modulus E, which is related to ν and λ: λ= Eν (1 + ν)(1 − 2ν) µ= E 2(1 + ν) It is then clear that for incompressible parameters λ becomes infinite while µ remains finite. In that case the pressure then logically converges to the well known formula: p = ρg(L − y) 187 In what follows we set L = 1000m, ρ = 2800, ν = 0.25, E = 6 · 1010 , g = 9.81. velocity pressure x2 x1 100000000.000000 1000000.000000 error 10000.000000 100.000000 1.000000 0.010000 0.000100 0.000001 0.01 0.1 h 188 41 fieldstone 35: 2D analytical sol. in annulus from stream function We seek an exact solution to the incompressible Stokes equations for an isoviscous, isothermal fluid in an annulus.Given the geometry of the problem, we work in polar coordinates. We denote the orthonormal basis vectors by er and eθ , the inner radius of the annulus by R1 and the outer radius by R2 . Further, we assume that the viscosity µ is constant, which we set to µ = 1 we set the gravity vector to g = −gr er with gr = 1. Given these assumptions, the incompressible Stokes equations in the annulus are [119] 1 ∂vr vr 2 ∂uθ 1 ∂ 2 vr ∂p ∂ 2 vr + − 2− 2 + − ∂r2 r ∂r r2 ∂θ2 r r ∂θ ∂r 1 ∂vθ 2 ∂vr 1 ∂p ∂ 2 vθ 1 ∂ 2 vθ vθ + + 2 Aθ = + 2 − 2− ∂r2 r ∂r r ∂θ2 r ∂θ r r ∂θ 1 ∂(rvr ) 1 ∂vθ + r ∂r r ∂θ Ar = = ρgr (299) = 0 (300) = 0 (301) Equations (299) and (300) are the momentum equations in polar coordinates while Equation (301) is the incompressibility constraint. The components of the velocity are obtained from the stream function as follows: 1 ∂Ψ ∂Ψ vr = vθ = − r ∂θ ∂r where vr is the radial component and vθ is the tangential component of the velocity vector. The stream function is defined for incompressible (divergence-free) flows in 2D (as well as in 3D with axisymmetry). The stream function can be used to plot streamlines, which represent the trajectories of particles in a steady flow. From calculus it is known that the gradient vector ∇Ψ is normal to the curve Ψ = C. It can be shown that everywhere u · ∇Ψ = 0 using the formula for u in terms of Ψ which proves that level curves of Ψ are streamlines: u · ∇Ψ = vr 1 ∂Ψ ∂Ψ ∂Ψ 1 ∂Ψ ∂Ψ 1 ∂Ψ + vθ = − =0 ∂r r ∂θ r ∂θ ∂r ∂r r ∂θ In polar coordinates the curl of a vector A is: 1 ∂(rAθ ) ∂Ar ∇×A= − r ∂r ∂θ Taking the curl of vector A yields: 1 r ∂(rAθ ) ∂Ar − ∂r ∂θ = 1 r − ∂(ρgr ) ∂θ Multiplying on each side by r ∂ρgr ∂(rAθ ) ∂Ar − =− ∂r ∂θ ∂θ If we now replace Ar and Aθ by their expressions as a function of velocity and pressure, we see that the pressure terms cancel out and assuming the viscosity and the gravity vector to be constant we get: Let us assume the following separation of variables Ψ(r, θ) = φ(r)ξ(θ) . Then vr = 1 ∂Ψ φξ 0 = r ∂θ r vθ = − 189 ∂Ψ = −φ0 ξ ∂r Let us first express Ar and Aθ as functions of Ψ and Ar = = = = ∂Ar ∂θ = 1 ∂vr vr 2 ∂uθ ∂ 2 vr 1 ∂ 2 vr + − 2− 2 + ∂r2 r ∂r r2 ∂θ2 r r ∂θ ∂ 2 φξ 0 1 ∂ φξ 0 1 ∂ 2 φξ 0 1 φξ 0 2 ∂ ( ( ( ) + ( ) + ) − ) − 2 (−φ0 ξ) 2 2 2 2 ∂r r r ∂r r r ∂θ r r r r ∂θ φ 0 φ 0 2 φ00 φ0 φ0 φ 000 φξ 0 ( − 2 2 + 2 3 )ξ + ( 2 − 3 )ξ + 3 ξ − 3 + 2 φ0 ξ 0 r r r r r r r r φξ 000 φ00 ξ 0 φ0 ξ 0 + 2 + 3 r r r φξ 0000 φ00 ξ 00 φ0 ξ 00 + 2 + 3 r r r (302) (303) (304) (305) (306) (307) 2 Aθ ∂(rAθ ) ∂r 2 ∂ vθ 1 ∂vθ 2 ∂vr 1 ∂ vθ vθ + + 2 + 2 − 2 ∂r2 r ∂r r ∂θ2 r ∂θ r 2 1 ∂ 2 ∂ φξ 0 ∂2 ∂ 1 1 (−φ0 ξ) + = (−φ0 ξ) + 2 2 (−φ0 ξ) + 2 ( ) − 2 (−φ0 ξ) 2 ∂r r ∂r r ∂θ r ∂θ r r φ00 ξ 2φξ 00 φ0 ξ φ0 ξ 00 000 = −φ ξ − − 2 + 2 + 2 r r r r = = (308) (309) (310) (311) 190 WRONG: ∂(r∆v) ∂r = = = = = ∂∆u ∂θ = = = = ∂ ∂ ∂v 1 ∂2v r + ∂r ∂r ∂r r ∂θ2 ∂2 ∂v ∂ 1 ∂2v r + ∂r2 ∂r ∂r r ∂θ2 ∂2 ∂ ∂Ψ ∂Ψ ∂ 1 ∂2 r (− (− ) + ) ∂r2 ∂r ∂r ∂r r ∂θ2 ∂r 2 2 3 ∂ Ψ ∂ 1 ∂ Ψ ∂ − 2 r 2 − ∂r ∂r ∂r r ∂θ2 ∂r ∂4Ψ 1 ∂3Ψ ∂3Ψ 1 ∂4Ψ −2 3 − r 4 + 2 2 − 2 2 ∂r ∂r r ∂θ 2∂r r ∂θ ∂r ∂ 1 ∂ ∂u 1 ∂ u r + 2 2 ∂θ r ∂r ∂r r ∂θ ∂ 1 ∂ ∂u 1 ∂3u r + 2 3 ∂θ r ∂r ∂r r ∂θ ∂ 1 ∂ ∂ 1 ∂Ψ 1 ∂ 3 1 ∂Ψ r ( ) + 2 3( ) ∂θ r ∂r ∂r r ∂θ r ∂θ r ∂θ 1 ∂3Ψ 1 ∂4Ψ 1 ∂4Ψ 1 ∂2Ψ − 2 + + 3 3 2 2 2 2 r ∂θ r ∂r∂θ r ∂r ∂θ r ∂θ4 (312) (313) (314) (315) (316) (317) (318) (319) (320) Assuming the following separation of variables Ψ(r, θ) = φ(r)ξ(θ) : ∂(r∆v) ∂r ∂∆u ∂θ = = 1 0 00 φξ − r2 1 00 1 1 φξ − 2 φ0 ξ 00 + φ00 ξ 00 + 3 r r r −2φ000 ξ − rφ0000 ξ + 1 00 00 φ ξ r 1 0000 φξ r3 (321) (322) so that ∂(r∆v) ∂∆u 1 1 1 1 1 1 − = −2φ000 ξ − rφ0000 ξ + 2 φ0 ξ 00 − φ00 ξ 00 − 3 φξ 00 + 2 φ0 ξ 00 − φ00 ξ 00 − 3 φξ 0000 ∂r ∂θ r r r r r r Further assuming ξ(θ) = cos(kθ) , then ξ 00 = −k 2 ξ and ξ 0000 = k 4 ξ then ∂(r∆v) ∂∆u 1 1 1 1 1 1 − = −2φ000 ξ − rφ0000 ξ − k 2 2 φ0 ξ + k 2 φ00 ξ + k 2 3 φξ − k 2 2 φ0 ξ + k 2 φ00 ξ − k 4 3 φξ ∂r ∂θ r r r r r r By choosing ρ such that ρ = λ(r)Υ(θ) and such that ∂θ Υ = ξ = cos(kθ) then we have −2φ000 ξ − rφ0000 ξ − k 2 1 0 1 1 1 1 1 1 φ ξ + k 2 φ00 ξ + k 2 3 φξ − k 2 2 φ0 ξ + k 2 φ00 ξ − k 4 3 φξ = − λξgr r2 r r r r r η and then dividing by ξ: (IS THIS OK ?) −2φ000 − rφ0000 − k 2 1 0 1 1 1 1 1 1 φ + k 2 φ00 + k 2 3 φ − k 2 2 φ0 + k 2 φ00 − k 4 3 φ = − λgr 2 r r r r r r η −2φ000 − rφ0000 − 2k 2 1 0 1 1 1 φ + 2k 2 φ00 + (k 2 − k 4 ) 3 φ = − λgr 2 r r r η so η λ(r) = gr Also not forget Υ = 1 k 000 0000 2 1 0 2 1 00 2 4 1 2φ + rφ + 2k 2 φ − 2k φ − (k − k ) 3 φ r r r sin(kθ) 191 41.1 Linking with our paper We have φ(r) 0 φ (r) 00 φ (r) 000 f (r) = 41.2 η0 g0 = −rg(r) (323) 0 = −g(r) − rg (r) = −f (r) (324) 0 (325) 00 = −f (r) φ (r) = −f (r) (326) φ0000 (r) = −f 000 (r) (327) 2f 00 (r) + rf 000 (r) + 2k 2 1 21 0 2 4 1 f (r) − 2k g(r) f (r) + (k − k ) r2 r r2 No slip boundary conditions No-slip boundary conditions inside and outside impose that all components of the velocity must be zero on both boundaries, i.e. v(r = R1 ) = v(r = R2 ) = 0 Due to the separation of variables, and since ξ(θ) = cos(kθ) we have u(r, θ) = 1 ∂Ψ 1 1 = φξ 0 = − φ(r)k sin(kθ) r ∂θ r r v(r, θ) = − ∂Ψ = −φ0 (r)ξ = −φ0 (r) cos(kθ) ∂r It is obvious that the only way to insure no-slip boundary conditions is to have φ(R1 ) = φ(R2 ) = φ0 (R1 ) = φ0 (R2 ) = 0 We could then choose φ(r) 0 φ (r) = = (r − R1 )2 (r − R2 )2 F(r) (328) 2 2 2 2 0 2(r − R1 )(r − R2 ) F(r) + 2(r − R1 ) (r − R2 )F(r) + (r − R1 ) (r − R2 ) F (r) (329) which are indeed identically zero on both boundaries. Here F(r) is any (smooth enough) function of r. We would then have Ψ(r, θ) = (r − R1 )2 (r − R2 )2 F(r) cos(kθ) In what follows we will take F(r) = 1 for simplicity. 192 COMPUTE f from φ and then the pressure. 41.3 Free slip boundary conditions Before postulating the form of φ(r), let us now turn to the boundary conditions that the flow must fulfill, i.e. free-slip on both boundaries. Two conditions must be met: • v · n = 0 (no flow through the boundaries) which yields u(r = R1 ) = 0 and u(r = R2 ) = 0, : 1 ∂Ψ (r = R1 , R2 ) = 0 r ∂θ 193 ∀θ which gives us the first constraint since Ψ(r, θ) = φ(r)ξ(θ): φ(r = R1 ) = φ(r = R2 ) = 0 • (σ · n) × n = 0 (the tangential stress at the boundary is zero) which imposes: σθr = 0, with 1 ∂v v 1 ∂u ∂ ∂Ψ 1 ∂Ψ 1 ∂ 1 ∂Ψ σθr = 2η · − + =η (− ) − (− )+ ( ) 2 ∂r r r ∂θ ∂r ∂r r ∂r r ∂θ r ∂θ Finally Ψ must fulfill (on the boundaries!): − ∂ 2 Ψ 1 ∂Ψ 1 ∂2Ψ + =0 + ∂r2 r ∂r r2 ∂θ2 1 1 −φ00 ξ + φ0 ξ + 2 φξ 00 = 0 r r or, 1 1 −φ00 + φ0 − k 2 2 φ = 0 r r Note that this equation is a so-called Euler Differential Equation17 . Since we are looking for a solution φ such that φ(R1 ) = φ(R2 ) = 0 then the 3rd term of the equation above is by definition zero on the boundaries. We have to ensure the following equality on the boundary: 1 −φ00 + φ0 = 0 r for r = R1 , R2 The solution of this ODE is of the form φ(r) = ar2 + b and it becomes evident that it cannot satisfy φ(r = R1 ) = φ(r = R2 ) = 0. Separation of variables leads to solutions which cannot fulfill the free slip boundary conditions 17 http://mathworld.wolfram.com/EulerDifferentialEquation.html 194 42 fieldstone 36: the annulus geometry elastic aquarium This fieldstone was developed in collaboration with Lukas van de Wiel. The domain is an annulus with inner radius R1 and outer radius R2 . It is filled with a single elastic material characterised by a Young’s modulus E and a Poisson ratio ν, a density ρ0 . The gravity g = −g0 er is pointing towards the center of the domain. The problem at hand is axisymmetric so that the tangential component of the displacement vector vθ is assumed to be zero as well as all terms containing ∂θ . The components of the strain tensor are εrr = εθθ = εrθ = ∂vr ∂r vr 1 ∂vθ vr + = r r ∂θ r 1 ∂vθ vθ 1 ∂vr − + =0 2 ∂r r r ∂θ (330) (331) (332) so that the tensor simply is ε= εrr εrθ εrθ εθθ = ∂vr ∂r 0 0 (333) vr r The pressure is p = −λ∇ · v = −λ 1 ∂(rvr ) r ∂r (334) and finally the stress tensor: σ = −p1 + 2µε = r) r + 2µ ∂v λ 1r ∂(rv ∂r ∂r 0 0 ! r) λ 1r ∂(rv + 2µ vrr ∂r The divergence of the stress tensor is given by [119]: ∂σrr σrr −σθθ θr + 1r ∂σ ∂r + r ∂θ ∇·σ = ∂σrθ σrθ +σθr 1 σθθ ∂r + r ∂θ + r Given the diagonal nature of the stress tensor this simplifies to (also remember that ∂θ = 0): ∂σ σrr −σθθ rr ∂r + r ∇·σ = 0 (335) (336) (337) Focusing on the r-component of the stress divergence: (∇ · σ)r = = = = = σrr − σθθ ∂σrr + ∂r r ∂ 1 ∂(rvr ) ∂vr 1 1 ∂(rvr ) ∂vr 1 ∂(rvr ) vr λ + 2µ + λ + 2µ −λ − 2µ ∂r r ∂r ∂r r r ∂r ∂r r ∂r r ∂ 2 vr 1 ∂(rvr ) 2µ ∂vr 1 ∂(rvr ) 2µvr ∂ 1 ∂(rvr ) + 2µ 2 + λ 2 + −λ 2 − 2 λ ∂r r ∂r ∂r r ∂r r ∂r r ∂r r vr 1 ∂vr ∂ 2 vr ∂ 2 vr 2µ ∂vr 2µvr λ(− 2 + + ) + 2µ 2 + − 2 r r ∂r ∂r2 ∂r r ∂r r ∂ 2 vr 1 ∂vr vr + (2µ + λ) 2 −(2µ + λ) 2 + (2µ + λ) r r ∂r ∂r (338) (339) (340) (341) (342) So the momentum conservation in the r direction is (∇ · σ + ρ0 g)r = −(2µ + λ) vr 1 ∂vr ∂ 2 vr + (2µ + λ) + (2µ + λ) 2 − ρ0 g0 = 0 2 r r ∂r ∂r 195 (343) or, ∂ 2 vr 1 ∂vr ρ0 g0 vr + − 2 = 2 ∂r r ∂r r λ + 2µ (344) We now look at the boundary conditions. On the inner boundary we prescribe vr (r = R1 ) = 0 while free surface boundary conditions are prescribed on the outer boundary, i.e. σ · n = 0 (i.e. there is no force applied on the surface). The general form of the solution can then be obtained: vr (r) = C1 r2 + C2 r + C3 r (345) with C1 = ρ0 g0 3(λ + 2µ) C2 = −C1 R1 − C3 R12 C3 = k1 + k2 (R12 + R22 )(2µ + λ) + (R22 − R12 )λ (346) k2 = λC1 (R12 R23 − R13 R22 ) (347) and k1 = (2µ + λ)C1 (2R12 R23 − R13 R22 ) Pressure can then be computed as follows: 1 1 ∂(rvr ) 2 = −λ (3C1 r + 2C2 r) = −λ(3C1 r + 2C2 ) p = −λ∇ · v = −λ r ∂r r (348) 0 1.2x1011 -20000 1x1011 -40000 radial displacement radial displacement We choose R1 = 2890km, R2 = 6371km, g0 = 9.81ms−2 , ρ0 = 3300, E = 6 · 1010 , ν = 0.49. -60000 -80000 -100000 6x1010 4x1010 2x1010 -120000 -140000 8x1010 3x106 3.5x106 4x106 4.5x106 5x106 5.5x106 0 6x106 3x106 3.5x106 4x106 r 4.5x106 r radial profiles of the displacement and pressure fields displacement and pressure fields in the domain 196 5x106 5.5x106 6x106 10000.000000 velocity pressure x2 x1 100.000000 error 1.000000 0.010000 0.000100 0.000001 0.01 h 197 43 fieldstone 37: marker advection and population control The domain is a unit square. The Stokes equations are not solved, the velocity is prescribed everywhere in the domain as follows: u = −(z − 0.5) (349) v = 0 (350) w = (x − 0.5) (351) At the moment, velocity is computed on the marker itself (rk0 algorithm). When markers are advected outside, they are arbitrarily placed at location (-0.0123,-0.0123). in construction. 198 44 fieldstone 38: Critical Rayleigh number This fieldstone was developed in collaboration with Arie van den Berg. The system is a layer of fluid between y = 0 and y = 1, with boundary conditions T (x, y = 0) = 1 and T (x, y = 1) = 0, characterized by ρ, cp , k, η0 . The Rayleigh number of the system is Ra = ρ0 g0 α∆T h3 η0 κ We have ∆T = 1, h = 1 and choose κ = 1 so that the Rayleigh number simplifies to Ra = ρ0 g0 α/η0 . ~ · σ + ~b = ~0 with ~b = ρ~g . Then the components of the this equation on the The Stokes equation is ∇ x- and y−axis are: ~ · σ)x (∇ ~ · σ)y (∇ = −ρ~g · ~ex = 0 (352) = −ρ~g · ~ey = ρg0 (353) since ~g and ~ey are in opposite directions (~g = −g0~ey , with g0 > 0). The stream function formulation of the incompressible isoviscous Stokes equation is then ∇4 Ψ = g0 ∂ρ η0 ∂x Assuming a linearised density field with regards to temperature ρ(T ) = ρ0 (1 − αT ) we have ∂T ∂ρ = −ρ0 α ∂x ∂x and then ∇4 Ψ = − ρ0 g0 α ∂T ∂T = −Ra g η0 ∂x ∂x (354) For small perturbations of the conductive state T0 (y) = 1 − y we define the temperature perturbation T1 (x, y) such that T (x, y) = T0 (y) + T1 (x, y) The temperature perturbation T1 satisfies the homogeneous boundary conditions T1 (x, y = 0) = 0 and T1 (x, y = 1) = 0. The temperature equation is DT ∂T ∂T0 + T1 ~ ~ ρcp = ρcp + ~ν · ∇T = ρcp + ~ν · ∇(T0 + T1 ) = k∆(T0 + T1 ) Dt ∂t ∂t and can be simplified as follows: ρcp ∂T1 ~ 0 + ~ν · ∇T ∂t = k∆T1 ~ 1 to be second since T0 does not depend on time, ∆T0 = 0 and we assume the nonlinear term ~ν · ∇T order (temperature perturbations and coupled velocity changes are assumed to be small). Using the relationship between velocity and stream function vy = −∂x Ψ we have v · ∇T0 = −vy = ∂x Ψ and since κ = k/ρcp = 1 we get ∂Ψ ∂T1 − κ∆T1 = − (355) ∂t ∂x Looking at these equations, we immediately think about a separation of variables approach to solve these equations. Both equations showcase the Laplace operator ∆, and the eigenfunctions of the biharmonic operator and the Laplace operator are the same. We then pose that Ψ and T1 can be written: Ψ(x, y, t) = AΨ exp(pt) exp(±ikx x) exp(±iky y) = AΨ Eψ (x, y, t) (356) T1 (x, y, t) = AT exp(pt) exp(±ikx x) exp(±iky y) = AT ET (x, y, t) (357) where kx and ky are the horizontal and vertical wave number respectively. Note that we then have ∇2 Ψ = −(kx2 + ky2 )Ψ ∇2 T1 = −(kx2 + ky2 )T1 199 The boundary conditions on T1 , coupled with a choice of a real function for the x dependence yields: ET (x, y, t) = exp(pt) cos(kx x) sin(nπy). from here onwards check for minus signs! The velocity boundary conditions are vy (x, y = 0) = 0 and vy (x, y = 1) = 0 which imposes conditions on ∂Ψ/∂x and we find that we can use the same y dependence as for T1 . Choosing again for a real function for the x dependence yields: EΨ (x, y, t) = exp(pt) sin(kx x) sin(nπz) We then have Ψ(x, y, t) = AΨ exp(pt) sin(kx x) sin(nπz) = AΨ Eψ (x, y, t) (358) T1 (x, y, t) = AT exp(pt) cos(kx x) sin(nπz) = AT ET (x, y, t) (359) In what follows we simplify notations: k = kx . Then the two PDEs become: pT1 + κ(k 2 + n2 π 2 ) − kAΨ exp(pt) cos(kx x) sin(nπz) = kAΨ Eθ (360) −RaAT cos(kx) sin(nπz) + κ(k 2 + n2 π 2 )2 AΨ = −RaAT EΨ + κ(k 2 + n2 π 2 )2 AΨ = 0 (361) These equations must then be verified for all ... which leads to write: p + (k 2 + n2 π 2 ) −k Aθ 0 = −Ra k (k 2 + n2 π 2 )2 AΨ 0 The determinant of such system must be nul otherwise there is only a trivial solution to the problem, i.e. Aθ = 0 and AΨ = 0 which is not helpful. CHECK/REPHRASE D = [p + (k 2 + n2 π 2 )](k 2 + n2 π 2 )2 − Ra k 2 = 0 or, p= Ra k 2 − (k 2 + n2 π 2 )3 (k 2 + n2 π 2 )2 The coefficient p determines the stability of the system: if it is negative, the system is stable and both Ψ and T1 will decay to zero (return to conductive state). If p = 0, then the system is meta-stable, and if p > 0 then the system is unstable and the perturbations will grow. The threshold is then p = 0 and the solution of the above system is 200 45 fieldstone: Gravity: buried sphere Before you proceed further, please read : http://en.wikipedia.org/wiki/Gravity_anomaly http://en.wikipedia.org/wiki/Gravimeter Let us consider a vertical domain Lx × Ly where Lx = 1000km and Ly = 500km. This domain is discretised by means of a grid which counts nnp = nnx × nny nodes. This grid then counts nel = nelx × nely = (nnx − 1) × (nny − 1) cells. The horizontal spacing between nodes is hx and the vertical spacing is hy. Assume that this domain is filled with a rock type which mass density is given by ρmedium = 3000kg/m3 , and that there is a circular inclusion of another rock type (ρsphere = 3200kg/m3 ) at location (xsphere, ysphere) of radius rsphere. The density in the system is then given by ρsphere inside the circle ρ(x, y) = ρmedium outside the circle Let us now assume that we place nsurf gravimeters at the surface of the model. These are placed equidistantly between coordinates x = 0 and coordinates x = Lx. We will use the arrays xsurf and ysurf to store the coordinates of these locations. The spacing between the gravimeters is δx = Lx/(nsurf − 1). At any given point (xi , yi ) in a 2D space, one can show that the gravity anomaly due to the presence of a circular inclusion can be computed as follows: g(xi , yi ) = 2πG(ρsphere − ρ0 )R2 yi − ysphere (xi − xsphere )2 + (yi − ysphere )2 (362) where rsphere is the radius of the inclusion, (xsphere , ysphere ) are the coordinates of the center of the inclusion, and ρ0 is a reference density. However, the general formula to compute the gravity anomaly at a given point (xi , yi ) in space due to a density anomaly of any shape is given by: Z Z ∆ρ(x, y)(y − yi ) g(xi , yi ) = 2G dxdy (363) (x − xi )2 + (y − yi )2 Ω where Ω is the area of the domain on which the integration is to be carried out. Furthermore the density anomaly can be written : ∆ρ(x, y) = ρ(x, y) − ρ0 . We can then carry out the integration for each cell and sum their contributions: nel Z Z X (ρ(x, y) − ρ0 )(y − yi ) g(xi , yi ) = 2G dxdy (364) 2 2 Ωe (x − xi ) + (y − yi ) ic=1 where Ωe is now the area of a single R R cell. Finally, one can assume the density to be constant within each cell so that ρ(x, y) → ρ(ic) and dxdy → hx × hy and then Ωe g(xi , yi ) = 2G nel X (ρ(ic) − ρ0 )(y(ic) − yi ) sx sy (x(ic) − xi )2 + (y(ic) − yi )2 ic=1 (365) We will then use the array gsurf to store the value of the gravity anomaly measured at each gravimeter at the surface. 201 3200 50 3100 0 0.00075 gy 0 50 100 150 3000 0.00050 error(gy) 0.00025 0 200000 400000 0 200000 400000 0.000005 x 600000 800000 1000000 600000 800000 1000000 0.000010 x To go further • explore the effect of the size of the inclusion on the gravity profile. • explore the effect of the ρ0 value. • explore the effect of the grid resolution. • measure the time that is required to compute the gravity. How does this time vary with nsurf ? how does it vary when the grid resolution is doubled ? • Assume now that ρ2 < ρ1 . What does the gravity profile look like ? • what happens when the gravimeters are no more at the surface of the Earth but in a satellite ? • if you feel brave, redo the whole exercise in 3D... 202 46 Projects for guided research/MSc thesis • Darcy flow. redo WAFLE (see http://cedricthieulot.net/wafle.html) • carry out critical Rayleigh experiments for various geometries/aspect ratios. Use Arie’s notes. • Newton solver • Corner flow • elasticity with markers • Indentor/punch with stress b.c. ? • chunk grid • read in crust 1.0 in 2D on chunk • compute gravity based on tetrahedra • compare Q2 with Q2-serendipity • NS a la http://ww2.lacan.upc.edu/huerta/exercises/Incompressible/Incompressible Ex2.htm • produce example of mckenzie slab temperature • write about impose bc on el matrix • constraints • discontinuous galerkin • formatting of code style • navier-stokes ? (LUKAS) use dohu matlab code • nonlinear poiseuille • compositions, marker chain • free-slip bc on annulus and sphere . See for example p540 Gresho and Sani book. • non-linear rheologies (two layer brick spmw16, tosn15) • Picard vs Newton • periodic boundary conditions • free surface • newton method to localise markers • zaleski disk advection • including phase changes (w. R. Myhill) • compute strainrate in middle of element or at quad point for punch? • GEO1442 code • GEO1442 indenter setup in plane ? • in/out flow on sides for lith modelling • Fehlberg RK advection • redo puth17 2 layer experiment 203 https://peterkovesi.com/projects/colourmaps/ velocity: CET-D1A pressure: CET-D1 divv: CET-L1 density: CET-D3 strainrate: CET-R2 Problems to solve: colorscale better yet simple matrix storage ? write Scott about matching compressible2 setup with his paper deal with large matrices. 204 A Three-dimensional applications In the following table I list many papers which showcase high-resolution models of geodynamical processes (subduction, rifting, mantle flow, plume transport, ...). Given the yearly output of our community and the long list of journal in which research can be disseminated, this list can not be exhaustive. Author(s) topic resolution [8] Small-scale sublithospheric convection in the Pacific 448 × 56 × 64 [123] Migration and morphology of subducted slabs in the upper mantle 50 × 50 × 25 [106] Subduction scissor across the South Island of New Zealand 17 × 9 × 9 [92] Influence of a buoyant oceanic plateau on subduction zones 80 × 40 × 80 [28] Subduction dynamics, origin of Andean orogeny and the Bolivian orocline 96 × 96 × 64 [49] Feedback between rifting and diapirism, ultrahigh-pressure rocks exhumation 100 × 64 × 20 [4] Numerical modeling of upper crustal extensional systems 160 × 160 × 12 [5] Rift interaction in brittle-ductile coupled systems 160 × 160 × 23 [103] Kinematic interpretation of the 3D shapes of metamorphic core complexes 67 × 67 × 33 [71] Role of rheology and slab shape on rapid mantle flow: the Alaska slab edge 960 × 648 × 160 [27] Complex mantle flow around heterogeneous subducting oceanic plates 96 × 96 × 64 [20] Oblique rifting and continental break-up 150 × 50 × 30 [14] Influence of mantle plume head on dynamics of a retreating subduction zone 80 × 40 × 80 [19] Rift to break-up evolution of the Gulf of Aden 83 × 83 × 40 [21] Thermo-mechanical impact of plume arrival on continental break-up 100 × 70 × 20 [29] Subduction and slab breakoff controls on Asian indentation tectonics 96 × 96 × 64 [52] Modeling of upper mantle deformation and SKS splitting calculations 96 × 64 × 96 [115] Backarc extension/shortening, slab induced toroidal/poloidal mantle flow 352 × 80 × 64 [89] Sediment transports in the context of oblique subduction modelling 500 × 164 × 100 [150] Crustal growth at active continental margins 404 × 164 × 100 [80] Dynamics of India-Asia collision 257 × 257 × 33 [140] Strain-partitioning in the Himalaya 256 × 256 × 40 [85] Collision of continental corner from 3-D numerical modeling 500 × 340 × 164 [105] Dependence of mid-ocean ridge morphology on spreading rate 196 × 196 × 100 [51] Mid mantle seismic anisotropy around subduction zones 197 × 197 × 53 [64] Oblique rifting of the Equatorial Atlantic 120 × 80 × 20 [96] Dynamics of continental accretion 256 × 96 × 96 [111] Thrust wedges: infl. of decollement strength on transfer zones 309 × 85 × 149 [24] Asymmetric three-dimensional topography over mantle plumes 500 × 500 × 217 [133] modelled crustal systems undergoing orogeny and subjected to surface processes 96 × 32 × 14 [86] Thermo-mechanical modeling ontinental rifting and seafloor spreading 197 × 197 × 197 205 References [1] [2] pTatin3D: High-Performance Methods for Long-Term Lithospheric Dynamics, 2014. [3] M. Albers. A local mesh refinement multigrid method for 3D convection problems with strongly variable viscosity. J. Comp. Phys., 160:126–150, 2000. [4] V. Allken, R. Huismans, and C. Thieulot. Three dimensional numerical modelling of upper crustal extensional systems. J. Geophys. Res., 116:B10409, 2011. [5] V. Allken, R. Huismans, and C. Thieulot. Factors controlling the mode of rift interaction in brittleductile coupled systems: a 3d numerical study. Geochem. Geophys. Geosyst., 13(5):Q05010, 2012. [6] V. Allken, R.S. Huismans, H. Fossen, and C. Thieulot. 3D numerical modelling of graben interaction and linkage: a case study of the Canyonlands grabens, Utah. Basin Research, 25:1–14, 2013. [7] J.D. Anderson. Computational Fluid Dynamics. McGraw-Hill, 1995. [8] M.D. Ballmer, G. Ito, J. van Hunen, and P.J. Tackley. Small-scale sublithospheric convection reconcilies geochemistry and geochronology of ’Superplume’ volcanism in th western and south pacific. Earth Planet. Sci. Lett., 290:224–232, 2010. [9] K.-J. Bathe. Finite Element Procedures in Engineering Analysis. Prentice-Hall, 1982. [10] M. Benzi, G.H. Golub, and J. Liesen. Numerical solution of saddle point problems. Acta Numerica, 14:1–137, 2005. [11] D. Bercovici, G. Schubert, and G.A. Glatzmaier. Three-dimensional convection of an infinite Prandtl-number compressible fluid in a basally heated spherical shell. J. Fluid Mech., 239:683– 719, 1992. [12] M. Bercovier and M. Engelman. A finite-element for the numerical solution of viscous incompressible flows. J. Comp. Phys., 30:181–201, 1979. [13] M. Bercovier and M. Engelman. A finite-element method for incompressible Non-Newtonian flows. J. Comp. Phys., 36:313–326, 1980. [14] P.G. Betts, W.G. Mason, and L. Moresi. The influence of a mantle plume head on the dynamics of a retreating subduction zone. Geology, 40(8):739–742, 2012. [15] B. Blankenbach, F. Busse, U. Christensen, L. Cserepes, D. Gunkel, U. Hansen, H. Harder, G. Jarvis, M. Koch, G. Marquart, D. Moore, P. Olson, H. Schmeling, and T. Schnaubelt. A benchmark comparison for mantle convection codes. Geophys. J. Int., 98:23–38, 1989. [16] P. B. Bochev, C. R. Dohrmann, and M. D. Gunzburger. Stabilization of low-order mixed finite elements for the stokes equations. SIAM J. Numer. Anal., 44(1):82–101, 2006. [17] J. Braun, C. Thieulot, P. Fullsack, M. DeKool, and R.S. Huismans. DOUAR: a new threedimensional creeping flow model for the solution of geological problems. Phys. Earth. Planet. Inter., 171:76–91, 2008. [18] J. Braun and P. Yamato. Structural evolution of a three-dimensional, finite-width crustal wedge. Tectonophysics, 484:181–192, doi:10.1016/j.tecto.2009.08.032, 2009. [19] S. Brune and J. Autin. The rift to break-up evolution of the Gulf of Aden: Insights from 3D numerical lithospheric-scale modelling. Tectonophysics, 607:65–79, 2013. [20] S. Brune, A.A. Popov, and S. Sobolev. Modeling suggests that oblique extension facilitates rifting and continental break-up. J. Geophys. Res., 117(B08402), 2012. [21] S. Brune, A.A. Popov, and S. Sobolev. Quantifying the thermo-mechanical impact of plume arrival on continental break-up. Tectonophysics, 604:51–59, 2013. 206 [22] H.H. Bui, R. Fukugawa, K. Sako, and S. Ohno. Lagrangian meshfree particles method (SPH) for large deformation and failure flows of geomaterial using elasticplastic soil constitutive model. Int. J. Numer. Anal. Geomech., 32(12):1537–1570, 2008. [23] P.S. Bullen. Handbook of Means and Their Inequalities. Springer; 2nd edition, 2003. [24] E. Burov and T. Gerya. Asymmetric three-dimensional topography over mantle plumes. Nature, 513:doi:10.1038/nature13703, 2014. [25] C. Burstedde, G. Stadler, L. Alisic, L.C. Wilcox, E. Tan, M. Gurnis, and O. Ghattas. Large-scale adaptive mantle convection simulation. Geophy. J. Int., 192:889–906, 2013. [26] F.H. Busse, U. Christensen, R. Clever, L. Cserepes, C. Gable, E. Giannandrea, L. Guillou, G. Houseman, H.-C. Nataf, M. Ogawa, M. Parmentier, C. Sotin, and B. Travis. 3D convection at infinite Prandtl number in Cartesian geometry - a benchmark comparison. Geophys. Astrophys. Fluid Dynamics, 75:39–59, 1993. [27] F.A. Capitanio and M. Faccenda. Complex mantle flow around heterogeneous subducting oceanic plates. Earth Planet. Sci. Lett., 353-354:29–37, 2012. [28] F.A. Capitanio, C. Faccenna, S. Zlotnik, and D.R. Stegman. Subduction dynamics and the origin of Andean orogeny and the Bolivian orocline. Nature, 480:doi:10.1038/nature10596, 2011. [29] F.A. Capitanio and A. Replumaz. Subduction and slab breakoff controls on Asian indentation tectonics and Himalayan western syntaxis formation . Geochem. Geophys. Geosyst., 14(9):doi:10.1002/ggge.20171, 2013. [30] J.S. Chen, C. Pan, and T.Y.P. Chang. On the control of pressure oscillation in bilinear-displacement constant-pressure element. Comput. Methods Appl. Mech. Engrg., 128:137–152, 1995. [31] M.V. Chertova, T. Geenen, A. van den Berg, and W. Spakman. Using open sidewalls for modelling self-consistent lithosphere subduction dynamics . Solid Earth, 3:313–326, 2012. [32] Edmund Christiansen and Knud D. Andersen. Computation of collapse states with von mises type yield condition. International Journal for Numerical Methods in Engineering, 46:1185–1202, 1999. [33] Edmund Christiansen and Ole S. Pedersen. Automatic mesh refinement in limit analysis. International Journal for Numerical Methods in Engineering, 50:1331–1346, 2001. [34] M. crouzeix and P.A. Raviart. Conforming and non-conforming finite element methods for solving the stationary Stokes equations. RAIRO, 7:33–76, 1973. [35] C. Cuvelier, A. Segal, and A.A. van Steenhoven. Finite Element Methods and Navier-Stokes Equations. D. Reidel Publishing Company, 1986. [36] M. Dabrowski, M. Krotkiewski, and D.W. Schmid. Milamin: Matlab based finite element solver for large problems. Geochem. Geophys. Geosyst., 9(4):Q04030, doi:10.1029/2007GC001719, 2008. [37] D.R. Davies, C.R. Wilson, and S.C. Kramer. Fluidity: A fully unstructured anisotropic adaptive mesh computational modeling framework for geodynamics. Geochem. Geophys. Geosyst., 12(6), 2011. [38] P. Davy and P. Cobbold. Indentation tectonics in nature and experiment. 1. experiments scaled for gravity. Bulletin of the Geological Institutions of Uppsala, 14:129–141, 1988. [39] J. de Frutos, V. John, and J. Novo. Projection methods for incompressible ow problems with WENO nite difference schemes. J. Comp. Phys., 309:368–386, 2016. [40] Y. Deubelbeiss and B.J.P. Kaus. Comparison of Eulerian and Lagrangian numerical techniques for the Stokes equations in the presence of strongly varying viscosity. Phys. Earth Planet. Interiors, 171:92–111, 2008. 207 [41] C.R. Dohrmann and P.B. Bochev. A stabilized finite element method for the Stokes problem based on polynomial pressure projections. Int. J. Num. Meth. Fluids, 46:183–201, 2004. [42] J. Donea and A. Huerta. Finite Element Methods for Flow Problems. 2003. [43] J. Donea and A. Huerta. Finite Element Methods for Flow Problems. John Wiley & Sons, 2003. [44] Jean Donea and Antonio Huerta. Finite Element Methods for Flow Problems. John Wiley & Sons, 2003. [45] T. Duretz, D.A. May, T.V. Gerya, and P.J. Tackley. Discretization errors and free surface stabilisation in the finite difference and marker-in-cell method for applied geodynamics: A numerical study. Geochem. Geophys. Geosyst., 12(Q07004), 2011. [46] David L. Egholm. A new strategy for discrete element numerical models: 1. Theory. J. Geophys. Res., 112:B05203, doi:10.1029/2006JB004557, 2007. [47] David L. Egholm, Mike Sandiford, Ole R. Clausen, and Søren B. Nielsen. A new strategy for discrete element numerical models: 2. Sandbox applications. J. Geophys. Res., 112:B05204, doi:10.1029/2006JB004558, 2007. [48] R. Eid. Higher order isoparametric finite element solution of Stokes flow . Applied Mathematics and Computation, 162:1083–1101, 2005. [49] S.M. Ellis, T.A. Little, L.M. Wallace, B.R. Hacker, and S.J.H. Buiter. Feedback between rifting and diapirism can exhume ultrahigh-pressure rocks. Earth Planet. Sci. Lett., 311:427–438, 2011. [50] E. Erturk. Discussions on Driven Cavity Flow. Int. J. Num. Meth. Fluids, 60:275–294, 2009. [51] M. Faccenda. Mid mantle seismic anisotropy around subduction zones. Phys. Earth. Planet. Inter., 227:1–19, 2014. [52] M. Faccenda and F.A. Capitanio. Seismic anisotropy around subduction zones: Insights from threedimensional modeling of upper mantle deformation and SKS splitting calculations . Geochem. Geophys. Geosyst., 14(1):doi:10.1029/2012GC004451, 2013. [53] P.J. Frey and P.-L. George. Mesh generation. Hermes Science, 2000. [54] P. Fullsack. An arbitrary Lagrangian-Eulerian formulation for creeping flows and its application in tectonic models. Geophy. J. Int., 120:1–23, 1995. [55] M. Furuichi and D. Nishiura. Robust coupled fluid-particle simulation scheme in Stokes-flow regime: Toward the geodynamic simulation including granular media. Geochem. Geophys. Geosyst., 15:2865–2882, 2014. [56] M. Gerbault, A.N.B. Poliakov, and M. Daignieres. Prediction of faulting from the theories of elasticity and plasticity: what are the limits? Journal of Structural Geology, 20:301–320, 1998. [57] Taras Gerya. Numerical Geodynamic Modelling. Cambridge University Press, 2010. [58] T.V. Gerya, D.A. May, and T. Duretz. An adaptive staggered grid finite difference method for modeling geodynamic Stokes flows with strongly variable viscosity. Geochem. Geophys. Geosyst., 14(4), 2013. [59] G.H. Golub and C.F. van Loan. Matrix Computations, 4th edition. John Hopkins University Press, 2013. [60] P.M. Gresho and R.L. Sani. Incompressible flow and the Finite Element Method, vol II. John Wiley and Sons, Ltd, 2000. [61] D. Griffiths and D. Silvester. Unstable modes of the q1-p0 element. Technical Report 257, University of MAnchester/UMIST, 1994. 208 [62] M. Gunzburger. Finite Element Methods for Viscous Incompressible Flows: A Guide to Theory, Practice and Algorithms. Academic, Boston, 1989. [63] D.L. Hansen. A meshless formulation for geodynamic modeling. 108:doi:10.1029/2003JB002460, 2003. J. Geophys. Res., [64] C. Heine and S. Brune. Oblique rifting of the Equatorial Atlantic: Why there is no Saharan Atlantic Ocean. Geology, 42(3):211–214, 2014. [65] T. Heister, J. Dannberg, R. Gassmöller, and W. Bangerth. High Accuracy Mantle Convection Simulation through Modern Numerical Methods. II: Realistic Models and Problems. Geophy. J. Int., 210(2):833–851, 2017. [66] T.J.R. Hughes. The Finite Element Method. Linear Static and Dynamic Finite Element Analysis. Dover Publications, Inc., 2000. [67] T.J.R. Hughes, W.K. Liu, and A. Brooks. Finite element analysis of incompressible viscous flows by the penalty function formulation. J. Comp. Phys., 30:1–60, 1979. [68] Hoon Huh, Choong Ho Lee, and Wei H. Yang. A general algorithm for plastic flow simulation by finite element limit analysis. International Journal of Solids and Structures, 36:1193–1207, 1999. [69] Alik Ismail-Zadeh and Paul Tackley. Computational Methods for Geodynamics. Cambridge University Press, 2010. [70] J. Ita and S.D. King. Sensitivity of convection with an endothermic phase change to the form of governing equations, initial conditions, boundary conditions, and equation of state. J. Geophys. Res., 99(B8):15,919–15,938, 1994. [71] M.A. Jadamec and M.I. Billen. The role of rheology and slab shape on rapid mantle flow: Threedimensional numerical models of the Alaska slab edge. J. Geophys. Res., 117(B02304), 2012. [72] G.T. Jarvis. Effects of curvature on two-dimensional models of mantle convection: cylindrical polar coordinates. J. Geophys. Res., 98(B3):4477–4485, 1993. [73] C. Jaupart and J.-C. Mareschal. Heat Generation and Transport in the Earth. Cambridge, 2011. [74] L. Jolivet, P. Davy, and P. Cobbold. Right-lateral shear along the Northwest Pacific margin and the India-Eurasia collision. Tectonics, 9(6):1409–1419, 1990. [75] L.M. Kachanov. Fundamentals of the Theory of Plasticity. Dover Publications, Inc., 2004. [76] M. Kimmritz and M. Braack. iDiscretization of the hydrostatic Stokes system by stabilized finite elements of equal order. [77] S. King, C. Lee, P. van Keken, W. Leng, S. Zhong, E. Tan, N. Tosi, and M. Kameyama. A community benchmark for 2D Cartesian compressible convection in the Earths mantle. Geophy. J. Int., 180:7387, 2010. [78] J.R. Koseff and R.L. Street. The Lid-Driven Cavity Flow: A Synthesis of Qualitative and Quantitative Observations. J. Fluids Eng, 106:390–398, 1984. [79] M. Kronbichler, T. Heister, and W. Bangerth. High accuracy mantle convection simulation through modern numerical methods . Geophy. J. Int., 191:12–29, 2012. [80] S.M. Lechmann, S.M. Schmalholz, G. Hetenyi, D.A. May, and B.J.P. Kaus. Quantifying the impact of mechanical layering and underthrusting on the dynamics of the modern India-Asia collisional system with 3-D numerical models. J. Geophys. Res., 119:doi:10.1002/2012JB009748, 2014. [81] R. Lee, P. Gresho, and R. Sani. Smooting techniques for certain primitive variable solutions of the Navier-Stokes equations. . Int. Journal for Numerical Methods in Engineering, 14:1785–1804, 1979. 209 [82] W. Leng and S. Zhong. Viscous heating, adiabatic heating and energetic consistency in compressible mantle convection. Geophy. J. Int., 173:693–702, 2008. [83] W. Leng and S. Zhong. Implementation and application of adaptive mesh refinement for thermochemical mantle convection studies. Geochem. Geophys. Geosyst., 12(4), 2011. [84] J. Li, Y. He, and Z. Chen. Performance of several stabilized finite element methods for the Stokes equations based on the lowest equal-order pairs. Computing, 86:37–51, 2009. [85] Z.-H. Li, Z. Xu, T. Gerya, and J.-P. Burg. Collision of continental corner from 3-D numerical modeling. Earth Planet. Sci. Lett., 380:98–111, 2013. [86] J. Liao and T. Gerya. From continental rifting to seafloor spreading: Insight from 3D thermomechanical modeling. Gondwana Research, 2014. [87] X. Liu and S. Zhong. Analyses of marginal stability, heat transfer and boundary layer properties for thermal convection in a compressible fluid with infinite Prandtl number. Geophy. J. Int., 194:125– 144, 2013. [88] C. Loiselet, J. Braun, L. Husson, C. Le Carlier de Veslud, C. Thieulot, P. Yamato, and D. Grujic. Subducting slabs: Jellyfishes in the Earth’s mantle. Geochem. Geophys. Geosyst., 11(8):doi:10.1029/2010GC003172, 2010. [89] C. Malatesta, T. Gerya, L. Crispini, L. Federico, and G. Capponi. Oblique subduction modelling indicates along-trench tectonic transport of sediments. Nature Communications, 4, 2013. [90] D.S. Malkus and T.J.R. Hughes. Mixed finite element methods - reduced and selective integration techniques: a unification of concepts. Comput. Meth. Appl. Mech. Eng., 15:63–81, 1978. [91] L.E. Malvern. Introduction to the mechanics of a continuous medium. Prentice-Hall, Inc., 1969. [92] W.G. Mason, L. Moresi, P.G. Betts, and M.S. Miller. Three-dimensional numerical models of the influence of a buoyant oceanic plateau on subduction zones. Tectonophysics, 483:71–79, 2010. [93] D.A. May, J. Brown, and L. Le Pourhiet. A scalable, matrix-free multigrid preconditioner for finite element discretizations of heterogeneous Stokes flow. Computer Methods in Applied Mechanics and Engineering, 290:496–523, 2015. [94] A. Mizukami. A mixed finite element method for boundary flux computation. Computer Methods in Applied Mechanics and Engineering, 57:239–243, 1986. [95] P. Molnar and P. Tapponnier. Relation of the tectonics of eastern China to the India-Eurasia collision: Application of the slip-line field theory to large-scale continental tectonics. Geology, 5:212–216, 1977. [96] L. Moresi, P.G. Betts, M.S. Miller, and R.A. Cayley. Dynamics of continental accretion. Nature, 2014. [97] L. Moresi, S. Quenette, V. Lemiale, C. Mériaux, B. Appelbe, and H.-B. Mühlhaus. Computational approaches to studying non-linear dynamics of the crust and mantle. Phys. Earth. Planet. Inter., 163:69–82, 2007. [98] M. Nettesheim, T.A. Ehlers, D.M. Whipp, and A. Koptev. The influence of upper-plate advance and erosion on overriding plate deformation in orogen syntaxes. Solid Earth, 9:1207–1224, 2018. [99] S. Norburn and D. Silvester. Fourier analysis of stabilized Q1-Q1 mixed finite element approximation. SIAM J. Numer. Anal., 39:817–833, 2001. [100] C. O’Neill, L. Moresi, D. Müller, R. Albert, and F. Dufour. Ellipsis 3D: a particle-in-cell finite element hybrid code for modelling mantle convection and lithospheric deformation. Computers and Geosciences, 32:1769–1779, 2006. 210 [101] G. Peltzer and P. Tapponnier. Formation and evolution of strike-slip faults, rifts, and basins during the india-asia collision: an experimental approach. J. Geophys. Res., 93(B12):15085–15177, 1988. [102] A. Pinelli and A. Vacca. Chebyshev collocation method and multidomain decomposition for the incompressible Navier-Stokes equations. International Journal for numerical methods in fluids, 18:781–799, 1994. [103] L. Le Pourhiet, B. Huet, D.A. May, L. Labrousse, and L. Jolivet. Kinematic interpretation of the 3D shapes of metamorphic core complexes. Geochem. Geophys. Geosyst., 13(Q09002), 2012. [104] A.E. Pusok, B.J.P. Kaus, and A.A. Popov. On the Quality of Velocity Interpolation Schemes for Marker-in-Cell Method and Staggered Grids. Pure and Applied Geophysics, pages doi:10.1007/s00024–016–1431–8, 2016. [105] C. Püthe and T. Gerya. Dependence of mid-ocean ridge morphology on spreading rate in numerical 3-D models. Gondwana Research, 25:270–283, 2014. [106] R.N. Pysklywec, S.M. Ellis, and A.R. Gorman. Three-dimensional mantle lithosphere deformation at collisional plate boundaries: A subduction scissor across the South Island of New Zealand. Earth Planet. Sci. Lett., 289:334–346, 2010. [107] T. Rabczuk, P.M.A. Areias, and T. Belytschko. A simplified mesh-free method for shear bands with cohesive surfaces . Int. J. Num. Meth. Eng., 69:993–1021, 2007. [108] J.N. Reddy. On penalty function methods in the finite element analysis of flow problems. Int. J. Num. Meth. Fluids, 2:151–171, 1982. [109] J. Revenaugh and B. Parsons. Dynamic topography and gravity anomalies for fluid layers whose viscosity varies exponentially with depth. Geophysical Journal of the Royal Astronomical Society, 90(2):349–368, 1987. [110] J.G. Rice and R.J. Schnipke. An equal-order velocity-pressure formulation that does not exhibit spurious pressure modes. Computer Methods in Applied Mechanics and Engineering, 58:135–149, 1986. [111] J.B. Ruh, T. Gerya, and J.-P. Burg. High-resolution 3D numerical modeling of thrust wedges: Influence of décollement strength on transfer zones. Geochem. Geophys. Geosyst., 14(4):1131–1155, 2014. [112] Y. Saad. Iterative methods for sparse linear systems. SIAM, 2003. [113] R.L. Sani, P.M. Gresho, R.L. Lee, and D.F. Griffiths. The cause and cure (?) of the spurious pressures generated by certain FEM solutions of the incompressible Navier-Stokes equations: part 1. Int. J. Num. Meth. Fluids, 1:17–43, 1981. [114] R.L. Sani, P.M. Gresho, R.L. Lee, D.F. Griffiths, and M. Engelman. The cause and cure (?) of the spurious pressures generated by certain fem solutions of the incompressible navier-stokes equations: part 2. Int. J. Num. Meth. Fluids, 1:171–204, 1981. [115] W.P. Schellart and L. Moresi. A new driving mechanism for backarc extension and backarc shortening through slab sinking induced toroidal and poloidal mantle flow: Results from dynamic subduction models with an overriding plate. J. Geophys. Res., 118:1–28, 2013. [116] S.M. Schmalholz. A simple analytical solution for slab detachment. Earth Planet. Sci. Lett., 304:45–54, 2011. [117] H. Schmeling, A.Y. Babeyko, A. Enns, C. Faccenna, F. Funiciello, T. Gerya, G.J. Golabek, S. Grigull, B.J.P. Kaus, G. Morra, S.M. Schmalholz, and J. van Hunen. A benchmark comparison of spontaneous subduction models - Towards a free surface. Phys. Earth. Planet. Inter., 171:198–223, 2008. 211 [118] D.W. Schmid and Y.Y. Podlachikov. Analytical solutions for deformable elliptical inclusions in general shear. Geophy. J. Int., 155:269–288, 2003. [119] G. Schubert, D.L. Turcotte, and P. Olson. Mantle Convection in the Earth and Planets. Cambridge University Press, 2001. [120] A. Segal. Finite element methods for the incompressible Navier-Stokes equations. 2012. [121] M. Spiegelman, D.A. May, and C. Wilson. On the solvability of incompressible Stokes with viscoplastic rheologies in geodynamics. Geochem. Geophys. Geosyst., 17:2213–2238, 2016. [122] G. Stadler, M. Gurnis, C. Burstedde, L.C. Wilcox, L. Alisic, and O. Ghattas. The dynamics of plate tectonics and mantle flow: from local to global scales. Science, 329:1033–1038, 2010. [123] D.R. Stegman, W.P. Schellart, and J. Freeman. Competing influences of plate width and far-field boundary conditions on trench migration and morphology of subducted slabs in the upper mantle. Tectonophysics, 483:46–57, 2010. [124] J. Suckale, J.-C. Nave, and B.H. Hager. It takes three to tango: 1. Simulating buoyancy-driven flow in the presence of large viscosity contrasts. J. Geophys. Res., 115(B07409), 2010. [125] P. Tackley. Three-dimensional models of mantle convection: Influence of phase transitions and temperature-dependent viscosity. PhD thesis, California Institute of Technology, 1994. [126] E. Tan and M. Gurnis. Compressible thermochemical convection and application to lower mantle structures. J. Geophys. Res., 112(B06304), 2007. [127] Paul Tapponnier and Peter Molnar. Slip-line field theory and large-scale continental tectonics. Nature, 264:319–324, November 1976. [128] T.E. Tezduyar, S. Mittal, S.E. Ray, and R. Shih. Incompressible flow computations with stabilized bilinear and linear equal-order-interpolation velocity-pressure elements. Comput. Methods Appl. Mech. Engrg., 95:221–242, 1992. [129] M. Thielmann, D.A. May, and B.J.P. Kaus. Discretization errors in the Hybrid Finite Element Particle-In-Cell Method. Pure and Applied Geophysics, 2014. [130] C. Thieulot. FANTOM: two- and three-dimensional numerical modelling of creeping flows for the solution of geological problems. Phys. Earth. Planet. Inter., 188:47–68, 2011. [131] C. Thieulot. GHOST: Geoscientific Hollow Sphere Tesselation. Solid Earth, 9(1–9), 2018. [132] C. Thieulot, P. Fullsack, and J. Braun. Adaptive octree-based finite element analysis of two- and three-dimensional indentation problems. J. Geophys. Res., 113:B12207, 2008. [133] C. Thieulot, P. Steer, and R.S. Huismans. Three-dimensional numerical simulations of crustal systems undergoing orogeny and subjected to surface processes. Geochem. Geophys. Geosyst., 15:doi:10.1002/2014GC005490, 2014. [134] J.F. Thompson, B.K. Soni, and N.P. Weatherill. Handbook of grid generation. CRC press, 1998. [135] N. Tosi, C. Stein, L. Noack, C. Huettig, P. Maierova, H. Samuel, D.R. Davies, C.R. Wilson, S.C. Kramer, C. Thieulot, A. Glerum, M. Fraters, W. Spakman, A. Rozel, and P.J. Tackley. A community benchmark for viscoplastic thermal convection in a 2-D square box. Geochem. Geophys. Geosyst., 16(7):21752196, 2015. [136] R.A. Trompert and U. Hansen. On the Rayleigh number dependence of convection with a strongly temperature-dependent viscosity. Physics of Fluids, 10(2):351–360, 1998. [137] D.L. Turcotte and G. Schubert. Geodynamics, 2nd edition. Cambridge, 2012. [138] P.E. van Keken, S.D. King, H. Schmeling, U.R. Christensen, D. Neumeister, and M.-P. Doin. A comparison of methods for the modeling of thermochemical convection. J. Geophys. Res., 102(B10):22,477–22,495, 1997. 212 [139] H. Wang, R. Agrusta, and J. van Hunen. Advantages of a conservative velocity interpolation (CVI) scheme for particle-in-cell methods with application in geodynamic modeling. Geochem. Geophys. Geosyst., 16:doi:10.1002/2015GC005824, 2015. [140] D.M. Whipp, C. Beaumont, and J. Braun. Feeding the aneurysm: Orogen-parallel mass transport into Nanga Parbat and the western Himalayan syntaxis. J. Geophys. Res., 119:doi:10.1002/2013JB010929, 2014. [141] S.D. Willett. Dynamic and kinematic growth and change of a coulomb wedge. In K.R. McClay, editor, Thrust Tectonics, pages 19–31. Chapman and Hall, 1992. [142] M. Wolstencroft, J.H. Davies, and D.R. Davies. NusseltRayleigh number scaling for spherical shell Earth mantle simulation up to a Rayleigh number of 109 . Phys. Earth. Planet. Inter., 176:132–141, 2009. [143] H. Xing, W. Yu, and J. Zhang. In Advances in Geocomputing, Lecture Notes in Earth Sciences. Springer-Verlag, Berlin Heidelberg, 2009. [144] P. Yamato, L. Husson, J. Braun, C. Loiselet, and C. Thieulot. Influence of surrounding plates on 3D subduction dynamics. Geophys. Res. Lett., 36(L07303):doi:10.1029/2008GL036942, 2009. [145] X. Yu and F. Tin-Loi. A simple mixed finite element for static limit analysis. Computers and Structures, 84:1906–1917, 2006. [146] S. Zhong. Analytic solutions for Stokes flow with lateral variations in viscosity. Geophys. J. Int., 124:18–28, 1996. [147] S. Zhong, M. Gurnis, and G. Hulbert. Accurate determination of surface normal stress in viscous flow from a consistent boundary flux method. Phys. Earth. Planet. Inter., 78:1–8, 1993. [148] S. Zhong, A. McNamara, E. Tan, L. Moresi, and M. Gurnis. A benchmark study on mantle convection in a 3-D spherical shell using CITCOMS. Geochem. Geophys. Geosyst., 9(10), 2008. [149] S.J. Zhong, D.A. Yuen, and L.N. Moresi. Treatise on Geophysics Volume 7 : Mantle Dynamics. Elsevier B.V., 2007. [150] G. Zhu, T.V. Gerya, P.J. Tackley, and E. Kissling. Four-dimensional numerical modeling of crustal growth at active continental margins. J. Geophys. Res., 118:4682–4698, 2013. [151] O. Zienkiewicz and S. Nakazawa. The penalty function method and its application to the numerical solution of boundary value problems. The American Society of Mechanical Engineers, 51, 1982. [152] O.C. Zienkiewicz, M. Huang, and M. Pastor. Localization problems in plasticity using finite elements with adaptive remeshing. International Journal for Numerical and Analytical Methods in Geomechanics, 19:127–148, 1995. [153] O.C. Zienkiewicz, C. Humpheson, and R.W. Lewis. Associated and non-associated visco-plasticity and plasticity in soil mechanics . Géotechnique, 25(4):671–689, 1975. 213 Index P1 , 32, 34 P2 , 32 P3 , 33 Pm × Pn , 22 Pm × P−n , 22 Q1 × P0 , 91, 97, 99, 105, 112, 116, 120, 122, 138, 145, 157, 159, 163, 178, 179 Q1 , 23, 27 Q2 × Q1 , 22, 123, 128 Q2 , 23, 29, 35 Qs2 , 30 Q3 × Q2 , 131 Q3 , 24, 31 Qm × P−n , 22 Qm × Qn , 22 Qm × Q−n , 22 incompressible flow, 99, 105, 112, 116, 120, 122, 128, 131, 134, 138, 157, 159, 163, 178, 179 isoparametric, 80 isothermal, 91, 97, 99, 105, 112, 116, 120, 122, 128, 131, 134, 138, 157, 159, 163, 179 isoviscous, 91, 97, 116, 120, 128, 131, 138, 145, 163, 178 Lamé parameter, 14 Legendre polynomial, 20 method of manufactured solutions, 51 midpoint rule, 19 mixed formulation, 116, 120, 122, 128, 131, 134, 138, 145, 157, 159, 163, 178 MMS, 51 analytical solution, 91, 99, 116, 120, 128, 131, 134, Neumann boundary condition, 16 Newton’s method, 85 138, 145, 163, 179 Newton-Cotes, 20 arithmetic mean, 113 non-conforming element, 22 non-isoviscous, 99, 105, 112, 122, 134, 179 basis functions, 27 nonconforming Q1 × P0 , 134 Boussinesq, 13 nonlinear, 159 bubble function, 22 nonlinear rheology, 105 bulk modulus, 14, 140 numerical benchmark, 157 bulk viscosity, 12 buoyancy-driven flow, 93 open boundary conditions, 178 CBF, 163 particle-in-cell, 112 CG, 70 penalty formulation, 38, 91, 93, 97, 99, 105, 112, checkerboard, 66 179 cohesion, 65 piecewise, 22 Compressed Sparse Column, 58 Poisson ratio, 14 Compressed Sparse Row, 58 preconditioned conjugate gradient, 72 compressibility, 140 pressure normalisation, 124 compressible flow, 145 pressure scaling, 68 conforming element, 22 pressure smoothing, 66, 116, 134, 138, 145, 163 conjugate gradient, 70 connectivity array, 62 quadrature, 20 convex polygon, 61 CSC, 58 rectangle rule, 19 CSR, 58 Rens Elbertsen, 164, 185 Dirichlet boundary condition, 16 divergence free, 36 Drucker-Prager, 65 dynamic viscosity, 12 Gauss quadrature, 20 geometric mean, 113 harmonic mean, 113 hyperbolic PDE, 79 Schur complement, 70 Schur complement approach, 120, 122 second viscosity, 12 shear modulus, 14 SPD, 70 static condensation, 50 Stokes sphere, 93, 122 strain tensor, 14 strong form, 36 structured grid, 61 214 tensor invariant, 64 thermal expansion, 140 trapezoidal rule, 19 unstructured grid, 61 Viscosity Rescaling Method, 65 von Mises, 65 VRM, 65 weak form, 36, 39 work against gravity, 143 Young’s modulus, 14 215 Notes o o o o o o o o o o o o o o o o o o o o o o o o o o finish. not happy with definition. Look at literature . . . . . . . . . derive formula for Earth size R1 and R2 . . . . . . . . . . . . . . . . insert here figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . insert here figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . citation needed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . verify those . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . verify those . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . list codes which use this approach . . . . . . . . . . . . . . . . . . . insert here link(s) to manual and literature . . . . . . . . . . . . . . say something about minus sign? . . . . . . . . . . . . . . . . . . . . other time discr schemes! . . . . . . . . . . . . . . . . . . . . . . . . sort out mess wrt Eq 26 of busa13 . . . . . . . . . . . . . . . . . . . add more examples coming from geo . . . . . . . . . . . . . . . . . . produce drawing of node numbering . . . . . . . . . . . . . . . . . . insert here the rederivation 2.1.1 of spmw16 . . . . . . . . . . . . . . produce figure to explain this . . . . . . . . . . . . . . . . . . . . . . link to proto paper . . . . . . . . . . . . . . . . . . . . . . . . . . . link to least square and nodal derivatives . . . . . . . . . . . . . . . how to compute M for the Schur complement ? . . . . . . . . . . . . to finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . to finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . build S and have python compute its smallest and largest eigenvalues explain how Medge is arrived at! . . . . . . . . . . . . . . . . . . . . compare with ASPECT ??! . . . . . . . . . . . . . . . . . . . . . . . gauss-lobatto integration? . . . . . . . . . . . . . . . . . . . . . . . . pressure average on surface instead of volume ? . . . . . . . . . . . . 216 . . . . . . . . . . . . . . . 17 . . . . . . . . . . . . . . . 18 . . . . . . . . . . . . . . . 19 . . . . . . . . . . . . . . . 19 . . . . . . . . . . . . . . . 29 . . . . . . . . . . . . . . . 31 . . . . . . . . . . . . . . . 34 . . . . . . . . . . . . . . . 38 . . . . . . . . . . . . . . . 41 . . . . . . . . . . . . . . . 44 . . . . . . . . . . . . . . . 49 . . . . . . . . . . . . . . . 54 . . . . . . . . . . . . . . . 61 . . . . . . . . . . . . . . . 63 . . . . . . . . . . . . . . . 65 . . . . . . . . . . . . . . . 67 . . . . . . . . . . . . . . . 67 . . . . . . . . . . . . . . . 67 . . . . . . . . . . . . . . . 73 . . . . . . . . . . . . . . . 89 . . . . . . . . . . . . . . . 89 as a function of resolution?120 . . . . . . . . . . . . . . . 162 . . . . . . . . . . . . . . . 162 . . . . . . . . . . . . . . . 162 . . . . . . . . . . . . . . . 162
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 216 Page Mode : UseOutlines Author : Title : Subject : Creator : LaTeX with hyperref package Producer : pdfTeX-1.40.18 Create Date : 2019:04:08 22:50:25+02:00 Modify Date : 2019:04:08 22:50:25+02:00 Trapped : False PTEX Fullbanner : This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) kpathsea version 6.2.3EXIF Metadata provided by EXIF.tools