Commit ec6f5f8e authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'feature/free-base-spatialparams-from-typetag' into 'master'

[spatialparams] Free the base classes from TypeTag

See merge request !822
parents 96379636 b84adabf
......@@ -50,7 +50,6 @@ namespace Dumux {
template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
class FVAssembler
{
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual);
......@@ -69,6 +68,7 @@ public:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using ResidualType = SolutionVector;
......
......@@ -113,8 +113,6 @@ NEW_PROP_TAG(PrimaryVariableSwitch); //!< The primary variable swi
NEW_PROP_TAG(EffectiveDiffusivityModel); //!< The employed model for the computation of the effective diffusivity
NEW_PROP_TAG(ThermalConductivityModel); //!< Model to be used for the calculation of the effective conductivity
NEW_PROP_TAG(VelocityOutput); //!< specifies the velocity calculation module to be used
NEW_PROP_TAG(MaterialLaw); //!< The material law which ought to be used (extracted from the spatial parameters)
NEW_PROP_TAG(Formulation); //!< The formulation of the model
// TODO: is this useful? -> everything is a constraint solver just a different type
NEW_PROP_TAG(UseConstraintSolver); //!< Whether to use a contraint solver for computing the secondary variables
......
......@@ -224,28 +224,9 @@ class CCTpfaDarcysLaw<ScalarType, FVGridGeometry, /*isNetwork*/ false>
const auto insideScvIdx = scvf.insideScvIdx();
const auto& insideScv = fvGeometry.scv(insideScvIdx);
const auto& insideVolVars = elemVolVars[insideScvIdx];
// check if we evaluate the permeability in the volume (for discontinuous fields, default)
// or at the scvf center for analytical permeability fields (e.g. convergence studies)
using SpatialParams = typename Problem::SpatialParams;
using VolumeVariables = typename ElementVolumeVariables::VolumeVariables;
auto getPermeability = [&problem](const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal) -> typename SpatialParams::PermeabilityType
{
if (SpatialParams::evaluatePermeabilityAtScvfIP())
{
// If the permeability at pos method is not overloaded it might have a different return type
// We do an implicit cast to permeability type in case EvaluatePermeabilityAtScvfIP is not true so that it compiles
// If it is true make sure that no cast is necessary and the correct return type is specified in the spatial params
static_assert(!SpatialParams::evaluatePermeabilityAtScvfIP()
|| std::is_same<std::decay_t<typename SpatialParams::PermeabilityType>, std::decay_t<decltype(problem.spatialParams().permeabilityAtPos(scvfIpGlobal))>>::value,
"permeabilityAtPos doesn't return PermeabilityType stated in the spatial params!");
return problem.spatialParams().permeabilityAtPos(scvfIpGlobal);
}
else
return volVars.permeability();
};
const Scalar ti = computeTpfaTransmissibility(scvf, insideScv, getPermeability(insideVolVars, scvf.ipGlobal()),
const Scalar ti = computeTpfaTransmissibility(scvf, insideScv,
getPermeability_(problem, insideVolVars, scvf.ipGlobal()),
insideVolVars.extrusionFactor());
// on the boundary (dirichlet) we only need ti
......@@ -260,7 +241,8 @@ class CCTpfaDarcysLaw<ScalarType, FVGridGeometry, /*isNetwork*/ false>
// refers to the scv of our element, so we use the scv method
const auto& outsideScv = fvGeometry.scv(outsideScvIdx);
const auto& outsideVolVars = elemVolVars[outsideScvIdx];
const Scalar tj = -1.0*computeTpfaTransmissibility(scvf, outsideScv, getPermeability(outsideVolVars, scvf.ipGlobal()),
const Scalar tj = -1.0*computeTpfaTransmissibility(scvf, outsideScv,
getPermeability_(problem, outsideVolVars, scvf.ipGlobal()),
outsideVolVars.extrusionFactor());
// harmonic mean (check for division by zero!)
......@@ -273,6 +255,21 @@ class CCTpfaDarcysLaw<ScalarType, FVGridGeometry, /*isNetwork*/ false>
return tij;
}
private:
template<class Problem, class VolumeVariables,
std::enable_if_t<!Problem::SpatialParams::evaluatePermeabilityAtScvfIP(), int> = 0>
static decltype(auto) getPermeability_(const Problem& problem,
const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal)
{ return volVars.permeability(); }
template<class Problem, class VolumeVariables,
std::enable_if_t<Problem::SpatialParams::evaluatePermeabilityAtScvfIP(), int> = 0>
static decltype(auto) getPermeability_(const Problem& problem,
const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal)
{ return problem.spatialParams().permeabilityAtPos(scvfIpGlobal); }
};
/*!
......@@ -458,28 +455,9 @@ public:
const auto insideScvIdx = scvf.insideScvIdx();
const auto& insideScv = fvGeometry.scv(insideScvIdx);
const auto& insideVolVars = elemVolVars[insideScvIdx];
// check if we evaluate the permeability in the volume (for discontinuous fields, default)
// or at the scvf center for analytical permeability fields (e.g. convergence studies)
using SpatialParams = typename Problem::SpatialParams;
using VolumeVariables = typename ElementVolumeVariables::VolumeVariables;
auto getPermeability = [&problem](const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal) -> typename SpatialParams::PermeabilityType
{
if (SpatialParams::evaluatePermeabilityAtScvfIP())
{
// If the permeability at pos method is not overloaded it might have a different return type
// We do an implicit cast to permeability type in case evaluatePermeabilityAtScvfIP is not true so that it compiles
// If it is true make sure that no cast is necessary and the correct return type is specified in the spatial params
static_assert(!SpatialParams::evaluatePermeabilityAtScvfIP()
|| std::is_same<std::decay_t<typename SpatialParams::PermeabilityType>, std::decay_t<decltype(problem.spatialParams().permeabilityAtPos(scvfIpGlobal))>>::value,
"permeabilityAtPos doesn't return PermeabilityType stated in the spatial params!");
return problem.spatialParams().permeabilityAtPos(scvfIpGlobal);
}
else
return volVars.permeability();
};
const Scalar ti = computeTpfaTransmissibility(scvf, insideScv, getPermeability(insideVolVars, scvf.ipGlobal()),
const Scalar ti = computeTpfaTransmissibility(scvf, insideScv,
getPermeability_(problem, insideVolVars, scvf.ipGlobal()),
insideVolVars.extrusionFactor());
// for the boundary (dirichlet) or at branching points we only need ti
......@@ -494,7 +472,8 @@ public:
// refers to the scv of our element, so we use the scv method
const auto& outsideScv = fvGeometry.scv(outsideScvIdx);
const auto& outsideVolVars = elemVolVars[outsideScvIdx];
const Scalar tj = computeTpfaTransmissibility(fvGeometry.flipScvf(scvf.index()), outsideScv, getPermeability(outsideVolVars, scvf.ipGlobal()),
const Scalar tj = computeTpfaTransmissibility(fvGeometry.flipScvf(scvf.index()), outsideScv,
getPermeability_(problem, outsideVolVars, scvf.ipGlobal()),
outsideVolVars.extrusionFactor());
// harmonic mean (check for division by zero!)
......@@ -507,6 +486,21 @@ public:
return tij;
}
private:
template<class Problem, class VolumeVariables,
std::enable_if_t<!Problem::SpatialParams::evaluatePermeabilityAtScvfIP(), int> = 0>
static decltype(auto) getPermeability_(const Problem& problem,
const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal)
{ return volVars.permeability(); }
template<class Problem, class VolumeVariables,
std::enable_if_t<Problem::SpatialParams::evaluatePermeabilityAtScvfIP(), int> = 0>
static decltype(auto) getPermeability_(const Problem& problem,
const VolumeVariables& volVars,
const GlobalPosition& scvfIpGlobal)
{ return problem.spatialParams().permeabilityAtPos(scvfIpGlobal); }
};
} // end namespace Dumux
......
......@@ -26,35 +26,47 @@
#define DUMUX_FV_SPATIAL_PARAMS_HH
#include <dune/common/exceptions.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/typetraits/isvalid.hh>
#include "fv1p.hh"
namespace Dumux {
#ifndef DOXYGEN
namespace Detail {
// helper struct detecting if the user-defined spatial params class has a materialLawParamsAtPos function
// for g++ > 5.3, this can be replaced by a lambda
template<class GlobalPosition>
struct hasMaterialLawParamsAtPos
{
auto operator()(auto&& a)
-> decltype(a.materialLawParamsAtPos(std::declval<GlobalPosition>()))
{};
};
} // end namespace Detail
#endif
/*!
* \ingroup SpatialParameters
* \brief The base class for spatial parameters of multi-phase problems
* using a fully implicit discretization method.
*/
template<class TypeTag>
class FVSpatialParams: public FVSpatialParamsOneP<TypeTag>
template<class FVGridGeometry, class Scalar, class Implementation>
class FVSpatialParams : public FVSpatialParamsOneP<FVGridGeometry, Scalar, Implementation>
{
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using MaterialLawParams = typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params;
using ParentType = FVSpatialParamsOneP<FVGridGeometry, Scalar, Implementation>;
using GridView = typename FVGridGeometry::GridView;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVGridGeometry::SubControlVolume;
using Element = typename GridView::template Codim<0>::Entity;
static const int dimWorld = GridView::dimensionworld;
using GlobalPosition = Dune::FieldVector<typename GridView::ctype, dimWorld>;
public:
//! export the type used for the material law
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
//! The constructor
FVSpatialParams(const Problem& problem) : FVSpatialParamsOneP<TypeTag>(problem) {}
FVSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{}
/*!
* \brief Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
......@@ -65,24 +77,20 @@ public:
* \return the material parameters object
*/
template<class ElementSolution>
const MaterialLawParams& materialLawParams(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
decltype(auto) materialLawParams(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
return this->asImp_().materialLawParamsAtPos(scv.center());
}
static_assert(decltype(isValid(Detail::hasMaterialLawParamsAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
" Your spatial params class has to either implement\n\n"
" const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const\n\n"
" or overload this function\n\n"
" template<class ElementSolution>\n"
" const MaterialLawParams& materialLawParams(const Element& element,\n"
" const SubControlVolume& scv,\n"
" const ElementSolution& elemSol) const\n\n");
/*!
* \brief Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
*
* \return the material parameters object
* \param globalPos The position of the center of the element
*/
const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition& globalPos) const
{
DUNE_THROW(Dune::InvalidStateException,
"The spatial parameters do not provide "
"a materialLawParamsAtPos() method.");
return this->asImp_().materialLawParamsAtPos(scv.center());
}
/*!
......
......@@ -26,29 +26,40 @@
#define DUMUX_FV_SPATIAL_PARAMS_ONE_P_HH
#include <dune/common/exceptions.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/math.hh>
#include <dumux/common/typetraits/isvalid.hh>
#include <dune/common/fmatrix.hh>
namespace Dumux {
#ifndef DOXYGEN
namespace Detail {
// helper struct detecting if the user-defined spatial params class has a permeabilityAtPos function
// for g++ > 5.3, this can be replaced by a lambda
template<class GlobalPosition>
struct hasPermeabilityAtPos
{
auto operator()(auto&& a)
-> decltype(a.permeabilityAtPos(std::declval<GlobalPosition>()))
{};
};
} // end namespace Detail
#endif
/*!
* \ingroup SpatialParameters
* \brief The base class for spatial parameters of one-phase problems
* using a fully implicit discretization method.
*/
template<class TypeTag>
template<class FVGridGeometry, class Scalar, class Implementation>
class FVSpatialParamsOneP
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Implementation = typename GET_PROP_TYPE(TypeTag, SpatialParams);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
using GridView = typename FVGridGeometry::GridView;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVGridGeometry::SubControlVolume;
using SubControlVolumeFace = typename FVGridGeometry::SubControlVolumeFace;
using Element = typename GridView::template Codim<0>::Entity;
enum { dim = GridView::dimension };
......@@ -57,9 +68,17 @@ class FVSpatialParamsOneP
using GlobalPosition = Dune::FieldVector<typename GridView::ctype, dimWorld>;
public:
FVSpatialParamsOneP(const Problem& problem)
: problemPtr_(&problem)
{}
FVSpatialParamsOneP(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: fvGridGeometry_(fvGridGeometry)
{
/* \brief default forchheimer coefficient
* Source: Ward, J.C. 1964 Turbulent flow in porous media. ASCE J. Hydraul. Div 90 \cite ward1964 .
* Actually the Forchheimer coefficient is also a function of the dimensions of the
* porous medium. Taking it as a constant is only a first approximation
* (Nield, Bejan, Convection in porous media, 2006, p. 10 \cite nield2006 )
*/
forchCoeffDefault_ = getParam<Scalar>("SpatialParams.ForchCoeff", 0.55);
}
/*!
* \brief Harmonic average of a discontinuous scalar field at discontinuity interface
......@@ -126,21 +145,16 @@ public:
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
return asImp_().permeabilityAtPos(scv.center());
}
static_assert(decltype(isValid(Detail::hasPermeabilityAtPos<GlobalPosition>())(this->asImp_()))::value," \n\n"
" Your spatial params class has to either implement\n\n"
" const PermeabilityType& permeabilityAtPos(const GlobalPosition& globalPos) const\n\n"
" or overload this function\n\n"
" template<class ElementSolution>\n"
" const PermeabilityType& permeability(const Element& element,\n"
" const SubControlVolume& scv,\n"
" const ElementSolution& elemSol) const\n\n");
/*!
* \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$
* \note It is possibly solution dependent.
*
* \return permeability
* \param globalPos The position of the center of the scv
*/
Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
{
DUNE_THROW(Dune::InvalidStateException,
"The spatial parameters do not provide "
"a permeability() or permeabilityAtPos() method.");
return asImp_().permeabilityAtPos(scv.center());
}
/*!
......@@ -286,25 +300,18 @@ public:
/*!
* \brief Apply the Forchheimer coefficient for inertial forces
* calculation.
*
* Source: Ward, J.C. 1964 Turbulent flow in porous media. ASCE J. Hydraul. Div 90 \cite ward1964 .
* Actually the Forchheimer coefficient is also a function of the dimensions of the
* porous medium. Taking it as a constant is only a first approximation
* (Nield, Bejan, Convection in porous media, 2006, p. 10 \cite nield2006 )
*
* \param scv The sub-control volume face where the
* intrinsic velocity ought to be calculated.
*/
Scalar forchCoeff(const SubControlVolumeFace &scvf) const
{
static Scalar forchCoeff = getParamFromGroup<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "SpatialParams.ForchCoeff", 0.55);
return forchCoeff;
return forchCoeffDefault_;
}
//! The problem we are associated with
const Problem& problem() const
//! The finite volume grid geometry
const FVGridGeometry& fvGridGeometry() const
{
return *problemPtr_;
return *fvGridGeometry_;
}
protected:
......@@ -315,7 +322,8 @@ protected:
{ return *static_cast<const Implementation*>(this); }
private:
const Problem *problemPtr_;
std::shared_ptr<const FVGridGeometry> fvGridGeometry_;
Scalar forchCoeffDefault_;
};
} // namespace Dumux
......
......@@ -28,8 +28,10 @@
#include <dumux/common/properties.hh>
#include "sequentialfv1p.hh"
namespace Dumux
{
namespace Dumux {
namespace Properties
{ NEW_PROP_TAG( MaterialLaw ); }
/*!
* \ingroup SpatialParameters
* \brief The base class for spatial parameters of a multi-phase problem using the
......
......@@ -64,7 +64,7 @@ public:
using ElemSol = decltype( elementSolution(Elem(), x, fvGridGeometry) );
using Scv = typename FVGridGeometry::SubControlVolume;
using ReturnType = decltype(spatialParams.materialLawParams(Elem(), Scv(), ElemSol()));
static_assert(std::is_same<ReturnType, const MaterialLawParams&>::value,
static_assert(std::is_lvalue_reference<ReturnType>::value,
"In order to use the box-interface solver please provide access "
"to the material law parameters via returning (const) references");
......
......@@ -170,7 +170,7 @@ public:
static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1,
"2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!");
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
// evaluate the current wetting phase Darcy flux and resulting upwind weights
......@@ -288,7 +288,7 @@ public:
static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1,
"2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p0-s1 formulation!");
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
// evaluate the current wetting phase Darcy flux and resulting upwind weights
......@@ -433,7 +433,7 @@ public:
const ElementFluxVariablesCache& elemFluxVarsCache,
const SubControlVolumeFace& scvf) const
{
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
using MaterialLaw = typename Problem::SpatialParams::MaterialLaw;
using AdvectionType = typename GET_PROP_TYPE(TypeTag, AdvectionType);
// evaluate the current wetting phase Darcy flux and resulting upwind weights
......
......@@ -146,7 +146,6 @@ SET_PROP(TwoP, Formulation)
{ static constexpr auto value = TwoPFormulation::p0s1; };
SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model
SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>); //!< The spatial parameters. Use FVSpatialParams by default.
//! The model traits class
SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>);
......
......@@ -236,9 +236,6 @@ public:
using type = TwoPTwoCVolumeVariables<Traits>;
};
//! Use the FVSpatialParams by default
SET_TYPE_PROP(TwoPTwoC, SpatialParams, FVSpatialParams<TypeTag>);
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP(TwoPTwoC, EffectiveDiffusivityModel,
DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
......
......@@ -66,6 +66,7 @@ NEW_TYPE_TAG(SequentialTwoPTwoC, INHERITS_FROM(Pressure, Transport, IMPET));
//////////////////////////////////////////////////////////////////
NEW_PROP_TAG( Indices );
NEW_PROP_TAG( SpatialParams ); //!< The type of the soil properties object
NEW_PROP_TAG( MaterialLaw ); //!< The type of the material law
NEW_PROP_TAG( PressureFormulation); //!< The formulation of the model
NEW_PROP_TAG( SaturationFormulation); //!< The formulation of the model
NEW_PROP_TAG( VelocityFormulation); //!< The formulation of the model
......
......@@ -177,7 +177,6 @@ public:
};
SET_TYPE_PROP(TwoPNC, PrimaryVariableSwitch, TwoPNCPrimaryVariableSwitch<TypeTag>); //!< The primary variable switch for the 2pnc model
SET_TYPE_PROP(TwoPNC, SpatialParams, FVSpatialParams<TypeTag>); //!< Use the FVSpatialParams by default
//! Set the volume variables property
SET_PROP(TwoPNC, VolumeVariables)
......
......@@ -154,10 +154,6 @@ public:
using type = ThreePVolumeVariables<Traits>;
};
//! The spatial parameters to be employed.
//! Use FVSpatialParams by default.
SET_TYPE_PROP(ThreeP, SpatialParams, FVSpatialParams<TypeTag>);
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state.
......
......@@ -213,10 +213,6 @@ public:
using type = ThreePThreeCVolumeVariables<Traits>;
};
//! The spatial parameters to be employed.
//! Use FVSpatialParams by default.
SET_TYPE_PROP(ThreePThreeC, SpatialParams, FVSpatialParams<TypeTag>);
//! The model after Millington (1961) is used for the effective diffusivity
SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
......
......@@ -203,10 +203,6 @@ public:
using type = ThreePWaterOilVolumeVariables<Traits>;
};
//! The spatial parameters to be employed.
//! Use FVSpatialParams by default.
SET_TYPE_PROP(ThreePWaterOilNI, SpatialParams, FVSpatialParams<TypeTag>);
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP(ThreePWaterOilNI, EffectiveDiffusivityModel,
DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
......
......@@ -254,8 +254,6 @@ public:
using type = MPNCVolumeVariables<Traits>;
};
//! Use ImplicitSpatialParams by default.
SET_TYPE_PROP(MPNC, SpatialParams, FVSpatialParams<TypeTag>);
//! Per default, no component mass balance is replaced
SET_INT_PROP(MPNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents);
//! Use mole fractions in the balance equations by default
......
......@@ -78,14 +78,10 @@ public:
*/
PorousMediumFlowProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry,
const std::string& paramGroup = "")
: ParentType(fvGridGeometry, paramGroup)
, gravity_(0.0)
, spatialParams_(std::make_shared<SpatialParams>(this->asImp_()))
{
const bool enableGravity = getParamFromGroup<bool>(paramGroup, "Problem.EnableGravity");
if (enableGravity)
gravity_[dimWorld-1] = -9.81;
}
: PorousMediumFlowProblem(fvGridGeometry,
std::make_shared<SpatialParams>(fvGridGeometry),
paramGroup)
{}
/*!
* \name Physical parameters for porous media problems
......
......@@ -238,10 +238,6 @@ SET_TYPE_PROP(Richards, PrimaryVariableSwitch, ExtendedRichardsPrimaryVariableSw
//! The primary variable switch for the richards model
// SET_BOOL_PROP(Richards, ProblemUsePrimaryVariableSwitch, false);
//! The spatial parameters to be employed.
//! Use FVSpatialParams by default.
SET_TYPE_PROP(Richards, SpatialParams, FVSpatialParams<TypeTag>);
/*!
*\brief The fluid system used by the model.
*
......
......@@ -46,7 +46,7 @@ class RichardsNewtonSolver : public RichardsPrivarSwitchNewtonSolver<TypeTag, As
using ParentType = RichardsPrivarSwitchNewtonSolver<TypeTag, Assembler, LinearSolver>;
using SolutionVector = typename Assembler::ResidualType;
using MaterialLaw = typename GET_PROP_TYPE(TypeTag, MaterialLaw);
using MaterialLaw = typename Assembler::Problem::SpatialParams::MaterialLaw;
using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
enum { pressureIdx = Indices::pressureIdx };
......
......@@ -200,10 +200,6 @@ SET_PROP(RichardsNC, FluidState)
//! Set the vtk output fields specific to this model
SET_TYPE_PROP(RichardsNC, VtkOutputFields, RichardsNCVtkOutputFields);
//! The spatial parameters to be employed.
//! Use FVSpatialParamsOneP by default.
SET_TYPE_PROP(RichardsNC, SpatialParams, FVSpatialParamsOneP<TypeTag>);
//! The model after Millington (1961) is used for the effective diffusivity
SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>);
......
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