Skip to content

Commit a644a6b

Browse files
authored
Add more watchpoint plots and source files (#507)
1 parent 062f040 commit a644a6b

10 files changed

+118
-29
lines changed

perpendicular-flap/README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Fluid participant:
2323

2424
* 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://www.precice.org/adapter-openfoam-overview.html).
2525

26-
* Nutils. For more information, have a look at the [Nutils adapter documentation](https://www.precice.org/adapter-nutils.html). This Nutils solver requires at least Nutils v6.0.
27-
2826
* SU2. As opposed to the other two fluid codes, SU2 is in particular specialized for compressible flow. Therefore the default simulation parameters haven been adjusted in order to pull the setup into the compressible flow regime. For more information, have a look at the [SU2 adapter documentation](https://www.precice.org/adapter-su2-overview.html).
2927

28+
* Nutils. For more information, have a look at the [Nutils adapter documentation](https://www.precice.org/adapter-nutils.html). This Nutils solver requires at least Nutils v6.0. This case currently takes orders of magnitude longer than the OpenFOAM and SU2 cases, see [related issue](https://github.com/precice/tutorials/issues/506).
29+
3030
* Fake. A simple python script that acts as a fake solver and provides an arbitrary force, linearly-increasing per length of the flap. This solver can be used for debugging of the solid participant and its adapter. It also technically works with implicit coupling, thus no changes to the preCICE configuration are necessary. Note that [ASTE's replay mode](https://precice.org/tooling-aste.html#replay-mode) has a similar use case and could also feed artificial or previously recorded real data, replacing an actual solver.
3131

3232
Solid participant:
@@ -41,10 +41,10 @@ Solid participant:
4141

4242
* Nutils. The structural model is currently limited to linear elasticity. For more information, have a look at the [Nutils adapter documentation](https://www.precice.org/adapter-nutils.html). This Nutils solver requires at least Nutils v8.0.
4343

44-
* OpenFOAM (solidDisplacementFoam). For more information, have a look at the [OpenFOAM plateHole tutorial](https://www.openfoam.com/documentation/tutorial-guide/5-stress-analysis/5.1-stress-analysis-of-a-plate-with-a-hole). The solidDisplacementFoam solver only supports linear geometry. For general solid mechanics procedures in OpenFOAM, see solids4foam.
45-
4644
* solids4foam. Like for CalculiX, the geometrically non-linear solver is used by default. For more information, see the [solids4foam documentation](https://solids4foam.github.io/documentation/overview.html) and a [related tutorial](https://solids4foam.github.io/tutorials/more-tutorials/flexibleOversetCylinder.html). This case works with solids4foam v2.0, which is compatible with up to OpenFOAM v2012 and OpenFOAM 9 (as well as foam-extend, with which the OpenFOAM-preCICE adapter is not compatible), as well as the OpenFOAM-preCICE adapter v1.2.0 or later.
4745

46+
* OpenFOAM (solidDisplacementFoam). For more information, have a look at the [OpenFOAM plateHole tutorial](https://www.openfoam.com/documentation/tutorial-guide/5-stress-analysis/5.1-stress-analysis-of-a-plate-with-a-hole). The solidDisplacementFoam solver only supports linear geometry and this case is only provided for quick testing purposes, leading to outlier results. For general solid mechanics procedures in OpenFOAM, see solids4foam.
47+
4848
## Running the Simulation
4949

5050
All listed solvers can be used in order to run the simulation. OpenFOAM can be executed in parallel using `run.sh -parallel`. The default setting uses 4 MPI ranks. Open two separate terminals and start the desired fluid and solid participant by calling the respective run script `run.sh` located in the participant directory. For example:
@@ -73,17 +73,41 @@ As we defined a watchpoint on the 'Solid' participant at the flap tip (see `prec
7373

7474
![Flap watchpoint](images/tutorials-perpendicular-flap-displacement-watchpoint.png)
7575

76-
There is moreover a script `plot-all-displacements.sh` to plot and compare all possible variants. This script expects all watchpoint logs to be available in a subfolder `watchpoints` in the format `openfoam-dealii.log` or similar. If you want to use this script, you need to copy the files over accordingly.
76+
There is moreover a script `plot-all-displacements.sh` to plot and compare all possible variants. This script expects all watchpoint logs to be available in a subfolder `watchpoints` in the format `openfoam-dealii-version.log` or similar. If you want to use this script, you need to edit it to exclude combinations you want to exclude and copy the files over accordingly.
7777

7878
You should get results similar to this one:
7979

80-
![All flap watchpoints](images/tutorials-perpendicular-flap-displacement-all-watchpoints.png)
80+
![Selected flap watchpoints](images/tutorials-perpendicular-flap-displacement-selected-watchpoints.png)
8181

8282
Reasons for the differences:
8383

8484
* The CalculiX adapter only supports linear finite elements (deal.II uses 4th order, FEniCS 2nd order).
8585
* SU2 models a compressible fluid, OpenFOAM and Nutils an incompressible one.
8686

87+
### Looking closer
88+
89+
Excluding the `solid-openfoam` (outlier, provided mainly for technical testing), let's look at an overview of different combinations.
90+
91+
Comparison of the different flow solvers (incompressible `fluid-openfoam` and `fluid-nutils`, compressible `fluid-su2`, dummy `fluid-fake`):
92+
93+
![Flap watchpoints using solid-calculix](images/tutorials-perpendicular-flap-displacement-flow-comparison-watchpoints.png)
94+
95+
Combinations using the incompressible `fluid-openfoam` case:
96+
97+
![Flap watchpoints using fluid-openfoam](images/tutorials-perpendicular-flap-displacement-openfoam-watchpoints.png)
98+
99+
Combinations (excerpt) using the incompressible `fluid-nutils` case:
100+
101+
![Flap watchpoints using fluid-nutils](images/tutorials-perpendicular-flap-displacement-nutils-watchpoints.png)
102+
103+
Combinations (excerpt) using the compressible `fluid-su2` case:
104+
105+
![Flap watchpoints using fluid-su2](images/tutorials-perpendicular-flap-displacement-su2-watchpoints.png)
106+
107+
Combinations (excerpt) using the dummy `fluid-fake` case:
108+
109+
![Flap watchpoints using fluid-fake](images/tutorials-perpendicular-flap-displacement-fake-watchpoints.png)
110+
87111
{% disclaimer %}
88112
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.
89113
{% enddisclaimer %}
Binary file not shown.
96.7 KB
Loading
93.7 KB
Loading
104 KB
Loading
108 KB
Loading
111 KB
Loading
94.1 KB
Loading

perpendicular-flap/plot-all-displacements.sh

Lines changed: 85 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,94 @@
1616
#
1717
# If you are only interested in a subset of combinations, remove the respective lines.
1818

19+
WATCHPOINTS_DIR="./reference-results/watchpoints/"
20+
21+
gnuplot -p << EOF
22+
set grid
23+
set title 'x-displacement of the flap tip (selected combinations)'
24+
set xlabel 'time [s]'
25+
set ylabel 'x-displacement [m]'
26+
set term pngcairo enhanced size 900,654
27+
set output "images/tutorials-perpendicular-flap-displacement-selected-watchpoints.png"
28+
plot "${WATCHPOINTS_DIR}/openfoam-calculix-v2404.log" using 1:4 with lines title "OpenFOAM-CalculiX", \
29+
"${WATCHPOINTS_DIR}/openfoam-dealii-v2404.log" using 1:4 with lines title "OpenFOAM-deal.II", \
30+
"${WATCHPOINTS_DIR}/openfoam-fenics-v2404.log" using 1:4 with lines title "OpenFOAM-FEniCS", \
31+
"${WATCHPOINTS_DIR}/su2-calculix-v2404.log" using 1:4 with lines title "SU2-CalculiX", \
32+
"${WATCHPOINTS_DIR}/su2-dealii-v2404.log" using 1:4 with lines title "SU2-deal.II", \
33+
"${WATCHPOINTS_DIR}/su2-fenics-v2404.log" using 1:4 with lines title "SU2-FEniCS", \
34+
"${WATCHPOINTS_DIR}/nutils-calculix-v2404.log" using 1:4 with lines title "Nutils-CalculiX", \
35+
"${WATCHPOINTS_DIR}/nutils-dealii-v2404.log" using 1:4 with lines title "Nutils-deal.II"
36+
EOF
37+
38+
gnuplot -p << EOF
39+
set grid
40+
set title 'x-displacement of the flap tip (comparison of flow solvers)'
41+
set xlabel 'time [s]'
42+
set ylabel 'x-displacement [m]'
43+
set term pngcairo enhanced size 900,654
44+
set output "images/tutorials-perpendicular-flap-displacement-flow-comparison-watchpoints.png"
45+
plot "${WATCHPOINTS_DIR}/openfoam-calculix-v2404.log" using 1:4 with lines title "OpenFOAM-CalculiX", \
46+
"${WATCHPOINTS_DIR}/su2-calculix-v2404.log" using 1:4 with lines title "SU2-CalculiX", \
47+
"${WATCHPOINTS_DIR}/nutils-calculix-v2404.log" using 1:4 with lines title "Nutils-CalculiX", \
48+
"${WATCHPOINTS_DIR}/fake-calculix-v2404.log" using 1:4 with lines title "fake-CalculiX"
49+
EOF
50+
51+
gnuplot -p << EOF
52+
set grid
53+
set title 'x-displacement of the flap tip (incompressible flow with OpenFOAM)'
54+
set xlabel 'time [s]'
55+
set ylabel 'x-displacement [m]'
56+
set term pngcairo enhanced size 900,654
57+
set output "images/tutorials-perpendicular-flap-displacement-openfoam-watchpoints.png"
58+
plot "${WATCHPOINTS_DIR}/openfoam-calculix-v2404.log" using 1:4 with lines title "OpenFOAM-CalculiX", \
59+
"${WATCHPOINTS_DIR}/openfoam-dealii-v2404.log" using 1:4 with lines title "OpenFOAM-deal.II", \
60+
"${WATCHPOINTS_DIR}/openfoam-dune-v2404.log" using 1:4 with lines title "OpenFOAM-DUNE", \
61+
"${WATCHPOINTS_DIR}/openfoam-fenics-v2404.log" using 1:4 with lines title "OpenFOAM-FEniCS", \
62+
"${WATCHPOINTS_DIR}/openfoam-nutils-v2404.log" using 1:4 with lines title "OpenFOAM-Nutils", \
63+
"${WATCHPOINTS_DIR}/openfoam-solids4foam-v2404.log" using 1:4 with lines title "OpenFOAM-solids4Foam"
64+
EOF
65+
66+
gnuplot -p << EOF
67+
set grid
68+
set title 'x-displacement of the flap tip (compressible flow with SU2)'
69+
set xlabel 'time [s]'
70+
set ylabel 'x-displacement [m]'
71+
set term pngcairo enhanced size 900,654
72+
set output "images/tutorials-perpendicular-flap-displacement-su2-watchpoints.png"
73+
plot "${WATCHPOINTS_DIR}/su2-calculix-v2404.log" using 1:4 with lines title "SU2-CalculiX", \
74+
"${WATCHPOINTS_DIR}/su2-dealii-v2404.log" using 1:4 with lines title "SU2-deal.II", \
75+
"${WATCHPOINTS_DIR}/su2-dune-v2404.log" using 1:4 with lines title "SU2-DUNE", \
76+
"${WATCHPOINTS_DIR}/su2-fenics-v2404.log" using 1:4 with lines title "SU2-FEniCS", \
77+
"${WATCHPOINTS_DIR}/su2-nutils-v2404.log" using 1:4 with lines title "SU2-nutils", \
78+
"${WATCHPOINTS_DIR}/su2-solids4foam-v2404.log" using 1:4 with lines title "SU2-solids4Foam"
79+
EOF
80+
81+
gnuplot -p << EOF
82+
set grid
83+
set title 'x-displacement of the flap tip (incompressible flow with Nutils)'
84+
set xlabel 'time [s]'
85+
set ylabel 'x-displacement [m]'
86+
set term pngcairo enhanced size 900,654
87+
set output "images/tutorials-perpendicular-flap-displacement-nutils-watchpoints.png"
88+
plot "${WATCHPOINTS_DIR}/nutils-calculix-v2404.log" using 1:4 with lines title "Nutils-CalculiX", \
89+
"${WATCHPOINTS_DIR}/nutils-dealii-v2404.log" using 1:4 with lines title "Nutils-deal.II", \
90+
"${WATCHPOINTS_DIR}/nutils-dune-v2404.log" using 1:4 with lines title "Nutils-DUNE", \
91+
"${WATCHPOINTS_DIR}/nutils-fenics-v2404.log" using 1:4 with lines title "Nutils-FEniCS", \
92+
"${WATCHPOINTS_DIR}/nutils-nutils-v2404.log" using 1:4 with lines title "Nutils-Nutils", \
93+
"${WATCHPOINTS_DIR}/nutils-solids4foam-v2404.log" using 1:4 with lines title "Nutils-solids4Foam"
94+
EOF
95+
1996
gnuplot -p << EOF
2097
set grid
21-
set title 'x-displacement of the flap tip'
98+
set title 'x-displacement of the flap tip (dummy force data with fluid-fake)'
2299
set xlabel 'time [s]'
23100
set ylabel 'x-displacement [m]'
24101
set term pngcairo enhanced size 900,654
25-
set output "images/tutorials-perpendicular-flap-displacement-all-watchpoints.png"
26-
plot "watchpoints/openfoam-calculix.log" using 1:4 with lines title "OpenFOAM-CalculiX", \
27-
"watchpoints/openfoam-dealii.log" using 1:4 with lines title "OpenFOAM-deal.II", \
28-
"watchpoints/openfoam-fenics.log" using 1:4 with lines title "OpenFOAM-FEniCS", \
29-
"watchpoints/openfoam-dune.log" using 1:4 with lines title "OpenFOAM-DUNE", \
30-
"watchpoints/openfoam-openfoam.log" using 1:4 with lines title "OpenFOAM-OpenFOAM", \
31-
"watchpoints/openfoam-solids4foam.log" using 1:4 with lines title "OpenFOAM-solids4Foam", \
32-
"watchpoints/openfoam-nutils.log" using 1:4 with lines title "OpenFOAM-Nutils", \
33-
"watchpoints/su2-calculix.log" using 1:4 with lines title "SU2-CalculiX", \
34-
"watchpoints/su2-dealii.log" using 1:4 with lines title "SU2-deal.II", \
35-
"watchpoints/su2-fenics.log" using 1:4 with lines title "SU2-FEniCS", \
36-
"watchpoints/su2-dune.log" using 1:4 with lines title "SU2-DUNE", \
37-
"watchpoints/su2-openfoam.log" using 1:4 with lines title "SU2-OpenFOAM", \
38-
"watchpoints/su2-solids4foam.log" using 1:4 with lines title "SU2-solids4Foam", \
39-
"watchpoints/su2-nutils.log" using 1:4 with lines title "SU2-nutils", \
40-
"watchpoints/nutils-calculix.log" using 1:4 with lines title "Nutils-CalculiX", \
41-
"watchpoints/nutils-dealii.log" using 1:4 with lines title "Nutils-deal.II", \
42-
"watchpoints/nutils-fenics.log" using 1:4 with lines title "Nutils-FEniCS", \
43-
"watchpoints/nutils-dune.log" using 1:4 with lines title "Nutils-DUNE", \
44-
"watchpoints/nutils-openfoam.log" using 1:4 with lines title "Nutils-OpenFOAM", \
45-
"watchpoints/nutils-solids4foam.log" using 1:4 with lines title "Nutils-solids4Foam", \
46-
"watchpoints/nutils-nutils.log" using 1:4 with lines title "Nutils-Nutils"
102+
set output "images/tutorials-perpendicular-flap-displacement-fake-watchpoints.png"
103+
plot "${WATCHPOINTS_DIR}/fake-calculix-v2404.log" using 1:4 with lines title "fake-CalculiX", \
104+
"${WATCHPOINTS_DIR}/fake-dealii-v2404.log" using 1:4 with lines title "fake-deal.II", \
105+
"${WATCHPOINTS_DIR}/fake-dune-v2404.log" using 1:4 with lines title "fake-DUNE", \
106+
"${WATCHPOINTS_DIR}/fake-fenics-v2404.log" using 1:4 with lines title "fake-FEniCS", \
107+
"${WATCHPOINTS_DIR}/fake-nutils-v2404.log" using 1:4 with lines title "fake-Nutils", \
108+
"${WATCHPOINTS_DIR}/fake-solids4foam-v2404.log" using 1:4 with lines title "fake-solids4Foam"
47109
EOF
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:f117eb1c0c1dcaa921442550533db8dc5077c45eb6632ede2b341470814d193c
3+
size 337608

0 commit comments

Comments
 (0)