Skip to content
Snippets Groups Projects
README.md 2.57 KiB
Newer Older
Timo Koch's avatar
Timo Koch committed
# Exercise Properties (DuMuX course)
<br>
## Problem set-up

The problem setup is identical to the two-phase incompressible test from DuMu<sup>x</sup>.

## Preparing the exercise

* Navigate to the directory `exercise-properties`
_Exercise Properties_ deals with a two-phase immiscible incompressible problem (__2p__). The goal is to learn how to adapt compile-time parameters by employing the _DuMu<sup>x</sup> property system_.

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

Locate all the files you will need for this exercise
Timo Koch's avatar
Timo Koch committed
* The __main file__: `exercise_properties.cc`
* The __problem file__: `problem.hh`
* The __spatial parameters file__: `spatialparams.hh`
Timo Koch's avatar
Timo Koch committed
* The __input file__: `exercise_properties.input`
* One header file containing:
  * a custom __local residual__ in: `mylocalresidual.hh`


<hr><br><br>
### Task 2: Compiling and running the program
<hr>

* Change to the build-directory

```bash
cd ../build-cmake/exercises/exercise_properties
* Compile the executable `exercise_properties`
make exercise_properties
```

* Run the problem and inspect the result

```bash
./exercise_properties
```
Note: Because the input file has the same name as the
executable, DuMu<sup>x</sup> will find it automatically.
Bernd Flemisch's avatar
Bernd Flemisch committed

<hr><br><br>
Felix Weinhardt's avatar
Felix Weinhardt committed
### Task 3: Implement a custom local residual
Bernd Flemisch's avatar
Bernd Flemisch committed
<hr>

Types that are properties can be changed on the problem level by using the property system. In the following task we implement our own 2p local residual, i.e. the class that computes the element residual  in every Newton iteration. The file `mylocalresidual.hh` contains a copy of the original local residual class used for all immiscible models renamed to `template<class TypeTag> class MyLocalResidual`.
* Make DuMu<sup>x</sup> use this new local residual by including the header `mylocalresidual.hh` and setting the corresponding property in the `Property` namespace in the file `problem.hh`
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::TwoPIncompressible>
    using type = MyLocalResidual<TypeTag>;
Bernd Flemisch's avatar
Bernd Flemisch committed
Simplify the original local residual by using the assumption that only incompressible fluid phases are present. As a consequence, one can balance phase volume instead of phase mass:
* Eliminate the density from the `computeStorage` and the `computeFlux` methods.
Bernd Flemisch's avatar
Bernd Flemisch committed
* Adapt the relevant routine in the problem file such that volume instead of mass is injected. The density of the employed NAPL is 1460 kg/m^3 . For a first try, you can use the hardcoded value.
* Generalize your approach by using the component's `liquidDensity(t, p)` function instead of the hardcoded value.
Bernd Flemisch's avatar
Bernd Flemisch committed