In this section we discuss some basic numerical concepts for the solution of partial differential equations used in DuMux.
Newton's method
Nonlinear systems of equations can be solved with Newton's method. Newton's method is quadratically convergent, if the initial solution is close enough to the root of the residual equation. It does however not guarantee global convergence.
The discrete differential equations are formulated in residual form. All terms are on the left hand side and are summed up. The terms contain values for the primary variables which are part of the solution vector . The sum of the terms is called residual which is a function of the solution. For example:
We are looking for the unknown solution and use Newton's method to create a series of that we hope converges to . We start with an initial guess and calculate the initial residual . Next, we calculate the derivative of the residual with respect to the solution. This is the Jacobian matrix
with denoting the Newton iteration step. Each column is the residual derived with respect to the th entry of .
The Jacobian indicates the direction where the residual increases. By solving the linear system
we calculate the direction of maximum growth . We subtract it from our current solution to get a new, better solution .
We repeat the calculation of the Jacobian and the direction of maximum growth until our approximated solution becomes good enough. See Dumux::NewtonSolver for the implementation of the Newton method based solver in DuMux which features various convergence criteria and a simple line search algorithm to improve the update.
Time discretization
In the following, we describe two basic time stepping schemes which are first-order accurate. Our systems of partial differential equations are discretized in space and in time.
Let us consider the general case of a balance equation of the following form
seeking an unknown quantity in terms of storage , flux and source . All available Dumux models can be written mathematically in this form with possibly vector-valued quantities , , and a tensor-valued flux . For the sake of simplicity, we here assume scalar quantities , , and a vector-valued flux .
To discretize the continuous form of the balance equations, we need to choose an approximation for the temporal derivative . While many elaborate methods for this approximation exist, we focus on the simplest one of a first order difference quotient
for approximating the solution at time (forward) or (backward). The question of whether to choose the forward or the backward quotient leads to the explicit and implicit Euler method, respectively. Using the explicit Euler method leads to
whereas the implicit Euler method is described as
Once the solution at time is known, it is straightforward to determine , while attempting to do the same for the equation discreized with the implicit Euler involves the solution of a system of equations. The explicit method is stable only if the time step size is below a certain limit that depends on the specific balance equation, whereas the implicit method is unconditionally stable.