Skip to content

Commit dedf5fd

Browse files
Crazy-Rich-MeghanuekermanMakisH
authored
Add perpendicular flap with stresses (incl. G+Smo participant) (#603)
* Update G+Smo solid participant elasticity file * Modified the precice-config.xml to communicate with stress instead of force * Update documentation for solid-gismo.cpp * Create solid-gismo; Modified fluid-nutils and fluid-openfoam to give stress; Modified precice-config.xml to communicate with stress * Update the README.md file for the tutorial with G+Smo * Updated README.md; Uploaded Mesh convergence test and plots * Update README.md * Clean up * Update Setup in README.md * Recover modified file by mistake * Update clean.sh * Update README.md; added clean_gismo in tools.sh; update run and clean scripts * Update perpendicular-flap-stress/README.md Co-authored-by: Benjamin Uekermann <benjamin.uekermann@gmail.com> * Update file name * Delete image folder * Extend and enable cleaning scripts * Fix preCICE and adapter config * Add plotting script * Redo README * Rename gismo subfolder and delete cpp * Really delete cpp * Specify G#Smo solver * Update Post-processing (plotting) * Added visualization for precice config; add tip-displacement * Rename * Update README.md * Update perpendicular-flap-stress/plot-displacement.sh * Update perpendicular-flap-stress/README.md * Update perpendicular-flap-stress/README.md * Make gismo run script executable * Fixed the comparison with other solvers * Remove unused image, re-order README * Update tools/cleaning-tools.sh Co-authored-by: Benjamin Uekermann <benjamin.uekermann@gmail.com> * Update images * Update perpendicular-flap-stress/README.md Co-authored-by: Gerasimos Chourdakis <gerasimos.chourdakis@ipvs.uni-stuttgart.de> * Replace explicit clean tutorial script with link --------- Co-authored-by: Benjamin Uekermann <benjamin.uekermann@gmail.com> Co-authored-by: Benjamin Uekermann <benjamin.uekermann@ipvs.uni-stuttgart.de> Co-authored-by: Gerasimos Chourdakis <gerasimos.chourdakis@ipvs.uni-stuttgart.de>
1 parent dd1b840 commit dedf5fd

24 files changed

Lines changed: 769 additions & 5 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Perpendicular flap with stresses
3+
permalink: tutorials-perpendicular-flap-stresses.html
4+
keywords: G+Smo, fluid-structure interaction, FSI, OpenFOAM
5+
summary: This tutorial is a modified version of the “perpendicular flap” tutorial using stresses instead of forces.
6+
---
7+
8+
{% note %}
9+
Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/perpendicular-flap-stresses). Read how in the [tutorials introduction](https://precice.org/tutorials.html).
10+
{% endnote %}
11+
12+
## Setup
13+
14+
The scenario is exactly the same as the one described in the [perpendicular flap tutorial](https://precice.org/tutorials-perpendicular-flap.html). The only difference is that we use stresses instead of forces as data sent from the fluid to the solid participant. This requires changing the mapping constraint from conservative (forces) to consistent (stresses). To avoid a "write-consistent" combination, which [cannot be used in parallel](ttps://precice.org/configuration-mapping.html#restrictions-for-parallel-participants), we exchange both meshes.
15+
16+
## Configuration
17+
18+
preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)):
19+
20+
![preCICE configuration visualization](images/tutorials-perpendicular-flap-stress-precice-config.png)
21+
22+
## Available solvers
23+
24+
Fluid participant:
25+
26+
* OpenFOAM (pimpleFoam). In case you are using a very old OpenFOAM version, you will 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://precice.org/adapter-openfoam-overview.html).
27+
28+
Solid participant:
29+
30+
* G+Smo (perpendicular-flap-vertex-gismo). This solver includes both linear and nonlinear versions of the Newmark time integrator for time-dependent structural problems. The linear version iterates using a constant stiffness matrix. The nonlinear version iterates using an updated Jacobian matrix to account for material or geometric nonlinearity. By default, the solver runs in linear mode. To switch to nonlinear mode, add `--nonlinear` as option in `run.sh`. For more information, have a look at the [G+Smo adapter documentation](https://precice.org/adapter-gismo-overview.html).
31+
32+
## Running the simulation
33+
34+
Open two separate terminals and start the desired fluid and solid participants by calling the respective run scripts `run.sh` located in the participants' directories. For example:
35+
36+
```bash
37+
cd fluid-openfoam
38+
./run.sh
39+
```
40+
41+
and
42+
43+
```bash
44+
cd solid-gismo
45+
./run.sh
46+
```
47+
48+
## Post-processing
49+
50+
On the OpenFOAM side, you can open the `.foam` file with ParaView, or create VTK files with `foamToVTK`.
51+
52+
On the G+Smo side, you can open the `.pvd` file located in the `solid-gismo/output` folder using ParaView. If you prefer not to plot the simulation, simply edit the `run.sh` script and remove the `--plot` option.
53+
54+
As we defined a watchpoint on the 'Solid' participant at the flap tip (see `precice-config.xml`), we can plot it with gnuplot using the script `plot-displacement.sh.` You need to specify the directory of the selected solid participant as a command line argument, so that the script can pick-up the desired watchpoint file, e.g. `plot-displacement.sh solid-gismo`. The resulting graph shows the x displacement of the flap tip. You can modify the script to plot the force instead.
55+
56+
![Flap watchpoint](images/tutorials-perpendicular-flap-stress-displacement-watchpoint.png)
57+
58+
{% disclaimer %}
59+
This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
60+
{% enddisclaimer %}
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class volVectorField;
6+
object U;
7+
}
8+
9+
dimensions [0 1 -1 0 0 0 0];
10+
11+
internalField uniform (10 0 0);
12+
13+
boundaryField
14+
{
15+
inlet
16+
{
17+
type fixedValue;
18+
value $internalField;
19+
}
20+
outlet
21+
{
22+
type zeroGradient;
23+
}
24+
flap
25+
{
26+
type movingWallVelocity;
27+
value uniform (0 0 0);
28+
}
29+
upperWall
30+
{
31+
type noSlip;
32+
}
33+
lowerWall
34+
{
35+
type noSlip;
36+
}
37+
frontAndBack
38+
{
39+
type empty;
40+
}
41+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class volScalarField;
6+
object p;
7+
}
8+
9+
dimensions [0 2 -2 0 0 0 0];
10+
11+
internalField uniform 0;
12+
13+
boundaryField
14+
{
15+
inlet
16+
{
17+
type zeroGradient;
18+
}
19+
20+
outlet
21+
{
22+
type fixedValue;
23+
value uniform 0;
24+
}
25+
26+
flap
27+
{
28+
type zeroGradient;
29+
}
30+
31+
upperWall
32+
{
33+
type zeroGradient;
34+
}
35+
36+
lowerWall
37+
{
38+
type zeroGradient;
39+
}
40+
41+
frontAndBack
42+
{
43+
type empty;
44+
}
45+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class surfaceScalarField;
6+
object phi;
7+
}
8+
9+
dimensions [0 3 -1 0 0 0 0];
10+
11+
internalField uniform 0;
12+
boundaryField
13+
{
14+
inlet
15+
{
16+
type calculated;
17+
value $internalField;
18+
}
19+
outlet
20+
{
21+
type calculated;
22+
value $internalField;
23+
}
24+
flap
25+
{
26+
type calculated;
27+
value uniform 0;
28+
}
29+
upperWall
30+
{
31+
type calculated;
32+
value uniform 0;
33+
}
34+
lowerWall
35+
{
36+
type calculated;
37+
value uniform 0;
38+
}
39+
frontAndBack
40+
{
41+
type empty;
42+
value nonuniform 0;
43+
}
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class pointVectorField;
6+
object pointDisplacement;
7+
}
8+
9+
dimensions [0 1 0 0 0 0 0];
10+
11+
internalField uniform (0 0 0);
12+
13+
boundaryField
14+
{
15+
inlet
16+
{
17+
type fixedValue;
18+
value uniform (0 0 0);
19+
}
20+
21+
outlet
22+
{
23+
type fixedValue;
24+
value uniform (0 0 0);
25+
}
26+
27+
flap
28+
{
29+
type fixedValue;
30+
value $internalField;
31+
}
32+
33+
upperWall
34+
{
35+
type slip;
36+
}
37+
38+
lowerWall
39+
{
40+
type slip;
41+
}
42+
43+
frontAndBack
44+
{
45+
type empty;
46+
}
47+
}
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_openfoam .
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class dictionary;
6+
object dynamicMeshDict;
7+
}
8+
9+
dynamicFvMesh dynamicMotionSolverFvMesh;
10+
11+
motionSolverLibs ("libfvMotionSolvers.so");
12+
13+
solver displacementLaplacian;
14+
// OpenFOAM9 or newer: rename "solver" to "motionSolver"
15+
16+
displacementLaplacianCoeffs {
17+
diffusivity quadratic inverseDistance (flap);
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class dictionary;
6+
object transportProperties;
7+
}
8+
9+
transportModel Newtonian;
10+
11+
nu nu [ 0 2 -1 0 0 0 0 ] 1;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FoamFile
2+
{
3+
version 2.0;
4+
format ascii;
5+
class dictionary;
6+
object turbulenceProperties;
7+
}
8+
9+
simulationType laminar;

0 commit comments

Comments
 (0)