README.md 3.81 KB
Newer Older
Ned Coltman's avatar
Ned Coltman committed
1
# Exercise Basics (DuMuX course)
2
3
4
5
6
7
<br>
## Problem set-up

N$`_2`$ is injected in an aquifer previously saturated with water with an injection rate of 0.0001 kg/(s*m$`^2`$).
The aquifer is situated 2700 m below sea level and the domain size is 60 m x 40 m. It consists of two layers, a moderately permeable one ($`\Omega_1`$) and a lower permeable one ($`\Omega_2`$).

Katharina Heck's avatar
Katharina Heck committed
8
<img src="https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/master/exercises/extradoc/exercise1_setup.png" width="1000">
9
10
11

## Preparing the exercise

12
* Navigate to the directory `dumux-course/exercises/exercise-basic`
13

14
This exercise deals with two problems: a two-phase immiscible problem (__2p__) and a two-phase compositional problem (__2p2c__). They both set up the same scenario with the difference that the 2p2c assumes a miscible fluid state for the two fluids (water and gaseous N$`_2`$) and the 2p model assumes an immiscible fluid state.
15
16
17
18
19
20

<br><br>
### Task 1: Getting familiar with the code
<hr>

Locate all the files you will need for this exercise
21
22
* The __main file__ for the __2p__ problem : `exercise_basic_2p.cc`
* The __main file__ for the __2p2c__ problem : `exercise_basic_2p2c.cc`
23
24
25
* The __problem file__ for the __2p__ problem: `injection2pproblem.hh`
* The __problem file__ for the __2p2c__ problem: `injection2p2cproblem.hh`
* The shared __spatial parameters file__: `injection2pspatialparams.hh`
26
* The shared __input file__: `params.input`
27

Felix Weinhardt's avatar
Felix Weinhardt committed
28
<hr><br>
29
30
31
32
33
34
### Task 2: Compiling and running an executable
<hr>

* Change to the build-directory

```bash
35
cd ../../build-cmake/exercises/exercise-basic
36
37
```

38
* Compile both executables `exercise_basic_2p` and `exercise_basic_2p2c`
39
40

```bash
41
make exercise_basic_2p exercise_basic_2p2c
42
43
44
45
46
```

* Execute the two problems and inspect the result

```bash
47
48
./exercise_basic_2p params.input
./exercise_basic_2p2c params.input
49
50
51
52
53
54
55
56
```

* you can look at the results with paraview

```bash
paraview injection-2p2c.pvd
```

Felix Weinhardt's avatar
Felix Weinhardt committed
57
<hr><br>
58
### Task 3: Setting up a new executable (for a non-isothermal simulation)
59
60
<hr>

61
62
* Copy the main file `exercise_basic_2p.cc` and rename it to `exercise_basic_2pni.cc`
* In  `exercise_basic_2pni.cc`, include the header `injection2pniproblem.hh` instead of `injection2pproblem.hh`.
Felix Weinhardt's avatar
Felix Weinhardt committed
63
* In  `exercise_basic_2pni.cc`, change `Injection2pCC` to `Injection2pNICC` in the line `using TypeTag = Properties::TTag::Injection2pNICC;`
64
65
66
67
* Add a new executable in `CMakeLists.txt` by adding the lines

```cmake
# the two-phase non-isothermal simulation program
68
dune_add_test(NAME exercise_basic_2pni
69
              SOURCES exercise_basic_2pni.cc)
70
71
72
73
74
75
```

* Test that everything compiles without error

```bash
make # should rerun cmake
76
make exercise_basic_2pni # builds new executable
77
78
```

Felix Weinhardt's avatar
Felix Weinhardt committed
79
<hr><br>
80
### Task 4: Setting up a non-isothermal __2pni__ test problem
81
82
83
84
85
86
87
88
89
90
<hr>

* Open the file `injection2pniproblem.hh`. It is a copy of the `injection2pproblem.hh` with some useful comments on how to implement a non-isothermal model. Look for comments containing

```c++
// TODO: dumux-course-task
```

* The following set-up should be realized:

91
  __Boundary conditions:__ Dirichlet conditions for the temperature with a varying temperature of $`\displaystyle T(y) = 283~\text{K} + 0.03~\frac{\text{K}}{\text{m}} \cdot \left( d_\text{aquifer} - y \right) `$, with the aquifer depth $`\displaystyle d_\text{aquifer}=2700~\text{m}`$.
92
93
94

  __Initial conditions:__ The same temperature gradient as in the boundary conditions with an additional lens (with position: 20 < x < 30, 5 < y < 35), which has an initial temperature of 380 K.

Katharina Heck's avatar
Katharina Heck committed
95
<img src="https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/raw/master/exercises/extradoc/exercise1_nonisothermal.png" width="800">
96

97
The non-isothermal model requires additional parameters like the thermal conductivity of the solid component. They are already implemented and set in `params.input`, you just need to _uncomment_ them.