diff --git a/test/porousmediumflow/2p/implicit/lensproblem.hh b/test/porousmediumflow/2p/implicit/lensproblem.hh index ab53b595dd2c959a47ab1c8243592dcfd14ab3e6..370ee055750a5004e09412777b03ac19f7d298d8 100644 --- a/test/porousmediumflow/2p/implicit/lensproblem.hh +++ b/test/porousmediumflow/2p/implicit/lensproblem.hh @@ -28,9 +28,9 @@ #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/components/dnapl.hh> -#include <dumux/porousmediumflow/2p/implicit/model.hh> #include <dumux/porousmediumflow/problem.hh> #include <dumux/implicit/cellcentered/tpfa/properties.hh> +#include <dumux/porousmediumflow/2p/implicit/model.hh> #include <dumux/porousmediumflow/2p/implicit/gridadaptindicator.hh> #include <dumux/porousmediumflow/2p/implicit/adaptionhelper.hh> #include <dumux/implicit/adaptive/gridadaptinitializationindicator.hh> @@ -48,11 +48,13 @@ class LensProblem; ////////// namespace Properties { +NEW_PROP_TAG(AdaptiveGrid); + NEW_TYPE_TAG(LensProblem, INHERITS_FROM(TwoP, LensSpatialParams)); NEW_TYPE_TAG(LensBoxProblem, INHERITS_FROM(BoxModel, LensProblem)); NEW_TYPE_TAG(LensBoxAdaptiveProblem, INHERITS_FROM(BoxModel, LensProblem)); NEW_TYPE_TAG(LensCCProblem, INHERITS_FROM(CCTpfaModel, LensProblem)); -NEW_TYPE_TAG(LensCCAdaptiveProblem, INHERITS_FROM(CCModel, LensProblem)); +NEW_TYPE_TAG(LensCCAdaptiveProblem, INHERITS_FROM(CCTpfaModel, LensProblem)); #if HAVE_UG SET_TYPE_PROP(LensCCProblem, Grid, Dune::UGGrid<2>); @@ -110,13 +112,13 @@ SET_TYPE_PROP(LensBoxAdaptiveProblem, AdaptionHelper, TwoPAdaptionHelper<TypeTag #endif NEW_PROP_TAG(BaseProblem); -SET_TYPE_PROP(LensBoxProblem, BaseProblem, PorousMediaProblem<TypeTag>); -SET_TYPE_PROP(LensCCProblem, BaseProblem, PorousMediaProblem<TypeTag>); +SET_TYPE_PROP(LensBoxProblem, BaseProblem, PorousMediumFlowProblem<TypeTag>); +SET_TYPE_PROP(LensCCProblem, BaseProblem, PorousMediumFlowProblem<TypeTag>); #if HAVE_DUNE_ALUGRID -SET_TYPE_PROP(LensCCAdaptiveProblem, BaseProblem, PorousMediaProblem<TypeTag>); +SET_TYPE_PROP(LensCCAdaptiveProblem, BaseProblem, PorousMediumFlowProblem<TypeTag>); #endif #if HAVE_UG -SET_TYPE_PROP(LensBoxAdaptiveProblem, BaseProblem, PorousMediaProblem<TypeTag>); +SET_TYPE_PROP(LensBoxAdaptiveProblem, BaseProblem, PorousMediumFlowProblem<TypeTag>); #endif } @@ -190,15 +192,15 @@ class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) }; enum { dofCodim = isBox ? dim : 0 }; - enum { adaptiveGrid = GET_PROP_VALUE(TypeTag, AdaptiveGrid) }; + static const bool adaptiveGrid = GET_PROP_VALUE(TypeTag, AdaptiveGrid); typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; using NeumannFluxes = typename GET_PROP_TYPE(TypeTag, NumEqVector); using Sources = typename GET_PROP_TYPE(TypeTag, NumEqVector); + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry; typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables; typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes; - typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; @@ -209,9 +211,8 @@ public: * \param timeManager The time manager * \param gridView The grid view */ - LensProblem(TimeManager &timeManager, - const GridView &gridView) - : ParentType(timeManager, gridView) + LensProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) + : ParentType(fvGridGeometry) { temperature_ = 273.15 + 20; // -> 20°C @@ -323,10 +324,10 @@ public: Scalar densityW = FluidSystem::density(fluidState, FluidSystem::wPhaseIdx); - Scalar height = this->bBoxMax()[1] - this->bBoxMin()[1]; - Scalar depth = this->bBoxMax()[1] - globalPos[1]; + Scalar height = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; + Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; Scalar alpha = 1 + 1.5/height; - Scalar width = this->bBoxMax()[0] - this->bBoxMin()[0]; + Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; Scalar factor = (width*alpha + (1.0 - alpha)*globalPos[0])/width; // hydrostatic pressure scaled by alpha @@ -380,7 +381,7 @@ public: Scalar densityW = FluidSystem::density(fluidState, FluidSystem::wPhaseIdx); - Scalar depth = this->bBoxMax()[1] - globalPos[1]; + Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1]; // hydrostatic pressure values[pwIdx] = 1e5 - densityW*this->gravity()[1]*depth; @@ -393,28 +394,28 @@ private: bool onLeftBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] < this->bBoxMin()[0] + eps_; + return globalPos[0] < this->fvGridGeometry().bBoxMin()[0] + eps_; } bool onRightBoundary_(const GlobalPosition &globalPos) const { - return globalPos[0] > this->bBoxMax()[0] - eps_; + return globalPos[0] > this->fvGridGeometry().bBoxMax()[0] - eps_; } bool onLowerBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] < this->bBoxMin()[1] + eps_; + return globalPos[1] < this->fvGridGeometry().bBoxMin()[1] + eps_; } bool onUpperBoundary_(const GlobalPosition &globalPos) const { - return globalPos[1] > this->bBoxMax()[1] - eps_; + return globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_; } bool onInlet_(const GlobalPosition &globalPos) const { - Scalar width = this->bBoxMax()[0] - this->bBoxMin()[0]; - Scalar lambda = (this->bBoxMax()[0] - globalPos[0])/width; + Scalar width = this->fvGridGeometry().bBoxMax()[0] - this->fvGridGeometry().bBoxMin()[0]; + Scalar lambda = (this->fvGridGeometry().bBoxMax()[0] - globalPos[0])/width; return onUpperBoundary_(globalPos) && 0.5 < lambda && lambda < 2.0/3.0; } diff --git a/test/porousmediumflow/2p/implicit/lensspatialparams.hh b/test/porousmediumflow/2p/implicit/lensspatialparams.hh index bdca22573f740ba085c51eab4433be40fe4064c2..46c94808f5df27ec571600dbbb854bc4e972a6a4 100644 --- a/test/porousmediumflow/2p/implicit/lensspatialparams.hh +++ b/test/porousmediumflow/2p/implicit/lensspatialparams.hh @@ -98,11 +98,11 @@ public: * * \param gridView The grid view */ - LensSpatialParams(const Problem& problem, const GridView& gridView) - : ParentType(problem, gridView) + LensSpatialParams(const Problem& problem) + : ParentType(problem) { - lensLowerLeft_ = GET_RUNTIME_PARAM(TypeTag, GlobalPosition, SpatialParams.LensLowerLeft); - lensUpperRight_ = GET_RUNTIME_PARAM(TypeTag, GlobalPosition, SpatialParams.LensUpperRight); + lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft"); + lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight"); // residual saturations lensMaterialParams_.setSwr(0.18); diff --git a/test/porousmediumflow/2p/implicit/test_box2p.cc b/test/porousmediumflow/2p/implicit/test_box2p.cc index e0666e462e8c8867f38f80039cc2d684d8e9111e..4b09751a67fddcba82f6e2f59bede3d056c91e7d 100644 --- a/test/porousmediumflow/2p/implicit/test_box2p.cc +++ b/test/porousmediumflow/2p/implicit/test_box2p.cc @@ -156,8 +156,8 @@ int main(int argc, char** argv) try auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); // the linear solver - using LinearSolver = typename GET_PROP_TYPE(TypeTag, LinearSolver); - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->vertexMapper()); + using LinearSolver = Dumux::ILU0BiCGSTABBackend<TypeTag>; + auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver using NewtonController = Dumux::NewtonController<TypeTag>; diff --git a/test/porousmediumflow/2p/implicit/test_box2p.input b/test/porousmediumflow/2p/implicit/test_box2p.input index 95d7809362ae27f3c7299bd6fcfdffb580ccb081..b000721df382726cd95d14373a2470263c053e3b 100644 --- a/test/porousmediumflow/2p/implicit/test_box2p.input +++ b/test/porousmediumflow/2p/implicit/test_box2p.input @@ -1,4 +1,4 @@ -[TimeManager] +[TimeLoop] DtInitial = 250 # [s] TEnd = 3000 # [s] diff --git a/test/porousmediumflow/2p/implicit/test_cc2p.cc b/test/porousmediumflow/2p/implicit/test_cc2p.cc index 8f3b8c56336ef54173642a2d92f831ac2c5019a2..35e01822dece1b6187bd9376a49181ed3a446bfd 100644 --- a/test/porousmediumflow/2p/implicit/test_cc2p.cc +++ b/test/porousmediumflow/2p/implicit/test_cc2p.cc @@ -155,8 +155,8 @@ int main(int argc, char** argv) try auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); // the linear solver - using LinearSolver = typename GET_PROP_TYPE(TypeTag, LinearSolver); - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->elementMapper()); + using LinearSolver = Dumux::ILU0BiCGSTABBackend<TypeTag>; + auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver using NewtonController = typename GET_PROP_TYPE(TypeTag, NewtonController); diff --git a/test/porousmediumflow/2p/implicit/test_cc2p.input b/test/porousmediumflow/2p/implicit/test_cc2p.input index d6385b07db7486af09ca576eddf6d8a6465ba77b..c2dcf2f091b5a821eeacb1eadf32037ccadd392c 100644 --- a/test/porousmediumflow/2p/implicit/test_cc2p.input +++ b/test/porousmediumflow/2p/implicit/test_cc2p.input @@ -1,4 +1,4 @@ -[TimeManager] +[TimeLoop] DtInitial = 250 # [s] TEnd = 3000 # [s]