opm-simulators/doc/handbook/newton-in-a-nutshell.tex
Andreas Lauser 5d6f6916d7 make the handbook compile on modern LaTeX distributions
TeXLive 2016 complains about \it and \bf.

Also, this patch adds a simple bash script to create the handbook from
its LaTeX sources. Note that this script does *not* attempt to detect
if all prerequisites (in terms of binaries and LaTeX packages) are
properly available.
2017-01-14 15:40:51 +01:00

75 lines
2.8 KiB
TeX

\chapter{The Newton-Raphson method}
For the isothermal immiscible multi-phase model, the following mass
conservation equation needs to be solved:
\begin{align}
\underbrace{
\frac{\partial \phi \varrho_\alpha S_\alpha}{\partial t}
-
\text{div} \left\{
\varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\textbf{K}} \left(\text{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\textbf{g}} \right)
\right\} - q_\alpha} _
{\textbf{f}(\textbf{u})}
= 0 \; .
\end{align}
Because of the nonlinear dependencies even solving this comparatively
simple equation is a quite challenging task. However, for
finding roots of non-linear systems equations the
\textsc{Newton}-\textsc{Raphson} method can be used.
When using a fully-implicit numerical model, each time step essentially
consists of the application of the \textsc{Newton} algorithm to solve
the nonlinear system.
The idea of this algorithm is to linearize the non-linear system of
equation at a given solution, and then solving the resulting linear
system of equations. The hope is, that the solution of this linear
system is closer to the root of the non-linear system of
equations. This process is repeated until either convergence is
reached (a pre-determined accuracy is reached), or divergence of the
algorithm is detected (either by trespassing the maximum number of
iterations or by failure to linearize). This method can be formalized
as follows:
\begin{subequations}
\begin{align}
\label{NewtonGen}
\textbf{u}^{r+1} &= \textbf{u}^r + \Delta \textbf{u}^r \\
\Delta \textbf{u}^r & = - \left\{\text{grad}\,\textbf{f} (\textbf{u}^r) \right\}^{-1} \textbf{f}(\textbf{u}^r) \\
\end{align}
\end{subequations}
\noindent with
\begin{itemize}
\item $\textbf{u}$: Vector of unknowns
\item $\textbf{f}(\textbf{u}^r)$: Residual (Function of the vector of unknowns which ought to be set to $0$)
\item $\phantom{a}^r$: last iteration, $\phantom{a}^{r+1}$: current iteration,
\item $\text{grad}\,\phantom{a}$: \textsc{Jacobian} matrix of
$\textbf{f}$, i.e. matrix of the derivatives of \textbf{f} regarding
all components of $\textbf{u}$
\end{itemize}
The value of $\textbf{u}$ for which $\textbf{f}$ becomes zero is
searched for. Bringing \eqref{NewtonGen} into the form used the linear
solvers
\begin{equation}
\label{GenSysEq}
\textbf{A}\textbf{x} - \textbf{b} = 0
\end{equation}
leads to
\begin{itemize}
\item $\textbf{A} = \text{grad}\,\textbf{f} (\textbf{u}^r)$
\item $\textbf{x} = \textbf{u}^{r} - \textbf{u}^{r+1}$
\item $\textbf{b} = \textbf{f}(\textbf{u}^{r})$
\end{itemize}
Once $\textbf{u}^{r} - \textbf{u}^{r+1}$ has been calculated, \eWoms
updates the current solution in \texttt{NewtonController::update()}
and starts the next iteration if the scheme has not yet converged.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "ewoms-handbook"
%%% End: