From 5f93961d60898ff6c9f6084ef88fd2cfaa714427 Mon Sep 17 00:00:00 2001
From: Ned Coltman <edward.coltman@iws.uni-stuttgart.de>
Date: Thu, 30 Mar 2023 15:00:38 +0200
Subject: [PATCH] [exercises][ff-pm][interface] Add a further discussion to how
 subgrid works

---
 exercises/exercise-coupling-ff-pm/README.md | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/exercises/exercise-coupling-ff-pm/README.md b/exercises/exercise-coupling-ff-pm/README.md
index 739569c6..249f198a 100644
--- a/exercises/exercise-coupling-ff-pm/README.md
+++ b/exercises/exercise-coupling-ff-pm/README.md
@@ -148,23 +148,32 @@ the analytical solution of $`v_x`$ on the free flow domain. Play around with the
 
 __Task C: Change the 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. To do so, open `main.cc` in the subfolder `interface` again and search for `TODO: dumux-course-task 1.C`. Comment out the first code block and uncomment the second. 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.
+Now we want to include a non-flat interface between the two domains.
+We use [`dune-subgrid`](https://doi.org/10.1007/s00607-009-0067-2) to construct two grids for the two domains from one common host grid.
+Our hostgrid will be a Dune-Yasp grid (`Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, dim> >`)
+and the bounds and resolution of the domain will be set in the `params.input`file under the group `[Grid]`.
+This hostgrid, along with `elementSelector` functions defining some spatial cut of this domain, are passed to the grid manager to create each subdomain grid.
+
+To introduce this, open `main.cc` in the subfolder `interface` again and search for `TODO: dumux-course-task 1.C`.
+Comment out the first code block and uncomment the second.
+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 halves, separated by a sinusoidal interface.
 
 ```cpp
 auto elementSelectorFreeflow = [&](const auto& element)
 {
-    double interface = params.amplitude * std::sin(( element.geometry().center()[0] -params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
+    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 elementSelectorPorousMedium = [&](const auto& element)
 {
-    double interface  =  params.amplitude * std::sin(( element.geometry().center()[0] - params.offset) / params.scaling * 2.0 * M_PI) + params.baseline;
+    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;
 };
 ```
 
-Make sure, that you have uncommented the lines including the grid managers in both properties files
+Make sure that you have uncommented the lines including the grid managers in both properties files
 ```cpp
 #include <dumux/io/grid/gridmanager_sub.hh>
 ```
@@ -197,7 +206,7 @@ The final result should look something like this:
 
 *Extra Points:*
 Rather than enforcing a pressure difference across the domain, an inflow velocity profile could be set.
-What changes to the boundary conditions in the free-flow domain would you make to introduce this? What conditions can be enforced on the right boundary?
+What changes to the left boundary conditions in the free-flow domain would you make to introduce this? What conditions can be enforced on the right boundary?
 Hint: A relation between velocity and position is used for the vertical velocity component in the original form of the `initialAtPos` method.
 
 ### 2. Changing the porous medium model
-- 
GitLab