diff --git a/exercises/exercise-mainfile/CMakeLists.txt b/exercises/exercise-mainfile/CMakeLists.txt index 0f415b3773940284239fb17a597cab6d2a9dcb79..0574e5fc15c71dd1a5fd26f96c5eedcbfa925863 100644 --- a/exercises/exercise-mainfile/CMakeLists.txt +++ b/exercises/exercise-mainfile/CMakeLists.txt @@ -1,18 +1,18 @@ # the one-phase simulation program -dune_add_test(NAME exercise1_1p_a - SOURCES exercise1_1p_a.cc - CMD_ARGS exercise1_1p_a.input) +dune_add_test(NAME exercise_1p_a + SOURCES exercise_1p_a.cc + CMD_ARGS exercise_1p_a.input) -dune_add_test(NAME exercise1_1p_b - SOURCES exercise1_1p_b.cc - CMD_ARGS exercise1_1p_b.input) +dune_add_test(NAME exercise_1p_b + SOURCES exercise_1p_b.cc + CMD_ARGS exercise_1p_b.input) -dune_add_test(NAME exercise1_1p_c - SOURCES exercise1_1p_c.cc - CMD_ARGS exercise1_1p_c.input) +dune_add_test(NAME exercise_1p_c + SOURCES exercise_1p_c.cc + CMD_ARGS exercise_1p_c.input) # add tutorial to the common target -add_dependencies(test_exercises exercise1_1p_a exercise1_1p_b exercise1_1p_c) +add_dependencies(test_exercises exercise_1p_a exercise_1p_b exercise_1p_c) # add a symlink for the input file -dune_symlink_to_source_files(FILES "exercise1_1p_a.input" "exercise1_1p_b.input" "exercise1_1p_c.input") +dune_symlink_to_source_files(FILES "exercise_1p_a.input" "exercise_1p_b.input" "exercise_1p_c.input") diff --git a/exercises/exercise-mainfile/README.md b/exercises/exercise-mainfile/README.md index 5d8905eb9d73860bb3cbd1b880ad1d471d2e52d1..85380d6c27bcc5553f8d951969557b5709fd4b1d 100644 --- a/exercises/exercise-mainfile/README.md +++ b/exercises/exercise-mainfile/README.md @@ -9,9 +9,9 @@ In order to do so, there are three examples of one phase flow problems. Two exam The stationary examples differ in the fluidssystems they are using which means they differ in the fluid properties (e.g. density, thermal conductivity etc). The first problem (a) uses an incompressible fluid which means that the density does not change when pressure changes. This makes it possible to solve the system linearly. The second problem uses a compressible fluid, that means the density is a function of pressure and we need to use a nonlinear solver. To summarize the problems differ in: -* exercise1_1p_a: a one-phase incompressible, stationary problem -* exercise1_1p_b: a one-phase compressible, stationary problem -* exercise1_1p_c: a one-phase compressible, instationary problem +* exercise_1p_a: a one-phase incompressible, stationary problem +* exercise_1p_b: a one-phase compressible, stationary problem +* exercise_1p_c: a one-phase compressible, instationary problem The problem set-up for all three examples is always the same: It is a two dimensional problem and the domain is $`1 m`$ by $`1 m`$. It is a heterogeneous set-up with a lens in the middle of the domain which has a lower permeability ($`1\cdot 10^{-12} m^2`$ compared to $`1\cdot 10^{-10} m^2`$ in the rest of the domain). @@ -28,14 +28,14 @@ In the beginning there is a uniform pressure of $`1\cdot 10^5 Pa`$ in the whole <hr> Locate all the files you will need for this exercise -* The __main file__ for the __1p incompressible, stationary__ problem : `exercise1_1p_a.cc` -* The __main file__ for the __1p compressible, stationary__ problem : `exercise1_1p_b.cc` -* The __main file__ for the __1p compressible, instationary__ problem : `exercise1_1p_c.cc` +* The __main file__ for the __1p incompressible, stationary__ problem : `exercise_1p_a.cc` +* The __main file__ for the __1p compressible, stationary__ problem : `exercise_1p_b.cc` +* The __main file__ for the __1p compressible, instationary__ problem : `exercise_1p_c.cc` * The shared __problem file__: `1pproblem.hh` * The shared __spatial parameters file__: `1pspatialparams.hh` -* The __input file__ for the __1p incompressible, stationary__ problem: `exercise1_1p_a.input` -* The __input file__ for the __1p compressible, stationary__ problem: `exercise1_1p_b.input` -* The __input file__ for the __1p compressible, instationary__ problem: `exercise1_1p_c.input` +* The __input file__ for the __1p incompressible, stationary__ problem: `exercise_1p_a.input` +* The __input file__ for the __1p compressible, stationary__ problem: `exercise_1p_b.input` +* The __input file__ for the __1p compressible, instationary__ problem: `exercise_1p_c.input` Please pay special attention to the similarities and differences in the three main files. The first main file is solved linearly and does not need a newton solver or any other nonlinear solver method. The second problem is a nonlinear problem and uses newton's method to solve the system. The third problem is nonlinear and additionally instationary. Therefore a time loop needs to be included in the main file. @@ -83,7 +83,7 @@ VtkOutputFields::init(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); ``` -* then we need to assemble and solve the system. Depending on the problem this can be done with a linear solver or with a nonlinear solver. If the problem is time dependent we additionally need a time loop. An example for that is given in exercise1_1p_c: +* then we need to assemble and solve the system. Depending on the problem this can be done with a linear solver or with a nonlinear solver. If the problem is time dependent we additionally need a time loop. An example for that is given in exercise_1p_c: ```c++ // get some time loop parameters @@ -152,37 +152,37 @@ timeLoop->finalize(leafGridView.comm()); cd ../../build-cmake/exercises/exercise-mainfile ``` -* Compile all three executables `exercise1_1p_a` and `exercise1_1p_b` and `exercise1_1p_c` +* Compile all three executables `exercise_1p_a` and `exercise_1p_b` and `exercise_1p_c` ```bash -make exercise1_1p_a exercise1_1p_b exercise1_1p_c +make exercise_1p_a exercise_1p_b exercise_1p_c ``` * Execute the three problems and inspect the result ```bash -./exercise1_1p_a -./exercise1_1p_b -./exercise1_1p_c +./exercise_1p_a +./exercise_1p_b +./exercise_1p_c ``` -* you can look at the results with paraview +* you can look at the results (e.g. for the first example) with paraview: ```bash -paraview injection-1p_a.pvd +paraview 1p_incompressible_stationary.pvd ``` <hr><br><br> ### Task 3: Analytical differentiation <hr> -In the input file `exercise1_1p_a.input` you will see that there is a variable BaseEpsilon. This defines the base for the epsilon used in the numeric differentiation. If that value is too small, you will see that the solution of the numeric differentiation is not correct. Change that value to $`1 \cdot 10^{-15}`$ and have a look at the solution. +In the input file `exercise_1p_a.input` you will see that there is a variable BaseEpsilon. This defines the base for the epsilon used in the numeric differentiation. If that value is too small, you will see that the solution of the numeric differentiation is not correct. Change that value to $`1 \cdot 10^{-15}`$ and have a look at the solution. -For the incompressible one phase problem it is possible to also have an analytic solution method. Then the epsilon does not play a role anymore since the derivatives are calculated analytically. To implement that follow the directions in the `exercise1_1p_a.cc` and the `1pproblem.hh` marked by: +For the incompressible one phase problem it is possible to also have an analytic solution method. Then the epsilon does not play a role anymore since the derivatives are calculated analytically. To implement that follow the directions in the `exercise_1p_a.cc` and the `1pproblem.hh` marked by: ```c++ // TODO: dumux-course-task ``` For the analytic solution of your immiscible problem you need analytic solutions for the derivatives of the jacobian. For that we have a special local residual, the `OneincompressibleLocalResidual` which provides that. You just need to include that in your `1pproblem.hh` and use that instead of the `immisciblelocalresidual.hh` which is used as a standard for all immiscible models. -Additionally you need to set the differentiation method in the main file `exercise1_1p_a.cc` to analytic. +Additionally you need to set the differentiation method in the main file `exercise_1p_a.cc` to analytic. diff --git a/exercises/exercise-mainfile/exercise1_1p_a.cc b/exercises/exercise-mainfile/exercise_1p_a.cc similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_a.cc rename to exercises/exercise-mainfile/exercise_1p_a.cc diff --git a/exercises/exercise-mainfile/exercise1_1p_a.input b/exercises/exercise-mainfile/exercise_1p_a.input similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_a.input rename to exercises/exercise-mainfile/exercise_1p_a.input diff --git a/exercises/exercise-mainfile/exercise1_1p_b.cc b/exercises/exercise-mainfile/exercise_1p_b.cc similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_b.cc rename to exercises/exercise-mainfile/exercise_1p_b.cc diff --git a/exercises/exercise-mainfile/exercise1_1p_b.input b/exercises/exercise-mainfile/exercise_1p_b.input similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_b.input rename to exercises/exercise-mainfile/exercise_1p_b.input diff --git a/exercises/exercise-mainfile/exercise1_1p_c.cc b/exercises/exercise-mainfile/exercise_1p_c.cc similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_c.cc rename to exercises/exercise-mainfile/exercise_1p_c.cc diff --git a/exercises/exercise-mainfile/exercise1_1p_c.input b/exercises/exercise-mainfile/exercise_1p_c.input similarity index 100% rename from exercises/exercise-mainfile/exercise1_1p_c.input rename to exercises/exercise-mainfile/exercise_1p_c.input diff --git a/exercises/solution/exercise-mainfile/CMakeLists.txt b/exercises/solution/exercise-mainfile/CMakeLists.txt index b6f65eefd90e7c90760b6098c314b4a3fa9c9d85..85c84ea30d9bff304902ca447da8d3ff36a0a95c 100644 --- a/exercises/solution/exercise-mainfile/CMakeLists.txt +++ b/exercises/solution/exercise-mainfile/CMakeLists.txt @@ -1,13 +1,13 @@ # the one-phase simulation program -dune_add_test(NAME exercise1_1p_a_solution - SOURCES exercise1_1p_a.cc +dune_add_test(NAME exercise_1p_a_solution + SOURCES exercise_1p_a_solution.cc COMPILE_DEFINITIONS TYPETAG=OnePIncompressible - CMD_ARGS exercise1_1p_a.input) + CMD_ARGS exercise_1p_a.input) # here, add the two-phase non-isothermal simulation program # add tutorial to the common target -add_dependencies(test_exercises exercise1_1p_a) +add_dependencies(test_exercises exercise_1p_a_solution) # add a symlink for the input file -dune_symlink_to_source_files(FILES "exercise1_1p_a.input") +dune_symlink_to_source_files(FILES "exercise_1p_a.input") diff --git a/exercises/solution/exercise-mainfile/exercise1_1p_a.input b/exercises/solution/exercise-mainfile/exercise_1p_a.input similarity index 100% rename from exercises/solution/exercise-mainfile/exercise1_1p_a.input rename to exercises/solution/exercise-mainfile/exercise_1p_a.input diff --git a/exercises/solution/exercise-mainfile/exercise1_1p_a.cc b/exercises/solution/exercise-mainfile/exercise_1p_a_solution.cc similarity index 100% rename from exercises/solution/exercise-mainfile/exercise1_1p_a.cc rename to exercises/solution/exercise-mainfile/exercise_1p_a_solution.cc