Commit 946a5fea authored by Timo Koch's avatar Timo Koch
Browse files

[ff/pm] Free spatial params from TypeTag

Make solution files and exercise files more equal
parent 724ed1c9
......@@ -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
......
......@@ -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_->timeStepIndex()));
}
/*!
* \name Problem parameters
*/
// \{
/*!
* \brief Return the temperature within the domain in [K].
*
......@@ -380,10 +390,10 @@ public:
* \param scv The subcontrolvolume
*/
template<class ElementVolumeVariables>
NumEqVector source(const Element &element,
NumEqVector source(const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const SubControlVolume &scv) const
const SubControlVolume& scv) const
{ return NumEqVector(0.0); }
// \}
......@@ -396,7 +406,7 @@ public:
* For this method, the \a priVars parameter stores primary
* variables.
*/
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
{
static const Scalar stokesPressure = getParamFromGroup<Scalar>("Stokes", "Problem.Pressure");
......@@ -460,6 +470,6 @@ private:
Dumux::GnuplotInterface<Scalar> gnuplotInterfaceFluxes_;
Dumux::GnuplotInterface<Scalar> gnuplotStorage_;
};
} //end namespace
} //end namespace Dumux
#endif //DUMUX_DARCY_SUBPROBLEM_HH
......@@ -16,10 +16,10 @@
* 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 free-flow sub problem
*/
/*!
* \file
* \brief The free-flow sub problem
*/
#ifndef DUMUX_FREEFLOW1P2C_SUBPROBLEM_HH
#define DUMUX_FREEFLOW1P2C_SUBPROBLEM_HH
......@@ -37,13 +37,13 @@
#include <dumux/freeflow/navierstokes/problem.hh>
#endif
namespace Dumux
{
namespace Dumux {
template <class TypeTag>
class FreeFlowSubProblem;
namespace Properties
{
namespace Properties {
// Create new type tags
namespace TTag {
#if EXNUMBER >= 1
......
......@@ -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
......
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