Ned Coltman committed Jul 17, 2018 1 # Exercise Basics (DuMuX course)  Timo Koch committed Jul 09, 2018 2 3 4 5 6 7 
## 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 committed Jul 13, 2018 8   Timo Koch committed Jul 09, 2018 9 10 11  ## Preparing the exercise  Theresa Schollenberger committed Jul 12, 2018 12 * Navigate to the directory dumux-course/exercises/exercise-basic  Timo Koch committed Jul 09, 2018 13   Theresa Schollenberger committed Jul 13, 2018 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.  Timo Koch committed Jul 09, 2018 15 16 17 18 19 20 

### Task 1: Getting familiar with the code
Locate all the files you will need for this exercise  21 22 * The __main file__ for the __2p__ problem : exercisebasic2p.cc * The __main file__ for the __2p2c__ problem : exercisebasic2p2c.cc  Timo Koch committed Jul 09, 2018 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  Theresa Schollenberger committed Feb 19, 2019 26 * The shared __input file__: params.input  Timo Koch committed Jul 09, 2018 27   Felix Weinhardt committed Dec 14, 2018 28 

 Timo Koch committed Jul 09, 2018 29 30 31 32 33 34 ### Task 2: Compiling and running an executable
* Change to the build-directory bash  Theresa Schollenberger committed Jul 12, 2018 35 cd ../../build-cmake/exercises/exercise-basic  Timo Koch committed Jul 09, 2018 36 37   Theresa Schollenberger committed Jul 13, 2018 38 * Compile both executables exercise_basic_2p and exercise_basic_2p2c  Timo Koch committed Jul 09, 2018 39 40  bash  Theresa Schollenberger committed Jul 13, 2018 41 make exercise_basic_2p exercise_basic_2p2c  Timo Koch committed Jul 09, 2018 42 43 44 45 46  * Execute the two problems and inspect the result bash  Theresa Schollenberger committed Feb 19, 2019 47 48 ./exercise_basic_2p params.input ./exercise_basic_2p2c params.input  Timo Koch committed Jul 09, 2018 49 50 51 52 53 54 55 56  * you can look at the results with paraview bash paraview injection-2p2c.pvd   Felix Weinhardt committed Dec 14, 2018 57 

 Theresa Schollenberger committed Jul 12, 2018 58 ### Task 3: Setting up a new executable (for a non-isothermal simulation)  Timo Koch committed Jul 09, 2018 59 60 
 Theresa Schollenberger committed Jul 13, 2018 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 committed Dec 19, 2018 63 * In exercise_basic_2pni.cc, change Injection2pCC to Injection2pNICC in the line using TypeTag = Properties::TTag::Injection2pNICC;  Timo Koch committed Jul 09, 2018 64 65 66 67 * Add a new executable in CMakeLists.txt by adding the lines cmake # the two-phase non-isothermal simulation program  Theresa Schollenberger committed Jul 13, 2018 68 dune_add_test(NAME exercise_basic_2pni  Theresa Schollenberger committed Feb 19, 2019 69  SOURCES exercise_basic_2pni.cc)  Timo Koch committed Jul 09, 2018 70 71 72 73 74 75  * Test that everything compiles without error bash make # should rerun cmake  Theresa Schollenberger committed Jul 13, 2018 76 make exercise_basic_2pni # builds new executable  Timo Koch committed Jul 09, 2018 77 78   Felix Weinhardt committed Dec 14, 2018 79 

 Theresa Schollenberger committed Jul 12, 2018 80 ### Task 4: Setting up a non-isothermal __2pni__ test problem  Timo Koch committed Jul 09, 2018 81 82 83 84 85 86 87 88 89 90 
* 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:  Melanie Lipp committed Apr 30, 2019 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}$.  Timo Koch committed Jul 09, 2018 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 committed Jul 13, 2018 95   Timo Koch committed Jul 09, 2018 96   Maren Mittelbach committed Feb 12, 2019 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.