Skip to content

Commit b3de2af

Browse files
authored
Add tutorial of free flow over porous media (#678)
1 parent d15fdc9 commit b3de2af

33 files changed

+2221
-0
lines changed

changelog-entries/678.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Added new [free-flow-over-porous-media tutorial](https://precice.org/tutorials-free-flow-over-porous-media-2d.html) (migrated from the [example case in dumux-adapter](https://github.com/precice/dumux-adapter/tree/77e0fe5ca0dc6a1414d6cce5813ca914f0904259/examples/ff-pm)).
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Free flow over porous media 2D
3+
permalink: tutorials-free-flow-over-porous-media-2d.html
4+
keywords: DuMux, porous media
5+
summary: Flow-flow coupling example with porous media field and free flow field.
6+
---
7+
8+
{% note %}
9+
Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/free-flow-over-porous-media-2d). Read how in the [tutorials introduction](https://precice.org/tutorials.html).
10+
{% endnote %}
11+
12+
## Setup
13+
14+
This tutorial solves a coupled system consisting of a one-phase free flow and a one-phase flow in a porous media.
15+
16+
A pressure gradient is applied to the free flow domain from left to right. The top edge of the free-flow is a non-permeable wall with no-slip boundary conditions. In the porous media, there is a no-flow condition across the domain boundaries (left, bottom, and right boundaries). At the interface, a no-slip condition applies. The case is stationary (solved to a steady-state solution).
17+
18+
The setting is illustrated in the following figure:
19+
20+
![Free flow over porous media setup](images/tutorials-free-flow-over-porous-media-setup.png)
21+
22+
## Configuration
23+
24+
preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)):
25+
26+
![preCICE configuration visualization](images/tutorials-free-flow-over-porous-media-precice-config-visualization.png)
27+
28+
## Available solvers
29+
30+
Both the participants are computed using the simulation code [DuMu<sup>x</sup>](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/).
31+
32+
## Solver setup
33+
34+
To solve the flows with the DuMux framework, the necessary DUNE modules need to be downloaded and set up. This is done by running `sh setup-dumux.sh` in the tutorial folder.
35+
36+
Note that if an existing installation of DUNE modules is detected in a default location, this may lead to problems in running the `setup-dumux.sh` script. The script suppresses the environment variable `DUNE_CONTROL_PATH`.
37+
38+
To only recompile the participants, run `sh compile-dumux-cases.sh` in the tutorial folder.
39+
40+
## Running the simulation
41+
42+
Each participant has a `run.sh` script.
43+
44+
To run the free-flow participant, run:
45+
46+
```bash
47+
cd free-flow-dumux
48+
./run.sh
49+
```
50+
51+
To run the porous-media participant, run:
52+
53+
```bash
54+
cd porous-media-dumux
55+
./run.sh
56+
```
57+
58+
Participants can be executed only in serial. Parallel execution is not supported. The case takes approximately two minutes to finish.
59+
60+
## Post-processing
61+
62+
Both participants write VTU outputs, which can be viewed using ParaView.
63+
64+
## Further information
65+
66+
The results of the pressure and the velocity fields are as follows:
67+
68+
![Free flow over porous media results - pressure](images/tutorials-free-flow-over-porous-media-result-pressure.png)
69+
![Free flow over porous media results - velocity](images/tutorials-free-flow-over-porous-media-result-ux.png)
70+
71+
Each solver folder contains an input file (`params.input`) that will be passed to the solver executables. This is a DuMUX input file describing the simulation setting, e.g., pressure, mesh size, time stepping, etc.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../tools/clean-tutorial-base.sh
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
set -e -u
3+
4+
(
5+
cd free-flow-dumux/build-cmake/solver-dumux
6+
make free_flow_dumux
7+
)
8+
9+
(
10+
cd porous-media-dumux/build-cmake/solver-dumux
11+
make porous_media_dumux
12+
)
13+
14+
# Move free-flow-dumux and porous-media-dumux executables to the participant folder level
15+
mv free-flow-dumux/build-cmake/solver-dumux/free_flow_dumux free-flow-dumux/
16+
mv porous-media-dumux/build-cmake/solver-dumux/porous_media_dumux porous-media-dumux/
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
project(free-flow-dumux CXX)
3+
4+
if(NOT (dune-common_DIR OR dune-common_ROOT OR
5+
"${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
6+
string(REPLACE ${PROJECT_NAME} dune-common dune-common_DIR
7+
${PROJECT_BINARY_DIR})
8+
endif()
9+
10+
#find dune-common and set the module path
11+
find_package(dune-common REQUIRED)
12+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
13+
${dune-common_MODULE_PATH})
14+
15+
#include the dune macros
16+
include(DuneMacros)
17+
18+
# start a dune project with information from dune.module
19+
dune_project()
20+
21+
dune_enable_all_packages()
22+
23+
add_subdirectory(solver-dumux)
24+
25+
# finalize the dune project, e.g. generating config.h etc.
26+
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
set -e -u
3+
4+
. ../../tools/cleaning-tools.sh
5+
6+
clean_dumux .
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* begin free-flow-dumux
2+
put the definitions for config.h specific to
3+
your project here. Everything above will be
4+
overwritten
5+
*/
6+
7+
/* begin private */
8+
/* Name of package */
9+
#define PACKAGE "@DUNE_MOD_NAME@"
10+
11+
/* Define to the address where bug reports for this package should be sent. */
12+
#define PACKAGE_BUGREPORT "@DUNE_MAINTAINER@"
13+
14+
/* Define to the full name of this package. */
15+
#define PACKAGE_NAME "@DUNE_MOD_NAME@"
16+
17+
/* Define to the full name and version of this package. */
18+
#define PACKAGE_STRING "@DUNE_MOD_NAME@ @DUNE_MOD_VERSION@"
19+
20+
/* Define to the one symbol short name of this package. */
21+
#define PACKAGE_TARNAME "@DUNE_MOD_NAME@"
22+
23+
/* Define to the home page for this package. */
24+
#define PACKAGE_URL "@DUNE_MOD_URL@"
25+
26+
/* Define to the version of this package. */
27+
#define PACKAGE_VERSION "@DUNE_MOD_VERSION@"
28+
29+
/* end private */
30+
31+
/* Define to the version of free-flow-dumux */
32+
#define FREE_FLOW_DUMUX_VERSION "@FREE_FLOW_DUMUX_VERSION@"
33+
34+
/* Define to the major version of free-flow-dumux */
35+
#define FREE_FLOW_DUMUX_VERSION_MAJOR @FREE_FLOW_DUMUX_VERSION_MAJOR@
36+
37+
/* Define to the minor version of free-flow-dumux */
38+
#define FREE_FLOW_DUMUX_VERSION_MINOR @FREE_FLOW_DUMUX_VERSION_MINOR@
39+
40+
/* Define to the revision of free-flow-dumux */
41+
#define FREE_FLOW_DUMUX_VERSION_REVISION @FREE_FLOW_DUMUX_VERSION_REVISION@
42+
43+
/* end free-flow-dumux
44+
Everything below here will be overwritten
45+
*/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
################################
2+
# Dune module information file #
3+
################################
4+
5+
# Name of the module
6+
Module: free-flow-dumux
7+
Version: 1.0
8+
Maintainer: jun.chen@ipvs.uni-stuttgart.de
9+
# Required build dependencies
10+
Depends: dumux-precice
11+
# Optional build dependencies
12+
#Suggests:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
prefix=@prefix@
2+
exec_prefix=@exec_prefix@
3+
libdir=@libdir@
4+
includedir=@includedir@
5+
CXX=@CXX@
6+
CC=@CC@
7+
DEPENDENCIES=@REQUIRES@
8+
9+
Name: @PACKAGE_NAME@
10+
Version: @VERSION@
11+
Description: free-flow module
12+
URL: http://dune-project.org/
13+
Requires: dumux-precice
14+
Libs: -L${libdir}
15+
Cflags: -I${includedir}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[FreeFlow]
2+
EnableUnsymmetrizedVelocityGradientForBeaversJoseph = false
3+
4+
[FreeFlow.Grid]
5+
Verbosity = true
6+
LowerLeft = 0 1
7+
UpperRight = 1 2
8+
Cells = 40 40
9+
Grading1 = 1
10+
11+
[Darcy.Grid]
12+
Verbosity = true
13+
LowerLeft = 0 0
14+
UpperRight = 1 1
15+
Cells = 40 40
16+
Grading1 = 1
17+
18+
[FreeFlow.Problem]
19+
Name = free-flow-dumux
20+
EnableInertiaTerms = false
21+
PressureDifference = 1e-2
22+
23+
[Darcy.SpatialParams]
24+
Permeability = 1e-6 # m^2
25+
Porosity = 0.4
26+
AlphaBeaversJoseph = 1.0
27+
28+
[Problem]
29+
Name = fvca-iterative
30+
EnableGravity = false
31+
CouplingMode = ReconstructFreeFlowNormalStress
32+
33+
[Vtk]
34+
AddVelocity = 1
35+
36+
[Output]
37+
EnableCSVWriter = false

0 commit comments

Comments
 (0)