Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux-course
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux-course
Commits
baec331b
Commit
baec331b
authored
3 years ago
by
Katharina Heck
Browse files
Options
Downloads
Patches
Plain Diff
[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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercises/exercise-mainfile/README.md
+17
-18
17 additions, 18 deletions
exercises/exercise-mainfile/README.md
with
17 additions
and
18 deletions
exercises/exercise-mainfile/README.md
+
17
−
18
View file @
baec331b
...
...
@@ -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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment