Skip to content

Commit 0d144cb

Browse files
Partitioned heat conduction (G+Smo participant) (#604)
1 parent af13a9c commit 0d144cb

11 files changed

Lines changed: 98 additions & 3 deletions

File tree

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_gismo .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e -u
3+
4+
. ../../tools/log.sh
5+
exec > >(tee --append "$LOGFILE") 2>&1
6+
7+
./partitioned-heat-conduction -s 0 -c ../precice-config.xml --plot
8+
9+
close_log
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_gismo .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e -u
3+
4+
. ../../tools/log.sh
5+
exec > >(tee --append "$LOGFILE") 2>&1
6+
7+
./partitioned-heat-conduction -s 1 -c ../precice-config.xml --plot
8+
9+
close_log

partitioned-heat-conduction-direct/precice-config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424

2525
<participant name="Dirichlet">
2626
<provide-mesh name="Dirichlet-Mesh" />
27-
<receive-mesh name="Neumann-Mesh" from="Neumann" direct-access="true" />
27+
<receive-mesh name="Neumann-Mesh" from="Neumann" api-access="true" />
2828
<write-data name="Heat-Flux" mesh="Neumann-Mesh" />
2929
<read-data name="Temperature" mesh="Dirichlet-Mesh" />
3030
</participant>
3131

3232
<participant name="Neumann">
3333
<provide-mesh name="Neumann-Mesh" />
34-
<receive-mesh name="Dirichlet-Mesh" from="Dirichlet" direct-access="true" />
34+
<receive-mesh name="Dirichlet-Mesh" from="Dirichlet" api-access="true" />
3535
<write-data name="Temperature" mesh="Dirichlet-Mesh" />
3636
<read-data name="Heat-Flux" mesh="Neumann-Mesh" />
3737
</participant>

partitioned-heat-conduction/README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Partitioned heat conduction
33
permalink: tutorials-partitioned-heat-conduction.html
4-
keywords: FEniCS, Nutils, Heat conduction
4+
keywords: FEniCS, Nutils, G+Smo, Heat conduction
55
summary: We solve a simple heat equation. The domain is partitioned and the coupling is established in a Dirichlet-Neumann fashion.
66
---
77

@@ -39,6 +39,8 @@ You can either couple a solver with itself or different solvers with each other.
3939

4040
* OpenFOAM. This case uses the custom [heatTransfer](https://github.com/precice/tutorials/blob/master/partitioned-heat-conduction/solver-openfoam/heatTransfer.C) solver (find it in `solver-openfoam` and build with `wmake`). Read more details in the [OpenFOAM adapter](https://precice.org/adapter-openfoam-overview.html).
4141

42+
* G+Smo. Install the [G+Smo adapter](https://precice.org/adapter-gismo.html).
43+
4244
## Running the simulation
4345

4446
You can find the corresponding `run.sh` script for running the case in the folders corresponding to the participant you want to use:
@@ -75,6 +77,34 @@ If you want to use Nutils or OpenFOAM, use `cd dirichlet/neumann-nutils`, respec
7577
mpirun -n <N_PROC> heat.py -d
7678
```
7779

80+
For running G+Smo, follow the [G+Smo adapter installation instructions](https://precice.org/adapter-gismo.html) to build the `partitioned-heat-conduction` example. This tutorial only requires the `gsPreCICE` submodule:
81+
82+
```bash
83+
cmake .. -DGISMO_OPTIONAL="gsPreCICE"
84+
make partitioned-heat-conduction
85+
```
86+
87+
Then link the compiled executable to the `dirichlet-gismo` and `neumann-gismo` folders:
88+
89+
```bash
90+
cd <tutorial-directory>/partitioned-heat-conduction/dirichlet-gismo
91+
ln -sf <gismo-build-directory>/bin/partitioned-heat-conduction ./partitioned-heat-conduction
92+
cd ../neumann-gismo
93+
ln -sf <gismo-build-directory>/bin/partitioned-heat-conduction ./partitioned-heat-conduction
94+
```
95+
96+
Then open two terminals and run:
97+
98+
```bash
99+
cd dirichlet-gismo
100+
./run.sh
101+
```
102+
103+
```bash
104+
cd neumann-gismo
105+
./run.sh
106+
```
107+
78108
### Note on the combination of Nutils & FEniCS
79109

80110
You can mix the Nutils and FEniCS solver, if you like. Note that the error for a pure FEniCS simulation is lower than for a mixed one. We did not yet study the origin of this error, but assume that this is due to the fact that Nutils uses Gauss points as coupling mesh and therefore entails extrapolation in the data mapping at the top and bottom corners.
@@ -87,6 +117,8 @@ For FEniCS you can visualize the content with paraview by opening the `*.pvd` fi
87117

88118
For Nutils, please use the files `Dirichlet-*.vtk` or `Neumann-*.vtk`. Please note that these files contain the temperature as well as the reference solution.
89119

120+
For G+Smo, please use the generated `solution.pvd` files in the dirichlet-gismo and neumann-gismo directories.
121+
90122
![Animation of the partitioned heat equation](images/tutorials-partitioned-heat-conduction-FEniCS-movie.gif)
91123

92124
Visualization in paraview for `x_c = 1.5`.
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_gismo .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e -u
3+
4+
. ../../tools/log.sh
5+
exec > >(tee --append "$LOGFILE") 2>&1
6+
7+
./partitioned-heat-conduction -s 0 -c ../precice-config.xml --plot
8+
9+
close_log
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_gismo .
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e -u
3+
4+
. ../../tools/log.sh
5+
exec > >(tee --append "$LOGFILE") 2>&1
6+
7+
./partitioned-heat-conduction -s 1 -c ../precice-config.xml --plot
8+
9+
close_log

0 commit comments

Comments
 (0)