From dd74aaed18ddfabe9bc6e4e958c27761e78671fa Mon Sep 17 00:00:00 2001
From: yue <tkdxwb@gmail.com>
Date: Mon, 19 Oct 2020 20:06:13 +0200
Subject: [PATCH] [test][2p2c][mpnccomparison] new material law

---
 .../2p2c/implicit/mpnccomparison/params.input | 10 +++++
 .../implicit/mpnccomparison/spatialparams.hh  | 40 ++++++-------------
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/params.input b/test/porousmediumflow/2p2c/implicit/mpnccomparison/params.input
index 740e5317e7..7dbea708ca 100644
--- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/params.input
+++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/params.input
@@ -11,3 +11,13 @@ ResidualReduction = 1e-12
 
 [Problem]
 Name = obstacle_2p
+
+[SpatialParams]
+FineMaterial.Swr = 0.2
+FineMaterial.Snr = 0.0
+FineMaterial.BrooksCoreyPcEntry = 1e4
+FineMaterial.BrooksCoreyLambda = 2.0
+CoarseMaterial.Swr = 0.2
+CoarseMaterial.Snr = 0.0
+CoarseMaterial.BrooksCoreyPcEntry = 1e4
+CoarseMaterial.BrooksCoreyLambda = 2.0
diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh
index d984c54cb9..4720777dba 100644
--- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh
+++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/spatialparams.hh
@@ -27,10 +27,7 @@
 
 #include <dumux/porousmediumflow/properties.hh>
 #include <dumux/material/spatialparams/fv.hh>
-#include <dumux/material/fluidmatrixinteractions/2p/regularizedlinearmaterial.hh>
-#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
-
-#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
+#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
 
 namespace Dumux {
 
@@ -55,17 +52,16 @@ class TwoPTwoCComparisonSpatialParams
 
     enum {dimWorld=GridView::dimensionworld};
 
-    using EffectiveLaw = RegularizedBrooksCorey<Scalar>;
+    using PcKrSwCurve =FluidMatrix::BrooksCoreyDefault<Scalar>;
 
 public:
     //! Export permeability type
     using PermeabilityType = Scalar;
-    //! Export the type used for the material law
-    using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
-    using MaterialLawParams = typename MaterialLaw::Params;
-
 
-    TwoPTwoCComparisonSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) : ParentType(gridGeometry)
+    TwoPTwoCComparisonSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
+    : ParentType(gridGeometry)
+    , finePcKrSwCurve_("SpatialParams.FineMaterial")
+    , coarsePcKrSwCurve_("SpatialParams.CoarseMaterial")
     {
         // intrinsic permeabilities
         coarseK_ = 1e-12;
@@ -73,18 +69,6 @@ public:
 
         // the porosity
         porosity_ = 0.3;
-
-         // residual saturations
-        fineMaterialParams_.setSwr(0.2);
-        fineMaterialParams_.setSnr(0.0);
-        coarseMaterialParams_.setSwr(0.2);
-        coarseMaterialParams_.setSnr(0.0);
-
-        // parameters for the Brooks-Corey law
-        fineMaterialParams_.setPe(1e4);
-        coarseMaterialParams_.setPe(1e4);
-        fineMaterialParams_.setLambda(2.0);
-        coarseMaterialParams_.setLambda(2.0);
     }
 
     template<class ElementSolution>
@@ -115,12 +99,11 @@ public:
      * \param globalPos The global position of the sub-control volume.
      * \return The material parameters object
      */
-    const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
+    auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
     {
         if (isFineMaterial_(globalPos))
-            return fineMaterialParams_;
-        else
-            return coarseMaterialParams_;
+            return makeFluidMatrixInteraction(finePcKrSwCurve_);
+        return makeFluidMatrixInteraction(coarsePcKrSwCurve_);
     }
 
     /*!
@@ -149,8 +132,9 @@ private:
     Scalar coarseK_;
     Scalar fineK_;
     Scalar porosity_;
-    MaterialLawParams fineMaterialParams_;
-    MaterialLawParams coarseMaterialParams_;
+
+    const PcKrSwCurve finePcKrSwCurve_;
+    const PcKrSwCurve coarsePcKrSwCurve_;
     static constexpr Scalar eps_ = 1e-6;
 };
 
-- 
GitLab