Skip to content
Snippets Groups Projects
Commit 3615ed59 authored by Timo Koch's avatar Timo Koch
Browse files

Update README.md propertrires

parent 4b7debd6
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<br> <br>
## Problem set-up ## Problem set-up
The problem setup is identical to the previous [_exercise 1_](../ex1/README.md). The problem setup is identical to the previous [_Exercise Basic_](../exercise-basic/README.md).
## Preparing the exercise ## Preparing the exercise
* Navigate to the directory `dumux/tutorial/ex2` * Navigate to the directory `exercise-properties`
_Exercise 2_ deals with a two-phase compositional problem (__2p2c__). Goal is to learn how to use compile and runtime parameters and the _DuMuX property system_. _Exercise 2_ deals with a two-phase compositional problem (__2p2c__). Goal is to learn how to use compile and runtime parameters and the _DuMu<sup>x</sup> property system_.
<br><br> <br><br>
### Task 1: Getting familiar with the code ### Task 1: Getting familiar with the code
...@@ -31,19 +31,19 @@ Locate all the files you will need for this exercise ...@@ -31,19 +31,19 @@ Locate all the files you will need for this exercise
* Change to the build-directory * Change to the build-directory
```bash ```bash
cd ../../build-cmake/tutorial/ex2 cd ../build-cmake/exercise_properties
``` ```
* Compile the executable `exercise2` * Compile the executable `exercise_properties`
```bash ```bash
make exercise2 make exercise_properties
``` ```
* Run the problem and inspect the result * Run the problem and inspect the result
```bash ```bash
./exercise2 ./exercise_properties
``` ```
Note: Because the input file has the same name as the Note: Because the input file has the same name as the
executable, DuMuX will find it automatically. executable, DuMuX will find it automatically.
...@@ -72,7 +72,7 @@ const auto pe = params.pe(); ...@@ -72,7 +72,7 @@ const auto pe = params.pe();
The type (i.e. C++ type) of the material law is set in the file `injection2p2cspatialparams.hh` by declaring the following alias in the public section of the spatial parameters class: The type (i.e. C++ type) of the material law is set in the file `injection2p2cspatialparams.hh` by declaring the following alias in the public section of the spatial parameters class:
```c++ ```c++
using MaterialLaw = EffToAbsLaw<RegularizedBrooksCorey<Scalar>>; using MaterialLaw = EffToAbsLaw<RegularizedBrooksCorey<Scalar>>;
``` ```
* Make DuMuX use your own material law by including the header `mymateriallaw.hh` and changing the alias `MaterialLaw`. This will make sure that your material law is used everywhere else in the code. * Make DuMuX use your own material law by including the header `mymateriallaw.hh` and changing the alias `MaterialLaw`. This will make sure that your material law is used everywhere else in the code.
...@@ -90,25 +90,7 @@ OnlyPlotMaterialLaws = false ...@@ -90,25 +90,7 @@ OnlyPlotMaterialLaws = false
``` ```
<hr><br><br> <hr><br><br>
### Task 4: Enable/Disable Gravity -> DuMuX parameters ### Task 4: Implement a custom local residual
<hr>
DuMuX has many parameters that have default values. For example, all simulations consider gravity effects by default.
You can disable gravity for a study, simply by setting the parameter in the input file
```ini
[Problem]
EnableGravity = false
```
Run the simulation with and without gravity. Change the `Problem.Name` parameter to create output files with different
names. Compare the results using paraview. You should immediately see the difference.
A list of parameters that can be set through the input file is given [here](http://www.dumux.org/doxygen-stable/html-2.11/a06387.php).
<hr><br><br>
### Task 5: Implement your own local residual
<hr> <hr>
Most types in DuMuX are properties that can be changed just like the material law. In the following task we implement our own 2p2c local residual, i.e. the class that computes the element residual in every Newton iteration. The file `mylocalresidual.hh` contains a copy of the similar to the original local residual class used for all compositional models renamed to `template<class TypeTag> class MyCompositionalLocalResidual`. Most types in DuMuX are properties that can be changed just like the material law. In the following task we implement our own 2p2c local residual, i.e. the class that computes the element residual in every Newton iteration. The file `mylocalresidual.hh` contains a copy of the similar to the original local residual class used for all compositional models renamed to `template<class TypeTag> class MyCompositionalLocalResidual`.
...@@ -133,7 +115,7 @@ You want to make the new local residual special by adding a switch enabling / di ...@@ -133,7 +115,7 @@ You want to make the new local residual special by adding a switch enabling / di
```c++ ```c++
// ... in the computeFlux method of MyCompositionalLocalResidual // ... in the computeFlux method of MyCompositionalLocalResidual
auto enableDiffusion = getParam<bool>("Problem.EnableDiffusion", true); auto enableDiffusion = getParam<bool>("Problem.EnableDiffusion", true);
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment