Skip to content

Commit def68a0

Browse files
authored
Make preCICE export paths consistent (#510)
1 parent e1a39a9 commit def68a0

File tree

10 files changed

+15
-10
lines changed

10 files changed

+15
-10
lines changed

flow-over-heated-plate-nearest-projection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ From the preCICE point of view, the simulation here is in 3D, as opposed to the
6969
## Post-processing
7070

7171
Have a look at the [flow-over heated-plate](https://www.precice.org/tutorials-flow-over-heated-plate.html) tutorial for the general aspects of post-processing.
72-
Since we now defined mesh connectivity on our interface, we can export the coupling interface with the tag `<export:vtk directory="preCICE-output" />` in our `precice-config.xml`.
72+
Since we now defined mesh connectivity on our interface, we can export the coupling interface with the tag `<export:vtk directory="precice-exports" />` in our `precice-config.xml`.
7373
Visualizing these files (e.g. using ParaView) will show a triangular mesh, even though you use hexahedral meshes. This has nothing to do with your mesh and is just caused by the way the connectivity is defined in preCICE. As described above, the function `setMeshTriangles` is used to define the connectivity. Hence, every interface cell/face is represented by two triangles. The following image should give you an impression of a possible triangulated coupling mesh, which consists purely of hexahedral cells:
7474

7575
![triangulated](https://user-images.githubusercontent.com/33414590/55974257-96b07d80-5c87-11e9-9965-972b922c483d.png)

flow-over-heated-plate-nearest-projection/precice-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<provide-mesh name="Solid-Mesh-Centers" />
4646
<read-data name="Temperature" mesh="Solid-Mesh-Centers" />
4747
<write-data name="Heat-Flux" mesh="Solid-Mesh-Nodes" />
48-
<!-- <export:vtk directory="preCICE-output" /> -->
48+
<!-- <export:vtk directory="precice-exports" /> -->
4949
<mapping:nearest-projection
5050
direction="read"
5151
from="Fluid-Mesh-Nodes"

flow-over-heated-plate/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ First generate the output for each run by adding export to the participant `Soli
8080

8181
```xml
8282
<participant name="Solid">
83-
<export:vtk directory="preCICE-output" />
83+
<export:vtk directory="precice-exports" />
8484
<receive-mesh name="Fluid-Mesh" from="Fluid" />
8585
<provide-mesh name="Solid-Mesh" />
8686
...
8787
</participant>
8888
```
8989

90-
After that running a case from this tutorial will export data into `solid-*/preCICE-output`. To visualize and compare these results run `python3 plot-final-interface-temperature.py` (You can install the required python packages by running `pip3 install -r plot-final-interface-temperature-requirements.txt`). This will plot the dimensionless temperature `theta = (T-300)/(310-300)` (with `T` being the temperature) across the coupling interface, i.e. where the solid and the fluid meet and exchange heat. The x-axis shows the x coordinate and the y-axis the dimensionless temperature `theta` at the interface. If you want to exclude certain cases, simply comment out the corresponding lines in the script. For reference see below:
90+
After that running a case from this tutorial will export data into `solid-*/precice-exports`. To visualize and compare these results run `python3 plot-final-interface-temperature.py` (You can install the required python packages by running `pip3 install -r plot-final-interface-temperature-requirements.txt`). This will plot the dimensionless temperature `theta = (T-300)/(310-300)` (with `T` being the temperature) across the coupling interface, i.e. where the solid and the fluid meet and exchange heat. The x-axis shows the x coordinate and the y-axis the dimensionless temperature `theta` at the interface. If you want to exclude certain cases, simply comment out the corresponding lines in the script. For reference see below:
9191

9292
![Comparison of the results with different solvers](images/tutorials-flow-over-heated-plate-results-comparison.png)
9393

-1.25 KB
Loading

flow-over-heated-plate/plot-final-interface-temperature.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def vtk_to_dict(case):
7-
vtkFileName = "solid-{}/preCICE-output/Fluid-Mesh-Solid.dt100.vtk".format(case)
7+
vtkFileName = "solid-{}/precice-exports/Fluid-Mesh-Solid.dt100.vtk".format(case)
88
# read the vtk file as an unstructured grid
99
reader = vtk.vtkUnstructuredGridReader()
1010
reader.SetFileName(vtkFileName)
@@ -44,8 +44,13 @@ def vtk_to_dict(case):
4444
cases.append('fenics')
4545
cases.append('openfoam')
4646
cases.append('nutils')
47+
cases.append('dunefem')
4748

48-
case_labels = {'fenics': 'OpenFOAM-FEniCS', 'openfoam': 'OpenFOAM-OpenFOAM', 'nutils': 'OpenFOAM-Nutils', }
49+
case_labels = {
50+
'fenics': 'OpenFOAM-FEniCS',
51+
'openfoam': 'OpenFOAM-OpenFOAM',
52+
'nutils': 'OpenFOAM-Nutils',
53+
'dunefem': 'OpenFOAM-DuneFem'}
4954
styles = [':', '-', '--']
5055
colors = ['r', 'b', 'g', 'k']
5156
i = 0

flow-over-heated-plate/precice-config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
</participant>
3434

3535
<participant name="Solid">
36+
<export:vtk directory="precice-exports" />
3637
<receive-mesh name="Fluid-Mesh" from="Fluid" />
3738
<provide-mesh name="Solid-Mesh" />
3839
<mapping:nearest-neighbor

quickstart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ In serial, the simulation should take less than a minute to compute (simulated t
105105

106106
You can visualize the simulation results of the `Fluid` participant using ParaView and loading the (empty) file `fluid-openfoam/fluid-openfoam.foam`. The rigid body does not generate any readable output files, but the OpenFOAM data should be enough for now: click "play" in ParaView, the flap should already be moving! 🎉
107107

108-
You may be curious what displacements OpenFOAM received from the rigid body solver. We can actually easily visualize the coupling meshes, including the exchanged coupling data: preCICE generates the relevant files during the simulation and stores them in the directory `solid-cpp/coupling-meshes`. Load these VTK files in ParaView and apply a `Glyph` filter with `Glyph Type: Arrow`,`Orientation Array: Displacement`, and `Scale Array: No scale array`. You can further add a `Warp By Vector` filter with `Displacement` to deform the coupling data. The result should look as follows:
108+
You may be curious what displacements OpenFOAM received from the rigid body solver. We can actually easily visualize the coupling meshes, including the exchanged coupling data: preCICE generates the relevant files during the simulation and stores them in the directory `solid-cpp/precice-exports`. Load these VTK files in ParaView and apply a `Glyph` filter with `Glyph Type: Arrow`,`Orientation Array: Displacement`, and `Scale Array: No scale array`. You can further add a `Warp By Vector` filter with `Displacement` to deform the coupling data. The result should look as follows:
109109

110110
![result](images/quickstart-result.png)
111111

quickstart/precice-config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<read-data name="Force" mesh="Solid-Mesh" />
3939
<write-data name="Displacement" mesh="Solid-Mesh" />
4040
<watch-point mesh="Solid-Mesh" name="Flap-Tip" coordinate="0.25;0.0" />
41-
<export:vtk directory="coupling-meshes" />
41+
<export:vtk directory="precice-exports" />
4242
</participant>
4343

4444
<m2n:sockets acceptor="Fluid" connector="Solid" exchange-directory=".." />

quickstart/solid-cpp/clean.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ set -e -u
33

44
. ../../tools/cleaning-tools.sh
55

6-
rm -rfv coupling-meshes
76
clean_precice_logs .
87
clean_case_logs .

tools/cleaning-tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ clean_precice_logs() {
4040
./precice-*-watchintegral-*.log \
4141
./core
4242
rm -rfv ./precice-profiling/ profiling.json trace.json
43-
rm -rfv ./preCICE-output/
43+
rm -rfv ./precice-exports/
4444
)
4545
}
4646

0 commit comments

Comments
 (0)