From 4ebcc64da9964412f314a1b05af466a59673f426 Mon Sep 17 00:00:00 2001
From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de>
Date: Thu, 25 Jul 2024 17:42:39 +0200
Subject: [PATCH 1/2] [ff][flux] Allow empty intersections in flux over surface

---
 .../navierstokes/fluxoveraxisalignedsurface.hh     | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh b/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
index 047e40102a..535fb4d0ea 100644
--- a/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
+++ b/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
@@ -70,10 +70,12 @@ public:
      */
     FluxOverAxisAlignedSurface(const GridVariables& gridVariables,
                                const SolutionVector& sol,
-                               const LocalResidual& localResidual)
+                               const LocalResidual& localResidual,
+                               bool nonIntersectingSurfaceIsError = false)
     : gridVariables_(gridVariables)
     , sol_(sol)
     , localResidual_(localResidual)
+    , nonIntersectingSurfaceIsError_(nonIntersectingSurfaceIsError)
     {
         verbose_ = getParamFromGroup<bool>(problem_().paramGroup(), "FluxOverAxisAlignedSurface.Verbose", false);
     }
@@ -218,6 +220,12 @@ public:
             std::cout << "Flux over surface " << name << ": " << data.flux << std::endl;
     }
 
+    /*!
+     * \brief Set if non-intersecting surfaces are treated as error.
+     */
+    void setNonIntersectingSurfaceIsError(bool isError)
+    { nonIntersectingSurfaceIsError_ = isError; }
+
 private:
 
     template<class FluxType>
@@ -280,6 +288,9 @@ private:
 
             if (intersectingElements.empty())
             {
+                if(!nonIntersectingSurfaceIsError_)
+                    continue;
+
                 std::cout << "surface boundaries: " << std::endl;
                 printSurfaceBoundaries_(surfaceData.surface);
 
@@ -380,6 +391,7 @@ private:
     const SolutionVector& sol_;
     const LocalResidual localResidual_; // store a copy of the local residual
     bool verbose_;
+    bool nonIntersectingSurfaceIsError_;
 };
 
 } // end namespace Dumux
-- 
GitLab


From e86c3cef6aae07dba976d365b206d300bd752944 Mon Sep 17 00:00:00 2001
From: Timo Koch <timokoch@math.uio.no>
Date: Thu, 25 Jul 2024 17:12:45 +0000
Subject: [PATCH 2/2] fixup

---
 dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh b/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
index 535fb4d0ea..314caeeb1e 100644
--- a/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
+++ b/dumux/freeflow/navierstokes/fluxoveraxisalignedsurface.hh
@@ -223,7 +223,7 @@ public:
     /*!
      * \brief Set if non-intersecting surfaces are treated as error.
      */
-    void setNonIntersectingSurfaceIsError(bool isError)
+    void setNonIntersectingSurfaceIsError(bool isError = true)
     { nonIntersectingSurfaceIsError_ = isError; }
 
 private:
@@ -288,7 +288,7 @@ private:
 
             if (intersectingElements.empty())
             {
-                if(!nonIntersectingSurfaceIsError_)
+                if (!nonIntersectingSurfaceIsError_)
                     continue;
 
                 std::cout << "surface boundaries: " << std::endl;
-- 
GitLab