-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
891699d
add tutorial of free flow over porous media
Fujikawas f5a9d3d
rename files
Fujikawas 8970243
Merge branch 'develop' into dumux-example
Fujikawas cd42aa2
update README
Fujikawas 23dbde2
remove intermediate output
Fujikawas 912fea7
add setup figure
Fujikawas eec61d3
update file path
Fujikawas 99ba9ff
add switch for csv output
Fujikawas 00e8e95
add results
Fujikawas a86c2ee
remove parallel execution
Fujikawas 1c5a53c
Improve README and CMAKE file
Fujikawas 7b82a72
Update visualisation
Fujikawas 077b2cc
Add changelog entry
Fujikawas 40d03ef
remove echo message in the script
Fujikawas 810ceb0
rename solver folders
Fujikawas 5cbcf4b
Merge branch 'develop' into dumux-example
Fujikawas 1e74500
rename participant
Fujikawas 7e9a261
rename folder for compiling case
Fujikawas 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 @@ | ||
| - 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)). |
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 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: | ||
|
|
||
|  | ||
|
|
||
| ## Configuration | ||
|
|
||
| preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)): | ||
|
|
||
|  | ||
|
|
||
| ## 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: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| 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 |
MakisH marked this conversation as resolved.
Show resolved
Hide resolved
|
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,16 @@ | ||
| #!/usr/bin/env sh | ||
| set -e -u | ||
|
|
||
| ( | ||
| cd free-flow-dumux/build-cmake/solver-dumux | ||
| make free_flow_dumux | ||
| ) | ||
|
|
||
| ( | ||
| cd porous-media-dumux/build-cmake/solver-dumux | ||
| make porous_media_dumux | ||
| ) | ||
|
|
||
| # Move free-flow-dumux and porous-media-dumux executables to the participant folder level | ||
| mv free-flow-dumux/build-cmake/solver-dumux/free_flow_dumux free-flow-dumux/ | ||
| mv porous-media-dumux/build-cmake/solver-dumux/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(solver-dumux) | ||
|
|
||
| # finalize the dune project, e.g. generating config.h etc. | ||
| finalize_dune_project(GENERATE_CONFIG_H_CMAKE) |
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,6 @@ | ||
| #!/usr/bin/env sh | ||
| set -e -u | ||
|
|
||
| . ../../tools/cleaning-tools.sh | ||
|
|
||
| clean_dumux . |
45 changes: 45 additions & 0 deletions
45
free-flow-over-porous-media/free-flow-dumux/config.h.cmake
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,45 @@ | ||
| /* begin free-flow-dumux | ||
| put the definitions for config.h specific to | ||
| your project here. Everything above will be | ||
| overwritten | ||
| */ | ||
|
|
||
| /* begin private */ | ||
| /* Name of package */ | ||
| #define PACKAGE "@DUNE_MOD_NAME@" | ||
|
|
||
| /* Define to the address where bug reports for this package should be sent. */ | ||
| #define PACKAGE_BUGREPORT "@DUNE_MAINTAINER@" | ||
|
|
||
| /* Define to the full name of this package. */ | ||
| #define PACKAGE_NAME "@DUNE_MOD_NAME@" | ||
|
|
||
| /* Define to the full name and version of this package. */ | ||
| #define PACKAGE_STRING "@DUNE_MOD_NAME@ @DUNE_MOD_VERSION@" | ||
|
|
||
| /* Define to the one symbol short name of this package. */ | ||
| #define PACKAGE_TARNAME "@DUNE_MOD_NAME@" | ||
|
|
||
| /* Define to the home page for this package. */ | ||
| #define PACKAGE_URL "@DUNE_MOD_URL@" | ||
|
|
||
| /* Define to the version of this package. */ | ||
| #define PACKAGE_VERSION "@DUNE_MOD_VERSION@" | ||
|
|
||
| /* end private */ | ||
|
|
||
| /* Define to the version of free-flow-dumux */ | ||
| #define FREE_FLOW_DUMUX_VERSION "@FREE_FLOW_DUMUX_VERSION@" | ||
|
|
||
| /* Define to the major version of free-flow-dumux */ | ||
| #define FREE_FLOW_DUMUX_VERSION_MAJOR @FREE_FLOW_DUMUX_VERSION_MAJOR@ | ||
|
|
||
| /* Define to the minor version of free-flow-dumux */ | ||
| #define FREE_FLOW_DUMUX_VERSION_MINOR @FREE_FLOW_DUMUX_VERSION_MINOR@ | ||
|
|
||
| /* Define to the revision of free-flow-dumux */ | ||
| #define FREE_FLOW_DUMUX_VERSION_REVISION @FREE_FLOW_DUMUX_VERSION_REVISION@ | ||
|
|
||
| /* end free-flow-dumux | ||
| Everything below here will be overwritten | ||
| */ |
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 @@ | ||
| ################################ | ||
| # Dune module information file # | ||
| ################################ | ||
|
|
||
| # Name of the module | ||
| Module: free-flow-dumux | ||
| Version: 1.0 | ||
| Maintainer: jun.chen@ipvs.uni-stuttgart.de | ||
| # Required build dependencies | ||
| Depends: dumux-precice | ||
| # Optional build dependencies | ||
| #Suggests: |
15 changes: 15 additions & 0 deletions
15
free-flow-over-porous-media/free-flow-dumux/free-flow-dumux.pc.in
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,15 @@ | ||
| prefix=@prefix@ | ||
| exec_prefix=@exec_prefix@ | ||
| libdir=@libdir@ | ||
| includedir=@includedir@ | ||
| CXX=@CXX@ | ||
| CC=@CC@ | ||
| DEPENDENCIES=@REQUIRES@ | ||
|
|
||
| Name: @PACKAGE_NAME@ | ||
| Version: @VERSION@ | ||
| Description: free-flow module | ||
| URL: http://dune-project.org/ | ||
| Requires: dumux-precice | ||
| Libs: -L${libdir} | ||
| Cflags: -I${includedir} |
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,37 @@ | ||
| [FreeFlow] | ||
| EnableUnsymmetrizedVelocityGradientForBeaversJoseph = false | ||
|
|
||
| [FreeFlow.Grid] | ||
| Verbosity = true | ||
| LowerLeft = 0 1 | ||
| UpperRight = 1 2 | ||
| Cells = 40 40 | ||
| Grading1 = 1 | ||
|
|
||
| [Darcy.Grid] | ||
| Verbosity = true | ||
| LowerLeft = 0 0 | ||
| UpperRight = 1 1 | ||
| Cells = 40 40 | ||
| Grading1 = 1 | ||
|
|
||
| [FreeFlow.Problem] | ||
| Name = free-flow-dumux | ||
| EnableInertiaTerms = false | ||
| PressureDifference = 1e-2 | ||
|
|
||
| [Darcy.SpatialParams] | ||
| Permeability = 1e-6 # m^2 | ||
| Porosity = 0.4 | ||
| AlphaBeaversJoseph = 1.0 | ||
|
|
||
| [Problem] | ||
| Name = fvca-iterative | ||
| EnableGravity = false | ||
| CouplingMode = ReconstructFreeFlowNormalStress | ||
|
|
||
| [Vtk] | ||
| AddVelocity = 1 | ||
|
|
||
| [Output] | ||
| EnableCSVWriter = false |
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,9 @@ | ||
| #!/usr/bin/env bash | ||
| set -e -u | ||
|
|
||
| . ../../tools/log.sh | ||
| exec > >(tee --append "$LOGFILE") 2>&1 | ||
|
|
||
| ./free_flow_dumux params.input | ||
|
|
||
| close_log |
5 changes: 5 additions & 0 deletions
5
free-flow-over-porous-media/free-flow-dumux/solver-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,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() |
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.