Skip to content
Snippets Groups Projects
Commit 705f405d authored by Timo Koch's avatar Timo Koch
Browse files

Update README.md ex2

parent c9e8319d
No related branches found
No related tags found
2 merge requests!600[WIP][components][plotproperties] Add a source file to plot properties of some components,!553Dumux course tasks
...@@ -21,7 +21,7 @@ Locate all the files you will need for this exercise ...@@ -21,7 +21,7 @@ Locate all the files you will need for this exercise
* The __input file__: `exercise2.input` * The __input file__: `exercise2.input`
* Two header files containing: * Two header files containing:
* a custom __local residual__ in: `mylocalresidual.hh` * a custom __local residual__ in: `mylocalresidual.hh`
* a custom __material law__ in:: `mymateriallaw.hh` * a custom __material law__ in: `mymateriallaw.hh`
<hr><br><br> <hr><br><br>
...@@ -40,10 +40,11 @@ cd build-cmake/tutorial/exercise2 ...@@ -40,10 +40,11 @@ cd build-cmake/tutorial/exercise2
make exercise2 make exercise2
``` ```
* Execute the two problems and inspect the result * Run the problem and inspect the result
```bash ```bash
./exercise2 ./exercise2
paraview *pvd
``` ```
Note: Because the input file has the same name as the Note: Because the input file has the same name as the
executable, DuMuX will find it automatically. executable, DuMuX will find it automatically.
...@@ -84,9 +85,9 @@ SET_PROP(InjectionSpatialParams, MaterialLaw) ...@@ -84,9 +85,9 @@ SET_PROP(InjectionSpatialParams, MaterialLaw)
Note: Also use the wrapper class `EffToAbsLaw`. It takes care of converting absolute to effective saturations considering residual saturations. `MyMaterialLaw` Note: Also use the wrapper class `EffToAbsLaw`. It takes care of converting absolute to effective saturations considering residual saturations. `MyMaterialLaw`
as other material laws (like Brooks-Corey, VanGenuchten, ...) in DuMuX only deals with effective saturations. as other material laws (like Brooks-Corey, VanGenuchten, ...) in DuMuX only deals with effective saturations.
Verify your changes by recompiling and running the program. You should see a plot of your new function. * Verify your changes by recompiling and running the program. You should see a plot of your new function.
For the next task disable the plotting feature by changing the settings in the input file `exercise2.input` For the next task, disable the plotting feature by changing the settings in the input file `exercise2.input`
```ini ```ini
[Problem] [Problem]
...@@ -97,7 +98,7 @@ OnlyPlotMaterialLaws = false ...@@ -97,7 +98,7 @@ OnlyPlotMaterialLaws = false
### Task 4: Enable/Disable Gravity -> DuMuX parameters ### Task 4: Enable/Disable Gravity -> DuMuX parameters
<hr> <hr>
DuMuX has many parameters that have default values. For example, per default all simulation consider gravity effects. DuMuX has many parameters that have default values. For example, all simulations consider gravity effects by default.
You can disable gravity for a study, simply by setting the parameter in the input file You can disable gravity for a study, simply by setting the parameter in the input file
```ini ```ini
...@@ -108,7 +109,7 @@ EnableGravity = false ...@@ -108,7 +109,7 @@ EnableGravity = false
Run the simulation with and without gravity. Change the `Problem.Name` parameter to create output files with different Run the simulation with and without gravity. Change the `Problem.Name` parameter to create output files with different
names. Compare the results using paraview. You should immediately see the difference. names. Compare the results using paraview. You should immediately see the difference.
A list of parameters that can be set through the input file are given [here](http://www.dumux.org/doxygen-stable/html-2.11/a06387.php). A list of parameters that can be set through the input file is given [here](http://www.dumux.org/doxygen-stable/html-2.11/a06387.php).
<hr><br><br> <hr><br><br>
...@@ -142,7 +143,7 @@ MyTwoPTwoCLocalResidual() ...@@ -142,7 +143,7 @@ MyTwoPTwoCLocalResidual()
* Verify you are using the new class by compiling and running the new program and inspecting the terminal output. * Verify you are using the new class by compiling and running the new program and inspecting the terminal output.
You want to make the new local residual special by adding a switch enabling / disabling diffusion. We will achieve this with a DuMuX parameter, a parameter read from the input file that defaults to a property value if the input file doesn't contain the parameter. You want to make the new local residual special by adding a switch enabling / disabling diffusion. We will achieve this with a DuMuX parameter which is read from the input file and defaults to a property value if the input file doesn't contain the parameter.
* Create a new `TypeTag` node, a new `PropertyTag`, and set a default in the `mylocalresidual.hh` file by adding * Create a new `TypeTag` node, a new `PropertyTag`, and set a default in the `mylocalresidual.hh` file by adding
...@@ -193,6 +194,8 @@ You can now enable and disable diffusion through the input file ...@@ -193,6 +194,8 @@ You can now enable and disable diffusion through the input file
EnableDiffusion = true / false EnableDiffusion = true / false
``` ```
Verify the difference in the parameter $`x_w^{N2}`$, i.e. the mole fraction of nitrogen in the * Verify the difference in the parameter $`x_w^{N2}`$, i.e. the mole fraction of nitrogen in the
water phase, with and without diffusion. Note that due to diffusion being a slow process you water phase, with and without diffusion.
Note that due to diffusion being a slow process you
can only see the difference in later times. can only see the difference in later times.
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