Skip to content
Snippets Groups Projects
Commit af4067a4 authored by Gabi Seitz's avatar Gabi Seitz
Browse files

[exercise-fluidsystem] naming conventions and remove line reference in README.md

parent 0c626ffb
No related branches found
No related tags found
1 merge request!77Towards a more consistent DUMUX course for version 3.1
# executables for exercise part a & b # executables for exercise part a & b
#part a: 2pproblem #part a: 2pproblem
dune_add_test(NAME exercise_fluidsystem_a dune_add_test(NAME exercise_fluidsystem_a
SOURCES exercisefluidsystem.cc SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP
COMPILE_ONLY) # for testing purposes, ignore for the exercise COMPILE_ONLY) # for testing purposes, ignore for the exercise
#part b: 2p2cproblem #part b: 2p2cproblem
dune_add_test(NAME exercise_fluidsystem_b dune_add_test(NAME exercise_fluidsystem_b
SOURCES exercisefluidsystem.cc SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC
COMPILE_ONLY) # for testing purposes, ignore for the exercise COMPILE_ONLY) # for testing purposes, ignore for the exercise
......
...@@ -17,10 +17,10 @@ The domain has a size of 60 x 60 m and contains two low-permeable lenses. Initia ...@@ -17,10 +17,10 @@ The domain has a size of 60 x 60 m and contains two low-permeable lenses. Initia
### 1. Getting familiar with the code ### 1. Getting familiar with the code
Locate all the files you will need for this exercise Locate all the files you will need for this exercise
* The shared __main file__ : `exercisefluidsystem.cc` * The shared __main file__ : `main.cc`
* The __input file__ for part a: `exercise_fluidsystem_a.input` * The __input file__ for part a: `aparams.input`
* The __problem file__ for part a: `2pproblem.hh` * The __problem file__ for part a: `2pproblem.hh`
* The __input file__ for part b: `exercise_fluidsystem_b.input` * The __input file__ for part b: `bparams.input`
* The __problem file__ for part b: `2p2cproblem.hh` * The __problem file__ for part b: `2p2cproblem.hh`
* The __spatial parameters file__: `spatialparams.hh` * The __spatial parameters file__: `spatialparams.hh`
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
### 2.1. Incompressible component ### 2.1. Incompressible component
Open the file `myincompressiblecomponent.hh`. You can see in line 42 that a component should always derive from the _Base_ class (see `dumux/material/components/base.hh`), which defines the interface of a _DuMuX_ component with possibly required functions to be overloaded by the actual implementation. Additionally it is required for liquids to derive from the _Liquid_ class (see `dumux/material/components/liquid.hh`), for gases to derive from the _Gas_ class (see `dumux/material/components/gas.hh`) and for solids to derive from the _Solid_ class (see `dumux/material/components/solid.hh`), with functions specific to liquid, gas or solid. Open the file `myincompressiblecomponent.hh`. A component should always derive from the _Base_ class - thus we include `dumux/material/components/base.hh`-, which defines the interface of a _DuMuX_ component with possibly required functions to be overloaded by the actual implementation. Additionally it is required for liquids to derive from the _Liquid_ class (see `dumux/material/components/liquid.hh`), for gases to derive from the _Gas_ class (see `dumux/material/components/gas.hh`) and for solids to derive from the _Solid_ class (see `dumux/material/components/solid.hh`), with functions specific to liquid, gas or solid.
```c++ ```c++
/*! /*!
...@@ -151,7 +151,7 @@ In order to execute the program, change to the build directory and compile and e ...@@ -151,7 +151,7 @@ In order to execute the program, change to the build directory and compile and e
```bash ```bash
cd build-cmake/exercises/exercise-fluidsystem cd build-cmake/exercises/exercise-fluidsystem
make exercise_fluidsystem_a make exercise_fluidsystem_a
./exercise_fluidsystem_a exercise_fluidsystem_a.input ./exercise_fluidsystem_a aparams.input
``` ```
The saturation distribution of the nonwetting phase S$`_n`$ (the phase consisting of our fictitious incompressible component) at the final simulation time should look like this: The saturation distribution of the nonwetting phase S$`_n`$ (the phase consisting of our fictitious incompressible component) at the final simulation time should look like this:
...@@ -168,7 +168,7 @@ where $`p`$ is the pressure and $`\rho_{min} = 1440 `$, $`\rho_{max} = 1480 `$ a ...@@ -168,7 +168,7 @@ where $`p`$ is the pressure and $`\rho_{min} = 1440 `$, $`\rho_{max} = 1480 `$ a
![](../extradoc/exercise-fluidsystem_a_solution2.png) ![](../extradoc/exercise-fluidsystem_a_solution2.png)
You can plot the density of the phase consisting of your compressible component by setting `PlotDensity` in `exercise_fluidsystem_a.input` to `true` and starting the simulation again. You can plot the density of the phase consisting of your compressible component by setting `PlotDensity` in `aparams.input` to `true` and starting the simulation again.
Compare the gnuplot output to the following plot of the density function from above: Compare the gnuplot output to the following plot of the density function from above:
![](../extradoc/exercise-fluidsystem_a_densityfunction.png) ![](../extradoc/exercise-fluidsystem_a_densityfunction.png)
...@@ -229,7 +229,7 @@ Implement this dependency in the `density()` method in the fluid system. In orde ...@@ -229,7 +229,7 @@ Implement this dependency in the `density()` method in the fluid system. In orde
```bash ```bash
cd build-cmake/exercises/exercise-fluidsystem cd build-cmake/exercises/exercise-fluidsystem
make exercise_fluidsystem_b make exercise_fluidsystem_b
./exercise_fluidsystem_b exercise_fluidsystem_b.input ./exercise_fluidsystem_b bparams.input
``` ```
You will observe an error message and an abortion of the program. This is due to the fact that in order for the constraint solver and other mechanisms in the two-phase two-component model to work, an additional functionality in the component has to be implemented: the model has to know the vapour pressure. As in the previous exercise, check the `dumux/material/components/base.hh` file for this function and implement it into `mycompressiblecomponent.hh`. For the vapour pressure, use a value of $`3900`$ Pa. You will observe an error message and an abortion of the program. This is due to the fact that in order for the constraint solver and other mechanisms in the two-phase two-component model to work, an additional functionality in the component has to be implemented: the model has to know the vapour pressure. As in the previous exercise, check the `dumux/material/components/base.hh` file for this function and implement it into `mycompressiblecomponent.hh`. For the vapour pressure, use a value of $`3900`$ Pa.
......
# executables for exercise part a & b # executables for exercise part a & b
#part a: 2pproblem #part a: 2pproblem
dune_add_test(NAME exercise_fluidsystem_a_solution dune_add_test(NAME exercise_fluidsystem_a_solution
SOURCES exercisefluidsystem.cc SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP) COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP)
#part b: 2p2cproblem #part b: 2p2cproblem
dune_add_test(NAME exercise_fluidsystem_b_solution dune_add_test(NAME exercise_fluidsystem_b_solution
SOURCES exercisefluidsystem.cc SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC) COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC)
# add exercises to the common target # add exercises to the common target
......
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