Skip to content
Snippets Groups Projects

Exercise Basics (DuMuX course)


## 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).

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_2) and the 2p model assumes an immiscible fluid state.



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 and exercise_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 to exercise_basic_2pni.cc
  • In exercise_basic_2pni.cc, include the header injection2pniproblem.hh instead of injection2pproblem.hh.
  • In exercise_basic_2pni.cc, change Injection2pCC to Injection2pNICC in the line using 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 the injection2pproblem.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.