version 3.10-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Basic numerics

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 u. The sum of the terms is called residual r(u) which is a function of the solution. For example:

ϕϱαSαtdiv(ϱαkrαμαK(pαϱαg))qα=:r(u)=0

We are looking for the unknown solution u and use Newton's method to create a series of ui that we hope converges to u. We start with an initial guess u0 and calculate the initial residual r(u0). Next, we calculate the derivative of the residual with respect to the solution. This is the Jacobian matrix

ddur(ui)=Jr(ui)=(ddumir(ui)n)m,n

with i denoting the Newton iteration step. Each column is the residual derived with respect to the mth entry of ui.

The Jacobian indicates the direction where the residual increases. By solving the linear system

Jr(ui)xi=r(ui)

we calculate the direction of maximum growth xi. We subtract it from our current solution to get a new, better solution ui+1=uixi.

We repeat the calculation of the Jacobian Jr(ui) and the direction of maximum growth xi 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

m(u)t+f(u,u)+q(u)=0,

seeking an unknown quantity u in terms of storage m, flux f and source q. All available Dumux models can be written mathematically in this form with possibly vector-valued quantities u, m, q and a tensor-valued flux f. For the sake of simplicity, we here assume scalar quantities u, m, q and a vector-valued flux f.

To discretize the continuous form of the balance equations, we need to choose an approximation for the temporal derivative m(u)/t. While many elaborate methods for this approximation exist, we focus on the simplest one of a first order difference quotient

m(uk/k+1)tm(uk+1)m(uk)Δtk+1

for approximating the solution u at time tk (forward) or tk+1 (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

m(uk+1)m(uk)Δtk+1+f(uk,uk)+q(uk)=0,

whereas the implicit Euler method is described as

m(uk+1)m(uk)Δtk+1+f(uk+1,uk+1)+q(uk+1)=0.

Once the solution uk at time tk is known, it is straightforward to determine m(uk+1), 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 Δtk+1 is below a certain limit that depends on the specific balance equation, whereas the implicit method is unconditionally stable.


🛠 Edit above doc on GitLab