Commit d6764c21 authored by Timo Koch's avatar Timo Koch
Browse files

[biomin] Free spatial params from typetag

parent a0de95a0
......@@ -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_;
......
......@@ -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_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment