From 629cfc0b3b56439963760f001a0c02d3f7b79ea8 Mon Sep 17 00:00:00 2001
From: Katharina Heck <katharina.heck@iws.uni-stuttgart.de>
Date: Tue, 6 Nov 2018 14:49:50 +0100
Subject: [PATCH] [test][nonequilibrium] use law for 1p interfacial areas in 1p
 tests, call interfacial areas from volumevariables in 1p as it is done for 2p
 problems as well

---
 .../nonequilibrium/thermal/localresidual.hh   |  2 +-
 .../nonequilibrium/volumevariables.hh         | 29 +++++++++++++++++--
 .../implicit/nonequilibrium/spatialparams.hh  |  2 ++
 .../combustionlocalresidual.hh                |  2 +-
 .../thermalnonequilibrium/spatialparams.hh    |  2 ++
 5 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
index 4047df849d..2539b3e985 100644
--- a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
+++ b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh
@@ -170,7 +170,7 @@ public:
 
         //interfacial area
         // Shi & Wang, Transport in porous media (2011)
-        const Scalar as = 6.0 * (1.0-volVars.porosity()) / characteristicLength ;
+        const Scalar as = volVars.fluidSolidInterfacialArea();
 
         //temperature fluid is the same for both fluids
         const Scalar TFluid     = volVars.temperatureFluid(0);
diff --git a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
index ad2b52cc57..f07f08c0b0 100644
--- a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
+++ b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh
@@ -296,6 +296,7 @@ public:
         paramCache.updateAll(this->fluidState());
         //only update of DimLessNumbers is necessary here, as interfacial area is easy due to only one fluid with a solid and is directly computed in localresidual
         updateDimLessNumbers(elemSol, this->fluidState(), paramCache, problem, element, scv);
+        updateInterfacialArea(elemSol, this->fluidState(), paramCache, problem, element, scv);
     }
 
     /*!
@@ -339,10 +340,32 @@ public:
                                                                         prandtlNumber_[phaseIdx],
                                                                         porosity,
                                                                         ModelTraits::nusseltFormulation());
-
         }
     }
 
+
+    /*!
+     * \brief Updates the volume specific interfacial area [m^2 / m^3] between the solid and the fluid phase.
+     *
+     * \param elemSol A vector containing all primary variables connected to the element
+     * \param fluidState Container for all the secondary variables concerning the fluids
+     * \param paramCache The parameter cache corresponding to the fluid state
+     * \param problem The problem to be solved
+     * \param element An element which contains part of the control volume
+     * \param scv The sub-control volume
+     */
+    template<class ElemSol, class Problem, class Element, class Scv>
+    void updateInterfacialArea(const ElemSol& elemSol,
+                               const FluidState& fluidState,
+                               const ParameterCache& paramCache,
+                               const Problem& problem,
+                               const Element& element,
+                               const Scv& scv)
+    {
+       using FluidSolidInterfacialAreaFormulation = typename Problem::SpatialParams::FluidSolidInterfacialAreaFormulation;
+       interfacialArea_ =  FluidSolidInterfacialAreaFormulation::fluidSolidInterfacialArea(this->porosity(), characteristicLength());
+    }
+
     //! access function Reynolds Number
     const Scalar reynoldsNumber(const unsigned int phaseIdx) const { return reynoldsNumber_[phaseIdx]; }
     //! access function Prandtl Number
@@ -354,6 +377,8 @@ public:
     //! access function pre factor energy transfer
     const Scalar factorEnergyTransfer() const { return factorEnergyTransfer_; }
 
+    const Scalar fluidSolidInterfacialArea() const {return interfacialArea_;}
+
 private:
     //! dimensionless numbers
     Scalar reynoldsNumber_[ModelTraits::numPhases()];
@@ -362,7 +387,7 @@ private:
 
     Scalar characteristicLength_;
     Scalar factorEnergyTransfer_;
-    Scalar solidSurface_ ;
+    Scalar interfacialArea_ ;
 };
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/test/porousmediumflow/1pnc/implicit/nonequilibrium/spatialparams.hh b/test/porousmediumflow/1pnc/implicit/nonequilibrium/spatialparams.hh
index 721ab24d7f..abb43103aa 100644
--- a/test/porousmediumflow/1pnc/implicit/nonequilibrium/spatialparams.hh
+++ b/test/porousmediumflow/1pnc/implicit/nonequilibrium/spatialparams.hh
@@ -28,6 +28,7 @@
 #include <dumux/porousmediumflow/properties.hh>
 #include <dumux/material/spatialparams/fv1p.hh>
 #include <dumux/material/spatialparams/fvnonequilibrium.hh>
+#include <dumux/material/fluidmatrixinteractions/1pia/fluidsolidinterfacialareashiwang.hh>
 
 namespace Dumux {
 
@@ -54,6 +55,7 @@ class OnePNCNonequilibriumTestSpatialParams
 public:
     // export permeability type
     using PermeabilityType = Scalar;
+    using FluidSolidInterfacialAreaFormulation = FluidSolidInterfacialAreaShiWang<Scalar>;
 
     OnePNCNonequilibriumTestSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
     : ParentType(fvGridGeometry)
diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh
index 4e2d8ff702..418c5dd470 100644
--- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh
+++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh
@@ -84,7 +84,7 @@ public:
 
         //interfacial area
         // Shi & Wang, Transport in porous media (2011)
-        const Scalar as = 6.0 * (1.0-volVars.porosity()) / characteristicLength ;
+        const Scalar as = volVars.fluidSolidInterfacialArea();
 
         //temperature fluid is the same for both fluids
         const Scalar TFluid     = volVars.temperatureFluid(0);
diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh
index dc9276202f..a0427f6411 100644
--- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh
+++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/spatialparams.hh
@@ -31,6 +31,7 @@
 #include <dumux/material/fluidmatrixinteractions/2p/heatpipelaw.hh>
 #include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
 #include <dumux/material/fluidmatrixinteractions/mp/2padapter.hh>
+#include <dumux/material/fluidmatrixinteractions/1pia/fluidsolidinterfacialareashiwang.hh>
 #include <dumux/porousmediumflow/properties.hh>
 #include <dumux/material/spatialparams/fv.hh>
 
@@ -65,6 +66,7 @@ public:
     //! export the material law type used
     using MaterialLaw = TwoPAdapter<wPhaseIdx, EffToAbsLaw<EffectiveLaw>>;
     using MaterialLawParams = typename MaterialLaw::Params;
+    using FluidSolidInterfacialAreaFormulation = FluidSolidInterfacialAreaShiWang<Scalar>;
 
     CombustionSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry) : ParentType(fvGridGeometry)
     {
-- 
GitLab