Skip to content

Commit 15e5240

Browse files
authored
Merge pull request #208 from precice/develop
Tutorials v202104.1.0
2 parents 152fd79 + 3c1161e commit 15e5240

File tree

29 files changed

+422
-132
lines changed

29 files changed

+422
-132
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Issue template
3+
about: Check this out before opening an issue
4+
5+
---
6+
<!-- markdownlint-disable-file MD041 -->
7+
<!--
8+
Hey! Thank you for reporting an issue!
9+
Just to make sure: is this really an issue or do you need some help
10+
with troubleshooting? Please use our community channels if you need help:
11+
https://precice.org/community-channels.html
12+
Thanks! :-)
13+
14+
Please wrap any error messages with three backticks before and after:
15+
```
16+
This is an error message
17+
```
18+
19+
If this is a bug, please provide the following information.
20+
You can generate log files with `./run.sh > solver.log 2>&1`.
21+
-->
22+
23+
- Tutorials state (last commit / release):
24+
- Versions of solvers and adapters used:
25+
- preCICE version:
26+
- Log files:

.github/pull_request_template.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- Please submit your Pull Request to the `develop` branch.
2+
3+
It may help to have a look at the file `CONTRIBUTING.md` for a few hints and guidelines. -->

.github/workflows/check-links.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check links
2+
on: [push, pull_request]
3+
jobs:
4+
check_links:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v2
9+
- name: Check links in markdown files (markdown-link-check)
10+
uses: gaurav-nelson/github-action-markdown-link-check@v1
11+
with:
12+
use-quiet-mode: 'yes'
13+
use-verbose-mode: 'no'
14+
config-file: '.markdown-link-check-config.json'

.github/workflows/check-markdown.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Lint docs
2+
on: [push, pull_request]
3+
jobs:
4+
check_md:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v2
9+
- name: Lint markdown files (markdownlint)
10+
uses: articulate/actions-markdownlint@v1
11+
with:
12+
config: .markdownlint.json
13+
files: '.'
14+
ignore: changelog-entries
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Checks
1+
name: Check scripts
22
on: [push, pull_request]
33
jobs:
4-
checks:
4+
check_scripts:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Check out repository
88
uses: actions/checkout@v2
99
- run: bash tools/check.sh
1010
- run: bash tools/check-size.sh
11+
- name: Run ShellCheck
12+
uses: ludeeus/action-shellcheck@master
13+
env:
14+
SHELLCHECK_OPTS: -e SC1091

.markdown-link-check-config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"aliveStatusCodes": [429, 403, 200]
3+
}

.markdownlint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD033": false
4+
}

CODE_OF_CONDUCT.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
<!-- markdownlint-configure-file {"MD034": false } -->
4+
5+
## Our Pledge
6+
7+
We as members, contributors, and leaders pledge to make participation in our
8+
community a harassment-free experience for everyone, regardless of age, body
9+
size, visible or invisible disability, ethnicity, sex characteristics, gender
10+
identity and expression, level of experience, education, socio-economic status,
11+
nationality, personal appearance, race, religion, or sexual identity
12+
and orientation.
13+
14+
We pledge to act and interact in ways that contribute to an open, welcoming,
15+
diverse, inclusive, and healthy community.
16+
17+
## Our Standards
18+
19+
Examples of behavior that contributes to a positive environment for our
20+
community include:
21+
22+
* Demonstrating empathy and kindness toward other people
23+
* Being respectful of differing opinions, viewpoints, and experiences
24+
* Giving and gracefully accepting constructive feedback
25+
* Accepting responsibility and apologizing to those affected by our mistakes,
26+
and learning from the experience
27+
* Focusing on what is best not just for us as individuals, but for the
28+
overall community
29+
30+
Examples of unacceptable behavior include:
31+
32+
* The use of sexualized language or imagery, and sexual attention or
33+
advances of any kind
34+
* Trolling, insulting or derogatory comments, and personal or political attacks
35+
* Public or private harassment
36+
* Publishing others' private information, such as a physical or email
37+
address, without their explicit permission
38+
* Other conduct which could reasonably be considered inappropriate in a
39+
professional setting
40+
41+
## Enforcement Responsibilities
42+
43+
Community leaders are responsible for clarifying and enforcing our standards of
44+
acceptable behavior and will take appropriate and fair corrective action in
45+
response to any behavior that they deem inappropriate, threatening, offensive,
46+
or harmful.
47+
48+
Community leaders have the right and responsibility to remove, edit, or reject
49+
comments, commits, code, wiki edits, issues, and other contributions that are
50+
not aligned to this Code of Conduct, and will communicate reasons for moderation
51+
decisions when appropriate.
52+
53+
## Scope
54+
55+
This Code of Conduct applies within all community spaces, and also applies when
56+
an individual is officially representing the community in public spaces.
57+
Examples of representing our community include using an official e-mail address,
58+
posting via an official social media account, or acting as an appointed
59+
representative at an online or offline event.
60+
61+
## Enforcement
62+
63+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
64+
reported to the community leaders responsible for enforcement at
65+
info at precice.org.
66+
All complaints will be reviewed and investigated promptly and fairly.
67+
68+
All community leaders are obligated to respect the privacy and security of the
69+
reporter of any incident.
70+
71+
## Enforcement Guidelines
72+
73+
Community leaders will follow these Community Impact Guidelines in determining
74+
the consequences for any action they deem in violation of this Code of Conduct:
75+
76+
### 1. Correction
77+
78+
**Community Impact**: Use of inappropriate language or other behavior deemed
79+
unprofessional or unwelcome in the community.
80+
81+
**Consequence**: A private, written warning from community leaders, providing
82+
clarity around the nature of the violation and an explanation of why the
83+
behavior was inappropriate. A public apology may be requested.
84+
85+
### 2. Warning
86+
87+
**Community Impact**: A violation through a single incident or series
88+
of actions.
89+
90+
**Consequence**: A warning with consequences for continued behavior. No
91+
interaction with the people involved, including unsolicited interaction with
92+
those enforcing the Code of Conduct, for a specified period of time. This
93+
includes avoiding interactions in community spaces as well as external channels
94+
like social media. Violating these terms may lead to a temporary or
95+
permanent ban.
96+
97+
### 3. Temporary Ban
98+
99+
**Community Impact**: A serious violation of community standards, including
100+
sustained inappropriate behavior.
101+
102+
**Consequence**: A temporary ban from any sort of interaction or public
103+
communication with the community for a specified period of time. No public or
104+
private interaction with the people involved, including unsolicited interaction
105+
with those enforcing the Code of Conduct, is allowed during this period.
106+
Violating these terms may lead to a permanent ban.
107+
108+
### 4. Permanent Ban
109+
110+
**Community Impact**: Demonstrating a pattern of violation of community
111+
standards, including sustained inappropriate behavior, harassment of an
112+
individual, or aggression toward or disparagement of classes of individuals.
113+
114+
**Consequence**: A permanent ban from any sort of public interaction within
115+
the community.
116+
117+
## Attribution
118+
119+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
120+
version 2.0, available at
121+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
122+
123+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
124+
enforcement ladder](https://github.com/mozilla/diversity).
125+
126+
[homepage]: https://www.contributor-covenant.org
127+
128+
For answers to common questions about this code of conduct, see the FAQ at
129+
https://www.contributor-covenant.org/faq. Translations are available at
130+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Contribute to the preCICE tutorials
2+
13
It is amazing that you want to contribute a tutorial case for preCICE!
24

3-
We welcome contributions and we have a few guidelines and tips that you can follow in the [preCICE website](https://precice.org/community-contribute-to-precice.html).
5+
We welcome contributions and we have a few guidelines and tips that you can follow in the [preCICE website](https://precice.org/community-contribute-to-precice.html).

elastic-tube-1d/README.md

+27-21
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ keywords: OpenFOAM, python
55
summary: The 1D Elastic Tube is a FSI case, that consists of an internal flow in a flexible tube. The flow is unsteady and incompressible. This tutorial contains C++ and Python variants of the fluid and solid solvers. Running the simulation takes just 1-2 minutes.
66
---
77

8+
{% include note.html content="Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/elastic-tube-1d). Read how in the [tutorials introduction](https://www.precice.org/tutorials.html)." %}
89

910
## Setup
1011

1112
We want to simulate the internal flow in a flexible tube as shown in the figure below (image from [1]).
1213

1314
![FSI3 setup](images/tutorials-elastic-tube-1d-setup.png)
1415

15-
The flow is assumed to be incompressible flow and gravity is neglected. Due to the axisymmetry, the flow can be described using a quasi-two-dimensional continuity and momentum equations. The motivation and exact formulation of the equations that we consider can be found in [2].
16+
The flow is assumed to be incompressible flow and gravity is neglected. Due to the axisymmetry, the flow can be described using a quasi-two-dimensional continuity and momentum equations. The motivation and exact formulation of the equations that we consider can be found in [2].
1617

1718
The following parameters have been chosen:
19+
1820
- Length of the tube: L = 10
1921
- Inlet velocity: $$ v_{inlet} = 10 + 3 sin (10 \pi t) $$
2022
- Initial cross sectional area = 1
@@ -23,27 +25,25 @@ The following parameters have been chosen:
2325
- Fluid density: $$ \rho = 1 $$
2426
- Young modulus: E = 10000
2527

26-
2728
## Available solvers
2829

2930
Both fluid and solid participant are supported in:
3031

31-
* *C++*: An example solver using the intrinsic [C++ API of preCICE](couple-your-code-api.html). This solver also depends on LAPACK (e.g. on Ubuntu `sudo apt-get install liblapack-dev`)
32-
* *Python*: An example solver using the preCICE [Python bindings](installation-bindings-python.html). This solver also depends on the Python libraries `numpy scipy matplotlib vtk mpi4py`, which you can get from your system package manager or with `pip3 install --user <package>`.
33-
32+
- *C++*: An example solver using the intrinsic [C++ API of preCICE](https://www.precice.org/couple-your-code-api.html). This solver also depends on LAPACK (e.g. on Ubuntu `sudo apt-get install liblapack-dev`)
33+
- *Python*: An example solver using the preCICE [Python bindings](https://www.precice.org/installation-bindings-python.html). This solver also depends on the Python libraries `numpy scipy matplotlib vtk mpi4py`, which you can get from your system package manager or with `pip3 install --user <package>`.
3434

3535
### Building the C++ Solver
3636

3737
In order to use the C++ solver, you first need to build the scripts `FluidSolver` and `SolidSolver`. Each script needs to be built separately.
3838

39-
```
39+
```bash
4040
cd fluid-cpp
4141
mkdir build && cd build
4242
cmake ..
4343
make all
4444
```
4545

46-
```
46+
```bash
4747
cd solid-cpp
4848
mkdir build && cd build
4949
cmake ..
@@ -52,38 +52,43 @@ make all
5252

5353
Building can be skipped if you do not plan to use the C++ version.
5454

55-
## Running the Simulation
55+
## Running the Simulation
5656

5757
### C++
5858

59-
Open two separate terminals and start each participant by calling the respective run script.
59+
Open two separate terminals and start each participant by calling the respective run script.
6060

61-
```
61+
```bash
6262
cd fluid-cpp
6363
./run.sh
6464
```
65+
6566
and
66-
```
67+
68+
```bash
6769
cd solid-cpp
6870
./run.sh
6971
```
7072

71-
The solvers use the parameters `N = 100`, `tau = 0.01`, `kappa = 100` by default and can be modified in the solver.
73+
The solvers use the parameters `N = 100`, `tau = 0.01`, `kappa = 100` by default and can be modified in the solver.
7274

7375
### Python
7476

7577
Open two separate terminals and start each participant by calling the respective run script. Only serial run is possible:
7678

77-
```
79+
```bash
7880
cd fluid-python
7981
./run.sh
8082
```
83+
8184
and
82-
```
85+
86+
```bash
8387
cd solid-python
8488
./run.sh
8589
```
86-
Parameters such as `N` can be modified directly at the `FluidSolver.py` and at the `SolidSolver.py`. The parameters must be consistent between the different solvers and participants.
90+
91+
Parameters such as `N` can be modified directly at the `FluidSolver.py` and at the `SolidSolver.py`. The parameters must be consistent between the different solvers and participants.
8792

8893
**Optional:** Visualization and video output of the fluid participant can be triggered via the options `--enable-plot` and `--write-video` of `FluidSolver.py`. To generate .vtk files during execution, you need to add the flag `--write-vtk`.
8994

@@ -94,21 +99,27 @@ Parameters such as `N` can be modified directly at the `FluidSolver.py` and at t
9499
## Post-processing
95100

96101
The results from each simulation are stored in each `fluid-<participant>/output/` folder. You can visualize these VTK files using the provided `plot-diameter.sh` script
102+
97103
```bash
98104
./plot-diameter.sh
99105
```
106+
100107
which will try to visualize the results from both fluid cases, if available.
101108

102109
This script calls the more flexible `plot-vtk.py` Python script, which you can use as
110+
103111
```bash
104112
python3 plot-vtk.py <quantity> <case>/output/<prefix>
105113
```
114+
106115
Note the required arguments specifying which quantity to plot (`pressure`, `velocity` or `diameter`) and the name prefix of the target vtk files.
107116

108-
For example, to plot the diameter of the fluid-python case using the default prefix for VTK files, `plot-diamter.sh` executes:
117+
For example, to plot the diameter of the fluid-python case using the default prefix for VTK files, `plot-diameter.sh` executes:
118+
109119
```bash
110120
python3 plot-vtk.py diameter fluid-python/output/out_fluid_
111121
```
122+
112123
![FSI3 setup](images/tutorials-elastic-tube-1d-diameter.png)
113124

114125
## References
@@ -119,8 +130,3 @@ python3 plot-vtk.py diameter fluid-python/output/out_fluid_
119130

120131
[3] M. Mehl, B. Uekermann, H. Bijl, D. Blom, B. Gatzhammer, and A. van Zuijlen.
121132
Parallel coupling numerics for partitioned fluid-structure interaction simulations. CAMWA, 2016.
122-
123-
124-
125-
126-

elastic-tube-3d/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ keywords: FSI, OpenFOAM, CalculiX, nearest-projection, IMVJ
55
summary: Tutorial for an FSI simulation of a three-dimensional expanding tube scenario
66
---
77

8+
{% include note.html content="Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/elastic-tube-3d). Read how in the [tutorials introduction](https://www.precice.org/tutorials.html)." %}
9+
810
## Setup
911

1012
The expanding tube test case involves a cylindrical fluid domain surrounded by a solid domain. A pressure inlet boundary condition is applied at the inlet for 3 milliseconds, and then 0 set to zero for a further 7 millisecond. The pressure of the fluid expands the tube which then relaxes once the pressure decreases.
1113

12-
The expanding tube test case comes with the interface surface mesh connectivity of the solid domain. This allows the use of nearest-projection mapping of the displacements of the solid domain. In order to run the example with nearest projection mapping, the "node-mesh-with-connectivity" has been specified in the `solid-calculix/config.yml` file. More details can be found in the [CalculiX configuration description](adapter-calculix-config.html#nearest-projection-mapping).
14+
The expanding tube test case comes with the interface surface mesh connectivity of the solid domain. This allows the use of nearest-projection mapping of the displacements of the solid domain. In order to run the example with nearest projection mapping, the "node-mesh-with-connectivity" has been specified in the `solid-calculix/config.yml` file. More details can be found in the [CalculiX configuration description](https://www.precice.org/adapter-calculix-config.html#nearest-projection-mapping).
1315

1416
## Available solvers
1517

1618
Fluid participant:
1719

18-
* OpenFOAM. This tutorial is known to work with OpenFOAM 4.1, 5.0, but it should also work with newer versions. The case files are prepared for the latest versions of OpenFOAM and use the solver `pimpleFoam`. In case you are using a previous OpenFOAM version you need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](adapter-openfoam-overview.html).
20+
* OpenFOAM. This tutorial is known to work with OpenFOAM 4.1, 5.0, but it should also work with newer versions. The case files are prepared for the latest versions of OpenFOAM and use the solver `pimpleFoam`. In case you are using a previous OpenFOAM version you need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://www.precice.org/adapter-openfoam-overview.html).
1921

2022
Solid participant:
2123

22-
* CalculiX. This tutorial is known to work with CalculiX 2.15, but it should also work with newer versions. For more information, have a look at the [CalculiX adapter documentation](adapter-calculix-overview.html).
24+
* CalculiX. This tutorial is known to work with CalculiX 2.15, but it should also work with newer versions. For more information, have a look at the [CalculiX adapter documentation](https://www.precice.org/adapter-calculix-overview.html).
2325

2426
## Running the simulation
2527

0 commit comments

Comments
 (0)