From 60a5a76e09a0324f21cd72be63cf081dd9c87f79 Mon Sep 17 00:00:00 2001
From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de>
Date: Sun, 16 Feb 2025 12:03:17 +0100
Subject: [PATCH] [ifsolver] Check if reconstruction is necessary

---
 .../porousmediumflow/2p/saturationreconstruction.hh  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dumux/porousmediumflow/2p/saturationreconstruction.hh b/dumux/porousmediumflow/2p/saturationreconstruction.hh
index 1e6579a32a..b2cbea6b7f 100644
--- a/dumux/porousmediumflow/2p/saturationreconstruction.hh
+++ b/dumux/porousmediumflow/2p/saturationreconstruction.hh
@@ -80,12 +80,18 @@ public:
         if (!materialInterfaces.isOnMaterialInterface(scv))
             return sn;
 
-        // compute capillary pressure using material parameters associated with the dof
+        // pc-sw curve associated with the dof
         const auto& interfacePcSw = materialInterfaces.pcSwAtDof(scv);
-        const auto pc = interfacePcSw.pc(/*ww=*/1.0 - sn);
+        // pc-sw curve related to scv
+        const auto& pcSw = spatialParams.fluidMatrixInteraction(element, scv, elemSol).pcSwCurve();
+
+        if (interfacePcSw == pcSw)
+            return sn;
+
+        // compute capillary pressure using material parameters associated with the dof
+        const auto pc = interfacePcSw.pc(/*sw=*/1.0 - sn);
 
         // reconstruct by inverting the pc-sw curve
-        const auto& pcSw = spatialParams.fluidMatrixInteraction(element, scv, elemSol).pcSwCurve();
         const auto pcMin = pcSw.endPointPc();
 
         if (pc < pcMin && pcMin > 0.0)
-- 
GitLab