Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog-entries/678.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added new [free-flow-over-porous-media tutorial](https://precice.org/tutorials-free-flow-over-porous-media-2d.html) from [the example case in dumux-adapter](https://github.com/precice/dumux-adapter/tree/77e0fe5ca0dc6a1414d6cce5813ca914f0904259/examples/ff-pm) and updated to follow tutorials structure.
71 changes: 71 additions & 0 deletions free-flow-over-porous-media/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: Free flow over porous media 2D
permalink: tutorials-free-flow-over-porous-media-2d.html
keywords: DuMux, porous media
summary: Flow-flow coupling example with porous media field and free flow field.
---

{% note %}
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).
{% endnote %}

## Setup

This tutorial solves a coupled system consisting of a one-phase free flow and a one-phase flow in a porous media.

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).

The setting is illustrated in the following figure:

![Free flow over porous media setup](images/tutorials-free-flow-over-porous-media-setup.png)

## Configuration

preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)):

![preCICE configuration visualization](images/tutorials-free-flow-over-porous-media-precice-config-visualization.png)

## Available solvers

Both the participants are computed using the simulation code [DuMu<sup>x</sup>](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/).

## Solver setup

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.

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`.

To only recompile the participants, run `sh compile-dumux-cases.sh` in the tutorial folder.

## Running the simulation

Each participant has a `run.sh` script.

To run the free-flow participant, run:

```bash
cd free-flow-dumux
./run.sh
```

To run the porous-media participant, run:

```bash
cd porous-media-dumux
./run.sh
```

Participants can be executed only in serial. Parallel execution is not supported. The case takes approximately two minutes to finish.

## Post-processing

Both participants write VTU outputs, which can be viewed using ParaView.

## Further information

The results of the pressure and the velocity fields are as follows:

![Free flow over porous media results - pressure](images/tutorials-free-flow-over-porous-media-result-pressure.png)
![Free flow over porous media results - velocity](images/tutorials-free-flow-over-porous-media-result-ux.png)

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.
1 change: 1 addition & 0 deletions free-flow-over-porous-media/clean-tutorial.sh
12 changes: 12 additions & 0 deletions free-flow-over-porous-media/compile-dumux-cases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e -u

cd free-flow-dumux/build-cmake/appl
make free_flow_dumux
cd ../../../porous-media-dumux/build-cmake/appl
make porous_media_dumux
cd ../../../

# Move free-flow-dumux and porous-media-dumux executables to the participant folder level
mv free-flow-dumux/build-cmake/appl/free_flow_dumux free-flow-dumux/
mv porous-media-dumux/build-cmake/appl/porous_media_dumux porous-media-dumux/
26 changes: 26 additions & 0 deletions free-flow-over-porous-media/free-flow-dumux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.13)
project(free-flow-dumux CXX)

if(NOT (dune-common_DIR OR dune-common_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
string(REPLACE ${PROJECT_NAME} dune-common dune-common_DIR
${PROJECT_BINARY_DIR})
endif()

#find dune-common and set the module path
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
${dune-common_MODULE_PATH})

#include the dune macros
include(DuneMacros)

# start a dune project with information from dune.module
dune_project()

dune_enable_all_packages()

add_subdirectory(appl)

# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_executable(free_flow_dumux main.cc)
target_compile_definitions(free_flow_dumux PUBLIC "ENABLEMONOLITHIC=0")
target_link_libraries(free_flow_dumux PRIVATE dumux-precice)

add_input_file_links()
Loading