diff --git a/test/porousmediumflow/2p/implicit/CMakeLists.txt b/test/porousmediumflow/2p/implicit/CMakeLists.txt index bb9c0f8c03625659769e18c45b66c591ac5f32ef..58f07295b16e910c307b3e71ad6224d74451ee07 100644 --- a/test/porousmediumflow/2p/implicit/CMakeLists.txt +++ b/test/porousmediumflow/2p/implicit/CMakeLists.txt @@ -23,6 +23,9 @@ add_dumux_test(test_ccadaptive2p test_ccadaptive2p test_ccadaptive2p.cc ${CMAKE_CURRENT_BINARY_DIR}/lensccadaptive-00017.vtu --command "${CMAKE_CURRENT_BINARY_DIR}/test_ccadaptive2p") +add_dumux_test(test_boxadaptive2p test_boxadaptive2p test_boxadaptive2p.cc + ${CMAKE_CURRENT_BINARY_DIR}/test_boxadaptive2p) + add_dumux_test(test_generalizeddirichlet test_generalizeddirichlet test_generalizeddirichlet.cc python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py --script fuzzy diff --git a/test/porousmediumflow/2p/implicit/lensproblem.hh b/test/porousmediumflow/2p/implicit/lensproblem.hh index fd64d71f2293eba4f1f2f107401bd29b5fc0cfae..a17e557d7bf745db9e73fd8e11492e10fa0187f9 100644 --- a/test/porousmediumflow/2p/implicit/lensproblem.hh +++ b/test/porousmediumflow/2p/implicit/lensproblem.hh @@ -32,6 +32,7 @@ #include <dumux/porousmediumflow/implicit/problem.hh> #include <dumux/implicit/cellcentered/propertydefaults.hh> #include <dumux/porousmediumflow/2p/implicit/gridadaptindicator.hh> +#include <dumux/porousmediumflow/2p/implicit/adaptionhelper.hh> #include <dumux/implicit/adaptive/gridadaptinitializationindicator.hh> #include "lensspatialparams.hh" @@ -61,8 +62,9 @@ SET_TYPE_PROP(LensCCProblem, Grid, Dune::YaspGrid<2>); SET_TYPE_PROP(LensBoxProblem, Grid, Dune::YaspGrid<2>); #endif +SET_TYPE_PROP(LensBoxAdaptiveProblem, Grid, Dune::UGGrid<2>); + #if HAVE_DUNE_ALUGRID -SET_TYPE_PROP(LensBoxAdaptiveProblem, Grid, Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>); SET_TYPE_PROP(LensCCAdaptiveProblem, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); #endif @@ -97,10 +99,12 @@ SET_TYPE_PROP(LensBoxAdaptiveProblem, LinearSolver, ILU0BiCGSTABBackend<TypeTag> SET_BOOL_PROP(LensCCAdaptiveProblem, AdaptiveGrid, true); SET_TYPE_PROP(LensCCAdaptiveProblem, AdaptionIndicator, TwoPImplicitGridAdaptIndicator<TypeTag>); SET_TYPE_PROP(LensCCAdaptiveProblem, AdaptionInitializationIndicator, ImplicitGridAdaptInitializationIndicator<TypeTag>); +SET_TYPE_PROP(LensCCAdaptiveProblem, AdaptionHelper, TwoPAdaptionHelper<TypeTag>); SET_BOOL_PROP(LensBoxAdaptiveProblem, AdaptiveGrid, true); SET_TYPE_PROP(LensBoxAdaptiveProblem, AdaptionIndicator, TwoPImplicitGridAdaptIndicator<TypeTag>); -SET_TYPE_PROP(LensBoxAdaptiveProblem, AdaptionInitializationIndicator, ImplicitGridAdaptInitializationIndicator<TypeTag>); +//SET_TYPE_PROP(LensBoxAdaptiveProblem, AdaptionInitializationIndicator, ImplicitGridAdaptInitializationIndicator<TypeTag>); +SET_TYPE_PROP(LensBoxAdaptiveProblem, AdaptionHelper, TwoPAdaptionHelper<TypeTag>); #endif NEW_PROP_TAG(BaseProblem); @@ -364,6 +368,29 @@ public: } // \} + void addOutputVtkFields() + { + typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField; + + unsigned numElements = this->gridView().size(0); + ScalarField *isNew = this->resultWriter().allocateManagedBuffer(numElements); + ScalarField *gridLevel = this->resultWriter().allocateManagedBuffer(numElements); + + for (const auto& element : elements(this->gridView())) + { + if(element.partitionType() == Dune::InteriorEntity) + { + int eIdx = this->elementMapper().index(element); + + (*isNew)[eIdx] = element.isNew(); + (*gridLevel)[eIdx] = element.level(); + } + } + + this->resultWriter().attachCellData(*isNew, "isNew"); + this->resultWriter().attachCellData(*gridLevel, "gridLevel"); + } + private: bool onLeftBoundary_(const GlobalPosition &globalPos) const diff --git a/test/porousmediumflow/2p/implicit/lensspatialparams.hh b/test/porousmediumflow/2p/implicit/lensspatialparams.hh index 4a622dbfd6c82c92210208e54249cf4bff77db88..4f7e74f1be83c37e3b4308790868a00783685e8c 100644 --- a/test/porousmediumflow/2p/implicit/lensspatialparams.hh +++ b/test/porousmediumflow/2p/implicit/lensspatialparams.hh @@ -131,7 +131,7 @@ public: const FVElementGeometry &fvGeometry, int scvIdx) const { - const GlobalPosition& globalPos = fvGeometry.subContVol[scvIdx].global; + const GlobalPosition& globalPos = element.geometry().center(); if (isInLens_(globalPos)) return lensK_; @@ -163,8 +163,8 @@ public: { const GlobalPosition& globalPos = fvGeometry.subContVol[scvIdx].global; - if (isInLens_(globalPos)) - return lensMaterialParams_; +// if (isInLens_(globalPos)) +// return lensMaterialParams_; return outerMaterialParams_; } diff --git a/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input b/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input index 0641558f9fcdace6eb2a98c639f14c9768af9f4c..15a3d8dba91e951b94ef731f4d3bf547ebed9d1c 100644 --- a/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input +++ b/test/porousmediumflow/2p/implicit/test_boxadaptive2p.input @@ -5,7 +5,10 @@ TEnd = 3000 # [s] [Grid] LowerLeft = 0 0 UpperRight = 6 4 -Cells = 48 32 +#Cells = 48 32 +Cells = 24 16 +Refinement = 2 +CellType = Cube [SpatialParams] LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner diff --git a/test/porousmediumflow/2p/implicit/test_cc2p.input b/test/porousmediumflow/2p/implicit/test_cc2p.input index e2162947fd7523df56c65269cadf1bd516db18d4..1a724c827b402e627807ddbce432e8511ef44502 100644 --- a/test/porousmediumflow/2p/implicit/test_cc2p.input +++ b/test/porousmediumflow/2p/implicit/test_cc2p.input @@ -1,11 +1,11 @@ [TimeManager] -DtInitial = 250 # [s] -TEnd = 3000 # [s] +DtInitial = 1.0e2 # [s] +TEnd = 1.0e8 # [s] [Grid] LowerLeft = 0 0 -UpperRight = 6 4 -Cells = 48 32 +UpperRight = 100 100 +Cells = 100 100 [SpatialParams] LensLowerLeftX = 1.0 # [m] x-coordinate of the lower left lens corner @@ -14,8 +14,11 @@ LensUpperRightX = 4.0 # [m] x-coordinate of the upper right lens corner LensUpperRightY = 3.0 # [m] y-coordinate of the upper right lens corner [Problem] -Name = lenscc # name passed to the output routines +Name = FiveSpot # name passed to the output routines +InjectionRate = 1.5e-3 +InjectionRadius = 5.0 + [Implicit] -EnablePartialReassemble = 1 # enable partial reassembly of the jacobian matrix? -EnableJacobianRecycling = 1 # Enable reuse of jacobian matrices? +EnablePartialReassemble = 0 # enable partial reassembly of the jacobian matrix? +EnableJacobianRecycling = 0 # Enable reuse of jacobian matrices?