Skip to content
Snippets Groups Projects
Commit 89fba8da authored by Anna Mareike Kostelecky's avatar Anna Mareike Kostelecky
Browse files

Merge branch 'cleanup/ff-pm-ex' into 'master'

[ex][ff-pm] cleanup readme and ex

See merge request !282
parents 42f3fc49 5d37f113
No related branches found
No related tags found
1 merge request!282[ex][ff-pm] cleanup readme and ex
Pipeline #47757 passed
...@@ -101,10 +101,10 @@ mass and momentum fluxes coming from the porous domain and uses these values as ...@@ -101,10 +101,10 @@ mass and momentum fluxes coming from the porous domain and uses these values as
return values; return values;
} }
``` ```
Note that certain checks are performed when combining different models, e.g., the fluid system has to be the same for both domains > Note: Certain checks are performed when combining different models, e.g., the fluid system has to be the same for both domains
and the sub-control-volume faces at the interface have to match. and the sub-control-volume faces at the interface have to match.
>
We will use a staggered grid (also calles Marker-and-Cell method - MAC) to discretize the free-flow domain and a cell-centered finite volume (CCFV) method for the porous medium domain. We will use a staggered grid (also called Marker-and-Cell method - MAC) to discretize the free-flow domain and a cell-centered finite volume (CCFV) method for the porous medium domain.
Keep in mind that the staggered grid implementation distinguishes between face variables (velocity components) and cell center variables (all other variables). Keep in mind that the staggered grid implementation distinguishes between face variables (velocity components) and cell center variables (all other variables).
For this reason one distinguishes between `CouplingManager::stokesCellCenterIdx` and `CouplingManager::stokesFaceIdx` indices (see `main.cc`), while for the porous medium all variables can be accessed with `CouplingManager::darcyIdx`. For this reason one distinguishes between `CouplingManager::stokesCellCenterIdx` and `CouplingManager::stokesFaceIdx` indices (see `main.cc`), while for the porous medium all variables can be accessed with `CouplingManager::darcyIdx`.
......
...@@ -60,9 +60,12 @@ if(onRightBoundary_(globalPos)) ...@@ -60,9 +60,12 @@ if(onRightBoundary_(globalPos))
values[Indices::pressureIdx] = 0.0; values[Indices::pressureIdx] = 0.0;
``` ```
For changing the flow direction, the boundary conditions for the porous medium have to be changed as well. This should make the flow go from left to right.
If not already done, you can also delete the vertical velocity from `dirichletAtPos`, as Dirichlet-type boundary conditions should be set for the pressure.
For changing the flow direction, the boundary conditions for the porous medium (in `interface/porousmediumsubproblem.hh`) have to be changed as well.
Use Neumann no-flow boundaries everywhere, keep the coupling conditions. Use Neumann no-flow boundaries everywhere and keep the coupling conditions.
``` cpp ``` cpp
values.setAllNeumann(); values.setAllNeumann();
...@@ -70,9 +73,6 @@ if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf)) ...@@ -70,9 +73,6 @@ if (couplingManager().isCoupledEntity(CouplingManager::darcyIdx, scvf))
values.setAllCouplingNeumann(); values.setAllCouplingNeumann();
``` ```
This should make the flow go from left to right.
You can also delete the vertical velocity from `dirichletAtPos`, as Dirichlet-type boundary conditions should be set for the pressure.
Recompile and rerun your code. Then check your results with the applied changes by visualizing them e.g. with paraview. Recompile and rerun your code. Then check your results with the applied changes by visualizing them e.g. with paraview.
### Task B: Include slip-condition ### Task B: Include slip-condition
...@@ -105,6 +105,8 @@ freeflowVtkWriter.addField(freeflowProblem->getAnalyticalVelocityX(), "analytica ...@@ -105,6 +105,8 @@ freeflowVtkWriter.addField(freeflowProblem->getAnalyticalVelocityX(), "analytica
After re-compiling and re-running the executable, we should be able to see also After re-compiling and re-running the executable, we should be able to see also
the analytical solution of $`v_x`$ on the free flow domain. Play around with the grid resolution in the input file to see how that affects the resulting velocity profile. the analytical solution of $`v_x`$ on the free flow domain. Play around with the grid resolution in the input file to see how that affects the resulting velocity profile.
> Note: In Paraview you can e.g. use the tool `PlotOverLine` to plot the velocity in $x$-direction ($v_x$) over the y-Axis (e.g. at the outlet or the middle of the domain). After choosing `PlotOverLine` make sure to give the Point 1 and the Point 2 to define the line or click on the button `Y Axis` and check the coordinates of the points. Click on `Apply` and in section `Series Parameters` choose to only visualize `velocity_gas(m/s)_X` and `analyticalV_x`.
### Task C: Change the shape of interface ### Task C: Change the shape of interface
Now we want to include a non-flat interface between the two domains. Now we want to include a non-flat interface between the two domains.
...@@ -139,6 +141,10 @@ Make sure that you have uncommented the line for including the grid manager in t ...@@ -139,6 +141,10 @@ Make sure that you have uncommented the line for including the grid manager in t
and do the changes in the respective lines for the `Grid` property. and do the changes in the respective lines for the `Grid` property.
As well we have to define the parameters only for the base grid if using `dune-subgrid`. For this uncomment the block `[Grid]` in `interface/params.input` and comment the groups `[Freeflow.Grid]` and `[PorousMedium.Grid]`.
>Note: The four additional parameters `Baseline`, `Amplitude`, `Offset` and `Scaling` define the sinus-shaped interface in the main-file (the block you previously uncommented).
The problem should now compile. However, a runtime error occurs due to the coupling conditions. The problem should now compile. However, a runtime error occurs due to the coupling conditions.
So far, we assumed a flat interface, therefore the normal momentum coupling condition So far, we assumed a flat interface, therefore the normal momentum coupling condition
......
# for dune-subgrid # # TODO: dumux-course-task 1.C: uncomment the following group [Grid]
[Grid] # # for dune-subgrid
Positions0 = 0 1 #[Grid]
Positions1 = 0 0.2 0.3 0.65 #Positions0 = 0 1
Cells0 = 100 #Positions1 = 0 0.2 0.3 0.65
Cells1 = 10 50 18 #Cells0 = 100
Baseline = 0.25 # [m] #Cells1 = 10 50 18
Amplitude = 0.04 # [m] #Baseline = 0.25 # [m]
Offset = 0.5 # [m] #Amplitude = 0.04 # [m]
Scaling = 0.2 #[m] #Offset = 0.5 # [m]
#Scaling = 0.2 #[m]
# TODO: dumux-course-task 1.C: comment or delete the group [Freeflow.Grid]
[Freeflow.Grid] [Freeflow.Grid]
Verbosity = true Verbosity = true
Positions0 = 0.0 1.0 Positions0 = 0.0 1.0
...@@ -17,6 +19,7 @@ Cells0 = 20 ...@@ -17,6 +19,7 @@ Cells0 = 20
Cells1 = 100 Cells1 = 100
Grading1 = 1 Grading1 = 1
# TODO: dumux-course-task 1.C: comment or delete the group [PorousMedium.Grid]
[PorousMedium.Grid] [PorousMedium.Grid]
Verbosity = true Verbosity = true
Positions0 = 0.0 1.0 Positions0 = 0.0 1.0
...@@ -25,6 +28,10 @@ Cells0 = 20 ...@@ -25,6 +28,10 @@ Cells0 = 20
Cells1 = 20 Cells1 = 20
Grading1 = 1 Grading1 = 1
[Problem]
Name = ex_ff-pm-interface
EnableGravity = false
[Freeflow.Problem] [Freeflow.Problem]
Name = freeflow Name = freeflow
PressureDifference = 1e-9 PressureDifference = 1e-9
...@@ -39,9 +46,5 @@ Porosity = 0.4 ...@@ -39,9 +46,5 @@ Porosity = 0.4
AlphaBeaversJoseph = 1.0 AlphaBeaversJoseph = 1.0
Temperature = 283.15 Temperature = 283.15
[Problem]
Name = ex_ff-pm-interface
EnableGravity = false
[Vtk] [Vtk]
AddVelocity = 1 AddVelocity = 1
...@@ -25,6 +25,10 @@ Cells0 = 20 ...@@ -25,6 +25,10 @@ Cells0 = 20
Cells1 = 20 Cells1 = 20
Grading1 = 1 Grading1 = 1
[Problem]
Name = ex_ff-pm-interface
EnableGravity = false
[Freeflow.Problem] [Freeflow.Problem]
Name = freeflow Name = freeflow
PressureDifference = 1e-9 PressureDifference = 1e-9
...@@ -39,9 +43,5 @@ Porosity = 0.4 ...@@ -39,9 +43,5 @@ Porosity = 0.4
AlphaBeaversJoseph = 1.0 AlphaBeaversJoseph = 1.0
Temperature = 283.15 Temperature = 283.15
[Problem]
Name = ex_ff-pm-interface
EnableGravity = false
[Vtk] [Vtk]
AddVelocity = 1 AddVelocity = 1
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