Commit 2b227f0d authored by Katharina Heck's avatar Katharina Heck
Browse files

[exercises-fractures-properties-mainfile] naming conventions

parent dc45319c
dune_add_test(NAME exercise_fractures
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
SOURCES exercisefractures.cc)
SOURCES main.cc)
# add a symlink for each input file
add_input_file_links()
......
......@@ -14,8 +14,8 @@ In the initial setup of this exercise, we want to consider buoyancy-driven upwar
Navigate to the directory `dumux/exercises/exercise-fractures` and familiarize yourself with the files necessary for this exercise:
* The __main file__: `exercisefractures.cc`
* The __input file__: `exercise_fractures.input`
* The __main file__: `main.cc`
* The __input file__: `params.input`
* The __problem file__ for the matrix domain: `matrixproblem.hh`
* The __problem file__ for the fracture domain: `fractureproblem.hh`
* The __spatial parameters file__ for the matrix domain: `matrixspatialparams.hh`
......@@ -108,14 +108,14 @@ Head to the build directory, compile the exercise and execute the program by typ
```bash
cd build-cmake/exercises/exercise-fractures
make exercise_fractures
./exercise_fractures exercise_fractures.input
./exercise_fractures params.input
```
Take a look at the results by opening the files `matrix.pvd` and `fractures.pvd` with _Paraview_. In order to increase the visibility of the fracture solution, you might want to apply the tube filter to it (e.g. with a tube radius of 0.2). The result should look like this:
![](../extradoc/exercisefractures_initsol.png)
You can see how the fractures act as preferential flowpaths in the upwards movement of nitrogen due to their higher permeabilities. Additionally, you can observe comparatively high nitrogen saturations in the fracture tips as a result of the fractures acting as capillary traps due to the lower capillary pressures inside them. Consider turning them into capillary barriers, e.g. by setting __SpatialParams.VGAlpha = 1e-5__ in the __Fracture__ group in the input file (`exercise_fractures.input`). The nitrogen saturations in the fractures (especially in the fracture tips) should now be lower than in the surrounding matrix. Do not forget to reset __SpatialParams.VGAlpha = 1e-1__ in the input file after you are done.
You can see how the fractures act as preferential flowpaths in the upwards movement of nitrogen due to their higher permeabilities. Additionally, you can observe comparatively high nitrogen saturations in the fracture tips as a result of the fractures acting as capillary traps due to the lower capillary pressures inside them. Consider turning them into capillary barriers, e.g. by setting __SpatialParams.VGAlpha = 1e-5__ in the __Fracture__ group in the input file (`params.input`). The nitrogen saturations in the fractures (especially in the fracture tips) should now be lower than in the surrounding matrix. Do not forget to reset __SpatialParams.VGAlpha = 1e-1__ in the input file after you are done.
## Task A: Change the boundary conditions and disable gravity
......@@ -180,7 +180,7 @@ Physical Line(1) = {6,7,9,11,12,13,14,15,16,17,18,19,20,21,23,25};
Physical Line(2) = {8,10,22,24,26};
```
We now want to give all fracture elements that are tagged with domain marker 2 the properties for barriers and assign the parameters for open fractures to all other elements. The domain markers are read from the grid file and can be obtained from the `GridManager` subsequent to grid creation. The main file of this exercise has been implemented such that these markers are already passed to the spatial parameters of the sub-domains (see `exercise_fractures.cc`, lines 120-132). In the spatial parameters you will find a convenience function which allows you to obtain the domain marker for a given element (see `fracturespatialparams.hh`):
We now want to give all fracture elements that are tagged with domain marker 2 the properties for barriers and assign the parameters for open fractures to all other elements. The domain markers are read from the grid file and can be obtained from the `GridManager` subsequent to grid creation. The main file of this exercise has been implemented such that these markers are already passed to the spatial parameters of the sub-domains (see `main.cc`, lines 120-132). In the spatial parameters you will find a convenience function which allows you to obtain the domain marker for a given element (see `fracturespatialparams.hh`):
```cpp
//! returns the domain marker for an element
......@@ -188,7 +188,7 @@ int getElementDomainMarker(const Element& element) const
{ return gridDataPtr_->getElementDomainMarker(element); }
```
The domain markers are also already added to the output (see `exercise_fractures.cc`, lines 195-199). To visualize them, open any of your previously produced results with _Paraview_ and take a look at them by selecting __domainMarker__.
The domain markers are also already added to the output (see `main.cc`, lines 195-199). To visualize them, open any of your previously produced results with _Paraview_ and take a look at them by selecting __domainMarker__.
Adjust the functions for permeability, porosity and material law parameters in the `fracturespatialparams.hh` file such that they are selected depending on the domain marker of the elements. You will see in the results that the pressure jump across the first vertical fracture is now lower than before, because there are highly permeable fractures crossing it, allowing for a pressure release into the other parts of the domain.
......
# the one-phase simulation program
dune_add_test(NAME exercise_mainfile_a
SOURCES exercisemainfilea.cc)
SOURCES exercise1pamain.cc)
dune_add_test(NAME exercise_mainfile_b
SOURCES exercisemainfileb.cc)
SOURCES exercise1pbmain.cc)
dune_add_test(NAME exercise_mainfile_c
SOURCES exercisemainfilec.cc)
SOURCES exercise1pcmain.cc)
# add tutorial to the common target
add_dependencies(test_exercises exercise_mainfile_a exercise_mainfile_b exercise_mainfile_c)
......
......@@ -28,9 +28,9 @@ 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 __incompressible, stationary__ problem : `exercisemainfilea.cc`
* The __main file__ for the __compressible, stationary__ problem : `exercisemainfileb.cc`
* The __main file__ for the __compressible, instationary__ problem : `exercisemainfilec.cc`
* The __main file__ for the __incompressible, stationary__ problem : `exercise1pamain.cc`
* The __main file__ for the __compressible, stationary__ problem : `exercise1pbmain.cc`
* The __main file__ for the __compressible, instationary__ problem : `exercise1pcmain.cc`
* The shared __problem file__: `1pproblem.hh`
* The shared __spatial parameters file__: `1pspatialparams.hh`
* The __input file__ for the __incompressible, stationary__ problem: `exercise_mainfile_a.input`
......@@ -180,11 +180,11 @@ paraview 1p_incompressible_stationary.pvd
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 `exercisemainfilea.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 `exercise1pamain.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 `OnePIncompressibleLocalResidual` which provides that. You just need to include `incompressiblelocalresidual.hh` 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 `exercisemainfilea.cc` to analytic.
Additionally you need to set the differentiation method in the main file `exercise1pamain.cc` to analytic.
# the property exercise simulation program
dune_add_test(NAME exercise_properties
SOURCES exerciseproperties.cc)
SOURCES main.cc)
# add tutorial to the common target
add_dependencies(test_exercises exercise_properties)
......
......@@ -15,10 +15,10 @@ _Exercise Properties_ deals with a two-phase immiscible incompressible problem (
<hr>
Locate all the files you will need for this exercise
* The __main file__: `exerciseproperties.cc`
* The __main file__: `main.cc`
* The __problem file__: `problem.hh`
* The __spatial parameters file__: `spatialparams.hh`
* The __input file__: `exercise_properties.input`
* The __input file__: `params.input`
* One header file containing:
* a custom __local residual__ in: `mylocalresidual.hh`
......
# executable for the exercise
add_executable(exercisefractures_solution EXCLUDE_FROM_ALL exercisefractures.cc)
add_executable(exercisefractures_solution EXCLUDE_FROM_ALL main.cc)
dune_add_test(NAME exercisefractures_solution_a
CMAKE_GUARD "( dune-foamgrid_FOUND AND dune-alugrid_FOUND )"
......@@ -26,9 +26,9 @@ dune_symlink_to_source_files(FILES grids)
#install sources
install(FILES
exercisefractures.cc
main.cc
matrixproblem.hh
fractureproblem.hh
matrixspatialparams.hh
fracturespatialparams.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/exercises/exercise-fractures)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/exercises/solution/exercise-fractures)
# the one-phase simulation program
dune_add_test(NAME exercise_mainfile_a_solution
SOURCES exercisemainfile_a_solution.cc
SOURCES exercise1pa_solution_main.cc
COMPILE_DEFINITIONS TYPETAG=OnePIncompressible)
# here, add the two-phase non-isothermal simulation program
......
# the solution to the properties exercise
dune_add_test(NAME exercise_properties_solution
SOURCES exerciseproperties_solution.cc)
SOURCES main.cc)
# add tutorial to the common target
add_dependencies(test_exercises exercise_properties_solution)
......
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