From 0ed3747bf240f21073e4e525396c53ba159f45ac Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 14 Mar 2019 14:42:56 +0100
Subject: [PATCH] [PL/HT] Use MPL porosity property instead of
 PorousMedium/Porosity.

---
 ProcessLib/HT/MonolithicHTFEM.h     |  7 +++----
 ProcessLib/HT/StaggeredHTFEM-impl.h | 16 +++++++---------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/ProcessLib/HT/MonolithicHTFEM.h b/ProcessLib/HT/MonolithicHTFEM.h
index 03ec0af2727..613797b4dfe 100644
--- a/ProcessLib/HT/MonolithicHTFEM.h
+++ b/ProcessLib/HT/MonolithicHTFEM.h
@@ -133,11 +133,10 @@ public:
             // Order matters: First T, then P!
             NumLib::shapeFunctionInterpolate(local_x, N, T_int_pt, p_int_pt);
 
-            // \todo the first argument has to be changed for non constant
-            // porosity model
             auto const porosity =
-                process_data.porous_media_properties.getPorosity(t, pos)
-                    .getValue(t, pos, 0.0, T_int_pt);
+                solid_phase
+                    .property(MaterialPropertyLib::PropertyType::porosity)
+                    .template value<double>(vars);
 
             auto const intrinsic_permeability =
                 intrinsicPermeability<GlobalDim>(
diff --git a/ProcessLib/HT/StaggeredHTFEM-impl.h b/ProcessLib/HT/StaggeredHTFEM-impl.h
index eac894d1b2f..2d81e71ddc9 100644
--- a/ProcessLib/HT/StaggeredHTFEM-impl.h
+++ b/ProcessLib/HT/StaggeredHTFEM-impl.h
@@ -75,6 +75,7 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::
     auto const& medium = *this->_material_properties.media_map->getMedium(
         this->_element.getID());
     auto const& liquid_phase = medium.phase("AqueousLiquid");
+    auto const& solid_phase = medium.phase("Solid");
 
     auto const& b = material_properties.specific_body_force;
 
@@ -103,10 +104,8 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::
             p_int_pt;
 
         auto const porosity =
-            material_properties.porous_media_properties.getPorosity(t, pos)
-                .getValue(t, pos, 0.0, T1_int_pt);
-
-        // Use the fluid density model to compute the density
+            solid_phase.property(MaterialPropertyLib::PropertyType::porosity)
+                .template value<double>(vars);
         auto const fluid_density =
             liquid_phase.property(MaterialPropertyLib::PropertyType::density)
                 .template value<double>(vars);
@@ -210,7 +209,6 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::
     auto const& liquid_phase = medium.phase("AqueousLiquid");
     auto const& solid_phase = medium.phase("Solid");
 
-
     auto const& b = material_properties.specific_body_force;
 
     GlobalDimMatrixType const& I(
@@ -235,15 +233,15 @@ void StaggeredHTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::
         double T1_at_xi = 0.;
         NumLib::shapeFunctionInterpolate(local_T1, N, T1_at_xi);
 
-        auto const porosity =
-            material_properties.porous_media_properties.getPorosity(t, pos)
-                .getValue(t, pos, 0.0, T1_at_xi);
-
         vars[static_cast<int>(MaterialPropertyLib::Variable::temperature)] =
             T1_at_xi;
         vars[static_cast<int>(MaterialPropertyLib::Variable::phase_pressure)] =
             p_at_xi;
 
+        auto const porosity =
+            solid_phase.property(MaterialPropertyLib::PropertyType::porosity)
+                .template value<double>(vars);
+
         // Use the fluid density model to compute the density
         auto const fluid_density =
             liquid_phase.property(MaterialPropertyLib::PropertyType::density)
-- 
GitLab