Exercise Basics (DuMuX course)
## Problem set-up
N

Preparing the exercise
- Navigate to the directory
dumux-course/exercises/exercise-basic
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
Task 1: Getting familiar with the code
Locate all the files you will need for this exercise
- The main file for the 2p problem :
exercise_basic_2p.cc
- The main file for the 2p2c problem :
exercise_basic_2p2c.cc
- 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
- The shared input file:
exercise_basic.input
### Task 2: Compiling and running an executable
- Change to the build-directory
cd ../../build-cmake/exercises/exercise-basic
- Compile both executables
exercise_basic_2p
andexercise_basic_2p2c
make exercise_basic_2p exercise_basic_2p2c
- Execute the two problems and inspect the result
./exercise_basic_2p exercise_basic.input
./exercise_basic_2p2c exercise_basic.input
- you can look at the results with paraview
paraview injection-2p2c.pvd
### Task 3: Setting up a new executable (for a non-isothermal simulation)
- Copy the main file
exercise_basic_2p.cc
and rename it toexercise_basic_2pni.cc
- In
exercise_basic_2pni.cc
, include the headerinjection2pniproblem.hh
instead ofinjection2pproblem.hh
. - In
exercise_basic_2pni.cc
, changeInjection2pCC
toInjection2pNICC
in the lineusing TypeTag = Properties::TTag::Injection2pNICC;
- Add a new executable in
CMakeLists.txt
by adding the lines
# the two-phase non-isothermal simulation program
dune_add_test(NAME exercise_basic_2pni
SOURCES exercise_basic_2pni.cc
CMD_ARGS exercise_basic.input)
- Test that everything compiles without error
make # should rerun cmake
make exercise_basic_2pni # builds new executable
### Task 4: Setting up a non-isothermal __2pni__ test problem
- Open the file
injection2pniproblem.hh
. It is a copy of theinjection2pproblem.hh
with some useful comments on how to implement a non-isothermal model. Look for comments containing
// TODO: dumux-course-task
-
The following set-up should be realized:
Boundary conditions: Dirichlet conditions for the temperature with a temperature gradient of 0.03 K/m and a starting temperature of 283 K.
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.

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