diff --git a/dumux/material/components/constant.hh b/dumux/material/components/constant.hh index 1b90313aa9b59d267b24e024156bce1bcea04e9b..a96705977dd981a3f9dcb115ddbb918308eb84a3 100644 --- a/dumux/material/components/constant.hh +++ b/dumux/material/components/constant.hh @@ -45,7 +45,7 @@ namespace Components { * [1.Component] * MolarMass = 0.018 # kg/mol * \endcode - * \note If you only have one component you can also leaf out the "1.". + * \note If you only have one component you can also omit the "1.". */ template<int id, class Scalar> class Constant : public Component<Scalar, Constant<id, Scalar> > diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh index 78f3e288b5a0ca9ee9abd5ad78a8461c0bc72d3a..1de029a8e2ac0ffe7ed701536e113ae5d5eae050 100644 --- a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh +++ b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh @@ -78,7 +78,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity", true)) gravity_[dim - 1] = -9.81; } /*! @@ -93,7 +93,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity", true)) gravity_[dim - 1] = -9.81; } /*! @@ -106,7 +106,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity", true)) gravity_[dim - 1] = -9.81; } /*! @@ -120,7 +120,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity", true)) gravity_[dim - 1] = -9.81; } diff --git a/dumux/porousmediumflow/1p/sequential/properties.hh b/dumux/porousmediumflow/1p/sequential/properties.hh index 722ae9bb08b62c116200d01a5d8f8d2575ab21c1..eeb35d831bc47fe2edd22c8ef151fe033f31a55a 100644 --- a/dumux/porousmediumflow/1p/sequential/properties.hh +++ b/dumux/porousmediumflow/1p/sequential/properties.hh @@ -59,7 +59,6 @@ NEW_TYPE_TAG(SequentialOneP, INHERITS_FROM(SequentialModel)); ////////////////////////////////////////////////////////////////// NEW_PROP_TAG( SpatialParams ); //!< The type of the spatial parameters object -NEW_PROP_TAG( ProblemEnableGravity); //!< Returns whether gravity is considered in the problem NEW_PROP_TAG( Fluid ); //!< The fluid for one-phase models NEW_PROP_TAG( Indices ); //!< Set of indices for the one-phase model NEW_PROP_TAG( CellData ); //!< The cell data storage class @@ -99,9 +98,6 @@ SET_TYPE_PROP(SequentialOneP, CellData, CellData1P<TypeTag>); //! The spatial parameters to be employed. Use BoxSpatialParams by default. SET_TYPE_PROP(SequentialOneP, SpatialParams, FVSpatialParamsOneP<TypeTag>); - -//! Enable gravity by default -SET_BOOL_PROP(SequentialOneP, ProblemEnableGravity, true); } } #endif diff --git a/dumux/porousmediumflow/sequential/onemodelproblem.hh b/dumux/porousmediumflow/sequential/onemodelproblem.hh index fa381f504d9a8112d4eaaff5d17968ef76a24c17..92bee5bc4d5c369add1024b9b37d4be5ea32f027 100644 --- a/dumux/porousmediumflow/sequential/onemodelproblem.hh +++ b/dumux/porousmediumflow/sequential/onemodelproblem.hh @@ -109,6 +109,7 @@ public: timeManager_ = std::make_shared<TimeManager>(verbose); model_ = std::make_shared<Model>(asImp_()) ; + maxTimeStepSize_ = getParam<Scalar>("TimeManager.MaxTimeStepSize", std::numeric_limits<Scalar>::max()); } //! Constructs an object of type OneModelProblemProblem @@ -137,6 +138,7 @@ public: timeManager_ = Dune::stackobject_to_shared_ptr<TimeManager>(timeManager); model_ = std::make_shared<Model>(asImp_()) ; + maxTimeStepSize_ = getParam<Scalar>("TimeManager.MaxTimeStepSize", std::numeric_limits<Scalar>::max()); } /*! @@ -365,9 +367,7 @@ public: * Overload in problem for custom needs. */ Scalar maxTimeStepSize() const - { - return GET_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, MaxTimeStepSize); - } + { return maxTimeStepSize_; } /*! * \brief Returns the current time step size [seconds]. @@ -665,6 +665,7 @@ private: GlobalPosition bBoxMax_; std::shared_ptr<TimeManager> timeManager_; + Scalar maxTimeStepSize_; Variables variables_; diff --git a/test/porousmediumflow/1p/sequential/test_1pproblem.hh b/test/porousmediumflow/1p/sequential/test_1pproblem.hh index 5750ab40a83b60a373ee30fa842c155ba11ca9a7..c754ea2afcdc4ee1feb47e4dfdadfba3791e9705 100644 --- a/test/porousmediumflow/1p/sequential/test_1pproblem.hh +++ b/test/porousmediumflow/1p/sequential/test_1pproblem.hh @@ -25,7 +25,7 @@ #define DUMUX_TEST_1P_PROBLEM_HH #include <dumux/material/fluidsystems/liquidphase.hh> -#include <dumux/material/components/unit.hh> +#include <dumux/material/components/constant.hh> #include <dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh> #include <dumux/porousmediumflow/1p/sequential/diffusion/problem.hh> @@ -55,7 +55,7 @@ SET_PROP(TestProblemOneP, Fluid) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; // Set the spatial parameters @@ -94,7 +94,6 @@ class TestProblemOneP: public DiffusionProblem1P<TypeTag > typedef typename GridView::Intersection Intersection; typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; typedef Dune::FieldVector<Scalar, dim> LocalPosition; - typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; typedef typename GET_PROP_TYPE(TypeTag, GridCreator) GridCreator; @@ -102,13 +101,10 @@ public: TestProblemOneP(TimeManager &timeManager, const GridView &gridView) : ParentType(gridView), velocity_(*this) { - delta_ = 1e-3 ; + delta_ = getParam<Scalar>("Problem.Delta", 1e-3); - if (ParameterTree::tree().hasKey("Problem.Delta")) - delta_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, Delta); - int numRefine; - numRefine = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, int, Grid, NumRefine); - GridCreator::grid().globalRefine(numRefine); + int numRefine = getParam<int>("Grid.NumRefine"); + GridCreator::grid().globalRefine(numRefine); this->spatialParams().initialize(delta_); }