Å.Ødegård » Fully Implicit Methods for Systems of PDEs Fully Implicit Methods for Systems of PDEs 1/19 Outline Overview, Goal Operator splitting based methods Example with problem Overview Fully Implicit method Nonlinear problem Examples Å.Ødegård » Fully Implicit Methods for Systems of PDEs 2/19 Overview and Goal In an earlier talk, Tom discussed implementations for Systems of PDEs solved by splitting-techniques. We focus on Implicit methods for Systems of PDEs. Jacobi or Gauss–Seidel based solution strategies may be either slow or unstable, or both. Main goal: Establish framework for implementation of fully implicit solvers. Retain the flexibility and extensibility of the operator splitting approach. Talk based on chapter submitted to the next Diffpack book. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 3/19 Re-cap: Operator splitting we can formulate two different iterations: such that such that Gauss–Seidel: 1. Compute 2. Compute Jacobi: such that 1. Compute 2. Then compute such that Given Consider systems of differential equations on the form System reduced to solving two scalar equations Å.Ødegård » Fully Implicit Methods for Systems of PDEs 4/19 Splitting is not safe Consider the system: The system may easily be reformulated as: Å.Ødegård » Fully Implicit Methods for Systems of PDEs Analytical solution is: 5/19 Gauss–Seidel on ODE problem The Gauss–Seidel method can be formulated in two ways system (3), depending on in which order for the we solve the equations; either or These methods give the solution curves plotted in the figures on the next slide Å.Ødegård » Fully Implicit Methods for Systems of PDEs 6/19 0.5 0.5 0.5 0.4 0.4 0.4 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 0 0 0 −0.1 −0.1 −0.1 −0.2 −0.2 −0.2 −0.3 −0.3 −0.3 −0.4 −0.4 −0.4 10 20 30 40 50 60 70 (b) 80 90 Solution of system (7), with and . 100 −0.5 0 10 20 30 40 50 60 70 80 90 100 (c) Solution of system (6), with and . 0 −0.5 Solution of system (6), with and . 100 90 (a) 80 70 60 50 40 30 20 10 0 −0.5 The solution of (3) approximated with Gauss–Seidel’s method. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 7/19 Jacobi on the ODE problem 0.1 0.1 0 0 −0.1 −0.1 −0.2 −0.2 −0.3 −0.3 −0.4 −0.4 −0.5 −0.5 0 10 20 30 40 50 60 70 80 90 100 (d) Stabilitycondition fulfilled, and . Å.Ødegård » Fully Implicit Methods for Systems of PDEs 0 10 20 30 40 50 60 (e) condition satisfied, and 70 80 90 100 Stabilitynot . 0.2 0.2 0.3 0.3 0.4 0.4 0.5 0.5 8/19 Fully Implicit solver 0.2 0.1 0.1 0 0 −0.1 −0.1 −0.2 −0.2 −0.3 −0.3 −0.4 −0.4 20 40 50 60 , 70 80 90 100 (f) 30 10 0 −0.5 Å.Ødegård » Fully Implicit Methods for Systems of PDEs −0.5 0 10 20 (g) 30 40 50 60 , 70 80 90 100 0.2 0.3 0.3 0.4 0.4 0.5 0.5 9/19 Lessons learned so far... Simple splitting–techniques may lead to severe difficulties. The order of the equations in Gauss–Seidel may affect the solution. Simple splitting–techniques may converge to the wrong solution. Fully implicit method are more safe. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 10/19 Fully Implicit Implementation Consider the system Å.Ødegård » Fully Implicit Methods for Systems of PDEs and where : and : Finite element form of system (10) written with block matrices: 11/19 Fully Implicit cont... The Gauss–Seidel iteration written with block matrices: The Gauss–Seidel method and the implicit method only differ in how terms are arranged. If we have stand–alone solvers for the sub problems, these can be reused as before. We need to rearrange the terms, by changing the assembling of the linear system. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 12/19 Code Framework . Manager–class derived from SystemFEM have pointer to each sub-solver. which assemble the . Sub-solvers must implement the method. Sub-solvers must derive the base-class. Based on framework for Mixed Methods, Implements a new complete system. Storage for full system. This is not in Diffpack yet. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 13/19 Nonlinear Problems : The Newton–iteration for We use the Newton–Raphson method. and Nonlinear system. Given to non–linear problems: Assume that Diffpack solvers exist. Å.Ødegård » Fully Implicit Methods for Systems of PDEs Consider coupled problem: 14/19 Gauss–Seidel for Nonlinear Problem Gauss–Seidel iteration: The corresponding Newton iterations on the discrete problem: Contain only terms present in the sub-solvers. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 15/19 Fully Implicit solver Apply Newton method to (15) directly: The Jacobi matrices off–diagonal are new. The rest of the terms are present in the Gauss–Seidel solver. This is different from the linear case. Still, the resulting linear system is similar to what we obtain in the linear case. We can implement a fully implicit solver as we have done in the linear case. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 16/19 Examples on on on Pipeflow problem Here, Å.Ødegård » Fully Implicit Methods for Systems of PDEs and 17/19 Pipeflow classes gy1 Ener gy2 Ener um1 ment Mo um2 ment Mo gy3 Ener oss B G−S um3 ent m o M 2 Boss el2 onR m m o C el onR m m o C Å.Ødegård » Fully Implicit Methods for Systems of PDEs 18/19 Pipeflow cont. and implement and as well as some book-keeping functions. pow.law exponent: redefine functions which use the FiniteElement, since we are using the Mixed framework. iter. time iter. time Fully Implicit 4 4342.7s 3 3487.6s Gauss–Seidel 3 7747.8s 3 5995.8s Performance comparison. is Newton iterations in the fully implicit case and outer iterations in the Gauss–Seidel case. Å.Ødegård » Fully Implicit Methods for Systems of PDEs 19/19