Exercise Grids (DuMuX course)
Problem set-up
Here we will expand on what we've covered in the basics exercise, and the problem set up will remain the same.
Preparing the exercise
- Navigate to the directory
dumux-course/exercises/exercise-grids/
We'll be editing the following files during this exercise:
- The input file:
params.input
, - the problem file:
problem.hh
, - and the properties file:
properties.hh
.
Currently our grid is defined using the following input parameters in the input file:
[Grid]
UpperRight = 60 40
Cells = 24 16
The upper right point of our domain is defined using the first parameter, and all directions are split into a number of equally sized cells defined by the second parameter.
As you may have noticed, the resolution of our grid isn't quite optimal. A finer grid could help to show a more realistic picture of the physics.
Task 1: Applying a Global Refinement
A simple strategy for addressing this resolution issue would be a global refinement.
In the [Grid]
section of your input file, you can add a parameter Refinement
.
This will apply a global refinement to the grid you provided. A refinement of value 2 will split each cell into two cells per dimension.
-
Task 1: Apply a global refinement of value 2. Make note of the increase in simulation run time.
The simulation should take much more time. Luckily there are other ways to resolve your grid that will not be as computationally expensive.
Task 2: Changing the Grid Type
Up until now, we have used a basic uniform structured grid. This grid is provided in the Dune environment and is called the YASP grid (Yet Another Structured Parallel Grid).
In the properties file (properties.hh
), the grid properties are defined using the following command.
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; };