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

- Add adaptive decoupled models to changelog and model description in handbook

- Tutorial:
	* Corrected sign of outflow nemann condition and added explanation to text
	* Corrected some errors in decoupled tut, improved text for changeing components
	* Added solutions to the decoupled tutorial

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9217 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 42245826
......@@ -19,6 +19,9 @@ Differences Between DuMuX 2.1 and DuMuX 2.2
...fluxvariables.hh has to get the additional argument and the
class has to be adapted to deal with boundary faces. See FS#117 and #99
for details.
- Decoupled Models: An h-adaptive model using a mpfa l-method was added
that simulates 2p and 2p2c flow on irregular grids in two dimensions.
* Deprecated CLASSES/FILES, to be removed after 2.2:
- Model specific base box problems: The common functionality has been collected
......
......@@ -195,11 +195,13 @@ subdirectories of \texttt{dumux/boxmodels} of the \Dumux distribution.
%
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{The one-phase model}
\input{ModelDescriptions/1pdecoupledmodel}
\subsubsection{The two-phase model}
\subsubsection{The two-phase model}\label{ch:2p_decoupled}
\paragraph{Pressure model}
\input{ModelDescriptions/2pdecoupledpressuremodel}
......@@ -207,7 +209,7 @@ In comparison to a fully implicit model, the decoupled structure allows the use
\paragraph{Saturation model}
\input{ModelDescriptions/2pdecoupledsaturationmodel}
\subsubsection{The two-phase, two-component model}
\subsubsection{The two-phase, two-component model}\label{ch:2p2c_decoupled}
\input{ModelDescriptions/2p2cdecoupledpressuremodel}
\input{ModelDescriptions/2p2cdecoupledtransportmodel}
......
......@@ -23,7 +23,7 @@ Water infiltrates from the left side into the domain and replaces the oil. Gravi
\psfrag{S_n = 0}{$S_n = 0$}
\psfrag{S_n_initial = 0}{\textcolor{white}{$\mathbf{S_{n_{initial}} = 1}$}}
\psfrag{q_w = 0 [kg/m^2s]}{$q_w = 0$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\psfrag{q_n = -3 x 10^-4 [kg/m^2s]}{$q_n = -3 \times 10^{-2}$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\psfrag{q_n = -3 x 10^-4 [kg/m^2s]}{$q_n = 3 \times 10^{-2}$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\centering
\includegraphics[width=0.9\linewidth,keepaspectratio]{EPS/tutorial-problemconfiguration}
\caption{Geometry of the tutorial problem with initial and boundary conditions.}\label{tutorial-coupled:problemfigure}
......@@ -367,7 +367,8 @@ For the visualization of the results using paraview please refer to section \ref
\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. \\
Note, that the value has to be positive for outflow and negative for inflow.
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.
......@@ -401,8 +402,11 @@ In order to include a fluid system, you first have to comment out lines \ref{tut
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})
with the appropriate type, which is:\\
\texttt{Dumux::FluidSystems::H2OAir<typename GET\_PROP\_TYPE(TypeTag, Scalar)>}.\\
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();}.
......
......@@ -33,7 +33,7 @@ effects are neglected.
\psfrag{S_n = 0}{$S_w = 1$}
\psfrag{S_n_initial = 0}{\textcolor{white}{$\mathbf{S_{w_{initial}} = 0}$}}
\psfrag{q_w = 0 [kg/m^2s]}{$q_w = 0$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\psfrag{q_n = -3 x 10^-4 [kg/m^2s]}{$q_n = -3 \times 10^-2$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\psfrag{q_n = -3 x 10^-4 [kg/m^2s]}{$q_n = 3 \times 10^-2$ $\left[\frac{\textnormal{kg}}{\textnormal{m}^2 \textnormal{s}}\right]$}
\centering
\includegraphics[width=0.9\linewidth,keepaspectratio]{EPS/tutorial-problemconfiguration}
\caption{Geometry of the tutorial problem with initial and boundary conditions.}\label{tutorial-decoupled:problemfigure}
......@@ -191,21 +191,23 @@ As you can see, the simulation creates many output files. To reduce these in ord
\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.
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:
\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 Oil 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::SimpleDNAPL}, 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 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::SimpleDNAPL}, 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
\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-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{str + shift + 7} -- the same as to cancel the comment later on.\\
Now include the file \texttt{fluidsystems/h2oairsystem.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();}.\\
As an alternative, use a simpler version of water, e.g. \texttt{Dumux::SimpleH2O}, and apply it for the property \texttt{Components} with type \texttt{H2O}. The density of the gas is magnitudes smaller than that of oil, so please decrease the injection 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.\\
Now include the file \texttt{fluidsystems/h2oairsystem.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 injection 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} \\
......@@ -300,9 +302,6 @@ If you look at the Application in \texttt{/test/boxmodels/2p/}, you see that the
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}
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.
\subsubsection{Exercise 5}
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
systems in the directory \verb+/dumux/material/fluidsystems+.)
......@@ -311,6 +310,10 @@ 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}$.
\subsubsection{Exercise 5}
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"
......
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorial_decoupled.input
===================================================================
--- tutorial/tutorial_decoupled.input (revision 8322)
+++ tutorial/tutorial_decoupled.input (working copy)
@@ -1,4 +1,4 @@
-tEnd = 100000 # duration of the simulation [s]
+tEnd = 500000 # duration of the simulation [s]
dtInitial = 10 # initial time step size [s]
[Grid]
upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorialproblem_decoupled.hh
===================================================================
--- tutorial/tutorialproblem_decoupled.hh (revision 8322)
+++ tutorial/tutorialproblem_decoupled.hh (working copy)
@@ -144,7 +144,7 @@
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
{
//write only every 10th time step to output file
- this->setOutputInterval(1);/*@\label{tutorial-decoupled:outputinterval}@*/
+ this->setOutputInterval(20);/*@\label{tutorial-decoupled:outputinterval}@*/
}
//! The problem name.
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorial_decoupled.input
===================================================================
--- tutorial/tutorial_decoupled.input (revision 8322)
+++ tutorial/tutorial_decoupled.input (working copy)
@@ -1,7 +1,7 @@
-tEnd = 100000 # duration of the simulation [s]
+tEnd = 500000 # duration of the simulation [s]
dtInitial = 10 # initial time step size [s]
[Grid]
upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
-upperRightY = 60 # y-coordinate of the upper-right corner of the grid [m]
-numberOfCellsX = 100 # x-resolution of the grid
-numberOfCellsY = 1 # y-resolution of the grid
\ No newline at end of file
+upperRightY = 300 # y-coordinate of the upper-right corner of the grid [m]
+numberOfCellsX = 15 # x-resolution of the grid
+numberOfCellsY = 30 # y-resolution of the grid
\ No newline at end of file
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorialproblem_decoupled.hh
===================================================================
--- tutorial/tutorialproblem_decoupled.hh (revision 8322)
+++ tutorial/tutorialproblem_decoupled.hh (working copy)
@@ -144,7 +144,7 @@
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
{
//write only every 10th time step to output file
- this->setOutputInterval(1);/*@\label{tutorial-decoupled:outputinterval}@*/
+ this->setOutputInterval(20);/*@\label{tutorial-decoupled:outputinterval}@*/
}
//! The problem name.
@@ -223,7 +223,7 @@
*/
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:bctype}@*/
{
- if (globalPos[0] < this->bboxMin()[0] + eps_)
+ if (globalPos[1] < this->bboxMin()[1] + eps_)
{
bcTypes.setDirichlet(pressEqIdx);
bcTypes.setDirichlet(satEqIdx);
@@ -265,7 +265,7 @@
void neumannAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:neumann}@*/
{
values = 0;
- if (globalPos[0] > this->bboxMax()[0] - eps_)
+ if (globalPos[1] > this->bboxMax()[1] - eps_)
{
values[nPhaseIdx] = 3e-2;
}
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorialproblem_decoupled.hh
===================================================================
--- tutorial/tutorialproblem_decoupled.hh (revision 8322)
+++ tutorial/tutorialproblem_decoupled.hh (working copy)
@@ -47,7 +47,8 @@
// the components that are used
#include <dumux/material/components/h2o.hh>
-#include <dumux/material/components/oil.hh>
+#include <dumux/material/components/brine.hh>
+#include <dumux/material/components/simplednapl.hh>
namespace Dumux
{
@@ -81,7 +82,7 @@
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
- typedef Dumux::LiquidPhase<Scalar, Dumux::H2O<Scalar> > type; /*@\label{tutorial-decoupled:wettingPhase}@*/
+ typedef Dumux::LiquidPhase<Scalar, Dumux::Brine<Scalar, H2O<Scalar> > > type; /*@\label{tutorial-decoupled:wettingPhase}@*/
};
// Set the non-wetting phase
@@ -90,7 +91,7 @@
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
- typedef Dumux::LiquidPhase<Scalar, Dumux::Oil<Scalar> > type; /*@\label{tutorial-decoupled:nonwettingPhase}@*/
+ typedef Dumux::LiquidPhase<Scalar, Dumux::SimpleDNAPL<Scalar> > type; /*@\label{tutorial-decoupled:nonwettingPhase}@*/
}; /*@\label{tutorial-decoupled:2p-system-end}@*/
SET_TYPE_PROP(TutorialProblemDecoupled, EvalCflFluxFunction, Dumux::EvalCflFluxCoats<TypeTag>); /*@\label{tutorial-decoupled:cflflux}@*/
@@ -144,7 +145,7 @@
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
{
//write only every 10th time step to output file
- this->setOutputInterval(1);/*@\label{tutorial-decoupled:outputinterval}@*/
+ this->setOutputInterval(20);/*@\label{tutorial-decoupled:outputinterval}@*/
}
//! The problem name.
@@ -223,7 +224,7 @@
*/
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:bctype}@*/
{
- if (globalPos[0] < this->bboxMin()[0] + eps_)
+ if (globalPos[1] < this->bboxMin()[1] + eps_)
{
bcTypes.setDirichlet(pressEqIdx);
bcTypes.setDirichlet(satEqIdx);
@@ -265,7 +266,7 @@
void neumannAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:neumann}@*/
{
values = 0;
- if (globalPos[0] > this->bboxMax()[0] - eps_)
+ if (globalPos[1] > this->bboxMax()[1] - eps_)
{
values[nPhaseIdx] = 3e-2;
}
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorial_decoupled.input
===================================================================
--- tutorial/tutorial_decoupled.input (revision 9128)
+++ tutorial/tutorial_decoupled.input (working copy)
@@ -9,14 +9,14 @@
###############################################################
[TimeManager]
-TEnd = 100000 # duration of the simulation [s]
+TEnd = 20000 # duration of the simulation [s]
DtInitial = 10 # initial time step size [s]
[Grid]
UpperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
-UpperRightY = 60 # y-coordinate of the upper-right corner of the grid [m]
-NumberOfCellsX = 100 # x-resolution of the grid
-NumberOfCellsY = 1 # y-resolution of the grid
+UpperRightY = 300 # y-coordinate of the upper-right corner of the grid [m]
+NumberOfCellsX = 15 # x-resolution of the grid
+NumberOfCellsY = 30 # y-resolution of the grid
###############################################################
# Simulation restart
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorialproblem_decoupled.hh
===================================================================
--- tutorial/tutorialproblem_decoupled.hh (revision 9128)
+++ tutorial/tutorialproblem_decoupled.hh (working copy)
@@ -43,6 +43,7 @@
// the components that are used
#include <dumux/material/components/h2o.hh>
#include <dumux/material/components/lnapl.hh>
+#include <dumux/material/fluidsystems/h2oairfluidsystem.hh>
namespace Dumux
{
@@ -69,25 +70,25 @@
//Set the grid creator
SET_TYPE_PROP(TutorialProblemDecoupled, GridCreator, Dumux::CubeGridCreator<TypeTag>); /*@\label{tutorial-decoupled:set-gridcreator}@*/
+SET_TYPE_PROP(TutorialProblemDecoupled, FluidSystem, Dumux::H2OAirFluidSystem<TypeTag>);
+//// Set the wetting phase
+//SET_PROP(TutorialProblemDecoupled, WettingPhase) /*@\label{tutorial-decoupled:2p-system-start}@*/
+//{
+//private:
+// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
+//public:
+// typedef Dumux::LiquidPhase<Scalar, Dumux::H2O<Scalar> > type; /*@\label{tutorial-decoupled:wettingPhase}@*/
+//};
+//
+//// Set the non-wetting phase
+//SET_PROP(TutorialProblemDecoupled, NonwettingPhase)
+//{
+//private:
+// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
+//public:
+// typedef Dumux::LiquidPhase<Scalar, Dumux::LNAPL<Scalar> > type; /*@\label{tutorial-decoupled:nonwettingPhase}@*/
+//}; /*@\label{tutorial-decoupled:2p-system-end}@*/
-// Set the wetting phase
-SET_PROP(TutorialProblemDecoupled, WettingPhase) /*@\label{tutorial-decoupled:2p-system-start}@*/
-{
-private:
- typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
-public:
- typedef Dumux::LiquidPhase<Scalar, Dumux::H2O<Scalar> > type; /*@\label{tutorial-decoupled:wettingPhase}@*/
-};
-
-// Set the non-wetting phase
-SET_PROP(TutorialProblemDecoupled, NonwettingPhase)
-{
-private:
- typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
-public:
- typedef Dumux::LiquidPhase<Scalar, Dumux::LNAPL<Scalar> > type; /*@\label{tutorial-decoupled:nonwettingPhase}@*/
-}; /*@\label{tutorial-decoupled:2p-system-end}@*/
-
SET_TYPE_PROP(TutorialProblemDecoupled, EvalCflFluxFunction, Dumux::EvalCflFluxCoats<TypeTag>); /*@\label{tutorial-decoupled:cflflux}@*/
SET_SCALAR_PROP(TutorialProblemDecoupled, CFLFactor, 0.95); /*@\label{tutorial-decoupled:cflfactor}@*/
@@ -139,7 +140,8 @@
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
{
//write only every 10th time step to output file
- this->setOutputInterval(10);/*@\label{tutorial-decoupled:outputinterval}@*/
+ this->setOutputInterval(20);/*@\label{tutorial-decoupled:outputinterval}@*/
+ GET_PROP_TYPE(TypeTag, FluidSystem)::init();
}
//! The problem name.
@@ -218,7 +220,7 @@
*/
void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:bctype}@*/
{
- if (globalPos[0] < this->bboxMin()[0] + eps_)
+ if (globalPos[1] < this->bboxMin()[1] + eps_)
{
bcTypes.setDirichlet(pressEqIdx);
bcTypes.setDirichlet(satEqIdx);
@@ -260,9 +262,9 @@
void neumannAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:neumann}@*/
{
values = 0;
- if (globalPos[0] > this->bboxMax()[0] - eps_)
+ if (globalPos[1] > this->bboxMax()[1] - eps_)
{
- values[nPhaseIdx] = 3e-2;
+ values[nPhaseIdx] = 3e-4;
}
}
//! Initial condition at position globalPos.
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorial_decoupled.input
===================================================================
--- tutorial/tutorial_decoupled.input (revision 9128)
+++ tutorial/tutorial_decoupled.input (working copy)
@@ -9,14 +9,14 @@
###############################################################
[TimeManager]
-TEnd = 100000 # duration of the simulation [s]
+TEnd = 200000 # duration of the simulation [s]
DtInitial = 10 # initial time step size [s]
[Grid]
-UpperRightX = 300 # x-coordinate of the upper-right corner of the grid [m]
-UpperRightY = 60 # y-coordinate of the upper-right corner of the grid [m]
-NumberOfCellsX = 100 # x-resolution of the grid
-NumberOfCellsY = 1 # y-resolution of the grid
+UpperRightX = 600 # x-coordinate of the upper-right corner of the grid [m]
+UpperRightY = 300 # y-coordinate of the upper-right corner of the grid [m]
+NumberOfCellsX = 30 # x-resolution of the grid
+NumberOfCellsY = 15 # y-resolution of the grid
###############################################################
# Simulation restart
### Eclipse Workspace Patch 1.0
#P dumux-stable
Index: tutorial/tutorialspatialparams_decoupled.hh
===================================================================
--- tutorial/tutorialspatialparams_decoupled.hh (revision 9128)
+++ tutorial/tutorialspatialparams_decoupled.hh (working copy)
@@ -89,9 +89,12 @@
* Alternatively, the function intrinsicPermeabilityAtPos(const GlobalPosition& globalPos) could be
* defined, where globalPos is the vector including the global coordinates of the finite volume.
*/
- const FieldMatrix& intrinsicPermeability (const Element& element) const
+ const FieldMatrix& intrinsicPermeabilityAtPos(const GlobalPosition& globalPos) const
{
- return K_;
+ if(globalPos[0]<300)
+ return K1;
+ else
+ return K2;
}
//! Define the porosity \f$[-]\f$ of the porous medium depending
@@ -102,9 +105,12 @@
* Alternatively, the function porosityAtPos(const GlobalPosition& globalPos) could be
* defined, where globalPos is the vector including the global coordinates of the finite volume.
*/
- double porosity(const Element& element) const
+ double porosityAtPos(const GlobalPosition& globalPos) const
{
- return 0.2;
+ if(globalPos[0]<300)
+ return 0.15;
+ else
+ return 0.3;
}
/*! Return the parameter object for the material law (i.e. Brooks-Corey)
@@ -123,10 +129,12 @@
//! Constructor
TutorialSpatialParamsDecoupled(const GridView& gridView)
- : ParentType(gridView), K_(0)
+ : ParentType(gridView), K1(0), K2(0)
{
for (int i = 0; i < dim; i++)
- K_[i][i] = 1e-7;
+ K1[i][i] = 1e-8;
+ for (int i = 0; i < dim; i++)
+ K2[i][i] = 1e-9;
// residual saturations
materialLawParams_.setSwr(0);
@@ -142,8 +150,9 @@
private:
MaterialLawParams materialLawParams_;
- FieldMatrix K_;
-};
+ FieldMatrix K1;
+ FieldMatrix K2;
+ };
} // end namespace
#endif
### Eclipse Workspace Patch 1.0
#P workingDumux
Index: tutorial/tutorial_decoupled.input
===================================================================
--- tutorial/tutorial_decoupled.input (revision 9216)
+++ tutorial/tutorial_decoupled.input (working copy)
@@ -7,7 +7,14 @@
###############################################################
# Mandatory arguments
###############################################################
+[Problem]
+OutflowRateOil = 3e-2 # Rate of oil outflow for the Neumann boundary
+OutputInterval = 5
+[SpatialParams]
+Perm = 1e-8 # Peremeability
+Porosity = 0.15
+
[TimeManager]
TEnd = 100000 # duration of the simulation [s]
DtInitial = 10 # initial time step size [s]
@@ -18,6 +25,15 @@
NumberOfCellsX = 100 # x-resolution of the grid
NumberOfCellsY = 1 # y-resolution of the grid
+##########
+# Tweaks
+##########
+[Impet]
+CFLFactor = 0.8
+
+[Vtk]
+OutputLevel = 3
+
###############################################################
# Simulation restart
#
Index: tutorial/tutorialproblem_decoupled.hh
===================================================================
--- tutorial/tutorialproblem_decoupled.hh (revision 9210)
+++ tutorial/tutorialproblem_decoupled.hh (working copy)
@@ -138,6 +138,21 @@
TutorialProblemDecoupled(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/
{
+ int outputInterval;
+ try
+ {
+
+ outflowRateOil_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.OutflowRateOil);
+ outputInterval = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.OutputInterval);
+ }
+ catch (Dumux::ParameterException &e) {
+ std::cerr << e << ". Abort!\n";
+ exit(1) ;
+ }
+ catch (...) {
+ std::cerr << "Unknown exception thrown!\n";
+ exit(1);
+ }
+
//write only every 10th time step to output file
- this->setOutputInterval(10);/*@\label{tutorial-decoupled:outputinterval}@*/
+ this->setOutputInterval(outputInterval);/*@\label{tutorial-decoupled:outputinterval}@*/
}
@@ -262,7 +277,7 @@
values = 0;
if (globalPos[0] > this->bboxMax()[0] - eps_)
{
- values[nPhaseIdx] = 3e-2;
+ values[nPhaseIdx] = outflowRateOil_;
}
}
//! Initial condition at position globalPos.
@@ -282,6 +297,7 @@
private:
const Scalar eps_;
+ Scalar outflowRateOil_;
};
} //end namespace
Index: tutorial/tutorialspatialparams_decoupled.hh
===================================================================
--- tutorial/tutorialspatialparams_decoupled.hh (revision 9210)
+++ tutorial/tutorialspatialparams_decoupled.hh (working copy)
@@ -104,7 +104,7 @@
*/
double porosity(const Element& element) const
{
- return 0.2;
+ return porosity_;
}
/*! Return the parameter object for the material law (i.e. Brooks-Corey)
@@ -125,9 +125,22 @@
TutorialSpatialParamsDecoupled(const GridView& gridView)
: ParentType(gridView), K_(0)
{
- for (int i = 0; i < dim; i++)
- K_[i][i] = 1e-7;
+ try
+ {
+ for (int i = 0; i < dim; i++)
+ K_[i][i] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.Perm);
+ porosity_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.Porosity);
+ }
+ catch (Dumux::ParameterException &e) {
+ std::cerr << e << ". Abort!\n";
+ exit(1) ;
+ }
+ catch (...) {
+ std::cerr << "Unknown exception thrown!\n";
+ exit(1);
+ }
+
// residual saturations
materialLawParams_.setSwr(0);
materialLawParams_.setSnr(0);