diff --git a/doc/handbook/0_discussion.tex b/doc/handbook/0_discussion.tex new file mode 100644 index 0000000000000000000000000000000000000000..e457ed92b224311c66cf37f1712c9601aa94c2d7 --- /dev/null +++ b/doc/handbook/0_discussion.tex @@ -0,0 +1,118 @@ +\chapter{Discussion about the new handbook} + +BITTE: Fur svn ist es schrecklich eine lange Code-Zeile zu haben, bitte fugt +manuelle Zeilenumbruche hinzu +\todo[inline]{Ihr konnt die todo Befehle benutzen um Dinge zu markieren, die euch + auffallen, dann können wir die beim nachsten Mal besprechen} +\todo[inline]{Bitte schaut mal ob die grobe Kapitelstrukutur stimmt, durch das + umziehen der Dateien, kann sein, das ich etwas beim andern der chapter, sections, etc + vergessen habe. Kann sein, das es dadurch auch etwas unübersichtlich wurde, da + subsubsection zu paragraphs wurden. Wir sollten vllt die Kapitel aufteilen und + dann jeder eines durchgehen.} +\section{Beschlossene ToDos} +\begin{itemize} + \item Umstrukturierung (Thomas) + \item \Dumux aus den Uberschriften in Kap 5 rausnehmen + \item Modelle raus, Liste rein (Christoph) + \item Neues Gitterkapitel (Natalie) + \item Wiki (behandla, Mailing list (LH2), external Modules, lectures, tests + (Vishal), Infos fur neue Doktoranden (Christoph) + \item Hinweis auf tests, lecture und feature list am Ende von Tutorial + \item Doxygen main page - feature list und parameter list + \item Newton etwas ausfuhrlicher und Dumux spezifischer, schematische + Skizze der Matrix (Christoph) +\end{itemize} + +\section{Weitere ToDos} +\begin{itemize} + \item Wenn wir einen guten Weg zum Rechtschreibung prüfen finden, ware das sicher + auch gut. + \item Reihenfolge der Unterkapitel + \item Name fur Kapitel 4 und 5 + \item man sieht kaum einen Unterschied zwischen subsubsection und paragraphs s.u. + \item wir haben listtings für bash code (ist OK), für c++ und dumux code (sollten + wir schauen wo was benutzt wird und den dumux code entfernen, außerdem wären + Farben ganz nett), dazu könnten wir dann noch ein dumuxInputFile listing + mit anderer Farbgebung (da andere Kommentare) erstellen +\end{itemize} + +\subsubsection{subsubsection} +tafsasf mskmf safijsafaSF SAKFMAÖLSFMLDSF + +\paragraph{paragraph} +tafsasf mskmf safijsafaSF SAKFMAÖLSFMLDSF + +\section{Open Questions} +\begin{itemize} + \item Was kann ins Wiki ausgelagert werden? + \item Was kann ins doxygen ausgelagert werden? + \item Alles was (nicht?) LH2 spezifische raus? + \item Fur listOfProperties und listOfFeatures auf doxygen verweisen! (kommt + unter doxygen main pages) + \item Modelbeschreibungen rausschmeißen? + \item bennenung der ausgelagerten tex dateien mit kapitelnummer (nur eine nummer) + beginnend + \item Neue Kapitel/Abschnitte + \begin{itemize} + \item Wie kann ich Gitter erstellen (externe tools), /einlesen (dune), wo + kann ich bei dune nachschauen. Welche Dateien werden uberhaupt unterstutzt? + in Kap 5 (jemanden finden, der sich auskennt Alex, Timo, Bernd) + \end{itemize} + \item Tutorials: + \begin{itemize} + \item Noch aktuell, noch funktioniert? + \item Welche Features, Modelle brauchten auch ein Tutorial? Wie konnen wir + den Einstieg leicht machen und fur uns den Aufwand gering halten? + \item Verweis auf lecture fur realistischere Anwendungen + \end{itemize} +\end{itemize} + +\section{Other} +\subsection{How to move things to stable} +\begin{itemize} + \item mandatory checks + \begin{itemize} + \item remove all warnings (compile e.g. with the pedantic option) + \item are all units given? + \item are all references .g. for model constant, fluids ... given? + \item no tabulators? + \item no trailing whitespaces? + \item is the gnu license still up to date? + \item valgrind? + \item run make headercheck + \end{itemize} + \item optional checks + \begin{itemize} + \item check whether the todos are necessary + \item which lines of code may lead to confusion -> comment them? + \item are the comments necessary and helpful? + \item check and implement the naming conventions from dumux-devel/doc/naminglist + \item are the svn ignore properties set correctly? + \end{itemize} + \item doxygen (mandatory) + \begin{itemize} + \item fill all please doc me placeholders + \item are all public function commented? (minimum level: brief documentation and + explanation of the function parameters) + \item compile doxygen + \end{itemize} + \item for new models + \begin{itemize} + \item no preprocessor macros on the model level + \item integrate the model description into the handbook + \item add a new section in doxygen via the modules.txt + \item check that all equations appear correctly in doxygen + \item check that all class definition are listed, are they also listed in + other groups, where they may be necessary (e.g. fluxvariables) + \item add suitable test problem(s) that tests the main features + \end{itemize} + \item for new problems + \begin{itemize} + \item add a descriptive problem description (e.g. size, BC, what can you see, + where is the example taken from) + \item add reference solution and include in automatic testing + \item are the input files cleaned up (no unnecessary parameters, are the units given, + no unnecessary comments, ...) maybe compare to already existing input files + \item can you see the main features if you run the reference problem + \end{itemize} +\end{itemize} \ No newline at end of file diff --git a/doc/handbook/dumux-handbook.tex b/doc/handbook/0_dumux-handbook.tex similarity index 75% rename from doc/handbook/dumux-handbook.tex rename to doc/handbook/0_dumux-handbook.tex index c34e1deba7810e1aa299edf3677a3f801504b4ab..041feb5da1e656e10d8d5423db4db695f99ef233 100644 --- a/doc/handbook/dumux-handbook.tex +++ b/doc/handbook/0_dumux-handbook.tex @@ -1,56 +1,60 @@ \documentclass[11pt,a4paper,headinclude,footinclude,DIV16]{scrreprt} -\usepackage[automark]{scrpage2} -\usepackage[ansinew]{inputenc} \usepackage[english]{babel} +\usepackage[htt]{hyphenat} +\usepackage[ansinew]{inputenc} +\usepackage[automark]{scrpage2} +\usepackage[normalem]{ulem} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{booktabs} -\usepackage{theorem} -\usepackage[usenames,dvipsnames]{xcolor} -\usepackage{listings} -\usepackage{makeidx} +\usepackage{breakurl} +\usepackage{enumerate} +\usepackage{hyperref} \usepackage{graphicx} -\usepackage{xspace} -\usepackage[htt]{hyphenat} +\usepackage{layout} +\usepackage{listings} \usepackage{lscape} -\usepackage{enumerate} -\usepackage{subfig} -\usepackage{units} -\usepackage[hyphens]{url} -\usepackage{tikz} +\usepackage{makeidx} \usepackage{pdflscape} -\usepackage{textcomp} \usepackage{rotating} -\usetikzlibrary{arrows,backgrounds,decorations.pathmorphing,patterns,positioning,fit,shapes} -\usepackage[normalem]{ulem} +\usepackage{subfig} \usepackage{tabularx} +\usepackage{textcomp} +\usepackage{theorem} +\usepackage{tikz} +\usepackage[colorinlistoftodos]{todonotes} +\usepackage{units} +\usepackage{url} +\usepackage{xcolor} +\usepackage{xspace} + + \newcommand{\snakeline}{% % {\uwave{\makebox[\linewidth]{\mbox{}}}} \uwave{\mbox{}} } -\usepackage{layout} - -\usepackage{hyperref} -\hypersetup{bookmarksdepth=2} - -\DeclareGraphicsExtensions{.pdf, .jpg} -% Dune logo -\newcommand{\Dune}{{DUNE}\xspace} -% DuMuX macro -\newcommand{\Dumux}{\texorpdfstring{Du\-Mu$^\text{x}$\xspace}{DuMuX\xspace}} -\newcommand{\DumuxVersion}{2.7} -% DuMuX logo colors -\definecolor{dumuxYellow}{HTML}{E19417} -\definecolor{dumuxBlue}{HTML}{0C73CF} -% beautify C++ -\DeclareRobustCommand\Cplusplus{\texorpdfstring{C\nolinebreak[4]\hspace{-.05em}\raisebox{.4ex}{\tiny\bf ++}\xspace}{C++}} +\hypersetup{bookmarksdepth=3} +\usetikzlibrary{arrows,backgrounds,decorations.pathmorphing,patterns,positioning,fit,shapes} -% for listings of C++ code +% for listing of c++ code \lstset{language=C++, basicstyle=\ttfamily, - keywordstyle=\color{black}\bfseries, tabsize=4, stringstyle=\ttfamily, - commentstyle=\it, extendedchars=true, escapeinside={/*@}{@*/}} +% keywordstyle=\color{black}\bfseries, + tabsize=4, stringstyle=\ttfamily, +% commentstyle=\it, + extendedchars=true, escapeinside={/*@}{@*/}, +% keywordstyle=\color[rgb]{0,0,1}, +% commentstyle=\color[rgb]{0.026,0.112,0.095}, +% stringstyle=\color[rgb]{0.627,0.126,0.941}, + numberstyle=\color{cyan}, + basicstyle=\ttfamily, + keywordstyle=\color{blue}\ttfamily, + stringstyle=\color{red}\ttfamily, + commentstyle=\color{green}\ttfamily\it, + morecomment=[l][\color{magenta}]{\#} +} + % for listings of bash code in install.tex \lstdefinestyle{Bash} {language=Bash, @@ -68,6 +72,7 @@ aboveskip=\bigskipamount, belowskip=\bigskipamount } + % for listings of DuMuX code \lstdefinestyle{DumuxCode} {language=C++, @@ -75,15 +80,26 @@ numbers=left, numberstyle=\tiny, numbersep=5pt, - breaklines=true, - keywordstyle=\color{dumuxBlue}, - stringstyle=\color{Red}, - commentstyle=\color{Gray}, - morecomment=[l][\color{OliveGreen}]{\#} + breaklines=true } -\lstset{showstringspaces=false, - breaklines=true} +\lstset{showstringspaces=false, breaklines=true} + + +\DeclareGraphicsExtensions{.pdf, .jpg} + +% Dune logo +\newcommand{\Dune}{{DUNE}\xspace} +% DuMuX logo +\newcommand{\Dumux}{\texorpdfstring{Du\-Mu$^\text{x}$\xspace}{DuMuX\xspace}} +\newcommand{\DumuxVersion}{2.8} +% DuMuX logo colors +\definecolor{dumuxYellow}{HTML}{E19417} +\definecolor{dumuxBlue}{HTML}{0C73CF} +% beautify C++ +\DeclareRobustCommand\Cplusplus{\texorpdfstring{C\nolinebreak[4]\hspace{-.05em}\raisebox{.4ex}{\tiny\bf ++}\xspace}{C++}} +% for dumux flow of things +\newcommand{\nextline}{\par\phantom{a}\vspace*{0.1\textwidth}} \newcommand{\porosity}{\phi} \newcommand{\saturation}{S} @@ -161,21 +177,21 @@ Universit\"at Stuttgart, Paffenwaldring 61, D-70569 Stuttgart, Germany}\\ \maketitle -\setcounter{tocdepth}{1} -\pdfbookmark[0]{Table of Contents}{Table of Contents} +\setcounter{tocdepth}{2} +% \pdfbookmark[0]{Table of Contents}{Table of Contents} \tableofcontents -\input{intro} -\input{getting-started} -\input{tutorial} -\input{structure} -\input{propertysystem} -\input{fluidframework} -\input{models} -\input{DumuxFlow} -\input{NewtonInANutshell} -\input{TipsNTricks} -\input{install} +\newpage +\pdfbookmark[1]{List of ToDos}{List of ToDos} +% \makeatletter\let\chapter\@undefined\makeatother +\listoftodos + +\input{0_discussion} +\input{1_introduction} +\input{2_gettingstarted} +\input{3_tutorial} +\input{4_dumuxoverview} +\input{5_workingwithdumux} \bibliographystyle{plain} diff --git a/doc/handbook/intro.tex b/doc/handbook/1_introduction.tex similarity index 92% rename from doc/handbook/intro.tex rename to doc/handbook/1_introduction.tex index 0b1a175866f418a2e46de4341d81d42450a2aba5..9025f13a2b55927f35d496ee17e6f18a0feb808f 100644 --- a/doc/handbook/intro.tex +++ b/doc/handbook/1_introduction.tex @@ -26,7 +26,7 @@ achieve minimal overhead when accessing the underlying grid libraries\footnote{In fact, the performance penalty resulting from the use of \Dune's grid interface is usually negligible~\cite{BURRI2006}.}. \begin{figure}[hbt] - \centering + \centering \includegraphics[width=.5\linewidth, keepaspectratio]{PNG/dunedesign.png} \caption{ \label{fig:dune-design} @@ -63,13 +63,13 @@ finite element shape functions, while \texttt{dune-istl} is the and provides generic, highly optimized linear algebra routines for solving the generated systems. -\Dumux comes in form of an additional module \texttt{dumux}. -It depends on the \Dune core modules -\texttt{dune-common}, \texttt{dune-grid}, \texttt{dune-istl}, and on \texttt{dune-localfunctions}. -The main intention of \Dumux is to provide a framework for an easy and efficient -implementation of new physical models for porous media flow problems, -ranging from problem formulation and the selection of -spatial and temporal discretization schemes as well as nonlinear solvers, -to general concepts for model coupling. -Moreover, \Dumux includes ready to use numerical models and a few example applications. +\Dumux comes in form of an additional module \texttt{dumux}. +It depends on the \Dune core modules +\texttt{dune-common}, \texttt{dune-grid}, \texttt{dune-istl}, and on \texttt{dune-localfunctions}. +The main intention of \Dumux is to provide a framework for an easy and efficient +implementation of new physical models for porous media flow problems, +ranging from problem formulation and the selection of +spatial and temporal discretization schemes as well as nonlinear solvers, +to general concepts for model coupling. +Moreover, \Dumux includes ready to use numerical models and a few example applications. diff --git a/doc/handbook/install.tex b/doc/handbook/2_detailedinstall.tex similarity index 85% rename from doc/handbook/install.tex rename to doc/handbook/2_detailedinstall.tex index 6e3090c5acd824045992356b4aa0fee11a30ba88..07a36b9d4ab6368e19234167594dca4829acfe3f 100644 --- a/doc/handbook/install.tex +++ b/doc/handbook/2_detailedinstall.tex @@ -1,34 +1,47 @@ -\chapter{Detailed Installation Instructions} \label{install} - -In this section about the installation of \Dumux it is assumed that you work with a Linux or Apple OS X operating system -and that you are familiar with the use of a command line shell. Installation means that you unpack \Dune together with \Dumux in a certain directory. -Then, you compile it in that directory tree in which you do the further work, too. You also should know how to install new software packages -or you should have a person on hand who can give you assistance with that. In section \ref{sec:prerequisites} we list some prerequisites for running \Dune and \Dumux. -Please check in said paragraph whether you can fulfill them. In addition, section \ref{sec:external-modules-libraries} provides some details on optional libraries and modules. - -In a technical sense \Dumux is a module of \Dune. -Thus, the installation procedure of \Dumux is the same as that of \Dune. -Details regarding the installation of \Dune are provided on the \Dune website \cite{DUNE-INST}. +\section{Detailed Installation Instructions} +\label{install} +\todo[inline]{Dieses Unterkapitel könnte auch kürzer sein} + +In this section about the installation of \Dumux it is assumed that you work with +a Linux or Apple OS X operating system +and that you are familiar with the use of a command line shell. Installation means +that you unpack \Dune together with \Dumux in a certain directory. +Then, you compile it in that directory tree in which you do the further work, too. +You also should know how to install new software packages +or you should have a person on hand who can give you assistance with that. In +section \ref{sec:prerequisites} we list some prerequisites for running \Dune and \Dumux. +Please check in said paragraph whether you can fulfill them. In addition, section +\ref{sec:external-modules-libraries} provides some details on optional libraries and modules. + +In a technical sense \Dumux is a module of \Dune. +Thus, the installation procedure of \Dumux is the same as that of \Dune. +Details regarding the installation of \Dune are provided on the \Dune website \cite{DUNE-INST}. If you are interested in more details about the build system that is used, they can be found in the {\Dune} Buildsystem Howto \cite{DUNE-BS}. -All \Dune modules, including \Dumux, get extracted into a common directory, as it is done in an ordinary \Dune installation. -We refer to that directory abstractly as {\Dune} root directory or, in short, as {\Dune}-Root. -If it is used as directory's path of a shell command it is typed as \texttt{\Dune-Root}. +All \Dune modules, including \Dumux, get extracted into a common directory, as it +is done in an ordinary \Dune installation. +We refer to that directory abstractly as {\Dune} root directory or, in short, as {\Dune}-Root. +If it is used as directory's path of a shell command it is typed as \texttt{\Dune-Root}. For the real {\Dune} root directory on your file system any valid directory name can be chosen. -Source code files for each \Dune module are contained in their own subdirectory within {\Dune}-Root. -We name this directory of a certain module \emph{module root directory} or \texttt{module-root-directory} if it is a directory path, -e.\,g. for the module \texttt{dumux} these names are \emph{dumux root directory} respective \texttt{dumux-root-directory}. -The real directory names for the modules can be chosen arbitrarily. In this manual they are the same as the +Source code files for each \Dune module are contained in their own subdirectory +within {\Dune}-Root. +We name this directory of a certain module \emph{module root directory} or +\texttt{module-root-directory} if it is a directory path, +e.\,g. for the module \texttt{dumux} these names are \emph{dumux root directory} +respective \texttt{dumux-root-directory}. +The real directory names for the modules can be chosen arbitrarily. In this manual +they are the same as the module name or the module name extended by a version number suffix. -The name of each \Dune module is defined in the file \texttt{dune.module}, which is in the root +The name of each \Dune module is defined in the file \texttt{dune.module}, which is +in the root directory of the respective module. This should not be changed by the user. After extracting the source code for all relevant \Dune modules, including \Dumux, \Dune has to be built by the shell-command \texttt{dunecontrol} which is part of the \Dune build system. -\section{Prerequisites} \label{sec:prerequisites} +\subsection{Prerequisites} \label{sec:prerequisites} The GNU tool chain of \texttt{g++} and the tools of the GNU build system \cite{GNU-BS}, also known as GNU autotools (\texttt{autoconf}, \texttt{automake}, \texttt{autogen}, \texttt{libtool}), as well as \texttt{make} must be available in a recent version. For a list of prerequisite software packages to install,see @@ -36,17 +49,17 @@ must be available in a recent version. For a list of prerequisite software packa The building of included documentation like this handbook requires \LaTeX{} and auxiliary tools \texttt{bibtex}. One usually chooses a \LaTeX{} distribution like \texttt{texlive} for this purpose. -It is possible to switch off the building of the documentation by setting the switch \texttt{--disable-documentation} +It is possible to switch off the building of the documentation by setting the switch \texttt{--disable-documentation} in the \texttt{CONFIGURE\_FLAGS} of the building options, see Chapter \ref{buildIt}. Additional parts of documentation are contained within the source code files as special formatted comments. Extracting them can be done using \texttt{doxygen}, cf. Section \ref{sec:build-doxy-doc}. -Depending on whether you are going to use external libraries and modules for additional \Dune features, +Depending on whether you are going to use external libraries and modules for additional \Dune features, additional software packages may be required. Some hints on that are given in Section \ref{sec:external-modules-libraries}. Subversion (SVN) and a Git clients must be installed to download modules from Subversion and Git repositories. -\section{Obtaining Source Code for \Dune and \Dumux} +\subsection{Obtaining Source Code for \Dune and \Dumux} As stated above, the \Dumux release and trunk (developer tree) are based on the most recent \Dune release 2.3, comprising the core modules dune-common, dune-geometry, dune-grid, dune-istl and dune-localfunctions. For working with \Dumux, these modules are required. The @@ -55,30 +68,35 @@ external module dune-PDELab is recommended and required for several \Dumux featu Two possibilities exist to get the source code of \Dune and \Dumux. Firstly, \Dune and \Dumux can be downloaded as tar files from the respective \Dune and \Dumux website. They have to be extracted as described in the next paragraph. -Secondly, a method to obtain the most recent source code (or, more generally, any of its previous revisions) by direct access -to the software repositories of the revision control system is described in the subsequent part. +Secondly, a method to obtain the most recent source code (or, more generally, any of its previous revisions) by direct access +to the software repositories of the revision control system is described in the subsequent part. However, if a user does not want to use the most recent version, -certain version tags or branches (i.\,e. special names) are means +certain version tags or branches (i.\,e. special names) are means of the software revision control system to provide access to different versions of the software. -\subsubsection{Obtaining the software by installing tar files} -The slightly old-fashionedly named tape-archive-file, shortly named tar file or tarball, is a common file format for distributing collections of files contained within these archives. -The extraction from the tar files is done as follows: -Download the tarballs from the respective \Dune (version 2.3) and \Dumux websites to a certain folder in your file system. +\paragraph{Obtaining the software by installing tar files} +The slightly old-fashionedly named tape-archive-file, shortly named tar file or +tarball, is a common file format for distributing collections of files contained +within these archives. +The extraction from the tar files is done as follows: +Download the tarballs from the respective \Dune (version 2.3) and \Dumux websites +to a certain folder in your file system. Create the {\Dune} root directory, named \texttt{dune} in the example below. -Then extract the content of the tar files, e.\,g. with the command-line program \texttt{tar}. -This can be achieved by the following shell commands. Replace \texttt{path\_to\_tarball} with the directory name where the downloaded files are actually located. +Then extract the content of the tar files, e.\,g. with the command-line program +\texttt{tar}. +This can be achieved by the following shell commands. Replace \texttt{path\_to\_tarball} +with the directory name where the downloaded files are actually located. After extraction, the actual name of the \emph{dumux root directory} is \texttt{dumux-\DumuxVersion} (or whatever version you downloaded). \begin{lstlisting}[style=Bash] $ mkdir dune $ cd dune -$ tar xzvf path_to_tarball_of/dune-common-2.3.1.tar.gz -$ tar xzvf path_to_tarball_of/dune-geometry-2.3.1.tar.gz -$ tar xzvf path_to_tarball_of/dune-grid-2.3.1.tar.gz -$ tar xzvf path_to_tarball_of/dune-istl-2.3.1.tar.gz +$ tar xzvf path_to_tarball_of/dune-common-2.3.1.tar.gz +$ tar xzvf path_to_tarball_of/dune-geometry-2.3.1.tar.gz +$ tar xzvf path_to_tarball_of/dune-grid-2.3.1.tar.gz +$ tar xzvf path_to_tarball_of/dune-istl-2.3.1.tar.gz $ tar xzvf path_to_tarball_of/dune-localfunctions-2.3.1.tar.gz $ tar xzvf path_to_tarball_of/dune-pdelab-2.0.0.tar.gz $ tar xzvf path_to_tarball_of/dune-typetree-2.3.1.tar.gz @@ -88,15 +106,15 @@ $ tar xzvf path_to_tarball_of/dumux-2.7.tar.gz Furthermore, if you wish to install the optional \Dune Grid-Howto which provides a tutorial on the Dune grid interface, act similar. -\subsubsection{Obtaining \Dune and \Dumux from software repositories} -Direct access to a software revision control system for downloading code can be of advantage for the user later on. +\paragraph{Obtaining \Dune and \Dumux from software repositories} +Direct access to a software revision control system for downloading code can be of advantage for the user later on. It can be easier for him to keep up with code changes and to receive important bug fixes using the update or pull command of the revision control system. \Dune uses Git and \Dumux uses Apache Subversion for their software repositories. To access them a certain programs are needed which is referred to here shortly as Subversion client or Git client. In our description, we use the Subversion client \texttt{svn} of the Apache Subversion software itself. -In the technical language of Apache Subversion \emph{checking out a certain software version} means nothing more then fetching +In the technical language of Apache Subversion \emph{checking out a certain software version} means nothing more then fetching a local copy from the software repository and laying it out in the file system. In addition to the software some more files for the use of the software revision control system itself are created. If you have developer access to \Dumux, it is @@ -105,7 +123,7 @@ into the software repository. This is usually termed as \emph{commit}. The installation procedure is done as follows: Create a {\Dune} root directory, named \texttt{dune} in the lines below. -Then, enter the previously created directory and check out the desired modules. +Then, enter the previously created directory and check out the desired modules. As you see below, the check-out uses two different servers for getting the sources, one for \Dune and one for {\Dumux}. The \Dune modules of the stable 2.3 release branch are checked out as described @@ -152,7 +170,8 @@ Furthermore, if you wish to install the optional \Dune Grid-Howto which provides on the Dune grid interface, act similar. The \texttt{dumux} module is checked out as described below (see also the \Dumux website \cite{DUMUX-HP}). -Its file tree has to be created in the \Dune-Root directory, where the \Dune modules have also been checked out to. Subsequently, the next command +Its file tree has to be created in the \Dune-Root directory, where the \Dune modules +have also been checked out to. Subsequently, the next command is executed there, too. The dumux root directory is called \texttt{dumux} here. \begin{lstlisting}[style=Bash] @@ -160,20 +179,20 @@ $ # make sure you are in DUNE-Root $ svn checkout --username=anonymous --password='' svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk dumux \end{lstlisting} -\subsubsection{Patching \Dune or external libraries} +\paragraph{Patching \Dune or external libraries} \label{sc:patchingDUNE} Patching of \Dune modules in order to work together with \Dumux can be necessary for several reasons. Software like a compiler or even a standard library -changes at times. But, for example, a certain release of a software component that we depend on, +changes at times. But, for example, a certain release of a software component that we depend on, may not reflect that change and thus it has to be modified. -In the dynamic developing process of software which depends on other modules it is not always feasible +In the dynamic developing process of software which depends on other modules it is not always feasible to adapt everything to the most recent version of each module. They may fix problems with a certain module of a certain release without introducing too much structural change. -\Dumux contains patches and documentation about their usage and application within the +\Dumux contains patches and documentation about their usage and application within the directory \texttt{dumux/patches}. -Please check the README file in that directory for recent information. -In general, a patch can be applied as follows +Please check the README file in that directory for recent information. +In general, a patch can be applied as follows (the exact command or the used parameters may be slightly different). We include here an example of a patching dune-grid. @@ -183,14 +202,14 @@ $ cd dune-grid $ patch -p0 < ../dumux/patches/grid-2.3.1.patch \end{lstlisting} -It can be removed by +It can be removed by \begin{lstlisting}[style=Bash] $ path -p0 -R < ../dumux/patches/grid-2.3.1.patch \end{lstlisting} The \texttt{checkout-dumux} script also applies patches, if not explicitly requested not to do so. -\subsubsection{Hints for \Dumux-Developers} +\paragraph{Hints for \Dumux-Developers} If you also want to actively participate in the development of \Dumux, you can allways send patches to the Mailing list. @@ -198,10 +217,10 @@ To get more involved, you can apply either for full developer access or for developer access on certain parts of \Dumux. Granted developer access means that you are allowed to commit own code and that you can access the \texttt{dumux-devel} module. This enhances \texttt{dumux} by providing maybe unstable code from the developer group. -A developer usually checks out non-anonymously the modules \texttt{dumux} and \texttt{dumux-devel}. +A developer usually checks out non-anonymously the modules \texttt{dumux} and \texttt{dumux-devel}. \texttt{Dumux-devel} itself makes use of the stable part \texttt{dumux}. Hence, the two parts have to be checked out together. This is done using the commands below. But \texttt{joeuser} needs to be replaced by -the actual user name of the developer for accessing the software repository. +the actual user name of the developer for accessing the software repository. One can omit the \texttt{--username} option in the commands above if the user name for the repository access is identical to the one for the system account. @@ -215,8 +234,8 @@ choose to store it by subversion in a secure way, e.\,g. together with KDE's KWa Check the documentation of Subversion for info on how this is done. A leaked out password can be used by evil persons to abuse a software repository. -\section{Building Documentation} -\subsection{Doxygen} +\subsection{Building Documentation} +\subsubsection{Doxygen} \label{sec:build-doxy-doc} Doxygen documentation is done by especially formatted comments integrated in the source code, which can get extracted by the program \texttt{doxygen}. Beside extracting these comments, @@ -225,28 +244,29 @@ like class hierarchy of code displayed as graphs, see \cite{DOXYGEN-HP}. The Doxygen documentation of a module can be built, if \texttt{doxygen} is installed, by running \texttt{dunecontrol}, entering the \texttt{build-*}directory, and execute -\texttt{make doc}. Then point your web browser to the file +\texttt{make doc}. Then point your web browser to the file \texttt{MODULE\_BUILD\_DIRECTORY/doc/doxygen/html/index.html} to read the generated documentation. This should also work for other \Dune modules. -\subsection{Handbook} +\subsubsection{Handbook} To build the \Dumux handbook go into the \texttt{build-}directory and run \texttt{make doc} or \texttt{make dumux-handbook\_pdf}. The pdf can then be found in \texttt{MODULE\_BUILD\_DIRECTORY/doc/handbook/dumux-handbook.pdf}. -\section{External Libraries and Modules} \label{sec:external-modules-libraries} -The libraries described below provide additional functionality but are not generally required to run \Dumux. +\subsection{External Libraries and Modules} \label{sec:external-modules-libraries} +The libraries described below provide additional functionality but are not generally required to run \Dumux. If you are going to use an external library check the information provided on the \Dune website \cite{DUNE-EXT-LIB}. If you are going to use an external \Dune module the website on external modules \cite{DUNE-EXT-MOD} can be helpful. -Installing an external library can require additional libraries which are also used by \Dune. +Installing an external library can require additional libraries which are also used by \Dune. For some libraries, such as BLAS or MPI, multiple versions can be installed on the system. Make sure that it uses the same library as \Dune when configuring the external library. -\subsection{List of External Libraries and Modules} -In the following list, you can find some external modules and external libraries, and some more libraries and tools which are prerequisites for their use. +\subsubsection{List of External Libraries and Modules} +In the following list, you can find some external modules and external libraries, +and some more libraries and tools which are prerequisites for their use. \begin{itemize} \item \textbf{ALBERTA}: External grid library. Adaptive multi-level grid manager using bisectioning @@ -283,7 +303,8 @@ In the following list, you can find some external modules and external libraries Download: \texttt{\url{http://www.iwr.uni-heidelberg.de/frame/iwrwikiequipment/software/ug}} \end{itemize} -The following are dependencies of some of the used libraries. You will need them depending on which modules of \Dune and which external libraries you use. +The following are dependencies of some of the used libraries. You will need them +depending on which modules of \Dune and which external libraries you use. \begin{itemize} \item \textbf{MPI}: The parallel version of \Dune and also some of the external dependencies need MPI @@ -302,7 +323,7 @@ The following are dependencies of some of the used libraries. You will need them is the GNU compiler suite consisting of \texttt{gcc}, \texttt{g++} and \texttt{gfortran}. \end{itemize} -\subsection{Hints for Users from IWS} +\subsubsection{Hints for Users from IWS} We provide some features to make life a little bit easier for users from the Institute for Modelling Hydraulic and Environmental Systems, University of Stuttgart. There exists internally a Subversion repository made for several external libraries. diff --git a/doc/handbook/2_gettingstarted.tex b/doc/handbook/2_gettingstarted.tex new file mode 100644 index 0000000000000000000000000000000000000000..9e8284dacf323f438820118ecd7d840fea3cd636 --- /dev/null +++ b/doc/handbook/2_gettingstarted.tex @@ -0,0 +1,8 @@ +\chapter{Getting started} + +First, we describe a quick installation procedure. +Then a quick start guide for the first \Dumux experience is provided. + +\input{2_quickinstall} +\input{2_quickstartguide} +\input{2_detailedinstall} diff --git a/doc/handbook/quick-install.tex b/doc/handbook/2_quickinstall.tex similarity index 89% rename from doc/handbook/quick-install.tex rename to doc/handbook/2_quickinstall.tex index 9d349ea5a2918e104349944d3ab3f0d296431b57..ab420eabd2d7becfbda84eb3a6226f5f9e8d8fe9 100644 --- a/doc/handbook/quick-install.tex +++ b/doc/handbook/2_quickinstall.tex @@ -1,21 +1,22 @@ -\section{Quick Installation of \Dumux} \label{quick-install} +\section{Quick Installation of \Dumux} +\label{quick-install} -This only provides one quick way of installing \Dumux. -You should have a recent working Linux environment, no \Dune core modules should be installed. -If you need more information, -have \Dune already installed, please have a look at the detailed installation -instructions in Section \ref{install}. +This only provides one quick way of installing \Dumux. +You should have a recent working Linux environment, no \Dune core modules should be installed. +If you need more information, +have \Dune already installed, please have a look at the detailed installation +instructions in Section \ref{install}. \subsection{Obtaining the Code with the Script \texttt{checkout-dumux}} The shell-script \texttt{checkout-dumux} facilitates setting up a {\Dune}/{\Dumux} directory tree. It is available at \cite{DUMUX-DOWNLOAD}. -For example the second line below will check out the required \Dune modules and \texttt{dumux}, +For example the second line below will check out the required \Dune modules and \texttt{dumux}, \texttt{dumux-devel} and the \texttt{external} folder, which contains some useful external software and libraries. Again, \texttt{joeuser} needs to be replaced by the actual user name. \begin{lstlisting}[style=Bash] $ checkout-dumux -h # show help, -$ checkout-dumux -gme -u joeuser -p password -d DUMUX +$ checkout-dumux -gme -u joeuser -p password -d DUMUX \end{lstlisting} Be aware that you cannot get \texttt{dumux-devel} or the external libraries from \texttt{dumux-external} unless @@ -46,13 +47,13 @@ can be a starting point: \begin{lstlisting}[style=Bash] $ # make sure you are in the directory DUNE-Root $ cp dumux/debug.opts my-debug.opts # create a personal version -$ gedit my-debug.opts # optional editing the options file -$ ./dune-common/bin/dunecontrol --opts=my-debug.opts --use-cmake all +$ gedit my-debug.opts # optional editing the options file +$ ./dune-common/bin/dunecontrol --opts=my-debug.opts --use-cmake all \end{lstlisting} -More optimized code, which is typically not usable for standard debugging tasks, can be produced by +More optimized code, which is typically not usable for standard debugging tasks, can be produced by \begin{lstlisting}[style=Bash] -$ cp dumux/optim.opts my-optim.opts +$ cp dumux/optim.opts my-optim.opts $ ./dune-common/bin/dunecontrol --opts=my-optim.opts --use-cmake all \end{lstlisting} diff --git a/doc/handbook/quickstart-guide.tex b/doc/handbook/2_quickstartguide.tex similarity index 97% rename from doc/handbook/quickstart-guide.tex rename to doc/handbook/2_quickstartguide.tex index 16756e4c99ef56b1885524736d7261e367e41343..990564956dfe0a0c980c4da024884d75058fcfef 100644 --- a/doc/handbook/quickstart-guide.tex +++ b/doc/handbook/2_quickstartguide.tex @@ -1,4 +1,5 @@ -\section[Quick Start Guide]{Quick Start Guide: The First Run of a Test Application}\label{quick-start-guide} +\section[Quick Start Guide]{Quick Start Guide: The First Run of a Test Application} +\label{quick-start-guide} The previous section showed how to install and compile \Dumux. This chapter shall give a very brief introduction how to run a first test application and how diff --git a/doc/handbook/3_tutorial.tex b/doc/handbook/3_tutorial.tex new file mode 100644 index 0000000000000000000000000000000000000000..c5acaf1206571642ad1e79e2445d19b1503f315c --- /dev/null +++ b/doc/handbook/3_tutorial.tex @@ -0,0 +1,28 @@ +\chapter[Tutorial]{Tutorial} +\label{chp:tutorial} + +In \Dumux two sorts of models are implemented: Fully-coupled models and +decoupled models. In the fully-coupled models a flow system is described by a +system of strongly coupled equations, which can be for example mass balance +equations for phases, mass balance equations for components or energy balance +equations. In contrast, a decoupled model consists of a pressure equation, which +is iteratively coupled to a saturation equation, concentration equations, energy +balance equations, etc. + +Examples for different kinds of both, coupled and decoupled models, are +isothermal two-phase models, isothermal two-phase two-component models, +non-isothermal two-phase models and non-isothermal two-phase two-component +models. + +In section \ref{box} a short introduction to the box method is given, in section +\ref{cc} the cell centered finite volume method is introduced. The box method is +used in the fully-coupled models for the spatial discretization of the system of +equations. The decoupled models employ usually a cell centered finite volume +scheme. The following two sections of the tutorial demonstrate how to solve +problems using, first, a fully-coupled model (section \ref{tutorial-coupled}) +and, second, using a decoupled model (section \ref{tutorial-decoupled}). Being +the easiest case, an isothermal two-phase system (two fluid phases, one solid +phase) will be considered. + +\input{3_tutorialcoupled} +\input{3_tutorialdecoupled} diff --git a/doc/handbook/tutorial-coupled.tex b/doc/handbook/3_tutorialcoupled.tex similarity index 87% rename from doc/handbook/tutorial-coupled.tex rename to doc/handbook/3_tutorialcoupled.tex index 05d0d571dbaf80e9f7fb5ade5ca763cf1b29b559..1ed9fed3fe2f5dde45b4f4726127d65b3a3434b5 100644 --- a/doc/handbook/tutorial-coupled.tex +++ b/doc/handbook/3_tutorialcoupled.tex @@ -8,15 +8,15 @@ The process of setting up a problem using \Dumux can be roughly divided into fou \item Boundary conditions and initial conditions have to be specified. \end{enumerate} -The problem being solved in this tutorial is illustrated in Figure \ref{tutorial-coupled:problemfigure}. -A rectangular domain with no-flow boundaries on the top and on the bottom, which is initially saturated with oil, is considered. +The problem being solved in this tutorial is illustrated in Figure \ref{tutorial-coupled:problemfigure}. +A rectangular domain with no-flow boundaries on the top and on the bottom, which is initially saturated with oil, is considered. Water infiltrates from the left side into the domain and replaces the oil. Gravity effects are neglected here. \begin{figure}[ht] \centering \begin{tikzpicture}[>=latex] % basic sketch - \fill [fill=dumuxBlue](0,0) rectangle ++(2,1.5); + \fill [fill=dumuxBlue](0,0) rectangle ++(2,1.5); \fill [fill=dumuxYellow](2,0) rectangle ++(5,1.5); \draw (0,0) rectangle ++(7,1.5); \foreach \x in {0,0.25,...,6.75} @@ -57,7 +57,7 @@ The solved equations are the mass balances of water and oil: - \nabla \cdot \left( \varrho_{o} \, \frac{k_{ro}}{\mu_{o}} \, \mathbf{K}\;\nabla p_o \right) - - q_o + q_o & = 0 \end{align} @@ -86,13 +86,13 @@ After this, the default startup routine \texttt{Dumux::start()} is called on line \ref{tutorial-coupled:call-start}. This function deals with parsing the command line arguments, reading the parameter file, setting up the infrastructure necessary for \Dune, loading the grid, and -starting the simulation. -Required parameters for the start of the simulation, +starting the simulation. +Required parameters for the start of the simulation, such as the initial time-step size, the simulation time or details of the grid, can be either specified by command line arguments of the form (\texttt{-ParameterName ParameterValue}), in the file specified by the \texttt{-ParameterFile} argument, or if the latter is not specified, -in the file \mbox{\texttt{tutorial\_coupled.input}}. +in the file \mbox{\texttt{tutorial\_coupled.input}}. If a parameter is specified on the command line as well as in the parameter file, the values provided in the command line have @@ -106,9 +106,9 @@ default parameter file for the tutorial problem. To provide an error message, the usage message which is displayed to the user if the simulation is called incorrectly, is printed via the custom function which is defined on -line~\ref{tutorial-coupled:usage-function} in the main file. -In this function the usage message is customized to the problem at hand. -This means that at least the necessary parameters are listed here. +line~\ref{tutorial-coupled:usage-function} in the main file. +In this function the usage message is customized to the problem at hand. +This means that at least the necessary parameters are listed here. For more information about the input file please refer to section \ref{sec:inputFiles}. @@ -158,7 +158,7 @@ tells the model not to use gravity. \label{tutorial-coupled:boundaryStart}Parameters which are specific to a physical set-up to be simulated, such as boundary and initial conditions, source terms or temperature within the domain, and which are required to solve the differential -equations of the models are specified via a \textit{problem} class. This class +equations of the models are specified via a \textit{problem} class. This class should be derived from \texttt{ImplicitPorousMediaProblem} as done in line \ref{tutorial-coupled:def-problem}. @@ -169,7 +169,7 @@ The problem class always has at least five methods: \item A method \texttt{dirichlet()} specifying the actual values for the \textsc{Dirichlet} conditions at each \textsc{Dirichlet} vertex. \item A method \texttt{neumann()} specifying the actual values for - the \textsc{Neumann} conditions, which are usually evaluated at the + the \textsc{Neumann} conditions, which are usually evaluated at the integration points of the \textsc{Neumann} boundary faces. \item A method for source or sink terms called \texttt{source()}, usually evaluated at the center of a control volume. @@ -184,7 +184,7 @@ available: \item [bcTypes/values:] A vector which stores the result of the method. What the values in this vector mean is dependent on the method: For \texttt{dirichlet()}, \texttt{values} contains the actual values of the primary - variables, for \texttt{boundaryTypes()}, \texttt{bcTypes} contains the boundary + variables, for \texttt{boundaryTypes()}, \texttt{bcTypes} contains the boundary condition types. It has as many entries as the model has primary variables / equations. For the typical case, in which all equations have the same boundary condition type at a certain position, there are two methods that set the appropriate conditions @@ -216,7 +216,7 @@ Methods for box models which make statements about boundary segments of the grid \item[scvIdx:] The index of the sub-control volume in \texttt{fvGeometry} which is assigned to the boundary segment. \item[boundaryFaceIdx:] The index of the boundary face in - \texttt{fvGeometry} which represents the boundary segment. + \texttt{fvGeometry} which represents the boundary segment. \end{description} Similarly, the \texttt{initial()} and \texttt{source()} methods @@ -252,7 +252,7 @@ interactions are defined by {\em fluid systems}, which are located in \verb+dumux/material/fluidsystems+. A more thorough overview of the \Dumux fluid framework can be found in chapter~\ref{sec:fluidframework}. -% In this example, a class for the definition of a two-phase system is used. This allows for the choice +% In this example, a class for the definition of a two-phase system is used. This allows for the choice % of the two components oil and water and for access of the parameters that are relevant for the two-phase model. \subsection{Defining Spatially Dependent Parameters}\label{tutorial-coupled:description-spatialParameters} @@ -290,7 +290,7 @@ simulation (line \verb+dumux/material/fluidmatrixinteractions+. The selected one -- here it is a relation according to a regularized version of \textsc{Brooks} \& \textsc{Corey} -- is included in line -\ref{tutorial-coupled:rawLawInclude}. +\ref{tutorial-coupled:rawLawInclude}. After the selection, an adapter class is specified in line \ref{tutorial-coupled:eff2abs} to translate between effective and absolute saturations. Like this, residual saturations can be specified in a generic way. As only the employed @@ -350,95 +350,117 @@ the material description can be found in The following exercises will give you the opportunity to learn how you can change soil parameters, boundary conditions, run-time parameters and fluid properties in \Dumux. Possible solutions to these exercises are given in the tutorial folder in the -sub-folder \texttt{solutions\_coupled} as \texttt{.diff} files. In these files only the lines that are different from the original file are listed. +sub-folder \texttt{solutions\_coupled} as \texttt{.diff} files. In these files only +the lines that are different from the original file are listed. They can be opened using the program \texttt{kompare}, simply type \texttt{kompare SOLUTIONFILE} into the terminal. \subsubsection{Exercise 1} \renewcommand{\labelenumi}{\alph{enumi})} For Exercise 1 you have -to make only some small changes in the tutorial files. +to make only some small changes in the tutorial files. \begin{enumerate} \item \textbf{Running the Program} \\ -To get an impression what the results should look like you can compile and run the original version of +To get an impression what the results should look like you can compile and run the original version of the coupled tutorial model by typing \texttt{make tutorial\_coupled} followed by \texttt{./tutorial\_coupled}. -Note, that the time-step size is automatically adapted during the simulation. +Note, that the time-step size is automatically adapted during the simulation. For the visualization of the results using ParaView, please refer to section \ref{quick-start-guide}. \item \textbf{Changing the Model Domain and the Boundary Conditions} \\ Change the size of the model domain so that you get a rectangle with edge lengths of $\text{x} = \unit[400]{m}$ and $\text{y} = \unit[500]{m}$ and with discretization lengths of $\Delta \text{x} = \unit[20]{m}$ and $\Delta - \text{y} = \unit[20]{m}$. For this you have to edit the parameter file (\texttt{tutorialproblem\_coupled.input}) + \text{y} = \unit[20]{m}$. For this you have to edit the parameter file (\texttt{tutorialproblem\_coupled.input}) and run the program again.\\ Note, that you do not have to recompile the program if you make changes to the parameter file. - + Change the boundary conditions in the file \texttt{tutorialproblem\_coupled.hh} so that water enters from the bottom and oil is extracted from the top boundary. The right and the left boundary should be closed for water and oil fluxes. \\ - The Neumannn Boundary conditions are multiplied by the normal (pointing outwards), so an influx is negative, an outflux always positive. + The Neumannn Boundary conditions are multiplied by the normal (pointing outwards), + so an influx is negative, an outflux always positive. Such information can easily be found in the documentation of the functions (also look into base classes). Compile the main file by typing \texttt{make tutorial\_coupled} and run the model as explained above. \item \textbf{Changing the Shape of the Discrete Elements} \\ - In order to complete this exercise you need an external grid manager capable of handling - simplex grids, like \texttt{ALUGrid} or \texttt{UGGrid}. If this is not the case, please skip this exercise. - Change the types of elements used for discretizing the domain. In line \ref{tutorial-coupled:set-gridcreator} of the problem - file the type of gridcreator is chosen. By choosing a different grid creator you can discretize the domain with different elements. - Hint: You can find gridcreators in \texttt{dumux/io/}, change for example from \texttt{cubegridcreator.hh} to \texttt{simplexgridcreator.hh}. - For ALUGrid you have to change the ALUGrid type in line \ref{tutorial-coupled:set-grid-ALU} from \texttt{Dune::cube} + In order to complete this exercise you need an external grid manager capable of handling + simplex grids, like \texttt{ALUGrid} or \texttt{UGGrid}. If this is not the case, + please skip this exercise. + Change the types of elements used for discretizing the domain. In line + \ref{tutorial-coupled:set-gridcreator} of the problem + file the type of gridcreator is chosen. By choosing a different grid creator + you can discretize the domain with different elements. + Hint: You can find gridcreators in \texttt{dumux/io/}, change for example from + \texttt{cubegridcreator.hh} to \texttt{simplexgridcreator.hh}. + For ALUGrid you have to change the ALUGrid type in line \ref{tutorial-coupled:set-grid-ALU} from \texttt{Dune::cube} to \texttt{Dune::simplex}. The shape of the employed elements can be visualized in ParaView by choosing \texttt{Surface with Edges}. \item \textbf{Changing Fluids} \\ -Now you can change the fluids. Use DNAPL instead of Oil and Brine instead of Water. To do that, you have to select different components via the property system in the problem file: +Now you can change the fluids. Use DNAPL instead of Oil and Brine instead of Water. +To do that, you have to select different components via the property system in the problem file: \begin{enumerate} - \item Brine: Brine is thermodynamically very similar to pure water but also considers a fixed amount of salt in the liquid phase. - Hence, the class \texttt{Dumux::Brine} uses a pure water class, such as \texttt{Dumux::H2O<Scalar>}, - as a second template argument after the data type \texttt{<Scalar>}, i.e. \texttt{Dumux::Brine<Scalar, Dumux::H2O<Scalar>>}. The file is located in the folder \texttt{dumux/material/components/}. + \item Brine: Brine is thermodynamically very similar to pure water but also + considers a fixed amount of salt in the liquid phase. + Hence, the class \texttt{Dumux::Brine} uses a pure water class, such as \texttt{Dumux::H2O<Scalar>}, + as a second template argument after the data type \texttt{<Scalar>}, i.e. + \texttt{Dumux::Brine<Scalar, Dumux::H2O<Scalar>>}. The file is located in the folder \texttt{dumux/material/components/}. Try to include the file and select the component as the wetting phase via the property system. - \item DNAPL: + \item DNAPL: Now let's include a DNAPL (\textbf{d}ense \textbf{n}on-\textbf{a}queous \textbf{p}hase \textbf{l}iquid) - which is located in the folder \texttt{dumux/material/components/}. Try to include the file and select the component as the non-wetting phase via the property system. + which is located in the folder \texttt{dumux/material/components/}. Try to + include the file and select the component as the non-wetting phase via the property system. \end{enumerate} -If you want to take a closer look on how the fluid classes are defined and which substances are already available please browse through the files in the directory +If you want to take a closer look on how the fluid classes are defined and which +substances are already available please browse through the files in the directory \texttt{/dumux/material/components} and read chapter~\ref{sec:fluidframework}. \item \textbf{Use a Full-Fledged Fluid System} \\ -\Dumux usually describes fluid mixtures via \textit{fluid systems}, see also chapter \ref{sec:fluidframework}. -In order to include a fluid system, you first have to comment out lines \ref{tutorial-coupled:2p-system-start} -to \ref{tutorial-coupled:2p-system-end} in the problem file. If you use eclipse, this can easily be done by pressing \textit{Ctrl + Shift + 7} -- +\Dumux usually describes fluid mixtures via \textit{fluid systems}, see also chapter \ref{sec:fluidframework}. +In order to include a fluid system, you first have to comment out lines \ref{tutorial-coupled:2p-system-start} +to \ref{tutorial-coupled:2p-system-end} in the problem file. If you use eclipse, +this can easily be done by pressing \textit{Ctrl + Shift + 7} -- the same as to cancel the comment later on.\\ -Now include the file \texttt{fluidsystems/h2oairfluidsystem.hh} in the material folder, and set a type property \texttt{FluidSystem} (see line \ref{tutorial-coupled:set-fluidsystem}) +Now include the file \texttt{fluidsystems/h2oairfluidsystem.hh} in the material +folder, and set a type property \texttt{FluidSystem} (see line \ref{tutorial-coupled:set-fluidsystem}) with the appropriate type, which is either:\\ \texttt{Dumux::FluidSystems::H2OAir<typename GET\_PROP\_TYPE(TypeTag, Scalar)>}\\ or in the \Dumux tongue\\ \texttt{Dumux::H2OAirFluidSystem<TypeTag>} \\ -However, this is a rather complicated fluid system which -considers mixtures of components and also uses tabulated components that need to be initialized -- i.e. the tables need to be filled with values. -The initialization of the fluid system is normally done in the constructor of the problem by calling \texttt{GET\_PROP\_TYPE(TypeTag, FluidSystem)::init();}. -Remember that the constructor function always has the same name as the respective class, i.e. \texttt{TutorialProblemCoupled(..)}.\\ -As water flow replacing a gas is much faster, test your simulation only until $2000$ seconds and start with a time-step of $1$ second.\\ -Please reverse the changes made in this part of the exercise, as we will continue to use immiscible phases from here on and hence do not need a complex fluid system. +However, this is a rather complicated fluid system which +considers mixtures of components and also uses tabulated components that need to +be initialized -- i.e. the tables need to be filled with values. +The initialization of the fluid system is normally done in the constructor of the +problem by calling \texttt{GET\_PROP\_TYPE(TypeTag, FluidSystem)::init();}. +Remember that the constructor function always has the same name as the respective +class, i.e. \texttt{TutorialProblemCoupled(..)}.\\ +As water flow replacing a gas is much faster, test your simulation only until $2000$ +seconds and start with a time-step of $1$ second.\\ +Please reverse the changes made in this part of the exercise, as we will continue +to use immiscible phases from here on and hence do not need a complex fluid system. \item \textbf{Changing Constitutive Relations} \\ - Use an unregularized linear law with an entry pressure of $p_e = \unit[0.0]{Pa}$ and maximal capillary pressure of e.g. $p_{c_{max}} = \unit[2000.0]{Pa}$ instead of using a + Use an unregularized linear law with an entry pressure of $p_e = \unit[0.0]{Pa}$ + and maximal capillary pressure of e.g. $p_{c_{max}} = \unit[2000.0]{Pa}$ instead of using a regularized Brooks-Corey law for the - relative permeability and for the capillary pressure saturation relationship. To do that you have - to change the material law property (line \ref{tutorial-coupled:eff2abs}) in \texttt{tutorialspatialparams\_coupled.hh}. Leave the type definition of \texttt{Scalar} and remove - the type definition of \texttt{BrooksAndCorey} in the private section of the property definition. Exchange the \texttt{EffToAbsLaw} with the \texttt{LinearMaterial} law type in the + relative permeability and for the capillary pressure saturation relationship. + To do that you have + to change the material law property (line \ref{tutorial-coupled:eff2abs}) in + \texttt{tutorialspatialparams\_coupled.hh}. Leave the type definition of \texttt{Scalar} and remove + the type definition of \texttt{BrooksAndCorey} in the private section of + the property definition. Exchange the \texttt{EffToAbsLaw} with the \texttt{LinearMaterial} law type in the public section. - You can find the material laws in the folder + You can find the material laws in the folder \verb+dumux/material/fluidmatrixinteractions+. The necessary parameters of the linear law and the respective \texttt{set}-functions can be found in the file \\ \verb+dumux/material/fluidmatrixinteractions/2p/linearmaterialparams.hh+.\\ Call the \texttt{set}-functions from the constructor of the \texttt{tutorialspatialparams\_coupled.hh}. - + \item \textbf{Heterogeneities} \\ Set up a model domain with the soil properties given in Figure \ref{tutorial-coupled:exercise1_d}. Adjust the boundary conditions @@ -460,11 +482,13 @@ Call the \texttt{set}-functions from the constructor of the \texttt{tutorialspat \node [anchor=west] at (0.2,1){$\phi=0.15$}; \node [anchor=west] at (3.2,1.5){$\mathbf{K}=\unit[10^{-9}]{m^2}$}; \node [anchor=west] at (3.2,1){$\phi=0.3$}; -\end{tikzpicture} -\caption{Exercise 1g: Set-up of a model domain with a heterogeneity. Grid spacing: $\Delta x = \unit[20]{m}$ $\Delta y = \unit[20]{m}$.}\label{tutorial-coupled:exercise1_d} +\end{tikzpicture} +\caption{Exercise 1g: Set-up of a model domain with a heterogeneity. Grid +spacing: $\Delta x = \unit[20]{m}$ $\Delta y = \unit[20]{m}$.}\label{tutorial-coupled:exercise1_d} \end{figure} domain. You can use the fluids of exercise 1b.\\ -\textbf{Hint:} The current position of the control volume can be obtained using \texttt{element\allowbreak.geometry()\allowbreak.corner(scvIdx)}, which +\textbf{Hint:} The current position of the control volume can be obtained +using \texttt{element\allowbreak.geometry()\allowbreak.corner(scvIdx)}, which returns a vector of the global coordinates of the current position.\\ When does the front cross the material border? In ParaView, the animation view (\textit{View} $\rightarrow$ \textit{Animation @@ -485,17 +509,19 @@ guardian macros in lines \ref{tutorial-coupled:guardian1} and \ref{tutorial-coupled:guardian2} in the header files (e.g. change \mbox{\texttt{DUMUX\_TUTORIALPROBLEM\_COUPLED\_HH}} to\\ -\mbox{\texttt{DUMUX\_EX2\_TUTORIALPROBLEM\_COUPLED\_HH}}). Include the new problem file in \texttt{tutorial\_coupled.cc}. +\mbox{\texttt{DUMUX\_EX2\_TUTORIALPROBLEM\_COUPLED\_HH}}). Include the new problem file in \texttt{tutorial\_coupled.cc}. Besides adjusting the guardian macros, the new problem file should define and use a new type tag for the problem as well as a new problem class -e.g. \mbox{\texttt{Ex2TutorialProblemCoupled}}. The type tag definition has to be adjusted in \texttt{tutorial\_coupled.cc} too (see line \ref{tutorial-coupled:set-type-tag}). -Similarly adjust your new spatial parameters file. If you are using Eclipse there is +e.g. \mbox{\texttt{Ex2TutorialProblemCoupled}}. The type tag definition has +to be adjusted in \texttt{tutorial\_coupled.cc} too (see line \ref{tutorial-coupled:set-type-tag}). +Similarly adjust your new spatial parameters file. If you are using Eclipse there is a very helpful function called \texttt{Refactor} which you can use to change -all similar variables or types in your current file in one go. Just place the cursor at the variable or type you want to change +all similar variables or types in your current file in one go. Just place the +cursor at the variable or type you want to change and use the \texttt{Refactor} $\rightarrow$ \texttt{Rename} functionality. Make sure to assign your newly defined spatial parameter class to the \texttt{SpatialParams} property for the new -type tag. +type tag. After this, change the run-time parameters so that they match the domain described by figure \ref{tutorial-coupled:ex2_Domain}. Adapt @@ -578,12 +604,16 @@ via \textit{parameter input files}. In the code, parameters can be read via the macro \texttt{GET\_RUNTIME\_PARAM(TypeTag, Scalar, -MyWonderfulGroup.MyWonderfulParameter);}. In this exercise we will explore the possibilities of the +MyWonderfulGroup.MyWonderfulParameter);}. In this exercise we will explore the possibilities of the parameter file. For this we take a look at the file \texttt{ex3\_tutorial\_coupled.input} in the \texttt{solutions\_coupled} folder. -Besides the parameters which you already used in the parameter file above, there are parameters which can be used to control the -Newton and the Linear solver (groups: \texttt{Newton} and \texttt{LinearSolver}). Run-time parameters used in the problem or spatial parameters classes -can also be set with the respective group names (\texttt{Problem} and \texttt{SpatialParams}) in the parameter file. For the latter parameters to be included in the program -they have to be assigned in the problem or spatial parameters constructor. This can be done as shown in the files \texttt{ex3\_tutorialproblem\_coupled.diff} +Besides the parameters which you already used in the parameter file above, +there are parameters which can be used to control the +Newton and the Linear solver (groups: \texttt{Newton} and \texttt{LinearSolver}). +Run-time parameters used in the problem or spatial parameters classes +can also be set with the respective group names (\texttt{Problem} and \texttt{SpatialParams}) +in the parameter file. For the latter parameters to be included in the program +they have to be assigned in the problem or spatial parameters constructor. This +can be done as shown in the files \texttt{ex3\_tutorialproblem\_coupled.diff} and \texttt{ex3\_tutorialspatialparams\_coupled.diff} in the \texttt{solutions\_coupled} folder. Add some (for example \texttt{Newton.MaxSteps} and \texttt{Problem.EnableGravity}) to the parameter file \texttt{tutorial\_coupled.input} and observe what @@ -601,19 +631,27 @@ a viscosity of $\unit[0.00112]{Pa \, s}$. \subsubsection{Exercise 5: Time Dependent Boundary Conditions} -In this exercise we want to investigate the influence of time dependent boundary conditions. For this, redo the steps of exercise 2 and create a new problem and spatial parameters file. +In this exercise we want to investigate the influence of time dependent boundary +conditions. For this, redo the steps of exercise 2 and create a new problem and +spatial parameters file. After this, change the run-time parameters so that they match the domain described by figure \ref{tutorial-coupled:ex5_Domain}. Adapt the problem class so that the boundary conditions are consistent with -figure \ref{tutorial-coupled:ex5_BC}. Here you can see the time dependence of the nonwetting saturation, where water infiltrates only during $\unit[10^5]{s}$ and $\unit[4 \cdot 10^5]{s}$. To implement these time dependencies you need the actual time $t_{n+1}=t_n + \Delta t$ and the endtime of the simulation. For this you can use the methods \texttt{this->timeManager().time()}, \texttt{this->timeManager().timeStepSize()} and \texttt{this->timeManager().endTime()}. +figure \ref{tutorial-coupled:ex5_BC}. Here you can see the time dependence of the +nonwetting saturation, where water infiltrates only during $\unit[10^5]{s}$ and +$\unit[4 \cdot 10^5]{s}$. To implement these time dependencies you need the actual +time $t_{n+1}=t_n + \Delta t$ and the endtime of the simulation. For this you can +use the methods \texttt{this->timeManager().time()}, \texttt{this->timeManager().timeStepSize()} +and \texttt{this->timeManager().endTime()}. Initially, the domain is fully saturated with oil and the pressure is $p_w = 2 \times 10^5\,\text{Pa}$. Water infiltrates from the left side. Create a grid with $100$ cells in $x$-direction and $10$ cells in $y$-direction. The simulation time should be set to $\unit[5 \cdot 10^5]{s}$ with an initial time-step size of $\unit[10]{s}$. To avoid too big time-step sizes -you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{TimeManager} (in your input file) to $\unit[1000]{s}$. Then, you can compile the program. +you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{TimeManager} +(in your input file) to $\unit[1000]{s}$. Then, you can compile the program. \begin{figure}[ht] \centering @@ -628,7 +666,7 @@ you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{Time \draw[|<->|] (-0.2,0) -- ++(0,5); \node [anchor=east] at (-0.2,1.5){$\unit[50]{m}$}; \draw[|<->|] (0,5.35) -- ++(10,0); - \node [anchor=south] at (2.5,5.2){$\unit[100]{m}$}; + \node [anchor=south] at (2.5,5.2){$\unit[100]{m}$}; % labels \node [anchor=south] at (5,5.25){no flow}; \node [anchor=north] at (5,-0.25){no flow}; @@ -656,7 +694,7 @@ you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{Time \draw [dashed] (2,5) -- (2,0); \draw [dashed] (8,5) -- (8,0); \draw [dashed] (10,5) -- (10,0); - + % axes labeling \draw [-] (-0.1,5) -- (0.1,5); \node [anchor=west] at(-0.5,5){$1$}; @@ -666,21 +704,22 @@ you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{Time \node [anchor=west] at(1.5,-0.4){$1\cdot10^{5}$}; \draw [-] (8,0.1) -- (8,-0.1); \node [anchor=west] at(7.5,-0.4){$4\cdot10^{5}$}; - \draw [-] (10,0.1) -- (10,-0.1); - \node [anchor=west] at(9.5,-0.4){$5\cdot10^{5}$}; - + \draw [-] (10,0.1) -- (10,-0.1); + \node [anchor=west] at(9.5,-0.4){$5\cdot10^{5}$}; + \node [anchor=base] at (5,3){$1-\sin\left(\pi\frac{\text{time}-10^5}{3\cdot 10^5 }\right)$}; \end{tikzpicture} \caption{Time Dependent Boundary Conditions}\label{tutorial-coupled:ex5_BC} \end{figure} \begin{itemize} - \item Open ParaView and plot the values of $S_n$ at time $\unit[5 \cdot 10^5]{s}$ over the $x$-axis.\\ (\texttt{Filter->Data Analysis->Plot Over Line}) + \item Open ParaView and plot the values of $S_n$ at time $\unit[5 \cdot 10^5]{s}$ + over the $x$-axis.\\ (\texttt{Filter->Data Analysis->Plot Over Line}) \item What happens without any time-step restriction? \end{itemize} \clearpage \newpage -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "dumux-handbook" -%%% End: +%%% End: diff --git a/doc/handbook/tutorial-decoupled.tex b/doc/handbook/3_tutorialdecoupled.tex similarity index 70% rename from doc/handbook/tutorial-decoupled.tex rename to doc/handbook/3_tutorialdecoupled.tex index 69d3b487a125abb66ed29685d30a12268fc276e6..2d007b139a64f98d0d58a205e0c9509feee640ae 100644 --- a/doc/handbook/tutorial-decoupled.tex +++ b/doc/handbook/3_tutorialdecoupled.tex @@ -1,5 +1,5 @@ \section[Decoupled model]{Solving a problem using a Decoupled Model}\label{tutorial-decoupled} -The process of solving a problem using \Dumux can be roughly divided into four parts: +The process of solving a problem using \Dumux can be roughly divided into four parts: \begin{enumerate} \item The geometry of the problem and correspondingly a grid have to be defined. \item Material properties and constitutive relationships have to be defined. @@ -8,25 +8,25 @@ The process of solving a problem using \Dumux can be roughly divided into four p \end{enumerate} In contrast to the last section, we now apply a decoupled solution procedure, a -so-called \textit{IMPET} (\textit{IM}plicit \textit{P}ressure \textit{E}xplicit -\textit{T}ransport) algorithm. This means that the pressure equation is first +so-called \textit{IMPET} (\textit{IM}plicit \textit{P}ressure \textit{E}xplicit +\textit{T}ransport) algorithm. This means that the pressure equation is first solved using an implicit method. The resulting velocities are then used to solve a transport equation explicitly.\\ In this tutorial, pure fluid phases are solved with a finite volume discretization of both pressure- and transport step. Primary variables, according to default settings of the model, are the pressure and the saturation of the wetting phase. -The problem which is solved in this tutorial is illustrated in figure -\ref{tutorial-decoupled:problemfigure}. A rectangular domain with no flow -boundaries on the top and at the bottom, which is initially saturated with oil, -is considered. Water infiltrates from the left side into the domain. Gravity +The problem which is solved in this tutorial is illustrated in figure +\ref{tutorial-decoupled:problemfigure}. A rectangular domain with no flow +boundaries on the top and at the bottom, which is initially saturated with oil, +is considered. Water infiltrates from the left side into the domain. Gravity effects are neglected. \begin{figure}[ht] \centering \begin{tikzpicture}[>=latex] % basic sketch - \fill [fill=dumuxBlue](0,0) rectangle ++(2,1.5); + \fill [fill=dumuxBlue](0,0) rectangle ++(2,1.5); \fill [fill=dumuxYellow](2,0) rectangle ++(5,1.5); \draw (0,0) rectangle ++(7,1.5); \foreach \x in {0,0.25,...,6.75} @@ -48,10 +48,14 @@ effects are neglected. \node [anchor=west] at (7.5,1.1){$q_w = \unitfrac[0]{kg}{m^2s}$}; \node [anchor=west] at (7.5,0.4){$q_n = \unitfrac[3 \cdot 10^{-2}] {kg}{m^2s}$}; \end{tikzpicture} -\caption{Geometry of the tutorial problem with initial and boundary conditions.}\label{tutorial-decoupled:problemfigure} +\caption{Geometry of the tutorial problem with initial and boundary conditions.} +\label{tutorial-decoupled:problemfigure} \end{figure} -Listing \ref{tutorial-decoupled:mainfile} shows how the main file, which has to be executed, has to be set up, if the problem described above is to be solved using a decoupled model. This main file can be found in the directory \texttt{/tutorial} of the stable part of \Dumux. +Listing \ref{tutorial-decoupled:mainfile} shows how the main file, which has to be +executed, has to be set up, if the problem described above is to be solved using +a decoupled model. This main file can be found in the directory \texttt{/tutorial} +of the stable part of \Dumux. \begin{lst}[File tutorial/tutorial\_decoupled.cc]\label{tutorial-decoupled:mainfile} \mbox{} \lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=24, firstnumber=24]{../../tutorial/tutorial_decoupled.cc} @@ -105,13 +109,13 @@ so-called \textit{problem file} as shown in listing \lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=24, firstnumber=24]{../../tutorial/tutorialproblem_decoupled.hh} \end{lst} -First, both \Dune grid handlers and the decoupled model of \Dumux -have to be included. Then, a new type tag is created for the problem -in line \ref{tutorial-decoupled:create-type-tag}. In this case, the -new type tag inherits all properties defined for the \texttt{DecoupledTwoP} +First, both \Dune grid handlers and the decoupled model of \Dumux +have to be included. Then, a new type tag is created for the problem +in line \ref{tutorial-decoupled:create-type-tag}. In this case, the +new type tag inherits all properties defined for the \texttt{DecoupledTwoP} type tag, which means that for this problem the two-phase decoupled approach -is chosen as discretization scheme (defined via the include in line -\ref{tutorial-decoupled:parent-problem}). On line \ref{tutorial-decoupled:set-problem}, +is chosen as discretization scheme (defined via the include in line +\ref{tutorial-decoupled:parent-problem}). On line \ref{tutorial-decoupled:set-problem}, a problem class is attached to the new type tag, while the grid which is going to be used is defined in line \ref{tutorial-decoupled:set-grid-type} -- in this case an \texttt{YaspGrid} is created. Since there's no uniform mechanism to @@ -123,48 +127,58 @@ run-time parameters \texttt{Grid.upperRightX}, \texttt{Grid.upperRightY}, \texttt{Grid.numberOfCellsX} and \texttt{Grid.numberOfCellsY}. These parameters can be specified via the command-line or in a parameter file. -For more information about the \Dune grid interface, the different grid types -that are supported and the generation of different grids consult -the \textit{Dune Grid Interface HOWTO} \cite{DUNE-HP}. +For more information about the \Dune grid interface, the different grid types +that are supported and the generation of different grids consult +the \textit{Dune Grid Interface HOWTO} \cite{DUNE-HP}. Next, we select the material of the simulation: In the case of a pure two-phase model, each phase is a bulk fluid, and the complex (compositional) fluidsystems -do not need to be used. However, they can be used (see exercise 1 \ref{dec-ex1-fluidsystem}). -Instead, we use a simplified fluidsystem container that provides classes -for liquid and gas phases, line \ref{tutorial-decoupled:2p-system-start} to -\ref{tutorial-decoupled:2p-system-end}. These are linked to the appropriate -chemical species in line \ref{tutorial-decoupled:wettingPhase} and -\ref{tutorial-decoupled:nonwettingPhase}. For all parameters that depend -on space, such as the properties of the soil, the specific spatial parameters +do not need to be used. However, they can be used (see exercise 1 \ref{dec-ex1-fluidsystem}). +Instead, we use a simplified fluidsystem container that provides classes +for liquid and gas phases, line \ref{tutorial-decoupled:2p-system-start} to +\ref{tutorial-decoupled:2p-system-end}. These are linked to the appropriate +chemical species in line \ref{tutorial-decoupled:wettingPhase} and +\ref{tutorial-decoupled:nonwettingPhase}. For all parameters that depend +on space, such as the properties of the soil, the specific spatial parameters for the problem of interest are specified in line -\ref{tutorial-decoupled:set-spatialparameters}. +\ref{tutorial-decoupled:set-spatialparameters}. -Now we arrive at some model parameters of the applied two-phase decoupled -model. First, in line \ref{tutorial-decoupled:cflflux} a flux function for the evaluation of the cfl-criterion is defined. This is optional as there exists also a default flux function. The choice depends on the problem which has to be solved. For cases which are not advection dominated the one chosen here is more reasonable. +Now we arrive at some model parameters of the applied two-phase decoupled +model. First, in line \ref{tutorial-decoupled:cflflux} a flux function for the +evaluation of the cfl-criterion is defined. This is optional as there exists also +a default flux function. The choice depends on the problem which has to be solved. +For cases which are not advection dominated the one chosen here is more reasonable. Line \ref{tutorial-decoupled:cflfactor} assigns the CFL-factor to be used in the -simulation run, which scales the time-step size (kind of security factor). The last property in line \ref{tutorial-decoupled:gravity} +simulation run, which scales the time-step size (kind of security factor). The last +property in line \ref{tutorial-decoupled:gravity} is optional and tells the model not to use gravity. -After all necessary information is written into the property system and +After all necessary information is written into the property system and its namespace is closed in line \ref{tutorial-decoupled:propertysystem-end}, -the problem class is defined in line \ref{tutorial-decoupled:def-problem}. -As its property, the problem class itself is also derived from a parent, -\texttt{IMPESProblem2P}. The class constructor (line +the problem class is defined in line \ref{tutorial-decoupled:def-problem}. +As its property, the problem class itself is also derived from a parent, +\texttt{IMPESProblem2P}. The class constructor (line \ref{tutorial-decoupled:constructor-problem}) is able to hold two vectors, which is not needed in this tutorial. -Beside the definition of the boundary and initial conditions (discussed in -subsection \ref{tutorial-coupled:problem} from 4$^{th}$ paragraph on page \pageref{tutorial-coupled:boundaryStart}), the problem class also contains +Beside the definition of the boundary and initial conditions (discussed in +subsection \ref{tutorial-coupled:problem} from 4$^{th}$ paragraph on page +\pageref{tutorial-coupled:boundaryStart}), the problem class also contains general information about the current simulation. First, the name used by the \texttt{VTK-writer} to generate output is defined in the method of line \ref{tutorial-decoupled:name}, and line \ref{tutorial-decoupled:restart} indicates -whether restart files are written. As decoupled schemes usually feature small -time-steps, it can be usefull to set an output interval larger than 1. The respective function is called in line \ref{tutorial-decoupled:outputinterval}, which gets the output interval as argument. +whether restart files are written. As decoupled schemes usually feature small +time-steps, it can be usefull to set an output interval larger than 1. The respective +function is called in line \ref{tutorial-decoupled:outputinterval}, which gets the output interval as argument. The following methods all have in common that they may be dependent on space. Hence, they all have either an \texttt{element} or an \texttt{intersection} as their -function argument: Both are \Dune entities, depending on whether the parameter of the method is defined in an element, such as - initial values, or on an intersection, such as a boundary condition. As it may be sufficient to return values only based on a position, \Dumux models can also access functions in the problem with the form \mbox{\texttt{...AtPos(GlobalPosition\& globalPos)}}, without an \Dune entity, as one can see in line \ref{tutorial-decoupled:bctype}. +function argument: Both are \Dune entities, depending on whether the parameter of +the method is defined in an element, such as + initial values, or on an intersection, such as a boundary condition. As it may + be sufficient to return values only based on a position, \Dumux models can also + access functions in the problem with the form \mbox{\texttt{...AtPos(GlobalPosition\& globalPos)}}, + without an \Dune entity, as one can see in line \ref{tutorial-decoupled:bctype}. There are the methods for general parameters, source- or sinkterms, boundary conditions (lines \ref{tutorial-decoupled:bctype} to @@ -180,16 +194,16 @@ Listing \ref{tutorial-decoupled:spatialparamsfile} shows the file \begin{lst}[File tutorial/tutorialspatialparams\_decoupled.hh]\label{tutorial-decoupled:spatialparamsfile} \mbox{} \lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=24, firstnumber=24]{../../tutorial/tutorialspatialparams_decoupled.hh} \end{lst} -As this file only slightly differs from the coupled version, consult +As this file only slightly differs from the coupled version, consult chapter \ref{tutorial-coupled:description-spatialParameters} for explanations. However, as a standard Finite Volume scheme is used, in contrast to the box-method -in the coupled case, the argument list here is the same as for the problem +in the coupled case, the argument list here is the same as for the problem functions: Either an \texttt{element}, or only the global position if the function is called \texttt{...AtPos(...)}. \subsection{Exercises} \label{tutorial-deoucpled:exercises} -The following exercises will give you the opportunity to learn how you can change -soil parameters, boundary conditions and fluid properties in \Dumux and to play along +The following exercises will give you the opportunity to learn how you can change +soil parameters, boundary conditions and fluid properties in \Dumux and to play along with the decoupled modelling framework. \subsubsection{Exercise 1} @@ -198,33 +212,76 @@ For Exercise 1 you only have to make some small changes in the tutorial files. \begin{enumerate} \item \textbf{Altering output} -To get an impression what the results should look like you can first run the original version of the decoupled tutorial model by typing \texttt{./tutorial\_decoupled}. The runtime parameters which are set can be found in the input file (listing~\ref{tutorial-decoupled:parameter-file}). If the input file has the same name than the main file (e.g. \texttt{tutorial\_decoupled.cc} and \texttt{tutorial\_decoupled.input}), it is automatically chosen. If the name differs the program has to be started typing \texttt{./tutorial\_decoupled -parameterFile <filename>.input}. For more options you can also type \texttt{./tutorial\_decoupled -h}. For the visualisation with paraview please refer to \ref{quick-start-guide}.\\ -As you can see, the simulation creates many output files. To reduce these in order to perform longer simulations, change the method responsible for output (line \ref{tutorial-decoupled:outputinterval} in the file \texttt{tutorialproblem\_decoupled}) as to write an output only every 20 time-steps. Compile the main file by typing \texttt{make tutorial\_decoupled} and run the model. Now, run the simulation for 5e5 seconds. +To get an impression what the results should look like you can first run the +original version of the decoupled tutorial model by typing \texttt{./tutorial\_decoupled}. +The runtime parameters which are set can be found in the input file (listing~\ref{tutorial-decoupled:parameter-file}). +If the input file has the same name than the main file (e.g. \texttt{tutorial\_decoupled.cc} +and \texttt{tutorial\_decoupled.input}), it is automatically chosen. If the name differs +the program has to be started typing \texttt{./tutorial\_decoupled -parameterFile <filename>.input}. +For more options you can also type \texttt{./tutorial\_decoupled -h}. For the +visualisation with paraview please refer to \ref{quick-start-guide}.\\ +As you can see, the simulation creates many output files. To reduce these in order +to perform longer simulations, change the method responsible for output (line +\ref{tutorial-decoupled:outputinterval} in the file \texttt{tutorialproblem\_decoupled}) +as to write an output only every 20 time-steps. Compile the main file by typing +\texttt{make tutorial\_decoupled} and run the model. Now, run the simulation for 5e5 seconds. \item \textbf{Changing the Model Domain and the Boundary Conditions} \\ Change the size of the model domain so that you get a rectangle -with edge lengths of x = 300 m \\ and y = 300 m and with discretisation lengths of $\Delta \text{x} = 20$ m and $\Delta \text{y} = 10$ m. \\ -Change the boundary conditions in the file \texttt{tutorialproblem\_decoupled.hh} so that water enters from the bottom and oil flows out at the top boundary. The right and the left boundary should be closed for water and oil fluxes. The Neumannn Boundary conditions are multiplied by the normal (pointing outwards), so an influx is negative, an outflux always positive. Such information can easily be found in the documentation of the functions (also look into base classes). +with edge lengths of x = 300 m \\ and y = 300 m and with discretisation lengths +of $\Delta \text{x} = 20$ m and $\Delta \text{y} = 10$ m. \\ +Change the boundary conditions in the file \texttt{tutorialproblem\_decoupled.hh} +so that water enters from the bottom and oil flows out at the top boundary. The +right and the left boundary should be closed for water and oil fluxes. The Neumannn +Boundary conditions are multiplied by the normal (pointing outwards), so an influx +is negative, an outflux always positive. Such information can easily be found in the +documentation of the functions (also look into base classes). \item \textbf{Changing Fluids} \\ -Now you can change the fluids. Use DNAPL instead of Oil and Brine instead of Water. To do that you have to select different components via the property system in the problem file: +Now you can change the fluids. Use DNAPL instead of Oil and Brine instead of Water. +To do that you have to select different components via the property system in the problem file: \begin{enumerate} - \item Brine: The class \texttt{Dumux::Brine} acts as an adapter to the fluid system that alters a pure water class by adding some salt. Hence, the class \texttt{Dumux::Brine} uses a pure water class, such as \texttt{Dumux::H2O}, as a second template argument after the data type \texttt{<Scalar>} as a template argument (be sure to use the complete water class with its own template parameter). - \item DNAPL: A standard set of chemical substances, such as Water and Brine, is already included (via a list of \texttt{\#include ..} commandos) and hence easily accessible by default. This is not the case for the class \texttt{Dumux::DNAPL}, however, which is located in the folder \texttt{dumux/material/components/}. Try to include the file as well as select the component via the property system. + \item Brine: The class \texttt{Dumux::Brine} acts as an adapter to the fluid system + that alters a pure water class by adding some salt. Hence, the class \texttt{Dumux::Brine} + uses a pure water class, such as \texttt{Dumux::H2O}, as a second template + argument after the data type \texttt{<Scalar>} as a template argument (be sure + to use the complete water class with its own template parameter). + \item DNAPL: A standard set of chemical substances, such as Water and Brine, + is already included (via a list of \texttt{\#include ..} commandos) and hence + easily accessible by default. This is not the case for the class \texttt{Dumux::DNAPL}, + however, which is located in the folder \texttt{dumux/material/components/}. Try to + include the file as well as select the component via the property system. \end{enumerate} -If you want to take a closer look at how the fluid classes are defined and which substances are already available please browse through the files in the directory +If you want to take a closer look at how the fluid classes are defined and which +substances are already available please browse through the files in the directory \texttt{/dumux/material/components}. \item \textbf{Use the \Dumux fluid system}\label{dec-ex1-fluidsystem} \\ -\Dumux usually organizes fluid mixtures via a \texttt{fluidsystem}, see also chapter \ref{sec:fluidframework}. In order to include a fluidsystem you first have to comment the lines \ref{tutorial-decoupled:2p-system-start} to \ref{tutorial-decoupled:2p-system-end} in the problem file. If you use eclipse, this can easily be done by pressing \textit{str + shift + 7} -- the same as to cancel the comment later on.\\ -Now include the file \texttt{fluidsystems/h2oairfluidsystem.hh} in the material folder, and set a property \texttt{FluidSystem} with the appropriate type, \texttt{Dumux::H2OAirFluidSystem<TypeTag>}. However, this rather complicated fluidsystem uses tabularized fluid data, which need to be initialized (i.e. the tables need to be filled with values) in the constructor body of the current problem by adding \texttt{GET\_PROP\_TYPE(TypeTag, FluidSystem)::init();}. Remember that the constructor function always has the same name as the respective class, i.e. \texttt{TutorialProblemDecoupled(..)}.\\ -To avoid the initialization, use the simpler version of water \texttt{Dumux::SimpleH2O} or a non-tabulated version \texttt{Dumux::H2O}. This can be done by setting the property \texttt{Components} type \texttt{H2O}, +\Dumux usually organizes fluid mixtures via a \texttt{fluidsystem}, see also chapter +\ref{sec:fluidframework}. In order to include a fluidsystem you first have to comment +the lines \ref{tutorial-decoupled:2p-system-start} to \ref{tutorial-decoupled:2p-system-end} +in the problem file. If you use eclipse, this can easily be done by pressing +\textit{str + shift + 7} -- the same as to cancel the comment later on.\\ +Now include the file \texttt{fluidsystems/h2oairfluidsystem.hh} in the material folder, +and set a property \texttt{FluidSystem} with the appropriate type, +\texttt{Dumux::H2OAirFluidSystem<TypeTag>}. However, this rather complicated fluidsystem +uses tabularized fluid data, which need to be initialized (i.e. the tables need to be +filled with values) in the constructor body of the current problem by adding +\texttt{GET\_PROP\_TYPE(TypeTag, FluidSystem)::init();}. Remember that the constructor +function always has the same name as the respective class, i.e. \texttt{TutorialProblemDecoupled(..)}.\\ +To avoid the initialization, use the simpler version of water \texttt{Dumux::SimpleH2O} +or a non-tabulated version \texttt{Dumux::H2O}. This can be done by setting the property +\texttt{Components} type \texttt{H2O}, as is done in all the test problems of the decoupled 2p2c model.\\ -The density of the gas is magnitudes smaller than that of oil, so please decrease the outflow rate to $q_n = 3 \times 10^{-4}$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$. Also reduce the simulation duration to 2e4 seconds.\\ -Please reverse the changes of this example, as we still use bulk phases and hence do not need such an extensive fluid system. - +The density of the gas is magnitudes smaller than that of oil, so please decrease +the outflow rate to $q_n = 3 \times 10^{-4}$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$. +Also reduce the simulation duration to 2e4 seconds.\\ +Please reverse the changes of this example, as we still use bulk phases and +hence do not need such an extensive fluid system. + \item \textbf{Heterogeneities} \\ -Set up a model domain with the soil properties given in figure \ref{tutorial-deoucpled:exercise1_d}. Adjust the boundary conditions so that water is again flowing from left to right. +Set up a model domain with the soil properties given in figure \ref{tutorial-deoucpled:exercise1_d}. +Adjust the boundary conditions so that water is again flowing from left to right. \begin{figure}[bt] \centering \begin{tikzpicture}[>=latex] @@ -242,31 +299,33 @@ Set up a model domain with the soil properties given in figure \ref{tutorial-deo \node [anchor=west] at (0.2,1){$\phi=0.15$}; \node [anchor=west] at (3.2,1.5){$\mathbf{K}=\unit[10^{-9}]{m^2}$}; \node [anchor=west] at (3.2,1){$\phi=0.3$}; -\end{tikzpicture} +\end{tikzpicture} \caption{Exercise 1d: Set-up of a model domain a heterogeneity. $\Delta x = \Delta y = \unit[20]{m}$.} \label{tutorial-deoucpled:exercise1_d} \end{figure} -When does the front cross the material border? In paraview, the option \textit{View} $\rightarrow$ \textit{Animation View} is nice to get a rough feeling of the time-step sizes. +When does the front cross the material border? In paraview, the option +\textit{View} $\rightarrow$ \textit{Animation View} is nice to get a rough +feeling of the time-step sizes. \end{enumerate} \subsubsection{Exercise 2} For this exercise you should create a new problem file analogous to -the file \texttt{tutorialproblem\_decoupled.hh} (e.g. with the name -\texttt{ex2\_tutorialproblem\_decoupled.hh} and new spatial parameters +the file \texttt{tutorialproblem\_decoupled.hh} (e.g. with the name +\texttt{ex2\_tutorialproblem\_decoupled.hh} and new spatial parameters just like \texttt{tutorialspatialparams\_decoupled.hh}. These files need to -be included in the file \texttt{tutorial\_decoupled.cc}. +be included in the file \texttt{tutorial\_decoupled.cc}. -Each new files should contain the definition of a new class with a -name that relates to the file name, such as \texttt{Ex2TutorialProblemDecoupled}. +Each new files should contain the definition of a new class with a +name that relates to the file name, such as \texttt{Ex2TutorialProblemDecoupled}. Make sure that you also adjust the guardian macros in lines \ref{tutorial-decoupled:guardian1} and \ref{tutorial-decoupled:guardian2} in the header files (e.g. change \\ \texttt{DUMUX\_TUTORIALPROBLEM\_DECOUPLED\_HH} to -\texttt{DUMUX\_EX2\_TUTORIALPROBLEM\_DECOUPLED\_HH}). Beside also adjusting the guardian macros, +\texttt{DUMUX\_EX2\_TUTORIALPROBLEM\_DECOUPLED\_HH}). Beside also adjusting the guardian macros, the new problem file should define and use a new type tag for the problem as well as a new problem class -e.g. \texttt{Ex2TutorialProblemDecoupled}. Make sure to assign your newly defined spatial -parameter class to the \texttt{SpatialParams} property for the new -type tag. +e.g. \texttt{Ex2TutorialProblemDecoupled}. Make sure to assign your newly defined spatial +parameter class to the \texttt{SpatialParams} property for the new +type tag. After this, change the domain size (parameter input file) to match the domain described by figure \ref{tutorial-decoupled:ex2_Domain}. Adapt the problem class @@ -340,39 +399,66 @@ compile the program. \end{figure} \begin{itemize} - \item What happens if you increase the resolution of the grid? Hint: Paraview can visualize the time-steps via the ``Animation View'' (to be enabled unter the button \textit{View}). + \item What happens if you increase the resolution of the grid? Hint: Paraview + can visualize the time-steps via the ``Animation View'' (to be enabled unter the button \textit{View}). \item Set the CFL-factor to 1 and investigate the saturation: Is the value range reasonable? \item Further increase the CFL-factor to 2 and investigate the saturation. \end{itemize} \subsubsection{Exercise 3: Parameter file input.} -As you have experienced, compilation takes quite some time. Therefore, \Dumux provides a simple method to read in parameters (such as simulation end time or modelling parameters) via \texttt{Paramter Input Files}. The tests in the Test-folder \texttt{/test/} already use this system.\\ -If you look at the Application in \texttt{/test/implicit/2p/}, you see that the main file looks rather empty: The parameter file \texttt{test\_box2p.input} is read by a standard start procedure, which is called in the main function. This should be adapted for your problem at hand. The program run has to be called with the parameter file as argument. As this is a basic \Dumux feature, the procedure is the equivalent in the decoupled as in the box models. -In the code, parameters can be read via the macro \texttt{GET\_RUNTIME\_PARAM(TypeTag, Scalar, MyWonderfulGroup.MyWonderfulParameter);}. In \texttt{test\_2p}, \texttt{MyWonderfulGroup} is the group \texttt{SpatialParams} - any type of groups is applicable, if the group definition in the parameter file is enclosed in square brackets. The parameters are then listed thereafter. Try and use as much parameters as possible via the input file, such as lens dimension, grid resolution, soil properties etc. In addition, certain parameters that are specific to the model, such as the \texttt{CFL}-factor, can be assigned in the parameter file without any further action. +As you have experienced, compilation takes quite some time. Therefore, \Dumux +provides a simple method to read in parameters (such as simulation end time or +modelling parameters) via \texttt{Paramter Input Files}. The tests in the Test-folder +\texttt{/test/} already use this system.\\ +If you look at the Application in \texttt{/test/implicit/2p/}, you see that +the main file looks rather empty: The parameter file \texttt{test\_box2p.input} +is read by a standard start procedure, which is called in the main function. +This should be adapted for your problem at hand. The program run has to be +called with the parameter file as argument. As this is a basic \Dumux feature, +the procedure is the equivalent in the decoupled as in the box models. +In the code, parameters can be read via the macro +\texttt{GET\_RUNTIME\_PARAM(TypeTag, Scalar, MyWonderfulGroup.MyWonderfulParameter);}. +In \texttt{test\_2p}, \texttt{MyWonderfulGroup} is the group \texttt{SpatialParams} +- any type of groups is applicable, if the group definition in the parameter file +is enclosed in square brackets. The parameters are then listed thereafter. +Try and use as much parameters as possible via the input file, such as lens +dimension, grid resolution, soil properties etc. In addition, certain parameters +that are specific to the model, such as the \texttt{CFL}-factor, can be assigned +in the parameter file without any further action. \subsubsection{Exercise 4} Create a new file for benzene called \texttt{benzene.hh} and implement -a new fluid system. (You may get a hint by looking at existing fluid +a new fluid system. (You may get a hint by looking at existing fluid systems in the directory \verb+/dumux/material/fluidsystems+.) Use benzene as a new fluid and run the model of Exercise 2 with water and benzene. Benzene has a density of $889.51 \, \text{kg} / \text{m}^3$ -and a viscosity of $0.00112 \, \text{Pa} \, \text{s}$. +and a viscosity of $0.00112 \, \text{Pa} \, \text{s}$. \subsubsection{Exercise 5: Time Dependent Boundary Conditions} -In this exercise we want to investigate the influence of time dependent boundary conditions. For this, redo the steps of exercise 2 and create a new problem and spatial parameters file. +In this exercise we want to investigate the influence of time dependent boundary +conditions. For this, redo the steps of exercise 2 and create a new problem and +spatial parameters file. After this, change the run-time parameters so that they match the domain described by figure \ref{tutorial-decoupled:ex5_Domain}. Adapt the problem class so that the boundary conditions are consistent with -figure \ref{tutorial-decoupled:ex5_BC}. Here you can see the time dependence of the wetting saturation, where water infiltrates only during $10^5\,\text{s}$ and $4 \cdot 10^5\,\text{s}$. To implement these time dependencies you need the actual time $t_{n+1}=t_n + \Delta t$ and the endtime of the simulation. For this you can use the methods \texttt{this->timeManager().time()}, \texttt{this->timeManager().timeStepSize()} and \texttt{this->timeManager().endTime()}. +figure \ref{tutorial-decoupled:ex5_BC}. Here you can see the time dependence of +the wetting saturation, where water infiltrates only during $10^5\,\text{s}$ and +$4 \cdot 10^5\,\text{s}$. To implement these time dependencies you need the actual +time $t_{n+1}=t_n + \Delta t$ and the endtime of the simulation. For this you can +use the methods \texttt{this->timeManager().time()}, \texttt{this->timeManager().timeStepSize()} +and \texttt{this->timeManager().endTime()}. Initially, the domain is fully saturated with oil and the pressure is $p_w = 2 \times 10^5\,\text{Pa}$. Water infiltrates from the left side. Create a grid with $100$ cells in $x$-direction and $10$ cells in $y$-direction. The simulation time should be set to $5 \cdot 10^5\,\text{s}$ with an -initial time-step size of $10\,\text{s}$. To avoid too big time-step sizes you should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{TimeManager} (in your input file) to $\unit[100]{s}$. You should only create output files every $100^{th}$ time-step (see exercise 1a). Then, you can compile the program. +initial time-step size of $10\,\text{s}$. To avoid too big time-step sizes you +should set the parameter \texttt{MaxTimeStepSize} for the group \texttt{TimeManager} +(in your input file) to $\unit[100]{s}$. You should only create output files +every $100^{th}$ time-step (see exercise 1a). Then, you can compile the program. \begin{figure}[ht] \centering @@ -387,7 +473,7 @@ initial time-step size of $10\,\text{s}$. To avoid too big time-step sizes you s \draw[|<->|] (-0.2,0) -- ++(0,5); \node [anchor=east] at (-0.2,1.5){$\unit[50]{m}$}; \draw[|<->|] (0,5.35) -- ++(10,0); - \node [anchor=south] at (2.5,5.2){$\unit[100]{m}$}; + \node [anchor=south] at (2.5,5.2){$\unit[100]{m}$}; % labels \node [anchor=south] at (5,5.25){no flow}; \node [anchor=north] at (5,-0.25){no flow}; @@ -412,7 +498,7 @@ initial time-step size of $10\,\text{s}$. To avoid too big time-step sizes you s |- (11,0) node (xaxis) [right] {time\,[s]}; \draw plot[smooth,samples=100,domain=0:1] (6*\x + 2 ,{5*sin((\x)*pi r)}); \draw [dashed] (0,5) -- (5,5); - + % axes labeling \draw [-] (-0.1,5) -- (0.1,5); \node [anchor=west] at(-0.5,5){$1$}; @@ -422,23 +508,30 @@ initial time-step size of $10\,\text{s}$. To avoid too big time-step sizes you s \node [anchor=west] at(1.5,-0.4){$1\cdot10^{5}$}; \draw [-] (8,0.1) -- (8,-0.1); \node [anchor=west] at(7.5,-0.4){$4\cdot10^{5}$}; - \draw [-] (10,0.1) -- (10,-0.1); - \node [anchor=west] at(9.5,-0.4){$5\cdot10^{5}$}; - + \draw [-] (10,0.1) -- (10,-0.1); + \node [anchor=west] at(9.5,-0.4){$5\cdot10^{5}$}; + \node [anchor=base] at (5,2){$\sin(\pi\frac{\text{time}-10^5}{3\cdot 10^5 })$}; \end{tikzpicture} \caption{Time Dependent Boundary Conditions}\label{tutorial-decoupled:ex5_BC} \end{figure} \begin{itemize} - \item Open paraview and plot the values of $S_w$ at time $\unit[5 \cdot 10^5]{s}$ over the $x-$axis.\\ (\texttt{Filter->Data Analysis->Plot Over Line}) + \item Open paraview and plot the values of $S_w$ at time $\unit[5 \cdot 10^5]{s}$ + over the $x-$axis.\\ (\texttt{Filter->Data Analysis->Plot Over Line}) \item What happens without any time-step restriction? \end{itemize} \subsubsection{Exercise 6} -If both the coupled and the decoupled tutorial are completed, one should have noticed that the function arguments in the problem function differ slighty, as the numerical models differ. However, both are functions that depend on space, so both models can also work with functions based ond \mbox{\texttt{...AtPos(GlobalPosition \& globalPos)}}, no matter if we model coupled or decoupled. Try to formulate a spatial parameters file that works with both problems, the coupled and the decoupled. Therein, only use functions at the position. - -%%% Local Variables: +If both the coupled and the decoupled tutorial are completed, one should have +noticed that the function arguments in the problem function differ slighty, as +the numerical models differ. However, both are functions that depend on space, +so both models can also work with functions based ond \mbox{\texttt{...AtPos(GlobalPosition \& globalPos)}}, +no matter if we model coupled or decoupled. Try to formulate a spatial parameters +file that works with both problems, the coupled and the decoupled. Therein, only +use functions at the position. + +%%% Local Variables: %%% mode: latex %%% TeX-master: "dumux-handbook" -%%% End: +%%% End: diff --git a/doc/handbook/4_dumuxoverview.tex b/doc/handbook/4_dumuxoverview.tex new file mode 100644 index 0000000000000000000000000000000000000000..0f5d79be8e54d7d3103469bddba8eabe6856e4f1 --- /dev/null +++ b/doc/handbook/4_dumuxoverview.tex @@ -0,0 +1,13 @@ +\chapter[\Dumux overview - The \Dumux Navigator - How To Get Around]{\Dumux overview - The \Dumux Navigator - How To Get Around} + +The intention of this chapter is to provide the reader with basic knowledge +about how things are structured in \Dumux and what is necessary for +using \Dumux without any deeper modifications. + +\input{4_structure} +\input{4_newfoldersetup} +\input{4_parameterfiles} +\input{4_guidelines} +\input{4_newtoninanutshell} +\input{4_tipsandtricks} +\input{4_restartsimulations} diff --git a/doc/handbook/guidelines.tex b/doc/handbook/4_guidelines.tex similarity index 91% rename from doc/handbook/guidelines.tex rename to doc/handbook/4_guidelines.tex index 13e9c9b99d72298220b498fede7a8f127d3b8a24..ac208c02f6034843ab4c3f726828ce6dc7a30bc0 100644 --- a/doc/handbook/guidelines.tex +++ b/doc/handbook/4_guidelines.tex @@ -1,4 +1,4 @@ -\section{Coding Guidelines} +\section{Coding Guidelines} \label{guidelines} An important characteristic of source code is that it is written only @@ -22,7 +22,7 @@ with the quality of its documentation. Therefore it is of paramount importance that you document well everything you do! We use the Doxygen system to extract easily-readable documentation from the source code. Please use its syntax everywhere.\\ -We proclaim the Doc-Me Dogma. It goes like this: Whatever you do, and in whatever hurry you +We proclaim the Doc-Me Dogma. It goes like this: Whatever you do, and in whatever hurry you happen to be, please document everything at least with a \texttt{/** $\backslash$todo Please doc me! */}. That way at least the absence of documentation is documented, and it is easier to get rid of it systematically. @@ -36,7 +36,7 @@ is in \textbf{English}. In particular, please comment \textbf{all}: localResidual.eval(/*includeBoundaries=*/true); \end{lstlisting} \item Template Parameters - \item Return Values + \item Return Values \item Exceptions thrown by a method \item svn-Commits \end{itemize} @@ -49,7 +49,7 @@ of the code we have the following naming principles. \begin{itemize} \item \emph{use} letters and digits \item \emph{first letter} is lower case. - \item \emph{CamelCase}: if your variable names consists of several words, then + \item \emph{CamelCase}: if your variable names consists of several words, then the first letter of each new word should be capital. \item \emph{Abbreviations}: If and only if a single letter that represents an abbreviation or index is followed by a single letter (abbreviation or index), @@ -57,23 +57,26 @@ of the code we have the following naming principles. it symbolizes a fraction line. Afterwards, we continue with lower case, i.e. the common rules apply to both enumerator and denominator. Examples: \\ \texttt{pw} but \texttt{pressureW} $\rightarrow$ because ``pressure'' is a word.\\ - \texttt{srnw} but \texttt{sReg} $\rightarrow$ because ``reg'' is not an abbreviation of a single letter. ``n'' abbreviates ``non'', ``w'' is ``wetting'', so not CamelCase.\\ - \texttt{pcgw} but \texttt{dTauDPi} $\rightarrow$ Both ``Tau'' and ``Pi'' are words, plus longer than a letter.\\ - \textbf{But:} \texttt{CaCO3} The only exception: chemical formulas are written in their chemically correct way $\rightarrow$ + \texttt{srnw} but \texttt{sReg} $\rightarrow$ because ``reg'' is not an + abbreviation of a single letter. ``n'' abbreviates ``non'', ``w'' is ``wetting'', so not CamelCase.\\ + \texttt{pcgw} but \texttt{dTauDPi} $\rightarrow$ Both ``Tau'' and ``Pi'' + are words, plus longer than a letter.\\ + \textbf{But:} \texttt{CaCO3} The only exception: chemical formulas are + written in their chemically correct way $\rightarrow$ \item \emph{Self-Explaining}: especially abbreviations should be avoided (saturation in stead of S) \end{itemize} -\item \textbf{Private Data Variables:} Names of private data variables end with an +\item \textbf{Private Data Variables:} Names of private data variables end with an underscore and are the only variables that contain underscores. -\item \textbf{Type names:} For type names, the same rules as for variables apply. The +\item \textbf{Type names:} For type names, the same rules as for variables apply. The only difference is that the \emph{first letter is capital}. \item \textbf{Files:} File names should consist of \emph{lower case} letters exclusively. Header files get the suffix \texttt{.hh}, implementation files the suffix \texttt{.cc} \item \textbf{The Exclusive-Access Macro:} Every header file traditionally begins with the definition of a preprocessor constant that is used to make sure that - each header file is only included once. If your header file is called + each header file is only included once. If your header file is called 'myheaderfile.hh', this constant should be DUMUX\_MYHEADERFILE\_HH. -\item \textbf{Macros:} The use of preprocessor macros is strongly discouraged. If you +\item \textbf{Macros:} The use of preprocessor macros is strongly discouraged. If you have to use them for whatever reason, please use capital letters only. \end{itemize} diff --git a/doc/handbook/newFolder.tex b/doc/handbook/4_newfoldersetup.tex similarity index 99% rename from doc/handbook/newFolder.tex rename to doc/handbook/4_newfoldersetup.tex index 022a81a47eea53f566a813e106af8ff0a6427a31..be65499f53c875b106465b6e8a20f4f4cd95ab6a 100644 --- a/doc/handbook/newFolder.tex +++ b/doc/handbook/4_newfoldersetup.tex @@ -50,7 +50,7 @@ add_dumux_test(test\_program test\_program test\_program.cc For those who work with Subversion (\texttt{svn}) and want to commit a newly setup folder to the repository some basics are given in this paragraph. For further reading please check out the Subversion User Manual found at \cite{APACHE-SUBVERSION-HP} where you will also find a "High Speed Turorial" in the appendix. \\ -The four most important commands are \texttt{svn checkout}, \texttt{svn update}, \texttt{svn add} +The four most important commands are \texttt{svn checkout}, \texttt{svn update}, \texttt{svn add} and \texttt{svn commit}. The first one (\texttt{svn checkout}) you probably already know from the \Dumux installation. It will create a copy of the trunk version from the svn server on your local system. Use \texttt{svn update} to get the latest changes in the repository (commits from other users). In order to add a new folder to the repository the following diff --git a/doc/handbook/4_newtoninanutshell.tex b/doc/handbook/4_newtoninanutshell.tex new file mode 100644 index 0000000000000000000000000000000000000000..cc7a572e5d5592200879737d79fee18bf8e25d54 --- /dev/null +++ b/doc/handbook/4_newtoninanutshell.tex @@ -0,0 +1,82 @@ +\section{Newton in a Nutshell} +\label{sc:newtoninanutshell} + +Coming back to the example of chapter \ref{flow} the following mass conservation +equation is to be solved: +\begin{align} +\underbrace{ + \phi \frac{\partial \varrho_\alpha S_\alpha}{\partial t} + - + \text{div} \left\{ + \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} + \left(\grad\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) + \right\} - q_\alpha} _ +{\textbf{f}(\textbf{u}^r)} += 0 \; . +\end{align} + +Because of the nonlinear dependencies (even in this comparativly simple equation) +in there, this is a really difficult task. However, for finding roots of of +difficult equations there is a really handy method out there: \textsc{Newton}'s method. + +When using a fully coupled numerical model, one timestep essentially consists +of the application of the \textsc{Newton} algorithm to solve the nonlinear system. + +One step of the \textsc{Newton} method can be formalized as follows: + +\textsc{Newton} method: +\begin{subequations} +\begin{align} +\label{NewtonGen} +\textbf{u}^{r+1} &= \textbf{u}^r - \left(\textbf{f}^\prime (\textbf{u}^r) \right)^{-1} \textbf{f}(\textbf{u}^r) \\ +\Leftrightarrow {\textbf{f}^{\prime}(\textbf{u}^r)} ( \textbf{u}^{r+1}-\textbf{u}^r) &= -\textbf{f}(\textbf{u}^r) \\ +\Leftrightarrow \underbrace{\textbf{f}^{\prime}(\textbf{u}^r)}_{\textnormal{Jacobian}} + ( \textbf{u}^r - \textbf{u}^{r+1}) &= \textbf{f}(\textbf{u}^r) \label{NewtonAsUsed} +\end{align} +\end{subequations} + +\noindent with +\begin{itemize} +\item $\phantom{a}^r$: last iteration, $\phantom{a}^{r+1}$: current iteration, +\item $\phantom{a}^\prime$: derivative +\item $\textbf{u}$: vector of unknowns, the actual primary variables +\item $\textbf{f}(\textbf{u}^r)$: function of vector of unknowns +\end{itemize} + +1-D example with slope $m$: +\begin{equation} + m= \frac{y(u^{r+1})-y(u^{r})}{u^{r+1}-u^{r}} + \textnormal{ for a root of a function: } + m= - \frac{y(u^{r})}{u^{r+1}-u^{r}} +\end{equation} +The value of u (generally a vector of unknowns) for which f becomes zero is searched +for. Therefore the quantity of interest is $\textbf{u}^{r+1}$. + +But the (BiCGSTAB / Pardiso / ...) linear solver solves systems of the form: +\begin{equation} +\label{GenSysEq} + A\textbf{x} = \textbf{b} . +\end{equation} + +Comparing (\ref{GenSysEq}) with (\ref{NewtonAsUsed}) leads to: +\begin{itemize} +\item $\textbf{b} = \textbf{f}(\textbf{u}^r)$ r.h.s. as it is known from the last +iteration. Here, $\textbf{f}(\textbf{u}^r)$ is called residual. It is obtained by +evaluating the balance equations with the primary variables, as obtained from the +last iteration step. +\item $A=\textbf{f}^{\prime}(\textbf{u}^r)$ coefficient matrix or \textsc{Jacobian}. +It is obtained by numerical differentiation. Evaluating the balance equations at +the last solution + eps, then evaluating the balance equations at the last solution +- eps, division by 2eps: numerical differentiation complete. +\item $\textbf{x} = (\textbf{u}^{r+1} - \textbf{u}^{r})$ this is what the linear +solver finds as an solution. +\end{itemize} + +This is equivalent to stating that the implemented algorithm solves for the change +of the solution. Or in other words: until the $\textbf{u}$ does not change with one more \textsc{Newton-}iteration (do not confuse with timestep!). + +In the rest of Dumux (everywhere besides in the solver), not the change of the +solution is looked for, but the actual solution is used. Therefore the outcome +of the linear solver needs to be reformulated as done in \verb+updateMethod.update(*this, u, *uOld, model);+. +In this function the ``change in solution'' is changed to ``solution''. +Afterwards the quantity \verb+*u+ stands for the solution. diff --git a/doc/handbook/parameterfiles.tex b/doc/handbook/4_parameterfiles.tex similarity index 100% rename from doc/handbook/parameterfiles.tex rename to doc/handbook/4_parameterfiles.tex diff --git a/doc/handbook/restartsimulations.tex b/doc/handbook/4_restartsimulations.tex similarity index 99% rename from doc/handbook/restartsimulations.tex rename to doc/handbook/4_restartsimulations.tex index cb240f1e417d8e4aabab225d5524348ced213c5f..3cc949fe8bf1439a7210ad5dfba287368cb0bf4e 100644 --- a/doc/handbook/restartsimulations.tex +++ b/doc/handbook/4_restartsimulations.tex @@ -1,5 +1,6 @@ \section{Restart \Dumux Simulations} \label{sec:restartSimulations} + Using the restart capability of \Dumux can be advantageous for computationally expensive or time consuming simulations, because you can restart the simulation from a specific point in time and e.g. extend the simulation beyond the originally diff --git a/doc/handbook/structure.tex b/doc/handbook/4_structure.tex similarity index 65% rename from doc/handbook/structure.tex rename to doc/handbook/4_structure.tex index 57f8679bdf265d806233e1d0350e937f8d8aaf99..dc59362733f121ed590c0991df3f5cfd6a617eac 100644 --- a/doc/handbook/structure.tex +++ b/doc/handbook/4_structure.tex @@ -1,78 +1,88 @@ -\chapter{Structure, Guidelines, New Folder Setup} - \section{Directory Structure} - -We briefly describe the directory structure of \Dumux in terms -of subdirectories, source files, and tests. For more details, -the Doxygen documentation should be considered. -\Dumux comes in form of a DUNE module \texttt{dumux}. -It has a similar structure as other DUNE modules like \texttt{dune-grid}. -The following subdirectories are within the module's root directory, -from now on assumed to be \texttt{/}: +\todo[inline]{Wollen wir hier alle Unterordner kurz vorstellen und \emph{kurz} erklären, + was in deren Unterordnern zu finden ist?} +We briefly describe the directory structure of \Dumux in terms +of subdirectories, source files, and tests. For more details, +the Doxygen documentation should be considered. +\Dumux comes in form of a DUNE module \texttt{dumux}. +It has a similar structure as other DUNE modules like \texttt{dune-grid}. +The following subdirectories are within the module's root directory, +from now on assumed to be \texttt{/}: \begin{itemize} \item \texttt{bin}: contains binaries, e.g. used for the automatic testing -\item \texttt{CMake}: the configuration options -for building \Dumux using CMake. See the file \texttt{INSTALL.cmake} in -the root directory of \texttt{dumux} for details. Of course, -it is also possible to use the DUNE buildsystem just like for the other +\item \texttt{CMake}: the configuration options +for building \Dumux using CMake. See the file \texttt{INSTALL.cmake} in +the root directory of \texttt{dumux} for details. Of course, +it is also possible to use the DUNE buildsystem just like for the other DUNE modules. -\item \texttt{doc}: contains the Doxygen documentation in \texttt{doxygen}, -this handbook in \texttt{handbook}, and the \Dumux logo in various formats in -\texttt{logo}. The html documentation produced by Doxygen can be accessed as usual, -namely, by opening \texttt{doc/doxygen/html/index.html} with a web browser. -\item \texttt{dumux}: the \Dumux source files. See Section \ref{sec:dumux} for details. -\item \texttt{test}: tests for each numerical model and the property system. -See Section \ref{sec:test} for details. -\item \texttt{tutorial}: contains the tutorials described in Chapter \ref{chp:tutorial}. +\item \texttt{doc}: contains the Doxygen documentation in \texttt{doxygen}, +this handbook in \texttt{handbook}, and the \Dumux logo in various formats in +\texttt{logo}. The html documentation produced by Doxygen can be accessed as usual, +namely, by opening \texttt{doc/doxygen/html/index.html} with a web browser. +\item \texttt{dumux}: the \Dumux source files. See Section \ref{sec:dumux} for details. +\item \texttt{test}: tests for each numerical model and the property system. +See Section \ref{sec:test} for details. +\item \texttt{tutorial}: contains the tutorials described in Chapter \ref{chp:tutorial}. \end{itemize} +\subsection{The directory \texttt{dumux}} +\label{sec:dumux} -\subsection{The directory \texttt{dumux}}\label{sec:dumux} - -The directory \texttt{dumux} contains the \Dumux source files. It consists of the following subdirectories (see Figure \ref{fig:dumux-structure}): +The directory \texttt{dumux} contains the \Dumux source files. It consists of the +following subdirectories (see Figure \ref{fig:dumux-structure}): -\begin{itemize} +\begin{itemize} \item \texttt{implicit}: -the general fully implicit method is contained in the subdirectory \texttt{common}. -The subdirectories \texttt{box} and \texttt{cellcentered} contain the code for the according -discretization types. They also contain files \texttt{..fvelementgeometry.hh} employed -by the box or cc method to extract the dual mesh geometry information out of the primal one. -Each of the other subdirectories contain a derived specific numerical model. -% The files \texttt{pdelabboxassembler.hh} and \texttt{pdelabboxlocaloperator.hh} allow the use of the DUNE module \texttt{dune-pdelab}. +the general fully implicit method is contained in the subdirectory \texttt{common}. +The subdirectories \texttt{box} and \texttt{cellcentered} contain the code for the according +discretization types. They also contain files \texttt{..fvelementgeometry.hh} employed +by the box or cc method to extract the dual mesh geometry information out of the primal one. +Each of the other subdirectories contain a derived specific numerical model. +% The files \texttt{pdelabboxassembler.hh} and \texttt{pdelabboxlocaloperator.hh} allow the use of the DUNE module \texttt{dune-pdelab}. \item \texttt{common}: -general stuff like the property system and the time management for the -fully coupled as well as the decoupled models, -% the interface for the Pardiso direct solver library \cite{Pardiso}, -and the \texttt{start.hh} file that includes the common routine for starting a model called in the main function. +general stuff like the property system and the time management for the +fully coupled as well as the decoupled models, +% the interface for the Pardiso direct solver library \cite{Pardiso}, +and the \texttt{start.hh} file that includes the common routine for starting a model called in the main function. \item \texttt{decoupled}: - numerical models to solve the pressure equation as part of the fractional flow formulation. The specific models are contained - in corresponding subdirectories. In each model folder are subdirectories for the implicit pressure equation sorted by the employed discretization method, and for the explicit transport equation. The general decoupled formulation for the implicit pressure explicit transport formulation can be found in the subdirectory \texttt{common}. + numerical models to solve the pressure equation as part of the fractional flow + formulation. The specific models are contained + in corresponding subdirectories. In each model folder are subdirectories for the + implicit pressure equation sorted by the employed discretization method, and for the + explicit transport equation. The general decoupled formulation for the implicit + pressure explicit transport formulation can be found in the subdirectory \texttt{common}. % \item \texttt{fractionalflow}: -% the (non-compositional) fractional flow model, which utilizes the IMPES method +% the (non-compositional) fractional flow model, which utilizes the IMPES method % contained in the subdirectory \texttt{impes}. % \item \texttt{functions}: -% the Crouzeix--Raviart function implemented in the style of \texttt{dune-disc}'s P1 function. +% the Crouzeix--Raviart function implemented in the style of \texttt{dune-disc}'s P1 function. % \item \texttt{fvgeometry}: -% employed by the box method to extract the dual mesh geometry information out of the -% primal one. - -\item \texttt{io}: additional in-/output possibilities like restart files, gnuplot-interface -and a VTKWriter extension. - -\item \texttt{material}: everything related to material parameters and -constitutive equations. The properties of a pure chemical substance (e.g. water) or pseudo substance (e.g. air) can be found in the subdirectory \texttt{components} with the base class \texttt{components/component.hh}. The fluidsytem in the folder \texttt{fluidsystems} collects the information from the respective component and binary coefficients files, and contains the fluid characteristics of phases (e.g. viscosity, density, enthalpy, diffusion coefficients) for compositional or non-compositional multi-phase flow. - -The base class for all spatially dependend variables -- like permeability and porosity -- -can be found in \texttt{spatialparams}. The base class in \texttt{implicitspatialparameters.hh} +% employed by the box method to extract the dual mesh geometry information out of the +% primal one. + +\item \texttt{io}: additional in-/output possibilities like restart files, gnuplot-interface +and a VTKWriter extension. + +\item \texttt{material}: everything related to material parameters and +constitutive equations. The properties of a pure chemical substance (e.g. water) or +pseudo substance (e.g. air) can be found in the subdirectory \texttt{components} +with the base class \texttt{components/component.hh}. The fluidsytem in the folder +\texttt{fluidsystems} collects the information from the respective component and +binary coefficients files, and contains the fluid characteristics of phases +(e.g. viscosity, density, enthalpy, diffusion coefficients) for compositional or non-compositional multi-phase flow. + +The base class for all spatially dependend variables -- like permeability and porosity -- +can be found in \texttt{spatialparams}. The base class in \texttt{implicitspatialparameters.hh} also provides spatial averaging routines. All other spatial properties are specified in the specific - files of the respective models. Furthermore, the constitutive relations -- e.g. $p_c(S_w) $ -- are in \texttt{fluidmatrixinteractions}, + files of the respective models. Furthermore, the constitutive relations -- + e.g. $p_c(S_w) $ -- are in \texttt{fluidmatrixinteractions}, while the necessary binary coefficients like the Henry coefficient or binary diffusion coefficients are definded in \texttt{binarycoefficients}. @@ -80,43 +90,44 @@ while the necessary binary coefficients like the Henry coefficient or binary dif \item \texttt{nonlinear}: Newton's method. -% \item \texttt{operators}: based on \texttt{dune-disc}, assembly operators for Crouzeix--Raviart -% elements and mimetic finite differences. -% -% -% \item \texttt{pardiso}: interface to the Pardiso direct solver library, \cite{Pardiso}. -% -% -% \item \texttt{shapefunctions}: Crouzeix--Raviart element shape functions. -% -% -% \item \texttt{timedisc}: time discretization for the decoupled models. -% -% -% \item \texttt{transport}: numerical models to solve the pressure equation -% as part of the fractional flow formulation analogous to the \texttt{diffusion} -% directory. Moreover, the compositional decoupled models are included here. +% \item \texttt{operators}: based on \texttt{dune-disc}, assembly operators for Crouzeix--Raviart +% elements and mimetic finite differences. +% +% +% \item \texttt{pardiso}: interface to the Pardiso direct solver library, \cite{Pardiso}. +% +% +% \item \texttt{shapefunctions}: Crouzeix--Raviart element shape functions. +% +% +% \item \texttt{timedisc}: time discretization for the decoupled models. +% +% +% \item \texttt{transport}: numerical models to solve the pressure equation +% as part of the fractional flow formulation analogous to the \texttt{diffusion} +% directory. Moreover, the compositional decoupled models are included here. \end{itemize} -\subsection{The directory \texttt{test}}\label{sec:test} - - -The directory \texttt{test} contains a test for each numerical model and for -the property system. The tests for the property system can be found in \texttt{common}. -The subfolder \texttt{implicit} contains tests for the fully -coupled models (\texttt{1p}, \texttt{1p2c}, \texttt{2p}, \texttt{2p2c}, -\texttt{2p2cni}, \texttt{2pni}, \texttt{3p3c}, \texttt{3p3cni}, \texttt{mpnc} and \texttt{richards}), while the subdirectory \texttt{decoupled} corresponds to the decoupled models. -Each subdirectory contains one or more program files \texttt{test\_*.cc}, where \texttt{*} usually is the -name of the folder. Moreover, the problem definitions can be found -in the \texttt{*problem.hh} files and the definition of the spatially dependent parameters in \texttt{*spatialparameters.hh}. Simply executing the tests should either run the -full test or give a list of required command line arguments. After test execution, -VTK output files should have been generated. -For more detailed descriptions of the tests, the problem definitions and their corresponding -Doxygen documentation should be considered. +\subsection{The directory \texttt{test}} +\label{sec:test} +The directory \texttt{test} contains a test for each numerical model and for +the property system. The tests for the property system can be found in \texttt{common}. +The subfolder \texttt{implicit} contains tests for the fully +coupled models (\texttt{1p}, \texttt{1p2c}, \texttt{2p}, \texttt{2p2c}, +\texttt{2p2cni}, \texttt{2pni}, \texttt{3p3c}, \texttt{3p3cni}, \texttt{mpnc} +and \texttt{richards}), while the subdirectory \texttt{decoupled} corresponds to the decoupled models. +Each subdirectory contains one or more program files \texttt{test\_*.cc}, where \texttt{*} usually is the +name of the folder. Moreover, the problem definitions can be found +in the \texttt{*problem.hh} files and the definition of the spatially dependent +parameters in \texttt{*spatialparameters.hh}. Simply executing the tests should either run the +full test or give a list of required command line arguments. After test execution, +VTK output files should have been generated. +For more detailed descriptions of the tests, the problem definitions and their corresponding +Doxygen documentation should be considered. \begin{sidewaysfigure} \begin{tikzpicture}[>=latex,inner xsep=0.15cm,rounded corners] @@ -146,10 +157,10 @@ Doxygen documentation should be considered. \node [minimum height=0.7cm,draw,inner xsep=1.34cm,thick] (eos) at(4.2,-4) {eos}; \node [inner ysep=0.05cm,draw,text width=2cm,align=center,inner xsep=0.59cm,thick] (fi) at(4.2,-5) {fluidmatrix-\\[-16pt]interactions}; \node [minimum height=0.7cm,draw,inner xsep=0.73cm,thick] (fstate) at(4.2,-6) {fluidstates}; - \node [minimum height=0.7cm,draw,inner xsep=0.56cm,thick] (fsys) at(4.2,-7) {fluidsystems}; - \node [minimum height=0.7cm,draw,inner xsep=0.11cm,thick] (s) at(4.2,-8) {spatialparameters}; + \node [minimum height=0.7cm,draw,inner xsep=0.56cm,thick] (fsys) at(4.2,-7) {fluidsystems}; + \node [minimum height=0.7cm,draw,inner xsep=0.11cm,thick] (s) at(4.2,-8) {spatialparameters}; -\node [minimum height=0.7cm,draw,inner xsep=0.74cm,thick] (non) at(0.5,-9) {nonlinear}; +\node [minimum height=0.7cm,draw,inner xsep=0.74cm,thick] (non) at(0.5,-9) {nonlinear}; \node [minimum height=0.7cm,draw,inner xsep=0.9cm,thick] (para) at(0.5,-10) {parallel}; \draw (d)--(lin); @@ -178,62 +189,61 @@ Doxygen documentation should be considered. \draw (fstate)--(2.4,-6); \draw (fsys)--(2.4,-7); -\draw [->](c3)--(6.5,9) node [right,text width=12.5cm,align=left] - {Common files of the implicit (box and cell centered) models and the de-\\[-4pt]coupled models: time integration, start routine, the property system, ...}; -\draw [->](spec3)--(6.5,8) node [right,text width=12.5cm,align=left] - {Specific model definition for the decoupled formulation. In each model \\[-4pt]folder are subdirectories for the implicit pressure equation, sorted by \\[-4pt]discretization method, and for the explicit transport.}; -\draw [->](c2)--(6.5,7) node [right,text width=12.5cm,align=left] +\draw [->](c3)--(6.5,9) node [right,text width=12.5cm,align=left] + {Common files of the implicit (box and cell centered) models and the de-\\[-4pt] + coupled models: time integration, start routine, the property system, ...}; +\draw [->](spec3)--(6.5,8) node [right,text width=12.5cm,align=left] + {Specific model definition for the decoupled formulation. In each model \\[-4pt] + folder are subdirectories for the implicit pressure equation, sorted by \\[-4pt]discretization method, and for the explicit transport.}; +\draw [->](c2)--(6.5,7) node [right,text width=12.5cm,align=left] {Base classes and general files for the decoupled formulation.}; -\draw [->](spec2)--(6.5,6) node [right,text width=12.5cm,align=left] - {Specific model definition for free flow problems using the Strokes \\[-4pt]equation: non-isothermal, compositional, one-phase models.}; -\draw [->](spec1)--(6.5,5) node [right,text width=12.5cm,align=left] - {Model and problem definition: implementation of equations, model spe-\\[-4pt]cific properties and indices.}; -\draw [->](box)--(6.5,4) node [right,text width=12.5cm,align=left] - {Specific files for gerenal fully implicit boxmethod: boxassembler, dual \\[-5pt]mesh geometry in boxfvelementgeometry.hh, base classes for model and \\[-5pt]problem definition.}; -\draw [->](cell)--(6.5,3) node [right,text width=12.5cm,align=left] - {Specific files for fully implicit cell centered method: ccassembler, mesh \\[-5pt]geometry in ccfvelementgeometry.hh, base classes for model and problem \\[-5pt]definition.}; -\draw [->](c1)--(6.5,2) node [right,text width=12.5cm,align=left] - {Common functionality of cell centered and box formulation: assembling \\[-5pt]in implicitlocaljacobian.hh, evaluation of partial derivative in \\[-5pt]implicitlocalresidual.hh, base classes for model and problem definition.}; -\draw [->](io)--(6.5,1) node [right,text width=12.5cm,align=left] - {Additional in-/output possibilities like restart files, gnuplot-interface and a VTKWriter \\[-4pt]extension. Grid Creator files.}; +\draw [->](spec2)--(6.5,6) node [right,text width=12.5cm,align=left] + {Specific model definition for free flow problems using the Strokes \\[-4pt] + equation: non-isothermal, compositional, one-phase models.}; +\draw [->](spec1)--(6.5,5) node [right,text width=12.5cm,align=left] + {Model and problem definition: implementation of equations, model spe-\\[-4pt] + cific properties and indices.}; +\draw [->](box)--(6.5,4) node [right,text width=12.5cm,align=left] + {Specific files for gerenal fully implicit boxmethod: boxassembler, dual \\[-5pt] + mesh geometry in boxfvelementgeometry.hh, base classes for model and \\[-5pt]problem definition.}; +\draw [->](cell)--(6.5,3) node [right,text width=12.5cm,align=left] + {Specific files for fully implicit cell centered method: ccassembler, mesh \\[-5pt] + geometry in ccfvelementgeometry.hh, base classes for model and problem \\[-5pt]definition.}; +\draw [->](c1)--(6.5,2) node [right,text width=12.5cm,align=left] + {Common functionality of cell centered and box formulation: assembling \\[-5pt] + in implicitlocaljacobian.hh, evaluation of partial derivative in \\[-5pt]implicitlocalresidual.hh, base classes for model and problem definition.}; +\draw [->](io)--(6.5,1) node [right,text width=12.5cm,align=left] + {Additional in-/output possibilities like restart files, gnuplot-interface and a VTKWriter \\[-4pt] + extension. Grid Creator files.}; \draw [->](lin)--(6.5,0) node [right,text width=12.5cm,align=left] {Linear solver backend.}; -\draw [->](bin)--(6.5,-1) node [right,text width=12.5cm,align=left] - {Binary coefficients (like binary diffusion coefficients) and those needed for \\[-4pt]the constitutive relationships (e.g. Henry coefficient).}; -\draw [->](comp)--(6.5,-2) node [right,text width=12.5cm,align=left] +\draw [->](bin)--(6.5,-1) node [right,text width=12.5cm,align=left] + {Binary coefficients (like binary diffusion coefficients) and those needed for \\[-4pt] + the constitutive relationships (e.g. Henry coefficient).}; +\draw [->](comp)--(6.5,-2) node [right,text width=12.5cm,align=left] {Properties of a pure chemical substance (e.g. water) \\[-4pt]or pseudo substance (e.g. air).}; -\draw [->](con)--(6.5,-3) node [right,text width=12.5cm,align=left] - {Constraint solvers specify a well defined set of input variables and make \\[-4pt]sure that the resulting fluid state is consistent with a given set of \\[-4pt]thermodynamic equations.}; -\draw [->](eos)--(6.5,-4) node [right,text width=12.5cm,align=left] - {Equations of state (eos) are auxiliary classes which provide relations \\[-4pt]between a fluid phase's temperature, pressure, composition and density.}; -\draw [->](fi)--(6.5,-5) node [right,text width=12.5cm,align=left] +\draw [->](con)--(6.5,-3) node [right,text width=12.5cm,align=left] + {Constraint solvers specify a well defined set of input variables and make \\[-4pt] + sure that the resulting fluid state is consistent with a given set of \\[-4pt]thermodynamic equations.}; +\draw [->](eos)--(6.5,-4) node [right,text width=12.5cm,align=left] + {Equations of state (eos) are auxiliary classes which provide relations \\[-4pt] + between a fluid phase's temperature, pressure, composition and density.}; +\draw [->](fi)--(6.5,-5) node [right,text width=12.5cm,align=left] {Constitutive relationships (e.g. capillary pressure - saturation - curve).}; -\draw [->](fstate)--(6.5,-6) node [right,text width=12.5cm,align=left] - {Fluid states are responsible for representing the complete thermodynamic \\[-4pt]configuration of a system at a given spatial and temporal position.}; -\draw [->](fsys)--(6.5,-7) node [right,text width=12.5cm,align=left] +\draw [->](fstate)--(6.5,-6) node [right,text width=12.5cm,align=left] + {Fluid states are responsible for representing the complete thermodynamic \\[-4pt] + configuration of a system at a given spatial and temporal position.}; +\draw [->](fsys)--(6.5,-7) node [right,text width=12.5cm,align=left] {Fluid systems express the thermodynamic relations between quantities.}; -\draw [->](s)--(6.5,-8) node [right,text width=12.5cm,align=left] - {Base class for all spatially dependent variables, like permeability and \\[-4pt]porosity. Includes spatial averaging routines. All other properties are \\[-4pt]specified in the specific files of the respective models.}; -\draw [->](non)--(6.5,-9) node [right,text width=12.5cm,align=left] +\draw [->](s)--(6.5,-8) node [right,text width=12.5cm,align=left] + {Base class for all spatially dependent variables, like permeability and \\[-4pt] + porosity. Includes spatial averaging routines. All other properties are \\[-4pt] + specified in the specific files of the respective models.}; +\draw [->](non)--(6.5,-9) node [right,text width=12.5cm,align=left] {Newton's method.}; -\draw [->](para)--(6.5,-10) node [right,text width=12.5cm,align=left] +\draw [->](para)--(6.5,-10) node [right,text width=12.5cm,align=left] {Files for parallel programming.}; \end{tikzpicture} -\caption{Structure of the directory \texttt{dumux} containing the \Dumux source files.} +\caption{Structure of the directory \texttt{dumux} containing the \Dumux source files. +\todo[inline]{bei dieser Skizze sollten wir auch schauen ob die noch aktuell ist.}} \label{fig:dumux-structure} \end{sidewaysfigure} - -% \begin{landscape} -% \begin{figure}[hbt] -% \centering -% \includegraphics[width=\linewidth, keepaspectratio]{EPS/dumux_strucutre_flowchart_horizontal_explained.eps} -% \caption{ -% \label{fig:dumux-structure} -% Structure of the directory \texttt{dumux} containing the \Dumux source files. -% } -% \end{figure} -% \end{landscape} - -\input{newFolder} -\input{parameterfiles} -\input{restartsimulations} -\input{guidelines} diff --git a/doc/handbook/TipsNTricks.tex b/doc/handbook/4_tipsandtricks.tex similarity index 98% rename from doc/handbook/TipsNTricks.tex rename to doc/handbook/4_tipsandtricks.tex index 9fb281b4fa180b9be4cada136cfa1d043d86b361..640391930d816ec17ef95bf56fc8429e5b281742 100644 --- a/doc/handbook/TipsNTricks.tex +++ b/doc/handbook/4_tipsandtricks.tex @@ -1,4 +1,4 @@ -\chapter{Tips \& Tricks} +\section{Tips \& Tricks} This chapter tries to be a useful collection of tips and tricks that can be handy when working with \Dumux. One of the most prominent ideas for developing @@ -8,7 +8,7 @@ stating the \emph{tell us dogma}: ``If you found something useful, handy or for other reasons helping when working with \Dumux: put it into this chapter.'' or inform other developers and write to -\section{\Dumux - General Remarks} +\subsection{\Dumux - General Remarks} \paragraph{Flyspray} Flyspray or bug-tracking system is a software application mainly designed to @@ -37,7 +37,7 @@ If you further want to be informed about commits to the dumux can subscribe to the commit mailing list: \url{https://listserv.uni-stuttgart.de/mailman/listinfo/dumux-commits}. -\section{Developing \Dumux} +\subsection{Developing \Dumux} \paragraph{Checking Your Commits:} \Dumux is developed with the help of Subversion (\texttt{svn}). This means that at some point you will commit your new and/or advanced features @@ -137,8 +137,8 @@ Pass the flag \texttt{--only=dumux} to \texttt{dunecontrol} for configuring or b complex example would be the use of an additional grid. Then you have to configure and build only \Dune{}-grid and \Dumux by adding \texttt{--only=dune-grid,dumux} to the \texttt{dunecontrol} call. -\section{External Tools} -\subsection{Subversion (svn)} +\subsection{External Tools} +\subsubsection{Subversion (svn)} Subversion is a software versioning and revision control system. We use Subversion to manage the source code of \Dumux, archive changes and central storage. @@ -167,7 +167,7 @@ How to set the SVN attributes: \item{\em SVN on shell}: \verb+svn propedit svn:ignore .+ \end{itemize} -\subsection{Git} +\subsubsection{Git} Git plays a similar role as Subversion, some see Git as a successor of Subversion. Git is used by \Dune. The basic Git commands are: \begin{itemize} @@ -177,7 +177,7 @@ Git commands are: \item \texttt{git diff} to see the actual changes of a file/folder \end{itemize} -\subsection{Eclipse} +\subsubsection{Eclipse} \paragraph{Using the \Dumux-Eclipse Profile} Everybody using the same profile has the advantage of resulting in less conflicts when different developing environments are used: @@ -190,7 +190,7 @@ when different developing environments are used: % \subsection{kate} -\subsection{ParaView} +\subsubsection{ParaView} \paragraph{Reload Button:} Yes, you read it right. There is script to reload \texttt{pvd} files or series of \texttt{vtu} files since ParaView 4.2. The scripts are available diff --git a/doc/handbook/DumuxFlow.tex b/doc/handbook/5_flowofthings.tex similarity index 80% rename from doc/handbook/DumuxFlow.tex rename to doc/handbook/5_flowofthings.tex index 9222640b95160c4b65961f9f2726a1b1e561bc66..ed67f10b24ba8e752d4a39cd491d6ce560678ae0 100644 --- a/doc/handbook/DumuxFlow.tex +++ b/doc/handbook/5_flowofthings.tex @@ -1,31 +1,50 @@ - -\newcommand{\nextline}{\par\phantom{a}\vspace*{0.1\textwidth}} -\chapter{The flow of things in \Dumux} +\section{The flow of things in \Dumux} \label{flow} -This chapter is supposed to show how things are ``handed around'' in \Dumux. This is not a comprehenisve guide through the modeling framework of \Dumux, but hopefully it will help getting to grips with it. +\todo[inline]{I think here we can delete some portion of text} + +This chapter is supposed to show how things are ``handed around'' in \Dumux. This +is not a comprehenisve guide through the modeling framework of \Dumux, but +hopefully it will help getting to grips with it. -In Section \ref{content} the structure of \Dumux is shown from a \emph{content} point of view. -Section \ref{implementation} is written from the point of view of the \emph{implementation}. These two approaches are linked by the circled numbers (like \textbf{\textcircled{\ref{init}}}) in the flowchart of Section \ref{implementation} corresponding to the enumeration of the list of Section \ref{content}. This is supposed to demonstrate at which point of the program-flow you are content- and implementation-wise. +In Section \ref{content} the structure of \Dumux is shown from a \emph{content} +point of view. +Section \ref{implementation} is written from the point of view of the \emph{implementation}. +These two approaches are linked by the circled numbers (like \textbf{\textcircled{\ref{init}}}) +in the flowchart of Section \ref{implementation} corresponding to the enumeration +of the list of Section \ref{content}. This is supposed to demonstrate at which point +of the program-flow you are content- and implementation-wise. -Section \ref{implementation} is structured by \fbox{boxes} and $\overrightarrow{\textnormal{arrows}}$. Boxes stand for more or less important points in the programm. They may may be reckoned ``step stones''. Likewise, the arrows connect the boxes. If important things happen in between, it is written under the arrows. +Section \ref{implementation} is structured by \fbox{boxes} and +$\overrightarrow{\textnormal{arrows}}$. Boxes stand for more or less important +points in the programm. They may may be reckoned ``step stones''. Likewise, the +arrows connect the boxes. If important things happen in between, it is written +under the arrows. -\fbox{Plain boxes} stand for generic parts of the program. \fbox{\fbox{double}} $\lbrace\lbrace$boundings$\rbrace\rbrace$ stand for the implementatin specific part of the program, like \verb+2p, 2p2c...+. This will be the most important part for most users. \uwave{snakelike lines} tell you that this part is specific to the components considered. +\fbox{Plain boxes} stand for generic parts of the program. \fbox{\fbox{double}} +$\lbrace\lbrace$boundings$\rbrace\rbrace$ stand for the implementation specific +part of the program, like \verb+2p, 2p2c...+. This will be the most important +part for most users. \uwave{snakelike lines} tell you that this part is specific +to the components considered. For keeping things simple, the program flow of a \verb+2p+ model is shown. -There are extensive comments regarding the formating in the tex file: so feel free, to enhance this description. +There are extensive comments regarding the formating in the tex file: so feel free, +to enhance this description. -\section{Structure -- by Content} +\subsection{Structure -- by Content} \label{content} -% by means of this enumerated list, the connection between algorithm and content can be achieved by references to the labels of this list. -This list shows the algorithmic outline of a typical \Dumux run. Each item stands for a characteristic step within the modeling framework. +% by means of this enumerated list, the connection between algorithm and content +% can be achieved by references to the labels of this list. +This list shows the algorithmic outline of a typical \Dumux run. Each item stands +for a characteristic step within the modeling framework. \clearpage -In Figure \ref{fig:algorithm}, the algorithmic representations of both approaches down to the element level are illustrated. +In Figure \ref{fig:algorithm}, the algorithmic representations of both approaches +down to the element level are illustrated. \begin{figure}[hbt] \begin{tabular}{ l | l } - + \begin{minipage}[t]{0.48\textwidth} \setcounter{thingCounter}{0} @@ -34,7 +53,7 @@ In Figure \ref{fig:algorithm}, the algorithmic representations of both approache \begin{tabbing} \textbf{{\begin{turn}{45}\numberThis{main}{init}\end{turn}}} \= \textbf{{\begin{turn}{45}\numberThis{time step}{prep}\end{turn}}} \= -\textbf{{\begin{turn}{45}\numberThis{\textsc{Newton}}{elem}\end{turn}}} \= +\textbf{{\begin{turn}{45}\numberThis{\textsc{Newton}}{elem}\end{turn}}} \= \textbf{{\begin{turn}{45}\numberThis{element}{calc}\end{turn}}} \= \\ \\ initialize \\ @@ -67,7 +86,7 @@ finalize \end{minipage} -& +& \begin{minipage}[t]{0.48\textwidth} \setcounter{thingCounter}{0} @@ -77,7 +96,7 @@ finalize \begin{tabbing} \textbf{{\begin{turn}{45}1. main\end{turn}}} \= \textbf{{\begin{turn}{45}2. time step\end{turn}}} \= -\textbf{{\begin{turn}{45}3. \textsc{IMPES/C}\end{turn}}} \= +\textbf{{\begin{turn}{45}3. \textsc{IMPES/C}\end{turn}}} \= \textbf{{\begin{turn}{45}4. element\end{turn}}} \= \\ \\ initialize \\ @@ -115,23 +134,28 @@ finalize \end{minipage} \end{tabular} -\caption{Structure of a coupled fully-implicit (\textbf{left}) and a decoupled semi-implicit (\textbf{right}) scheme in \Dumux.} +\caption{Structure of a coupled fully-implicit (\textbf{left}) and a decoupled +semi-implicit (\textbf{right}) scheme in \Dumux.} \label{fig:algorithm} \end{figure} -\subsection{Levels} +\subsubsection{Levels} \textcircled{\ref{init}} main\\ \textcircled{\ref{prep}} time step\\ \textcircled{\ref{elem}} \textsc{Newton} step\\ \textcircled{\ref{calc}} Element-wise assembly -\section{Structure -- by Implementation} +\subsection{Structure -- by Implementation} \label{implementation} -This section is supposed to help you in getting an idea how things are handled in \Dumux and in which files things are written down. -This is not intuitivly clear, therefore it is mentioned for each \fbox{step-stone}. \textbf{called by} tells you from which file a function is -accessed. \textbf{implemented in} tells you in which file the function is written down. The name of the function is set in \verb+typewriter+. -Being a function is indicated by round brackets \verb+()+ but only the function name is given and not the full signature (arguments...) . +This section is supposed to help you in getting an idea how things are handled in +\Dumux and in which files things are written down. +This is not intuitivly clear, therefore it is mentioned for each \fbox{step-stone}. +\textbf{called by} tells you from which file a function is +accessed. \textbf{implemented in} tells you in which file the function is written +down. The name of the function is set in \verb+typewriter+. +Being a function is indicated by round brackets \verb+()+ but only the function +name is given and not the full signature (arguments...) . Comments regarding the events within one step-stone are set \scriptsize{smaller}. @@ -143,7 +167,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \setlength{\voffset}{4.2cm} %%README!!! it is important NOT to leave any blank lines, as multiple boxes are supposed to be in one line %% Unfortunately, blank lines need to be inserted manually if one box is lapping over the page border -%% by means of \newline, a new line plus some extra space can be inserted, which has unfortunately to be done after each line +%% by means of \newline, a new line plus some extra space can be inserted, which has unfortunately to be done after each line %% \newline is defined at the beginning of this file %% sometimes \texttt{} is used (in stead of \verb), as it is not possible to have ANY environment within \verb. %% If multiple lines are supposed to be under one arrow, I used an align environment and switched back to \textnormal for each line @@ -155,10 +179,10 @@ Being a function is indicated by round brackets \verb+()+ but only the function % \textbf{\textcircled{\ref{calc}}}\verb+ctl.newtonEnd()+ \\ % this is the line for showing code. also in this line the circled numbers are printed, that show the connection to the content wise structure. The numbers are realized as references to the enumerated list. bold! % \begin{scriptsize}\end{scriptsize}\\ % \textbf{called by}:\\ %one line in the box/ table: ``called by'' is set in bold face -% \textbf{implemented in}: \\ %another line in the box / table +% \textbf{implemented in}: \\ %another line in the box / table % \hline % this line is smaller textsize for writing comments \hline makesthe bottom bar of the box % \end{tabular} -% $\overrightarrow{\scriptsize % this is the arrow connecting two boxes. In can carry text. +% $\overrightarrow{\scriptsize % this is the arrow connecting two boxes. In can carry text. % \begin{array}{l} % if the arrow is supposed to carry multiple lines, an array is inserted. % \textnormal{timemanager.hh}\\ % formating within an array is tiring. Each line needs its own set of size and textnormal % \textbf{\textcircled{\ref{prep}}} \rightarrow \textbf{\textcircled{\ref{init}}} @@ -168,7 +192,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{init}}}\verb+start()+ \\ \begin{scriptsize}start the simulation\end{scriptsize}\\ \textbf{called by}: main() \\ - \textbf{implemented in}: start.hh \\ + \textbf{implemented in}: start.hh \\ \hline \end{tabular} $\overrightarrow{}$ @@ -176,17 +200,17 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{init}}}\verb+timeManager.init()+ \\ \begin{scriptsize}initialization\end{scriptsize}\\ \textbf{called by}: start() \\ - \textbf{implemented in}: timemanager.hh \\ + \textbf{implemented in}: timemanager.hh \\ \hline \end{tabular} $\overrightarrow{}$ \begin{tabular}{|l|}\hline - \textbf{\textcircled{\ref{init}}}\verb+timeManager.run()+\\ + \textbf{\textcircled{\ref{init}}}\verb+timeManager.run()+\\ \begin{scriptsize}\end{scriptsize}\\ \textbf{called by}: {start()}\\ - \textbf{implemented in}: {timemanager.hh}\\ + \textbf{implemented in}: {timemanager.hh}\\ \hline - \end{tabular} + \end{tabular} {\scriptsize $\overrightarrow{ %an arrow under which things may be written \begin{array}{l} % in order to be able to write multiple lines under the arrow @@ -199,9 +223,9 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{prep}}}\verb+problem->timeIntegration()+ \\ \begin{scriptsize}execute time integration scheme \end{scriptsize}\\ \textbf{called by}: timemanager.hh\\ - \textbf{implemented in}: implicitproblem.hh\\ + \textbf{implemented in}: implicitproblem.hh\\ \hline - \end{tabular} + \end{tabular} \nextline {\scriptsize$\overrightarrow{ \begin{array}{l} @@ -214,7 +238,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{prep}}}\verb+model->update()+ \\ \begin{scriptsize}sth like numerical model\end{scriptsize}\\ \textbf{called by}: implicitproblem.hh\\ - \textbf{implemented in}: implicitmodel.hh\\ + \textbf{implemented in}: implicitmodel.hh\\ \hline \end{tabular} {\scriptsize$\overrightarrow{ }$} @@ -225,7 +249,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function % % \begin{scriptsize}\textbf{applies Dirichlets}\end{scriptsize}\\ % % \begin{scriptsize}\textbf{not applied here any mroe}\end{scriptsize}\\ % % \textbf{called by}: boxscheme.hh\\ -% % \textbf{implemented in}: boxscheme.hh\\ +% % \textbf{implemented in}: boxscheme.hh\\ % % \hline % % \end{tabular} % % @@ -234,7 +258,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function % % \textnormal{\texttt{while(true)}loop} \\ % % \rightarrow \textnormal{until converged} % % \end{array} } $} -% % +% % \begin{tabular}{|l|} \hline \textbf{\textcircled{\ref{prep}}}\verb+solver.execute()+ \\ @@ -244,35 +268,35 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textnormal{catching errors} \end{array}$\end{scriptsize}\\ \textbf{called by}: implicitmodel.hh\\ - \textbf{implemented in}: newtonmethod.hh : $\texttt{execute\_()}$\\ + \textbf{implemented in}: newtonmethod.hh : $\texttt{execute\_()}$\\ \hline \end{tabular} \nextline $\overrightarrow{ \begin{array}{l} \textbf{\textcircled{\ref{prep}}} \rightarrow \textbf{\textcircled{\ref{elem}}}\\ \texttt{while(ctl.newtonProceed())}\\ - \textnormal{uLastIter = uCurrentIter(model.uCur())} + \textnormal{uLastIter = uCurrentIter(model.uCur())} \end{array} }$ \begin{tabular}{|l|} - \hline + \hline \textbf{\textcircled{\ref{elem}}}\verb+jacobianAsm.assemble()+ \\ \begin{scriptsize}linearize the problem: \end{scriptsize}\\ \begin{scriptsize}add all element contributions to global \textsc{Jacobian} and global residual\end{scriptsize}\\ \textbf{called by}: newtonmethod.hh\\ - \textbf{implemented in}: implicitassembler.hh\\ + \textbf{implemented in}: implicitassembler.hh\\ \hline \end{tabular} \nextline $\overrightarrow{ }$ \begin{tabular}{|l|} - \hline + \hline \textbf{\textcircled{\ref{elem}}}\verb+resetSystem_()+ \\ \begin{scriptsize} set r.h.s. (i.e. residual) and\end{scriptsize}\\ \begin{scriptsize} set \textsc{Jacobian} to zero \end{scriptsize}\\ \textbf{called by}: implicitassembler.hh\\ - \textbf{implemented in}: implicitassembler.hh\\ + \textbf{implemented in}: implicitassembler.hh\\ \hline \end{tabular} {\scriptsize$\overrightarrow{\begin{array}{l} @@ -285,7 +309,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{calc}}}\verb+assembleElement_()+ \\ \begin{scriptsize}call local \textsc{Jacobian} and residual assembly\end{scriptsize}\\ \textbf{called by}: implicitassembler.hh\\ - \textbf{implemented in}: implicitassembler.hh\\ + \textbf{implemented in}: implicitassembler.hh\\ \hline \end{tabular} \nextline @@ -298,7 +322,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}reset local \textsc{Jacobian} to 0\end{scriptsize}\\ \begin{scriptsize}update types of boundaries on this element\end{scriptsize}\\ \textbf{called by}: implicitassembler.hh\\ - \textbf{implemented in}: implicitlocaljacobian.hh\\ + \textbf{implemented in}: implicitlocaljacobian.hh\\ \hline \end{tabular} $\overrightarrow{ @@ -309,7 +333,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}call model specific update of quantities defined for the volume:\end{scriptsize}\\ \begin{scriptsize}variables for the \emph{current and previous timestep...!!}\end{scriptsize}\\ \textbf{called by}: implicitlocaljacobian.hh\\ - \textbf{implemented in}: implicitelementvolumevariables.hh\\ + \textbf{implemented in}: implicitelementvolumevariables.hh\\ \hline \end{tabular} \nextline @@ -320,7 +344,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{calc}}}\verb+update()+ \\ \begin{scriptsize}calculate all two-phase specific quantites defined in the volume\end{scriptsize}\\ \textbf{called by}: boxelementvolumevariables.hh\\ - \textbf{implemented in}: 2pvolumevariables.hh\\ + \textbf{implemented in}: 2pvolumevariables.hh\\ \hline\hline \end{tabular} $\overrightarrow{ @@ -330,7 +354,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{calc}}}\verb+completeFluidState()+ \\ \begin{scriptsize}calculate all required fluid properties from the primary variables\end{scriptsize}\\ \textbf{called by}: 2pvolumevariables.hh\\ - \textbf{implemented in}: 2pvolumevariables.hh\\ + \textbf{implemented in}: 2pvolumevariables.hh\\ \hline\hline \end{tabular} \nextline @@ -338,16 +362,16 @@ Being a function is indicated by round brackets \verb+()+ but only the function }$ \begin{tabular}{||l||} \uwave{\mbox{\phantom{\textbf{\textcircled{\ref{calc}}}+ e.g: density\_ = Fluidsystem::phaseDensity()+ bissl}}} -\\ +\\ \textbf{\textcircled{\ref{calc}}}\verb+ e.g: rho = Fluidsystem::density()+ \\ \verb+ fluidState.setDensity(phaseIdx,rho)+ \\ \begin{scriptsize}The fluid system does the real work: \end{scriptsize}\\ \begin{scriptsize}calculates densities, diffusivities ... \end{scriptsize}\\ \begin{scriptsize}The fluidstate save and provides them. \end{scriptsize}\\ \textbf{called by}: 2pvolumevariables.hh\\ - \textbf{implemented in}: 2pvolumevariables.hh\\ + \textbf{implemented in}: 2pvolumevariables.hh\\ \uwave{\mbox{\phantom{\textbf{\textcircled{\ref{calc}}}+ e.g: density\_ = Fluidsystem::phaseDensity()+ bissl}}} -\\ +\\ \end{tabular} $\overrightarrow{ }$ @@ -357,7 +381,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}the element's local residual is calculated:\end{scriptsize}\\ \begin{scriptsize}see the next two stepstones\end{scriptsize}\\ \textbf{called by}: implicitlocaljacobian.hh\\ - \textbf{implemented in}: boxlocalresidual.hh\\ + \textbf{implemented in}: boxlocalresidual.hh\\ \hline \end{tabular} $\overrightarrow{ @@ -368,7 +392,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}evaluate the fluxes going into each finite volume\end{scriptsize}\\ \begin{scriptsize}how this is done is \fbox{\fbox{model specific}} (see below)\end{scriptsize}\\ \textbf{called by}: boxlocalresidual.hh\\ - \textbf{implemented in}: boxlocalresidual.hh\\ + \textbf{implemented in}: boxlocalresidual.hh\\ \hline \end{tabular} \nextline @@ -378,7 +402,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{calc}}}\verb+computeFluxes()+ \\ \begin{scriptsize}model specific flux computation \end{scriptsize}\\ \textbf{called by}: boxlocalresidual.hh\\ - \textbf{implemented in}: 2plocalresidual.hh\\ + \textbf{implemented in}: 2plocalresidual.hh\\ \hline\hline \end{tabular} $\overrightarrow{ @@ -389,7 +413,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}this is a call to a constructor: \end{scriptsize}\\ \begin{scriptsize}calculate the velocities \end{scriptsize}\\ \textbf{called by}: 2plocalresidual.hh\\ - \textbf{implemented in}: boxdarcyfluxvariables.hh\\ + \textbf{implemented in}: boxdarcyfluxvariables.hh\\ \hline\hline \end{tabular} $\overrightarrow{ @@ -399,7 +423,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \textbf{\textcircled{\ref{calc}}}\verb+computeAdvectiveFlux()+ (other models: also diffusive)\\ \scriptsize{upwinding decision via \verb+massUpwindWeight_+}\\ \textbf{called by}: 2plocalresidual.hh\\ - \textbf{implemented in}: 2plocalresidual.hh\\ + \textbf{implemented in}: 2plocalresidual.hh\\ \hline\hline \end{tabular} \nextline @@ -411,7 +435,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}evaluate the storage and source terms for each finite volume\end{scriptsize}\\ \begin{scriptsize}how this is done is \fbox{\fbox{model specific}} (see below)\end{scriptsize}\\ \textbf{called by}: boxlocalresidual.hh\\ - \textbf{implemented in}: boxlocalresidual.hh\\ + \textbf{implemented in}: boxlocalresidual.hh\\ \hline \end{tabular} $\overrightarrow{ @@ -422,7 +446,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}deal with the boundary conditions\end{scriptsize}\\ \begin{scriptsize}may be \fbox{\fbox{model specific}}\end{scriptsize}\\ \textbf{called by}: boxlocalresidual.hh\\ - \textbf{implemented in}: boxlocalresidual.hh (or modelspecific)\\ + \textbf{implemented in}: boxlocalresidual.hh (or modelspecific)\\ \hline \end{tabular} $\overrightarrow{ @@ -434,7 +458,7 @@ Being a function is indicated by round brackets \verb+()+ but only the function \begin{scriptsize}a property chooses backward/central/foward differences\end{scriptsize}\\ \begin{scriptsize}here: central differences\end{scriptsize}\\ \textbf{called by}: implicitlocaljacobian.hh\\ - \textbf{implemented in}: implicitlocaljacobian.hh\\ + \textbf{implemented in}: implicitlocaljacobian.hh\\ \hline \end{tabular} \nextline @@ -466,16 +490,16 @@ $\left \lbrace \end{minipage} \hspace{.25\textwidth} {\scriptsize$\overrightarrow{}$ } - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{calc}}}\verb+assembleElement_()+ \\ - \verb+model_().localJacobian().assemble()+ \\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{calc}}}\verb+assembleElement_()+ \\ + \verb+model_().localJacobian().assemble()+ \\ \begin{scriptsize}Residual of the current solution is now\end{scriptsize}\\ \begin{scriptsize}``numerically differentiated'', for the element i.e.\end{scriptsize}\\ \begin{scriptsize}the local \textsc{Jacobian} matrix is calculated. \end{scriptsize}\\ - \textbf{called by}: implicitassembler.hh \\ - \textbf{implemented in}: implicitassembler.hh\\ - \hline + \textbf{called by}: implicitassembler.hh \\ + \textbf{implemented in}: implicitassembler.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{}$ } $\left| @@ -486,55 +510,55 @@ $\left \lbrace \end{array} \right |$ {\scriptsize$\overrightarrow{}$ } - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{calc}}}\verb?resdidual_[globI]+=? \\ - \verb? model_().globalJacobian().resdidual(i)? \\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{calc}}}\verb?resdidual_[globI]+=? \\ + \verb? model_().globalJacobian().resdidual(i)? \\ \begin{scriptsize}Add to global residual.\end{scriptsize}\\ - \textbf{called by}: continuing in the function. \\ - \textbf{implemented in}: implicitassembler.hh\\ - \hline + \textbf{called by}: continuing in the function. \\ + \textbf{implemented in}: implicitassembler.hh\\ + \hline \end{tabular} \nextline - {\scriptsize$\overrightarrow{ - \begin{array}{l} + {\scriptsize$\overrightarrow{ + \begin{array}{l} \textnormal{loop vertices}\\ \textnormal{of an element} \end{array}}$} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{calc}}}\verb?(*matrix_)[globI][globJ] +=? \\ - \verb? model_().localJacobian().mat(i,j)? \\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{calc}}}\verb?(*matrix_)[globI][globJ] +=? \\ + \verb? model_().localJacobian().mat(i,j)? \\ \begin{scriptsize}Add to global \textsc{Jacobian}.\end{scriptsize}\\ - \textbf{called by}: continuing in the function. \\ - \textbf{implemented in}: implicitassembler.hh\\ - \hline + \textbf{called by}: continuing in the function. \\ + \textbf{implemented in}: implicitassembler.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{ \begin{array}{l} \textbf{\textcircled{\ref{calc}}}\rightarrow\textbf{\textcircled{\ref{elem}}}\\ \end{array} }$} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb?assemble()? \\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb?assemble()? \\ \begin{scriptsize}Assembling of elements to global quantities is done.\end{scriptsize}\\ %\begin{scriptsize}In case: print partial assembling stuff\end{scriptsize}\\ - \textbf{called by}: continuing in the function. \\ - \textbf{implemented in}: implicitassembler.hh\\ - \hline + \textbf{called by}: continuing in the function. \\ + \textbf{implemented in}: implicitassembler.hh\\ + \hline \end{tabular} \nextline {$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb?while newtonProceed() ?\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb?while newtonProceed() ?\\ \begin{scriptsize}Print information.\end{scriptsize}\\ \begin{scriptsize}start/ stop timer.\end{scriptsize}\\ - \textbf{called by}: continuing in the function, $\texttt{execute\_()}$ \\ - \textbf{implemented in}: newtonmethod.hh\\ - \hline + \textbf{called by}: continuing in the function, $\texttt{execute\_()}$ \\ + \textbf{implemented in}: newtonmethod.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow {\begin{array}{l} @@ -543,76 +567,76 @@ $\left \lbrace \textnormal{solved for later)}\\ \end{array}} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb?newtonSolveLinear() ?\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb?newtonSolveLinear() ?\\ \begin{scriptsize}Ask the linear solver to solve the system.\end{scriptsize}\\ \begin{scriptsize}i.e. : give \textsc{Jacobian}(matrix), delta(x), r.h.s.(residual) to linear solver\end{scriptsize}\\ \begin{scriptsize}$\nabla r(x^k) \cdot \Delta x^k = r(x^k)$\end{scriptsize}\\ \begin{scriptsize}tricky: each \textsc{Newton}step solves a linear system of equations. \end{scriptsize}\\ - \textbf{called by}: continuing in the function, $\texttt{execute\_()}$. \\ - \textbf{implemented in}: newtonmethod.hh\\ - \hline + \textbf{called by}: continuing in the function, $\texttt{execute\_()}$. \\ + \textbf{implemented in}: newtonmethod.hh\\ + \hline \end{tabular} \nextline {\scriptsize$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb+newtonSolveLinear()+\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb+newtonSolveLinear()+\\ \begin{scriptsize}Catching errors.\end{scriptsize}\\ - \textbf{called by}: newtonmethod.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \textbf{called by}: newtonmethod.hh\\ + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb+linearSolver_.solve()+\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb+linearSolver_.solve()+\\ \begin{scriptsize}Solve the linear system with the chosen backend.\end{scriptsize}\\ - \textbf{called by}: newtoncontroller.hh\\ - \textbf{implemented in}: boxlinearsolver.hh\\ - \hline + \textbf{called by}: newtoncontroller.hh\\ + \textbf{implemented in}: boxlinearsolver.hh\\ + \hline \end{tabular} \nextline {\scriptsize$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb+ctl.newtonUpdate()+\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb+ctl.newtonUpdate()+\\ \begin{scriptsize}We solved for the change in solution, but need the solution:\end{scriptsize}\\ \begin{scriptsize}Calculate current (this iteration) solution\end{scriptsize}\\ \begin{scriptsize}\quad from last (iteration) solution and current (iteration) change in solution:\end{scriptsize}\\ - \begin{scriptsize} $x^{k+1} = x^k - \Delta x^k$ where $\Delta x^k = (\nabla r(x^k))^{-1} \cdot r(x^k)$\end{scriptsize}\\ - \textbf{called by}: newtonmethod.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \begin{scriptsize} $x^{k+1} = x^k - \Delta x^k$ where $\Delta x^k = (\nabla r(x^k))^{-1} \cdot r(x^k)$\end{scriptsize}\\ + \textbf{called by}: newtonmethod.hh\\ + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb+newtonupdateRelError()+\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb+newtonupdateRelError()+\\ \begin{scriptsize}calculate the \emph{relative error} between two iterations\end{scriptsize}\\ \begin{scriptsize}\quad find the prim. var. that changed most between \end{scriptsize}\\ \begin{scriptsize}\quad last(\verb+uLastIter+) and current (\verb+uCurrentIter+) \end{scriptsize}\\ \begin{scriptsize}\quad \textsc{Newton} iteration.\end{scriptsize}\\ - \textbf{called by}: newtoncontroller.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \textbf{called by}: newtoncontroller.hh\\ + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} \nextline {\scriptsize$\overrightarrow{} $} - \begin{tabular}{|l|} - \hline - \textbf{\textcircled{\ref{elem}}}\verb+ctl.newtonEndStep()+\\ + \begin{tabular}{|l|} + \hline + \textbf{\textcircled{\ref{elem}}}\verb+ctl.newtonEndStep()+\\ \begin{scriptsize}Increase counter for number of \textsc{Newton} steps. \end{scriptsize}\\ \begin{scriptsize}Print info. \end{scriptsize}\\ - \textbf{called by}: newtonmethod.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \textbf{called by}: newtonmethod.hh\\ + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow {\begin{array}{l} @@ -631,19 +655,19 @@ $\left \lbrace \begin{tabular}{|l|} \hline \textbf{\textcircled{\ref{prep}}}\verb+ctl.newtonEnd()+ \\ - \begin{scriptsize}Tell the controller we are done\end{scriptsize}\\ + \begin{scriptsize}Tell the controller we are done\end{scriptsize}\\ \textbf{called by}: newtonmethod.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{ }$} \begin{tabular}{|l|} \hline \textbf{\textcircled{\ref{prep}}}\verb+asImp_().updateSuccessful()+ \\ - \begin{scriptsize}Can be filled by the \fbox{\fbox{model}}.\end{scriptsize}\\ + \begin{scriptsize}Can be filled by the \fbox{\fbox{model}}.\end{scriptsize}\\ \textbf{called by}: implicitmodel.hh\\ - \textbf{implemented in}: implicitmodel.hh\\ - \hline + \textbf{implemented in}: implicitmodel.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow {\begin{array}{l} @@ -654,10 +678,10 @@ $\left \lbrace \hline \textbf{\textcircled{\ref{prep}}}\verb+problem_.postTimeStep(),writeOutput()+ \\ \begin{scriptsize}Give the \fbox{\fbox{problem}} the chance to\end{scriptsize}\\ - \begin{scriptsize}post-process the solution.\end{scriptsize}\\ + \begin{scriptsize}post-process the solution.\end{scriptsize}\\ \textbf{called by}: timemanager.hh\\ - \textbf{implemented in}: implicitproblem.hh\\ - \hline + \textbf{implemented in}: implicitproblem.hh\\ + \hline \end{tabular} \nextline {\scriptsize$\overrightarrow @@ -671,10 +695,10 @@ $\left \lbrace \begin{tabular}{|l|} \hline \textbf{\textcircled{\ref{prep}}}\verb+newtonCtl_.suggestTimestepSize()+ \\ - \begin{scriptsize}Determine new time step size from number of \textsc{Newton} steps. \end{scriptsize}\\ + \begin{scriptsize}Determine new time step size from number of \textsc{Newton} steps. \end{scriptsize}\\ \textbf{called by}: timemanager.hh, implicitproblem.hh\\ - \textbf{implemented in}: newtoncontroller.hh\\ - \hline + \textbf{implemented in}: newtoncontroller.hh\\ + \hline \end{tabular} {\scriptsize$\overrightarrow{}$} {\scriptsize$\overrightarrow{ @@ -688,8 +712,8 @@ $\left \lbrace % \textbf{\textcircled{\ref{calc}}}\verb++ \\ % \begin{scriptsize}\end{scriptsize}\\ % \textbf{called by}:\\ -% \textbf{implemented in}: \\ -% \hline +% \textbf{implemented in}: \\ +% \hline % \end{tabular} % $\overrightarrow{\scriptsize % }$ @@ -698,11 +722,11 @@ $\left \lbrace \end{landscape} \normalsize -\newpage +\newpage % Original pagestyle (headings and footer) were switched off, in order to get mroe space for the flowchart. \pagestyle{scrheadings} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "dumux-handbook" -%%% End: +%%% End: diff --git a/doc/handbook/fluidframework.tex b/doc/handbook/5_fluidframework.tex similarity index 97% rename from doc/handbook/fluidframework.tex rename to doc/handbook/5_fluidframework.tex index 6805da04d1d83c178b9bbef8d17943fa956a65e4..6507d988076972e256d6d7d4c205e350ad5d54c9 100644 --- a/doc/handbook/fluidframework.tex +++ b/doc/handbook/5_fluidframework.tex @@ -1,4 +1,4 @@ -\chapter{The \Dumux Fluid Framework} +\section{The \Dumux Fluid Framework} \label{sec:fluidframework} This chapter discusses the \Dumux fluid framework. \Dumux users who @@ -8,7 +8,7 @@ configurations may skip this chapter. In the chapter, a high level overview over the the principle concepts is provided first, then some implementation details follow. -\section{Overview of the Fluid Framework} +\subsection{Overview of the Fluid Framework} The \Dumux fluid framework currently features the following concepts (listed roughly in their order of importance): @@ -61,12 +61,12 @@ The \Dumux fluid framework currently features the following concepts coefficients has not been standardized in \Dumux. \end{description} -\section{Fluid States} +\subsection{Fluid States} Fluid state objects express the complete thermodynamic state of a -system at a given spatial and temporal position. +system at a given spatial and temporal position. -\subsection{Exported Constants} +\subsubsection{Exported Constants} {\bf All} fluid states {\bf must} export the following constants: \begin{description} @@ -75,7 +75,7 @@ system at a given spatial and temporal position. species or pseudo-species. \end{description} -\subsection{Accessible Thermodynamic Quantities} +\subsubsection{Accessible Thermodynamic Quantities} Also, {\bf all} fluid states {\bf must} provide the following methods: \begin{description} @@ -158,8 +158,8 @@ Also, {\bf all} fluid states {\bf must} provide the following methods: \item[viscosity():] Returns the dynamic viscosity $\mu_\alpha$ of fluid phase $\alpha$. \end{description} - -\subsection{Available Fluid States} + +\subsubsection{Available Fluid States} Currently, the following fluid states are provided by \Dumux: \begin{description} \item[NonEquilibriumFluidState:] This is the most general fluid state @@ -192,12 +192,12 @@ Currently, the following fluid states are provided by \Dumux: phase pressures. \end{description} -\section{Fluid Systems} +\subsection{Fluid Systems} Fluid systems express the thermodynamic relations between the quantities of a fluid state. -\subsection{Parameter Caches} +\subsubsection{Parameter Caches} All fluid systems must export a type for their \texttt{ParameterCache} objects. Parameter caches can be used to cache parameter that are @@ -247,7 +247,7 @@ changed, it is possible to only define the \texttt{updatePhase()} method and derive the parameter cache from \texttt{Dumux::ParameterCacheBase}. -\subsection{Exported Constants and Capabilities} +\subsubsection{Exported Constants and Capabilities} Besides providing the type of their \texttt{ParameterCache} objects, fluid systems need to export the following constants and auxiliary @@ -282,7 +282,7 @@ methods: the corresponding component. \end{description} -\subsection{Thermodynamic Relations} +\subsubsection{Thermodynamic Relations} Fluid systems have been explicitly designed to provide as few thermodynamic relations as possible. A full-fledged fluid system thus @@ -302,18 +302,18 @@ only needs to provide the following thermodynamic relations: parameter cache, a phase and a component index, return the calculate the molecular diffusion coefficient for the component in the fluid phase. - + Molecular diffusion of a component $\kappa$ in phase $\alpha$ is caused by a gradient of the chemical potential and follows the law - \[ + \[ J^\kappa_\alpha = - D^\kappa_\alpha\ \mathbf{grad} \zeta^\kappa_\alpha\;, - \] + \] where $\zeta^\kappa_\alpha$ is the component's chemical potential, $D^\kappa_\alpha$ is the diffusion coefficient and $J^\kappa_\alpha$ is the diffusive flux. $\zeta^\kappa_\alpha$ is connected to the component's fugacity $f^\kappa_\alpha$ by the relation - \[ - \zeta^\kappa_\alpha = + \[ + \zeta^\kappa_\alpha = R T_\alpha \mathrm{ln} \frac{f^\kappa_\alpha}{p_\alpha} \;. \] \item[binaryDiffusionCoefficient():] Given a fluid state, an @@ -350,7 +350,7 @@ throw an exception of type \lstinline{Dune::NotImplemented} instead. Obviously, such fluid systems cannot be used for models that depend on those methods. -\subsection{Available Fluid Systems} +\subsubsection{Available Fluid Systems} Currently, the following fluid systems are available in \Dumux: \begin{description} @@ -386,7 +386,7 @@ Currently, the following fluid systems are available in \Dumux: mixtures\cite{SPE5}. \end{description} -\section{Constraint Solvers} +\subsection{Constraint Solvers} \label{sec:constraint_solvers} Constraint solvers connect the thermodynamic relations expressed by @@ -414,7 +414,7 @@ provides the following constraint solvers: \end{eqnarray*} where $p_{c\beta\alpha}$ is the capillary pressure between the fluid phases $\beta$ and $\alpha$. -\item[CompositionalFlash:] A compositional 2p2c flash solver for the +\item[CompositionalFlash:] A compositional 2p2c flash solver for the sequential models in \Dumux. Input is temperature, phase pressures and feed mass fraction, the solver computes the compositional variables and saturations. @@ -444,7 +444,7 @@ saturations. \sum_{\alpha=1}^M \saturation_\alpha = 1 \] \item $M - 1$ constraints are given by the capillary pressures: - \[ + \[ p_\beta = p_\alpha + p_{c\beta\alpha} \;, \] for all phases $\alpha$, $\beta$ @@ -470,7 +470,7 @@ system of equations is closed. non-ideal mixtures. \end{description} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "dumux-handbook" -%%% End: +%%% End: diff --git a/doc/handbook/models.tex b/doc/handbook/5_models.tex similarity index 63% rename from doc/handbook/models.tex rename to doc/handbook/5_models.tex index ce82446ed4d71ca3710c74027c10acb99ca6a1f5..12febf4491f3fd4e3070f986ff57d91f2d100b64 100644 --- a/doc/handbook/models.tex +++ b/doc/handbook/5_models.tex @@ -1,10 +1,12 @@ -\chapter[The \Dumux Models]{Physical and Numerical Models Available in \Dumux} +\section[The \Dumux Models]{Physical and Numerical Models Available in \Dumux} +\todo[inline]{Evtl. könnten wir das in zwei kapitel aufsplitten? Physical und numerical + models} -\section{Physical and Mathematical Description} +\subsection{Physical and Mathematical Description} Characteristic of compositional multiphase models is that the phases are not only matter of a single chemical substance. Instead, their -composition in general includes several species, and for the mass transfer, +composition in general includes several species, and for the mass transfer, the component behavior is quite different from the phase behavior. In the following, we give some basic definitions and assumptions that are required for the formulation of the model concept below. As an example, we take a @@ -13,11 +15,11 @@ three-phase three-component system water-NAPL-gas systems is straightforward and can be found, e.\ g., in \cite{A3:bielinski:2006,A3:acosta:2006}. -\subsection{Basic Definitions and Assumptions for the Compositional +\subsubsection{Basic Definitions and Assumptions for the Compositional Model Concept} \textbf{Components:} The term {\it component} stands for constituents of the phases which -can be associated with a unique chemical species, or, more generally, with +can be associated with a unique chemical species, or, more generally, with a group of species exploiting similar physical behavior. In this work, we assume a water-gas-NAPL system composed of the phases water (subscript $\text{w}$), gas ($\text{g}$), and NAPL ($\text{n}$). These phases are @@ -53,7 +55,7 @@ composed of the components water (superscript $\text{w}$), air %A-B \draw [<->,white](0.5,1.8)--(-1.6,3.6) node[black,above,sloped,pos=0.5]{adsorption}; \draw [<->](0.5,1.8)--(-1.6,3.6) node[below,sloped,pos=0.5]{desorption}; - %B-C + %B-C \draw[<-](-1,5.4)--(4,5.4)node[above,sloped,pos=0.5]{condensation, dissolution}; \draw[->](-1,4.5)--(4,4.5)node[above,sloped,pos=0.5]{evaporation, degassing}; %B-D @@ -61,7 +63,7 @@ composed of the components water (superscript $\text{w}$), air %D-C \draw[->](3.6,8.9)--(5.2,7)node[above,sloped,pos=0.5]{evaporation}; \draw[rotate around={-51:(4,6.8)}](3.35,7.95) ellipse (1.5cm and 0.45cm); %Ellipse um evaporation - \draw (3.6,9.22)--(8,9.5)--(5.45,6.9); + \draw (3.6,9.22)--(8,9.5)--(5.45,6.9); \draw[<-](3,8.3)--(4.5,6.5)node[above,sloped,pos=0.55]{condensation}; % thermal energy \filldraw [black!40](8.5,9.5)rectangle(11,8.5); @@ -92,12 +94,12 @@ For the non-isothermal multiphase processes in porous media under consideration, we state that the assumption of local thermal equilibrium is valid since flow velocities are small. We neglect chemical reactions and biological decomposition and assume chemical -equilibrium. Mechanical equilibrium is not valid in a porous medium, +equilibrium. Mechanical equilibrium is not valid in a porous medium, since discontinuities in pressure can occur across a fluid-fluid interface due to capillary effects. -\textbf{Notation:} The index $\alpha \in \{\text{w}, \text{n}, \text{g}\}$ refers -to the phase, while the superscript $\kappa \in \{\text{w}, \text{a}, \text{c}\}$ refers +\textbf{Notation:} The index $\alpha \in \{\text{w}, \text{n}, \text{g}\}$ refers +to the phase, while the superscript $\kappa \in \{\text{w}, \text{a}, \text{c}\}$ refers to the component. \\ \begin{tabular}{llll} $p_\alpha$ & phase pressure & $\phi$ & porosity \\ @@ -115,7 +117,7 @@ $\boldsymbol{v}_\alpha$ & velocity (Darcy or free flow)& & \\ \end{tabular} -\subsection{Balance Equations} +\subsubsection{Balance Equations} For the balance equations for multicomponent systems, it is in many cases convenient to use a molar formulation of the continuity equation. Considering the mass conservation for each component allows @@ -126,21 +128,21 @@ molar mass balance can be written as: \begin{multline} \label{A3:eqmass1} \phi \frac{\partial (\sum_\alpha \varrho_{\text{mol}, \alpha} - x_\alpha^\kappa S_\alpha )}{\partial t} + x_\alpha^\kappa S_\alpha )}{\partial t} - \sum\limits_\alpha \Div \left\lbrace \frac{k_{\text{r} \alpha}}{\mu_\alpha} \varrho_{\text{mol}, \alpha} x_\alpha^\kappa \textbf{K} (\grad p_\alpha - \varrho_{\alpha} \boldsymbol{g}) \right\rbrace \\ - % + % % - \sum\limits_\alpha \Div \left\lbrace \tau \phi S_\alpha D_\alpha^\kappa \varrho_{\text{mol}, \alpha} \grad x_\alpha^\kappa \right\rbrace - q^\kappa = 0, \qquad \kappa \in \{\text{w,a,c}\}. \end{multline} -The component mass balance can also be written in terms of mass fractions +The component mass balance can also be written in terms of mass fractions by replacing molar densities by mass densities and mole by mass fractions. -To obtain a single conserved quantity in the temporal derivative, the total +To obtain a single conserved quantity in the temporal derivative, the total concentration, representing the mass of one component per unit volume, is defined as \begin{displaymath} C^\kappa = \sum_\alpha \phi S_\alpha \varrho_{\text{mass},\alpha} X_\alpha^\kappa \; . @@ -149,7 +151,7 @@ Using this definition, the component mass balance is written as: \begin{multline} \label{A3:eqmass2} - \frac{\partial C^\kappa}{\partial t} = + \frac{\partial C^\kappa}{\partial t} = \sum\limits_\alpha \Div \left\lbrace \frac{k_{\text{r} \alpha}}{\mu_\alpha} \varrho_{\text{mass}, \alpha} X_\alpha^\kappa \textbf{K} (\grad p_\alpha + @@ -157,14 +159,14 @@ Using this definition, the component mass balance is written as: % % + \sum\limits_\alpha \Div \left\lbrace \tau \phi S_\alpha D_\alpha^\kappa \varrho_{\text{mass}, - \alpha} \frac{M^\kappa}{M_\alpha} \grad x_\alpha^\kappa \right\rbrace + \alpha} \frac{M^\kappa}{M_\alpha} \grad x_\alpha^\kappa \right\rbrace + q^\kappa = 0, \qquad \kappa \in \{\text{w,a,c}\}. \end{multline} In the case of non-isothermal systems, we further have to balance the thermal energy. We assume fully reversible processes, such that entropy -is not needed as a model parameter. Furthermore, we neglect +is not needed as a model parameter. Furthermore, we neglect dissipative effects and the heat transport due to molecular diffusion. The energy balance can then be formulated as: @@ -174,18 +176,18 @@ formulated as: \phi \frac{\partial \left( \sum_\alpha \varrho_{\alpha} u_\alpha S_\alpha \right)}{\partial t} + \left( 1 - \phi \right) \frac{\partial \varrho_{\text{s}} c_{\text{s}} - T}{\partial t} + T}{\partial t} - \Div \left( \lambda_{\text{pm}} \grad T \right) \\ - \sum\limits_\alpha \Div \left\lbrace \frac{k_{\text{r} \alpha}}{\mu_\alpha} \varrho_{\alpha} h_\alpha K \left( \grad p_\alpha - \varrho_{\alpha} - \boldsymbol{g} \right) \right\rbrace + \boldsymbol{g} \right) \right\rbrace - q^h \; = \; 0. \end{multline} In order to close the system, supplementary constraints for capillary pressure, saturations and mole -fractions are needed, \cite{A3:helmig:1997}. +fractions are needed, \cite{A3:helmig:1997}. According to the Gibbsian phase rule, the number of degrees of freedom in a non-isothermal compositional multiphase system is equal to the number of components plus one. This means we need as many independent @@ -193,117 +195,42 @@ unknowns in the system description. The available primary variables are, e.\ g., saturations, mole/mass fractions, temperature, pressures, etc. -\input{spatialdiscretization} +\subsection{Available Models} +The following description of the available models is automatically extracted +from the Doxygen documentation. +\todo[inline]{Die Modelle waren etwas uneinheitlich von der Notation (ich habe + hier auch gerade das entsprechende ToDo entfernt). Das ist naturlich jetzt + nicht mehr so schlimm, da die Modelle nicht mehr untereinander auftauchen, + allerdings wird auch die Fehlersuche schwieriger (aus dem Auge aus dem Sinn).} -\section{Available Models} -The following description of the available models is automatically extracted -from the Doxygen documentation. -% \textbf{TODO}: Unify notation. +\todo[inline]{evtl. entferne Unterkapitel. Einfugen der Modelliste, die könnte + in ahnlicher Form auch aufs doxygen? Update der Liste in die Release Manager + Tasks ubernehmen} -\subsection{Fully-Implicit Models} +\subsubsection{Fully-Implicit Models} -The fully-implicit models described in this section are using the box or the cell centered finite volume method as described in section \ref{box} and \ref{cc} for spatial and the implicit Euler +The fully-implicit models described in this section are using the box or the +cell centered finite volume method as described in section \ref{box} and \ref{cc} +for spatial and the implicit Euler method as temporal discretization. The models themselves are located in subdirectories of \texttt{dumux/implicit} of the \Dumux distribution. -\subsubsection{The Single-Phase Model: OnePModel} -\input{ModelDescriptions/1pimplicitmodel} - -\subsubsection{The Single-Phase,Two-Component Model: OnePTwoCModel} -\input{ModelDescriptions/1p2cimplicitmodel} - -\subsubsection{The Two-Phase Model Using the Richards Assumption: RichardsModel} -\input{ModelDescriptions/richardsimplicitmodel} - -\subsubsection{The Two-Phase MOdel: TwoPModel} -\input{ModelDescriptions/2pimplicitmodel} - -\subsubsection{The Two-Phase, Two-Component Model: TwoPTwoCModel} -\input{ModelDescriptions/2p2cimplicitmodel} - -\subsubsection{The CO2 Model: CO2Model} -\input{ModelDescriptions/co2implicitmodel} - -\subsubsection{The Three-Phase Model: ThreePModel} -\input{ModelDescriptions/3pimplicitmodel} - -\subsubsection{The three-Phase, Three-Component Model: ThreePThreeCModel} -\input{ModelDescriptions/3p3cimplicitmodel} - -\subsubsection{The Non-Isothermal Model: NIModel} -\input{ModelDescriptions/nonisothermalimplicitmodel} - -\subsubsection{The $M$-Phase, $N$-Component Model: MpNcModel} -\input{ModelDescriptions/mpncimplicitmodel} - -\subsubsection{The Two-Phase, Discrete Fracture Model: TwoPDFMModel} -\input{ModelDescriptions/2pdfmimplicitmodel} - -\subsubsection{The Stokes Model: StokesModel} -\input{ModelDescriptions/stokesimplicitmodel} - -\subsubsection{The Isothermal $N$-Component Stokes Model: StokesNcModel} -\input{ModelDescriptions/stokesncimplicitmodel} - -\subsubsection{The Non-Isothermal $N$-Component Stokes Model: StokesNcNIModel} -\input{ModelDescriptions/stokesncniimplicitmodel} - -\subsubsection{The Isothermal Zero Equation (algebraic) Turbulence Model: ZeroeqModel} -\input{ModelDescriptions/zeroeqimplicitmodel} - -\subsubsection{The Isothermal $N$-Component Zero Equation (algebraic) Turbulence Model: ZeroeqNcModel} -\input{ModelDescriptions/zeroeqncimplicitmodel} - -\subsubsection{The Non-Isothermal $N$-Component Zero Equation (algebraic) Turbulence Model: ZeroeqNcNIModel} -\input{ModelDescriptions/zeroeqncniimplicitmodel} - -\subsubsection{The Coupled StokesNcModel - TwoPTwoCModel} -\label{sc_2cstokes2p2c} -\input{ModelDescriptions/2cstokes2p2cmodel} - -\subsubsection{The Coupled StokesNcNIModel - TwoPTwoCNIModel} -\label{sc_2cnistokes2p2cni} -\input{ModelDescriptions/2cnistokes2p2cnimodel} - -\subsubsection{The Coupled ZeroeqNcModel - TwoPTwoCModel} -\input{ModelDescriptions/2czeroeq2p2cmodel} - -\subsubsection{The Coupled ZeroeqNcNIModel - TwoPTwoCNIModel} -\input{ModelDescriptions/2cnizeroeq2p2cnimodel} - -\subsubsection{The Linear Elastic Model: ElasticModel} -\input{ModelDescriptions/elasticmodel} - -\subsubsection{The Linear Elastic One-Phase Two-Component Model: ElOnePTwoCModel} -\input{ModelDescriptions/el1p2cmodel} - -\subsubsection{The Linear Elastic Two-Phase Model: ElTwoPModel} -\input{ModelDescriptions/el2pmodel} - -\subsection{Decoupled Models} -% -The basic idea the so-called decoupled models have in common is to reformulate the equations of multi-phase flow (e.g. Eq. \ref{A3:eqmass1}) into one equation for pressure and equations for phase-/component-/etc. transport. The pressure equation is the sum of the mass balance equations and thus considers the total flow of the fluid system. The new set of equations is considered as decoupled (or weakly coupled) and can thus be solved sequentially. The most popular decoupled model is the so-called fractional flow formulation for two-phase flow which is usually implemented applying an IMplicit Pressure Explicit Saturation algorithm (IMPES). -In comparison to a fully implicit model, the decoupled structure allows the use of different discretization methods for the different equations. The standard method used in the decoupled models is a cell centered finite volume method. Further schemes, so far only available for the two-phase pressure equation, are cell centered finite volumes with multi-point flux approximation (MPFA O-method) and mimetic finite differences. - -An $h$-adaptive implementation of both \nameref{ch:2p_decoupled} and \nameref{ch:2p2c_decoupled} is provided for two dimensions. +\subsubsection{Decoupled Models} % -\subsubsection{The one-phase model} -\input{ModelDescriptions/1pdecoupledmodel} - -\subsubsection{The two-phase model}\label{ch:2p_decoupled} - -\paragraph{Pressure Model} -\input{ModelDescriptions/2pdecoupledpressuremodel} - -\paragraph{Saturation Model} -\input{ModelDescriptions/2pdecoupledsaturationmodel} - -\subsubsection{The Two-Phase, Two-Component Model}\label{ch:2p2c_decoupled} -\input{ModelDescriptions/2p2cdecoupledpressuremodel} -\input{ModelDescriptions/2p2cdecoupledtransportmodel} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: "dumux-handbook" -%%% End: +The basic idea the so-called decoupled models have in common is to reformulate the +equations of multi-phase flow (e.g. Eq. \ref{A3:eqmass1}) into one equation for +pressure and equations for phase-/component-/etc. transport. The pressure equation +is the sum of the mass balance equations and thus considers the total flow of the +fluid system. The new set of equations is considered as decoupled (or weakly coupled) +and can thus be solved sequentially. The most popular decoupled model is the so-called +fractional flow formulation for two-phase flow which is usually implemented applying +an IMplicit Pressure Explicit Saturation algorithm (IMPES). +In comparison to a fully implicit model, the decoupled structure allows the use of +different discretization methods for the different equations. The standard method +used in the decoupled models is a cell centered finite volume method. Further schemes, +so far only available for the two-phase pressure equation, are cell centered finite +volumes with multi-point flux approximation (MPFA O-method) and mimetic finite differences. + +An $h$-adaptive implementation of both \nameref{ch:2p_decoupled} and +\nameref{ch:2p2c_decoupled} is provided for two dimensions. diff --git a/doc/handbook/propertysystem.tex b/doc/handbook/5_propertysystem.tex similarity index 94% rename from doc/handbook/propertysystem.tex rename to doc/handbook/5_propertysystem.tex index 82811e8e23c815b07276032a038b2a5583be2e31..7d5bb6f46018edc6b60be48fd2cef8d725fabac1 100644 --- a/doc/handbook/propertysystem.tex +++ b/doc/handbook/5_propertysystem.tex @@ -1,11 +1,11 @@ -\chapter{The \Dumux Property System} +\section{The \Dumux Property System} \label{sec:propertysystem} -This section is dedicated to the \Dumux property system. First, a high +This subsection is dedicated to the \Dumux property system. First, a high level overview over its design and principle ideas is given, then follows a short reference and a short self-contained example. -\section{Concepts and Features of the \Dumux Property System} +\subsection{Concepts and Features of the \Dumux Property System} The \Dumux property system was designed as an attempt to mitigate the problems of traits classes. In fact, it can be seen as a traits system @@ -32,7 +32,7 @@ introspection denotes the ability to generate diagnostic messages which can be used to find out where a certain property was defined and how it was inherited. -\section{\Dumux Property System Reference} +\subsection{\Dumux Property System Reference} All source files which use the \Dumux property system should include the header file \texttt{dumux/ \hskip-1ex{}common/ @@ -40,7 +40,7 @@ the header file \texttt{dumux/ \hskip-1ex{}common/ property tags as well as defining properties must be done inside the namespace \texttt{Dumux::Properties}. -\subsection*{Defining Type Tags} +\subsubsection{Defining Type Tags} New nodes in the type tag hierarchy can be defined using \begin{lstlisting}[style=DumuxCode] @@ -62,7 +62,7 @@ NEW_TYPE_TAG(MyDerivedTypeTag, INHERITS_FROM(MyBaseTypeTag1, MyBaseTypeTag2)); }} \end{lstlisting} -\subsection*{Declaring Property Tags} +\subsubsection{Declaring Property Tags} New property tags -- i.e. labels for properties -- are declared using @@ -82,7 +82,7 @@ NEW_PROP_TAG(MyPropertyTag); }} \end{lstlisting} -\subsection*{Defining Properties} +\subsubsection{Defining Properties} The value of a property on a given node of the type tag hierarchy is defined using @@ -130,7 +130,7 @@ SET_SCALAR_PROP(MyTypeTag, MyScalarValue, 12345.67890); }} \end{lstlisting} -\subsection*{Un-setting Properties} +\subsubsection{Un-setting Properties} Sometimes some inherited properties do not make sense for a certain node in the type tag hierarchy. These properties can be explicitly @@ -153,12 +153,12 @@ NEW_PROP_TAG(TestProp); SET_TYPE_PROP(BaseTypeTag, TestProp, int); UNSET_PROP(DerivedTypeTag, TestProp); -// trying to access the 'TestProp' property for 'DerivedTypeTag' +// trying to access the 'TestProp' property for 'DerivedTypeTag' // will trigger a compiler error! }} \end{lstlisting} -\subsection*{Converting Tag Names to Tag Types} +\subsubsection{Converting Tag Names to Tag Types} For the \Cplusplus compiler, property and type tags are like ordinary types. Both can thus be used as template arguments. To convert a @@ -166,7 +166,7 @@ property tag name or a type tag name into the corresponding type, the macros \texttt{TTAG(TypeTagName)} and \texttt{PTAG(PropertyTagName)} ought to be used. -\subsection*{Retrieving Property Values} +\subsubsection{Retrieving Property Values} The value of a property can be retrieved using \begin{lstlisting}[style=DumuxCode] @@ -198,18 +198,18 @@ Example:\nolinebreak template <TypeTag> class MyClass { // retrieve the ::value attribute of the 'NumEq' property - enum { numEq = GET_PROP(TypeTag, NumEq)::value }; + enum { numEq = GET_PROP(TypeTag, NumEq)::value }; // retrieve the ::value attribute of the 'NumPhases' property using the convenience macro - enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) }; + enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) }; // retrieve the ::type attribute of the 'Scalar' property - typedef typename GET_PROP(TypeTag, Scalar)::type Scalar; + typedef typename GET_PROP(TypeTag, Scalar)::type Scalar; // retrieve the ::type attribute of the 'Vector' property using the convenience macro typedef typename GET_PROP_TYPE(TypeTag, Vector) Vector; }; \end{lstlisting} -\subsection*{Nesting Property Definitions} +\subsubsection{Nesting Property Definitions} Inside property definitions there is access to all other properties which are defined somewhere on the type tag hierarchy. The node for @@ -228,7 +228,7 @@ public: typedef std::vector<Scalar> type; \end{lstlisting} -\section{A Self-Contained Example} +\subsection{A Self-Contained Example} As a concrete example, let us consider some kinds of cars: Compact cars, sedans, trucks, pickups, military tanks and the Hummer-H1 sports @@ -321,7 +321,7 @@ the following: of seats is $2$, it uses $\unitfrac[18]{l}{100km}$ and has a cargo payload of $\unit[35]{t}$. \item A tank exhibits a top speed of $\unitfrac[60]{km}{h}$, uses $\unitfrac[65]{l}{100km}$ - and features a $\unit[120]{mm}$ diameter canon + and features a $\unit[120]{mm}$ diameter canon \item A sedan has a gas usage of $\unitfrac[7]{l}{100km}$, as well as an automatic transmission, in every other aspect it is like a compact car. \item A pick-up truck has a top speed of $\unitfrac[120]{km}{h}$ and a payload of diff --git a/doc/handbook/5_spatialdiscretizations.tex b/doc/handbook/5_spatialdiscretizations.tex new file mode 100644 index 0000000000000000000000000000000000000000..89379faf4fe78172e56dd78f8ac608c17a60c030 --- /dev/null +++ b/doc/handbook/5_spatialdiscretizations.tex @@ -0,0 +1,202 @@ +\section{Numerical Models or Implicit Spatial Discretization Schemes???} +\label{spatialdiscretization} +\todo[inline]{Habe das aus dem Model Kapitel zu einem eigen Kapitel gemacht} + +For the implicit models there are two spatial discretization schemes (box and Cell +Centered Finite Volume Method) available which are shortly introduced +in this subsection. + +\subsection{Box Method -- A Short Introduction}\label{box} + +The so called box method unites the advantages of the finite-volume (FV) and +finite-element (FE) methods. + +First, the model domain $G$ is discretized with a FE mesh consisting of nodes +$i$ and corresponding elements $E_k$. Then, a secondary FV mesh is constructed +by connecting the midpoints and barycenters of the elements surrounding node +$i$ creating a box $B_i$ around node $i$ (see Figure \ref{pc:box}a). + +\begin{figure} [ht] +\includegraphics[width=0.8\linewidth,keepaspectratio]{PNG/box_disc.png} +\caption{\label{pc:box} Discretization of the box method} +\end{figure} + +The FE mesh divides the box $B_i$ into subcontrolvolumes (scv's) $b^k_i$ +(see Figure \ref{pc:box}b). Figure \ref{pc:box}c shows the finite element $E_k$ +and the scv's $b^k_i$ inside $E_k$, which belong to four different boxes $B_i$. +Also necessary for the discretization are the faces of the subcontrolvolumes (scvf's) +$e^k_{ij}$ between the scv's $b^k_i$ and $b^k_j$, where $|e^k_{ij}|$ is the length +of the scvf. The integration points $x^k_{ij}$ on $e^k_{ij}$ and the outer normal +vector $\mathbf n^k_{ij}$ are also to be defined (see Figure \ref{pc:box}c). + +The advantage of the FE method is that unstructured grids can be used, while the +FV method is mass conservative. The idea is to apply the FV method (balance of +fluxes across the interfaces) to each FV box $B_i$ and to get the fluxes across +the interfaces $e^k_{ij}$ at the integration points $x^k_{ij}$ from the FE approach. +Consequently, at each scvf the following expression results: + +\begin{equation} + f(\tilde u(x^k_{ij})) \cdot \mathbf n^k_{ij} \: |e^k_{ij}| \qquad \textrm{with} + \qquad \tilde u(x^k_{ij}) = \sum_i N_i(x^k_{ij}) \cdot \hat u_i . +\end{equation} + +In the following, the discretization of the balance equation is going to be derived. +From the \textsc{Reynolds} transport theorem follows the general balance equation: + +\begin{equation} + \underbrace{\int_G \frac{\partial}{\partial t} \: u \: dG}_{1} + + \underbrace{\int_{\partial G} (\mathbf{v} u + \mathbf w) \cdot \textbf n \: d\varGamma}_{2} = \underbrace{\int_G q \: dG}_{3} +\end{equation} + +\begin{equation} + f(u) = \int_G \frac{\partial u}{\partial t} \: dG + \int_{G} \nabla \cdot + \underbrace{\left[ \mathbf{v} u + \mathbf w(u)\right] }_{F(u)} \: dG - \int_G q \: dG = 0 +\end{equation} +where term 1 describes the changes of entity $u$ within a control volume over +time, term 2 the advective, diffusive and dispersive fluxes over the interfaces +of the control volume and term 3 is the source and sink term. $G$ denotes the +model domain and $F(u) = F(\mathbf v, p) = F(\mathbf v(x,t), p(x,t))$. + +Like the FE method, the box method follows the principle of weighted residuals. +In the function $f(u)$ the unknown $u$ is approximated by discrete values at the +nodes of the FE mesh $\hat u_i$ and linear basis functions $N_i$ yielding an +approximate function $f(\tilde u)$. For $u\in \lbrace \mathbf v, p, x^\kappa \rbrace$ +this means: + +\begin{minipage}[b]{0.47\textwidth} +\begin{equation} +\label{eq:p} + \tilde p = \sum_i N_i \hat{p_i} +\end{equation} +\begin{equation} +\label{eq:v} + \tilde{\mathbf v} = \sum_i N_i \hat{\mathbf v} +\end{equation} +\begin{equation} +\label{eq:x} + \tilde x^\kappa = \sum_i N_i \hat x^\kappa +\end{equation} +\end{minipage} +\hfill +\begin{minipage}[b]{0.47\textwidth} +\begin{equation} +\label{eq:dp} + \nabla \tilde p = \sum_i \nabla N_i \hat{p_i} +\end{equation} +\begin{equation} +\label{eq:dv} + \nabla \tilde{\mathbf v} = \sum_i \nabla N_i \hat{\mathbf v} +\end{equation} +\begin{equation} +\label{eq:dx} + \nabla \tilde x^\kappa = \sum_i \nabla N_i \hat x^\kappa . +\end{equation} +\end{minipage} + +Due to the approximation with node values and basis functions the differential +equations are not exactly fulfilled anymore but a residual $\varepsilon$ is produced. + +\begin{equation} + f(u) = 0 \qquad \Rightarrow \qquad f(\tilde u) = \varepsilon +\end{equation} + +Application of the principle of weighted residuals, meaning the multiplication +of the residual $\varepsilon$ with a weighting function $W_j$ and claiming that +this product has to vanish within the whole domain, + +\begin{equation} + \int_G W_j \cdot \varepsilon \: \overset {!}{=} \: 0 \qquad \textrm{with} \qquad \sum_j W_j =1 +\end{equation} +yields the following equation: + +\begin{equation} + \int_G W_j \frac{\partial \tilde u}{\partial t} \: dG + \int_G W_j + \cdot \left[ \nabla \cdot F(\tilde u) \right] \: dG - \int_G W_j + \cdot q \: dG = \int_G W_j \cdot \varepsilon \: dG \: \overset {!}{=} \: 0 . +\end{equation} + +Then, the chain rule and the \textsc{Green-Gaussian} integral theorem are applied. + +\begin{equation} + \int_G W_j \frac{\partial \sum_i N_i \hat u_i}{\partial t} \: dG + + \int_{\partial G} \left[ W_j \cdot F(\tilde u)\right] + \cdot \mathbf n \: d\varGamma_G + \int_G \nabla W_j \cdot F(\tilde u) + \: dG - \int_G W_j \cdot q \: dG = 0 +\end{equation} + +A mass lumping technique is applied by assuming that the storage capacity is +reduced to the nodes. This means that the integrals $M_{i,j} = \int_G W_j \: N_i \: dG$ +are replaced by the mass lumping term $M^{lump}_{i,j}$ which is defined as: + +\begin{equation} + M^{lump}_{i,j} =\begin{cases} \int_G W_j \: dG = \int_G N_i \: dG = V_i &i = j\\ + 0 &i \neq j\\ + \end{cases} +\end{equation} +where $V_i$ is the volume of the FV box $B_i$ associated with node $i$. +The application of this assumption in combination with +$\int_G W_j \:q \: dG = V_i \: q$ yields + +\begin{equation} + V_i \frac{\partial \hat u_i}{\partial t} + + \int_{\partial G} \left[ W_j \cdot F(\tilde u)\right] + \cdot \mathbf n \: d\varGamma_G + \int_G \nabla W_j \cdot F(\tilde u) + \: dG- V_i \cdot q = 0 \, . +\end{equation} + +Defining the weighting function $W_j$ to be piecewisely constant over a +control volume box $B_i$ + +\begin{equation} + W_j(x) = \begin{cases} + 1 &x \in B_i \\ + 0 &x \notin B_i\\ + \end{cases} +\end{equation} + +causes $\nabla W_j = 0$: + +\begin{equation} +\label{eq:disc1} + V_i \frac{\partial \hat u_i}{\partial t} + + \int_{\partial B_i} \left[ W_j \cdot F(\tilde u)\right] + \cdot \mathbf n \; d{\varGamma}_{B_i} - V_i \cdot q = 0 . +\end{equation} + +The consideration of the time discretization and inserting $W_j = 1$ finally +leads to the discretized form which will be applied to the mathematical +flow and transport equations: + +\begin{equation} +\label{eq:discfin} + V_i \frac{\hat u_i^{n+1} - \hat u_i^{n}}{\Delta t} + + \int_{\partial B_i} F(\tilde u^{n+1}) \cdot \mathbf n + \; d{\varGamma}_{B_i} - V_i \: q^{n+1} \: = 0 +\end{equation} + +\subsection{Cell Centered Finite Volume Method -- A Short Introduction}\label{cc} + +\begin{figure} [ht] +\centering +\includegraphics[width=0.4\linewidth,keepaspectratio]{PNG/cc_disc.png} +\caption{\label{pc:cc} Discretization of the cell centered finite volume method} +\end{figure} + +The cell centered finite volume method uses the elements of the grid as control volumes. +For each control volume all discrete values are determined at the element/control +volume center (see Figure~\ref{pc:cc}). +The mass or energy fluxes are evaluated at the integration points ($x_{ij}$), +which are located at the midpoints of the control +volume faces. This is a two point flux approximation since the flux between +the element/control volume centers $i$ and $j$ is calculated +only with information from these two points. In contrast the box method uses +a multi-point flux approximation where all nodes of the +element influence the flux between two specific nodes. \\ +Neumann boundary conditions are applied at the boundary control volume faces +and Dirichlet boundary conditions at the boundary control volumes. \\ +The cell centered finite volume method is robust and mass conservative but +should only be applied for structured grids +(the control volume face normal vector ($n_{ij}$) should be parallel to the +direction of the gradient between the two element/control +volume centers). + diff --git a/doc/handbook/5_workingwithdumux.tex b/doc/handbook/5_workingwithdumux.tex new file mode 100644 index 0000000000000000000000000000000000000000..84494e42f0e3b4fc44d0c6c54782d7999e978efa --- /dev/null +++ b/doc/handbook/5_workingwithdumux.tex @@ -0,0 +1,9 @@ +\chapter[Working with Dumux - Dive Into \Dumux - Detailed Instructions]{Working with Dumux - Dive Into \Dumux - Detailed Instructions} + +This chapter contains detailed information for those who are interested +in deeper modifications of underlying \Dumux models, classes, functions, etc. +\input{5_models} +\input{5_spatialdiscretizations} +\input{5_propertysystem} +\input{5_fluidframework} +\input{5_flowofthings} diff --git a/doc/handbook/CMakeLists.txt b/doc/handbook/CMakeLists.txt index bbd7bcb73175a0dde9a319c4bed2fb2978c58e18..fd2a5ada8ce3126fbcabd02bb37d3b1e18a08877 100644 --- a/doc/handbook/CMakeLists.txt +++ b/doc/handbook/CMakeLists.txt @@ -1,54 +1,28 @@ set(TEX_INPUTS - DumuxFlow.tex - fluidframework.tex - getting-started.tex - guidelines.tex - install.tex - intro.tex - models.tex - newFolder.tex - dumux-handbook.tex - NewtonInANutshell.tex - parameterfiles.tex - propertysystem.tex - quick-install.tex - quickstart-guide.tex - spatialdiscretization.tex - restartsimulations.tex - structure.tex - TipsNTricks.tex - tutorial-coupled.tex - tutorial-decoupled.tex - tutorial.tex - ModelDescriptions/2cstokes2p2cmodel.tex - ModelDescriptions/2cnistokes2p2cnimodel.tex - ModelDescriptions/2czeroeq2p2cmodel.tex - ModelDescriptions/2cnizeroeq2p2cnimodel.tex - ModelDescriptions/1p2cimplicitmodel.tex - ModelDescriptions/1pdecoupledmodel.tex - ModelDescriptions/1pimplicitmodel.tex - ModelDescriptions/2p2cdecoupledpressuremodel.tex - ModelDescriptions/2p2cdecoupledtransportmodel.tex - ModelDescriptions/2p2cimplicitmodel.tex - ModelDescriptions/2pdecoupledpressuremodel.tex - ModelDescriptions/2pdecoupledsaturationmodel.tex - ModelDescriptions/2pdfmimplicitmodel.tex - ModelDescriptions/2pimplicitmodel.tex - ModelDescriptions/3p3cimplicitmodel.tex - ModelDescriptions/3pimplicitmodel.tex - ModelDescriptions/co2implicitmodel.tex - ModelDescriptions/el1p2cmodel.tex - ModelDescriptions/el2pmodel.tex - ModelDescriptions/elasticmodel.tex - ModelDescriptions/mpncimplicitmodel.tex - ModelDescriptions/nonisothermalimplicitmodel.tex - ModelDescriptions/richardsimplicitmodel.tex - ModelDescriptions/stokesimplicitmodel.tex - ModelDescriptions/stokesncimplicitmodel.tex - ModelDescriptions/stokesncniimplicitmodel.tex - ModelDescriptions/zeroeqimplicitmodel.tex - ModelDescriptions/zeroeqncimplicitmodel.tex - ModelDescriptions/zeroeqncniimplicitmodel.tex + 0_dumux-handbook.tex + 0_discussion.tex + 1_introduction.tex + 2_detailedinstall.tex + 2_gettingstarted.tex + 2_quickinstall.tex + 2_quickstartguide.tex + 3_tutorial.tex + 3_tutorialcoupled.tex + 3_tutorialdecoupled.tex + 4_dumuxoverview.tex + 4_guidelines.tex + 4_newfoldersetup.tex + 4_newtoninanutshell.tex + 4_parameterfiles.tex + 4_restartsimulations.tex + 4_structure.tex + 4_tipsandtricks.tex + 5_flowofthings.tex + 5_fluidframework.tex + 5_models.tex + 5_propertysystem.tex + 5_spatialdiscretizations.tex + 5_workingwithdumux.tex ../../tutorial/tutorial_coupled.cc ../../tutorial/tutorial_coupled.input ../../tutorial/tutorialproblem_coupled.hh @@ -65,7 +39,7 @@ set(TEX_IMAGES PNG/dunedesign.png ../logo/dumux_logo_hires_whitebg.png) -dune_add_latex_document(dumux-handbook.tex +dune_add_latex_document(0_dumux-handbook.tex FATHER_TARGET doc DEFAULT_PDF BIBFILES dumux-handbook.bib diff --git a/doc/handbook/ModelDescriptions/1p2cimplicitmodel.tex b/doc/handbook/ModelDescriptions/1p2cimplicitmodel.tex deleted file mode 100644 index c078d894f45ab7cfcf8aabe56265af6373b5d732..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/1p2cimplicitmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a one-\/phase flow of a compressible fluid, that consists of two components, using a standard Darcy approach as the equation for the conservation of momentum\-: \[ v = - \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho {\textbf g} \right) \] - -Gravity can be enabled or disabled via the property system. By inserting this into the continuity equation, one gets \[ \phi\frac{\partial \varrho}{\partial t} - \text{div} \left\{ \varrho \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho {\textbf g} \right) \right\} = q \;, \] - -The transport of the components $\kappa \in \{ w, a \}$ is described by the following equation\-: \[ \phi \frac{ \partial \varrho X^\kappa}{\partial t} - \text{div} \left\lbrace \varrho X^\kappa \frac{{\textbf K}}{\mu} \left( \textbf{grad}\, p - \varrho {\textbf g} \right) + \varrho D^\kappa_\text{pm} \frac{M^\kappa}{M_\alpha} \textbf{grad} x^\kappa \right\rbrace = q. \] - -All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. The model is able to use either mole or mass fractions. The property use\-Moles can be set to either true or false in the problem file. Make sure that the according units are used in the problem setup. use\-Moles is set to true by default. - -The primary variables are the pressure $p$ and the mole or mass fraction of dissolved component $x$. - diff --git a/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex b/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex deleted file mode 100644 index b6d15d886d157d4346701641fedef862d3cf3159..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex +++ /dev/null @@ -1,9 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model solves equations of the form \[ \text{div}\, \boldsymbol v = q. \] The velocity $ \boldsymbol v $ is the single phase Darcy velocity\-: \[ \boldsymbol v = -\frac{1}{\mu} \boldsymbol K \left(\textbf{grad}\, p + \rho \, g \, \textbf{grad}\, z\right), \] where $ p $ is the pressure, $ \boldsymbol K $ the absolute permeability, $ \mu $ the viscosity, $ \rho $ the density, and $ g $ the gravity constant, and $ q $ is the source term. At the boundary, $ p = p_D $ on $ \Gamma_{Dirichlet} $, and $ \boldsymbol v \cdot \boldsymbol n = q_N$ on $ \Gamma_{Neumann} $. - - diff --git a/doc/handbook/ModelDescriptions/1pimplicitmodel.tex b/doc/handbook/ModelDescriptions/1pimplicitmodel.tex deleted file mode 100644 index 00f36f560fccae02d9211f65e1c2eca7d9dcd018..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/1pimplicitmodel.tex +++ /dev/null @@ -1,10 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Single-\/phase, isothermal flow model, which uses a standard Darcy approach as the equation for the conservation of momentum\-: \[ v = - \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho {\textbf g} \right) \] - -and solves the mass continuity equation\-: \[ \phi \frac{\partial \varrho}{\partial t} + \text{div} \left\lbrace - \varrho \frac{\textbf K}{\mu} \left( \textbf{grad}\, p -\varrho {\textbf g} \right) \right\rbrace = q, \] All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. The model supports compressible as well as incompressible fluids. - diff --git a/doc/handbook/ModelDescriptions/2cnistokes2p2cnimodel.tex b/doc/handbook/ModelDescriptions/2cnistokes2p2cnimodel.tex deleted file mode 100644 index 6505b25ab059d6586d02a158cdffda8d45a09063..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2cnistokes2p2cnimodel.tex +++ /dev/null @@ -1,24 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements the coupling between a free-\/flow model and a porous-\/medium flow model under non-\/isothermal conditions. Here the coupling conditions for the individual balance are presented\-: - -The total mass balance equation\-: \[ \left[ \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = -\left[ \left( \varrho_\textrm{g} \boldsymbol{v}_\textrm{g} + \varrho_\textrm{l} \boldsymbol{v}_\textrm{l} \right) \cdot \boldsymbol{n} \right]^\textrm{pm} \] in which $n$ represents a vector normal to the interface pointing outside of the specified subdomain. - -The momentum balance (tangential), which corresponds to the Beavers-\/\-Jospeh Saffman condition\-: \[ \left[ \left( {\boldsymbol{v}}_\textrm{g} + \frac{\sqrt{\left(\boldsymbol{K} \boldsymbol{t}_i \right) \cdot \boldsymbol{t}_i}} {\alpha_\textrm{BJ} \mu_\textrm{g}} \boldsymbol{{\tau}}_\textrm{t} \boldsymbol{n} \right) \cdot \boldsymbol{t}_i \right]^\textrm{ff} = 0 \] with $ \boldsymbol{{\tau}_\textrm{t}} = \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right] \nabla \left( \boldsymbol{v}_\textrm{g} + \boldsymbol{v}_\textrm{g}^\intercal \right) $ in which the eddy viscosity $ \mu_\textrm{g,t} = 0 $ for the Stokes equation. - -The momentum balance (normal)\-: \[ \left[ \left( \left\lbrace \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} {\boldsymbol{v}}_\textrm{g}^\intercal - \boldsymbol{{\tau}}_\textrm{t} + {p}_\textrm{g} \boldsymbol{I} \right\rbrace \boldsymbol{n} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = p_\textrm{g}^\textrm{pm} \] - -The component mass balance equation (continuity of fluxes)\-: \[ \left[ \left( \varrho_\textrm{g} {X}^\kappa_\textrm{g} {\boldsymbol{v}}_\textrm{g} - {\boldsymbol{j}}^\kappa_\textrm{g,ff,t,diff} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = -\left[ \left( \varrho_\textrm{g} X^\kappa_\textrm{g} \boldsymbol{v}_\textrm{g} - \boldsymbol{j}^\kappa_\textrm{g,pm,diff} + \varrho_\textrm{l} \boldsymbol{v}_\textrm{l} X^\kappa_\textrm{l} - \boldsymbol{j}^\kappa_\textrm{l,pm,diff} \right) \cdot \boldsymbol{n} \right]^\textrm{pm} = 0 \] in which the diffusive fluxes $ j_\textrm{diff} $ are the diffusive fluxes as they are implemented in the individual subdomain models. - -The component mass balance equation (continuity of mass/ mole fractions)\-: \[ \left[ {X}^{\kappa}_\textrm{g} \right]^\textrm{ff} = \left[ X^{\kappa}_\textrm{g} \right]^\textrm{pm} \] - -The energy balance equation (continuity of fluxes)\-: \[ \left[ \left( \varrho_\textrm{g} {h}_\textrm{g} {\boldsymbol{v}}_\textrm{g} - {h}^\textrm{a}_\textrm{g} {\boldsymbol{j}}^\textrm{a}_\textrm{g,ff,t,diff} - {h}^\textrm{w}_\textrm{g} {\boldsymbol{j}}^\textrm{w}_\textrm{g,ff,t,diff} - \left( \lambda_\textrm{g} + \lambda_\textrm{g,t} \right) \nabla {T} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = -\left[ \left( \varrho_\textrm{g} h_\textrm{g} \boldsymbol{v}_\textrm{g} + \varrho_\textrm{l} h_\textrm{l} \boldsymbol{v}_\textrm{l} - \lambda_\textrm{pm} \nabla T \right) \cdot \boldsymbol{n} \right]^\textrm{pm} \] - -The energy balance equation (continuity of temperature)\-: \[ \left[ {T} \right]^\textrm{ff} = \left[ T \right]^\textrm{pm} \] - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/2cnizeroeq2p2cnimodel.tex b/doc/handbook/ModelDescriptions/2cnizeroeq2p2cnimodel.tex deleted file mode 100644 index 81d55e0a120bd1d88ef3550e96f7a8707e185ac7..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2cnizeroeq2p2cnimodel.tex +++ /dev/null @@ -1,6 +0,0 @@ - -This model implements the same coupling conditions as the model -concepts, which couples Darcy and Stokes flow presented \hyperref[sc_2cnistokes2p2cni]{above}. -The only difference is that the eddy coefficients $\mu_\textrm{g,t}$, -$D_\textrm{g,t}$, and $\lambda_\textrm{g,t}$ are not necessarily non-zero -at the coupling interface. diff --git a/doc/handbook/ModelDescriptions/2cstokes2p2cmodel.tex b/doc/handbook/ModelDescriptions/2cstokes2p2cmodel.tex deleted file mode 100644 index 55e263dbb97b06dc8a5c06066a78e902ce65ec6e..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2cstokes2p2cmodel.tex +++ /dev/null @@ -1,20 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements the coupling between a free-\/flow model and a porous-\/medium flow model under isothermal conditions. Here the coupling conditions for the individual balance are presented\-: - -The total mass balance equation\-: \[ \left[ \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = -\left[ \left( \varrho_\textrm{g} \boldsymbol{v}_\textrm{g} + \varrho_\textrm{l} \boldsymbol{v}_\textrm{l} \right) \cdot \boldsymbol{n} \right]^\textrm{pm} \] in which $n$ represents a vector normal to the interface pointing outside of the specified subdomain. - -The momentum balance (tangential), which corresponds to the Beavers-\/\-Jospeh Saffman condition\-: \[ \left[ \left( {\boldsymbol{v}}_\textrm{g} + \frac{\sqrt{\left(\boldsymbol{K} \boldsymbol{t}_i \right) \cdot \boldsymbol{t}_i}} {\alpha_\textrm{BJ} \mu_\textrm{g}} \boldsymbol{{\tau}}_\textrm{t} \boldsymbol{n} \right) \cdot \boldsymbol{t}_i \right]^\textrm{ff} = 0 \] with $ \boldsymbol{{\tau}_\textrm{t}} = \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right] \nabla \left( \boldsymbol{v}_\textrm{g} + \boldsymbol{v}_\textrm{g}^\intercal \right) $ in which the eddy viscosity $ \mu_\textrm{g,t} = 0 $ for the Stokes equation. - -The momentum balance (normal)\-: \[ \left[ \left( \left\lbrace \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} {\boldsymbol{v}}_\textrm{g}^\intercal - \boldsymbol{{\tau}}_\textrm{t} + {p}_\textrm{g} \boldsymbol{I} \right\rbrace \boldsymbol{n} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = p_\textrm{g}^\textrm{pm} \] - -The component mass balance equation (continuity of fluxes)\-: \[ \left[ \left( \varrho_\textrm{g} {X}^\kappa_\textrm{g} {\boldsymbol{v}}_\textrm{g} - {\boldsymbol{j}}^\kappa_\textrm{g,ff,t,diff} \right) \cdot \boldsymbol{n} \right]^\textrm{ff} = -\left[ \left( \varrho_\textrm{g} X^\kappa_\textrm{g} \boldsymbol{v}_\textrm{g} - \boldsymbol{j}^\kappa_\textrm{g,pm,diff} + \varrho_\textrm{l} \boldsymbol{v}_\textrm{l} X^\kappa_\textrm{l} - \boldsymbol{j}^\kappa_\textrm{l,pm,diff} \right) \cdot \boldsymbol{n} \right]^\textrm{pm} = 0 \] in which the diffusive fluxes $ j_\textrm{diff} $ are the diffusive fluxes as they are implemented in the individual subdomain models. - -The component mass balance equation (continuity of mass/ mole fractions)\-: \[ \left[ {X}^{\kappa}_\textrm{g} \right]^\textrm{ff} = \left[ X^{\kappa}_\textrm{g} \right]^\textrm{pm} \] - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/2czeroeq2p2cmodel.tex b/doc/handbook/ModelDescriptions/2czeroeq2p2cmodel.tex deleted file mode 100644 index 172f325fd863fa6a6bb064bda747939184cccbd4..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2czeroeq2p2cmodel.tex +++ /dev/null @@ -1,6 +0,0 @@ - -This model implements the same coupling conditions as the model -concepts, which couples Darcy and Stokes flow presented \hyperref[sc_2cstokes2p2c]{above}. -The only difference is that the eddy coefficients $\mu_\textrm{g,t}$ -and $D_\textrm{g,t}$ are not necessarily non-zero at the coupling -interface. diff --git a/doc/handbook/ModelDescriptions/2p2cdecoupledpressuremodel.tex b/doc/handbook/ModelDescriptions/2p2cdecoupledpressuremodel.tex deleted file mode 100644 index 40adc647a7d6967d92a227fee7ebfa650951b41c..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2p2cdecoupledpressuremodel.tex +++ /dev/null @@ -1,20 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file is NOT autogenerated % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Provides a Finite Volume implementation for the pressure equation of a compressible system with two components. An I\-M\-P\-E\-S-\/like method is used for the sequential solution of the problem. Diffusion is neglected, capillarity can be regarded. Isothermal conditions and local thermodynamic equilibrium are assumed. Gravity is included. -\[ c_{total}\frac{\partial p}{\partial t} + \sum_{\kappa} \frac{\partial v_{total}}{\partial C^{\kappa}} \nabla \cdot \left( \sum_{\alpha} X^{\kappa}_{\alpha} \varrho_{\alpha} \bf{v}_{\alpha}\right) = \sum_{\kappa} \frac{\partial v_{total}}{\partial C^{\kappa}} q^{\kappa}, \] -where $\bf{v}_{\alpha} = - \lambda_{\alpha} \bf{K} \left(\nabla p_{\alpha} + \rho_{\alpha} \bf{g} \right) $. -$ c_{total} $ represents the total compressibility, for constant porosity this yields -$ - \frac{\partial V_{total}}{\partial p_{\alpha}} $, -$p_{\alpha} $ denotes the phase pressure, -$ \bf{K} $ the absolute permeability, -$ \lambda_{\alpha} $ the phase mobility, -$ \rho_{\alpha} $ the phase density and -$ \bf{g} $ the gravity constant and -$ C^{\kappa} $ the total \hyperlink{a00070}{Component} concentration. See paper S\-P\-E 99619 or \char`\"{}\-Analysis of a Compositional Model for Fluid -Flow in Porous Media\char`\"{} by Chen, Qin and Ewing for derivation. - -The pressure base class \hyperlink{a00131}{F\-V\-Pressure} assembles the matrix and right-\/hand-\/side vector and solves for the pressure vector, whereas this class provides the actual entries for the matrix and R\-H\-S vector. The partial derivatives of the actual fluid volume $ v_{total} $ are gained by using a secant method. - - diff --git a/doc/handbook/ModelDescriptions/2p2cdecoupledtransportmodel.tex b/doc/handbook/ModelDescriptions/2p2cdecoupledtransportmodel.tex deleted file mode 100644 index 0e6614aec89a1cd17e3a0c9f2bacc1cfaf0c601e..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2p2cdecoupledtransportmodel.tex +++ /dev/null @@ -1,15 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file is NOT autogenerated % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -The transport step is described by the finite volume model for the solution of the transport equation for compositional two-\/phase flow. -\[ \frac{\partial C^\kappa}{\partial t} = - \nabla \cdot \left( \sum_{\alpha} X^{\kappa}_{\alpha} \varrho_{\alpha} \bf{v}_{\alpha}\right) + q^{\kappa}, \] -where $ \bf{v}_{\alpha} = - \lambda_{\alpha} \bf{K} \left(\nabla p_{\alpha} + \rho_{\alpha} \bf{g} \right) $. $ p_{\alpha} $ denotes the phase pressure, -$ \bf{K} $ the absolute permeability, -$ \lambda_{\alpha} $ the phase mobility, -$ \rho_{\alpha} $ the phase density and -$ \bf{g} $ the gravity constant and - $ C^{\kappa} $ the total \hyperlink{a00070}{Component} concentration. -The whole flux contribution for each cell is subdivided into a storage term, a flux term and a source term. Corresponding functions ({\ttfamily \hyperlink{a00145_a13998fc22be58456c4bf8e3f4b12d89c}{get\-Flux()}} and {\ttfamily \hyperlink{a00145_a40fc97d83d3d15cdd29574d3a38fdafb}{get\-Flux\-On\-Boundary()}}) are provided, internal sources are directly treated. - - diff --git a/doc/handbook/ModelDescriptions/2p2cimplicitmodel.tex b/doc/handbook/ModelDescriptions/2p2cimplicitmodel.tex deleted file mode 100644 index 41663d06e6ad506ca2d4676cac6ea537f2cafdea..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2p2cimplicitmodel.tex +++ /dev/null @@ -1,19 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements two-\/phase two-\/component flow of two compressible and partially miscible fluids $\alpha \in \{ w, n \}$ composed of the two components $\kappa \in \{ w, a \}$. The standard multiphase Darcy approach is used as the equation for the conservation of momentum\-: \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) \] - -By inserting this into the equations for the conservation of the components, one gets one transport equation for each component \begin{eqnarray*} && \phi \frac{\partial (\sum_\alpha \varrho_\alpha \frac{M^\kappa}{M_\alpha} x_\alpha^\kappa S_\alpha )} {\partial t} - \sum_\alpha \text{div} \left\{ \varrho_\alpha \frac{M^\kappa}{M_\alpha} x_\alpha^\kappa \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} (\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g}) \right\} \nonumber \\ \nonumber \\ &-& \sum_\alpha \text{div} \left\{ D_{\alpha,\text{pm}}^\kappa \varrho_{\alpha} \frac{M^\kappa}{M_\alpha} \textbf{grad} x^\kappa_{\alpha} \right\} - \sum_\alpha q_\alpha^\kappa = 0 \qquad \kappa \in \{w, a\} \, , \alpha \in \{w, g\} \end{eqnarray*} - -All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. - -By using constitutive relations for the capillary pressure $p_c = p_n - p_w$ and relative permeability $k_{r\alpha}$ and taking advantage of the fact that $S_w + S_n = 1$ and $x^\kappa_w + x^\kappa_n = 1$, the number of unknowns can be reduced to two. The used primary variables are, like in the two-\/phase model, either $p_w$ and $S_n$ or $p_n$ and $S_w$. The formulation which ought to be used can be specified by setting the {\ttfamily Formulation} property to either Two\-P\-Two\-C\-Indices\-::p\-Ws\-N or Two\-P\-Two\-C\-Indices\-::p\-Ns\-W. By default, the model uses $p_w$ and $S_n$. Moreover, the second primary variable depends on the phase state, since a primary variable switch is included. The phase state is stored for all nodes of the system. The model is able to use either mole or mass fractions. The property use\-Moles can be set to either true or false in the problem file. Make sure that the according units are used in the problem setup. use\-Moles is set to true by default. Following cases can be distinguished\-: -\begin{itemize} -\item Both phases are present\-: The saturation is used (either $S_n$ or $S_w$, dependent on the chosen {\ttfamily Formulation}), as long as $ 0 < S_\alpha < 1$. -\item Only wetting phase is present\-: The mole fraction of, e.\-g., air in the wetting phase $x^a_w$ is used, as long as the maximum mole fraction is not exceeded $(x^a_w<x^a_{w,max})$ -\item Only non-\/wetting phase is present\-: The mole fraction of, e.\-g., water in the non-\/wetting phase, $x^w_n$, is used, as long as the maximum mole fraction is not exceeded $(x^w_n<x^w_{n,max})$ -\end{itemize} - diff --git a/doc/handbook/ModelDescriptions/2pdecoupledpressuremodel.tex b/doc/handbook/ModelDescriptions/2pdecoupledpressuremodel.tex deleted file mode 100644 index 42f7be883ccbf37590ee9690d06ed61ef43e31df..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2pdecoupledpressuremodel.tex +++ /dev/null @@ -1,25 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model solves equations of the form \[ \phi \left( \rho_w \frac{\partial S_w}{\partial t} + \rho_n \frac{\partial S_n}{\partial t}\right) + \text{div}\, \boldsymbol{v}_{total} = q. \] The definition of the total velocity $\boldsymbol{v}_{total}$ depends on the choice of the primary pressure variable. Further, fluids can be assumed to be compressible or incompressible (Property\-: {\ttfamily Enable\-Compressibility}). In the incompressible case a wetting $(w) $ phase pressure as primary variable leads to - -\[ - \text{div}\, \left[\lambda \boldsymbol K \left(\textbf{grad}\, p_w + f_n \textbf{grad}\, p_c + \sum f_\alpha \rho_\alpha \, g \, \textbf{grad}\, z\right)\right] = q, \] - -a non-\/wetting ( $ n $) phase pressure yields \[ - \text{div}\, \left[\lambda \boldsymbol K \left(\textbf{grad}\, p_n - f_w \textbf{grad}\, p_c + \sum f_\alpha \rho_\alpha \, g \, \textbf{grad}\, z\right)\right] = q, \] and a global pressure leads to \[ - \text{div}\, \left[\lambda \boldsymbol K \left(\textbf{grad}\, p_{global} + \sum f_\alpha \rho_\alpha \, g \, \textbf{grad}\, z\right)\right] = q. \] Here, $ p_\alpha $ is a phase pressure, $ p_ {global} $ the global pressure of a classical fractional flow formulation (see e.\-g. P. Binning and M. A. Celia, \textquotesingle{}\textquotesingle{}Practical implementation of the fractional flow approach to multi-\/phase flow simulation\textquotesingle{}\textquotesingle{}, Advances in water resources, vol. 22, no. 5, pp. 461-\/478, 1999.), $ p_c = p_n - p_w $ is the capillary pressure, $ \boldsymbol K $ the absolute permeability, $ \lambda = \lambda_w + \lambda_n $ the total mobility depending on the saturation ( $ \lambda_\alpha = k_{r_\alpha} / \mu_\alpha $), $ f_\alpha = \lambda_\alpha / \lambda $ the fractional flow function of a phase, $ \rho_\alpha $ a phase density, $ g $ the gravity constant and $ q $ the source term. - -For all cases, $ p = p_D $ on $ \Gamma_{Dirichlet} $, and $ \boldsymbol v_{total} \cdot \boldsymbol n = q_N $ on $ \Gamma_{Neumann} $. - -The slightly compressible case is only implemented for phase pressures! In this case for a wetting $(w) $ phase pressure as primary variable the equations are formulated as \[ \phi \left( \rho_w \frac{\partial S_w}{\partial t} + \rho_n \frac{\partial S_n}{\partial t}\right) - \text{div}\, \left[\lambda \boldsymbol{K} \left(\textbf{grad}\, p_w + f_n \, \textbf{grad}\, p_c + \sum f_\alpha \rho_\alpha \, g \, \textbf{grad}\, z\right)\right] = q, \] and for a non-\/wetting ( $ n $) phase pressure as \[ \phi \left( \rho_w \frac{\partial S_w}{\partial t} + \rho_n \frac{\partial S_n}{\partial t}\right) - \text{div}\, \left[\lambda \boldsymbol{K} \left(\textbf{grad}\, p_n - f_w \textbf{grad}\, p_c + \sum f_\alpha \rho_\alpha \, g \, \textbf{grad}\, z\right)\right] = q, \] In this slightly compressible case the following definitions are valid\-: $ \lambda = \rho_w \lambda_w + \rho_n \lambda_n $, $ f_\alpha = (\rho_\alpha \lambda_\alpha) / \lambda $ This model assumes that temporal changes in density are very small and thus terms of temporal derivatives are negligible in the pressure equation. Depending on the formulation the terms including time derivatives of saturations are simplified by inserting $ S_w + S_n = 1 $. - -In the I\-M\-P\-E\-S models the default setting is\-: - - -\begin{itemize} -\item formulation\-: $ p_w-S_w $ (Property\-: {\itshape Formulation} defined as {\itshape \hyperlink{a00095_a601a847774d6e1b2e2a2b469f70c3f22}{Decoupled\-Two\-P\-Common\-Indices\-::pwsw}}) -\item compressibility\-: disabled (Property\-: {\itshape Enable\-Compressibility} set to {\itshape false}) -\end{itemize} - - diff --git a/doc/handbook/ModelDescriptions/2pdecoupledsaturationmodel.tex b/doc/handbook/ModelDescriptions/2pdecoupledsaturationmodel.tex deleted file mode 100644 index 8bf9b712ef2ceafe86eaaadc9ffc8a18c031a691..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2pdecoupledsaturationmodel.tex +++ /dev/null @@ -1,23 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model solves equations of the form - -\[ \phi \frac{\partial (\rho_\alpha S_\alpha)}{\partial t} + \text{div}\, (\rho_\alpha \boldsymbol{v_\alpha}) = q_\alpha, \] - -where $ S_\alpha $ is the saturation of phase $ \alpha $ (wetting $(w) $, non-\/wetting $(n) $) and $ \boldsymbol v_\alpha $ is the phase velocity defined by the multi-\/phase Darcy equation. If a phase velocity is reconstructed from the pressure solution it can be directly inserted into the previous equation. In the incompressible case the equation is further divided by the phase density $ \rho_\alpha $. If a total velocity is reconstructed the saturation equation is reformulated into\-: - -\[ \phi \frac{\partial S_w}{\partial t} + f_w \text{div}\, \boldsymbol{v}_{t} + f_w \lambda_n \boldsymbol{K}\left(\textbf{grad}\, p_c + (\rho_n-\rho_w) \, g \, \textbf{grad} z \right)= q_\alpha, \] to get a wetting phase saturation or \[ \phi \frac{\partial S_n}{\partial t} + f_n \text{div}\, \boldsymbol{v}_{t} - f_n \lambda_w \boldsymbol{K}\left(\textbf{grad}\, p_c + (\rho_n-\rho_w) \, g \, \textbf{grad} z \right)= q_\alpha, \] if the non-\/wetting phase saturation is the primary transport variable. - -The total velocity formulation is only implemented for incompressible fluids and $ f_\alpha $ is the fractional flow function, $ \lambda_\alpha $ is the mobility, $ \boldsymbol K $ the absolute permeability, $ p_c $ the capillary pressure, $ \rho $ the fluid density, $ g $ the gravity constant, and $ q $ the source term. - -In the I\-M\-P\-E\-S models the default setting is\-: - -formulation\-: $ p_w $ -\/ $ S_w $ (Property\-: {\itshape Formulation} defined as {\itshape \hyperlink{a00095_a601a847774d6e1b2e2a2b469f70c3f22}{Decoupled\-Two\-P\-Common\-Indices\-::pwsw}}) - -compressibility\-: disabled (Property\-: {\itshape Enable\-Compressibility} set to {\itshape false}) - - diff --git a/doc/handbook/ModelDescriptions/2pdfmimplicitmodel.tex b/doc/handbook/ModelDescriptions/2pdfmimplicitmodel.tex deleted file mode 100644 index eae81f3749d36da23724abe3801c9f0677dba05a..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2pdfmimplicitmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements two-\/phase flow of two immiscible fluids $\alpha \in \{ w, n \}$ using a standard multiphase Darcy approach as the equation for the conservation of momentum, i.\-e. \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \textbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} {\textbf g} \right) \] - -By inserting this into the equation for the conservation of the phase mass, one gets \[ \phi \frac{\partial \varrho_\alpha S_\alpha}{\partial t} - \text{div} \left\{ \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) \right\} - q_\alpha = 0 \;, \] - -These equations are discretized by a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit Euler method as time discretization. - -By using constitutive relations for the capillary pressure $p_c = p_n - p_w$ and relative permeability $k_{r\alpha}$ and taking advantage of the fact that $S_w + S_n = 1$, the number of unknowns can be reduced to two. Currently the model supports choosing either $p_w$ and $S_n$ or $p_n$ and $S_w$ as primary variables. The formulation which ought to be used can be specified by setting the {\ttfamily Formulation} property to either {\ttfamily Two\-P\-Common\-Indices\-::p\-Ws\-N} or {\ttfamily Two\-P\-Common\-Indices\-::p\-Ns\-W}. By default, the model uses $p_w$ and $S_n$. - diff --git a/doc/handbook/ModelDescriptions/2pimplicitmodel.tex b/doc/handbook/ModelDescriptions/2pimplicitmodel.tex deleted file mode 100644 index c686b7e69f8815120da1054aacb999157ccc64a4..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/2pimplicitmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements two-\/phase flow of two immiscible fluids $\alpha \in \{ w, n \}$ using a standard multiphase Darcy approach as the equation for the conservation of momentum, i.\-e. \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \textbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} {\textbf g} \right) \] - -By inserting this into the equation for the conservation of the phase mass, one gets \[ \phi \frac{\partial \varrho_\alpha S_\alpha}{\partial t} - \text{div} \left\{ \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) \right\} - q_\alpha = 0 \;, \] - -All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. - -By using constitutive relations for the capillary pressure $p_c = p_n - p_w$ and relative permeability $k_{r\alpha}$ and taking advantage of the fact that $S_w + S_n = 1$, the number of unknowns can be reduced to two. Currently the model supports choosing either $p_w$ and $S_n$ or $p_n$ and $S_w$ as primary variables. The formulation which ought to be used can be specified by setting the {\ttfamily Formulation} property to either {\ttfamily Two\-P\-Common\-Indices\-::p\-Ws\-N} or {\ttfamily Two\-P\-Common\-Indices\-::p\-Ns\-W}. By default, the model uses $p_w$ and $S_n$. - diff --git a/doc/handbook/ModelDescriptions/3p3cimplicitmodel.tex b/doc/handbook/ModelDescriptions/3p3cimplicitmodel.tex deleted file mode 100644 index c8fddd9906af188aa5b40b5291bcf06839c1923b..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/3p3cimplicitmodel.tex +++ /dev/null @@ -1,26 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements three-\/phase three-\/component flow of three fluid phases $\alpha \in \{ water, gas, NAPL \}$ each composed of up to three components $\kappa \in \{ water, air, contaminant \}$. The standard multiphase Darcy approach is used as the equation for the conservation of momentum\-: \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) \] - -By inserting this into the equations for the conservation of the components, one transport equation for each component is obtained as \begin{eqnarray*} && \phi \frac{\partial (\sum_\alpha \varrho_\alpha X_\alpha^\kappa S_\alpha )}{\partial t} - \sum\limits_\alpha \text{div} \left\{ \frac{k_{r\alpha}}{\mu_\alpha} \varrho_\alpha x_\alpha^\kappa \mathbf{K} (\textbf{grad}\, p_\alpha - \varrho_\alpha \mbox{\bf g}) \right\} \nonumber \\ \nonumber \\ && - \sum\limits_\alpha \text{div} \left\{ D_\text{pm}^\kappa \varrho_\alpha \frac{M^\kappa}{M_\alpha} \textbf{grad} x^\kappa_{\alpha} \right\} - q^\kappa = 0 \qquad \forall \kappa , \; \forall \alpha \end{eqnarray*} - -Note that these balance equations are molar. - -All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. - -The model uses commonly applied auxiliary conditions like $S_w + S_n + S_g = 1$ for the saturations and $x^w_\alpha + x^a_\alpha + x^c_\alpha = 1$ for the mole fractions. Furthermore, the phase pressures are related to each other via capillary pressures between the fluid phases, which are functions of the saturation, e.\-g. according to the approach of Parker et al. - -The used primary variables are dependent on the locally present fluid phases. An adaptive primary variable switch is included. The phase state is stored for all nodes of the system. The following cases can be distinguished\-: -\begin{itemize} -\item All three phases are present\-: Primary variables are two saturations $(S_w$ and $S_n)$, and a pressure, in this case $p_g$. -\item Only the water phase is present\-: Primary variables are now the mole fractions of air and contaminant in the water phase $(x_w^a$ and $x_w^c)$, as well as the gas pressure, which is, of course, in a case where only the water phase is present, just the same as the water pressure. -\item Gas and N\-A\-P\-L phases are present\-: Primary variables $(S_n$, $x_g^w$, $p_g)$. -\item Water and N\-A\-P\-L phases are present\-: Primary variables $(S_n$, $x_w^a$, $p_g)$. -\item Only gas phase is present\-: Primary variables $(x_g^w$, $x_g^c$, $p_g)$. -\item Water and gas phases are present\-: Primary variables $(S_w$, $x_w^g$, $p_g)$. -\end{itemize} - diff --git a/doc/handbook/ModelDescriptions/3pimplicitmodel.tex b/doc/handbook/ModelDescriptions/3pimplicitmodel.tex deleted file mode 100644 index 1b78ef904bcaabc250657eb6cfff4ef46088c9b4..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/3pimplicitmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements three-\/phase flow of three fluid phases $\alpha \in \{ water, gas, NAPL \}$ The standard multiphase Darcy approach is used as the equation for the conservation of momentum. - -By inserting this into the equations for the conservation of the components, the well-\/known multiphase flow equation is obtained. - -All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. - -The model uses commonly applied auxiliary conditions like $S_w + S_n + S_g = 1$ for the saturations. Furthermore, the phase pressures are related to each other via capillary pressures between the fluid phases, which are functions of the saturation, e.\-g. according to the approach of Parker et al. - -The used primary variables are gas phase pressure $p_g$, water saturation $S_w$ and N\-A\-P\-L saturation $S_n$. - diff --git a/doc/handbook/ModelDescriptions/co2implicitmodel.tex b/doc/handbook/ModelDescriptions/co2implicitmodel.tex deleted file mode 100644 index 7812c03ac83cef8640a943de0f9c2a14a2fc8ca1..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/co2implicitmodel.tex +++ /dev/null @@ -1,8 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -See \hyperlink{a00633}{Two\-P\-Two\-C\-Model} for reference to the equations used. The \hyperlink{a00074}{C\-O2} model is derived from the 2p2c model. In the \hyperlink{a00074}{C\-O2} model the phase switch criterion is different from the 2p2c model. The phase switch occurs when the equilibrium concentration of a component in a phase is exceeded, instead of the sum of the components in the virtual phase (the phase which is not present) being greater that unity as done in the 2p2c model. The \hyperlink{a00078}{C\-O2\-Volume\-Variables} do not use a constraint solver for calculating the mole fractions as is the case in the 2p2c model. Instead mole fractions are calculated in the Fluid\-System with a given temperature, pressurem and salinity. The model is able to use either mole or mass fractions. The property use\-Moles can be set to either true or false in the problem file. Make sure that the according units are used in the problem setup. use\-Moles is set to false by default. - diff --git a/doc/handbook/ModelDescriptions/el1p2cmodel.tex b/doc/handbook/ModelDescriptions/el1p2cmodel.tex deleted file mode 100644 index 156dd70f5792e44509b4459fb418bf0bf0d91ba2..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/el1p2cmodel.tex +++ /dev/null @@ -1,32 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a one-\/phase flow of an incompressible fluid, that consists of two components. The deformation of the solid matrix is described with a quasi-\/stationary momentum balance equation. The influence of the pore fluid is accounted for through the effective stress concept (Biot 1941). The total stress acting on a rock is partially supported by the rock matrix and partially supported by the pore fluid. The effective stress represents the share of the total stress which is supported by the solid rock matrix and can be determined as a function of the strain according to Hooke\textquotesingle{}s law. - -As an equation for the conservation of momentum within the fluid phase Darcy\textquotesingle{}s approach is used\-: \[ v = - \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho_w {\textbf g} \right) \] - -Gravity can be enabled or disabled via the property system. By inserting this into the volume balance of the solid-\/fluid mixture, one gets \[ \frac{\partial \text{div} \textbf{u}}{\partial t} - \text{div} \left\{ \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho_w {\textbf g} \right)\right\} = q \;, \] - -The transport of the components $\kappa \in \{ w, a \}$ is described by the following equation\-: \[ \frac{ \partial \phi_{eff} X^\kappa}{\partial t} - \text{div} \left\lbrace X^\kappa \frac{{\textbf K}}{\mu} \left( \textbf{grad}\, p - \varrho_w {\textbf g} \right) + D^\kappa_\text{pm} \frac{M^\kappa}{M_\alpha} \textbf{grad} x^\kappa - \phi_{eff} X^\kappa \frac{\partial \boldsymbol{u}}{\partial t} \right\rbrace = q. \] - -If the model encounters stability problems, a stabilization term can be switched on. The stabilization term is defined in Aguilar et al (2008)\-: \[ \beta \text{div} \textbf{grad} \frac{\partial p}{\partial t} \] with $\beta$\-: \[ \beta = h^2 / 4(\lambda + 2 \mu) \] where $h$ is the discretization length. - -The balance equations with the stabilization term are given below\-: \[ \frac{\partial \text{div} \textbf{u}}{\partial t} - \text{div} \left\{ \frac{\textbf K}{\mu} \left(\textbf{grad}\, p - \varrho_w {\textbf g} \right) + \varrho_w \beta \textbf{grad} \frac{\partial p}{\partial t} \right\} = q \;, \] - -The transport of the components $\kappa \in \{ w, a \}$ is described by the following equation\-: - -\[ \frac{ \partial \phi_{eff} X^\kappa}{\partial t} - \text{div} \left\lbrace X^\kappa \frac{{\textbf K}}{\mu} \left( \textbf{grad}\, p - \varrho_w {\textbf g} \right) + \varrho_w X^\kappa \beta \textbf{grad} \frac{\partial p}{\partial t} + D^\kappa_\text{pm} \frac{M^\kappa}{M_\alpha} \textbf{grad} x^\kappa - \phi_{eff} X^\kappa \frac{\partial \boldsymbol{u}}{\partial t} \right\rbrace = q. \] - -The quasi-\/stationary momentum balance equation is\-: \[ \text{div}\left( \boldsymbol{\sigma'}- p \boldsymbol{I} \right) + \left( \phi_{eff} \varrho_w + (1 - \phi_{eff}) * \varrho_s \right) {\textbf g} = 0 \;, \] with the effective stress\-: \[ \boldsymbol{\sigma'} = 2\,G\,\boldsymbol{\epsilon} + \lambda \,\text{tr} (\boldsymbol{\epsilon}) \, \boldsymbol{I}. \] - -and the strain tensor $\boldsymbol{\epsilon}$ as a function of the solid displacement gradient $\textbf{grad} \boldsymbol{u}$\-: \[ \boldsymbol{\epsilon} = \frac{1}{2} \, (\textbf{grad} \boldsymbol{u} + \textbf{grad}^T \boldsymbol{u}). \] - -Here, the rock mechanics sign convention is switch off which means compressive stresses are $<$ 0 and tensile stresses are $>$ 0. The rock mechanics sign convention can be switched on for the vtk output via the property system. - -The effective porosity is calculated as a function of the solid displacement\-: \[ \phi_{eff} = \frac{\phi_{init} + \text{div} \boldsymbol{u}}{1 + \text{div}} \] All equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. - -The primary variables are the pressure $p$ and the mole or mass fraction of dissolved component $x$ and the solid displacement vector $\boldsymbol{u}$. - diff --git a/doc/handbook/ModelDescriptions/el2pmodel.tex b/doc/handbook/ModelDescriptions/el2pmodel.tex deleted file mode 100644 index f60dd9a337e0619539d19bee9247c5746d4c6519..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/el2pmodel.tex +++ /dev/null @@ -1,22 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a two-\/phase flow of compressible immiscible fluids $\alpha \in \{ w, n \}$. The deformation of the solid matrix is described with a quasi-\/stationary momentum balance equation. The influence of the pore fluid is accounted for through the effective stress concept (Biot 1941). The total stress acting on a rock is partially supported by the rock matrix and partially supported by the pore fluid. The effective stress represents the share of the total stress which is supported by the solid rock matrix and can be determined as a function of the strain according to Hooke\textquotesingle{}s law. - -As an equation for the conservation of momentum within the fluid phases the standard multiphase Darcy\textquotesingle{}s approach is used\-: \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \textbf{K} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} {\textbf g} \right) \] - -Gravity can be enabled or disabled via the property system. By inserting this into the continuity equation, one gets \[ \frac{\partial \phi_{eff} \varrho_\alpha S_\alpha}{\partial t} - \text{div} \left\{ \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K}_\text{eff} \left(\textbf{grad}\, p_\alpha - \varrho_{\alpha} \mathbf{g} \right) - \phi_{eff} \varrho_\alpha S_\alpha \frac{\partial \mathbf{u}}{\partial t} \right\} - q_\alpha = 0 \;, \] - -A quasi-\/stationary momentum balance equation is solved for the changes with respect to the initial conditions (Darcis 2012), note that this implementation assumes the soil mechanics sign convention (i.\-e. compressive stresses are negative)\-: \[ \text{div}\left( \boldsymbol{\Delta \sigma'}- \Delta p_{eff} \boldsymbol{I} \right) + \Delta \varrho_b {\textbf g} = 0 \;, \] with the effective stress\-: \[ \boldsymbol{\sigma'} = 2\,G\,\boldsymbol{\epsilon} + \lambda \,\text{tr} (\boldsymbol{\epsilon}) \, \mathbf{I}. \] - -and the strain tensor $\boldsymbol{\epsilon}$ as a function of the solid displacement gradient $\textbf{grad} \mathbf{u}$\-: \[ \boldsymbol{\epsilon} = \frac{1}{2} \, (\textbf{grad} \mathbf{u} + \textbf{grad}^T \mathbf{u}). \] - -Here, the rock mechanics sign convention is switch off which means compressive stresses are $<$ 0 and tensile stresses are $>$ 0. The rock mechanics sign convention can be switched on for the vtk output via the property system. - -The effective porosity and the effective permeability are calculated as a function of the solid displacement\-: \[ \phi_{eff} = \frac{\phi_{init} + \text{div} \mathbf{u}}{1 + \text{div} \mathbf{u}} \] \[ K_{eff} = K_{init} \text{exp}\left( 22.2(\phi_{eff}/\phi_{init} -1 )\right) \] The mass balance equations are discretized using a vertex-\/centered finite volume (box) or cell-\/centered finite volume scheme as spatial and the implicit Euler method as time discretization. The momentum balance equations are discretized using a standard Galerkin Finite Element method as spatial discretization scheme. - -The primary variables are the wetting phase pressure $p_w$, the nonwetting phase saturation $S_n$ and the solid displacement vector $\mathbf{u}$ (changes in solid displacement with respect to initial conditions). - diff --git a/doc/handbook/ModelDescriptions/elasticmodel.tex b/doc/handbook/ModelDescriptions/elasticmodel.tex deleted file mode 100644 index 5c22a3c674581a91581a7915d4d4f1cc1125f5d4..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/elasticmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a linear elastic solid using Hooke\textquotesingle{}s law as stress-\/strain relation and a quasi-\/stationary momentum balance equation\-: \[ \boldsymbol{\sigma} = 2\,G\,\boldsymbol{\epsilon} + \lambda \,\text{tr} (\boldsymbol{\epsilon}) \, \boldsymbol{I}. \] - -with the strain tensor $\boldsymbol{\epsilon}$ as a function of the solid displacement gradient $\textbf{grad} \boldsymbol{u}$\-: \[ \boldsymbol{\epsilon} = \frac{1}{2} \, (\textbf{grad} \boldsymbol{u} + \textbf{grad}^T \boldsymbol{u}). \] - -Gravity can be enabled or disabled via the property system. By inserting this into the momentum balance equation, one gets \[ \text{div} \boldsymbol{\sigma} + \varrho {\textbf g} = 0 \;, \] - -The equation is discretized using a vertex-\/centered finite volume (box) scheme as spatial discretization. - diff --git a/doc/handbook/ModelDescriptions/mpncimplicitmodel.tex b/doc/handbook/ModelDescriptions/mpncimplicitmodel.tex deleted file mode 100644 index 205aa3d9a41b9c3ca9a590609f0dc59089852330..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/mpncimplicitmodel.tex +++ /dev/null @@ -1,32 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a $M$-\/phase flow of a fluid mixture composed of $N$ chemical species. The phases are denoted by lower index $\alpha \in \{ 1, \dots, M \}$. All fluid phases are mixtures of $N \geq M - 1$ chemical species which are denoted by the upper index $\kappa \in \{ 1, \dots, N \} $. - -The momentum approximation can be selected via \char`\"{}\-Base\-Flux\-Variables\char`\"{}\-: Darcy (\hyperlink{a00280}{Implicit\-Darcy\-Flux\-Variables}) and Forchheimer (\hyperlink{a00281}{Implicit\-Forchheimer\-Flux\-Variables}) relations are available for all Box models. - -By inserting this into the equations for the conservation of the mass of each component, one gets one mass-\/continuity equation for each component $\kappa$ \[ \sum_{\kappa} \left( \phi \frac{\partial \left(\varrho_\alpha x_\alpha^\kappa S_\alpha\right)}{\partial t} + \mathrm{div}\; \left\{ v_\alpha \frac{\varrho_\alpha}{\overline M_\alpha} x_\alpha^\kappa \right\} \right) = q^\kappa \] with $\overline M_\alpha$ being the average molar mass of the phase $\alpha$\-: \[ \overline M_\alpha = \sum_\kappa M^\kappa \; x_\alpha^\kappa \] - -For the missing $M$ model assumptions, the model assumes that if a fluid phase is not present, the sum of the mole fractions of this fluid phase is smaller than $1$, i.\-e. \[ \forall \alpha: S_\alpha = 0 \implies \sum_\kappa x_\alpha^\kappa \leq 1 \] - -Also, if a fluid phase may be present at a given spatial location its saturation must be positive\-: \[ \forall \alpha: \sum_\kappa x_\alpha^\kappa = 1 \implies S_\alpha \geq 0 \] - -Since at any given spatial location, a phase is always either present or not present, one of the strict equalities on the right hand side is always true, i.\-e. \[ \forall \alpha: S_\alpha \left( \sum_\kappa x_\alpha^\kappa - 1 \right) = 0 \] always holds. - -These three equations constitute a non-\/linear complementarity problem, which can be solved using so-\/called non-\/linear complementarity functions $\Phi(a, b)$ which have the property \[\Phi(a,b) = 0 \iff a \geq0 \land b \geq0 \land a \cdot b = 0 \] - -Several non-\/linear complementarity functions have been suggested, e.\-g. the Fischer-\/\-Burmeister function \[ \Phi(a,b) = a + b - \sqrt{a^2 + b^2} \;. \] This model uses \[ \Phi(a,b) = \min \{a, b \}\;, \] because of its piecewise linearity. - -These equations are then discretized using a fully-\/implicit vertex centered finite volume scheme (often known as \textquotesingle{}box\textquotesingle{}-\/scheme) for spatial discretization and the implicit Euler method as temporal discretization. - -The model assumes local thermodynamic equilibrium and uses the following primary variables\-: -\begin{itemize} -\item The component fugacities $f^1, \dots, f^{N}$ -\item The pressure of the first phase $p_1$ -\item The saturations of the first $M-1$ phases $S_1, \dots, S_{M-1}$ -\item Temperature $T$ if the energy equation is enabled -\end{itemize} - diff --git a/doc/handbook/ModelDescriptions/nonisothermalimplicitmodel.tex b/doc/handbook/ModelDescriptions/nonisothermalimplicitmodel.tex deleted file mode 100644 index acd5fc2bcd91fdc1be9499945bee34798fb5bb1a..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/nonisothermalimplicitmodel.tex +++ /dev/null @@ -1,10 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a generic energy balance for single and multi-\/phase transport problems. Currently the non-\/isothermal model can be used on top of the 1p2c, 2p, 2p2c and 3p3c models. Comparison to simple analytical solutions for pure convective and conductive problems are found in the 1p2c test. Also refer to this test for details on how to activate the non-\/isothermal model. - -For the energy balance, local thermal equilibrium is assumed. This results in one energy conservation equation for the porous solid matrix and the fluids\-: \begin{align*} \phi \frac{\partial \sum_\alpha \varrho_\alpha u_\alpha S_\alpha}{\partial t} & + \left( 1 - \phi \right) \frac{\partial (\varrho_s c_s T)}{\partial t} - \sum_\alpha \text{div} \left\{ \varrho_\alpha h_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left( \textbf{grad}\,p_\alpha - \varrho_\alpha \mbox{\bf g} \right) \right\} \\ & - \text{div} \left(\lambda_{pm} \textbf{grad} \, T \right) - q^h = 0. \end{align*} where $h_\alpha$ is the specific enthalpy of a fluid phase $\alpha$ and $u_\alpha = h_\alpha - p_\alpha/\varrho_\alpha$ is the specific internal energy of the phase. - diff --git a/doc/handbook/ModelDescriptions/richardsimplicitmodel.tex b/doc/handbook/ModelDescriptions/richardsimplicitmodel.tex deleted file mode 100644 index 1d4cc399a02ef452a566e3aca69adaddab352faa..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/richardsimplicitmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -In the unsaturated zone, Richards\textquotesingle{} equation \[ \frac{\partial\;\phi S_w \varrho_w}{\partial t} - \text{div} \left\lbrace \varrho_w \frac{k_{rw}}{\mu_w} \; \mathbf{K} \; \left( \text{\textbf{grad}} p_w - \varrho_w \textbf{g} \right) \right\rbrace = q_w, \] is frequently used to approximate the water distribution above the groundwater level. - -It can be derived from the two-\/phase equations, i.\-e. \[ \phi\frac{\partial S_\alpha \varrho_\alpha}{\partial t} - \text{div} \left\lbrace \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha}\; \mathbf{K} \; \left( \text{\textbf{grad}} p_\alpha - \varrho_\alpha \textbf{g} \right) \right\rbrace = q_\alpha, \] where $\alpha \in \{w, n\}$ is the fluid phase, $\kappa \in \{ w, a \}$ are the components, $\rho_\alpha$ is the fluid density, $S_\alpha$ is the fluid saturation, $\phi$ is the porosity of the soil, $k_{r\alpha}$ is the relative permeability for the fluid, $\mu_\alpha$ is the fluid\textquotesingle{}s dynamic viscosity, $\mathbf{K}$ is the intrinsic permeability, $p_\alpha$ is the fluid pressure and $g$ is the potential of the gravity field. - -In contrast to the full two-\/phase model, the Richards model assumes gas as the non-\/wetting fluid and that it exhibits a much lower viscosity than the (liquid) wetting phase. (For example at atmospheric pressure and at room temperature, the viscosity of air is only about $1\%$ of the viscosity of liquid water.) As a consequence, the $\frac{k_{r\alpha}}{\mu_\alpha}$ term typically is much larger for the gas phase than for the wetting phase. For this reason, the Richards model assumes that $\frac{k_{rn}}{\mu_n}$ is infinitly large. This implies that the pressure of the gas phase is equivalent to the static pressure distribution and that therefore, mass conservation only needs to be considered for the wetting phase. - -The model thus choses the absolute pressure of the wetting phase $p_w$ as its only primary variable. The wetting phase saturation is calculated using the inverse of the capillary pressure, i.\-e. \[ S_w = p_c^{-1}(p_n - p_w) \] holds, where $p_n$ is a given reference pressure. Nota bene, that the last step is assumes that the capillary pressure-\/saturation curve can be uniquely inverted, so it is not possible to set the capillary pressure to zero when using the Richards model! - diff --git a/doc/handbook/ModelDescriptions/stokesimplicitmodel.tex b/doc/handbook/ModelDescriptions/stokesimplicitmodel.tex deleted file mode 100644 index 251aedab735513487a252c32de5a9eb21cfed349..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/stokesimplicitmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements laminar Stokes flow of a single fluid, solving the momentum balance equation \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] - -and the mass balance equation \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0. \] - -By setting the property {\ttfamily Enable\-Navier\-Stokes} to {\ttfamily true} the Navier-\/\-Stokes equation can be solved. In this case an additional term \[ + \varrho_g \left(\boldsymbol{v}_g \boldsymbol{\cdot} \boldsymbol{\nabla} \right) \boldsymbol{v}_g \] is added to the momentum balance equation. - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/stokesncimplicitmodel.tex b/doc/handbook/ModelDescriptions/stokesncimplicitmodel.tex deleted file mode 100644 index 1c917d2008782326faa8afd345701bd49ce8a9d5..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/stokesncimplicitmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements an isothermal n-\/component Stokes flow of a fluid solving a momentum balance, a mass balance and a conservation equation for each component. When using mole fractions naturally the densities represent molar densites - -Momentum Balance\-: \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] - -Mass balance equation\-: \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 \] - -\hyperlink{a00084}{Component} mass balance equations\-: \[ \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa - D^\kappa_g \varrho_g \frac{M^\kappa}{M_g} \boldsymbol{\nabla} X_g^\kappa \right) - q_g^\kappa = 0 \] - -This is discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/stokesncniimplicitmodel.tex b/doc/handbook/ModelDescriptions/stokesncniimplicitmodel.tex deleted file mode 100644 index a0e48a098b5f1f5da80f4c8c317f4b7b2625c570..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/stokesncniimplicitmodel.tex +++ /dev/null @@ -1,18 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements a non-\/isothermal n-\/component Stokes flow of a fluid solving a momentum balance, a mass balance, a conservation equation for one component, and one balance equation for the energy. - -Momentum Balance\-: \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] - -Mass balance equation\-: \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 \] - -\hyperlink{a00084}{Component} mass balance equation\-: \[ \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa - D^\kappa_g \varrho_g \frac{M^\kappa}{M_g} \boldsymbol{\nabla} x_g^\kappa \right) - q_g^\kappa = 0 \] - -Energy balance equation\-: \[ \frac{\partial (\varrho_g u_g)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g h_g {\boldsymbol{v}}_g - \sum_\kappa \left[ h^\kappa_g D^\kappa_g \varrho_g \frac{M^\kappa}{M_g} \nabla x^\kappa_g \right] - \lambda_g \boldsymbol{\nabla} T \right) - q_T = 0 \] - -This is discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit Euler method as temporal discretization. - diff --git a/doc/handbook/ModelDescriptions/zeroeqimplicitmodel.tex b/doc/handbook/ModelDescriptions/zeroeqimplicitmodel.tex deleted file mode 100644 index 3aba7e286736808c0ea850a2f994b6f14b16e4c7..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/zeroeqimplicitmodel.tex +++ /dev/null @@ -1,14 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements an single-\/phase isothermal free flow solving the mass and the momentum balance. For the momentum balance the Reynolds-\/averaged Navier-\/\-Stokes (R\-A\-N\-S) equation with zero equation (algebraic) turbulence model is used. - -Mass balance\-: \[ \frac{\partial \varrho_\textrm{g}}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right) - q_\textrm{g} = 0 \] - -Momentum Balance\-: \[ \frac{\partial \left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} {\boldsymbol{v}_\textrm{g} {\boldsymbol{v}}_\textrm{g}} - \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right] \left(\boldsymbol{\nabla} \boldsymbol{v}_\textrm{g} + \boldsymbol{\nabla} \boldsymbol{v}_\textrm{g}^T \right) \right) + \left(p_\textrm{g} {\bf {I}} \right) - \varrho_\textrm{g} {\bf g} = 0, \] - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/zeroeqncimplicitmodel.tex b/doc/handbook/ModelDescriptions/zeroeqncimplicitmodel.tex deleted file mode 100644 index d0deec2ac6103bafea1edc111d02f0b441422f66..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/zeroeqncimplicitmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements an single-\/phase isothermal compositional free flow solving the mass and the momentum balance. For the momentum balance the Reynolds-\/averaged Navier-\/\-Stokes (R\-A\-N\-S) equation with zero equation (algebraic) turbulence model is used. - -Mass balance\-: \[ \frac{\partial \varrho_\textrm{g}}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right) - q_\textrm{g} = 0 \] - -Momentum Balance\-: \[ \frac{\partial \left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} {\boldsymbol{v}_\textrm{g} {\boldsymbol{v}}_\textrm{g}} - \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right] \left(\boldsymbol{\nabla} \boldsymbol{v}_\textrm{g} + \boldsymbol{\nabla} \boldsymbol{v}_\textrm{g}^T \right) \right) + \left(p_\textrm{g} {\bf {I}} \right) - \varrho_\textrm{g} {\bf g} = 0, \] - -\hyperlink{a00084}{Component} mass balance equations\-: \[ \frac{\partial \left(\varrho_\textrm{g} X_\textrm{g}^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} X_\textrm{g}^\kappa - \left[ D^\kappa_\textrm{g} + D^\kappa_\textrm{g,t} \right] \varrho_\textrm{g} \frac{M^\kappa}{M_\textrm{g}} \boldsymbol{\nabla} x_\textrm{g}^\kappa \right) - q_\textrm{g}^\kappa = 0 \] - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/ModelDescriptions/zeroeqncniimplicitmodel.tex b/doc/handbook/ModelDescriptions/zeroeqncniimplicitmodel.tex deleted file mode 100644 index c2a101598e91a6a519185b0859c679fc6eb8a467..0000000000000000000000000000000000000000 --- a/doc/handbook/ModelDescriptions/zeroeqncniimplicitmodel.tex +++ /dev/null @@ -1,18 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -This model implements an single-\/phase non-\/isothermal compositional free flow solving the mass and the momentum balance. For the momentum balance the Reynolds-\/averaged Navier-\/\-Stokes (R\-A\-N\-S) equation with zero equation (algebraic) turbulence model is used. - -Mass balance\-: \[ \frac{\partial \varrho_\textrm{g}}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right) - q_\textrm{g} = 0 \] - -Momentum Balance\-: \[ \frac{\partial \left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} {\boldsymbol{v}_\textrm{g} {\boldsymbol{v}}_\textrm{g}} - \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right] \left(\boldsymbol{\nabla} \boldsymbol{v}_\textrm{g} + \boldsymbol{\nabla} \boldsymbol{v}_\textrm{g}^T \right) \right) + \left(p_\textrm{g} {\bf {I}} \right) - \varrho_\textrm{g} {\bf g} = 0, \] - -\hyperlink{a00084}{Component} mass balance equations\-: \[ \frac{\partial \left(\varrho_\textrm{g} X_\textrm{g}^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} X_\textrm{g}^\kappa - \left[ D^\kappa_\textrm{g} + D^\kappa_\textrm{g,t} \right] \varrho_\textrm{g} \frac{M^\kappa}{M_\textrm{g}} \boldsymbol{\nabla} x_\textrm{g}^\kappa \right) - q_\textrm{g}^\kappa = 0 \] - -Energy balance equation\-: \[ \frac{\partial (\varrho_\textrm{g} u_\textrm{g})}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_\textrm{g} h_\textrm{g} {\boldsymbol{v}}_\textrm{g} - \sum_\kappa \left( h^\kappa_\textrm{g} \left[ D^\kappa_\textrm{g} + D^\kappa_\textrm{g,t} \right] \varrho_\textrm{g} \frac{M^\kappa}{M_\textrm{g}} \nabla x^\kappa_\textrm{g} \right) - \left[ \lambda_\textrm{g} + \lambda_\textrm{g,t} \right] \boldsymbol{\nabla} T \right) - q_\textrm{T} = 0 \] - -This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit Euler method in time. - diff --git a/doc/handbook/NewtonInANutshell.tex b/doc/handbook/NewtonInANutshell.tex deleted file mode 100644 index a64ab420f9fb32211b1bc68edafd43232f46a945..0000000000000000000000000000000000000000 --- a/doc/handbook/NewtonInANutshell.tex +++ /dev/null @@ -1,61 +0,0 @@ - - -\chapter{Newton in a Nutshell} -Coming back to the example of chapter \ref{flow} the following mass conservation equation is to be solved: -\begin{align} -\underbrace{ - \phi \frac{\partial \varrho_\alpha S_\alpha}{\partial t} - - - \text{div} \left\{ - \varrho_\alpha \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} \left(\grad\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) - \right\} - q_\alpha} _ -{\textbf{f}(\textbf{u}^r)} -= 0 \; . -\end{align} - -Because of the nonlinear dependencies (even in this comparativly simple equation) in there, this is a really difficult task. However, for finding roots of of difficult equations there is a really handy method out there: \textsc{Newton}'s method. - -When using a fully coupled numerical model, one timestep essentially consists of the application of the \textsc{Newton} algorithm to solve the nonlinear system. - -One step of the \textsc{Newton} method can be formalized as follows: - -\textsc{Newton} method: -\begin{subequations} -\begin{align} -\label{NewtonGen} -\textbf{u}^{r+1} &= \textbf{u}^r - \left(\textbf{f}^\prime (\textbf{u}^r) \right)^{-1} \textbf{f}(\textbf{u}^r) \\ -\Leftrightarrow {\textbf{f}^{\prime}(\textbf{u}^r)} ( \textbf{u}^{r+1}-\textbf{u}^r) &= -\textbf{f}(\textbf{u}^r) \\ -\Leftrightarrow \underbrace{\textbf{f}^{\prime}(\textbf{u}^r)}_{\textnormal{Jacobian}} ( \textbf{u}^r - \textbf{u}^{r+1}) &= \textbf{f}(\textbf{u}^r) \label{NewtonAsUsed} -\end{align} -\end{subequations} - -\noindent with -\begin{itemize} -\item $\phantom{a}^r$: last iteration, $\phantom{a}^{r+1}$: current iteration, -\item $\phantom{a}^\prime$: derivative -\item $\textbf{u}$: vector of unknowns, the actual primary variables -\item $\textbf{f}(\textbf{u}^r)$: function of vector of unknowns -\end{itemize} - -1-D example with slope $m$: -\begin{equation} - m= \frac{y(u^{r+1})-y(u^{r})}{u^{r+1}-u^{r}} \textnormal{ for a root of a function: } m= - \frac{y(u^{r})}{u^{r+1}-u^{r}} -\end{equation} -The value of u (generally a vector of unknowns) for which f becomes zero is searched for. Therefore the quantity of interest is $\textbf{u}^{r+1}$. - -But the (BiCGSTAB / Pardiso / ...) linear solver solves systems of the form: -\begin{equation} -\label{GenSysEq} - A\textbf{x} = \textbf{b} . -\end{equation} - -Comparing (\ref{GenSysEq}) with (\ref{NewtonAsUsed}) leads to: -\begin{itemize} -\item $\textbf{b} = \textbf{f}(\textbf{u}^r)$ r.h.s. as it is known from the last iteration. Here, $\textbf{f}(\textbf{u}^r)$ is called residual. It is obtained by evaluating the balance equations with the primary variables, as obtained from the last iteration step. -\item $A=\textbf{f}^{\prime}(\textbf{u}^r)$ coefficient matrix or \textsc{Jacobian}. It is obtained by numerical differentiation. Evaluating the balance equations at the last solution + eps, then evaluating the balance equations at the last solution - eps, division by 2eps: numerical differentiation complete. -\item $\textbf{x} = (\textbf{u}^{r+1} - \textbf{u}^{r})$ this is what the linear solver finds as an solution. -\end{itemize} - -This is equivalent to stating that the implemented algorithm solves for the change of the solution. Or in other words: until the $\textbf{u}$ does not change with one more \textsc{Newton-}iteration (do not confuse with timestep!). - -In the rest of Dumux (everywhere besides in the solver), not the change of the solution is looked for, but the actual solution is used. Therefore the outcome of the linear solver needs to be reformulated as done in \verb+updateMethod.update(*this, u, *uOld, model);+. In this function the ``change in solution'' is changed to ``solution''. Afterwards the quantity \verb+*u+ stands for the solution. diff --git a/doc/handbook/getting-started.tex b/doc/handbook/getting-started.tex deleted file mode 100644 index 93ba070734e3178031ec108785e7eb53df6759fd..0000000000000000000000000000000000000000 --- a/doc/handbook/getting-started.tex +++ /dev/null @@ -1,7 +0,0 @@ -\chapter{Getting started} - -First, we describe a quick installation procedure. -Then a quick start guide for the first \Dumux experience is provided. - -\input{quick-install} -\input{quickstart-guide} diff --git a/doc/handbook/spatialdiscretization.tex b/doc/handbook/spatialdiscretization.tex deleted file mode 100644 index 59e108eb7dad4f465030ea38cb555d98e8c296e6..0000000000000000000000000000000000000000 --- a/doc/handbook/spatialdiscretization.tex +++ /dev/null @@ -1,145 +0,0 @@ -\section{Implicit Spatial Discretization Schemes}\label{spatialdiscretization} - -For the implicit models there are two spatial discretization schemes (box and Cell Centered Finite Volume Method) available which are shortly introduced -in this section. - -\subsection{Box Method -- A Short Introduction}\label{box} - -The so called box method unites the advantages of the finite-volume (FV) and finite-element (FE) methods. - -First, the model domain $G$ is discretized with a FE mesh consisting of nodes i and corresponding elements $E_k$. Then, a secondary FV mesh is constructed by connecting the midpoints and barycenters of the elements surrounding node i creating a box $B_i$ around node i (see Figure \ref{pc:box}a). - -\begin{figure} [ht] -\includegraphics[width=0.8\linewidth,keepaspectratio]{PNG/box_disc.png} -\caption{\label{pc:box} Discretization of the box method} -\end{figure} - -The FE mesh divides the box $B_i$ into subcontrolvolumes (scv's) $b^k_i$ (see Figure \ref{pc:box}b). Figure \ref{pc:box}c shows the finite element $E_k$ and the scv's $b^k_i$ inside $E_k$, which belong to four different boxes $B_i$. Also necessary for the discretization are the faces of the subcontrolvolumes (scvf's) $e^k_{ij}$ between the scv's $b^k_i$ and $b^k_j$, where $|e^k_{ij}|$ is the length of the scvf. The integration points $x^k_{ij}$ on $e^k_{ij}$ and the outer normal vector $\mathbf n^k_{ij}$ are also to be defined (see Figure \ref{pc:box}c). - -The advantage of the FE method is that unstructured grids can be used, while the FV method is mass conservative. The idea is to apply the FV method (balance of fluxes across the interfaces) to each FV box $B_i$ and to get the fluxes across the interfaces $e^k_{ij}$ at the integration points $x^k_{ij}$ from the FE approach. Consequently, at each scvf the following expression results: - -\begin{equation} - f(\tilde u(x^k_{ij})) \cdot \mathbf n^k_{ij} \: |e^k_{ij}| \qquad \textrm{with} \qquad \tilde u(x^k_{ij}) = \sum_i N_i(x^k_{ij}) \cdot \hat u_i . -\end{equation} - -In the following, the discretization of the balance equation is going to be derived. From the \textsc{Reynolds} transport theorem follows the general balance equation: - -\begin{equation} - \underbrace{\int_G \frac{\partial}{\partial t} \: u \: dG}_{1} + \underbrace{\int_{\partial G} (\mathbf{v} u + \mathbf w) \cdot \textbf n \: d\varGamma}_{2} = \underbrace{\int_G q \: dG}_{3} -\end{equation} - -\begin{equation} - f(u) = \int_G \frac{\partial u}{\partial t} \: dG + \int_{G} \nabla \cdot \underbrace{\left[ \mathbf{v} u + \mathbf w(u)\right] }_{F(u)} \: dG - \int_G q \: dG = 0 -\end{equation} -where term 1 describes the changes of entity $u$ within a control volume over time, term 2 the advective, diffusive and dispersive fluxes over the interfaces of the control volume and term 3 is the source and sink term. $G$ denotes the model domain and $F(u) = F(\mathbf v, p) = F(\mathbf v(x,t), p(x,t))$. - -Like the FE method, the box method follows the principle of weighted residuals. In the function $f(u)$ the unknown $u$ is approximated by discrete values at the nodes of the FE mesh $\hat u_i$ and linear basis functions $N_i$ yielding an approximate function $f(\tilde u)$. For $u\in \lbrace \mathbf v, p, x^\kappa \rbrace$ this means - -\begin{minipage}[b]{0.47\textwidth} -\begin{equation} -\label{eq:p} - \tilde p = \sum_i N_i \hat{p_i} -\end{equation} -\begin{equation} -\label{eq:v} - \tilde{\mathbf v} = \sum_i N_i \hat{\mathbf v} -\end{equation} -\begin{equation} -\label{eq:x} - \tilde x^\kappa = \sum_i N_i \hat x^\kappa -\end{equation} -\end{minipage} -\hfill -\begin{minipage}[b]{0.47\textwidth} -\begin{equation} -\label{eq:dp} - \nabla \tilde p = \sum_i \nabla N_i \hat{p_i} -\end{equation} -\begin{equation} -\label{eq:dv} - \nabla \tilde{\mathbf v} = \sum_i \nabla N_i \hat{\mathbf v} -\end{equation} -\begin{equation} -\label{eq:dx} - \nabla \tilde x^\kappa = \sum_i \nabla N_i \hat x^\kappa . -\end{equation} -\end{minipage} - -Due to the approximation with node values and basis functions the differential equations are not exactly fulfilled anymore but a residual $\varepsilon$ is produced. - -\begin{equation} - f(u) = 0 \qquad \Rightarrow \qquad f(\tilde u) = \varepsilon -\end{equation} - -Application of the principle of weighted residuals, meaning the multiplication of the residual $\varepsilon$ with a weighting function $W_j$ and claiming that this product has to vanish within the whole domain, - -\begin{equation} - \int_G W_j \cdot \varepsilon \: \overset {!}{=} \: 0 \qquad \textrm{with} \qquad \sum_j W_j =1 -\end{equation} -yields the following equation: - -\begin{equation} - \int_G W_j \frac{\partial \tilde u}{\partial t} \: dG + \int_G W_j \cdot \left[ \nabla \cdot F(\tilde u) \right] \: dG - \int_G W_j \cdot q \: dG = \int_G W_j \cdot \varepsilon \: dG \: \overset {!}{=} \: 0 . -\end{equation} - -Then, the chain rule and the \textsc{Green-Gaussian} integral theorem are applied. - -\begin{equation} - \int_G W_j \frac{\partial \sum_i N_i \hat u_i}{\partial t} \: dG + \int_{\partial G} \left[ W_j \cdot F(\tilde u)\right] \cdot \mathbf n \: d\varGamma_G + \int_G \nabla W_j \cdot F(\tilde u) \: dG - \int_G W_j \cdot q \: dG = 0 -\end{equation} - -A mass lumping technique is applied by assuming that the storage capacity is reduced to the nodes. This means that the integrals $M_{i,j} = \int_G W_j \: N_i \: dG$ are replaced by the mass lumping term $M^{lump}_{i,j}$ which is defined as: - -\begin{equation} - M^{lump}_{i,j} =\begin{cases} \int_G W_j \: dG = \int_G N_i \: dG = V_i &i = j\\ - 0 &i \neq j\\ - \end{cases} -\end{equation} -where $V_i$ is the volume of the FV box $B_i$ associated with node i. The application of this assumption in combination with $\int_G W_j \:q \: dG = V_i \: q$ yields - -\begin{equation} - V_i \frac{\partial \hat u_i}{\partial t} + \int_{\partial G} \left[ W_j \cdot F(\tilde u)\right] \cdot \mathbf n \: d\varGamma_G + \int_G \nabla W_j \cdot F(\tilde u) \: dG- V_i \cdot q = 0 \, . -\end{equation} - -Defining the weighting function $W_j$ to be piecewisely constant over a control volume box $B_i$ - -\begin{equation} - W_j(x) = \begin{cases} - 1 &x \in B_i \\ - 0 &x \notin B_i\\ - \end{cases} -\end{equation} - -causes $\nabla W_j = 0$: - -\begin{equation} -\label{eq:disc1} - V_i \frac{\partial \hat u_i}{\partial t} + \int_{\partial B_i} \left[ W_j \cdot F(\tilde u)\right] \cdot \mathbf n \; d{\varGamma}_{B_i} - V_i \cdot q = 0 . -\end{equation} - -The consideration of the time discretization and inserting $W_j = 1$ finally lead to the discretized form which will be applied to the mathematical flow and transport equations: - -\begin{equation} -\label{eq:discfin} - V_i \frac{\hat u_i^{n+1} - \hat u_i^{n}}{\Delta t} + \int_{\partial B_i} F(\tilde u^{n+1}) \cdot \mathbf n \; d{\varGamma}_{B_i} - V_i \: q^{n+1} \: = 0 -\end{equation} - -\subsection{Cell Centered Finite Volume Method -- A Short Introduction}\label{cc} - -\begin{figure} [ht] -\centering -\includegraphics[width=0.4\linewidth,keepaspectratio]{PNG/cc_disc.png} -\caption{\label{pc:cc} Discretization of the cell centered finite volume method} -\end{figure} - -The cell centered finite volume method uses the elements of the grid as control volumes. -For each control volume all discrete values are determined at the element/control volume center (see Figure~\ref{pc:cc}). -The mass or energy fluxes are evaluated at the integration points ($x_{ij}$), which are located at the midpoints of the control -volume faces. This is a two point flux approximation since the flux between the element/control volume centers $i$ and $j$ is calculated -only with information from these two points. In contrast the box method uses a multi-point flux approximation where all nodes of the -element influence the flux between two specific nodes. \\ -Neumann boundary conditions are applied at the boundary control volume faces and Dirichlet boundary conditions at the boundary control volumes. \\ -The cell centered finite volume method is robust and mass conservative but should only be applied for structured grids -(the control volume face normal vector ($n_{ij}$) should be parallel to the direction of the gradient between the two element/control -volume centers). - diff --git a/doc/handbook/tutorial.tex b/doc/handbook/tutorial.tex deleted file mode 100644 index 0569ed9252ba8c183d7868b268638cf01db6e991..0000000000000000000000000000000000000000 --- a/doc/handbook/tutorial.tex +++ /dev/null @@ -1,9 +0,0 @@ -\chapter[Tutorial]{Tutorial}\label{chp:tutorial} - -In \Dumux two sorts of models are implemented: Fully-coupled models and decoupled models. In the fully-coupled models a flow system is described by a system of strongly coupled equations, which can be for example mass balance equations for phases, mass balance equations for components or energy balance equations. In contrast, a decoupled model consists of a pressure equation, which is iteratively coupled to a saturation equation, concentration equations, energy balance equations, etc. - -Examples for different kinds of both, coupled and decoupled models, are isothermal two-phase models, isothermal two-phase two-component models, non-isothermal two-phase models and non-isothermal two-phase two-component models. - -In section \ref{box} a short introduction to the box method is given, in section \ref{cc} the cell centered finite volume method is introduced. The box method is used in the fully-coupled models for the spatial discretization of the system of equations. The decoupled models employ usually a cell centered finite volume scheme. The following two sections of the tutorial demonstrate how to solve problems using, first, a fully-coupled model (section \ref{tutorial-coupled}) and, second, using a decoupled model (section \ref{tutorial-decoupled}). Being the easiest case, an isothermal two-phase system (two fluid phases, one solid phase) will be considered. -\input{tutorial-coupled} -\input{tutorial-decoupled}