mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
decoupled: finish the SpatialParameters -> SpatialParams frenzy
I also removed the deprecation stuff, as IMO it is more confusing than helpful. (Ever tried to set the SpatialParameters instead of SpatialParams in your problem?) Also move the decoupled spatial parameters from dumux/material to dumux/decoupled because they are specific to the decoupled models.
This commit is contained in:
parent
ed2bf12c5f
commit
13d9867500
@ -162,10 +162,10 @@ on the functions, consult the documentation in the code.
|
||||
\subsection{The definition of the parameters that are dependent on space}\label{tutorial-decoupled:description-spatialParameters}
|
||||
|
||||
Listing \ref{tutorial-decoupled:spatialparametersfile} shows the file
|
||||
\verb+tutorialspatialparameters_decoupled.hh+:
|
||||
\verb+tutorialspatialparams_decoupled.hh+:
|
||||
|
||||
\begin{lst}[File tutorial/tutorialspatialparameters\_decoupled.hh]\label{tutorial-decoupled:spatialparametersfile} \mbox{}
|
||||
\lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=26]{../../tutorial/tutorialspatialparameters_decoupled.hh}
|
||||
\begin{lst}[File tutorial/tutorialspatialparams\_decoupled.hh]\label{tutorial-decoupled:spatialparametersfile} \mbox{}
|
||||
\lstinputlisting[style=DumuxCode, numbersep=5pt, firstline=26]{../../tutorial/tutorialspatialparams_decoupled.hh}
|
||||
\end{lst}
|
||||
As this file only slightly differs from the coupled version, consult
|
||||
chapter \ref{tutorial-coupled:description-spatialParameters} for explanations.
|
||||
@ -228,7 +228,7 @@ When does the front cross the material border? In paraview, the option \textit{V
|
||||
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
|
||||
just like \texttt{tutorialspatialparameters\_decoupled.hh}. These files need to
|
||||
just like \texttt{tutorialspatialparams\_decoupled.hh}. These files need to
|
||||
be included in the file \texttt{tutorial\_decoupled.cc}.
|
||||
|
||||
Each new files should contain the definition of a new class with a
|
||||
@ -240,7 +240,7 @@ macros in lines \ref{tutorial-decoupled:guardian1} and \ref{tutorial-decoupled:g
|
||||
\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{SpatialParameters} property for the new
|
||||
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
|
||||
@ -297,7 +297,7 @@ compile the program.
|
||||
\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.\\
|
||||
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{SpatialParameters} - 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.
|
||||
|
||||
\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.
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define DUMUX_TUTORIALPROBLEM_DECOUPLED_HH // guardian macro /*@\label{tutorial-decoupled:guardian2}@*/
|
||||
|
||||
// assign parameters dependent on space (e.g. spatial parameters)
|
||||
#include "tutorialspatialparameters_decoupled.hh" /*@\label{tutorial-decoupled:spatialparameters}@*/
|
||||
#include "tutorialspatialparams_decoupled.hh" /*@\label{tutorial-decoupled:spatialparameters}@*/
|
||||
|
||||
// dumux 2p-decoupled environment
|
||||
#include <dumux/decoupled/2p/diffusion/fv/fvpressureproperties2p.hh>
|
||||
@ -63,7 +63,7 @@ class TutorialProblemDecoupled;
|
||||
namespace Properties
|
||||
{
|
||||
// create a new type tag for the problem
|
||||
NEW_TYPE_TAG(TutorialProblemDecoupled, INHERITS_FROM(FVPressureTwoP, FVTransportTwoP, IMPESTwoP, TutorialSpatialParametersDecoupled)); /*@\label{tutorial-decoupled:create-type-tag}@*/
|
||||
NEW_TYPE_TAG(TutorialProblemDecoupled, INHERITS_FROM(FVPressureTwoP, FVTransportTwoP, IMPESTwoP, TutorialSpatialParamsDecoupled)); /*@\label{tutorial-decoupled:create-type-tag}@*/
|
||||
|
||||
// Set the problem property
|
||||
SET_PROP(TutorialProblemDecoupled, Problem) /*@\label{tutorial-decoupled:set-problem}@*/
|
||||
|
@ -27,7 +27,7 @@
|
||||
#ifndef DUMUX_TUTORIAL_SPATIAL_PARAMETERS_DECOUPLED_HH
|
||||
#define DUMUX_TUTORIAL_SPATIAL_PARAMETERS_DECOUPLED_HH
|
||||
|
||||
#include <dumux/material/spatialparameters/fvspatialparameters.hh>
|
||||
#include <dumux/decoupled/spatialparams/fvspatialparams.hh>
|
||||
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
|
||||
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
|
||||
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
|
||||
@ -40,19 +40,19 @@ namespace Dumux
|
||||
|
||||
//forward declaration
|
||||
template<class TypeTag>
|
||||
class TutorialSpatialParametersDecoupled;
|
||||
class TutorialSpatialParamsDecoupled;
|
||||
|
||||
namespace Properties
|
||||
{
|
||||
// The spatial parameters TypeTag
|
||||
NEW_TYPE_TAG(TutorialSpatialParametersDecoupled);
|
||||
NEW_TYPE_TAG(TutorialSpatialParamsDecoupled);
|
||||
|
||||
// Set the spatial parameters
|
||||
SET_TYPE_PROP(TutorialSpatialParametersDecoupled, SpatialParams,
|
||||
Dumux::TutorialSpatialParametersDecoupled<TypeTag>); /*@\label{tutorial-decoupled:set-spatialparameters}@*/
|
||||
SET_TYPE_PROP(TutorialSpatialParamsDecoupled, SpatialParams,
|
||||
Dumux::TutorialSpatialParamsDecoupled<TypeTag>); /*@\label{tutorial-decoupled:set-spatialparameters}@*/
|
||||
|
||||
// Set the material law
|
||||
SET_PROP(TutorialSpatialParametersDecoupled, MaterialLaw)
|
||||
SET_PROP(TutorialSpatialParamsDecoupled, MaterialLaw)
|
||||
{
|
||||
private:
|
||||
// material law typedefs
|
||||
@ -66,9 +66,9 @@ public:
|
||||
//! Definition of the spatial parameters for the decoupled tutorial
|
||||
|
||||
template<class TypeTag>
|
||||
class TutorialSpatialParametersDecoupled: public FVSpatialParameters<TypeTag>
|
||||
class TutorialSpatialParamsDecoupled: public FVSpatialParams<TypeTag>
|
||||
{
|
||||
typedef FVSpatialParameters<TypeTag> ParentType;
|
||||
typedef FVSpatialParams<TypeTag> ParentType;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
@ -127,7 +127,7 @@ public:
|
||||
}
|
||||
|
||||
//! Constructor
|
||||
TutorialSpatialParametersDecoupled(const GridView& gridView)
|
||||
TutorialSpatialParamsDecoupled(const GridView& gridView)
|
||||
: ParentType(gridView), K_(0)
|
||||
{
|
||||
for (int i = 0; i < dim; i++)
|
Loading…
Reference in New Issue
Block a user