Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eafa4fb
Add default argument values to the Dockerfile
MakisH Oct 24, 2026
24f1780
Add OpenCourant to the Dockerfile
MakisH Oct 24, 2026
c9ad096
Migrate pulsating-flow-over-flexible-flap-case1 from openradioss-cases
MakisH Oct 28, 2026
ce0e426
Add and update setup-openradioss.sh
MakisH Nov 11, 2026
e5bcb91
Increase the numberOfSudomains to 8
MakisH Nov 11, 2026
5efe352
Remove unrelated changes from Dockerfile
MakisH Nov 11, 2026
046b39d
Adjust comments in OpenFOAM dict files
MakisH Nov 11, 2026
08993d2
Modify setup-openradioss.sh to be consistent with the Dockerfile
MakisH Nov 11, 2026
a0df207
Add plot-displacement.sh
MakisH Nov 11, 2026
e14d06d
Update README.md, add reference pictures
MakisH Nov 11, 2026
48acd93
Add the tutorial to the system tests
MakisH Nov 11, 2026
1cc44c8
Fix component name
MakisH Nov 11, 2026
6af19e1
Fix paths in the Dockerfile
MakisH Nov 11, 2026
db07379
Fix path in the Dockerfile
MakisH Nov 11, 2026
797e72c
Make toVTK optional
MakisH Nov 11, 2026
daa94e9
Add reference version
MakisH Nov 11, 2026
ba3511a
Remove hard-coded export
MakisH Nov 11, 2026
6a5db69
Add changelog entry
MakisH Nov 11, 2026
c39b1d6
Move openradioss test from extra to nightly
MakisH Nov 11, 2026
4a45559
Add reference results for perpendicular-flap-3d_fluid-openfoam_solid-…
Nov 11, 2026
8ca7ba7
Pin the OpenCourant version
MakisH Nov 11, 2026
ce6c7cc
Relax the comparison tolerance
MakisH Nov 11, 2026
2037df5
Set tolerance to 1e-2
MakisH Nov 11, 2026
ec0af1a
Skip the comparison entirely
MakisH Nov 11, 2026
145955c
Remove another hardcoded vtk export node
MakisH Nov 11, 2026
954f16f
Merge branch 'develop' into openradioss
MakisH Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog-entries/947.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added a new tutorial perpendicular-flap-3d, with OpenFOAM and OpenRadioss (OpenCourant) [#947](https://github.com/precice/tutorials/pull/947)
85 changes: 85 additions & 0 deletions perpendicular-flap-3d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Perpendicular flap 3D
permalink: tutorials-perpendicular-flap-3d.html
aliases:
- /tutorials-perpendicular-flap-3d.html
keywords: fluid-structure interaction, FSI, OpenFOAM, OpenRadioss, OpenCourant
summary: This tutorial describes how to run a 3D fluid-structure interaction using OpenFOAM and OpenRadioss.
---

{% note %}
Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/develop/perpendicular-flap-3d), as continuously rendered here, or see the [latest released version](https://github.com/precice/tutorials/tree/master/perpendicular-flap-3d) (if there is already one). Read how in the [tutorials introduction](https://precice.org/tutorials.html).
{% endnote %}

## Setup

This tutorial is derived from the "Pulsating flow over flexible flap" test case discussed in the [OpenFOAM-preCICE paper](https://doi.org/10.51560/ofj.v3.88) (comparing to a [benchmark from the literature](https://doi.org/10.1002/nme.6072)),
and it was originally designed to validate OpenRadioss as a solid participant in fluid-structure interaction.
In contrast to the discussed case, this is using an explicit coupling scheme with a smaller coupling time window / solver time step.

Overall, this tutorial consists of a 3D flow channel with an elastic flap perpendicular to the flow, anchored from the bottom. The inlet velocity oscillates over time, and the flap deforms in all dimensions.

## Configuration

preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)):

![preCICE configuration visualization](images/tutorials-perpendicular-flap-3d-precice-config.png)

## Available solvers

Fluid participant:

* OpenFOAM (pimpleFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html). This tutorial needs the OpenFOAM adapter v1.4.0 or later.

Solid participant:

* OpenRadioss. While [OpenRadioss is no longer maintained](https://en.wikipedia.org/wiki/Radioss), the community fork [OpenCourant](https://opencourant.org/) is actively maintained and works with this tutorial. OpenCourant needs to [be built with preCICE enabled](https://github.com/OpenCourant/OpenCourant/tree/main/engine/source/coupling).
In addition to the `starter` and `engine`, you will need to build the [`anim_to_vtk` tool](https://github.com/OpenCourant/Tools/tree/main/output_converters/anim_to_vtk).

## Mesh Configuration

The test case implemented within this repository implements what the [OpenFOAM-preCICE paper](https://doi.org/10.51560/ofj.v3.88) refers to as `coarse` mesh:
The OpenRadioss `Solid` domain is discretized with 48 `HEX20` solid elements, arranged with a 2 x 4 x 6 cell resolution along the three spatial directions.

## Running 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:

```sh
# Terminal 1
cd fluid-openfoam -parallel
./run.sh

# Terminal 2
cd solid-openradioss
./run.sh
```

The scripts rely on tools found in `../tools/`.

OpenFOAM can be executed in parallel using `run.sh -parallel`.
The default setting uses 8 MPI ranks, but you can increase the number of subdomains in `system/decomposeParDict`.
Since this case takes a long time to complete, you probably want to run the fluid case in parallel.

## Post-processing

OpenCourant (same as OpenRadioss) writes `.anim` files, which can be converted to VTK using the [`anim_to_vtk` tool](https://github.com/OpenCourant/Tools/tree/main/output_converters/anim_to_vtk) tool. This tool can be called (commented out by default) at the end of `solid-openradioss/run.sh` using the alias `toVTK`, defined in `tools/setup-openradioss.sh`.

OpenFOAM results can directly be loaded in ParaView ([visualization details](https://precice.org/tutorials/visualization/)).

At `t=2.5 s`, the flap should deform as follows:

![Surface plot of velocity](./images/tutorials-perpendicular-flap-3d-surface.png)

Two watchpoints are defined: one in the center of the flap, and one on its left tip. These can be visualized using the provided gnuplot script:

```shell
./plot-displacement.sh solid-openradioss
```

Expected results for the two watchpoints (left and center of the flap):

![Left watchpoint plot](./images/tutorials-perpendicular-flap-3d-watchpoint-left.png)
![Central watchpoint plot](./images/tutorials-perpendicular-flap-3d-watchpoint-center.png)

Detailed results can be found in the [`openradioss-cases` repository](https://github.com/elisa-santoro/openradioss-cases) and in the [Master's thesis of Elisa Santoro](https://webthesis.biblio.polito.it/id/eprint/40822).
1 change: 1 addition & 0 deletions perpendicular-flap-3d/clean-tutorial.sh
82 changes: 82 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/0/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type codedFixedValue;
value uniform (0 0 0);
name timeVaryingParabolic;

code
#{
const vectorField& Cf = patch().Cf(); // face centres
const vectorField& n = patch().nf(); // face normals (unit normals)
vectorField& field = *this;

const scalar pi = constant::mathematical::pi;
const scalar t = this->db().time().value();

forAll(Cf, faceI)
{
const scalar y = Cf[faceI].y();
const scalar z = Cf[faceI].z();

// Equivalent of:
// para = -2*((2500/81)*y*(y-0.6)*(z+0.6)*(z-0.6))*normal();

const scalar poly =
-2.0 * (2500.0/81.0)
* y * (y - 0.6)
* (z + 0.6)
* (z - 0.6);

vector para = poly * n[faceI];

if (t < 10.0)
{
scalar ramp = 0.5 * (1.0 - cos(pi * t));
field[faceI] = ramp * para;
}
else
{
field[faceI] = vector::zero;
}
}
#};
}

outlet
{
type zeroGradient;
}
flap
{
type movingWallVelocity;
value uniform (0 0 0);
}
upperWall
{
type noSlip;
}
lowerWall
{
type noSlip;
}
frontAndBack
{
type noSlip;
}
}
46 changes: 46 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/0/p
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

flap
{
type zeroGradient;
}

upperWall
{
type zeroGradient;
}

lowerWall
{
type zeroGradient;
}

frontAndBack
{
type zeroGradient;
}
}
46 changes: 46 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/0/phi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "0";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 3 -1 0 0 0 0];

internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
flap
{
type calculated;
value uniform 0;
}
upperWall
{
type calculated;
value uniform 0;
}
lowerWall
{
type calculated;
value uniform 0;
}
frontAndBack
{
type calculated;
value uniform 0;
}
}
50 changes: 50 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/0/pointDisplacement
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 0 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0);
}

outlet
{
type fixedValue;
value uniform (0 0 0);
}

flap
{
type fixedValue;
value $internalField;
}

upperWall
{
type slip;
}

lowerWall
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBack
{
type fixedValue;
value uniform (0 0 0);
}
}
6 changes: 6 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e -u

. ../../tools/cleaning-tools.sh

clean_openfoam .
22 changes: 22 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/constant/dynamicMeshDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver displacementLaplacian;

displacementLaplacianCoeffs {

diffusivity quadratic inverseDistance (flap);

}
13 changes: 13 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/constant/transportProperties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 0.01;
11 changes: 11 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/constant/turbulenceProperties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType laminar;
12 changes: 12 additions & 0 deletions perpendicular-flap-3d/fluid-openfoam/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e -u

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

blockMesh

../../tools/run-openfoam.sh "$@"
. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs

close_log
Loading
Loading