Commit cd8a714d authored by Benjamin Faigle's avatar Benjamin Faigle
Browse files

improvement of handbook:

- removed all (old) occurrences of Dumux 2.1 and Dune 2.1
- updated "Flow of things" to version in the AWR Dumux paper: Included decoupled flow with adaptive gridding.
reviewed by Bernd

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9272 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 1c5a47e9
...@@ -18,70 +18,106 @@ There are extensive comments regarding the formating in the tex file: so feel fr ...@@ -18,70 +18,106 @@ There are extensive comments regarding the formating in the tex file: so feel fr
\section{Structure -- by content} \section{Structure -- by content}
\label{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. % 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 employing a fully coupled model. Each item stands for a characteristic step within the modeling framework. This list shows the algorithmic outline of a typical \Dumux run. Each item stands for a characteristic step within the modeling framework.
\clearpage \clearpage
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}
\scriptsize
\sffamily
\begin{tabbing} \begin{tabbing}
\textbf{\numberThis{main}{init}} \hspace{0.01\textwidth} \= \textbf{{\begin{turn}{45}\numberThis{main}{init}\end{turn}}} \=
\textbf{\numberThis{time step}{prep}} \hspace{0.01\textwidth} \= \textbf{{\begin{turn}{45}\numberThis{time step}{prep}\end{turn}}} \=
\textbf{\numberThis{Newton step}{elem}} \hspace{0.01\textwidth} \= \textbf{{\begin{turn}{45}\numberThis{\textsc{Newton}}{elem}\end{turn}}} \=
\textbf{\numberThis{Element}{calc}} \hspace{0.01\textwidth} \\ \textbf{{\begin{turn}{45}\numberThis{element}{calc}\end{turn}}} \= \\
\\ \\
initialize \\ initialize \\
\textbf{for each} time step\\ \textbf{foreach} time step\\
\> pre-process solution\\ \> prepare update\\
\> \textbf{for each} \textsc{Newton} iteration \\ \> \textbf{foreach} \textsc{Newton} iteration \\
\> \> \textbf{for each} element \\ \> \> \textbf{foreach} element \\
\> \> \> calculate element's local residual \\ \> \> \> - calculate element \\
\> \> \> calculate element's \textsc{Jacobian} of local residual \\ \>\>\> \; residual vector and \\
\> \> \> add local residual to global residual vector \\ \>\>\> \; Jacobian matrix\\
\> \> \> add local \textsc{Jacobian} to global \textsc{Jacobian} matrix \\ \> \> \> - assemble into global\\
\>\>\> \; residual vector and \\
\> \> \textbf{end for} \\ \> \> \> \;{Jacobian} matrix \\
\> \> solve linear system of equations\\ \> \> \textbf{endfor} \\
\> \> update current iterative solution\\
\> \> \textbf{if} converged \\ \> \> solve linear system\\
\> \> \qquad stop \textsc{Newton} iteration\\ \> \> update solution\\
\> \> \textbf{end if} \\ \> \> check for \textsc{Newton} convergence\\
\> \textbf{endfor}\\ \> \textbf{endfor}\\
\> \textbf{if} converged \\ \> - adapt time step size, \\
\> \qquad post-process solution\\ \> \; possibly redo with smaller step size\\
\> \qquad write result\\ \> - write result\\
\> \qquad adapt timestep size \\ \textbf{endfor}\\
\> \textbf{else if} not converged \\ finalize
\> \qquad retry with half time step size\\ \end{tabbing}
\> \textbf{end if} \\
\textbf{end for}\\ \end{minipage}
finalize\\
&
\begin{minipage}[t]{0.48\textwidth}
\setcounter{thingCounter}{0}
\scriptsize
\sffamily
\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}4. element\end{turn}}} \= \\
\\
initialize \\
\textbf{foreach} time step\\
\> prepare update\\
\> \textbf{foreach} \textsc{IMPES/C} step \\
\> \> \textbf{if} grid is adaptive\\
\> \> \> - calculate refinement indicator\\
\> \> \> - mark elements, adapt the grid\\
\> \> \> - map old solution to new grid\\
\> \> - calculate {flow field}\\
\> \> \textbf{foreach} element \\
\> \> \> - calculate element stiffness matrix \\
\> \> \> - assemble into global matrix \\
\> \> \textbf{endfor} \\
\> \> solve linear system\\
\> \> - calculate {transport} \\
\> \> \; (saturations, concentrations,...) \\
\> \> \textbf{foreach} element \\
\> \> \> -calculate update (explicitly) \\
\> \> \>- adapt time step ({CFL}-like criterion) \\
\> \> \textbf{endfor} \\
\> \> - update old solution \\
\> \> - postprocess (flash calculation, etc.)\\
\> \textbf{endfor}\\
\> - write result\\
\textbf{endfor}\\
finalize
\end{tabbing} \end{tabbing}
\end{minipage}
\end{tabular}
%% this is tructured by a table propably the new structure (\numberThis{}{} defined in the main document)is intuetivly easier to get \caption{Structure of a coupled fully-implicit (\textbf{left}) and a decoupled semi-implicit (\textbf{right}) scheme in \Dumux.}
% \begin{enumerate}[1] \label{fig:algorithm}
% \item\label{init} initialize \\ \end{figure}
% \textbf{foreach} timestep
% \item\label{prep}
% \hspace*{0.05\textwidth} prepare update\\
% \hspace*{0.05\textwidth} \textbf{foreach} \textsc{Newton} step
% \item\label{elem}
% \hspace*{0.1\textwidth} \textbf{foreach} element
% \item\label{calc}
% \hspace*{0.15\textwidth} calculate element \textit{Jacobian}\\
% \hspace*{0.15\textwidth} assemble into global \textit{Jacobian} matrix \\
%
% \hspace*{0.10\textwidth} \textbf{foreach} element calculate element residual \\
% \hspace*{0.10\textwidth} assemble into global defect\\
%
% \hspace*{0.05\textwidth} solve linear system\\
% \hspace*{0.05\textwidth} update solution\\
% \hspace*{0.05\textwidth} check for \textsc{Newton} convergence\\
% \hspace*{0.05\textwidth} adapt timestep, possibly redo with smaller stepsize\\
% \hspace*{0.05\textwidth} write result\\
% \end{enumerate}
\subsection{Levels} \subsection{Levels}
......
...@@ -34,7 +34,7 @@ been written by oneself. ...@@ -34,7 +34,7 @@ been written by oneself.
\item Files: Filenames should consist of lower case letters exclusively. Header files get the suffix .hh, implementation files the suffix .cc \item Files: Filenames should consist of lower case letters exclusively. Header files get the suffix .hh, implementation files the suffix .cc
\end{itemize} \end{itemize}
\item Documentation: \item Documentation:
Dune, as any software project of similar complexity, will stand and fall with the quality of its documentation. \Dumux, as any software project of similar complexity, will stand and fall 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. In particular, please comment \textbf{all} 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. In particular, please comment \textbf{all}
\begin{itemize} \begin{itemize}
\item Method Parameters (in / out) \item Method Parameters (in / out)
......
...@@ -83,8 +83,8 @@ for debugging: & valgrind &\\ ...@@ -83,8 +83,8 @@ for debugging: & valgrind &\\
\end{table} \end{table}
\section{Obtaining source code for \Dune and \Dumux} \section{Obtaining source code for \Dune and \Dumux}
As stated above, the \Dumux release 2.1.0 and trunk (developer tree) are based on the \Dune release 2.1.1, As stated above, the \Dumux release 2.2.0 and trunk (developer tree) are based on the \Dune release 2.2.0,
comprising the core modules \texttt{dune-common}, \texttt{dune-grid}, \texttt{dune-istl} and \texttt{dune-localfunctions}. comprising the core modules \texttt{dune-common}, \texttt{dune-grid}, \texttt{dune-geometry}, \texttt{dune-istl} and \texttt{dune-localfunctions}.
% and the external dune module \texttt{dune-pdelab}. % and the external dune module \texttt{dune-pdelab}.
For working with \Dumux, these modules are required. For working with \Dumux, these modules are required.
...@@ -150,7 +150,7 @@ $ svn checkout https://svn.dune-project.org/svn/dune-geometry/branches/release-2 ...@@ -150,7 +150,7 @@ $ svn checkout https://svn.dune-project.org/svn/dune-geometry/branches/release-2
$ svn checkout https://svn.dune-project.org/svn/dune-localfunctions/branches/release-2.2 dune-localfunctions $ svn checkout https://svn.dune-project.org/svn/dune-localfunctions/branches/release-2.2 dune-localfunctions
\end{lstlisting} \end{lstlisting}
The newest and maybe unstable developments are also provided in these repositories in a folder called \emph{trunk}. Please check the \Dune website \cite{DUNE-DOWNLOAD-SVN} for further information. However, the current \Dumux release is based on the stable 2.1 release and it might not compile without further adaptations using the the newest versions of \Dune. The newest and maybe unstable developments are also provided in these repositories in a folder called \emph{trunk}. Please check the \Dune website \cite{DUNE-DOWNLOAD-SVN} for further information. However, the current \Dumux release is based on the stable 2.2 release and it might not compile without further adaptations using the the newest versions of \Dune.
The additional module \texttt{dune-grid-howto} is a tutorial which provides information about the \Dune grid interface. The additional module \texttt{dune-grid-howto} is a tutorial which provides information about the \Dune grid interface.
It may give you an idea of how some abstractions in \Dune are done. It may give you an idea of how some abstractions in \Dune are done.
......
...@@ -297,7 +297,7 @@ compile the program. ...@@ -297,7 +297,7 @@ compile the program.
\end{itemize} \end{itemize}
\subsubsection{Exercise 3: Parameter file input.} \subsubsection{Exercise 3: Parameter file input.}
As you have experienced, compilation takes quite some time. Therefore, \Dumux 2.1 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.\\ 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/boxmodels/2p/}, you see that the main file looks rather empty: The parameter file \texttt{test\_2p.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. If you look at the Application in \texttt{/test/boxmodels/2p/}, you see that the main file looks rather empty: The parameter file \texttt{test\_2p.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. 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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment