-
-
Notifications
You must be signed in to change notification settings - Fork 129
Add tutorial of free flow over porous media #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Fujikawas
wants to merge
13
commits into
develop
Choose a base branch
from
dumux-example
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
891699d
add tutorial of free flow over porous media
f5a9d3d
rename files
8970243
Merge branch 'develop' into dumux-example
Fujikawas cd42aa2
update README
23dbde2
remove intermediate output
912fea7
add setup figure
eec61d3
update file path
99ba9ff
add switch for csv output
00e8e95
add results
a86c2ee
remove parallel execution
1c5a53c
Improve README and CMAKE file
7b82a72
Update visualisation
077b2cc
Add changelog entry
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 simple 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, while at the top of the free-flow we have a non-permeable wall with no-slip boundary conditions. In the porous media, we assume no-flow across the domain boundaries (left, bottom and right boundary). At the interface we assume a no-slip condition. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The setting is illustrated in the following figure: | ||
|
|
||
|  | ||
|
|
||
| ## Configuration | ||
|
|
||
| preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)): | ||
|
|
||
|  | ||
|
|
||
| ## Available solvers | ||
|
|
||
| Both the flow in free flow and porous media can be solved using the simulation framework [DuMu<sup>x</sup>](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/). | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 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 environment variable DUNE_CONTROL_PATH is suppressed by the script. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To recompile only the simulation, run `sh compile-dumux-cases.sh` in the tutorial folder. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Running the simulation | ||
|
|
||
| You can find the corresponding `run.sh`script for running the case in the folders corresponding to the solvers you want to use. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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 | ||
| ``` | ||
|
|
||
| So far only serial execution is supported for this tutorial, which takes less than two minutes to finish. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Post-processing | ||
|
|
||
| The VTU files from both solvers could be rendered and inspected with ParaView. | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Further information | ||
|
|
||
| The simulation is stationary and the results of the pressure and the velocity fields are as follows: | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|  | ||
|
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../tools/clean-tutorial-base.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
26
free-flow-over-porous-media/free-flow-dumux/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
5 changes: 5 additions & 0 deletions
5
free-flow-over-porous-media/free-flow-dumux/appl/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| add_executable(porous_media_dumux main.cc) | ||
| target_compile_definitions(porous_media_dumux PUBLIC "ENABLEMONOLITHIC=0") | ||
| target_link_libraries(porous_media_dumux PRIVATE dumux-precice) | ||
Fujikawas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| add_input_file_links() | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.