Commit 2fc6395c authored by Johannes Hommel's avatar Johannes Hommel
Browse files

Merge branch 'fix/towardsAMoreConsistentDumuxCourseFor3.1' into 'master'

Towards a more consistent DUMUX course for version 3.1

Closes #21

See merge request !77
parents 93aba79e 68b630da
Pipeline #1411 passed with stage
in 33 seconds
# the immiscible two-phase simulation program
dune_add_test(NAME exercise_basic_2p
SOURCES exercise_basic_2p.cc)
SOURCES 2pmain.cc)
# the compositional two-phase two-component simulation program
dune_add_test(NAME exercise_basic_2p2c
SOURCES exercise_basic_2p2c.cc)
SOURCES 2p2cmain.cc)
# here, add the two-phase non-isothermal simulation program
......
......@@ -18,8 +18,8 @@ This exercise deals with two problems: a two-phase immiscible problem (__2p__) a
<hr>
Locate all the files you will need for this exercise
* The __main file__ for the __2p__ problem : `exercise_basic_2p.cc`
* The __main file__ for the __2p2c__ problem : `exercise_basic_2p2c.cc`
* The __main file__ for the __2p__ problem : `2pmain.cc`
* The __main file__ for the __2p2c__ problem : `2p2cmain.cc`
* The __problem file__ for the __2p__ problem: `injection2pproblem.hh`
* The __problem file__ for the __2p2c__ problem: `injection2p2cproblem.hh`
* The shared __spatial parameters file__: `injection2pspatialparams.hh`
......@@ -58,15 +58,15 @@ paraview injection-2p2c.pvd
### Task 3: Setting up a new executable (for a non-isothermal simulation)
<hr>
* Copy the main file `exercise_basic_2p.cc` and rename it to `exercise_basic_2pni.cc`
* In `exercise_basic_2pni.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`.
* In `exercise_basic_2pni.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;`
* Copy the main file `2pmain.cc` and rename it to `2pnimain.cc`
* In `2pnimain.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`.
* In `2pnimain.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;`
* Add a new executable in `CMakeLists.txt` by adding the lines
```cmake
# the two-phase non-isothermal simulation program
dune_add_test(NAME exercise_basic_2pni
SOURCES exercise_basic_2pni.cc)
SOURCES 2pnimain.cc)
```
* Test that everything compiles without error
......
......@@ -31,7 +31,7 @@
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include "injection2pspatialparams.hh"
#include "spatialparams.hh"
namespace Dumux {
......@@ -69,7 +69,7 @@ public:
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Injection2p2c> { using type = FluidSystems::H2ON2<GetPropType<TypeTag, Properties::Scalar>, FluidSystems::H2ON2DefaultPolicy</*fastButSimplifiedRelations=*/ true>>; };
// Define whether mole(true) or mass (false) fractions are used
// Define whether mole (true) or mass (false) fractions are used
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = true; };
} // end namespace Properties
......@@ -83,15 +83,15 @@ struct UseMoles<TypeTag, TTag::Injection2p2c> { static constexpr bool value = tr
*
* The domain is sized 60 m times 40 m.
*
* For the mass conservation equation neumann boundary conditions are used on
* the top, on the bottom and on the right of the domain, while dirichlet conditions
* For the mass conservation equation Neumann boundary conditions are used on
* the top, on the bottom and on the right of the domain, while Dirichlet conditions
* apply on the left boundary.
*
* Gas is injected at the right boundary from 7 m to 15 m at a rate of
* 0.001 kg/(s m), the remaining neumann boundaries are no-flow
* 0.001 kg/(s m), the remaining Neumann boundaries are no-flow
* boundaries.
*
* At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a
* At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a
*
* This problem uses the \ref TwoPModel model.
*/
......@@ -192,7 +192,7 @@ public:
}
/*!
* \brief Evaluate the boundary conditions for a neumann
* \brief Evaluate the boundary conditions for a Neumann
* boundary segment.
*
* \param globalPos The position of the integration point of the boundary segment.
......
......@@ -32,13 +32,13 @@
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include "injection2pspatialparams.hh"
#include "spatialparams.hh"
namespace Dumux {
// forward declare problem
template <class TypeTag>
class InjectionProblem2PNI;
class Injection2PNIProblem;
namespace Properties
{
......@@ -58,7 +58,7 @@ struct Grid<TypeTag, TTag::Injection2pNITypeTag> { using type = Dune::YaspGrid<2
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = InjectionProblem2PNI<TypeTag>; };
struct Problem<TypeTag, TTag::Injection2pNITypeTag> { using type = Injection2PNIProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
......@@ -89,20 +89,20 @@ struct FluidSystem<TypeTag, TTag::Injection2pNITypeTag>
*
* The domain is sized 60 m times 40 m.
*
* For the mass conservation equation neumann boundary conditions are used on
* the top, on the bottom and on the right of the domain, while dirichlet conditions
* For the mass conservation equation Neumann boundary conditions are used on
* the top, on the bottom and on the right of the domain, while Dirichlet conditions
* apply on the left boundary.
*
* Gas is injected at the right boundary from 7 m to 15 m at a rate of
* 0.001 kg/(s m), the remaining neumann boundaries are no-flow
* 0.001 kg/(s m), the remaining Neumann boundaries are no-flow
* boundaries.
*
* At the dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a
* At the Dirichlet boundaries a hydrostatic pressure and a gas saturation of zero a
*
* This problem uses the \ref TwoPModel model.
*/
template<class TypeTag>
class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
......@@ -120,7 +120,7 @@ class InjectionProblem2PNI : public PorousMediumFlowProblem<TypeTag>
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
public:
InjectionProblem2PNI(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
Injection2PNIProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
// initialize the tables of the fluid system
......@@ -190,7 +190,7 @@ public:
}
/*!
* \brief Evaluate the boundary conditions for a neumann
* \brief Evaluate the boundary conditions for a Neumann
* boundary segment.
*
* \param globalPos The position of the integration point of the boundary segment.
......
......@@ -32,13 +32,13 @@
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include "injection2pspatialparams.hh"
#include "spatialparams.hh"
namespace Dumux {
// forward declare problem
template <class TypeTag>
class InjectionProblem2P;
class Injection2PProblem;
namespace Properties {
// define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization.
......@@ -54,7 +54,7 @@ struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::Injection2p> { using type = InjectionProblem2P<TypeTag>; };
struct Problem<TypeTag, TTag::Injection2p> { using type = Injection2PProblem<TypeTag>; };
// Set the spatial parameters
template<class TypeTag>
......@@ -94,7 +94,7 @@ struct FluidSystem<TypeTag, TTag::Injection2p> { using type = FluidSystems::H2ON
* This problem uses the \ref TwoPModel model.
*/
template<class TypeTag>
class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
class Injection2PProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
......@@ -112,7 +112,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
public:
InjectionProblem2P(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
Injection2PProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
// initialize the tables of the fluid system
......
# executables for exercisebiomin
dune_add_test(NAME exercisebiomin
SOURCES exercisebiomin.cc
dune_add_test(NAME exercise_biomin
SOURCES main.cc
CMD_ARGS -TimeLoop.TEnd 1e5)
# add tutorial to the common target
add_dependencies(test_exercises exercisebiomin)
add_dependencies(test_exercises exercise_biomin)
# add a symlink for each input file
add_input_file_links()
......@@ -19,8 +19,8 @@ Disclaimer: Please note, that this is not a realistic scenario. One does not wan
### 1. Getting familiar with the code
Locate all the files you will need for this exercise
* The __main file__ : `exercisebiomin.cc`
* The __input file__: `exercisebiomin.input`
* The __main file__ : `main.cc`
* The __input file__: `params.input`
* The __problem file__ : `biominproblem.hh`
* The __spatial parameters file__: `biominspatialparams.hh`
......@@ -37,7 +37,7 @@ There are two types of solid components. Reactive and inert. For each reactive c
### 2. Implement a chemical equation
In the following the basic steps required to set the new chemical equation are outlined. Here, this is done in the __chemistry__ folder in the prepared file: `simplebiominreactions.hh` starting in line 96.
In the following the basic steps required to set the new chemical equation are outlined. Here, this is done in the __chemistry__ folder in the prepared file: `simplebiominreactions.hh` within the function reactionSource().
Please be aware, that the chemistry file already provides some convenience functions (e.g. ``moleFracToMolality()``).
__Task__
......@@ -64,15 +64,17 @@ which is:
Calcium ion + Urea + 2 Water &rarr; 2 Ammonium ions + Calcite
Note that since the chemistry is simplified for this dumux-course example, the component Ammonium is neglected and you thus cannot set its source term, even though it is produced in the real reaction.
### 3. Make use of your newly created chemical equation
To enable your newly created chemical equation, the chemistry file has to be included in your problem file. This has to be done in line 35:
To enable your newly created chemical equation, the chemistry file has to be included in your problem file.
```c++
#include "chemistry/simplebiominreactions.hh" // chemical reactions
```
Additionally the TypeTag of your chemistry file needs to be set in the problem file (line 125):
Additionally the TypeTag of your chemistry file needs to be set in the problem file, within the class ExerciseFourBioMinProblem:
```c++
using Chemistry = typename Dumux::SimpleBiominReactions<NumEqVector, VolumeVariables>;
......@@ -80,7 +82,7 @@ using Chemistry = typename Dumux::SimpleBiominReactions<NumEqVector, VolumeVaria
__Task__
Now the source/sink term can be updated in the problem file. You find it in line 343. You can access the newly created chemistry file and call the reactionSource()-function from it. Make sure to call the reactionSource()-function with the correct arguments. Return the updated source terms in the end.
Now the source/sink term can be updated in the problem file in its function source(). You can access the newly created chemistry file and call the reactionSource()-function from it. Make sure to call the chemistry.reactionSource()-function with the correct arguments. Return the updated source terms in the end.
The volume variables can be set using the element volume variables and the sub control volume:
```c++
......@@ -97,7 +99,7 @@ and type
```bash
make exercisebiomin
./exercisebiomin exercisebiomin.input
./exercise_biomin exercise_biomin.input
```
### 4. Seal leakage pathway in the aquitard
......
......@@ -48,7 +48,7 @@ namespace Dumux {
#include <dumux/material/components/co2tables.inc>
template <class TypeTag>
class ExerciseFourBioMinProblem;
class BioMinProblem;
namespace Properties {
//! Create new type tag for the problem
......@@ -60,7 +60,7 @@ struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBi
//! Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = ExerciseFourBioMinProblem<TypeTag>; };
struct Problem<TypeTag, TTag::ExerciseFourBioMin> { using type = BioMinProblem<TypeTag>; };
//! Set grid and the grid creator to be used
template<class TypeTag>
......@@ -106,7 +106,7 @@ struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMin> { static
* \brief Problem biomineralization (MICP) in an experimental setup.
*/
template <class TypeTag>
class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
class BioMinProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
......@@ -166,7 +166,7 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
* \param fvGridGeometry The finite volume grid geometry
*/
public:
ExerciseFourBioMinProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
BioMinProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
name_ = getParam<std::string>("Problem.Name");
......@@ -281,7 +281,7 @@ public:
// Set values for Ca + urea injection above aquitard.
// Use negative values for injection.
if(globalPos[0] < eps_
&& globalPos[1] > 11.0 + eps_
&& globalPos[1] > 11.0 - eps_
&& globalPos[1] < 12.0 + eps_
&& time_ < injBioTime_)
{
......
......@@ -15,10 +15,10 @@ Free flow is modeled in the upper subdomain, while the lower subdomain models a
There are three sub folders: `interface` (Exercise 1), `models` (Exercise 2) and `turbulence` (Exercise 3).
The problem-related files for this exercise are:
* Three __main files__ for the three sub-tasks :`ex_interface_coupling_ff-pm.cc`, `ex_models_coupling_ff-pm.cc`, `ex_turbulence_coupling_ff-pm.cc`,
* Three __free flow problem files__: `ex_interface_ffproblem.hh`, `ex_models_ffproblem.hh`, `ex_turbulence__ffproblem.hh`
* Three __porous medium flow problem files__: `ex_interface_pmproblem.hh`, `ex_models_pmproblem.hh`, `ex_turbulence_pmproblem.hh`
* The __input files__: `ex_interface_coupling_ff-pm.input`, `ex_models_coupling_ff-pm.input`, `ex_turbulence_coupling_ff-pm.input`,
* Three __main files__ for the three sub-tasks :`interface/main.cc`, `models/main.cc`, `turbulence/main.cc`,
* Three __free flow problem files__: `interface/freeflowsubproblem.hh`, `models/freeflowsubproblem.hh`, `turbulence/freeflowsubproblem.hh`
* Three __porous medium flow problem files__: `interface/porousmediumsubproblem.hh`, `models/porousmediumsubproblem.hh`, `turbulence/porousmediumsubproblem.hh`
* The __input files__: `interface/params.input`, `models/parmas.input`, `turbulence/params.input`,
* The __spatial parameters files__: `1pspatialparams.hh`, `2pspatialparams.hh`
......@@ -27,8 +27,8 @@ The same applies for types such as `GridManager`, `FVGridGeometry`, `Problem`, e
Since we use a monolithic coupling scheme, there is only one `Assembler` and one `NewtonSolver`.
The problem files very much look like "regular", uncoupled ones with the exception that they hold a pointer to the `CouplingManager` which allows to evaluate the coupling conditions and to exchange information between the coupled models.
The coupling conditions are realized technically in terms of boundary condition. For instance, in lines 178 and 179
in `ex_interface_ffproblem.hh`, `couplingNeumann` boundary conditions are set, which means that the free flow models evaluates the
The coupling conditions are realized technically in terms of boundary condition. For instance,
in `interface/freeflowsubproblem.hh`, `couplingNeumann` boundary conditions are set, which means that the free flow models evaluates the
mass and momentum fluxes coming from the porous domain and uses these values as boundary conditions at the interface.
Note the certain checks are performed when combining different models, e.g., the fluid system has to be the same for both domains
......@@ -57,7 +57,7 @@ Currently, a velocity profile is set on the upper free flow boundary, which lead
__Task A: Change the flow direction__
Open the file `ex_interface_ffproblem.hh` and navigate to line 148, where the types of boundary condition are set.
Open the file `interface/freeflowsubproblem.hh` and navigate to the part, where the types of boundary condition are set.
Instead of applying a fixed velocity profile at the top of the domain, we want to use fixed pressure boundary conditions
at the left and right side of the free flow domain, while the top represents an impermeable wall.
......@@ -113,6 +113,7 @@ if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
```
This should make the flow go from left to right.
You can also delete the initial vertical velocity from initialAtPos(), to be consistent with the new boundary conditions.
__Task B: Include slip-condition__
......@@ -133,10 +134,10 @@ with a Beavers-Joseph-Saffman (BJS) boundary condition for the respective moment
values.setBJS(Indices::momentumXBalanceIdx);
```
at the position where the coupling boundary conditions are set in `ex_interface_ffproblem.hh`.
at the position where the coupling boundary conditions are set in `interface/freeflowsubproblem.hh`.
To check if the simulation behaves as expected, we can compare the velocity profile $`v_x(y)`$ with the analytical solution provided by [Beavers and Joseph (1967)](https://doi.org/10.1017/S0022112067001375).
For doing so, we uncomment line 212 in `ex_interface_coupling_ff-pm.cc`.
For doing so, we uncomment line 212 in `exerciseinterfacecouplingffpm.cc`.
```cpp
stokesVtkWriter.addField(stokesProblem->getAnalyticalVelocityX(), "analyticalV_x");
```
......@@ -147,7 +148,7 @@ the analytical solution of $`v_x`$ on the free flow domain. Play around with the
__Task C: Cange shape of interface__
Now we want to include a non-flat interface between the two domains. We use `dune-subgrid` to construct
two grids for the two domains from one common host grid. Comment out lines 96-106 in `ex_interface_coupling_ff-pm.cc` and comment lines 114-149 in the same file. This will instantiate a host grid and define two helper lambda functions that are used to choose elements from to host grid for the respective sub grid. In the given case,
two grids for the two domains from one common host grid. Comment out lines 96-106 in `exerciseinterfacecouplingffpm.cc` and comment lines 114-149 in the same file. This will instantiate a host grid and define two helper lambda functions that are used to choose elements from to host grid for the respective sub grid. In the given case,
the domain is split in two haves, separated by a sinusoidal interface.
```cpp
......@@ -166,7 +167,7 @@ auto elementSelectorDarcy = [&](const auto& element)
Make sure, that you have uncommented the lines including the grid managers in both problem files
```cpp
#include <dumux/io/grid/subgridmanager.hh>
#include <dumux/io/grid/gridmanager_sub.hh>
```
and do the changes in the respective lines for the `Grid` property.
......@@ -215,7 +216,7 @@ __Task A: Change the model__:
In the first task, the porous-medium model will be changed from a 1p2c system to a 2p2c system.
Although a 2p2c system is plugged in, we still want to simulate the same situation as before, i.e., air with water vapor in both domains.
The following changes have to be made in the porous-medium model (`ex_models_pmproblem.hh`):
The following changes have to be made in the porous-medium model (`models/porousmediumsubproblem.hh`):
* Include the 2pnc model: include the respective headers and inherit from the new model `TwoPNC`
* Exchange the spatial parameters for the 1-phase system by those for a 2-phase system (hint: two occurrences).
* Since two phases are involved now, we do not need to use the OnePAdapter anymore. Change to property of the FluidSystem such that `H2OAir` is used directly.
......@@ -241,7 +242,7 @@ However, if only the gas phase is present, the liquid saturation is always zero.
In this case, the chosen formulation will set the given value as the mole fraction of water vapor in the gas phase.
* To tell to program which phases are present in which parts of the domain at the beginning of the simulation,
you have to call `values.setState(MY_PHASE_PRESENCE);` in `initialAtPos()`. Have a look at the `indices.hh`
in the `2p2c` model to figure out which is the correct value of `MY_PHASE_PRESENCE` for the presence of
in the `2pnc` model (as the 2p2c model is a special case of the 2pnc model) to figure out which is the correct value of `MY_PHASE_PRESENCE` for the presence of
a gas-phase only (hint: the numbering of phase indices begins with 0, the numbering of the phase presence states begins
with 1. Take a look at your formulation to find out which phase index to use for the gas phase.)
......@@ -313,7 +314,7 @@ All the prepared files can be found in the subfolder `exercise-coupling-ff-pm/tu
__Task A__:
The file `ex_turbulence_ffproblem.hh` is your free flow problem file within this exercise.
The file `freeflowsubproblem.hh` is your free flow problem file within this exercise.
For using the compositional zero equation turbulence model, the following header files need to be included:
```
......@@ -346,7 +347,7 @@ To get all these interactions, you have to call
```cpp
stokesProblem->updateStaticWallProperties();
```
in `ex_turbulence_coupling_ff-pm.cc`.
in `main.cc`.
However, there is also a solution-dependent component of these interactions, e.g. for a correct
damping of the eddy viscosity toward the wall, the velocity gradient at the wall and inside the
cells is needed.
......
# executables for ex_interface_coupling_ff-pm
dune_add_test(NAME ex_interface_coupling_ff-pm
SOURCES ex_interface_coupling_ff-pm.cc)
dune_add_test(NAME exercise_interface_coupling_ff-pm
SOURCES main.cc)
# add tutorial to the common target
add_dependencies(test_exercises ex_interface_coupling_ff-pm)
add_dependencies(test_exercises exercise_interface_coupling_ff-pm)
# add a symlink for each input file
add_input_file_links()
......@@ -25,6 +25,7 @@
#include <dune/grid/yaspgrid.hh>
// TODO: dumux-course-task
//****** uncomment for the last exercise *****//
// #include <dumux/io/grid/subgridmanager.hh>
......@@ -38,7 +39,7 @@
namespace Dumux
{
template <class TypeTag>
class StokesSubProblem;
class FreeFlowSubProblem;
namespace Properties
{
......@@ -63,6 +64,7 @@ struct Grid<TypeTag, TTag::StokesOneP>
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using TensorGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<Scalar, dim> >;
// TODO: dumux-course-task
//****** comment out for the last exercise *****//
using type = TensorGrid;
......@@ -73,7 +75,7 @@ struct Grid<TypeTag, TTag::StokesOneP>
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::StokesOneP> { using type = Dumux::StokesSubProblem<TypeTag> ; };
struct Problem<TypeTag, TTag::StokesOneP> { using type = Dumux::FreeFlowSubProblem<TypeTag> ; };
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::StokesOneP> { static constexpr bool value = true; };
......@@ -87,7 +89,7 @@ struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOneP> { static conste
* \brief The free flow sub problem
*/
template <class TypeTag>
class StokesSubProblem : public NavierStokesProblem<TypeTag>
class FreeFlowSubProblem : public NavierStokesProblem<TypeTag>
{
using ParentType = NavierStokesProblem<TypeTag>;
......@@ -112,7 +114,7 @@ class StokesSubProblem : public NavierStokesProblem<TypeTag>
using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
public:
StokesSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager)
FreeFlowSubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<CouplingManager> couplingManager)
: ParentType(fvGridGeometry, "Stokes"), eps_(1e-6), couplingManager_(couplingManager)
{
deltaP_ = getParamFromGroup<Scalar>(this->paramGroup(), "Problem.PressureDifference");
......@@ -159,6 +161,8 @@ public:
const auto& globalPos = scvf.dofPosition();
// TODO: dumux-course-task
// change the boundary conditions here as described in the exercise
if(onUpperBoundary_(globalPos))
{
values.setDirichlet(Indices::velocityXIdx);
......
......@@ -46,8 +46,8 @@
#include <dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh>
#include "ex_interface_pmproblem.hh"
#include "ex_interface_ffproblem.hh"
#include "porousmediumsubproblem.hh"
#include "freeflowsubproblem.hh"
namespace Dumux {
namespace Properties {
......@@ -89,7 +89,7 @@ int main(int argc, char** argv) try
// ******************** comment-out this section for the last exercise **************** //
// TODO: dumux-course-task: comment-out this section for the last exercise **************** //
// create two individual grids (from the given grid file or the input file)
// for both sub-domains
......@@ -110,43 +110,48 @@ int main(int argc, char** argv) try
// ******************** uncomment this section for the last exercise ****************** //
// // use dune-subgrid to create the individual grids
// static constexpr int dim = 2;
// using HostGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, dim> >;
// using HostGridManager = Dumux::GridManager<HostGrid>;
// HostGridManager hostGridManager;
// hostGridManager.init();
// auto& hostGrid = hostGridManager.grid();
//
// struct Params
// {
// double amplitude = getParam<double>("Grid.Amplitude");
// double baseline = getParam<double>("Grid.Baseline");
// double offset = getParam<double>("Grid.Offset");
// double scaling = getParam<double>("Grid.Scaling");
// };
//
// Params params;
//
// auto elementSelectorStokes = [&](const auto& element)
// {
// double interface = params.amplitude * std::sin(( element.geometry().center()[0] -params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
// return element.geometry().center()[1] > interface;
// };
//
// auto elementSelectorDarcy = [&](const auto& element)
// {
// double interface = params.amplitude * std::sin(( element.geometry().center()[0] - params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
// return element.geometry().center()[1] < interface;
// };
//
// // subgrid Pointer
// auto stokesGridPtr = SubgridManager<HostGrid>::makeGrid(hostGrid, elementSelectorStokes, "Stokes");
// auto darcyGridPtr = SubgridManager<HostGrid>::makeGrid(hostGrid, elementSelectorDarcy, "Darcy");
//
// // we compute on the leaf grid view
// const auto& darcyGridView = darcyGridPtr->leafGridView();
// const auto& stokesGridView = stokesGridPtr->leafGridView();
// // use dune-subgrid to create the individual grids
// static constexpr int dim = 2;
// using HostGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, dim> >;
// using HostGridManager = Dumux::GridManager<HostGrid>;
// HostGridManager hostGridManager;
// hostGridManager.init();
// auto& hostGrid = hostGridManager.grid();
//
// struct Params
// {
// double amplitude = getParam<double>("Grid.Amplitude");
// double baseline = getParam<double>("Grid.Baseline");
// double offset = getParam<double>("Grid.Offset");
// double scaling = getParam<double>("Grid.Scaling");
// };
//
// Params params;
//
// auto elementSelectorStokes = [&](const auto& element)
// {
// double interface = params.amplitude * std::sin(( element.geometry().center()[0] -params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
// return element.geometry().center()[1] > interface;
// };
//
// auto elementSelectorDarcy = [&](const auto& element)
// {
// double interface = params.amplitude * std::sin(( element.geometry().center()[0] - params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
// return element.geometry().center()[1] < interface;
// };
//
// using SubGrid = Dune::SubGrid<dim, HostGrid>;
//
// Dumux::GridManager<SubGrid> subGridManagerStokes;
// Dumux::GridManager<SubGrid> subGridManagerDarcy;
//
// // initialize subgrids
// subGridManagerStokes.init(hostGrid, elementSelectorStokes, "Stokes");
// subGridManagerDarcy.init(hostGrid, elementSelectorDarcy, "Darcy");
//
// // we compute on the leaf grid view
// const auto& darcyGridView = subGridManagerDarcy.grid().leafGridView();
// const auto& stokesGridView = subGridManagerStokes.grid().leafGridView();
// ************************************************************************************ //
</