|
| 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 | + |
| 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 | + |
| 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 %} |
0 commit comments