Skip to content
Snippets Groups Projects
Commit baec331b authored by Katharina Heck's avatar Katharina Heck
Browse files

[readme][exercise-mainfile] adapt to changes for release 3.5

parent 7f135069
No related branches found
No related tags found
1 merge request!119[readme][exercise-mainfile] adapt to changes for release 3.5
......@@ -39,10 +39,10 @@ Locate all the files you will need for this exercise
* The __input file__ for the __compressible, stationary__ problem: `exercise_mainfile_b.input`
* The __input file__ for the __compressible, instationary__ problem: `exercise_mainfile_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.
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.
The general structure of any main file in DuMuX is:
......@@ -53,7 +53,7 @@ The general structure of any main file in DuMuX is:
// define the type tag for this problem
using TypeTag = Properties::TTag::OnePCompressible;
```
The `TypeTag` is created in the `properties.hh`. There, you can see that it inherits from the __OneP__ and additionally from the __CCTpfaModel__.
The `TypeTag` is created in the `properties.hh`. There, you can see that it inherits from the __OneP__ and additionally from the __CCTpfaModel__.
The latter defines the discretization method, which is in this case the cell-centered tpfa method.
* A gridmanager tries to create the grid either from a grid file or the input file:
......@@ -62,14 +62,13 @@ The latter defines the discretization method, which is in this case the cell-cen
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
gridManager.init();
```
* We create the finite volume grid geometry, the problem, solution vector and the grid variables and initialize them.
* We create the finite volume grid geometry, the problem, solution vector and the grid variables and initialize them.
Additionally, we initialize the vtk output. Each model has a predefined model specific output with relevant parameters for that model:
```c++
// create the finite volume grid geometry
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView);
fvGridGeometry->update();
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
// the problem (initial and boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......@@ -93,7 +92,7 @@ IOFields::initOutputModule(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 a nonlinear solver.
* Then, we need to assemble and solve the system. Depending on the problem, this can be done with a linear solver or a nonlinear solver.
If the problem is time dependent, we additionally need a time loop. An example for that is given in `exercise1pcmain.cc`:
```c++
......@@ -187,21 +186,21 @@ paraview 1p_incompressible_stationary.pvd
### Task 3: Analytical differentiation
<hr>
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.
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 also possible to have an analytic solution method.
In this case, the epsilon does not play a role anymore, since the derivatives are calculated analytically.
For the incompressible one phase problem, it is also possible to have an analytic solution method.
In this case, the epsilon does not play a role anymore, since the derivatives are calculated analytically.
To implement that, follow the tips in the `exercise1pamain.cc` and the `properties.hh` marked by:
```c++
// TODO: dumux-course-task 3
```
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 `properties.hh`
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 `properties.hh`
and use that instead of the `immisciblelocalresidual.hh` which is used as a default for all immiscible models.
Additionally, you need to set the differentiation method in the main file `exercise1pamain.cc` to analytic.
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