You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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].
@@ -24,27 +25,25 @@ The following parameters have been chosen:
24
25
- Fluid density: $$ \rho = 1 $$
25
26
- Young modulus: E = 10000
26
27
27
-
28
28
## Available solvers
29
29
30
30
Both fluid and solid participant are supported in:
31
31
32
-
**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`)
33
-
**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>`.
34
-
32
+
-*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`)
33
+
-*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>`.
35
34
36
35
### Building the C++ Solver
37
36
38
37
In order to use the C++ solver, you first need to build the scripts `FluidSolver` and `SolidSolver`. Each script needs to be built separately.
39
38
40
-
```
39
+
```bash
41
40
cd fluid-cpp
42
41
mkdir build &&cd build
43
42
cmake ..
44
43
make all
45
44
```
46
45
47
-
```
46
+
```bash
48
47
cd solid-cpp
49
48
mkdir build &&cd build
50
49
cmake ..
@@ -53,38 +52,43 @@ make all
53
52
54
53
Building can be skipped if you do not plan to use the C++ version.
55
54
56
-
## Running the Simulation
55
+
## Running the Simulation
57
56
58
57
### C++
59
58
60
-
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.
61
60
62
-
```
61
+
```bash
63
62
cd fluid-cpp
64
63
./run.sh
65
64
```
65
+
66
66
and
67
-
```
67
+
68
+
```bash
68
69
cd solid-cpp
69
70
./run.sh
70
71
```
71
72
72
-
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.
73
74
74
75
### Python
75
76
76
77
Open two separate terminals and start each participant by calling the respective run script. Only serial run is possible:
77
78
78
-
```
79
+
```bash
79
80
cd fluid-python
80
81
./run.sh
81
82
```
83
+
82
84
and
83
-
```
85
+
86
+
```bash
84
87
cd solid-python
85
88
./run.sh
86
89
```
87
-
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.
88
92
89
93
**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`.
90
94
@@ -95,21 +99,27 @@ Parameters such as `N` can be modified directly at the `FluidSolver.py` and at t
95
99
## Post-processing
96
100
97
101
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
+
98
103
```bash
99
104
./plot-diameter.sh
100
105
```
106
+
101
107
which will try to visualize the results from both fluid cases, if available.
102
108
103
109
This script calls the more flexible `plot-vtk.py` Python script, which you can use as
Copy file name to clipboardExpand all lines: flow-over-heated-plate-nearest-projection/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,12 +28,14 @@ The solvers are currently only OpenFOAM related. For information regarding the n
28
28
29
29
Open two separate terminals and start each participant by calling the respective run script.
30
30
31
-
```
31
+
```bash
32
32
cd fluid-openfoam
33
33
./run.sh
34
34
```
35
+
35
36
and
36
-
```
37
+
38
+
```bash
37
39
cd solid-openfoam
38
40
./run.sh
39
41
```
@@ -45,22 +47,24 @@ You can also run OpenFOAM in parallel by `./run.sh -parallel`. If you are using
45
47
As we are defining two meshes for each participant, we need to define them in the `precice-config.xml` and `preciceDict` configuration files. Additionally, we need to enable the `connectivity` switch for the adapter.
46
48
47
49
### Changes in `precice-config.xml`
50
+
48
51
In order to map from face nodes to face centers, both meshes need to be specified. The nodes-based mesh uses the write data and the centers-based mesh uses the read data. Have a look in the given `precice-config.xml` in this tutorial. Example: `Temperature` is calculated by the `Fluid` participant and passed to the `Solid` participant. Therefore, it is the write data of the participant `Fluid` and the read data of the participant `Solid`. This results in the following two meshes for this data:
49
-
```
52
+
53
+
```xml
50
54
<meshname="Fluid-Mesh-Nodes">
51
55
<use-dataname="Temperature"/>
52
56
</mesh>
53
57
<meshname="Solid-Mesh-Centers">
54
58
<use-dataname="Temperature"/>
55
59
</mesh>
56
60
```
61
+
57
62
All further changes follow from this interface splitting. Have a look in the given config files for all details.
58
63
59
64
### Notes on 2D Cases
60
65
61
66
From the preCICE point of view, the simulation here is in 3D, as opposed to the original 2D case, as is often the case with 3D solvers (such as OpenFOAM). In such cases, we recommend keeping the out-of-plane thickness of the domain small and comparable to the in-plane cell size. Otherwise, the face centers will have a large distance to the face nodes, which might trigger a preCICE warning and preCICE may even filter out one of the meshes, especially in parallel simulations.
62
67
63
-
64
68
## Post-processing
65
69
66
70
Have a look at the [flow-over heated-plate](tutorials-flow-over-heated-plate.html) tutorial for the general aspects of post-processing.
Copy file name to clipboardExpand all lines: multiple-perpendicular-flaps/README.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ summary: In this case, a fluid and two solids are coupled together using a fully
11
11
12
12
In the following tutorial we model a fluid flowing through a channel. Two solid, elastic flaps are fixed to the floor of this channel. The flaps oscillate due to the fluid pressure building up on its surface. In this case, a fluid and two solids are coupled together using a fully-implicit multi-coupling scheme. The case setup is shown here:
The simulated flow domain is 6 units long (x) and 4 units tall (z). The flaps are clamped at the bottom (z=0) and they are 1 unit tall (z), 0.1 units long (x), and 0.3 units wide (y). Being located at x=-1 and x=1, the flaps split the domain into three equal parts.
17
17
@@ -46,49 +46,61 @@ Most of the coupling details are specified in the file `precide-config.xml`. Her
46
46
47
47
For the simulation of the solid participants we use the deal.II adapter. In deal.II, the geometry of the domain is specified directly on the solver. The two flaps in our case are essentially the same but for the x-coordinate. The flap geometry is given to the solver when we select the scenario in the '.prm' file.
48
48
49
-
```
50
-
set Scenario = PF
51
-
```
49
+
```text
50
+
set Scenario = PF
51
+
```
52
+
52
53
But to specify the position of the flap along the x-axis, we must specify it in the `Solid1/linear_elasticity.prm` file as follows:
53
54
54
-
```
55
-
set Flap location = -1.0
56
-
```
55
+
```text
56
+
set Flap location = -1.0
57
+
```
58
+
57
59
While in case of `Solid2/linear_elasticity.prm` we write:
58
60
59
-
```
60
-
set Flap location = 1.0
61
-
```
61
+
```text
62
+
set Flap location = 1.0
63
+
```
64
+
62
65
The scenario settings are implemented similarly for the nonlinear case.
63
66
64
67
## Running the Simulation
68
+
65
69
1. Preparation:
66
70
To run the coupled simulation, copy the deal.II executable `linear_elasticity` or `nonlinear_elasticity` into the main folder. To learn how to obtain the deal.II executable take a look at the description on the [deal.II-adapter page](adapter-dealii-overview.html).
67
71
2. Starting:
68
72
69
73
We are going to run each solver in a different terminal. It is important that first we navigate to the simulation directory so that all solvers start in the same directory.
70
74
To start the `Fluid` participant, run:
71
-
```
75
+
76
+
```bash
72
77
cd fluid-openfoam
73
78
./run.sh
74
79
```
80
+
75
81
to start OpenFOAM in serial or
76
-
```
82
+
83
+
```bash
77
84
cd fluid-openfoam
78
85
./run.sh -parallel
79
86
```
87
+
80
88
for a parallel run.
81
89
82
90
The solid participants are only designed for serial runs. To run the `Solid1` participant, execute the corresponding deal.II binary file e.g. by:
83
-
```
91
+
92
+
```bash
84
93
cd solid-left-dealii
85
94
./run.sh -linear
86
95
```
96
+
87
97
Finally, in the third terminal we will run the solver for the `Solid2` participant by:
88
-
```
98
+
99
+
```bash
89
100
cd solid-right-dealii
90
101
./run.sh -linear
91
102
```
103
+
92
104
In case we want to run the nonlinear case, simply replace the flag`-linear` by `-nonlinear`.
93
105
94
106
## Postprocessing
@@ -100,4 +112,3 @@ After the simulation has finished, you can visualize your results using e.g. Par
100
112
## References
101
113
102
114
[1] H. Bungartz, F. Linder, M. Mehl, B. Uekerman. A plug-and-play coupling approach for parallel multi-field simulations. 2014.
Copy file name to clipboardExpand all lines: partitioned-elastic-beam/README.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ We have a rectangular linear elastic beam of dimensions 1 x 1 x 8 m, divided in
17
17
18
18
* CalculiX. CalculiX is used for both structural parts. For more information, have a look at the [CalculiX adapter documentation](adapter-calculix-overview.html) for more.
19
19
20
-
21
20
## Running the Simulation
22
21
23
22
The prepared case already contains configuration and mesh files, so that the simulation is ready to run. You can start the simulation by running the script `./run.sh` located in each participant directory. You will see both participants of the simulation running simultaneously.
Copy file name to clipboardExpand all lines: partitioned-heat-conduction/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,21 +38,21 @@ For choosing whether you want to run the Dirichlet-kind and a Neumann-kind parti
38
38
39
39
For running the case, open two terminals run:
40
40
41
-
```
41
+
```bash
42
42
cd fenics
43
43
./run.sh -d
44
44
```
45
45
46
46
and
47
47
48
-
```
48
+
```bash
49
49
cd fenics
50
50
./run.sh -n
51
51
```
52
52
53
53
If you want to use Nutils for one or both sides of the setup, just `cd nutils`. The FEniCS case also supports parallel runs. Here, you cannot use the `run.sh` script, but must simply execute
54
54
55
-
```
55
+
```bash
56
56
mpirun -n <N_PROC> heat.py -d
57
57
```
58
58
@@ -62,7 +62,7 @@ You can mix the Nutils and FEniCS solver, if you like. Note that the error for a
62
62
63
63
## Visualization
64
64
65
-
Output is written into the folders `fenics/out` and `nutils`.
65
+
Output is written into the folders `fenics/out` and `nutils`.
66
66
67
67
For FEniCS you can visualize the content with paraview by opening the `*.pvd` files. The files `Dirichlet.pvd` and `Neumann.pvd` correspond to the numerical solution of the Dirichlet, respectively Neumann, problem, while the files with the prefix `ref` correspond to the analytical reference solution, the files with `error` show the error and the files with `ranks` the ranks of the solvers (if executed in parallel).
Copy file name to clipboardExpand all lines: partitioned-pipe/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,12 +25,14 @@ Both for Fluid1 and Fluid2, the following participants are available:
25
25
26
26
All listed solvers can be used in order to run the simulation. Open two separate terminals and start the desired fluid1 and fluid2 participants by calling the respective run script. For example:
Copy file name to clipboardExpand all lines: perpendicular-flap/README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,17 +37,19 @@ Solid participant:
37
37
38
38
All listed solvers can be used in order to run the simulation. 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:
39
39
40
-
```
40
+
```bash
41
41
cd fluid-openfoam
42
42
./run.sh
43
43
```
44
+
44
45
and
45
-
```
46
+
47
+
```bash
46
48
cd solid-fenics
47
49
./run.sh
48
50
```
49
-
in order to use OpenFOAM and FEniCS for this test case.
50
51
52
+
in order to use OpenFOAM and FEniCS for this test case.
51
53
52
54
## Post-processing
53
55
@@ -57,7 +59,6 @@ CalculiX exports results in `.frd` format, which you can visualize in CGX (`cgx
57
59
58
60
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-fenics`. The resulting graph shows the x displacement of the flap tip. You can modify the script to plot the force instead.
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.
0 commit comments