Skip to content
Snippets Groups Projects
Commit b94dfa12 authored by Sina Ackermann's avatar Sina Ackermann Committed by Katharina Heck
Browse files

[2pinfiltration] Update README.md

parent 00bba52d
No related branches found
No related tags found
1 merge request!1547[examples] Set up problem for documentation (2p, adaptive, point source)
...@@ -48,13 +48,27 @@ The following headers need to be included in the main file: ...@@ -48,13 +48,27 @@ The following headers need to be included in the main file:
``` ```
The grid adaptation is prepared during the initialization by the following steps: The grid adaptation is prepared during the initialization by the following steps:
* instantiate indicator & data transfer, read parameters for indicator (ll. 111-115) 1. **Instantiate indicator (l. 114):**
* do initial refinement around sources/BCs (l. 118) The indicator is saturation-dependent and defined in the file dumux/porousmediumflow/2p/gridadaptindicator.hh.
* refine up to the maximum level (ll. 121-137) It allows to set the minimum and maximum allowed refinement levels via the input parameters
* do refinement for the initial conditions using the indicator (ll. 140-144) `Adaptive.MinLevel` and `Adaptive.MaxLevel`.
* update grid data after adaption (ll. 147-152) 2. **Instantiate data transfer (l. 154):**
The data transfer performs the transfer of data on a grid from before to after adaptation and is defined in the
file dumux/porousmediumflow/2p/griddatatransfer.hh.
Its main functions are to store and reconstruct the primary variables.
3. **Set the indicator for the initial refinement around sources/BCs (l. 118):**
We use the GridAdaptInitializationIndicator defined in dumux/adaptive/initializationindicator.hh.
4. **Refine up to the maximum level (ll. 121-137):**
For every level, the indicator used for the refinement/coarsening is calculated.
If any grid cells have to be adapted, the gridvariables and the pointsourcemap are updated.
5. **Do refinement for the initial conditions using the indicator (ll. 140-144):**
Depending on the initial conditions, another grid adaptation might be necessary.
The gridadaptindicator uses the input parameters `Adaptive.RefineTolerance` and `Adaptive.CoarsenTolerance` for this step.
For further details on the indicator calculations see dumux/porousmediumflow/2p/gridadaptindicator.hh, ll. 116.
Afterwards, the marked elements are adapted.
6. **Update grid data after adaption (ll. 147-152):**
In case of a grid adaptation, the gridvariables and the pointsourcemap are updated.
The indicator ...
During the time loop, the refinement indicator is computed (l. 191) and the respective elements to be refined are marked (ll. 194-196). During the time loop, the refinement indicator is computed (l. 191) and the respective elements to be refined are marked (ll. 194-196).
...@@ -68,16 +82,22 @@ In case of grid adaptation, the following updates are necessary (ll. 201-205): ...@@ -68,16 +82,22 @@ In case of grid adaptation, the following updates are necessary (ll. 201-205):
``` ```
### problem.hh ### problem.hh
... A non-conforming grid such as ALUGrid has to be chosen in the problem file:
```C++
//! Use non-conforming refinement
template<class TypeTag>
struct Grid<TypeTag, TTag::TwoPAdaptivePointSource> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; };
```
### params.input ### params.input
The following parameters in the `[Adaptive]` parameter group determine the grid adaptation behavior: The following parameters in the `[Adaptive]` parameter group determine the grid adaptation behavior:
* `RefineAtDirichletBC`: ... * `RefineAtDirichletBC`: If to refine at Dirichlet boundaries
* `RefineAtFluxBC`: ... * `RefineAtFluxBC`: If to refine at Neumann/Robin boundaries
* `MinLevel`: ... * `MinLevel`: Minimum allowed refinement level, used by the indicators
* `MaxLevel`: ... * `MaxLevel`: Maximum allowed refinement level, used by the indicators
* `CoarsenTolerance`: ... * `CoarsenTolerance`
* `RefineTolerance`: ... * `RefineTolerance`
## Solution ## Solution
![](test_2p_pointsource_adaptive.png) ![](test_2p_pointsource_adaptive.png)
......
...@@ -54,13 +54,8 @@ namespace Dumux { ...@@ -54,13 +54,8 @@ namespace Dumux {
} // end namespace TTag } // end namespace TTag
//! Use non-conforming refinement //! Use non-conforming refinement
#if HAVE_DUNE_ALUGRID
template<class TypeTag> template<class TypeTag>
struct Grid<TypeTag, TTag::TwoPAdaptivePointSource> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; struct Grid<TypeTag, TTag::TwoPAdaptivePointSource> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; };
#else
template<class TypeTag>
struct Grid<TypeTag, TTag::TwoPAdaptivePointSource> { using type = Dune::YaspGrid<2>; };
#endif
template<class TypeTag> template<class TypeTag>
struct Problem<TypeTag, TTag::TwoPAdaptivePointSource> { using type = PointSourceTestProblem<TypeTag>; }; struct Problem<TypeTag, TTag::TwoPAdaptivePointSource> { using type = PointSourceTestProblem<TypeTag>; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment