diff --git a/exercises/exercise-fluidsystem/CMakeLists.txt b/exercises/exercise-fluidsystem/CMakeLists.txt index 3ee66daa51a7ad1a57a2e82843c9a959f22c39f3..e4ed4f012ab0b328f8dab5c001a6b0d4edad76ea 100644 --- a/exercises/exercise-fluidsystem/CMakeLists.txt +++ b/exercises/exercise-fluidsystem/CMakeLists.txt @@ -1,13 +1,13 @@ # executables for exercise part a & b #part a: 2pproblem dune_add_test(NAME exercise_fluidsystem_a - SOURCES exercisefluidsystem.cc + SOURCES main.cc COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP COMPILE_ONLY) # for testing purposes, ignore for the exercise #part b: 2p2cproblem dune_add_test(NAME exercise_fluidsystem_b - SOURCES exercisefluidsystem.cc + SOURCES main.cc COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC COMPILE_ONLY) # for testing purposes, ignore for the exercise diff --git a/exercises/exercise-fluidsystem/README.md b/exercises/exercise-fluidsystem/README.md index 9f4b8740f5f92a280f1d46b3ddfce321e2b299c8..df8f82a0e684dad95bad420d57c675da6ee15e2e 100644 --- a/exercises/exercise-fluidsystem/README.md +++ b/exercises/exercise-fluidsystem/README.md @@ -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 Locate all the files you will need for this exercise -* The shared __main file__ : `exercisefluidsystem.cc` -* The __input file__ for part a: `exercise_fluidsystem_a.input` +* The shared __main file__ : `main.cc` +* The __input file__ for part a: `aparams.input` * 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 __spatial parameters file__: `spatialparams.hh` @@ -119,7 +119,7 @@ public: ### 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++ /*! @@ -151,7 +151,7 @@ In order to execute the program, change to the build directory and compile and e ```bash cd build-cmake/exercises/exercise-fluidsystem 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: @@ -168,7 +168,7 @@ where $`p`$ is the pressure and $`\rho_{min} = 1440 `$, $`\rho_{max} = 1480 `$ a  -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:  @@ -229,7 +229,7 @@ Implement this dependency in the `density()` method in the fluid system. In orde ```bash cd build-cmake/exercises/exercise-fluidsystem 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. diff --git a/exercises/exercise-fluidsystem/exercise_fluidsystem_a.input b/exercises/exercise-fluidsystem/aparams.input similarity index 100% rename from exercises/exercise-fluidsystem/exercise_fluidsystem_a.input rename to exercises/exercise-fluidsystem/aparams.input diff --git a/exercises/exercise-fluidsystem/exercise_fluidsystem_b.input b/exercises/exercise-fluidsystem/bparams.input similarity index 100% rename from exercises/exercise-fluidsystem/exercise_fluidsystem_b.input rename to exercises/exercise-fluidsystem/bparams.input diff --git a/exercises/exercise-fluidsystem/exercisefluidsystem.cc b/exercises/exercise-fluidsystem/main.cc similarity index 100% rename from exercises/exercise-fluidsystem/exercisefluidsystem.cc rename to exercises/exercise-fluidsystem/main.cc diff --git a/exercises/solution/exercise-fluidsystem/CMakeLists.txt b/exercises/solution/exercise-fluidsystem/CMakeLists.txt index 57b95d69550516e887f55753f2a1cb69edbccbae..4381e36d72958b9df7bca23e74161158119e38a2 100644 --- a/exercises/solution/exercise-fluidsystem/CMakeLists.txt +++ b/exercises/solution/exercise-fluidsystem/CMakeLists.txt @@ -1,12 +1,12 @@ # executables for exercise part a & b #part a: 2pproblem dune_add_test(NAME exercise_fluidsystem_a_solution - SOURCES exercisefluidsystem.cc + SOURCES main.cc COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoP) #part b: 2p2cproblem dune_add_test(NAME exercise_fluidsystem_b_solution - SOURCES exercisefluidsystem.cc + SOURCES main.cc COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoC) # add exercises to the common target diff --git a/exercises/solution/exercise-fluidsystem/exercise_fluidsystem_a_solution.input b/exercises/solution/exercise-fluidsystem/aparams.input similarity index 100% rename from exercises/solution/exercise-fluidsystem/exercise_fluidsystem_a_solution.input rename to exercises/solution/exercise-fluidsystem/aparams.input diff --git a/exercises/solution/exercise-fluidsystem/exercise_fluidsystem_b_solution.input b/exercises/solution/exercise-fluidsystem/bparams.input similarity index 100% rename from exercises/solution/exercise-fluidsystem/exercise_fluidsystem_b_solution.input rename to exercises/solution/exercise-fluidsystem/bparams.input diff --git a/exercises/solution/exercise-fluidsystem/exercisefluidsystem.cc b/exercises/solution/exercise-fluidsystem/main.cc similarity index 100% rename from exercises/solution/exercise-fluidsystem/exercisefluidsystem.cc rename to exercises/solution/exercise-fluidsystem/main.cc