From f333ac924c3c6ac332144134df8dcfc8616f51f7 Mon Sep 17 00:00:00 2001
From: Anna Mareike Kostelecky <anmako96@web.de>
Date: Wed, 27 Mar 2024 13:50:16 +0000
Subject: [PATCH] [md][boundary][ffpnm] rename params cellsPerThroat and
 fixedCellsBetweenThroats to ...Pore(s)

---
 doc/doxygen/extradoc/parameterlist.txt        |  4 ++--
 doc/doxygen/extradoc/parameters.json          |  6 +++---
 .../freeflowporenetwork/snappygridmanager.hh  | 20 ++++++++++---------
 .../freeflowporenetwork/1p_1p/params.input    |  2 +-
 .../1p_1p/params_single_throat.input          |  2 +-
 5 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/doc/doxygen/extradoc/parameterlist.txt b/doc/doxygen/extradoc/parameterlist.txt
index 8bd9307682..9677c19b56 100644
--- a/doc/doxygen/extradoc/parameterlist.txt
+++ b/doc/doxygen/extradoc/parameterlist.txt
@@ -118,7 +118,7 @@
  * | Grid                 | CellType                                      | std::string              | "Cube"          | "Cube" or "Simplex" to be used for structured grids                                                                                                    |
  * | Grid                 | Cells                                         | std::array<unsigned int, dim> | {1, 1, 1}       | The number of elements in a structured uniform grid in x, y and z direction                                                                            |
  * | Grid                 | Cells0/1/2                                    | std::vector<int>         | -               | For a grid with zones, number of cells of the leftmost zone, number of cells of the second-leftmost zone, ..., number of cells of the rightmost zone, spaceseparated. (assuming x-axis points to the right) |
- * | Grid                 | CellsPerThroat                                | int                      | -               | the number of cells above the porous medium                                                                                                            |
+ * | Grid                 | CellsPerPore                                  | int                      | -               | the number of cells above the porous medium                                                                                                            |
  * | Grid                 | ClosureType                                   | std::string              | "Green"         | Decide whether to add a green closure to locally refined grid sections or not: "Green" (Standard red/green refinement) or "None" (No closure, results in nonconforming meshes) |
  * | Grid                 | Coordinates                                   | std::vector<typename Grid::ctype> | -               | To construct a 1D grid with just a coordinates vector                                                                                                  |
  * | Grid                 | CouplingPlaneLowerLeft                        | GlobalPosition           | Grid.LowerLeft  | the lower left point of the coupling plane                                                                                                             |
@@ -131,7 +131,7 @@
  * | Grid                 | DownstreamGrading0/1/2                        | std::vector<Scalar>      | -               | Grading factor for the user-defined additional points  in each normal direction in the downstream area of a snappy grid.                               |
  * | Grid                 | DownstreamPositions0/1/2                      | std::vector<Scalar>      | -               | User-defined additional points in the normal directions in the downstream area of a snappy grid.                                                       |
  * | Grid                 | File                                          | std::string              | -               | A DGF or gmsh file to load from                                                                                                                        |
- * | Grid                 | FixedCellsBetweenThroats                      | int                      | -1              | the number of cells between two throats                                                                                                                |
+ * | Grid                 | FixedCellsBetweenPores                        | int                      | -1              | the number of cells between two pores                                                                                                                |
  * | Grid                 | FixedPoreRadiusForLabel                       | std::vector<Scalar>      | std::vector<Scalar>{} | Vector of pore radii to be set to the corresponding pores not belonging to a subregion indicated by PoreLabelsToSetFixedRadius.                        |
  * | Grid                 | GmshPhysicalEntityThreshold                   | std::size_t              | 0               | Boundary element index threshold                                                                                                                       |
  * | Grid                 | Grading0/1/2                                  | std::vector<Scalar>      | -               | For a grid with zones, grading factors for the x-zones. 1.0 means all cells within this zone have equal extension in x-direction. Negative factors are possible. |
diff --git a/doc/doxygen/extradoc/parameters.json b/doc/doxygen/extradoc/parameters.json
index ff0d28635d..6359867ef0 100644
--- a/doc/doxygen/extradoc/parameters.json
+++ b/doc/doxygen/extradoc/parameters.json
@@ -952,7 +952,7 @@
             "std::vector<int>"
         ]
     },
-    "Grid.CellsPerThroat": {
+    "Grid.CellsPerPore": {
         "explanation": [
             "the number of cells above the porous medium"
         ]
@@ -1048,9 +1048,9 @@
             "A DGF or gmsh file to load from"
         ]
     },
-    "Grid.FixedCellsBetweenThroats": {
+    "Grid.FixedCellsBetweenPores": {
         "explanation": [
-            "the number of cells between two throats"
+            "the number of cells between two pores"
         ]
     },
     "Grid.FixedPoreRadiusForLabel": {
diff --git a/dumux/multidomain/boundary/freeflowporenetwork/snappygridmanager.hh b/dumux/multidomain/boundary/freeflowporenetwork/snappygridmanager.hh
index 076d21ae74..e634438f85 100644
--- a/dumux/multidomain/boundary/freeflowporenetwork/snappygridmanager.hh
+++ b/dumux/multidomain/boundary/freeflowporenetwork/snappygridmanager.hh
@@ -553,7 +553,7 @@ private:
             const auto right = point.pos + point.radius;
 
             if (left < positions[directionIndex].back())
-                DUNE_THROW(Dune::RangeError, "Throat radii are too large, they intersect!");
+                DUNE_THROW(Dune::RangeError, "Pore body radii are too large, they intersect!");
 
             if (left > gridLowerLeft[directionIndex])
                 positions[directionIndex].push_back(left);
@@ -573,21 +573,23 @@ private:
                            const PointsOnLine& points)
     {
         // set the number of cells above the porous medium
-        const int cellsPerThroat = getParamFromGroup<int>(modelParamGroup_, "Grid.CellsPerThroat");
-        const int fixedCellsBetweenThroats = getParamFromGroup<int>(modelParamGroup_, "Grid.FixedCellsBetweenThroats", -1);
+        const int cellsPerPore = getParamFromGroup<int>(modelParamGroup_, "Grid.CellsPerPore");
+        const int fixedCellsBetweenPores = getParamFromGroup<int>(modelParamGroup_, "Grid.FixedCellsBetweenPores", -1);
 
-        // set the cells between the throats
+        // set the number of cells between the pore bodies
         for (int i = 0; i < points.size(); ++i)
         {
-            cells[directionIndex].push_back(cellsPerThroat);
+            cells[directionIndex].push_back(cellsPerPore);
             if (i < points.size() -1)
             {
-                if (fixedCellsBetweenThroats > 0)
-                    cells[directionIndex].push_back(fixedCellsBetweenThroats);
+                if (fixedCellsBetweenPores > 0)
+                    cells[directionIndex].push_back(fixedCellsBetweenPores);
                 else
                 {
-                    const auto spacingLeft = points[i].radius*2.0 / cellsPerThroat;
-                    const auto spacingRight = points[i+1].radius*2.0 / cellsPerThroat;
+                    // set number of cells such that the spacing of the cells between the left and right pore body
+                    // is the average of the spacings for the cells coupled to those two pore bodies
+                    const auto spacingLeft = points[i].radius*2.0 / cellsPerPore;
+                    const auto spacingRight = points[i+1].radius*2.0 / cellsPerPore;
                     const auto avgSpacing = (spacingLeft + spacingRight) / 2;
                     const auto lengthBetween = (points[i+1].pos - (points[i+1].radius))
                                              - (points[i].pos + (points[i].radius));
diff --git a/test/multidomain/boundary/freeflowporenetwork/1p_1p/params.input b/test/multidomain/boundary/freeflowporenetwork/1p_1p/params.input
index dc76edca82..17944ed3af 100644
--- a/test/multidomain/boundary/freeflowporenetwork/1p_1p/params.input
+++ b/test/multidomain/boundary/freeflowporenetwork/1p_1p/params.input
@@ -15,7 +15,7 @@ ThroatCrossSectionShape = Square
 LowerLeft = -0.0024 1e-2
 UpperRight = 0.0124 1.2e-2
 UpstreamCells0 = 5
-CellsPerThroat = 3
+CellsPerPore = 3
 DownstreamCells0 = 5
 Cells1 = 6
 
diff --git a/test/multidomain/boundary/freeflowporenetwork/1p_1p/params_single_throat.input b/test/multidomain/boundary/freeflowporenetwork/1p_1p/params_single_throat.input
index d9caa8b350..4cc4f8c610 100644
--- a/test/multidomain/boundary/freeflowporenetwork/1p_1p/params_single_throat.input
+++ b/test/multidomain/boundary/freeflowporenetwork/1p_1p/params_single_throat.input
@@ -10,7 +10,7 @@ ThroatCrossSectionShape = TwoPlates
 LowerLeft = 0 0
 UpperRight = 1e-3 1e-3
 UpstreamCells0 = 5
-CellsPerThroat = 5
+CellsPerPore = 5
 DownstreamCells0 = 5
 Cells1 = 10
 
-- 
GitLab