Commit 743745be authored by Beatrix Becker's avatar Beatrix Becker
Browse files

[ex-fluidsysten] cleanup, right paths for executables, rename exercise solution folder

parent 88f1cb50
......@@ -58,7 +58,7 @@ while the `BoxModel` _TypeTag_ can be found in the `box/properties.hh` header:
For a cell-centered scheme, you could derive from `CCTpfaModel` or `CCMpfaModel` instead (and, of course, include the right headers).
As one phase we want to use water and we want to precompute tables on which the properties are then interpolated in order to save computational time. Thus, in a first step we have to include the following headers:
As one of the two phases we want to use water and we want to precompute tables on which the properties are then interpolated in order to save computational time. Thus, in a first step we have to include the following headers:
```c++
// The water component
......@@ -88,7 +88,7 @@ This fluid system expects __phases__ as input and so far we have only included t
```
which creates a _liquid phase_ from a given component. Finally, using all of the included classes we set the fluid system property by choosing that
the water phase is liquid (OnePLiquid) and consists of tabulated water, and
the water phase is liquid (OnePLiquid) and consists of the tabulated water component, and
the other phase is liquid as well and consists of the incompressible fictitious component. Both will make up the immiscible fluid system (TwoPImmiscible):
......@@ -144,7 +144,7 @@ In order to do so, have a look at the files `dumux/material/components/base.hh`
In order to execute the program, change to the build directory and compile and execute the program by typing
```bash
cd build-cmake/tutorial/ex3
cd build-cmake/exercises/exercise-fluidsystem
make exercise3_a
./exercise3_a exercise3_a.input
```
......@@ -159,13 +159,14 @@ We now want to implement a pressure-dependent density for our component. Open th
$`\displaystyle \rho_{MyComp} = \rho_{min} + \frac{ \rho_{max} - \rho_{min} }{ 1 + \rho_{min}*e^{-1.0*k*(\rho_{max} - \rho_{min})*p} } `$
where $`p`$ is the pressure and $`\rho_{min} = 1440 `$, $`\rho_{max} = 1480 `$ and $`k = 5 \cdot 10^{-7} `$. Also, make sure the header is included in the `2pproblem.hh` file by uncommenting line 45. Furthermore, the new component has to be set as the non-wetting phase in the fluid system, i.e. comment line 90 and uncomment line 91. The non-wetting density distribution at the final simulation time should look like this:
where $`p`$ is the pressure and $`\rho_{min} = 1440 `$, $`\rho_{max} = 1480 `$ and $`k = 5 \cdot 10^{-7} `$. Also, make sure the header is included in the `2pproblem.hh` file by uncommenting line 45. Furthermore, the new component has to be set as a liquid phase in the fluid system, i.e. comment line 90 and uncomment line 91. The density distribution of this phase (rhoN) at the final simulation time should look like this:
![](../extradoc/exercise3_a_solution2.png)
### 3. Implement a new fluid system
The problem file for this part of the exercise is `2p2cproblem.hh`. We now want to implement a new fluid system consisting of two liquid phases, which are water and the previously implemented compressible component. We will consider compositional effects, which is why we now have to derive our _TypeTag_ (`ExerciseThreeBoxTwoPTwoCTypeTag`) from a _TypeTag_ (`ExerciseThreeTwoPTwoCTypeTag`) that derives from the `TwoPTwoC` model _TypeTag_:
The problem file for this part of the exercise is `2p2cproblem.hh`. We now want to implement a new fluid system consisting of two liquid phases, which are water and the previously implemented compressible component. We will consider compositional effects, which is why we now have to derive our _TypeTag_ (`ExerciseThreeTwoPTwoCTypeTag`) from a _TypeTag_ (`TwoPTwoC`) that holds the miscible two-phase
two-component model properties:
```c++
// The numerical model
......@@ -174,8 +175,7 @@ The problem file for this part of the exercise is `2p2cproblem.hh`. We now want
```c++
// Create a new type tag for the problem
NEW_TYPE_TAG(ExerciseThreeTwoPTwoCTypeTag, INHERITS_FROM(TwoPTwoC));
NEW_TYPE_TAG(ExerciseThreeBoxTwoPTwoCTypeTag, INHERITS_FROM(BoxModel, ExerciseThreeTwoPTwoCTypeTag));
NEW_TYPE_TAG(ExerciseThreeTwoPTwoCTypeTag, INHERITS_FROM(TwoPTwoC, BoxModel));
```
The new fluid system is to be implemented in the file `fluidsystems/h2omycompressiblecomponent.hh`. This is already included in the problem and the fluid system property is set accordingly.
......@@ -196,7 +196,7 @@ public:
};
```
In the `fluidsystems/h2omycompressiblecomponent.hh` file, your implemented component and the binary coefficient files are already included.
In the `fluidsystems/h2omycompressiblecomponent.hh` file, your implemented compressible component and the binary coefficient files are already included.
```c++
// the ficitious component that was created in exercise 3a
......@@ -215,12 +215,12 @@ $` \rho_{w} = \frac{ \rho_{w, pure} }{ M_{H_2O} }*(M_{H_2O}*x_{H_2O} + M_{MyComp
Implement this dependency in the `density()` method in the fluid system. In order to compile and execute the program run
```bash
cd build-cmake/tutorial/ex3
cd build-cmake/exercises/exercise-fluidsystem
make exercise3_b
./exercise3_b exercise3_b.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.
### 4. Change wettability of the porous medium
......@@ -246,7 +246,7 @@ int wettingPhaseAtPos(const GlobalPosition& globalPos) const
Change this function such that the the phase of our new component is the wetting phase __only__ within the lenses. Execute the program of task 3 again:
```bash
cd build-cmake/tutorial/ex3
cd build-cmake/exercises/exercise-fluidsystem
make exercise3_b
./exercise3_b exercise3_b.input
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment