Commit c91156ca authored by Timo Koch's avatar Timo Koch

Merge branch 'cleanup/free-spatialparams-from-typetag' into 'master'

Cleanup/free spatialparams from typetag

See merge request !63
parents 681e6b88 d6764c21
Pipeline #750 passed with stage
in 25 seconds
......@@ -53,7 +53,7 @@ namespace Properties
//! Create new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFourBioMin { using InheritsFrom = std::tuple<BioMinSpatialparams, TwoPNCMin>; };
struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
} // end namespace TTag
......@@ -92,6 +92,14 @@ struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
using type = SolidSystems::BiominSolidPhase<Scalar>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
using MT = GetPropType<TypeTag, ModelTraits>;
static constexpr int numFluidComps = MT::numFluidComponents();
static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
using type = BioMinSpatialparams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
};
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = false; };
......
......@@ -33,39 +33,20 @@
#include <dumux/discretization/method.hh>
namespace Dumux
{
//forward declaration
template<class TypeTag>
class BioMinSpatialparams;
namespace Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG(BioMinSpatialparams);
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::BioMinSpatialparams> { using type = BioMinSpatialparams<TypeTag>; };
} // end namespace Properties
namespace Dumux {
/*!
* \brief Definition of the spatial parameters for the biomineralisation problem
* with geostatistically distributed initial permeability.
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar, int numFluidComps, int numActiveSolidComps>
class BioMinSpatialparams
: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
BioMinSpatialparams<TypeTag>>
: public FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<FVGridGeometry, Scalar, numFluidComps, numActiveSolidComps>>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<TypeTag>>;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<FVGridGeometry, Scalar, numFluidComps, numActiveSolidComps>>;
using EffectiveLaw = RegularizedBrooksCorey<Scalar>;
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using GridView = typename FVGridGeometry::GridView;
using CoordScalar = typename GridView::ctype;
......@@ -75,8 +56,9 @@ class BioMinSpatialparams
using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
using Tensor = Dune::FieldMatrix<CoordScalar, dimWorld, dimWorld>;
using PoroLaw = PorosityPrecipitation<Scalar, numFluidComps, numActiveSolidComps>;
public:
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using PermeabilityType = Tensor;
using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
using MaterialLawParams = typename MaterialLaw::Params;
......@@ -156,6 +138,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template<class SolutionVector>
void computeReferencePorosity(const FVGridGeometry& fvGridGeometry,
const SolutionVector& sol)
{
......@@ -174,6 +157,7 @@ public:
const auto& dofPosition = scv.dofPosition();
const bool isInAquitardNotFaultZone = isInAquitard_(dofPosition) && !isFaultZone_(dofPosition);
auto phi = isInAquitardNotFaultZone ? aquitardPorosity_ : initialPorosity_;
auto phiEvaluated = poroLaw_.evaluatePorosity(element, scv, elemSol, phi);
referencePorosity_[eIdx][scv.indexInElement()] = calculatephiRef(phi, phiEvaluated);
}
......@@ -226,6 +210,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template<class SolutionVector>
void computeReferencePermeability(const FVGridGeometry& fvGridGeometry,
const SolutionVector& sol)
{
......@@ -332,10 +317,8 @@ private:
bool isFaultZone_(const GlobalPosition &globalPos) const
{ return globalPos[dimWorld-2] > 2 - eps_ && globalPos[dimWorld-2] < 3 + eps_;}
using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>;
PorosityPrecipitation<Scalar, ModelTraits::numFluidComponents(), ModelTraits::numSolidComps()> poroLaw_;
PermeabilityKozenyCarman<PermeabilityType> permLaw_;
PoroLaw poroLaw_;
Scalar initialPorosity_;
std::vector< std::vector<Scalar> > referencePorosity_;
......
......@@ -26,27 +26,20 @@
#include <dumux/material/spatialparams/fv1p.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup OnePModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the
* 1p cc model
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar>
class OnePSpatialParams
: public FVSpatialParamsOneP<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
OnePSpatialParams<TypeTag>>
: public FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>
{
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<TypeTag>>;
using GridView = typename FVGridGeometry::GridView;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>;
using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
......@@ -56,7 +49,7 @@ public:
using PermeabilityType = Scalar;
OnePSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
: ParentType(fvGridGeometry)
{
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
......
......@@ -29,29 +29,22 @@
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the 2p cc model
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar>
class TwoPSpatialParams
: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
TwoPSpatialParams<TypeTag>>
: public FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<FVGridGeometry, Scalar>>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using GridView = typename FVGridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<TypeTag>>;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<FVGridGeometry, Scalar>>;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using EffectiveLaw = RegularizedVanGenuchten<Scalar>;
......@@ -62,7 +55,7 @@ public:
using PermeabilityType = Scalar;
TwoPSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
: ParentType(fvGridGeometry)
{
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
......@@ -134,6 +127,6 @@ private:
static constexpr Scalar eps_ = 1.0e-7;
};
} // end namespace
} // end namespace Dumux
#endif
......@@ -17,10 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The porous medium flow sub problem
*/
* \file
*
* \brief The porous medium flow sub problem
*/
#ifndef DUMUX_DARCY_SUBPROBLEM_HH
#define DUMUX_DARCY_SUBPROBLEM_HH
......@@ -80,8 +80,11 @@ struct Grid<TypeTag, TTag::DarcyOneP>
};
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOneP> { using type = OnePSpatialParams<TypeTag>; };
}
struct SpatialParams<TypeTag, TTag::DarcyOneP> {
using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
} // end namespace Properties
/*!
* \brief The porous medium flow sub problem
......
......@@ -79,8 +79,11 @@ struct Grid<TypeTag, TTag::DarcyOnePNC> { using type = Dune::YaspGrid<2>; };
// Set the spatial paramaters type
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { using type = OnePSpatialParams<TypeTag>; };
}
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> {
using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
} // end namespace Properties
template <class TypeTag>
class DarcySubProblem : public PorousMediumFlowProblem<TypeTag>
......@@ -396,6 +399,6 @@ private:
Dumux::GnuplotInterface<Scalar> gnuplotInterfaceFluxes_;
Dumux::GnuplotInterface<Scalar> gnuplotStorage_;
};
} //end namespace
} //end namespace Dumux
#endif //DUMUX_DARCY_SUBPROBLEM_HH
......@@ -32,13 +32,13 @@
#include <dumux/freeflow/compositional/navierstokesncmodel.hh>
#include <dumux/freeflow/navierstokes/problem.hh>
namespace Dumux
{
namespace Dumux {
template <class TypeTag>
class FreeFlowSubProblem;
namespace Properties
{
namespace Properties {
// Create new type tags
namespace TTag {
struct StokesZeroEq { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; };
......
......@@ -16,11 +16,11 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The porous medium sub problem
*/
/*!
* \file
*
* \brief The porous medium sub problem
*/
#ifndef DUMUX_DARCY2P2C_SUBPROBLEM_HH
#define DUMUX_DARCY2P2C_SUBPROBLEM_HH
......@@ -72,8 +72,11 @@ template<class TypeTag>
struct UseMoles<TypeTag, TTag::DarcyTwoPTwoCNI> { static constexpr bool value = true; };
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> { using type = TwoPSpatialParams<TypeTag>; };
}
struct SpatialParams<TypeTag, TTag::DarcyTwoPTwoCNI> {
using type = TwoPSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
} // end namespace Properties
/*!
* \brief The porous medium sub problem
......
......@@ -70,7 +70,9 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>;
// set the spatial params
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::OnePBase> { using type = OnePTestSpatialParams<TypeTag>; };
struct SpatialParams<TypeTag, TTag::OnePBase> {
using type = OnePTestSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
// the fluid system for incompressible tests
template<class TypeTag>
......
......@@ -24,7 +24,6 @@
#ifndef DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#include <dumux/porousmediumflow/properties.hh>
#include <dumux/material/spatialparams/fv1p.hh>
namespace Dumux {
......@@ -34,19 +33,15 @@ namespace Dumux {
* \brief The spatial parameters class for the test problem using the
* compressible 1p model
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar>
class OnePTestSpatialParams
: public FVSpatialParamsOneP<typename GET_PROP_TYPE(TypeTag, FVGridGeometry),
typename GET_PROP_TYPE(TypeTag, Scalar),
OnePTestSpatialParams<TypeTag>>
: public FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePTestSpatialParams<FVGridGeometry, Scalar>>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using GridView = typename FVGridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePTestSpatialParams<TypeTag>>;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePTestSpatialParams<FVGridGeometry, Scalar>>;
static constexpr int dimWorld = GridView::dimensionworld;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
......
......@@ -54,7 +54,7 @@ namespace Properties
//! Create new type tag for the problem
// Create new type tags
namespace TTag {
struct ExerciseFourBioMin { using InheritsFrom = std::tuple<BioMinSpatialparams, TwoPNCMin>; };
struct ExerciseFourBioMin { using InheritsFrom = std::tuple<TwoPNCMin>; };
struct ExerciseFourBioMinCCTpfa { using InheritsFrom = std::tuple<ExerciseFourBioMin, CCTpfaModel>; };
} // end namespace TTag
......@@ -93,6 +93,14 @@ struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
using type = SolidSystems::BiominSolidPhase<Scalar>;
};
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::ExerciseFourBioMin> {
using MT = GetPropType<TypeTag, ModelTraits>;
static constexpr int numFluidComps = MT::numFluidComponents();
static constexpr int numActiveSolidComps = MT::numSolidComps() - MT::numInertSolidComps();
using type = BioMinSpatialparams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>, numFluidComps, numActiveSolidComps>;
};
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::ExerciseFourBioMin> { static constexpr bool value = false; };
......
......@@ -33,39 +33,20 @@
#include <dumux/discretization/method.hh>
namespace Dumux
{
//forward declaration
template<class TypeTag>
class BioMinSpatialparams;
namespace Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG(BioMinSpatialparams);
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::BioMinSpatialparams> { using type = BioMinSpatialparams<TypeTag>; };
} // end namespace Properties
namespace Dumux {
/*!
* \brief Definition of the spatial parameters for the biomineralisation problem
* with geostatistically distributed initial permeability.
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar, int numFluidComps, int numActiveSolidComps>
class BioMinSpatialparams
: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
BioMinSpatialparams<TypeTag>>
: public FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<FVGridGeometry, Scalar, numFluidComps, numActiveSolidComps>>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<TypeTag>>;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<FVGridGeometry, Scalar, numFluidComps, numActiveSolidComps>>;
using EffectiveLaw = RegularizedBrooksCorey<Scalar>;
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using GridView = typename FVGridGeometry::GridView;
using CoordScalar = typename GridView::ctype;
......@@ -75,8 +56,9 @@ class BioMinSpatialparams
using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
using Tensor = Dune::FieldMatrix<CoordScalar, dimWorld, dimWorld>;
using PoroLaw = PorosityPrecipitation<Scalar, numFluidComps, numActiveSolidComps>;
public:
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using PermeabilityType = Tensor;
using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
using MaterialLawParams = typename MaterialLaw::Params;
......@@ -156,6 +138,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template<class SolutionVector>
void computeReferencePorosity(const FVGridGeometry& fvGridGeometry,
const SolutionVector& sol)
{
......@@ -174,6 +157,7 @@ public:
const auto& dofPosition = scv.dofPosition();
const bool isInAquitardNotFaultZone = isInAquitard_(dofPosition) && !isFaultZone_(dofPosition);
auto phi = isInAquitardNotFaultZone ? aquitardPorosity_ : initialPorosity_;
auto phiEvaluated = poroLaw_.evaluatePorosity(element, scv, elemSol, phi);
referencePorosity_[eIdx][scv.indexInElement()] = calculatephiRef(phi, phiEvaluated);
}
......@@ -226,6 +210,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template<class SolutionVector>
void computeReferencePermeability(const FVGridGeometry& fvGridGeometry,
const SolutionVector& sol)
{
......@@ -332,10 +317,8 @@ private:
bool isFaultZone_(const GlobalPosition &globalPos) const
{ return globalPos[dimWorld-2] > 2 - eps_ && globalPos[dimWorld-2] < 3 + eps_;}
using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>;
PorosityPrecipitation<Scalar, ModelTraits::numFluidComponents(), ModelTraits::numSolidComps()> poroLaw_;
PermeabilityKozenyCarman<PermeabilityType> permLaw_;
PoroLaw poroLaw_;
Scalar initialPorosity_;
std::vector< std::vector<Scalar> > referencePorosity_;
......
......@@ -26,27 +26,20 @@
#include <dumux/material/spatialparams/fv1p.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup OnePModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the
* 1p cc model
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar>
class OnePSpatialParams
: public FVSpatialParamsOneP<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
OnePSpatialParams<TypeTag>>
: public FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>
{
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<TypeTag>>;
using GridView = typename FVGridGeometry::GridView;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, OnePSpatialParams<FVGridGeometry, Scalar>>;
using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
......@@ -56,7 +49,7 @@ public:
using PermeabilityType = Scalar;
OnePSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
: ParentType(fvGridGeometry)
{
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
......
......@@ -29,29 +29,22 @@
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
namespace Dumux
{
namespace Dumux {
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the 2p cc model
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar>
class TwoPSpatialParams
: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
TwoPSpatialParams<TypeTag>>
: public FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<FVGridGeometry, Scalar>>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using GridView = typename FVGridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<TypeTag>>;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, TwoPSpatialParams<FVGridGeometry, Scalar>>;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using EffectiveLaw = RegularizedVanGenuchten<Scalar>;
......@@ -62,7 +55,7 @@ public:
using PermeabilityType = Scalar;
TwoPSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
: ParentType(fvGridGeometry)
{
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
......@@ -134,6 +127,6 @@ private:
static constexpr Scalar eps_ = 1.0e-7;
};
} // end namespace
} // end namespace Dumux
#endif
......@@ -47,23 +47,29 @@ class DarcySubProblem;
namespace Properties
{
NEW_TYPE_TAG(DarcyOneP, INHERITS_FROM(CCTpfaModel, OneP));
// Create new type tags
namespace TTag {
struct DarcyOneP { using InheritsFrom = std::tuple<OneP, CCTpfaModel>; };
} // end namespace TTag
// Set the problem property
SET_TYPE_PROP(DarcyOneP, Problem, Dumux::DarcySubProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::DarcyOneP> { using type = Dumux::DarcySubProblem<TypeTag>; };
// the fluid system
SET_PROP(DarcyOneP, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::DarcyOneP>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::SimpleH2O<Scalar> > ;
};
// Set the grid type
SET_PROP(DarcyOneP, Grid)
template<class TypeTag>
struct Grid<TypeTag, TTag::DarcyOneP>
{
static constexpr auto dim = 2;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using TensorGrid = Dune::YaspGrid<2, Dune::TensorProductCoordinates<Scalar, dim> >;
#if EXNUMBER < 3 // use "normal" grid
......@@ -74,8 +80,12 @@ SET_PROP(DarcyOneP, Grid)
#endif
};
SET_TYPE_PROP(DarcyOneP, SpatialParams, OnePSpatialParams<TypeTag>);
}
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOneP> {
using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
} // end namespace Properties
/*!
* \brief The porous medium flow sub problem
......@@ -84,23 +94,23 @@ template <class TypeTag>
class DarcySubProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using Element = typename GridView::template Codim<0>::Entity;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using CouplingManager = typename GET_PROP_TYPE(TypeTag, CouplingManager);
using CouplingManager = GetPropType<TypeTag, Properties::CouplingManager>;
public:
DarcySubProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry,
......
......@@ -26,9 +26,9 @@
#include <dune/grid/yaspgrid.hh>
#include <dumux/material/fluidsystems/1padapter.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/io/gnuplotinterface.hh>
#include <dumux/material/fluidsystems/1padapter.hh>
#include <dumux/material/fluidsystems/h2oair.hh>
#include <dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh>
......@@ -100,12 +100,17 @@ struct Formulation<TypeTag, TTag::DarcyOnePNC>
// Set the spatial paramaters type
#if EXNUMBER >= 1
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { using type = TwoPSpatialParams<TypeTag>; };
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> {
using type = TwoPSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
#else
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> { using type = OnePSpatialParams<TypeTag>; };
struct SpatialParams<TypeTag, TTag::DarcyOnePNC> {
using type = OnePSpatialParams<GetPropType<TypeTag, FVGridGeometry>, GetPropType<TypeTag, Scalar>>;
};
#endif
}
} // end namespace Properties
template <class TypeTag>
class DarcySubProblem : public PorousMediumFlowProblem<TypeTag>
......@@ -309,6 +314,11 @@ public:
gnuplotInterfaceFluxes_.plot("flux_" + std::to_string(timeLoop_->